@aceshooting/lyra-ui 30.4.0 → 30.7.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.
- package/CHANGELOG.md +92 -0
- package/README.md +2 -3
- package/dist/components/agent-tools/artifact-panel/artifact-panel.class.d.ts +7 -4
- package/dist/components/agent-tools/artifact-panel/artifact-panel.class.js +5 -5
- package/dist/components/conversation/code-block/onig.provenance.json +1 -1
- package/dist/components/conversation/markdown/markdown-base.class.d.ts +1 -1
- package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
- package/dist/components/conversation/markdown/markdown-core.class.d.ts +11 -1
- package/dist/components/conversation/markdown/markdown-core.class.js +1 -1
- package/dist/components/conversation/markdown/markdown-progressive.js +2 -2
- package/dist/components/conversation/markdown/markdown-shared.d.ts +7 -2
- package/dist/components/conversation/markdown/markdown-shared.js +3 -3
- package/dist/components/conversation/markdown/markdown.class.d.ts +11 -1
- package/dist/components/conversation/markdown/markdown.class.js +1 -1
- package/dist/components/conversation/message-parts/message-parts.class.d.ts +1 -1
- package/dist/components/conversation/message-parts/message-parts.class.js +1 -1
- package/dist/components/conversation/message-parts/message-parts.d.ts +1 -1
- package/dist/components/conversation/model-select/model-select.class.d.ts +8 -1
- package/dist/components/conversation/model-select/model-select.class.js +2 -2
- package/dist/components/conversation/streaming-text/streaming-text-base.class.d.ts +5 -0
- package/dist/components/conversation/streaming-text/streaming-text-base.class.js +2 -2
- package/dist/components/conversation/streaming-text/streaming-text-core.class.d.ts +1 -1
- package/dist/components/conversation/streaming-text/streaming-text-core.class.js +1 -0
- package/dist/components/conversation/streaming-text/streaming-text.class.d.ts +1 -1
- package/dist/components/conversation/streaming-text/streaming-text.class.js +1 -0
- package/dist/components/conversation/suggestion-chips/suggestion-chips.class.d.ts +6 -0
- package/dist/components/conversation/suggestion-chips/suggestion-chips.styles.js +1 -1
- package/dist/components/conversation/voice-picker/voice-picker.class.d.ts +9 -2
- package/dist/components/conversation/voice-picker/voice-picker.class.js +2 -2
- package/dist/components/conversation/widget-renderer/default-registry.js +1 -1
- package/dist/components/conversation/widget-renderer/registry.d.ts +1 -27
- package/dist/components/conversation/widget-renderer/registry.js +1 -1
- package/dist/components/conversation/widget-renderer/resolve.d.ts +1 -29
- package/dist/components/conversation/widget-renderer/resolve.js +1 -1
- package/dist/components/conversation/widget-renderer/widget-renderer.class.d.ts +1 -1
- package/dist/components/conversation/widget-renderer/widget-renderer.class.js +1 -1
- package/dist/components/forms/catalog-picker-base.d.ts +3 -1
- package/dist/components/forms/catalog-picker-base.js +3 -3
- package/dist/components/forms/combobox/combobox.class.d.ts +9 -2
- package/dist/components/forms/combobox/combobox.class.js +2 -2
- package/dist/components/forms/date-picker/date-input.class.d.ts +9 -2
- package/dist/components/forms/date-picker/date-input.class.js +2 -2
- package/dist/components/forms/input/input-shared.d.ts +9 -2
- package/dist/components/forms/input/input-shared.js +2 -2
- package/dist/components/forms/input/time-input.class.d.ts +9 -2
- package/dist/components/forms/input/time-input.class.js +2 -2
- package/dist/components/forms/input/time-input.styles.js +1 -1
- package/dist/components/forms/locale-picker/locale-picker.class.d.ts +18 -3
- package/dist/components/forms/locale-picker/locale-picker.class.js +2 -2
- package/dist/components/forms/phone-input/phone-input.class.d.ts +9 -2
- package/dist/components/forms/phone-input/phone-input.class.js +2 -2
- package/dist/components/forms/phone-input/phone-input.styles.js +1 -1
- package/dist/components/forms/select/select.class.d.ts +9 -2
- package/dist/components/forms/select/select.class.js +2 -2
- package/dist/components/forms/textarea/textarea.class.d.ts +9 -2
- package/dist/components/forms/textarea/textarea.class.js +2 -2
- package/dist/components/forms/token-input/token-input.class.d.ts +9 -2
- package/dist/components/forms/token-input/token-input.class.js +2 -2
- package/dist/components/forms/token-input/token-input.styles.js +1 -1
- package/dist/components/layout/dock-panel/dock-panel.class.d.ts +5 -2
- package/dist/components/layout/dock-panel/dock-panel.styles.js +1 -1
- package/dist/components/layout/menu/menu-item.class.d.ts +7 -4
- package/dist/components/layout/menu/menu-item.class.js +3 -2
- package/dist/components/layout/multi-split/multi-split.class.d.ts +73 -6
- package/dist/components/layout/multi-split/multi-split.class.js +4 -4
- package/dist/components/layout/multi-split/multi-split.styles.js +1 -1
- package/dist/components/layout/page/page.class.d.ts +7 -0
- package/dist/components/layout/page/page.styles.js +1 -1
- package/dist/components/media/flag/language-map.js +1 -1
- package/dist/components/media/image-viewer/image-viewer-panorama.d.ts +1 -5
- package/dist/components/media/image-viewer/image-viewer-panorama.js +1 -8
- package/dist/components/media/image-viewer/image-viewer.class.d.ts +1 -1
- package/dist/components/media/image-viewer/image-viewer.class.js +1 -1
- package/dist/components/media/map/map-control-options.d.ts +19 -5
- package/dist/components/media/map/map-control-options.js +1 -1
- package/dist/components/media/map/map-controls-lifecycle.js +1 -1
- package/dist/components/media/map/map-feature-loader.js +1 -1
- package/dist/components/media/map/map-loader.d.ts +10 -4
- package/dist/components/media/map/map-loader.js +1 -1
- package/dist/components/media/map/map-scene-admission.js +1 -0
- package/dist/components/media/map/map-scene-completion-adapter.js +1 -0
- package/dist/components/media/map/map-scene-completion-camera.js +1 -0
- package/dist/components/media/map/map-scene-configuration-controller.js +1 -0
- package/dist/components/media/map/map-scene-configuration.d.ts +15 -0
- package/dist/components/media/map/map-scene-configuration.js +1 -0
- package/dist/components/media/map/map-scene-controls.js +1 -0
- package/dist/components/media/map/map-scene-errors.js +1 -0
- package/dist/components/media/map/map-scene-line-layer.js +1 -0
- package/dist/components/media/map/map-scene-lines.js +1 -0
- package/dist/components/media/map/map-scene-owner.js +1 -0
- package/dist/components/media/map/map-scene-position-registry.js +1 -0
- package/dist/components/media/map/map-scene-render-controller.js +1 -0
- package/dist/components/media/map/map-scene-render-input.js +1 -0
- package/dist/components/media/map/map-scene-source-snapshot.js +1 -0
- package/dist/components/media/map/map-scene-status.js +1 -0
- package/dist/components/media/map/map-scene-types.d.ts +55 -0
- package/dist/components/media/map/map.class.d.ts +105 -18
- package/dist/components/media/map/map.class.js +32 -15
- package/dist/components/media/map/map.styles.js +1 -1
- package/dist/components/media/sequence-playback/sequence-playback.class.d.ts +1 -1
- package/dist/components/media/sequence-playback/sequence-playback.class.js +1 -1
- package/dist/components/media/video/video.class.d.ts +1 -1
- package/dist/components/media/video/video.class.js +1 -1
- package/dist/components/retrieval/graph/graph-builtin-3d-engine.js +1 -1
- package/dist/components/retrieval/graph/graph-curvature.js +1 -0
- package/dist/components/retrieval/graph/graph-engine-columns.js +1 -1
- package/dist/components/retrieval/graph/graph-model.d.ts +4 -0
- package/dist/components/retrieval/graph/graph-node-renderer.d.ts +13 -0
- package/dist/components/retrieval/graph/graph-node-renderer.js +1 -0
- package/dist/components/retrieval/graph/graph-source-controller.js +1 -1
- package/dist/components/retrieval/graph/graph-spatial-controller.js +3 -1
- package/dist/components/retrieval/graph/graph-spatial.js +1 -1
- package/dist/components/retrieval/graph/graph-webgl-engine.js +1 -1
- package/dist/components/retrieval/graph/graph.class.d.ts +11 -3
- package/dist/components/retrieval/graph/graph.class.js +4 -4
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +8 -2
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +4 -2
- package/dist/events.d.ts +41 -1
- package/dist/framework-types.d.ts +1 -1
- package/dist/internal/collection-policy.js +1 -0
- package/dist/internal/collection-snapshot.js +1 -1
- package/dist/internal/default-strings/media.generated.js +1 -1
- package/dist/internal/default-strings/retrieval.generated.js +1 -1
- package/dist/internal/engine-3d-loader.d.ts +8 -2
- package/dist/internal/engine-3d-loader.js +1 -1
- package/dist/internal/form-control.styles.js +1 -1
- package/dist/internal/locale-loaders.generated.js +1 -1
- package/dist/internal/localization-runtime.js +1 -1
- package/dist/internal/localization-types.d.ts +1 -1
- package/dist/internal/localization.js +1 -1
- package/dist/internal/map-camera-follow-controller.d.ts +9 -0
- package/dist/internal/map-camera-follow-controller.js +1 -0
- package/dist/internal/map-camera-follow-data.js +1 -0
- package/dist/internal/map-camera-follow-scene.js +1 -0
- package/dist/internal/map-camera-session-controller.d.ts +59 -0
- package/dist/internal/map-camera-session-controller.js +1 -0
- package/dist/internal/map-camera-session-data.d.ts +16 -0
- package/dist/internal/map-camera-session-data.js +1 -0
- package/dist/internal/map-camera-session.js +1 -0
- package/dist/internal/map-scene-session.js +1 -0
- package/dist/internal/media-panorama.d.ts +5 -0
- package/dist/internal/media-panorama.js +8 -0
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/sequence-playback-binding.js +1 -0
- package/dist/internal/typed-columns.d.ts +3 -1
- package/dist/internal/typed-columns.js +1 -1
- package/dist/internal/variants.d.ts +7 -0
- package/dist/internal/widget-default-registry.js +1 -0
- package/dist/internal/widget-document.d.ts +29 -0
- package/dist/internal/widget-document.js +1 -0
- package/dist/internal/widget-type-registry.d.ts +27 -0
- package/dist/internal/widget-type-registry.js +1 -0
- package/dist/lyra.d.ts +1 -1
- package/dist/lyra.js +1 -1
- package/dist/map-camera-session.d.ts +10 -0
- package/dist/map-camera-session.js +1 -0
- package/dist/sequence-time-binding.d.ts +3 -0
- package/dist/sequence-time-binding.js +1 -0
- package/dist/simulation-clock.d.ts +3 -0
- package/dist/simulation-clock.js +1 -0
- package/dist/time-index.d.ts +3 -0
- package/dist/time-index.js +1 -0
- package/llms/components/lr-artifact-panel.md +8 -3
- package/llms/components/lr-combobox.md +2 -0
- package/llms/components/lr-country-picker.md +2 -0
- package/llms/components/lr-currency-picker.md +2 -0
- package/llms/components/lr-date-picker.md +2 -0
- package/llms/components/lr-dock-panel.md +5 -2
- package/llms/components/lr-graph.md +121 -3
- package/llms/components/lr-input.md +2 -0
- package/llms/components/lr-knowledge-graph-explorer.md +6 -1
- package/llms/components/lr-locale-picker.md +8 -1
- package/llms/components/lr-map.md +365 -13
- package/llms/components/lr-markdown-core.md +2 -1
- package/llms/components/lr-markdown.md +12 -1
- package/llms/components/lr-menu.md +5 -2
- package/llms/components/lr-model-select.md +2 -0
- package/llms/components/lr-multi-split.md +53 -4
- package/llms/components/lr-native-time-input.md +2 -0
- package/llms/components/lr-number-input.md +2 -0
- package/llms/components/lr-page.md +9 -1
- package/llms/components/lr-phone-input.md +2 -0
- package/llms/components/lr-select.md +2 -0
- package/llms/components/lr-sequence-playback.md +44 -0
- package/llms/components/lr-streaming-text-core.md +3 -2
- package/llms/components/lr-streaming-text.md +4 -1
- package/llms/components/lr-suggestion-chips.md +6 -2
- package/llms/components/lr-textarea.md +2 -0
- package/llms/components/lr-time-input.md +2 -0
- package/llms/components/lr-time-zone-picker.md +2 -0
- package/llms/components/lr-token-input.md +2 -0
- package/llms/components/lr-unit-picker.md +2 -0
- package/llms/components/lr-voice-picker.md +2 -0
- package/llms/peers.md +7 -7
- package/llms/shared/imports-and-registration.md +1 -1
- package/llms/shared/localization-and-rtl.md +15 -1
- package/llms/shared/testing-and-utilities.md +184 -0
- package/llms/shared.md +200 -2
- package/locales.json +1 -1
- package/package.json +39 -23
- package/registrations.json +1 -1
- package/skills/lyra-ui/lyra-gen.md +18 -0
- /package/dist/{components/media/image-viewer/image-viewer-panorama.styles.js → internal/media-panorama.styles.js} +0 -0
package/llms/shared.md
CHANGED
|
@@ -182,7 +182,7 @@ The entry points, then:
|
|
|
182
182
|
`@aceshooting/lyra-ui/localization.js` (side-effect-free locale runtime),
|
|
183
183
|
`@aceshooting/lyra-ui/autoloader.js` (side-effect-free on-demand tag loading),
|
|
184
184
|
`@aceshooting/lyra-ui/autoloader-cdn.js` (browser-guarded auto-start side effect),
|
|
185
|
-
`@aceshooting/lyra-translations/<locale>.js` (the
|
|
185
|
+
`@aceshooting/lyra-translations/<locale>.js` (the eighty message catalogs, in the companion package),
|
|
186
186
|
`@aceshooting/lyra-ui/events` (the global typed-event map — types only, no runtime),
|
|
187
187
|
`@aceshooting/lyra-ui/ai` (provider-neutral data types), `@aceshooting/lyra-ui/testing`
|
|
188
188
|
(happy-dom shims, `createLyraEvent()` for building a validated test event, a small set of
|
|
@@ -2536,6 +2536,9 @@ transport. The helper neither reloads the page nor changes module URLs to bypass
|
|
|
2536
2536
|
category selection walks the same chain, so the two can never disagree:
|
|
2537
2537
|
|
|
2538
2538
|
1. **The BCP-47 truncation walk, most specific first**, with any explicitly registered delta parent chain inserted immediately after its child — `zh-Hans-CN` → `zh-Hans` → `zh`.
|
|
2539
|
+
A tag without a script subtag whose CLDR likely script differs from its bare language's walks
|
|
2540
|
+
that implied script just before the bare language: `sr-ME` (likely `sr-Latn-ME`) →
|
|
2541
|
+
`sr-Latn` → `sr`, while `sr-RS` (likely Cyrillic, like bare `sr`) goes straight to `sr`.
|
|
2539
2542
|
Casing and `_` separators are normalized, so `pt_BR` and `pt-br` are the same key. Lookup chains
|
|
2540
2543
|
are memoized and capped at 64 candidates. A structurally valid tag beyond the normal complexity
|
|
2541
2544
|
ceiling retains its exact tag, base language and English fallback without constructing an
|
|
@@ -2627,7 +2630,7 @@ silently defeats a registered catalog — omit it, or pass `undefined`.
|
|
|
2627
2630
|
|
|
2628
2631
|
### Ready-made catalogs: `@aceshooting/lyra-translations/<locale>.js`
|
|
2629
2632
|
|
|
2630
|
-
|
|
2633
|
+
Eighty catalogs ship in the companion package `@aceshooting/lyra-translations` (`pnpm add @aceshooting/lyra-translations`, same version as `@aceshooting/lyra-ui`), each covering every key in `LYRA_DEFAULT_STRINGS`.
|
|
2631
2634
|
The public `@aceshooting/lyra-ui/locales.json` manifest lists their canonical identities, authored
|
|
2632
2635
|
source spellings, import paths, and structural coverage. It also distinguishes translation
|
|
2633
2636
|
coverage from linguistic review tier. The catalogs are **side-effect-only modules**: import one
|
|
@@ -2649,6 +2652,8 @@ import "@aceshooting/lyra-translations/ro.js"; // Romanian
|
|
|
2649
2652
|
import "@aceshooting/lyra-translations/zh-CN.js"; // Simplified: serves zh, zh-Hans, zh-SG and zh-Hans-CN
|
|
2650
2653
|
import "@aceshooting/lyra-translations/zh-TW.js"; // Traditional: serves zh-Hant and zh-MO
|
|
2651
2654
|
import "@aceshooting/lyra-translations/zh-HK.js"; // Hong Kong: differences over zh-TW
|
|
2655
|
+
import "@aceshooting/lyra-translations/sr.js"; // Serbian Cyrillic: serves sr, sr-Cyrl, sr-RS, sr-BA
|
|
2656
|
+
import "@aceshooting/lyra-translations/sr-Latn.js"; // Serbian Latin: serves sr-Latn, sr-Latn-RS, sr-ME
|
|
2652
2657
|
```
|
|
2653
2658
|
|
|
2654
2659
|
Persian and Hebrew use CLDR plural categories (`fa`: `one`/`other`; `he`:
|
|
@@ -2669,6 +2674,15 @@ they register only the messages that differ and resolve every other message thro
|
|
|
2669
2674
|
(`de`, the built-in English, `es`, `fr`, `zh-TW`), and importing one also imports its parent catalog (`en-GB` has none: English is built in).
|
|
2670
2675
|
The four regional additions are AI-assisted translations; no human or native-speaker review is claimed.
|
|
2671
2676
|
|
|
2677
|
+
Serbian ships in both scripts as two complete catalogs: `sr` (Cyrillic, the CLDR default for bare
|
|
2678
|
+
`sr`) and `sr-Latn` (Latin). Script decides, not region: `sr-Latn-*` tags and script-less tags whose
|
|
2679
|
+
likely script is Latin (`sr-ME`) reach `sr-Latn`; `sr-Cyrl-*`, `sr-RS`, `sr-BA` and `sr-XK` reach
|
|
2680
|
+
`sr`. The `sk`, `bg`, `lt`, `lv`, `et`, `ca`, `ga`, `mt`, `sr` and `sr-Latn` catalogs are
|
|
2681
|
+
AI-assisted translations with structural verification only (keys, placeholders, ICU syntax and CLDR
|
|
2682
|
+
plural categories); they await native-speaker review, and no human or native-speaker review is
|
|
2683
|
+
claimed. Regional tags such as `ca-ES-valencia`, `ga-IE` and `mt-MT` reach their base catalog by
|
|
2684
|
+
truncation.
|
|
2685
|
+
|
|
2672
2686
|
Import only the locales the application can actually offer — each is a separate module, so unimported
|
|
2673
2687
|
ones cost nothing. A catalog registered this way is merged like any other, so a later
|
|
2674
2688
|
`registerLyraLocale('de', { close: '…' })` still overrides individual keys, and a per-instance
|
|
@@ -4063,6 +4077,190 @@ so a bundler drops the unused catalog; an unbundled graph that imports it still
|
|
|
4063
4077
|
- `formResetCallback()` restores the _content attribute_ default, so `el.value = 'x'` never redefines
|
|
4064
4078
|
what `form.reset()` restores to (native `defaultValue`/`defaultSelected` semantics).
|
|
4065
4079
|
|
|
4080
|
+
### Shared simulation clock and irregular time indices
|
|
4081
|
+
|
|
4082
|
+
These granular modules are registration-free and require no map or 3D engine:
|
|
4083
|
+
|
|
4084
|
+
- `@aceshooting/lyra-ui/simulation-clock.js`: `createSimulationClock(options, capabilities?)`,
|
|
4085
|
+
`SimulationClockError`; types `SimulationClock`, `SimulationClockOptions`,
|
|
4086
|
+
`SimulationClockCapabilities`, `ClockScheduler`, `ClockSnapshot`, `SimulationClockMode`,
|
|
4087
|
+
`SimulationClockReason`, `SimulationClockErrorCode`.
|
|
4088
|
+
- `@aceshooting/lyra-ui/time-index.js`: `createTimeIndex(timestamps)`, `TimeIndexError`;
|
|
4089
|
+
types `TimeIndex`, `TimeLocation`, `TimeIndexErrorCode`.
|
|
4090
|
+
- `@aceshooting/lyra-ui/sequence-time-binding.js`: `bindSequencePlayback(control, clock, index,
|
|
4091
|
+
options?)`, `SequenceTimeBindingError`; types `SequenceTimeBindingOptions`,
|
|
4092
|
+
`SequenceTimeBindingErrorCode`. Register the sequence control separately.
|
|
4093
|
+
- `@aceshooting/lyra-ui/map-camera-session.js`: `createMapCameraSession(map, options?)`,
|
|
4094
|
+
`MapCameraSessionError`; saved viewpoints, tours sampled from a shared clock and scene-object
|
|
4095
|
+
following for a ready `lr-map`. Register the map separately.
|
|
4096
|
+
|
|
4097
|
+
#### Clock contract
|
|
4098
|
+
|
|
4099
|
+
`SimulationClockOptions` has readonly `range: readonly [number, number]`, `instant: number` and
|
|
4100
|
+
optional `rate: number` (default 1). Numbers are epoch milliseconds within ±8.64e15; fractional
|
|
4101
|
+
milliseconds are allowed. Range start must not exceed end. Instants clamp to range; rates must be
|
|
4102
|
+
finite and positive, without a fixed maximum. Plain records and tuples reject accessors/invalid
|
|
4103
|
+
structure. Optional second-argument `SimulationClockCapabilities` carries the deliberately trusted
|
|
4104
|
+
`scheduler?: ClockScheduler` and `onSubscriberError?: (error: unknown) => void` callbacks separately
|
|
4105
|
+
from plain data. Scheduler methods are `monotonicNow(): number`, `epochNow(): number`,
|
|
4106
|
+
`requestFrame(callback: () => void): unknown`, `cancelFrame(handle: unknown): void`.
|
|
4107
|
+
|
|
4108
|
+
`clock.snapshot` is immutable `ClockSnapshot { instant, range, mode, playing, rate, revision, reason }`.
|
|
4109
|
+
`mode` is `'replay' | 'live'`. `reason` is
|
|
4110
|
+
`'initial' | 'tick' | 'seek' | 'play' | 'pause' | 'rate' | 'range' | 'mode' | 'live'`.
|
|
4111
|
+
`currentInstant()` samples current time without notification. `play()`, `pause()`, `seek(instant)`,
|
|
4112
|
+
`stepTo(instant)`, `setRate(rate)`, `setRange(range)`, `setMode(mode)` update shared state.
|
|
4113
|
+
Seek pauses and enters replay; stepTo preserves replay playing unless clamped at end, and leaves
|
|
4114
|
+
live for paused replay. Play from live starts replay at current live instant; play at end does not
|
|
4115
|
+
rewind. Pause from live freezes replay. Selecting an already-current mode does nothing. No looping
|
|
4116
|
+
or reverse playback is implied. Live follows clamped wall time, including wall-clock corrections;
|
|
4117
|
+
rate affects replay only. Applications own rolling ranges and incoming data.
|
|
4118
|
+
|
|
4119
|
+
`subscribe(listener, { signal? })` immediately supplies caught-up state and returns an idempotent
|
|
4120
|
+
release function. Each registration is independent, including repeated use of one callback.
|
|
4121
|
+
Reentrant writes coalesce into one later desired-state delivery. Listener errors are isolated.
|
|
4122
|
+
Every subscriber in a fan-out sees the same instant/revision, not a promise of simultaneous paint.
|
|
4123
|
+
Use revision checks before committing asynchronous map/chart work. Time zones/locales belong to
|
|
4124
|
+
`Intl.DateTimeFormat` presentation and never change the shared instant.
|
|
4125
|
+
|
|
4126
|
+
Replay derives from a monotonic anchor rather than counting frames. Hidden/background documents
|
|
4127
|
+
skip intermediate frames and catch up; they do not pause analytical replay or burst old updates.
|
|
4128
|
+
No subscribers means no delivery scheduling, while replay still advances analytically. Import,
|
|
4129
|
+
construction and paused use are SSR-safe and side-effect free; replay/live needs a usable injected
|
|
4130
|
+
time source in SSR even without subscribers. Browser delivery uses one owner-realm animation-frame
|
|
4131
|
+
chain. `dispose()` cancels jobs, clears subscribers and silently releases bindings. It is idempotent;
|
|
4132
|
+
final getters remain readable, while later mutation/subscribe throws `disposed`.
|
|
4133
|
+
|
|
4134
|
+
`SimulationClockError(code, message?)` exposes readonly `code`:
|
|
4135
|
+
`'invalid-options' | 'invalid-instant' | 'invalid-range' | 'invalid-rate' |
|
|
4136
|
+
'invalid-capabilities' | 'invalid-listener' | 'disposed'`. Failures leave rejected commands
|
|
4137
|
+
unpublished. Developer diagnostics are not localized product copy; applications localize by code.
|
|
4138
|
+
|
|
4139
|
+
#### Time index contract
|
|
4140
|
+
|
|
4141
|
+
`createTimeIndex` snapshots and freezes at most 10,000 strictly increasing timestamps. Empty and
|
|
4142
|
+
singleton inputs are legal. Duplicate, descending, sparse, accessor, nonfinite and out-of-Date-range
|
|
4143
|
+
values fail rather than sorting, truncating or reindexing. `TimeIndex` exposes readonly
|
|
4144
|
+
`timestamps`, `length`, `instantAt(index): number`, and `locate(instant): TimeLocation | undefined`.
|
|
4145
|
+
`TimeLocation` has readonly `lowerIndex`, `upperIndex`, `nearestIndex`, `fraction`; exact samples
|
|
4146
|
+
have equal indices/fraction zero, endpoint queries clamp, nearest ties choose lower. Empty indices
|
|
4147
|
+
return undefined. Consumers explicitly select hold/nearest/linear interpretation; the utility never
|
|
4148
|
+
interpolates application records, geographic wrapping, categories or physical trajectories.
|
|
4149
|
+
`TimeIndexError(code, message?)` codes are
|
|
4150
|
+
`'invalid-timestamps' | 'invalid-instant' | 'invalid-index'`.
|
|
4151
|
+
|
|
4152
|
+
Binding signature: `bindSequencePlayback(control: HTMLElement, clock: SimulationClock,
|
|
4153
|
+
index: TimeIndex, options?: SequenceTimeBindingOptions): () => void`; options has readonly
|
|
4154
|
+
`signal?: AbortSignal`. Clock/index must come from these factories in the same package module graph.
|
|
4155
|
+
`SequenceTimeBindingError(code, message?)` codes are `'unsupported-control' | 'inactive-control' |
|
|
4156
|
+
'already-bound' | 'invalid-clock' | 'invalid-index' | 'invalid-options'`. A disposed clock raises
|
|
4157
|
+
`SimulationClockError('disposed')`. Abort signals are trusted lifecycle capabilities; a preaborted
|
|
4158
|
+
signal performs no attachment. Releasing never pauses other consumers.
|
|
4159
|
+
|
|
4160
|
+
- **`simulation-clock-contracts`** — Shared replay and live time.
|
|
4161
|
+
Import: `@aceshooting/lyra-ui/simulation-clock.js`.
|
|
4162
|
+
`createSimulationClock(options: SimulationClockOptions, capabilities?: SimulationClockCapabilities): SimulationClock`
|
|
4163
|
+
`SimulationClockOptions {
|
|
4164
|
+
readonly range: readonly [number, number];
|
|
4165
|
+
readonly instant: number;
|
|
4166
|
+
readonly rate?: number;
|
|
4167
|
+
}`
|
|
4168
|
+
`ClockScheduler {
|
|
4169
|
+
monotonicNow(): number;
|
|
4170
|
+
epochNow(): number;
|
|
4171
|
+
requestFrame(callback: () => void): unknown;
|
|
4172
|
+
cancelFrame(handle: unknown): void;
|
|
4173
|
+
}`
|
|
4174
|
+
`SimulationClockCapabilities {
|
|
4175
|
+
readonly scheduler?: ClockScheduler;
|
|
4176
|
+
readonly onSubscriberError?: (error: unknown) => void;
|
|
4177
|
+
}`
|
|
4178
|
+
`ClockSnapshot {
|
|
4179
|
+
readonly instant: number;
|
|
4180
|
+
readonly range: readonly [number, number];
|
|
4181
|
+
readonly mode: SimulationClockMode;
|
|
4182
|
+
readonly playing: boolean;
|
|
4183
|
+
readonly rate: number;
|
|
4184
|
+
readonly revision: number;
|
|
4185
|
+
readonly reason: SimulationClockReason;
|
|
4186
|
+
}`
|
|
4187
|
+
`SimulationClock {
|
|
4188
|
+
readonly snapshot: ClockSnapshot;
|
|
4189
|
+
currentInstant(): number;
|
|
4190
|
+
seek(instant: number): void;
|
|
4191
|
+
stepTo(instant: number): void;
|
|
4192
|
+
play(): void;
|
|
4193
|
+
pause(): void;
|
|
4194
|
+
setRate(rate: number): void;
|
|
4195
|
+
setRange(range: readonly [number, number]): void;
|
|
4196
|
+
setMode(mode: SimulationClockMode): void;
|
|
4197
|
+
subscribe(listener: (snapshot: ClockSnapshot) => void, options?: { readonly signal?: AbortSignal }): () => void;
|
|
4198
|
+
dispose(): void;
|
|
4199
|
+
}`
|
|
4200
|
+
|
|
4201
|
+
- **`time-index-contracts`** — Immutable irregular timestamp indices.
|
|
4202
|
+
Import: `@aceshooting/lyra-ui/time-index.js`.
|
|
4203
|
+
`createTimeIndex(timestamps: readonly number[]): TimeIndex`
|
|
4204
|
+
`TimeLocation {
|
|
4205
|
+
readonly lowerIndex: number;
|
|
4206
|
+
readonly upperIndex: number;
|
|
4207
|
+
readonly nearestIndex: number;
|
|
4208
|
+
readonly fraction: number;
|
|
4209
|
+
}`
|
|
4210
|
+
`TimeIndex {
|
|
4211
|
+
readonly timestamps: readonly number[];
|
|
4212
|
+
readonly length: number;
|
|
4213
|
+
locate(instant: number): TimeLocation | undefined;
|
|
4214
|
+
instantAt(index: number): number;
|
|
4215
|
+
}`
|
|
4216
|
+
|
|
4217
|
+
- **`sequence-time-binding-contracts`** — Shared time binding for a registered sequence control.
|
|
4218
|
+
Import: `@aceshooting/lyra-ui/sequence-time-binding.js`.
|
|
4219
|
+
`bindSequencePlayback(control: HTMLElement, clock: SimulationClock, index: TimeIndex, options?: SequenceTimeBindingOptions): () => void`
|
|
4220
|
+
`SequenceTimeBindingOptions { readonly signal?: AbortSignal; }`
|
|
4221
|
+
|
|
4222
|
+
- **`map-camera-session-contracts`** — Saved viewpoints, clock-driven tours and object following
|
|
4223
|
+
for a ready `lr-map`; see the `lr-map` camera sessions section of the media reference.
|
|
4224
|
+
Import: `@aceshooting/lyra-ui/map-camera-session.js`.
|
|
4225
|
+
`createMapCameraSession(map: HTMLElement, options?: MapCameraSessionOptions): MapCameraSession`
|
|
4226
|
+
`MapCameraSessionOptions { readonly signal?: AbortSignal; }`
|
|
4227
|
+
`MapViewpoint {
|
|
4228
|
+
readonly center: readonly [number, number];
|
|
4229
|
+
readonly zoom: number;
|
|
4230
|
+
readonly bearing: number;
|
|
4231
|
+
readonly pitch: number;
|
|
4232
|
+
}`
|
|
4233
|
+
`MapCameraTransition {
|
|
4234
|
+
readonly kind?: 'jump' | 'ease' | 'fly';
|
|
4235
|
+
readonly duration?: number;
|
|
4236
|
+
}`
|
|
4237
|
+
`MapCameraKeyframe {
|
|
4238
|
+
readonly instant: number;
|
|
4239
|
+
readonly view: MapViewpoint;
|
|
4240
|
+
readonly interpolation?: 'linear' | 'hold';
|
|
4241
|
+
}`
|
|
4242
|
+
`MapCameraTour { readonly keyframes: readonly MapCameraKeyframe[]; }`
|
|
4243
|
+
`MapCameraFollowOptions {
|
|
4244
|
+
readonly objectId: string;
|
|
4245
|
+
readonly mode: 'ground';
|
|
4246
|
+
readonly zoom?: number;
|
|
4247
|
+
readonly bearing?: number;
|
|
4248
|
+
readonly pitch?: number;
|
|
4249
|
+
}`
|
|
4250
|
+
`MapCameraSession {
|
|
4251
|
+
readonly snapshot: MapCameraSessionSnapshot;
|
|
4252
|
+
capture(): MapViewpoint;
|
|
4253
|
+
restore(viewpoint: MapViewpoint, transition?: MapCameraTransition): void;
|
|
4254
|
+
tour(clock: SimulationClock, tour: MapCameraTour): void;
|
|
4255
|
+
follow(options: MapCameraFollowOptions): void;
|
|
4256
|
+
stop(): void;
|
|
4257
|
+
subscribe(listener: (snapshot: MapCameraSessionSnapshot) => void, options?: MapCameraSessionOptions): () => void;
|
|
4258
|
+
dispose(): void;
|
|
4259
|
+
}`
|
|
4260
|
+
`MapCameraSessionError(code)` exposes `code: MapCameraSessionErrorCode`. Snapshot, reason, mode
|
|
4261
|
+
and tracking types are `MapCameraSessionSnapshot`, `MapCameraSessionReason`, `MapCameraSessionMode`,
|
|
4262
|
+
`MapCameraTrackingStatus` and `MapCameraTrackingIssue`.
|
|
4263
|
+
|
|
4066
4264
|
## Reference artifacts
|
|
4067
4265
|
|
|
4068
4266
|
The package includes authored family and shared references plus derived index, component, token,
|