@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
|
@@ -12,9 +12,17 @@ export type LyraMultiSplitCollapseMode='start'|'end'|'none';
|
|
|
12
12
|
export type LyraMultiSplitCollapseState='wide'|'rail'|'floating';
|
|
13
13
|
/** What can be *assigned* to `collapseState` -- `'auto'` is a write-only
|
|
14
14
|
* sentinel; see the `collapseState` accessor doc. */
|
|
15
|
-
export type LyraMultiSplitCollapseStateInput=LyraMultiSplitCollapseState|'auto';export interface LyraMultiSplitCollapseChangeDetail{readonly state:LyraMultiSplitCollapseState;}export interface
|
|
15
|
+
export type LyraMultiSplitCollapseStateInput=LyraMultiSplitCollapseState|'auto';export interface LyraMultiSplitCollapseChangeDetail{readonly state:LyraMultiSplitCollapseState;}export interface LyraMultiSplitPanelCollapseChangeDetail{
|
|
16
|
+
/** The `panel-id` of the panel that was folded or unfolded.*/
|
|
17
|
+
readonly panelId:string;
|
|
18
|
+
/** Whether that panel is now collapsed to its rail.*/
|
|
19
|
+
readonly collapsed:boolean;
|
|
20
|
+
/** Every currently collapsed panel's `panel-id`, in DOM order.*/
|
|
21
|
+
readonly collapsedPanels:readonly string[];
|
|
22
|
+
/** The settled `sizes` after the freed or reclaimed share was redistributed.*/
|
|
23
|
+
readonly sizes:readonly number[];}export interface LyraMultiSplitToggleDetail{
|
|
16
24
|
/** Whether the floating drawer is (or, on a cancelable proposal, would be) open.*/
|
|
17
|
-
readonly expanded:boolean;}export interface LyraMultiSplitResizeDetail{readonly sizes:readonly number[];}export interface LyraMultiSplitOrientationChangeDetail{readonly orientation:LyraOrientation;}export interface LyraMultiSplitEventMap{'lr-resize-request':CustomEvent<LyraEventDetailSnapshot<LyraMultiSplitResizeDetail>>;'lr-resize':CustomEvent<LyraEventDetailSnapshot<LyraMultiSplitResizeDetail>>;'lr-resize-change':CustomEvent<LyraEventDetailSnapshot<LyraMultiSplitResizeDetail>>;'lr-multi-split-collapse-change':CustomEvent<LyraMultiSplitCollapseChangeDetail>;'lr-toggle-request':CustomEvent<LyraMultiSplitToggleDetail>;'lr-toggle':CustomEvent<LyraMultiSplitToggleDetail>;'lr-multi-split-constraints-invalid':CustomEvent<LyraMultiSplitConstraintIssueDetail>;'lr-multi-split-orientation-change':CustomEvent<LyraMultiSplitOrientationChangeDetail>;}
|
|
25
|
+
readonly expanded:boolean;}export interface LyraMultiSplitResizeDetail{readonly sizes:readonly number[];}export interface LyraMultiSplitOrientationChangeDetail{readonly orientation:LyraOrientation;}export interface LyraMultiSplitEventMap{'lr-resize-request':CustomEvent<LyraEventDetailSnapshot<LyraMultiSplitResizeDetail>>;'lr-resize':CustomEvent<LyraEventDetailSnapshot<LyraMultiSplitResizeDetail>>;'lr-resize-change':CustomEvent<LyraEventDetailSnapshot<LyraMultiSplitResizeDetail>>;'lr-multi-split-collapse-change':CustomEvent<LyraMultiSplitCollapseChangeDetail>;'lr-multi-split-panel-collapse-change':CustomEvent<LyraEventDetailSnapshot<LyraMultiSplitPanelCollapseChangeDetail>>;'lr-toggle-request':CustomEvent<LyraMultiSplitToggleDetail>;'lr-toggle':CustomEvent<LyraMultiSplitToggleDetail>;'lr-multi-split-constraints-invalid':CustomEvent<LyraMultiSplitConstraintIssueDetail>;'lr-multi-split-orientation-change':CustomEvent<LyraMultiSplitOrientationChangeDetail>;}
|
|
18
26
|
/**
|
|
19
27
|
* `<lr-multi-split>` — resizable panels for dashboard layouts. Direct light-DOM
|
|
20
28
|
* children are the panels; a divider is auto-inserted between each pair. Give every panel a
|
|
@@ -83,6 +91,15 @@ readonly expanded:boolean;}export interface LyraMultiSplitResizeDetail{readonly
|
|
|
83
91
|
* open or closed, the divider beside the floating pane releases its gutter
|
|
84
92
|
* and hairline, so the other pane(s) take the full track.
|
|
85
93
|
*
|
|
94
|
+
* Separately, any panel -- not only an edge pane, and at any container width -- can be folded
|
|
95
|
+
* to a narrow rail strip by a host control through `collapsedPanels` or
|
|
96
|
+
* `collapsePanel()`/`expandPanel()`/`togglePanel()`, keyed by `panel-id`. The folded panel keeps
|
|
97
|
+
* rendering (the host draws its strip content: a rotated label, an expand button) while its share
|
|
98
|
+
* moves to the open panels within their `panelConstraints`, the dividers beside it keep resizing
|
|
99
|
+
* its open neighbours, and the collapsed set persists with the sizes under `storageKey`. The
|
|
100
|
+
* responsive pane above is independent of it: while that pane is `'rail'`/`'floating'` its own
|
|
101
|
+
* state governs it, and a per-panel fold of the same panel resumes once it is `'wide'` again.
|
|
102
|
+
*
|
|
86
103
|
* Public collection properties take bounded, clone-owned readonly snapshots. Create a new
|
|
87
104
|
* collection and reassign it after changes; mutating the assigned array does not update the view.
|
|
88
105
|
*
|
|
@@ -110,6 +127,11 @@ readonly expanded:boolean;}export interface LyraMultiSplitResizeDetail{readonly
|
|
|
110
127
|
* Forced writes while no eligible collapsing pane exists are inert and do
|
|
111
128
|
* not fire. Not fired for a redundant reassignment to the state already in
|
|
112
129
|
* effect.
|
|
130
|
+
* @event lr-multi-split-panel-collapse-change - `detail: { panelId, collapsed, collapsedPanels,
|
|
131
|
+
* sizes }` (`LyraMultiSplitPanelCollapseChangeDetail`), fired when `collapsePanel()`,
|
|
132
|
+
* `expandPanel()` or `togglePanel()` folds or unfolds a panel, after the redistributed `sizes`
|
|
133
|
+
* are applied and persisted and the panel's `data-panel-collapsed` marker is set. Not fired when
|
|
134
|
+
* a consumer assigns `collapsedPanels` (or `sizes`) directly, nor when a stored layout restores.
|
|
113
135
|
* @event lr-toggle-request - Cancelable proposal before an interactive overlay state change.
|
|
114
136
|
* Detail carries the proposed `expanded` state. Direct property writes and
|
|
115
137
|
* forced responsive closes do not propose an interactive change.
|
|
@@ -130,7 +152,10 @@ readonly expanded:boolean;}export interface LyraMultiSplitResizeDetail{readonly
|
|
|
130
152
|
* `aria-disabled="true"` and is drag/keyboard-inert
|
|
131
153
|
* while its adjacent panel is collapsed (`'rail'`/`'floating'`). While that panel is `'floating'`
|
|
132
154
|
* the divider also takes no track and paints no line, but stays focusable as the collapse-focus
|
|
133
|
-
* fallback; beside a `'rail'` panel it keeps both.
|
|
155
|
+
* fallback; beside a `'rail'` panel it keeps both. Beside a per-panel collapsed panel (see
|
|
156
|
+
* `collapsedPanels`) a divider instead resizes the nearest open panel on each side, and
|
|
157
|
+
* `aria-valuenow` reports that leading open panel; it is disabled only when one side has no
|
|
158
|
+
* open panel left.
|
|
134
159
|
* @csspart backdrop - The `'floating'` drawer's scrim. Only rendered while `collapseState === 'floating'` and `open`.
|
|
135
160
|
* @cssprop [--lr-multi-split-overlay-color=var(--lr-color-overlay)] - The `'floating'` drawer scrim's color, applied to `[part="backdrop"]`.
|
|
136
161
|
* @cssprop [--lr-multi-split-divider-target-size=max(var(--lr-icon-button-size),var(--lr-size-3px))] -
|
|
@@ -148,6 +173,9 @@ readonly expanded:boolean;}export interface LyraMultiSplitResizeDetail{readonly
|
|
|
148
173
|
* @cssprop [--lr-multi-split-divider-active-color=color-mix(in oklab,var(--lr-color-brand),var(--lr-color-mix-partner) var(--lr-color-mix-active))] -
|
|
149
174
|
* The divider hairline's color while a resize gesture is pressed (pointer capture holds this
|
|
150
175
|
* through the whole drag).
|
|
176
|
+
* @cssprop [--lr-multi-split-collapsed-panel-size=var(--lr-size-2-5rem)] - The rail a per-panel
|
|
177
|
+
* collapsed panel (`collapsedPanels`) clamps to along the resize axis: its inline size in a
|
|
178
|
+
* horizontal split, its block size in a vertical one. Set it on the split or an ancestor.
|
|
151
179
|
* @cssprop [--lr-multi-split-floating-panel-inset=0] - The `'floating'` drawer's distance from
|
|
152
180
|
* `[part="base"]`'s edges, applied to both block insets and to whichever logical inline edge
|
|
153
181
|
* `collapse` anchors the drawer to. Unset, the drawer stays flush with the container exactly as
|
|
@@ -320,7 +348,28 @@ for:string;
|
|
|
320
348
|
* and the total panel count (`lr-multi-split` supports N panels, so a single fixed string can't
|
|
321
349
|
* express every divider's label; a function can). Unset (the default) keeps today's exact
|
|
322
350
|
* localized `Resize divider between panel {a} and panel {b}` template (see `this.localize()`). */
|
|
323
|
-
dividerLabel?:(index:number,panelCount:number)=>string;
|
|
351
|
+
dividerLabel?:(index:number,panelCount:number)=>string;
|
|
352
|
+
/** The `panel-id`s of the panels folded to a narrow rail strip, independent of container width
|
|
353
|
+
* and of the responsive `collapse` pane. Empty by default: no panel folds and the split behaves
|
|
354
|
+
* exactly as before this property existed.
|
|
355
|
+
*
|
|
356
|
+
* A collapsed panel stays rendered and in the accessibility tree; it is clamped along the
|
|
357
|
+
* resize axis to `--lr-multi-split-collapsed-panel-size` and marked `data-panel-collapsed`, so
|
|
358
|
+
* the panel's own content can switch to its strip presentation (a rotated label, an expand
|
|
359
|
+
* control) and should take its full content out of the tab order itself, for example with
|
|
360
|
+
* `inert` on the hidden region. Its share of the track is redistributed to the open panels in
|
|
361
|
+
* proportion to their sizes, never past a panel's `panelConstraints` maximum; its `sizes`
|
|
362
|
+
* entry reads `0` while folded, and expanding restores the share it had when it folded,
|
|
363
|
+
* reclaimed from the open panels' room above their minimums. A divider beside a collapsed panel
|
|
364
|
+
* resizes the nearest open panel on each side, and is disabled only when one side has none.
|
|
365
|
+
*
|
|
366
|
+
* Requires every panel to carry a unique, nonempty, whitespace-stable `panel-id` (the same
|
|
367
|
+
* identity `storageKey` uses); otherwise the set is ignored. Unknown ids are ignored, and at least
|
|
368
|
+
* one panel always stays open: a set naming every panel leaves the last one open. Assigning this
|
|
369
|
+
* property is silent, like assigning `sizes`; `collapsePanel()`/`expandPanel()`/`togglePanel()`
|
|
370
|
+
* apply a change immediately, persist it under `storageKey`, and announce it. A valid stored
|
|
371
|
+
* layout restores the collapsed set too, unless this property already names panels. */
|
|
372
|
+
collapsedPanels:readonly string[];private panelCount;private sizesReconciledForMembership;private appliedCollapsed;private readonly expandedSizes;private _collapseState;private _forced;private pinnedBand?;private overlayActive;private justOpened;private overlayHandle?;private readonly nativeModal;private readonly modalSurface;private nativeModalView?;private nativeModalResizeObserver?;private floatingFrame?;private readonly floatingGeometry;private openingBlockSize;private stopNativeModalGeometry;private nativeModalLabel;private readonly syncNativeModalGeometry;private triggerAria?;private triggerPanel?;private generatedTriggerPanelId?;private overlayReturnTarget;private overlayOpener;private floatingDialogPanel;private floatingDialogPreviousRole;private floatingDialogPreviousAriaModal;private drags;private readonly dragController;private ownedPanels;private readonly panelOwnership;private panelOwnershipObserver?;private constraintIssueKey;private constraintConfigVersion;private renderConstraintBounds;private initializedSizes;private measuredInlineSize;private _effectiveOrientation;private baseEl?;private collapseResizeObserver?;private collapseObservedElement?;private collapseObserverOwnerDocument?;private collapseObserverGeneration;private gutterResizeObserver?;private gutterObserverFrame?;private gutterObserverDocument?;private gutterObservedDividers;private gutterObservedContainerSize;private orientationBreakpoints;private collapseBreakpoints;connectedCallback():void;private seedInlineSize;disconnectedCallback():void;adoptedCallback():void;protected firstUpdated(changed:PropertyValues):void;
|
|
324
373
|
/** Both branches here derive one reactive property from another with no
|
|
325
374
|
* DOM measurement involved, so they belong in `willUpdate()` rather than
|
|
326
375
|
* `updated()`: setting a reactive property from `updated()`/
|
|
@@ -373,11 +422,29 @@ collapsePane():void;
|
|
|
373
422
|
* Named `togglePane()` (with `expandPane()`/`collapsePane()`) because `collapse` is already this
|
|
374
423
|
* component's pane-selection property, mirroring `<lr-page>`'s `showNavigation()` trio.
|
|
375
424
|
*/
|
|
376
|
-
togglePane():void;
|
|
425
|
+
togglePane():void;
|
|
426
|
+
/**
|
|
427
|
+
* Folds one panel to its rail strip at any container width (see `collapsedPanels`). `panel` is
|
|
428
|
+
* the panel's `panel-id` or the panel element itself. Applies synchronously: the freed share is
|
|
429
|
+
* redistributed, the layout persists under `storageKey`, the panel is decorated, and then
|
|
430
|
+
* `lr-multi-split-panel-collapse-change` fires. Returns whether anything changed: `false` for an
|
|
431
|
+
* unknown panel, one already collapsed, the last open panel, or a split whose panels lack valid
|
|
432
|
+
* `panel-id`s. Called before the first update, it only records the request, silently.
|
|
433
|
+
*
|
|
434
|
+
* Named `collapsePanel()` (with `expandPanel()`/`togglePanel()`) to stay distinct from
|
|
435
|
+
* `collapsePane()`, which drives the single responsive `collapse` pane.
|
|
436
|
+
*/
|
|
437
|
+
collapsePanel(panel:string|HTMLElement):boolean;
|
|
438
|
+
/** Unfolds a collapsed panel back to the share it had when it folded, taken from the open
|
|
439
|
+
* panels' room above their minimums. Same identity, persistence and event rules as
|
|
440
|
+
* `collapsePanel()`. */
|
|
441
|
+
expandPanel(panel:string|HTMLElement):boolean;
|
|
442
|
+
/** Collapses an open panel or expands a collapsed one; see `collapsePanel()`.*/
|
|
443
|
+
togglePanel(panel:string|HTMLElement):boolean;private panelIdOf;private setPanelCollapsed;private targetCollapsedIds;private indexesOf;private collapsedIndexes;private syncCollapsedLayout;private foldSizes;private distributeShare;private dividerPair;private get paneExpanded();private applyPaneIntent;private releaseCollapsePin;private pinMeasurementWidth;
|
|
377
444
|
/** The live layout and resize axis after applying `orientationBreakpoint` — identical to
|
|
378
445
|
* `orientation` whenever `orientationBreakpoint` is unset (or set to something that doesn't
|
|
379
446
|
* resolve to a length). Also reflected as the `data-effective-orientation` host attribute (only
|
|
380
447
|
* present while `orientationBreakpoint` resolves, mirroring `data-collapse-state`'s
|
|
381
448
|
* only-present-while-active contract) so CSS can
|
|
382
449
|
* target the live axis directly instead of every consumer duplicating this fallback. */
|
|
383
|
-
get effectiveOrientation():LyraOrientation;private get responsiveObservationEnabled();private updateEffectiveOrientation;private currentMeasuredWidth;private effectiveCollapseStateFor;private applyEffectiveCollapseTransition;private relocateFocusOutOfCollapsingPanel;private collapseFocusFallbacks;private setOpen;requestUpdate(name?:PropertyKey,oldValue?:unknown,options?:PropertyDeclaration):void;private setRequestedCollapseState;private get storageFullKey();private panelIdsFor;private reconcileIdentitySizes;private reconcileSizesByPanelId;private validInitialSizes;private validLiveSizes;private resolveDefaultSizes;private initializeSizes;private loadPersisted;private persist;private ensureSizes;private readPanelStyle;private samePanelStyle;private snapshotPanelOwnership;private adoptPanelOwnership;private applyOwnedPanelStyle;private applyOwnedPanelStyleValue;private applyOwnedPanelHidden;private
|
|
450
|
+
get effectiveOrientation():LyraOrientation;private get responsiveObservationEnabled();private updateEffectiveOrientation;private currentMeasuredWidth;private effectiveCollapseStateFor;private applyEffectiveCollapseTransition;private relocateFocusOutOfCollapsingPanel;private collapseFocusFallbacks;private setOpen;requestUpdate(name?:PropertyKey,oldValue?:unknown,options?:PropertyDeclaration):void;private setRequestedCollapseState;private get storageFullKey();private panelIdsFor;private reconcileIdentitySizes;private reconcileSizesByPanelId;private validInitialSizes;private validLiveSizes;private resolveDefaultSizes;private acceptFoldedSizes;private initializeSizes;private loadPersisted;private persist;private ensureSizes;private readPanelStyle;private samePanelStyle;private snapshotPanelOwnership;private adoptPanelOwnership;private applyOwnedPanelStyle;private applyOwnedPanelStyleValue;private applyOwnedPanelHidden;private applyOwnedPanelAttribute;private restorePanelOwnership;private panelProjectionDiverged;private resetPanelOwnershipObserver;private observeOwnedPanels;private samePanelSequence;private syncPanelMembership;private releaseOwnedPanels;private onSlotChange;private getContainerSize;private resetGutterObserver;private updateGutterBudget;private syncGutterObserver;private get collapsingIndex();private get collapseActive();private isDividerDisabled;private updateCollapseState;private armCollapseObserver;private resetCollapseObserver;private syncCollapseObserver;private get safeMin();private normalizedDefaultMin;private resolveConstraintBounds;private hasClampConstraint;private minSideExpr;private maxSideExpr;private clampPair;private requestResize;private settle;private applyDelta;private get floatingPanelEl();private activateFloatingOverlay;private deactivateFloatingOverlay;private onBackdropClick;private onModalLayerClick;private onPointerDown;private onPointerMove;private onPointerUp;private endDragGestures;private onDividerKeyDown;private dividerName;private dividerValueRange;protected updated(changed:PropertyValues):void;private resolveExternalTrigger;private syncExternalTriggerA11y;private releaseExternalTriggerA11y;private decorateOwnedPanels;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-multi-split':LyraMultiSplit;}}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{resolveIdReferencesIn}from"../../../internal/aria-reflection.js";import{NativeModalCarrier}from"../../../internal/native-modal-carrier.js";import{ModalSurfaceController}from"../../../internal/modal-surface-controller.js";import{leaseInlineStyleProperty}from"../../../internal/style-property-lease.js";import{nativeModalCarrierStyles}from"../../../internal/native-modal-carrier.styles.js";import{collectionSupport}from"../../../internal/collection-snapshot.js";import{html,nothing}from"lit";import{property,query}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{activateOverlay,composedContains,deepActiveElement}from"../../../internal/overlay-manager.js";import{isRtl}from"../../../internal/rtl.js";import{repairComposedFocus}from"../../../internal/focus-navigation.js";import{cancelDeferredFocusReturn}from"../../../internal/deferred-focus-return.js";import{acquireAriaOwnership}from"../../../internal/aria-ownership.js";import{nextId}from"../../../internal/a11y.js";import{isHtmlElement}from"../../../internal/dom-guards.js";import{finiteRange}from"../../../internal/numbers.js";import{SeparatorDragController,separatorArrowDirection,separatorCoordinate,separatorDelta}from"../../../internal/separator-drag.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{CollapseBreakpointController,OrientationBreakpointController}from"../../../internal/orientation-breakpoint.js";import{readPersistedState,writePersistedState}from"../../../internal/persisted-state.js";import{resolveCssLength}from"../../../internal/css-length.js";import{styles}from"./multi-split.styles.js";import{LYRA_DEFAULT_resizeDivider,LYRA_DEFAULT_resizeValuePercent}from"../../../internal/default-strings/layout.generated.js";const KEYBOARD_STEP=2;function isPersistedPanelLayout(value){if(typeof value!="object"||value===null)return!1;const candidate=value;return candidate.version!==1||!Array.isArray(candidate.panels)?!1:candidate.panels.every(panel=>{if(typeof panel!="object"||panel===null)return!1;const record=panel;return typeof record.panelId=="string"&&record.panelId!==""&&record.panelId.trim()===record.panelId&&typeof record.size=="number"&&Number.isFinite(record.size)&&record.size>=0})}const NO_MIN_PX=0,NO_MAX_PX=1e6,OWNED_PANEL_STYLE_PROPERTIES=["flex","order","inline-size","--_lr-multi-split-panel-min"];class LyraMultiSplit extends LyraElement{constructor(){super(...arguments),this.toggleProposalDepth=0,this.toggleProposalMutationVersion=0,this.forcedCloseVersion=0,this.sizes=[],this.defaultSizes=[],this.min=10,this.orientation="horizontal",this.orientationBreakpointBasis="container",this.narrowOrientation="vertical",this.panelConstraints=[],this.collapse="none",this.railWidth="3.5rem",this.railBreakpoint=640,this.floatBreakpoint=400,this.collapseBreakpointBasis="container",this.releasePinOnBreakpoint=!1,this.open=!1,this.trigger=null,this.for="",this.panelCount=0,this.sizesReconciledForMembership=!1,this._collapseState="wide",this._forced=!1,this.overlayActive=!1,this.justOpened=!1,this.nativeModal=new NativeModalCarrier(this,{onCancel:()=>{this.overlayHandle?.isTopmost()&&this.setOpen(!1)},onUnexpectedClose:()=>{this.overlayHandle?.isTopmost()&&this.setOpen(!1),this.overlayActive&&this.modalSurface.show()}}),this.modalSurface=new ModalSurfaceController(this,this.nativeModal,()=>this.baseEl??null),this.floatingGeometry=new Map,this.openingBlockSize=0,this.syncNativeModalGeometry=()=>{if(!this.overlayActive||!this.isConnected)return;const allocation=this.shadowRoot?.querySelector(".allocation"),reservation=this.shadowRoot?.querySelector(".allocation-reservation"),frame=this.nativeModal.requested?this.shadowRoot?.querySelector("[data-native-modal-carrier]"):this.baseEl;if(!allocation||!reservation||!frame)return;if(!this.nativeModalView){this.nativeModalView=this.ownerDocument.defaultView??void 0,this.nativeModalView?.addEventListener("scroll",this.syncNativeModalGeometry,!0),this.nativeModalView?.addEventListener("resize",this.syncNativeModalGeometry);const Observer=this.nativeModalView?.ResizeObserver;if(Observer){const observer=new Observer(this.syncNativeModalGeometry);this.nativeModalResizeObserver=observer,observer.observe(allocation)}}if(this.floatingFrame!==frame){for(const lease of this.floatingGeometry.values())lease.release();this.floatingGeometry.clear(),this.floatingFrame=frame}const set=(property2,value)=>{const lease=this.floatingGeometry.get(property2);lease?(frame.style.getPropertyValue(property2)!==value||frame.style.getPropertyPriority(property2))&&lease.set(value):this.floatingGeometry.set(property2,leaseInlineStyleProperty(frame,property2,value))};if(reservation.hidden){const height=this.baseEl?.getBoundingClientRect().height??0;this.openingBlockSize=height||this.openingBlockSize||allocation.getBoundingClientRect().height,set("position","fixed"),reservation.style.blockSize=`${this.openingBlockSize}px`,reservation.hidden=!1}const rect=allocation.getBoundingClientRect();for(const[property2,value]of Object.entries({position:"fixed",top:`${rect.top}px`,left:`${rect.left}px`,right:"auto",bottom:"auto",width:`${rect.width}px`,height:`${rect.height}px`,padding:"0","box-sizing":"border-box","max-inline-size":"none"}))set(property2,value)},this.overlayReturnTarget=null,this.overlayOpener=null,this.floatingDialogPanel=null,this.floatingDialogPreviousRole=null,this.floatingDialogPreviousAriaModal=null,this.drags=new Map,this.dragController=new SeparatorDragController(this,event=>this.onPointerMove(event),event=>this.onPointerUp(event)),this.ownedPanels=[],this.panelOwnership=new Map,this.constraintIssueKey="",this.constraintConfigVersion=0,this.renderConstraintBounds=[],this.initializedSizes=!1,this.measuredInlineSize=Number.POSITIVE_INFINITY,this._effectiveOrientation="horizontal",this.collapseObserverGeneration=0,this.gutterObservedDividers=[],this.gutterObservedContainerSize=0,this.orientationBreakpoints=new OrientationBreakpointController(this,()=>this.updateEffectiveOrientation(this.measuredInlineSize,!0)),this.collapseBreakpoints=new CollapseBreakpointController(this,()=>this.updateCollapseState(this.measuredInlineSize,!0)),this.onSlotChange=()=>{this.updateBrowserDerivedState(()=>this.syncPanelMembership())},this.onBackdropClick=()=>{this.overlayHandle?.dismissBackdrop()},this.onModalLayerClick=event=>{event.target===this.baseEl&&this.overlayHandle?.dismissBackdrop()},this.onPointerDown=(e,index)=>{if(e.button!==0||this.isDividerDisabled(index))return;const divider=e.currentTarget;this.dragController.start(e,divider)&&this.drags.set(e.pointerId,{index,startPos:separatorCoordinate(e,this.effectiveOrientation==="vertical"?"block":"inline"),base:this.baseEl,rtl:this.effectiveOrientation==="horizontal"&&isRtl(this),appliedDelta:0,acceptedResize:!1})},this.onPointerMove=e=>{const drag=this.drags.get(e.pointerId);if(!drag)return;if(this.isDividerDisabled(drag.index)){this.endDragGestures();return}if(this.effectiveOrientation==="horizontal"&&isRtl(this)!==drag.rtl){this.endDragGestures();return}const total=this.effectiveOrientation==="vertical"?drag.base.clientHeight:drag.base.clientWidth;if(!Number.isFinite(total)||total<=0){this.endDragGestures();return}const incremental=separatorDelta(drag.startPos,e,this.effectiveOrientation==="vertical"?"block":"inline",drag.rtl)/total*100-drag.appliedDelta,priorValue=this.sizes[drag.index];if(priorValue===void 0)return;const paired=this.clampPair(this.sizes,drag.index,incremental,total),pairedA=paired[drag.index],pairedB=paired[drag.index+1];if(pairedA===void 0||pairedB===void 0)return;const next=[...this.sizes];next[drag.index]=pairedA,next[drag.index+1]=pairedB,this.requestResize(next,!1)&&(drag.appliedDelta+=pairedA-priorValue,drag.acceptedResize=!0)},this.onPointerUp=e=>{const drag=this.drags.get(e.pointerId);drag&&(this.drags.delete(e.pointerId),e.type==="pointerup"&&drag.acceptedResize&&this.settle(),this.dragController.end(e.pointerId))},this.onDividerKeyDown=(e,index)=>{if(this.isDividerDisabled(index)||e.altKey||e.ctrlKey||e.metaKey||e.isComposing)return;const direction=separatorArrowDirection(e,this.effectiveOrientation==="vertical"?"block":"inline",this.effectiveOrientation==="horizontal"&&isRtl(this));if(e.key==="Home"||e.key==="End"){const{min,max}=this.dividerValueRange(index),current=this.sizes[index];if(current!==void 0){const target=e.key==="Home"?min:max;this.applyDelta(index,target-current,!0)&&e.preventDefault()}}else direction===1?this.applyDelta(index,KEYBOARD_STEP,!0)&&e.preventDefault():direction===-1&&this.applyDelta(index,-KEYBOARD_STEP,!0)&&e.preventDefault()}}static{this.defaultStrings={...super.defaultStrings,resizeDivider:LYRA_DEFAULT_resizeDivider,resizeValuePercent:LYRA_DEFAULT_resizeValuePercent}}static{this.collectionSupport=collectionSupport}static{this.ownedCollectionProperties=Object.freeze(["sizes","defaultSizes","panelConstraints"])}static{this.styles=[LyraElement.styles,nativeModalCarrierStyles,styles]}static{this.immutableEventDetails=Object.freeze(["lr-resize-request","lr-resize","lr-resize-change"])}static{this.properties={collapseState:{reflect:!0,attribute:"collapse-state",noAccessor:!0}}}stopNativeModalGeometry(){this.nativeModalView?.removeEventListener("scroll",this.syncNativeModalGeometry,!0),this.nativeModalView?.removeEventListener("resize",this.syncNativeModalGeometry),this.nativeModalView=void 0,this.nativeModalResizeObserver?.disconnect(),this.nativeModalResizeObserver=void 0;for(const lease of this.floatingGeometry.values())lease.release();this.floatingGeometry.clear(),this.floatingFrame=void 0,this.openingBlockSize=0;const reservation=this.shadowRoot?.querySelector(".allocation-reservation");reservation&&(reservation.hidden=!0,reservation.style.removeProperty("block-size"))}nativeModalLabel(){const panel=this.floatingPanelEl;return panel?panel.hasAttribute("aria-label")?panel.getAttribute("aria-label"):resolveIdReferencesIn(panel.getRootNode(),panel.getAttribute("aria-labelledby")).map(element=>element.textContent?.trim()).filter(Boolean).join(" ")||this.getAttribute("aria-label"):this.getAttribute("aria-label")}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.responsiveObservationEnabled&&this.seedInlineSize(),this.seedFirstRenderState(()=>this.syncPanelMembership(!1)),this.hasUpdated&&this.syncPanelMembership(!1),this.initializedSizes&&this.ensureSizes(),this.responsiveObservationEnabled&&this.armCollapseObserver(),this.hasUpdated&&this.overlayActive&&(this.overlayHandle?.isActive()?this.overlayHandle.resume():this.activateFloatingOverlay(),queueMicrotask(()=>{!this.isConnected||!this.overlayActive||(this.syncNativeModalGeometry(),this.modalSurface.show(),this.overlayHandle?.focusInitial())})),this.hasUpdated&&this.syncExternalTriggerA11y()}seedInlineSize(){const hostWidth=this.getBoundingClientRect().width;hostWidth>0&&(this.measuredInlineSize=hostWidth)}disconnectedCallback(){this.modalSurface.disconnect(),this.stopNativeModalGeometry(),super.disconnectedCallback(),this.endDragGestures(),this.resetCollapseObserver(),this.resetGutterObserver(),this.overlayHandle?.suspend(),cancelDeferredFocusReturn(this),this.releaseExternalTriggerA11y(),this.releaseOwnedPanels()}adoptedCallback(){super.adoptedCallback(),cancelDeferredFocusReturn(this),this.releaseExternalTriggerA11y(),this.endDragGestures(),this.resetCollapseObserver(),this.resetGutterObserver(),this.releaseOwnedPanels()}firstUpdated(changed){super.firstUpdated(changed),this.responsiveObservationEnabled&&this.armCollapseObserver()}willUpdate(changed){if(super.willUpdate(changed),!this.ownerDocument&&this.panelCount===0&&(this.panelCount=Math.max(this.sizes.length,this.defaultSizes.length,this.panelConstraints.length)),!this.initializedSizes)this.initializeSizes(),this.initializedSizes=!0;else if(changed.has("sizes")){const previous=changed.get("sizes");this.sizesReconciledForMembership?this.sizesReconciledForMembership=!1:this.validLiveSizes(this.sizes)||(Array.isArray(previous)&&this.validLiveSizes(previous)?this.sizes=[...previous]:(this.sizes=[],this.ensureSizes()))}else this.sizes.length===0&&this.ensureSizes();if((changed.has("orientationBreakpoint")||changed.has("orientationBreakpointBasis"))&&this.orientationBreakpoints.configure(this.orientationBreakpoint,this.orientationBreakpointBasis),!this.hasUpdated&&this.isConnected&&this.responsiveObservationEnabled&&this.seedInlineSize(),(changed.has("orientation")||changed.has("narrowOrientation")||changed.has("orientationBreakpoint")||changed.has("orientationBreakpointBasis"))&&this.updateEffectiveOrientation(this.measuredInlineSize,this.hasUpdated&&this.orientationBreakpointBasis==="viewport"),changed.has("collapse")||changed.has("railBreakpoint")||changed.has("floatBreakpoint")||changed.has("collapseBreakpointBasis")){const previousEffective=changed.has("collapse")?this.effectiveCollapseStateFor(changed.get("collapse")??"none"):this.collapseState;changed.has("collapse")&&previousEffective!=="wide"&&this.endDragGestures(),this.collapseBreakpoints.configure(this.railBreakpoint,this.floatBreakpoint,this.collapseBreakpointBasis),this.collapsingIndex!==-1&&!this._forced&&(this._collapseState=this.collapseBreakpoints.classify(this.measuredInlineSize)),this.applyEffectiveCollapseTransition(previousEffective,this.collapseState,this.hasUpdated)}if(changed.has("open")||changed.has("collapseState")||changed.has("collapse")||changed.has("panelCount")){const next=this.collapseState==="floating"&&this.open;next!==this.overlayActive&&(this.overlayActive=next,next?(this.justOpened=!0,this.activateFloatingOverlay()):this.deactivateFloatingOverlay())}this.renderConstraintBounds=this.resolveConstraintBounds(this.getContainerSize()).bounds}get collapseState(){return this.effectiveCollapseStateFor(this.collapse)}set collapseState(next){if(next==="auto"){this.releaseCollapsePin(),this.updateCollapseState(this.currentMeasuredWidth());return}this._forced=!0,this.pinnedBand=this.collapseBreakpoints.classify(this.pinMeasurementWidth()),this.setRequestedCollapseState(next)}expandPane(){this.applyPaneIntent(!0)}collapsePane(){this.applyPaneIntent(!1)}togglePane(){this.applyPaneIntent(!this.paneExpanded)}get paneExpanded(){const state=this.collapseState;return state==="floating"?this.open:state==="wide"}applyPaneIntent(expanded){if(this.collapsingIndex===-1)return;const band=this.collapseBreakpoints.classify(this.pinMeasurementWidth());if(band==="floating"){this.collapseState!=="floating"&&(this.releaseCollapsePin(),this.setRequestedCollapseState("floating")),this.open=expanded;return}const target=expanded?"wide":"rail";if(this.collapseState!==target){if(target===band){this.releaseCollapsePin(),this.setRequestedCollapseState(target);return}this.collapseState=target}}releaseCollapsePin(){this._forced=!1,this.pinnedBand=void 0}pinMeasurementWidth(){const live=this.currentMeasuredWidth();return live>0?live:this.measuredInlineSize}get effectiveOrientation(){return this._effectiveOrientation}get responsiveObservationEnabled(){return this.collapse!=="none"||this.orientationBreakpoints.containerObservationEnabled}updateEffectiveOrientation(width,shouldEmit){const next=this.orientationBreakpoints.isBelow(width)?this.narrowOrientation:this.orientation;next!==this._effectiveOrientation&&(this.endDragGestures(),this._effectiveOrientation=next,this.requestUpdate(),shouldEmit&&this.emit("lr-multi-split-orientation-change",{orientation:next}),this._forced&&this.releasePinOnBreakpoint&&(this.releaseCollapsePin(),this.updateCollapseState(width,this.hasUpdated)))}currentMeasuredWidth(){return this.baseEl?.clientWidth??0}effectiveCollapseStateFor(collapse){return collapse!=="none"&&this.panelCount>=2?this._collapseState:"wide"}applyEffectiveCollapseTransition(previous,next,shouldEmit=!0){if(previous===next)return;this.endDragGestures(),this.requestUpdate("collapseState",previous);const forceClose=previous==="floating"&&next!=="floating"&&this.open,forcedCloseVersion=this.forcedCloseVersion;shouldEmit&&(this.relocateFocusOutOfCollapsingPanel(next),this.decorateOwnedPanels(),this.emit("lr-multi-split-collapse-change",{state:next})),forceClose&&this.forcedCloseVersion===forcedCloseVersion&&this.collapseState!=="floating"&&this.setOpen(!1,{force:!0})}relocateFocusOutOfCollapsingPanel(next){if(next==="wide"||next==="floating"&&this.open)return;const index=this.collapsingIndex;if(index===-1)return;const panel=this.ownedPanels[index];panel&&repairComposedFocus(panel,()=>this.collapseFocusFallbacks(panel))}collapseFocusFallbacks(collapsing){const dividers=[...this.renderRoot.querySelectorAll('[part="divider"]')];return[...new Set([...this.ownedPanels.filter(panel=>panel!==collapsing),...dividers.filter((_,index)=>!this.isDividerDisabled(index)),...dividers])]}setOpen(next,options){if(options?.force){this.open=next,this.forcedCloseVersion+=1,this.emit("lr-toggle",{expanded:next});return}if(this.open===next)return;const collapseState=this.collapseState,open=this.open,mutationVersion=this.toggleProposalMutationVersion;this.toggleProposalDepth+=1;try{if(this.emit("lr-toggle-request",{expanded:next},{cancelable:!0}).defaultPrevented||this.toggleProposalMutationVersion!==mutationVersion||this.collapseState!==collapseState||this.open!==open)return}finally{this.toggleProposalDepth-=1}this.open=next,this.emit("lr-toggle",{expanded:next})}requestUpdate(name,oldValue,options){this.toggleProposalDepth>0&&(name==="open"&&oldValue!==this.open||name==="collapse"&&oldValue!==this.collapse||name==="collapseState"&&oldValue!==this.collapseState)&&(this.toggleProposalMutationVersion+=1),super.requestUpdate(name,oldValue,options)}setRequestedCollapseState(next,shouldEmit=!0){const previousEffective=this.collapseState;if(next===this._collapseState)return;this._collapseState=next;const nextEffective=this.collapseState;this.applyEffectiveCollapseTransition(previousEffective,nextEffective,shouldEmit),previousEffective===nextEffective&&next!==nextEffective&&this.requestUpdate("collapseState",next)}get storageFullKey(){return this.storageKey?`lr-multi-split:${this.storageKey}:panels`:void 0}panelIdsFor(panels){const ids=[],seen=new Set;for(const panel of panels){const panelId=panel.getAttribute("panel-id")??"";if(!panelId||panelId.trim()!==panelId||seen.has(panelId))return null;seen.add(panelId),ids.push(panelId)}return ids}reconcileIdentitySizes(previousIds,previousValues,nextIds){if(previousIds.length!==previousValues.length||nextIds.length===0)return null;const previousSizes=new Map;previousIds.forEach((panelId,index)=>{previousSizes.set(panelId,previousValues[index])});const retainedTotal=nextIds.reduce((total,panelId)=>total+(previousSizes.get(panelId)??0),0),missingCount=nextIds.filter(panelId=>!previousSizes.has(panelId)).length;if(!(retainedTotal>0)){const equal=100/nextIds.length;return nextIds.map(()=>equal)}const newShare=100/nextIds.length,retainedScale=(100-newShare*missingCount)/retainedTotal;return nextIds.map(panelId=>{const previous=previousSizes.get(panelId);return previous===void 0?newShare:previous*retainedScale})}reconcileSizesByPanelId(previousPanels,nextPanels){if(previousPanels.length!==this.sizes.length||nextPanels.length===0)return null;const previousIds=this.panelIdsFor(previousPanels),nextIds=this.panelIdsFor(nextPanels);return!previousIds||!nextIds?null:this.reconcileIdentitySizes(previousIds,this.sizes,nextIds)}validInitialSizes(value){return!Array.isArray(value)||value.length!==this.panelCount||!value.every(size=>Number.isFinite(size)&&size>=this.safeMin)?!1:Math.abs(value.reduce((sum,size)=>sum+size,0)-100)<.01}validLiveSizes(value){if(!Array.isArray(value)||value.length!==this.panelCount)return!1;const floor=this.normalizedDefaultMin();return value.every(size=>Number.isFinite(size)&&size>=floor)?Math.abs(value.reduce((sum,size)=>sum+size,0)-100)<.01:!1}resolveDefaultSizes(){if(this.defaultSizes.length===0)return null;if(!this.defaultSizes.some(entry=>typeof entry=="string")){const numbers=this.defaultSizes;return this.validInitialSizes(numbers)?[...numbers]:null}const containerSize=this.currentMeasuredWidth()||this.getBoundingClientRect().width;if(!(containerSize>0))return null;const resolvedPx=[];for(const entry of this.defaultSizes){if(typeof entry=="number"){if(!Number.isFinite(entry))return null;resolvedPx.push(entry/100*containerSize);continue}const px=resolveCssLength(entry,{host:this,percentBase:containerSize,viewportBasis:this.ownerDocument.defaultView??void 0});if(px==null||!(px>=0))return null;resolvedPx.push(px)}const sum=resolvedPx.reduce((total,size)=>total+size,0);if(!(sum>0))return null;const normalized=resolvedPx.map(size=>size/sum*100);return this.validInitialSizes(normalized)?normalized:null}initializeSizes(){if(this.validInitialSizes(this.sizes)||this.loadPersisted())return;const resolved=this.resolveDefaultSizes();if(resolved){this.sizes=resolved;return}this.sizes=[],this.ensureSizes()}loadPersisted(){const panelIds=this.panelIdsFor(this.ownedPanels);if(!panelIds)return!1;const parsed=readPersistedState(this.storageFullKey,isPersistedPanelLayout);if(!parsed||parsed.panels.length===0)return!1;const persistedIds=[],persistedSizes=[],seen=new Set;for(const panel of parsed.panels){if(seen.has(panel.panelId))return!1;seen.add(panel.panelId),persistedIds.push(panel.panelId),persistedSizes.push(panel.size)}if(Math.abs(persistedSizes.reduce((sum,size)=>sum+size,0)-100)>=.01)return!1;const normalized=this.reconcileIdentitySizes(persistedIds,persistedSizes,panelIds);return normalized&&this.validInitialSizes(normalized)?(this.sizes=normalized,!0):!1}persist(){const panelIds=this.panelIdsFor(this.ownedPanels);if(!panelIds||panelIds.length!==this.sizes.length)return;const layout={version:1,panels:panelIds.map((panelId,index)=>({panelId,size:this.sizes[index]}))};writePersistedState(this.storageFullKey,layout)}ensureSizes(){if(this.panelCount===this.sizes.length)return;if(this.panelCount<=0){this.sizes=[];return}if(this.sizes.length===0){const equal=100/this.panelCount;this.sizes=Array.from({length:this.panelCount},()=>equal);return}const diff=this.panelCount-this.sizes.length;if(diff>0){const newShare=100/this.panelCount,scale=(100-newShare*diff)/100;this.sizes=[...this.sizes.map(s=>s*scale),...Array.from({length:diff},()=>newShare)]}else{const kept=this.sizes.slice(0,this.panelCount),removedTotal=this.sizes.slice(this.panelCount).reduce((sum,s)=>sum+s,0),keptTotal=kept.reduce((sum,s)=>sum+s,0)||1;this.sizes=kept.map(s=>s+s/keptTotal*removedTotal)}}readPanelStyle(panel,property2){return{value:panel.style.getPropertyValue(property2),priority:panel.style.getPropertyPriority(property2)}}samePanelStyle(left,right){return left.value===right.value&&left.priority===right.priority}snapshotPanelOwnership(panel){const styles2=new Map;for(const property2 of OWNED_PANEL_STYLE_PROPERTIES)styles2.set(property2,this.readPanelStyle(panel,property2));return{styles:styles2,appliedStyles:new Map,hidden:panel.hidden,collapseState:panel.getAttribute("data-collapse-state")}}adoptPanelOwnership(panel,snapshot){for(const property2 of OWNED_PANEL_STYLE_PROPERTIES){const current=this.readPanelStyle(panel,property2),applied=snapshot.appliedStyles.get(property2);(applied&&!this.samePanelStyle(current,applied)||!applied&&!this.samePanelStyle(current,snapshot.styles.get(property2)))&&snapshot.styles.set(property2,current)}(snapshot.appliedHidden!==void 0&&panel.hidden!==snapshot.appliedHidden||snapshot.appliedHidden===void 0&&panel.hidden!==snapshot.hidden)&&(snapshot.hidden=panel.hidden);const collapseState=panel.getAttribute("data-collapse-state");(snapshot.appliedCollapseState!==void 0&&collapseState!==snapshot.appliedCollapseState||snapshot.appliedCollapseState===void 0&&collapseState!==snapshot.collapseState)&&(snapshot.collapseState=collapseState)}applyOwnedPanelStyle(panel,snapshot,property2,value){value.value===""?panel.style.removeProperty(property2):panel.style.setProperty(property2,value.value,value.priority),snapshot.appliedStyles.set(property2,this.readPanelStyle(panel,property2))}applyOwnedPanelStyleValue(panel,snapshot,property2,value){this.applyOwnedPanelStyle(panel,snapshot,property2,{value,priority:""})}applyOwnedPanelHidden(panel,snapshot,hidden){panel.hidden=hidden,snapshot.appliedHidden=panel.hidden}applyOwnedPanelCollapseState(panel,snapshot,state){state===null?panel.removeAttribute("data-collapse-state"):panel.setAttribute("data-collapse-state",state),snapshot.appliedCollapseState=panel.getAttribute("data-collapse-state")}restorePanelOwnership(panel,snapshot){this.adoptPanelOwnership(panel,snapshot);for(const property2 of OWNED_PANEL_STYLE_PROPERTIES){const value=snapshot.styles.get(property2);value.value===""?panel.style.removeProperty(property2):panel.style.setProperty(property2,value.value,value.priority)}panel.hidden=snapshot.hidden,snapshot.collapseState===null?panel.removeAttribute("data-collapse-state"):panel.setAttribute("data-collapse-state",snapshot.collapseState)}panelProjectionDiverged(panel,snapshot){for(const property2 of OWNED_PANEL_STYLE_PROPERTIES){const current=this.readPanelStyle(panel,property2),expected=snapshot.appliedStyles.get(property2)??snapshot.styles.get(property2);if(!this.samePanelStyle(current,expected))return!0}if(panel.hidden!==(snapshot.appliedHidden??snapshot.hidden))return!0;const expectedCollapseState=snapshot.appliedCollapseState!==void 0?snapshot.appliedCollapseState:snapshot.collapseState;return panel.getAttribute("data-collapse-state")!==expectedCollapseState}resetPanelOwnershipObserver(){this.panelOwnershipObserver?.disconnect(),this.panelOwnershipObserver=void 0}observeOwnedPanels(){this.resetPanelOwnershipObserver();const MutationObserverConstructor=this.ownerDocument.defaultView?.MutationObserver;if(!MutationObserverConstructor||!this.isConnected||this.ownedPanels.length===0)return;const observer=new MutationObserverConstructor(records=>{records.some(record=>{const panel=record.target,snapshot=this.panelOwnership.get(panel);return snapshot?this.panelProjectionDiverged(panel,snapshot):!1})&&this.requestUpdate()});this.panelOwnershipObserver=observer;for(const panel of this.ownedPanels)observer.observe(panel,{attributes:!0,attributeFilter:["style","hidden","data-collapse-state"]})}samePanelSequence(next){return next.length===this.ownedPanels.length&&next.every((panel,index)=>panel===this.ownedPanels[index])}syncPanelMembership(reconcileSizes=!0){const next=[...this.children].filter(child=>child!==this.nativeModal.helperMount);if(this.samePanelSequence(next))return;const previousPanels=this.ownedPanels,identitySizes=reconcileSizes?this.reconcileSizesByPanelId(previousPanels,next):null,previousEffective=this.collapseState,nextSet=new Set(next);for(const panel of this.ownedPanels){if(nextSet.has(panel))continue;const snapshot=this.panelOwnership.get(panel);snapshot&&this.restorePanelOwnership(panel,snapshot),this.panelOwnership.delete(panel)}for(const panel of next)this.panelOwnership.has(panel)||this.panelOwnership.set(panel,this.snapshotPanelOwnership(panel));const countChanged=next.length!==this.panelCount;this.ownedPanels=next,this.panelCount=next.length,this.collapsingIndex!==-1&&!this._forced&&(this._collapseState=this.collapseBreakpoints.classify(this.currentMeasuredWidth())),this.applyEffectiveCollapseTransition(previousEffective,this.collapseState,this.hasUpdated),identitySizes?(this.sizesReconciledForMembership=!0,this.sizes=identitySizes):countChanged&&reconcileSizes&&(this.sizesReconciledForMembership=!0,this.ensureSizes()),this.observeOwnedPanels(),this.hasUpdated&&this.requestUpdate()}releaseOwnedPanels(){this.resetPanelOwnershipObserver();for(const panel of this.ownedPanels){const snapshot=this.panelOwnership.get(panel);snapshot&&this.restorePanelOwnership(panel,snapshot)}this.ownedPanels=[],this.panelOwnership.clear()}getContainerSize(){return this.baseEl?this.effectiveOrientation==="vertical"?this.baseEl.clientHeight:this.baseEl.clientWidth:0}resetGutterObserver(){this.gutterObserverFrame!==void 0&&(this.gutterObserverDocument?.defaultView?.cancelAnimationFrame(this.gutterObserverFrame),this.gutterObserverFrame=void 0),this.gutterResizeObserver?.disconnect(),this.gutterResizeObserver=void 0,this.gutterObserverDocument=void 0,this.gutterObservedDividers=[],this.baseEl?.style.removeProperty("--_lr-multi-split-gutters")}updateGutterBudget(){const view=this.ownerDocument.defaultView,base=this.baseEl;if(!view||!base)return;const vertical=this.effectiveOrientation==="vertical",value=`${this.gutterObservedDividers.reduce((total,divider)=>{const style=view.getComputedStyle(divider),properties=vertical?["height","padding-top","padding-bottom","border-top-width","border-bottom-width"]:["width","padding-left","padding-right","border-left-width","border-right-width"],boxProperties=style.boxSizing==="border-box"?properties.slice(0,1):properties;return total+boxProperties.reduce((size,property2)=>size+finiteRange(parseFloat(style.getPropertyValue(property2)),0,0),0)},0)}px`;base.style.getPropertyValue("--_lr-multi-split-gutters")!==value&&base.style.setProperty("--_lr-multi-split-gutters",value)}syncGutterObserver(enabled){const base=this.baseEl;if(!enabled||!this.isConnected||!base){this.resetGutterObserver();return}const ownerDocument=this.ownerDocument,dividers=[...base.querySelectorAll('[part="divider"]')];if(this.gutterResizeObserver&&this.gutterObserverDocument===ownerDocument&÷rs.length===this.gutterObservedDividers.length&÷rs.every((divider,index)=>divider===this.gutterObservedDividers[index])){this.updateGutterBudget();return}this.resetGutterObserver(),this.gutterObservedDividers=dividers,this.gutterObserverDocument=ownerDocument,this.gutterObservedContainerSize=this.getContainerSize(),this.updateGutterBudget();const ownerWindow=ownerDocument.defaultView,ResizeObserverConstructor=ownerWindow?.ResizeObserver;if(!ownerWindow||!ResizeObserverConstructor)return;const observer=new ResizeObserverConstructor(()=>{if(this.gutterResizeObserver!==observer||!this.isConnected||this.ownerDocument!==ownerDocument)return;this.updateGutterBudget();const size=this.getContainerSize();size!==this.gutterObservedContainerSize&&(this.gutterObservedContainerSize=size,this.requestUpdate())});this.gutterResizeObserver=observer;const frame=ownerWindow.requestAnimationFrame(()=>{if(!(this.gutterObserverFrame!==frame||this.gutterResizeObserver!==observer||!this.isConnected||this.ownerDocument!==ownerDocument||this.baseEl!==base)){this.gutterObserverFrame=void 0,observer.observe(base,{box:"border-box"});for(const divider of dividers)observer.observe(divider,{box:"border-box"})}});this.gutterObserverFrame=frame}get collapsingIndex(){return this.collapse==="none"||this.panelCount<2?-1:this.collapse==="start"?0:this.panelCount-1}get collapseActive(){return this.collapsingIndex!==-1&&this.collapseState!=="wide"}isDividerDisabled(index){if(!this.collapseActive)return!1;const adjacent=this.collapsingIndex===0?0:this.panelCount-2;return index===adjacent}updateCollapseState(width,shouldEmit=!0){if(this.collapse==="none")return;const classified=this.collapseBreakpoints.classify(width);if(this._forced){if(!this.releasePinOnBreakpoint||classified===this.pinnedBand)return;this.releaseCollapsePin()}this.setRequestedCollapseState(classified,shouldEmit)}armCollapseObserver(){const observedElement=this.baseEl;if(!this.isConnected||!observedElement)return;const ownerDocument=this.ownerDocument;if(this.collapseResizeObserver&&this.collapseObservedElement===observedElement&&this.collapseObserverOwnerDocument===ownerDocument)return;this.resetCollapseObserver();const ResizeObserverConstructor=ownerDocument.defaultView?.ResizeObserver;if(!ResizeObserverConstructor)return;const generation=this.collapseObserverGeneration,observer=new ResizeObserverConstructor(entries=>{if(this.collapseResizeObserver!==observer||this.collapseObserverGeneration!==generation||!this.isConnected||this.ownerDocument!==ownerDocument||this.baseEl!==observedElement)return;const box=entries[0]?.contentBoxSize?.[0],width=box?box.inlineSize:observedElement.getBoundingClientRect().width;this.measuredInlineSize=width,this.updateCollapseState(width),this.updateEffectiveOrientation(width,!0)});this.collapseResizeObserver=observer,this.collapseObservedElement=observedElement,this.collapseObserverOwnerDocument=ownerDocument,observer.observe(observedElement)}resetCollapseObserver(){this.collapseObserverGeneration+=1,this.collapseResizeObserver?.disconnect(),this.collapseResizeObserver=void 0,this.collapseObservedElement=void 0,this.collapseObserverOwnerDocument=void 0}syncCollapseObserver(){if(!this.responsiveObservationEnabled){this.resetCollapseObserver();return}this.armCollapseObserver()}get safeMin(){return finiteRange(this.min,10,0)}normalizedDefaultMin(){if(this.panelCount<=0)return 0;const requested=this.safeMin,available=Math.max(0,100-KEYBOARD_STEP);return Math.min(requested,available/this.panelCount)}resolveConstraintBounds(containerSize){const fallbackMin=this.normalizedDefaultMin(),fallback=Array.from({length:this.panelCount},()=>({min:fallbackMin,max:1/0}));if(this.panelCount<=0)return{bounds:[],usePanelConstraints:!0};const bounds=[];let minimumTotal=0,maximumTotal=0,hasUnboundedMaximum=!1,issueReason;for(let index=0;index<this.panelCount;index++){const constraint=this.panelConstraints[index];let min=this.safeMin,max=1/0,minSet=!1,maxSet=!1;constraint&&(constraint.minPx!=null&&Number.isFinite(constraint.minPx)&&constraint.minPx>=0&&containerSize>0&&(min=constraint.minPx/containerSize*100,minSet=!0),constraint.minPercent!=null&&Number.isFinite(constraint.minPercent)&&constraint.minPercent>=0&&(min=minSet?Math.max(min,constraint.minPercent):constraint.minPercent,minSet=!0),constraint.maxPx!=null&&Number.isFinite(constraint.maxPx)&&constraint.maxPx>=0&&containerSize>0&&(max=constraint.maxPx/containerSize*100,maxSet=!0),constraint.maxPercent!=null&&Number.isFinite(constraint.maxPercent)&&constraint.maxPercent>=0&&(max=maxSet?Math.min(max,constraint.maxPercent):constraint.maxPercent,maxSet=!0),(constraint.minPx!=null&&(!Number.isFinite(constraint.minPx)||constraint.minPx<0)||constraint.maxPx!=null&&(!Number.isFinite(constraint.maxPx)||constraint.maxPx<0)||constraint.minPercent!=null&&(!Number.isFinite(constraint.minPercent)||constraint.minPercent<0)||constraint.maxPercent!=null&&(!Number.isFinite(constraint.maxPercent)||constraint.maxPercent<0))&&(issueReason??="minimum-exceeds-maximum")),min>max&&(issueReason??="minimum-exceeds-maximum"),bounds.push({min,max}),minimumTotal+=min,Number.isFinite(max)?maximumTotal+=max:hasUnboundedMaximum=!0}return issueReason==null&&minimumTotal>100+1e-9&&(issueReason="minimum-total"),issueReason==null&&!hasUnboundedMaximum&&maximumTotal<100-1e-9&&(issueReason="maximum-total"),issueReason==null?{bounds,usePanelConstraints:!0}:{bounds:fallback,usePanelConstraints:!1,issue:{reason:issueReason,panelCount:this.panelCount,minimumTotal,maximumTotal:hasUnboundedMaximum?null:maximumTotal,containerSize}}}hasClampConstraint(constraint){return!!constraint&&(constraint.minPx!=null||constraint.maxPx!=null||constraint.minPercent!=null||constraint.maxPercent!=null)}minSideExpr(constraint){const terms=[];return constraint?.minPx!=null&&Number.isFinite(constraint.minPx)&&constraint.minPx>=0&&terms.push(`${constraint.minPx}px`),constraint?.minPercent!=null&&Number.isFinite(constraint.minPercent)&&constraint.minPercent>=0&&terms.push(`${constraint.minPercent}%`),terms.length===0?`${NO_MIN_PX}px`:terms.length===1?terms[0]:`max(${this.safeMin}%, ${terms.join(", ")})`}maxSideExpr(constraint){const terms=[];return constraint?.maxPx!=null&&Number.isFinite(constraint.maxPx)&&constraint.maxPx>=0&&terms.push(`${constraint.maxPx}px`),constraint?.maxPercent!=null&&Number.isFinite(constraint.maxPercent)&&constraint.maxPercent>=0&&terms.push(`${constraint.maxPercent}%`),terms.length===0?`${NO_MAX_PX}px`:terms.length===1?terms[0]:`min(${terms.join(", ")})`}clampPair(sizes,i,delta,containerSize=0){const next=[...sizes],currentA=next[i],currentB=next[i+1];if(currentA===void 0||currentB===void 0)return next;const pairTotal=currentA+currentB,bounds=this.resolveConstraintBounds(containerSize).bounds,a=bounds[i]??{min:0,max:1/0},b=bounds[i+1]??{min:0,max:1/0},loRaw=Math.max(a.min,pairTotal-b.max),hiRaw=Math.min(a.max,pairTotal-b.min),lo=Math.min(loRaw,pairTotal),hi=Math.max(hiRaw,lo),clampedA=Math.min(Math.max(currentA+delta,lo),hi);return next[i]=clampedA,next[i+1]=pairTotal-clampedA,next}requestResize(next,commit){return next.length===this.sizes.length&&next.every((size,index)=>Math.abs(size-this.sizes[index])<=1e-9)||this.emit("lr-resize-request",{sizes:[...next]},{cancelable:!0}).defaultPrevented?!1:(this.sizes=next,this.emit("lr-resize",{sizes:[...this.sizes]}),commit&&this.settle(),!0)}settle(){this.persist(),this.emit("lr-resize-change",{sizes:[...this.sizes]})}applyDelta(index,delta,commit){const next=this.clampPair(this.sizes,index,delta,this.getContainerSize());return next.length!==this.sizes.length||next.some((size,currentIndex)=>Math.abs(size-this.sizes[currentIndex])>1e-9)?(this.requestResize(next,commit),!0):!1}get floatingPanelEl(){const index=this.collapsingIndex;return index===-1?null:this.ownedPanels[index]??null}activateFloatingOverlay(){this.openingBlockSize=this.baseEl?.getBoundingClientRect().height??0,this.modalSurface.prepare();const opener=deepActiveElement(this.ownerDocument);this.overlayOpener=isHtmlElement(opener)?opener:null;const trigger=this.resolveExternalTrigger();this.overlayReturnTarget=trigger??this.overlayOpener;const panel=this.floatingPanelEl;panel&&(this.floatingDialogPanel=panel,this.floatingDialogPreviousRole=panel.getAttribute("role"),this.floatingDialogPreviousAriaModal=panel.getAttribute("aria-modal"),this.nativeModal.requested||(panel.setAttribute("role","dialog"),panel.setAttribute("aria-modal","true"))),this.overlayHandle=activateOverlay({host:this,panel:()=>this.floatingPanelEl,modalRoot:()=>this.floatingPanelEl,auxiliaryRoots:()=>{const root=this.nativeModal.helperMount;return root?[root]:[]},restoreFocusTo:trigger??void 0,onEscape:()=>this.setOpen(!1),onBackdrop:()=>this.setOpen(!1),lockScroll:!0,suspendWhenUnrendered:!0,deferredReturn:()=>{if(!(this.resolveExternalTrigger()||this.trigger||this.for))return;const panel2=this.floatingDialogPanel;return{candidates:()=>[this.resolveExternalTrigger(),this.overlayReturnTarget,this.overlayOpener],stranded:active=>panel2!==null&&composedContains(panel2,active),isCurrent:()=>!this.overlayActive}}})}deactivateFloatingOverlay(){this.modalSurface.hide(),this.stopNativeModalGeometry(),this.nativeModal.prepare(!1);const trigger=this.resolveExternalTrigger(),panel=this.floatingDialogPanel;trigger&&this.overlayHandle?.updateRestoreFocusTo(trigger),this.overlayHandle?.deactivate(),this.overlayHandle=void 0,this.floatingDialogPanel=null,panel&&(this.floatingDialogPreviousRole===null?panel.removeAttribute("role"):panel.setAttribute("role",this.floatingDialogPreviousRole),this.floatingDialogPreviousAriaModal===null?panel.removeAttribute("aria-modal"):panel.setAttribute("aria-modal",this.floatingDialogPreviousAriaModal))}endDragGestures(){this.drags.clear(),this.dragController.cancelAll()}dividerName(index){let label;try{label=this.dividerLabel?.(index,this.panelCount)}catch{}return typeof label=="string"&&label.trim()?label:this.localize("resizeDivider",void 0,{a:getNumberFormat(this.effectiveLocale).format(index+1),b:getNumberFormat(this.effectiveLocale).format(index+2)})}dividerValueRange(index,bounds=this.resolveConstraintBounds(this.getContainerSize()).bounds){const pairTotal=(this.sizes[index]??0)+(this.sizes[index+1]??0),leading=bounds[index],trailing=bounds[index+1],min=Math.max(leading.min,pairTotal-trailing.max);return{min,max:Math.max(min,Math.min(leading.max,pairTotal-trailing.min))}}updated(changed){super.updated(changed),this.overlayActive&&(this.syncNativeModalGeometry(),this.modalSurface.show()),(changed.has("collapse")||changed.has("orientationBreakpoint")||changed.has("orientationBreakpointBasis"))&&this.syncCollapseObserver(),this.orientationBreakpoints.active?this.setAttribute("data-effective-orientation",this._effectiveOrientation):this.removeAttribute("data-effective-orientation"),(changed.has("panelConstraints")||changed.has("min"))&&(this.constraintConfigVersion+=1);const constraintResolution=this.resolveConstraintBounds(this.getContainerSize()),issue=constraintResolution.issue,issueKey=issue?`${issue.reason}:${issue.panelCount}:${this.constraintConfigVersion}`:"";issueKey!==this.constraintIssueKey&&(this.constraintIssueKey=issueKey,issue&&this.emit("lr-multi-split-constraints-invalid",issue));const collapsingIndex=this.collapseActive?this.collapsingIndex:-1;this.syncGutterObserver(collapsingIndex===-1&&this.panelConstraints.some(constraint=>finiteRange(constraint?.minPx??0,0,0)>0)),this.decorateOwnedPanels(constraintResolution),this.syncExternalTriggerA11y(),this.justOpened&&(this.justOpened=!1,this.overlayHandle?.focusInitial())}resolveExternalTrigger(){if(this.trigger)return this.trigger;if(!this.for)return null;const found=this.getRootNode().getElementById?.(this.for);return isHtmlElement(found)?found:null}syncExternalTriggerA11y(){const panel=this.ownedPanels[this.collapsingIndex],trigger=panel&&this.panelCount>1?this.resolveExternalTrigger():null;if(!this.isConnected||!panel||!trigger){this.releaseExternalTriggerA11y();return}this.triggerPanel!==panel&&(this.releaseExternalTriggerA11y(),this.triggerPanel=panel),panel.id||(this.generatedTriggerPanelId=nextId("multi-split-panel"),panel.id=this.generatedTriggerPanelId);const contribution={attributes:{"aria-expanded":this.paneExpanded?"true":"false"},controls:[panel]};this.triggerAria?this.triggerAria.update(trigger,contribution):this.triggerAria=acquireAriaOwnership(trigger,contribution)}releaseExternalTriggerA11y(){this.triggerAria?.release(),this.triggerAria=void 0,this.triggerPanel&&this.generatedTriggerPanelId&&this.triggerPanel.id===this.generatedTriggerPanelId&&this.triggerPanel.removeAttribute("id"),this.triggerPanel=void 0,this.generatedTriggerPanelId=void 0}decorateOwnedPanels(constraintResolution=this.resolveConstraintBounds(this.getContainerSize())){const panels=this.ownedPanels;for(const panel of panels){const snapshot=this.panelOwnership.get(panel);snapshot&&this.adoptPanelOwnership(panel,snapshot)}const collapsingIndex=this.collapseActive?this.collapsingIndex:-1,pixelMinimumTotal=constraintResolution.usePanelConstraints?this.panelConstraints.slice(0,this.panelCount).reduce((total,constraint)=>total+finiteRange(constraint?.minPx??0,0,0),0):0,redistributedShare=new Array(panels.length).fill(0);if(collapsingIndex===-1){let freedPercent=0;const growableIndexes=[];let growableTotal=0;for(let i=0;i<panels.length;i++){const percent=this.sizes[i]??0,constraint=constraintResolution.usePanelConstraints?this.panelConstraints[i]:void 0;if(this.hasClampConstraint(constraint)){const bounds=constraintResolution.bounds[i],clamped=bounds?Math.min(Math.max(percent,bounds.min),bounds.max):percent;clamped<percent&&(freedPercent+=percent-clamped)}else growableIndexes.push(i),growableTotal+=percent}if(freedPercent>0&&growableTotal>0)for(const i of growableIndexes)redistributedShare[i]=freedPercent*((this.sizes[i]??0)/growableTotal)}panels.forEach((panel,i)=>{const snapshot=this.panelOwnership.get(panel);if(!snapshot)return;const percent=this.sizes[i]??0,constraint=constraintResolution.usePanelConstraints?this.panelConstraints[i]:void 0,pixelMinimum=finiteRange(constraint?.minPx??0,0,0);if(collapsingIndex===-1&&pixelMinimum>0&&pixelMinimumTotal>0?this.applyOwnedPanelStyleValue(panel,snapshot,"--_lr-multi-split-panel-min",`min(${pixelMinimum}px, max(0px, calc((100% - var(--_lr-multi-split-gutters, 0px)) * ${pixelMinimum/pixelMinimumTotal})))`):this.applyOwnedPanelStyle(panel,snapshot,"--_lr-multi-split-panel-min",snapshot.styles.get("--_lr-multi-split-panel-min")),this.applyOwnedPanelStyle(panel,snapshot,"inline-size",snapshot.styles.get("inline-size")),this.applyOwnedPanelHidden(panel,snapshot,snapshot.hidden),collapsingIndex===i&&this.collapseState==="rail")this.applyOwnedPanelStyleValue(panel,snapshot,"flex",`0 0 ${this.railWidth}`);else if(collapsingIndex===i&&this.collapseState==="floating"&&!this.open)this.applyOwnedPanelStyleValue(panel,snapshot,"flex","none"),this.applyOwnedPanelHidden(panel,snapshot,!0);else if(collapsingIndex===i&&this.collapseState==="floating")this.applyOwnedPanelStyleValue(panel,snapshot,"inline-size",`var(--lr-multi-split-floating-panel-inline-size, ${percent}%)`);else if(collapsingIndex!==-1&&i!==collapsingIndex)this.applyOwnedPanelStyleValue(panel,snapshot,"flex",this.hasClampConstraint(constraint)?`0 1 clamp(${this.minSideExpr(constraint)}, ${percent}%, ${this.maxSideExpr(constraint)})`:`${percent} 1 0%`);else{const adjustedPercent=percent+(redistributedShare[i]??0);this.applyOwnedPanelStyleValue(panel,snapshot,"flex",this.hasClampConstraint(constraint)?`0 1 clamp(${this.minSideExpr(constraint)}, ${percent}%, ${this.maxSideExpr(constraint)})`:`0 1 ${adjustedPercent}%`)}this.applyOwnedPanelStyleValue(panel,snapshot,"order",String(i*2)),collapsingIndex===i?this.applyOwnedPanelCollapseState(panel,snapshot,this.collapseState):this.applyOwnedPanelCollapseState(panel,snapshot,null)}),collapsingIndex!==-1?this.setAttribute("data-collapse-state",this.collapseState):this.removeAttribute("data-collapse-state")}render(){const dividers=[],bounds=this.renderConstraintBounds;for(let i=0;i<this.panelCount-1;i++){const{min:valueMin,max:valueMax}=this.dividerValueRange(i,bounds),disabled=this.isDividerDisabled(i);dividers.push(html`<div
|
|
1
|
+
import{__decorate}from"tslib";import{resolveIdReferencesIn}from"../../../internal/aria-reflection.js";import{NativeModalCarrier}from"../../../internal/native-modal-carrier.js";import{ModalSurfaceController}from"../../../internal/modal-surface-controller.js";import{leaseInlineStyleProperty}from"../../../internal/style-property-lease.js";import{nativeModalCarrierStyles}from"../../../internal/native-modal-carrier.styles.js";import{collectionSupport}from"../../../internal/collection-snapshot.js";import{html,nothing}from"lit";import{property,query}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{activateOverlay,composedContains,deepActiveElement}from"../../../internal/overlay-manager.js";import{isRtl}from"../../../internal/rtl.js";import{repairComposedFocus}from"../../../internal/focus-navigation.js";import{cancelDeferredFocusReturn}from"../../../internal/deferred-focus-return.js";import{acquireAriaOwnership}from"../../../internal/aria-ownership.js";import{nextId}from"../../../internal/a11y.js";import{isHtmlElement}from"../../../internal/dom-guards.js";import{finiteRange}from"../../../internal/numbers.js";import{SeparatorDragController,separatorArrowDirection,separatorCoordinate,separatorDelta}from"../../../internal/separator-drag.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{CollapseBreakpointController,OrientationBreakpointController}from"../../../internal/orientation-breakpoint.js";import{readPersistedState,writePersistedState}from"../../../internal/persisted-state.js";import{resolveCssLength}from"../../../internal/css-length.js";import{styles}from"./multi-split.styles.js";import{LYRA_DEFAULT_resizeDivider,LYRA_DEFAULT_resizeValuePercent}from"../../../internal/default-strings/layout.generated.js";const KEYBOARD_STEP=2;function isPersistedPanelLayout(value){if(typeof value!="object"||value===null)return!1;const candidate=value;if(candidate.version!==1&&candidate.version!==2||!Array.isArray(candidate.panels))return!1;const version=candidate.version;return candidate.panels.every(panel=>{if(typeof panel!="object"||panel===null)return!1;const record=panel;return version===2&&(record.collapsed!==void 0&&typeof record.collapsed!="boolean"||record.expandedSize!==void 0&&!(typeof record.expandedSize=="number"&&Number.isFinite(record.expandedSize)&&record.expandedSize>0))?!1:typeof record.panelId=="string"&&record.panelId!==""&&record.panelId.trim()===record.panelId&&typeof record.size=="number"&&Number.isFinite(record.size)&&record.size>=0})}const NO_COLLAPSED_PANELS=new Set,NO_MIN_PX=0,NO_MAX_PX=1e6,OWNED_PANEL_STYLE_PROPERTIES=["flex","order","inline-size","--_lr-multi-split-panel-min"],OWNED_PANEL_ATTRIBUTES=["data-collapse-state","data-panel-collapsed"];class LyraMultiSplit extends LyraElement{constructor(){super(...arguments),this.toggleProposalDepth=0,this.toggleProposalMutationVersion=0,this.forcedCloseVersion=0,this.sizes=[],this.defaultSizes=[],this.min=10,this.orientation="horizontal",this.orientationBreakpointBasis="container",this.narrowOrientation="vertical",this.panelConstraints=[],this.collapse="none",this.railWidth="3.5rem",this.railBreakpoint=640,this.floatBreakpoint=400,this.collapseBreakpointBasis="container",this.releasePinOnBreakpoint=!1,this.open=!1,this.trigger=null,this.for="",this.collapsedPanels=[],this.panelCount=0,this.sizesReconciledForMembership=!1,this.appliedCollapsed=[],this.expandedSizes=new Map,this._collapseState="wide",this._forced=!1,this.overlayActive=!1,this.justOpened=!1,this.nativeModal=new NativeModalCarrier(this,{onCancel:()=>{this.overlayHandle?.isTopmost()&&this.setOpen(!1)},onUnexpectedClose:()=>{this.overlayHandle?.isTopmost()&&this.setOpen(!1),this.overlayActive&&this.modalSurface.show()}}),this.modalSurface=new ModalSurfaceController(this,this.nativeModal,()=>this.baseEl??null),this.floatingGeometry=new Map,this.openingBlockSize=0,this.syncNativeModalGeometry=()=>{if(!this.overlayActive||!this.isConnected)return;const allocation=this.shadowRoot?.querySelector(".allocation"),reservation=this.shadowRoot?.querySelector(".allocation-reservation"),frame=this.nativeModal.requested?this.shadowRoot?.querySelector("[data-native-modal-carrier]"):this.baseEl;if(!allocation||!reservation||!frame)return;if(!this.nativeModalView){this.nativeModalView=this.ownerDocument.defaultView??void 0,this.nativeModalView?.addEventListener("scroll",this.syncNativeModalGeometry,!0),this.nativeModalView?.addEventListener("resize",this.syncNativeModalGeometry);const Observer=this.nativeModalView?.ResizeObserver;if(Observer){const observer=new Observer(this.syncNativeModalGeometry);this.nativeModalResizeObserver=observer,observer.observe(allocation)}}if(this.floatingFrame!==frame){for(const lease of this.floatingGeometry.values())lease.release();this.floatingGeometry.clear(),this.floatingFrame=frame}const set=(property2,value)=>{const lease=this.floatingGeometry.get(property2);lease?(frame.style.getPropertyValue(property2)!==value||frame.style.getPropertyPriority(property2))&&lease.set(value):this.floatingGeometry.set(property2,leaseInlineStyleProperty(frame,property2,value))};if(reservation.hidden){const height=this.baseEl?.getBoundingClientRect().height??0;this.openingBlockSize=height||this.openingBlockSize||allocation.getBoundingClientRect().height,set("position","fixed"),reservation.style.blockSize=`${this.openingBlockSize}px`,reservation.hidden=!1}const rect=allocation.getBoundingClientRect();for(const[property2,value]of Object.entries({position:"fixed",top:`${rect.top}px`,left:`${rect.left}px`,right:"auto",bottom:"auto",width:`${rect.width}px`,height:`${rect.height}px`,padding:"0","box-sizing":"border-box","max-inline-size":"none"}))set(property2,value)},this.overlayReturnTarget=null,this.overlayOpener=null,this.floatingDialogPanel=null,this.floatingDialogPreviousRole=null,this.floatingDialogPreviousAriaModal=null,this.drags=new Map,this.dragController=new SeparatorDragController(this,event=>this.onPointerMove(event),event=>this.onPointerUp(event)),this.ownedPanels=[],this.panelOwnership=new Map,this.constraintIssueKey="",this.constraintConfigVersion=0,this.renderConstraintBounds=[],this.initializedSizes=!1,this.measuredInlineSize=Number.POSITIVE_INFINITY,this._effectiveOrientation="horizontal",this.collapseObserverGeneration=0,this.gutterObservedDividers=[],this.gutterObservedContainerSize=0,this.orientationBreakpoints=new OrientationBreakpointController(this,()=>this.updateEffectiveOrientation(this.measuredInlineSize,!0)),this.collapseBreakpoints=new CollapseBreakpointController(this,()=>this.updateCollapseState(this.measuredInlineSize,!0)),this.onSlotChange=()=>{this.updateBrowserDerivedState(()=>this.syncPanelMembership())},this.onBackdropClick=()=>{this.overlayHandle?.dismissBackdrop()},this.onModalLayerClick=event=>{event.target===this.baseEl&&this.overlayHandle?.dismissBackdrop()},this.onPointerDown=(e,index)=>{if(e.button!==0||this.isDividerDisabled(index))return;const divider=e.currentTarget;this.dragController.start(e,divider)&&this.drags.set(e.pointerId,{index,startPos:separatorCoordinate(e,this.effectiveOrientation==="vertical"?"block":"inline"),base:this.baseEl,rtl:this.effectiveOrientation==="horizontal"&&isRtl(this),appliedDelta:0,acceptedResize:!1})},this.onPointerMove=e=>{const drag=this.drags.get(e.pointerId);if(!drag)return;if(this.isDividerDisabled(drag.index)){this.endDragGestures();return}if(this.effectiveOrientation==="horizontal"&&isRtl(this)!==drag.rtl){this.endDragGestures();return}const total=this.effectiveOrientation==="vertical"?drag.base.clientHeight:drag.base.clientWidth;if(!Number.isFinite(total)||total<=0){this.endDragGestures();return}const incremental=separatorDelta(drag.startPos,e,this.effectiveOrientation==="vertical"?"block":"inline",drag.rtl)/total*100-drag.appliedDelta,pair=this.dividerPair(drag.index);if(!pair)return;const[leading,trailing]=pair,priorValue=this.sizes[leading];if(priorValue===void 0)return;const paired=this.clampPair(this.sizes,leading,trailing,incremental,total),pairedA=paired[leading],pairedB=paired[trailing];if(pairedA===void 0||pairedB===void 0)return;const next=[...this.sizes];next[leading]=pairedA,next[trailing]=pairedB,this.requestResize(next,!1)&&(drag.appliedDelta+=pairedA-priorValue,drag.acceptedResize=!0)},this.onPointerUp=e=>{const drag=this.drags.get(e.pointerId);drag&&(this.drags.delete(e.pointerId),e.type==="pointerup"&&drag.acceptedResize&&this.settle(),this.dragController.end(e.pointerId))},this.onDividerKeyDown=(e,index)=>{if(this.isDividerDisabled(index)||e.altKey||e.ctrlKey||e.metaKey||e.isComposing)return;const direction=separatorArrowDirection(e,this.effectiveOrientation==="vertical"?"block":"inline",this.effectiveOrientation==="horizontal"&&isRtl(this));if(e.key==="Home"||e.key==="End"){const{min,max}=this.dividerValueRange(index),current=this.sizes[this.dividerPair(index)?.[0]??index];if(current!==void 0){const target=e.key==="Home"?min:max;this.applyDelta(index,target-current,!0)&&e.preventDefault()}}else direction===1?this.applyDelta(index,KEYBOARD_STEP,!0)&&e.preventDefault():direction===-1&&this.applyDelta(index,-KEYBOARD_STEP,!0)&&e.preventDefault()}}static{this.defaultStrings={...super.defaultStrings,resizeDivider:LYRA_DEFAULT_resizeDivider,resizeValuePercent:LYRA_DEFAULT_resizeValuePercent}}static{this.collectionSupport=collectionSupport}static{this.ownedCollectionProperties=Object.freeze(["sizes","defaultSizes","panelConstraints","collapsedPanels"])}static{this.styles=[LyraElement.styles,nativeModalCarrierStyles,styles]}static{this.immutableEventDetails=Object.freeze(["lr-resize-request","lr-resize","lr-resize-change","lr-multi-split-panel-collapse-change"])}static{this.properties={collapseState:{reflect:!0,attribute:"collapse-state",noAccessor:!0}}}stopNativeModalGeometry(){this.nativeModalView?.removeEventListener("scroll",this.syncNativeModalGeometry,!0),this.nativeModalView?.removeEventListener("resize",this.syncNativeModalGeometry),this.nativeModalView=void 0,this.nativeModalResizeObserver?.disconnect(),this.nativeModalResizeObserver=void 0;for(const lease of this.floatingGeometry.values())lease.release();this.floatingGeometry.clear(),this.floatingFrame=void 0,this.openingBlockSize=0;const reservation=this.shadowRoot?.querySelector(".allocation-reservation");reservation&&(reservation.hidden=!0,reservation.style.removeProperty("block-size"))}nativeModalLabel(){const panel=this.floatingPanelEl;return panel?panel.hasAttribute("aria-label")?panel.getAttribute("aria-label"):resolveIdReferencesIn(panel.getRootNode(),panel.getAttribute("aria-labelledby")).map(element=>element.textContent?.trim()).filter(Boolean).join(" ")||this.getAttribute("aria-label"):this.getAttribute("aria-label")}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.responsiveObservationEnabled&&this.seedInlineSize(),this.seedFirstRenderState(()=>this.syncPanelMembership(!1)),this.hasUpdated&&this.syncPanelMembership(!1),this.initializedSizes&&this.ensureSizes(),this.responsiveObservationEnabled&&this.armCollapseObserver(),this.hasUpdated&&this.overlayActive&&(this.overlayHandle?.isActive()?this.overlayHandle.resume():this.activateFloatingOverlay(),queueMicrotask(()=>{!this.isConnected||!this.overlayActive||(this.syncNativeModalGeometry(),this.modalSurface.show(),this.overlayHandle?.focusInitial())})),this.hasUpdated&&this.syncExternalTriggerA11y()}seedInlineSize(){const hostWidth=this.getBoundingClientRect().width;hostWidth>0&&(this.measuredInlineSize=hostWidth)}disconnectedCallback(){this.modalSurface.disconnect(),this.stopNativeModalGeometry(),super.disconnectedCallback(),this.endDragGestures(),this.resetCollapseObserver(),this.resetGutterObserver(),this.overlayHandle?.suspend(),cancelDeferredFocusReturn(this),this.releaseExternalTriggerA11y(),this.releaseOwnedPanels()}adoptedCallback(){super.adoptedCallback(),cancelDeferredFocusReturn(this),this.releaseExternalTriggerA11y(),this.endDragGestures(),this.resetCollapseObserver(),this.resetGutterObserver(),this.releaseOwnedPanels()}firstUpdated(changed){super.firstUpdated(changed),this.responsiveObservationEnabled&&this.armCollapseObserver()}willUpdate(changed){if(super.willUpdate(changed),!this.ownerDocument&&this.panelCount===0&&(this.panelCount=Math.max(this.sizes.length,this.defaultSizes.length,this.panelConstraints.length)),!this.initializedSizes)this.initializeSizes(),this.initializedSizes=!0;else if(changed.has("sizes")){const previous=changed.get("sizes");this.sizesReconciledForMembership?this.sizesReconciledForMembership=!1:!this.validLiveSizes(this.sizes)&&!this.acceptFoldedSizes(previous)&&(Array.isArray(previous)&&this.validLiveSizes(previous)?this.sizes=[...previous]:(this.sizes=[],this.ensureSizes()))}else this.sizes.length===0&&this.ensureSizes();if(this.syncCollapsedLayout(),(changed.has("orientationBreakpoint")||changed.has("orientationBreakpointBasis"))&&this.orientationBreakpoints.configure(this.orientationBreakpoint,this.orientationBreakpointBasis),!this.hasUpdated&&this.isConnected&&this.responsiveObservationEnabled&&this.seedInlineSize(),(changed.has("orientation")||changed.has("narrowOrientation")||changed.has("orientationBreakpoint")||changed.has("orientationBreakpointBasis"))&&this.updateEffectiveOrientation(this.measuredInlineSize,this.hasUpdated&&this.orientationBreakpointBasis==="viewport"),changed.has("collapse")||changed.has("railBreakpoint")||changed.has("floatBreakpoint")||changed.has("collapseBreakpointBasis")){const previousEffective=changed.has("collapse")?this.effectiveCollapseStateFor(changed.get("collapse")??"none"):this.collapseState;changed.has("collapse")&&previousEffective!=="wide"&&this.endDragGestures(),this.collapseBreakpoints.configure(this.railBreakpoint,this.floatBreakpoint,this.collapseBreakpointBasis),this.collapsingIndex!==-1&&!this._forced&&(this._collapseState=this.collapseBreakpoints.classify(this.measuredInlineSize)),this.applyEffectiveCollapseTransition(previousEffective,this.collapseState,this.hasUpdated)}if(changed.has("open")||changed.has("collapseState")||changed.has("collapse")||changed.has("panelCount")){const next=this.collapseState==="floating"&&this.open;next!==this.overlayActive&&(this.overlayActive=next,next?(this.justOpened=!0,this.activateFloatingOverlay()):this.deactivateFloatingOverlay())}this.renderConstraintBounds=this.resolveConstraintBounds(this.getContainerSize()).bounds}get collapseState(){return this.effectiveCollapseStateFor(this.collapse)}set collapseState(next){if(next==="auto"){this.releaseCollapsePin(),this.updateCollapseState(this.currentMeasuredWidth());return}this._forced=!0,this.pinnedBand=this.collapseBreakpoints.classify(this.pinMeasurementWidth()),this.setRequestedCollapseState(next)}expandPane(){this.applyPaneIntent(!0)}collapsePane(){this.applyPaneIntent(!1)}togglePane(){this.applyPaneIntent(!this.paneExpanded)}collapsePanel(panel){return this.setPanelCollapsed(panel,!0)}expandPanel(panel){return this.setPanelCollapsed(panel,!1)}togglePanel(panel){const panelId=this.panelIdOf(panel);return panelId===null?!1:(this.syncCollapsedLayout(),this.setPanelCollapsed(panelId,!this.appliedCollapsed.includes(panelId)))}panelIdOf(panel){return typeof panel=="string"?panel:this.ownedPanels.includes(panel)?panel.getAttribute("panel-id"):null}setPanelCollapsed(panel,collapsed){const panelId=this.panelIdOf(panel),ids=this.panelIdsFor(this.ownedPanels);if(panelId===null||!ids||ids.length<2||!ids.includes(panelId))return!1;const requested=this.collapsedPanels.filter(id=>typeof id=="string"),next=collapsed?[...requested.filter(id=>id!==panelId),panelId]:requested.filter(id=>id!==panelId);return this.initializedSizes?(this.syncCollapsedLayout(),this.appliedCollapsed.includes(panelId)===collapsed||collapsed&&!this.targetCollapsedIds(ids,next).includes(panelId)?!1:(this.collapsedPanels=next,this.syncCollapsedLayout(),this.persist(),this.decorateOwnedPanels(),this.emit("lr-multi-split-panel-collapse-change",{panelId,collapsed,collapsedPanels:[...this.appliedCollapsed],sizes:[...this.sizes]}),!0)):requested.includes(panelId)===collapsed?!1:(this.collapsedPanels=next,!0)}targetCollapsedIds(ids,requested=this.collapsedPanels){if(requested.length===0||!ids||ids.length<2)return[];const names=new Set(requested),target=ids.filter(id=>names.has(id));return target.length===ids.length&&target.pop(),target}indexesOf(ids,collapsed){if(collapsed.length===0)return NO_COLLAPSED_PANELS;const names=new Set(collapsed),indexes=new Set;return ids.forEach((id,index)=>{names.has(id)&&indexes.add(index)}),indexes}collapsedIndexes(){return this.appliedCollapsed.length===0?NO_COLLAPSED_PANELS:this.indexesOf(this.ownedPanels.map(panel=>panel.getAttribute("panel-id")??""),this.appliedCollapsed)}syncCollapsedLayout(){if(this.collapsedPanels.length===0&&this.appliedCollapsed.length===0)return;const ids=this.panelIdsFor(this.ownedPanels);if(!ids){this.appliedCollapsed.length>0&&(this.appliedCollapsed=[],this.expandedSizes.clear(),this.endDragGestures(),this.sizes=[],this.ensureSizes());return}const present=new Set(ids),applied=this.appliedCollapsed.filter(id=>present.has(id));for(const id of[...this.expandedSizes.keys()])present.has(id)||this.expandedSizes.delete(id);const target=this.targetCollapsedIds(ids);if(applied.length===target.length&&applied.every((id,index)=>id===target[index])&&this.validLiveSizes(this.sizes,this.indexesOf(ids,applied))){this.appliedCollapsed=applied;return}this.endDragGestures(),this.sizes=this.foldSizes(ids,applied,target),this.appliedCollapsed=target}foldSizes(ids,from,to){const next=ids.map((_,index)=>this.sizes[index]??0),closed=new Set(this.indexesOf(ids,from)),toIndexes=this.indexesOf(ids,to),bounds=this.resolveConstraintBounds(this.getContainerSize(),toIndexes).bounds,floor=this.normalizedDefaultMin(),openIndexes=()=>ids.map((_,index)=>index).filter(index=>!closed.has(index));for(const index of toIndexes){if(closed.has(index))continue;const freed=next[index];this.expandedSizes.set(ids[index],freed),next[index]=0,closed.add(index),this.distributeShare(next,freed,openIndexes(),bounds)}for(const index of[...closed]){if(toIndexes.has(index))continue;closed.delete(index);const id=ids[index],bound=bounds[index]??{min:floor,max:1/0},remembered=this.expandedSizes.get(id)??100/ids.length;this.expandedSizes.delete(id);const wanted=Math.min(Math.max(remembered,bound.min,floor),bound.max),donors=openIndexes().filter(open=>open!==index),slack=donors.map(donor=>Math.max(0,next[donor]-Math.max(bounds[donor]?.min??floor,floor))),slackTotal=slack.reduce((total,value)=>total+value,0),taken=Math.min(wanted,slackTotal);donors.forEach((donor,position)=>{next[donor]=next[donor]-(slackTotal>0?taken*slack[position]/slackTotal:0)}),next[index]=next[index]+taken}if(this.validLiveSizes(next,toIndexes))return next;const openCount=ids.length-toIndexes.size;return ids.map((_,index)=>toIndexes.has(index)?0:100/openCount)}distributeShare(sizes,amount,indexes,bounds){let remaining=amount,pool=indexes.filter(index=>sizes[index]<(bounds[index]?.max??1/0)-1e-9);for(;remaining>1e-9&&pool.length>0;){const weightTotal=pool.reduce((total2,index)=>total2+sizes[index],0),capped=new Set;let given=0;for(const index of pool){const share=weightTotal>0?remaining*sizes[index]/weightTotal:remaining/pool.length,room=(bounds[index]?.max??1/0)-sizes[index],portion=Math.min(share,room);sizes[index]=sizes[index]+portion,given+=portion,portion>=room-1e-9&&capped.add(index)}remaining-=given,pool=pool.filter(index=>!capped.has(index))}if(remaining<=1e-9||indexes.length===0)return;const total=indexes.reduce((sum,index)=>sum+sizes[index],0);for(const index of indexes)sizes[index]=sizes[index]+(total>0?remaining*sizes[index]/total:remaining/indexes.length)}dividerPair(index){const collapsed=this.collapsedIndexes();if(collapsed.size===0)return[index,index+1];const held=this.collapseActive?this.collapsingIndex:-1,closed=panel=>collapsed.has(panel)||panel===held;let leading=index;for(;leading>=0&&closed(leading);)leading--;let trailing=index+1;for(;trailing<this.panelCount&&closed(trailing);)trailing++;return leading>=0&&trailing<this.panelCount?[leading,trailing]:null}get paneExpanded(){const state=this.collapseState;return state==="floating"?this.open:state==="wide"}applyPaneIntent(expanded){if(this.collapsingIndex===-1)return;const band=this.collapseBreakpoints.classify(this.pinMeasurementWidth());if(band==="floating"){this.collapseState!=="floating"&&(this.releaseCollapsePin(),this.setRequestedCollapseState("floating")),this.open=expanded;return}const target=expanded?"wide":"rail";if(this.collapseState!==target){if(target===band){this.releaseCollapsePin(),this.setRequestedCollapseState(target);return}this.collapseState=target}}releaseCollapsePin(){this._forced=!1,this.pinnedBand=void 0}pinMeasurementWidth(){const live=this.currentMeasuredWidth();return live>0?live:this.measuredInlineSize}get effectiveOrientation(){return this._effectiveOrientation}get responsiveObservationEnabled(){return this.collapse!=="none"||this.orientationBreakpoints.containerObservationEnabled}updateEffectiveOrientation(width,shouldEmit){const next=this.orientationBreakpoints.isBelow(width)?this.narrowOrientation:this.orientation;next!==this._effectiveOrientation&&(this.endDragGestures(),this._effectiveOrientation=next,this.requestUpdate(),shouldEmit&&this.emit("lr-multi-split-orientation-change",{orientation:next}),this._forced&&this.releasePinOnBreakpoint&&(this.releaseCollapsePin(),this.updateCollapseState(width,this.hasUpdated)))}currentMeasuredWidth(){return this.baseEl?.clientWidth??0}effectiveCollapseStateFor(collapse){return collapse!=="none"&&this.panelCount>=2?this._collapseState:"wide"}applyEffectiveCollapseTransition(previous,next,shouldEmit=!0){if(previous===next)return;this.endDragGestures(),this.requestUpdate("collapseState",previous);const forceClose=previous==="floating"&&next!=="floating"&&this.open,forcedCloseVersion=this.forcedCloseVersion;shouldEmit&&(this.relocateFocusOutOfCollapsingPanel(next),this.decorateOwnedPanels(),this.emit("lr-multi-split-collapse-change",{state:next})),forceClose&&this.forcedCloseVersion===forcedCloseVersion&&this.collapseState!=="floating"&&this.setOpen(!1,{force:!0})}relocateFocusOutOfCollapsingPanel(next){if(next==="wide"||next==="floating"&&this.open)return;const index=this.collapsingIndex;if(index===-1)return;const panel=this.ownedPanels[index];panel&&repairComposedFocus(panel,()=>this.collapseFocusFallbacks(panel))}collapseFocusFallbacks(collapsing){const dividers=[...this.renderRoot.querySelectorAll('[part="divider"]')];return[...new Set([...this.ownedPanels.filter(panel=>panel!==collapsing),...dividers.filter((_,index)=>!this.isDividerDisabled(index)),...dividers])]}setOpen(next,options){if(options?.force){this.open=next,this.forcedCloseVersion+=1,this.emit("lr-toggle",{expanded:next});return}if(this.open===next)return;const collapseState=this.collapseState,open=this.open,mutationVersion=this.toggleProposalMutationVersion;this.toggleProposalDepth+=1;try{if(this.emit("lr-toggle-request",{expanded:next},{cancelable:!0}).defaultPrevented||this.toggleProposalMutationVersion!==mutationVersion||this.collapseState!==collapseState||this.open!==open)return}finally{this.toggleProposalDepth-=1}this.open=next,this.emit("lr-toggle",{expanded:next})}requestUpdate(name,oldValue,options){this.toggleProposalDepth>0&&(name==="open"&&oldValue!==this.open||name==="collapse"&&oldValue!==this.collapse||name==="collapseState"&&oldValue!==this.collapseState)&&(this.toggleProposalMutationVersion+=1),super.requestUpdate(name,oldValue,options)}setRequestedCollapseState(next,shouldEmit=!0){const previousEffective=this.collapseState;if(next===this._collapseState)return;this._collapseState=next;const nextEffective=this.collapseState;this.applyEffectiveCollapseTransition(previousEffective,nextEffective,shouldEmit),previousEffective===nextEffective&&next!==nextEffective&&this.requestUpdate("collapseState",next)}get storageFullKey(){return this.storageKey?`lr-multi-split:${this.storageKey}:panels`:void 0}panelIdsFor(panels){const ids=[],seen=new Set;for(const panel of panels){const panelId=panel.getAttribute("panel-id")??"";if(!panelId||panelId.trim()!==panelId||seen.has(panelId))return null;seen.add(panelId),ids.push(panelId)}return ids}reconcileIdentitySizes(previousIds,previousValues,nextIds){if(previousIds.length!==previousValues.length||nextIds.length===0)return null;const previousSizes=new Map;previousIds.forEach((panelId,index)=>{previousSizes.set(panelId,previousValues[index])});const retainedTotal=nextIds.reduce((total,panelId)=>total+(previousSizes.get(panelId)??0),0),missingCount=nextIds.filter(panelId=>!previousSizes.has(panelId)).length;if(!(retainedTotal>0)){const equal=100/nextIds.length;return nextIds.map(()=>equal)}const newShare=100/nextIds.length,retainedScale=(100-newShare*missingCount)/retainedTotal;return nextIds.map(panelId=>{const previous=previousSizes.get(panelId);return previous===void 0?newShare:previous*retainedScale})}reconcileSizesByPanelId(previousPanels,nextPanels){if(previousPanels.length!==this.sizes.length||nextPanels.length===0)return null;const previousIds=this.panelIdsFor(previousPanels),nextIds=this.panelIdsFor(nextPanels);return!previousIds||!nextIds?null:this.reconcileIdentitySizes(previousIds,this.sizes,nextIds)}validInitialSizes(value,collapsed=this.collapsedIndexes()){return!Array.isArray(value)||value.length!==this.panelCount||!value.every((size,index)=>collapsed.has(index)?size===0:Number.isFinite(size)&&size>=this.safeMin)?!1:Math.abs(value.reduce((sum,size)=>sum+size,0)-100)<.01}validLiveSizes(value,collapsed=this.collapsedIndexes()){if(!Array.isArray(value)||value.length!==this.panelCount)return!1;const floor=this.normalizedDefaultMin();return value.every((size,index)=>collapsed.has(index)?size===0:Number.isFinite(size)&&size>=floor)?Math.abs(value.reduce((sum,size)=>sum+size,0)-100)<.01:!1}resolveDefaultSizes(){if(this.defaultSizes.length===0)return null;if(!this.defaultSizes.some(entry=>typeof entry=="string")){const numbers=this.defaultSizes;return this.validInitialSizes(numbers)?[...numbers]:null}const containerSize=this.currentMeasuredWidth()||this.getBoundingClientRect().width;if(!(containerSize>0))return null;const resolvedPx=[];for(const entry of this.defaultSizes){if(typeof entry=="number"){if(!Number.isFinite(entry))return null;resolvedPx.push(entry/100*containerSize);continue}const px=resolveCssLength(entry,{host:this,percentBase:containerSize,viewportBasis:this.ownerDocument.defaultView??void 0});if(px==null||!(px>=0))return null;resolvedPx.push(px)}const sum=resolvedPx.reduce((total,size)=>total+size,0);if(!(sum>0))return null;const normalized=resolvedPx.map(size=>size/sum*100);return this.validInitialSizes(normalized)?normalized:null}acceptFoldedSizes(previous){const ids=this.panelIdsFor(this.ownedPanels),target=this.targetCollapsedIds(ids);return!ids||target.length===0||!this.validLiveSizes(this.sizes,this.indexesOf(ids,target))?!1:(ids.forEach((panelId,index)=>{if(!target.includes(panelId)||this.appliedCollapsed.includes(panelId))return;const share=Array.isArray(previous)?previous[index]:void 0;typeof share=="number"&&share>0&&this.expandedSizes.set(panelId,share)}),this.appliedCollapsed=target,!0)}initializeSizes(){if(this.validInitialSizes(this.sizes))return;const panelIds=this.panelIdsFor(this.ownedPanels),target=this.targetCollapsedIds(panelIds);if(panelIds&&target.length>0&&this.validInitialSizes(this.sizes,this.indexesOf(panelIds,target))){this.appliedCollapsed=target;return}if(this.loadPersisted())return;const resolved=this.resolveDefaultSizes();if(resolved){this.sizes=resolved;return}this.sizes=[],this.ensureSizes()}loadPersisted(){const panelIds=this.panelIdsFor(this.ownedPanels);if(!panelIds)return!1;const parsed=readPersistedState(this.storageFullKey,isPersistedPanelLayout);if(!parsed||parsed.panels.length===0)return!1;const persistedIds=[],persistedSizes=[],persistedCollapsed=new Map,seen=new Set;for(const panel of parsed.panels){if(seen.has(panel.panelId))return!1;seen.add(panel.panelId),persistedIds.push(panel.panelId),persistedSizes.push(panel.size),parsed.version===2&&panel.collapsed===!0&&persistedCollapsed.set(panel.panelId,panel.expandedSize)}if(Math.abs(persistedSizes.reduce((sum,size)=>sum+size,0)-100)>=.01)return!1;const normalized=this.reconcileIdentitySizes(persistedIds,persistedSizes,panelIds);if(!normalized)return!1;const restoredCollapsed=panelIds.filter(panelId=>persistedCollapsed.has(panelId));if(!this.validInitialSizes(normalized,this.indexesOf(panelIds,restoredCollapsed)))return!1;this.sizes=normalized,this.appliedCollapsed=restoredCollapsed;for(const panelId of restoredCollapsed){const expandedSize=persistedCollapsed.get(panelId);expandedSize!==void 0&&this.expandedSizes.set(panelId,expandedSize)}return restoredCollapsed.length>0&&this.collapsedPanels.length===0&&(this.collapsedPanels=restoredCollapsed),!0}persist(){const panelIds=this.panelIdsFor(this.ownedPanels);if(!panelIds||panelIds.length!==this.sizes.length)return;const collapsed=new Set(this.appliedCollapsed),layout={version:collapsed.size>0?2:1,panels:panelIds.map((panelId,index)=>{const size=this.sizes[index];if(!collapsed.has(panelId))return{panelId,size};const expandedSize=this.expandedSizes.get(panelId);return expandedSize===void 0?{panelId,size,collapsed:!0}:{panelId,size,collapsed:!0,expandedSize}})};writePersistedState(this.storageFullKey,layout)}ensureSizes(){if(this.panelCount===this.sizes.length)return;if(this.panelCount<=0){this.sizes=[];return}if(this.sizes.length===0){const equal=100/this.panelCount;this.sizes=Array.from({length:this.panelCount},()=>equal);return}const diff=this.panelCount-this.sizes.length;if(diff>0){const newShare=100/this.panelCount,scale=(100-newShare*diff)/100;this.sizes=[...this.sizes.map(s=>s*scale),...Array.from({length:diff},()=>newShare)]}else{const kept=this.sizes.slice(0,this.panelCount),removedTotal=this.sizes.slice(this.panelCount).reduce((sum,s)=>sum+s,0),keptTotal=kept.reduce((sum,s)=>sum+s,0)||1;this.sizes=kept.map(s=>s+s/keptTotal*removedTotal)}}readPanelStyle(panel,property2){return{value:panel.style.getPropertyValue(property2),priority:panel.style.getPropertyPriority(property2)}}samePanelStyle(left,right){return left.value===right.value&&left.priority===right.priority}snapshotPanelOwnership(panel){const styles2=new Map;for(const property2 of OWNED_PANEL_STYLE_PROPERTIES)styles2.set(property2,this.readPanelStyle(panel,property2));const attributes=new Map;for(const name of OWNED_PANEL_ATTRIBUTES)attributes.set(name,panel.getAttribute(name));return{styles:styles2,appliedStyles:new Map,hidden:panel.hidden,attributes,appliedAttributes:new Map}}adoptPanelOwnership(panel,snapshot){for(const property2 of OWNED_PANEL_STYLE_PROPERTIES){const current=this.readPanelStyle(panel,property2),applied=snapshot.appliedStyles.get(property2);(applied&&!this.samePanelStyle(current,applied)||!applied&&!this.samePanelStyle(current,snapshot.styles.get(property2)))&&snapshot.styles.set(property2,current)}(snapshot.appliedHidden!==void 0&&panel.hidden!==snapshot.appliedHidden||snapshot.appliedHidden===void 0&&panel.hidden!==snapshot.hidden)&&(snapshot.hidden=panel.hidden);for(const name of OWNED_PANEL_ATTRIBUTES){const current=panel.getAttribute(name),expected=snapshot.appliedAttributes.has(name)?snapshot.appliedAttributes.get(name):snapshot.attributes.get(name);current!==expected&&snapshot.attributes.set(name,current)}}applyOwnedPanelStyle(panel,snapshot,property2,value){value.value===""?panel.style.removeProperty(property2):panel.style.setProperty(property2,value.value,value.priority),snapshot.appliedStyles.set(property2,this.readPanelStyle(panel,property2))}applyOwnedPanelStyleValue(panel,snapshot,property2,value){this.applyOwnedPanelStyle(panel,snapshot,property2,{value,priority:""})}applyOwnedPanelHidden(panel,snapshot,hidden){panel.hidden=hidden,snapshot.appliedHidden=panel.hidden}applyOwnedPanelAttribute(panel,snapshot,name,value){value===null?panel.removeAttribute(name):panel.setAttribute(name,value),snapshot.appliedAttributes.set(name,panel.getAttribute(name))}restorePanelOwnership(panel,snapshot){this.adoptPanelOwnership(panel,snapshot);for(const property2 of OWNED_PANEL_STYLE_PROPERTIES){const value=snapshot.styles.get(property2);value.value===""?panel.style.removeProperty(property2):panel.style.setProperty(property2,value.value,value.priority)}panel.hidden=snapshot.hidden;for(const name of OWNED_PANEL_ATTRIBUTES){const value=snapshot.attributes.get(name)??null;value===null?panel.removeAttribute(name):panel.setAttribute(name,value)}}panelProjectionDiverged(panel,snapshot){for(const property2 of OWNED_PANEL_STYLE_PROPERTIES){const current=this.readPanelStyle(panel,property2),expected=snapshot.appliedStyles.get(property2)??snapshot.styles.get(property2);if(!this.samePanelStyle(current,expected))return!0}return panel.hidden!==(snapshot.appliedHidden??snapshot.hidden)?!0:OWNED_PANEL_ATTRIBUTES.some(name=>{const expected=snapshot.appliedAttributes.has(name)?snapshot.appliedAttributes.get(name):snapshot.attributes.get(name);return panel.getAttribute(name)!==expected})}resetPanelOwnershipObserver(){this.panelOwnershipObserver?.disconnect(),this.panelOwnershipObserver=void 0}observeOwnedPanels(){this.resetPanelOwnershipObserver();const MutationObserverConstructor=this.ownerDocument.defaultView?.MutationObserver;if(!MutationObserverConstructor||!this.isConnected||this.ownedPanels.length===0)return;const observer=new MutationObserverConstructor(records=>{records.some(record=>{const panel=record.target,snapshot=this.panelOwnership.get(panel);return snapshot?this.panelProjectionDiverged(panel,snapshot):!1})&&this.requestUpdate()});this.panelOwnershipObserver=observer;for(const panel of this.ownedPanels)observer.observe(panel,{attributes:!0,attributeFilter:["style","hidden",...OWNED_PANEL_ATTRIBUTES]})}samePanelSequence(next){return next.length===this.ownedPanels.length&&next.every((panel,index)=>panel===this.ownedPanels[index])}syncPanelMembership(reconcileSizes=!0){const next=[...this.children].filter(child=>child!==this.nativeModal.helperMount);if(this.samePanelSequence(next))return;const previousPanels=this.ownedPanels,identitySizes=reconcileSizes?this.reconcileSizesByPanelId(previousPanels,next):null,previousEffective=this.collapseState,nextSet=new Set(next);for(const panel of this.ownedPanels){if(nextSet.has(panel))continue;const snapshot=this.panelOwnership.get(panel);snapshot&&this.restorePanelOwnership(panel,snapshot),this.panelOwnership.delete(panel)}for(const panel of next)this.panelOwnership.has(panel)||this.panelOwnership.set(panel,this.snapshotPanelOwnership(panel));const countChanged=next.length!==this.panelCount;this.ownedPanels=next,this.panelCount=next.length,this.collapsingIndex!==-1&&!this._forced&&(this._collapseState=this.collapseBreakpoints.classify(this.currentMeasuredWidth())),this.applyEffectiveCollapseTransition(previousEffective,this.collapseState,this.hasUpdated),identitySizes?(this.sizesReconciledForMembership=!0,this.sizes=identitySizes):countChanged&&reconcileSizes&&(this.sizesReconciledForMembership=!0,this.ensureSizes()),this.observeOwnedPanels(),this.hasUpdated&&this.requestUpdate()}releaseOwnedPanels(){this.resetPanelOwnershipObserver();for(const panel of this.ownedPanels){const snapshot=this.panelOwnership.get(panel);snapshot&&this.restorePanelOwnership(panel,snapshot)}this.ownedPanels=[],this.panelOwnership.clear()}getContainerSize(){return this.baseEl?this.effectiveOrientation==="vertical"?this.baseEl.clientHeight:this.baseEl.clientWidth:0}resetGutterObserver(){this.gutterObserverFrame!==void 0&&(this.gutterObserverDocument?.defaultView?.cancelAnimationFrame(this.gutterObserverFrame),this.gutterObserverFrame=void 0),this.gutterResizeObserver?.disconnect(),this.gutterResizeObserver=void 0,this.gutterObserverDocument=void 0,this.gutterObservedDividers=[],this.baseEl?.style.removeProperty("--_lr-multi-split-gutters")}updateGutterBudget(){const view=this.ownerDocument.defaultView,base=this.baseEl;if(!view||!base)return;const vertical=this.effectiveOrientation==="vertical",value=`${this.gutterObservedDividers.reduce((total,divider)=>{const style=view.getComputedStyle(divider),properties=vertical?["height","padding-top","padding-bottom","border-top-width","border-bottom-width"]:["width","padding-left","padding-right","border-left-width","border-right-width"],boxProperties=style.boxSizing==="border-box"?properties.slice(0,1):properties;return total+boxProperties.reduce((size,property2)=>size+finiteRange(parseFloat(style.getPropertyValue(property2)),0,0),0)},0)}px`;base.style.getPropertyValue("--_lr-multi-split-gutters")!==value&&base.style.setProperty("--_lr-multi-split-gutters",value)}syncGutterObserver(enabled){const base=this.baseEl;if(!enabled||!this.isConnected||!base){this.resetGutterObserver();return}const ownerDocument=this.ownerDocument,dividers=[...base.querySelectorAll('[part="divider"]')];if(this.gutterResizeObserver&&this.gutterObserverDocument===ownerDocument&÷rs.length===this.gutterObservedDividers.length&÷rs.every((divider,index)=>divider===this.gutterObservedDividers[index])){this.updateGutterBudget();return}this.resetGutterObserver(),this.gutterObservedDividers=dividers,this.gutterObserverDocument=ownerDocument,this.gutterObservedContainerSize=this.getContainerSize(),this.updateGutterBudget();const ownerWindow=ownerDocument.defaultView,ResizeObserverConstructor=ownerWindow?.ResizeObserver;if(!ownerWindow||!ResizeObserverConstructor)return;const observer=new ResizeObserverConstructor(()=>{if(this.gutterResizeObserver!==observer||!this.isConnected||this.ownerDocument!==ownerDocument)return;this.updateGutterBudget();const size=this.getContainerSize();size!==this.gutterObservedContainerSize&&(this.gutterObservedContainerSize=size,this.requestUpdate())});this.gutterResizeObserver=observer;const frame=ownerWindow.requestAnimationFrame(()=>{if(!(this.gutterObserverFrame!==frame||this.gutterResizeObserver!==observer||!this.isConnected||this.ownerDocument!==ownerDocument||this.baseEl!==base)){this.gutterObserverFrame=void 0,observer.observe(base,{box:"border-box"});for(const divider of dividers)observer.observe(divider,{box:"border-box"})}});this.gutterObserverFrame=frame}get collapsingIndex(){return this.collapse==="none"||this.panelCount<2?-1:this.collapse==="start"?0:this.panelCount-1}get collapseActive(){return this.collapsingIndex!==-1&&this.collapseState!=="wide"}isDividerDisabled(index){if(this.collapseActive){const adjacent=this.collapsingIndex===0?0:this.panelCount-2;if(index===adjacent)return!0}return this.dividerPair(index)===null}updateCollapseState(width,shouldEmit=!0){if(this.collapse==="none")return;const classified=this.collapseBreakpoints.classify(width);if(this._forced){if(!this.releasePinOnBreakpoint||classified===this.pinnedBand)return;this.releaseCollapsePin()}this.setRequestedCollapseState(classified,shouldEmit)}armCollapseObserver(){const observedElement=this.baseEl;if(!this.isConnected||!observedElement)return;const ownerDocument=this.ownerDocument;if(this.collapseResizeObserver&&this.collapseObservedElement===observedElement&&this.collapseObserverOwnerDocument===ownerDocument)return;this.resetCollapseObserver();const ResizeObserverConstructor=ownerDocument.defaultView?.ResizeObserver;if(!ResizeObserverConstructor)return;const generation=this.collapseObserverGeneration,observer=new ResizeObserverConstructor(entries=>{if(this.collapseResizeObserver!==observer||this.collapseObserverGeneration!==generation||!this.isConnected||this.ownerDocument!==ownerDocument||this.baseEl!==observedElement)return;const box=entries[0]?.contentBoxSize?.[0],width=box?box.inlineSize:observedElement.getBoundingClientRect().width;this.measuredInlineSize=width,this.updateCollapseState(width),this.updateEffectiveOrientation(width,!0)});this.collapseResizeObserver=observer,this.collapseObservedElement=observedElement,this.collapseObserverOwnerDocument=ownerDocument,observer.observe(observedElement)}resetCollapseObserver(){this.collapseObserverGeneration+=1,this.collapseResizeObserver?.disconnect(),this.collapseResizeObserver=void 0,this.collapseObservedElement=void 0,this.collapseObserverOwnerDocument=void 0}syncCollapseObserver(){if(!this.responsiveObservationEnabled){this.resetCollapseObserver();return}this.armCollapseObserver()}get safeMin(){return finiteRange(this.min,10,0)}normalizedDefaultMin(){if(this.panelCount<=0)return 0;const requested=this.safeMin,available=Math.max(0,100-KEYBOARD_STEP);return Math.min(requested,available/this.panelCount)}resolveConstraintBounds(containerSize,collapsed=this.collapsedIndexes()){const fallbackMin=this.normalizedDefaultMin(),fallback=Array.from({length:this.panelCount},(_,index)=>collapsed.has(index)?{min:0,max:0}:{min:fallbackMin,max:1/0});if(this.panelCount<=0)return{bounds:[],usePanelConstraints:!0};const bounds=[];let minimumTotal=0,maximumTotal=0,hasUnboundedMaximum=!1,issueReason;for(let index=0;index<this.panelCount;index++){if(collapsed.has(index)){bounds.push({min:0,max:0});continue}const constraint=this.panelConstraints[index];let min=this.safeMin,max=1/0,minSet=!1,maxSet=!1;constraint&&(constraint.minPx!=null&&Number.isFinite(constraint.minPx)&&constraint.minPx>=0&&containerSize>0&&(min=constraint.minPx/containerSize*100,minSet=!0),constraint.minPercent!=null&&Number.isFinite(constraint.minPercent)&&constraint.minPercent>=0&&(min=minSet?Math.max(min,constraint.minPercent):constraint.minPercent,minSet=!0),constraint.maxPx!=null&&Number.isFinite(constraint.maxPx)&&constraint.maxPx>=0&&containerSize>0&&(max=constraint.maxPx/containerSize*100,maxSet=!0),constraint.maxPercent!=null&&Number.isFinite(constraint.maxPercent)&&constraint.maxPercent>=0&&(max=maxSet?Math.min(max,constraint.maxPercent):constraint.maxPercent,maxSet=!0),(constraint.minPx!=null&&(!Number.isFinite(constraint.minPx)||constraint.minPx<0)||constraint.maxPx!=null&&(!Number.isFinite(constraint.maxPx)||constraint.maxPx<0)||constraint.minPercent!=null&&(!Number.isFinite(constraint.minPercent)||constraint.minPercent<0)||constraint.maxPercent!=null&&(!Number.isFinite(constraint.maxPercent)||constraint.maxPercent<0))&&(issueReason??="minimum-exceeds-maximum")),min>max&&(issueReason??="minimum-exceeds-maximum"),bounds.push({min,max}),minimumTotal+=min,Number.isFinite(max)?maximumTotal+=max:hasUnboundedMaximum=!0}return issueReason==null&&minimumTotal>100+1e-9&&(issueReason="minimum-total"),issueReason==null&&!hasUnboundedMaximum&&maximumTotal<100-1e-9&&(issueReason="maximum-total"),issueReason==null?{bounds,usePanelConstraints:!0}:{bounds:fallback,usePanelConstraints:!1,issue:{reason:issueReason,panelCount:this.panelCount,minimumTotal,maximumTotal:hasUnboundedMaximum?null:maximumTotal,containerSize}}}hasClampConstraint(constraint){return!!constraint&&(constraint.minPx!=null||constraint.maxPx!=null||constraint.minPercent!=null||constraint.maxPercent!=null)}minSideExpr(constraint){const terms=[];return constraint?.minPx!=null&&Number.isFinite(constraint.minPx)&&constraint.minPx>=0&&terms.push(`${constraint.minPx}px`),constraint?.minPercent!=null&&Number.isFinite(constraint.minPercent)&&constraint.minPercent>=0&&terms.push(`${constraint.minPercent}%`),terms.length===0?`${NO_MIN_PX}px`:terms.length===1?terms[0]:`max(${this.safeMin}%, ${terms.join(", ")})`}maxSideExpr(constraint){const terms=[];return constraint?.maxPx!=null&&Number.isFinite(constraint.maxPx)&&constraint.maxPx>=0&&terms.push(`${constraint.maxPx}px`),constraint?.maxPercent!=null&&Number.isFinite(constraint.maxPercent)&&constraint.maxPercent>=0&&terms.push(`${constraint.maxPercent}%`),terms.length===0?`${NO_MAX_PX}px`:terms.length===1?terms[0]:`min(${terms.join(", ")})`}clampPair(sizes,i,j,delta,containerSize=0){const next=[...sizes],currentA=next[i],currentB=next[j];if(currentA===void 0||currentB===void 0)return next;const pairTotal=currentA+currentB,bounds=this.resolveConstraintBounds(containerSize).bounds,a=bounds[i]??{min:0,max:1/0},b=bounds[j]??{min:0,max:1/0},loRaw=Math.max(a.min,pairTotal-b.max),hiRaw=Math.min(a.max,pairTotal-b.min),lo=Math.min(loRaw,pairTotal),hi=Math.max(hiRaw,lo),clampedA=Math.min(Math.max(currentA+delta,lo),hi);return next[i]=clampedA,next[j]=pairTotal-clampedA,next}requestResize(next,commit){return next.length===this.sizes.length&&next.every((size,index)=>Math.abs(size-this.sizes[index])<=1e-9)||this.emit("lr-resize-request",{sizes:[...next]},{cancelable:!0}).defaultPrevented?!1:(this.sizes=next,this.emit("lr-resize",{sizes:[...this.sizes]}),commit&&this.settle(),!0)}settle(){this.persist(),this.emit("lr-resize-change",{sizes:[...this.sizes]})}applyDelta(index,delta,commit){const pair=this.dividerPair(index);if(!pair)return!1;const next=this.clampPair(this.sizes,pair[0],pair[1],delta,this.getContainerSize());return next.length!==this.sizes.length||next.some((size,currentIndex)=>Math.abs(size-this.sizes[currentIndex])>1e-9)?(this.requestResize(next,commit),!0):!1}get floatingPanelEl(){const index=this.collapsingIndex;return index===-1?null:this.ownedPanels[index]??null}activateFloatingOverlay(){this.openingBlockSize=this.baseEl?.getBoundingClientRect().height??0,this.modalSurface.prepare();const opener=deepActiveElement(this.ownerDocument);this.overlayOpener=isHtmlElement(opener)?opener:null;const trigger=this.resolveExternalTrigger();this.overlayReturnTarget=trigger??this.overlayOpener;const panel=this.floatingPanelEl;panel&&(this.floatingDialogPanel=panel,this.floatingDialogPreviousRole=panel.getAttribute("role"),this.floatingDialogPreviousAriaModal=panel.getAttribute("aria-modal"),this.nativeModal.requested||(panel.setAttribute("role","dialog"),panel.setAttribute("aria-modal","true"))),this.overlayHandle=activateOverlay({host:this,panel:()=>this.floatingPanelEl,modalRoot:()=>this.floatingPanelEl,auxiliaryRoots:()=>{const root=this.nativeModal.helperMount;return root?[root]:[]},restoreFocusTo:trigger??void 0,onEscape:()=>this.setOpen(!1),onBackdrop:()=>this.setOpen(!1),lockScroll:!0,suspendWhenUnrendered:!0,deferredReturn:()=>{if(!(this.resolveExternalTrigger()||this.trigger||this.for))return;const panel2=this.floatingDialogPanel;return{candidates:()=>[this.resolveExternalTrigger(),this.overlayReturnTarget,this.overlayOpener],stranded:active=>panel2!==null&&composedContains(panel2,active),isCurrent:()=>!this.overlayActive}}})}deactivateFloatingOverlay(){this.modalSurface.hide(),this.stopNativeModalGeometry(),this.nativeModal.prepare(!1);const trigger=this.resolveExternalTrigger(),panel=this.floatingDialogPanel;trigger&&this.overlayHandle?.updateRestoreFocusTo(trigger),this.overlayHandle?.deactivate(),this.overlayHandle=void 0,this.floatingDialogPanel=null,panel&&(this.floatingDialogPreviousRole===null?panel.removeAttribute("role"):panel.setAttribute("role",this.floatingDialogPreviousRole),this.floatingDialogPreviousAriaModal===null?panel.removeAttribute("aria-modal"):panel.setAttribute("aria-modal",this.floatingDialogPreviousAriaModal))}endDragGestures(){this.drags.clear(),this.dragController.cancelAll()}dividerName(index){let label;try{label=this.dividerLabel?.(index,this.panelCount)}catch{}if(typeof label=="string"&&label.trim())return label;const[leading,trailing]=this.dividerPair(index)??[index,index+1];return this.localize("resizeDivider",void 0,{a:getNumberFormat(this.effectiveLocale).format(leading+1),b:getNumberFormat(this.effectiveLocale).format(trailing+1)})}dividerValueRange(index,bounds=this.resolveConstraintBounds(this.getContainerSize()).bounds){const[leadingIndex,trailingIndex]=this.dividerPair(index)??[index,index+1],pairTotal=(this.sizes[leadingIndex]??0)+(this.sizes[trailingIndex]??0),leading=bounds[leadingIndex],trailing=bounds[trailingIndex],min=Math.max(leading.min,pairTotal-trailing.max);return{min,max:Math.max(min,Math.min(leading.max,pairTotal-trailing.min))}}updated(changed){super.updated(changed),this.overlayActive&&(this.syncNativeModalGeometry(),this.modalSurface.show()),(changed.has("collapse")||changed.has("orientationBreakpoint")||changed.has("orientationBreakpointBasis"))&&this.syncCollapseObserver(),this.orientationBreakpoints.active?this.setAttribute("data-effective-orientation",this._effectiveOrientation):this.removeAttribute("data-effective-orientation"),(changed.has("panelConstraints")||changed.has("min"))&&(this.constraintConfigVersion+=1);const constraintResolution=this.resolveConstraintBounds(this.getContainerSize()),issue=constraintResolution.issue,issueKey=issue?`${issue.reason}:${issue.panelCount}:${this.constraintConfigVersion}`:"";issueKey!==this.constraintIssueKey&&(this.constraintIssueKey=issueKey,issue&&this.emit("lr-multi-split-constraints-invalid",issue));const collapsingIndex=this.collapseActive?this.collapsingIndex:-1;this.syncGutterObserver(collapsingIndex===-1&&this.panelConstraints.some(constraint=>finiteRange(constraint?.minPx??0,0,0)>0)),this.decorateOwnedPanels(constraintResolution),this.syncExternalTriggerA11y(),this.justOpened&&(this.justOpened=!1,this.overlayHandle?.focusInitial())}resolveExternalTrigger(){if(this.trigger)return this.trigger;if(!this.for)return null;const found=this.getRootNode().getElementById?.(this.for);return isHtmlElement(found)?found:null}syncExternalTriggerA11y(){const panel=this.ownedPanels[this.collapsingIndex],trigger=panel&&this.panelCount>1?this.resolveExternalTrigger():null;if(!this.isConnected||!panel||!trigger){this.releaseExternalTriggerA11y();return}this.triggerPanel!==panel&&(this.releaseExternalTriggerA11y(),this.triggerPanel=panel),panel.id||(this.generatedTriggerPanelId=nextId("multi-split-panel"),panel.id=this.generatedTriggerPanelId);const contribution={attributes:{"aria-expanded":this.paneExpanded?"true":"false"},controls:[panel]};this.triggerAria?this.triggerAria.update(trigger,contribution):this.triggerAria=acquireAriaOwnership(trigger,contribution)}releaseExternalTriggerA11y(){this.triggerAria?.release(),this.triggerAria=void 0,this.triggerPanel&&this.generatedTriggerPanelId&&this.triggerPanel.id===this.generatedTriggerPanelId&&this.triggerPanel.removeAttribute("id"),this.triggerPanel=void 0,this.generatedTriggerPanelId=void 0}decorateOwnedPanels(constraintResolution=this.resolveConstraintBounds(this.getContainerSize())){const panels=this.ownedPanels;for(const panel of panels){const snapshot=this.panelOwnership.get(panel);snapshot&&this.adoptPanelOwnership(panel,snapshot)}const collapsingIndex=this.collapseActive?this.collapsingIndex:-1,collapsed=this.collapsedIndexes(),pixelMinimumTotal=constraintResolution.usePanelConstraints?this.panelConstraints.slice(0,this.panelCount).reduce((total,constraint,index)=>collapsed.has(index)?total:total+finiteRange(constraint?.minPx??0,0,0),0):0,redistributedShare=new Array(panels.length).fill(0);if(collapsingIndex===-1){let freedPercent=0;const growableIndexes=[];let growableTotal=0;for(let i=0;i<panels.length;i++){if(collapsed.has(i))continue;const percent=this.sizes[i]??0,constraint=constraintResolution.usePanelConstraints?this.panelConstraints[i]:void 0;if(this.hasClampConstraint(constraint)){const bounds=constraintResolution.bounds[i],clamped=bounds?Math.min(Math.max(percent,bounds.min),bounds.max):percent;clamped<percent&&(freedPercent+=percent-clamped)}else growableIndexes.push(i),growableTotal+=percent}if(freedPercent>0&&growableTotal>0)for(const i of growableIndexes)redistributedShare[i]=freedPercent*((this.sizes[i]??0)/growableTotal)}panels.forEach((panel,i)=>{const snapshot=this.panelOwnership.get(panel);if(!snapshot)return;const percent=this.sizes[i]??0,constraint=constraintResolution.usePanelConstraints?this.panelConstraints[i]:void 0,pixelMinimum=finiteRange(constraint?.minPx??0,0,0);if(collapsingIndex===-1&&!collapsed.has(i)&&pixelMinimum>0&&pixelMinimumTotal>0?this.applyOwnedPanelStyleValue(panel,snapshot,"--_lr-multi-split-panel-min",`min(${pixelMinimum}px, max(0px, calc((100% - var(--_lr-multi-split-gutters, 0px)) * ${pixelMinimum/pixelMinimumTotal})))`):this.applyOwnedPanelStyle(panel,snapshot,"--_lr-multi-split-panel-min",snapshot.styles.get("--_lr-multi-split-panel-min")),this.applyOwnedPanelStyle(panel,snapshot,"inline-size",snapshot.styles.get("inline-size")),this.applyOwnedPanelHidden(panel,snapshot,snapshot.hidden),collapsingIndex===i&&this.collapseState==="rail")this.applyOwnedPanelStyleValue(panel,snapshot,"flex",`0 0 ${this.railWidth}`);else if(collapsingIndex===i&&this.collapseState==="floating"&&!this.open)this.applyOwnedPanelStyleValue(panel,snapshot,"flex","none"),this.applyOwnedPanelHidden(panel,snapshot,!0);else if(collapsingIndex===i&&this.collapseState==="floating")this.applyOwnedPanelStyleValue(panel,snapshot,"inline-size",`var(--lr-multi-split-floating-panel-inline-size, ${collapsed.has(i)?this.expandedSizes.get(panel.getAttribute("panel-id")??"")??percent:percent}%)`);else if(collapsed.has(i))this.applyOwnedPanelStyleValue(panel,snapshot,"flex","0 0 var(--_lr-multi-split-collapsed-panel-size)");else if(collapsingIndex!==-1&&i!==collapsingIndex)this.applyOwnedPanelStyleValue(panel,snapshot,"flex",this.hasClampConstraint(constraint)?`0 1 clamp(${this.minSideExpr(constraint)}, ${percent}%, ${this.maxSideExpr(constraint)})`:`${percent} 1 0%`);else{const adjustedPercent=percent+(redistributedShare[i]??0);this.applyOwnedPanelStyleValue(panel,snapshot,"flex",this.hasClampConstraint(constraint)?`0 1 clamp(${this.minSideExpr(constraint)}, ${percent}%, ${this.maxSideExpr(constraint)})`:`0 1 ${adjustedPercent}%`)}this.applyOwnedPanelStyleValue(panel,snapshot,"order",String(i*2)),this.applyOwnedPanelAttribute(panel,snapshot,"data-collapse-state",collapsingIndex===i?this.collapseState:null),this.applyOwnedPanelAttribute(panel,snapshot,"data-panel-collapsed",collapsed.has(i)?"":null)}),collapsingIndex!==-1?this.setAttribute("data-collapse-state",this.collapseState):this.removeAttribute("data-collapse-state")}render(){const dividers=[],bounds=this.renderConstraintBounds;for(let i=0;i<this.panelCount-1;i++){const{min:valueMin,max:valueMax}=this.dividerValueRange(i,bounds),disabled=this.isDividerDisabled(i),leading=this.dividerPair(i)?.[0]??i;dividers.push(html`<div
|
|
2
2
|
part="divider"
|
|
3
3
|
role="separator"
|
|
4
4
|
aria-label=${this.dividerName(i)}
|
|
5
5
|
aria-orientation=${this.effectiveOrientation==="vertical"?"horizontal":"vertical"}
|
|
6
|
-
aria-valuenow=${Math.round(this.sizes[
|
|
7
|
-
aria-valuetext=${this.localize("resizeValuePercent",void 0,{value:getNumberFormat(this.effectiveLocale).format(Math.round(this.sizes[
|
|
6
|
+
aria-valuenow=${Math.round(this.sizes[leading]??0)}
|
|
7
|
+
aria-valuetext=${this.localize("resizeValuePercent",void 0,{value:getNumberFormat(this.effectiveLocale).format(Math.round(this.sizes[leading]??0))})}
|
|
8
8
|
aria-valuemin=${Math.round(valueMin)}
|
|
9
9
|
aria-valuemax=${Math.round(valueMax)}
|
|
10
10
|
aria-disabled=${disabled?"true":"false"}
|
|
@@ -20,4 +20,4 @@ import{__decorate}from"tslib";import{resolveIdReferencesIn}from"../../../interna
|
|
|
20
20
|
${dividers}
|
|
21
21
|
${showBackdrop?html`<div part="backdrop" @click=${this.onBackdropClick}></div>`:nothing}
|
|
22
22
|
</div>`,{label:this.nativeModalLabel()})}
|
|
23
|
-
</div>`}}__decorate([property({attribute:!1})],LyraMultiSplit.prototype,"sizes",void 0),__decorate([property({attribute:!1})],LyraMultiSplit.prototype,"defaultSizes",void 0),__decorate([property({type:Number})],LyraMultiSplit.prototype,"min",void 0),__decorate([property({reflect:!0})],LyraMultiSplit.prototype,"orientation",void 0),__decorate([property({attribute:"orientation-breakpoint"})],LyraMultiSplit.prototype,"orientationBreakpoint",void 0),__decorate([property({reflect:!0,attribute:"orientation-breakpoint-basis"})],LyraMultiSplit.prototype,"orientationBreakpointBasis",void 0),__decorate([property({reflect:!0,attribute:"narrow-orientation"})],LyraMultiSplit.prototype,"narrowOrientation",void 0),__decorate([property({attribute:"storage-key"})],LyraMultiSplit.prototype,"storageKey",void 0),__decorate([property({attribute:!1})],LyraMultiSplit.prototype,"panelConstraints",void 0),__decorate([property({reflect:!0})],LyraMultiSplit.prototype,"collapse",void 0),__decorate([property({attribute:"rail-width"})],LyraMultiSplit.prototype,"railWidth",void 0),__decorate([property({attribute:"rail-breakpoint"})],LyraMultiSplit.prototype,"railBreakpoint",void 0),__decorate([property({attribute:"float-breakpoint"})],LyraMultiSplit.prototype,"floatBreakpoint",void 0),__decorate([property({reflect:!0,attribute:"collapse-breakpoint-basis"})],LyraMultiSplit.prototype,"collapseBreakpointBasis",void 0),__decorate([property({type:Boolean,reflect:!0,attribute:"release-pin-on-breakpoint"})],LyraMultiSplit.prototype,"releasePinOnBreakpoint",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraMultiSplit.prototype,"open",void 0),__decorate([property({attribute:!1})],LyraMultiSplit.prototype,"trigger",void 0),__decorate([property()],LyraMultiSplit.prototype,"for",void 0),__decorate([property({attribute:!1})],LyraMultiSplit.prototype,"dividerLabel",void 0),__decorate([property({type:Number,attribute:"data-lr-panel-count",reflect:!0})],LyraMultiSplit.prototype,"panelCount",void 0),__decorate([query('[part="base"]')],LyraMultiSplit.prototype,"baseEl",void 0);export{LyraMultiSplit};
|
|
23
|
+
</div>`}}__decorate([property({attribute:!1})],LyraMultiSplit.prototype,"sizes",void 0),__decorate([property({attribute:!1})],LyraMultiSplit.prototype,"defaultSizes",void 0),__decorate([property({type:Number})],LyraMultiSplit.prototype,"min",void 0),__decorate([property({reflect:!0})],LyraMultiSplit.prototype,"orientation",void 0),__decorate([property({attribute:"orientation-breakpoint"})],LyraMultiSplit.prototype,"orientationBreakpoint",void 0),__decorate([property({reflect:!0,attribute:"orientation-breakpoint-basis"})],LyraMultiSplit.prototype,"orientationBreakpointBasis",void 0),__decorate([property({reflect:!0,attribute:"narrow-orientation"})],LyraMultiSplit.prototype,"narrowOrientation",void 0),__decorate([property({attribute:"storage-key"})],LyraMultiSplit.prototype,"storageKey",void 0),__decorate([property({attribute:!1})],LyraMultiSplit.prototype,"panelConstraints",void 0),__decorate([property({reflect:!0})],LyraMultiSplit.prototype,"collapse",void 0),__decorate([property({attribute:"rail-width"})],LyraMultiSplit.prototype,"railWidth",void 0),__decorate([property({attribute:"rail-breakpoint"})],LyraMultiSplit.prototype,"railBreakpoint",void 0),__decorate([property({attribute:"float-breakpoint"})],LyraMultiSplit.prototype,"floatBreakpoint",void 0),__decorate([property({reflect:!0,attribute:"collapse-breakpoint-basis"})],LyraMultiSplit.prototype,"collapseBreakpointBasis",void 0),__decorate([property({type:Boolean,reflect:!0,attribute:"release-pin-on-breakpoint"})],LyraMultiSplit.prototype,"releasePinOnBreakpoint",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraMultiSplit.prototype,"open",void 0),__decorate([property({attribute:!1})],LyraMultiSplit.prototype,"trigger",void 0),__decorate([property()],LyraMultiSplit.prototype,"for",void 0),__decorate([property({attribute:!1})],LyraMultiSplit.prototype,"dividerLabel",void 0),__decorate([property({attribute:!1})],LyraMultiSplit.prototype,"collapsedPanels",void 0),__decorate([property({type:Number,attribute:"data-lr-panel-count",reflect:!0})],LyraMultiSplit.prototype,"panelCount",void 0),__decorate([query('[part="base"]')],LyraMultiSplit.prototype,"baseEl",void 0);export{LyraMultiSplit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{focusRing}from"../../../internal/interactive-control.styles.js";import{css}from"lit";const styles=css` :host { display: block; inline-size: 100%; min-inline-size: 0; max-inline-size: 100%; block-size: 100%; --_lr-multi-split-overlay-color: var(--lr-color-overlay); --_lr-multi-split-divider-target-size: max( var(--lr-icon-button-size), var(--lr-size-3px) ); --_lr-multi-split-divider-thickness: var(--lr-size-3px); --_lr-multi-split-divider-color: var(--lr-color-border); --_lr-multi-split-divider-hover-color: var(--lr-color-brand); --_lr-multi-split-divider-active-color: color-mix( in oklab, var(--lr-color-brand), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } .allocation { inline-size: 100%; block-size: 100%; min-inline-size: 0; min-block-size: 0; } .allocation-reservation { max-block-size: 100%; pointer-events: none; } .allocation-reservation[hidden] { display: none; } [part="base"] { --_lr-multi-split-panel-min: 0; --_lr-multi-split-gutters: 0; display: flex; position: relative; inline-size: 100%; min-inline-size: 0; max-inline-size: 100%; block-size: 100%; } ::slotted(*) { flex: 1 1 0; min-inline-size: var(--_lr-multi-split-panel-min, 0); max-inline-size: 100%; min-block-size: 0; max-block-size: 100%; overflow: auto; overflow-wrap: anywhere; box-sizing: border-box; } ::slotted([hidden]:not([hidden="until-found" i])) { display: none !important; } :host([orientation="vertical"]) [part="base"] { flex-direction: column; } :host([orientation="vertical"]) ::slotted(*), :host([data-effective-orientation="vertical"]) ::slotted(*) { min-inline-size: 0; min-block-size: var(--_lr-multi-split-panel-min, 0); } :host([data-effective-orientation="horizontal"]) ::slotted(*) { min-inline-size: var(--_lr-multi-split-panel-min, 0); min-block-size: 0; } [part="divider"] { position: relative; flex: 0 0 auto; inline-size: var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ); min-block-size: min( 100%, var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ) ); max-block-size: 100%; background: transparent; cursor: col-resize; touch-action: none; } [part="divider"]::before { content: ""; position: absolute; inset-block: 0; inset-inline: calc( ( 100% - var( --lr-multi-split-divider-thickness, var(--_lr-multi-split-divider-thickness) ) ) / 2 ); background: var( --lr-multi-split-divider-color, var(--_lr-multi-split-divider-color) ); pointer-events: none; transition: background-color var(--lr-transition-fast); } :host(:where([orientation="vertical"])) [part="divider"] { inline-size: 100%; min-inline-size: min( 100%, var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ) ); max-inline-size: 100%; min-block-size: 0; block-size: var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ); cursor: row-resize; } :host(:where([orientation="vertical"])) [part="divider"]::before { inset-block: calc( ( 100% - var( --lr-multi-split-divider-thickness, var(--_lr-multi-split-divider-thickness) ) ) / 2 ); inset-inline: 0; } :host([data-effective-orientation="vertical"]) [part="base"] { flex-direction: column; } :host([data-effective-orientation="horizontal"]) [part="base"] { flex-direction: row; } :host(:where([data-effective-orientation="vertical"])) [part="divider"] { inline-size: 100%; min-inline-size: min( 100%, var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ) ); max-inline-size: 100%; min-block-size: 0; block-size: var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ); cursor: row-resize; } :host(:where([data-effective-orientation="vertical"])) [part="divider"]::before { inset-block: calc( ( 100% - var( --lr-multi-split-divider-thickness, var(--_lr-multi-split-divider-thickness) ) ) / 2 ); inset-inline: 0; } :host(:where([data-effective-orientation="horizontal"])) [part="divider"] { inline-size: var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ); min-block-size: min( 100%, var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ) ); max-block-size: 100%; block-size: auto; cursor: col-resize; } :host(:where([data-effective-orientation="horizontal"])) [part="divider"]::before { inset-block: 0; inset-inline: calc( ( 100% - var( --lr-multi-split-divider-thickness, var(--_lr-multi-split-divider-thickness) ) ) / 2 ); } [part="divider"]:hover::before { background: var( --lr-multi-split-divider-hover-color, var(--_lr-multi-split-divider-hover-color) ); } [part="divider"]:active::before { background: var( --lr-multi-split-divider-active-color, var(--_lr-multi-split-divider-active-color) ); } [part="divider"]:focus-visible { ${focusRing} } [part="divider"][aria-disabled="true"] { cursor: default; pointer-events: none; } :host([data-collapse-state="floating"]) [part="divider"][aria-disabled="true"] { flex: 0 0 0; min-inline-size: 0; min-block-size: 0; } :host([data-collapse-state="floating"]) [part="divider"][aria-disabled="true"]::before { content: none; } ::slotted([data-collapse-state="floating"]) { position: absolute; inset-block: var(--lr-multi-split-floating-panel-inset, 0); z-index: var(--lr-layer-content); background: var(--lr-color-surface); border-radius: var(--lr-radius); box-shadow: var(--lr-shadow-l); } :host([collapse="start"]) ::slotted([data-collapse-state="floating"]) { inset-inline-start: var(--lr-multi-split-floating-panel-inset, 0); } :host([collapse="end"]) ::slotted([data-collapse-state="floating"]) { inset-inline-end: var(--lr-multi-split-floating-panel-inset, 0); } [part="backdrop"] { position: absolute; inset: 0; z-index: var(--lr-layer-base); background: var( --lr-multi-split-overlay-color, var(--_lr-multi-split-overlay-color) ); } ::slotted([data-collapse-state="rail"]) { overflow: hidden; } `;export{styles};
|
|
1
|
+
import{focusRing}from"../../../internal/interactive-control.styles.js";import{css}from"lit";const styles=css` :host { display: block; inline-size: 100%; min-inline-size: 0; max-inline-size: 100%; block-size: 100%; --_lr-multi-split-overlay-color: var(--lr-color-overlay); --_lr-multi-split-divider-target-size: max( var(--lr-icon-button-size), var(--lr-size-3px) ); --_lr-multi-split-divider-thickness: var(--lr-size-3px); --_lr-multi-split-collapsed-panel-size: var( --lr-multi-split-collapsed-panel-size, var(--lr-size-2-5rem) ); --_lr-multi-split-divider-color: var(--lr-color-border); --_lr-multi-split-divider-hover-color: var(--lr-color-brand); --_lr-multi-split-divider-active-color: color-mix( in oklab, var(--lr-color-brand), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } .allocation { inline-size: 100%; block-size: 100%; min-inline-size: 0; min-block-size: 0; } .allocation-reservation { max-block-size: 100%; pointer-events: none; } .allocation-reservation[hidden] { display: none; } [part="base"] { --_lr-multi-split-panel-min: 0; --_lr-multi-split-gutters: 0; display: flex; position: relative; inline-size: 100%; min-inline-size: 0; max-inline-size: 100%; block-size: 100%; } ::slotted(*) { flex: 1 1 0; min-inline-size: var(--_lr-multi-split-panel-min, 0); max-inline-size: 100%; min-block-size: 0; max-block-size: 100%; overflow: auto; overflow-wrap: anywhere; box-sizing: border-box; } ::slotted([hidden]:not([hidden="until-found" i])) { display: none !important; } :host([orientation="vertical"]) [part="base"] { flex-direction: column; } :host([orientation="vertical"]) ::slotted(*), :host([data-effective-orientation="vertical"]) ::slotted(*) { min-inline-size: 0; min-block-size: var(--_lr-multi-split-panel-min, 0); } :host([data-effective-orientation="horizontal"]) ::slotted(*) { min-inline-size: var(--_lr-multi-split-panel-min, 0); min-block-size: 0; } [part="divider"] { position: relative; flex: 0 0 auto; inline-size: var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ); min-block-size: min( 100%, var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ) ); max-block-size: 100%; background: transparent; cursor: col-resize; touch-action: none; } [part="divider"]::before { content: ""; position: absolute; inset-block: 0; inset-inline: calc( ( 100% - var( --lr-multi-split-divider-thickness, var(--_lr-multi-split-divider-thickness) ) ) / 2 ); background: var( --lr-multi-split-divider-color, var(--_lr-multi-split-divider-color) ); pointer-events: none; transition: background-color var(--lr-transition-fast); } :host(:where([orientation="vertical"])) [part="divider"] { inline-size: 100%; min-inline-size: min( 100%, var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ) ); max-inline-size: 100%; min-block-size: 0; block-size: var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ); cursor: row-resize; } :host(:where([orientation="vertical"])) [part="divider"]::before { inset-block: calc( ( 100% - var( --lr-multi-split-divider-thickness, var(--_lr-multi-split-divider-thickness) ) ) / 2 ); inset-inline: 0; } :host([data-effective-orientation="vertical"]) [part="base"] { flex-direction: column; } :host([data-effective-orientation="horizontal"]) [part="base"] { flex-direction: row; } :host(:where([data-effective-orientation="vertical"])) [part="divider"] { inline-size: 100%; min-inline-size: min( 100%, var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ) ); max-inline-size: 100%; min-block-size: 0; block-size: var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ); cursor: row-resize; } :host(:where([data-effective-orientation="vertical"])) [part="divider"]::before { inset-block: calc( ( 100% - var( --lr-multi-split-divider-thickness, var(--_lr-multi-split-divider-thickness) ) ) / 2 ); inset-inline: 0; } :host(:where([data-effective-orientation="horizontal"])) [part="divider"] { inline-size: var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ); min-block-size: min( 100%, var( --lr-multi-split-divider-target-size, var(--_lr-multi-split-divider-target-size) ) ); max-block-size: 100%; block-size: auto; cursor: col-resize; } :host(:where([data-effective-orientation="horizontal"])) [part="divider"]::before { inset-block: 0; inset-inline: calc( ( 100% - var( --lr-multi-split-divider-thickness, var(--_lr-multi-split-divider-thickness) ) ) / 2 ); } [part="divider"]:hover::before { background: var( --lr-multi-split-divider-hover-color, var(--_lr-multi-split-divider-hover-color) ); } [part="divider"]:active::before { background: var( --lr-multi-split-divider-active-color, var(--_lr-multi-split-divider-active-color) ); } [part="divider"]:focus-visible { ${focusRing} } [part="divider"][aria-disabled="true"] { cursor: default; pointer-events: none; } :host([data-collapse-state="floating"]) [part="divider"][aria-disabled="true"] { flex: 0 0 0; min-inline-size: 0; min-block-size: 0; } :host([data-collapse-state="floating"]) [part="divider"][aria-disabled="true"]::before { content: none; } ::slotted([data-collapse-state="floating"]) { position: absolute; inset-block: var(--lr-multi-split-floating-panel-inset, 0); z-index: var(--lr-layer-content); background: var(--lr-color-surface); border-radius: var(--lr-radius); box-shadow: var(--lr-shadow-l); } :host([collapse="start"]) ::slotted([data-collapse-state="floating"]) { inset-inline-start: var(--lr-multi-split-floating-panel-inset, 0); } :host([collapse="end"]) ::slotted([data-collapse-state="floating"]) { inset-inline-end: var(--lr-multi-split-floating-panel-inset, 0); } [part="backdrop"] { position: absolute; inset: 0; z-index: var(--lr-layer-base); background: var( --lr-multi-split-overlay-color, var(--_lr-multi-split-overlay-color) ); } ::slotted([data-collapse-state="rail"]), ::slotted([data-panel-collapsed]) { overflow: hidden; } `;export{styles};
|
|
@@ -122,6 +122,13 @@ export type PageNavigationPlacement='start'|'end';export interface LyraPageEvent
|
|
|
122
122
|
* mobile navigation drawer.
|
|
123
123
|
* @cssprop [--lr-page-navigation-drawer-shadow=var(--lr-shadow-l)] - Shadow of the mobile
|
|
124
124
|
* navigation drawer.
|
|
125
|
+
* @cssprop [--lr-page-banner-bg=var(--lr-color-surface)] - Opaque background of the sticky banner,
|
|
126
|
+
* so scrolled content never shows through; unpainted when `disable-sticky` names `banner`.
|
|
127
|
+
* @cssprop [--lr-page-header-bg=var(--lr-color-surface)] - Opaque background of the sticky header,
|
|
128
|
+
* so scrolled content never shows through; unpainted when `disable-sticky` names `header`.
|
|
129
|
+
* @cssprop [--lr-page-subheader-bg=var(--lr-color-surface)] - Opaque background of the sticky
|
|
130
|
+
* subheader, so scrolled content never shows through; unpainted when `disable-sticky` names
|
|
131
|
+
* `subheader`.
|
|
125
132
|
* @cssprop [--aside-width] - Web Awesome alias for `--lr-page-aside-width`.
|
|
126
133
|
* @cssprop [--banner-height] - Web Awesome alias for `--lr-page-banner-height`.
|
|
127
134
|
* @cssprop [--header-height] - Web Awesome alias for `--lr-page-header-height`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{iconHitTarget,focusRing}from"../../../internal/interactive-control.styles.js";import{css}from"lit";const styles=css` :host { --_lr-page-aside-width: var(--aside-width, auto); --_lr-page-banner-height: var(--banner-height, calc(0 * var(--lr-size-1px))); --_lr-page-header-height: var(--header-height, calc(0 * var(--lr-size-1px))); --_lr-page-main-width: var(--main-width, 1fr); --_lr-page-menu-width: var(--menu-width, auto); --_lr-page-subheader-height: var(--subheader-height, calc(0 * var(--lr-size-1px))); display: block; min-inline-size: 0; color: var(--lr-color-text); } [part~="page"] { display: flex; flex-direction: column; min-inline-size: 0; min-block-size: 100dvh; overflow-x: clip; overflow-y: clip; background: var(--lr-color-surface); } [part~="skip-to-content"] { position: fixed; inset-block-start: max(var(--lr-space-s), var(--lr-safe-area-top)); inset-inline-start: max( var(--lr-space-s), var(--lr-safe-area-inline-start) ); z-index: var(--lr-layer-toast); display: inline-flex; align-items: center; justify-content: center; ${iconHitTarget} box-sizing: border-box; padding-inline: var(--lr-space-m); border: var(--lr-border-width-thin) solid var(--lr-color-border); border-radius: var(--lr-radius); opacity: 0; pointer-events: none; background: var(--lr-color-surface-overlay); color: var(--lr-color-text); box-shadow: var(--lr-shadow-m); text-decoration: none; transform: translateY(calc(-100% - var(--lr-space-l))); transition: opacity var(--lr-transition-fast), transform var(--lr-transition-fast), background-color var(--lr-transition-fast); cursor: pointer; } [part~="skip-to-content"]:where(:hover) { background: var( --lr-page-skip-to-content-hover-bg, var(--lr-color-brand-quiet) ); color: var(--lr-page-skip-to-content-hover-color, var(--lr-color-brand)); } [part~="skip-to-content"]:where(:active) { background: var( --lr-page-skip-to-content-active-bg, color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ) ); color: var(--lr-page-skip-to-content-active-color, var(--lr-color-brand)); } [part~="skip-to-content"]:where(:focus-visible) { opacity: 1; pointer-events: auto; ${focusRing} transform: none; } [part~="banner"], [part~="header"], [part~="subheader"], [part~="menu"], [part~="navigation-header"], [part~="navigation-footer"], [part~="main-header"], [part~="main-content"], [part~="main-footer"], [part~="aside"], [part~="footer"] { min-inline-size: 0; overflow-wrap: anywhere; } [part~="banner"] { min-block-size: var(--lr-page-banner-height, var(--_lr-page-banner-height)); } [part~="header"] { display: flex; align-items: center; justify-content: space-between; gap: var(--lr-space-s); min-block-size: var(--lr-page-header-height, var(--_lr-page-header-height)); } [part~="subheader"] { min-block-size: var( --lr-page-subheader-height, var(--_lr-page-subheader-height) ); } :host(:not([disable-sticky~="banner"])) [part~="banner"] { position: sticky; inset-block-start: 0; z-index: var(--lr-layer-content); } :host(:not([disable-sticky~="header"])) [part~="header"] { position: sticky; inset-block-start: var( --lr-page-banner-height, var(--_lr-page-banner-height) ); z-index: var(--lr-layer-content); } :host(:not([disable-sticky~="subheader"])) [part~="subheader"] { position: sticky; inset-block-start: calc( var(--lr-page-banner-height, var(--_lr-page-banner-height)) + var(--lr-page-header-height, var(--_lr-page-header-height)) ); z-index: var(--lr-layer-content); } .navigation-toggle-container { display: none; flex: 0 0 auto; } :host([view="mobile"]) .navigation-toggle-container { display: block; } [part~="navigation-toggle"] { display: inline-flex; align-items: center; justify-content: center; ${iconHitTarget} box-sizing: border-box; padding: var(--lr-space-s); border: var(--lr-border-width-thin) solid var(--lr-color-border); border-radius: var(--lr-radius); background: var(--lr-color-surface); color: var(--lr-color-text); font: inherit; cursor: pointer; } :host([disable-navigation-toggle]) [part~="navigation-toggle"] { display: none; } [part~="navigation-toggle"]:where(:hover), ::slotted([slot="navigation-toggle"]:hover) { background: var( --lr-page-navigation-toggle-hover-bg, var(--lr-color-brand-quiet) ); color: var(--lr-page-navigation-toggle-hover-color, var(--lr-color-brand)); } [part~="navigation-toggle"]:where(:active), ::slotted([slot="navigation-toggle"]:active) { background: var( --lr-page-navigation-toggle-active-bg, color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ) ); color: var(--lr-page-navigation-toggle-active-color, var(--lr-color-brand)); } [part~="navigation-toggle"]:where(:focus-visible), ::slotted([slot="navigation-toggle"]:focus-visible) { ${focusRing} } ::slotted([slot="navigation-toggle"]) { ${iconHitTarget} cursor: pointer; } [part~="navigation-toggle-icon"] { display: inline-flex; align-items: center; justify-content: center; pointer-events: none; } [part~="navigation-toggle-icon"] svg { display: block; } [part~="body"] { display: grid; flex: 1 1 auto; grid-template-areas: "menu navigation main aside"; grid-template-columns: var(--lr-page-menu-width, var(--_lr-page-menu-width)) auto minmax(0, var(--lr-page-main-width, var(--_lr-page-main-width))) var(--lr-page-aside-width, var(--_lr-page-aside-width)); min-inline-size: 0; align-items: stretch; } :host([navigation-placement="end"]) [part~="body"] { grid-template-areas: "menu main aside navigation"; grid-template-columns: var(--lr-page-menu-width, var(--_lr-page-menu-width)) minmax(0, var(--lr-page-main-width, var(--_lr-page-main-width))) var(--lr-page-aside-width, var(--_lr-page-aside-width)) auto; } [part~="menu"] { grid-area: menu; inline-size: var(--lr-page-menu-width, var(--_lr-page-menu-width)); } [part~="dialog-wrapper"], [part~="drawer"] { display: contents; } [part~="navigation"] { grid-area: navigation; display: flex; flex-direction: column; min-inline-size: 0; } [part~="navigation"] > slot[name="navigation"] { flex: 1 1 auto; } [part~="main"] { grid-area: main; min-inline-size: 0; inline-size: var(--lr-page-main-width, var(--_lr-page-main-width)); max-inline-size: 100%; outline: none; } [part~="aside"] { grid-area: aside; inline-size: var(--lr-page-aside-width, var(--_lr-page-aside-width)); max-inline-size: 100%; } :host(:not([disable-sticky~="menu"])) [part~="menu"], :host(:not([disable-sticky~="aside"])) [part~="aside"] { position: sticky; inset-block-start: calc( var(--lr-page-banner-height, var(--_lr-page-banner-height)) + var(--lr-page-header-height, var(--_lr-page-header-height)) + var(--lr-page-subheader-height, var(--_lr-page-subheader-height)) ); align-self: start; max-block-size: calc( 100dvh - var(--lr-page-banner-height, var(--_lr-page-banner-height)) - var(--lr-page-header-height, var(--_lr-page-header-height)) - var(--lr-page-subheader-height, var(--_lr-page-subheader-height)) ); overflow-y: auto; overflow-x: clip; } :host([view="mobile"]) [part~="body"] { display: block; } :host([view="mobile"]) [part~="menu"], :host([view="mobile"]) [part~="main"], :host([view="mobile"]) [part~="aside"] { inline-size: 100%; } :host([view="mobile"]) [part~="dialog-wrapper"] { position: fixed; inset: 0; z-index: var(--lr-overlay-stack-index, var(--lr-layer-modal)); display: block; visibility: hidden; pointer-events: none; background: transparent; transition: background-color var(--lr-transition-base), visibility var(--lr-transition-base); } :host([view="mobile"][nav-open]) [part~="dialog-wrapper"] { visibility: visible; pointer-events: auto; background: var(--lr-page-navigation-backdrop-bg, var(--lr-color-overlay)); } :host([view="mobile"]) [part~="drawer"] { position: absolute; inset-block: 0; display: flex; flex-direction: column; inline-size: min(var(--lr-size-18rem), calc(100% - var(--lr-space-l))); max-inline-size: 100%; min-inline-size: 0; box-sizing: border-box; padding-block-start: var(--lr-safe-area-top); padding-block-end: var(--lr-safe-area-bottom); padding-inline-start: var(--lr-safe-area-inline-start); padding-inline-end: var(--lr-safe-area-inline-end); background: var( --lr-page-navigation-drawer-bg, var(--lr-color-surface-overlay) ); box-shadow: var(--lr-page-navigation-drawer-shadow, var(--lr-shadow-l)); overflow-y: auto; overflow-x: clip; transition: transform var(--lr-transition-base); } :host([view="mobile"][navigation-placement="start"]) [part~="drawer"] { inset-inline-start: 0; } :host([view="mobile"][navigation-placement="end"]) [part~="drawer"] { inset-inline-end: 0; } :host( [view="mobile"]:not([nav-open])[navigation-placement="start"]:not( :dir(rtl) ) ) [part~="drawer"], :host([view="mobile"]:not([nav-open])[navigation-placement="end"]:dir(rtl)) [part~="drawer"] { transform: translateX(-100%); } :host( [view="mobile"]:not([nav-open])[navigation-placement="end"]:not(:dir(rtl)) ) [part~="drawer"], :host([view="mobile"]:not([nav-open])[navigation-placement="start"]:dir(rtl)) [part~="drawer"] { transform: translateX(100%); } :host([view="mobile"][nav-open]) [part~="drawer"] { transform: none; } :host([view="mobile"]) [part~="navigation"] { flex: 1 1 auto; min-block-size: 0; } ::slotted(*) { min-inline-size: 0; max-inline-size: 100%; } @media (prefers-reduced-motion: reduce) { [part~="skip-to-content"], [part~="navigation-toggle"], [part~="dialog-wrapper"], [part~="drawer"] { transition: none !important; } } `;export{styles};
|
|
1
|
+
import{iconHitTarget,focusRing}from"../../../internal/interactive-control.styles.js";import{css}from"lit";const styles=css` :host { --_lr-page-aside-width: var(--aside-width, auto); --_lr-page-banner-height: var(--banner-height, calc(0 * var(--lr-size-1px))); --_lr-page-header-height: var(--header-height, calc(0 * var(--lr-size-1px))); --_lr-page-main-width: var(--main-width, 1fr); --_lr-page-menu-width: var(--menu-width, auto); --_lr-page-subheader-height: var(--subheader-height, calc(0 * var(--lr-size-1px))); display: block; min-inline-size: 0; color: var(--lr-color-text); } [part~="page"] { display: flex; flex-direction: column; min-inline-size: 0; min-block-size: 100dvh; overflow-x: clip; overflow-y: clip; background: var(--lr-color-surface); } [part~="skip-to-content"] { position: fixed; inset-block-start: max(var(--lr-space-s), var(--lr-safe-area-top)); inset-inline-start: max( var(--lr-space-s), var(--lr-safe-area-inline-start) ); z-index: var(--lr-layer-toast); display: inline-flex; align-items: center; justify-content: center; ${iconHitTarget} box-sizing: border-box; padding-inline: var(--lr-space-m); border: var(--lr-border-width-thin) solid var(--lr-color-border); border-radius: var(--lr-radius); opacity: 0; pointer-events: none; background: var(--lr-color-surface-overlay); color: var(--lr-color-text); box-shadow: var(--lr-shadow-m); text-decoration: none; transform: translateY(calc(-100% - var(--lr-space-l))); transition: opacity var(--lr-transition-fast), transform var(--lr-transition-fast), background-color var(--lr-transition-fast); cursor: pointer; } [part~="skip-to-content"]:where(:hover) { background: var( --lr-page-skip-to-content-hover-bg, var(--lr-color-brand-quiet) ); color: var(--lr-page-skip-to-content-hover-color, var(--lr-color-brand)); } [part~="skip-to-content"]:where(:active) { background: var( --lr-page-skip-to-content-active-bg, color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ) ); color: var(--lr-page-skip-to-content-active-color, var(--lr-color-brand)); } [part~="skip-to-content"]:where(:focus-visible) { opacity: 1; pointer-events: auto; ${focusRing} transform: none; } [part~="banner"], [part~="header"], [part~="subheader"], [part~="menu"], [part~="navigation-header"], [part~="navigation-footer"], [part~="main-header"], [part~="main-content"], [part~="main-footer"], [part~="aside"], [part~="footer"] { min-inline-size: 0; overflow-wrap: anywhere; } [part~="banner"] { min-block-size: var(--lr-page-banner-height, var(--_lr-page-banner-height)); } [part~="header"] { display: flex; align-items: center; justify-content: space-between; gap: var(--lr-space-s); min-block-size: var(--lr-page-header-height, var(--_lr-page-header-height)); } [part~="subheader"] { min-block-size: var( --lr-page-subheader-height, var(--_lr-page-subheader-height) ); } :host(:not([disable-sticky~="banner"])) [part~="banner"] { position: sticky; background: var(--lr-page-banner-bg, var(--lr-color-surface)); inset-block-start: 0; z-index: var(--lr-layer-content); } :host(:not([disable-sticky~="header"])) [part~="header"] { position: sticky; background: var(--lr-page-header-bg, var(--lr-color-surface)); inset-block-start: var( --lr-page-banner-height, var(--_lr-page-banner-height) ); z-index: var(--lr-layer-content); } :host(:not([disable-sticky~="subheader"])) [part~="subheader"] { position: sticky; background: var(--lr-page-subheader-bg, var(--lr-color-surface)); inset-block-start: calc( var(--lr-page-banner-height, var(--_lr-page-banner-height)) + var(--lr-page-header-height, var(--_lr-page-header-height)) ); z-index: var(--lr-layer-content); } .navigation-toggle-container { display: none; flex: 0 0 auto; } :host([view="mobile"]) .navigation-toggle-container { display: block; } [part~="navigation-toggle"] { display: inline-flex; align-items: center; justify-content: center; ${iconHitTarget} box-sizing: border-box; padding: var(--lr-space-s); border: var(--lr-border-width-thin) solid var(--lr-color-border); border-radius: var(--lr-radius); background: var(--lr-color-surface); color: var(--lr-color-text); font: inherit; cursor: pointer; } :host([disable-navigation-toggle]) [part~="navigation-toggle"] { display: none; } [part~="navigation-toggle"]:where(:hover), ::slotted([slot="navigation-toggle"]:hover) { background: var( --lr-page-navigation-toggle-hover-bg, var(--lr-color-brand-quiet) ); color: var(--lr-page-navigation-toggle-hover-color, var(--lr-color-brand)); } [part~="navigation-toggle"]:where(:active), ::slotted([slot="navigation-toggle"]:active) { background: var( --lr-page-navigation-toggle-active-bg, color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ) ); color: var(--lr-page-navigation-toggle-active-color, var(--lr-color-brand)); } [part~="navigation-toggle"]:where(:focus-visible), ::slotted([slot="navigation-toggle"]:focus-visible) { ${focusRing} } ::slotted([slot="navigation-toggle"]) { ${iconHitTarget} cursor: pointer; } [part~="navigation-toggle-icon"] { display: inline-flex; align-items: center; justify-content: center; pointer-events: none; } [part~="navigation-toggle-icon"] svg { display: block; } [part~="body"] { display: grid; flex: 1 1 auto; grid-template-areas: "menu navigation main aside"; grid-template-columns: var(--lr-page-menu-width, var(--_lr-page-menu-width)) auto minmax(0, var(--lr-page-main-width, var(--_lr-page-main-width))) var(--lr-page-aside-width, var(--_lr-page-aside-width)); min-inline-size: 0; align-items: stretch; } :host([navigation-placement="end"]) [part~="body"] { grid-template-areas: "menu main aside navigation"; grid-template-columns: var(--lr-page-menu-width, var(--_lr-page-menu-width)) minmax(0, var(--lr-page-main-width, var(--_lr-page-main-width))) var(--lr-page-aside-width, var(--_lr-page-aside-width)) auto; } [part~="menu"] { grid-area: menu; inline-size: var(--lr-page-menu-width, var(--_lr-page-menu-width)); } [part~="dialog-wrapper"], [part~="drawer"] { display: contents; } [part~="navigation"] { grid-area: navigation; display: flex; flex-direction: column; min-inline-size: 0; } [part~="navigation"] > slot[name="navigation"] { flex: 1 1 auto; } [part~="main"] { grid-area: main; min-inline-size: 0; inline-size: var(--lr-page-main-width, var(--_lr-page-main-width)); max-inline-size: 100%; outline: none; } [part~="aside"] { grid-area: aside; inline-size: var(--lr-page-aside-width, var(--_lr-page-aside-width)); max-inline-size: 100%; } :host(:not([disable-sticky~="menu"])) [part~="menu"], :host(:not([disable-sticky~="aside"])) [part~="aside"] { position: sticky; inset-block-start: calc( var(--lr-page-banner-height, var(--_lr-page-banner-height)) + var(--lr-page-header-height, var(--_lr-page-header-height)) + var(--lr-page-subheader-height, var(--_lr-page-subheader-height)) ); align-self: start; max-block-size: calc( 100dvh - var(--lr-page-banner-height, var(--_lr-page-banner-height)) - var(--lr-page-header-height, var(--_lr-page-header-height)) - var(--lr-page-subheader-height, var(--_lr-page-subheader-height)) ); overflow-y: auto; overflow-x: clip; } :host([view="mobile"]) [part~="body"] { display: block; } :host([view="mobile"]) [part~="menu"], :host([view="mobile"]) [part~="main"], :host([view="mobile"]) [part~="aside"] { inline-size: 100%; } :host([view="mobile"]) [part~="dialog-wrapper"] { position: fixed; inset: 0; z-index: var(--lr-overlay-stack-index, var(--lr-layer-modal)); display: block; visibility: hidden; pointer-events: none; background: transparent; transition: background-color var(--lr-transition-base), visibility var(--lr-transition-base); } :host([view="mobile"][nav-open]) [part~="dialog-wrapper"] { visibility: visible; pointer-events: auto; background: var(--lr-page-navigation-backdrop-bg, var(--lr-color-overlay)); } :host([view="mobile"]) [part~="drawer"] { position: absolute; inset-block: 0; display: flex; flex-direction: column; inline-size: min(var(--lr-size-18rem), calc(100% - var(--lr-space-l))); max-inline-size: 100%; min-inline-size: 0; box-sizing: border-box; padding-block-start: var(--lr-safe-area-top); padding-block-end: var(--lr-safe-area-bottom); padding-inline-start: var(--lr-safe-area-inline-start); padding-inline-end: var(--lr-safe-area-inline-end); background: var( --lr-page-navigation-drawer-bg, var(--lr-color-surface-overlay) ); box-shadow: var(--lr-page-navigation-drawer-shadow, var(--lr-shadow-l)); overflow-y: auto; overflow-x: clip; transition: transform var(--lr-transition-base); } :host([view="mobile"][navigation-placement="start"]) [part~="drawer"] { inset-inline-start: 0; } :host([view="mobile"][navigation-placement="end"]) [part~="drawer"] { inset-inline-end: 0; } :host( [view="mobile"]:not([nav-open])[navigation-placement="start"]:not( :dir(rtl) ) ) [part~="drawer"], :host([view="mobile"]:not([nav-open])[navigation-placement="end"]:dir(rtl)) [part~="drawer"] { transform: translateX(-100%); } :host( [view="mobile"]:not([nav-open])[navigation-placement="end"]:not(:dir(rtl)) ) [part~="drawer"], :host([view="mobile"]:not([nav-open])[navigation-placement="start"]:dir(rtl)) [part~="drawer"] { transform: translateX(100%); } :host([view="mobile"][nav-open]) [part~="drawer"] { transform: none; } :host([view="mobile"]) [part~="navigation"] { flex: 1 1 auto; min-block-size: 0; } ::slotted(*) { min-inline-size: 0; max-inline-size: 100%; } @media (prefers-reduced-motion: reduce) { [part~="skip-to-content"], [part~="navigation-toggle"], [part~="dialog-wrapper"], [part~="drawer"] { transition: none !important; } } `;export{styles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getDisplayNames}from"../../../internal/intl-cache.js";const nativeNames=new Map;let nativeNameMethod,nativeNameConstructor;const ALPHA2_RE=/^[a-z]{2}$/i,ALPHA3_RE=/^[a-z]{3}$/i,ALPHA3_TO_ALPHA2_PACKED="abwawafgafagoaoaiaaialaaxalbalandadareaeargararmamasmasataaqatftfatgagausauautatazeazbdibibelbebenbjbesbqbfabfbgdbdbgrbgbhrbhbhsbsbihbablmblblrbyblzbzbmubmbolbobrabrbrbbbbrnbnbtnbtbvtbvbwabwcafcfcancacckccchechchlclchncncivcicmrcmcodcdcogcgcokckcolcocomkmcpvcvcricrcubcucuwcwcxrcxcymkycypcyczeczdeudedjidjdmadmdnkdkdomdodzadzecuecegyegeriereshehespesesteeethetfinfifjifjflkfkfrafrfrofofsmfmgabgagbrgbgeogeggyggghaghgibgigingnglpgpgmbgmgnbgwgnqgqgrcgrgrdgdgrlglgtmgtgufgfgumguguygyhkghkhmdhmhndhnhrvhrhtihthunhuidnidimnimindiniotioirlieirnirirqiqislisisrilitaitjamjmjeyjejorjojpnjpkazkzkenkekgzkgkhmkhkirkiknaknkorkrkwtkwlaolalbnlblbrlrlbylylcalclielilkalklsolsltultluxlulvalvmacmomafmfmarmamcomcmdamdmdgmgmdvmvmexmxmhlmhmkdmkmlimlmltmtmmrmmmnememngmnmnpmpmozmzmrtmrmsrmsmtqmqmusmumwimwmysmymytytnamnanclncnernenfknfngangnicniniununldnlnornonplnpnrunrnzlnzomnompakpkpanpapcnpnperpephlphplwpwpngpgpolplpriprprkkpprtptprypypsepspyfpfqatqareurerourorusrurwarwsausasdnsdsensnsgpsgsgsgsshnshsjmsjslbsbsleslslvsvsmrsmsomsospmpmsrbrsssdssstpstsursrsvksksvnsisweseswzszsxmsxsycscsyrsytcatctcdtdtgotgthathtjktjtkltktkmtmtlstltontottotttuntnturtrtuvtvtwntwtzatzugaugukruaumiumuryuyusausuzbuzvatvavctvcvenvevgbvgvirvivnmvnvutvuwlfwfwsmwsyemyezafzazmbzmzwezw";let alpha3Lookup;function alpha3ToAlpha2(code){if(ALPHA3_RE.test(code)){if(!alpha3Lookup){alpha3Lookup=new Map;for(let index=0;index<ALPHA3_TO_ALPHA2_PACKED.length;index+=5)alpha3Lookup.set(ALPHA3_TO_ALPHA2_PACKED.slice(index,index+3),ALPHA3_TO_ALPHA2_PACKED.slice(index+3,index+5))}return alpha3Lookup.get(code.toLowerCase())}}const LANGUAGE_TO_COUNTRY={en:"gb",fr:"fr",de:"de",es:"es",it:"it",pt:"pt",nl:"nl",ar:"sa",zh:"cn",ja:"jp",ko:"kr",ru:"ru",pl:"pl",tr:"tr",sv:"se",da:"dk",fi:"fi",no:"no",nb:"no",nn:"no",cs:"cz",sk:"sk",el:"gr",he:"il",hi:"in",th:"th",vi:"vn",id:"id",ms:"my",uk:"ua",kk:"kz",lah:"pk",ro:"ro",hu:"hu",bg:"bg",hr:"hr",sr:"rs",sl:"si",et:"ee",lv:"lv",lt:"lt",fa:"ir",ur:"pk",bn:"bd",ta:"in",am:"et",bho:"in",gu:"in",ha:"ng",ig:"ng",jv:"id",kn:"in",ln:"cd",ml:"in",mr:"in",my:"mm",ne:"np",om:"et",or:"in",pa:"in",pcm:"ng",pnb:"pk",ps:"af",sd:"pk",su:"id",sw:"tz",te:"in",tl:"ph",uz:"uz",yo:"ng",zu:"za",ca:"es",lb:"lu",fil:"ph"};function mappedCountry(language){return Object.hasOwn(LANGUAGE_TO_COUNTRY,language)?LANGUAGE_TO_COUNTRY[language]:void 0}function scriptImpliedRegion(locale){if(!locale.script)return;const scriptRegion=locale.maximize().region,languageRegion=new Intl.Locale(locale.language).maximize().region;return scriptRegion&&ALPHA2_RE.test(scriptRegion)&&scriptRegion!==languageRegion?scriptRegion.toLowerCase():void 0}function languageToCountry(language){if(typeof language!="string")return;const normalized=language.trim().replaceAll("_","-");if(!normalized)return;try{const locale=new Intl.Locale(normalized);if(locale.region&&/^\d{3}$/.test(locale.region))return;if(locale.region&&ALPHA2_RE.test(locale.region))return locale.region.toLowerCase();const mapped=mappedCountry(locale.language.toLowerCase());return mapped===void 0?void 0:scriptImpliedRegion(locale)??mapped}catch{}const parts=normalized.toLowerCase().split("-").slice(0,16),base=parts[0];if(base.length!==1){for(const part of parts.slice(1)){if(!/^[a-z0-9]{1,8}$/.test(part)||part.length===1)break;if(/^\d{3}$/.test(part))return;if(ALPHA2_RE.test(part))return part}return mappedCountry(base)}}function localeNativeName(tag){try{(nativeNameMethod!==Intl.DisplayNames.prototype.of||nativeNameConstructor!==Intl.DisplayNames)&&(nativeNames.clear(),nativeNameMethod=Intl.DisplayNames.prototype.of,nativeNameConstructor=Intl.DisplayNames);const cached=nativeNames.get(tag);if(cached!==void 0)return cached;const name=getDisplayNames(tag,{type:"language"}).of(tag)??tag;return nativeNames.size>=1024&&nativeNames.delete(nativeNames.keys().next().value),nativeNames.set(tag,name),name}catch{return tag}}export{ALPHA2_RE,ALPHA3_RE,LANGUAGE_TO_COUNTRY,alpha3ToAlpha2,languageToCountry,localeNativeName};
|
|
1
|
+
import{getDisplayNames}from"../../../internal/intl-cache.js";const nativeNames=new Map;let nativeNameMethod,nativeNameConstructor;const ALPHA2_RE=/^[a-z]{2}$/i,ALPHA3_RE=/^[a-z]{3}$/i,ALPHA3_TO_ALPHA2_PACKED="abwawafgafagoaoaiaaialaaxalbalandadareaeargararmamasmasataaqatftfatgagausauautatazeazbdibibelbebenbjbesbqbfabfbgdbdbgrbgbhrbhbhsbsbihbablmblblrbyblzbzbmubmbolbobrabrbrbbbbrnbnbtnbtbvtbvbwabwcafcfcancacckccchechchlclchncncivcicmrcmcodcdcogcgcokckcolcocomkmcpvcvcricrcubcucuwcwcxrcxcymkycypcyczeczdeudedjidjdmadmdnkdkdomdodzadzecuecegyegeriereshehespesesteeethetfinfifjifjflkfkfrafrfrofofsmfmgabgagbrgbgeogeggyggghaghgibgigingnglpgpgmbgmgnbgwgnqgqgrcgrgrdgdgrlglgtmgtgufgfgumguguygyhkghkhmdhmhndhnhrvhrhtihthunhuidnidimnimindiniotioirlieirnirirqiqislisisrilitaitjamjmjeyjejorjojpnjpkazkzkenkekgzkgkhmkhkirkiknaknkorkrkwtkwlaolalbnlblbrlrlbylylcalclielilkalklsolsltultluxlulvalvmacmomafmfmarmamcomcmdamdmdgmgmdvmvmexmxmhlmhmkdmkmlimlmltmtmmrmmmnememngmnmnpmpmozmzmrtmrmsrmsmtqmqmusmumwimwmysmymytytnamnanclncnernenfknfngangnicniniununldnlnornonplnpnrunrnzlnzomnompakpkpanpapcnpnperpephlphplwpwpngpgpolplpriprprkkpprtptprypypsepspyfpfqatqareurerourorusrurwarwsausasdnsdsensnsgpsgsgsgsshnshsjmsjslbsbsleslslvsvsmrsmsomsospmpmsrbrsssdssstpstsursrsvksksvnsisweseswzszsxmsxsycscsyrsytcatctcdtdtgotgthathtjktjtkltktkmtmtlstltontottotttuntnturtrtuvtvtwntwtzatzugaugukruaumiumuryuyusausuzbuzvatvavctvcvenvevgbvgvirvivnmvnvutvuwlfwfwsmwsyemyezafzazmbzmzwezw";let alpha3Lookup;function alpha3ToAlpha2(code){if(ALPHA3_RE.test(code)){if(!alpha3Lookup){alpha3Lookup=new Map;for(let index=0;index<ALPHA3_TO_ALPHA2_PACKED.length;index+=5)alpha3Lookup.set(ALPHA3_TO_ALPHA2_PACKED.slice(index,index+3),ALPHA3_TO_ALPHA2_PACKED.slice(index+3,index+5))}return alpha3Lookup.get(code.toLowerCase())}}const LANGUAGE_TO_COUNTRY={en:"gb",fr:"fr",de:"de",es:"es",it:"it",pt:"pt",nl:"nl",ar:"sa",zh:"cn",ja:"jp",ko:"kr",ru:"ru",pl:"pl",tr:"tr",sv:"se",da:"dk",fi:"fi",no:"no",nb:"no",nn:"no",cs:"cz",sk:"sk",el:"gr",he:"il",hi:"in",th:"th",vi:"vn",id:"id",ms:"my",uk:"ua",kk:"kz",lah:"pk",ro:"ro",hu:"hu",bg:"bg",hr:"hr",sr:"rs",sl:"si",et:"ee",lv:"lv",lt:"lt",fa:"ir",ur:"pk",bn:"bd",ta:"in",am:"et",bho:"in",gu:"in",ha:"ng",ig:"ng",jv:"id",kn:"in",ln:"cd",ml:"in",mr:"in",my:"mm",ne:"np",om:"et",or:"in",pa:"in",pcm:"ng",pnb:"pk",ps:"af",sd:"pk",su:"id",sw:"tz",te:"in",tl:"ph",uz:"uz",yo:"ng",zu:"za",ca:"es",ga:"ie",mt:"mt",lb:"lu",fil:"ph"};function mappedCountry(language){return Object.hasOwn(LANGUAGE_TO_COUNTRY,language)?LANGUAGE_TO_COUNTRY[language]:void 0}function scriptImpliedRegion(locale){if(!locale.script)return;const scriptRegion=locale.maximize().region,languageRegion=new Intl.Locale(locale.language).maximize().region;return scriptRegion&&ALPHA2_RE.test(scriptRegion)&&scriptRegion!==languageRegion?scriptRegion.toLowerCase():void 0}function languageToCountry(language){if(typeof language!="string")return;const normalized=language.trim().replaceAll("_","-");if(!normalized)return;try{const locale=new Intl.Locale(normalized);if(locale.region&&/^\d{3}$/.test(locale.region))return;if(locale.region&&ALPHA2_RE.test(locale.region))return locale.region.toLowerCase();const mapped=mappedCountry(locale.language.toLowerCase());return mapped===void 0?void 0:scriptImpliedRegion(locale)??mapped}catch{}const parts=normalized.toLowerCase().split("-").slice(0,16),base=parts[0];if(base.length!==1){for(const part of parts.slice(1)){if(!/^[a-z0-9]{1,8}$/.test(part)||part.length===1)break;if(/^\d{3}$/.test(part))return;if(ALPHA2_RE.test(part))return part}return mappedCountry(base)}}function localeNativeName(tag){try{(nativeNameMethod!==Intl.DisplayNames.prototype.of||nativeNameConstructor!==Intl.DisplayNames)&&(nativeNames.clear(),nativeNameMethod=Intl.DisplayNames.prototype.of,nativeNameConstructor=Intl.DisplayNames);const cached=nativeNames.get(tag);if(cached!==void 0)return cached;const name=getDisplayNames(tag,{type:"language"}).of(tag)??tag;return nativeNames.size>=1024&&nativeNames.delete(nativeNames.keys().next().value),nativeNames.set(tag,name),name}catch{return tag}}export{ALPHA2_RE,ALPHA3_RE,LANGUAGE_TO_COUNTRY,alpha3ToAlpha2,languageToCountry,localeNativeName};
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/** First valid ID wins; invalid coordinates and blank IDs are omitted from the bounded snapshot.*/
|
|
3
|
-
export declare function snapshotPanoramaHotspots(value:unknown,owner:Window|null):readonly LyraPanoramaHotspot[];type Media=HTMLImageElement|HTMLVideoElement;interface PanoramaOptions{readonly changed:()=>void;readonly updated:()=>Promise<unknown>;readonly localize:(key:LyraMessageKey)=>string;readonly direction:()=>'ltr'|'rtl';readonly camera:(camera:LyraPanoramaCamera)=>void;readonly pick:(detail:LyraPanoramaHotspotSelectDetail)=>void;readonly fallback:(detail:Engine3dFallbackDetail)=>void;}
|
|
4
|
-
/** Optional spherical rendering around a caller-owned native image or video.*/
|
|
5
|
-
export declare class PanoramaController{private readonly host;private readonly options;private readonly selection;private readonly announcements;ready:boolean;loading:boolean;notice:Engine3dFallbackDetail|null;private software;private enabled;private media;private mediaRevision;private hotspots;private camera;private container;private engine?;private generation;private revision;private attempted;private pending;private intersection?;private eligibility?;private intersecting;private resize?;private theme?;private cleanups;private cursor;constructor(host:HTMLElement,options:PanoramaOptions);private release;invalidate():void;disconnect():void;adopted():void;update(enabled:boolean,media:Media|null,mediaRevision:number,hotspots:readonly LyraPanoramaHotspot[],camera:LyraPanoramaCamera,container:HTMLElement|null):void;private fail;private command;private start;private style;private activate;keydown(event:KeyboardEvent,direction:'ltr'|'rtl'):void;renderViewport(label:string,enabled:boolean):TemplateResult|typeof nothing;renderNotice():TemplateResult|typeof nothing;renderHotspots(enabled:boolean):TemplateResult|typeof nothing;}export{};
|
|
1
|
+
export*from'../../../internal/media-panorama.js';
|