Composition / foldkit-composition

Where blocks, pages, and edits live

FactOwner
Which Blocks exist, their props, Regions and Contentfoldkit-composition, in code
Which Blocks a page has, and wherethe Document, stored as data
Whether a Document fits a CatalogComposition.validate, reporting every finding
The draft being edited, saving, revisions, publishingthe application (foldkit-form, foldkit-cms)
How a Block looks and behavesa 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.