Composition / foldkit-builder

Where builder state and page data live

FactOwner
What a page may hold, and how each Block looksthe application: a Catalog and a Renderer
The page being editedthe Builder's Model, as the form key's value
Undothe Builder's Model: the page is kept as a foldkit-primitives/state history
What is selected, the open panel, the viewportthe Builder's Model, beside the page
The last node copied or cutthe Builder's Model, as clipboard, and the system clipboard as text
Which text on the page is being edited in place, and what it said when that beganthe Builder's Model, as editing
A prop's field while it holds text that does not decode yetthe Builder's Model, as inspector
The layers' keyboard focus and which rows are openthe Builder's Model, as a TreeNavigation placement
What the editor last said to assistive technologythe Builder's Model, as a LiveAnnounce placement
Saving, revisions, publishingthe form, and foldkit-cms around it

The Catalog and Renderer define your vocabulary rather than state: Builder.make closes over them once at module scope, keeping them out of the Model and placement arguments.

How edits become undoable history

In the view, a click or key press dispatches a Builder Message. Composition.apply computes the next Document, and History.push(page, document) records it in one transition. Inside a form, a Control Message carries only Document changes as edits, so selection or hover changes leave the form clean for autosave.