1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
//! # Dracon Terminal Engine
//!
//! A terminal application framework for Rust with composable widgets,
//! z-indexed compositor, themes, and TextEditor.
//!
//! ## Quick Start
//!
//! ```ignore
//! // Pattern 1 — Widget trait (auto-render)
//! use dracon_terminal_engine::prelude::*;
//!
//! struct MyApp { theme: Theme }
//! impl Widget for MyApp {
//! fn id(&self) -> WidgetId { WidgetId::new() }
//! fn area(&self) -> Rect { Rect::new(0, 0, 80, 24) }
//! fn needs_render(&self) -> bool { true }
//! fn render(&self, area: Rect) -> Plane {
//! let mut p = Plane::new(0, area.width, area.height);
//! p.fill_bg(self.theme.bg);
//! p.put_str(0, 0, "Hello from Dracon!");
//! p
//! }
//! }
//!
//! // Pattern 2 — Closure-based (manual render)
//! App::new().unwrap()
//! .title("My App")
//! .on_tick(|ctx, _tick| {
//! ctx.add_plane(Plane::new(0, 80, 24)); // render here
//! })
//! .run();
//! ```
//!
//! ## Architecture
//!
//! The engine is organized into several layers:
//!
//! - **App** — [`App`] and [`Ctx`] provide the one-import entry point with event loop
//! - **Compositor** — [`Plane`] layers composited via [`Compositor`] with TrueColor and filters
//! - **Widgets** — 43 framework widgets (`List`, `Table`, `Tree`, `Form`, `Button`, etc.)
//! - **TextEditor** — Full-featured code editor with syntax highlighting via syntect
//! - **Themes** — 21 built-in themes (nord, dracula, catppuccin, gruvbox, etc.)
//! - **Input** — SGR mouse parsing, keyboard chords, modifiers
//! - **System** — [`SystemMonitor`] for CPU, memory, disk, process metrics
//! - **Framework** — HitZone, DragDrop, Animation, Focus, Layout helpers
// ─────────────────────────────────────────────────────────────────────────────
// Module declarations
// ─────────────────────────────────────────────────────────────────────────────
// ─────────────────────────────────────────────────────────────────────────────
// Re-exports from all major modules
// ─────────────────────────────────────────────────────────────────────────────
// Compositor primitives
pub use ;
// Error type
pub use DraconError;
// Core terminal
pub use ;
// Input system
pub use ;
// System monitoring
pub use ;
// ─────────────────────────────────────────────────────────────────────────────
// Framework re-exports (the main API surface)
// ─────────────────────────────────────────────────────────────────────────────
pub use prelude;
// ─────────────────────────────────────────────────────────────────────────────
// Framework widgets (all 41) — accessible via prelude::*
// ─────────────────────────────────────────────────────────────────────────────
//
// The following widgets are exported from the prelude and accessible as:
// use dracon_terminal_engine::prelude::*;
//
// Individual widget modules are also available via:
// use dracon_terminal_engine::framework::widgets::*
//
// Widget list (41 total):
// 1. Autocomplete - Text input with autocomplete suggestions
// 2. Breadcrumbs - Clickable path breadcrumb navigation
// 3. Button - Clickable button with hover states
// 4. Calendar - Date picker calendar widget
// 5. Checkbox - Toggle checkbox with label
// 6. CommandPalette - Filterable command search overlay
// 7. ConfirmDialog - Modal yes/no confirmation dialog
// 8. ContextMenu - Right-click context menu
// 9. DebugOverlay - Debug information overlay
// 10. EventLogger - Event log viewer with filtering
// 11. Form - Multi-field form with validation
// 12. Gauge - Progress bar with warn/crit thresholds
// 13. Hud - Heads-up display overlay
// 14. KeyValueGrid - Key-value display grid
// 15. Label - Static text label
// 16. List - Scrollable list with selection
// 17. LogViewer - Auto-scrolling log with severity
// 18. MenuBar - Top menu bar with dropdowns
// 19. Modal - Modal dialog container
// 20. NotificationCenter - Notification display system
// 21. PasswordInput - Password input with masking
// 22. Profiler - Performance profiling display
// 23. ProgressBar - Progress indicator bar
// 24. Radio - Radio button group
// 25. RichText - Rich text display with formatting
// 26. SearchInput - Search input with clear button
// 27. Select - Dropdown select widget
// 28. Slider - Horizontal slider control
// 29. Spinner - Loading spinner animation
// 30. SplitPane - Resizable split panel container
// 31. StatusBadge - Colored status badge (OK/WARN/ERROR)
// 32. StatusBar - Bottom status bar with segments
// 33. StreamingText - Live-updating text display
// 34. TabBar - Tab bar for panel switching
// 35. Table - Sortable data table
// 36. TextEditorAdapter - Adapter for TextEditor in framework
// 37. Toast - Toast notification popup
// 38. Toggle - Toggle switch control
// 39. Tooltip - Hover tooltip popup
// 40. Tree - Collapsible tree view
// 41. WidgetInspector - Widget debugging inspector
//
// Additional helper types:
// - CellTextFn<T> - Table cell text formatter
// - Column - Table column definition
// - TableRow - Table row data wrapper
// - ConfirmResult - ConfirmDialog result enum
// - ContextAction - ContextMenu action definition
// - LoggedEvent - EventLogger log entry
// - FormField - Form field definition
// - ValidationRule - Form validation rule
// - LogLevel - Log line severity level
// - LogLine - Log line entry
// - MenuEntry - Menu bar entry
// - MenuItem - Menu dropdown item
// - ModalResult<T> - Modal result wrapper
// - NotificationKind - Notification severity
// - Orientation - SplitPane orientation
// - Metric - Profiler metric entry
// - ScrollState - Scroll position state
// - TreeNode - Tree node wrapper
// - DragState - HitZone drag state
// - DragGhost - Drag operation ghost
// - DragPhase - Drag lifecycle phase
// - Animation - Animation definition
// - AnimationManager - Animation controller
// - Easing - Easing function enum
// - FocusManager - Tab-order focus ring
// - DirtyRegion - Dirty region for render optimization
// - DirtyRegionTracker - Dirty region tracking
// - EventBus - Pub/sub event system
// - Reactive<T> - Observable value wrapper
// - SubscriptionId - Event subscription handle
// - NavigationEvent - Scene navigation event
// - Scene - Scene trait for router
// - SceneRouter - Scene navigation controller
// - PluginRegistry - Dynamic widget loading
// - WidgetFactory - Widget factory trait
// - KeybindingSet - Keybinding configuration
// - KeybindingConfig - Keybinding loader
// - Constraint - Layout constraint
// - Direction - Layout direction
// - Layout - Constraint-based layout engine
// - ScrollContainer - Scrollable container wrapper
// ─────────────────────────────────────────────────────────────────────────────
// Standalone widgets (TextEditor, TextInput, etc.)
// ─────────────────────────────────────────────────────────────────────────────
pub use TextEditor;
pub use TextInput;
pub use Button as StandaloneButton;
pub use Panel;
pub use Component;
pub use HotkeyHint;
pub use ContextMenuAction;