@aceshooting/lyra-ui 21.0.0 → 21.1.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 +56 -0
- package/README.md +6 -3
- package/custom-elements.json +1 -1
- package/dist/ai/runtime.js +1 -1
- package/dist/ai/types.d.ts +13 -5
- package/dist/cli/lyra-rename-ledger.mjs +1 -0
- package/dist/cli/migrate-wa.mjs +33 -13
- package/dist/cli/migration-contract.json +1 -1
- package/dist/components/agent-tools/agent-trace/agent-trace.class.d.ts +5 -3
- package/dist/components/agent-tools/agent-trace/agent-trace.class.js +3 -2
- package/dist/components/agent-tools/tool-call-block/tool-call-block.class.d.ts +15 -3
- package/dist/components/agent-tools/tool-call-block/tool-call-block.class.js +3 -3
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.d.ts +24 -8
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.js +3 -3
- package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js +4 -0
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.class.d.ts +9 -5
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.class.js +2 -2
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.styles.js +1 -1
- package/dist/components/agent-tools/tool-status.js +2 -2
- package/dist/components/agent-tools/tool-timeline/tool-timeline.class.d.ts +8 -0
- package/dist/components/agent-tools/tool-timeline/tool-timeline.class.js +3 -2
- package/dist/components/agent-tools/tool-timeline/tool-timeline.styles.js +1 -1
- package/dist/components/agent-tools/trace-tree/span.d.ts +2 -2
- package/dist/components/charts/chart/box-plot.class.d.ts +3 -1
- package/dist/components/charts/chart/box-plot.class.js +9 -9
- package/dist/components/charts/chart/chart-bidi.d.ts +109 -0
- package/dist/components/charts/chart/chart-bidi.js +1 -0
- package/dist/components/charts/chart/chart.class.d.ts +17 -2
- package/dist/components/charts/chart/chart.class.js +10 -8
- package/dist/components/charts/chart/histogram.class.js +1 -1
- package/dist/components/charts/chart/lite-chart.class.d.ts +24 -5
- package/dist/components/charts/chart/lite-chart.class.js +9 -9
- package/dist/components/charts/chart/lite-chart.styles.js +1 -1
- package/dist/components/conversation/code-block/shiki-dark-theme.d.ts +2 -2
- package/dist/components/conversation/code-block/shiki-dark-theme.js +1 -1
- package/dist/components/conversation/conversation-item/conversation-item.class.d.ts +18 -2
- package/dist/components/conversation/conversation-item/conversation-item.class.js +3 -3
- package/dist/components/conversation/conversation-item/conversation-item.styles.js +1 -1
- package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
- package/dist/components/conversation/markdown/markdown-core.class.d.ts +3 -1
- package/dist/components/conversation/markdown/markdown.class.d.ts +3 -1
- package/dist/components/conversation/message-actions/message-actions.class.d.ts +7 -2
- package/dist/components/conversation/message-actions/message-actions.class.js +2 -2
- package/dist/components/conversation/message-parts/message-parts.class.d.ts +6 -2
- package/dist/components/conversation/message-parts/message-parts.class.js +5 -3
- package/dist/components/conversation/selection-toolbar/selection-toolbar.class.d.ts +3 -2
- package/dist/components/conversation/selection-toolbar/selection-toolbar.class.js +1 -1
- package/dist/components/conversation/streaming-text/streaming-text-base.class.d.ts +1 -5
- 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 +7 -1
- package/dist/components/conversation/streaming-text/streaming-text-core.class.js +3 -4
- package/dist/components/conversation/streaming-text/streaming-text.class.d.ts +7 -1
- package/dist/components/conversation/streaming-text/streaming-text.class.js +3 -4
- package/dist/components/conversation/thread-list/thread-list.class.d.ts +13 -2
- package/dist/components/conversation/thread-list/thread-list.class.js +3 -3
- package/dist/components/data/data-grid/data-grid.class.js +1 -1
- package/dist/components/data/document-library/document-library.class.js +2 -0
- package/dist/components/data/flow-canvas/flow-canvas.class.js +1 -1
- package/dist/components/data/flow-minimap/flow-minimap.class.js +1 -1
- package/dist/components/data/flow-node/flow-node.class.d.ts +6 -2
- package/dist/components/data/flow-node/flow-node.class.js +6 -2
- package/dist/components/data/flow-node/flow-node.styles.js +1 -1
- package/dist/components/data/gauge/gauge.styles.js +1 -1
- package/dist/components/data/heatmap/heatmap.class.d.ts +3 -0
- package/dist/components/data/heatmap/heatmap.class.js +2 -2
- package/dist/components/data/heatmap/heatmap.styles.js +1 -1
- package/dist/components/data/sparkline/sparkline.class.d.ts +5 -3
- package/dist/components/data/stat/stat.class.d.ts +4 -3
- package/dist/components/data/table/table.class.d.ts +32 -5
- package/dist/components/data/table/table.class.js +3 -2
- package/dist/components/forms/button/button.class.d.ts +7 -1
- package/dist/components/forms/button/button.styles.js +1 -1
- package/dist/components/forms/date-picker/date-input.styles.js +1 -1
- package/dist/components/forms/input/input.styles.js +1 -1
- package/dist/components/forms/rubric-form/rubric-form.class.js +1 -0
- package/dist/components/layout/app-rail/app-rail.class.d.ts +50 -11
- package/dist/components/layout/app-rail/app-rail.class.js +2 -2
- package/dist/components/layout/command-palette/command-palette.class.js +1 -1
- package/dist/components/layout/menu/menu.class.d.ts +6 -5
- package/dist/components/layout/split-panel/split-panel.class.d.ts +2 -1
- package/dist/components/media/flag/language-map.d.ts +8 -0
- package/dist/components/media/flag/language-map.js +1 -1
- package/dist/components/media/map/map-loader.d.ts +7 -1
- package/dist/components/media/map/map.class.d.ts +111 -5
- package/dist/components/media/map/map.class.js +3 -3
- package/dist/components/media/media-card/media-card.class.d.ts +18 -5
- package/dist/components/media/media-card/media-card.class.js +1 -1
- package/dist/components/overlays/overlay/popover.class.d.ts +20 -0
- package/dist/components/overlays/overlay/popover.class.js +2 -2
- package/dist/components/retrieval/graph/graph.class.d.ts +3 -3
- package/dist/components/retrieval/graph/graph.class.js +1 -1
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +5 -3
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +3 -2
- package/dist/components/retrieval/mind-map/mind-map.class.d.ts +3 -3
- package/dist/components/retrieval/mind-map/mind-map.class.js +1 -1
- package/dist/components/retrieval/retrieval-results/retrieval-results.class.d.ts +4 -1
- package/dist/components/retrieval/retrieval-results/retrieval-results.class.js +5 -1
- package/dist/components/retrieval/source-picker/source-picker.class.d.ts +4 -1
- package/dist/components/retrieval/source-picker/source-picker.class.js +5 -1
- package/dist/components/utility/icon/icon.class.d.ts +9 -3
- package/dist/components/utility/icon/icon.class.js +1 -1
- package/dist/components/utility/mutation-observer/mutation-observer.class.d.ts +14 -8
- package/dist/components/utility/mutation-observer/mutation-observer.class.js +1 -1
- package/dist/components/viewers/document-viewer/document-viewer.class.d.ts +6 -1
- package/dist/components/viewers/document-viewer/document-viewer.class.js +7 -1
- package/dist/components/viewers/document-viewer/registry.d.ts +12 -3
- package/dist/components/viewers/geojson-view/geojson-view.class.d.ts +13 -5
- package/dist/components/viewers/geojson-view/geojson-view.class.js +1 -1
- package/dist/components/viewers/geojson-view/geojson-viewer.class.d.ts +3 -2
- package/dist/custom-elements-jsx.d.ts +1 -1
- package/dist/events.d.ts +644 -1242
- package/dist/internal/anchored-overlay-runtime.d.ts +2 -2
- package/dist/internal/cell-range.d.ts +0 -6
- package/dist/internal/cell-range.js +1 -1
- package/dist/internal/css-token-length.d.ts +7 -0
- package/dist/internal/css-token-length.js +1 -0
- package/dist/internal/default-strings.generated.d.ts +1 -1
- package/dist/internal/default-strings.generated.js +1 -1
- package/dist/internal/deferred-focus-return.d.ts +7 -4
- package/dist/internal/deferred-focus-return.js +1 -1
- package/dist/internal/dev-mode-attribute-warning.d.ts +35 -0
- package/dist/internal/dev-mode-attribute-warning.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 +2 -2
- package/dist/internal/package-metadata.d.ts +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/papaparse-loader.d.ts +1 -1
- package/dist/internal/papaparse-loader.js +1 -1
- package/dist/internal/positioner.d.ts +10 -0
- package/dist/internal/positioner.js +1 -1
- package/dist/internal/shared-unions.d.ts +2 -1
- package/dist/internal/slotted-overlay-controller.d.ts +20 -0
- package/dist/internal/slotted-overlay-controller.js +1 -0
- package/dist/internal/text-quote.d.ts +1 -1
- package/dist/internal/text-quote.js +1 -1
- package/dist/internal/theme-observation.d.ts +4 -0
- package/dist/internal/theme-observation.js +1 -0
- package/dist/internal/theme-watcher.js +1 -1
- package/dist/localization.d.ts +6 -1
- package/dist/localization.js +1 -1
- package/dist/lyra.d.ts +1 -1
- package/dist/lyra.js +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/testing/lyra-tag-event-map.js +1 -1
- package/dist/translations/ar/agent-tools.js +1 -1
- package/dist/translations/cs/agent-tools.js +1 -1
- package/dist/translations/da/agent-tools.js +1 -1
- package/dist/translations/de/agent-tools.js +1 -1
- package/dist/translations/de-CH/agent-tools.js +1 -1
- package/dist/translations/es/agent-tools.js +1 -1
- package/dist/translations/fa/agent-tools.js +1 -1
- package/dist/translations/fi/agent-tools.js +1 -1
- package/dist/translations/fr/agent-tools.js +1 -1
- package/dist/translations/he/agent-tools.js +1 -1
- package/dist/translations/hi/agent-tools.js +1 -1
- package/dist/translations/hr/agent-tools.js +1 -1
- package/dist/translations/hu/agent-tools.js +1 -1
- package/dist/translations/id/agent-tools.js +1 -1
- package/dist/translations/it/agent-tools.js +1 -1
- package/dist/translations/ja/agent-tools.js +1 -1
- package/dist/translations/kk/agent-tools.js +1 -1
- package/dist/translations/ko/agent-tools.js +1 -1
- package/dist/translations/nb/agent-tools.js +1 -1
- package/dist/translations/nl/agent-tools.js +1 -1
- package/dist/translations/nn/agent-tools.js +1 -1
- package/dist/translations/pl/agent-tools.js +1 -1
- package/dist/translations/pt-BR/agent-tools.js +1 -1
- package/dist/translations/pt-PT/agent-tools.js +1 -1
- package/dist/translations/pt-PT/charts.js +1 -1
- package/dist/translations/pt-PT/conversation.js +1 -1
- package/dist/translations/pt-PT/data.js +1 -1
- package/dist/translations/pt-PT/forms.js +1 -1
- package/dist/translations/pt-PT/layout.js +1 -1
- package/dist/translations/pt-PT/media.js +1 -1
- package/dist/translations/pt-PT/retrieval.js +1 -1
- package/dist/translations/pt-PT/shared.js +1 -1
- package/dist/translations/pt-PT/utility.js +1 -1
- package/dist/translations/pt-PT/viewers.js +2 -2
- package/dist/translations/ro/agent-tools.js +1 -1
- package/dist/translations/ru/agent-tools.js +1 -1
- package/dist/translations/sl/agent-tools.js +1 -1
- package/dist/translations/sv/agent-tools.js +1 -1
- package/dist/translations/tr/agent-tools.js +1 -1
- package/dist/translations/uk/agent-tools.js +1 -1
- package/dist/translations/zh-CN/agent-tools.js +1 -1
- package/dist/translations/zh-TW/agent-tools.js +1 -1
- package/dist/utilities/index.d.ts +1 -1
- package/dist/utilities/index.js +1 -1
- package/dist/utilities/localization.d.ts +28 -10
- package/dist/vue.d.ts +1 -1
- package/llms/components/lr-accordion-item.md +2 -344
- package/llms/components/lr-accordion.md +2 -344
- package/llms/components/lr-app-rail-group.md +2 -721
- package/llms/components/lr-app-rail-item.md +2 -721
- package/llms/components/lr-app-rail.md +29 -4
- package/llms/components/lr-bar-chart.md +2 -87
- package/llms/components/lr-box-plot.md +1 -1
- package/llms/components/lr-breadcrumb-item.md +2 -67
- package/llms/components/lr-bubble-chart.md +2 -87
- package/llms/components/lr-button.md +7 -0
- package/llms/components/lr-chart.md +4 -5
- package/llms/components/lr-chip-group.md +2 -272
- package/llms/components/lr-conversation-item.md +20 -2
- package/llms/components/lr-date-input.md +2 -457
- package/llms/components/lr-date-picker.md +6 -2
- package/llms/components/lr-document-library.md +3 -3
- package/llms/components/lr-document-viewer.md +14 -5
- package/llms/components/lr-doughnut-chart.md +2 -87
- package/llms/components/lr-dropdown-item.md +2 -306
- package/llms/components/lr-dropdown.md +6 -0
- package/llms/components/lr-flag.md +9 -1
- package/llms/components/lr-flow-node.md +4 -1
- package/llms/components/lr-geojson-view.md +3 -90
- package/llms/components/lr-geojson-viewer.md +13 -5
- package/llms/components/lr-icon-button.md +4 -1
- package/llms/components/lr-icon.md +14 -6
- package/llms/components/lr-input.md +9 -2
- package/llms/components/lr-lite-chart.md +17 -9
- package/llms/components/lr-map.md +87 -2
- package/llms/components/lr-markdown-core.md +5 -4
- package/llms/components/lr-markdown.md +4 -2
- package/llms/components/lr-media-card.md +10 -5
- package/llms/components/lr-menu-item.md +2 -306
- package/llms/components/lr-menu.md +9 -6
- package/llms/components/lr-menubar-item.md +2 -125
- package/llms/components/lr-message-actions.md +4 -1
- package/llms/components/lr-message-parts.md +14 -5
- package/llms/components/lr-mutation-observer.md +12 -6
- package/llms/components/lr-navigation-menu-item.md +2 -237
- package/llms/components/lr-number-input.md +4 -0
- package/llms/components/lr-option.md +2 -712
- package/llms/components/lr-pie-chart.md +2 -87
- package/llms/components/lr-polar-area-chart.md +2 -87
- package/llms/components/lr-popover.md +10 -0
- package/llms/components/lr-prompt-input.md +5 -1
- package/llms/components/lr-radar-chart.md +2 -87
- package/llms/components/lr-reorder-item.md +2 -157
- package/llms/components/lr-result-field.md +2 -117
- package/llms/components/lr-retrieval-results.md +3 -1
- package/llms/components/lr-rubric-form.md +3 -2
- package/llms/components/lr-scatter-chart.md +2 -87
- package/llms/components/lr-selection-toolbar.md +4 -2
- package/llms/components/lr-source-card.md +2 -186
- package/llms/components/lr-source-picker.md +3 -1
- package/llms/components/lr-sparkline.md +9 -4
- package/llms/components/lr-split-panel.md +5 -3
- package/llms/components/lr-stat.md +4 -3
- package/llms/components/lr-streaming-text-core.md +7 -5
- package/llms/components/lr-streaming-text.md +9 -6
- package/llms/components/lr-swatch-picker.md +130 -0
- package/llms/components/lr-tag.md +2 -177
- package/llms/components/lr-thread-list.md +27 -4
- package/llms/components/lr-timeline-item.md +2 -120
- package/llms/components/lr-toast-item.md +2 -223
- package/llms/components/lr-tool-call-block.md +12 -3
- package/llms/components/lr-tool-call-chip.md +12 -6
- package/llms/components/lr-tool-param-form.md +3 -2
- package/llms/components/lr-tool-result-dialog.md +7 -3
- package/llms/components/lr-tool-result-view.md +4 -3
- package/llms/components/lr-tool-timeline.md +12 -5
- package/llms/components/lr-tree-item.md +2 -354
- package/llms/index.md +22 -4
- package/llms/migration.md +75 -1
- package/llms/peers.md +1 -1
- package/llms/shared.md +86 -39
- package/llms-full.txt +739 -163
- package/package.json +6 -6
- package/registrations.json +1 -1
- package/vscode-css-data.json +1 -1
- package/vscode-html-data.json +1 -1
- package/web-types.json +1 -1
|
@@ -9,310 +9,6 @@
|
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [llms-full.txt](../../llms-full.txt)
|
|
10
10
|
- **Deprecations** none
|
|
11
11
|
- **Optional peers** none
|
|
12
|
-
- **Themeable via** 12 parts, 16 custom properties — see
|
|
13
|
-
- **Documented with** `lr-menu
|
|
12
|
+
- **Themeable via** 12 parts, 16 custom properties — see `lr-menu.md`
|
|
13
|
+
- **Documented with** `lr-menu`: see [lr-menu.md](./lr-menu.md).
|
|
14
14
|
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## `lr-menu` / `lr-menu-item`
|
|
19
|
-
|
|
20
|
-
The inline semantic menu mapped from Shoelace's `sl-menu`, plus its action-row element. A root
|
|
21
|
-
`<lr-menu>` is always visible and owns the named `role="menu"` list, real roving DOM focus,
|
|
22
|
-
wrapping keyboard navigation, type-ahead, and one canonical selection event. It deliberately has no
|
|
23
|
-
trigger, positioned popup, root open state, placement API, or overlay lifecycle.
|
|
24
|
-
|
|
25
|
-
Removing or disabling the remembered active item repairs the roving stop without taking focus from
|
|
26
|
-
outside controls or the menu's header/footer. If the changed item held actual focus, focus moves to
|
|
27
|
-
a valid survivor or through the existing owner dismissal path when none remain.
|
|
28
|
-
|
|
29
|
-
For a menu button or other anchored overlay, compose the semantic controller inside
|
|
30
|
-
`<lr-dropdown>`:
|
|
31
|
-
|
|
32
|
-
```html
|
|
33
|
-
<lr-dropdown label="Row actions">
|
|
34
|
-
<button slot="trigger" aria-label="Row actions">⋮</button>
|
|
35
|
-
<lr-menu>
|
|
36
|
-
<lr-menu-item value="edit">Edit</lr-menu-item>
|
|
37
|
-
<lr-menu-item value="delete" variant="danger">Delete</lr-menu-item>
|
|
38
|
-
</lr-menu>
|
|
39
|
-
</lr-dropdown>
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
The dropdown shell owns trigger relationships, positioning, opening/closing, outside dismissal,
|
|
43
|
-
focus return, and lifecycle events. The contained menu remains the sole semantic owner: its
|
|
44
|
-
`header`/default/`footer` regions and named `role="menu"` list are preserved, while the outer popup
|
|
45
|
-
is neutral. This is also the composition used for direct `<lr-dropdown-item>` children.
|
|
46
|
-
|
|
47
|
-
### `lr-menu`
|
|
48
|
-
|
|
49
|
-
**Properties:**
|
|
50
|
-
|
|
51
|
-
- `label?: string` — accessible name for the `role="menu"` list. A host `aria-label`
|
|
52
|
-
attribute is authoritative, including `aria-label=""`; any supplied `label` follows (including `"Menu"` or
|
|
53
|
-
`""`),
|
|
54
|
-
then a containing dropdown's supplied fallback, then the localized menu label. Omission,
|
|
55
|
-
not comparison with an English sentinel, is what selects localization.
|
|
56
|
-
- `dropdownOpen: boolean = false` (attribute: false) — the containing dropdown's controlled open
|
|
57
|
-
state, used to synchronize the menu interaction engine while it is rendered inside a popup.
|
|
58
|
-
|
|
59
|
-
**Events:**
|
|
60
|
-
|
|
61
|
-
- `lr-select` — cancelable, with `detail: { item }`. It originates exactly once at the menu that
|
|
62
|
-
owns the activated item, then bubbles unchanged through ancestor menus and a containing dropdown.
|
|
63
|
-
Preventing it anywhere keeps the current menu/submenu chain open. There are no
|
|
64
|
-
`lr-menu-select`, `lr-menu-item-select`, or nested-selection aliases.
|
|
65
|
-
|
|
66
|
-
**Slots:** default (`<lr-menu-item>`/`<lr-dropdown-item>` plus semantic separators), `header`, and
|
|
67
|
-
`footer`. Header and footer are composed controls or explanatory regions outside the
|
|
68
|
-
`role="menu"` list, so filters, counts, or footer actions do not violate the menu required-child
|
|
69
|
-
contract. Arbitrary non-item content in the default slot still renders, but is not enrolled as a
|
|
70
|
-
menu item.
|
|
71
|
-
|
|
72
|
-
**CSS parts:** `header`, `list`, and `footer`. Root `trigger` and `popup` parts do not exist;
|
|
73
|
-
style those on `<lr-dropdown>` when using the overlay composition.
|
|
74
|
-
|
|
75
|
-
**Themeable custom properties:** the standalone menu surface and a submenu's own surface paint from
|
|
76
|
-
the **shared overlay-surface family** (16.0.0) — `--lr-overlay-surface` (default
|
|
77
|
-
`var(--lr-color-surface-overlay)`), `--lr-overlay-border` (default `var(--lr-color-border-subtle)`),
|
|
78
|
-
`--lr-overlay-radius` (default `var(--lr-radius)`) and, on the submenu only,
|
|
79
|
-
`--lr-overlay-shadow-anchored` (default `var(--lr-shadow-m)`). None is declared on `:host`, so one
|
|
80
|
-
declaration on `:root` (or on any ancestor, to scope it) retints this menu together with every other
|
|
81
|
-
floating surface. A menu contained by `<lr-dropdown>` paints no surface of its own, so the family has
|
|
82
|
-
no effect there — the dropdown's popup carries it. The header/footer dividing rules and a slotted
|
|
83
|
-
`<hr>` deliberately stay outside the family on the decorative `--lr-color-border-subtle`: they
|
|
84
|
-
separate content rather than draw the surface's edge. Otherwise shared spacing and motion tokens.
|
|
85
|
-
Row chrome is controlled through the menu-item properties listed below.
|
|
86
|
-
|
|
87
|
-
Width is a pair, applied to the standalone surface and to a submenu's own surface alike:
|
|
88
|
-
`--lr-menu-max-inline-size` (default `var(--lr-size-20rem)`) and `--lr-menu-min-inline-size`
|
|
89
|
-
(default `var(--lr-size-10rem)`). They move together — the floor wins over the ceiling, so capping
|
|
90
|
-
alone cannot take a menu below 10rem. Neither is declared on `:host`, so an ancestor theme wrapper's
|
|
91
|
-
value reaches the menu. The ceiling takes a length or a percentage; `100%` and `none` both uncap it
|
|
92
|
-
to the container, and any other value outside `<length-percentage>` is treated as `none` rather than
|
|
93
|
-
dropping the cap's safety terms. Those terms — the shared `--lr-popover-viewport-clamp` and the
|
|
94
|
-
container allocation — are applied outside the name, so no value of the hook can make a menu wider
|
|
95
|
-
than its container or the viewport. (That guarantee is enforced by a registered custom property, so
|
|
96
|
-
an out-of-syntax value falls back cleanly instead of invalidating the whole declaration; an engine
|
|
97
|
-
without `CSS.registerProperty` degrades to "use `100%`, not `none`".) A menu contained by
|
|
98
|
-
`<lr-dropdown>` sizes from its dropdown and is unaffected by both names.
|
|
99
|
-
|
|
100
|
-
**`--lr-positioning-strategy`** (16.0.0) — the private submenu surface reads this same cascading
|
|
101
|
-
`absolute`/`fixed` override documented on `<lr-popover>` when it is (re)positioned, falling back to
|
|
102
|
-
its own `fixed` default when nothing is set. There is no per-instance `positioning-strategy`
|
|
103
|
-
property on `<lr-menu>`; set the custom property on `:root`, a theme, or one clipping ancestor to
|
|
104
|
-
change every unset submenu beneath it. A menu contained by `<lr-dropdown>` is positioned by the
|
|
105
|
-
dropdown instead and is unaffected.
|
|
106
|
-
|
|
107
|
-
**Methods:** no menu-specific public overlay methods. Use `<lr-dropdown>`'s `show()`/`hide()` and
|
|
108
|
-
`open` state for an overlay. Menu-item submenu methods remain public because they drive a row's
|
|
109
|
-
nested disclosure.
|
|
110
|
-
|
|
111
|
-
**Keyboard and focus:** exactly one navigable row has `tabindex="0"`. ArrowDown/ArrowUp wrap;
|
|
112
|
-
Home/End move to the first/last navigable row; Enter/Space activate; printable input performs
|
|
113
|
-
locale-aware type-ahead. Rows that are disabled, loading, hidden, `aria-hidden`, inert, or inside an
|
|
114
|
-
inert subtree are skipped. Navigation is repaired live when those states or light-DOM membership
|
|
115
|
-
change. A root inline menu does not consume Escape or turn Tab into overlay dismissal; a containing
|
|
116
|
-
dropdown owns those root-level behaviors.
|
|
117
|
-
|
|
118
|
-
### `lr-menu-item`
|
|
119
|
-
|
|
120
|
-
A focusable action row owned by `<lr-menu>`. The host itself carries `role="menuitem"` (or
|
|
121
|
-
`menuitemcheckbox`/`menuitemradio`) and roving `tabindex`; `[part="base"]` is only the visual row.
|
|
122
|
-
|
|
123
|
-
**Properties:**
|
|
124
|
-
|
|
125
|
-
- `value: string = ''` — identifier available as `event.detail.item.value` on `lr-select`
|
|
126
|
-
- `size: '2xs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'small' | 'medium' | 'large' = 'm'`
|
|
127
|
-
- `disabled: boolean = false`
|
|
128
|
-
- `variant: 'default' | 'danger' = 'default'`
|
|
129
|
-
- `type: 'normal' | 'checkbox' | 'radio' = 'normal'`
|
|
130
|
-
- `checked: boolean = false` — meaningful only for `type="checkbox"`/`type="radio"`
|
|
131
|
-
- `group?: string` — narrows a `type="radio"` item's exclusive-choice scope to only the other
|
|
132
|
-
radio items sharing this same string. Unset, the scope is every `type="radio"` item the same
|
|
133
|
-
owning `<lr-menu>` owns directly — a nested submenu's radio items belong to that submenu's own
|
|
134
|
-
`<lr-menu>` instead, so they're never in scope regardless of `group`. Meaningless for
|
|
135
|
-
`type="normal"`/`"checkbox"`
|
|
136
|
-
- `loading: boolean = false`
|
|
137
|
-
- `href?: string` — when set to a safe link URL (`http:`/`https:`/`blob:`/`mailto:`/relative; see
|
|
138
|
-
`safeLinkHref`, or `safeDownloadHref` when `download` is set, which drops `mailto:`),
|
|
139
|
-
`[part="base"]` renders as a real `<a href=…>` instead of a `<span>`, and activation (click, or
|
|
140
|
-
the owning menu's Enter/Space handling, which forwards through `click()` for a link item so the
|
|
141
|
-
anchor's own native default action runs) navigates there in addition to firing the usual
|
|
142
|
-
`select()`/`lr-select` contract. An unsafe/unparseable value falls back to the plain `<span>`,
|
|
143
|
-
matching `lr-button`'s identical fallback
|
|
144
|
-
- `target?: string` — native anchor `target`, used only while `href` resolves to a link. Setting it
|
|
145
|
-
(e.g. `'_blank'`) always force-adds `noopener noreferrer` to the rendered anchor's `rel`,
|
|
146
|
-
matching `lr-button`'s identical pattern
|
|
147
|
-
- `rel?: string` — independently settable author relationship tokens, no default. Author tokens are
|
|
148
|
-
merged rather than replaced: `opener` is always stripped, and whenever `target` is set the
|
|
149
|
-
non-removable `noopener noreferrer` floor is added, so a same-tab link (no `target`) keeps
|
|
150
|
-
exactly the author's tokens while a link opening a new context can never lose the guard
|
|
151
|
-
- `download?: string` — native anchor `download` attribute, used only while `href` resolves to a
|
|
152
|
-
link. Presence narrows the safe-URL allowlist to `safeDownloadHref`'s, which drops `mailto:` — a
|
|
153
|
-
mail handoff names no retrievable bytes, so it cannot be a download target
|
|
154
|
-
- `hasSubmenu: boolean` (read-only)
|
|
155
|
-
- `submenuOpen: boolean = false` — transient live state; assigning it drives an existing submenu
|
|
156
|
-
without moving focus and disconnect resets it
|
|
157
|
-
|
|
158
|
-
**Methods:**
|
|
159
|
-
|
|
160
|
-
- `click(): void` forwards programmatic activation through the visual-row path
|
|
161
|
-
- `select(): void` activates through the current owning menu; it is inert while disabled/loading
|
|
162
|
-
- `openSubmenu(focus: 'first' | 'last' | 'none' = 'first'): Promise<void>`
|
|
163
|
-
- `closeSubmenu(): Promise<void>`
|
|
164
|
-
- `getTextLabel(): string` returns the accessibility-visible label used by type-ahead
|
|
165
|
-
|
|
166
|
-
The computed name is derived from the row's own visible label and does not depend on whether the
|
|
167
|
-
menu is currently displayed, so a row inside a closed dropdown — whose popup is `visibility:
|
|
168
|
-
hidden` — is named the same as an open one, and `getTextLabel()` drives type-ahead either way.
|
|
169
|
-
A row with no label text carries **no** `aria-label` attribute rather than an empty one, so the
|
|
170
|
-
browser falls back to the row's own content; an `aria-label` or `aria-labelledby` you set yourself,
|
|
171
|
-
including an explicitly empty value, still wins.
|
|
172
|
-
|
|
173
|
-
A checkbox activation first emits cancelable `lr-menu-item-change` with the proposed
|
|
174
|
-
`detail: { value, checked }`. Preventing that event retains the current checked state; the owning
|
|
175
|
-
menu's canonical `lr-select` still follows. A submenu parent is a disclosure instead of an action:
|
|
176
|
-
activation opens its submenu and emits neither checkbox-change nor selection.
|
|
177
|
-
|
|
178
|
-
A `type="radio"` item works the same way, with exclusive-choice semantics layered on top:
|
|
179
|
-
activating an already-checked radio is a no-op on `checked` — no `lr-menu-item-change`, no state
|
|
180
|
-
change, matching native `<input type="radio">` — but still falls through to the owning menu's
|
|
181
|
-
usual selection. Activating an unchecked radio fires `lr-menu-item-change` with
|
|
182
|
-
`checked: true`; once not prevented, this item becomes `checked` and every other `type="radio"`
|
|
183
|
-
item the same owning `<lr-menu>` owns directly whose `group` matches is unchecked directly
|
|
184
|
-
(without an `lr-menu-item-change` of its own).
|
|
185
|
-
|
|
186
|
-
**Events:**
|
|
187
|
-
|
|
188
|
-
- `lr-menu-item-change` — cancelable checkbox/radio-state proposal; never fired when activating an
|
|
189
|
-
already-checked radio
|
|
190
|
-
- `lr-menu-item-state-change` — internal navigation repair signal with
|
|
191
|
-
`detail: { disabled, hidden, inert }`; the owning menu consumes and contains it, so it does not
|
|
192
|
-
escape a menu or a composite wrapper as an apparent public event
|
|
193
|
-
|
|
194
|
-
Item activation itself is private owner plumbing, not a public child event. Listen for `lr-select`
|
|
195
|
-
on the owning menu.
|
|
196
|
-
|
|
197
|
-
**Slots:** default label, `icon`, `prefix`, `details`, `suffix`, and `submenu`. Display slots are
|
|
198
|
-
inert visual content; their accessibility-visible default-slot text names the focusable host. The
|
|
199
|
-
submenu slot accepts either one nested `<lr-menu>` or direct mapped items. Long `details` and
|
|
200
|
-
`suffix` content shrinks and ellipsizes within the allocated row in both directions rather than
|
|
201
|
-
expanding the popup.
|
|
202
|
-
|
|
203
|
-
**CSS parts:** `base`, `icon`, `prefix`, `label`, `details`, `suffix`, `checkmark`,
|
|
204
|
-
`checked-icon`, `spinner`, `spinner__base`, `submenu-icon`, and `submenu`.
|
|
205
|
-
|
|
206
|
-
**Themeable custom properties:** `--lr-menu-item-gap`, `--lr-menu-item-radius`,
|
|
207
|
-
`--lr-menu-item-danger-color`, `--lr-menu-item-danger-hover-bg`,
|
|
208
|
-
`--lr-menu-item-danger-active-bg`, `--lr-menu-item-checked-bg` (default `transparent`),
|
|
209
|
-
`--lr-menu-item-checked-color` (default `inherit`), `--lr-menu-item-checked-font-weight` (default
|
|
210
|
-
`inherit`), and `--submenu-offset`, plus shared size/focus/color/spacing tokens. The checked hooks
|
|
211
|
-
apply to a `type="checkbox" checked` or `type="radio" checked` row's `[part="base"]`, matching the
|
|
212
|
-
checked/selected-state hooks `<lr-option>`, `<lr-select>`, `<lr-combobox>`, and `<lr-tree-item>`
|
|
213
|
-
already expose; unset, a checked row paints identically to an unchecked one.
|
|
214
|
-
|
|
215
|
-
Four more row-chrome hooks land in 16.0.0, each an inline fallback so unset rendering is
|
|
216
|
-
byte-identical: `--lr-menu-item-hover-bg` (default `var(--lr-color-brand-quiet)`) is the enabled
|
|
217
|
-
row's fill under the pointer, and the pressed state mixes from that same value, so a retuned hover
|
|
218
|
-
fill keeps its pressed step instead of snapping back to the brand default; `--lr-menu-item-active-bg`
|
|
219
|
-
(default `color-mix(in oklab, var(--lr-menu-item-hover-bg, var(--lr-color-brand-quiet)),
|
|
220
|
-
var(--lr-color-mix-partner) var(--lr-color-mix-active))`) overrides that pressed fill directly,
|
|
221
|
-
matching `--lr-option-active-bg`'s equivalent hook — unset, the pressed row keeps mixing from
|
|
222
|
-
`--lr-menu-item-hover-bg` exactly as before this hook existed; `--lr-menu-item-icon-color` (default
|
|
223
|
-
`inherit`) recolours `[part="icon"]` without touching the label beside it, so it still follows the
|
|
224
|
-
row while the row is disabled or `variant="danger"` unless you say otherwise; and
|
|
225
|
-
`--lr-menu-item-min-height` (default `max(var(--lr-form-control-height), var(--lr-size-24px))`)
|
|
226
|
-
sets the row's minimum block size for a denser or roomier menu, replacing a `::part(base)` rule per
|
|
227
|
-
item. A value below the 24px floor is your call, exactly as it is when overriding the shared ladder
|
|
228
|
-
itself.
|
|
229
|
-
|
|
230
|
-
Any element assigned to `details` counts as content, including a shadow-rendered
|
|
231
|
-
`<lr-kbd slot="details" keys="mod+t">` chip or an icon. An intentionally empty placeholder element
|
|
232
|
-
also shows the part and reserves one `--lr-menu-item-gap`; whitespace-only text and empty forwarding
|
|
233
|
-
slots keep the part hidden. This also applies to `lr-dropdown-item`.
|
|
234
|
-
|
|
235
|
-
### Nested submenus
|
|
236
|
-
|
|
237
|
-
Both supported authoring shapes use the `submenu` slot:
|
|
238
|
-
|
|
239
|
-
```html
|
|
240
|
-
<lr-menu label="Share actions">
|
|
241
|
-
<lr-menu-item value="share">
|
|
242
|
-
Share
|
|
243
|
-
<lr-menu slot="submenu" label="Share options">
|
|
244
|
-
<lr-menu-item value="email">Email</lr-menu-item>
|
|
245
|
-
<lr-menu-item value="link">Copy link</lr-menu-item>
|
|
246
|
-
</lr-menu>
|
|
247
|
-
</lr-menu-item>
|
|
248
|
-
</lr-menu>
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
```html
|
|
252
|
-
<lr-dropdown-item>
|
|
253
|
-
Share
|
|
254
|
-
<lr-dropdown-item slot="submenu" value="email">Email</lr-dropdown-item>
|
|
255
|
-
<lr-dropdown-item slot="submenu" value="link">Copy link</lr-dropdown-item>
|
|
256
|
-
</lr-dropdown-item>
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
The submenu presentation is private to the parent row, not a second root-menu API. A submenu parent
|
|
260
|
-
has `aria-haspopup="menu"`, explicit `aria-expanded="true|false"`, the transient
|
|
261
|
-
`submenu-open` state, and a logical-direction chevron. Its submenu is named from the parent's
|
|
262
|
-
accessible label unless the submenu supplies its own `aria-label` or non-default `label`.
|
|
263
|
-
|
|
264
|
-
The into-branch and back-out arrow keys swap under RTL. Enter/Space and the into key open and focus
|
|
265
|
-
the first child; the back-out key and Escape close only the innermost branch and return focus to its
|
|
266
|
-
parent row. Pointer hover uses an intent delay, outside pointer dismissal closes the branch, and at
|
|
267
|
-
most one branch per level is open. Selection bubbles as the same single `lr-select`; a non-vetoed
|
|
268
|
-
selection closes the full nested chain.
|
|
269
|
-
|
|
270
|
-
### `lr-dropdown-item`
|
|
271
|
-
|
|
272
|
-
The Web Awesome-compatible name for the same item implementation. It shares all menu-item
|
|
273
|
-
properties, slots, parts, methods, checkbox/radio/state events, roving focus, and canonical parent
|
|
274
|
-
`lr-select` behavior. Its host also exposes native, non-bubbling, composed `focus` and `blur`
|
|
275
|
-
events.
|
|
276
|
-
|
|
277
|
-
**Attributes:** `href`, `target`, `rel`, and `download` — the same link-rendering properties
|
|
278
|
-
documented above for `<lr-menu-item>`, settable directly in markup
|
|
279
|
-
(`<lr-dropdown-item href="/settings" target="_blank">`). The `rel` guard is identical: author
|
|
280
|
-
tokens merge rather than get replaced, `opener` is always stripped, and setting `target` force-adds
|
|
281
|
-
the non-removable `noopener noreferrer` floor, so a same-tab link keeps exactly the author's tokens
|
|
282
|
-
while a link opening a new context can never lose the guard.
|
|
283
|
-
|
|
284
|
-
**Events:** native, non-bubbling, composed, non-cancelable `focus` and `blur` (`FocusEvent`) when
|
|
285
|
-
the focusable host gains or loses focus, plus the shared menu-item events above.
|
|
286
|
-
|
|
287
|
-
**Themeable custom properties:** every `<lr-menu-item>` hook above, including 16.0.0's
|
|
288
|
-
`--lr-menu-item-hover-bg`, `--lr-menu-item-active-bg`, `--lr-menu-item-icon-color` and
|
|
289
|
-
`--lr-menu-item-min-height`.
|
|
290
|
-
`--lr-overlay-surface`, `--lr-overlay-border` and `--lr-overlay-radius` are listed on this tag
|
|
291
|
-
because it shares a stylesheet directory with `<lr-menu>`, whose surface reads them; a dropdown item
|
|
292
|
-
is a row **inside** that surface and paints no surface of its own, so setting them here is a no-op —
|
|
293
|
-
set them on the menu or on any ancestor instead. The row's own corner stays `--lr-menu-item-radius`.
|
|
294
|
-
|
|
295
|
-
`submenuOpen` reflects to canonical `submenu-open`. HTML normalizes Web Awesome's documented
|
|
296
|
-
mixed-case spelling to `submenuopen`, so that lowercase token is a permanent compatibility alias.
|
|
297
|
-
Adding either spelling opens the submenu and synchronizes the other; removing either closes it and
|
|
298
|
-
removes both. Internal close paths — `closeSubmenu()`, Escape, outside dismissal, selection,
|
|
299
|
-
replacement, and disconnect — clear both spellings, preventing a persistent alias from reopening a
|
|
300
|
-
dismissed branch. An authored initial open request remains pending until submenu content connects.
|
|
301
|
-
|
|
302
|
-
### 9.0 migration
|
|
303
|
-
|
|
304
|
-
Root overlay behavior moved from `<lr-menu>` to `<lr-dropdown>`. Migrate mechanically:
|
|
305
|
-
|
|
306
|
-
- Move a former menu `trigger` slot and menu `open`, `placement`, `anchor`, or
|
|
307
|
-
`close-on-escape-anywhere` policy to an enclosing `<lr-dropdown>`.
|
|
308
|
-
- Replace `menu.show()`/`menu.hide()` and menu `lr-show`/`lr-hide` listeners with the equivalent
|
|
309
|
-
dropdown APIs/events.
|
|
310
|
-
- Replace `lr-menu-select` (`detail.value`) and `lr-menu-item-select` listeners with one
|
|
311
|
-
`lr-select` listener on the menu or dropdown and read `event.detail.item`.
|
|
312
|
-
- Replace menu `::part(trigger)`/`::part(popup)` rules with dropdown part styling. Menu
|
|
313
|
-
`header`/`list`/`footer` parts remain on the semantic controller.
|
|
314
|
-
|
|
315
|
-
Standalone mapped `<sl-menu>` markup needs no wrapper: the mechanical `sl-` → `lr-` tag rename
|
|
316
|
-
continues to produce an inline menu.
|
|
317
|
-
|
|
318
|
-
---
|
|
@@ -92,6 +92,12 @@ its surface.
|
|
|
92
92
|
inherits `<lr-popover>`'s `trigger`/`showDelay`/`hideDelay`/`hoverBridge`, and honors the
|
|
93
93
|
cascading `--lr-positioning-strategy` custom property ahead of this mirrored `absolute` default
|
|
94
94
|
when neither spelling is authored on the instance.
|
|
95
|
+
- `topLayer: boolean = false` (attribute `top-layer`, reflected) — inherited from `<lr-popover>`:
|
|
96
|
+
always shows the open menu in the browser top layer, placed `fixed` whatever
|
|
97
|
+
`positioning-strategy`/`hoist` say, so a dropdown in a `z-index`ed fixed header opens above a
|
|
98
|
+
sibling surface stacked higher. Submenus of a promoted menu stay above the sibling surface too.
|
|
99
|
+
Unset, a dropdown is promoted only when a trapping ancestor forces it (see **Anchored overlays
|
|
100
|
+
and the top layer**).
|
|
95
101
|
- `containingElement?: HTMLElement` (property only) — an external element that counts as inside for
|
|
96
102
|
light-dismiss handling.
|
|
97
103
|
- `arrow`, `withoutArrow` (`without-arrow`), `arrowPlacement`, `arrowPadding`, and `accessibleLabel`
|
|
@@ -93,7 +93,15 @@ Also exported from the package root:
|
|
|
93
93
|
`languageToCountry(language: string): string | undefined` and the `LANGUAGE_TO_COUNTRY` lookup
|
|
94
94
|
table (region subtag wins, e.g. `en-US` → `us`; plain `en` → `gb`; override the table per-app if you
|
|
95
95
|
need different defaults). Only the table's own entries are eligible for base-language fallback;
|
|
96
|
-
inherited object members such as `constructor` resolve to `undefined`.
|
|
96
|
+
inherited object members such as `constructor` resolve to `undefined`. A region-less tag whose
|
|
97
|
+
script subtag implies a different likely region than its bare language takes that region instead of
|
|
98
|
+
the table default, so Traditional and Simplified Chinese never share a flag: `zh-Hant` → `tw` while
|
|
99
|
+
`zh` and `zh-Hans` → `cn`. The rule is not specific to Chinese: `zh-Hanb` and `zh-Bopo` → `tw`, and
|
|
100
|
+
`kk-Arab` (Kazakh in Arabic script, as written in China) → `cn` rather than the `kk` default of `kz`;
|
|
101
|
+
pass `country` when a different flag is wanted. A script that implies the language's own likely
|
|
102
|
+
region keeps the table's convention (`en-Latn` → `gb`), a language with no table entry stays
|
|
103
|
+
unresolved, and an engine without `Intl.Locale` likely-subtags data uses the table default. Also
|
|
104
|
+
exported:
|
|
97
105
|
`localeNativeName(tag: string): string`.
|
|
98
106
|
|
|
99
107
|
`localeNativeName()` returns a BCP-47 tag's **endonym** — the locale's name written in that locale
|
|
@@ -50,7 +50,10 @@ owns none of that.
|
|
|
50
50
|
|
|
51
51
|
**Slots:** default (body content), `icon` (leading header glyph), `header` (replaces the built-in
|
|
52
52
|
heading row entirely), `toolbar` (action row at the block-end edge; revealed by hover/focus on
|
|
53
|
-
hover-capable devices and always visible with a coarse pointer or no hover
|
|
53
|
+
hover-capable devices and always visible with a coarse pointer or no hover; it also stays revealed
|
|
54
|
+
while an `lr-dropdown`, `lr-popover` or `lr-context-menu` opened from it is open, because that menu
|
|
55
|
+
sits in the browser top layer, where Chromium and WebKit stop matching `:hover`/`:focus-within` on
|
|
56
|
+
the node).
|
|
54
57
|
|
|
55
58
|
**CSS parts:** `base` (the row wrapping the input handles, the card and the output handles — it
|
|
56
59
|
carries no card chrome of its own), `card` (the bordered, filled node card), `header`, `icon`,
|
|
@@ -7,95 +7,8 @@
|
|
|
7
7
|
- **Family** `components/viewers/` — see `llms/index.md` for its siblings
|
|
8
8
|
- **Status** `stable` since `4.0.0` — see the maturity and deprecation policy in `llms/shared.md`
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md)
|
|
10
|
-
- **
|
|
10
|
+
- **Deprecated component** `lr-geojson-view` since `21.1.0`; use component `<lr-geojson-viewer>`; removal not before `23.0.0` — lr-geojson-view is the pre-v9 name of lr-geojson-viewer and adds no behavior of its own; it survives only as a distinct subclass so both names can share one registry. This reverses the earlier promise to keep the alias permanently: the tag, the LyraGeojsonView class and its geojson-view routes keep working unchanged through the 22.x line, and connecting the tag logs a one-time development warning.
|
|
11
11
|
- **Optional peers** `maplibre-gl` — see `llms/peers.md`
|
|
12
|
-
- **Themeable via** 7 parts, 1 custom property — see
|
|
13
|
-
- **Documented with** `lr-geojson-viewer
|
|
12
|
+
- **Themeable via** 7 parts, 1 custom property — see `lr-geojson-viewer.md`
|
|
13
|
+
- **Documented with** `lr-geojson-viewer`: see [lr-geojson-viewer.md](./lr-geojson-viewer.md).
|
|
14
14
|
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## `lr-geojson-viewer` / `lr-geojson-view`
|
|
19
|
-
|
|
20
|
-
Document-registry bridge that fetches, validates, and renders a GeoJSON file through `<lr-map>`'s
|
|
21
|
-
`dataLayers`. The canonical class is `LyraGeoJsonViewer`; the pre-v9 `lr-geojson-view` tag and
|
|
22
|
-
`LyraGeojsonView` class name remain compatibility aliases. The document registry renders the
|
|
23
|
-
canonical tag and matches `application/geo+json` and `.geojson` filenames.
|
|
24
|
-
|
|
25
|
-
Validates the parsed JSON is a `Feature`/`FeatureCollection`/bare geometry (one of `Point`,
|
|
26
|
-
`LineString`, `Polygon`, `MultiPoint`, `MultiLineString`, `MultiPolygon`, `GeometryCollection`) before
|
|
27
|
-
rendering; anything else renders the localized `geojsonViewInvalid` error. On success, it walks every
|
|
28
|
-
value and object key first, rejecting more than 50,000 graph units, nesting beyond 64 levels, more
|
|
29
|
-
than 2 Mi UTF-16 units of aggregate keys/string values, or more than 4 Mi UTF-16 units of formatted
|
|
30
|
-
metadata before serialization or peer handoff. It then walks every coordinate under a separate
|
|
31
|
-
10,000-position ceiling to compute a bounding box and fits a `center`/`zoom` to it (a Web-Mercator-fit
|
|
32
|
-
approximation weighting latitude span ~2x, with 40% padding), then hands the parsed value to
|
|
33
|
-
`<lr-map>` as a single `dataLayers` entry (`sourceId: 'lr-geojson'`). When the optional
|
|
34
|
-
`maplibre-gl` peer isn't installed, it falls back to a status line plus a `<lr-json-viewer
|
|
35
|
-
collapsed-depth="2">` of the raw value instead of the map.
|
|
36
|
-
|
|
37
|
-
The root owns the named `region` landmark while loading, in fallback/error/idle states, and while a
|
|
38
|
-
lazy map initializes. After `lr-map-load`, landmark ownership transfers to the map canvas so there
|
|
39
|
-
is exactly one named region. Serialized metadata is locally inline-scrollable, preventing long
|
|
40
|
-
unbroken values from widening a 320px allocation.
|
|
41
|
-
|
|
42
|
-
**Properties:** `src: string = ''` — URL to fetch and parse. `name: string = ''` — accessible label,
|
|
43
|
-
used as `<lr-map>`'s `label` and the root's `aria-label` (falling back to the localized
|
|
44
|
-
`geojsonViewLabel` when unset). A host `aria-label` takes precedence over `name`.
|
|
45
|
-
`maxHeight: string = ''` (attribute `max-height`) is a CSS length that caps `[part="base"]` —
|
|
46
|
-
covering the loaded map, the serialized metadata, and the missing-peer fallback alike — by writing
|
|
47
|
-
`--lr-geojson-viewer-max-height` inline on it; invalid CSS `max-height` values, declaration breaks,
|
|
48
|
-
and `url()` are ignored. The shared
|
|
49
|
-
text-viewer contract adds `highlights`, `activeHighlightId`, `anchor`, and
|
|
50
|
-
`anchorKinds` (`['text-quote', 'fragment']`), plus `search()`, `searchNext()`, `searchPrevious()`,
|
|
51
|
-
`clearSearch()`, and `scrollToAnchor()` for the ordinary-DOM serialized feature metadata and status
|
|
52
|
-
text, independent of whether the optional map peer is available. Fragment resolution is an exact
|
|
53
|
-
DOM `id` lookup, but the generated metadata, status, and map output define no fragment ids, so a
|
|
54
|
-
fragment jump reports `found: false`. Use a text-quote anchor for serialized metadata.
|
|
55
|
-
|
|
56
|
-
**Events:**
|
|
57
|
-
|
|
58
|
-
- `lr-render-error` — `detail: { error }` — fetch, parse, shape-validation, or missing-map capability
|
|
59
|
-
failure. A missing optional MapLibre peer also keeps the serialized metadata fallback visible.
|
|
60
|
-
- `lr-search-change` — `detail: { query: string; matchCount: number; matchCountExact: boolean; activeIndex: number }` — fired
|
|
61
|
-
whenever serialized-metadata search state changes.
|
|
62
|
-
- `lr-anchor-result` — `detail: { found: boolean }` — fired after an `anchor` assignment or
|
|
63
|
-
`scrollToAnchor()` call is applied.
|
|
64
|
-
- `lr-text-select` — `detail: TextSelectDetail` (`{ text: string; anchor: LyraAnchor | null; rects:
|
|
65
|
-
DOMRect[] }`) — fired after a selection ends inside the serialized metadata.
|
|
66
|
-
|
|
67
|
-
`lr-highlight-activate` is not part of this registry bridge's event contract: serialized-metadata
|
|
68
|
-
highlights are passive and cannot be activated.
|
|
69
|
-
|
|
70
|
-
The three shared text-viewer events bubble and compose and are non-cancelable.
|
|
71
|
-
|
|
72
|
-
**CSS parts:** `base` (the root container with explicit `aria-busy="true"|"false"`), `status` (the
|
|
73
|
-
ordinary feature-count line, shown only in the `<lr-map>` path; a successful transition uses the
|
|
74
|
-
shared document-level polite sink), `metadata` (selectable/searchable serialized GeoJSON `<pre>`,
|
|
75
|
-
rendered in both map and fallback paths), `missing-library` (the missing-`maplibre-gl` callout shown
|
|
76
|
-
alongside the `lr-json-viewer` fallback; its transition uses the shared document-level assertive
|
|
77
|
-
sink), `error` (ordinary visible error text; later transitions use the same assertive sink),
|
|
78
|
-
`spinner` (a decorative skeleton plus an ordinary visually-hidden localized label; later loading
|
|
79
|
-
transitions use the shared document-level polite sink), and `anchor-live-region` (an aria-hidden,
|
|
80
|
-
non-live shadow mirror of the latest anchor-jump message; the spoken copy is appended to the shared
|
|
81
|
-
document-level polite sink only while the viewer and its composed ancestors are exposed to the
|
|
82
|
-
accessibility tree). No active live semantics are rendered in the viewer's shadow tree.
|
|
83
|
-
|
|
84
|
-
Those states carry the same visual tones the rest of this family uses rather than plain inherited
|
|
85
|
-
body text: `error` is `--lr-color-danger` (matching `lr-docx-viewer`/`lr-email-viewer`/
|
|
86
|
-
`lr-html-viewer`), `missing-library` is `--lr-color-warning` -- a missing optional peer is a degraded
|
|
87
|
-
but working state, since the `lr-json-viewer` fallback below it still renders the data, not a failure
|
|
88
|
-
-- and `status` is the quiet `--lr-color-text-quiet` metadata tone.
|
|
89
|
-
|
|
90
|
-
**Themeable custom properties:** `--lr-geojson-viewer-max-height` (default `none`) — maximum block
|
|
91
|
-
size of `[part="base"]`, matching every other viewer in this family. It is also settable via the
|
|
92
|
-
`maxHeight` property, which writes this token inline on `[part="base"]`.
|
|
93
|
-
|
|
94
|
-
The canonical tag is registered by importing `geojson-viewer/geojson-viewer.js`; the permanent
|
|
95
|
-
compatibility tag and old deep route remain available through `geojson-view/geojson-view.js`.
|
|
96
|
-
Remote
|
|
97
|
-
resources are capped at 25 MB; exceeding it surfaces the localized `documentPreviewResourceTooLarge`
|
|
98
|
-
message instead of the map. Lyra supports MapLibre v5 and v6; consumers must import its CSS.
|
|
99
|
-
MapLibre v5's standard build includes its worker, while v6 is ESM-only, requires WebGL2, and needs
|
|
100
|
-
its module-worker URL configured for the bundler before this viewer constructs the nested map. See
|
|
101
|
-
`llms/components/lr-map.md` for the Vite v6 example and the other bundler variants.
|
|
@@ -18,9 +18,13 @@
|
|
|
18
18
|
## `lr-geojson-viewer` / `lr-geojson-view`
|
|
19
19
|
|
|
20
20
|
Document-registry bridge that fetches, validates, and renders a GeoJSON file through `<lr-map>`'s
|
|
21
|
-
`dataLayers`. The canonical class is `LyraGeoJsonViewer
|
|
22
|
-
`LyraGeojsonView` class
|
|
23
|
-
|
|
21
|
+
`dataLayers`. The canonical class is `LyraGeoJsonViewer`. The pre-v9 `lr-geojson-view` tag, its
|
|
22
|
+
`LyraGeojsonView` class and `LyraGeojsonViewEventMap` type are deprecated compatibility aliases
|
|
23
|
+
(removal not before 23.0.0; this replaces the earlier promise to keep them permanently): they keep
|
|
24
|
+
working unchanged until then, and connecting `lr-geojson-view` logs a one-time development warning.
|
|
25
|
+
Rename them to `lr-geojson-viewer`, `LyraGeoJsonViewer` and `LyraGeoJsonViewerEventMap`. The
|
|
26
|
+
document registry renders the canonical tag and matches `application/geo+json` and `.geojson`
|
|
27
|
+
filenames.
|
|
24
28
|
|
|
25
29
|
Validates the parsed JSON is a `Feature`/`FeatureCollection`/bare geometry (one of `Point`,
|
|
26
30
|
`LineString`, `Polygon`, `MultiPoint`, `MultiLineString`, `MultiPolygon`, `GeometryCollection`) before
|
|
@@ -91,8 +95,12 @@ but working state, since the `lr-json-viewer` fallback below it still renders th
|
|
|
91
95
|
size of `[part="base"]`, matching every other viewer in this family. It is also settable via the
|
|
92
96
|
`maxHeight` property, which writes this token inline on `[part="base"]`.
|
|
93
97
|
|
|
94
|
-
The canonical tag is registered by importing `
|
|
95
|
-
|
|
98
|
+
The canonical tag is registered by importing `components/lr-geojson-viewer.js` (deep route
|
|
99
|
+
`components/viewers/geojson-view/geojson-viewer.js`). The deprecated `components/lr-geojson-view.js`,
|
|
100
|
+
`components/viewers/geojson-view/geojson-view.js` and `geojson-view.class.js` routes register or
|
|
101
|
+
export the alias (the registration routes also register `lr-geojson-viewer`) and keep working until
|
|
102
|
+
their removal, no earlier than 23.0.0; an application importing one of them only to register the
|
|
103
|
+
canonical tag switches to `components/lr-geojson-viewer.js`.
|
|
96
104
|
Remote
|
|
97
105
|
resources are capped at 25 MB; exceeding it surfaces the localized `documentPreviewResourceTooLarge`
|
|
98
106
|
message instead of the map. Lyra supports MapLibre v5 and v6; consumers must import its CSS.
|
|
@@ -108,7 +108,10 @@ sibling of it, not piped through `<lr-icon>`: the internal `<lr-icon>` mounts on
|
|
|
108
108
|
set, so with `icon` left empty your content is the button's only child. That is what lets a
|
|
109
109
|
complete element — an `<svg>`, an `<img>`, an `<lr-flag>` — render at its own natural aspect ratio
|
|
110
110
|
instead of being forced into a 1:1 box. Setting both `icon` and slotted content renders both, side
|
|
111
|
-
by side; that is a valid composition, not a fallback.
|
|
111
|
+
by side; that is a valid composition, not a fallback. No wrapper sits between the slot and the
|
|
112
|
+
native control, and that control declares no overflow clip. A glow painted around slotted content
|
|
113
|
+
therefore keeps its full silhouette instead of being cut to the glyph's box. The
|
|
114
|
+
`gemstoneAccentPicker` trigger's `gemstoneSelectedGlyphStyles` halo relies on this.
|
|
112
115
|
|
|
113
116
|
**Bare SVG geometry fallback:** slotted bare SVG _geometry_ (`path`, `circle`, `rect`, `line`,
|
|
114
117
|
`polygon`, `polyline`, `ellipse`, `g`, `use`) with no `icon` set and no enclosing `<svg>` of its
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
- **Family** `components/utility/` — see `llms/index.md` for its siblings
|
|
8
8
|
- **Status** `stable` since `4.0.0` — see the maturity and deprecation policy in `llms/shared.md`
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [llms-full.txt](../../llms-full.txt)
|
|
10
|
+
- **Deprecated css-property** `--lr-icon-fixed-width` since `21.1.0`; use host-css-property `inline-size (the same value, on the fixed-width icons only)`; removal not before `23.0.0` — This property only sizes the box while the deprecated fixed-width attribute is set, so it shares that attribute's removal window. A host inline-size declaration reproduces the wider box without a component-specific custom property; a glyph wider than 1em then keeps its intrinsic width instead of being squeezed to 1em.
|
|
10
11
|
- **Deprecated property** `autoWidth` / `auto-width` since `8.0.0`; use property `canvas="auto"`; removal not before `10.0.0` — autoWidth is a boolean compatibility spelling that cannot express fixed canvas sizes; canvas covers both automatic and explicit sizing. That version is a policy floor, not a plan: `wa-icon` still publishes its own deprecated `auto-width` attribute, so this alias is removed only when upstream's is.
|
|
12
|
+
- **Deprecated property** `fixedWidth` / `fixed-width` since `21.1.0`; use host-css-property `inline-size: var(--lr-size-1-5em) on that icon (or the --lr-icon-fixed-width value it used)`; removal not before `23.0.0` — fixed-width predates the mirrored canvas vocabulary, whose default fixed canvas already gives every icon the same 1.25em box so a column of icons lines its labels up. Where the wider 1.5em box matters, a host inline-size reproduces it, except that a glyph wider than 1em keeps its intrinsic width instead of being squeezed to 1em. Neither pinned upstream publishes fixed-width, so it is a Lyra-only spelling.
|
|
11
13
|
- **Optional peers** `dompurify` — see `llms/peers.md`
|
|
12
14
|
- **Themeable via** 4 parts, 45 custom properties — see this component's own `@csspart`/`@cssprop` list below
|
|
13
15
|
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`
|
|
@@ -63,9 +65,14 @@ Pairs with `lr-icon-button` (see `llms/components/lr-icon-button.md`).
|
|
|
63
65
|
`flip`, `flip-360`, `shake`, `spin`, `spin-pulse`, `spin-reverse`, `spin-snap`, `spin-snap-4`,
|
|
64
66
|
`spin-snap-8`, `buzz`, `wag`, `float`, `swing`, or `jello`. Every treatment stops under
|
|
65
67
|
`prefers-reduced-motion: reduce`.
|
|
66
|
-
- `fixedWidth: boolean = false` (attribute `fixed-width`, reflected
|
|
67
|
-
`--lr-icon-fixed-width` while the glyph
|
|
68
|
-
of differently-shaped icons
|
|
68
|
+
- `fixedWidth: boolean = false` (attribute `fixed-width`, reflected, deprecated; removal not before
|
|
69
|
+
23.0.0) — widens the icon _box_ to `--lr-icon-fixed-width` while the glyph's svg is pinned to
|
|
70
|
+
`--lr-icon-size` (1em by default) and centres inside it, so a column of differently-shaped icons
|
|
71
|
+
lines its labels up. It keeps working unchanged, and setting it logs a one-time development
|
|
72
|
+
warning. Omit it: the default canvas already gives every icon the same 1.25em box. For the wider
|
|
73
|
+
1.5em box set `lr-icon { inline-size: var(--lr-size-1-5em); }` on the host instead. One geometry
|
|
74
|
+
difference: a glyph wider than 1em keeps its intrinsic width (up to the box) instead of being
|
|
75
|
+
squeezed to 1em.
|
|
69
76
|
|
|
70
77
|
**Events:**
|
|
71
78
|
|
|
@@ -100,8 +107,9 @@ source tree.
|
|
|
100
107
|
- `--lr-icon-size` (unset by default) — when supplied, overrides both canvas dimensions. Without
|
|
101
108
|
it, the selected `canvas` uses the font-relative sizes above. Stroke color is `currentColor` and
|
|
102
109
|
the host is `color: inherit`, so color comes from surrounding text with no configuration.
|
|
103
|
-
- `--lr-icon-fixed-width` (default `--lr-size-1-5em
|
|
104
|
-
is set.
|
|
110
|
+
- `--lr-icon-fixed-width` (default `--lr-size-1-5em`; deprecated together with `fixed-width`,
|
|
111
|
+
removal not before 23.0.0) — inline size of the box while `fixed-width` is set. Set `inline-size`
|
|
112
|
+
on the host instead.
|
|
105
113
|
- `--lr-icon-rotate` (default `0deg`), `--lr-icon-flip-x` and `--lr-icon-flip-y` (default `1` each) —
|
|
106
114
|
the transform inputs. `--lr-icon-rotate` is written inline from the `rotate` property and the flip
|
|
107
115
|
factors are set to `-1` by `flip`, so set those properties rather than these tokens.
|
|
@@ -169,7 +177,7 @@ unregisterIconLibrary("material"); // icons using it revert to the built-in glyp
|
|
|
169
177
|
name="star"
|
|
170
178
|
label="Favourite"
|
|
171
179
|
></lr-icon>
|
|
172
|
-
<lr-icon library="material" name="delete"
|
|
180
|
+
<lr-icon library="material" name="delete"></lr-icon>
|
|
173
181
|
<lr-icon name="search" canvas="square" animation="beat"></lr-icon>
|
|
174
182
|
```
|
|
175
183
|
|
|
@@ -220,8 +220,15 @@ and cancellation rules. Never fires while `debounce` is unset, `0`, or non-finit
|
|
|
220
220
|
`prefix` (alias of `start`), `suffix` (alias of `end`),
|
|
221
221
|
`clear-button` (non-empty clearable `text`/`search` inputs only),
|
|
222
222
|
`hint`/`form-control-help-text` (compatibility names on the same hint node), and `error`.
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
In a constrained row the native field gives up its spare width first, so a short adornment such
|
|
224
|
+
as a measurement unit (`kWh`) stays whole beside a narrow value. While a `start` or `end` adornment
|
|
225
|
+
is shown the field keeps a four-character floor; only then do the adornments shrink: each is
|
|
226
|
+
capped at half the row, and genuinely long adornments ellipsize inside that allocation rather than
|
|
227
|
+
widening a narrow field. The floor holds against the fixed clear, password-toggle and stepper
|
|
228
|
+
actions too, so a row with an adornment that is narrower than those actions plus the floor
|
|
229
|
+
overflows rather than hiding the value. A row without adornments has no floor: its field still
|
|
230
|
+
yields entirely to those actions. A shrink-to-fit container still sizes the field to its native
|
|
231
|
+
intrinsic width. Label, hint, and error text wrap at unbroken boundaries. The
|
|
225
232
|
`Narrow RTL (320px)` story exercises both adornments with a clear action and localized long copy.
|
|
226
233
|
|
|
227
234
|
**The required marker.** `required` with a non-empty `label` paints the library's shared marker on
|
|
@@ -67,7 +67,9 @@ is no "every item in the tooltip" surface to hook a title or footer formatter on
|
|
|
67
67
|
them side by side; ignored for `type="line"`
|
|
68
68
|
- `tickFormat?: (value: number) => string` (attribute: false) — formats a y-axis tick value for
|
|
69
69
|
display (e.g. `(v) => \`$${v.toFixed(2)}\`` for currency, or a duration formatter for `"42s"`).
|
|
70
|
-
Falls back to the built-in "nice numbers" formatter when unset.
|
|
70
|
+
Falls back to the built-in "nice numbers" formatter when unset. The returned string is painted
|
|
71
|
+
bidi-isolated, so `2.4 MiB/s` keeps its number-unit order under `dir="rtl"` (see
|
|
72
|
+
[Formatted labels in right-to-left layouts](#formatted-labels-in-right-to-left-layouts)).
|
|
71
73
|
- `formatter?: LyraChartFormatter` (attribute: false) — family-wide context-object formatter used
|
|
72
74
|
by visual/tooltips, spoken text, legends, tables, and CSV export. It takes precedence over the
|
|
73
75
|
older surface-specific hooks, which remain available as compatibility fallbacks.
|
|
@@ -125,14 +127,20 @@ is no "every item in the tooltip" surface to hook a title or footer formatter on
|
|
|
125
127
|
actually render *text*: after the global record sampler runs, it selects from those retained
|
|
126
128
|
categories, always shows the first and last sampled label, and roughly evenly distributes the
|
|
127
129
|
rest between them. A number is authoritative up to the number of sampled categories. `'auto'`
|
|
128
|
-
|
|
129
|
-
using the same deterministic 7px-per-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
labels
|
|
130
|
+
re-selects after each resize from the resolved tick positions and the widest rendered caller
|
|
131
|
+
label, using the same deterministic 7px-per-character estimate as label ellipsis. Whenever the
|
|
132
|
+
first and last labels fit side by side, it keeps at least 10px of breathing room between every
|
|
133
|
+
adjacent pair of labels; when even those two do not fit, only they remain and label ellipsis
|
|
134
|
+
prevents overlap. Each label is measured where it paints: centered on its tick, except the first
|
|
135
|
+
and last category, which anchor toward the plot interior (mirrored under RTL) and so occupy their
|
|
136
|
+
whole width on the inner side of their tick. Label centers are spaced evenly between those two
|
|
137
|
+
boundary labels, so neither boundary pair is crowded. A `barX` that reorders the ticks away from
|
|
138
|
+
source order falls back to the width-only cap (plot width divided by the widest label plus 10px).
|
|
139
|
+
It therefore responds to either `layout` mode without DOM text measurement or browser-specific
|
|
140
|
+
font metrics. Unset (the default) renders every label, unchanged. Each rendered category label
|
|
141
|
+
is allocation-aware: narrow/long text is ellipsized before paint, with the complete caller label
|
|
142
|
+
retained as its accessible name. Independently, the global 1,000-record safety sampler may bound
|
|
143
|
+
both marks and labels for very large category×series input.
|
|
136
144
|
- `barX?: (index: number) => number` (attribute: false, bar type only) — overrides the internal
|
|
137
145
|
per-category x-origin formula (`plotX + i * slot`) used by both bars and their axis labels, so a
|
|
138
146
|
consumer can pixel-align this chart's bars with a sibling `<lr-heatmap>` calendar's week columns
|