@aceshooting/lyra-ui 31.0.0 → 31.1.1
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 +129 -0
- package/dist/autoloader-cdn.js +1 -1
- package/dist/components/agent-tools/budget-meter/budget-meter.class.d.ts +12 -1
- package/dist/components/agent-tools/budget-meter/budget-meter.class.js +4 -4
- package/dist/components/charts/chart/lite-chart.class.js +1 -1
- package/dist/components/conversation/chat-composer/chat-composer.class.d.ts +18 -8
- package/dist/components/conversation/chat-composer/chat-composer.class.js +11 -9
- package/dist/components/conversation/chat-composer/chat-composer.styles.js +1 -1
- package/dist/components/conversation/message-feedback/message-feedback.class.d.ts +11 -3
- package/dist/components/conversation/message-feedback/message-feedback.class.js +12 -6
- package/dist/components/conversation/message-feedback/message-feedback.styles.js +1 -1
- package/dist/components/conversation/prompt-input/prompt-input.class.d.ts +6 -3
- package/dist/components/conversation/prompt-input/prompt-input.class.js +3 -2
- package/dist/components/conversation/push-to-talk/push-to-talk.class.js +1 -1
- package/dist/components/conversation/thread-list/thread-list.class.d.ts +1 -1
- package/dist/components/conversation/thread-list/thread-list.class.js +2 -2
- package/dist/components/data/document-library/document-library-cursor.js +1 -0
- package/dist/components/data/document-library/document-library-types.d.ts +20 -0
- package/dist/components/data/document-library/document-library.class.d.ts +37 -26
- package/dist/components/data/document-library/document-library.class.js +20 -11
- package/dist/components/data/document-library/document-library.styles.js +1 -1
- package/dist/components/data/flow-canvas/flow-canvas.class.d.ts +1 -1
- package/dist/components/data/flow-canvas/flow-canvas.class.js +1 -1
- package/dist/components/data/timeline/timeline.class.js +1 -1
- package/dist/components/forms/combobox/combobox.class.d.ts +20 -12
- package/dist/components/forms/combobox/combobox.class.js +2 -2
- package/dist/components/layout/dock-panel/dock-panel.class.d.ts +1 -1
- package/dist/components/layout/dock-panel/dock-panel.class.js +1 -1
- package/dist/components/layout/page/page.class.d.ts +3 -3
- package/dist/components/layout/page/page.class.js +1 -1
- package/dist/components/layout/segmented/segmented.class.d.ts +20 -7
- package/dist/components/layout/segmented/segmented.class.js +34 -24
- package/dist/components/layout/segmented/segmented.styles.js +1 -1
- package/dist/components/layout/stepper/stepper.styles.js +1 -1
- package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
- package/dist/components/media/map/map-anchor-controller.js +1 -1
- package/dist/components/media/map/map-canvas-target.js +1 -0
- package/dist/components/media/map/map.class.d.ts +10 -1
- package/dist/components/media/map/map.class.js +4 -4
- package/dist/components/media/map/map.styles.js +1 -1
- package/dist/components/media/sequence-playback/sequence-playback.class.d.ts +21 -9
- package/dist/components/media/sequence-playback/sequence-playback.class.js +7 -6
- package/dist/components/media/sequence-playback/sequence-playback.styles.js +1 -1
- package/dist/components/overlays/overlay/overlay.styles.js +1 -1
- package/dist/components/retrieval/graph/graph-spatial-controller.js +1 -1
- package/dist/components/retrieval/graph/graph.class.js +1 -1
- package/dist/components/retrieval/ingestion-queue/ingestion-queue-presentation.d.ts +11 -0
- package/dist/components/retrieval/ingestion-queue/ingestion-queue-presentation.js +1 -0
- package/dist/components/retrieval/ingestion-queue/ingestion-queue.class.d.ts +18 -7
- package/dist/components/retrieval/ingestion-queue/ingestion-queue.class.js +13 -26
- package/dist/components/retrieval/ingestion-queue/ingestion-queue.styles.js +1 -1
- package/dist/components/utility/diff-view/diff-view.class.d.ts +5 -5
- package/dist/components/utility/diff-view/diff-view.class.js +1 -1
- package/dist/components/utility/icon/icon.class.js +1 -1
- package/dist/components/viewers/archive-viewer/archive-viewer.class.js +1 -1
- package/dist/components/viewers/calendar-viewer/calendar-viewer.class.js +1 -1
- package/dist/components/viewers/contact-viewer/contact-viewer.class.js +1 -1
- package/dist/components/viewers/document-preview/document-preview.class.js +2 -2
- package/dist/components/viewers/docx-viewer/docx-viewer.class.d.ts +1 -1
- package/dist/components/viewers/docx-viewer/docx-viewer.class.js +1 -1
- package/dist/components/viewers/email-viewer/email-viewer.class.d.ts +1 -1
- package/dist/components/viewers/email-viewer/email-viewer.class.js +2 -2
- package/dist/components/viewers/html-viewer/html-viewer.class.js +1 -1
- package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +2 -2
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts +1 -1
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +1 -1
- package/dist/components/viewers/pptx-viewer/pptx-viewer.class.js +1 -1
- package/dist/components/viewers/svg-viewer/svg-viewer.class.js +1 -1
- package/dist/components/viewers/xml-viewer/xml-viewer.class.js +2 -2
- package/dist/data-sources.d.ts +10 -0
- package/dist/events.d.ts +9 -4
- package/dist/framework-types.d.ts +1 -1
- package/dist/internal/default-strings/conversation.generated.js +1 -1
- package/dist/internal/default-strings/data.generated.js +1 -1
- package/dist/internal/default-strings/retrieval.generated.js +1 -1
- package/dist/internal/localization-types.d.ts +1 -1
- package/dist/internal/localization.js +1 -1
- package/dist/internal/lyra-element.js +2 -2
- package/dist/internal/native-modal-context.js +1 -1
- package/dist/internal/overlay-manager.js +1 -1
- package/dist/internal/overlay-order.js +1 -1
- package/dist/internal/overlay-stack.js +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/runtime-diagnostics.js +1 -0
- package/dist/internal/source-cursor-controller.js +1 -0
- package/dist/internal/source-cursor-projection.js +1 -0
- package/dist/internal/source-page-scope.js +1 -1
- package/dist/lyra.d.ts +1 -1
- package/dist/theme/theme-bootstrap.js +1 -1
- package/dist/theme/theme.js +1 -1
- package/dist/utilities/overlay-manager.d.ts +2 -0
- package/llms/components/lr-budget-meter.md +31 -0
- package/llms/components/lr-chat-composer.md +13 -2
- package/llms/components/lr-combobox.md +27 -1
- package/llms/components/lr-diff-view.md +6 -0
- package/llms/components/lr-document-library.md +90 -6
- package/llms/components/lr-graph.md +5 -0
- package/llms/components/lr-ingestion-queue.md +76 -8
- package/llms/components/lr-json-viewer.md +34 -0
- package/llms/components/lr-lite-chart.md +2 -1
- package/llms/components/lr-map.md +33 -0
- package/llms/components/lr-message-feedback.md +38 -3
- package/llms/components/lr-page.md +4 -2
- package/llms/components/lr-prompt-input.md +5 -2
- package/llms/components/lr-segmented.md +30 -10
- package/llms/components/lr-sequence-playback.md +47 -12
- package/llms/components/lr-virtual-list.md +3 -1
- package/llms/peers.md +2 -2
- package/llms/shared/events-and-types.md +61 -2
- package/llms/shared/forms-and-accessibility.md +25 -0
- package/llms/shared/imports-and-registration.md +154 -110
- package/llms/shared/testing-and-utilities.md +5 -1
- package/llms/shared.md +245 -113
- package/locales.json +1 -1
- package/package.json +8 -8
- package/registrations.json +1 -1
|
@@ -122,6 +122,31 @@ activation.
|
|
|
122
122
|
`lr-time-range` is form-associated only for fieldset-cascaded disablement: no submission value,
|
|
123
123
|
no state restoration.
|
|
124
124
|
|
|
125
|
+
### Hiding the label visually: `label-display`
|
|
126
|
+
|
|
127
|
+
On controls that expose `labelDisplay: LyraLabelDisplay` (`'visible' | 'hidden'`, reflected as
|
|
128
|
+
`label-display`), use `label-display="hidden"` to visually hide the existing field caption without
|
|
129
|
+
removing its accessible-name relationship. The caption leaves normal layout but remains available
|
|
130
|
+
to assistive technology. Keep a meaningful `label` or documented label slot; the display setting
|
|
131
|
+
does not supply a label. A host `aria-label` retains its documented naming precedence.
|
|
132
|
+
|
|
133
|
+
The display choice affects the `form-control-label` part only: hint/error text, their description
|
|
134
|
+
relationships, required semantics and validation are unchanged. It does not hide the whole control.
|
|
135
|
+
The default is `'visible'` on `lr-input`, `lr-number-input`, `lr-time-input`, `lr-textarea`,
|
|
136
|
+
`lr-select`, `lr-combobox`, `lr-date-input`, `lr-phone-input`, `lr-token-input`, `lr-locale-picker`,
|
|
137
|
+
`lr-country-picker`, `lr-currency-picker`, `lr-time-zone-picker`, `lr-unit-picker`, `lr-model-select`
|
|
138
|
+
and `lr-voice-picker`. `lr-segmented` uses the same vocabulary but defaults to `'hidden'`; set
|
|
139
|
+
`label-display="visible"` to add its field caption. Supporting text follows each component's own
|
|
140
|
+
hint/error API; `lr-segmented` provides a hint, not form validation or an error field.
|
|
141
|
+
|
|
142
|
+
```js
|
|
143
|
+
import '@aceshooting/lyra-ui/components/lr-select.js';
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
```html
|
|
147
|
+
<lr-select label="Sort order" label-display="hidden"></lr-select>
|
|
148
|
+
```
|
|
149
|
+
|
|
125
150
|
### Enter submits the form
|
|
126
151
|
|
|
127
152
|
A native `<input>` submits its form owner when the user presses Enter. The `<input>` these controls
|
|
@@ -2,21 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Component status, versioning, and deprecation
|
|
4
4
|
|
|
5
|
-
Every public `lr-*` component
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- **
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
version. If an API is deprecated in major version M, it remains available for the complete M+1
|
|
18
|
-
release line and cannot be removed before M+2. This policy applies equally to stable and
|
|
19
|
-
experimental public APIs.
|
|
5
|
+
Every public `lr-*` component records a status and `since` version in package metadata. `since`
|
|
6
|
+
is the earliest published release manifest containing the tag, or the current version for a new tag.
|
|
7
|
+
|
|
8
|
+
- **Stable** components support production use.
|
|
9
|
+
- **Experimental** components remain open to design review.
|
|
10
|
+
|
|
11
|
+
Once published, both statuses have full-semver protection until formal deprecation and removal; an incompatible
|
|
12
|
+
public API or behavior change requires a semver-major release.
|
|
13
|
+
|
|
14
|
+
Deprecation is explicit metadata, independent of status: it records a replacement, deprecation version,
|
|
15
|
+
rationale and earliest removal version. An API deprecated in major M remains available throughout
|
|
16
|
+
M+1 and cannot be removed before M+2, for stable and experimental APIs alike.
|
|
20
17
|
|
|
21
18
|
**9.0.0 took a one-time exception to that policy, and says so rather than quietly breaking it.**
|
|
22
19
|
Three members whose recorded removal window had genuinely opened were removed normally
|
|
@@ -32,36 +29,30 @@ customary M+1 warning period — `lr-usage-badge`'s `compact`, `lr-chart`'s `hor
|
|
|
32
29
|
a mechanical migration listed in the 9.0.0 changelog entry and in `migration.md`. From 9.0.0 onward
|
|
33
30
|
the M+2 rule applies as written; treat the above as a documented exception, not a precedent.
|
|
34
31
|
|
|
35
|
-
Deprecation
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Deprecated
|
|
39
|
-
|
|
40
|
-
`
|
|
41
|
-
|
|
42
|
-
are
|
|
43
|
-
|
|
44
|
-
The
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
way, and moving to the replacement removes the warning. A test suite that fails on console output
|
|
60
|
-
while deliberately exercising a deprecated form can pre-seed Lit's development-mode
|
|
61
|
-
`globalThis.litIssuedWarnings` set, before the element renders, with the key
|
|
62
|
-
`lyra-deprecated:<owner>:<kind>:<name>` — `<kind>` and `<name>` as in the deprecation record.
|
|
63
|
-
`<owner>` is the element name or package-relative module specifier. Theme migration guidance is in
|
|
64
|
-
[styles and tokens](styles-and-tokens.md).
|
|
32
|
+
Deprecation also covers **slot content** inside a supported slot, such as non-item menu content;
|
|
33
|
+
the slot description identifies it. Deprecated **package entry points**, **stylesheets**,
|
|
34
|
+
**exported types/functions/constants**, and **global events/root attributes** appear under
|
|
35
|
+
"Deprecated package exports" in `llms/index.md`. Named exports also carry `@deprecated` for editors.
|
|
36
|
+
Component records appear in the `llms/components/<tag>.md` header and `custom-elements.json`
|
|
37
|
+
(from `@aceshooting/lyra-ide`): declaration `deprecations` contain records, and a member's
|
|
38
|
+
`deprecationRef` identifies one as `kind:name`. Generic CEM readers can use `deprecated`.
|
|
39
|
+
These records are exhaustive; audit upgrades against them, not console output.
|
|
40
|
+
|
|
41
|
+
**Development warnings.** The `development` package condition includes deprecation diagnostics;
|
|
42
|
+
the default production condition omits them. With Lit's development build, some deprecated usages
|
|
43
|
+
emit `console.warn` naming the element or module, API and replacement, once per page for each
|
|
44
|
+
owner/API. Observable usages include setting a deprecated property/attribute, connecting a tag,
|
|
45
|
+
vetoing through an alias event or calling a function. Deprecated forms keep working; adopting the
|
|
46
|
+
replacement removes the warning. Production never emits these deprecation warnings.
|
|
47
|
+
|
|
48
|
+
Warnings require cheap, exact observation. Many deprecations never warn, including slot content
|
|
49
|
+
(`lr-stat`'s default-slot icon and `lr-menu`'s non-item default-slot content) and unobservable CSS
|
|
50
|
+
parts, custom properties and custom states. A silent console does not prove absence of deprecated
|
|
51
|
+
usage. Tests deliberately exercising it can pre-seed Lit's development-mode
|
|
52
|
+
`globalThis.litIssuedWarnings` set before rendering with
|
|
53
|
+
`lyra-deprecated:<owner>:<kind>:<name>`: `<kind>`/`<name>` come from the record; `<owner>` is the
|
|
54
|
+
element name or package-relative module specifier. See [styles and tokens](styles-and-tokens.md)
|
|
55
|
+
for theme migration.
|
|
65
56
|
|
|
66
57
|
### Release history and upgrade notes
|
|
67
58
|
|
|
@@ -77,16 +68,12 @@ registration-free `.class.js` subpath, the split SSR/hydration entries, and the
|
|
|
77
68
|
|
|
78
69
|
### The support window
|
|
79
70
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
floors are derived from those platform features rather than individually verified version-by-version.
|
|
87
|
-
Raising any floor is a semver-major change. Full policy, including the known WebKit
|
|
88
|
-
cross-shadow-selection gap and the
|
|
89
|
-
rule for when a `@supports` fallback may be dropped:
|
|
71
|
+
The published support window is Chromium 120+, Gecko 121+, WebKit 16.4+ and Node 22+ (ESM only,
|
|
72
|
+
no CommonJS entry). These floors derive from `:dir()`, `:has()`, `@container`, `color-mix()` and
|
|
73
|
+
`ElementInternals` form association, not individual version-by-version verification. Lyra ships
|
|
74
|
+
untranspiled ES2022 modules without polyfills or build-time downleveling. There is no `browserslist`
|
|
75
|
+
field: it would describe a build step Lyra does not have. Raising a floor is semver-major. Full policy, including WebKit's
|
|
76
|
+
cross-shadow-selection gap and conditions for dropping a `@supports` fallback:
|
|
90
77
|
<https://github.com/aceshooting/lyra-ui/blob/main/docs/support-policy.md>.
|
|
91
78
|
|
|
92
79
|
## Importing and registering components
|
|
@@ -99,9 +86,8 @@ import "@aceshooting/lyra-ui/components/lr-combobox.js"; // registers <lr-combob
|
|
|
99
86
|
import "@aceshooting/lyra-ui/components/lr-table.js"; // registers <lr-table>
|
|
100
87
|
```
|
|
101
88
|
|
|
102
|
-
Family
|
|
103
|
-
|
|
104
|
-
do not register a tag.
|
|
89
|
+
Family barrels register their family. Registration-free `.class.js` entries retain the owning
|
|
90
|
+
family/component path, exposing source organization.
|
|
105
91
|
|
|
106
92
|
New application code can import any component through its stable tag-shaped path:
|
|
107
93
|
|
|
@@ -111,8 +97,8 @@ import "@aceshooting/lyra-ui/components/lr-menubar.js";
|
|
|
111
97
|
import "@aceshooting/lyra-ui/components/lr-tool-call-block.js";
|
|
112
98
|
```
|
|
113
99
|
|
|
114
|
-
`llms/index.md` lists
|
|
115
|
-
|
|
100
|
+
`llms/index.md` lists tags and implementation modules; stable aliases and family barrels resolve
|
|
101
|
+
through component exports.
|
|
116
102
|
|
|
117
103
|
The package root is a pure, side-effect-free export surface. Import a component entry to register
|
|
118
104
|
only that tag, or use the explicit `all.js` entry when whole-library registration is needed:
|
|
@@ -121,11 +107,9 @@ only that tag, or use the explicit `all.js` entry when whole-library registratio
|
|
|
121
107
|
import "@aceshooting/lyra-ui/all.js"; // explicitly registers the root-included tags
|
|
122
108
|
```
|
|
123
109
|
|
|
124
|
-
The
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
remain side-effectful convenience entries; prefer tag-shaped imports for smaller application
|
|
128
|
-
bundles.
|
|
110
|
+
The root exports shared utilities/types, not component constructors. Use a component's owning
|
|
111
|
+
`.class.js` for its class and tag-shaped entry to register it. Family barrels and `all.js` remain
|
|
112
|
+
side-effectful conveniences; prefer tag imports for smaller bundles.
|
|
129
113
|
|
|
130
114
|
The entry points, then:
|
|
131
115
|
|
|
@@ -138,11 +122,11 @@ The entry points, then:
|
|
|
138
122
|
one warning for that exact conflict with the existing/incoming package versions, constructor
|
|
139
123
|
names, and both constructor references. An existing non-Lyra definition is reported with an
|
|
140
124
|
`unknown` existing version rather than guessed provenance.
|
|
141
|
-
- **Root barrel.** `import '@aceshooting/lyra-ui';` registers **nothing**.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
125
|
+
- **Root barrel.** `import '@aceshooting/lyra-ui';` registers **nothing**. Its broad compatibility
|
|
126
|
+
surface of commonly used classes, helpers and types is not exhaustive for component-owned types
|
|
127
|
+
or future exports. Prefer the owning entry for that component's complete contract and smaller
|
|
128
|
+
bundles.
|
|
129
|
+
|
|
146
130
|
- **`all.js` compatibility entry.** `import '@aceshooting/lyra-ui/all.js';` registers the 296
|
|
147
131
|
root-included tags — everything **except** the 15 inventory-designated optional-peer-family tags:
|
|
148
132
|
`lr-chart` and its 8 typed subclasses (`lr-line-chart`, `lr-bar-chart`, `lr-pie-chart`,
|
|
@@ -193,11 +177,76 @@ The entry points, then:
|
|
|
193
177
|
`waitForLyraElement()`/`waitForToast()` for awaiting a lazily registered mount),
|
|
194
178
|
`@aceshooting/lyra-ui/utilities/*` (the curated shared helpers, all documented below).
|
|
195
179
|
|
|
180
|
+
### One runtime per document
|
|
181
|
+
|
|
182
|
+
Active Lyra components and overlay utilities in a `Document`, including lazy chunks, must share
|
|
183
|
+
one evaluated `@aceshooting/lyra-ui` graph. Identical versions/archive bytes can still produce
|
|
184
|
+
separate runtimes through different optional-peer contexts. Matching versions or avoiding tag
|
|
185
|
+
conflicts does not share Escape, focus, modal inertness, scroll-lock or native-modal coordination.
|
|
186
|
+
Shadow roots/scoped registries do not isolate these resources; separate documents are independent.
|
|
187
|
+
|
|
188
|
+
Choose the application that owns UI and its required optional peers. For a Vite application whose
|
|
189
|
+
project root directly depends on UI, configure
|
|
190
|
+
[`resolve.dedupe`](https://vite.dev/config/shared-options#resolve-dedupe):
|
|
191
|
+
|
|
192
|
+
```js
|
|
193
|
+
import { defineConfig } from 'vite';
|
|
194
|
+
|
|
195
|
+
export default defineConfig({
|
|
196
|
+
resolve: { dedupe: ['@aceshooting/lyra-ui'] },
|
|
197
|
+
});
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
A shared build root without that dependency must explicitly select the owning application's
|
|
201
|
+
public UI exports. For Vite 8, this example uses a
|
|
202
|
+
[pre-enforced resolver](https://vite.dev/guide/api-plugin#plugin-ordering) and the same resolver
|
|
203
|
+
in [dependency optimization](https://vite.dev/config/dep-optimization-options#optimizedeps-rolldownoptions):
|
|
204
|
+
|
|
205
|
+
```js
|
|
206
|
+
import { createRequire } from 'node:module';
|
|
207
|
+
import { defineConfig } from 'vite';
|
|
208
|
+
|
|
209
|
+
const application = createRequire(new URL('./app/package.json', import.meta.url));
|
|
210
|
+
const resolveUi = () => ({
|
|
211
|
+
name: 'application-ui-runtime',
|
|
212
|
+
resolveId(source) {
|
|
213
|
+
return /^@aceshooting\/lyra-ui(?:\/.*)?$/u.test(source)
|
|
214
|
+
? application.resolve(source)
|
|
215
|
+
: null;
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
export default defineConfig({
|
|
220
|
+
resolve: { dedupe: ['@aceshooting/lyra-ui'] },
|
|
221
|
+
plugins: [{ ...resolveUi(), enforce: 'pre' }],
|
|
222
|
+
optimizeDeps: { rolldownOptions: { plugins: [resolveUi()] } },
|
|
223
|
+
});
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Replace `./app/package.json` with the owning application's manifest. UI's current default public
|
|
227
|
+
exports support `createRequire().resolve()` without assuming install layout or importing CommonJS.
|
|
228
|
+
Import-only companion exports instead require an ESM entry resolved in their owning application.
|
|
229
|
+
Retain that UI context's required optional peers and companion worker/renderer identity checks;
|
|
230
|
+
deduplicating incompatible peers does not repair them.
|
|
231
|
+
|
|
232
|
+
Reusable libraries should peer-depend on UI and externalize its root and every public subpath,
|
|
233
|
+
without bundling a separate copy. Verify actually served development dependencies and production
|
|
234
|
+
module graphs, including lazy imports: development optimization can collapse copies that remain
|
|
235
|
+
split in production. Alias the whole package, never an internal owner or diagnostic module.
|
|
236
|
+
|
|
237
|
+
Active use of a second instrumented runtime emits one `[lr-runtime-duplicate]` warning per
|
|
238
|
+
document, including when versions match. It detects an unsupported split runtime; it does not
|
|
239
|
+
merge or repair overlay state. Passive imports and SSR do not claim a document. If the document's
|
|
240
|
+
diagnostic marker cannot be used, `[lr-runtime-diagnostic-unavailable]` is bounded to once per
|
|
241
|
+
runtime per document; components continue to operate. A throwing console logger does not abort
|
|
242
|
+
connection or overlay acquisition. Silence is not proof of correct bundling: older uninstrumented
|
|
243
|
+
copies and partial internal deduplication can escape detection. Keep the whole-package singleton
|
|
244
|
+
configuration even when no warning appears.
|
|
245
|
+
|
|
196
246
|
### Registration-free component helpers
|
|
197
247
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
normalization as a component without registering it:
|
|
248
|
+
These public, side-effect-free helpers share component data normalization without defining custom
|
|
249
|
+
elements, for server, worker or application code:
|
|
201
250
|
|
|
202
251
|
```ts
|
|
203
252
|
import {
|
|
@@ -232,17 +281,17 @@ also renders that component.
|
|
|
232
281
|
|
|
233
282
|
### Optional autoloader
|
|
234
283
|
|
|
235
|
-
`@aceshooting/lyra-ui/autoloader.js` exports `discover(root?, options?)`, `start(root?, options?)
|
|
236
|
-
and `stop()`. It
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
284
|
+
`@aceshooting/lyra-ui/autoloader.js` exports `discover(root?, options?)`, `start(root?, options?)`
|
|
285
|
+
and `stop()`. It independently loads known tags for component splitting; granular imports stay
|
|
286
|
+
independent. Importing it has no side effects or registrations.
|
|
287
|
+
|
|
288
|
+
- `discover()` scans once. `start()` scans, then watches dynamic/Turbo-style replacement subtrees,
|
|
289
|
+
stopping any previous watcher. Idempotent `stop()` disconnects it, invalidates pending definitions
|
|
290
|
+
and removes loader-owned markers.
|
|
291
|
+
- Root defaults to `document`: accept a `Document`, `DocumentFragment`/open `ShadowRoot` or
|
|
292
|
+
`Element`. Traverse caller-owned open shadows iteratively and use each element's owning/scoped
|
|
293
|
+
custom-element registry, never an unrelated global registry.
|
|
294
|
+
|
|
246
295
|
- `maxElements` (default `10_000`), `maxRoots` (`2_000`), `maxDepth` (`256`), and `maxWork`
|
|
247
296
|
(`100_000`) bound one complete discovery operation. `maxConcurrency` (`16`) bounds concurrent
|
|
248
297
|
definition and first-update tasks. Invalid limits throw `RangeError`; an initial `discover()` or
|
|
@@ -287,9 +336,9 @@ and both are safe to import in plain Node.
|
|
|
287
336
|
## Optional native scoped registries
|
|
288
337
|
|
|
289
338
|
`utilities/scoped-registry.js` exports `supportsScopedRegistries()` and
|
|
290
|
-
`createScopedRegistry(definitions, { document? })`.
|
|
291
|
-
|
|
292
|
-
|
|
339
|
+
`createScopedRegistry(definitions, { document? })`. Creation checks optional native support and
|
|
340
|
+
rejects unsupported browsers/SSR; no polyfill or global fallback is installed. Ordinary registration
|
|
341
|
+
imports retain global behavior.
|
|
293
342
|
|
|
294
343
|
Use class-only imports and provide full tag names, including composed children:
|
|
295
344
|
|
|
@@ -338,26 +387,21 @@ creation in third-party factories is not intercepted; those factories must use t
|
|
|
338
387
|
|
|
339
388
|
## Collection identity
|
|
340
389
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
Lyra does not rewrite a valid retained identity merely to validate it. When normalization is part
|
|
360
|
-
of that contract, the normalized value is the identity used consistently for duplicate detection,
|
|
361
|
-
selection, persistence, keyed DOM ownership, and event details. Assign a new collection when the
|
|
362
|
-
data changes, and keep the business identity stable across object replacement so those consumers
|
|
363
|
-
continue to follow the same logical record.
|
|
390
|
+
Each host collection declares an identity policy. Actionable/keyed collections require stable,
|
|
391
|
+
nonempty business identities: ignore malformed identities and later duplicates before rendering,
|
|
392
|
+
counting, focus reconciliation, selection lookup, persistence or events. First valid occurrence
|
|
393
|
+
wins; reordering never makes array position its identity. Intentionally repeated values remain,
|
|
394
|
+
with an occurrence index in every state/event addressing one; the component documents this.
|
|
395
|
+
|
|
396
|
+
Controlled properties, persisted/active fields and action details use the same domain names rather than
|
|
397
|
+
`HTMLElement.id`: e.g. `panelId`, `commandId`, `cellId`, `stepId`, `viewId`, `attachmentId`, `cueId`,
|
|
398
|
+
`highlightId` and `spanId`. Compound identities retain all scope fields, e.g.
|
|
399
|
+
`{ invocationId, sourceKey }`. Published input records may retain established `id`/`key`/`path`
|
|
400
|
+
spellings while applying their documented uniqueness/occurrence policy and exposing domain-named
|
|
401
|
+
controlled state/action details.
|
|
402
|
+
|
|
403
|
+
Empty/whitespace-only required identities are missing. Valid retained identities are not rewritten
|
|
404
|
+
for validation unless the component explicitly documents and tests normalization, such as trimming.
|
|
405
|
+
Then use the normalized identity consistently for duplicates, selection, persistence, keyed DOM
|
|
406
|
+
ownership and event details. Assign a new collection when data changes; retain business identities
|
|
407
|
+
across object replacement so consumers follow the same logical records.
|
|
@@ -708,7 +708,11 @@ animationName: string, options?: LyraGetAnimationOptions): LyraResolvedElementAn
|
|
|
708
708
|
- **`overlay-manager` → `activateOverlay(options): OverlayHandle` and
|
|
709
709
|
`suspendLyraModalsFor(externalModal): () => void`** — per-`Document` coordination used by Lyra's
|
|
710
710
|
modal and focus-returning overlay surfaces, including dialogs/drawers, Page/app navigation,
|
|
711
|
-
command/tool surfaces, lightbox/tour, and responsive/floating/fullscreen panels.
|
|
711
|
+
command/tool surfaces, lightbox/tour, and responsive/floating/fullscreen panels. Components and
|
|
712
|
+
utility imports must use [one application-owned runtime per document](./imports-and-registration.md#one-runtime-per-document),
|
|
713
|
+
including lazy chunks; equal versions do not make separate package copies coordinate.
|
|
714
|
+
`[lr-runtime-duplicate]` detects unsupported split-runtime use without merging its state.
|
|
715
|
+
All entries in the supported runtime share
|
|
712
716
|
one topmost stack: only the top entry handles Escape, Tab
|
|
713
717
|
trapping, and backdrop dismissal. Content outside the active modal's composed path is inert,
|
|
714
718
|
including lower overlays and page content added while it is open. Focus traversal crosses slots
|