host: block editor — edit the :body composition (composition roadmap step 6)
The post body is now editable as a composition. Model ops over the :body ref-seq (and the
ordered `contains` edges): host/blog-block-add! (create a card object is-a a card-type +
fields, contains edge, append a ref), -remove! (drop ref + edge), -move! (swap adjacent).
host/blog--block-editor renders a row per block — type + a content preview + ↑/↓/remove
controls + a "fields" link — plus an add-block form, injected into the edit page. Routes
POST /:slug/blocks/{add, :cslug/remove, :cslug/move} (guarded; SX-htmx sx-post + outerHTML
swap of #block-editor, redirect fallback for no-JS).
Cards-as-objects pays off: per-block FIELD editing is free — a card IS an object, so its
fields are edited via its own /<cslug>/edit page; the block editor only owns structure.
Guard fix: a card type is a SUBTYPE-OF card (not is-a), so the add validates ctype against
the down-closure of "card", not host/blog-is-a?. Verified via the warm server (162/164; the
2 fails are the pre-existing relate-picker pair). Deferred: Playwright live-swap check;
alt/each block insertion (the core editor handles the seq of refs).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -118,7 +118,13 @@ Transclusion = a `ref` leaf. Sort/filter/limit/group = the *source query* langua
|
||||
typed-block path. `/import` wired; home filtered to published so `"block"` cards stay hidden.
|
||||
The `val` (raw value) leaf added for attribute interpolation. (Perf: typing now reads direct
|
||||
KV `subtype-of` edges via a host-side BFS, not lib/relations — no Datalog re-saturation.)
|
||||
6. The block editor edits the body (insert/reorder/`alt`/`each`) — the metamodel editor for content.
|
||||
6. **(done, server-side)** The block editor edits the body: `host/blog-block-add!` /
|
||||
`-remove!` / `-move!` operate on the `:body` ref-seq + ordered `contains` edges;
|
||||
`host/blog--block-editor` renders a row per block (type + preview + ↑/↓/remove + a link
|
||||
to edit the card's fields) + an add-block form, injected into the edit page; routes
|
||||
`POST /:slug/blocks/{add,:cslug/remove,:cslug/move}` (guarded, SX-htmx outerHTML swap).
|
||||
Per-block field editing is free — a card is an object, edited via its own `/<cslug>/edit`.
|
||||
(Live SX-htmx swap still wants a Playwright check; `alt`/`each` block insertion deferred.)
|
||||
7. **Prove universality with a second fold.** Write a tiny `execute`-fold over the *same*
|
||||
`seq/alt/each` structure that *runs* a workflow (leaves = effects; `seq` = steps in order, `alt`
|
||||
= branch, `each` = for-each) — the way the recursive tree proved recursion, this proves the
|
||||
|
||||
Reference in New Issue
Block a user