refactor: extract dizzle

This commit is contained in:
AAAAAAAAAAAAAAAAAAAAAAAAAAAA 2026-01-17 03:43:27 +02:00
parent b0d2fad17b
commit 1344967f33
34 changed files with 372 additions and 2235 deletions

View file

@ -4,24 +4,20 @@ description = "UI metaframework, Ratatui backend."
version = { workspace = true }
edition = { workspace = true }
[lib]
path = "src/tui.rs"
[features]
dsl = [ "dep:tengri_dsl", "tengri_output/dsl" ]
dsl = [ "tengri_output/dsl" ]
bumpalo = [ "dep:bumpalo" ]
[dependencies]
tengri_core = { workspace = true }
dizzle = { workspace = true }
tengri_input = { workspace = true }
tengri_output = { workspace = true }
tengri_dsl = { workspace = true, optional = true }
atomic_float = { workspace = true }
better-panic = { workspace = true }
bumpalo = { workspace = true, optional = true }
crossterm = { workspace = true }
konst = { workspace = true }
palette = { workspace = true }
quanta = { workspace = true }
rand = { workspace = true }
@ -30,5 +26,4 @@ unicode-width = { workspace = true }
[dev-dependencies]
tengri = { workspace = true, features = [ "dsl" ] }
tengri_dsl = { workspace = true }
tengri_proc = { workspace = true }

29
tui/src/lib.rs Normal file
View file

@ -0,0 +1,29 @@
#![feature(type_changing_struct_update)]
#![feature(trait_alias)]
#[cfg(test)] mod tui_test;
mod tui_engine; pub use self::tui_engine::*;
mod tui_content; pub use self::tui_content::*;
pub use ::{tengri_input, tengri_output, ratatui, crossterm, palette, better_panic};
pub(crate) use ::{
dizzle::*,
tengri_input::*,
tengri_output::*,
atomic_float::AtomicF64,
std::{io::{stdout, Stdout}, sync::{Arc, RwLock, atomic::{AtomicBool, Ordering::*}}},
better_panic::{Settings, Verbosity},
palette::{*, convert::*, okhsl::*},
ratatui::{
prelude::{Color, Style, Buffer},
style::Modifier,
backend::{Backend, CrosstermBackend, ClearType},
layout::{Size, Rect},
buffer::Cell
},
crossterm::{
ExecutableCommand,
terminal::{EnterAlternateScreen, LeaveAlternateScreen, enable_raw_mode, disable_raw_mode},
event::{Event, KeyEvent, KeyCode, KeyModifiers, KeyEventKind, KeyEventState},
}
};

View file

@ -1,39 +1,5 @@
#![feature(type_changing_struct_update)]
#![feature(trait_alias)]
#[cfg(test)] mod tui_test;
mod tui_engine; pub use self::tui_engine::*;
mod tui_content; pub use self::tui_content::*;
pub use ::{
tengri_input,
tengri_output,
ratatui,
crossterm,
palette,
better_panic
};
pub(crate) use ::{
tengri_core::*,
tengri_input::*,
tengri_output::*,
atomic_float::AtomicF64,
std::{io::{stdout, Stdout}, sync::{Arc, RwLock, atomic::{AtomicBool, Ordering::*}}},
better_panic::{Settings, Verbosity},
palette::{*, convert::*, okhsl::*},
ratatui::{
prelude::{Color, Style, Buffer},
style::Modifier,
backend::{Backend, CrosstermBackend, ClearType},
layout::{Size, Rect},
buffer::Cell
},
crossterm::{
ExecutableCommand,
terminal::{EnterAlternateScreen, LeaveAlternateScreen, enable_raw_mode, disable_raw_mode},
event::{Event, KeyEvent, KeyCode, KeyModifiers, KeyEventKind, KeyEventState},
}
};
use crate::*;
#[cfg(feature = "dsl")] use tengri_dsl::*;
#[cfg(feature = "dsl")]
pub fn evaluate_output_expression_tui <'a, S> (
state: &S, mut output: &mut TuiOut, expr: impl DslExpr + 'a