@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.
Files changed (61) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +1 -1
  3. package/compose/transpiler/transpiler-maps.js +54 -4
  4. package/corpus/chunk-embeddings.json +1 -1
  5. package/corpus/chunks/_index.json +288 -6
  6. package/corpus/chunks/_source-hashes.json +57 -57
  7. package/corpus/chunks/admin-shell-rounded-borderless.json +2 -1
  8. package/corpus/chunks/admin-topbar-search.json +4 -4
  9. package/corpus/chunks/agent-activity-feed.json +5 -5
  10. package/corpus/chunks/agent-prompt-library-grid.json +4 -4
  11. package/corpus/chunks/agent-rate-limit.json +1 -1
  12. package/corpus/chunks/agent-reasoning-collapsed.json +7 -7
  13. package/corpus/chunks/auth-new-password-form.json +1 -1
  14. package/corpus/chunks/auth-new-password.json +1 -1
  15. package/corpus/chunks/billing-overview.json +14 -14
  16. package/corpus/chunks/billing-progress-label.json +16 -16
  17. package/corpus/chunks/conversion-funnel-4-step-funnel.json +11 -11
  18. package/corpus/chunks/conversion-funnel-6step.json +17 -17
  19. package/corpus/chunks/conversion-funnel-wide-summary.json +11 -11
  20. package/corpus/chunks/conversion-funnel-with-segment-compare.json +11 -11
  21. package/corpus/chunks/dashboard-admin-page.json +2 -2
  22. package/corpus/chunks/dashboard-conversion-panel.json +10 -10
  23. package/corpus/chunks/dashboard-funnel.json +11 -11
  24. package/corpus/chunks/dashboard-overview-panel.json +13 -13
  25. package/corpus/chunks/dashboard-storage-card.json +14 -14
  26. package/corpus/chunks/dashboard-team-actions-storage.json +13 -13
  27. package/corpus/chunks/date-range-picker-canonical.json +51 -0
  28. package/corpus/chunks/date-range-picker-comparison.json +50 -0
  29. package/corpus/chunks/date-time-picker-form.json +5 -6
  30. package/corpus/chunks/drawer-report.json +5 -6
  31. package/corpus/chunks/filter-bar-filter-bar-with-table.json +4 -4
  32. package/corpus/chunks/form-system-live-demo.json +1 -1
  33. package/corpus/chunks/image-thumbnail-grid.json +5 -5
  34. package/corpus/chunks/inline-dialog-schedule.json +4 -6
  35. package/corpus/chunks/list-window-chat-thread.json +76 -0
  36. package/corpus/chunks/list-window-loading.json +39 -0
  37. package/corpus/chunks/loading-skeleton-placeholder.json +11 -11
  38. package/corpus/chunks/map-with-location-list.json +3 -3
  39. package/corpus/chunks/members-active-table-search-filter.json +4 -6
  40. package/corpus/chunks/patient-visit-shell.json +1 -1
  41. package/corpus/chunks/permissions-share-people.json +4 -4
  42. package/corpus/chunks/playground-app-shell.json +2 -1
  43. package/corpus/chunks/progress-tracker-milestones.json +1 -1
  44. package/corpus/chunks/rating-stars-review-summary.json +1 -1
  45. package/corpus/chunks/real-time-metrics-dashboard.json +1 -1
  46. package/corpus/chunks/search-with-filters.json +4 -4
  47. package/corpus/chunks/spinner-button-saving.json +50 -0
  48. package/corpus/chunks/spinner-button-uploading.json +49 -0
  49. package/corpus/chunks/spinner-centered-card.json +36 -0
  50. package/corpus/chunks/spinner-typing-indicator.json +41 -0
  51. package/corpus/chunks/time-picker-appointment-form.json +126 -0
  52. package/corpus/chunks/time-picker-min-max.json +50 -0
  53. package/corpus/chunks/timeline-events.json +3 -3
  54. package/corpus/chunks/timezone-selector-preview.json +3 -4
  55. package/corpus/chunks/usage-quota-meter-card.json +1 -1
  56. package/corpus/chunks/user-onboarding-checklist.json +1 -1
  57. package/corpus/chunks/video-player-controls.json +1 -1
  58. package/corpus/manifest.json +4 -4
  59. package/package.json +1 -1
  60. package/retrieval/README.md +1 -1
  61. package/retrieval/catalog.js +67 -40
@@ -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, stat } = await import(/* @vite-ignore */ 'node:fs/promises');
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 compsDir = join(dirname(fileURLToPath(import.meta.url)), '../../../web-components/components');
29
- const entries = await readdir(compsDir, { withFileTypes: true });
30
- for (const e of entries) {
31
- if (!e.isDirectory()) continue;
32
- const path = join(compsDir, e.name, `${e.name}.a2ui.json`);
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 raw = await readFile(path, 'utf8');
35
- const schema = JSON.parse(raw);
36
- const tag = tagFromSchema(schema);
37
- if (tag) schemaByTag.set(tag, schema);
38
- } catch { /* skip missing / malformed */ }
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 { /* components dir missing */ }
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
- modules = import.meta.glob('../../../web-components/components/*/*.a2ui.json', { query: '?raw', import: 'default' });
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
- const categoryMap = {
98
- 'row-ui': 'layout', 'col-ui': 'layout', 'list-ui': 'layout', 'grid-ui': 'layout',
99
- 'stack-ui': 'layout', 'block-ui': 'layout', 'toolbar-ui': 'layout',
100
- 'text-ui': 'display', 'image-ui': 'display', 'icon-ui': 'display',
101
- 'divider-ui': 'display', 'badge-ui': 'display', 'avatar-ui': 'display',
102
- 'avatar-group-ui': 'display', 'progress-ui': 'display', 'skeleton-ui': 'display',
103
- 'code-ui': 'display', 'kbd-ui': 'display', 'tag-ui': 'display',
104
- 'stat-ui': 'display', 'empty-state-ui': 'display',
105
- 'input-ui': 'input', 'check-ui': 'input', 'switch-ui': 'input',
106
- 'slider-ui': 'input', 'select-ui': 'input', 'search-ui': 'input',
107
- 'upload-ui': 'input', 'textarea-ui': 'input', 'radio-ui': 'input',
108
- 'otp-input-ui': 'input', 'calendar-picker-ui': 'input', 'color-picker-ui': 'input',
109
- 'range-ui': 'input',
110
- 'button-ui': 'action',
111
- 'card-ui': 'container', 'tabs-ui': 'container', 'tab-ui': 'container',
112
- 'pane-ui': 'container', 'modal-ui': 'container', 'drawer-ui': 'container',
113
- 'toast-ui': 'container', 'popover-ui': 'container', 'accordion-ui': 'container',
114
- 'alert-ui': 'container', 'tooltip-ui': 'container', 'menu-ui': 'container',
115
- 'command-ui': 'container',
116
- 'section': 'card-child', 'header': 'card-child', 'footer': 'card-child',
117
- 'stream-ui': 'agent', 'table-ui': 'agent', 'chart-ui': 'agent',
118
- 'embed-ui': 'agent', 'noodles-ui': 'agent',
119
- 'breadcrumb-ui': 'navigation', 'nav-ui': 'navigation', 'pagination-ui': 'navigation',
120
- 'segmented-ui': 'navigation', 'segment-ui': 'navigation', 'router-ui': 'navigation',
121
- 'toggle-group-ui': 'navigation', 'toggle-option-ui': 'navigation',
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 = categoryMap[tag] || 'other';
225
+ const category = categoryFor(tag, schema);
199
226
 
200
227
  entries.set(type, {
201
228
  type,