@aceshooting/lyra-ui 30.5.0 → 30.8.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 +93 -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 +35 -7
- package/dist/components/layout/dock-panel/dock-panel.class.js +8 -5
- 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-elevated-lines.js +36 -0
- package/dist/components/media/map/map-scene-errors.js +1 -0
- package/dist/components/media/map/map-scene-line-encoding.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 +60 -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-custom-layer-attachment.js +1 -0
- package/dist/internal/map-custom-layer-controller.js +1 -0
- package/dist/internal/map-custom-layer-types.d.ts +63 -0
- package/dist/internal/map-scene-layer-runtime.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/map-custom-layers.d.ts +16 -0
- package/dist/map-custom-layers.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 +28 -10
- 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 +401 -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 +261 -0
- package/llms/shared.md +277 -2
- package/locales.json +1 -1
- package/package.json +41 -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
|
@@ -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,373 @@ 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
|
+
A path or arc at zero altitude against the displayed surface (`sea-level` without terrain, or
|
|
2006
|
+
`terrain`) drapes on the flat line layer. Any other altitude, a nonzero arc `height`, or `sea-level`
|
|
2007
|
+
geometry while terrain is displayed is drawn in 3D at its authored altitude through the custom
|
|
2008
|
+
layer bridge of `@aceshooting/lyra-map/scene` (see [Custom 3D layers](#custom-3d-layers)), which
|
|
2009
|
+
loads on first use. Its screen width stays `width` CSS pixels, depth tests against the map, and
|
|
2010
|
+
globe horizons hide the far side. `terrain` altitude adds displayed terrain height from the engine's
|
|
2011
|
+
elevation query; a segment between a `terrain` and a `sea-level` endpoint blends the two references
|
|
2012
|
+
linearly. When the bridge is not installed, fails to load or fails to render, those lines are drawn
|
|
2013
|
+
as ground tracks and the scene reports `partial` with code `altitude`. Changing terrain re-evaluates
|
|
2014
|
+
this. A style replacement reinstalls scene lines after the new style loads; clearing the scene,
|
|
2015
|
+
removing every path and arc, or disconnecting the map removes them.
|
|
2016
|
+
|
|
2017
|
+
A connected assignment snapshots and admits input synchronously before returning. A detached
|
|
2018
|
+
assignment is accepted on connection in that document's realm. Assign a new scene object to
|
|
2019
|
+
request an update; mutating an existing graph in place is not an update API. Invalid updates
|
|
2020
|
+
retain the last accepted rows and report the rejected update. `{ objects: [] }` accepts an empty
|
|
2021
|
+
scene; `undefined` clears accepted ownership. Leaving `scene` unset preserves existing behavior
|
|
2022
|
+
and adds no scene panel.
|
|
2023
|
+
|
|
2024
|
+
Direct source bytes are copied on admission. Reusing the same source record with unchanged
|
|
2025
|
+
metadata reuses its owned snapshot, including after its original buffer detaches. Replace the
|
|
2026
|
+
source record to supply new content. Clearing, disconnecting or adopting the map revokes that
|
|
2027
|
+
reuse; reconnect accepts current authored input again. Relative source URLs resolve against the
|
|
2028
|
+
connected owner document; acceptance alone does not fetch them.
|
|
2029
|
+
|
|
2030
|
+
Admission rejects the complete update rather than truncating it:
|
|
2031
|
+
|
|
2032
|
+
| Input | Ceiling |
|
|
2033
|
+
| --- | --- |
|
|
2034
|
+
| Objects / model objects per scene | 2,000 / 32 |
|
|
2035
|
+
| Authored positions per scene / positions per path | 65,536 / 4,096 |
|
|
2036
|
+
| Generated path and arc vertices per scene | 262,144; great-circle sampling coarsens to fit, and code `limit` is reported otherwise |
|
|
2037
|
+
| ID / required label / optional color | 1–1,024 / 16,384 / 1,024 UTF-16 units |
|
|
2038
|
+
| Model `src` / resolved absolute source URL | 1,048,576 UTF-16 units each |
|
|
2039
|
+
| Aggregate authored IDs, labels, colors and model `src` occurrences | 4,194,304 UTF-16 units per request |
|
|
2040
|
+
| Aggregate resolved source URLs | 4,194,304 UTF-16 units per source stage |
|
|
2041
|
+
| Library-owned encoded source snapshots, including staged replacements and retained associations | 64 MiB shared per connection |
|
|
2042
|
+
|
|
2043
|
+
A marker/model counts as one authored position and an arc as two. Text field limits apply before
|
|
2044
|
+
trimming or resolution; repeated authored references may count again. Resolved URL accounting
|
|
2045
|
+
counts each source-record association once, including reused associations, while distinct records
|
|
2046
|
+
count separately. These are admission limits, not a total JavaScript heap bound; the public
|
|
2047
|
+
property still retains caller input, including a rejected assignment. Generated geometry and
|
|
2048
|
+
rendering resources need separate limits.
|
|
2049
|
+
|
|
2050
|
+
The expandable text panel pages accepted objects with at most 100 rows rendered at once.
|
|
2051
|
+
Interactive rows support pointer, Enter and Space activation without implicitly panning; other
|
|
2052
|
+
rows remain text. Caller labels render as text. Style the surface with `scene-panel`,
|
|
2053
|
+
`scene-toggle`, `scene-list`, `scene-item`, `scene-pagination` and `scene-status` parts.
|
|
2054
|
+
|
|
2055
|
+
`lr-map-scene-state` emits immutable `{ revision, state, code? }` detail against the accepted
|
|
2056
|
+
revision. Accepted empty input and clear report `empty`. Nonempty input reports `loading`, then
|
|
2057
|
+
one settled state: `ready` when every object is installed on the map exactly; `partial` with a code
|
|
2058
|
+
when some objects are missing or approximated; or `unavailable` with a code when nothing could be
|
|
2059
|
+
drawn. Codes are `altitude` (drawn as a ground track because the 3D bridge is unavailable), `model` (models are not drawn), `engine` (the
|
|
2060
|
+
map, its optional scene renderer or a native layer failed), `limit` (generated geometry exceeds the
|
|
2061
|
+
vertex limit) and `context-lost` (the WebGL context is lost; drawing resumes on restore). When
|
|
2062
|
+
several apply, the most significant is reported in that reverse order, `context-lost` first. A
|
|
2063
|
+
settled state can change again on a style replacement, terrain change or context loss. `ready`
|
|
2064
|
+
means installed, not visible: the viewport, terrain and occlusion still apply. Rejected input
|
|
2065
|
+
reports `error` with `invalid` or `limit` while retaining the previous accepted revision, and
|
|
2066
|
+
renderer progress does not replace that report until a new scene is accepted. `loading` and
|
|
2067
|
+
`ready` are not announced; `partial` is announced politely and `unavailable`, `empty` and `error`
|
|
2068
|
+
assertively. The `scene-status` part shows the current text except when `ready`. `lr-map-scene-activate` emits immutable `{ id, kind, layerId?, source,
|
|
2069
|
+
position? }` detail, with `source: 'pointer' | 'keyboard'`; positional marker/model actions include
|
|
2070
|
+
the accepted geographic position. A pointer click that a custom 3D layer's `pick()` hits reports
|
|
2071
|
+
`kind: 'custom'`, the hit `id`, the layer's `layerId` and the hit's optional `position`. Both events bubble, are composed and are noncancelable.
|
|
2072
|
+
|
|
2073
|
+
### Declarative globe and terrain configuration
|
|
2074
|
+
|
|
2075
|
+
`lr-map.projection` accepts `'mercator'` or `'globe'`. Leaving it unset preserves the projection
|
|
2076
|
+
in `mapStyle`, including a native projection expression. Clearing an override restores the
|
|
2077
|
+
captured configuration of the **current** style; an asynchronous style replacement establishes
|
|
2078
|
+
a new baseline after that replacement actually loads. Removing the `projection` attribute or
|
|
2079
|
+
assigning `undefined` releases ownership. Invalid projection strings normalize to unset.
|
|
2080
|
+
|
|
2081
|
+
The property-only `terrain` accepts `{ source, exaggeration? }`. `source` must name an existing
|
|
2082
|
+
`raster-dem` source in the current `mapStyle`; the component never adds a DEM provider or removes
|
|
2083
|
+
caller-owned sources. Exaggeration defaults to 1 and accepts finite numbers greater than or equal
|
|
2084
|
+
to zero, with no upper cap. Assign `null` to disable terrain explicitly, or `undefined` to restore
|
|
2085
|
+
the current style's terrain. The record is snapshotted on assignment; replace the record to change
|
|
2086
|
+
it. The new settings do not change the existing camera, overlay or control ownership contracts.
|
|
2087
|
+
|
|
2088
|
+
```ts
|
|
2089
|
+
import '@aceshooting/lyra-ui/components/lr-map.js';
|
|
2090
|
+
import type { LyraMapTerrain } from '@aceshooting/lyra-ui/components/lr-map.js';
|
|
2091
|
+
|
|
2092
|
+
const map = document.querySelector('lr-map')!;
|
|
2093
|
+
// Supply mapStyle with a raster-dem source named "elevation" before enabling terrain.
|
|
2094
|
+
const terrain: LyraMapTerrain = { source: 'elevation', exaggeration: 1.5 };
|
|
2095
|
+
map.projection = 'globe';
|
|
2096
|
+
map.terrain = terrain;
|
|
2097
|
+
await map.whenIdle();
|
|
2098
|
+
|
|
2099
|
+
map.terrain = null; // Disable terrain, preserving its source.
|
|
2100
|
+
await map.whenIdle();
|
|
2101
|
+
map.projection = undefined;
|
|
2102
|
+
map.terrain = undefined; // Restore this style's original configuration.
|
|
2103
|
+
await map.whenIdle();
|
|
2104
|
+
```
|
|
2105
|
+
|
|
2106
|
+
Initial overrides and style-replacement replay are included in `whenStyleReady()` and
|
|
2107
|
+
`lr-map-style-load`. A same-style change leaves that completed style barrier alone; await
|
|
2108
|
+
`whenIdle()` for each new configuration. An equal effective configuration does not call the
|
|
2109
|
+
native setters again. Superseded preparation cannot mutate a newer style or a disconnected map.
|
|
2110
|
+
|
|
2111
|
+
Unsupported capabilities, malformed terrain or a missing/wrong-kind elevation source reject
|
|
2112
|
+
readiness with `MapReadinessError` and show the existing localized map fallback. Native setters
|
|
2113
|
+
are not an atomic transaction; a failed application retires the map instead of reporting a
|
|
2114
|
+
partially configured scene as ready. Reconnect or assign a valid `mapStyle` to retry. Do not
|
|
2115
|
+
mutate native projection/terrain while the matching declarative override owns it; clear the
|
|
2116
|
+
override first. Native toolbar controls are not added by these properties: compose ordinary
|
|
2117
|
+
Lyra buttons and a slider around the map, or opt into the component-owned toggles below. Terrain exaggeration is
|
|
2118
|
+
a display scale, not a physical simulation.
|
|
2119
|
+
|
|
2120
|
+
### Component-owned globe and terrain controls
|
|
2121
|
+
|
|
2122
|
+
`controls.globe` accepts `true` or `{ position?, order? }`. `controls.terrain` accepts
|
|
2123
|
+
`false` or `{ source, exaggeration?, position?, order? }`; the source is required and `true`
|
|
2124
|
+
is not accepted. Both default to `top-right`, order 0. Equal-order controls read navigation,
|
|
2125
|
+
scale, geolocate, globe, terrain, attribution. Existing corner mirroring follows RTL.
|
|
2126
|
+
|
|
2127
|
+
```ts
|
|
2128
|
+
map.controls = {
|
|
2129
|
+
globe: true,
|
|
2130
|
+
terrain: { source: 'elevation', exaggeration: 1.5 },
|
|
2131
|
+
};
|
|
2132
|
+
```
|
|
2133
|
+
|
|
2134
|
+
Installing or changing these controls does not change the scene. Activation assigns `projection`
|
|
2135
|
+
or `terrain` first, then emits a noncancelable request event: `lr-map-projection-change` carries
|
|
2136
|
+
`{ projection, source: 'control' }`; `lr-map-terrain-change` carries
|
|
2137
|
+
`{ terrain, source: 'control' }`. Await `whenIdle()` for application. Programmatic changes and
|
|
2138
|
+
style replay do not emit either event. A controlled application can synchronously reassign the
|
|
2139
|
+
property in the event handler; its latest assignment wins.
|
|
2140
|
+
|
|
2141
|
+
Pressed state reflects settled native configuration. Literal globe is pressed, mercator is not;
|
|
2142
|
+
expression-valued projection is mixed. Transition metadata does not change a literal's state.
|
|
2143
|
+
The terrain toggle disables any active terrain, including a different source; enabling uses its
|
|
2144
|
+
configured source and scale. A missing enable source disables that action with localized feedback;
|
|
2145
|
+
disabling active terrain remains available. Source availability recovers after style/source updates.
|
|
2146
|
+
Controls are disabled while scene changes are pending. `whenControlsReady()` covers installation,
|
|
2147
|
+
not terrain tiles or scene application. Showing a control never downloads or guesses a DEM source.
|
|
2148
|
+
|
|
2149
|
+
Use `globe-control`, `globe-button`, `globe-icon`, `terrain-control`, `terrain-button` and
|
|
2150
|
+
`terrain-icon` parts for the owned chrome. Labels use `mapGlobe` and `mapTerrain` localization keys.
|
|
2151
|
+
|
|
2152
|
+
### Saved viewpoints, camera tours and following
|
|
2153
|
+
|
|
2154
|
+
Import `createMapCameraSession` from `@aceshooting/lyra-ui/map-camera-session.js`. It registers no
|
|
2155
|
+
element and loads no engine; register `lr-map` separately. Create a session after
|
|
2156
|
+
`whenStyleReady()` resolves on a connected map. One session owns a map's camera at a time.
|
|
2157
|
+
|
|
2158
|
+
```ts
|
|
2159
|
+
import '@aceshooting/lyra-ui/components/lr-map.js';
|
|
2160
|
+
import { createMapCameraSession, type MapViewpoint } from '@aceshooting/lyra-ui/map-camera-session.js';
|
|
2161
|
+
import { createSimulationClock } from '@aceshooting/lyra-ui/simulation-clock.js';
|
|
2162
|
+
|
|
2163
|
+
const map = document.querySelector('lr-map')!;
|
|
2164
|
+
await map.whenStyleReady();
|
|
2165
|
+
const camera = createMapCameraSession(map);
|
|
2166
|
+
|
|
2167
|
+
const saved: MapViewpoint = camera.capture(); // { center, zoom, bearing, pitch }, frozen
|
|
2168
|
+
camera.restore(saved, { kind: 'fly', duration: 1200 });
|
|
2169
|
+
|
|
2170
|
+
const start = Date.UTC(2026, 0, 15, 12);
|
|
2171
|
+
const clock = createSimulationClock({ range: [start, start + 60_000], instant: start });
|
|
2172
|
+
camera.tour(clock, { keyframes: [
|
|
2173
|
+
{ instant: start, view: saved },
|
|
2174
|
+
{ instant: start + 20_000, view: { center: [2.35, 48.86], zoom: 9, bearing: 30, pitch: 45 } },
|
|
2175
|
+
{ instant: start + 60_000, view: saved, interpolation: 'hold' },
|
|
2176
|
+
] });
|
|
2177
|
+
clock.play();
|
|
2178
|
+
|
|
2179
|
+
map.scene = { objects: [{ kind: 'marker', id: 'relay-1', label: 'Relay 1', position: { lngLat: [-3, 48.2] } }] };
|
|
2180
|
+
camera.follow({ objectId: 'relay-1', mode: 'ground', zoom: 7 });
|
|
2181
|
+
|
|
2182
|
+
map.addEventListener('lr-map-camera-interrupt', event => showReason(event.detail.reason));
|
|
2183
|
+
camera.subscribe(snapshot => render(snapshot.mode, snapshot.active, snapshot.reason));
|
|
2184
|
+
// When the application scope ends:
|
|
2185
|
+
camera.dispose(); clock.dispose();
|
|
2186
|
+
```
|
|
2187
|
+
|
|
2188
|
+
`capture()` returns the current camera as a detached frozen `MapViewpoint`. `restore(viewpoint,
|
|
2189
|
+
transition?)` validates the whole viewpoint (longitude in `[-180, 180]`, latitude in `[-90, 90]`,
|
|
2190
|
+
finite zoom and bearing, pitch in `[0, 85]`) and moves with `kind: 'jump'` (the default), `'ease'`
|
|
2191
|
+
or `'fly'`; `duration` is milliseconds, finite and at least 0. The map's zoom limits clamp zoom.
|
|
2192
|
+
|
|
2193
|
+
`tour(clock, tour)` samples 1 to 1,024 keyframes whose `instant` values strictly increase, on the
|
|
2194
|
+
clock's delivered instants; the gap between instants is each segment's duration. Linear segments
|
|
2195
|
+
interpolate centre, zoom, bearing and pitch, with longitude and bearing taking the shorter way
|
|
2196
|
+
round; `interpolation: 'hold'` keeps a keyframe until the next one. Before the first keyframe the
|
|
2197
|
+
tour holds it, and after the last it holds the last. Seeking, pausing and the clock rate apply
|
|
2198
|
+
directly. The tour stays active at the range end until another action, `stop()` or an
|
|
2199
|
+
interruption; disposing the clock ends it with reason `engine`.
|
|
2200
|
+
|
|
2201
|
+
`follow({ objectId, mode: 'ground', zoom?, bearing?, pitch? })` centres an accepted `scene`
|
|
2202
|
+
marker or model and moves again each time an assigned `scene` changes that object's accepted
|
|
2203
|
+
position. Following needs no scene rendering: it reads accepted geography. Omitted axes keep the
|
|
2204
|
+
camera's values from the start of following. A missing object keeps following armed with
|
|
2205
|
+
`trackingStatus: 'missing'`; a path or arc fails with `invalid-follow`. Drive a moving object from
|
|
2206
|
+
the shared clock by assigning a new `scene` from a clock subscription.
|
|
2207
|
+
|
|
2208
|
+
Each new `restore()`, `tour()` or `follow()` replaces the previous action without an interrupt
|
|
2209
|
+
event; `stop()` ends it in place. A drag, wheel, touch, box-zoom or keyboard gesture ends the action
|
|
2210
|
+
and lets the gesture continue; `flyTo()`, `easeTo()`, `jumpTo()`, `fitBounds()`, `fitToData()` or a
|
|
2211
|
+
different `center`/`zoom` assignment ends it as `external`; a `mapStyle`, `projection` or `terrain`
|
|
2212
|
+
change ends it as `style` and stops its animation; a lost rendering context ends it as `engine`. In
|
|
2213
|
+
each case the session snapshot becomes `{ mode: 'idle', active: false, reason }` and the map emits
|
|
2214
|
+
`lr-map-camera-interrupt` once, after ownership settles, so a listener can start a newer action. A
|
|
2215
|
+
map without a session never emits it. Re-assigning an equal `center`/`zoom` mirror does not
|
|
2216
|
+
interrupt.
|
|
2217
|
+
|
|
2218
|
+
Under `prefers-reduced-motion: reduce` or `data-lr-motion="reduce"`, `restore()` jumps instead of
|
|
2219
|
+
animating, a tour holds each keyframe instead of interpolating, and following centres the object
|
|
2220
|
+
once and then holds still. A motion preference change while an animated restore runs completes it
|
|
2221
|
+
as a jump.
|
|
2222
|
+
|
|
2223
|
+
Disconnecting or adopting the map disposes the session permanently with reason `disconnect`; create
|
|
2224
|
+
a new session after the map reconnects and its style is ready. `dispose()`, or aborting
|
|
2225
|
+
`options.signal`, releases the camera; both are idempotent. Methods on a disposed session throw
|
|
2226
|
+
`disposed`.
|
|
2227
|
+
|
|
2228
|
+
`snapshot` and `subscribe(listener, { signal? })` report frozen `MapCameraSessionSnapshot`
|
|
2229
|
+
records: `mode` (`'idle' | 'viewpoint' | 'tour' | 'follow'`), `active` and `reason`
|
|
2230
|
+
(`MapCameraSessionReason`: `'initial' | 'start' | 'complete' | 'stop' | 'user' | 'external' |
|
|
2231
|
+
'style' | 'disconnect' | 'engine' | 'disposed'`). Follow snapshots add `objectId`, `followMode`,
|
|
2232
|
+
`trackingStatus` (`'pending' | 'ground' | 'missing' | 'unavailable'` while ground following),
|
|
2233
|
+
`corrections` and an optional `unavailableReason`. A listener runs once on subscription.
|
|
2234
|
+
|
|
2235
|
+
Failures throw `MapCameraSessionError` synchronously and leave the running action unchanged. Its
|
|
2236
|
+
`code` is `MapCameraSessionErrorCode`: `'unsupported-map'` (a connected element without camera
|
|
2237
|
+
support), `'inactive-map'` (disconnected), `'already-bound'` (another session owns the camera),
|
|
2238
|
+
`'unavailable'` (style not ready, pending camera work, or a refused engine command),
|
|
2239
|
+
`'invalid-viewpoint'`, `'invalid-tour'`, `'invalid-follow'`, `'invalid-clock'`,
|
|
2240
|
+
`'invalid-options'` or `'disposed'`. Input records must be plain own-data objects; accessors and
|
|
2241
|
+
unknown fields are rejected without being read.
|
|
2242
|
+
|
|
2243
|
+
### Custom 3D layers
|
|
2244
|
+
|
|
2245
|
+
Import `addMapCustomLayer` from `@aceshooting/lyra-ui/map-custom-layers.js` to add a trusted WebGL2
|
|
2246
|
+
effect, such as a beam, coverage cone, cloud or particle system, to a connected `lr-map`. It
|
|
2247
|
+
registers no element; the bridge loads from the optional `@aceshooting/lyra-map/scene` entry on
|
|
2248
|
+
first use, so ordinary `lr-map` imports never load it. Rendering a beam or cone does not compute its
|
|
2249
|
+
physical validity; that stays application logic.
|
|
2250
|
+
|
|
2251
|
+
```ts
|
|
2252
|
+
import '@aceshooting/lyra-ui/components/lr-map.js';
|
|
2253
|
+
import { addMapCustomLayer, type LyraMapCustomLayer } from '@aceshooting/lyra-ui/map-custom-layers.js';
|
|
2254
|
+
|
|
2255
|
+
const beam: LyraMapCustomLayer = {
|
|
2256
|
+
id: 'uplink-beam', label: 'Uplink beam',
|
|
2257
|
+
create(context) {
|
|
2258
|
+
const { gl } = context; // the map's own WebGL2 context
|
|
2259
|
+
const vao = gl.createVertexArray();
|
|
2260
|
+
let program: WebGLProgram | undefined;
|
|
2261
|
+
return {
|
|
2262
|
+
render(frame) {
|
|
2263
|
+
const top = frame.geographic.resolve({ lngLat: [6.13, 49.61], altitude: 20_000 });
|
|
2264
|
+
if (top.status !== 'resolved') return;
|
|
2265
|
+
const origin = context.geographic.frameFor(top);
|
|
2266
|
+
const shader = frame.geographic.shader(origin); // prelude, defines, uniforms
|
|
2267
|
+
const xyz = frame.geographic.encode(top, origin); // tile-local x, y and meters
|
|
2268
|
+
program ??= compile(gl, shader); // your GLSL body calls lrProjectPosition()
|
|
2269
|
+
upload(gl, program, shader.uniforms, xyz);
|
|
2270
|
+
gl.bindVertexArray(vao); gl.drawArrays(gl.TRIANGLES, 0, 36);
|
|
2271
|
+
},
|
|
2272
|
+
dispose() { if (!gl.isContextLost()) gl.deleteVertexArray(vao); },
|
|
2273
|
+
pick: async ([x, y], revision) => null,
|
|
2274
|
+
};
|
|
2275
|
+
},
|
|
2276
|
+
};
|
|
2277
|
+
const map = document.querySelector('lr-map')!;
|
|
2278
|
+
const layer = addMapCustomLayer(map, beam, { onStateChange: ({ state, code }) => console.log(state, code) });
|
|
2279
|
+
map.addEventListener('lr-map-scene-activate', event => {
|
|
2280
|
+
if (event.detail.kind === 'custom') select(event.detail.layerId, event.detail.id);
|
|
2281
|
+
});
|
|
2282
|
+
layer.remove();
|
|
2283
|
+
```
|
|
2284
|
+
|
|
2285
|
+
- **Geographic transforms.** Positions are `{ lngLat, altitude?, altitudeReference? }` in degrees
|
|
2286
|
+
and meters. `resolve()` returns meters above sea level; `terrain` adds the displayed terrain
|
|
2287
|
+
height (including exaggeration) from the engine's elevation query, reporting `terrain-pending`
|
|
2288
|
+
until its DEM tile loads and `terrain-unavailable` without terrain. `frameFor()` picks a tile
|
|
2289
|
+
origin in the world copy nearest the view, `encode()` returns tile-local `[x, y, meters]` for it,
|
|
2290
|
+
`fromEnu()` offsets a resolved position by east/north/up meters, and `project()` returns CSS
|
|
2291
|
+
pixel `point` and `visible`. Frame services expire when `render()` returns; keep what `pick()`
|
|
2292
|
+
needs.
|
|
2293
|
+
- **Shared camera.** `shader(origin)` returns GLSL ES 3.00 `defines`, `vertexPrelude`,
|
|
2294
|
+
`fragmentPrelude` and `uniforms` (projection matrices, tile Mercator coordinates, clipping plane,
|
|
2295
|
+
globe transition). Prefix your shaders with them and call `lrProjectPosition(vec3)`. The same code
|
|
2296
|
+
draws in Mercator, globe and the transition between them; on a globe forward
|
|
2297
|
+
`lrHorizonPosition()` and discard where `lrHorizonOccluded()` returns true. The layer draws in
|
|
2298
|
+
the map's 3D pass with its depth buffer and premultiplied alpha blending. `frame` also carries
|
|
2299
|
+
CSS `width`/`height`, `pixelRatio`, `time`, `revision` and the map's `reducedMotion`; stop
|
|
2300
|
+
animation when it is true.
|
|
2301
|
+
- **Lifecycle.** `create()` runs for each mount epoch: on first install, after a `mapStyle`
|
|
2302
|
+
replacement and after WebGL context restoration. The previous instance is disposed first, so
|
|
2303
|
+
allocate GL objects in `create()` or lazily in `render()`. A lost context disposes the instance
|
|
2304
|
+
without GL work (`context.gl.isContextLost()` is true) and reports `unavailable` with
|
|
2305
|
+
`context-lost`; restoration reinstalls it. `remove()` and disconnecting the map dispose it and
|
|
2306
|
+
report the final `removed` state. Never resize the canvas or lose the context yourself.
|
|
2307
|
+
- **Status.** `handle.status` and `onStateChange` report `loading`, `ready` after a completed frame,
|
|
2308
|
+
`unavailable` with `engine` (the optional bridge did not load or the map engine refused the
|
|
2309
|
+
layer), `render` (a callback threw; the layer stays retired until the next style replacement),
|
|
2310
|
+
`invalid`, `context-lost`, or a code the layer reports through `context.reportState()`, and
|
|
2311
|
+
`removed`. `ready` does not assert visible pixels.
|
|
2312
|
+
- **Picking.** A pointer click calls `pick(point, revision)` with CSS pixels; a hit `{ id,
|
|
2313
|
+
position? }` emits `lr-map-scene-activate` with `kind: 'custom'`. `handle.pick(point)` asks
|
|
2314
|
+
directly. Results resolve `null` after the view, epoch or layer changed.
|
|
2315
|
+
|
|
2316
|
+
Both the modular engine and `engine="maplibre"` support the bridge; it needs `@aceshooting/lyra-map`
|
|
2317
|
+
installed. `requestRender()` schedules a frame for animation and `setVisible(false)` skips drawing.
|
|
2318
|
+
The layer descriptor is snapshotted once; `id` and `label` are nonblank strings and `before` names
|
|
2319
|
+
an existing style layer to render beneath. A malformed descriptor or an element that is not a
|
|
2320
|
+
connected `lr-map` throws `TypeError`. Custom layers add no text alternative: describe what they show
|
|
2321
|
+
in the surrounding page or scene list.
|
|
@@ -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),
|
|
@@ -79,6 +79,16 @@ uses for its own `[part="body"]`.
|
|
|
79
79
|
Markdown still renders; `trusted` renders raw HTML without sanitization and is only for trusted
|
|
80
80
|
content. In escape mode, a consumer `renderer.text` or `renderer.html` override replaces the
|
|
81
81
|
escaping and is the consumer's responsibility.
|
|
82
|
+
- `withoutImages: boolean = false` (attribute `without-images`) — the untrusted-content switch for
|
|
83
|
+
images, in every `htmlMode`. The scheme allowlist alone still admits any `http(s)`, relative or
|
|
84
|
+
`data:` image, so untrusted Markdown (a streamed language-model answer, for example) can make the
|
|
85
|
+
page request an arbitrary URL as soon as it renders. With `without-images`, every Markdown image
|
|
86
|
+
renders as its alt text, exactly like a refused URL, and the finished HTML is enforced too:
|
|
87
|
+
raw-HTML `<img>` and `<input type="image">` become their alt text, `<picture>` sources and SVG
|
|
88
|
+
`<image>`/`<feImage>` are removed, and `<video>` loses its `poster`. In `sanitize` mode authored
|
|
89
|
+
`<style>` elements are also removed; `trusted` mode does not inspect authored CSS. Changing it
|
|
90
|
+
re-renders. Pair it with the default `sanitize` mode for language-model output:
|
|
91
|
+
`<lr-markdown without-images></lr-markdown>`.
|
|
82
92
|
- `withoutGfm: boolean = false` (attribute `without-gfm`) — disables GitHub-flavored Markdown
|
|
83
93
|
(tables, strikethrough, autolinks, task lists), which is on by default.
|
|
84
94
|
GFM task-list checkboxes stay disabled. Unordered tasks replace their bullets and align their
|
|
@@ -370,7 +380,8 @@ can cover the other. Both surfaces use `white-space: pre` and scroll horizontall
|
|
|
370
380
|
relative URLs — plus `data:` for images only), independently of `htmlMode` — `sanitize` and
|
|
371
381
|
`escape` both reject a disallowed scheme (e.g. `javascript:`) by dropping the anchor/image and
|
|
372
382
|
rendering only its text/alt content, exactly like the malformed-`href` case above; only
|
|
373
|
-
`html-mode="trusted"` skips this check, consistent with its documented full bypass.
|
|
383
|
+
`html-mode="trusted"` skips this check, consistent with its documented full bypass. The allowlist
|
|
384
|
+
does not stop an allowed image URL from being fetched; set `without-images` for that.
|
|
374
385
|
- `target` is not in DOMPurify's default attribute allowlist (unlike `part`/`rel`/`class`, which
|
|
375
386
|
already are), so sanitization is called with `ADD_ATTR: ['target']` — without that, every rendered
|
|
376
387
|
link's `target` would be silently stripped by sanitization even though the anchor itself survives.
|
|
@@ -145,8 +145,11 @@ A focusable action row owned by `<lr-menu>`. The host itself carries `role="menu
|
|
|
145
145
|
`[part="base"]` renders as a real `<a href=…>` instead of a `<span>`, and activation (click, or
|
|
146
146
|
the owning menu's Enter/Space handling, which forwards through `click()` for a link item so the
|
|
147
147
|
anchor's own native default action runs) navigates there in addition to firing the usual
|
|
148
|
-
`select()`/`lr-select` contract.
|
|
149
|
-
|
|
148
|
+
`select()`/`lr-select` contract. The anchor carries the row's accessible name as its own
|
|
149
|
+
`aria-label` (a non-empty host `aria-label` wins, otherwise the visible label) and keeps it live
|
|
150
|
+
when either changes, because its visible label sits behind the decorative label wrapper. An
|
|
151
|
+
unsafe/unparseable value falls back to the plain `<span>`, matching `lr-button`'s identical
|
|
152
|
+
fallback
|
|
150
153
|
- `target?: string` — native anchor `target`, used only while `href` resolves to a link. Setting it
|
|
151
154
|
(e.g. `'_blank'`) always force-adds `noopener noreferrer` to the rendered anchor's `rel`,
|
|
152
155
|
matching `lr-button`'s identical pattern
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
## `lr-model-select`
|
|
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
|
The model list follows the [shared surface treatment](../shared/styles-and-tokens.md);
|
|
20
22
|
its editing field retains an opaque fill.
|
|
21
23
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md)
|
|
10
10
|
- **Deprecations** none
|
|
11
11
|
- **Optional peers** none
|
|
12
|
-
- **Themeable via** 3 parts,
|
|
12
|
+
- **Themeable via** 3 parts, 9 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
|
---
|
|
@@ -103,7 +103,10 @@ needs a different scrolling surface.
|
|
|
103
103
|
doesn't resolve to a length. Also reflected as `data-effective-orientation` (only present while
|
|
104
104
|
`orientationBreakpoint` resolves to a usable length).
|
|
105
105
|
- `storageKey?: string` (attribute `storage-key`) — persists a versioned list of `{ panelId, size }`
|
|
106
|
-
records to `localStorage` under `` `lr-multi-split:${key}:panels` ``.
|
|
106
|
+
records to `localStorage` under `` `lr-multi-split:${key}:panels` ``. While a panel is folded
|
|
107
|
+
(`collapsedPanels`) the record is version 2 and a folded panel's entry adds `collapsed: true` and
|
|
108
|
+
the `expandedSize` it returns to; with nothing folded the original version-1 shape is written, and
|
|
109
|
+
both versions restore. Every direct panel must have
|
|
107
110
|
a unique, nonempty, whitespace-stable `panel-id`; a missing, surrounding-whitespace, or duplicate identity fails persistence closed without
|
|
108
111
|
disabling the live split. Restores and same-instance membership reconciliation follow `panelId`,
|
|
109
112
|
so a reorder/replacement never transfers a saved size to a different business panel.
|
|
@@ -205,6 +208,24 @@ number; maxPx?: number; minPercent?: number; maxPercent?: number }`, index-align
|
|
|
205
208
|
releases a pin, so ordinary resizing inside one band leaves it alone. Left unset (the default), a
|
|
206
209
|
pin survives every band and orientation change until a consumer writes `'auto'` — the pre-existing
|
|
207
210
|
behavior.
|
|
211
|
+
- `collapsedPanels: string[] = []` (attribute: false) — the `panel-id`s of panels folded to a narrow
|
|
212
|
+
rail strip by a host control, at any container width and for any panel (not only an edge one).
|
|
213
|
+
Empty (the default) leaves the split exactly as before. A collapsed panel clamps along the resize
|
|
214
|
+
axis to `--lr-multi-split-collapsed-panel-size` (default `var(--lr-size-2-5rem)`), carries a
|
|
215
|
+
`data-panel-collapsed` marker, clips its overflow, and stays rendered: the panel's own content
|
|
216
|
+
paints the strip (a rotated title, an expand control) under `[data-panel-collapsed]` and takes its
|
|
217
|
+
full content out of the tab order itself (for example `display: none` or `inert` on the hidden
|
|
218
|
+
region). Its share moves to the open panels in proportion to their sizes, never past a panel's
|
|
219
|
+
`panelConstraints` maximum (a capped panel's surplus goes to the others); its `sizes` entry reads
|
|
220
|
+
`0` while folded, and expanding restores the share it had when it folded, reclaimed from the open
|
|
221
|
+
panels' room above their minimums. Requires the full `panel-id` identity model (otherwise the set
|
|
222
|
+
is ignored); unknown ids are ignored, and at least one panel stays open (a set naming every panel
|
|
223
|
+
leaves the last one open). Assigning it is silent, like `sizes`; a `sizes` assignment made
|
|
224
|
+
together with it may already describe the fold (zero entries for the folded panels), otherwise a
|
|
225
|
+
`sizes` value with a non-zero entry for a folded panel is rejected like any invalid layout. A
|
|
226
|
+
valid `storageKey` layout restores the set, unless this property already names panels. The
|
|
227
|
+
responsive `collapse` pane is independent: while it is `'rail'`/`'floating'` its own state governs
|
|
228
|
+
that panel, and a per-panel fold of the same panel shows again once it is `'wide'`.
|
|
208
229
|
|
|
209
230
|
**Methods:** `expandPane()`, `collapsePane()` and `togglePane()` drive the collapse feature
|
|
210
231
|
semantically, each picking the mechanism the pane's *current band* provides rather than its pinned
|
|
@@ -220,6 +241,24 @@ write does not. They are named `…Pane()` rather than `expand()`/`collapse()`/`
|
|
|
220
241
|
`collapse` is already the pane-selection property, following `<lr-page>`'s `showNavigation()` trio.
|
|
221
242
|
The component still renders no trigger of its own — wire these to your own control.
|
|
222
243
|
|
|
244
|
+
`collapsePanel(panel)`, `expandPanel(panel)` and `togglePanel(panel)` fold and unfold one panel of
|
|
245
|
+
`collapsedPanels`; `panel` is its `panel-id` or the panel element. Each applies synchronously:
|
|
246
|
+
`sizes` is redistributed, the layout persists under `storageKey` (with the collapsed set), the panel
|
|
247
|
+
is decorated, and `lr-multi-split-panel-collapse-change` fires. Each returns whether anything
|
|
248
|
+
changed: `false` for an unknown panel, one already in the requested state, the last open panel, or a
|
|
249
|
+
split without valid `panel-id`s. Called before the first update, they only record the request,
|
|
250
|
+
silently. Wire them to a chevron in each panel's header and mirror the fold onto that control's
|
|
251
|
+
`aria-expanded` from the event or the `data-panel-collapsed` marker:
|
|
252
|
+
|
|
253
|
+
```js
|
|
254
|
+
split.addEventListener('lr-multi-split-panel-collapse-change', (event) => {
|
|
255
|
+
const { panelId, collapsed } = event.detail;
|
|
256
|
+
const toggle = split.querySelector(`[panel-id="${panelId}"] .toggle`);
|
|
257
|
+
toggle.setAttribute('aria-expanded', String(!collapsed));
|
|
258
|
+
});
|
|
259
|
+
toggleButton.addEventListener('click', () => split.togglePanel(toggleButton.closest('[panel-id]')));
|
|
260
|
+
```
|
|
261
|
+
|
|
223
262
|
`collapse`'s three resulting states — `'wide'` (default, today's plain layout) / `'rail'` / `'floating'`
|
|
224
263
|
— are exposed as: a `data-collapse-state` attribute on both the host and the collapsing panel element
|
|
225
264
|
itself (absent for `'wide'`/`collapse="none"`); and the `lr-multi-split-collapse-change` event below. The
|
|
@@ -265,7 +304,12 @@ Forced closes emit no request. Direct `open` writes and no-op dismissals emit ne
|
|
|
265
304
|
`lr-multi-split-constraints-invalid` (`detail: LyraMultiSplitConstraintIssueDetail`, fired once per configuration when the
|
|
266
305
|
configured panel minimums/maximums cannot fit the track; resizing the container does not repeat it; the infeasible set is rejected for interaction and a
|
|
267
306
|
normalized percent minimum is used instead), `lr-multi-split-orientation-change` (`detail: { orientation }`,
|
|
268
|
-
fired only when an enabled `orientationBreakpoint` actually changes `effectiveOrientation`)
|
|
307
|
+
fired only when an enabled `orientationBreakpoint` actually changes `effectiveOrientation`),
|
|
308
|
+
`lr-multi-split-panel-collapse-change` (`detail: LyraMultiSplitPanelCollapseChangeDetail = { panelId,
|
|
309
|
+
collapsed, collapsedPanels, sizes }`, an immutable snapshot fired when `collapsePanel()`,
|
|
310
|
+
`expandPanel()` or `togglePanel()` folds or unfolds a panel, after the redistributed `sizes` are
|
|
311
|
+
applied and persisted and the `data-panel-collapsed` marker is set; never for a direct
|
|
312
|
+
`collapsedPanels`/`sizes` assignment or a stored-layout restore)
|
|
269
313
|
|
|
270
314
|
**Slots:** default (each direct child element is one panel; set a unique `panel-id` on every child
|
|
271
315
|
when `storage-key` is used).
|
|
@@ -273,7 +317,9 @@ when `storage-key` is used).
|
|
|
273
317
|
**CSS parts:** `base` (`position: relative`, so the `'floating'` state can anchor to it), `divider`
|
|
274
318
|
(carries `aria-disabled="true"` and is drag/keyboard-inert while its adjacent panel is collapsed;
|
|
275
319
|
while that panel is `'floating'` it takes no track and paints no line, but stays focusable as the
|
|
276
|
-
collapse-focus fallback; beside a `'rail'` panel it keeps both
|
|
320
|
+
collapse-focus fallback; beside a `'rail'` panel it keeps both; beside a `collapsedPanels` panel it
|
|
321
|
+
instead resizes the nearest open panel on each side, reports that leading panel as `aria-valuenow`
|
|
322
|
+
and names those two panels in its label, and is disabled only when one side has no open panel),
|
|
277
323
|
`backdrop` (the `'floating'` drawer's scrim — only rendered while `collapseState === 'floating'` and
|
|
278
324
|
`open`)
|
|
279
325
|
|
|
@@ -304,6 +350,9 @@ needed against the inline style the component rewrites on every render.
|
|
|
304
350
|
`collapse` anchors the drawer to, so one declaration insets all three anchored edges; the free inline
|
|
305
351
|
edge stays governed by the panel's own width. Unset, the drawer is flush with its container exactly
|
|
306
352
|
as before.
|
|
353
|
+
`--lr-multi-split-collapsed-panel-size` (default `var(--lr-size-2-5rem)`) sets the rail a
|
|
354
|
+
`collapsedPanels` panel clamps to: its inline size in a horizontal split, its block size in a
|
|
355
|
+
vertical one. Set it on the split or an ancestor.
|
|
307
356
|
Otherwise shared tokens only.
|
|
308
357
|
|
|
309
358
|
**Optional peer deps:** none.
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
## `lr-native-time-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
|
The Lyra 7 browser-native time field preserved under an explicit tag. It shares the input
|
|
20
22
|
implementation with `lr-input`, forces its internal native input to `type="time"` on construction and reconnect, and retypes
|
|
21
23
|
`min`/`max` so time-shaped attributes such as `09:00:30` are forwarded verbatim instead of parsed
|