chore: use re-exports for clean theme types

This commit is contained in:
Matias Fontanini 2025-02-20 16:15:12 -08:00
parent 8a806d76a1
commit fa4d862834
15 changed files with 15 additions and 19 deletions

View File

@ -4,7 +4,7 @@ use crate::{
elements::{Line, Text}, elements::{Line, Text},
text_style::{Color, TextStyle}, text_style::{Color, TextStyle},
}, },
theme::clean::CodeBlockStyle, theme::CodeBlockStyle,
}; };
use flate2::read::ZlibDecoder; use flate2::read::ZlibDecoder;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;

View File

@ -13,7 +13,7 @@ use crate::{
operation::{AsRenderOperations, BlockLine, RenderOperation}, operation::{AsRenderOperations, BlockLine, RenderOperation},
properties::WindowSize, properties::WindowSize,
}, },
theme::clean::{Alignment, CodeBlockStyle}, theme::{Alignment, CodeBlockStyle},
}; };
use schemars::JsonSchema; use schemars::JsonSchema;
use serde::Deserialize; use serde::Deserialize;

View File

@ -15,7 +15,7 @@ use crate::{
Image, ImageSource, Image, ImageSource,
printer::{ImageProperties, TerminalImage}, printer::{ImageProperties, TerminalImage},
}, },
theme::{clean::ProcessingThemeError, raw::PresentationTheme}, theme::{ProcessingThemeError, raw::PresentationTheme},
third_party::ThirdPartyRender, third_party::ThirdPartyRender,
tools::{ExecutionError, ThirdPartyTools}, tools::{ExecutionError, ThirdPartyTools},
}; };

View File

@ -30,8 +30,7 @@ use crate::{
printer::{ImageRegistry, RegisterImageError}, printer::{ImageRegistry, RegisterImageError},
}, },
theme::{ theme::{
AuthorPositioning, Margin, Alignment, AuthorPositioning, CodeBlockStyle, ElementType, Margin, PresentationTheme, ProcessingThemeError,
clean::{Alignment, CodeBlockStyle, ElementType, PresentationTheme, ProcessingThemeError},
raw, raw,
registry::{LoadThemeError, PresentationThemeRegistry}, registry::{LoadThemeError, PresentationThemeRegistry},
}, },

View File

@ -123,7 +123,7 @@ mod test {
operation::{AsRenderOperations, BlockLine, RenderAsync, RenderAsyncState}, operation::{AsRenderOperations, BlockLine, RenderAsync, RenderAsyncState},
properties::WindowSize, properties::WindowSize,
}, },
theme::{Margin, clean::Alignment}, theme::{Alignment, Margin},
}; };
use rstest::rstest; use rstest::rstest;
use std::rc::Rc; use std::rc::Rc;

View File

@ -21,7 +21,7 @@ use crate::{
image::printer::{ImagePrinter, ImageRegistry}, image::printer::{ImagePrinter, ImageRegistry},
printer::TerminalIo, printer::TerminalIo,
}, },
theme::{clean::ProcessingThemeError, raw::PresentationTheme}, theme::{ProcessingThemeError, raw::PresentationTheme},
third_party::ThirdPartyRender, third_party::ThirdPartyRender,
}; };
use std::{ use std::{

View File

@ -17,7 +17,7 @@ use crate::{
}, },
printer::TerminalIo, printer::TerminalIo,
}, },
theme::clean::Alignment, theme::Alignment,
}; };
use std::mem; use std::mem;

View File

@ -1,4 +1,4 @@
use crate::{render::properties::WindowSize, theme::clean::Alignment}; use crate::{render::properties::WindowSize, theme::Alignment};
#[derive(Debug)] #[derive(Debug)]
pub(crate) struct Layout { pub(crate) struct Layout {

View File

@ -16,7 +16,7 @@ use crate::{
Terminal, Terminal,
image::printer::{ImagePrinter, PrintImageError}, image::printer::{ImagePrinter, PrintImageError},
}, },
theme::{Margin, clean::Alignment}, theme::{Alignment, Margin},
}; };
use engine::{RenderEngine, RenderEngineOptions}; use engine::{RenderEngine, RenderEngineOptions};
use std::{ use std::{

View File

@ -5,7 +5,7 @@ use crate::{
text_style::{Color, Colors}, text_style::{Color, Colors},
}, },
terminal::image::Image, terminal::image::Image,
theme::{Margin, clean::Alignment}, theme::{Alignment, Margin},
}; };
use std::{fmt::Debug, rc::Rc}; use std::{fmt::Debug, rc::Rc};

View File

@ -166,7 +166,7 @@ mod test {
assert!(merged.is_ok(), "theme '{theme_name}' can't be merged: {}", merged.unwrap_err()); assert!(merged.is_ok(), "theme '{theme_name}' can't be merged: {}", merged.unwrap_err());
let resources = Resources::new("/tmp/foo", "/tmp/foo", Default::default()); let resources = Resources::new("/tmp/foo", "/tmp/foo", Default::default());
crate::theme::clean::PresentationTheme::new(&theme, &resources).expect("malformed theme"); crate::theme::PresentationTheme::new(&theme, &resources).expect("malformed theme");
} }
} }

View File

@ -13,7 +13,7 @@ use crate::{
properties::WindowSize, properties::WindowSize,
}, },
terminal::image::{Image, printer::RegisterImageError}, terminal::image::{Image, printer::RegisterImageError},
theme::clean::{Alignment, MermaidStyle, PresentationTheme, TypstStyle}, theme::{Alignment, MermaidStyle, PresentationTheme, TypstStyle},
tools::{ExecutionError, ThirdPartyTools}, tools::{ExecutionError, ThirdPartyTools},
}; };
use std::{ use std::{

View File

@ -20,10 +20,7 @@ use crate::{
image::{Image, printer::ImageRegistry}, image::{Image, printer::ImageRegistry},
should_hide_cursor, should_hide_cursor,
}, },
theme::{ theme::{Alignment, ExecutionOutputBlockStyle, ExecutionStatusBlockStyle, Margin},
Margin,
clean::{Alignment, ExecutionOutputBlockStyle, ExecutionStatusBlockStyle},
},
}; };
use crossterm::{ use crossterm::{
ExecutableCommand, cursor, ExecutableCommand, cursor,

View File

@ -13,7 +13,7 @@ use crate::{
properties::WindowSize, properties::WindowSize,
}, },
terminal::image::Image, terminal::image::Image,
theme::{Margin, clean::PresentationTheme}, theme::{Margin, PresentationTheme},
}; };
use std::{iter, rc::Rc}; use std::{iter, rc::Rc};
use unicode_width::UnicodeWidthStr; use unicode_width::UnicodeWidthStr;

View File

@ -8,7 +8,7 @@ use crate::{
operation::{AsRenderOperations, BlockLine, RenderOperation}, operation::{AsRenderOperations, BlockLine, RenderOperation},
properties::WindowSize, properties::WindowSize,
}, },
theme::{Margin, clean::Alignment}, theme::{Alignment, Margin},
}; };
use std::rc::Rc; use std::rc::Rc;