@adia-ai/gen-ui 0.8.39 → 0.8.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +1 -1
- package/compose/transpiler/transpiler-maps.js +54 -4
- package/corpus/chunk-embeddings.json +1 -1
- package/corpus/chunks/_index.json +288 -6
- package/corpus/chunks/_source-hashes.json +57 -57
- package/corpus/chunks/admin-shell-rounded-borderless.json +2 -1
- package/corpus/chunks/admin-topbar-search.json +4 -4
- package/corpus/chunks/agent-activity-feed.json +5 -5
- package/corpus/chunks/agent-prompt-library-grid.json +4 -4
- package/corpus/chunks/agent-rate-limit.json +1 -1
- package/corpus/chunks/agent-reasoning-collapsed.json +7 -7
- package/corpus/chunks/auth-new-password-form.json +1 -1
- package/corpus/chunks/auth-new-password.json +1 -1
- package/corpus/chunks/billing-overview.json +14 -14
- package/corpus/chunks/billing-progress-label.json +16 -16
- package/corpus/chunks/conversion-funnel-4-step-funnel.json +11 -11
- package/corpus/chunks/conversion-funnel-6step.json +17 -17
- package/corpus/chunks/conversion-funnel-wide-summary.json +11 -11
- package/corpus/chunks/conversion-funnel-with-segment-compare.json +11 -11
- package/corpus/chunks/dashboard-admin-page.json +2 -2
- package/corpus/chunks/dashboard-conversion-panel.json +10 -10
- package/corpus/chunks/dashboard-funnel.json +11 -11
- package/corpus/chunks/dashboard-overview-panel.json +13 -13
- package/corpus/chunks/dashboard-storage-card.json +14 -14
- package/corpus/chunks/dashboard-team-actions-storage.json +13 -13
- package/corpus/chunks/date-range-picker-canonical.json +51 -0
- package/corpus/chunks/date-range-picker-comparison.json +50 -0
- package/corpus/chunks/date-time-picker-form.json +5 -6
- package/corpus/chunks/drawer-report.json +5 -6
- package/corpus/chunks/filter-bar-filter-bar-with-table.json +4 -4
- package/corpus/chunks/form-system-live-demo.json +1 -1
- package/corpus/chunks/image-thumbnail-grid.json +5 -5
- package/corpus/chunks/inline-dialog-schedule.json +4 -6
- package/corpus/chunks/list-window-chat-thread.json +76 -0
- package/corpus/chunks/list-window-loading.json +39 -0
- package/corpus/chunks/loading-skeleton-placeholder.json +11 -11
- package/corpus/chunks/map-with-location-list.json +3 -3
- package/corpus/chunks/members-active-table-search-filter.json +4 -6
- package/corpus/chunks/patient-visit-shell.json +1 -1
- package/corpus/chunks/permissions-share-people.json +4 -4
- package/corpus/chunks/playground-app-shell.json +2 -1
- package/corpus/chunks/progress-tracker-milestones.json +1 -1
- package/corpus/chunks/rating-stars-review-summary.json +1 -1
- package/corpus/chunks/real-time-metrics-dashboard.json +1 -1
- package/corpus/chunks/search-with-filters.json +4 -4
- package/corpus/chunks/spinner-button-saving.json +50 -0
- package/corpus/chunks/spinner-button-uploading.json +49 -0
- package/corpus/chunks/spinner-centered-card.json +36 -0
- package/corpus/chunks/spinner-typing-indicator.json +41 -0
- package/corpus/chunks/time-picker-appointment-form.json +126 -0
- package/corpus/chunks/time-picker-min-max.json +50 -0
- package/corpus/chunks/timeline-events.json +3 -3
- package/corpus/chunks/timezone-selector-preview.json +3 -4
- package/corpus/chunks/usage-quota-meter-card.json +1 -1
- package/corpus/chunks/user-onboarding-checklist.json +1 -1
- package/corpus/chunks/video-player-controls.json +1 -1
- package/corpus/manifest.json +4 -4
- package/package.json +1 -1
- package/retrieval/README.md +1 -1
- package/retrieval/catalog.js +67 -40
package/retrieval/catalog.js
CHANGED
|
@@ -22,22 +22,36 @@ async function loadSchemas() {
|
|
|
22
22
|
|
|
23
23
|
if (typeof process !== 'undefined' && process.versions?.node) {
|
|
24
24
|
try {
|
|
25
|
-
const { readdir, readFile
|
|
25
|
+
const { readdir, readFile } = await import(/* @vite-ignore */ 'node:fs/promises');
|
|
26
26
|
const { fileURLToPath } = await import(/* @vite-ignore */ 'node:url');
|
|
27
27
|
const { dirname, join } = await import(/* @vite-ignore */ 'node:path');
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
const engineDir = dirname(fileURLToPath(import.meta.url));
|
|
29
|
+
// gh#1380/ADR-0065: scan RECURSIVELY, not just <dir>/<dir-name>.a2ui.json —
|
|
30
|
+
// a directory holding a family (e.g. components/feed/feed-item.a2ui.json,
|
|
31
|
+
// components/tabs/tab.a2ui.json) carries sidecars whose filename doesn't
|
|
32
|
+
// match the directory's own name, and web-modules composites live in a
|
|
33
|
+
// sibling tree entirely. Missing either silently defaulted every such
|
|
34
|
+
// component's category to 'other' (exactly the bug this fix closes).
|
|
35
|
+
const roots = [
|
|
36
|
+
join(engineDir, '../../../web-components/components'),
|
|
37
|
+
join(engineDir, '../../../web-modules'),
|
|
38
|
+
];
|
|
39
|
+
for (const root of roots) {
|
|
33
40
|
try {
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
const entries = await readdir(root, { withFileTypes: true, recursive: true });
|
|
42
|
+
for (const e of entries) {
|
|
43
|
+
if (!e.isFile() || !e.name.endsWith('.a2ui.json')) continue;
|
|
44
|
+
const path = join(e.parentPath ?? e.path, e.name);
|
|
45
|
+
try {
|
|
46
|
+
const raw = await readFile(path, 'utf8');
|
|
47
|
+
const schema = JSON.parse(raw);
|
|
48
|
+
const tag = tagFromSchema(schema);
|
|
49
|
+
if (tag) schemaByTag.set(tag, schema);
|
|
50
|
+
} catch { /* skip malformed */ }
|
|
51
|
+
}
|
|
52
|
+
} catch { /* root missing */ }
|
|
39
53
|
}
|
|
40
|
-
} catch { /*
|
|
54
|
+
} catch { /* fs/path modules unavailable */ }
|
|
41
55
|
} else {
|
|
42
56
|
// Browser. Vite rewrites the glob CALL at transform time; on the static
|
|
43
57
|
// deploy that call throws (no Vite — `import.meta.glob` is a compile-time
|
|
@@ -47,7 +61,13 @@ async function loadSchemas() {
|
|
|
47
61
|
// produced loaders. See composition-library.js for the full rationale.
|
|
48
62
|
let modules = null;
|
|
49
63
|
try {
|
|
50
|
-
|
|
64
|
+
// gh#1380/ADR-0065: also glob web-modules — a composite's category
|
|
65
|
+
// (e.g. admin-sidebar-ui, chat-composer-ui) previously fell through
|
|
66
|
+
// to 'other' because only the web-components tree was globbed here.
|
|
67
|
+
modules = {
|
|
68
|
+
...import.meta.glob('../../../web-components/components/*/*.a2ui.json', { query: '?raw', import: 'default' }),
|
|
69
|
+
...import.meta.glob('../../../web-modules/**/*.a2ui.json', { query: '?raw', import: 'default' }),
|
|
70
|
+
};
|
|
51
71
|
} catch { /* no Vite transform — static deploy */ }
|
|
52
72
|
|
|
53
73
|
if (modules && Object.keys(modules).length > 0) {
|
|
@@ -94,32 +114,37 @@ export function registerSchema(tag, schema) {
|
|
|
94
114
|
}
|
|
95
115
|
|
|
96
116
|
// ── Category classification ──
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
};
|
|
117
|
+
//
|
|
118
|
+
// Ratified by ADR-0065 (docs/ops/adr/adr-0065-category-vocabulary.md): `category`
|
|
119
|
+
// is DERIVED from each component's own yaml SoT (forwarded verbatim onto its
|
|
120
|
+
// sidecar's `x-adiaui.category` by scripts/build/components.mjs), never
|
|
121
|
+
// hand-maintained here for anything that HAS a yaml SoT. The prior hand-typed
|
|
122
|
+
// `categoryMap` (~60 tags) covered under a third of the catalog and silently
|
|
123
|
+
// defaulted every unlisted tag — the whole picker family, `stepper-ui`,
|
|
124
|
+
// `list-window-ui`, every primitive shipped after the map was last touched —
|
|
125
|
+
// to `'other'`; it also disagreed with yaml where it did overlap (e.g.
|
|
126
|
+
// `tab-ui`: map said `container`, yaml says `navigation`). Reading the
|
|
127
|
+
// sidecar's own field instead means every YAML-backed component gets its
|
|
128
|
+
// yaml-ratified category, and `scripts/build/components.mjs`'s
|
|
129
|
+
// `CATEGORY_VALUES` gate (mirroring ADR-0057's `status` check) guarantees
|
|
130
|
+
// that value is always one of the twelve ratified ones before it ever
|
|
131
|
+
// reaches this file.
|
|
132
|
+
//
|
|
133
|
+
// A handful of `registry` (@adia-ai/a2ui) entries are schema-LESS v0.9
|
|
134
|
+
// composition pseudo-types with no yaml, no sidecar, and therefore nothing
|
|
135
|
+
// to derive from: `Section`/`Header`/`Footer` (registry.js tags them
|
|
136
|
+
// `section`/`header`/`footer` — no `-ui` suffix, deliberately distinct from
|
|
137
|
+
// the real `section-ui`/`header-ui`/`footer-ui` primitives, which DO have
|
|
138
|
+
// yaml and now correctly resolve via the sidecar) represent a card's
|
|
139
|
+
// structural child slots, not standalone components. This is the one place
|
|
140
|
+
// still hand-maintained, and deliberately small — everything with a yaml
|
|
141
|
+
// SoT is excluded from it by construction.
|
|
142
|
+
const PSEUDO_TYPE_CATEGORY = { section: 'card-child', header: 'card-child', footer: 'card-child' };
|
|
143
|
+
|
|
144
|
+
function categoryFor(tag, schema) {
|
|
145
|
+
if (schema?.['x-adiaui']?.category) return schema['x-adiaui'].category;
|
|
146
|
+
return PSEUDO_TYPE_CATEGORY[tag] || 'other';
|
|
147
|
+
}
|
|
123
148
|
|
|
124
149
|
// ── Trait registry ──
|
|
125
150
|
//
|
|
@@ -145,6 +170,7 @@ async function loadTraitRegistry() {
|
|
|
145
170
|
attributes: [...t.attributes],
|
|
146
171
|
events: [...t.events],
|
|
147
172
|
config: [...t.config],
|
|
173
|
+
prefixes: [...(t.prefixes || [])],
|
|
148
174
|
}));
|
|
149
175
|
} catch (err) {
|
|
150
176
|
console.warn('[a2ui-corpus] could not load trait catalog:', err.message);
|
|
@@ -167,6 +193,7 @@ async function loadTraitRegistry() {
|
|
|
167
193
|
attributes: [...t.attributes],
|
|
168
194
|
events: [...t.events],
|
|
169
195
|
config: [...t.config],
|
|
196
|
+
prefixes: [...(t.prefixes || [])],
|
|
170
197
|
}));
|
|
171
198
|
} catch { /* trait catalog not present in this build context */ }
|
|
172
199
|
}
|
|
@@ -195,7 +222,7 @@ async function buildCatalog() {
|
|
|
195
222
|
if (type.includes('-')) continue;
|
|
196
223
|
|
|
197
224
|
const schema = schemaByTag.get(tag) || null;
|
|
198
|
-
const category =
|
|
225
|
+
const category = categoryFor(tag, schema);
|
|
199
226
|
|
|
200
227
|
entries.set(type, {
|
|
201
228
|
type,
|