@aceshooting/lyra-ui 30.2.0 → 30.4.0

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 (93) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/dist/ai/adapters/a2ui.d.ts +10 -4
  3. package/dist/ai/adapters/a2ui.js +1 -1
  4. package/dist/ai/adapters/ag-ui.d.ts +17 -4
  5. package/dist/ai/adapters/ag-ui.js +1 -1
  6. package/dist/ai/adapters/ai-sdk.js +1 -1
  7. package/dist/ai/runtime.js +1 -1
  8. package/dist/components/agent-tools/mcp-app/mcp-app-protocol.d.ts +15 -0
  9. package/dist/components/agent-tools/mcp-app/mcp-app-protocol.js +36 -0
  10. package/dist/components/agent-tools/mcp-app/mcp-app.class.d.ts +31 -4
  11. package/dist/components/agent-tools/mcp-app/mcp-app.class.js +4 -4
  12. package/dist/components/conversation/chat-viewport/chat-viewport.class.d.ts +2 -2
  13. package/dist/components/conversation/chat-viewport/chat-viewport.class.js +1 -1
  14. package/dist/components/conversation/message-actions/message-actions.class.d.ts +3 -3
  15. package/dist/components/conversation/message-parts/message-parts.class.d.ts +13 -4
  16. package/dist/components/conversation/message-parts/message-parts.class.js +12 -10
  17. package/dist/components/conversation/message-parts/message-parts.d.ts +1 -1
  18. package/dist/components/conversation/message-parts/message-parts.js +1 -1
  19. package/dist/components/conversation/voice-picker/voice-picker.class.d.ts +1 -1
  20. package/dist/components/data/flow-minimap/flow-minimap.class.d.ts +1 -1
  21. package/dist/components/forms/select/select.class.js +1 -1
  22. package/dist/components/layout/app-rail/app-rail.class.d.ts +1 -1
  23. package/dist/components/layout/app-rail/app-rail.class.js +1 -1
  24. package/dist/components/layout/multi-split/multi-split.class.d.ts +4 -1
  25. package/dist/components/layout/multi-split/multi-split.class.js +6 -3
  26. package/dist/components/layout/multi-split/multi-split.styles.js +1 -1
  27. package/dist/components/layout/navigation-menu/navigation-menu.class.js +1 -1
  28. package/dist/components/layout/page/page.class.d.ts +3 -1
  29. package/dist/components/layout/page/page.class.js +1 -1
  30. package/dist/components/layout/responsive-panel/responsive-panel.class.d.ts +6 -4
  31. package/dist/components/layout/responsive-panel/responsive-panel.class.js +1 -1
  32. package/dist/components/layout/scroller/scroller.class.d.ts +1 -1
  33. package/dist/components/layout/scroller/scroller.class.js +1 -1
  34. package/dist/components/layout/split-panel/split-panel.class.d.ts +1 -1
  35. package/dist/components/layout/split-panel/split-panel.class.js +1 -1
  36. package/dist/components/layout/stepper/stepper.class.d.ts +1 -1
  37. package/dist/components/layout/stepper/stepper.class.js +1 -1
  38. package/dist/components/layout/widget/widget.class.d.ts +1 -1
  39. package/dist/components/layout/widget/widget.class.js +1 -1
  40. package/dist/components/media/file-input/file-input.styles.js +1 -1
  41. package/dist/components/media/map/map-control-chrome.js +1 -0
  42. package/dist/components/media/map/map-control-options.d.ts +6 -2
  43. package/dist/components/media/map/map-control-options.js +1 -1
  44. package/dist/components/media/map/map-controls-lifecycle.js +1 -1
  45. package/dist/components/media/map/map-controls-readiness.js +1 -0
  46. package/dist/components/media/map/map.class.d.ts +39 -2
  47. package/dist/components/media/map/map.class.js +13 -7
  48. package/dist/components/media/map/map.styles.js +1 -1
  49. package/dist/components/overlays/dialog/dialog.class.d.ts +2 -2
  50. package/dist/components/overlays/dialog/dialog.class.js +1 -1
  51. package/dist/components/utility/copy-button/copy-button.class.d.ts +13 -15
  52. package/dist/components/utility/copy-button/copy-button.class.js +3 -3
  53. package/dist/components/utility/copy-button/copy-button.styles.js +1 -1
  54. package/dist/components/utility/tour/tour.class.d.ts +2 -2
  55. package/dist/components/utility/tour/tour.class.js +1 -1
  56. package/dist/events.d.ts +10 -1
  57. package/dist/framework-types.d.ts +1 -1
  58. package/dist/internal/localization-types.d.ts +1 -1
  59. package/dist/internal/localization.js +1 -1
  60. package/dist/internal/modal-host.styles.js +1 -0
  61. package/dist/internal/modal-surface-controller.js +1 -1
  62. package/dist/internal/overlay-stack.d.ts +1 -1
  63. package/dist/internal/overlay-stack.js +1 -1
  64. package/dist/internal/package-metadata.js +1 -1
  65. package/dist/internal/scoped-definitions.generated.js +1 -1
  66. package/dist/internal/style-property-lease.js +1 -1
  67. package/dist/lyra.d.ts +1 -1
  68. package/llms/components/lr-app-rail.md +4 -0
  69. package/llms/components/lr-badge.md +3 -0
  70. package/llms/components/lr-copy-button.md +15 -7
  71. package/llms/components/lr-file-input.md +5 -0
  72. package/llms/components/lr-map.md +80 -8
  73. package/llms/components/lr-mcp-app.md +94 -4
  74. package/llms/components/lr-message-parts.md +18 -0
  75. package/llms/components/lr-multi-split.md +4 -0
  76. package/llms/components/lr-page.md +5 -1
  77. package/llms/components/lr-responsive-panel.md +5 -1
  78. package/llms/components/lr-select.md +3 -2
  79. package/llms/components/lr-token-input.md +4 -3
  80. package/llms/components/lr-tooltip.md +4 -4
  81. package/llms/peers.md +1 -1
  82. package/llms/shared/ai-and-peers.md +88 -3
  83. package/llms/shared/events-and-types.md +25 -1
  84. package/llms/shared/localization-and-rtl.md +29 -0
  85. package/llms/shared/styles-and-tokens.md +75 -14
  86. package/llms/shared.md +217 -18
  87. package/locales.json +1 -1
  88. package/package.json +8 -4
  89. package/registrations.json +1 -1
  90. package/skills/compose-lyra-interfaces/SKILL.md +5 -3
  91. package/skills/compose-lyra-interfaces/references/composition-patterns.md +8 -1
  92. package/skills/lyra-ui/SKILL.md +17 -8
  93. package/skills/lyra-ui/lyra-gen.md +95 -0
@@ -8,7 +8,7 @@ description: Design and implement coherent interfaces with @aceshooting/lyra-ui,
8
8
  Turn product intent into a small, coherent Lyra component hierarchy, then implement and verify it.
9
9
  Use the sibling `lyra-ui` skill (or the installed package's `llms.txt`) for exact properties, events,
10
10
  slots, parts, custom properties, peers and import paths before writing code; its companion-package
11
- routes cover the experimental DOCX editor, flag assets, locale catalogs and editor data.
11
+ routes cover the experimental DOCX editor, generated views, flag assets, locale catalogs and editor data.
12
12
 
13
13
  Appearance defaults and the optional spotlights, gemstone selector, 44px mode/design/flag-language
14
14
  controls and persistence recipe are owned by the sibling `lyra-ui` skill ("Appearance defaults") and the
@@ -22,7 +22,8 @@ retheme an existing app only within an authorized migration or redesign.
22
22
  1. **Frame the experience.** Identify the primary user outcome, critical actions, data ownership,
23
23
  navigation boundary, and failure modes. Ask only for choices that materially change the result.
24
24
  2. **Inventory exact contracts.** Look up every candidate tag. Prefer an existing Lyra or native
25
- primitive over inventing a wrapper. Record optional peers and stable/experimental status.
25
+ primitive over inventing a wrapper. Record optional peers and stable/experimental status. For
26
+ generated content, follow the sibling skill's `lyra-gen.md` before choosing a catalog or renderer.
26
27
  3. **Sketch structure before chrome.** Start with semantic page regions and native headings/forms.
27
28
  Add Lyra layout, control, data, feedback, and overlay primitives only where they provide a real
28
29
  contract. Read [references/composition-patterns.md](references/composition-patterns.md) for
@@ -31,7 +32,8 @@ retheme an existing app only within an authorized migration or redesign.
31
32
  read-only, and destructive/confirmation states that apply. Define event detail, focus movement,
32
33
  cancellation, and ownership of controlled values.
33
34
  5. **Design across constraints.** Check narrow allocation and long content first, then wide layout.
34
- Include RTL, translated strings, keyboard-only use, reduced motion, forced colors, and both
35
+ Separate core/companion chrome, host copy, generated prose language and data formatting. Include
36
+ RTL, translated strings, keyboard-only use, reduced motion, forced colors, and both
35
37
  supported theme modes. Use logical CSS and Lyra tokens/utilities.
36
38
  6. **Implement with stable boundaries.** Import registration modules through stable tag-shaped
37
39
  paths such as `@aceshooting/lyra-ui/components/lr-input.js`. Bind objects, arrays, functions, and
@@ -14,6 +14,7 @@ contract in the `lyra-ui` skill or the package reference before emitting markup.
14
14
  | Data display | Native text/list for small static content | Table, data grid, tree, virtual list, chart, or viewer when their interaction contract is required |
15
15
  | Feedback | Inline text near the action | Alert, progress, skeleton, spinner, empty state, toast, or live announcement based on urgency and persistence |
16
16
  | Transient UI | Inline disclosure when space permits | Popover, dropdown, drawer, or dialog when focus/dismissal/stacking behavior is genuinely needed |
17
+ | Generated answers | Existing widget-v2 renderer for widget-v2 documents | `lyra-gen` for catalog-bound views; follow the sibling skill's `lyra-gen.md` and installed `docs/compatibility.md` for the supported profile and limits |
17
18
 
18
19
  Do not nest a component merely to obtain padding or a border. Use layout utilities and semantic
19
20
  containers for visual grouping; reserve interactive components for interactions they own.
@@ -64,13 +65,19 @@ separate. Announce user-triggered status transitions without replaying initial s
64
65
  or consequential tool actions behind an explicit confirmation/approval contract, and keep focus
65
66
  return deterministic when transient UI closes.
66
67
 
68
+ For generated content, keep each admitted surface stable during prose updates, preserve edited
69
+ state across refinements, and show a localized fallback when its boundary rejects. Keep source
70
+ provenance, collection instructions and tool authorization host-owned. Readiness does not imply
71
+ remote-data completion or authorize an automatic focus move.
72
+
67
73
  ## Implementation handoff checklist
68
74
 
69
75
  - Register only rendered tags through stable tag-shaped imports.
70
76
  - Import the framework's type-only declaration entry once.
71
77
  - Bind complex values as properties; do not serialize objects into attributes.
72
78
  - Use the documented CustomEvent name and exact detail type; decide whether cancellation matters.
73
- - Use caller data verbatim but localize library-owned labels and announcements.
79
+ - Localize core/companion chrome and host copy through their respective owners; locale catalogs
80
+ do not translate caller data or generated prose. Keep source values separate from locale formatting.
74
81
  - Use logical CSS, Lyra tokens, and allocation-aware layout.
75
82
  - Record SSR mode, optional peers, remote-content boundaries, and failure behavior.
76
83
  - Test populated/open accessibility, keyboard/focus, narrow/long content, RTL, reduced motion,
@@ -2,7 +2,7 @@
2
2
  name: lyra-ui
3
3
  description: >
4
4
  Use when writing or reviewing code that imports @aceshooting/lyra-ui (or its lyra-docs,
5
- lyra-flags, lyra-map, lyra-translations and lyra-ide companions), uses any lr-* custom element, or
5
+ lyra-flags, lyra-map, lyra-translations, lyra-ide and lyra-gen companions), uses any lr-* custom element, or
6
6
  migrates a project off Web Awesome (wa-*) or Shoelace (sl-*). Covers exact component APIs
7
7
  (attributes, slots, events, parts, CSS custom properties), design-token theming, localization,
8
8
  framework/TypeScript integration, and wa-*/sl-* to lr-* migration.
@@ -59,9 +59,10 @@ instead of guessing.
59
59
  older React via a ref.
60
60
  - **Form controls are form-associated** (native submit and validation, no wiring). Read
61
61
  `effectiveDisabled`, not `disabled`, for the state merged with an ancestor `<fieldset disabled>`.
62
- - **Every built-in string is localizable** through a per-instance `.strings` override or an app-wide
63
- catalog via `registerLyraLocale()`; never overwrite slotted content to translate. Locale does not
64
- set writing direction: inherit an explicit `dir="rtl"`.
62
+ - **Localize component chrome separately from content.** Use documented keys through `.strings`
63
+ or `registerLyraLocale()`; preserve caller/slotted data. Locale imports register catalogs but do
64
+ not select them: use `setLyraLocale()` or inherited `lang`/`locale`, and apply `dir` explicitly.
65
+ Read `node_modules/@aceshooting/lyra-ui/llms/shared/localization-and-rtl.md` for precedence and document bridging.
65
66
 
66
67
  ## Appearance defaults
67
68
 
@@ -79,10 +80,13 @@ Install `@aceshooting/lyra-ide` and `@aceshooting/lyra-translations` at the same
79
80
  `@aceshooting/lyra-ui`. `@aceshooting/lyra-flags`, `@aceshooting/lyra-docs`, and `@aceshooting/lyra-map` are versioned
80
81
  independently; choose releases compatible with the installed packages and their declared peer ranges.
81
82
 
82
- - **`@aceshooting/lyra-translations`** (optional peer): the locale catalogs, imported as
83
- `@aceshooting/lyra-translations/<locale>.js` (or `<locale>/<family>.js` slices) or through
84
- `loadLyraLocale()`; see `node_modules/@aceshooting/lyra-ui/llms/shared/localization-and-rtl.md`. Only the pseudo-locales stay
85
- under `@aceshooting/lyra-ui/translations/pseudo/`.
83
+ - **`@aceshooting/lyra-translations`** (optional peer): side-effect-only core locale catalogs at
84
+ `@aceshooting/lyra-translations/<locale>.js` or `<locale>/<family>.js` (include shared keys when
85
+ using slices). Lazy loading uses `loadLyraLocale()` from `@aceshooting/lyra-ui/locale-loader.js`.
86
+ The conversation slice includes Gen's seven `genView*` renderer messages; generated prose stays
87
+ caller content. English is built into Lyra UI; pseudo locales stay under its `translations/pseudo/` path. Read
88
+ `@aceshooting/lyra-ui/locales.json` for exact imports and coverage; coverage is not linguistic
89
+ review. Companion-specific and application text retain their own message ownership.
86
90
  - **`@aceshooting/lyra-ide`** (dev dependency): editor data (`custom-elements.json`,
87
91
  `web-types.json`, `vscode-html-data.json`, `vscode-css-data.json`); setup in
88
92
  `node_modules/@aceshooting/lyra-ui/llms/shared/testing-and-utilities.md`.
@@ -91,6 +95,11 @@ independently; choose releases compatible with the installed packages and their
91
95
  - **`@aceshooting/lyra-docs`**: experimental `<lr-docx-editor>`; read its installed README for the
92
96
  bundled engine, registration, stylesheet imports, async editing commands, save receipts and limits. Core document viewers
93
97
  stay in `node_modules/@aceshooting/lyra-ui/llms/components/`.
98
+ - **`@aceshooting/lyra-gen`**: independently versioned generated views, interactive chat and saved/live
99
+ dashboards. Read [lyra-gen.md](lyra-gen.md) for boundary, validation, authority and locale ownership,
100
+ then the installed companion guide for the task. Its view format differs from widget-v2;
101
+ its explicit compatibility profile owns qualification limits and the experimental A2UI candidate
102
+ entry. A roadmap or adapter does not establish released support or protocol conformance.
94
103
  - **`@aceshooting/lyra-map`** (optional peer): the default modular renderer for `<lr-map>`. Configure
95
104
  `lyraMapWorkerPlugin()` from `@aceshooting/lyra-map/vite`, or supply a compatible worker URL.
96
105
  Read `node_modules/@aceshooting/lyra-ui/llms/components/lr-map.md` and the companion README before imperative map mutations:
@@ -0,0 +1,95 @@
1
+ # Lyra Gen companion
2
+
3
+ `@aceshooting/lyra-gen` is independently versioned. Pin the installed version,
4
+ check its Lyra UI peer range and release status, then read its `README.md` and the relevant guide
5
+ below. Package, view-format and catalog versions are separate contracts. Use granular imports;
6
+ the root registers no elements, while `@aceshooting/lyra-gen/gen-view.js` registers `lr-gen-view`.
7
+ Use only entries in the installed package's explicit `exports` map. Its `examples/` files are
8
+ application source recipes, not importable package subpaths; `docs/compatibility.md` owns the
9
+ implementation-path migration and separately experimental entry boundary.
10
+
11
+ The 1.x compatibility contract covers the declared view/chat/dashboard, static SSR, pinned SDK
12
+ and owned protocol profiles; only `adapters/a2ui-candidate.js` is an experimental exported API.
13
+ Read the installed compatibility guide's qualification limits before making release or performance
14
+ claims; provider/comparator campaigns and human assistive-technology review are not implied.
15
+
16
+ ## Choose and validate the boundary
17
+
18
+ - Keep existing widget-v2 documents on `lr-widget-renderer`; a Gen view uses `version: '1'`, an
19
+ exact catalog reference, a surface/revision and explicit unique node ids.
20
+ - Select the smallest reviewed catalog with `subsetCatalog()` or `selectCatalogPreset()` from
21
+ `catalog.js`. Catalog roles map to trusted components; registration does not expose their full
22
+ APIs. Read the selected property schemas, child/slot rules and required accessible names.
23
+ - `buildCatalogPrompt()` and `exportCatalogJsonSchema()` from `prompts.js` supply request context,
24
+ not a provider client or proof of provider schema support. Keep transport and token budgets in
25
+ the host. Runtime `validateView()` from `runtime.js` remains required for every input route.
26
+ - `parseMarkup()` from `parser.js` parses restricted data syntax, never HTML/JSX/JavaScript.
27
+ Quoted strings and JSON-valued properties do not authorize expression evaluation. Never send
28
+ rejected input through `innerHTML`, an HTML viewer or an evaluator.
29
+ - Partial input stays inert. Markup streams expose syntax results at `finish()`; JSON streams
30
+ validate there. Island parsers expose closed blocks that still need `validateView()`; the chat
31
+ controller validates before publication. Preserve prose and localized per-boundary fallbacks.
32
+
33
+ ```ts
34
+ import { initialCatalog, subsetCatalog } from '@aceshooting/lyra-gen/catalog.js';
35
+ import { validateView } from '@aceshooting/lyra-gen/runtime.js';
36
+
37
+ const selected = subsetCatalog(initialCatalog, ['stack', 'heading', 'text']);
38
+ if (!selected.ok) throw new Error('The requested catalog is unavailable.');
39
+ const admitted = validateView(receivedValue, selected.value);
40
+ // Render only admitted.value when admitted.ok is true, using the same selected catalog.
41
+ ```
42
+
43
+ ## Preserve state and host authority
44
+
45
+ Bind `.document`, `.catalog` and JSON-valued `.bindingState` as properties. For `.controlled`
46
+ edits, handle `lr-gen-state-change` and supply the accepted values. Keep a generated element stable
47
+ across sibling prose updates; refinements retain logical ids and advance the same surface's
48
+ revision. `applyViewPatch()` checks the expected revision. Reassigning `.bindingState` replaces
49
+ local state, so do not replay an old value over newer edits. `lr-gen-ready` reports renderer/child
50
+ update settlement, not remote-data completion; focus and completion announcements remain host-owned.
51
+
52
+ Authorize every `lr-gen-action` at the actual effect boundary. Catalog `confirm` actions require
53
+ `.confirmAction(action, signal)`; an absent callback denies them. Respect cancellation and stale
54
+ surface/viewer context. Catalog loaders, property adapters, URL sinks and field collection are
55
+ trusted host capabilities: follow `docs/security.md`, including exact approved-field policy when
56
+ required. Generated prose and labels do not establish safe collection intent or grant permissions.
57
+
58
+ Use viewer-authorized data maps; generated references do not fetch URLs or confer credentials.
59
+ Saved dashboards need server authorization and atomic conditional writes. Stored answers use
60
+ explicit approved catalog migrations preserving original and dirty state; dashboard envelope
61
+ migrations are separate. Unsupported identities need a visible localized fallback. `repairView()`
62
+ uses a host transport, bounded actual usage and a current generation/view/state guard; commit its
63
+ candidate only while that generation remains current. Never repair identity, security or resource
64
+ failures into acceptance.
65
+
66
+ ## Own language separately from data
67
+
68
+ `@aceshooting/lyra-translations` matches the **Lyra UI** version, not the independent Gen version.
69
+ Its full catalogs include core chrome and the seven `genView*` renderer messages in the
70
+ `conversation` slice; slice imports also need the families/shared keys used by child controls.
71
+ Override renderer messages through `.strings` or `registerLyraLocale()` and supply host-localized
72
+ `strings` to `createChatStream()`. Generated prose and caller labels stay application content. The host chooses
73
+ requested prose language and display locale separately and applies `lang`/`dir`. Preserve finite
74
+ JSON numbers and ISO dates where the schema admits them; format display values through the
75
+ component/host locale rather than replacing source data with localized strings.
76
+
77
+ ## Read the guide for the task
78
+
79
+ Paths below are relative to the installed companion. Follow their exact APIs and examples rather
80
+ than expanding this skill into a second API reference.
81
+
82
+ | Task | Guide |
83
+ |---|---|
84
+ | Presets, schemas, examples and structured inputs | `docs/catalog-presets.md`, `docs/structured-input.md` |
85
+ | Local scripted Markets, Weather and editable travel-budget walkthrough | `docs/guided-demo.md` (example-owned en/fr/ar copy; no model request) |
86
+ | Chat, stable `renderPart` shells and SDK parts | `docs/interactive-chat.md`, `docs/ai-sdk.md` |
87
+ | Rendering, state, readiness and approval | `docs/rendering.md`, `docs/approval.md` |
88
+ | Saved/live dashboards | `docs/dashboards.md`, `docs/dashboard-composition.md` |
89
+ | Completion, repair and stored answers | `docs/recovery-and-diagnostics.md`, `docs/stored-answer-migrations.md` |
90
+ | Server snapshots | `docs/ssr.md` |
91
+ | Protocol profiles and release evidence | `docs/a2ui.md`, `docs/compatibility.md`, `docs/threat-matrix.md` |
92
+
93
+ A deterministic example, synthetic replay, schema export or adapter is not evidence of model
94
+ quality, latency, accessibility review, production hosting or full protocol conformance. Report
95
+ only the installed profile and verification actually performed; unmet roadmap criteria remain pending.