@aceshooting/lyra-ui 30.5.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 +78 -0
- package/README.md +1 -1
- 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 +7 -3
- 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 +60 -12
- package/dist/components/media/map/map.class.js +23 -6
- 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 +36 -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 +315 -7
- 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 +37 -21
- package/registrations.json +1 -1
- package/skills/lyra-ui/lyra-gen.md +2 -0
- /package/dist/{components/media/image-viewer/image-viewer-panorama.styles.js → internal/media-panorama.styles.js} +0 -0
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
## `lr-currency-picker`
|
|
18
18
|
|
|
19
|
+
Attribute `label-display` (`'visible'` default, or `'hidden'`) removes the label visually while it stays the accessible name; hint and error are unaffected (see "Hiding the label visually: `label-display`").
|
|
20
|
+
|
|
19
21
|
A form-associated, single-currency selector with a compact ISO-code trigger and localized currency
|
|
20
22
|
names and symbols in its options. It composes `lr-select` (or `lr-combobox` when searchable) and `lr-option`; no additional popover,
|
|
21
23
|
currency-name table or optional peer is needed. Selection changes the field value only: exchange
|
|
@@ -209,6 +209,8 @@ day-cell/grid-column size; its private default follows the `size` tier — `2xs`
|
|
|
209
209
|
|
|
210
210
|
### `lr-date-input`
|
|
211
211
|
|
|
212
|
+
`labelDisplay: 'visible' | 'hidden' = 'visible'` (attribute `label-display`) — `'hidden'` removes the label visually while it stays the accessible name; hint and error are unaffected (see "Hiding the label visually: `label-display`" in the shared forms notes).
|
|
213
|
+
|
|
212
214
|
Text field + calendar popover, **form-associated** via the shared `FormAssociated` mixin (`name`,
|
|
213
215
|
`value`, `disabled`, `required` all inherited).
|
|
214
216
|
|
|
@@ -105,8 +105,11 @@ exact same colors as before: `--lr-dock-panel-collapse-toggle-hover-bg` (default
|
|
|
105
105
|
`color-mix()` (background) for its pressed state; `--lr-dock-panel-handle-hover-color` (default
|
|
106
106
|
`var(--lr-color-brand)`) themes the handle's hover/keyboard-focus state, and
|
|
107
107
|
`--lr-dock-panel-handle-active-color` (default a `color-mix()` of the hover color) themes it while
|
|
108
|
-
being dragged. `--lr-dock-panel-handle-hit-area`
|
|
109
|
-
`var(--lr-space-m)
|
|
108
|
+
being dragged. `--lr-dock-panel-handle-hit-area` sets the resize target width along the inner edge (default
|
|
109
|
+
`var(--lr-space-m)`). The target sits inside the panel's clipped edge, over its content, so precise
|
|
110
|
+
pointers get exactly that width and content beside the edge stays clickable; set it to the visible
|
|
111
|
+
line (for example `3px`) to give the content every pixel. Coarse or hover-less pointers get at
|
|
112
|
+
least `--lr-icon-button-size`. Plus shared tokens `--lr-color-surface`, `--lr-color-border`,
|
|
110
113
|
`--lr-color-border-subtle`, `--lr-color-brand`, `--lr-color-brand-quiet`, `--lr-color-text`,
|
|
111
114
|
`--lr-radius`, `--lr-space-xs`, `--lr-focus-ring-width/-color/-offset`, `--lr-transition-fast`,
|
|
112
115
|
`--lr-icon-button-size`.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [retrieval](https://github.com/aceshooting/lyra-ui/blob/main/packages/lyra-ui/llms/retrieval.md)
|
|
10
10
|
- **Deprecations** none
|
|
11
11
|
- **Optional peers** `@aceshooting/lyra-3d`, `d3-drag`, `d3-force`, `d3-selection`, `d3-zoom` — see `llms/peers.md`
|
|
12
|
-
- **Themeable via**
|
|
12
|
+
- **Themeable via** 35 parts, 17 custom properties — see this component's own `@csspart`/`@cssprop` list below
|
|
13
13
|
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`
|
|
14
14
|
|
|
15
15
|
---
|
|
@@ -23,9 +23,50 @@ back to built-in spatial rendering and then the paginated list. Localized feedba
|
|
|
23
23
|
`lr-engine-fallback` with `{ from, to, reason }`; reasons are `'unavailable'`, `'unsupported'`,
|
|
24
24
|
`'context-lost'` or `'error'`.
|
|
25
25
|
|
|
26
|
+
**Custom 3D bodies:** `nodeRenderer: LyraGraphNodeRenderer | null | undefined = undefined`
|
|
27
|
+
(property only) supplies a synchronous mesh callback for local `view="3d" engine="webgl"` scenes.
|
|
28
|
+
`LyraGraphNodeRenderContext` contains frozen `{ id, index, node? }`; `index` is the filtered render
|
|
29
|
+
row, and `node` is present for record inputs. Typed columns supply identity/index without record
|
|
30
|
+
materialization. Return `null`/`undefined` for the standard body, or `LyraGraphNodeMesh` with
|
|
31
|
+
non-indexed Float32Array `positions` (9 values per triangle), `normals` (one outward unit XYZ
|
|
32
|
+
normal per triangle), and optional sRGB RGBA `color` in [0,1]. Vertices fit the unit sphere;
|
|
33
|
+
triangles have consistent outward winding and nonzero area. Geometry uses the graph's world axes,
|
|
34
|
+
scaled by the existing node radius, with flat face lighting. The optional color inherits the
|
|
35
|
+
resolved node fill when omitted. The **Custom spatial nodes** story shows a tetrahedron.
|
|
36
|
+
|
|
37
|
+
Geometry is copied without changing caller buffers. Limits are 64 triangles per custom node,
|
|
38
|
+
16,384 custom rows and 65,536 triangles per scene, with a 4 MiB per-owner mesh payload ceiling.
|
|
39
|
+
Mixed-scene storage preflight can refuse a smaller scene when combined staging/sorting costs
|
|
40
|
+
exceed its bounds. The callback runs in cancellable scheduled slices; each callback itself is
|
|
41
|
+
trusted synchronous application code. Promise results, accessors, shared/resizable buffers and
|
|
42
|
+
invalid geometry are refused. Assign a new callback identity to refresh captured application data;
|
|
43
|
+
hover, selection, theme and camera changes preserve the admitted geometry. Reset with `null` or
|
|
44
|
+
`undefined`. Source-provider, builtin, 2D and list branches retain standard nodes and show a
|
|
45
|
+
localized availability notice without invoking the callback. Keyboard/list identities and labels
|
|
46
|
+
remain available. Custom bodies use exact triangle picks with their original node id; their
|
|
47
|
+
irregular silhouette has no ordinary circular hit padding. Authored alpha zero removes body picks;
|
|
48
|
+
positive-alpha bodies remain pickable when dimmed to zero. Forced colors uses accessible paint.
|
|
49
|
+
|
|
50
|
+
A rejected batch keeps standard nodes and emits noncancelable `lr-node-render-error` with
|
|
51
|
+
`LyraGraphNodeRenderErrorDetail { reason: 'callback' | 'invalid' | 'budget'; nodeId?: string }` once
|
|
52
|
+
for that callback/model generation. Exceptions are represented by localized text. The visible
|
|
53
|
+
`custom-node-notice` part reports refusal or availability. Renderer failures retain the existing
|
|
54
|
+
`lr-engine-fallback` chain.
|
|
55
|
+
|
|
56
|
+
**Optional halo:** `glow: boolean = false` (reflected attribute `glow`) enables static WebGL
|
|
57
|
+
postprocessing. It follows the same explicit 3D/WebGL preference and adds no request or render
|
|
58
|
+
target while unset. It leaves picks and the component's separate label canvas unchanged. The
|
|
59
|
+
**Spatial glow** story provides an on/off control. Enabled glow adds two offscreen blur passes
|
|
60
|
+
and a scene capture; it has an 8 CSS-pixel radius and 0.6 strength. Half-resolution attachments
|
|
61
|
+
have at most 1,048,576 pixels each and a 16 MiB combined color/depth storage estimate, excluding
|
|
62
|
+
driver overhead; resizing can temporarily retain two sets. Forced colors suppresses it; reduced
|
|
63
|
+
motion keeps a static halo. Builtin/list alternatives show a localized `glow-notice`. Genuine
|
|
64
|
+
current effect failures enter the existing renderer fallback chain.
|
|
65
|
+
|
|
26
66
|
`graphColumns: LyraGraphColumns | undefined` (property only) replaces local arrays in 3D/list;
|
|
27
67
|
`graphSource` remains authoritative. Columns support 200,000 nodes and 1,000,000 edges.
|
|
28
68
|
Required `ids` supplies string node IDs; optional Float32Array columns are `x`, `y`, `z`, `size`;
|
|
69
|
+
optional `edgeCurvature` is a Float32Array with one signed curvature per source edge, before filtering.
|
|
29
70
|
optional Uint16Array columns are `category`, `edgeCategory`. Required Uint32Array `source` and
|
|
30
71
|
`target` contain node indices. Optional `categories`/`labels` are string arrays. Validation
|
|
31
72
|
checks lengths, coordinates and indices; coordinates are bounded to ±10,000,000 graph units.
|
|
@@ -83,6 +124,80 @@ frontmost picking. Adaptive edge subdivision approximates crossings; this is not
|
|
|
83
124
|
a guarantee of perfect translucent intersections. Use modest graphs, typically low hundreds;
|
|
84
125
|
the 2D canvas capacity claim below does not apply to 3D.
|
|
85
126
|
|
|
127
|
+
`LyraGraphEdge.curvature?: number` bends ordinary 3D edges along a quadratic curve. Its signed
|
|
128
|
+
value is the midpoint deflection divided by endpoint distance, clamped to `[-1, 1]`.
|
|
129
|
+
Unset, non-number and nonfinite local values mean a straight edge. Typed `edgeCurvature` columns
|
|
130
|
+
and provider scenes reject nonfinite values; provider accessors and non-number values are also
|
|
131
|
+
rejected. Finite values clamp without changing caller data. The perpendicular is the endpoint
|
|
132
|
+
direction crossed with the least-aligned world axis (ties X, then Y, then Z);
|
|
133
|
+
reversing endpoints reverses the bend. Camera movement does not change that world orientation.
|
|
134
|
+
Self-loops and dangling stubs keep their existing shape; 2D ignores curvature.
|
|
135
|
+
|
|
136
|
+
Curves use 16 strokes. Labels use the curve midpoint, arrows follow the endpoint tangent, and
|
|
137
|
+
dash patterns continue across segments. Initial fitting and explicit `fit()` include analytic
|
|
138
|
+
curve extrema, which can extend beyond node-coordinate bounds; existing camera limits can still
|
|
139
|
+
prevent full containment. Changing curvature alone does not refit the camera. Typed columns render
|
|
140
|
+
curves with the optional WebGL engine; their fallback remains the paginated list. Local records and
|
|
141
|
+
provider scenes also support curves in the built-in renderer. In the companion, each curved edge
|
|
142
|
+
reserves 16 strokes plus its directed arrow against the existing 2,000,000-primitive ceiling.
|
|
143
|
+
|
|
144
|
+
**DAG preprocessing:** import `@aceshooting/lyra-3d/graph-layout` explicitly to compute a directed
|
|
145
|
+
acyclic graph's positions before assigning them. The helper is independent of the renderer;
|
|
146
|
+
`lr-graph` keeps the supplied positions and its existing 3D, Fit and List controls. There is no
|
|
147
|
+
new layout selector. Keep original node-row order when mapping xyz results back to ids:
|
|
148
|
+
|
|
149
|
+
```ts
|
|
150
|
+
import type { LyraGraph, LyraGraphNode } from '@aceshooting/lyra-ui/components/retrieval/graph/graph.class.js';
|
|
151
|
+
|
|
152
|
+
function createDagUpdates(graph: LyraGraph) {
|
|
153
|
+
let pending: AbortController | undefined;
|
|
154
|
+
let generation = 0;
|
|
155
|
+
let disposed = false;
|
|
156
|
+
return {
|
|
157
|
+
async replace(nodes: readonly LyraGraphNode[], source: Uint32Array, target: Uint32Array) {
|
|
158
|
+
if (disposed) return;
|
|
159
|
+
pending?.abort();
|
|
160
|
+
const controller = new AbortController();
|
|
161
|
+
pending = controller;
|
|
162
|
+
const revision = ++generation;
|
|
163
|
+
const current = () => !disposed && !controller.signal.aborted && revision === generation;
|
|
164
|
+
try {
|
|
165
|
+
const { layoutGraphDagAsync } = await import('@aceshooting/lyra-3d/graph-layout');
|
|
166
|
+
if (!current()) return;
|
|
167
|
+
const result = await layoutGraphDagAsync({ nodeCount: nodes.length, source, target },
|
|
168
|
+
{ direction: 'y', layerGap: 100, nodeGap: 50 }, { signal: controller.signal });
|
|
169
|
+
if (!current()) return;
|
|
170
|
+
graph.nodes = nodes.map((node, row) => ({ ...node, position: {
|
|
171
|
+
x: result.positions[row * 3]!,
|
|
172
|
+
y: result.positions[row * 3 + 1]!,
|
|
173
|
+
z: result.positions[row * 3 + 2]!,
|
|
174
|
+
} }));
|
|
175
|
+
await graph.updateComplete;
|
|
176
|
+
if (current() && graph.isConnected) graph.fit();
|
|
177
|
+
} catch (error) {
|
|
178
|
+
if (current()) throw error;
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
dispose() { disposed = true; generation++; pending?.abort(); },
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Assign matching edge records separately, use `view="3d"`, and call the returned `dispose()` when
|
|
187
|
+
the owning view disconnects. Handle replacement errors with application-localized status while
|
|
188
|
+
retaining the previous graph. Do not mutate endpoint columns while a request is pending. Returned
|
|
189
|
+
positions and ranks are owned buffers; coordinates use Float32 precision. The synchronous helper
|
|
190
|
+
accepts up to 10,000 nodes/100,000 edges; the cancellable asynchronous helper accepts up to
|
|
191
|
+
200,000 nodes/1,000,000 edges through bounded main-thread tasks, not a worker. These are helper
|
|
192
|
+
admission ceilings, not renderer capacity claims.
|
|
193
|
+
|
|
194
|
+
Both helpers reject cycles rather than reversing edges. The six directions are `x`, `-x`, `y`,
|
|
195
|
+
`-y`, `z` and `-z`; default layer/node gaps are 100/50 world units. The helper rejects coordinates
|
|
196
|
+
outside ±10,000,000 world units; local `LyraGraphNode.position` retains its separate ±1,000,000
|
|
197
|
+
limit, so choose gaps and graph depth that fit the target component. The **Retrieval / Graph /
|
|
198
|
+
Directed acyclic layout** story shows axis replacement, cancellation, strict cycle refusal,
|
|
199
|
+
empty-data fallback and signed curvature on parallel directed links.
|
|
200
|
+
|
|
86
201
|
`camera?: LyraGraphCamera` (property only) accepts readonly `{ yaw, pitch, distance, target }`,
|
|
87
202
|
where `target: LyraGraphPosition`, yaw/pitch use radians and distance uses graph units. Without an
|
|
88
203
|
input, the initial spatial scene is fitted. Camera inputs are copied; invalid fields use safe
|
|
@@ -162,7 +277,7 @@ color?: string; shape?: 'circle' | 'square' | 'diamond' }`, one entry per `LyraG
|
|
|
162
277
|
layout even when no matching `nodeTypes` entry exists
|
|
163
278
|
- `edges: LyraGraphEdge[] = []` (attribute: false) — readonly `LyraGraphEdge { id?: string; source: string; target:
|
|
164
279
|
string; width?: number; label?: string; accessibleLabel?: string; description?: string; directed?:
|
|
165
|
-
boolean; color?: string; dash?: number[] }` (source/target are node ids). `directed` adds an
|
|
280
|
+
boolean; color?: string; dash?: number[]; curvature?: number }` (source/target are node ids). `directed` adds an
|
|
166
281
|
arrowhead; `color` and `dash` style the individual stroke; `label` provides a spoken-name and SVG
|
|
167
282
|
tooltip fallback and is drawn as visible edge text only with `withEdgeLabels`; `accessibleLabel` and `description`
|
|
168
283
|
can override the spoken name and tooltip independently. `width` is normalized before reaching
|
|
@@ -278,6 +393,8 @@ coalesced to one event per frame), and `lr-view-change` (`detail: { view: LyraGr
|
|
|
278
393
|
Direct camera and view property assignments are silent.
|
|
279
394
|
With `engine="webgl"`, `lr-engine-fallback` (`detail: { from, to, reason }`, frozen; `reason` is
|
|
280
395
|
`'unavailable'`, `'unsupported'`, `'context-lost'` or `'error'`) reports each step down the fallback chain.
|
|
396
|
+
Also `lr-node-render-error` (`detail: LyraGraphNodeRenderErrorDetail { reason, nodeId? }`) when a custom
|
|
397
|
+
`nodeRenderer` mesh batch is refused; the reason is sanitized and the node keeps its default body.
|
|
281
398
|
|
|
282
399
|
**Slots:** none.
|
|
283
400
|
|
|
@@ -297,7 +414,8 @@ the offscreen keyboard-roving items), `spatial-toolbar` (3D/list view and camera
|
|
|
297
414
|
`spatial-control` (each toolbar or pagination button), `spatial-canvas` (the 3D drawing and camera
|
|
298
415
|
interaction surface), `spatial-instructions` (camera keyboard instructions), `spatial-list` (the
|
|
299
416
|
visible paginated fallback), `spatial-list-item` (each activatable node, edge or community),
|
|
300
|
-
`spatial-page-count` (localized total and page status),
|
|
417
|
+
`spatial-page-count` (localized total and page status), `spatial-pagination` (page controls),
|
|
418
|
+
`custom-node-notice` (custom body availability/refusal), and `glow-notice` (halo availability).
|
|
301
419
|
Source-mode parts: `source-navigator` (global query, record list and pagination), `source-row`
|
|
302
420
|
(a mounted record activation button), `source-row-active` (the navigator's roving tab stop),
|
|
303
421
|
`source-status` (loading, unavailable-record or error text), and `source-coverage` (full-source
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
## `lr-input`
|
|
18
18
|
|
|
19
|
+
Attribute `label-display` (`'visible'` default, or `'hidden'`) removes the label visually while it stays the accessible name; hint and error are unaffected (see "Hiding the label visually: `label-display`").
|
|
20
|
+
|
|
19
21
|
A single-line plain-text input primitive, the `lr-*` equivalent of a plain `wa-input`,
|
|
20
22
|
form-associated via the same `FormAssociated` mixin as `lr-textarea`. Ships the same opt-in
|
|
21
23
|
`label`/`hint`/`errorText` form-control chrome as `lr-textarea`/`lr-select`, and the same
|
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
|
|
19
19
|
`engine: Engine3dPreference = 'builtin'` forwards the renderer preference to the composed graph.
|
|
20
20
|
`engine="webgl"` requests its companion for the 3D view. `lr-engine-fallback` bubbles unchanged
|
|
21
|
-
with `{ from, to, reason }`.
|
|
21
|
+
with `{ from, to, reason }`. `nodeRenderer: LyraGraphNodeRenderer | null | undefined = undefined`
|
|
22
|
+
and `glow: boolean = false` forward the same custom-body and static-halo preferences to the graph;
|
|
23
|
+
`nodeRenderer` is property-only and `glow` reflects its boolean attribute. The graph
|
|
24
|
+
`lr-node-render-error` event bubbles through with its sanitized reason and optional nodeId.
|
|
22
25
|
|
|
23
26
|
Orchestration-level knowledge-graph surface: the `lr-graph` canvas plus entity search, type filters,
|
|
24
27
|
neighborhood expansion, pinned nodes, path finding between pins, node selection, and a details
|
|
@@ -241,6 +244,8 @@ filtered-out id). None change `selectedNodeId` or filters.
|
|
|
241
244
|
`lr-relation-activate` (`detail: { relation, sourceNodeId?, targetNodeId?, occurrenceIndex }`, from `lr-path-strip`).
|
|
242
245
|
- `lr-engine-fallback` (`detail: { from, to, reason }`) — forwarded from the graph when `engine="webgl"`
|
|
243
246
|
steps down the fallback chain.
|
|
247
|
+
- `lr-node-render-error` (`detail: LyraGraphNodeRenderErrorDetail { reason, nodeId? }`) — forwarded from the graph when a
|
|
248
|
+
custom `nodeRenderer` mesh batch is refused; the sanitized reason is `'callback'`, `'invalid'` or `'budget'`.
|
|
244
249
|
|
|
245
250
|
**Slots:** `details` — overrides the details popover's default content (an `lr-entity-card` with a
|
|
246
251
|
nested `lr-neighbor-list` and a pin toggle) entirely, including the two additive slots below.
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
## `lr-locale-picker`
|
|
18
18
|
|
|
19
|
+
`labelDisplay: 'visible' | 'hidden' = 'visible'` (attribute `label-display`) — `'hidden'` removes the label visually while it stays the accessible name; hint and error are unaffected (see "Hiding the label visually: `label-display`" in the shared forms notes).
|
|
20
|
+
|
|
19
21
|
A closed-list locale switcher over the library's own locale registry. First-party invention (no
|
|
20
22
|
Web Awesome equivalent). With `locales` unset (the default), the offered rows are exactly
|
|
21
23
|
`getRegisteredLyraLocales()` — every locale with strings registered via `registerLyraLocale()`,
|
|
@@ -46,7 +48,12 @@ readonly LyraLocaleEntry[]`, `LyraLocaleEntry { tag: string; label?: string; cou
|
|
|
46
48
|
custom labels, or a locale offered before its strings are registered. An entry's `label` overrides
|
|
47
49
|
the derived `localeNativeName(tag)` endonym only when it is non-blank; an explicitly blank (or
|
|
48
50
|
whitespace-only) `label` is treated the same as an omitted one and still falls back to
|
|
49
|
-
`localeNativeName(tag)`.
|
|
51
|
+
`localeNativeName(tag)`. Derived endonyms resolve lazily: a closed picker resolves only the
|
|
52
|
+
locale its trigger shows (nothing when that row has a non-blank `label`), and the other rows
|
|
53
|
+
resolve when the listbox opens, or when closed typeahead or the search filter needs them, then
|
|
54
|
+
stay cached until `locales` or the registry changes. Supplying `{ tag, label }` rows therefore
|
|
55
|
+
keeps `Intl.DisplayNames` out of the closed first render entirely. Names never reorder rows; the
|
|
56
|
+
catalog order is the displayed order. Explicit catalogs are
|
|
50
57
|
capped at the first 512 source entries, cloned and frozen at assignment; mutate a new array/entry
|
|
51
58
|
and reassign it to update the list. The localized `limit` part reports omitted input through
|
|
52
59
|
`localePickerInputLimit`. Closed listboxes contain no option rows after their exit transition;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [media](https://github.com/aceshooting/lyra-ui/blob/main/packages/lyra-ui/llms/media.md)
|
|
10
10
|
- **Deprecations** none
|
|
11
11
|
- **Optional peers** `@aceshooting/lyra-map`, `dompurify`, `maplibre-gl` — see `llms/peers.md`
|
|
12
|
-
- **Themeable via**
|
|
12
|
+
- **Themeable via** 92 parts, 10 custom properties — see this component's own `@csspart`/`@cssprop` list below
|
|
13
13
|
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`
|
|
14
14
|
|
|
15
15
|
---
|
|
@@ -1059,9 +1059,9 @@ intensity?: LyraMapHeatmapZoomValue; opacity?: number }`, where `LyraMapHeatmapZ
|
|
|
1059
1059
|
`LyraMapScaleUnit = 'metric' | 'imperial'`. The element adds the engine's standard controls once
|
|
1060
1060
|
the map exists, moves one whose corner changes, replaces one whose other options change and removes one that
|
|
1061
1061
|
is dropped, so an application no longer imports control classes and calls `map.addControl()`.
|
|
1062
|
-
All
|
|
1062
|
+
All control option objects accept finite `order` numbers, defaulting to `0`. Within each
|
|
1063
1063
|
corner, ascending order controls both visual and keyboard order; ties retain the existing
|
|
1064
|
-
navigation, scale, geolocate, attribution sequence. Changing only order moves existing controls
|
|
1064
|
+
navigation, scale, geolocate, globe, terrain, attribution sequence. Changing only order moves existing controls
|
|
1065
1065
|
without reconstructing them. Invalid order values produce localized configuration feedback.
|
|
1066
1066
|
`true` takes the defaults (navigation `'top-right'`, scale `'bottom-left'` and `'metric'`); an
|
|
1067
1067
|
unknown navigation/scale position or unit falls back to its default. Malformed geolocate or
|
|
@@ -1107,7 +1107,7 @@ intensity?: LyraMapHeatmapZoomValue; opacity?: number }`, where `LyraMapHeatmapZ
|
|
|
1107
1107
|
};
|
|
1108
1108
|
```
|
|
1109
1109
|
|
|
1110
|
-
Within each corner the visual and keyboard order is navigation, scale, geolocate, attribution,
|
|
1110
|
+
Within each corner the visual and keyboard order is navigation, scale, geolocate, globe, terrain, attribution,
|
|
1111
1111
|
including when constructors load in a different order or one fails. A subset keeps that relative
|
|
1112
1112
|
order. Changing only a corner moves the existing controls and retains focused buttons. Corners
|
|
1113
1113
|
continue to follow text direction under RTL. Geolocation is never activated by reconfiguration
|
|
@@ -1436,6 +1436,17 @@ expose no coordinates or native messages; `lr-map-export-error` (frozen
|
|
|
1436
1436
|
Attribution: `lr-map-attribution-toggle` (`LyraMapAttributionToggleDetail { expanded }`) after the owned
|
|
1437
1437
|
attribution control's credits are shown or hidden. None of these events is cancelable; all bubble and
|
|
1438
1438
|
are composed.
|
|
1439
|
+
Scene: `lr-map-projection-change` (frozen `LyraMapProjectionChangeDetail { projection, source:
|
|
1440
|
+
'control' }`) and `lr-map-terrain-change` (frozen `LyraMapTerrainChangeDetail { terrain, source:
|
|
1441
|
+
'control' }`) follow a component-owned globe or terrain control after the property is assigned;
|
|
1442
|
+
programmatic assignments do not emit them, and `whenIdle()` resolves once the change applies.
|
|
1443
|
+
`lr-map-scene-state` (frozen `LyraMapSceneStateDetail { revision, state, code? }`) reports accepted
|
|
1444
|
+
scene status, with rejected updates keeping the previous accepted revision, and
|
|
1445
|
+
`lr-map-scene-activate` (frozen `LyraMapSceneActivateDetail { id, kind, source, position? }`)
|
|
1446
|
+
reports activation of an interactive scene object without moving the camera.
|
|
1447
|
+
Camera: `lr-map-camera-interrupt` (frozen `LyraMapCameraInterruptDetail { reason }`, a
|
|
1448
|
+
`LyraMapCameraInterruptReason`) reports that something other than a `createMapCameraSession()`
|
|
1449
|
+
session ended its viewpoint transition, tour or follow; see the camera sessions section below.
|
|
1439
1450
|
|
|
1440
1451
|
The outer marker-activation detail is frozen, while an opaque marker `unsafeHtml` value remains the
|
|
1441
1452
|
original supplied value at the MapLibre popup and marker-activation boundary. Treat it as trusted
|
|
@@ -1472,14 +1483,27 @@ which only reaches rows projected from `legend`.
|
|
|
1472
1483
|
`geolocate`, `geolocate-control`, `controls`, `controls-top`, `controls-bottom`, `controls-top-left`, `controls-top-right`,
|
|
1473
1484
|
`controls-bottom-left`, `controls-bottom-right`, `zoom-in-icon`, `zoom-out-icon`, `compass-icon`,
|
|
1474
1485
|
`geolocate-icon`, `geolocate-waiting`, `geolocate-active`, `geolocate-background`, `geolocate-error`,
|
|
1486
|
+
`globe-control`, `globe-button`, `globe-icon`, `terrain-control`, `terrain-button`, `terrain-icon`,
|
|
1475
1487
|
`attribution-link`, `attribution-expanded`, `controls-attribution-expanded`,
|
|
1476
|
-
`configuration-error`, `error
|
|
1488
|
+
`configuration-error`, `error`, `scene-panel`, `scene-toggle`, `scene-list`, `scene-item`,
|
|
1489
|
+
`scene-pagination`, `scene-status`.
|
|
1490
|
+
|
|
1491
|
+
| Scene part | Description |
|
|
1492
|
+
| --- | --- |
|
|
1493
|
+
| `scene-panel` | Accessible section containing accepted scene text controls and status. |
|
|
1494
|
+
| `scene-toggle` | Native button that expands or collapses the scene object list. |
|
|
1495
|
+
| `scene-list` | List containing the current page of accepted scene objects. |
|
|
1496
|
+
| `scene-item` | An object's interactive native button or noninteractive text row. |
|
|
1497
|
+
| `scene-pagination` | Previous/next page buttons and localized page summary, present when more than one page exists. |
|
|
1498
|
+
| `scene-status` | Localized accepted-scene or rejected-update status text. |
|
|
1499
|
+
|
|
1477
1500
|
Before native construction, `initialization-placeholder` is the stable surface and
|
|
1478
1501
|
`initialization-skeleton` is its decorative skeleton. `initialization-controls` also exposes `controls`;
|
|
1479
1502
|
its rows expose `controls-top` and `controls-bottom`, and each `initialization-corner` also exposes its
|
|
1480
1503
|
matching corner token. `initialization-control` outlines explicitly requested controls, with
|
|
1481
|
-
`initialization-navigation`, `initialization-scale`, `initialization-geolocate
|
|
1482
|
-
`initialization-attribution` identifying the kind.
|
|
1504
|
+
`initialization-navigation`, `initialization-scale`, `initialization-geolocate`,
|
|
1505
|
+
`initialization-attribution`, `initialization-globe` or `initialization-terrain` identifying the kind.
|
|
1506
|
+
Placeholder corners and order follow those options;
|
|
1483
1507
|
implicit default attribution has no placeholder. Once the map is constructed, the activation surface
|
|
1484
1508
|
and skeleton are gone, but `initialization-controls` stays (`aria-hidden`, inert, no pointer events)
|
|
1485
1509
|
with outlines only for requested controls whose lazy code is still installing. Those controls load and
|
|
@@ -1925,3 +1949,287 @@ undefined`, or changing `choropleth.sourceId` to a different value, now calls `r
|
|
|
1925
1949
|
without `ResizeObserver` retain MapLibre's own window-resize behavior.
|
|
1926
1950
|
|
|
1927
1951
|
---
|
|
1952
|
+
|
|
1953
|
+
### Geographic scene input and text fallback
|
|
1954
|
+
|
|
1955
|
+
The property-only `scene` accepts a `LyraMapScene` with an `objects` array of `marker`,
|
|
1956
|
+
`path`, `arc` and `model` records. Every object has a unique exact-string `id` and a required
|
|
1957
|
+
plain-text `label`. Positions use `{ lngLat: [longitude, latitude], altitude?,
|
|
1958
|
+
altitudeReference? }`; altitude is in meters and defaults to 0 above `sea-level`, with `terrain`
|
|
1959
|
+
as the other reference. Model sources use `{ format, bytes }` or `{ format, src }`, with formats
|
|
1960
|
+
`gltf`, `glb`, `stl`, `obj`, `ply`, `xyz` and `pcd`. Use a property binding, never an attribute.
|
|
1961
|
+
|
|
1962
|
+
Optional descriptor fields use these admission defaults:
|
|
1963
|
+
|
|
1964
|
+
| Field | Default |
|
|
1965
|
+
| --- | --- |
|
|
1966
|
+
| Position `altitude` / `altitudeReference` | `0` meters / `'sea-level'` |
|
|
1967
|
+
| Object `color` / `opacity` | No authored color override / `1` |
|
|
1968
|
+
| Object `interactive` / `showLabel` | `true` / `false` |
|
|
1969
|
+
| Marker `radius` | `6` |
|
|
1970
|
+
| Path `interpolation` / `width` | `'great-circle'` / `2` |
|
|
1971
|
+
| Arc `width` | `2` (`height` is required) |
|
|
1972
|
+
| Model `metersPerUnit` / `orientation` | `1` / identity `[0, 0, 0, 1]` |
|
|
1973
|
+
|
|
1974
|
+
Opacity must be between 0 and 1; radius, width and model scale must be positive. Model orientation
|
|
1975
|
+
is a scalar-last quaternion normalized during admission. Model fields describe requested rendering,
|
|
1976
|
+
which is not yet drawn. `interactive` controls text-row activation; `showLabel` does not hide the
|
|
1977
|
+
required label from the text fallback, and rendered labels are not drawn.
|
|
1978
|
+
|
|
1979
|
+
```ts
|
|
1980
|
+
import '@aceshooting/lyra-ui/components/lr-map.js';
|
|
1981
|
+
import type { LyraMapScene } from '@aceshooting/lyra-ui/components/lr-map.js';
|
|
1982
|
+
|
|
1983
|
+
const scene: LyraMapScene = { objects: [
|
|
1984
|
+
{ kind: 'marker', id: 'station', label: 'Central station',
|
|
1985
|
+
position: { lngLat: [6.134, 49.6] }, interactive: true },
|
|
1986
|
+
] };
|
|
1987
|
+
const map = document.querySelector('lr-map')!;
|
|
1988
|
+
map.scene = scene;
|
|
1989
|
+
```
|
|
1990
|
+
|
|
1991
|
+
Accepted scenes are drawn on the map and keep the accessible text fallback. Markers render as
|
|
1992
|
+
geographic circles through the optional `@aceshooting/lyra-map/scene` bridge. Paths and arcs render
|
|
1993
|
+
as one scene-owned GeoJSON source and line layer, with each object's resolved `color` (default: the
|
|
1994
|
+
accent token), `width` in CSS pixels and `opacity`. Markers draw above lines. Models are not fetched,
|
|
1995
|
+
parsed or drawn. Existing `markers`, `dataLayers`, projection and terrain configuration remain
|
|
1996
|
+
separate APIs.
|
|
1997
|
+
|
|
1998
|
+
Path `interpolation: 'great-circle'` follows the shortest route on the globe, sampled at most one
|
|
1999
|
+
degree apart; `'linear'` joins vertices straight in longitude/latitude. Both cross the antimeridian
|
|
2000
|
+
the shorter way. An arc follows the great circle from `start` to `end`; its altitude interpolates
|
|
2001
|
+
linearly between the endpoint altitudes and adds a parabolic rise of `height` meters,
|
|
2002
|
+
`height * 4t(1 - t)`, peaking at the midpoint. Generated vertices carry that altitude as the third
|
|
2003
|
+
GeoJSON coordinate.
|
|
2004
|
+
|
|
2005
|
+
The map draws lines flat on its displayed surface, so altitude is drawn exactly only when it is
|
|
2006
|
+
zero against that surface: `sea-level` without terrain, or `terrain`. A path or arc with any other
|
|
2007
|
+
altitude, a nonzero arc `height`, or `sea-level` geometry while terrain is displayed is drawn as its
|
|
2008
|
+
ground track, and the scene reports `partial` with code `altitude`. Changing terrain re-evaluates
|
|
2009
|
+
this. A style replacement reinstalls scene lines after the new style loads; clearing the scene,
|
|
2010
|
+
removing every path and arc, or disconnecting the map removes them.
|
|
2011
|
+
|
|
2012
|
+
A connected assignment snapshots and admits input synchronously before returning. A detached
|
|
2013
|
+
assignment is accepted on connection in that document's realm. Assign a new scene object to
|
|
2014
|
+
request an update; mutating an existing graph in place is not an update API. Invalid updates
|
|
2015
|
+
retain the last accepted rows and report the rejected update. `{ objects: [] }` accepts an empty
|
|
2016
|
+
scene; `undefined` clears accepted ownership. Leaving `scene` unset preserves existing behavior
|
|
2017
|
+
and adds no scene panel.
|
|
2018
|
+
|
|
2019
|
+
Direct source bytes are copied on admission. Reusing the same source record with unchanged
|
|
2020
|
+
metadata reuses its owned snapshot, including after its original buffer detaches. Replace the
|
|
2021
|
+
source record to supply new content. Clearing, disconnecting or adopting the map revokes that
|
|
2022
|
+
reuse; reconnect accepts current authored input again. Relative source URLs resolve against the
|
|
2023
|
+
connected owner document; acceptance alone does not fetch them.
|
|
2024
|
+
|
|
2025
|
+
Admission rejects the complete update rather than truncating it:
|
|
2026
|
+
|
|
2027
|
+
| Input | Ceiling |
|
|
2028
|
+
| --- | --- |
|
|
2029
|
+
| Objects / model objects per scene | 2,000 / 32 |
|
|
2030
|
+
| Authored positions per scene / positions per path | 65,536 / 4,096 |
|
|
2031
|
+
| Generated path and arc vertices per scene | 262,144; great-circle sampling coarsens to fit, and code `limit` is reported otherwise |
|
|
2032
|
+
| ID / required label / optional color | 1–1,024 / 16,384 / 1,024 UTF-16 units |
|
|
2033
|
+
| Model `src` / resolved absolute source URL | 1,048,576 UTF-16 units each |
|
|
2034
|
+
| Aggregate authored IDs, labels, colors and model `src` occurrences | 4,194,304 UTF-16 units per request |
|
|
2035
|
+
| Aggregate resolved source URLs | 4,194,304 UTF-16 units per source stage |
|
|
2036
|
+
| Library-owned encoded source snapshots, including staged replacements and retained associations | 64 MiB shared per connection |
|
|
2037
|
+
|
|
2038
|
+
A marker/model counts as one authored position and an arc as two. Text field limits apply before
|
|
2039
|
+
trimming or resolution; repeated authored references may count again. Resolved URL accounting
|
|
2040
|
+
counts each source-record association once, including reused associations, while distinct records
|
|
2041
|
+
count separately. These are admission limits, not a total JavaScript heap bound; the public
|
|
2042
|
+
property still retains caller input, including a rejected assignment. Generated geometry and
|
|
2043
|
+
rendering resources need separate limits.
|
|
2044
|
+
|
|
2045
|
+
The expandable text panel pages accepted objects with at most 100 rows rendered at once.
|
|
2046
|
+
Interactive rows support pointer, Enter and Space activation without implicitly panning; other
|
|
2047
|
+
rows remain text. Caller labels render as text. Style the surface with `scene-panel`,
|
|
2048
|
+
`scene-toggle`, `scene-list`, `scene-item`, `scene-pagination` and `scene-status` parts.
|
|
2049
|
+
|
|
2050
|
+
`lr-map-scene-state` emits immutable `{ revision, state, code? }` detail against the accepted
|
|
2051
|
+
revision. Accepted empty input and clear report `empty`. Nonempty input reports `loading`, then
|
|
2052
|
+
one settled state: `ready` when every object is installed on the map exactly; `partial` with a code
|
|
2053
|
+
when some objects are missing or approximated; or `unavailable` with a code when nothing could be
|
|
2054
|
+
drawn. Codes are `altitude` (drawn as a ground track), `model` (models are not drawn), `engine` (the
|
|
2055
|
+
map, its optional scene renderer or a native layer failed), `limit` (generated geometry exceeds the
|
|
2056
|
+
vertex limit) and `context-lost` (the WebGL context is lost; drawing resumes on restore). When
|
|
2057
|
+
several apply, the most significant is reported in that reverse order, `context-lost` first. A
|
|
2058
|
+
settled state can change again on a style replacement, terrain change or context loss. `ready`
|
|
2059
|
+
means installed, not visible: the viewport, terrain and occlusion still apply. Rejected input
|
|
2060
|
+
reports `error` with `invalid` or `limit` while retaining the previous accepted revision, and
|
|
2061
|
+
renderer progress does not replace that report until a new scene is accepted. `loading` and
|
|
2062
|
+
`ready` are not announced; `partial` is announced politely and `unavailable`, `empty` and `error`
|
|
2063
|
+
assertively. The `scene-status` part shows the current text except when `ready`. `lr-map-scene-activate` emits immutable `{ id, kind, source,
|
|
2064
|
+
position? }` detail, with `source: 'pointer' | 'keyboard'`; positional marker/model actions include
|
|
2065
|
+
the accepted geographic position. Both events bubble, are composed and are noncancelable.
|
|
2066
|
+
|
|
2067
|
+
### Declarative globe and terrain configuration
|
|
2068
|
+
|
|
2069
|
+
`lr-map.projection` accepts `'mercator'` or `'globe'`. Leaving it unset preserves the projection
|
|
2070
|
+
in `mapStyle`, including a native projection expression. Clearing an override restores the
|
|
2071
|
+
captured configuration of the **current** style; an asynchronous style replacement establishes
|
|
2072
|
+
a new baseline after that replacement actually loads. Removing the `projection` attribute or
|
|
2073
|
+
assigning `undefined` releases ownership. Invalid projection strings normalize to unset.
|
|
2074
|
+
|
|
2075
|
+
The property-only `terrain` accepts `{ source, exaggeration? }`. `source` must name an existing
|
|
2076
|
+
`raster-dem` source in the current `mapStyle`; the component never adds a DEM provider or removes
|
|
2077
|
+
caller-owned sources. Exaggeration defaults to 1 and accepts finite numbers greater than or equal
|
|
2078
|
+
to zero, with no upper cap. Assign `null` to disable terrain explicitly, or `undefined` to restore
|
|
2079
|
+
the current style's terrain. The record is snapshotted on assignment; replace the record to change
|
|
2080
|
+
it. The new settings do not change the existing camera, overlay or control ownership contracts.
|
|
2081
|
+
|
|
2082
|
+
```ts
|
|
2083
|
+
import '@aceshooting/lyra-ui/components/lr-map.js';
|
|
2084
|
+
import type { LyraMapTerrain } from '@aceshooting/lyra-ui/components/lr-map.js';
|
|
2085
|
+
|
|
2086
|
+
const map = document.querySelector('lr-map')!;
|
|
2087
|
+
// Supply mapStyle with a raster-dem source named "elevation" before enabling terrain.
|
|
2088
|
+
const terrain: LyraMapTerrain = { source: 'elevation', exaggeration: 1.5 };
|
|
2089
|
+
map.projection = 'globe';
|
|
2090
|
+
map.terrain = terrain;
|
|
2091
|
+
await map.whenIdle();
|
|
2092
|
+
|
|
2093
|
+
map.terrain = null; // Disable terrain, preserving its source.
|
|
2094
|
+
await map.whenIdle();
|
|
2095
|
+
map.projection = undefined;
|
|
2096
|
+
map.terrain = undefined; // Restore this style's original configuration.
|
|
2097
|
+
await map.whenIdle();
|
|
2098
|
+
```
|
|
2099
|
+
|
|
2100
|
+
Initial overrides and style-replacement replay are included in `whenStyleReady()` and
|
|
2101
|
+
`lr-map-style-load`. A same-style change leaves that completed style barrier alone; await
|
|
2102
|
+
`whenIdle()` for each new configuration. An equal effective configuration does not call the
|
|
2103
|
+
native setters again. Superseded preparation cannot mutate a newer style or a disconnected map.
|
|
2104
|
+
|
|
2105
|
+
Unsupported capabilities, malformed terrain or a missing/wrong-kind elevation source reject
|
|
2106
|
+
readiness with `MapReadinessError` and show the existing localized map fallback. Native setters
|
|
2107
|
+
are not an atomic transaction; a failed application retires the map instead of reporting a
|
|
2108
|
+
partially configured scene as ready. Reconnect or assign a valid `mapStyle` to retry. Do not
|
|
2109
|
+
mutate native projection/terrain while the matching declarative override owns it; clear the
|
|
2110
|
+
override first. Native toolbar controls are not added by these properties: compose ordinary
|
|
2111
|
+
Lyra buttons and a slider around the map, or opt into the component-owned toggles below. Terrain exaggeration is
|
|
2112
|
+
a display scale, not a physical simulation.
|
|
2113
|
+
|
|
2114
|
+
### Component-owned globe and terrain controls
|
|
2115
|
+
|
|
2116
|
+
`controls.globe` accepts `true` or `{ position?, order? }`. `controls.terrain` accepts
|
|
2117
|
+
`false` or `{ source, exaggeration?, position?, order? }`; the source is required and `true`
|
|
2118
|
+
is not accepted. Both default to `top-right`, order 0. Equal-order controls read navigation,
|
|
2119
|
+
scale, geolocate, globe, terrain, attribution. Existing corner mirroring follows RTL.
|
|
2120
|
+
|
|
2121
|
+
```ts
|
|
2122
|
+
map.controls = {
|
|
2123
|
+
globe: true,
|
|
2124
|
+
terrain: { source: 'elevation', exaggeration: 1.5 },
|
|
2125
|
+
};
|
|
2126
|
+
```
|
|
2127
|
+
|
|
2128
|
+
Installing or changing these controls does not change the scene. Activation assigns `projection`
|
|
2129
|
+
or `terrain` first, then emits a noncancelable request event: `lr-map-projection-change` carries
|
|
2130
|
+
`{ projection, source: 'control' }`; `lr-map-terrain-change` carries
|
|
2131
|
+
`{ terrain, source: 'control' }`. Await `whenIdle()` for application. Programmatic changes and
|
|
2132
|
+
style replay do not emit either event. A controlled application can synchronously reassign the
|
|
2133
|
+
property in the event handler; its latest assignment wins.
|
|
2134
|
+
|
|
2135
|
+
Pressed state reflects settled native configuration. Literal globe is pressed, mercator is not;
|
|
2136
|
+
expression-valued projection is mixed. Transition metadata does not change a literal's state.
|
|
2137
|
+
The terrain toggle disables any active terrain, including a different source; enabling uses its
|
|
2138
|
+
configured source and scale. A missing enable source disables that action with localized feedback;
|
|
2139
|
+
disabling active terrain remains available. Source availability recovers after style/source updates.
|
|
2140
|
+
Controls are disabled while scene changes are pending. `whenControlsReady()` covers installation,
|
|
2141
|
+
not terrain tiles or scene application. Showing a control never downloads or guesses a DEM source.
|
|
2142
|
+
|
|
2143
|
+
Use `globe-control`, `globe-button`, `globe-icon`, `terrain-control`, `terrain-button` and
|
|
2144
|
+
`terrain-icon` parts for the owned chrome. Labels use `mapGlobe` and `mapTerrain` localization keys.
|
|
2145
|
+
|
|
2146
|
+
### Saved viewpoints, camera tours and following
|
|
2147
|
+
|
|
2148
|
+
Import `createMapCameraSession` from `@aceshooting/lyra-ui/map-camera-session.js`. It registers no
|
|
2149
|
+
element and loads no engine; register `lr-map` separately. Create a session after
|
|
2150
|
+
`whenStyleReady()` resolves on a connected map. One session owns a map's camera at a time.
|
|
2151
|
+
|
|
2152
|
+
```ts
|
|
2153
|
+
import '@aceshooting/lyra-ui/components/lr-map.js';
|
|
2154
|
+
import { createMapCameraSession, type MapViewpoint } from '@aceshooting/lyra-ui/map-camera-session.js';
|
|
2155
|
+
import { createSimulationClock } from '@aceshooting/lyra-ui/simulation-clock.js';
|
|
2156
|
+
|
|
2157
|
+
const map = document.querySelector('lr-map')!;
|
|
2158
|
+
await map.whenStyleReady();
|
|
2159
|
+
const camera = createMapCameraSession(map);
|
|
2160
|
+
|
|
2161
|
+
const saved: MapViewpoint = camera.capture(); // { center, zoom, bearing, pitch }, frozen
|
|
2162
|
+
camera.restore(saved, { kind: 'fly', duration: 1200 });
|
|
2163
|
+
|
|
2164
|
+
const start = Date.UTC(2026, 0, 15, 12);
|
|
2165
|
+
const clock = createSimulationClock({ range: [start, start + 60_000], instant: start });
|
|
2166
|
+
camera.tour(clock, { keyframes: [
|
|
2167
|
+
{ instant: start, view: saved },
|
|
2168
|
+
{ instant: start + 20_000, view: { center: [2.35, 48.86], zoom: 9, bearing: 30, pitch: 45 } },
|
|
2169
|
+
{ instant: start + 60_000, view: saved, interpolation: 'hold' },
|
|
2170
|
+
] });
|
|
2171
|
+
clock.play();
|
|
2172
|
+
|
|
2173
|
+
map.scene = { objects: [{ kind: 'marker', id: 'relay-1', label: 'Relay 1', position: { lngLat: [-3, 48.2] } }] };
|
|
2174
|
+
camera.follow({ objectId: 'relay-1', mode: 'ground', zoom: 7 });
|
|
2175
|
+
|
|
2176
|
+
map.addEventListener('lr-map-camera-interrupt', event => showReason(event.detail.reason));
|
|
2177
|
+
camera.subscribe(snapshot => render(snapshot.mode, snapshot.active, snapshot.reason));
|
|
2178
|
+
// When the application scope ends:
|
|
2179
|
+
camera.dispose(); clock.dispose();
|
|
2180
|
+
```
|
|
2181
|
+
|
|
2182
|
+
`capture()` returns the current camera as a detached frozen `MapViewpoint`. `restore(viewpoint,
|
|
2183
|
+
transition?)` validates the whole viewpoint (longitude in `[-180, 180]`, latitude in `[-90, 90]`,
|
|
2184
|
+
finite zoom and bearing, pitch in `[0, 85]`) and moves with `kind: 'jump'` (the default), `'ease'`
|
|
2185
|
+
or `'fly'`; `duration` is milliseconds, finite and at least 0. The map's zoom limits clamp zoom.
|
|
2186
|
+
|
|
2187
|
+
`tour(clock, tour)` samples 1 to 1,024 keyframes whose `instant` values strictly increase, on the
|
|
2188
|
+
clock's delivered instants; the gap between instants is each segment's duration. Linear segments
|
|
2189
|
+
interpolate centre, zoom, bearing and pitch, with longitude and bearing taking the shorter way
|
|
2190
|
+
round; `interpolation: 'hold'` keeps a keyframe until the next one. Before the first keyframe the
|
|
2191
|
+
tour holds it, and after the last it holds the last. Seeking, pausing and the clock rate apply
|
|
2192
|
+
directly. The tour stays active at the range end until another action, `stop()` or an
|
|
2193
|
+
interruption; disposing the clock ends it with reason `engine`.
|
|
2194
|
+
|
|
2195
|
+
`follow({ objectId, mode: 'ground', zoom?, bearing?, pitch? })` centres an accepted `scene`
|
|
2196
|
+
marker or model and moves again each time an assigned `scene` changes that object's accepted
|
|
2197
|
+
position. Following needs no scene rendering: it reads accepted geography. Omitted axes keep the
|
|
2198
|
+
camera's values from the start of following. A missing object keeps following armed with
|
|
2199
|
+
`trackingStatus: 'missing'`; a path or arc fails with `invalid-follow`. Drive a moving object from
|
|
2200
|
+
the shared clock by assigning a new `scene` from a clock subscription.
|
|
2201
|
+
|
|
2202
|
+
Each new `restore()`, `tour()` or `follow()` replaces the previous action without an interrupt
|
|
2203
|
+
event; `stop()` ends it in place. A drag, wheel, touch, box-zoom or keyboard gesture ends the action
|
|
2204
|
+
and lets the gesture continue; `flyTo()`, `easeTo()`, `jumpTo()`, `fitBounds()`, `fitToData()` or a
|
|
2205
|
+
different `center`/`zoom` assignment ends it as `external`; a `mapStyle`, `projection` or `terrain`
|
|
2206
|
+
change ends it as `style` and stops its animation; a lost rendering context ends it as `engine`. In
|
|
2207
|
+
each case the session snapshot becomes `{ mode: 'idle', active: false, reason }` and the map emits
|
|
2208
|
+
`lr-map-camera-interrupt` once, after ownership settles, so a listener can start a newer action. A
|
|
2209
|
+
map without a session never emits it. Re-assigning an equal `center`/`zoom` mirror does not
|
|
2210
|
+
interrupt.
|
|
2211
|
+
|
|
2212
|
+
Under `prefers-reduced-motion: reduce` or `data-lr-motion="reduce"`, `restore()` jumps instead of
|
|
2213
|
+
animating, a tour holds each keyframe instead of interpolating, and following centres the object
|
|
2214
|
+
once and then holds still. A motion preference change while an animated restore runs completes it
|
|
2215
|
+
as a jump.
|
|
2216
|
+
|
|
2217
|
+
Disconnecting or adopting the map disposes the session permanently with reason `disconnect`; create
|
|
2218
|
+
a new session after the map reconnects and its style is ready. `dispose()`, or aborting
|
|
2219
|
+
`options.signal`, releases the camera; both are idempotent. Methods on a disposed session throw
|
|
2220
|
+
`disposed`.
|
|
2221
|
+
|
|
2222
|
+
`snapshot` and `subscribe(listener, { signal? })` report frozen `MapCameraSessionSnapshot`
|
|
2223
|
+
records: `mode` (`'idle' | 'viewpoint' | 'tour' | 'follow'`), `active` and `reason`
|
|
2224
|
+
(`MapCameraSessionReason`: `'initial' | 'start' | 'complete' | 'stop' | 'user' | 'external' |
|
|
2225
|
+
'style' | 'disconnect' | 'engine' | 'disposed'`). Follow snapshots add `objectId`, `followMode`,
|
|
2226
|
+
`trackingStatus` (`'pending' | 'ground' | 'missing' | 'unavailable'` while ground following),
|
|
2227
|
+
`corrections` and an optional `unavailableReason`. A listener runs once on subscription.
|
|
2228
|
+
|
|
2229
|
+
Failures throw `MapCameraSessionError` synchronously and leave the running action unchanged. Its
|
|
2230
|
+
`code` is `MapCameraSessionErrorCode`: `'unsupported-map'` (a connected element without camera
|
|
2231
|
+
support), `'inactive-map'` (disconnected), `'already-bound'` (another session owns the camera),
|
|
2232
|
+
`'unavailable'` (style not ready, pending camera work, or a refused engine command),
|
|
2233
|
+
`'invalid-viewpoint'`, `'invalid-tour'`, `'invalid-follow'`, `'invalid-clock'`,
|
|
2234
|
+
`'invalid-options'` or `'disposed'`. Input records must be plain own-data objects; accessors and
|
|
2235
|
+
unknown fields are rejected without being read.
|
|
@@ -53,7 +53,8 @@ clamped to `[1, 32]` (`0` becomes `1`, `33` becomes `32`), and only non-finite v
|
|
|
53
53
|
`Infinity`) fall back to `4`, independently of rendered code's
|
|
54
54
|
`--lr-code-block-tab-size`; `marked: LyraMarkedParser | undefined` (readonly, no attribute) — this
|
|
55
55
|
instance's isolated peer-neutral configurable parser; `htmlMode: 'sanitize' | 'escape' | 'trusted' =
|
|
56
|
-
'sanitize'` (attribute `html-mode`), `withoutGfm: boolean = false` (attribute `without-gfm`),
|
|
56
|
+
'sanitize'` (attribute `html-mode`), `withoutGfm: boolean = false` (attribute `without-gfm`),
|
|
57
|
+
`withoutImages: boolean = false` (attribute `without-images`), `linkTarget: string | null = '_blank'` (attribute
|
|
57
58
|
`link-target`), `internalLinkPrefix: string = ''` (attribute `internal-link-prefix`),
|
|
58
59
|
`headingOffset: number = 0` (attribute `heading-offset`), `streaming: boolean = false` (reflected),
|
|
59
60
|
`streamingRender: MarkdownStreamingRender = 'plain'` (attribute `streaming-render`, not reflected),
|