mdx-artifacts 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +211 -59
- package/README.zh-CN.md +299 -42
- package/agents/AGENTS.snippet.md +21 -10
- package/artifact-docs/examples/commentable-feedback.mdx +76 -70
- package/artifact-docs/examples/decision-matrix.mdx +122 -50
- package/artifact-docs/examples/layout-composition.mdx +106 -128
- package/artifact-docs/examples/streamlit-style-mixed.mdx +100 -85
- package/dist/lib/cli/{build.js → commands/build.js} +2 -2
- package/dist/lib/cli/{components.js → commands/components.js} +19 -3
- package/dist/lib/cli/{dev.js → commands/dev.js} +2 -2
- package/dist/lib/cli/commands/interactions.d.ts +2 -0
- package/dist/lib/cli/commands/interactions.js +280 -0
- package/dist/lib/cli/commands/review.d.ts +1 -0
- package/dist/lib/cli/commands/review.js +171 -0
- package/dist/lib/cli/commands/scaffold.d.ts +16 -0
- package/dist/lib/cli/commands/scaffold.js +440 -0
- package/dist/lib/cli/commands/validate.d.ts +18 -0
- package/dist/lib/cli/commands/validate.js +311 -0
- package/dist/lib/cli/config/config.d.ts +2 -0
- package/dist/lib/cli/{config.js → config/config.js} +3 -2
- package/dist/lib/cli/{types.d.ts → config/types.d.ts} +2 -1
- package/dist/lib/cli/{vite-artifact.d.ts → dev-server/vite-artifact.d.ts} +3 -3
- package/dist/lib/cli/{vite-artifact.js → dev-server/vite-artifact.js} +170 -10
- package/dist/lib/cli/diagnostics/diagnostics.d.ts +11 -0
- package/dist/lib/cli/diagnostics/diagnostics.js +1 -0
- package/dist/lib/cli/index.js +39 -18
- package/dist/lib/cli/mdx/sortable-list.d.ts +14 -0
- package/dist/lib/cli/mdx/sortable-list.js +520 -0
- package/dist/lib/cli/resources/resource-policy.d.ts +15 -0
- package/dist/lib/cli/resources/resource-policy.js +46 -0
- package/dist/lib/cli/resources/safe-path.d.ts +13 -0
- package/dist/lib/cli/resources/safe-path.js +55 -0
- package/dist/lib/cli/services/interaction-service.d.ts +40 -0
- package/dist/lib/cli/services/interaction-service.js +226 -0
- package/dist/lib/cli/services/review.d.ts +43 -0
- package/dist/lib/cli/{review.js → services/review.js} +34 -172
- package/dist/lib/react/{components → composites/comparison-set}/ComparisonSet.d.ts +1 -1
- package/dist/lib/react/{components → composites/comparison-set}/ComparisonSet.js +3 -3
- package/dist/lib/react/composites/comparison-set/index.d.ts +2 -0
- package/dist/lib/react/composites/comparison-set/index.js +1 -0
- package/dist/lib/react/composites/content-set/ContentItem.d.ts +37 -0
- package/dist/lib/react/composites/content-set/ContentItem.js +49 -0
- package/dist/lib/react/composites/content-set/index.d.ts +2 -0
- package/dist/lib/react/composites/content-set/index.js +1 -0
- package/dist/lib/react/{components → composites/export-panel}/ExportPanel.js +2 -2
- package/dist/lib/react/composites/export-panel/index.d.ts +2 -0
- package/dist/lib/react/composites/export-panel/index.js +1 -0
- package/dist/lib/react/{components → composites/section}/Section.js +1 -1
- package/dist/lib/react/composites/section/index.d.ts +2 -0
- package/dist/lib/react/composites/section/index.js +1 -0
- package/dist/lib/react/index.d.ts +36 -31
- package/dist/lib/react/index.js +18 -15
- package/dist/lib/react/interactions/artifact-state/index.d.ts +1 -0
- package/dist/lib/react/interactions/artifact-state/index.js +1 -0
- package/dist/lib/react/{components → interactions/comments}/Comments.d.ts +2 -2
- package/dist/lib/react/{components → interactions/comments}/Comments.js +3 -3
- package/dist/lib/react/interactions/comments/index.d.ts +1 -0
- package/dist/lib/react/interactions/comments/index.js +1 -0
- package/dist/lib/react/interactions/sortable-list/SortableList.d.ts +29 -0
- package/dist/lib/react/interactions/sortable-list/SortableList.js +282 -0
- package/dist/lib/react/interactions/sortable-list/index.d.ts +1 -0
- package/dist/lib/react/interactions/sortable-list/index.js +1 -0
- package/dist/lib/react/layout/layout-primitives/index.d.ts +2 -0
- package/dist/lib/react/layout/layout-primitives/index.js +1 -0
- package/dist/lib/react/legacy/LegacyContentComponents.d.ts +65 -0
- package/dist/lib/react/legacy/LegacyContentComponents.js +26 -0
- package/dist/lib/react/mdx-components.d.ts +5 -0
- package/dist/lib/react/mdx-components.js +38 -0
- package/dist/lib/react/{components → primitives/annotated-code}/AnnotatedCode.d.ts +1 -1
- package/dist/lib/react/{components → primitives/annotated-code}/AnnotatedCode.js +5 -5
- package/dist/lib/react/primitives/annotated-code/index.d.ts +2 -0
- package/dist/lib/react/primitives/annotated-code/index.js +1 -0
- package/dist/lib/react/primitives/callout/Callout.d.ts +11 -0
- package/dist/lib/react/{components → primitives/callout}/Callout.js +9 -6
- package/dist/lib/react/primitives/callout/index.d.ts +2 -0
- package/dist/lib/react/primitives/callout/index.js +1 -0
- package/dist/lib/react/primitives/code-block/CodeBlock.d.ts +20 -0
- package/dist/lib/react/primitives/code-block/CodeBlock.js +32 -0
- package/dist/lib/react/primitives/code-block/index.d.ts +2 -0
- package/dist/lib/react/primitives/code-block/index.js +1 -0
- package/dist/lib/react/primitives/code-surface/CodeSurface.d.ts +11 -0
- package/dist/lib/react/primitives/code-surface/CodeSurface.js +34 -0
- package/dist/lib/react/primitives/code-surface/index.d.ts +2 -0
- package/dist/lib/react/primitives/code-surface/index.js +1 -0
- package/dist/lib/react/primitives/diff-block/DiffBlock.js +25 -0
- package/dist/lib/react/primitives/diff-block/index.d.ts +2 -0
- package/dist/lib/react/primitives/diff-block/index.js +1 -0
- package/dist/lib/react/{components → primitives/inline-text}/InlineText.d.ts +4 -2
- package/dist/lib/react/primitives/inline-text/InlineText.js +28 -0
- package/dist/lib/react/primitives/inline-text/index.d.ts +2 -0
- package/dist/lib/react/primitives/inline-text/index.js +1 -0
- package/dist/lib/react/primitives/markdown-body/MarkdownBody.d.ts +9 -0
- package/dist/lib/react/primitives/markdown-body/MarkdownBody.js +49 -0
- package/dist/lib/react/primitives/markdown-body/index.d.ts +2 -0
- package/dist/lib/react/primitives/markdown-body/index.js +1 -0
- package/dist/lib/react/primitives/severity-badge/index.d.ts +2 -0
- package/dist/lib/react/primitives/severity-badge/index.js +1 -0
- package/dist/lib/react/registry.d.ts +10 -0
- package/dist/lib/react/registry.js +505 -210
- package/dist/lib/react/styles.css +490 -38
- package/docs/cli-structure.md +141 -0
- package/docs/component-protocol.md +199 -33
- package/docs/component-taxonomy.md +40 -4
- package/docs/design.md +42 -21
- package/docs/design.zh-CN.md +41 -21
- package/docs/naming.md +17 -7
- package/docs/releasing.md +132 -0
- package/docs/testing.md +35 -10
- package/package.json +9 -7
- package/dist/lib/cli/config.d.ts +0 -2
- package/dist/lib/cli/review.d.ts +0 -33
- package/dist/lib/cli/scaffold.d.ts +0 -1
- package/dist/lib/cli/scaffold.js +0 -56
- package/dist/lib/cli/validate.d.ts +0 -6
- package/dist/lib/cli/validate.js +0 -79
- package/dist/lib/react/components/Callout.d.ts +0 -9
- package/dist/lib/react/components/CodeBlock.d.ts +0 -10
- package/dist/lib/react/components/CodeBlock.js +0 -28
- package/dist/lib/react/components/DecisionMatrix.d.ts +0 -16
- package/dist/lib/react/components/DecisionMatrix.js +0 -27
- package/dist/lib/react/components/DiffBlock.js +0 -24
- package/dist/lib/react/components/InlineText.js +0 -18
- package/dist/lib/react/components/MarkdownBody.d.ts +0 -7
- package/dist/lib/react/components/MarkdownBody.js +0 -36
- package/dist/lib/react/components/OptionGrid.d.ts +0 -13
- package/dist/lib/react/components/OptionGrid.js +0 -21
- /package/dist/lib/cli/{build.d.ts → commands/build.d.ts} +0 -0
- /package/dist/lib/cli/{components.d.ts → commands/components.d.ts} +0 -0
- /package/dist/lib/cli/{dev.d.ts → commands/dev.d.ts} +0 -0
- /package/dist/lib/cli/{types.js → config/types.js} +0 -0
- /package/dist/lib/cli/{artifact-state.d.ts → state/artifact-state.d.ts} +0 -0
- /package/dist/lib/cli/{artifact-state.js → state/artifact-state.js} +0 -0
- /package/dist/lib/react/{components → composites/export-panel}/ExportPanel.d.ts +0 -0
- /package/dist/lib/react/{components → composites/section}/Section.d.ts +0 -0
- /package/dist/lib/react/{components → interactions/artifact-state}/ArtifactState.d.ts +0 -0
- /package/dist/lib/react/{components → interactions/artifact-state}/ArtifactState.js +0 -0
- /package/dist/lib/react/{components → layout/layout-primitives}/Layout.d.ts +0 -0
- /package/dist/lib/react/{components → layout/layout-primitives}/Layout.js +0 -0
- /package/dist/lib/react/{components → primitives/diff-block}/DiffBlock.d.ts +0 -0
- /package/dist/lib/react/{components → primitives/severity-badge}/SeverityBadge.d.ts +0 -0
- /package/dist/lib/react/{components → primitives/severity-badge}/SeverityBadge.js +0 -0
|
@@ -1,17 +1,53 @@
|
|
|
1
|
+
const contentBlockGuidance = [
|
|
2
|
+
"Use title, badge, and summary for short visible display slots.",
|
|
3
|
+
"Use MDX children for long explanations, rationale, pros, cons, risks, and lists.",
|
|
4
|
+
"Do not invent Markdown heading parsers for slot names inside children."
|
|
5
|
+
];
|
|
6
|
+
const structuredRendererGuidance = [
|
|
7
|
+
"Keep domain data in explicit structured props.",
|
|
8
|
+
"Use ids for stable review anchors when the rendered block should be commentable.",
|
|
9
|
+
"Do not move code, diff rows, or line annotations into free-form prose children."
|
|
10
|
+
];
|
|
11
|
+
const layoutPrimitiveGuidance = [
|
|
12
|
+
"Use only when semantic components cannot express the arrangement.",
|
|
13
|
+
"Keep props focused on layout concerns such as spacing, ratios, collapse behavior, and surface treatment.",
|
|
14
|
+
"Do not encode workflow or domain semantics in layout wrappers."
|
|
15
|
+
];
|
|
16
|
+
const interactiveDataGuidance = [
|
|
17
|
+
"Use structured props for ids, labels, tags, and initial state.",
|
|
18
|
+
"Keep item fields short; do not put long prose or Markdown blocks into item records.",
|
|
19
|
+
"Persist user-controlled order or state through artifact interactions when available."
|
|
20
|
+
];
|
|
21
|
+
const exportEditorGuidance = [
|
|
22
|
+
"Keep handoff data in structured value or state props.",
|
|
23
|
+
"Use formats and titles for export UX, not for artifact domain modeling.",
|
|
24
|
+
"Prefer ExportPanel when an artifact needs to return decisions, edits, or comments to the workflow."
|
|
25
|
+
];
|
|
26
|
+
const reviewBoundaryGuidance = [
|
|
27
|
+
"Use stable ids for durable comment anchors.",
|
|
28
|
+
"Wrap the smallest meaningful review target, not decorative layout fragments.",
|
|
29
|
+
"Keep children as the visible content being reviewed."
|
|
30
|
+
];
|
|
1
31
|
export const componentRegistry = [
|
|
2
32
|
{
|
|
3
33
|
name: "InlineText",
|
|
4
34
|
category: "content",
|
|
5
35
|
stability: "stable",
|
|
6
|
-
|
|
36
|
+
authoring: { kind: "content-block", guidance: contentBlockGuidance },
|
|
37
|
+
description: "Renders children-first short single-line text with controlled inline Markdown.",
|
|
7
38
|
useWhen: ["Titles", "Labels", "Captions", "Short notes", "Inline explanations"],
|
|
8
39
|
props: [
|
|
40
|
+
{
|
|
41
|
+
name: "children",
|
|
42
|
+
type: "ReactNode",
|
|
43
|
+
contentType: "inlineMarkdown",
|
|
44
|
+
description: "Preferred short inline Markdown content."
|
|
45
|
+
},
|
|
9
46
|
{
|
|
10
47
|
name: "text",
|
|
11
48
|
type: "string",
|
|
12
49
|
contentType: "inlineMarkdown",
|
|
13
|
-
|
|
14
|
-
description: "Short text. Supports bold, emphasis, strikethrough, inline code, and links."
|
|
50
|
+
description: "Legacy short text prop. Prefer children for human-readable content."
|
|
15
51
|
},
|
|
16
52
|
{
|
|
17
53
|
name: "as",
|
|
@@ -24,25 +60,29 @@ export const componentRegistry = [
|
|
|
24
60
|
description: "Visual text variant."
|
|
25
61
|
}
|
|
26
62
|
],
|
|
27
|
-
example: `<InlineText
|
|
28
|
-
as
|
|
29
|
-
|
|
30
|
-
text="Use **MDX** as source and ~~raw HTML~~ only as fallback."
|
|
31
|
-
/>`
|
|
63
|
+
example: `<InlineText as="h3" variant="subtitle">
|
|
64
|
+
Use **MDX** as source and ~~raw HTML~~ only as fallback.
|
|
65
|
+
</InlineText>`
|
|
32
66
|
},
|
|
33
67
|
{
|
|
34
68
|
name: "MarkdownBody",
|
|
35
69
|
category: "content",
|
|
36
70
|
stability: "stable",
|
|
37
|
-
|
|
71
|
+
authoring: { kind: "content-block", guidance: contentBlockGuidance },
|
|
72
|
+
description: "Renders children-first controlled multi-line Markdown for component body copy.",
|
|
38
73
|
useWhen: ["Component body explanations", "Controlled lists inside components", "Component-local prose"],
|
|
39
74
|
props: [
|
|
75
|
+
{
|
|
76
|
+
name: "children",
|
|
77
|
+
type: "ReactNode",
|
|
78
|
+
contentType: "blockMarkdown",
|
|
79
|
+
description: "Preferred body content. Use MDX children for human-readable prose, lists, and local explanations."
|
|
80
|
+
},
|
|
40
81
|
{
|
|
41
82
|
name: "body",
|
|
42
83
|
type: "string",
|
|
43
84
|
contentType: "blockMarkdown",
|
|
44
|
-
|
|
45
|
-
description: "Multi-line Markdown. Supports headings, paragraphs, lists, blockquotes, bold, emphasis, strikethrough, inline code, and links. Use native MDX children inside Section for document-level prose."
|
|
85
|
+
description: "Legacy multi-line Markdown body prop. Prefer children for human-readable content. Supports headings, paragraphs, lists, blockquotes, bold, emphasis, strikethrough, inline code, and links."
|
|
46
86
|
},
|
|
47
87
|
{
|
|
48
88
|
name: "variant",
|
|
@@ -50,20 +90,353 @@ export const componentRegistry = [
|
|
|
50
90
|
description: "Body density variant."
|
|
51
91
|
}
|
|
52
92
|
],
|
|
53
|
-
example: `<MarkdownBody
|
|
54
|
-
|
|
93
|
+
example: `<MarkdownBody>
|
|
94
|
+
Use MarkdownBody when a component needs controlled body copy:
|
|
55
95
|
|
|
56
96
|
- **Readable** paragraphs and lists
|
|
57
97
|
- \\\`inline code\\\` for short technical names
|
|
58
98
|
- Headings for local body sections
|
|
59
|
-
- No tables, HTML, math, or code blocks
|
|
99
|
+
- No tables, HTML, math, or code blocks
|
|
100
|
+
</MarkdownBody>`
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "ContentItem",
|
|
104
|
+
category: "content",
|
|
105
|
+
stability: "stable",
|
|
106
|
+
authoring: { kind: "content-block", guidance: contentBlockGuidance },
|
|
107
|
+
description: "Renders one reusable content card with display slots, tone color, emphasis weight, and Markdown-rich body content.",
|
|
108
|
+
useWhen: ["Standalone content cards", "Recommendations", "Risks", "Highlights", "Reusable item blocks"],
|
|
109
|
+
props: [
|
|
110
|
+
{
|
|
111
|
+
name: "id",
|
|
112
|
+
type: "string",
|
|
113
|
+
contentType: "plainText",
|
|
114
|
+
description: "Optional stable anchor id for comments and state. Prefer short semantic ids such as risk.api-boundary."
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "title",
|
|
118
|
+
type: "string",
|
|
119
|
+
contentType: "inlineMarkdown",
|
|
120
|
+
required: true,
|
|
121
|
+
description: "Primary visible label for this item."
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "badge",
|
|
125
|
+
type: "string",
|
|
126
|
+
contentType: "plainText",
|
|
127
|
+
description: "Optional short visible label. Badge text does not choose color; tone controls color."
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "summary",
|
|
131
|
+
type: "string",
|
|
132
|
+
contentType: "inlineMarkdown",
|
|
133
|
+
description: "Optional one-line summary. Use children for longer explanations and lists."
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "icon",
|
|
137
|
+
type: "ReactNode",
|
|
138
|
+
description: "Optional decorative marker rendered in the component-defined title area. Emoji are recommended for agent-authored artifacts; project icon components may be passed when needed."
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "tone",
|
|
142
|
+
type: "'neutral' | 'info' | 'positive' | 'warning' | 'danger' | 'accent'",
|
|
143
|
+
description: "Semantic color tone. Defaults to neutral."
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "emphasis",
|
|
147
|
+
type: "'default' | 'primary' | 'subtle'",
|
|
148
|
+
description: "Structural visual weight. Defaults to default."
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "children",
|
|
152
|
+
type: "ReactNode",
|
|
153
|
+
contentType: "blockMarkdown",
|
|
154
|
+
description: "Markdown-rich body content for rationale, lists, caveats, or supporting prose."
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
example: `<ContentItem
|
|
158
|
+
id="item.component-first"
|
|
159
|
+
title="Component-first authoring"
|
|
160
|
+
badge="Recommended"
|
|
161
|
+
icon="✅"
|
|
162
|
+
tone="positive"
|
|
163
|
+
emphasis="primary"
|
|
164
|
+
summary="Best when the artifact needs stable interaction and visual structure."
|
|
165
|
+
>
|
|
166
|
+
### Tradeoffs
|
|
167
|
+
|
|
168
|
+
- Clear component boundaries
|
|
169
|
+
- Easy to debug
|
|
170
|
+
- Less natural than plain Markdown for long prose
|
|
171
|
+
</ContentItem>`
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "ContentSet",
|
|
175
|
+
category: "artifact",
|
|
176
|
+
stability: "stable",
|
|
177
|
+
authoring: { kind: "content-block", guidance: contentBlockGuidance },
|
|
178
|
+
description: "Groups same-kind content items in a grid or stack while preserving item-level tone, emphasis, and comment anchors.",
|
|
179
|
+
useWhen: ["Option groups", "Risk groups", "Recommendation sets", "Finding lists", "Comparable content cards"],
|
|
180
|
+
props: [
|
|
181
|
+
{
|
|
182
|
+
name: "id",
|
|
183
|
+
type: "string",
|
|
184
|
+
contentType: "plainText",
|
|
185
|
+
description: "Optional stable parent anchor id. Child item anchors become parentId.itemId when provided."
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: "title",
|
|
189
|
+
type: "string",
|
|
190
|
+
contentType: "inlineMarkdown",
|
|
191
|
+
required: true,
|
|
192
|
+
description: "Visible title for the content set."
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "children",
|
|
196
|
+
type: "ReactNode",
|
|
197
|
+
required: true,
|
|
198
|
+
description: "Use ContentSet.Item children. Each item uses title, badge, summary, tone, emphasis, and Markdown body."
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "icon",
|
|
202
|
+
type: "ReactNode",
|
|
203
|
+
description: "Optional decorative marker rendered beside the set title. It describes the group and is not inherited by items."
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: "layout",
|
|
207
|
+
type: "'grid' | 'stack'",
|
|
208
|
+
description: "Item arrangement. Defaults to grid."
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "columns",
|
|
212
|
+
type: "2 | 3 | 4 | 5",
|
|
213
|
+
description: "Grid column count on desktop. Defaults to 3. Stack layout ignores this."
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: "surface",
|
|
217
|
+
type: "'plain' | 'subtle' | 'outlined'",
|
|
218
|
+
description: "Container surface treatment. Defaults to plain. Use outlined when the set should read as a bounded section."
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: "tone",
|
|
222
|
+
type: "'neutral' | 'info' | 'positive' | 'warning' | 'danger' | 'accent'",
|
|
223
|
+
description: "Optional default tone inherited by ContentSet.Item children."
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: "emphasis",
|
|
227
|
+
type: "'default' | 'primary' | 'subtle'",
|
|
228
|
+
description: "Optional default emphasis inherited by ContentSet.Item children."
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
types: [
|
|
232
|
+
{
|
|
233
|
+
name: "ContentSet.Item",
|
|
234
|
+
description: "Compound child used inside ContentSet. It renders the same visual structure as ContentItem.",
|
|
235
|
+
fields: [
|
|
236
|
+
{
|
|
237
|
+
name: "id",
|
|
238
|
+
type: "string",
|
|
239
|
+
contentType: "plainText",
|
|
240
|
+
description: "Optional stable child anchor id. When the parent has id, child anchors become parentId.itemId."
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: "title",
|
|
244
|
+
type: "string",
|
|
245
|
+
contentType: "inlineMarkdown",
|
|
246
|
+
required: true,
|
|
247
|
+
description: "Primary visible item label."
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "badge",
|
|
251
|
+
type: "string",
|
|
252
|
+
contentType: "plainText",
|
|
253
|
+
description: "Optional short visible label."
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
name: "summary",
|
|
257
|
+
type: "string",
|
|
258
|
+
contentType: "inlineMarkdown",
|
|
259
|
+
description: "Optional one-line summary. Use children for longer explanations and lists."
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: "icon",
|
|
263
|
+
type: "ReactNode",
|
|
264
|
+
description: "Optional decorative marker rendered in the item title area. Use text props and tone for semantic meaning."
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: "tone",
|
|
268
|
+
type: "'neutral' | 'info' | 'positive' | 'warning' | 'danger' | 'accent'",
|
|
269
|
+
description: "Optional item tone. Overrides the parent tone."
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: "emphasis",
|
|
273
|
+
type: "'default' | 'primary' | 'subtle'",
|
|
274
|
+
description: "Optional item emphasis. Overrides the parent emphasis."
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
name: "children",
|
|
278
|
+
type: "ReactNode",
|
|
279
|
+
contentType: "blockMarkdown",
|
|
280
|
+
description: "Markdown-rich item body."
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
example: `<ContentSet id="set.authoring-paths" title="Authoring paths" icon="🧭" layout="grid" columns={3} surface="subtle">
|
|
286
|
+
<ContentSet.Item
|
|
287
|
+
id="component-first"
|
|
288
|
+
title="Component-first"
|
|
289
|
+
badge="Recommended"
|
|
290
|
+
icon="✅"
|
|
291
|
+
tone="positive"
|
|
292
|
+
emphasis="primary"
|
|
293
|
+
summary="Best for stable interaction and visual structure."
|
|
294
|
+
>
|
|
295
|
+
### Tradeoffs
|
|
296
|
+
|
|
297
|
+
- Clear component boundaries
|
|
298
|
+
- Easy to debug
|
|
299
|
+
- Less natural for long prose
|
|
300
|
+
</ContentSet.Item>
|
|
301
|
+
</ContentSet>`
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
name: "SortableList",
|
|
305
|
+
category: "artifact",
|
|
306
|
+
stability: "stable",
|
|
307
|
+
authoring: { kind: "interactive-data", guidance: interactiveDataGuidance },
|
|
308
|
+
description: "Renders a draggable priority list from structured item data and persists the user-controlled order.",
|
|
309
|
+
useWhen: ["Priority sorting", "Ranked handoff tasks", "User-adjustable queues", "Structured ordering decisions"],
|
|
310
|
+
props: [
|
|
311
|
+
{
|
|
312
|
+
name: "id",
|
|
313
|
+
type: "string",
|
|
314
|
+
contentType: "plainText",
|
|
315
|
+
required: true,
|
|
316
|
+
description: "Stable interaction id used for review anchors and artifact state."
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
name: "title",
|
|
320
|
+
type: "string",
|
|
321
|
+
contentType: "inlineMarkdown",
|
|
322
|
+
required: true,
|
|
323
|
+
description: "Visible title for the sortable list."
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: "summary",
|
|
327
|
+
type: "string",
|
|
328
|
+
contentType: "inlineMarkdown",
|
|
329
|
+
description: "Optional one-line explanation for the sorting task."
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
name: "items",
|
|
333
|
+
type: "SortableListItem[]",
|
|
334
|
+
required: true,
|
|
335
|
+
description: "Structured item records. Keep fields short; use this component for interactive ordering, not long Markdown prose."
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: "surface",
|
|
339
|
+
type: "'plain' | 'subtle' | 'outlined'",
|
|
340
|
+
description: "Container surface treatment. Defaults to outlined."
|
|
341
|
+
}
|
|
342
|
+
],
|
|
343
|
+
types: [
|
|
344
|
+
{
|
|
345
|
+
name: "SortableListItem",
|
|
346
|
+
description: "One short structured item in a SortableList.",
|
|
347
|
+
fields: [
|
|
348
|
+
{
|
|
349
|
+
name: "id",
|
|
350
|
+
type: "string",
|
|
351
|
+
contentType: "plainText",
|
|
352
|
+
required: true,
|
|
353
|
+
description: "Stable item id used in orderedIds exports."
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
name: "title",
|
|
357
|
+
type: "string",
|
|
358
|
+
contentType: "inlineMarkdown",
|
|
359
|
+
required: true,
|
|
360
|
+
description: "Primary visible item label."
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
name: "summary",
|
|
364
|
+
type: "string",
|
|
365
|
+
contentType: "inlineMarkdown",
|
|
366
|
+
description: "Optional one-line item context."
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
name: "badge",
|
|
370
|
+
type: "string",
|
|
371
|
+
contentType: "plainText",
|
|
372
|
+
description: "Optional short priority or status label."
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
name: "tags",
|
|
376
|
+
type: "string[]",
|
|
377
|
+
contentType: "json",
|
|
378
|
+
description: "Optional short labels for filtering or scanning."
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
name: "disabled",
|
|
382
|
+
type: "boolean",
|
|
383
|
+
description: "When true, the item is visible but cannot be moved by the user."
|
|
384
|
+
}
|
|
385
|
+
]
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
name: "SortableListInteraction",
|
|
389
|
+
description: "Persisted artifact interaction written after the user changes order.",
|
|
390
|
+
fields: [
|
|
391
|
+
{
|
|
392
|
+
name: "type",
|
|
393
|
+
type: "'sortable-list'",
|
|
394
|
+
required: true,
|
|
395
|
+
description: "Interaction discriminator."
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
name: "orderedIds",
|
|
399
|
+
type: "string[]",
|
|
400
|
+
required: true,
|
|
401
|
+
description: "Current user-controlled item order."
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
name: "orderedItems",
|
|
405
|
+
type: "SortableListItem[]",
|
|
406
|
+
required: true,
|
|
407
|
+
description: "Current ordered item records for export handoff."
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
}
|
|
411
|
+
],
|
|
412
|
+
example: `<SortableList
|
|
413
|
+
id="list.launch-priority"
|
|
414
|
+
title="Launch priority"
|
|
415
|
+
summary="Drag items or use the controls to change the handoff order."
|
|
416
|
+
items={[
|
|
417
|
+
{
|
|
418
|
+
id: "contentset-api",
|
|
419
|
+
title: "Stabilize ContentSet API",
|
|
420
|
+
summary: "Must land before public examples.",
|
|
421
|
+
badge: "P0",
|
|
422
|
+
tags: ["api", "docs"]
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
id: "layout-guidance",
|
|
426
|
+
title: "Clarify layout guidance",
|
|
427
|
+
summary: "Explain Frame, Columns, Section, and ContentSet boundaries.",
|
|
428
|
+
badge: "P1",
|
|
429
|
+
tags: ["protocol"]
|
|
430
|
+
}
|
|
431
|
+
]}
|
|
60
432
|
/>`
|
|
61
433
|
},
|
|
62
434
|
{
|
|
63
435
|
name: "CodeBlock",
|
|
64
436
|
category: "content",
|
|
65
437
|
stability: "stable",
|
|
66
|
-
|
|
438
|
+
authoring: { kind: "structured-renderer", guidance: structuredRendererGuidance },
|
|
439
|
+
description: "Renders code text with optional filename, language label, line numbers, copy control, and highlighted lines.",
|
|
67
440
|
useWhen: ["Code examples", "Implementation notes", "Technical explanations", "Code review context"],
|
|
68
441
|
props: [
|
|
69
442
|
{
|
|
@@ -99,6 +472,11 @@ export const componentRegistry = [
|
|
|
99
472
|
name: "highlightLines",
|
|
100
473
|
type: "number[]",
|
|
101
474
|
description: "One-based line numbers to visually emphasize."
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
name: "copyable",
|
|
478
|
+
type: "boolean",
|
|
479
|
+
description: "Shows a copy button when true."
|
|
102
480
|
}
|
|
103
481
|
],
|
|
104
482
|
example: `<CodeBlock
|
|
@@ -116,6 +494,7 @@ export const componentRegistry = [
|
|
|
116
494
|
name: "DiffBlock",
|
|
117
495
|
category: "content",
|
|
118
496
|
stability: "stable",
|
|
497
|
+
authoring: { kind: "structured-renderer", guidance: structuredRendererGuidance },
|
|
119
498
|
description: "Renders structured diff lines with add, remove, and context rows plus a compact effective line number column.",
|
|
120
499
|
useWhen: ["Code review context", "Patch explanations", "Before and after code changes", "Implementation reports"],
|
|
121
500
|
props: [
|
|
@@ -191,6 +570,7 @@ export const componentRegistry = [
|
|
|
191
570
|
name: "SeverityBadge",
|
|
192
571
|
category: "semantic",
|
|
193
572
|
stability: "stable",
|
|
573
|
+
authoring: { kind: "content-block", guidance: contentBlockGuidance },
|
|
194
574
|
description: "Renders a compact severity, confidence, status, or risk label.",
|
|
195
575
|
useWhen: ["Code review findings", "Risk labels", "Status summaries", "Annotated explanations"],
|
|
196
576
|
props: [
|
|
@@ -212,7 +592,8 @@ export const componentRegistry = [
|
|
|
212
592
|
name: "Callout",
|
|
213
593
|
category: "semantic",
|
|
214
594
|
stability: "stable",
|
|
215
|
-
|
|
595
|
+
authoring: { kind: "content-block", guidance: contentBlockGuidance },
|
|
596
|
+
description: "Highlights a focused note, warning, recommendation, or risk with children-first Markdown body copy.",
|
|
216
597
|
useWhen: ["Review notes", "Assumptions", "Warnings", "Implementation gotchas", "Recommendations"],
|
|
217
598
|
props: [
|
|
218
599
|
{
|
|
@@ -221,12 +602,17 @@ export const componentRegistry = [
|
|
|
221
602
|
contentType: "plainText",
|
|
222
603
|
description: "Optional stable anchor id for comments and state. Prefer short semantic ids such as callout.risk."
|
|
223
604
|
},
|
|
605
|
+
{
|
|
606
|
+
name: "children",
|
|
607
|
+
type: "ReactNode",
|
|
608
|
+
contentType: "blockMarkdown",
|
|
609
|
+
description: "Preferred callout message content. Use MDX children for human-readable body copy."
|
|
610
|
+
},
|
|
224
611
|
{
|
|
225
612
|
name: "body",
|
|
226
613
|
type: "string",
|
|
227
614
|
contentType: "blockMarkdown",
|
|
228
|
-
|
|
229
|
-
description: "Controlled Markdown body. Use for the message inside the callout."
|
|
615
|
+
description: "Legacy controlled Markdown body prop. Prefer children for the message inside the callout."
|
|
230
616
|
},
|
|
231
617
|
{
|
|
232
618
|
name: "title",
|
|
@@ -240,17 +626,15 @@ export const componentRegistry = [
|
|
|
240
626
|
description: "Visual tone. Defaults to info."
|
|
241
627
|
}
|
|
242
628
|
],
|
|
243
|
-
example: `<Callout
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
title="Review focus"
|
|
247
|
-
body="Check the **export path** before treating this artifact as complete."
|
|
248
|
-
/>`
|
|
629
|
+
example: `<Callout id="callout.review-focus" tone="warning" title="Review focus">
|
|
630
|
+
Check the **export path** before treating this artifact as complete.
|
|
631
|
+
</Callout>`
|
|
249
632
|
},
|
|
250
633
|
{
|
|
251
634
|
name: "AnnotatedCode",
|
|
252
635
|
category: "semantic",
|
|
253
636
|
stability: "stable",
|
|
637
|
+
authoring: { kind: "structured-renderer", guidance: structuredRendererGuidance },
|
|
254
638
|
description: "Combines a CodeBlock with line-level annotations and severity labels.",
|
|
255
639
|
useWhen: ["Code explanations", "Review focus areas", "Implementation walkthroughs", "Risk notes tied to code lines"],
|
|
256
640
|
props: [
|
|
@@ -356,6 +740,7 @@ export const componentRegistry = [
|
|
|
356
740
|
name: "Stack",
|
|
357
741
|
category: "layout",
|
|
358
742
|
stability: "advanced",
|
|
743
|
+
authoring: { kind: "layout-primitive", guidance: layoutPrimitiveGuidance },
|
|
359
744
|
description: "Arranges children in a single vertical column with controlled spacing and alignment.",
|
|
360
745
|
useWhen: ["Advanced composition", "Vertical sections", "Storybook layout checks"],
|
|
361
746
|
props: [
|
|
@@ -377,7 +762,7 @@ export const componentRegistry = [
|
|
|
377
762
|
}
|
|
378
763
|
],
|
|
379
764
|
example: `<Stack gap="md">
|
|
380
|
-
<MarkdownBody
|
|
765
|
+
<MarkdownBody>Use semantic components first.</MarkdownBody>
|
|
381
766
|
<ExportPanel value={{ status: "ready" }} />
|
|
382
767
|
</Stack>`
|
|
383
768
|
},
|
|
@@ -385,6 +770,7 @@ export const componentRegistry = [
|
|
|
385
770
|
name: "Columns",
|
|
386
771
|
category: "layout",
|
|
387
772
|
stability: "advanced",
|
|
773
|
+
authoring: { kind: "layout-primitive", guidance: layoutPrimitiveGuidance },
|
|
388
774
|
description: "Arranges children in ratio-based columns that collapse responsively.",
|
|
389
775
|
useWhen: ["Advanced composition", "Main and supporting content", "Side-by-side artifact sections"],
|
|
390
776
|
props: [
|
|
@@ -411,7 +797,7 @@ export const componentRegistry = [
|
|
|
411
797
|
}
|
|
412
798
|
],
|
|
413
799
|
example: `<Columns ratio="3:1" gap="md">
|
|
414
|
-
<MarkdownBody
|
|
800
|
+
<MarkdownBody>Main explanation.</MarkdownBody>
|
|
415
801
|
<Frame surface="subtle">Supporting notes</Frame>
|
|
416
802
|
</Columns>`
|
|
417
803
|
},
|
|
@@ -419,6 +805,7 @@ export const componentRegistry = [
|
|
|
419
805
|
name: "Grid",
|
|
420
806
|
category: "layout",
|
|
421
807
|
stability: "advanced",
|
|
808
|
+
authoring: { kind: "layout-primitive", guidance: layoutPrimitiveGuidance },
|
|
422
809
|
description: "Arranges children in equal-width two, three, or four column grids.",
|
|
423
810
|
useWhen: ["Advanced composition", "Equal alternative cards", "Preview groups"],
|
|
424
811
|
props: [
|
|
@@ -454,6 +841,7 @@ export const componentRegistry = [
|
|
|
454
841
|
name: "SplitPane",
|
|
455
842
|
category: "layout",
|
|
456
843
|
stability: "advanced",
|
|
844
|
+
authoring: { kind: "layout-primitive", guidance: layoutPrimitiveGuidance },
|
|
457
845
|
description: "Arranges children into a two-pane layout with a controlled ratio.",
|
|
458
846
|
useWhen: ["Advanced composition", "Main content with sidebar", "Editor and preview layouts"],
|
|
459
847
|
props: [
|
|
@@ -480,7 +868,7 @@ export const componentRegistry = [
|
|
|
480
868
|
}
|
|
481
869
|
],
|
|
482
870
|
example: `<SplitPane ratio="3:1">
|
|
483
|
-
<MarkdownBody
|
|
871
|
+
<MarkdownBody>Primary reading surface.</MarkdownBody>
|
|
484
872
|
<Frame surface="outlined">Sidebar</Frame>
|
|
485
873
|
</SplitPane>`
|
|
486
874
|
},
|
|
@@ -488,6 +876,7 @@ export const componentRegistry = [
|
|
|
488
876
|
name: "Frame",
|
|
489
877
|
category: "layout",
|
|
490
878
|
stability: "advanced",
|
|
879
|
+
authoring: { kind: "layout-primitive", guidance: layoutPrimitiveGuidance },
|
|
491
880
|
description: "Provides a stable visual boundary for previews, snippets, mockups, or charts.",
|
|
492
881
|
useWhen: ["Advanced composition", "Preview boundaries", "Code or mockup framing"],
|
|
493
882
|
props: [
|
|
@@ -509,13 +898,14 @@ export const componentRegistry = [
|
|
|
509
898
|
}
|
|
510
899
|
],
|
|
511
900
|
example: `<Frame surface="outlined" padding="md">
|
|
512
|
-
<MarkdownBody
|
|
901
|
+
<MarkdownBody>A framed preview.</MarkdownBody>
|
|
513
902
|
</Frame>`
|
|
514
903
|
},
|
|
515
904
|
{
|
|
516
905
|
name: "CommentLayer",
|
|
517
906
|
category: "artifact",
|
|
518
907
|
stability: "stable",
|
|
908
|
+
authoring: { kind: "review-boundary", guidance: reviewBoundaryGuidance },
|
|
519
909
|
description: "Provides local browser comment state for block-level artifact feedback. Artifact and Storybook shells provide this automatically.",
|
|
520
910
|
useWhen: ["Custom React shells", "Reviewable artifacts", "Block-level user feedback", "Agent handoff comments"],
|
|
521
911
|
props: [
|
|
@@ -529,7 +919,9 @@ export const componentRegistry = [
|
|
|
529
919
|
example: `// Usually provided by the artifact shell.
|
|
530
920
|
<CommentLayer>
|
|
531
921
|
<CommentableBlock blockId="decision" title="Decision">
|
|
532
|
-
<
|
|
922
|
+
<ContentSet id="set.path" title="Choose a path" columns={2}>
|
|
923
|
+
<ContentSet.Item id="path-a" title="Path A">Readable option body.</ContentSet.Item>
|
|
924
|
+
</ContentSet>
|
|
533
925
|
</CommentableBlock>
|
|
534
926
|
<CommentExport />
|
|
535
927
|
</CommentLayer>`
|
|
@@ -538,6 +930,7 @@ export const componentRegistry = [
|
|
|
538
930
|
name: "Section",
|
|
539
931
|
category: "artifact",
|
|
540
932
|
stability: "stable",
|
|
933
|
+
authoring: { kind: "review-boundary", guidance: reviewBoundaryGuidance },
|
|
541
934
|
description: "Defines a stable reviewable document section for native MDX prose.",
|
|
542
935
|
useWhen: ["Reviewable native MDX prose", "Stable Markdown anchors", "Document structure", "Block-level feedback"],
|
|
543
936
|
props: [
|
|
@@ -571,6 +964,7 @@ This section can contain native MDX paragraphs, lists, and code fences.
|
|
|
571
964
|
name: "CommentableBlock",
|
|
572
965
|
category: "artifact",
|
|
573
966
|
stability: "stable",
|
|
967
|
+
authoring: { kind: "review-boundary", guidance: reviewBoundaryGuidance },
|
|
574
968
|
description: "Wraps any artifact content with a stable block target and hover-revealed local comment input.",
|
|
575
969
|
useWhen: ["Commenting on existing components", "Commenting on prose blocks", "Exporting block-level feedback"],
|
|
576
970
|
props: [
|
|
@@ -604,15 +998,18 @@ This section can contain native MDX paragraphs, lists, and code fences.
|
|
|
604
998
|
example: `<CommentableBlock
|
|
605
999
|
blockId="component-menu"
|
|
606
1000
|
title="Component menu"
|
|
607
|
-
description="Feedback on the
|
|
1001
|
+
description="Feedback on the content set"
|
|
608
1002
|
>
|
|
609
|
-
<
|
|
1003
|
+
<ContentSet id="set.components" title="Components">
|
|
1004
|
+
<ContentSet.Item id="export-panel" title="ExportPanel">Readable item body.</ContentSet.Item>
|
|
1005
|
+
</ContentSet>
|
|
610
1006
|
</CommentableBlock>`
|
|
611
1007
|
},
|
|
612
1008
|
{
|
|
613
1009
|
name: "CommentTarget",
|
|
614
1010
|
category: "artifact",
|
|
615
1011
|
stability: "stable",
|
|
1012
|
+
authoring: { kind: "review-boundary", guidance: reviewBoundaryGuidance },
|
|
616
1013
|
description: "Marks a fine-grained comment target with hover affordance and persistent comment count.",
|
|
617
1014
|
useWhen: ["Component internals", "Fine-grained review targets", "Custom local component comment anchors"],
|
|
618
1015
|
props: [
|
|
@@ -651,6 +1048,7 @@ This section can contain native MDX paragraphs, lists, and code fences.
|
|
|
651
1048
|
name: "CommentExport",
|
|
652
1049
|
category: "artifact",
|
|
653
1050
|
stability: "stable",
|
|
1051
|
+
authoring: { kind: "export-editor", guidance: exportEditorGuidance },
|
|
654
1052
|
description: "Compatibility dock for exporting comments from the nearest CommentLayer. Prefer ExportPanel when an artifact also has result output.",
|
|
655
1053
|
useWhen: ["Comments-only artifacts", "Legacy comment handoff", "Copying review comments without a result export"],
|
|
656
1054
|
props: [
|
|
@@ -709,110 +1107,13 @@ This section can contain native MDX paragraphs, lists, and code fences.
|
|
|
709
1107
|
example: `<CommentExport
|
|
710
1108
|
title="Export artifact feedback"
|
|
711
1109
|
formats={["markdown", "json"]}
|
|
712
|
-
/>`
|
|
713
|
-
},
|
|
714
|
-
{
|
|
715
|
-
name: "DecisionMatrix",
|
|
716
|
-
category: "artifact",
|
|
717
|
-
stability: "stable",
|
|
718
|
-
description: "Compares options by pros, cons, risks, confidence, and recommendation.",
|
|
719
|
-
useWhen: ["Architecture decisions", "Product tradeoffs", "Implementation planning", "Open-source roadmap"],
|
|
720
|
-
props: [
|
|
721
|
-
{
|
|
722
|
-
name: "id",
|
|
723
|
-
type: "string",
|
|
724
|
-
contentType: "plainText",
|
|
725
|
-
description: "Optional stable anchor id for comments and state. Prefer short semantic ids such as decision.comment-targets."
|
|
726
|
-
},
|
|
727
|
-
{
|
|
728
|
-
name: "question",
|
|
729
|
-
type: "string",
|
|
730
|
-
contentType: "inlineMarkdown",
|
|
731
|
-
required: true,
|
|
732
|
-
description: "The decision question being answered."
|
|
733
|
-
},
|
|
734
|
-
{
|
|
735
|
-
name: "options",
|
|
736
|
-
type: "DecisionMatrixOption[]",
|
|
737
|
-
required: true,
|
|
738
|
-
description: "Options to compare. Each option can include name, pros, cons, risks, confidence, and verdict."
|
|
739
|
-
}
|
|
740
|
-
],
|
|
741
|
-
types: [
|
|
742
|
-
{
|
|
743
|
-
name: "DecisionMatrixOption",
|
|
744
|
-
description: "One option in a decision comparison.",
|
|
745
|
-
fields: [
|
|
746
|
-
{
|
|
747
|
-
name: "id",
|
|
748
|
-
type: "string",
|
|
749
|
-
contentType: "plainText",
|
|
750
|
-
description: "Optional stable child anchor id. When the parent has id, child anchors become parentId.optionId."
|
|
751
|
-
},
|
|
752
|
-
{
|
|
753
|
-
name: "name",
|
|
754
|
-
type: "string",
|
|
755
|
-
contentType: "inlineMarkdown",
|
|
756
|
-
required: true,
|
|
757
|
-
description: "Option title."
|
|
758
|
-
},
|
|
759
|
-
{
|
|
760
|
-
name: "summary",
|
|
761
|
-
type: "string",
|
|
762
|
-
contentType: "inlineMarkdown",
|
|
763
|
-
description: "Short option summary."
|
|
764
|
-
},
|
|
765
|
-
{
|
|
766
|
-
name: "pros",
|
|
767
|
-
type: "string[]",
|
|
768
|
-
contentType: "inlineMarkdown",
|
|
769
|
-
description: "Advantages for this option."
|
|
770
|
-
},
|
|
771
|
-
{
|
|
772
|
-
name: "cons",
|
|
773
|
-
type: "string[]",
|
|
774
|
-
contentType: "inlineMarkdown",
|
|
775
|
-
description: "Disadvantages for this option."
|
|
776
|
-
},
|
|
777
|
-
{
|
|
778
|
-
name: "risks",
|
|
779
|
-
type: "string[]",
|
|
780
|
-
contentType: "inlineMarkdown",
|
|
781
|
-
description: "Risks or failure modes for this option."
|
|
782
|
-
},
|
|
783
|
-
{
|
|
784
|
-
name: "confidence",
|
|
785
|
-
type: "'low' | 'medium' | 'high'",
|
|
786
|
-
description: "Confidence level for this option."
|
|
787
|
-
},
|
|
788
|
-
{
|
|
789
|
-
name: "verdict",
|
|
790
|
-
type: "string",
|
|
791
|
-
contentType: "inlineMarkdown",
|
|
792
|
-
description: "Short recommendation or conclusion for this option."
|
|
793
|
-
}
|
|
794
|
-
]
|
|
795
|
-
}
|
|
796
|
-
],
|
|
797
|
-
example: `<DecisionMatrix
|
|
798
|
-
id="decision.stage-one"
|
|
799
|
-
question="Should the first stage focus on a Vite single HTML artifact?"
|
|
800
|
-
options={[
|
|
801
|
-
{
|
|
802
|
-
id: "vite",
|
|
803
|
-
name: "Vite single HTML artifact",
|
|
804
|
-
pros: ["Short feedback loop", "Direct component debugging"],
|
|
805
|
-
cons: ["No docs-site navigation yet"],
|
|
806
|
-
confidence: "high",
|
|
807
|
-
verdict: "Recommended for stage one"
|
|
808
|
-
}
|
|
809
|
-
]}
|
|
810
1110
|
/>`
|
|
811
1111
|
},
|
|
812
1112
|
{
|
|
813
1113
|
name: "ComparisonSet",
|
|
814
1114
|
category: "artifact",
|
|
815
1115
|
stability: "stable",
|
|
1116
|
+
authoring: { kind: "content-block", guidance: contentBlockGuidance },
|
|
816
1117
|
description: "Groups comparable candidates while allowing each item to render arbitrary component content.",
|
|
817
1118
|
useWhen: ["Candidate comparison", "Mixed media alternatives", "Prototype comparison", "Reviewable option sets"],
|
|
818
1119
|
props: [
|
|
@@ -876,96 +1177,18 @@ This section can contain native MDX paragraphs, lists, and code fences.
|
|
|
876
1177
|
],
|
|
877
1178
|
example: `<ComparisonSet id="comparison.artifact-forms" title="Compare artifact forms" columns={3}>
|
|
878
1179
|
<ComparisonSet.Item id="markdown" title="Markdown explanation" value="markdown">
|
|
879
|
-
<MarkdownBody
|
|
1180
|
+
<MarkdownBody>Best for prose-heavy context.</MarkdownBody>
|
|
880
1181
|
</ComparisonSet.Item>
|
|
881
1182
|
<ComparisonSet.Item id="code" title="Code path" value="code">
|
|
882
1183
|
<Frame surface="subtle">Code renderer or local component</Frame>
|
|
883
1184
|
</ComparisonSet.Item>
|
|
884
1185
|
</ComparisonSet>`
|
|
885
|
-
},
|
|
886
|
-
{
|
|
887
|
-
name: "OptionGrid",
|
|
888
|
-
category: "artifact",
|
|
889
|
-
stability: "stable",
|
|
890
|
-
description: "Displays multiple options, component candidates, or prototype directions in a scannable grid.",
|
|
891
|
-
useWhen: ["Option exploration", "Component scope", "Prototype comparison"],
|
|
892
|
-
props: [
|
|
893
|
-
{
|
|
894
|
-
name: "id",
|
|
895
|
-
type: "string",
|
|
896
|
-
contentType: "plainText",
|
|
897
|
-
description: "Optional stable anchor id for comments and state. Prefer short semantic ids such as option.comment-flow."
|
|
898
|
-
},
|
|
899
|
-
{
|
|
900
|
-
name: "title",
|
|
901
|
-
type: "string",
|
|
902
|
-
contentType: "inlineMarkdown",
|
|
903
|
-
required: true,
|
|
904
|
-
description: "Grid title."
|
|
905
|
-
},
|
|
906
|
-
{
|
|
907
|
-
name: "options",
|
|
908
|
-
type: "OptionGridItem[]",
|
|
909
|
-
required: true,
|
|
910
|
-
description: "Items to display. Each item can include name, intent, description, and tradeoffs."
|
|
911
|
-
}
|
|
912
|
-
],
|
|
913
|
-
types: [
|
|
914
|
-
{
|
|
915
|
-
name: "OptionGridItem",
|
|
916
|
-
description: "One option in an OptionGrid.",
|
|
917
|
-
fields: [
|
|
918
|
-
{
|
|
919
|
-
name: "id",
|
|
920
|
-
type: "string",
|
|
921
|
-
contentType: "plainText",
|
|
922
|
-
description: "Optional stable child anchor id. When the parent has id, child anchors become parentId.itemId."
|
|
923
|
-
},
|
|
924
|
-
{
|
|
925
|
-
name: "name",
|
|
926
|
-
type: "string",
|
|
927
|
-
contentType: "inlineMarkdown",
|
|
928
|
-
required: true,
|
|
929
|
-
description: "Option title."
|
|
930
|
-
},
|
|
931
|
-
{
|
|
932
|
-
name: "intent",
|
|
933
|
-
type: "string",
|
|
934
|
-
contentType: "inlineMarkdown",
|
|
935
|
-
description: "Short statement of what this option is trying to achieve."
|
|
936
|
-
},
|
|
937
|
-
{
|
|
938
|
-
name: "description",
|
|
939
|
-
type: "string",
|
|
940
|
-
contentType: "inlineMarkdown",
|
|
941
|
-
description: "Short option description."
|
|
942
|
-
},
|
|
943
|
-
{
|
|
944
|
-
name: "tradeoffs",
|
|
945
|
-
type: "string[]",
|
|
946
|
-
contentType: "inlineMarkdown",
|
|
947
|
-
description: "Tradeoffs or caveats for this option."
|
|
948
|
-
}
|
|
949
|
-
]
|
|
950
|
-
}
|
|
951
|
-
],
|
|
952
|
-
example: `<OptionGrid
|
|
953
|
-
id="option.first-components"
|
|
954
|
-
title="First component scope"
|
|
955
|
-
options={[
|
|
956
|
-
{
|
|
957
|
-
id: "export",
|
|
958
|
-
name: "ExportPanel",
|
|
959
|
-
intent: "Return human edits to the workflow",
|
|
960
|
-
tradeoffs: ["Copy-only in v1", "Can add downloads later"]
|
|
961
|
-
}
|
|
962
|
-
]}
|
|
963
|
-
/>`
|
|
964
1186
|
},
|
|
965
1187
|
{
|
|
966
1188
|
name: "ExportPanel",
|
|
967
1189
|
category: "artifact",
|
|
968
1190
|
stability: "stable",
|
|
1191
|
+
authoring: { kind: "export-editor", guidance: exportEditorGuidance },
|
|
969
1192
|
description: "Shows a floating export dock for artifact results and, when comments are available, review comments.",
|
|
970
1193
|
useWhen: ["Exporting decisions", "Copying state back to an agent", "Issue or PR handoff", "Configuration handoff", "Exporting comments with artifact results"],
|
|
971
1194
|
props: [
|
|
@@ -997,6 +1220,78 @@ This section can contain native MDX paragraphs, lists, and code fences.
|
|
|
997
1220
|
/>`
|
|
998
1221
|
}
|
|
999
1222
|
];
|
|
1223
|
+
const legacyComponentRegistry = [
|
|
1224
|
+
{
|
|
1225
|
+
name: "DecisionMatrix",
|
|
1226
|
+
deprecated: {
|
|
1227
|
+
replacement: "ContentSet",
|
|
1228
|
+
guidance: [
|
|
1229
|
+
"DecisionMatrix is kept only as a runtime compatibility shim for older MDX.",
|
|
1230
|
+
"Use ContentSet with ContentSet.Item for new artifacts.",
|
|
1231
|
+
"Existing MDX can still render, but validate will warn and guide migration."
|
|
1232
|
+
]
|
|
1233
|
+
},
|
|
1234
|
+
description: "Deprecated compatibility component. Use ContentSet with ContentSet.Item instead.",
|
|
1235
|
+
useWhen: [],
|
|
1236
|
+
props: [],
|
|
1237
|
+
example: `<ContentSet id="decision.path" title="Choose the implementation path">
|
|
1238
|
+
<ContentSet.Item id="path-a" title="Path A">Readable option body.</ContentSet.Item>
|
|
1239
|
+
</ContentSet>`
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
name: "DecisionMatrix.Option",
|
|
1243
|
+
deprecated: {
|
|
1244
|
+
replacement: "ContentSet.Item",
|
|
1245
|
+
guidance: [
|
|
1246
|
+
"DecisionMatrix.Option is kept only as a runtime compatibility shim for older MDX.",
|
|
1247
|
+
"Use ContentSet.Item for new artifacts.",
|
|
1248
|
+
"Move long pros, cons, risks, and rationale into MDX children."
|
|
1249
|
+
]
|
|
1250
|
+
},
|
|
1251
|
+
description: "Deprecated compatibility child component. Use ContentSet.Item instead.",
|
|
1252
|
+
useWhen: [],
|
|
1253
|
+
props: [],
|
|
1254
|
+
example: `<ContentSet.Item id="path-a" title="Path A">
|
|
1255
|
+
### Tradeoffs
|
|
1256
|
+
|
|
1257
|
+
- Keep readable rationale in MDX children
|
|
1258
|
+
</ContentSet.Item>`
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
name: "OptionGrid",
|
|
1262
|
+
deprecated: {
|
|
1263
|
+
replacement: "ContentSet",
|
|
1264
|
+
guidance: [
|
|
1265
|
+
"OptionGrid is kept only as a runtime compatibility shim for older MDX.",
|
|
1266
|
+
"Use ContentSet with ContentSet.Item for new artifacts.",
|
|
1267
|
+
"Existing MDX can still render, but validate will warn and guide migration."
|
|
1268
|
+
]
|
|
1269
|
+
},
|
|
1270
|
+
description: "Deprecated compatibility component. Use ContentSet with ContentSet.Item instead.",
|
|
1271
|
+
useWhen: [],
|
|
1272
|
+
props: [],
|
|
1273
|
+
example: `<ContentSet id="options.path" title="Implementation options">
|
|
1274
|
+
<ContentSet.Item id="path-a" title="Path A">Readable option body.</ContentSet.Item>
|
|
1275
|
+
</ContentSet>`
|
|
1276
|
+
},
|
|
1277
|
+
{
|
|
1278
|
+
name: "OptionGrid.Item",
|
|
1279
|
+
deprecated: {
|
|
1280
|
+
replacement: "ContentSet.Item",
|
|
1281
|
+
guidance: [
|
|
1282
|
+
"OptionGrid.Item is kept only as a runtime compatibility shim for older MDX.",
|
|
1283
|
+
"Use ContentSet.Item for new artifacts.",
|
|
1284
|
+
"Move long descriptions and tradeoffs into MDX children."
|
|
1285
|
+
]
|
|
1286
|
+
},
|
|
1287
|
+
description: "Deprecated compatibility child component. Use ContentSet.Item instead.",
|
|
1288
|
+
useWhen: [],
|
|
1289
|
+
props: [],
|
|
1290
|
+
example: `<ContentSet.Item id="path-a" title="Path A">
|
|
1291
|
+
Readable option body.
|
|
1292
|
+
</ContentSet.Item>`
|
|
1293
|
+
}
|
|
1294
|
+
];
|
|
1000
1295
|
export function findComponentMeta(name) {
|
|
1001
|
-
return componentRegistry.find((component) => component.name.toLowerCase() === name.toLowerCase());
|
|
1296
|
+
return [...componentRegistry, ...legacyComponentRegistry].find((component) => component.name.toLowerCase() === name.toLowerCase());
|
|
1002
1297
|
}
|