The json-render flat Spec model and its fail-closed decoder, scoped to this
package's component set and pinned to @json-render/core v0.19.0.
A Spec is the canonical flat form: { root, elements, state } where elements is a
map keyed by id and children are referenced by string key (never nested inline).
Fail-closed. The decoder rejects, rather than silently dropping:
type (json-render's renderer is fail-open
here; we are not);repeat element with no children
(the structural floor validateSpec enforces).A rejected manifest never produces a partial tree: the host shows an error stub.
Decode a flat json-render Spec, fail-closed. See the module doc for what is
rejected. On any structural or off-catalog error the decoder fails with a diagnostic
message; the host renders an error stub rather than a partial tree.
One element: its (validated) component type, its strictly-decoded props, its child
keys, its event bindings, and an optional repeat. Mirrors json-render's UIElement
shape (type/props/children/on/repeat), minus the visible/watch siblings this
renderer does not support.
The allowlisted component types. Anything else fails the decode.
The component type's wire name, for diagnostics.
Strictly-decoded props, one variant per component type. The variant always agrees
with the element's ComponentType (both come from a single read of
the type field).
Stack layout direction.
Card props. title is optional and may be any expression.
Stack props: a layout direction and a numeric gap.
Badge props: the value expression (e.g. a status string mapped to a tone).
Button props: the label expression.
Checkbox props: an optional label and an optional checked binding (typically a
two-way $bindState / $bindItem).
GroupedTable props: the bind expression pointing at the array of rows to group
and a groupBy field name. The table groups the array of records by that field and shows
counts.
An event binding: a named verb, its (unresolved) params, and an optional confirm
dialog. The key is action/params per the pinned format, never a URL.
A confirm dialog shown by the renderer before an action emits. title and message
may be expressions (e.g. a $template interpolating a row field).
Element-level iteration: statePath points at a state array, key is the optional
stable-list item field.
A flat json-render spec: a root element key, a keyed map of elements, and the host-owned initial state.