@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
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.datetime-input-icon,
|
|
54
|
-
.datetime-dialog-close-icon,
|
|
55
54
|
.datetime-calendar-nav-icon,
|
|
56
55
|
.datetime-time-stepper-icon {
|
|
57
56
|
font-family: var(--a2ui-icon-font-family);
|
|
@@ -79,7 +78,11 @@
|
|
|
79
78
|
justify-content: center;
|
|
80
79
|
width: 100%;
|
|
81
80
|
height: 100%;
|
|
82
|
-
padding:
|
|
81
|
+
padding: 24px;
|
|
82
|
+
top: 0;
|
|
83
|
+
right: 0;
|
|
84
|
+
bottom: 0;
|
|
85
|
+
left: 0;
|
|
83
86
|
box-sizing: border-box;
|
|
84
87
|
}
|
|
85
88
|
|
|
@@ -101,10 +104,11 @@
|
|
|
101
104
|
.datetime-dialog-content {
|
|
102
105
|
display: flex;
|
|
103
106
|
flex-direction: column;
|
|
104
|
-
gap:
|
|
107
|
+
gap: 12px;
|
|
105
108
|
width: 100%;
|
|
106
109
|
max-width: 380px;
|
|
107
|
-
|
|
110
|
+
max-height: 82%;
|
|
111
|
+
padding: 16px;
|
|
108
112
|
border-width: 1px;
|
|
109
113
|
border-style: solid;
|
|
110
114
|
border-color: var(--a2ui-color-border-strong);
|
|
@@ -112,6 +116,7 @@
|
|
|
112
116
|
background-color: var(--a2ui-color-surface-strong);
|
|
113
117
|
box-shadow: 0 16px 40px var(--a2ui-color-overlay);
|
|
114
118
|
box-sizing: border-box;
|
|
119
|
+
overflow-y: auto;
|
|
115
120
|
transition: opacity 0.18s ease, transform 0.18s ease;
|
|
116
121
|
}
|
|
117
122
|
|
|
@@ -127,7 +132,6 @@
|
|
|
127
132
|
transform: translateY(8px);
|
|
128
133
|
}
|
|
129
134
|
|
|
130
|
-
.datetime-dialog-header,
|
|
131
135
|
.datetime-calendar-header,
|
|
132
136
|
.datetime-dialog-actions {
|
|
133
137
|
display: flex;
|
|
@@ -135,21 +139,11 @@
|
|
|
135
139
|
align-items: center;
|
|
136
140
|
}
|
|
137
141
|
|
|
138
|
-
.datetime-dialog-header,
|
|
139
142
|
.datetime-calendar-header {
|
|
140
143
|
justify-content: space-between;
|
|
141
144
|
gap: 12px;
|
|
142
145
|
}
|
|
143
146
|
|
|
144
|
-
.datetime-dialog-title {
|
|
145
|
-
min-width: 0;
|
|
146
|
-
color: var(--a2ui-color-on-surface);
|
|
147
|
-
font-size: 17px;
|
|
148
|
-
font-weight: 700;
|
|
149
|
-
line-height: 1.4;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.datetime-dialog-close,
|
|
153
147
|
.datetime-calendar-nav {
|
|
154
148
|
display: flex;
|
|
155
149
|
align-items: center;
|
|
@@ -162,12 +156,10 @@
|
|
|
162
156
|
color: var(--a2ui-color-text-muted);
|
|
163
157
|
}
|
|
164
158
|
|
|
165
|
-
.datetime-dialog-close.ui-active,
|
|
166
159
|
.datetime-calendar-nav.ui-active {
|
|
167
160
|
background-color: var(--a2ui-color-secondary);
|
|
168
161
|
}
|
|
169
162
|
|
|
170
|
-
.datetime-dialog-close-icon,
|
|
171
163
|
.datetime-calendar-nav-icon {
|
|
172
164
|
color: inherit;
|
|
173
165
|
font-size: 20px;
|
|
@@ -176,7 +168,7 @@
|
|
|
176
168
|
.datetime-calendar {
|
|
177
169
|
display: flex;
|
|
178
170
|
flex-direction: column;
|
|
179
|
-
gap:
|
|
171
|
+
gap: 8px;
|
|
180
172
|
width: 100%;
|
|
181
173
|
min-width: 0;
|
|
182
174
|
}
|
|
@@ -201,7 +193,7 @@
|
|
|
201
193
|
display: flex;
|
|
202
194
|
align-items: center;
|
|
203
195
|
justify-content: center;
|
|
204
|
-
height:
|
|
196
|
+
height: 20px;
|
|
205
197
|
}
|
|
206
198
|
|
|
207
199
|
.datetime-weekday-text {
|
|
@@ -212,14 +204,14 @@
|
|
|
212
204
|
}
|
|
213
205
|
|
|
214
206
|
.datetime-month {
|
|
215
|
-
grid-template-rows:
|
|
207
|
+
grid-template-rows: 34px 34px 34px 34px 34px 34px;
|
|
216
208
|
}
|
|
217
209
|
|
|
218
210
|
.datetime-day {
|
|
219
211
|
display: flex;
|
|
220
212
|
align-items: center;
|
|
221
213
|
justify-content: center;
|
|
222
|
-
margin:
|
|
214
|
+
margin: 1px;
|
|
223
215
|
border-width: 1px;
|
|
224
216
|
border-style: solid;
|
|
225
217
|
border-color: transparent;
|
|
@@ -262,7 +254,7 @@
|
|
|
262
254
|
.datetime-time {
|
|
263
255
|
display: flex;
|
|
264
256
|
flex-direction: column;
|
|
265
|
-
gap:
|
|
257
|
+
gap: 8px;
|
|
266
258
|
width: 100%;
|
|
267
259
|
min-width: 0;
|
|
268
260
|
}
|
|
@@ -279,7 +271,7 @@
|
|
|
279
271
|
flex-direction: row;
|
|
280
272
|
align-items: center;
|
|
281
273
|
justify-content: center;
|
|
282
|
-
gap:
|
|
274
|
+
gap: 10px;
|
|
283
275
|
}
|
|
284
276
|
|
|
285
277
|
.datetime-time-field {
|
|
@@ -287,7 +279,7 @@
|
|
|
287
279
|
flex-direction: column;
|
|
288
280
|
align-items: center;
|
|
289
281
|
justify-content: center;
|
|
290
|
-
width:
|
|
282
|
+
width: 66px;
|
|
291
283
|
min-width: 0;
|
|
292
284
|
overflow: hidden;
|
|
293
285
|
border-width: 1px;
|
|
@@ -299,16 +291,16 @@
|
|
|
299
291
|
|
|
300
292
|
.datetime-time-value {
|
|
301
293
|
color: var(--a2ui-color-on-surface);
|
|
302
|
-
font-size:
|
|
294
|
+
font-size: 22px;
|
|
303
295
|
font-weight: 700;
|
|
304
|
-
line-height: 1.
|
|
296
|
+
line-height: 1.3;
|
|
305
297
|
}
|
|
306
298
|
|
|
307
299
|
.datetime-time-separator {
|
|
308
300
|
color: var(--a2ui-color-text-muted);
|
|
309
|
-
font-size:
|
|
301
|
+
font-size: 22px;
|
|
310
302
|
font-weight: 700;
|
|
311
|
-
line-height: 1.
|
|
303
|
+
line-height: 1.3;
|
|
312
304
|
}
|
|
313
305
|
|
|
314
306
|
.datetime-time-stepper {
|
|
@@ -316,7 +308,7 @@
|
|
|
316
308
|
align-items: center;
|
|
317
309
|
justify-content: center;
|
|
318
310
|
width: 100%;
|
|
319
|
-
height:
|
|
311
|
+
height: 24px;
|
|
320
312
|
color: var(--a2ui-color-text-muted);
|
|
321
313
|
}
|
|
322
314
|
|
|
@@ -326,7 +318,7 @@
|
|
|
326
318
|
|
|
327
319
|
.datetime-time-stepper-icon {
|
|
328
320
|
color: inherit;
|
|
329
|
-
font-size:
|
|
321
|
+
font-size: 20px;
|
|
330
322
|
}
|
|
331
323
|
|
|
332
324
|
.datetime-dialog-actions {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@import "../theme.css";
|
|
2
|
+
|
|
3
|
+
.loading {
|
|
4
|
+
--a2ui-loading-base: var(--a2ui-color-surface-muted);
|
|
5
|
+
--a2ui-loading-glow: rgba(255, 255, 255, 0.34);
|
|
6
|
+
--a2ui-loading-highlight: var(--a2ui-color-border-strong);
|
|
7
|
+
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
align-items: stretch;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
flex-shrink: 0;
|
|
13
|
+
gap: 10px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.loading-inline {
|
|
17
|
+
width: 100%;
|
|
18
|
+
min-height: 14px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.loading-block {
|
|
22
|
+
width: 100%;
|
|
23
|
+
min-height: 48px;
|
|
24
|
+
padding: 6px 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.loading-skeleton {
|
|
28
|
+
height: 14px;
|
|
29
|
+
border-radius: 999px;
|
|
30
|
+
background: linear-gradient(
|
|
31
|
+
90deg,
|
|
32
|
+
var(--a2ui-loading-base) 0%,
|
|
33
|
+
var(--a2ui-loading-glow) 30%,
|
|
34
|
+
var(--a2ui-loading-highlight) 50%,
|
|
35
|
+
var(--a2ui-loading-glow) 70%,
|
|
36
|
+
var(--a2ui-loading-base) 100%
|
|
37
|
+
);
|
|
38
|
+
background-size: 220% 100%;
|
|
39
|
+
animation-name: a2ui-loading-shimmer;
|
|
40
|
+
animation-duration: 1200ms;
|
|
41
|
+
animation-timing-function: ease-in-out;
|
|
42
|
+
animation-iteration-count: infinite;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.loading-skeleton-primary {
|
|
46
|
+
width: 96%;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.loading-skeleton-secondary {
|
|
50
|
+
width: 68%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@keyframes a2ui-loading-shimmer {
|
|
54
|
+
0% {
|
|
55
|
+
background-position: 120% 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
100% {
|
|
59
|
+
background-position: -120% 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -69,7 +69,7 @@ Then add a script to your package:
|
|
|
69
69
|
```json
|
|
70
70
|
{
|
|
71
71
|
"scripts": {
|
|
72
|
-
"build:catalog": "genui a2ui generate catalog --catalog-dir src/catalog --out-dir dist
|
|
72
|
+
"build:catalog": "genui a2ui generate catalog --catalog-dir src/catalog --out-dir dist"
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
```
|
|
@@ -132,13 +132,15 @@ extractor that this interface should become a catalog component named
|
|
|
132
132
|
Run:
|
|
133
133
|
|
|
134
134
|
```bash
|
|
135
|
-
genui a2ui generate catalog --catalog-dir src/catalog --out-dir dist
|
|
135
|
+
genui a2ui generate catalog --catalog-dir src/catalog --out-dir dist
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
The extractor scans the catalog directory, finds interfaces marked with
|
|
139
139
|
`@a2uiCatalog`, and writes one file per component:
|
|
140
140
|
|
|
141
141
|
```text
|
|
142
|
+
dist/
|
|
143
|
+
catalog.json
|
|
142
144
|
dist/catalog/
|
|
143
145
|
QuickStartCard/
|
|
144
146
|
catalog.json
|
|
@@ -405,13 +407,18 @@ genui a2ui generate catalog [options]
|
|
|
405
407
|
| `--catalog-dir <dir>` | Directory to scan for source files. Repeatable. | `src/catalog` |
|
|
406
408
|
| `--source <path>` | Source file or directory to scan. Repeatable. | None |
|
|
407
409
|
| `--typedoc-json <file>` | Read an existing TypeDoc JSON project instead of running TypeDoc conversion. | None |
|
|
408
|
-
| `--out-dir <dir>` |
|
|
410
|
+
| `--out-dir <dir>` | Root directory where catalog artifacts are written. | `dist` |
|
|
411
|
+
| `--catalog-id <id>` | Catalog ID written to the full catalog file. | `catalog.json` |
|
|
409
412
|
| `--version`, `-v` | Print the package version. | None |
|
|
410
413
|
| `--help`, `-h` | Print usage. | None |
|
|
411
414
|
|
|
412
415
|
`--source` and `--catalog-dir` can be used together. The extractor merges
|
|
413
416
|
all inputs, removes duplicates, sorts them, and then runs TypeDoc.
|
|
414
417
|
|
|
418
|
+
The extractor writes both per-component files such as
|
|
419
|
+
`dist/catalog/QuickStartCard/catalog.json` and a full catalog file at
|
|
420
|
+
`dist/catalog.json`.
|
|
421
|
+
|
|
415
422
|
The scanner accepts `.ts`, `.tsx`, `.js`, `.jsx`, `.mts`, and `.cts`
|
|
416
423
|
files. It ignores `.d.ts`, `node_modules`, `dist`, and `.turbo`.
|
|
417
424
|
|
|
@@ -437,7 +444,7 @@ const components = await extractCatalogComponents({
|
|
|
437
444
|
|
|
438
445
|
await writeComponentCatalogs({
|
|
439
446
|
sourceFiles: ['src/catalog/QuickStartCard.tsx'],
|
|
440
|
-
outDir: 'dist
|
|
447
|
+
outDir: 'dist',
|
|
441
448
|
});
|
|
442
449
|
```
|
|
443
450
|
|
|
@@ -448,7 +455,7 @@ directory:
|
|
|
448
455
|
await writeComponentCatalogs({
|
|
449
456
|
cwd: process.cwd(),
|
|
450
457
|
sourceFiles: ['src/catalog/QuickStartCard.tsx'],
|
|
451
|
-
outDir: 'dist
|
|
458
|
+
outDir: 'dist',
|
|
452
459
|
});
|
|
453
460
|
```
|
|
454
461
|
|
|
@@ -480,14 +487,14 @@ const projectJson = JSON.parse(
|
|
|
480
487
|
const components = extractCatalogComponentsFromTypeDocJson(projectJson);
|
|
481
488
|
|
|
482
489
|
writeCatalogComponents(components, {
|
|
483
|
-
outDir: 'dist
|
|
490
|
+
outDir: 'dist',
|
|
484
491
|
});
|
|
485
492
|
```
|
|
486
493
|
|
|
487
494
|
The equivalent CLI command is:
|
|
488
495
|
|
|
489
496
|
```bash
|
|
490
|
-
genui a2ui generate catalog --typedoc-json typedoc.json --out-dir dist
|
|
497
|
+
genui a2ui generate catalog --typedoc-json typedoc.json --out-dir dist
|
|
491
498
|
```
|
|
492
499
|
|
|
493
500
|
### Create a full A2UI catalog object
|
|
@@ -6,7 +6,7 @@ import * as fs from 'node:fs';
|
|
|
6
6
|
import { createRequire } from 'node:module';
|
|
7
7
|
import * as path from 'node:path';
|
|
8
8
|
import { pathToFileURL } from 'node:url';
|
|
9
|
-
import { extractCatalogComponentsFromTypeDocJson, extractCatalogFunctionsFromTypeDocJson, findCatalogSourceFiles, writeCatalogArtifacts, writeCatalogComponents,
|
|
9
|
+
import { createA2UICatalog, extractCatalogComponentsFromTypeDocJson, extractCatalogFunctionsFromTypeDocJson, findCatalogSourceFiles, writeA2UICatalog, writeCatalogArtifacts, writeCatalogComponents, } from './index.js';
|
|
10
10
|
const usage = `Usage: a2ui-catalog-extractor [options]
|
|
11
11
|
|
|
12
12
|
Options:
|
|
@@ -15,19 +15,20 @@ Options:
|
|
|
15
15
|
--typedoc-json <file>
|
|
16
16
|
Read an existing TypeDoc JSON project instead of
|
|
17
17
|
running TypeDoc conversion.
|
|
18
|
-
--out-dir <dir> Output directory for
|
|
18
|
+
--out-dir <dir> Output root directory for catalog artifacts.
|
|
19
|
+
--catalog-id <id> Catalog ID written to the full catalog.json file.
|
|
19
20
|
--version Print the package version.
|
|
20
21
|
--help Print this help message.
|
|
21
22
|
|
|
22
23
|
Defaults:
|
|
23
24
|
--catalog-dir src/catalog
|
|
24
|
-
--out-dir dist
|
|
25
|
+
--out-dir dist
|
|
25
26
|
`;
|
|
26
27
|
export function parseCliArgs(args) {
|
|
27
28
|
const options = {
|
|
28
29
|
catalogDirs: [],
|
|
29
30
|
help: false,
|
|
30
|
-
outDir: 'dist
|
|
31
|
+
outDir: 'dist',
|
|
31
32
|
sourceInputs: [],
|
|
32
33
|
version: false,
|
|
33
34
|
};
|
|
@@ -48,6 +49,9 @@ export function parseCliArgs(args) {
|
|
|
48
49
|
case '--out-dir':
|
|
49
50
|
options.outDir = readValue(args, ++index, arg);
|
|
50
51
|
break;
|
|
52
|
+
case '--catalog-id':
|
|
53
|
+
options.catalogId = readValue(args, ++index, arg);
|
|
54
|
+
break;
|
|
51
55
|
case '--help':
|
|
52
56
|
case '-h':
|
|
53
57
|
options.help = true;
|
|
@@ -87,7 +91,11 @@ export async function runCli(args, cwd = process.cwd()) {
|
|
|
87
91
|
cwd,
|
|
88
92
|
outDir: options.outDir,
|
|
89
93
|
});
|
|
90
|
-
|
|
94
|
+
writeA2UICatalog(createA2UICatalog({
|
|
95
|
+
catalogId: options.catalogId ?? 'catalog.json',
|
|
96
|
+
components,
|
|
97
|
+
functions,
|
|
98
|
+
}), {
|
|
91
99
|
cwd,
|
|
92
100
|
outDir: options.outDir,
|
|
93
101
|
});
|
|
@@ -111,6 +119,7 @@ export async function runCli(args, cwd = process.cwd()) {
|
|
|
111
119
|
cwd,
|
|
112
120
|
outDir: options.outDir,
|
|
113
121
|
sourceFiles: uniqueSourceFiles,
|
|
122
|
+
...(options.catalogId ? { catalogId: options.catalogId } : {}),
|
|
114
123
|
});
|
|
115
124
|
printGeneratedComponents(components);
|
|
116
125
|
printGeneratedFunctions(functions);
|
|
@@ -137,7 +146,7 @@ function printGeneratedComponents(components) {
|
|
|
137
146
|
function printGeneratedFunctions(functions) {
|
|
138
147
|
if (functions.length === 0)
|
|
139
148
|
return;
|
|
140
|
-
console.info(`Generated ${functions.length} A2UI function
|
|
149
|
+
console.info(`Generated ${functions.length} A2UI function definitions.`);
|
|
141
150
|
for (const fn of functions) {
|
|
142
151
|
console.info(`Generated function definition for ${fn.name}`);
|
|
143
152
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAA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AQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;AACH,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import type { ProjectReflection } from 'typedoc';
|
|
|
2
2
|
export interface JsonSchema {
|
|
3
3
|
$ref?: string;
|
|
4
4
|
additionalProperties?: boolean | JsonSchema;
|
|
5
|
+
const?: unknown;
|
|
5
6
|
default?: unknown;
|
|
6
7
|
deprecated?: boolean;
|
|
7
8
|
description?: string;
|
|
@@ -11,6 +12,7 @@ export interface JsonSchema {
|
|
|
11
12
|
properties?: Record<string, JsonSchema>;
|
|
12
13
|
required?: string[];
|
|
13
14
|
type?: string;
|
|
15
|
+
unevaluatedProperties?: boolean | JsonSchema;
|
|
14
16
|
}
|
|
15
17
|
export interface CatalogComponent {
|
|
16
18
|
filePath: string;
|
|
@@ -27,12 +29,13 @@ export interface ExtractCatalogFromTypeDocOptions {
|
|
|
27
29
|
cwd?: string;
|
|
28
30
|
}
|
|
29
31
|
export interface WriteComponentCatalogOptions extends ExtractCatalogOptions {
|
|
32
|
+
catalogId?: string;
|
|
30
33
|
outDir: string;
|
|
31
34
|
}
|
|
32
35
|
export interface A2UICatalog {
|
|
33
36
|
catalogId: string;
|
|
34
37
|
components?: Record<string, JsonSchema>;
|
|
35
|
-
functions?:
|
|
38
|
+
functions?: Record<string, JsonSchema>;
|
|
36
39
|
theme?: Record<string, JsonSchema>;
|
|
37
40
|
}
|
|
38
41
|
export interface FunctionDefinition {
|
|
@@ -123,7 +126,7 @@ export interface CatalogArtifacts {
|
|
|
123
126
|
functions: CatalogFunction[];
|
|
124
127
|
}
|
|
125
128
|
/**
|
|
126
|
-
* Bootstrap TypeDoc once and emit
|
|
129
|
+
* Bootstrap TypeDoc once and emit component manifests plus the full catalog.
|
|
127
130
|
* Preferred entry point for the CLI — running the conversion twice doubles
|
|
128
131
|
* cold-start latency on large catalogs.
|
|
129
132
|
*/
|
|
@@ -138,3 +141,7 @@ export declare function createA2UICatalog(options: {
|
|
|
138
141
|
functions?: FunctionDefinition[];
|
|
139
142
|
theme?: Record<string, JsonSchema>;
|
|
140
143
|
}): A2UICatalog;
|
|
144
|
+
export declare function writeA2UICatalog(catalog: A2UICatalog, options: {
|
|
145
|
+
cwd?: string;
|
|
146
|
+
outDir: string;
|
|
147
|
+
}): void;
|
|
@@ -95,9 +95,9 @@ export async function writeComponentCatalogs(options) {
|
|
|
95
95
|
}
|
|
96
96
|
export function writeCatalogComponents(components, options) {
|
|
97
97
|
const cwd = options.cwd ? path.resolve(options.cwd) : process.cwd();
|
|
98
|
-
const
|
|
98
|
+
const catalogDir = getComponentCatalogDir(path.resolve(cwd, options.outDir));
|
|
99
99
|
for (const component of components) {
|
|
100
|
-
const componentOutDir = path.join(
|
|
100
|
+
const componentOutDir = path.join(catalogDir, component.name);
|
|
101
101
|
fs.mkdirSync(componentOutDir, { recursive: true });
|
|
102
102
|
fs.writeFileSync(path.join(componentOutDir, 'catalog.json'), `${JSON.stringify({ [component.name]: component.schema }, null, 2)}\n`);
|
|
103
103
|
}
|
|
@@ -108,7 +108,7 @@ export async function writeCatalogFunctionDefinitions(options) {
|
|
|
108
108
|
return functions;
|
|
109
109
|
}
|
|
110
110
|
/**
|
|
111
|
-
* Bootstrap TypeDoc once and emit
|
|
111
|
+
* Bootstrap TypeDoc once and emit component manifests plus the full catalog.
|
|
112
112
|
* Preferred entry point for the CLI — running the conversion twice doubles
|
|
113
113
|
* cold-start latency on large catalogs.
|
|
114
114
|
*/
|
|
@@ -118,7 +118,11 @@ export async function writeCatalogArtifacts(options) {
|
|
|
118
118
|
const components = extractCatalogComponentsFromTypeDocProject(project, cwdOptions);
|
|
119
119
|
const functions = extractCatalogFunctionsFromTypeDocProject(project, cwdOptions);
|
|
120
120
|
writeCatalogComponents(components, options);
|
|
121
|
-
|
|
121
|
+
writeA2UICatalog(createA2UICatalog({
|
|
122
|
+
catalogId: options.catalogId ?? 'catalog.json',
|
|
123
|
+
components,
|
|
124
|
+
functions,
|
|
125
|
+
}), options);
|
|
122
126
|
return { components, functions };
|
|
123
127
|
}
|
|
124
128
|
// Function names must be valid JavaScript identifiers so they're safe to
|
|
@@ -129,7 +133,7 @@ export function writeCatalogFunctions(functions, options) {
|
|
|
129
133
|
if (functions.length === 0)
|
|
130
134
|
return;
|
|
131
135
|
const cwd = options.cwd ? path.resolve(options.cwd) : process.cwd();
|
|
132
|
-
const functionsDir = path.join(path.resolve(cwd, options.outDir), 'functions');
|
|
136
|
+
const functionsDir = path.join(getComponentCatalogDir(path.resolve(cwd, options.outDir)), 'functions');
|
|
133
137
|
fs.mkdirSync(functionsDir, { recursive: true });
|
|
134
138
|
for (const fn of functions) {
|
|
135
139
|
if (!FUNCTION_NAME_RE.test(fn.name)) {
|
|
@@ -148,10 +152,52 @@ export function createA2UICatalog(options) {
|
|
|
148
152
|
return {
|
|
149
153
|
catalogId: options.catalogId,
|
|
150
154
|
components: catalogComponents,
|
|
151
|
-
...(options.functions
|
|
155
|
+
...(options.functions
|
|
156
|
+
? { functions: createFunctionSchemas(options.functions) }
|
|
157
|
+
: {}),
|
|
152
158
|
...(options.theme ? { theme: options.theme } : {}),
|
|
153
159
|
};
|
|
154
160
|
}
|
|
161
|
+
function createFunctionSchemas(functions) {
|
|
162
|
+
const seenNames = new Set();
|
|
163
|
+
const duplicateNames = new Set();
|
|
164
|
+
for (const fn of functions) {
|
|
165
|
+
if (seenNames.has(fn.name)) {
|
|
166
|
+
duplicateNames.add(fn.name);
|
|
167
|
+
}
|
|
168
|
+
seenNames.add(fn.name);
|
|
169
|
+
}
|
|
170
|
+
if (duplicateNames.size > 0) {
|
|
171
|
+
throw new Error(`[a2ui-catalog-extractor] Duplicate A2UI function name(s): ${[...duplicateNames].join(', ')}. Function names must be unique in a catalog.`);
|
|
172
|
+
}
|
|
173
|
+
return Object.fromEntries(functions.map(({ description, name, parameters, returnType }) => [
|
|
174
|
+
name,
|
|
175
|
+
{
|
|
176
|
+
type: 'object',
|
|
177
|
+
...(description ? { description } : {}),
|
|
178
|
+
properties: {
|
|
179
|
+
call: { const: name },
|
|
180
|
+
args: stripSchemaDialect(parameters),
|
|
181
|
+
returnType: { const: returnType },
|
|
182
|
+
},
|
|
183
|
+
required: ['call', 'args'],
|
|
184
|
+
unevaluatedProperties: false,
|
|
185
|
+
},
|
|
186
|
+
]));
|
|
187
|
+
}
|
|
188
|
+
function stripSchemaDialect(schema) {
|
|
189
|
+
const { $schema: _schema, ...rest } = schema;
|
|
190
|
+
return rest;
|
|
191
|
+
}
|
|
192
|
+
export function writeA2UICatalog(catalog, options) {
|
|
193
|
+
const cwd = options.cwd ? path.resolve(options.cwd) : process.cwd();
|
|
194
|
+
const outDir = path.resolve(cwd, options.outDir);
|
|
195
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
196
|
+
fs.writeFileSync(path.join(outDir, 'catalog.json'), `${JSON.stringify(catalog, null, 2)}\n`);
|
|
197
|
+
}
|
|
198
|
+
function getComponentCatalogDir(outDir) {
|
|
199
|
+
return path.join(outDir, 'catalog');
|
|
200
|
+
}
|
|
155
201
|
async function createTypeDocProject(options) {
|
|
156
202
|
const cwd = options.cwd ? path.resolve(options.cwd) : process.cwd();
|
|
157
203
|
// TypeDoc treats `entryPoints` as glob patterns and rejects Windows
|