@joplo-app/core 0.1.3 → 0.2.1

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/dist/catalog.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * (packages/core/test/catalog.test.ts 与渲染器的类型检查保证)。目录之外的名称在编译时报错,不会被静默渲染。
7
7
  * 只换词汇,不换渲染:运行时不引入 Mantine,仍由 Joplo 渲染成低保真风格。
8
8
  */
9
- export declare const COMPONENT_TYPES: readonly ["AppShell", "AppShell.Header", "AppShell.Navbar", "AppShell.Main", "AppShell.Aside", "AppShell.Footer", "Container", "Stack", "Group", "Flex", "Grid", "Grid.Col", "SimpleGrid", "Center", "Box", "Space", "Paper", "Card", "Card.Section", "Divider", "ScrollArea", "Title", "Text", "Code", "Kbd", "Blockquote", "List", "List.Item", "Badge", "Avatar", "Image", "ThemeIcon", "Indicator", "Timeline", "Timeline.Item", "Table", "Table.Thead", "Table.Tbody", "Table.Tr", "Table.Th", "Table.Td", "DataTable", "Accordion", "Accordion.Item", "Accordion.Panel", "Radio", "Tabs.List", "Tabs.Panel", "Breadcrumbs", "Stepper", "Stepper.Step", "Alert", "Loader", "Progress", "RingProgress", "Skeleton", "Notification", "Modal", "Drawer", "ChatMessage", "ToolCall", "Terminal", "Terminal.Command", "Terminal.Output", "Phone", "Diagram", "Diagram.Group", "Diagram.Node", "Diagram.Edge", "div", "span", "p", "h1", "h2", "h3", "h4", "main", "section", "header", "footer", "nav", "aside", "ul", "ol", "li", "strong", "em", "small", "code", "Placeholder", "Custom", "#text", "Button", "ActionIcon", "CloseButton", "Anchor", "a", "NavLink", "Burger", "TextInput", "PasswordInput", "NumberInput", "Textarea", "Select", "MultiSelect", "Checkbox", "Radio.Group", "Switch", "SegmentedControl", "FileInput", "Tabs", "Tabs.Tab", "Accordion.Control", "Pagination", "PromptInput", "Terminal.Input"];
9
+ export declare const COMPONENT_TYPES: readonly ["AppShell", "AppShell.Header", "AppShell.Navbar", "AppShell.Main", "AppShell.Aside", "AppShell.Footer", "Container", "Stack", "Group", "Flex", "Grid", "Grid.Col", "SimpleGrid", "Center", "Box", "Space", "Paper", "Card", "Card.Section", "Divider", "ScrollArea", "Title", "Text", "Code", "Kbd", "Blockquote", "List", "List.Item", "Badge", "Avatar", "Image", "ThemeIcon", "Indicator", "Timeline", "Timeline.Item", "Table", "Table.Thead", "Table.Tbody", "Table.Tr", "Table.Th", "Table.Td", "DataTable", "Accordion", "Accordion.Item", "Accordion.Panel", "Radio", "Tabs.List", "Tabs.Panel", "Breadcrumbs", "Stepper", "Stepper.Step", "Alert", "Loader", "Progress", "RingProgress", "Skeleton", "Notification", "Modal", "Drawer", "ChatMessage", "ToolCall", "Thinking", "Artifact", "Email", "DataCard", "StateFlow", "Terminal", "Terminal.Command", "Terminal.Output", "Phone", "Diagram", "Diagram.Group", "Diagram.Node", "Diagram.Edge", "div", "span", "p", "h1", "h2", "h3", "h4", "main", "section", "header", "footer", "nav", "aside", "ul", "ol", "li", "strong", "em", "small", "code", "Placeholder", "Custom", "#text", "Button", "ActionIcon", "CloseButton", "Anchor", "a", "NavLink", "Burger", "TextInput", "PasswordInput", "NumberInput", "Textarea", "Select", "MultiSelect", "Checkbox", "Radio.Group", "Switch", "SegmentedControl", "FileInput", "Tabs", "Tabs.Tab", "Accordion.Control", "Pagination", "PromptInput", "Terminal.Input", "Artifact.Ref"];
10
10
  export type ComponentType = (typeof COMPONENT_TYPES)[number];
11
11
  export declare const INTERACTIVE_TYPES: ReadonlySet<string>;
12
12
  /** 可接收输入值;type/select/toggle 动作写入 state.inputs[nodeId]。 */
package/dist/catalog.js CHANGED
@@ -23,7 +23,7 @@ const STRUCTURE = [
23
23
  // 反馈与浮层
24
24
  'Alert', 'Loader', 'Progress', 'RingProgress', 'Skeleton', 'Notification', 'Modal', 'Drawer',
25
25
  // AI 交互(Joplo 自有)
26
- 'ChatMessage', 'ToolCall',
26
+ 'ChatMessage', 'ToolCall', 'Thinking', 'Artifact', 'Email', 'DataCard', 'StateFlow',
27
27
  // 设备外框(Joplo 自有):终端与手机
28
28
  'Terminal', 'Terminal.Command', 'Terminal.Output', 'Phone',
29
29
  // 架构图(Joplo 自有,D41):节点与连线的 state 绑定 $.ui,由 flow 步骤驱动
@@ -40,6 +40,7 @@ const INTERACTIVE = [
40
40
  'Button', 'ActionIcon', 'CloseButton', 'Anchor', 'a', 'NavLink', 'Burger',
41
41
  'TextInput', 'PasswordInput', 'NumberInput', 'Textarea', 'Select', 'MultiSelect', 'Checkbox', 'Radio.Group', 'Switch',
42
42
  'SegmentedControl', 'FileInput', 'Tabs', 'Tabs.Tab', 'Accordion.Control', 'Pagination', 'PromptInput', 'Terminal.Input',
43
+ 'Artifact.Ref',
43
44
  ];
44
45
  export const COMPONENT_TYPES = [...STRUCTURE, ...INTERACTIVE];
45
46
  export const INTERACTIVE_TYPES = new Set(INTERACTIVE);
@@ -58,122 +59,128 @@ export const JOPLO_PROPS = ['id', 'when', 'disabledReason', 'unmodeled', 'note']
58
59
  * 响应式写成 { base, xs, sm, md, lg, xl };visibleFrom / hiddenFrom;以及 Joplo 属性 id/when/disabled/disabledReason/unmodeled/note。
59
60
  */
60
61
  export const COMPONENT_DOCS = {
61
- AppShell: 'header={{ height }}, navbar={{ width, breakpoint, collapsed: { mobile, desktop } }}, aside={{ width, breakpoint, collapsed }}, footer={{ height }}, padding;窄于 breakpoint 时导航收起并显示 Burger',
62
- 'AppShell.Header': '顶栏;p, px',
63
- 'AppShell.Navbar': '侧边导航;p;放 NavLink',
64
- 'AppShell.Main': '主内容区;放 <Outlet />',
65
- 'AppShell.Aside': '右侧栏;p',
66
- 'AppShell.Footer': '底栏;p',
67
- Container: 'size: xs|sm|md|lg|xl|number(默认 md), fluid',
68
- Stack: 'gap(默认 md), align, justify —— 纵向排列',
69
- Group: 'gap(默认 md), justify, align(默认 center), wrap, grow —— 横向排列',
70
- Flex: 'direction, gap, rowGap, columnGap, align, justify, wrap —— 均可响应式',
71
- Grid: 'columns(默认 12), gutter, justify, align, grow;子元素用 Grid.Col',
62
+ AppShell: 'header={{ height }}, navbar={{ width, breakpoint, collapsed: { mobile, desktop } }}, aside={{ width, breakpoint, collapsed }}, footer={{ height }}, padding; navigation collapses below breakpoint and shows Burger',
63
+ 'AppShell.Header': 'Header; p, px',
64
+ 'AppShell.Navbar': 'Navigation sidebar; p; contains NavLink',
65
+ 'AppShell.Main': 'Main content; contains <Outlet />',
66
+ 'AppShell.Aside': 'Right sidebar; p',
67
+ 'AppShell.Footer': 'Footer; p',
68
+ Container: 'size: xs|sm|md|lg|xl|number (default md), fluid',
69
+ Stack: 'gap (default md), align, justify; vertical layout',
70
+ Group: 'gap (default md), justify, align (default center), wrap, grow; horizontal layout',
71
+ Flex: 'direction, gap, rowGap, columnGap, align, justify, wrap; all responsive',
72
+ Grid: 'columns (default 12), gutter, justify, align, grow; Grid.Col children',
72
73
  'Grid.Col': 'span: number|"auto"|"content"|{ base, md }, offset',
73
74
  SimpleGrid: 'cols={{ base: 1, md: 3 }}, spacing, verticalSpacing',
74
- Center: 'inline —— 内容居中',
75
- Box: '通用容器,只用样式属性',
76
- Space: 'h, w —— 空白间隔',
75
+ Center: 'inline; centers content',
76
+ Box: 'Generic container; style props only',
77
+ Space: 'h, w; blank space',
77
78
  Paper: 'p, withBorder, shadow, radius',
78
- Card: 'padding(默认 md), withBorder, shadow, radius;Card.Section 贴边分区',
79
+ Card: 'padding (default md), withBorder, shadow, radius; Card.Section for edge-to-edge sections',
79
80
  'Card.Section': 'withBorder, inheritPadding',
80
81
  Divider: 'label, labelPosition: left|center|right, orientation, my',
81
82
  ScrollArea: 'h, mah',
82
- Title: 'order: 1-6;文字写在子节点',
83
- Text: 'size: xs|sm|md|lg|xl, c: dimmed|red|green|…, fw, ta, truncate, lineClamp, span;保留换行',
84
- Code: 'block(多行代码块), color',
85
- Kbd: '键盘按键',
83
+ Title: 'order: 1-6; text in children',
84
+ Text: 'size: xs|sm|md|lg|xl, c: dimmed|red|green|…, fw, ta, truncate, lineClamp, span; preserves newlines',
85
+ Code: 'block (multiline code block), color',
86
+ Kbd: 'Keyboard key',
86
87
  Blockquote: 'cite, color',
87
- List: 'type: ordered|unordered, spacing;子元素用 List.Item',
88
- 'List.Item': '列表项',
88
+ List: 'type: ordered|unordered, spacing; List.Item children',
89
+ 'List.Item': 'List item',
89
90
  Badge: 'color, variant: filled|light|outline|dot|default, size',
90
- Avatar: 'name(显示首字), src, color, radius, size',
91
- Image: 'src, alt, h, w, radius —— 渲染为带 alt 的占位',
92
- ThemeIcon: 'color, variant, size, radius;子节点放一个字符',
93
- Indicator: 'label, color, disabled;包裹一个元素,在角上显示标记',
94
- Timeline: 'active(已完成到第几项), bulletSize;子元素用 Timeline.Item',
95
- 'Timeline.Item': 'title, bullet;子节点是说明',
96
- Table: 'data={{ head: [...], body: [[...]] }} 或 Table.Thead/Tbody/Tr/Th/Td;striped, withTableBorder',
97
- 'Table.Thead': '表头',
98
- 'Table.Tbody': '表体',
99
- 'Table.Tr': '行',
100
- 'Table.Th': '表头单元格',
101
- 'Table.Td': '单元格',
102
- DataTable: 'records(可绑定 $.data.x), columns: [{ accessor, title }], noRecordsText —— 对齐 mantine-datatable',
103
- Accordion: 'value / defaultValue(展开项);select 动作写入展开项;子元素用 Accordion.Item',
104
- 'Accordion.Item': 'value;内含 Accordion.Control 与 Accordion.Panel',
105
- 'Accordion.Panel': '展开后显示的内容',
106
- Radio: 'value, label —— 放在 Radio.Group 里',
107
- 'Tabs.List': '标签栏;放 Tabs.Tab',
108
- 'Tabs.Panel': 'value —— 当前标签的内容',
109
- Breadcrumbs: 'separator;子节点放 Anchor 或文字',
110
- Stepper: 'active(从 0 开始);子元素用 Stepper.Step',
111
- 'Stepper.Step': 'label, description;子节点是该步内容(只显示当前步)',
112
- Alert: 'title, color(默认 blue), variant;子节点是说明',
113
- Loader: 'size, color, type;可带子文字',
91
+ Avatar: 'name (shows first character), src, color, radius, size',
92
+ Image: 'src, alt, h, w, radius; renders a placeholder with alt',
93
+ ThemeIcon: 'color, variant, size, radius; one character as child',
94
+ Indicator: 'label, color, disabled; wraps one element with a corner badge',
95
+ Timeline: 'active (completed item index), bulletSize; Timeline.Item children',
96
+ 'Timeline.Item': 'title, bullet; description in children',
97
+ Table: 'data={{ head: [...], body: [[...]] }} or Table.Thead/Tbody/Tr/Th/Td; striped, withTableBorder',
98
+ 'Table.Thead': 'Table head',
99
+ 'Table.Tbody': 'Table body',
100
+ 'Table.Tr': 'Row',
101
+ 'Table.Th': 'Header cell',
102
+ 'Table.Td': 'Cell',
103
+ DataTable: 'records (can bind $.data.x), columns: [{ accessor, title }], noRecordsText; matches mantine-datatable',
104
+ Accordion: 'value / defaultValue (expanded item); select sets the expanded item; Accordion.Item children',
105
+ 'Accordion.Item': 'value; contains Accordion.Control and Accordion.Panel',
106
+ 'Accordion.Panel': 'Content shown when expanded',
107
+ Radio: 'value, label; place inside Radio.Group',
108
+ 'Tabs.List': 'Tab bar; contains Tabs.Tab',
109
+ 'Tabs.Panel': 'value; current tab content',
110
+ Breadcrumbs: 'separator; Anchor or text children',
111
+ Stepper: 'active (zero-based); Stepper.Step children',
112
+ 'Stepper.Step': 'label, description; step content in children (only current step shown)',
113
+ Alert: 'title, color (default blue), variant; description in children',
114
+ Loader: 'size, color, type; optional child text',
114
115
  Progress: 'value 0-100, color, size, striped',
115
116
  RingProgress: 'sections: [{ value, color }], label, size, thickness',
116
117
  Skeleton: 'h, w, circle, radius, visible',
117
- Notification: 'title, color, loading, withCloseButton —— 页面内的通知条(临时提示用步骤里的 toast)',
118
- Modal: 'opened(门控,常写 opened={$.ui.open}), title, size, centered, fullScreen',
119
- Drawer: 'opened(门控), title, position: left|right|top|bottom(默认 left), size',
120
- ChatMessage: "from: 'user'|'assistant', name;子节点是消息内容(保留换行)",
121
- ToolCall: "title, state: 'running'|'done'|'error';子节点是调用详情",
122
- Terminal: 'title —— 终端窗口(命令行原型),子节点是 Terminal.Command / Terminal.Output / Terminal.Input;内容超出 h 或 mah 时内部滚动',
123
- Diagram: "direction: 'right'|'down'(默认 right), h(高度,默认 420)—— 架构图,子节点是 Diagram.Group / Diagram.Node / Diagram.Edge;布局自动生成且确定(state 变化不移动节点);整图缩放放进容器(不滚动),看细节用演示页统一的缩放平移(滚轮 / 捏合 / 拖动)或镜头推近;连线正交走线、出入口与平行段间距 ≥ 10px;shot 同一张图里 2 个及以上节点(或一条连线)时,这些节点移到中央排成紧凑的聚焦小图;节点多、宽度有限时用 direction='down'。逐段出现:给 Group / Node / Edge 写 when={$.ui.x},flow 里 set 为真时出现(布局按全部元素预先算好,已有元素不动);调用链用步骤里的 trace() 描述,节点与连线的 state 自动推算",
124
- 'Diagram.Group': 'label —— 带标题的分组框,子节点是 Diagram.Node 或嵌套的 Diagram.Group',
125
- 'Diagram.Node': "id(必填,连线与 trace 靠它), label, description(第二行小字), kind: 'client'|'service'|'model'|'database'|'queue'|'storage'|'external'|'tool'|'user', state(可选): 'idle'|'active'|'ok'|'error'|'dim'——不写时由步骤里的 trace() 自动推算;写了就以它为准",
126
- 'Diagram.Edge': "from, to(同一个 Diagram 里的 Node id), label, async(虚线), state(可选): 'idle'|'active'|'ok'|'error'|'dim';id 缺省为 \"from->to\"。演示调用链:步骤里写 trace('app', 'biz')(走这条线,自动变 active,之后 ok)、trace.fail(...)(error)、trace.skip(...)(dim),不用手写 state;同一方向有多条连线时 trace('连线 id')",
127
- 'Terminal.Command': 'prompt(默认 "$");子节点是命令文字',
128
- 'Terminal.Output': "tone: 'plain'|'ok'|'warn'|'error'(默认 plain);子节点是输出文字(保留换行)",
129
- Phone: 'scale(视觉缩放,默认 1), h(屏幕高度,默认 844)—— 手机外框,子节点按手机宽度 390 排版,响应式断点按这个宽度计算;页面写 viewport: "mobile" 时舞台自动套上,不用写它',
130
- div: 'HTML 兜底,建议改用 Box/Stack/Group',
131
- span: 'HTML 兜底,建议改用 Text span',
132
- p: 'HTML 兜底,建议改用 Text',
133
- h1: 'HTML 兜底,建议改用 Title order={1}',
134
- h2: 'HTML 兜底,建议改用 Title order={2}',
135
- h3: 'HTML 兜底,建议改用 Title order={3}',
136
- h4: 'HTML 兜底,建议改用 Title order={4}',
137
- main: 'HTML 兜底,建议改用 AppShell.Main',
138
- section: 'HTML 兜底,建议改用 Box',
139
- header: 'HTML 兜底,建议改用 AppShell.Header',
140
- footer: 'HTML 兜底,建议改用 AppShell.Footer',
141
- nav: 'HTML 兜底,建议改用 AppShell.Navbar',
142
- aside: 'HTML 兜底,建议改用 AppShell.Aside',
143
- ul: 'HTML 兜底,建议改用 List',
144
- ol: 'HTML 兜底,建议改用 List type="ordered"',
145
- li: 'HTML 兜底,建议改用 List.Item',
146
- strong: 'HTML 兜底,建议改用 Text fw={700} span',
147
- em: 'HTML 兜底,建议改用 Text fs="italic" span',
148
- small: 'HTML 兜底,建议改用 Text size="xs"',
149
- code: 'HTML 兜底,建议改用 Code',
150
- Placeholder: 'label, h —— 图片、图表等占位',
151
- Custom: 'kind —— 目录没有的组件,渲染为带说明的占位框',
152
- '#text': '编译器生成的文本节点(不要直接使用)',
153
- Button: 'variant: filled|light|outline|subtle|default|white, color, size, fullWidth, loading, leftSection(字符)',
154
- ActionIcon: "图标按钮:aria-label(必写,用作名称), variant, color, size;子节点放一个字符如 '+'",
118
+ Notification: 'title, color, loading, withCloseButton; inline notification (use step toast for temporary messages)',
119
+ Modal: 'opened (gated, usually opened={$.ui.open}), title, size, centered, fullScreen',
120
+ Drawer: 'opened (gated), title, position: left|right|top|bottom (default left), size',
121
+ ChatMessage: "from: 'user'|'assistant', name; message content in children (preserves newlines)",
122
+ ToolCall: "title, state: 'running'|'done'|'error'; call details in children",
123
+ Email: 'from, to, subject, time; simple email card, body in children; can contain Button',
124
+ DataCard: 'title, value (object or state binding), fields?: [{ key, label }]; lists all keys by default; rows changed this step show old value → new value',
125
+ StateFlow: 'value (current state binding), states: string[], labels?: { state: name }; earlier states are completed, current state highlighted',
126
+ Thinking: 'title (current thought; can bind $.ui.x), active (thinking: title pulses), duration (shows "Thought for …" when finished), opened (expands the process); thinking process in children',
127
+ Artifact: "title, kind: 'doc'|'code'|'sheet'|'web'|'image', status: 'generating'|'ready'|'error', version; Agent artifact side panel, content in children",
128
+ Terminal: 'title; terminal window (CLI prototype), Terminal.Command / Terminal.Output / Terminal.Input children; scrolls internally when content exceeds h or mah',
129
+ Diagram: "direction: 'right'|'down' (default right), h (height, default 420); architecture diagram with Diagram.Group / Diagram.Node / Diagram.Edge children; automatic deterministic layout (state changes do not move nodes); scales the whole diagram to fit without scrolling; inspect details with shared demo zoom/pan (wheel / pinch / drag) or shots; orthogonal edges with port and parallel segment spacing ≥ 10px; a shot of 2+ nodes (or one edge) in the same diagram centers them in a compact focused subgraph; use direction='down' for many nodes in limited width. Progressive reveal: set when={$.ui.x} on Group / Node / Edge and set true in flow (layout precomputed from all elements, existing elements stay fixed); describe calls with step trace(), which derives node/edge state",
130
+ 'Diagram.Group': 'label; titled group box with Diagram.Node or nested Diagram.Group children',
131
+ 'Diagram.Node': "id (required for edges and trace), label, description (small second line), kind: 'client'|'service'|'model'|'database'|'queue'|'storage'|'external'|'tool'|'user', optional state: 'idle'|'active'|'ok'|'error'|'dim'; omitted state is derived from step trace(); explicit state overrides it",
132
+ 'Diagram.Edge': "from, to (Node ids in the same Diagram), label, async (dashed), optional state: 'idle'|'active'|'ok'|'error'|'dim'; id defaults to \"from->to\". Use trace('app', 'biz') in steps (this edge becomes active, then ok), trace.fail(...) (error), trace.skip(...) (dim), without manual state; for multiple edges in the same direction use trace('edge_id')",
133
+ 'Terminal.Command': 'prompt (default "$"); command text in children',
134
+ 'Terminal.Output': "tone: 'plain'|'ok'|'warn'|'error' (default plain); output text in children (preserves newlines)",
135
+ Phone: 'scale (visual scale, default 1), h (screen height, default 844); phone frame, children laid out at mobile width 390 with breakpoints based on that width; viewport: "mobile" on a page adds it automatically; do not add Phone explicitly',
136
+ div: 'HTML fallback; prefer Box/Stack/Group',
137
+ span: 'HTML fallback; prefer Text span',
138
+ p: 'HTML fallback; prefer Text',
139
+ h1: 'HTML fallback; prefer Title order={1}',
140
+ h2: 'HTML fallback; prefer Title order={2}',
141
+ h3: 'HTML fallback; prefer Title order={3}',
142
+ h4: 'HTML fallback; prefer Title order={4}',
143
+ main: 'HTML fallback; prefer AppShell.Main',
144
+ section: 'HTML fallback; prefer Box',
145
+ header: 'HTML fallback; prefer AppShell.Header',
146
+ footer: 'HTML fallback; prefer AppShell.Footer',
147
+ nav: 'HTML fallback; prefer AppShell.Navbar',
148
+ aside: 'HTML fallback; prefer AppShell.Aside',
149
+ ul: 'HTML fallback; prefer List',
150
+ ol: 'HTML fallback; prefer List type="ordered"',
151
+ li: 'HTML fallback; prefer List.Item',
152
+ strong: 'HTML fallback; prefer Text fw={700} span',
153
+ em: 'HTML fallback; prefer Text fs="italic" span',
154
+ small: 'HTML fallback; prefer Text size="xs"',
155
+ code: 'HTML fallback; prefer Code',
156
+ Placeholder: 'label, h; placeholder for images, charts, etc.',
157
+ Custom: 'kind; component absent from the catalog, rendered as a labeled placeholder box',
158
+ '#text': 'Compiler-generated text node (do not use directly)',
159
+ Button: 'variant: filled|light|outline|subtle|default|white, color, size, fullWidth, loading, leftSection (character)',
160
+ ActionIcon: "Icon button: aria-label (required as name), variant, color, size; one character child such as '+'",
155
161
  CloseButton: 'aria-label, size',
156
- Anchor: 'href(看板内路径,不会真正跳转), c, underline',
157
- a: 'HTML 兜底,建议改用 Anchor',
158
- NavLink: 'label, description, href(等于当前路径时高亮), active, leftSection(字符);可嵌套 NavLink',
159
- Burger: 'opened, aria-label —— 窄屏导航开关,常配 hiddenFrom="sm"',
160
- TextInput: 'label, placeholder, description, error, withAsterisk, type —— type 动作写入',
161
- PasswordInput: 'label, placeholder, description, error —— type 动作写入,显示为圆点',
162
- NumberInput: 'label, placeholder, min, max, suffix, prefix —— type 动作写入',
163
- Textarea: 'label, placeholder, description, error, minRows, autosize —— type 动作写入',
164
- Select: 'label, data: string[] | { value, label }[], placeholder, description —— select 动作接受 value 或 label',
165
- MultiSelect: 'label, data, placeholder —— 每次 select 动作切换一个选项',
166
- Checkbox: 'label, description, checked —— toggle 动作写入',
167
- 'Radio.Group': 'label, value;子元素用 Radio value/label —— select 动作接受 value 或 label',
168
- Switch: 'label, description, checked —— toggle 动作写入',
169
- SegmentedControl: 'data: string[] | { value, label }[], fullWidth —— select 动作接受 value 或 label',
170
- FileInput: 'label, placeholder, accept —— type 动作写入文件名',
171
- Tabs: 'value / defaultValue;Tabs.List 内放 Tabs.Tab,Tabs.Panel 放内容 —— select 动作切换标签',
172
- 'Tabs.Tab': 'value, leftSection(字符)',
173
- 'Accordion.Control': '可点击的标题(需要 id)',
174
- Pagination: 'total, value / defaultValue —— select 动作写入页码',
175
- PromptInput: 'placeholder —— AI 输入框,type 动作写入;发送按钮用 ActionIcon 或 Button',
176
- 'Terminal.Input': 'prompt(默认 "$"), placeholder —— 终端里的输入行(需要 id),type 动作写入',
162
+ Anchor: 'href is display-only; clicking never navigates; use go() in the step; c, underline',
163
+ a: 'HTML fallback; prefer Anchor',
164
+ NavLink: 'label, description, href (highlighted when equal to current route), active, leftSection (character); nested NavLink allowed',
165
+ Burger: 'opened, aria-label; narrow-screen navigation toggle, usually with hiddenFrom="sm"',
166
+ TextInput: 'label, placeholder, description, error, withAsterisk, type; type action writes the value',
167
+ PasswordInput: 'label, placeholder, description, error; type action writes the value, shown as dots',
168
+ NumberInput: 'label, placeholder, min, max, suffix, prefix; type action writes the value',
169
+ Textarea: 'label, placeholder, description, error, minRows, autosize; type action writes the value',
170
+ Select: 'label, data: string[] | { value, label }[], placeholder, description; select accepts value or label',
171
+ MultiSelect: 'label, data, placeholder; each select toggles one option',
172
+ Checkbox: 'label, description, checked; toggle action writes the value',
173
+ 'Radio.Group': 'label, value; Radio value/label children; select accepts value or label',
174
+ Switch: 'label, description, checked; toggle action writes the value',
175
+ SegmentedControl: 'data: string[] | { value, label }[], fullWidth; select accepts value or label',
176
+ FileInput: 'label, placeholder, accept; type action writes the filename',
177
+ Tabs: 'value / defaultValue; Tabs.Tab inside Tabs.List, content in Tabs.Panel; select switches tabs',
178
+ 'Tabs.Tab': 'value, leftSection (character)',
179
+ 'Accordion.Control': 'Clickable heading (requires id)',
180
+ Pagination: 'total, value / defaultValue; select action writes the page number',
181
+ PromptInput: 'placeholder; AI input, type action writes the value; use ActionIcon or Button to send',
182
+ 'Artifact.Ref': "title, kind, status; card linking to an artifact in the conversation (requires id; clickable)",
183
+ 'Terminal.Input': 'prompt (default "$"), placeholder; terminal input line (requires id), type action writes the value',
177
184
  };
178
185
  // ---------- 响应式(Mantine 默认断点,按舞台宽度取值) ----------
179
186
  /** Mantine 默认断点:36/48/62/75/88em,按 16px 换算。 */
package/dist/compile.d.ts CHANGED
@@ -29,4 +29,6 @@ export type CompileResult = {
29
29
  diagnostics: Diagnostic[];
30
30
  };
31
31
  export declare function compile(src: AuthoringProject, mode: 'dev' | 'publish'): CompileResult;
32
+ /** 角色的颜色(D56):没写 color 时按声明顺序取。 */
33
+ export declare const ROLE_COLORS: readonly ["#E8590C", "#1971C2", "#2F9E44", "#9C36B5", "#C2255C", "#0C8599"];
32
34
  export declare function relSource(root: string, s: string): string;