Composition / foldkit-builder
Where builder state and page data live
| Fact | Owner |
|---|---|
| What a page may hold, and how each Block looks | the application: a Catalog and a Renderer |
| The page being edited | the Builder's Model, as the form key's value |
| Undo | the Builder's Model: the page is kept as a foldkit-primitives/state history |
| What is selected, the open panel, the viewport | the Builder's Model, beside the page |
| The last node copied or cut | the 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 began | the Builder's Model, as editing |
| A prop's field while it holds text that does not decode yet | the Builder's Model, as inspector |
| The layers' keyboard focus and which rows are open | the Builder's Model, as a TreeNavigation placement |
| What the editor last said to assistive technology | the Builder's Model, as a LiveAnnounce placement |
| Saving, revisions, publishing | the 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.