Skip to content

Commit 8ee8dcc

Browse files
committed
docs(ui): generate the component reference from sdui.manifest.json, with a drift check
scripts/gen-sdui-reference.mjs renders content/docs/ui/components/ from the repo-root manifest: one page per namespace (html-tier elements and the plugin-* blocks each share a page), every input as a table row, and an index linking all components. --check fails when the committed pages differ; lint.yml runs it next to the manifest's own check. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwMyAnTNeas3ANYhyi
1 parent 5866877 commit 8ee8dcc

13 files changed

Lines changed: 2371 additions & 0 deletions

File tree

‎.github/workflows/lint.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,17 @@ jobs:
10131013
continue-on-error: true
10141014
run: node scripts/check-sdui-manifest.mjs --self-test && node scripts/check-sdui-manifest.mjs
10151015

1016+
# The component reference under content/docs/ui/components/ is generated
1017+
# from that same manifest by scripts/gen-sdui-reference.mjs, so it sits
1018+
# next to the manifest's own check: a PR that changes the manifest and
1019+
# not the reference reds here, and the two land in one PR. Offline and
1020+
# unfiltered for the reason the step above gives. The script header is
1021+
# the authority on the page layout and on what the drift check compares.
1022+
- name: Component reference matches the SDUI manifest
1023+
id: component-reference-matches-the-sdui-manifest
1024+
continue-on-error: true
1025+
run: pnpm check:sdui-reference
1026+
10161027
# pm-dispatch SKILL.md line ratchet (#7341 / #5925 item 7): the PM skill
10171028
# is read in full by every seat session and every Routine fire, so its
10181029
# size is a per-round tax on the whole fleet. The #7341 extraction moved
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
title: "Action components — component reference"
3+
navTitle: "Actions"
4+
description: "The action:* components that put an action on a page: a button, an icon, a group or a menu."
5+
---
6+
7+
{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Generated from sdui.manifest.json by node scripts/gen-sdui-reference.mjs; change the manifest or the generator, never this page. */}
8+
9+
The `action:*` components put an action on a page as a button, an icon button, a group of buttons or a menu.
10+
11+
<Callout type="info">
12+
This page is generated from the repo-root `sdui.manifest.json`, the component manifest CI
13+
regenerates from the renderer registry. Regenerate it with
14+
`node scripts/gen-sdui-reference.mjs`; `node scripts/gen-sdui-reference.mjs --check` fails when it is stale.
15+
</Callout>
16+
17+
## `action:button` [#action-button]
18+
19+
Namespace `action`.
20+
21+
| Input | Type | Required | Description |
22+
| :--- | :--- | :--- | :--- |
23+
| `name` | `string` | | — |
24+
| `label` | `string` | | — |
25+
| `icon` | `string` | | — |
26+
| `actionType` | `enum`: `script`, `url`, `modal`, `flow`, `api` | | — |
27+
| `target` | `string` | | — |
28+
| `variant` | `enum`: `default`, `primary`, `secondary`, `destructive`, `outline`, `ghost` | | — |
29+
| `size` | `enum`: `default`, `sm`, `md`, `lg`, `icon` | | Button size: the Button primitive's `default`, `sm`, `lg` or `icon`, plus `md`, which renders as `default` (default: `default`) |
30+
| `className` | `string` | | — |
31+
| `visible` | `boolean` \| `string` \| `object` | | Visibility predicate: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds; the button is not rendered when it is false, nor when the predicate fails to evaluate. Omit for always-visible |
32+
| `disabled` | `boolean` \| `string` \| `object` | | Disabled predicate, in the same three shapes as `visible`: the button is shown but cannot be pressed while it holds. Omit for never-disabled |
33+
| `params` | `array` | | The parameters to collect from the user before the action runs (`ActionParam` objects: `name`, `type`, `label`, …); each collected value reaches the executor under its parameter `name`. Static execution values ride `properties.params` instead |
34+
| `description` | `string` | | Action description — the parameter dialog shows it under its title |
35+
| `openIn` | `enum`: `self`, `new-tab` | | For a `url` action: `self` navigates in place, `new-tab` opens a new browser tab |
36+
| `method` | `string` | | HTTP method of an `api` action (`POST` when omitted) |
37+
| `bodyExtra` | `object` | | Static request-body fields of an `api` action, merged last, so a constant here overrides a collected value of the same name |
38+
| `bodyShape` | `enum` \| `object`: `flat` | | How an `api` action shapes its request body: `flat` (the default) or `{ wrap: KEY }` to nest the collected values under that key, with `bodyExtra` beside it |
39+
| `operation` | `enum`: `update` | | `update` declares a single-record field write: the row runs the declared action its `name` names, so it needs a `name`. The runner posts the collected values to the platform action route under that name, and the route writes that action's own `patch` |
40+
| `confirmText` | `string` | | Confirmation question asked before the action runs; the action runs only if it is confirmed |
41+
| `successMessage` | `string` | | Toast text when the action succeeds; a `${result.*}` token reads the handler's answer (e.g. `${result.id}`) |
42+
| `errorMessage` | `string` | | Toast text when the action fails, in place of the raw error |
43+
| `refreshAfter` | `boolean` | | Refresh the surrounding data after the action succeeds |
44+
| `locations` | `array` of `string` | | The placements the action declares (`list_toolbar`, `list_item`, `record_header`, …). A `script` or `flow` action declared record-scoped (`list_item`, `record_header`, `record_more` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one |
45+
| `toast` | `object` | | Toast behaviour: `{ showOnSuccess?, showOnError?, duration? }` — `false` suppresses that toast, `duration` is handed to the toast |
46+
| `resultDialog` | `object` | | One-shot result dialog for a value the response shows exactly once (a 2FA code, a fresh secret); it replaces the success toast |
47+
| `onSuccess` | `object` | | Post-success navigation `{ navigate, openIn? }`: `navigate` is a route template that can read `${result.*}`, `openIn` is `self` (the default) or `newTab` |
48+
| `objectName` | `string` | | Object the action acts on — dispatch goes to this object instead of the page's. Omit to act on the page's object |
49+
| `recordIdField` | `string` | | For a `script` action run against a single selected row: the row field whose value is sent as the record id (default `id`) |
50+
| `undoable` | `boolean` | | Offer an Undo affordance after an update action: once an `operation: update` succeeds, its success toast offers Undo, which writes back the values the fields it wrote held on the record in scope (the record page's record, or the row the host binds), provided that record carries each of them. The one limit: a button with no record in scope (standalone, or writing a record other than the one in scope) offers no Undo, because there is no row to restore |
51+
52+
## `action:group` [#action-group]
53+
54+
Namespace `action`.
55+
56+
| Input | Type | Required | Description |
57+
| :--- | :--- | :--- | :--- |
58+
| `label` | `string` | | — |
59+
| `icon` | `string` | | — |
60+
| `actions` | `array` of `object` | | The actions in this group, in order. Each member is an action object the group draws and runs itself (`name`, `label`, `icon`, `type`, `target`, `locations`, `visible`, `disabled`, …); a member's executor is its own `type` |
61+
| `display` | `enum`: `inline`, `dropdown` | | — |
62+
| `location` | `enum`: `list_toolbar`, `list_item`, `record_header`, `record_more`, `record_related`, `record_section` | | Render only the members whose `locations` include this location. Omit to render every member |
63+
| `variant` | `enum`: `default`, `secondary`, `outline`, `ghost` | | — |
64+
| `size` | `enum`: `default`, `sm`, `lg`, `icon` | | Button size for the dropdown trigger and for every inline member that sets none |
65+
| `visible` | `boolean` \| `string` \| `object` | | Visibility predicate for the whole group: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds. Omit for always-visible |
66+
| `className` | `string` | | — |
67+
68+
## `action:icon` [#action-icon]
69+
70+
Namespace `action`.
71+
72+
| Input | Type | Required | Description |
73+
| :--- | :--- | :--- | :--- |
74+
| `name` | `string` | | — |
75+
| `label` | `string` | | — |
76+
| `icon` | `string` | | — |
77+
| `actionType` | `enum`: `script`, `url`, `modal`, `flow`, `api` | | — |
78+
| `target` | `string` | | — |
79+
| `variant` | `enum`: `default`, `secondary`, `destructive`, `outline`, `ghost` | | — |
80+
| `className` | `string` | | — |
81+
| `visible` | `boolean` \| `string` \| `object` | | Visibility predicate: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds; the icon is not rendered when it is false. Omit for always-visible |
82+
| `disabled` | `boolean` \| `string` \| `object` | | Disabled predicate, in the same three shapes as `visible`: the icon is shown but cannot be pressed while it holds. Omit for never-disabled |
83+
| `params` | `array` | | The parameters to collect from the user before the action runs (`ActionParam` objects: `name`, `type`, `label`, …); each collected value reaches the executor under its parameter `name`. Static execution values ride `properties.params` instead |
84+
| `description` | `string` | | Action description — the tooltip text when there is no `label`, and what the parameter dialog shows under its title |
85+
| `openIn` | `enum`: `self`, `new-tab` | | For a `url` action: `self` navigates in place, `new-tab` opens a new browser tab |
86+
| `method` | `string` | | HTTP method of an `api` action (`POST` when omitted) |
87+
| `bodyExtra` | `object` | | Static request-body fields of an `api` action, merged last, so a constant here overrides a collected value of the same name |
88+
| `bodyShape` | `enum` \| `object`: `flat` | | How an `api` action shapes its request body: `flat` (the default) or `{ wrap: KEY }` to nest the collected values under that key, with `bodyExtra` beside it |
89+
| `operation` | `enum`: `update` | | `update` declares a single-record field write: the row runs the declared action its `name` names, so it needs a `name`. The runner posts the collected values to the platform action route under that name, and the route writes that action's own `patch` |
90+
| `confirmText` | `string` | | Confirmation question asked before the action runs; the action runs only if it is confirmed |
91+
| `successMessage` | `string` | | Toast text when the action succeeds; a `${result.*}` token reads the handler's answer (e.g. `${result.id}`) |
92+
| `errorMessage` | `string` | | Toast text when the action fails, in place of the raw error |
93+
| `refreshAfter` | `boolean` | | Refresh the surrounding data after the action succeeds |
94+
| `locations` | `array` of `string` | | The placements the action declares (`list_toolbar`, `list_item`, `record_header`, …). A `script` or `flow` action declared record-scoped (`list_item`, `record_header`, `record_more` or `record_section`) refuses to run when no record or single selection is in scope, instead of running without one |
95+
| `toast` | `object` | | Toast behaviour: `{ showOnSuccess?, showOnError?, duration? }` — `false` suppresses that toast, `duration` is handed to the toast |
96+
| `resultDialog` | `object` | | One-shot result dialog for a value the response shows exactly once (a 2FA code, a fresh secret); it replaces the success toast |
97+
| `onSuccess` | `object` | | Post-success navigation `{ navigate, openIn? }`: `navigate` is a route template that can read `${result.*}`, `openIn` is `self` (the default) or `newTab` |
98+
| `objectName` | `string` | | Object the action acts on — dispatch goes to this object instead of the page's. Omit to act on the page's object |
99+
100+
## `action:menu` [#action-menu]
101+
102+
Namespace `action`.
103+
104+
| Input | Type | Required | Description |
105+
| :--- | :--- | :--- | :--- |
106+
| `label` | `string` | | — |
107+
| `icon` | `string` | | — |
108+
| `actions` | `array` of `object` | | The menu's actions, in order. Each member is an action object the menu draws and runs itself (`name`, `label`, `icon`, `type`, `target`, `visible`, `disabled`, `tags`, …); a member's executor is its own `type` |
109+
| `variant` | `enum`: `default`, `secondary`, `outline`, `ghost` | | — |
110+
| `size` | `enum`: `default`, `sm`, `lg`, `icon` | | Trigger button size (renderer default: `icon`) |
111+
| `visible` | `boolean` \| `string` \| `object` | | Visibility predicate for the whole menu: `true`/`false`, a bare CEL expression, or the `{ dialect: 'cel', source }` envelope, evaluated against the row the host binds; a predicate that fails to evaluate hides it. Omit for always-visible |
112+
| `className` | `string` | | — |
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: "Element components — component reference"
3+
navTitle: "Elements"
4+
description: "The element:* components: text, numbers, buttons, dividers, definition lists and repeaters."
5+
---
6+
7+
{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Generated from sdui.manifest.json by node scripts/gen-sdui-reference.mjs; change the manifest or the generator, never this page. */}
8+
9+
The `element:*` components are small, self-contained page elements.
10+
11+
<Callout type="info">
12+
This page is generated from the repo-root `sdui.manifest.json`, the component manifest CI
13+
regenerates from the renderer registry. Regenerate it with
14+
`node scripts/gen-sdui-reference.mjs`; `node scripts/gen-sdui-reference.mjs --check` fails when it is stale.
15+
</Callout>
16+
17+
## `element:button` [#element-button]
18+
19+
Namespace `element`.
20+
21+
| Input | Type | Required | Description |
22+
| :--- | :--- | :--- | :--- |
23+
| `label` | `string` \| `object` | yes | Accepts an inline translation map (\{ en, "zh-CN", … \}) |
24+
| `action` | `object` | | Inline ActionDef executed on click (url / navigation / api / script / modal / flow); omitted → renders inert |
25+
| `variant` | `enum`: `primary`, `secondary`, `danger`, `ghost`, `link` | | — |
26+
| `size` | `enum`: `small`, `medium`, `large` | | — |
27+
| `icon` | `string` | | Lucide icon name |
28+
| `iconPosition` | `enum`: `left`, `right` | | — |
29+
| `disabled` | `boolean` | | — |
30+
31+
## `element:definition-list` [#element-definition-list]
32+
33+
Namespace `element`.
34+
35+
| Input | Type | Required | Description |
36+
| :--- | :--- | :--- | :--- |
37+
| `items` | `array` of `object` | | Term/description pairs [\{ term, description \}], in order: `term` is the row label, `description` is shown as-is (an object as JSON, an omitted one as an em dash). Omitted or empty renders the empty state: the active language’s "No data" (`common.noData`) |
38+
| `columns` | `enum`: `[object Object]`, `[object Object]` | | Grid columns from the small breakpoint up: the NUMBER 1 or 2 (default 1) |
39+
| `inline` | `boolean` | | Term and description on one baseline-aligned row |
40+
41+
## `element:divider` [#element-divider]
42+
43+
Namespace `element`.
44+
45+
It takes no inputs.
46+
47+
## `element:number` [#element-number]
48+
49+
Namespace `element`.
50+
51+
| Input | Type | Required | Description |
52+
| :--- | :--- | :--- | :--- |
53+
| `aggregate` | `enum`: `count`, `sum`, `avg`, `min`, `max` | yes | — |
54+
| `field` | `string` | | Measure field (required for every aggregate except count) |
55+
| `format` | `enum`: `number`, `currency`, `percent` | | — |
56+
| `prefix` | `string` | | — |
57+
| `suffix` | `string` | | — |
58+
| `dataSource` | `object` (`object` data binding) | | Per-element data binding: \{ object, view, filter, sort, limit \}. Overrides the page-level object context for this block; `view` names a saved view of `object`, and `filter` is ANDed with the view’s own rather than replacing it. |
59+
60+
## `element:repeater` [#element-repeater]
61+
62+
Namespace `element`.
63+
64+
| Input | Type | Required | Description |
65+
| :--- | :--- | :--- | :--- |
66+
| `titleField` | `string` | | — |
67+
| `fields` | `array` | | Fields shown after the title on each line, in order: a bare field name, or `{ field }` |
68+
| `emptyText` | `string` | | — |
69+
| `divided` | `boolean` | | Separator between rows |
70+
| `dataSource` | `object` (`object` data binding) | | Per-element data binding: \{ object, view, filter, sort, limit \}. Overrides the page-level object context for this block; `view` names a saved view of `object`, and `filter` is ANDed with the view’s own rather than replacing it. |
71+
72+
## `element:text` [#element-text]
73+
74+
Namespace `element`.
75+
76+
| Input | Type | Required | Description |
77+
| :--- | :--- | :--- | :--- |
78+
| `content` | `string` \| `object` | yes | Accepts an inline translation map (\{ en, "zh-CN", … \}) |
79+
| `variant` | `enum`: `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `body`, `caption`, `overline` | | One of the nine text styles ui:text uses: h1-h6 (rendered as that heading level), body, caption or overline. The earlier spellings heading and subheading are refused; write h2 or h3 instead. |
80+
| `align` | `enum`: `left`, `center`, `right` | | — |

0 commit comments

Comments
 (0)