Improve content blocks: new types, formatting, and a better editor

Blocks (migration 032): video (click to play, sharing the featured
cards' player), button and callout types; quotes get an attribution
and images alt text separate from the caption. Paragraphs, callouts,
quotes and list items take **bold**, *italic*, [text](url), line
breaks and blank-line paragraphs, parsed into elements (never HTML)
with only safe link schemes. A list item's detail no longer uses an
em-dash.

Editor: each block type shows only its fields, with a named type and
a description, and every open block previews itself with the site's
renderer. Any repeater row can now be duplicated or have a new row
inserted below it; nested collections take `when`, and help text can
depend on the row.

src/seed-showcase.js writes a local test post using every block type
and option. It refuses the production database.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-27 16:50:21 -05:00
parent c62dc84add
commit c5f12c769f
13 changed files with 723 additions and 169 deletions

View file

@ -22,6 +22,7 @@ Backend (`server/`, Node >= 22). The server reads `HOST` (default `127.0.0.1`),
- `DB_PATH=./dev.db pnpm dev`: run with `node --watch`
- `DB_PATH=./dev.db pnpm migrate`: apply migrations without starting the server
- `DB_PATH=./dev.db node src/admin-cli.js add|list|passwd|role|disable|enable ...`: the only way accounts are created
- `DB_PATH=./dev.db node src/seed-showcase.js`: writes /blog/content-block-showcase, every content block type in one page, for checking `ContentBlocks.tsx`. Local only; refuses /var/lib/ngu.
In dev, Vite proxies `/api` to the target set in `vite.config.ts`, so the API must listen on that port.