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
//! Base widgets: `Container`, `Flex`, `Stack`, `Text`.
//!
//! These are the foundational building blocks for Martensite UIs.
//! Each widget implements the [`Widget`](martensite_core::widget::Widget)
//! trait and integrates with the arena, layout, text, and rendering
//! pipelines.
//!
//! ## Layout Architecture
//!
//! Martensite uses a **two-level layout architecture**:
//!
//! 1. **Arena-level layout** (`LayoutEngine`): The `LayoutEngine` uses
//! Taffy to compute bounds for top-level widgets registered in the
//! `WidgetArena`. Each widget is a Taffy leaf node whose intrinsic
//! size is determined by `Widget::measure`.
//!
//! 2. **Widget-internal layout** (`Widget::layout`): Each widget
//! manages its own children internally. `Container` applies padding
//! and positions its single child. `Flex` arranges its children in
//! a row or column with alignment and gap. `Stack` layers children.
//! These children are not registered in the arena — they are owned
//! by the parent widget as `Box<dyn Widget>`.
//!
//! This means `Flex`/`Container`/`Stack` are treated as **leaf nodes**
//! by the `LayoutEngine` (they have no arena children). Their internal
//! children are laid out during `Widget::layout`, not by Taffy. This
//! architecture gives widgets full control over their internal layout
//! while Taffy handles the top-level arena tree.
//!
//! In a future milestone, widgets may optionally register their children
//! in the arena for Taffy-driven flexbox layout, but for v0.3.0 the
//! widget-internal approach is used.
pub use Container;
pub use ;
pub use Stack;
pub use Text;