Skip to main content

panes/
lib.rs

1//! Renderer-agnostic spatial layout engine.
2//!
3//! Describe panels in rows, columns, and presets. panes solves the geometry
4//! via Taffy's flexbox engine and hands back a map of `PanelId → Rect`.
5
6mod builder;
7/// Compiles a [`LayoutTree`] into a Taffy tree for layout computation.
8pub mod compiler;
9/// Frame-to-frame diffing of resolved layouts.
10pub mod diff;
11mod error;
12mod focus;
13mod layout;
14mod macros;
15mod node;
16mod panel;
17mod preset;
18mod rect;
19mod resize;
20/// Resolves compiled Taffy output into [`ResolvedLayout`].
21pub mod resolver;
22/// Stateful runtime with viewport tracking, caching, and frame diffing.
23pub mod runtime;
24/// Ordered panel sequence for focus navigation.
25mod sequence;
26/// Serializable snapshots for session persistence.
27mod snapshot;
28/// Layout mutation strategies mapped to presets.
29mod strategy;
30#[cfg(feature = "toml")]
31mod toml_parse;
32mod tree;
33mod validate;
34mod viewport;
35
36pub use builder::{ContainerCtx, LayoutBuilder};
37pub use error::{ConstraintError, MutationError, PaneError, TreeError, ViewportError};
38pub use focus::FocusDirection;
39pub use layout::Layout;
40pub use node::{Node, NodeId, PanelId};
41pub use panel::{Constraints, PanelIdGenerator, fixed, grow};
42pub use preset::{
43    CenteredMaster, Columns, Dashboard, Deck, Dwindle, Grid, HolyGrail, MasterStack, Monocle,
44    PanelInputKind, PresetInfo, Scrollable, Sidebar, Spiral, Split, Stacked, Tabbed,
45};
46pub use rect::Rect;
47pub use resolver::{PanelEntry, ResolvedLayout};
48pub use runtime::Placement;
49pub use sequence::PanelSequence;
50pub use snapshot::{LayoutSnapshot, SnapshotNode, SnapshotSlotDef, SnapshotSource, StrategyConfig};
51pub use strategy::{ActivePanelVariant, Direction, SlotDef, StrategyKind};
52#[cfg(feature = "toml")]
53pub use toml_parse::TomlError;
54pub use tree::{LayoutTree, Position};
55pub use viewport::ViewportState;