flower_core/lib.rs
1//! flower-core — the frontend-neutral structural editing model for config files.
2//!
3//! Given a config document's bytes and format, it exposes the document as a
4//! navigable projection of fig's `Value` — plus structural navigation and
5//! path-addressed edits routed through fig's lossless editor. It knows nothing
6//! about terminals, GUIs, or the filesystem — a frontend (flower-ratatui,
7//! a future flower-gpui, …) renders the projection and drives the model's
8//! methods; the embedder owns file I/O.
9//!
10//! There are two projections, selected by [`ViewMode`], over one document and one
11//! set of edits:
12//!
13//! - the **[`tree`]** — every visible node at once, indented by depth
14//! ([`Model::rows`]). The document as a document.
15//! - the **[`page`]** — one container at a time, pushed and popped
16//! ([`Model::page`]), with small all-scalar groups inlined. The document as a
17//! settings menu, and the one that stays legible when it is deep.
18
19pub mod backend;
20pub mod format;
21pub mod model;
22pub mod page;
23pub mod schema;
24pub mod tree;
25
26pub use backend::{Backend, BackendError, EditOp, FigBackend};
27pub use format::detect;
28pub use model::{Mode, Model, ViewMode};
29pub use page::{ItemKind, Page, PageItem};
30pub use schema::{Constraint, FieldRule, FieldRuleExt, Schema};
31pub use tree::{Row, VKind};
32
33// The generic, prov-agnostic pieces (path matching, field type, controlled
34// vocabulary, presentation hints) live in fig-schema now; re-exported here so
35// existing callers importing them from flower_core keep working.
36pub use fig_schema::{
37 Cardinality, FieldType, Icon, PathPat, Presentation, Seg, SegPat, Term, Tint, Validation,
38};