@maxhealth.tech/prefab 0.3.9 → 0.3.11
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/CHANGELOG.md +723 -671
- package/README.md +76 -10
- package/dist/a2ui/browser.d.ts +46 -0
- package/dist/a2ui/browser.d.ts.map +1 -0
- package/dist/a2ui/browser.js +58 -0
- package/dist/a2ui/browser.js.map +1 -0
- package/dist/a2ui/catalog.d.ts +72 -0
- package/dist/a2ui/catalog.d.ts.map +1 -0
- package/dist/a2ui/catalog.js +521 -0
- package/dist/a2ui/catalog.js.map +1 -0
- package/dist/a2ui/control.d.ts +20 -0
- package/dist/a2ui/control.d.ts.map +1 -0
- package/dist/a2ui/control.js +107 -0
- package/dist/a2ui/control.js.map +1 -0
- package/dist/a2ui/emit.d.ts +59 -0
- package/dist/a2ui/emit.d.ts.map +1 -0
- package/dist/a2ui/emit.js +373 -0
- package/dist/a2ui/emit.js.map +1 -0
- package/dist/a2ui/expr.d.ts +91 -0
- package/dist/a2ui/expr.d.ts.map +1 -0
- package/dist/a2ui/expr.js +201 -0
- package/dist/a2ui/expr.js.map +1 -0
- package/dist/a2ui/icons.d.ts +30 -0
- package/dist/a2ui/icons.d.ts.map +1 -0
- package/dist/a2ui/icons.js +87 -0
- package/dist/a2ui/icons.js.map +1 -0
- package/dist/a2ui/index.d.ts +29 -0
- package/dist/a2ui/index.d.ts.map +1 -0
- package/dist/a2ui/index.js +24 -0
- package/dist/a2ui/index.js.map +1 -0
- package/dist/a2ui/pipes.d.ts +49 -0
- package/dist/a2ui/pipes.d.ts.map +1 -0
- package/dist/a2ui/pipes.js +106 -0
- package/dist/a2ui/pipes.js.map +1 -0
- package/dist/a2ui/table.d.ts +31 -0
- package/dist/a2ui/table.d.ts.map +1 -0
- package/dist/a2ui/table.js +155 -0
- package/dist/a2ui/table.js.map +1 -0
- package/dist/a2ui/types.d.ts +174 -0
- package/dist/a2ui/types.d.ts.map +1 -0
- package/dist/a2ui/types.js +35 -0
- package/dist/a2ui/types.js.map +1 -0
- package/dist/a2ui.min.js +1 -0
- package/dist/app.d.ts +17 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +19 -0
- package/dist/app.js.map +1 -1
- package/dist/auto/form.d.ts +25 -0
- package/dist/auto/form.d.ts.map +1 -1
- package/dist/auto/form.js +21 -8
- package/dist/auto/form.js.map +1 -1
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.d.ts.map +1 -1
- package/dist/core/version.js +1 -1
- package/dist/core/version.js.map +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/a2ui.d.ts +91 -0
- package/dist/mcp/a2ui.d.ts.map +1 -0
- package/dist/mcp/a2ui.js +134 -0
- package/dist/mcp/a2ui.js.map +1 -0
- package/dist/mcp/display.d.ts +28 -6
- package/dist/mcp/display.d.ts.map +1 -1
- package/dist/mcp/display.js +10 -9
- package/dist/mcp/display.js.map +1 -1
- package/dist/mcp/index.d.ts +7 -2
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +3 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/input-required.d.ts +79 -0
- package/dist/mcp/input-required.d.ts.map +1 -0
- package/dist/mcp/input-required.js +231 -0
- package/dist/mcp/input-required.js.map +1 -0
- package/dist/mcp/resource.d.ts +10 -0
- package/dist/mcp/resource.d.ts.map +1 -1
- package/dist/mcp/resource.js +12 -4
- package/dist/mcp/resource.js.map +1 -1
- package/dist/mcp/result.d.ts +7 -5
- package/dist/mcp/result.d.ts.map +1 -1
- package/dist/mcp/result.js +5 -3
- package/dist/mcp/result.js.map +1 -1
- package/dist/mcp/types.d.ts +117 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/renderer/components/index.d.ts.map +1 -1
- package/dist/renderer/components/index.js +6 -0
- package/dist/renderer/components/index.js.map +1 -1
- package/dist/renderer/engine.d.ts +4 -0
- package/dist/renderer/engine.d.ts.map +1 -1
- package/dist/renderer/engine.js +24 -0
- package/dist/renderer/engine.js.map +1 -1
- package/dist/renderer.auto.min.js +13 -13
- package/dist/renderer.min.js +13 -13
- package/package.json +14 -3
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* prefab component type → A2UI Basic catalog mapper registry.
|
|
3
|
+
*
|
|
4
|
+
* prefab ships 115+ components; the A2UI Basic catalog defines 18. The gap is
|
|
5
|
+
* closed by degradation rather than by refusing to emit: a `Badge` becomes
|
|
6
|
+
* `Text`, an `Alert` becomes a `Card` wrapping its body, an `H2` becomes `Text`
|
|
7
|
+
* carrying a Markdown `##` prefix (which the Basic catalog's `Text` explicitly
|
|
8
|
+
* supports). Every degradation is recorded as a diagnostic, so what changed is
|
|
9
|
+
* visible at emit time instead of in someone else's renderer.
|
|
10
|
+
*
|
|
11
|
+
* A mapper returns the A2UI properties for one node without its `id`; the
|
|
12
|
+
* emitter allocates ids and owns the adjacency list. Mappers that expand one
|
|
13
|
+
* prefab node into several A2UI components (`Metric`, the table family in
|
|
14
|
+
* `./table.ts`) push the extras through `ctx.push` and return the root of the
|
|
15
|
+
* expansion.
|
|
16
|
+
*/
|
|
17
|
+
import { a2uiIconName } from './icons.js';
|
|
18
|
+
import { CONTROL_MAPPERS } from './control.js';
|
|
19
|
+
import { mapTable, mapDataTable, TABLE_PART_TYPES } from './table.js';
|
|
20
|
+
// ── Helpers ──────────────────────────────────────────────────────────────────
|
|
21
|
+
/** Read the first present scalar prop from a node. */
|
|
22
|
+
function textOf(node, ...keys) {
|
|
23
|
+
for (const k of keys) {
|
|
24
|
+
const v = node[k];
|
|
25
|
+
if (typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean')
|
|
26
|
+
return String(v);
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
/** Build a `Text` component, prefixing Markdown syntax onto literal content. */
|
|
31
|
+
function text(node, ctx, opts) {
|
|
32
|
+
const raw = textOf(node, ...(opts?.keys ?? ['content', 'text', 'label', 'title']));
|
|
33
|
+
if (raw == null) {
|
|
34
|
+
ctx.note('unsupported', node.type, 'no text content to render');
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
const bound = ctx.bind(raw);
|
|
38
|
+
if (bound.kind === 'unbindable') {
|
|
39
|
+
ctx.note('expression', node.type, `"${bound.expression}" is richer than a JSON Pointer; the text was left as written`);
|
|
40
|
+
}
|
|
41
|
+
const prefix = opts?.prefix ?? '';
|
|
42
|
+
const suffix = opts?.suffix ?? '';
|
|
43
|
+
// Markdown decoration can only wrap a literal. A bound or interpolated value
|
|
44
|
+
// is handed over undecorated rather than emitting syntax the renderer would
|
|
45
|
+
// show as data.
|
|
46
|
+
if (bound.kind === 'format' && bound.note != null)
|
|
47
|
+
ctx.note('degraded', node.type, bound.note);
|
|
48
|
+
if (bound.kind === 'binding' || bound.kind === 'format' || bound.kind === 'index') {
|
|
49
|
+
if (prefix !== '' || suffix !== '') {
|
|
50
|
+
ctx.note('degraded', node.type, 'Markdown emphasis dropped: the text is a data binding');
|
|
51
|
+
}
|
|
52
|
+
return { component: 'Text', text: bound.value, ...(opts?.variant != null && { variant: opts.variant }) };
|
|
53
|
+
}
|
|
54
|
+
const literal = bound.kind === 'literal' ? bound.value : raw;
|
|
55
|
+
return {
|
|
56
|
+
component: 'Text',
|
|
57
|
+
text: `${prefix}${literal}${suffix}`,
|
|
58
|
+
...(opts?.variant != null && { variant: opts.variant }),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Map prefab's justify/align vocabulary onto the Basic catalog's. */
|
|
62
|
+
const JUSTIFY = {
|
|
63
|
+
start: 'start', end: 'end', center: 'center',
|
|
64
|
+
between: 'spaceBetween', around: 'spaceAround', evenly: 'spaceEvenly',
|
|
65
|
+
spaceBetween: 'spaceBetween', spaceAround: 'spaceAround', spaceEvenly: 'spaceEvenly',
|
|
66
|
+
};
|
|
67
|
+
const ALIGN = {
|
|
68
|
+
start: 'start', end: 'end', center: 'center', stretch: 'stretch', baseline: 'baseline',
|
|
69
|
+
};
|
|
70
|
+
function flow(component) {
|
|
71
|
+
return (node, ctx) => {
|
|
72
|
+
const children = ctx.children(node.children);
|
|
73
|
+
if (children.length === 0) {
|
|
74
|
+
ctx.note('unsupported', node.type, `${component} requires at least one child and none survived`);
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
const justify = typeof node.justify === 'string' ? JUSTIFY[node.justify] : undefined;
|
|
78
|
+
const align = typeof node.align === 'string' ? ALIGN[node.align] : undefined;
|
|
79
|
+
return {
|
|
80
|
+
component,
|
|
81
|
+
children,
|
|
82
|
+
...(justify != null && { justify }),
|
|
83
|
+
...(align != null && { align }),
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** Container types carrying no meaning A2UI can express; they flatten to a Column. */
|
|
88
|
+
const AS_COLUMN = [
|
|
89
|
+
'Div', 'Container', 'Stack', 'Grid', 'GridItem', 'Page', 'Pages', 'Dashboard',
|
|
90
|
+
'DashboardItem', 'MasterDetail', 'Detail', 'Form', 'Fieldset', 'CardContent',
|
|
91
|
+
'CardHeader', 'CardFooter', 'Accordion', 'Carousel', 'SelectGroup', 'ComboboxGroup',
|
|
92
|
+
'Section', 'Article', 'Aside', 'Header', 'Footer', 'Nav', 'Span',
|
|
93
|
+
];
|
|
94
|
+
const AS_ROW = ['ButtonGroup', 'Toolbar', 'Inline'];
|
|
95
|
+
// ── Text ─────────────────────────────────────────────────────────────────────
|
|
96
|
+
const HEADING_PREFIX = {
|
|
97
|
+
H1: '# ', H2: '## ', H3: '### ', H4: '#### ', H5: '##### ', H6: '###### ',
|
|
98
|
+
};
|
|
99
|
+
const TEXT_MAPPERS = {
|
|
100
|
+
Heading: (node, ctx) => {
|
|
101
|
+
const level = typeof node.level === 'number' ? Math.min(6, Math.max(1, node.level)) : 1;
|
|
102
|
+
return text(node, ctx, { prefix: `${'#'.repeat(level)} ` });
|
|
103
|
+
},
|
|
104
|
+
Text: (node, ctx) => text(node, ctx),
|
|
105
|
+
P: (node, ctx) => text(node, ctx),
|
|
106
|
+
Lead: (node, ctx) => text(node, ctx),
|
|
107
|
+
Large: (node, ctx) => text(node, ctx),
|
|
108
|
+
Small: (node, ctx) => text(node, ctx, { variant: 'caption' }),
|
|
109
|
+
Muted: (node, ctx) => text(node, ctx, { variant: 'caption' }),
|
|
110
|
+
Label: (node, ctx) => text(node, ctx, { variant: 'caption' }),
|
|
111
|
+
TableCaption: (node, ctx) => text(node, ctx, { variant: 'caption' }),
|
|
112
|
+
BlockQuote: (node, ctx) => text(node, ctx, { prefix: '> ' }),
|
|
113
|
+
Code: (node, ctx) => text(node, ctx, { prefix: '`', suffix: '`' }),
|
|
114
|
+
Kbd: (node, ctx) => text(node, ctx, { prefix: '`', suffix: '`' }),
|
|
115
|
+
Markdown: (node, ctx) => text(node, ctx),
|
|
116
|
+
Badge: (node, ctx) => text(node, ctx, { keys: ['label', 'content'], variant: 'caption' }),
|
|
117
|
+
// Card slots that carry text rather than children. Without these they fall to
|
|
118
|
+
// the generic fallback, which renders the same Text but reports a degradation
|
|
119
|
+
// for what is actually an exact mapping.
|
|
120
|
+
CardTitle: (node, ctx) => text(node, ctx, { prefix: '**', suffix: '**' }),
|
|
121
|
+
CardDescription: (node, ctx) => text(node, ctx, { variant: 'caption' }),
|
|
122
|
+
Tooltip: (node, ctx) => text(node, ctx, { variant: 'caption' }),
|
|
123
|
+
AlertTitle: (node, ctx) => text(node, ctx, { prefix: '**', suffix: '**' }),
|
|
124
|
+
AlertDescription: (node, ctx) => text(node, ctx),
|
|
125
|
+
};
|
|
126
|
+
for (const [type, prefix] of Object.entries(HEADING_PREFIX)) {
|
|
127
|
+
TEXT_MAPPERS[type] = (node, ctx) => text(node, ctx, { prefix });
|
|
128
|
+
}
|
|
129
|
+
// ── Media ────────────────────────────────────────────────────────────────────
|
|
130
|
+
function media(component) {
|
|
131
|
+
return (node, ctx) => {
|
|
132
|
+
const url = ctx.dyn(textOf(node, 'src', 'url'));
|
|
133
|
+
if (url == null) {
|
|
134
|
+
ctx.note('unsupported', node.type, 'no resolvable source URL');
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
// Only Image and AudioPlayer take a description; Video carries a poster instead.
|
|
138
|
+
const description = component === 'Video' ? undefined : ctx.dyn(textOf(node, 'alt', 'description'));
|
|
139
|
+
const poster = component === 'Video' ? ctx.dyn(textOf(node, 'poster', 'posterUrl')) : undefined;
|
|
140
|
+
return {
|
|
141
|
+
component,
|
|
142
|
+
url,
|
|
143
|
+
...(description != null && { description }),
|
|
144
|
+
...(poster != null && { posterUrl: poster }),
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
// ── Form ─────────────────────────────────────────────────────────────────────
|
|
149
|
+
/** prefab `inputType` → the Basic catalog's four TextField variants. */
|
|
150
|
+
const TEXTFIELD_VARIANT = {
|
|
151
|
+
text: 'shortText', email: 'shortText', url: 'shortText', tel: 'shortText', search: 'shortText',
|
|
152
|
+
password: 'obscured', number: 'number',
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* Bind a stateful control to the data model.
|
|
156
|
+
*
|
|
157
|
+
* prefab addresses form state by `name`, a key at the root of the state object,
|
|
158
|
+
* so the pointer is that name as a single escaped token.
|
|
159
|
+
*/
|
|
160
|
+
function valueBinding(node, ctx) {
|
|
161
|
+
const name = typeof node.name === 'string' ? node.name : undefined;
|
|
162
|
+
if (name == null)
|
|
163
|
+
return undefined;
|
|
164
|
+
const bound = ctx.bind(`{{ ${name} }}`);
|
|
165
|
+
return bound.kind === 'binding' ? bound.value : undefined;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Renderer-side validation for a stateful control.
|
|
169
|
+
*
|
|
170
|
+
* Every A2UI input is `Checkable` and takes a list of check rules, which is the
|
|
171
|
+
* same job prefab's `required` and `inputType` do. Dropping them made a form
|
|
172
|
+
* cross over without its validation: a required field stopped being required,
|
|
173
|
+
* which is a functional regression rather than a cosmetic one.
|
|
174
|
+
*
|
|
175
|
+
* No `message` is emitted. The rule already says which check failed, and the
|
|
176
|
+
* renderer is better placed to word and localize that than a hardcoded English
|
|
177
|
+
* string from here.
|
|
178
|
+
*/
|
|
179
|
+
function checksOf(node, ctx) {
|
|
180
|
+
const value = valueBinding(node, ctx);
|
|
181
|
+
if (value == null)
|
|
182
|
+
return undefined;
|
|
183
|
+
const checks = [];
|
|
184
|
+
if (node.required === true)
|
|
185
|
+
checks.push({ condition: { call: 'required', args: { value } } });
|
|
186
|
+
// `numeric` is deliberately absent. The catalog requires it to carry a `min`
|
|
187
|
+
// or a `max` — it is a range check, not a type check — and prefab's number
|
|
188
|
+
// inputs carry no range to supply. Emitting a bare one fails validation, and
|
|
189
|
+
// `variant: 'number'` on the field already says the value is numeric.
|
|
190
|
+
if (node.inputType === 'email')
|
|
191
|
+
checks.push({ condition: { call: 'email', args: { value } } });
|
|
192
|
+
return checks.length > 0 ? checks : undefined;
|
|
193
|
+
}
|
|
194
|
+
function optionsOf(node, ctx) {
|
|
195
|
+
const children = Array.isArray(node.children) ? node.children : [];
|
|
196
|
+
const options = [];
|
|
197
|
+
for (const child of children) {
|
|
198
|
+
const value = textOf(child, 'value');
|
|
199
|
+
if (value == null) {
|
|
200
|
+
ctx.note('degraded', node.type, `dropped a ${child.type} child that carries no option value`);
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
options.push({ label: textOf(child, 'label') ?? value, value });
|
|
204
|
+
}
|
|
205
|
+
return options;
|
|
206
|
+
}
|
|
207
|
+
function dateTime(node, ctx, flags) {
|
|
208
|
+
if (textOf(node, 'label', 'name') == null) {
|
|
209
|
+
ctx.note('degraded', node.type, 'no label available for the DateTimeInput');
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
component: 'DateTimeInput',
|
|
213
|
+
// The catalog asks for an empty string while the value is unset.
|
|
214
|
+
value: valueBinding(node, ctx) ?? '',
|
|
215
|
+
...flags,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function choicePicker(variant) {
|
|
219
|
+
return (node, ctx) => {
|
|
220
|
+
const label = ctx.dyn(textOf(node, 'label', 'name'));
|
|
221
|
+
if (label == null) {
|
|
222
|
+
ctx.note('unsupported', node.type, 'ChoicePicker requires a label and none could be derived');
|
|
223
|
+
return undefined;
|
|
224
|
+
}
|
|
225
|
+
const options = optionsOf(node, ctx);
|
|
226
|
+
if (options.length === 0) {
|
|
227
|
+
ctx.note('unsupported', node.type, 'no options to choose from');
|
|
228
|
+
return undefined;
|
|
229
|
+
}
|
|
230
|
+
const value = valueBinding(node, ctx);
|
|
231
|
+
const checks = checksOf(node, ctx);
|
|
232
|
+
return {
|
|
233
|
+
component: 'ChoicePicker',
|
|
234
|
+
label,
|
|
235
|
+
variant,
|
|
236
|
+
options,
|
|
237
|
+
...(value != null && { value }),
|
|
238
|
+
...(checks != null && { checks }),
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
function textField(node, ctx, variant) {
|
|
243
|
+
const label = ctx.dyn(textOf(node, 'label', 'name'));
|
|
244
|
+
if (label == null) {
|
|
245
|
+
ctx.note('unsupported', node.type, 'TextField requires a label and none could be derived');
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
const value = valueBinding(node, ctx);
|
|
249
|
+
const placeholder = ctx.dyn(textOf(node, 'placeholder'));
|
|
250
|
+
const checks = checksOf(node, ctx);
|
|
251
|
+
return {
|
|
252
|
+
component: 'TextField',
|
|
253
|
+
label,
|
|
254
|
+
variant,
|
|
255
|
+
...(value != null && { value }),
|
|
256
|
+
...(placeholder != null && { placeholder }),
|
|
257
|
+
...(checks != null && { checks }),
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
const FORM_MAPPERS = {
|
|
261
|
+
Input: (node, ctx) => {
|
|
262
|
+
const inputType = typeof node.inputType === 'string' ? node.inputType : 'text';
|
|
263
|
+
const variant = TEXTFIELD_VARIANT[inputType];
|
|
264
|
+
if (variant == null) {
|
|
265
|
+
ctx.note('degraded', node.type, `inputType "${inputType}" has no A2UI variant; used shortText`);
|
|
266
|
+
}
|
|
267
|
+
return textField(node, ctx, variant ?? 'shortText');
|
|
268
|
+
},
|
|
269
|
+
Textarea: (node, ctx) => textField(node, ctx, 'longText'),
|
|
270
|
+
Checkbox: (node, ctx) => {
|
|
271
|
+
const label = ctx.dyn(textOf(node, 'label', 'name'));
|
|
272
|
+
if (label == null) {
|
|
273
|
+
ctx.note('unsupported', node.type, 'CheckBox requires a label and none could be derived');
|
|
274
|
+
return undefined;
|
|
275
|
+
}
|
|
276
|
+
const checks = checksOf(node, ctx);
|
|
277
|
+
// `value` is required by the catalog; an unbound checkbox starts unchecked.
|
|
278
|
+
return {
|
|
279
|
+
component: 'CheckBox',
|
|
280
|
+
label,
|
|
281
|
+
value: valueBinding(node, ctx) ?? false,
|
|
282
|
+
...(checks != null && { checks }),
|
|
283
|
+
};
|
|
284
|
+
},
|
|
285
|
+
Slider: (node, ctx) => {
|
|
286
|
+
const max = typeof node.max === 'number' ? node.max : undefined;
|
|
287
|
+
if (max == null) {
|
|
288
|
+
ctx.note('unsupported', node.type, 'Slider requires a max and prefab left it open');
|
|
289
|
+
return undefined;
|
|
290
|
+
}
|
|
291
|
+
const label = ctx.dyn(textOf(node, 'label', 'name'));
|
|
292
|
+
const min = typeof node.min === 'number' ? node.min : undefined;
|
|
293
|
+
const step = typeof node.step === 'number' ? node.step : undefined;
|
|
294
|
+
// A2UI counts divisions where prefab counts increment size.
|
|
295
|
+
const steps = step != null && step > 0 ? Math.max(1, Math.round((max - (min ?? 0)) / step)) : undefined;
|
|
296
|
+
return {
|
|
297
|
+
component: 'Slider',
|
|
298
|
+
max,
|
|
299
|
+
value: valueBinding(node, ctx) ?? min ?? 0,
|
|
300
|
+
...(label != null && { label }),
|
|
301
|
+
...(min != null && { min }),
|
|
302
|
+
...(steps != null && { steps }),
|
|
303
|
+
};
|
|
304
|
+
},
|
|
305
|
+
Button: (node, ctx) => {
|
|
306
|
+
const label = textOf(node, 'label', 'content') ?? 'Button';
|
|
307
|
+
const action = ctx.action(node.onClick, 'Button')
|
|
308
|
+
?? (node.submit === true ? { event: { name: 'submit' } } : undefined);
|
|
309
|
+
if (action == null) {
|
|
310
|
+
ctx.note('unsupported', node.type, 'Button requires an action and none could be derived');
|
|
311
|
+
return undefined;
|
|
312
|
+
}
|
|
313
|
+
const child = ctx.push({ component: 'Text', text: ctx.dyn(label) ?? label });
|
|
314
|
+
const variant = node.variant === 'link' || node.variant === 'ghost'
|
|
315
|
+
? 'borderless'
|
|
316
|
+
: node.variant === 'default' ? 'primary' : 'default';
|
|
317
|
+
return { component: 'Button', child, action, variant };
|
|
318
|
+
},
|
|
319
|
+
Link: (node, ctx) => {
|
|
320
|
+
const href = textOf(node, 'href', 'url');
|
|
321
|
+
if (href == null) {
|
|
322
|
+
ctx.note('unsupported', node.type, 'no href to open');
|
|
323
|
+
return undefined;
|
|
324
|
+
}
|
|
325
|
+
const label = textOf(node, 'content', 'label') ?? href;
|
|
326
|
+
const child = ctx.push({ component: 'Text', text: ctx.dyn(label) ?? label });
|
|
327
|
+
// A2UI Basic renders links as a borderless Button running the openUrl function.
|
|
328
|
+
return {
|
|
329
|
+
component: 'Button',
|
|
330
|
+
child,
|
|
331
|
+
variant: 'borderless',
|
|
332
|
+
action: { functionCall: { call: 'openUrl', args: { url: href } } },
|
|
333
|
+
};
|
|
334
|
+
},
|
|
335
|
+
DatePicker: (node, ctx) => dateTime(node, ctx, { enableDate: true }),
|
|
336
|
+
TimePicker: (node, ctx) => dateTime(node, ctx, { enableTime: true }),
|
|
337
|
+
DateTimePicker: (node, ctx) => dateTime(node, ctx, { enableDate: true, enableTime: true }),
|
|
338
|
+
Select: choicePicker('mutuallyExclusive'),
|
|
339
|
+
RadioGroup: choicePicker('mutuallyExclusive'),
|
|
340
|
+
Combobox: choicePicker('mutuallyExclusive'),
|
|
341
|
+
};
|
|
342
|
+
// A Switch is a checkbox with a different affordance; A2UI Basic has one control for both.
|
|
343
|
+
FORM_MAPPERS.Switch = FORM_MAPPERS.Checkbox;
|
|
344
|
+
// ── Composites ───────────────────────────────────────────────────────────────
|
|
345
|
+
const COMPOSITE_MAPPERS = {
|
|
346
|
+
Card: (node, ctx) => {
|
|
347
|
+
const child = ctx.single(node.children);
|
|
348
|
+
if (child == null) {
|
|
349
|
+
ctx.note('unsupported', 'Card', 'Card requires a child and it had none');
|
|
350
|
+
return undefined;
|
|
351
|
+
}
|
|
352
|
+
return { component: 'Card', child };
|
|
353
|
+
},
|
|
354
|
+
Alert: (node, ctx) => {
|
|
355
|
+
const child = ctx.single(node.children);
|
|
356
|
+
if (child == null) {
|
|
357
|
+
ctx.note('unsupported', 'Alert', 'no alert body to render');
|
|
358
|
+
return undefined;
|
|
359
|
+
}
|
|
360
|
+
const variant = typeof node.variant === 'string' ? node.variant : 'default';
|
|
361
|
+
ctx.note('degraded', 'Alert', `variant "${variant}" rendered as a plain Card`);
|
|
362
|
+
return { component: 'Card', child };
|
|
363
|
+
},
|
|
364
|
+
Separator: () => ({ component: 'Divider' }),
|
|
365
|
+
Divider: () => ({ component: 'Divider' }),
|
|
366
|
+
Icon: (node, ctx) => {
|
|
367
|
+
const name = textOf(node, 'name', 'icon');
|
|
368
|
+
if (name == null) {
|
|
369
|
+
ctx.note('unsupported', 'Icon', 'no icon name');
|
|
370
|
+
return undefined;
|
|
371
|
+
}
|
|
372
|
+
// A2UI's icon names are a closed enum, so an unrecognised one fails
|
|
373
|
+
// validation rather than falling back to a default glyph.
|
|
374
|
+
const resolved = a2uiIconName(name);
|
|
375
|
+
if (resolved == null) {
|
|
376
|
+
ctx.note('unsupported', 'Icon', `"${name}" has no equivalent in the A2UI icon set`);
|
|
377
|
+
return undefined;
|
|
378
|
+
}
|
|
379
|
+
if (resolved !== name)
|
|
380
|
+
ctx.note('degraded', 'Icon', `"${name}" mapped to the A2UI icon "${resolved}"`);
|
|
381
|
+
return { component: 'Icon', name: resolved };
|
|
382
|
+
},
|
|
383
|
+
Metric: (node, ctx) => {
|
|
384
|
+
// A Column of caption + value is the closest Basic-catalog reading of a KPI tile.
|
|
385
|
+
const parts = [];
|
|
386
|
+
const label = textOf(node, 'label', 'title');
|
|
387
|
+
if (label != null) {
|
|
388
|
+
parts.push(ctx.push({ component: 'Text', text: ctx.dyn(label) ?? label, variant: 'caption' }));
|
|
389
|
+
}
|
|
390
|
+
const value = textOf(node, 'value');
|
|
391
|
+
if (value != null) {
|
|
392
|
+
parts.push(ctx.push({ component: 'Text', text: ctx.dyn(value) ?? value }));
|
|
393
|
+
}
|
|
394
|
+
if (parts.length === 0) {
|
|
395
|
+
ctx.note('unsupported', 'Metric', 'neither a label nor a value to render');
|
|
396
|
+
return undefined;
|
|
397
|
+
}
|
|
398
|
+
ctx.note('degraded', 'Metric', 'rendered as a Column of Text; trend and delta styling dropped');
|
|
399
|
+
return { component: 'Column', children: parts };
|
|
400
|
+
},
|
|
401
|
+
Tabs: (node, ctx) => {
|
|
402
|
+
const children = Array.isArray(node.children) ? node.children : [];
|
|
403
|
+
const tabs = [];
|
|
404
|
+
for (const tab of children) {
|
|
405
|
+
const child = ctx.single(tab.children);
|
|
406
|
+
if (child == null)
|
|
407
|
+
continue;
|
|
408
|
+
tabs.push({ title: textOf(tab, 'title') ?? 'Tab', child });
|
|
409
|
+
}
|
|
410
|
+
if (tabs.length === 0) {
|
|
411
|
+
ctx.note('unsupported', 'Tabs', 'no tab had renderable content');
|
|
412
|
+
return undefined;
|
|
413
|
+
}
|
|
414
|
+
return { component: 'Tabs', tabs };
|
|
415
|
+
},
|
|
416
|
+
Dialog: (node, ctx) => {
|
|
417
|
+
const content = ctx.single(node.children);
|
|
418
|
+
if (content == null) {
|
|
419
|
+
ctx.note('unsupported', 'Dialog', 'no dialog body to render');
|
|
420
|
+
return undefined;
|
|
421
|
+
}
|
|
422
|
+
// A2UI's Modal takes any component as its trigger, so a prefab trigger that
|
|
423
|
+
// will not map on its own does not have to cost the dialog. prefab's own
|
|
424
|
+
// trigger is usually a Button with no onClick — opening the dialog is
|
|
425
|
+
// implicit — which the Button mapper rightly refuses, so falling back to the
|
|
426
|
+
// label as Text is the difference between a working Modal and none at all.
|
|
427
|
+
const triggerNode = node.trigger;
|
|
428
|
+
const label = triggerNode != null
|
|
429
|
+
? textOf(triggerNode, 'label', 'content') ?? textOf(node, 'title') ?? 'Open'
|
|
430
|
+
: textOf(node, 'title') ?? 'Open';
|
|
431
|
+
const trigger = (triggerNode != null ? ctx.child(triggerNode) : undefined)
|
|
432
|
+
?? ctx.push({ component: 'Text', text: ctx.dyn(label) ?? label });
|
|
433
|
+
return { component: 'Modal', trigger, content };
|
|
434
|
+
},
|
|
435
|
+
AccordionItem: (node, ctx) => {
|
|
436
|
+
const parts = [];
|
|
437
|
+
const title = textOf(node, 'title');
|
|
438
|
+
if (title != null)
|
|
439
|
+
parts.push(ctx.push({ component: 'Text', text: title, variant: 'caption' }));
|
|
440
|
+
parts.push(...ctx.children(node.children));
|
|
441
|
+
if (parts.length === 0) {
|
|
442
|
+
ctx.note('unsupported', 'AccordionItem', 'nothing to render');
|
|
443
|
+
return undefined;
|
|
444
|
+
}
|
|
445
|
+
ctx.note('degraded', 'AccordionItem', 'rendered expanded; A2UI Basic has no disclosure component');
|
|
446
|
+
return { component: 'Column', children: parts };
|
|
447
|
+
},
|
|
448
|
+
};
|
|
449
|
+
// ── Registry ─────────────────────────────────────────────────────────────────
|
|
450
|
+
const MAPPERS = {
|
|
451
|
+
Column: flow('Column'),
|
|
452
|
+
Row: flow('Row'),
|
|
453
|
+
...TEXT_MAPPERS,
|
|
454
|
+
...FORM_MAPPERS,
|
|
455
|
+
...COMPOSITE_MAPPERS,
|
|
456
|
+
...CONTROL_MAPPERS,
|
|
457
|
+
Image: media('Image'),
|
|
458
|
+
Video: media('Video'),
|
|
459
|
+
Audio: media('AudioPlayer'),
|
|
460
|
+
Table: mapTable,
|
|
461
|
+
DataTable: mapDataTable,
|
|
462
|
+
};
|
|
463
|
+
for (const type of AS_COLUMN)
|
|
464
|
+
MAPPERS[type] ??= flow('Column');
|
|
465
|
+
for (const type of AS_ROW)
|
|
466
|
+
MAPPERS[type] ??= flow('Row');
|
|
467
|
+
/** Types that only make sense inside their parent's mapper. */
|
|
468
|
+
const CONSUMED_BY_PARENT = new Set([
|
|
469
|
+
'Tab', 'SelectOption', 'ComboboxOption', 'Radio', 'Option', ...TABLE_PART_TYPES,
|
|
470
|
+
]);
|
|
471
|
+
/**
|
|
472
|
+
* Component families with no Basic-catalog reading at all. Naming them keeps the
|
|
473
|
+
* diagnostic specific ("charts are outside the Basic catalog") rather than the
|
|
474
|
+
* generic fallback's "no equivalent".
|
|
475
|
+
*/
|
|
476
|
+
const KNOWN_UNSUPPORTED = {
|
|
477
|
+
LineChart: 'charts', BarChart: 'charts', AreaChart: 'charts', PieChart: 'charts',
|
|
478
|
+
ScatterChart: 'charts', RadarChart: 'charts', RadialChart: 'charts',
|
|
479
|
+
Histogram: 'charts', Sparkline: 'charts',
|
|
480
|
+
Svg: 'inline vector graphics', Mermaid: 'diagrams', Embed: 'embedded frames',
|
|
481
|
+
DropZone: 'file uploads', Ring: 'progress rings', Loader: 'loading indicators',
|
|
482
|
+
Progress: 'progress bars',
|
|
483
|
+
};
|
|
484
|
+
export function mapperFor(type) {
|
|
485
|
+
return MAPPERS[type];
|
|
486
|
+
}
|
|
487
|
+
export function isConsumedByParent(type) {
|
|
488
|
+
return CONSUMED_BY_PARENT.has(type);
|
|
489
|
+
}
|
|
490
|
+
/** Every prefab type with a first-class mapping, for docs and tests. */
|
|
491
|
+
export function mappedTypes() {
|
|
492
|
+
return Object.keys(MAPPERS).sort();
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Last-resort mapping for a type the registry does not name.
|
|
496
|
+
*
|
|
497
|
+
* A node with children becomes a Column, a node with text becomes a Text, and
|
|
498
|
+
* anything else is dropped. This is what keeps a tree built from unmapped
|
|
499
|
+
* components emitting something coherent instead of failing outright.
|
|
500
|
+
*/
|
|
501
|
+
export function fallbackMapper(node, ctx) {
|
|
502
|
+
const family = KNOWN_UNSUPPORTED[node.type];
|
|
503
|
+
if (family != null) {
|
|
504
|
+
ctx.note('unsupported', node.type, `${family} are outside the A2UI Basic catalog`);
|
|
505
|
+
return undefined;
|
|
506
|
+
}
|
|
507
|
+
if (Array.isArray(node.children) && node.children.length > 0) {
|
|
508
|
+
const children = ctx.children(node.children);
|
|
509
|
+
if (children.length > 0) {
|
|
510
|
+
ctx.note('degraded', node.type, 'no Basic-catalog equivalent; flattened to a Column');
|
|
511
|
+
return { component: 'Column', children };
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
if (textOf(node, 'content', 'text', 'label', 'title') != null) {
|
|
515
|
+
ctx.note('degraded', node.type, 'no Basic-catalog equivalent; rendered as Text');
|
|
516
|
+
return text(node, ctx);
|
|
517
|
+
}
|
|
518
|
+
ctx.note('unsupported', node.type, 'no Basic-catalog equivalent and nothing to render');
|
|
519
|
+
return undefined;
|
|
520
|
+
}
|
|
521
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/a2ui/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AA6CrE,gFAAgF;AAEhF,sDAAsD;AACtD,SAAS,MAAM,CAAC,IAAmB,EAAE,GAAG,IAAc;IACpD,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC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AO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7D,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC5C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,oDAAoD,CAAC,CAAA;YACrF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;QAC1C,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;QAC9D,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,+CAA+C,CAAC,CAAA;QAChF,OAAO,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IACxB,CAAC;IAED,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,EAAE,mDAAmD,CAAC,CAAA;IACvF,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Control-flow mappers — `ForEach`, `Define`/`Use`/`Slot`, and the conditionals.
|
|
3
|
+
*
|
|
4
|
+
* These are the prefab components with no A2UI component of their own, and they
|
|
5
|
+
* split three ways. `ForEach` has an A2UI *mechanism* rather than a component:
|
|
6
|
+
* the child template, the same construct `./table.ts` uses for `DataTable`.
|
|
7
|
+
* `Define`/`Use`/`Slot` need no A2UI concept at all, because a definition can be
|
|
8
|
+
* expanded before the payload is sent.
|
|
9
|
+
*
|
|
10
|
+
* Conditionals are the exception, and the one genuine capability gap between the
|
|
11
|
+
* two protocols. A2UI has no declarative `if`: the renderer draws what the
|
|
12
|
+
* adjacency list says, and the agent sends a fresh `updateComponents` when the
|
|
13
|
+
* shape should change. prefab runs a reactive client that re-shapes itself
|
|
14
|
+
* without a round trip. Faking it — emitting a one-item list template as a
|
|
15
|
+
* pretend conditional — would produce a UI that is wrong in a way nothing
|
|
16
|
+
* reports, so it is diagnosed instead.
|
|
17
|
+
*/
|
|
18
|
+
import type { Mapper } from './catalog.js';
|
|
19
|
+
export declare const CONTROL_MAPPERS: Record<string, Mapper>;
|
|
20
|
+
//# sourceMappingURL=control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../src/a2ui/control.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAgB1C,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA+ElD,CAAA"}
|