@aceshooting/lyra-ui 30.2.0 → 30.3.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 (51) hide show
  1. package/CHANGELOG.md +71 -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-parts/message-parts.class.d.ts +13 -4
  15. package/dist/components/conversation/message-parts/message-parts.class.js +12 -10
  16. package/dist/components/conversation/message-parts/message-parts.d.ts +1 -1
  17. package/dist/components/conversation/message-parts/message-parts.js +1 -1
  18. package/dist/components/forms/select/select.class.js +1 -1
  19. package/dist/components/media/file-input/file-input.styles.js +1 -1
  20. package/dist/components/media/map/map-control-chrome.js +1 -0
  21. package/dist/components/media/map/map-control-options.d.ts +6 -2
  22. package/dist/components/media/map/map-control-options.js +1 -1
  23. package/dist/components/media/map/map-controls-lifecycle.js +1 -1
  24. package/dist/components/media/map/map-controls-readiness.js +1 -0
  25. package/dist/components/media/map/map.class.d.ts +39 -2
  26. package/dist/components/media/map/map.class.js +13 -7
  27. package/dist/components/media/map/map.styles.js +1 -1
  28. package/dist/events.d.ts +10 -1
  29. package/dist/framework-types.d.ts +1 -1
  30. package/dist/internal/localization-types.d.ts +1 -1
  31. package/dist/internal/localization.js +1 -1
  32. package/dist/internal/package-metadata.js +1 -1
  33. package/dist/internal/scoped-definitions.generated.js +1 -1
  34. package/dist/lyra.d.ts +1 -1
  35. package/llms/components/lr-file-input.md +5 -0
  36. package/llms/components/lr-map.md +80 -8
  37. package/llms/components/lr-mcp-app.md +94 -4
  38. package/llms/components/lr-message-parts.md +18 -0
  39. package/llms/components/lr-select.md +3 -2
  40. package/llms/peers.md +1 -1
  41. package/llms/shared/ai-and-peers.md +77 -3
  42. package/llms/shared/events-and-types.md +25 -1
  43. package/llms/shared/localization-and-rtl.md +29 -0
  44. package/llms/shared.md +131 -4
  45. package/locales.json +1 -1
  46. package/package.json +8 -4
  47. package/registrations.json +1 -1
  48. package/skills/compose-lyra-interfaces/SKILL.md +5 -3
  49. package/skills/compose-lyra-interfaces/references/composition-patterns.md +8 -1
  50. package/skills/lyra-ui/SKILL.md +16 -8
  51. package/skills/lyra-ui/lyra-gen.md +86 -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 | Experimental `lyra-gen` for catalog-bound views; follow the sibling skill's `lyra-gen.md` and installed guides |
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,10 @@ 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 experimental generated views and saved
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
+ a roadmap or adapter does not establish released support or protocol conformance.
94
102
  - **`@aceshooting/lyra-map`** (optional peer): the default modular renderer for `<lr-map>`. Configure
95
103
  `lyraMapWorkerPlugin()` from `@aceshooting/lyra-map/vite`, or supply a compatible worker URL.
96
104
  Read `node_modules/@aceshooting/lyra-ui/llms/components/lr-map.md` and the companion README before imperative map mutations:
@@ -0,0 +1,86 @@
1
+ # Lyra Gen companion
2
+
3
+ `@aceshooting/lyra-gen` is independently versioned and experimental. 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
+
8
+ ## Choose and validate the boundary
9
+
10
+ - Keep existing widget-v2 documents on `lr-widget-renderer`; a Gen view uses `version: '1'`, an
11
+ exact catalog reference, a surface/revision and explicit unique node ids.
12
+ - Select the smallest reviewed catalog with `subsetCatalog()` or `selectCatalogPreset()` from
13
+ `catalog.js`. Catalog roles map to trusted components; registration does not expose their full
14
+ APIs. Read the selected property schemas, child/slot rules and required accessible names.
15
+ - `buildCatalogPrompt()` and `exportCatalogJsonSchema()` from `prompts.js` supply request context,
16
+ not a provider client or proof of provider schema support. Keep transport and token budgets in
17
+ the host. Runtime `validateView()` from `runtime.js` remains required for every input route.
18
+ - `parseMarkup()` from `parser.js` parses restricted data syntax, never HTML/JSX/JavaScript.
19
+ Quoted strings and JSON-valued properties do not authorize expression evaluation. Never send
20
+ rejected input through `innerHTML`, an HTML viewer or an evaluator.
21
+ - Partial input stays inert. Markup streams expose syntax results at `finish()`; JSON streams
22
+ validate there. Island parsers expose closed blocks that still need `validateView()`; the chat
23
+ controller validates before publication. Preserve prose and localized per-boundary fallbacks.
24
+
25
+ ```ts
26
+ import { initialCatalog, subsetCatalog } from '@aceshooting/lyra-gen/catalog.js';
27
+ import { validateView } from '@aceshooting/lyra-gen/runtime.js';
28
+
29
+ const selected = subsetCatalog(initialCatalog, ['stack', 'heading', 'text']);
30
+ if (!selected.ok) throw new Error('The requested catalog is unavailable.');
31
+ const admitted = validateView(receivedValue, selected.value);
32
+ // Render only admitted.value when admitted.ok is true, using the same selected catalog.
33
+ ```
34
+
35
+ ## Preserve state and host authority
36
+
37
+ Bind `.document`, `.catalog` and JSON-valued `.bindingState` as properties. For `.controlled`
38
+ edits, handle `lr-gen-state-change` and supply the accepted values. Keep a generated element stable
39
+ across sibling prose updates; refinements retain logical ids and advance the same surface's
40
+ revision. `applyViewPatch()` checks the expected revision. Reassigning `.bindingState` replaces
41
+ local state, so do not replay an old value over newer edits. `lr-gen-ready` reports renderer/child
42
+ update settlement, not remote-data completion; focus and completion announcements remain host-owned.
43
+
44
+ Authorize every `lr-gen-action` at the actual effect boundary. Catalog `confirm` actions require
45
+ `.confirmAction(action, signal)`; an absent callback denies them. Respect cancellation and stale
46
+ surface/viewer context. Catalog loaders, property adapters, URL sinks and field collection are
47
+ trusted host capabilities: follow `docs/security.md`, including exact approved-field policy when
48
+ required. Generated prose and labels do not establish safe collection intent or grant permissions.
49
+
50
+ Use viewer-authorized data maps; generated references do not fetch URLs or confer credentials.
51
+ Saved dashboards need server authorization and atomic conditional writes. Stored answers use
52
+ explicit approved catalog migrations preserving original and dirty state; dashboard envelope
53
+ migrations are separate. Unsupported identities need a visible localized fallback. `repairView()`
54
+ uses a host transport, bounded actual usage and a current generation/view/state guard; commit its
55
+ candidate only while that generation remains current. Never repair identity, security or resource
56
+ failures into acceptance.
57
+
58
+ ## Own language separately from data
59
+
60
+ `@aceshooting/lyra-translations` matches the **Lyra UI** version, not the independent Gen version.
61
+ Its full catalogs include core chrome and the seven `genView*` renderer messages in the
62
+ `conversation` slice; slice imports also need the families/shared keys used by child controls.
63
+ Override renderer messages through `.strings` or `registerLyraLocale()` and supply host-localized
64
+ `strings` to `createChatStream()`. Generated prose and caller labels stay application content. The host chooses
65
+ requested prose language and display locale separately and applies `lang`/`dir`. Preserve finite
66
+ JSON numbers and ISO dates where the schema admits them; format display values through the
67
+ component/host locale rather than replacing source data with localized strings.
68
+
69
+ ## Read the guide for the task
70
+
71
+ Paths below are relative to the installed companion. Follow their exact APIs and examples rather
72
+ than expanding this skill into a second API reference.
73
+
74
+ | Task | Guide |
75
+ |---|---|
76
+ | Presets, schemas, examples and structured inputs | `docs/catalog-presets.md`, `docs/structured-input.md` |
77
+ | Chat, stable `renderPart` shells and SDK parts | `docs/interactive-chat.md`, `docs/ai-sdk.md` |
78
+ | Rendering, state, readiness and approval | `docs/rendering.md`, `docs/approval.md` |
79
+ | Saved/live dashboards | `docs/dashboards.md`, `docs/dashboard-composition.md` |
80
+ | Completion, repair and stored answers | `docs/recovery-and-diagnostics.md`, `docs/stored-answer-migrations.md` |
81
+ | Server snapshots | `docs/ssr.md` |
82
+ | Protocol profiles and release evidence | `docs/a2ui.md`, `docs/compatibility.md`, `docs/threat-matrix.md` |
83
+
84
+ A deterministic example, synthetic replay, schema export or adapter is not evidence of model
85
+ quality, latency, accessibility review, production hosting or full protocol conformance. Report
86
+ only the installed profile and verification actually performed; unmet roadmap criteria remain pending.