From fa4d862834bd9577c251ec9fbbf6fd12ee9eb1cc Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Thu, 20 Feb 2025 16:15:12 -0800 Subject: [PATCH] chore: use re-exports for clean theme types --- src/code/highlighting.rs | 2 +- src/code/snippet.rs | 2 +- src/export.rs | 2 +- src/presentation/builder.rs | 3 +-- src/presentation/diff.rs | 2 +- src/presenter.rs | 2 +- src/render/engine.rs | 2 +- src/render/layout.rs | 2 +- src/render/mod.rs | 2 +- src/render/operation.rs | 2 +- src/theme/registry.rs | 2 +- src/third_party.rs | 2 +- src/ui/execution.rs | 5 +---- src/ui/modals.rs | 2 +- src/ui/separator.rs | 2 +- 15 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/code/highlighting.rs b/src/code/highlighting.rs index 7bf3f82..87ae891 100644 --- a/src/code/highlighting.rs +++ b/src/code/highlighting.rs @@ -4,7 +4,7 @@ use crate::{ elements::{Line, Text}, text_style::{Color, TextStyle}, }, - theme::clean::CodeBlockStyle, + theme::CodeBlockStyle, }; use flate2::read::ZlibDecoder; use once_cell::sync::Lazy; diff --git a/src/code/snippet.rs b/src/code/snippet.rs index 3854070..e5f0223 100644 --- a/src/code/snippet.rs +++ b/src/code/snippet.rs @@ -13,7 +13,7 @@ use crate::{ operation::{AsRenderOperations, BlockLine, RenderOperation}, properties::WindowSize, }, - theme::clean::{Alignment, CodeBlockStyle}, + theme::{Alignment, CodeBlockStyle}, }; use schemars::JsonSchema; use serde::Deserialize; diff --git a/src/export.rs b/src/export.rs index 9a50ef9..0bf5796 100644 --- a/src/export.rs +++ b/src/export.rs @@ -15,7 +15,7 @@ use crate::{ Image, ImageSource, printer::{ImageProperties, TerminalImage}, }, - theme::{clean::ProcessingThemeError, raw::PresentationTheme}, + theme::{ProcessingThemeError, raw::PresentationTheme}, third_party::ThirdPartyRender, tools::{ExecutionError, ThirdPartyTools}, }; diff --git a/src/presentation/builder.rs b/src/presentation/builder.rs index 7dae2fe..40fa276 100644 --- a/src/presentation/builder.rs +++ b/src/presentation/builder.rs @@ -30,8 +30,7 @@ use crate::{ printer::{ImageRegistry, RegisterImageError}, }, theme::{ - AuthorPositioning, Margin, - clean::{Alignment, CodeBlockStyle, ElementType, PresentationTheme, ProcessingThemeError}, + Alignment, AuthorPositioning, CodeBlockStyle, ElementType, Margin, PresentationTheme, ProcessingThemeError, raw, registry::{LoadThemeError, PresentationThemeRegistry}, }, diff --git a/src/presentation/diff.rs b/src/presentation/diff.rs index 6074e59..3817552 100644 --- a/src/presentation/diff.rs +++ b/src/presentation/diff.rs @@ -123,7 +123,7 @@ mod test { operation::{AsRenderOperations, BlockLine, RenderAsync, RenderAsyncState}, properties::WindowSize, }, - theme::{Margin, clean::Alignment}, + theme::{Alignment, Margin}, }; use rstest::rstest; use std::rc::Rc; diff --git a/src/presenter.rs b/src/presenter.rs index fb06044..c4bf50f 100644 --- a/src/presenter.rs +++ b/src/presenter.rs @@ -21,7 +21,7 @@ use crate::{ image::printer::{ImagePrinter, ImageRegistry}, printer::TerminalIo, }, - theme::{clean::ProcessingThemeError, raw::PresentationTheme}, + theme::{ProcessingThemeError, raw::PresentationTheme}, third_party::ThirdPartyRender, }; use std::{ diff --git a/src/render/engine.rs b/src/render/engine.rs index ec63bf6..121e900 100644 --- a/src/render/engine.rs +++ b/src/render/engine.rs @@ -17,7 +17,7 @@ use crate::{ }, printer::TerminalIo, }, - theme::clean::Alignment, + theme::Alignment, }; use std::mem; diff --git a/src/render/layout.rs b/src/render/layout.rs index 8de3eb2..9d93d03 100644 --- a/src/render/layout.rs +++ b/src/render/layout.rs @@ -1,4 +1,4 @@ -use crate::{render::properties::WindowSize, theme::clean::Alignment}; +use crate::{render::properties::WindowSize, theme::Alignment}; #[derive(Debug)] pub(crate) struct Layout { diff --git a/src/render/mod.rs b/src/render/mod.rs index f384116..6b58fea 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -16,7 +16,7 @@ use crate::{ Terminal, image::printer::{ImagePrinter, PrintImageError}, }, - theme::{Margin, clean::Alignment}, + theme::{Alignment, Margin}, }; use engine::{RenderEngine, RenderEngineOptions}; use std::{ diff --git a/src/render/operation.rs b/src/render/operation.rs index 105f07f..8977ea2 100644 --- a/src/render/operation.rs +++ b/src/render/operation.rs @@ -5,7 +5,7 @@ use crate::{ text_style::{Color, Colors}, }, terminal::image::Image, - theme::{Margin, clean::Alignment}, + theme::{Alignment, Margin}, }; use std::{fmt::Debug, rc::Rc}; diff --git a/src/theme/registry.rs b/src/theme/registry.rs index ab60164..96ea644 100644 --- a/src/theme/registry.rs +++ b/src/theme/registry.rs @@ -166,7 +166,7 @@ mod test { assert!(merged.is_ok(), "theme '{theme_name}' can't be merged: {}", merged.unwrap_err()); 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"); } } diff --git a/src/third_party.rs b/src/third_party.rs index f7d4042..1890f80 100644 --- a/src/third_party.rs +++ b/src/third_party.rs @@ -13,7 +13,7 @@ use crate::{ properties::WindowSize, }, terminal::image::{Image, printer::RegisterImageError}, - theme::clean::{Alignment, MermaidStyle, PresentationTheme, TypstStyle}, + theme::{Alignment, MermaidStyle, PresentationTheme, TypstStyle}, tools::{ExecutionError, ThirdPartyTools}, }; use std::{ diff --git a/src/ui/execution.rs b/src/ui/execution.rs index d19323b..73fbb70 100644 --- a/src/ui/execution.rs +++ b/src/ui/execution.rs @@ -20,10 +20,7 @@ use crate::{ image::{Image, printer::ImageRegistry}, should_hide_cursor, }, - theme::{ - Margin, - clean::{Alignment, ExecutionOutputBlockStyle, ExecutionStatusBlockStyle}, - }, + theme::{Alignment, ExecutionOutputBlockStyle, ExecutionStatusBlockStyle, Margin}, }; use crossterm::{ ExecutableCommand, cursor, diff --git a/src/ui/modals.rs b/src/ui/modals.rs index c1664cb..0574699 100644 --- a/src/ui/modals.rs +++ b/src/ui/modals.rs @@ -13,7 +13,7 @@ use crate::{ properties::WindowSize, }, terminal::image::Image, - theme::{Margin, clean::PresentationTheme}, + theme::{Margin, PresentationTheme}, }; use std::{iter, rc::Rc}; use unicode_width::UnicodeWidthStr; diff --git a/src/ui/separator.rs b/src/ui/separator.rs index 0a94d14..85f2391 100644 --- a/src/ui/separator.rs +++ b/src/ui/separator.rs @@ -8,7 +8,7 @@ use crate::{ operation::{AsRenderOperations, BlockLine, RenderOperation}, properties::WindowSize, }, - theme::{Margin, clean::Alignment}, + theme::{Alignment, Margin}, }; use std::rc::Rc;