@lynx-js/genui 0.0.1 → 0.0.3
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 +5 -9
- package/a2ui/AGENTS.md +167 -0
- package/a2ui/README.md +76 -780
- package/a2ui/README_zh.md +103 -0
- package/a2ui/dist/catalog/Button/{index.js → index.jsx} +12 -8
- package/a2ui/dist/catalog/Button/index.jsx.map +1 -0
- package/a2ui/dist/catalog/Card/{index.js → index.jsx} +5 -4
- package/a2ui/dist/catalog/Card/index.jsx.map +1 -0
- package/a2ui/dist/catalog/CheckBox/{index.js → index.jsx} +11 -6
- package/a2ui/dist/catalog/CheckBox/index.jsx.map +1 -0
- package/a2ui/dist/catalog/ChoicePicker/index.jsx +98 -0
- package/a2ui/dist/catalog/ChoicePicker/index.jsx.map +1 -0
- package/a2ui/dist/catalog/Column/{index.js → index.jsx} +10 -7
- package/a2ui/dist/catalog/Column/{index.js.map → index.jsx.map} +1 -1
- package/a2ui/dist/catalog/DateTimeInput/index.jsx +249 -0
- package/a2ui/dist/catalog/DateTimeInput/index.jsx.map +1 -0
- package/a2ui/dist/catalog/DateTimeInput/utils.d.ts +0 -1
- package/a2ui/dist/catalog/DateTimeInput/utils.js +0 -3
- package/a2ui/dist/catalog/DateTimeInput/utils.js.map +1 -1
- package/a2ui/dist/catalog/Divider/index.jsx +7 -0
- package/a2ui/dist/catalog/Divider/index.jsx.map +1 -0
- package/a2ui/dist/catalog/Icon/{index.js → index.jsx} +4 -3
- package/a2ui/dist/catalog/Icon/{index.js.map → index.jsx.map} +1 -1
- package/a2ui/dist/catalog/Image/{index.js → index.jsx} +2 -3
- package/a2ui/dist/catalog/Image/{index.js.map → index.jsx.map} +1 -1
- package/a2ui/dist/catalog/LineChart/{index.js → index.jsx} +50 -13
- package/a2ui/dist/catalog/LineChart/{index.js.map → index.jsx.map} +1 -1
- package/a2ui/dist/catalog/List/{index.js → index.jsx} +9 -6
- package/a2ui/dist/catalog/List/{index.js.map → index.jsx.map} +1 -1
- package/a2ui/dist/catalog/Loading/catalog.json +15 -0
- package/a2ui/dist/catalog/Loading/index.d.ts +10 -0
- package/a2ui/dist/catalog/Loading/index.jsx +11 -0
- package/a2ui/dist/catalog/Loading/index.jsx.map +1 -0
- package/a2ui/dist/catalog/Modal/{index.js → index.jsx} +18 -9
- package/a2ui/dist/catalog/Modal/index.jsx.map +1 -0
- package/a2ui/dist/catalog/PieChart/{index.js → index.jsx} +41 -15
- package/a2ui/dist/catalog/PieChart/{index.js.map → index.jsx.map} +1 -1
- package/a2ui/dist/catalog/RadioGroup/{index.js → index.jsx} +18 -5
- package/a2ui/dist/catalog/RadioGroup/index.jsx.map +1 -0
- package/a2ui/dist/catalog/Row/{index.js → index.jsx} +10 -7
- package/a2ui/dist/catalog/Row/index.jsx.map +1 -0
- package/a2ui/dist/catalog/Slider/{index.js → index.jsx} +22 -7
- package/a2ui/dist/catalog/Slider/{index.js.map → index.jsx.map} +1 -1
- package/a2ui/dist/catalog/Tabs/index.jsx +40 -0
- package/a2ui/dist/catalog/Tabs/index.jsx.map +1 -0
- package/a2ui/dist/catalog/Text/catalog.json +6 -2
- package/a2ui/dist/catalog/Text/index.d.ts +1 -1
- package/a2ui/dist/catalog/Text/index.jsx +16 -0
- package/a2ui/dist/catalog/Text/index.jsx.map +1 -0
- package/a2ui/dist/catalog/TextField/{index.js → index.jsx} +8 -5
- package/a2ui/dist/catalog/TextField/{index.js.map → index.jsx.map} +1 -1
- package/a2ui/dist/catalog/defineCatalog.d.ts +0 -4
- package/a2ui/dist/catalog/defineCatalog.js.map +1 -1
- package/a2ui/dist/catalog/index.d.ts +20 -19
- package/a2ui/dist/catalog/index.js +41 -21
- package/a2ui/dist/catalog/index.js.map +1 -1
- package/a2ui/dist/catalog.json +2548 -0
- package/a2ui/dist/index.d.ts +1 -1
- package/a2ui/dist/index.js +2 -2
- package/a2ui/dist/index.js.map +1 -1
- package/a2ui/dist/react/A2UI.d.ts +1 -1
- package/a2ui/dist/react/{A2UI.js → A2UI.jsx} +6 -5
- package/a2ui/dist/react/{A2UI.js.map → A2UI.jsx.map} +1 -1
- package/a2ui/dist/react/{A2UIProvider.js → A2UIProvider.jsx} +2 -3
- package/a2ui/dist/react/{A2UIProvider.js.map → A2UIProvider.jsx.map} +1 -1
- package/a2ui/dist/react/{A2UIRenderer.js → A2UIRenderer.jsx} +32 -32
- package/a2ui/dist/react/A2UIRenderer.jsx.map +1 -0
- package/a2ui/dist/react/index.d.ts +3 -3
- package/a2ui/dist/react/index.js +2 -2
- package/a2ui/dist/react/index.js.map +1 -1
- package/a2ui/dist/react/useA2UIContext.d.ts +1 -1
- package/a2ui/dist/react/useA2UIContext.js +1 -1
- package/a2ui/dist/react/useA2UIContext.js.map +1 -1
- package/a2ui/dist/tsconfig.build.tsbuildinfo +1 -1
- package/a2ui/docs/catalog-guide.md +401 -0
- package/a2ui/docs/catalog-guide_zh.md +373 -0
- package/a2ui/docs/overview.md +312 -0
- package/a2ui/docs/overview_zh.md +289 -0
- package/a2ui/docs/system-prompts.md +187 -0
- package/a2ui/docs/system-prompts_zh.md +187 -0
- package/a2ui/src/catalog/README.md +12 -0
- package/a2ui/src/catalog/index.ts +51 -0
- package/a2ui/src/catalog/readme_zh.md +11 -0
- package/a2ui/src/index.ts +115 -0
- package/a2ui/styles/catalog/Button.css +5 -5
- package/a2ui/styles/catalog/DateTimeInput.css +22 -30
- package/a2ui/styles/catalog/Loading.css +61 -0
- package/a2ui/styles/catalog/Modal.css +1 -0
- package/a2ui/styles/catalog/Text.css +2 -6
- package/a2ui-catalog-extractor/README.md +14 -7
- package/a2ui-catalog-extractor/dist/cli.d.ts +1 -0
- package/a2ui-catalog-extractor/dist/cli.js +15 -6
- package/a2ui-catalog-extractor/dist/cli.js.map +1 -1
- package/a2ui-catalog-extractor/dist/index.d.ts +9 -2
- package/a2ui-catalog-extractor/dist/index.js +52 -6
- package/a2ui-catalog-extractor/dist/index.js.map +1 -1
- package/a2ui-catalog-extractor/dist/tsconfig.build.tsbuildinfo +1 -1
- package/a2ui-catalog-extractor/skills/a2ui-catalog-extractor/SKILL.md +1 -1
- package/a2ui-prompt/README.md +3 -2
- package/a2ui-prompt/dist/index.d.ts +2 -0
- package/a2ui-prompt/dist/index.js +259 -184
- package/cli/README.md +26 -0
- package/cli/bin/cli.js +7 -265
- package/cli/dist/a2ui/create.d.ts +5 -0
- package/cli/dist/a2ui/create.js +178 -0
- package/cli/dist/a2ui/create.js.map +1 -0
- package/cli/dist/a2ui/index.d.ts +5 -0
- package/cli/dist/a2ui/index.js +170 -0
- package/cli/dist/a2ui/index.js.map +1 -0
- package/cli/dist/cli.d.ts +4 -0
- package/cli/dist/cli.js +40 -0
- package/cli/dist/cli.js.map +1 -0
- package/cli/dist/openui.d.ts +1 -0
- package/cli/dist/openui.js +21 -0
- package/cli/dist/openui.js.map +1 -0
- package/cli/dist/tsconfig.build.tsbuildinfo +1 -0
- package/cli/dist/utils.d.ts +2 -0
- package/cli/dist/utils.js +17 -0
- package/cli/dist/utils.js.map +1 -0
- package/cli/templates/default/lynx.config.ts +13 -0
- package/cli/templates/default/package.json +27 -0
- package/cli/templates/default/src/App.css +88 -0
- package/cli/templates/default/src/App.tsx +100 -0
- package/cli/templates/default/src/index.tsx +10 -0
- package/cli/templates/default/src/messages.ts +158 -0
- package/cli/templates/default/src/rspeedy-env.d.ts +14 -0
- package/cli/templates/default/src/tsconfig.json +17 -0
- package/cli/templates/default/tsconfig.json +15 -0
- package/cli/templates/default/tsconfig.node.json +16 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/openui/README.md +50 -46
- package/openui/dist/catalog/Action/{index.js → index.jsx} +1 -1
- package/openui/dist/catalog/Action/index.jsx.map +1 -0
- package/openui/dist/catalog/Button/index.d.ts +8 -8
- package/openui/dist/catalog/Button/{index.js → index.jsx} +28 -14
- package/openui/dist/catalog/Button/index.jsx.map +1 -0
- package/openui/dist/catalog/Card/index.d.ts +1 -1
- package/openui/dist/catalog/Card/{index.js → index.jsx} +5 -4
- package/openui/dist/catalog/Card/{index.js.map → index.jsx.map} +1 -1
- package/openui/dist/catalog/CardHeader/index.d.ts +1 -1
- package/openui/dist/catalog/CardHeader/index.jsx +20 -0
- package/openui/dist/catalog/CardHeader/index.jsx.map +1 -0
- package/openui/dist/catalog/CheckBox/index.d.ts +16 -0
- package/openui/dist/catalog/CheckBox/index.jsx +82 -0
- package/openui/dist/catalog/CheckBox/index.jsx.map +1 -0
- package/openui/dist/catalog/Icon/index.d.ts +44 -0
- package/openui/dist/catalog/Icon/index.jsx +66 -0
- package/openui/dist/catalog/Icon/index.jsx.map +1 -0
- package/openui/dist/catalog/Image/index.d.ts +19 -0
- package/openui/dist/catalog/Image/index.jsx +40 -0
- package/openui/dist/catalog/Image/index.jsx.map +1 -0
- package/openui/dist/catalog/Loading/index.d.ts +7 -0
- package/openui/dist/catalog/Loading/index.jsx +25 -0
- package/openui/dist/catalog/Loading/index.jsx.map +1 -0
- package/openui/dist/catalog/RadioGroup/index.d.ts +21 -0
- package/openui/dist/catalog/RadioGroup/index.jsx +99 -0
- package/openui/dist/catalog/RadioGroup/index.jsx.map +1 -0
- package/openui/dist/catalog/Separator/index.d.ts +1 -1
- package/openui/dist/catalog/Separator/{index.js → index.jsx} +3 -4
- package/openui/dist/catalog/Separator/index.jsx.map +1 -0
- package/openui/dist/catalog/Slider/index.d.ts +19 -0
- package/openui/dist/catalog/Slider/index.jsx +139 -0
- package/openui/dist/catalog/Slider/index.jsx.map +1 -0
- package/openui/dist/catalog/Stack/index.d.ts +1 -1
- package/openui/dist/catalog/Stack/{index.js → index.jsx} +3 -4
- package/openui/dist/catalog/Stack/{index.js.map → index.jsx.map} +1 -1
- package/openui/dist/catalog/Tag/index.d.ts +1 -1
- package/openui/dist/catalog/Tag/{index.js → index.jsx} +5 -4
- package/openui/dist/catalog/Tag/index.jsx.map +1 -0
- package/openui/dist/catalog/TextContent/index.d.ts +1 -1
- package/openui/dist/catalog/TextContent/{index.js → index.jsx} +5 -4
- package/openui/dist/catalog/TextContent/{index.js.map → index.jsx.map} +1 -1
- package/openui/dist/catalog/TextField/index.d.ts +23 -0
- package/openui/dist/catalog/TextField/index.jsx +132 -0
- package/openui/dist/catalog/TextField/index.jsx.map +1 -0
- package/openui/dist/catalog/index.d.ts +14 -7
- package/openui/dist/catalog/index.js +14 -7
- package/openui/dist/catalog/index.js.map +1 -1
- package/openui/dist/core/context.d.ts +17 -7
- package/openui/dist/core/{context.js → context.jsx} +8 -2
- package/openui/dist/core/context.jsx.map +1 -0
- package/openui/dist/core/createLibrary.d.ts +1 -1
- package/openui/dist/core/{createLibrary.js → createLibrary.jsx} +14 -3
- package/openui/dist/core/createLibrary.jsx.map +1 -0
- package/openui/dist/core/hooks/index.d.ts +1 -0
- package/openui/dist/core/hooks/index.js +1 -0
- package/openui/dist/core/hooks/index.js.map +1 -1
- package/openui/dist/core/hooks/useOpenUIState.d.ts +2 -2
- package/openui/dist/core/hooks/useOpenUIState.js +3 -1
- package/openui/dist/core/hooks/useOpenUIState.js.map +1 -1
- package/openui/dist/core/hooks/useStateField.js +1 -1
- package/openui/dist/core/hooks/useStateField.js.map +1 -1
- package/openui/dist/core/index.d.ts +13 -7
- package/openui/dist/core/index.js +7 -4
- package/openui/dist/core/index.js.map +1 -1
- package/openui/dist/core/{library.js → library.jsx} +1 -1
- package/openui/dist/core/library.jsx.map +1 -0
- package/openui/dist/core/renderer.css +527 -0
- package/openui/dist/core/renderer.d.ts +31 -4
- package/openui/dist/core/renderer.jsx +281 -0
- package/openui/dist/core/renderer.jsx.map +1 -0
- package/openui/dist/core/runtime/index.d.ts +1 -0
- package/openui/dist/core/runtime/index.js +5 -0
- package/openui/dist/core/runtime/index.js.map +1 -0
- package/openui/dist/core/runtime/reactive.d.ts +7 -0
- package/openui/dist/core/runtime/reactive.js +10 -0
- package/openui/dist/core/runtime/reactive.js.map +1 -0
- package/package.json +18 -8
- package/a2ui/dist/catalog/Button/index.js.map +0 -1
- package/a2ui/dist/catalog/Card/index.js.map +0 -1
- package/a2ui/dist/catalog/CheckBox/index.js.map +0 -1
- package/a2ui/dist/catalog/ChoicePicker/index.js +0 -66
- package/a2ui/dist/catalog/ChoicePicker/index.js.map +0 -1
- package/a2ui/dist/catalog/DateTimeInput/index.js +0 -147
- package/a2ui/dist/catalog/DateTimeInput/index.js.map +0 -1
- package/a2ui/dist/catalog/Divider/index.js +0 -8
- package/a2ui/dist/catalog/Divider/index.js.map +0 -1
- package/a2ui/dist/catalog/Modal/index.js.map +0 -1
- package/a2ui/dist/catalog/RadioGroup/index.js.map +0 -1
- package/a2ui/dist/catalog/Row/index.js.map +0 -1
- package/a2ui/dist/catalog/Tabs/index.js +0 -32
- package/a2ui/dist/catalog/Tabs/index.js.map +0 -1
- package/a2ui/dist/catalog/Text/index.js +0 -27
- package/a2ui/dist/catalog/Text/index.js.map +0 -1
- package/a2ui/dist/react/A2UIRenderer.js.map +0 -1
- package/openui/dist/catalog/Action/index.js.map +0 -1
- package/openui/dist/catalog/Button/index.js.map +0 -1
- package/openui/dist/catalog/CardHeader/index.js +0 -18
- package/openui/dist/catalog/CardHeader/index.js.map +0 -1
- package/openui/dist/catalog/Separator/index.js.map +0 -1
- package/openui/dist/catalog/Tag/index.js.map +0 -1
- package/openui/dist/core/context.js.map +0 -1
- package/openui/dist/core/createLibrary.js.map +0 -1
- package/openui/dist/core/library.js.map +0 -1
- package/openui/dist/core/renderer.js +0 -139
- package/openui/dist/core/renderer.js.map +0 -1
|
@@ -13,6 +13,18 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
13
13
|
catalogId: BASIC_CATALOG_ID
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
version: 'v0.9',
|
|
18
|
+
updateDataModel: {
|
|
19
|
+
surfaceId: 'main',
|
|
20
|
+
value: {
|
|
21
|
+
form: {
|
|
22
|
+
email: '',
|
|
23
|
+
password: ''
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
16
28
|
{
|
|
17
29
|
version: 'v0.9',
|
|
18
30
|
updateComponents: {
|
|
@@ -82,24 +94,12 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
82
94
|
}
|
|
83
95
|
]
|
|
84
96
|
}
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
version: 'v0.9',
|
|
88
|
-
updateDataModel: {
|
|
89
|
-
surfaceId: 'main',
|
|
90
|
-
value: {
|
|
91
|
-
form: {
|
|
92
|
-
email: '',
|
|
93
|
-
password: ''
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
97
|
}
|
|
98
98
|
]
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
name: 'dynamic-list',
|
|
102
|
-
user: 'Show three trip ideas as a compact
|
|
102
|
+
user: 'Show three trip ideas as a compact vertical group.',
|
|
103
103
|
messages: [
|
|
104
104
|
{
|
|
105
105
|
version: 'v0.9',
|
|
@@ -108,6 +108,27 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
108
108
|
catalogId: BASIC_CATALOG_ID
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
|
+
{
|
|
112
|
+
version: 'v0.9',
|
|
113
|
+
updateDataModel: {
|
|
114
|
+
surfaceId: 'main',
|
|
115
|
+
path: '/items',
|
|
116
|
+
value: [
|
|
117
|
+
{
|
|
118
|
+
name: 'Canal walk',
|
|
119
|
+
detail: 'Morning coffee and quiet bridges'
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'Museum loop',
|
|
123
|
+
detail: 'Design exhibits plus lunch nearby'
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'Sunset hill',
|
|
127
|
+
detail: 'Short climb with skyline views'
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
},
|
|
111
132
|
{
|
|
112
133
|
version: 'v0.9',
|
|
113
134
|
updateComponents: {
|
|
@@ -118,7 +139,7 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
118
139
|
component: 'Column',
|
|
119
140
|
children: [
|
|
120
141
|
'title',
|
|
121
|
-
'trip-
|
|
142
|
+
'trip-items'
|
|
122
143
|
]
|
|
123
144
|
},
|
|
124
145
|
{
|
|
@@ -128,9 +149,8 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
128
149
|
variant: 'h2'
|
|
129
150
|
},
|
|
130
151
|
{
|
|
131
|
-
id: 'trip-
|
|
132
|
-
component: '
|
|
133
|
-
direction: 'vertical',
|
|
152
|
+
id: 'trip-items',
|
|
153
|
+
component: 'Column',
|
|
134
154
|
children: {
|
|
135
155
|
path: '/items',
|
|
136
156
|
componentId: 'trip-row'
|
|
@@ -162,7 +182,7 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
162
182
|
id: 'trip-name',
|
|
163
183
|
component: 'Text',
|
|
164
184
|
text: {
|
|
165
|
-
path: '
|
|
185
|
+
path: 'name'
|
|
166
186
|
},
|
|
167
187
|
variant: 'h3'
|
|
168
188
|
},
|
|
@@ -170,33 +190,12 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
170
190
|
id: 'trip-detail',
|
|
171
191
|
component: 'Text',
|
|
172
192
|
text: {
|
|
173
|
-
path: '
|
|
193
|
+
path: 'detail'
|
|
174
194
|
},
|
|
175
195
|
variant: 'body'
|
|
176
196
|
}
|
|
177
197
|
]
|
|
178
198
|
}
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
version: 'v0.9',
|
|
182
|
-
updateDataModel: {
|
|
183
|
-
surfaceId: 'main',
|
|
184
|
-
path: '/items',
|
|
185
|
-
value: [
|
|
186
|
-
{
|
|
187
|
-
name: 'Canal walk',
|
|
188
|
-
detail: 'Morning coffee and quiet bridges'
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
name: 'Museum loop',
|
|
192
|
-
detail: 'Design exhibits plus lunch nearby'
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
name: 'Sunset hill',
|
|
196
|
-
detail: 'Short climb with skyline views'
|
|
197
|
-
}
|
|
198
|
-
]
|
|
199
|
-
}
|
|
200
199
|
}
|
|
201
200
|
]
|
|
202
201
|
},
|
|
@@ -211,6 +210,35 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
211
210
|
catalogId: BASIC_CATALOG_ID
|
|
212
211
|
}
|
|
213
212
|
},
|
|
213
|
+
{
|
|
214
|
+
version: 'v0.9',
|
|
215
|
+
updateDataModel: {
|
|
216
|
+
surfaceId: 'main',
|
|
217
|
+
value: {
|
|
218
|
+
chart: {
|
|
219
|
+
labels: [
|
|
220
|
+
'Mon',
|
|
221
|
+
'Tue',
|
|
222
|
+
'Wed',
|
|
223
|
+
'Thu',
|
|
224
|
+
'Fri'
|
|
225
|
+
],
|
|
226
|
+
series: [
|
|
227
|
+
{
|
|
228
|
+
name: 'Users',
|
|
229
|
+
values: [
|
|
230
|
+
120,
|
|
231
|
+
148,
|
|
232
|
+
132,
|
|
233
|
+
171,
|
|
234
|
+
190
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
214
242
|
{
|
|
215
243
|
version: 'v0.9',
|
|
216
244
|
updateComponents: {
|
|
@@ -251,35 +279,6 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
251
279
|
}
|
|
252
280
|
]
|
|
253
281
|
}
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
version: 'v0.9',
|
|
257
|
-
updateDataModel: {
|
|
258
|
-
surfaceId: 'main',
|
|
259
|
-
value: {
|
|
260
|
-
chart: {
|
|
261
|
-
labels: [
|
|
262
|
-
'Mon',
|
|
263
|
-
'Tue',
|
|
264
|
-
'Wed',
|
|
265
|
-
'Thu',
|
|
266
|
-
'Fri'
|
|
267
|
-
],
|
|
268
|
-
series: [
|
|
269
|
-
{
|
|
270
|
-
name: 'Users',
|
|
271
|
-
values: [
|
|
272
|
-
120,
|
|
273
|
-
148,
|
|
274
|
-
132,
|
|
275
|
-
171,
|
|
276
|
-
190
|
|
277
|
-
]
|
|
278
|
-
}
|
|
279
|
-
]
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
282
|
}
|
|
284
283
|
]
|
|
285
284
|
},
|
|
@@ -335,60 +334,25 @@ const BASIC_CATALOG_EXAMPLES = [
|
|
|
335
334
|
]
|
|
336
335
|
}
|
|
337
336
|
];
|
|
338
|
-
var catalog_namespaceObject = JSON.parse('{"Button":{"properties":{"child":{"type":"string"},"variant":{"type":"string","enum":["primary","borderless"]},"isValid":{"type":"boolean"},"action":{"oneOf":[{"type":"object","properties":{"event":{"type":"object","properties":{"name":{"type":"string"},"context":{"type":"object","additionalProperties":true,"description":"Context is a JSON object map in v0.9."}},"required":["name"],"additionalProperties":false}},"required":["event"],"additionalProperties":false},{"type":"object","properties":{"functionCall":{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}},"required":["functionCall"],"additionalProperties":false}],"description":"v0.9 actions should use the `event` wrapper for server-dispatched clicks."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"message":{"type":"string"}},"required":["condition","message"],"additionalProperties":false}}},"required":["child","action"]}}');
|
|
339
|
-
var Card_catalog_namespaceObject = JSON.parse('{"Card":{"properties":{"child":{"type":"string"},"variant":{"type":"string","enum":["elevated","outlined","filled","ghost"]},"weight":{"type":"number"}},"required":["child"]}}');
|
|
340
|
-
var CheckBox_catalog_namespaceObject = JSON.parse('{"CheckBox":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"value":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"message":{"type":"string"}},"required":["condition","message"],"additionalProperties":false}}},"required":["label","value"]}}');
|
|
341
|
-
var ChoicePicker_catalog_namespaceObject = JSON.parse('{"ChoicePicker":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The label for the group of options."},"variant":{"type":"string","enum":["multipleSelection","mutuallyExclusive"],"description":"A hint for how the choice picker should be displayed and behave."},"options":{"type":"array","items":{"type":"object","properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The text to display for this option."},"value":{"type":"string","description":"The stable value associated with this option."}},"required":["label","value"],"additionalProperties":false},"description":"The list of available options to choose from."},"value":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The list of currently selected values."},"displayStyle":{"type":"string","enum":["checkbox","chips"],"description":"The display style of the component."},"filterable":{"type":"boolean","description":"If true, displays a search input to filter the options."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["options","value"]}}');
|
|
342
|
-
var Column_catalog_namespaceObject = JSON.parse('{"Column":{"properties":{"children":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"componentId":{"type":"string"},"path":{"type":"string"}},"required":["componentId","path"],"additionalProperties":false}],"description":"Static child IDs array or template object."},"align":{"type":"string","enum":["start","center","end","stretch"]},"justify":{"type":"string","enum":["start","center","end","stretch","spaceBetween","spaceAround","spaceEvenly"]}},"required":["children"]}}');
|
|
343
|
-
var DateTimeInput_catalog_namespaceObject = JSON.parse('{"DateTimeInput":{"properties":{"value":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"The current date/time value. Typically bound to a data path."},"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The text label for the input field."},"enableDate":{"type":"boolean","description":"Whether to show the date picker."},"enableTime":{"type":"boolean","description":"Whether to show the time picker."},"outputFormat":{"type":"string","description":"Format string for the output value. Supports YYYY, MM, DD, HH, and mm."},"min":{"type":"string","description":"Minimum allowed date/time value."},"max":{"type":"string","description":"Maximum allowed date/time value."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["value"]}}');
|
|
344
|
-
var Divider_catalog_namespaceObject = JSON.parse('{"Divider":{"properties":{"axis":{"type":"string","enum":["horizontal","vertical"]}},"required":[]}}');
|
|
345
|
-
var Icon_catalog_namespaceObject = JSON.parse('{"Icon":{"properties":{"name":{"oneOf":[{"type":"string","enum":["account_circle","add","arrow_back","arrow_forward","camera","check","close","delete","edit","error","favorite","help","home","info","location_on","lock","mail","menu","more_vert","pause","person","play_arrow","refresh","search","send","settings","share","star","warning"]},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"Google Material icon ligature name, e.g. \\"info\\", \\"account_circle\\", \\"arrow_back\\"."},"size":{"type":"string","enum":["sm","md","lg"]},"color":{"type":"string","enum":["primary","muted","inherit"]}},"required":["name"]}}');
|
|
346
|
-
var Image_catalog_namespaceObject = JSON.parse('{"Image":{"properties":{"url":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"Image URL or path binding."},"fit":{"type":"string","enum":["contain","cover","fill","none","scale-down"]},"mode":{"type":"string","enum":["center","scaleToFill","aspectFit","aspectFill"]},"variant":{"type":"string","enum":["icon","avatar","smallFeature","mediumFeature","largeFeature","header"]},"weight":{"type":"number"}},"required":["url"]}}');
|
|
347
|
-
var LineChart_catalog_namespaceObject = JSON.parse('{"LineChart":{"properties":{"labels":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"Category labels shown along the x axis."},"series":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"values":{"type":"array","items":{"type":"number"}},"color":{"type":"string"}},"required":["name","values"],"additionalProperties":false}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"One or more line series to render over the shared labels."},"variant":{"type":"string","enum":["linear","natural","step"]},"xLabel":{"type":"string"},"yLabel":{"type":"string"},"showGrid":{"type":"boolean"},"showLegend":{"type":"boolean"},"height":{"type":"number"}},"required":["labels","series"]}}');
|
|
348
|
-
var List_catalog_namespaceObject = JSON.parse('{"List":{"properties":{"children":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"componentId":{"type":"string"},"path":{"type":"string"}},"required":["componentId","path"],"additionalProperties":false}],"description":"Static child IDs array or template object."},"direction":{"type":"string","enum":["horizontal","vertical"]},"align":{"type":"string","enum":["start","center","end","stretch"]}},"required":["children"]}}');
|
|
349
|
-
var Modal_catalog_namespaceObject = JSON.parse('{"Modal":{"properties":{"trigger":{"type":"string","description":"The ID of the component that opens the modal when interacted with."},"content":{"type":"string","description":"The ID of the component to display inside the modal."}},"required":["trigger","content"]}}');
|
|
350
|
-
var RadioGroup_catalog_namespaceObject = JSON.parse('{"RadioGroup":{"properties":{"items":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The list of string options to display."},"value":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The currently selected value."},"usageHint":{"type":"string","enum":["default","card","row"],"description":"A hint for the visual style of the radio group."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"message":{"type":"string"}},"required":["condition","message"],"additionalProperties":false}}},"required":["items","value"]}}');
|
|
351
|
-
var Row_catalog_namespaceObject = JSON.parse('{"Row":{"properties":{"children":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"componentId":{"type":"string"},"path":{"type":"string"}},"required":["componentId","path"],"additionalProperties":false}],"description":"Static child IDs array or template object."},"justify":{"type":"string","enum":["start","center","end","stretch","spaceBetween","spaceAround","spaceEvenly"]},"align":{"type":"string","enum":["start","center","end","stretch"]}},"required":["children"]}}');
|
|
352
|
-
var Slider_catalog_namespaceObject = JSON.parse('{"Slider":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The label for the slider."},"min":{"type":"number","description":"The minimum value of the slider."},"max":{"type":"number","description":"The maximum value of the slider."},"value":{"oneOf":[{"type":"number"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The current value of the slider."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["max","value"]}}');
|
|
353
|
-
var Tabs_catalog_namespaceObject = JSON.parse('{"Tabs":{"properties":{"tabs":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"child":{"type":"string"}},"required":["title","child"],"additionalProperties":false}}},"required":["tabs"]}}');
|
|
354
|
-
var Text_catalog_namespaceObject = JSON.parse('{"Text":{"properties":{"text":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"Literal text, path binding, or function call."},"variant":{"type":"string","enum":["h1","h2","h3","h4","h5","caption","body","markdown"]},"weight":{"type":"number"}},"required":["text"]}}');
|
|
355
|
-
var TextField_catalog_namespaceObject = JSON.parse('{"TextField":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"The text label for the input field."},"value":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"The value of the text field."},"variant":{"type":"string","enum":["number","longText","shortText","obscured"],"description":"The type of input field to display."},"validationRegexp":{"type":"string","description":"A regular expression used for client-side validation of the input."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}]}},"returnType":{"type":"string","enum":["boolean"]}},"required":["call"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["label"]}}');
|
|
337
|
+
var catalog_namespaceObject = JSON.parse('{"catalogId":"https://unpkg.com/@lynx-js/genui/a2ui/dist/catalog.json","components":{"Button":{"properties":{"child":{"type":"string"},"variant":{"type":"string","enum":["primary","borderless"]},"isValid":{"type":"boolean"},"action":{"oneOf":[{"type":"object","properties":{"event":{"type":"object","properties":{"name":{"type":"string"},"context":{"type":"object","additionalProperties":true,"description":"Context is a JSON object map in v0.9."}},"required":["name"],"additionalProperties":false}},"required":["event"],"additionalProperties":false},{"type":"object","properties":{"functionCall":{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}},"required":["functionCall"],"additionalProperties":false}],"description":"v0.9 actions should use the `event` wrapper for server-dispatched clicks."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"message":{"type":"string"}},"required":["condition","message"],"additionalProperties":false}}},"required":["child","action"]},"Card":{"properties":{"child":{"type":"string"},"variant":{"type":"string","enum":["elevated","outlined","filled","ghost"]},"weight":{"type":"number"}},"required":["child"]},"CheckBox":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"value":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"message":{"type":"string"}},"required":["condition","message"],"additionalProperties":false}}},"required":["label","value"]},"ChoicePicker":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The label for the group of options."},"variant":{"type":"string","enum":["multipleSelection","mutuallyExclusive"],"description":"A hint for how the choice picker should be displayed and behave."},"options":{"type":"array","items":{"type":"object","properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The text to display for this option."},"value":{"type":"string","description":"The stable value associated with this option."}},"required":["label","value"],"additionalProperties":false},"description":"The list of available options to choose from."},"value":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The list of currently selected values."},"displayStyle":{"type":"string","enum":["checkbox","chips"],"description":"The display style of the component."},"filterable":{"type":"boolean","description":"If true, displays a search input to filter the options."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["options","value"]},"Column":{"properties":{"children":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"componentId":{"type":"string"},"path":{"type":"string"}},"required":["componentId","path"],"additionalProperties":false}],"description":"Static child IDs array or template object."},"align":{"type":"string","enum":["start","center","end","stretch"]},"justify":{"type":"string","enum":["start","center","end","stretch","spaceBetween","spaceAround","spaceEvenly"]}},"required":["children"]},"DateTimeInput":{"properties":{"value":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"The current date/time value. Typically bound to a data path."},"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The text label for the input field."},"enableDate":{"type":"boolean","description":"Whether to show the date picker."},"enableTime":{"type":"boolean","description":"Whether to show the time picker."},"outputFormat":{"type":"string","description":"Format string for the output value. Supports YYYY, MM, DD, HH, and mm."},"min":{"type":"string","description":"Minimum allowed date/time value."},"max":{"type":"string","description":"Maximum allowed date/time value."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["value"]},"Divider":{"properties":{"axis":{"type":"string","enum":["horizontal","vertical"]}},"required":[]},"Icon":{"properties":{"name":{"oneOf":[{"type":"string","enum":["account_circle"]},{"type":"string","enum":["add"]},{"type":"string","enum":["arrow_back"]},{"type":"string","enum":["arrow_forward"]},{"type":"string","enum":["camera"]},{"type":"string","enum":["check"]},{"type":"string","enum":["close"]},{"type":"string","enum":["delete"]},{"type":"string","enum":["edit"]},{"type":"string","enum":["error"]},{"type":"string","enum":["favorite"]},{"type":"string","enum":["help"]},{"type":"string","enum":["home"]},{"type":"string","enum":["info"]},{"type":"string","enum":["location_on"]},{"type":"string","enum":["lock"]},{"type":"string","enum":["mail"]},{"type":"string","enum":["menu"]},{"type":"string","enum":["more_vert"]},{"type":"string","enum":["pause"]},{"type":"string","enum":["person"]},{"type":"string","enum":["play_arrow"]},{"type":"string","enum":["refresh"]},{"type":"string","enum":["search"]},{"type":"string","enum":["send"]},{"type":"string","enum":["settings"]},{"type":"string","enum":["share"]},{"type":"string","enum":["star"]},{"type":"string","enum":["warning"]},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"Google Material icon ligature name, e.g. \\"info\\", \\"account_circle\\", \\"arrow_back\\"."},"size":{"type":"string","enum":["sm","md","lg"]},"color":{"type":"string","enum":["primary","muted","inherit"]}},"required":["name"]},"Image":{"properties":{"url":{"type":"string","description":"Image URL or path binding."},"fit":{"type":"string","enum":["contain","cover","fill","none","scale-down"]},"mode":{"type":"string","enum":["center","scaleToFill","aspectFit","aspectFill"]},"variant":{"type":"string","enum":["icon","avatar","smallFeature","mediumFeature","largeFeature","header"]},"weight":{"type":"number"}},"required":["url"]},"LineChart":{"properties":{"labels":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"Category labels shown along the x axis."},"series":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"values":{"type":"array","items":{"type":"number"}},"color":{"type":"string"}},"required":["name","values"],"additionalProperties":false}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"One or more line series to render over the shared labels."},"variant":{"type":"string","enum":["linear","natural","step"]},"xLabel":{"type":"string"},"yLabel":{"type":"string"},"showGrid":{"type":"boolean"},"showLegend":{"type":"boolean"},"height":{"type":"number"}},"required":["labels","series"]},"List":{"properties":{"children":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"componentId":{"type":"string"},"path":{"type":"string"}},"required":["componentId","path"],"additionalProperties":false}],"description":"Static child IDs array or template object."},"direction":{"type":"string","enum":["horizontal","vertical"]},"align":{"type":"string","enum":["start","center","end","stretch"]}},"required":["children"]},"Loading":{"properties":{"variant":{"type":"string","enum":["inline","block"],"description":"Visual density for the skeleton placeholder."}},"required":[]},"Modal":{"properties":{"trigger":{"type":"string","description":"The ID of the component that opens the modal when interacted with."},"content":{"type":"string","description":"The ID of the component to display inside the modal."}},"required":["trigger","content"]},"PieChart":{"properties":{"data":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"number"},"color":{"type":"string"}},"required":["name","value"],"additionalProperties":false}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"Pie slices to render."},"variant":{"type":"string","enum":["pie","donut"],"description":"Render the chart as a flat pie or a donut."},"title":{"type":"string","description":"Optional title shown above the chart."},"subtitle":{"type":"string","description":"Optional subtitle shown under the title."},"showLegend":{"type":"boolean","description":"Show the legend below the chart."},"showPercentages":{"type":"boolean","description":"Show percentage values in the legend."},"height":{"type":"number","description":"Chart height in pixels."},"paddingAngle":{"type":"number","description":"Padding angle between slices, in degrees."},"colors":{"type":"array","items":{"type":"string"},"description":"Custom color palette for the slices."}},"required":["data"]},"RadioGroup":{"properties":{"items":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The list of string options to display."},"value":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The currently selected value."},"usageHint":{"type":"string","enum":["default","card","row"],"description":"A hint for the visual style of the radio group."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}]},"message":{"type":"string"}},"required":["condition","message"],"additionalProperties":false}}},"required":["items","value"]},"Row":{"properties":{"children":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"componentId":{"type":"string"},"path":{"type":"string"}},"required":["componentId","path"],"additionalProperties":false}],"description":"Static child IDs array or template object."},"justify":{"type":"string","enum":["start","center","end","stretch","spaceBetween","spaceAround","spaceEvenly"]},"align":{"type":"string","enum":["start","center","end","stretch"]}},"required":["children"]},"Slider":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The label for the slider."},"min":{"type":"number","description":"The minimum value of the slider."},"max":{"type":"number","description":"The maximum value of the slider."},"value":{"oneOf":[{"type":"number"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The current value of the slider."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["max","value"]},"Tabs":{"properties":{"tabs":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"child":{"type":"string"}},"required":["title","child"],"additionalProperties":false}}},"required":["tabs"]},"Text":{"properties":{"text":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":true},"returnType":{"type":"string","enum":["string","number","boolean","object","array","any","void"]}},"required":["call","args"],"additionalProperties":false}],"description":"Literal text, path binding, or function call."},"variant":{"type":"string","enum":["h1","h2","h3","h4","h5","caption","body","markdown"]},"emphasis":{"type":"string","enum":["medium","strong"]}},"required":["text"]},"TextField":{"properties":{"label":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"The text label for the input field."},"value":{"oneOf":[{"type":"string"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}],"description":"The value of the text field."},"variant":{"type":"string","enum":["number","longText","shortText","obscured"],"description":"The type of input field to display."},"validationRegexp":{"type":"string","description":"A regular expression used for client-side validation of the input."},"checks":{"type":"array","items":{"type":"object","properties":{"condition":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false},{"type":"object","properties":{"call":{"type":"string"},"args":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"path":{"type":"string"}},"required":["path"],"additionalProperties":false}]}},"returnType":{"type":"string","enum":["boolean"]}},"required":["call"],"additionalProperties":false}],"description":"The condition that indicates whether the check passes."},"message":{"type":"string","description":"The error message to display if the check fails."}},"required":["condition","message"],"additionalProperties":false},"description":"A list of checks to perform."}},"required":["label"]}},"functions":{"required":{"type":"object","description":"Checks that the value is not null, undefined, or empty.","properties":{"call":{"const":"required"},"args":{"type":"object","properties":{"value":{"description":"The value to check."}},"required":["value"],"additionalProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"regex":{"type":"object","description":"Checks that the value matches a regular expression string.","properties":{"call":{"const":"regex"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicString"},"pattern":{"type":"string","description":"The regex pattern to match against."}},"required":["value","pattern"],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"length":{"type":"object","description":"Checks string length constraints.","properties":{"call":{"const":"length"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicString"},"min":{"type":"integer","minimum":0,"description":"The minimum allowed length."},"max":{"type":"integer","minimum":0,"description":"The maximum allowed length."}},"required":["value"],"anyOf":[{"required":["min"]},{"required":["max"]}],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"numeric":{"type":"object","description":"Checks numeric range constraints.","properties":{"call":{"const":"numeric"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicNumber"},"min":{"type":"number","description":"The minimum allowed value."},"max":{"type":"number","description":"The maximum allowed value."}},"required":["value"],"anyOf":[{"required":["min"]},{"required":["max"]}],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"email":{"type":"object","description":"Checks that the value is a valid email address.","properties":{"call":{"const":"email"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicString"}},"required":["value"],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"formatString":{"type":"object","description":"Performs string interpolation of data model values and other functions in the catalog functions list and returns the resulting string. The value string can contain interpolated expressions in the `${expression}` format. Supported expression types include: JSON Pointer paths to the data model (e.g., `${/absolute/path}` or `${relative/path}`), and client-side function calls (e.g., `${now()}`). Function arguments must be named (e.g., `${formatDate(value:${/currentDate}, format:\'MM-dd\')}`). To include a literal `${` sequence, escape it as `\\\\${`.","properties":{"call":{"const":"formatString"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicString"}},"required":["value"],"unevaluatedProperties":false},"returnType":{"const":"string"}},"required":["call","args"],"unevaluatedProperties":false},"formatNumber":{"type":"object","description":"Formats a number with the specified grouping and decimal precision.","properties":{"call":{"const":"formatNumber"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicNumber","description":"The number to format."},"decimals":{"$ref":"common_types.json#/$defs/DynamicNumber","description":"Optional. The number of decimal places to show. Defaults to 0 or 2 depending on locale."},"grouping":{"$ref":"common_types.json#/$defs/DynamicBoolean","description":"Optional. If true, uses locale-specific grouping separators (e.g. \'1,000\'). If false, returns raw digits (e.g. \'1000\'). Defaults to true."}},"required":["value"],"unevaluatedProperties":false},"returnType":{"const":"string"}},"required":["call","args"],"unevaluatedProperties":false},"formatCurrency":{"type":"object","description":"Formats a number as a currency string.","properties":{"call":{"const":"formatCurrency"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicNumber","description":"The monetary amount."},"currency":{"$ref":"common_types.json#/$defs/DynamicString","description":"The ISO 4217 currency code (e.g., \'USD\', \'EUR\')."},"decimals":{"$ref":"common_types.json#/$defs/DynamicNumber","description":"Optional. The number of decimal places to show. Defaults to 0 or 2 depending on locale."},"grouping":{"$ref":"common_types.json#/$defs/DynamicBoolean","description":"Optional. If true, uses locale-specific grouping separators (e.g. \'1,000\'). If false, returns raw digits (e.g. \'1000\'). Defaults to true."}},"required":["currency","value"],"unevaluatedProperties":false},"returnType":{"const":"string"}},"required":["call","args"],"unevaluatedProperties":false},"formatDate":{"type":"object","description":"Formats a timestamp into a string using a pattern.","properties":{"call":{"const":"formatDate"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicValue","description":"The date to format."},"format":{"$ref":"common_types.json#/$defs/DynamicString","description":"A Unicode TR35 date pattern string.\\n\\nToken Reference:\\n- Year: \'yy\' (26), \'yyyy\' (2026)\\n- Month: \'M\' (1), \'MM\' (01), \'MMM\' (Jan), \'MMMM\' (January)\\n- Day: \'d\' (1), \'dd\' (01), \'E\' (Tue), \'EEEE\' (Tuesday)\\n- Hour (12h): \'h\' (1-12), \'hh\' (01-12) - requires \'a\' for AM/PM\\n- Hour (24h): \'H\' (0-23), \'HH\' (00-23) - Military Time\\n- Minute: \'mm\' (00-59)\\n- Second: \'ss\' (00-59)\\n- Period: \'a\' (AM/PM)\\n\\nExamples:\\n- \'MMM dd, yyyy\' -> \'Jan 16, 2026\'\\n- \'HH:mm\' -> \'14:30\' (Military)\\n- \'h:mm a\' -> \'2:30 PM\'\\n- \'EEEE, d MMMM\' -> \'Friday, 16 January\'"}},"required":["format","value"],"unevaluatedProperties":false},"returnType":{"const":"string"}},"required":["call","args"],"unevaluatedProperties":false},"pluralize":{"type":"object","description":"Returns a localized string based on the Common Locale Data Repository (CLDR) plural category of the count (zero, one, two, few, many, other). Requires an \'other\' fallback. For English, just use \'one\' and \'other\'.","properties":{"call":{"const":"pluralize"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicNumber","description":"The numeric value used to determine the plural category."},"zero":{"$ref":"common_types.json#/$defs/DynamicString","description":"String for the \'zero\' category (e.g., 0 items)."},"one":{"$ref":"common_types.json#/$defs/DynamicString","description":"String for the \'one\' category (e.g., 1 item)."},"two":{"$ref":"common_types.json#/$defs/DynamicString","description":"String for the \'two\' category (used in Arabic, Welsh, etc.)."},"few":{"$ref":"common_types.json#/$defs/DynamicString","description":"String for the \'few\' category (e.g., small groups in Slavic languages)."},"many":{"$ref":"common_types.json#/$defs/DynamicString","description":"String for the \'many\' category (e.g., large groups in various languages)."},"other":{"$ref":"common_types.json#/$defs/DynamicString","description":"The default/fallback string (used for general plural cases)."}},"required":["value","other"],"unevaluatedProperties":false},"returnType":{"const":"string"}},"required":["call","args"],"unevaluatedProperties":false},"openUrl":{"type":"object","description":"Opens the specified URL in a browser or handler. This function has no return value.","properties":{"call":{"const":"openUrl"},"args":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL to open."}},"required":["url"],"additionalProperties":false},"returnType":{"const":"void"}},"required":["call","args"],"unevaluatedProperties":false},"and":{"type":"object","description":"Performs a logical AND operation on a list of boolean values.","properties":{"call":{"const":"and"},"args":{"type":"object","properties":{"values":{"type":"array","description":"The list of boolean values to evaluate.","items":{"$ref":"common_types.json#/$defs/DynamicBoolean"},"minItems":2}},"required":["values"],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"or":{"type":"object","description":"Performs a logical OR operation on a list of boolean values.","properties":{"call":{"const":"or"},"args":{"type":"object","properties":{"values":{"type":"array","description":"The list of boolean values to evaluate.","items":{"$ref":"common_types.json#/$defs/DynamicBoolean"},"minItems":2}},"required":["values"],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false},"not":{"type":"object","description":"Performs a logical NOT operation on a boolean value.","properties":{"call":{"const":"not"},"args":{"type":"object","properties":{"value":{"$ref":"common_types.json#/$defs/DynamicBoolean","description":"The boolean value to negate."}},"required":["value"],"unevaluatedProperties":false},"returnType":{"const":"boolean"}},"required":["call","args"],"unevaluatedProperties":false}}}');
|
|
356
338
|
const a2ui_catalog_BASIC_CATALOG_ID = 'https://a2ui.org/specification/v0_9/basic_catalog.json';
|
|
357
|
-
const CATALOG_MANIFESTS = [
|
|
358
|
-
Text_catalog_namespaceObject,
|
|
359
|
-
Image_catalog_namespaceObject,
|
|
360
|
-
Icon_catalog_namespaceObject,
|
|
361
|
-
Divider_catalog_namespaceObject,
|
|
362
|
-
LineChart_catalog_namespaceObject,
|
|
363
|
-
Row_catalog_namespaceObject,
|
|
364
|
-
Column_catalog_namespaceObject,
|
|
365
|
-
List_catalog_namespaceObject,
|
|
366
|
-
Card_catalog_namespaceObject,
|
|
367
|
-
Tabs_catalog_namespaceObject,
|
|
368
|
-
Modal_catalog_namespaceObject,
|
|
369
|
-
catalog_namespaceObject,
|
|
370
|
-
TextField_catalog_namespaceObject,
|
|
371
|
-
CheckBox_catalog_namespaceObject,
|
|
372
|
-
ChoicePicker_catalog_namespaceObject,
|
|
373
|
-
DateTimeInput_catalog_namespaceObject,
|
|
374
|
-
RadioGroup_catalog_namespaceObject,
|
|
375
|
-
Slider_catalog_namespaceObject
|
|
376
|
-
];
|
|
377
339
|
const COMPONENT_SUMMARIES = {
|
|
378
340
|
Button: 'Clickable button. MUST always include an action. Has no "label" prop; use a child Text component for the visible label.',
|
|
379
341
|
Card: 'Card container with exactly one child. Wrap multiple elements in a Column/Row/List first.',
|
|
380
342
|
CheckBox: 'Boolean checkbox with a label and optional validation checks.',
|
|
381
343
|
ChoicePicker: 'Single- or multi-select choice picker with checkbox and chip display styles.',
|
|
382
|
-
Column: 'Vertical layout container.',
|
|
344
|
+
Column: 'Vertical layout container. Preferred for ordinary non-scrollable repeated content using template children.',
|
|
383
345
|
DateTimeInput: 'Date and/or time input with a calendar panel. Without outputFormat, date-enabled inputs write YYYY-MM-DD.',
|
|
384
346
|
Divider: 'Horizontal or vertical separator line.',
|
|
385
347
|
Icon: 'Display an icon by name.',
|
|
386
348
|
Image: 'Display an image by URL.',
|
|
387
349
|
LineChart: 'Display one or more numeric line series over shared labels.',
|
|
388
|
-
List: '
|
|
350
|
+
List: 'Scrollable repeating layout container. Use when repeated content needs scrolling; otherwise prefer Column or Row template children.',
|
|
351
|
+
Loading: 'Animated progress indicator for pending content.',
|
|
389
352
|
Modal: 'Modal dialog with a trigger component and a content component. The trigger opens the modal locally when tapped.',
|
|
353
|
+
PieChart: 'Display numeric slices as a pie or donut chart.',
|
|
390
354
|
RadioGroup: 'Single-choice selector for a list of string options.',
|
|
391
|
-
Row: 'Horizontal layout container.',
|
|
355
|
+
Row: 'Horizontal layout container. Preferred for ordinary non-scrollable repeated content using template children.',
|
|
392
356
|
Slider: 'Numeric slider with an optional label and validation checks.',
|
|
393
357
|
Tabs: 'Tabbed container; each tab references a child component id.',
|
|
394
358
|
Text: 'Display styled text. Supports literal text, data bindings, and function calls.',
|
|
@@ -471,6 +435,48 @@ function componentFromManifest(manifest) {
|
|
|
471
435
|
} : {}
|
|
472
436
|
};
|
|
473
437
|
}
|
|
438
|
+
function functionsFromGeneratedCatalog(catalog) {
|
|
439
|
+
if (!isRecord(catalog)) return [];
|
|
440
|
+
const { functions } = catalog;
|
|
441
|
+
if (Array.isArray(functions)) return functions.filter((fn)=>{
|
|
442
|
+
if (!isRecord(fn)) return false;
|
|
443
|
+
const candidate = fn;
|
|
444
|
+
return 'string' == typeof candidate.name && isRecord(candidate.parameters) && isFunctionReturnType(candidate.returnType);
|
|
445
|
+
});
|
|
446
|
+
if (!isRecord(functions)) return [];
|
|
447
|
+
return Object.entries(functions).map(([name, schema])=>functionSpecFromSchema(name, schema)).filter((fn)=>null !== fn);
|
|
448
|
+
}
|
|
449
|
+
function functionSpecFromSchema(name, schema) {
|
|
450
|
+
if (!isRecord(schema)) return null;
|
|
451
|
+
const schemaRecord = schema;
|
|
452
|
+
if (!isRecord(schemaRecord.properties)) return null;
|
|
453
|
+
const properties = schemaRecord.properties;
|
|
454
|
+
const args = properties.args;
|
|
455
|
+
const returnType = properties.returnType;
|
|
456
|
+
if (!isRecord(args) || !isRecord(returnType)) return null;
|
|
457
|
+
const returnTypeValue = returnType.const;
|
|
458
|
+
if (!isFunctionReturnType(returnTypeValue)) return null;
|
|
459
|
+
const description = schemaRecord.description;
|
|
460
|
+
return {
|
|
461
|
+
name,
|
|
462
|
+
...'string' == typeof description ? {
|
|
463
|
+
description
|
|
464
|
+
} : {},
|
|
465
|
+
parameters: args,
|
|
466
|
+
returnType: returnTypeValue
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
function isFunctionReturnType(value) {
|
|
470
|
+
return 'string' === value || 'number' === value || 'boolean' === value || 'array' === value || 'object' === value || 'any' === value || 'void' === value;
|
|
471
|
+
}
|
|
472
|
+
function componentManifestsFromGeneratedCatalog(catalog) {
|
|
473
|
+
if (!isRecord(catalog)) return [];
|
|
474
|
+
const { components } = catalog;
|
|
475
|
+
if (!isRecord(components)) return [];
|
|
476
|
+
return Object.entries(components).filter((entry)=>isRecord(entry[1])).map(([name, schema])=>({
|
|
477
|
+
[name]: schema
|
|
478
|
+
}));
|
|
479
|
+
}
|
|
474
480
|
function createA2UICatalogFromManifests(options) {
|
|
475
481
|
return {
|
|
476
482
|
id: options.catalogId,
|
|
@@ -494,11 +500,12 @@ const BASIC_CATALOG = {
|
|
|
494
500
|
id: a2ui_catalog_BASIC_CATALOG_ID,
|
|
495
501
|
label: 'Lynx A2UI basic catalog (v0.9)',
|
|
496
502
|
version: 'v0.9',
|
|
497
|
-
components:
|
|
503
|
+
components: componentManifestsFromGeneratedCatalog(catalog_namespaceObject).map((manifest)=>componentFromManifest(manifest)).filter((component)=>null !== component),
|
|
498
504
|
extraRules: [
|
|
499
505
|
'Use only components listed in this catalog; unsupported examples such as Video, AudioPlayer, DatePicker, or Checkbox are not available unless they appear here.',
|
|
500
506
|
'The implemented checkbox component is named "CheckBox" with a capital B.'
|
|
501
507
|
],
|
|
508
|
+
functions: functionsFromGeneratedCatalog(catalog_namespaceObject),
|
|
502
509
|
examples: BASIC_CATALOG_EXAMPLES
|
|
503
510
|
};
|
|
504
511
|
function renderCatalogReference(catalog) {
|
|
@@ -568,21 +575,23 @@ and exactly ONE of the following keys:
|
|
|
568
575
|
|
|
569
576
|
## Required ordering for a fresh response
|
|
570
577
|
1. createSurface (with surfaceId + catalogId)
|
|
571
|
-
2.
|
|
572
|
-
|
|
573
|
-
|
|
578
|
+
2. updateDataModel for every initial value referenced by a { "path": ... }
|
|
579
|
+
binding. Send this before the first component that reads those paths.
|
|
580
|
+
3. updateComponents (the FIRST one MUST contain a component whose id is "root")
|
|
581
|
+
4. (optional) further updateDataModel / updateComponents for incremental UI.
|
|
582
|
+
For each incremental bound component, send its data model value first, then
|
|
583
|
+
send the component that binds to it.
|
|
574
584
|
|
|
575
585
|
## Envelope semantics
|
|
576
586
|
- createSurface creates a surface. Once created, its surfaceId and catalogId are
|
|
577
587
|
fixed. To change catalog/theme, delete and recreate the surface.
|
|
578
588
|
- updateComponents adds or replaces component definitions for that surface. It
|
|
579
|
-
may reference data paths
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
Its fields MUST be nested inside "updateDataModel":
|
|
589
|
+
may reference data paths, but for smooth streaming those paths SHOULD already
|
|
590
|
+
be populated by an earlier updateDataModel in the same response.
|
|
591
|
+
- updateDataModel has shape:
|
|
583
592
|
{ "version": "v0.9",
|
|
584
|
-
"updateDataModel": { "surfaceId":
|
|
585
|
-
|
|
593
|
+
"updateDataModel": { "surfaceId": string, "path"?: string, "value"?: any } }
|
|
594
|
+
"path" defaults to "/" and "value" may be any JSON value.
|
|
586
595
|
- deleteSurface removes a surface when the UI is no longer needed.
|
|
587
596
|
|
|
588
597
|
## Component model
|
|
@@ -596,16 +605,38 @@ and exactly ONE of the following keys:
|
|
|
596
605
|
}
|
|
597
606
|
- The component with id "root" is the entry point of the tree.
|
|
598
607
|
- Layout containers (Row / Column / List) take "children": ["id1", "id2", ...].
|
|
599
|
-
To repeat from the data model, use "children":
|
|
608
|
+
To repeat from the data model, any of these containers can use "children":
|
|
600
609
|
{ "path": "/items", "componentId": "itemRow" }
|
|
610
|
+
Prefer Column for ordinary vertical repeated content and Row for ordinary
|
|
611
|
+
horizontal repeated content. Use List only when the repeated content should
|
|
612
|
+
be scrollable.
|
|
601
613
|
- Card uses "child": "id". Modal uses "trigger" + "content". Tabs uses an
|
|
602
614
|
array of {title, child}.
|
|
603
615
|
|
|
604
616
|
## Data binding
|
|
605
617
|
- Static text: "text": "Hello"
|
|
606
618
|
- Bound text: "text": { "path": "/user/name" }
|
|
607
|
-
- Bound
|
|
619
|
+
- Bound repeating children:
|
|
620
|
+
"children": { "path": "/items", "componentId": "itemRow" }
|
|
621
|
+
- Inside the template component tree for a bound repeating container, bind item
|
|
622
|
+
fields with relative paths that match the object fields in each data-model
|
|
623
|
+
item. Example
|
|
624
|
+
data model:
|
|
625
|
+
{ "items": [{ "item": "Alpha" }, { "item": "Beta" }] }
|
|
626
|
+
paired with:
|
|
608
627
|
"children": { "path": "/items", "componentId": "itemRow" }
|
|
628
|
+
"text": { "path": "item" }
|
|
629
|
+
If each array item is { "name": "Alpha" }, use { "path": "name" } instead.
|
|
630
|
+
Templated children require each list item to be an object with named fields.
|
|
631
|
+
A2UI data bindings are JSON Pointer paths to named data fields, not current
|
|
632
|
+
item references. Always use this object-item shape:
|
|
633
|
+
{ "items": [{ "label": "Alpha" }, { "label": "Beta" }] }
|
|
634
|
+
"children": { "path": "/items", "componentId": "itemRow" }
|
|
635
|
+
"text": { "path": "label" }
|
|
636
|
+
If the source values are strings, numbers, booleans, or other primitive
|
|
637
|
+
values, wrap each value in an object field before using it in a template.
|
|
638
|
+
Do NOT use wildcard paths like "/items/*/item"; collection scope makes the
|
|
639
|
+
current item the base path automatically.
|
|
609
640
|
- Use updateDataModel messages to populate values at those paths.
|
|
610
641
|
- DynamicString/DynamicNumber/DynamicBoolean props accept either a literal value
|
|
611
642
|
or { "path": "/json/pointer" }. If you bind a prop to a path, create the
|
|
@@ -637,52 +668,63 @@ function buildHardRules(catalogId) {
|
|
|
637
668
|
5. For a fresh non-action response, the first message MUST be createSurface with
|
|
638
669
|
catalogId = "${catalogId}". Use surfaceId "main" unless the user specifies
|
|
639
670
|
otherwise.
|
|
640
|
-
6. For
|
|
641
|
-
updateComponents
|
|
642
|
-
|
|
643
|
-
|
|
671
|
+
6. For "{path:...}" bindings, send updateDataModel before the first
|
|
672
|
+
updateComponents message that contains components reading those paths. After
|
|
673
|
+
createSurface, either send a literal root/skeleton updateComponents first, or
|
|
674
|
+
send updateDataModel first when the first visible components use bindings.
|
|
675
|
+
In template children, use relative paths from the current item, for example
|
|
676
|
+
{ "path": "item" }, never absolute wildcard paths like "/items/*/item".
|
|
677
|
+
Never use { "path": "." }; A2UI cannot resolve "." as the current item.
|
|
678
|
+
Any data-model array used by template children MUST contain objects with
|
|
679
|
+
named fields. Never bind template children to an array of strings, numbers,
|
|
680
|
+
booleans, or other primitive values. Wrap primitive values as objects, e.g.
|
|
681
|
+
[{ "label": "Alpha" }], then bind { "path": "label" }.
|
|
682
|
+
Do not use List merely because data is repeated. Prefer Column/Row
|
|
683
|
+
template children for non-scrollable repeated content; reserve List for
|
|
684
|
+
scrollable collections.
|
|
685
|
+
7. For a fresh non-action response, the first updateComponents message MUST
|
|
686
|
+
contain exactly one component with id "root".
|
|
687
|
+
8. Use property-based component discriminators: "component": "Text", not
|
|
644
688
|
wrapper objects such as { "Text": {...} }.
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
689
|
+
9. Children are referenced by id only. NEVER inline a child component.
|
|
690
|
+
10. Container references MUST point to components present in the same response.
|
|
691
|
+
11. Card.child is exactly one id; wrap multiple elements in Row/Column/List.
|
|
692
|
+
12. Buttons MUST include a dispatchable "action": either non-empty
|
|
693
|
+
"action.event.name" or non-empty "action.functionCall.call". Button has NO
|
|
694
|
+
"label" prop – provide the label via a child Text component
|
|
695
|
+
("child": "<text-id>").
|
|
696
|
+
13. When using Modal for a confirmation flow, do NOT put the server action on
|
|
651
697
|
the Modal trigger. The trigger only opens the modal. Put a separate confirm
|
|
652
698
|
Button inside Modal.content, and attach the action to that confirm Button.
|
|
653
|
-
|
|
699
|
+
14. Render a Modal by placing the Modal component itself where the trigger
|
|
654
700
|
should appear. Do NOT also list the trigger component as a sibling in the
|
|
655
701
|
parent container, because Modal renders its trigger internally.
|
|
656
|
-
|
|
702
|
+
15. The "weight" prop is only a small Row/Column child layout ratio, not CSS
|
|
657
703
|
font-weight. Do NOT use values like 400, 500, 600, or 700 for typography.
|
|
658
|
-
Use
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
{ "version": "v0.9", "updateDataModel": { "surfaceId": "main", "path": "/", "value": {} } }
|
|
665
|
-
Wrong:
|
|
666
|
-
{ "version": "v0.9", "updateDataModel": { "surfaceId": "main", "value": {} }, "path": "/" }
|
|
667
|
-
17. Ids are kebab-case, unique per surface ("root", "title-text", "submit-btn").
|
|
668
|
-
18. Do not invent components outside the catalog.
|
|
669
|
-
19. No comments, trailing commas or unknown fields.
|
|
670
|
-
20. If the user asks for impossible, unsafe, or unsupported UI, render a concise
|
|
704
|
+
Use Text.variant for base typography and Text.emphasis ("medium" or
|
|
705
|
+
"strong") for extra text emphasis.
|
|
706
|
+
16. Ids are kebab-case, unique per surface ("root", "title-text", "submit-btn").
|
|
707
|
+
17. Do not invent components outside the catalog.
|
|
708
|
+
18. No comments, trailing commas or unknown fields.
|
|
709
|
+
19. If the user asks for impossible, unsafe, or unsupported UI, render a concise
|
|
671
710
|
explanatory A2UI surface using supported components rather than prose.
|
|
672
|
-
|
|
711
|
+
20. If the latest user message starts with "A2UI_USER_ACTION:", this is an
|
|
673
712
|
action response for an existing surface. Return a non-empty JSON array with
|
|
674
713
|
updateDataModel and/or updateComponents for that same surfaceId. Do NOT
|
|
675
714
|
return [] and do NOT create a new surface unless the action explicitly asks
|
|
676
715
|
to replace the whole UI.
|
|
677
|
-
|
|
716
|
+
21. For action responses, prefer the smallest valid patch: one updateDataModel
|
|
678
717
|
for changed data, plus one updateComponents only if the visible structure
|
|
679
718
|
needs to change.
|
|
680
|
-
|
|
719
|
+
22. For UI that should change after a button tap, keep the initial response in
|
|
681
720
|
the pre-action state. Put confirmation, success, or result details in the
|
|
682
721
|
action response instead of showing them before the action happens.
|
|
683
|
-
|
|
722
|
+
23. For Image.url, provide a short English image search query such as
|
|
684
723
|
"fresh pasta on a table" or "city skyline at night". Do NOT invent photo
|
|
685
724
|
CDN URLs. The server resolves Image.url values through its image provider.
|
|
725
|
+
24. Function calls are allowed only when the "call" name exactly matches a
|
|
726
|
+
function listed under "Available functions" in the active catalog. Do NOT
|
|
727
|
+
invent function names.
|
|
686
728
|
`;
|
|
687
729
|
}
|
|
688
730
|
function renderCatalogExamples(catalog) {
|
|
@@ -724,19 +766,35 @@ function readA2UICatalogFromDirectory(options) {
|
|
|
724
766
|
const catalogDir = __rspack_external_node_path_c5b9b54f.resolve(cwd, options.catalogDir);
|
|
725
767
|
if (!__rspack_external_node_fs_5ea92f0c.existsSync(catalogDir)) throw new Error(`[a2ui-prompt] Catalog directory does not exist: ${options.catalogDir}`);
|
|
726
768
|
if (!__rspack_external_node_fs_5ea92f0c.statSync(catalogDir).isDirectory()) throw new Error(`[a2ui-prompt] Catalog path is not a directory: ${options.catalogDir}`);
|
|
769
|
+
const fullCatalog = readFullCatalog(catalogDir);
|
|
770
|
+
if (fullCatalog) {
|
|
771
|
+
const componentManifests = componentManifestsFromFullCatalog(fullCatalog);
|
|
772
|
+
if (0 === componentManifests.length) throw new Error(`[a2ui-prompt] Full catalog for ${options.catalogId} did not contain any valid component schemas.`);
|
|
773
|
+
return createA2UICatalogFromManifests({
|
|
774
|
+
catalogId: options.catalogId,
|
|
775
|
+
componentManifests,
|
|
776
|
+
functions: functionDefinitionsFromFullCatalog(fullCatalog),
|
|
777
|
+
...options.label ? {
|
|
778
|
+
label: options.label
|
|
779
|
+
} : {},
|
|
780
|
+
...options.version ? {
|
|
781
|
+
version: options.version
|
|
782
|
+
} : {}
|
|
783
|
+
});
|
|
784
|
+
}
|
|
727
785
|
const componentManifests = [];
|
|
728
|
-
|
|
786
|
+
const componentCatalogDir = resolveComponentCatalogDir(catalogDir);
|
|
787
|
+
for (const entry of __rspack_external_node_fs_5ea92f0c.readdirSync(componentCatalogDir, {
|
|
729
788
|
withFileTypes: true
|
|
730
789
|
})){
|
|
731
790
|
if (!entry.isDirectory() || 'functions' === entry.name) continue;
|
|
732
|
-
const catalogJsonPath = __rspack_external_node_path_c5b9b54f.join(
|
|
791
|
+
const catalogJsonPath = __rspack_external_node_path_c5b9b54f.join(componentCatalogDir, entry.name, 'catalog.json');
|
|
733
792
|
if (__rspack_external_node_fs_5ea92f0c.existsSync(catalogJsonPath)) componentManifests.push(readCatalogManifest(catalogJsonPath));
|
|
734
793
|
}
|
|
735
|
-
if (0 === componentManifests.length) throw new Error(`[a2ui-prompt] No component catalog files found in ${options.catalogDir}. Expected files like
|
|
794
|
+
if (0 === componentManifests.length) throw new Error(`[a2ui-prompt] No component catalog files found in ${options.catalogDir}. Expected a full catalog.json or files like catalog/<Component>/catalog.json. Run "genui a2ui generate catalog" first or pass --catalog-dir to the generated catalog directory.`);
|
|
736
795
|
return createA2UICatalogFromManifests({
|
|
737
796
|
catalogId: options.catalogId,
|
|
738
797
|
componentManifests,
|
|
739
|
-
functions: readFunctionDefinitions(catalogDir),
|
|
740
798
|
...options.label ? {
|
|
741
799
|
label: options.label
|
|
742
800
|
} : {},
|
|
@@ -745,36 +803,53 @@ function readA2UICatalogFromDirectory(options) {
|
|
|
745
803
|
} : {}
|
|
746
804
|
});
|
|
747
805
|
}
|
|
748
|
-
function
|
|
749
|
-
const
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
for (const
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
if (
|
|
757
|
-
const functionRecord = readJsonObject(__rspack_external_node_path_c5b9b54f.join(functionsDir, entry.name));
|
|
758
|
-
for (const [name, value] of Object.entries(functionRecord)){
|
|
759
|
-
if (!src_isRecord(value)) continue;
|
|
760
|
-
const description = value["description"];
|
|
761
|
-
const parameters = value['parameters'];
|
|
762
|
-
const returnType = value['returnType'];
|
|
763
|
-
functions.push({
|
|
764
|
-
name,
|
|
765
|
-
...'string' == typeof description ? {
|
|
766
|
-
description
|
|
767
|
-
} : {},
|
|
768
|
-
parameters: src_isRecord(parameters) ? parameters : {
|
|
769
|
-
type: 'object',
|
|
770
|
-
properties: {},
|
|
771
|
-
additionalProperties: false
|
|
772
|
-
},
|
|
773
|
-
returnType: isReturnType(returnType) ? returnType : 'any'
|
|
774
|
-
});
|
|
775
|
-
}
|
|
806
|
+
function readFullCatalog(catalogDir) {
|
|
807
|
+
const candidates = [
|
|
808
|
+
__rspack_external_node_path_c5b9b54f.join(catalogDir, 'catalog.json'),
|
|
809
|
+
__rspack_external_node_path_c5b9b54f.join(__rspack_external_node_path_c5b9b54f.dirname(catalogDir), 'catalog.json')
|
|
810
|
+
];
|
|
811
|
+
for (const candidate of candidates){
|
|
812
|
+
if (!__rspack_external_node_fs_5ea92f0c.existsSync(candidate)) continue;
|
|
813
|
+
const catalog = readJsonObject(candidate);
|
|
814
|
+
if (src_isRecord(catalog['components'])) return catalog;
|
|
776
815
|
}
|
|
777
|
-
return
|
|
816
|
+
return null;
|
|
817
|
+
}
|
|
818
|
+
function resolveComponentCatalogDir(catalogDir) {
|
|
819
|
+
const nestedCatalogDir = __rspack_external_node_path_c5b9b54f.join(catalogDir, 'catalog');
|
|
820
|
+
if (__rspack_external_node_fs_5ea92f0c.existsSync(nestedCatalogDir) && __rspack_external_node_fs_5ea92f0c.statSync(nestedCatalogDir).isDirectory()) return nestedCatalogDir;
|
|
821
|
+
return catalogDir;
|
|
822
|
+
}
|
|
823
|
+
function componentManifestsFromFullCatalog(catalog) {
|
|
824
|
+
const components = catalog['components'];
|
|
825
|
+
if (!src_isRecord(components)) return [];
|
|
826
|
+
return Object.entries(components).filter((entry)=>src_isRecord(entry[1])).map(([name, schema])=>({
|
|
827
|
+
[name]: schema
|
|
828
|
+
}));
|
|
829
|
+
}
|
|
830
|
+
function functionDefinitionsFromFullCatalog(catalog) {
|
|
831
|
+
const functions = catalog['functions'];
|
|
832
|
+
if (src_isRecord(functions)) return Object.entries(functions).map(([name, schema])=>src_functionSpecFromSchema(name, schema)).filter((fn)=>null !== fn).sort((left, right)=>left.name.localeCompare(right.name));
|
|
833
|
+
if (!Array.isArray(functions)) return [];
|
|
834
|
+
return functions.filter((fn)=>src_isRecord(fn) && 'string' == typeof fn['name'] && src_isRecord(fn['parameters']) && isReturnType(fn['returnType'])).sort((left, right)=>left.name.localeCompare(right.name));
|
|
835
|
+
}
|
|
836
|
+
function src_functionSpecFromSchema(name, schema) {
|
|
837
|
+
if (!src_isRecord(schema) || !src_isRecord(schema['properties'])) return null;
|
|
838
|
+
const properties = schema['properties'];
|
|
839
|
+
const args = properties['args'];
|
|
840
|
+
const returnType = properties['returnType'];
|
|
841
|
+
if (!src_isRecord(args) || !src_isRecord(returnType)) return null;
|
|
842
|
+
const returnTypeValue = returnType['const'];
|
|
843
|
+
if (!isReturnType(returnTypeValue)) return null;
|
|
844
|
+
const description = schema["description"];
|
|
845
|
+
return {
|
|
846
|
+
name,
|
|
847
|
+
...'string' == typeof description ? {
|
|
848
|
+
description
|
|
849
|
+
} : {},
|
|
850
|
+
parameters: args,
|
|
851
|
+
returnType: returnTypeValue
|
|
852
|
+
};
|
|
778
853
|
}
|
|
779
854
|
function readJsonObject(filePath) {
|
|
780
855
|
const value = JSON.parse(__rspack_external_node_fs_5ea92f0c.readFileSync(filePath, 'utf8'));
|