Composition / foldkit-composition
Where blocks, pages, and edits live
| Fact | Owner |
|---|---|
| Which Blocks exist, their props, Regions and Content | foldkit-composition, in code |
| Which Blocks a page has, and where | the Document, stored as data |
| Whether a Document fits a Catalog | Composition.validate, reporting every finding |
| The draft being edited, saving, revisions, publishing | the application (foldkit-form, foldkit-cms) |
| How a Block looks and behaves | a view, drawn from the Block by a renderer |
Code decides what may exist; data records what does. A Document refers to Blocks only by name, so stored pages outlive deployments: removing a Block from code leaves a node that still loads, round-trips, and reports an unknown-block finding without dropping data.
How Blocks, Regions, and Documents fit together
In code, a Block pairs a name, a prop Schema, its child Regions, and the
Content roles it provides (such as Section, Flow, or Interactive). A
Catalog lists the Blocks available in one context and which Content roles may
appear as page roots.
In storage, a Document holds roots: [id, ...] and
nodes: { id: { block, props, regions } }. A Region is a named slot inside
a Block (such as a Hero's actions) that accepts children by Content role rather
than Block name, so Regions written today automatically accept new Blocks added
later.