host: block editor renders ANY composition node (no more "(unknown block)")
The block editor assumed cards-as-objects leaves (ref/alt-with-refs/each-with-ref), so a hand-authored composition (the compose-demo: text/row/alt-with-text/each-with-inline) fell through to "(unknown block)" for every text/row node. Now every node kind gets a labelled row + preview + move/remove controls: card (✎ chip), text (its content), layout (row/grid + item count), field, group, and a graceful "other". Conditionals/repeaters display each branch via host/blog--node-display (a ref → ✎ chip, else the inline text/summary) instead of assuming a ref. host/blog--node-kind extended (text/layout/field/group); +node-display/+branch-display. TEST-FIRST: a mixed body (text + alt-with-text + row + each-with-inline) asserts the editor has NO "unknown block" and labels text/layout/for-each. RED before, GREEN after. blog 171/171. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -897,6 +897,21 @@
|
||||
(list (contains? html "+ card") (contains? html "+ conditional")
|
||||
(contains? html "+ repeater") (contains? html "for each")))
|
||||
(list true true true true))
|
||||
;; the editor renders a HAND-AUTHORED composition (text/row/alt-with-text) WITHOUT falling
|
||||
;; through to "(unknown block)" — every node kind gets a labelled row (the compose-demo case).
|
||||
(host-bl-test "the block editor renders text/layout/inline-alt nodes (no unknown block)"
|
||||
(begin
|
||||
(host/blog-put! "mixdoc" "Mix" "(article)" "published")
|
||||
(host/blog--set-body! "mixdoc"
|
||||
(quote (seq
|
||||
(text "<p>intro</p>")
|
||||
(alt (when (has "auth") (text "member")) (else (text "guest")))
|
||||
(row (text "A") (text "B"))
|
||||
(each (query is-a compose-item) (seq (text "x"))))))
|
||||
(let ((html (render-page (host/blog--block-editor "mixdoc"))))
|
||||
(list (contains? html "unknown block")
|
||||
(contains? html "text") (contains? html "layout") (contains? html "for each"))))
|
||||
(list false true true true))
|
||||
;; -- /workflow-demo: ONE composition object run through the EXECUTE-fold (step 7 live). The
|
||||
;; same :body structure the render-fold renders, folded to an effect log (status=ready ->
|
||||
;; validate, publish, notify each — not hold). --
|
||||
|
||||
Reference in New Issue
Block a user