Skip to main content

sim_lib_web_layout/
lib.rs

1//! Workspace value, panes, tabs, docks, and layout persistence.
2//!
3//! The workspace is one SIM value: panes, tabs, splits, docks, floating
4//! inspectors, overlays, open resources, active lens per resource, mode,
5//! session ref, palette state, and history ref. Because it round-trips through
6//! general codecs, a workspace can be saved, shared, versioned, diffed, and
7//! restored as data. Layout is data; restoring a session is decoding a value.
8//!
9//! This crate provides the workspace [`value`] model, [`pane`] records, the
10//! [`layout`] engine (operations over the workspace value), and a [`scene`]
11//! encoder for the dock/split arrangement.
12
13#![forbid(unsafe_code)]
14#![deny(missing_docs)]
15
16mod citizen;
17pub mod cookbook;
18pub mod layout;
19pub mod palette;
20pub mod pane;
21pub mod scene;
22pub mod value;
23
24pub use citizen::{WorkspaceDescriptor, workspace_descriptor_class_symbol};
25pub use cookbook::workspace_pane_demo;
26pub use layout::{LayoutOp, apply_layout_op, layout_op_from_intent};
27pub use palette::{EntryKind, Palette, PaletteEntry, card_target, open_card};
28pub use pane::{new_pane, pane_dock, pane_id, pane_lens, pane_resource, rect};
29pub use scene::workspace_scene;
30pub use value::{WORKSPACE_CLASS, focus, mode, new_workspace, panes};
31
32/// Embedded cookbook recipe books shipped with this library.
33pub static RECIPES: sim_cookbook::EmbeddedDir =
34    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
35
36#[cfg(test)]
37mod palette_tests;
38#[cfg(test)]
39mod tests;