pub use crate::core::{
AlignItems, BorderStyle, Color, Display, Element, ElementId, FlexDirection, JustifyContent,
Overflow, Position, Style, TextWrap,
};
pub use crate::components::{Box, Box as LayoutBox, Spacer, Static, Transform};
pub use crate::components::{
Cursor, CursorShape, CursorState, CursorStyle, Gradient, Hyperlink, HyperlinkBuilder, Line,
Message, MessageRole, Newline, Span, Text, ThinkingBlock, ToolCall, set_hyperlinks_supported,
supports_hyperlinks,
};
pub use crate::components::{
Bar, BarChart, BarChartOrientation, Cell, Constraint, List, ListColors, ListItem, ListState,
Row, Sparkline, Tab, Table, TableState, Tabs, Tree, TreeNode, TreeState, TreeStyle,
calculate_visible_range, handle_list_navigation, handle_tree_input, virtual_scroll_view,
};
pub use crate::components::{
Confirm, ConfirmState, ConfirmStyle, FileEntry, FileFilter, FilePicker, FilePickerState,
FilePickerStyle, FileType, MultiSelect, MultiSelectItem, MultiSelectStyle, SelectInput,
SelectInputStyle, SelectItem, SelectionState, TextInputHandle, TextInputOptions,
TextInputState, handle_confirm_input, use_text_input,
};
pub use crate::components::{
Dialog, DialogState, Gauge, Modal, ModalAlign, Notification, NotificationBorder,
NotificationItem, NotificationLevel, NotificationPosition, NotificationState,
NotificationStyle, Progress, ProgressColors, ProgressSymbols, Spinner, SpinnerBuilder,
StopwatchState, TimerState, Toast,
};
pub use crate::components::{
Help, HelpMode, HelpStyle, KeyBinding, NavigationConfig, NavigationResult, Paginator,
PaginatorState, PaginatorStyle, PaginatorType, ScrollableBox, Scrollbar, ScrollbarOrientation,
ScrollbarSymbols, editor_help, fixed_bottom_layout, handle_paginator_input, navigation_help,
vim_navigation_help,
};
pub use crate::components::{
BackgroundColors, BorderColors, ButtonColors, ButtonStyle, ComponentColors, InputColors,
SemanticColor, TextColors, Theme, ThemeBuilder, get_theme, set_theme, with_theme,
};
pub use crate::components::{
format_duration_hhmmss, format_duration_mmss, format_duration_precise,
};
pub use crate::renderer::{
AppBuilder,
AppOptions,
IntoPrintable,
ModeSwitch,
Printable,
RenderHandle,
RenderOptions,
enter_alt_screen,
exit_alt_screen,
is_alt_screen,
println,
println_trimmed,
render,
render_fullscreen,
render_handle,
render_inline,
render_to_string,
render_to_string_auto,
render_to_string_no_trim,
render_to_string_raw,
render_to_string_with_options,
request_render,
};
pub use crate::hooks::{
Context, Deps, DepsHash, MemoizedCallback, RefHandle, Signal, StateSetter, create_context,
use_callback, use_context, use_memo, use_ref, use_signal, use_state, with_context,
};
pub use crate::hooks::{
use_cmd, use_cmd_once, use_effect, use_effect_once, use_layout_effect, use_layout_effect_once,
};
pub use crate::hooks::{
AnimationHandle, TransitionHandle, use_animation, use_animation_auto, use_transition,
use_transition_with_easing,
};
pub use crate::hooks::{
BracketedPasteGuard, Key, KeyCodeKind, MediaKeyKind, Mouse, MouseAction, MouseButton,
PasteEvent, disable_bracketed_paste, dispatch_paste, enable_bracketed_paste,
is_bracketed_paste_enabled, is_mouse_enabled, use_input, use_mouse, use_paste,
};
pub use crate::hooks::{
FocusManagerHandle, FocusState, UseFocusOptions, use_focus, use_focus_manager,
};
pub use crate::hooks::{
Dimensions, MeasureContext, MeasureRef, ScrollHandle, ScrollState, measure_element,
measure_element_by_key, use_measure, use_scroll,
};
pub use crate::hooks::{
AppContext, StderrHandle, StdinHandle, StdoutHandle, WindowTitleGuard,
clear_screen_reader_cache, clear_window_title, set_screen_reader_enabled, set_window_title,
use_app, use_frame_rate, use_is_screen_reader_enabled, use_stderr, use_stdin, use_stdout,
use_window_title, use_window_title_fn,
};
pub mod lite {
pub use crate::components::{Box as LayoutBox, Spacer, Text};
pub use crate::core::{Color, Element, FlexDirection, Style};
pub use crate::hooks::{Key, use_app, use_effect, use_input, use_signal};
pub use crate::renderer::{render, render_to_string};
}
#[cfg(test)]
mod tests {
#[test]
fn test_layout_box_alias_compiles() {
use super::*;
let _element = LayoutBox::new()
.child(Text::new("ok").into_element())
.into_element();
}
#[test]
fn test_lite_prelude_compiles() {
use super::lite::*;
let _element = LayoutBox::new()
.child(Text::new("lite").into_element())
.into_element();
let _style = Style::new().fg(Color::Green);
}
}