@aceshooting/lyra-ui 9.1.0 → 10.0.1
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 +843 -0
- package/README.md +7 -0
- package/custom-elements.json +1 -1
- package/dist/cli/migrate-wa.mjs +52 -0
- package/dist/cli/migration-contract.json +1 -1
- package/dist/components/agent-tools/activity-feed/activity-feed.class.js +2 -2
- package/dist/components/agent-tools/activity-feed/activity-feed.styles.js +0 -16
- package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.class.js +1 -1
- package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.styles.js +9 -7
- package/dist/components/agent-tools/agent-run/agent-run.class.js +2 -2
- package/dist/components/agent-tools/agent-run/agent-run.styles.js +0 -13
- package/dist/components/agent-tools/agent-trace/agent-trace.class.js +1 -1
- package/dist/components/agent-tools/agent-trace/agent-trace.styles.js +7 -4
- package/dist/components/agent-tools/approval-queue/approval-queue.styles.js +7 -5
- package/dist/components/agent-tools/artifact-panel/artifact-panel.styles.js +0 -3
- package/dist/components/agent-tools/browser-frame/browser-frame.class.js +1 -1
- package/dist/components/agent-tools/browser-frame/browser-frame.styles.js +3 -5
- package/dist/components/agent-tools/commit-card/commit-card.class.js +1 -1
- package/dist/components/agent-tools/commit-card/commit-card.styles.js +0 -10
- package/dist/components/agent-tools/compare-panel/compare-panel.styles.js +11 -6
- package/dist/components/agent-tools/confirm-bar/confirm-bar.class.js +2 -2
- package/dist/components/agent-tools/confirm-bar/confirm-bar.styles.js +0 -46
- package/dist/components/agent-tools/context-inspector/context-inspector.class.js +1 -1
- package/dist/components/agent-tools/eval-dataset/eval-dataset.styles.js +0 -7
- package/dist/components/agent-tools/eval-result/eval-result.class.js +1 -1
- package/dist/components/agent-tools/evaluation-run/evaluation-run.class.js +2 -2
- package/dist/components/agent-tools/policy-summary/policy-summary.class.js +1 -1
- package/dist/components/agent-tools/prompt-studio/prompt-studio.styles.js +0 -15
- package/dist/components/agent-tools/result-card/result-card.styles.js +0 -7
- package/dist/components/agent-tools/result-card/result-field.styles.js +0 -5
- package/dist/components/agent-tools/schema-viewer/schema-viewer.styles.js +2 -5
- package/dist/components/agent-tools/span-waterfall/span-waterfall.class.js +1 -1
- package/dist/components/agent-tools/span-waterfall/span-waterfall.styles.js +0 -15
- package/dist/components/agent-tools/stack-trace/stack-trace.styles.js +0 -20
- package/dist/components/agent-tools/subagent-panel/subagent-panel.class.js +2 -2
- package/dist/components/agent-tools/subagent-panel/subagent-panel.styles.js +1 -4
- package/dist/components/agent-tools/task-list/task-list.class.js +2 -2
- package/dist/components/agent-tools/task-list/task-list.styles.js +0 -15
- package/dist/components/agent-tools/terminal/terminal.class.d.ts +11 -6
- package/dist/components/agent-tools/terminal/terminal.class.js +4 -4
- package/dist/components/agent-tools/terminal/terminal.styles.js +0 -46
- package/dist/components/agent-tools/test-results/test-results.class.js +2 -2
- package/dist/components/agent-tools/test-results/test-results.styles.js +0 -5
- package/dist/components/agent-tools/thinking-panel/thinking-panel.class.js +1 -1
- package/dist/components/agent-tools/thinking-panel/thinking-panel.styles.js +0 -41
- package/dist/components/agent-tools/tool-approval-dialog/tool-approval-dialog.styles.js +0 -41
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.js +2 -2
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.styles.js +0 -30
- package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js +6 -6
- package/dist/components/agent-tools/tool-param-form/tool-param-form.styles.js +0 -5
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.class.js +2 -2
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.styles.js +0 -20
- package/dist/components/agent-tools/tool-result-view/tool-result-view.styles.js +0 -4
- package/dist/components/agent-tools/tool-select-dialog/tool-select-dialog.styles.js +0 -21
- package/dist/components/agent-tools/trace-tree/trace-tree.class.js +2 -2
- package/dist/components/agent-tools/trace-tree/trace-tree.styles.js +7 -31
- package/dist/components/charts/chart/bar-chart.class.js +1 -1
- package/dist/components/charts/chart/box-plot.styles.js +0 -20
- package/dist/components/charts/chart/bubble-chart.class.js +1 -1
- package/dist/components/charts/chart/chart-colors.d.ts +1 -1
- package/dist/components/charts/chart/chart-colors.js +1 -1
- package/dist/components/charts/chart/chart-core-loader.d.ts +1 -0
- package/dist/components/charts/chart/chart-core-loader.js +1 -1
- package/dist/components/charts/chart/chart-feature-loader.d.ts +35 -0
- package/dist/components/charts/chart/chart-feature-loader.js +1 -1
- package/dist/components/charts/chart/chart.class.d.ts +93 -0
- package/dist/components/charts/chart/chart.class.js +3 -3
- package/dist/components/charts/chart/chart.styles.js +0 -27
- package/dist/components/charts/chart/doughnut-chart.class.js +1 -1
- package/dist/components/charts/chart/histogram.class.js +1 -1
- package/dist/components/charts/chart/line-chart.class.js +1 -1
- package/dist/components/charts/chart/lite-chart.class.d.ts +20 -1
- package/dist/components/charts/chart/lite-chart.class.js +4 -4
- package/dist/components/charts/chart/lite-chart.styles.js +0 -27
- package/dist/components/charts/chart/pie-chart.class.js +1 -1
- package/dist/components/charts/chart/polar-area-chart.class.js +1 -1
- package/dist/components/charts/chart/radar-chart.class.js +1 -1
- package/dist/components/charts/chart/scatter-chart.class.js +1 -1
- package/dist/components/conversation/agent-workspace/agent-workspace.class.d.ts +20 -0
- package/dist/components/conversation/agent-workspace/agent-workspace.class.js +3 -1
- package/dist/components/conversation/agent-workspace/agent-workspace.styles.js +3 -0
- package/dist/components/conversation/audio-visualizer/audio-visualizer.styles.js +0 -7
- package/dist/components/conversation/branch-picker/branch-picker.styles.js +0 -3
- package/dist/components/conversation/chat-composer/chat-composer.styles.js +0 -51
- package/dist/components/conversation/chat-message/chat-message.class.js +2 -2
- package/dist/components/conversation/chat-message/chat-message.styles.js +13 -35
- package/dist/components/conversation/chat-viewport/chat-viewport.class.js +1 -1
- package/dist/components/conversation/chat-viewport/chat-viewport.styles.js +0 -33
- package/dist/components/conversation/checkpoint/checkpoint.class.js +1 -1
- package/dist/components/conversation/checkpoint/checkpoint.styles.js +0 -3
- package/dist/components/conversation/code-block/code-block-shared.d.ts +5 -2
- package/dist/components/conversation/code-block/code-block.class.js +1 -1
- package/dist/components/conversation/code-block/code-block.styles.js +4 -95
- package/dist/components/conversation/code-block/code-loader.d.ts +11 -0
- package/dist/components/conversation/code-block/code-loader.js +1 -1
- package/dist/components/conversation/code-block/shiki-types.d.ts +12 -0
- package/dist/components/conversation/code-block/shiki-types.js +1 -1
- package/dist/components/conversation/conversation-item/conversation-item.styles.js +8 -54
- package/dist/components/conversation/generation-metrics/generation-metrics.class.js +2 -2
- package/dist/components/conversation/generation-metrics/generation-metrics.styles.js +0 -17
- package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
- package/dist/components/conversation/markdown/markdown.styles.js +0 -41
- package/dist/components/conversation/message-actions/message-actions.styles.js +0 -3
- package/dist/components/conversation/message-feedback/message-feedback.styles.js +0 -35
- package/dist/components/conversation/message-parts/message-parts.class.d.ts +1 -1
- package/dist/components/conversation/message-parts/message-parts.styles.js +0 -5
- package/dist/components/conversation/model-select/model-select.class.js +3 -3
- package/dist/components/conversation/model-select/model-select.styles.js +12 -47
- package/dist/components/conversation/model-settings-panel/model-settings-panel.styles.js +0 -6
- package/dist/components/conversation/prompt-input/prompt-input.class.d.ts +3 -0
- package/dist/components/conversation/prompt-input/prompt-input.styles.js +0 -10
- package/dist/components/conversation/push-to-talk/push-to-talk.styles.js +0 -8
- package/dist/components/conversation/realtime-session/realtime-session.styles.js +1 -1
- package/dist/components/conversation/selection-toolbar/selection-toolbar.styles.js +1 -11
- package/dist/components/conversation/stream-status/stream-status.styles.js +0 -16
- package/dist/components/conversation/streaming-text/streaming-text.styles.js +0 -15
- package/dist/components/conversation/suggestion-chips/suggestion-chips.styles.js +0 -5
- package/dist/components/conversation/thread-list/thread-list.styles.js +5 -19
- package/dist/components/conversation/transcript-feed/transcript-feed.class.d.ts +16 -4
- package/dist/components/conversation/transcript-feed/transcript-feed.class.js +1 -1
- package/dist/components/conversation/transcript-feed/transcript-feed.styles.js +0 -1
- package/dist/components/conversation/typing-indicator/typing-indicator.styles.js +0 -23
- package/dist/components/conversation/usage-badge/usage-badge.class.js +1 -1
- package/dist/components/conversation/usage-badge/usage-badge.styles.js +0 -3
- package/dist/components/conversation/voice-picker/voice-picker.class.js +3 -3
- package/dist/components/conversation/voice-picker/voice-picker.styles.js +9 -29
- package/dist/components/conversation/widget-renderer/resolve.d.ts +2 -0
- package/dist/components/conversation/widget-renderer/resolve.js +1 -1
- package/dist/components/data/calendar/calendar.class.d.ts +15 -2
- package/dist/components/data/calendar/calendar.class.js +2 -2
- package/dist/components/data/calendar/calendar.styles.js +2 -28
- package/dist/components/data/condition-builder/condition-builder.class.d.ts +10 -6
- package/dist/components/data/condition-builder/condition-builder.class.js +2 -2
- package/dist/components/data/condition-builder/condition-builder.styles.js +0 -6
- package/dist/components/data/context-meter/context-meter.styles.js +0 -24
- package/dist/components/data/data-grid/data-grid.class.js +3 -3
- package/dist/components/data/data-grid/data-grid.styles.js +0 -22
- package/dist/components/data/document-library/document-library.class.js +2 -2
- package/dist/components/data/document-library/document-library.styles.js +0 -4
- package/dist/components/data/env-list/env-list.class.js +1 -1
- package/dist/components/data/env-list/env-list.styles.js +7 -4
- package/dist/components/data/file-tree/file-tree.class.d.ts +12 -0
- package/dist/components/data/file-tree/file-tree.class.js +1 -1
- package/dist/components/data/flow-canvas/flow-canvas.styles.js +12 -19
- package/dist/components/data/flow-controls/flow-controls.class.js +2 -2
- package/dist/components/data/flow-controls/flow-controls.styles.js +3 -36
- package/dist/components/data/flow-minimap/flow-minimap.class.js +1 -1
- package/dist/components/data/flow-minimap/flow-minimap.styles.js +0 -9
- package/dist/components/data/flow-node/flow-node.styles.js +0 -23
- package/dist/components/data/flow-run-status/flow-run-status.class.js +1 -1
- package/dist/components/data/flow-run-status/flow-run-status.styles.js +0 -7
- package/dist/components/data/graph-query-builder/graph-query-builder.class.d.ts +0 -7
- package/dist/components/data/graph-query-builder/graph-query-builder.class.js +1 -1
- package/dist/components/data/graph-query-builder/graph-query-builder.styles.js +0 -10
- package/dist/components/data/heatmap/heatmap-scale.d.ts +20 -0
- package/dist/components/data/heatmap/heatmap-scale.js +1 -1
- package/dist/components/data/heatmap/heatmap.class.d.ts +85 -2
- package/dist/components/data/heatmap/heatmap.class.js +2 -2
- package/dist/components/data/heatmap/heatmap.styles.js +0 -54
- package/dist/components/data/pagination/pagination.class.js +1 -1
- package/dist/components/data/pagination/pagination.styles.js +23 -46
- package/dist/components/data/sequence-strip/sequence-strip.class.d.ts +34 -1
- package/dist/components/data/sequence-strip/sequence-strip.class.js +5 -2
- package/dist/components/data/sequence-strip/sequence-strip.styles.js +14 -20
- package/dist/components/data/sparkline/sparkline.class.js +1 -1
- package/dist/components/data/stat/stat.styles.js +0 -67
- package/dist/components/data/table/table.class.d.ts +42 -3
- package/dist/components/data/table/table.class.js +4 -4
- package/dist/components/data/table/table.styles.js +20 -91
- package/dist/components/data/timeline/timeline-item.styles.js +0 -30
- package/dist/components/data/timeline/timeline.class.d.ts +89 -1
- package/dist/components/data/timeline/timeline.class.js +2 -2
- package/dist/components/data/timeline/timeline.styles.js +111 -31
- package/dist/components/data/tree/tree-item.styles.js +1 -28
- package/dist/components/data/tree/tree.class.js +2 -2
- package/dist/components/data/tree/tree.styles.js +0 -6
- package/dist/components/data/word-cloud/word-cloud.styles.js +0 -5
- package/dist/components/forms/button/button.class.js +1 -1
- package/dist/components/forms/button/button.styles.js +1 -106
- package/dist/components/forms/checkbox/checkbox.class.d.ts +3 -0
- package/dist/components/forms/checkbox/checkbox.class.js +1 -1
- package/dist/components/forms/checkbox/checkbox.styles.js +0 -39
- package/dist/components/forms/checkbox-group/checkbox-group.class.d.ts +21 -2
- package/dist/components/forms/checkbox-group/checkbox-group.class.js +1 -1
- package/dist/components/forms/checkbox-group/checkbox-group.styles.js +0 -18
- package/dist/components/forms/code-editor/code-editor.styles.js +0 -30
- package/dist/components/forms/color-picker/color-picker.class.js +2 -2
- package/dist/components/forms/color-picker/color-picker.styles.js +0 -69
- package/dist/components/forms/combobox/combobox.class.js +2 -2
- package/dist/components/forms/combobox/combobox.styles.js +22 -111
- package/dist/components/forms/combobox/option.styles.js +7 -1
- package/dist/components/forms/date-picker/date-input.class.js +1 -1
- package/dist/components/forms/date-picker/date-input.styles.js +12 -67
- package/dist/components/forms/date-picker/date-picker.class.d.ts +1 -0
- package/dist/components/forms/date-picker/date-picker.class.js +22 -20
- package/dist/components/forms/date-picker/date-picker.styles.js +36 -29
- package/dist/components/forms/emoji-picker/emoji-data-loader.d.ts +6 -3
- package/dist/components/forms/emoji-picker/emoji-data-loader.js +1 -1
- package/dist/components/forms/emoji-picker/emoji-picker.class.d.ts +8 -1
- package/dist/components/forms/emoji-picker/emoji-picker.class.js +1 -1
- package/dist/components/forms/emoji-picker/emoji-picker.styles.js +3 -41
- package/dist/components/forms/icon-button/icon-button.class.js +1 -1
- package/dist/components/forms/icon-button/icon-button.styles.js +0 -16
- package/dist/components/forms/input/input.styles.js +0 -54
- package/dist/components/forms/input/number-input.styles.d.ts +4 -5
- package/dist/components/forms/input/number-input.styles.js +0 -11
- package/dist/components/forms/input/time-input-shared.d.ts +11 -0
- package/dist/components/forms/input/time-input-shared.js +1 -1
- package/dist/components/forms/input/time-input.class.d.ts +11 -2
- package/dist/components/forms/input/time-input.class.js +1 -1
- package/dist/components/forms/input/time-input.styles.js +0 -6
- package/dist/components/forms/locale-picker/locale-picker.class.js +2 -2
- package/dist/components/forms/locale-picker/locale-picker.styles.js +1 -26
- package/dist/components/forms/otp-input/otp-input.class.js +3 -3
- package/dist/components/forms/otp-input/otp-input.styles.js +0 -16
- package/dist/components/forms/phone-input/phone-input.class.d.ts +9 -1
- package/dist/components/forms/phone-input/phone-input.class.js +2 -2
- package/dist/components/forms/phone-input/phone-input.styles.js +0 -37
- package/dist/components/forms/radio/radio-button.styles.js +1 -30
- package/dist/components/forms/radio/radio-group.styles.js +0 -4
- package/dist/components/forms/radio/radio.styles.js +0 -44
- package/dist/components/forms/rubric-form/rubric-form.styles.js +0 -5
- package/dist/components/forms/select/select.class.js +1 -1
- package/dist/components/forms/select/select.styles.js +14 -114
- package/dist/components/forms/slider/slider.styles.js +0 -55
- package/dist/components/forms/swatch-picker/swatch-picker.class.d.ts +0 -11
- package/dist/components/forms/swatch-picker/swatch-picker.class.js +2 -2
- package/dist/components/forms/swatch-picker/swatch-picker.styles.js +0 -77
- package/dist/components/forms/switch/switch.class.d.ts +3 -0
- package/dist/components/forms/switch/switch.class.js +1 -1
- package/dist/components/forms/switch/switch.styles.js +3 -38
- package/dist/components/forms/textarea/textarea.styles.js +0 -28
- package/dist/components/forms/time-range/time-range.styles.js +12 -84
- package/dist/components/forms/token-input/token-input.class.d.ts +23 -9
- package/dist/components/forms/token-input/token-input.class.js +1 -1
- package/dist/components/forms/token-input/token-input.styles.js +1 -54
- package/dist/components/layout/app-rail/app-rail-item.class.js +2 -2
- package/dist/components/layout/app-rail/app-rail-item.styles.js +0 -13
- package/dist/components/layout/app-rail/app-rail.class.d.ts +5 -0
- package/dist/components/layout/app-rail/app-rail.class.js +1 -1
- package/dist/components/layout/app-rail/app-rail.styles.js +0 -46
- package/dist/components/layout/button-group/button-group.styles.js +0 -6
- package/dist/components/layout/card/card.class.d.ts +12 -0
- package/dist/components/layout/card/card.styles.js +5 -13
- package/dist/components/layout/carousel/carousel.styles.js +0 -1
- package/dist/components/layout/command-palette/command-palette.class.d.ts +8 -0
- package/dist/components/layout/command-palette/command-palette.class.js +3 -1
- package/dist/components/layout/command-palette/command-palette.styles.js +1 -13
- package/dist/components/layout/control-group/control-group.styles.js +0 -7
- package/dist/components/layout/dashboard-grid/dashboard-grid.class.js +1 -1
- package/dist/components/layout/dashboard-grid/dashboard-grid.styles.js +6 -25
- package/dist/components/layout/details/accordion.class.d.ts +13 -0
- package/dist/components/layout/details/accordion.class.js +1 -1
- package/dist/components/layout/details/details.class.js +1 -1
- package/dist/components/layout/details/details.styles.js +0 -12
- package/dist/components/layout/dock-panel/dock-panel.styles.js +0 -45
- package/dist/components/layout/drilldown-panel/drilldown-panel.class.d.ts +2 -0
- package/dist/components/layout/drilldown-panel/drilldown-panel.class.js +2 -2
- package/dist/components/layout/drilldown-panel/drilldown-panel.styles.js +0 -4
- package/dist/components/layout/filter-bar/filter-bar.class.js +1 -1
- package/dist/components/layout/filter-bar/filter-bar.styles.js +0 -9
- package/dist/components/layout/menu/menu-item.class.d.ts +5 -0
- package/dist/components/layout/menu/menu-item.class.js +1 -1
- package/dist/components/layout/menu/menu-item.styles.js +0 -49
- package/dist/components/layout/menu/menu-label.styles.js +0 -2
- package/dist/components/layout/menu/menu.styles.js +0 -18
- package/dist/components/layout/multi-split/multi-split.class.js +1 -1
- package/dist/components/layout/multi-split/multi-split.styles.js +8 -51
- package/dist/components/layout/page/page.class.d.ts +4 -0
- package/dist/components/layout/page/page.class.js +1 -1
- package/dist/components/layout/reorder-list/reorder-item.styles.js +0 -4
- package/dist/components/layout/responsive-panel/responsive-panel.styles.js +0 -27
- package/dist/components/layout/scroller/scroller.styles.js +0 -20
- package/dist/components/layout/segmented/segmented.class.d.ts +7 -1
- package/dist/components/layout/segmented/segmented.class.js +1 -1
- package/dist/components/layout/segmented/segmented.styles.js +69 -37
- package/dist/components/layout/split-panel/split-panel.styles.js +1 -7
- package/dist/components/layout/stepper/stepper.class.d.ts +8 -1
- package/dist/components/layout/stepper/stepper.class.js +1 -1
- package/dist/components/layout/stepper/stepper.styles.js +140 -41
- package/dist/components/layout/tab-group/tab-group.class.d.ts +4 -1
- package/dist/components/layout/tab-group/tab-group.styles.js +9 -75
- package/dist/components/layout/tab-group/tab.styles.js +0 -2
- package/dist/components/layout/virtual-list/virtual-list.class.d.ts +4 -4
- package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
- package/dist/components/layout/virtual-list/virtual-list.styles.js +0 -68
- package/dist/components/layout/widget/widget.class.d.ts +5 -1
- package/dist/components/layout/widget/widget.class.js +1 -1
- package/dist/components/layout/widget/widget.styles.js +97 -40
- package/dist/components/media/animated-image/animated-image.class.d.ts +3 -0
- package/dist/components/media/animated-image/animated-image.class.js +1 -1
- package/dist/components/media/animated-image/animated-image.styles.js +0 -28
- package/dist/components/media/attachment-chip/attachment-chip.class.d.ts +1 -1
- package/dist/components/media/attachment-chip/attachment-chip.class.js +2 -2
- package/dist/components/media/attachment-chip/attachment-chip.styles.js +0 -31
- package/dist/components/media/attachment-trigger/attachment-trigger.class.d.ts +1 -1
- package/dist/components/media/attachment-trigger/attachment-trigger.class.js +4 -4
- package/dist/components/media/attachment-trigger/attachment-trigger.styles.js +0 -40
- package/dist/components/media/av-player/av-player.class.d.ts +5 -6
- package/dist/components/media/av-player/av-player.class.js +1 -1
- package/dist/components/media/av-player/av-player.styles.js +0 -45
- package/dist/components/media/avatar/avatar.styles.js +3 -16
- package/dist/components/media/file-icon/file-icon.class.d.ts +1 -2
- package/dist/components/media/file-icon/file-icon.class.js +1 -1
- package/dist/components/media/file-input/file-input.class.d.ts +12 -0
- package/dist/components/media/file-input/file-input.class.js +1 -1
- package/dist/components/media/file-input/file-input.styles.js +3 -24
- package/dist/components/media/flag/flag.class.d.ts +20 -0
- package/dist/components/media/flag/flag.class.js +4 -2
- package/dist/components/media/flag/flag.styles.js +7 -1
- package/dist/components/media/flag/language-map.d.ts +10 -0
- package/dist/components/media/flag/language-map.js +1 -1
- package/dist/components/media/image-comparer/image-comparer.styles.js +4 -33
- package/dist/components/media/image-viewer/image-viewer.class.js +0 -2
- package/dist/components/media/image-viewer/image-viewer.styles.js +7 -27
- package/dist/components/media/lightbox/lightbox.class.js +0 -2
- package/dist/components/media/lightbox/lightbox.styles.js +2 -21
- package/dist/components/media/map/map-loader.d.ts +19 -1
- package/dist/components/media/map/map-loader.js +1 -1
- package/dist/components/media/map/map.class.d.ts +141 -1
- package/dist/components/media/map/map.class.js +15 -3
- package/dist/components/media/map/map.styles.js +20 -17
- package/dist/components/media/media-card/media-card.class.d.ts +14 -3
- package/dist/components/media/media-card/media-card.class.js +1 -1
- package/dist/components/media/media-card/media-card.styles.js +2 -28
- package/dist/components/media/pan-zoom/pan-zoom.styles.js +0 -3
- package/dist/components/media/qr-code/qr-code.class.d.ts +3 -2
- package/dist/components/media/qr-code/qr-code.class.js +2 -2
- package/dist/components/media/qr-code/qr-code.styles.js +0 -3
- package/dist/components/media/sequence-playback/sequence-playback.class.d.ts +2 -0
- package/dist/components/media/sequence-playback/sequence-playback.class.js +2 -1
- package/dist/components/media/sequence-playback/sequence-playback.styles.js +0 -19
- package/dist/components/media/video/video.class.d.ts +23 -2
- package/dist/components/media/video/video.class.js +3 -3
- package/dist/components/media/video/video.styles.js +4 -2
- package/dist/components/media/zoomable-frame/zoomable-frame.class.d.ts +3 -2
- package/dist/components/media/zoomable-frame/zoomable-frame.class.js +2 -2
- package/dist/components/media/zoomable-frame/zoomable-frame.styles.js +0 -5
- package/dist/components/overlays/alert/alert.styles.js +4 -2
- package/dist/components/overlays/badge/badge.styles.js +4 -48
- package/dist/components/overlays/badge/tag.styles.js +0 -14
- package/dist/components/overlays/callout/callout.styles.js +2 -13
- package/dist/components/overlays/chip/chip-group.styles.js +0 -18
- package/dist/components/overlays/chip/chip.styles.js +6 -69
- package/dist/components/overlays/dialog/confirm.d.ts +1 -4
- package/dist/components/overlays/dialog/confirm.js +1 -1
- package/dist/components/overlays/dialog/dialog.class.d.ts +12 -9
- package/dist/components/overlays/dialog/dialog.class.js +1 -1
- package/dist/components/overlays/dialog/dialog.styles.js +0 -43
- package/dist/components/overlays/drawer/drawer.class.d.ts +2 -2
- package/dist/components/overlays/drawer/drawer.styles.js +0 -9
- package/dist/components/overlays/empty/empty.styles.js +0 -12
- package/dist/components/overlays/kbd/kbd.class.js +1 -1
- package/dist/components/overlays/kbd/kbd.styles.js +0 -8
- package/dist/components/overlays/overlay/dropdown.class.d.ts +1 -6
- package/dist/components/overlays/overlay/dropdown.class.js +2 -2
- package/dist/components/overlays/overlay/overlay.styles.js +0 -28
- package/dist/components/overlays/overlay/popover.class.d.ts +9 -1
- package/dist/components/overlays/overlay/popover.class.js +2 -2
- package/dist/components/overlays/overlay/tooltip.class.d.ts +10 -0
- package/dist/components/overlays/overlay/tooltip.class.js +2 -2
- package/dist/components/overlays/popup/popup.class.d.ts +1 -0
- package/dist/components/overlays/popup/popup.class.js +2 -2
- package/dist/components/overlays/popup/popup.styles.js +0 -15
- package/dist/components/overlays/progress/progress-ring.class.d.ts +9 -1
- package/dist/components/overlays/progress/progress-ring.class.js +3 -3
- package/dist/components/overlays/progress/progress.styles.js +0 -21
- package/dist/components/overlays/rating/rating.styles.js +0 -25
- package/dist/components/overlays/skeleton/skeleton.styles.js +0 -4
- package/dist/components/overlays/spinner/spinner.styles.js +2 -5
- package/dist/components/overlays/toast/toast-item.styles.js +3 -45
- package/dist/components/retrieval/chunk-inspector/chunk-inspector.styles.js +0 -35
- package/dist/components/retrieval/citation-badge/citation-badge.class.d.ts +2 -2
- package/dist/components/retrieval/citation-badge/citation-badge.class.js +3 -3
- package/dist/components/retrieval/citation-badge/citation-badge.styles.js +0 -20
- package/dist/components/retrieval/claim-evidence/claim-evidence.class.js +1 -1
- package/dist/components/retrieval/claim-evidence/claim-evidence.styles.js +0 -8
- package/dist/components/retrieval/community-card/community-card.class.d.ts +1 -0
- package/dist/components/retrieval/community-card/community-card.styles.js +0 -6
- package/dist/components/retrieval/embedding-explorer/embedding-explorer.styles.js +8 -12
- package/dist/components/retrieval/entity-card/entity-card.class.d.ts +4 -3
- package/dist/components/retrieval/entity-card/entity-card.class.js +1 -1
- package/dist/components/retrieval/entity-card/entity-card.styles.js +0 -12
- package/dist/components/retrieval/entity-chip/entity-chip.class.d.ts +10 -4
- package/dist/components/retrieval/entity-chip/entity-chip.class.js +3 -3
- package/dist/components/retrieval/entity-chip/entity-chip.styles.js +6 -9
- package/dist/components/retrieval/entity-dossier/entity-dossier.class.d.ts +19 -5
- package/dist/components/retrieval/entity-dossier/entity-dossier.class.js +1 -1
- package/dist/components/retrieval/graph/graph.class.d.ts +5 -0
- package/dist/components/retrieval/graph/graph.class.js +1 -1
- package/dist/components/retrieval/graph/graph.styles.js +0 -30
- package/dist/components/retrieval/graph-legend/graph-legend.styles.js +0 -3
- package/dist/components/retrieval/grounding-summary/grounding-summary.class.js +2 -2
- package/dist/components/retrieval/ingestion-queue/ingestion-queue.styles.js +0 -25
- package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.class.d.ts +2 -0
- package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.styles.js +0 -7
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +20 -6
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +2 -2
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.styles.js +6 -11
- package/dist/components/retrieval/memory-panel/memory-panel.class.js +1 -1
- package/dist/components/retrieval/mind-map/mind-map.class.d.ts +5 -3
- package/dist/components/retrieval/mind-map/mind-map.class.js +1 -1
- package/dist/components/retrieval/mind-map/mind-map.styles.js +0 -2
- package/dist/components/retrieval/neighbor-list/neighbor-list.class.d.ts +3 -2
- package/dist/components/retrieval/neighbor-list/neighbor-list.class.js +1 -1
- package/dist/components/retrieval/neighbor-list/neighbor-list.styles.js +0 -30
- package/dist/components/retrieval/node-palette/node-palette.styles.js +0 -11
- package/dist/components/retrieval/path-strip/path-strip.styles.js +0 -10
- package/dist/components/retrieval/provenance-panel/provenance-panel.class.d.ts +12 -3
- package/dist/components/retrieval/provenance-panel/provenance-panel.class.js +1 -1
- package/dist/components/retrieval/provenance-panel/provenance-panel.styles.js +0 -2
- package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.d.ts +3 -2
- package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.js +2 -2
- package/dist/components/retrieval/retrieval-results/retrieval-results.styles.js +0 -28
- package/dist/components/retrieval/retrieval-search/retrieval-search.styles.js +0 -4
- package/dist/components/retrieval/retrieval-trace/retrieval-trace.class.js +1 -1
- package/dist/components/retrieval/retrieval-trace/retrieval-trace.styles.js +0 -2
- package/dist/components/retrieval/source-card/source-card.styles.js +0 -13
- package/dist/components/retrieval/source-list/source-list.styles.js +0 -7
- package/dist/components/retrieval/source-picker/source-picker.class.js +1 -1
- package/dist/components/retrieval/source-picker/source-picker.styles.js +0 -7
- package/dist/components/utility/copy-button/copy-button.styles.js +0 -10
- package/dist/components/utility/diff-view/diff-view.styles.js +0 -14
- package/dist/components/utility/export-button/export-button.styles.js +0 -22
- package/dist/components/utility/icon/icon.styles.js +0 -6
- package/dist/components/utility/json-viewer/json-viewer.styles.js +2 -48
- package/dist/components/utility/known-date/known-date.class.d.ts +7 -3
- package/dist/components/utility/known-date/known-date.styles.js +10 -51
- package/dist/components/utility/live-region/live-region.styles.js +0 -4
- package/dist/components/utility/mention-popover/mention-popover.styles.js +0 -25
- package/dist/components/utility/poll-status/poll-status.styles.js +0 -4
- package/dist/components/utility/random-content/random-content.class.d.ts +22 -0
- package/dist/components/utility/random-content/random-content.class.js +3 -2
- package/dist/components/utility/random-content/random-content.styles.js +6 -13
- package/dist/components/utility/tour/tour.class.d.ts +4 -2
- package/dist/components/utility/tour/tour.class.js +3 -3
- package/dist/components/utility/tour/tour.styles.js +0 -13
- package/dist/components/utility/visually-hidden/visually-hidden.styles.js +0 -5
- package/dist/components/viewers/archive-viewer/archive-viewer.class.js +1 -1
- package/dist/components/viewers/archive-viewer/archive-viewer.styles.d.ts +2 -2
- package/dist/components/viewers/archive-viewer/archive-viewer.styles.js +0 -10
- package/dist/components/viewers/contact-viewer/contact-viewer.class.js +1 -1
- package/dist/components/viewers/csv-viewer/csv-viewer.class.js +1 -1
- package/dist/components/viewers/csv-viewer/csv-viewer.styles.js +0 -19
- package/dist/components/viewers/dataset-viewer/dataset-viewer.class.js +1 -1
- package/dist/components/viewers/dataset-viewer/dataset-viewer.styles.js +0 -15
- package/dist/components/viewers/document-compare/document-compare.class.js +1 -1
- package/dist/components/viewers/document-compare/document-compare.styles.js +0 -3
- package/dist/components/viewers/document-preview/document-preview.styles.js +0 -25
- package/dist/components/viewers/document-viewer/document-viewer.class.d.ts +2 -1
- package/dist/components/viewers/document-viewer/document-viewer.class.js +1 -1
- package/dist/components/viewers/document-viewer/document-viewer.styles.js +0 -5
- package/dist/components/viewers/docx-viewer/docx-viewer.styles.js +0 -17
- package/dist/components/viewers/ebook-viewer/ebook-viewer.class.js +1 -1
- package/dist/components/viewers/ebook-viewer/ebook-viewer.styles.js +0 -4
- package/dist/components/viewers/email-viewer/email-viewer.styles.js +0 -7
- package/dist/components/viewers/geojson-view/geojson-view.styles.js +0 -5
- package/dist/components/viewers/highlight-layer/highlight-layer.styles.js +0 -3
- package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +1 -1
- package/dist/components/viewers/notebook-viewer/notebook-viewer.styles.js +0 -38
- package/dist/components/viewers/page-rail/page-rail.class.js +1 -1
- package/dist/components/viewers/page-rail/page-rail.styles.js +0 -13
- package/dist/components/viewers/pdf-viewer/pdf-loader.d.ts +13 -2
- package/dist/components/viewers/pdf-viewer/pdf-loader.js +1 -1
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts +32 -2
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +4 -4
- package/dist/components/viewers/pdf-viewer/pdf-viewer.styles.js +1 -27
- package/dist/components/viewers/pptx-viewer/pptx-viewer.styles.js +0 -3
- package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.js +1 -1
- package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.styles.js +0 -14
- package/dist/components/viewers/svg-viewer/svg-viewer.styles.js +0 -7
- package/dist/components/viewers/xml-viewer/xml-viewer.styles.js +2 -24
- package/dist/custom-elements-jsx.d.ts +56 -37
- package/dist/events.d.ts +43 -33
- package/dist/internal/agent-status-variants.d.ts +18 -0
- package/dist/internal/agent-status-variants.js +1 -0
- package/dist/internal/announcer.d.ts +8 -3
- package/dist/internal/announcer.js +1 -1
- package/dist/internal/autoloader-manifest.js +1 -1
- package/dist/internal/canvas-color.d.ts +16 -0
- package/dist/internal/canvas-color.js +1 -1
- package/dist/internal/catalog-picker.d.ts +0 -1
- package/dist/internal/catalog-picker.js +1 -1
- package/dist/internal/default-strings.generated.d.ts +1 -0
- package/dist/internal/default-strings.generated.js +1 -1
- package/dist/internal/dev-mode-attribute-warning.d.ts +30 -0
- package/dist/internal/dev-mode-attribute-warning.js +1 -0
- 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/lyra-element.d.ts +13 -0
- package/dist/internal/lyra-element.js +1 -1
- package/dist/internal/media-controller.js +1 -1
- package/dist/internal/package-metadata.d.ts +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/scroll-overflow.d.ts +35 -13
- package/dist/internal/scroll-overflow.js +1 -1
- package/dist/internal/sizes.styles.js +0 -2
- package/dist/internal/specialist-tokens.styles.js +6 -11
- package/dist/internal/text-highlights.d.ts +4 -1
- package/dist/internal/text-highlights.js +1 -1
- package/dist/internal/tokens/palette.styles.js +0 -15
- package/dist/internal/tokens.styles.js +19 -113
- package/dist/lyra.d.ts +8 -5
- package/dist/styles/reservations.css +82 -0
- package/dist/svelte.d.ts +56 -37
- package/dist/translations/ar.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/pt-BR.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/zh-CN.js +1 -1
- package/dist/vue.d.ts +56 -37
- package/llms/components/lr-accordion-item.md +12 -3
- package/llms/components/lr-accordion.md +11 -2
- package/llms/components/lr-agent-eval-dashboard.md +1 -1
- package/llms/components/lr-agent-trace.md +3 -1
- package/llms/components/lr-agent-workspace.md +20 -0
- package/llms/components/lr-artifact-panel.md +10 -4
- package/llms/components/lr-attachment-chip.md +7 -4
- package/llms/components/lr-attachment-trigger.md +9 -6
- package/llms/components/lr-av-player.md +3 -1
- package/llms/components/lr-avatar.md +6 -6
- package/llms/components/lr-bar-chart.md +4 -3
- package/llms/components/lr-box-plot.md +1 -1
- package/llms/components/lr-browser-frame.md +7 -3
- package/llms/components/lr-bubble-chart.md +4 -3
- package/llms/components/lr-calendar.md +9 -2
- package/llms/components/lr-card.md +24 -0
- package/llms/components/lr-chart.md +32 -8
- package/llms/components/lr-chat-viewport.md +7 -2
- package/llms/components/lr-checkbox-group.md +13 -5
- package/llms/components/lr-checkbox.md +5 -2
- package/llms/components/lr-checkpoint.md +6 -2
- package/llms/components/lr-combobox.md +5 -2
- package/llms/components/lr-command-palette.md +4 -1
- package/llms/components/lr-confirm-bar.md +7 -3
- package/llms/components/lr-context-meter.md +12 -11
- package/llms/components/lr-conversation-item.md +7 -4
- package/llms/components/lr-details.md +11 -2
- package/llms/components/lr-dialog.md +15 -10
- package/llms/components/lr-dock-panel.md +7 -10
- package/llms/components/lr-document-preview.md +6 -1
- package/llms/components/lr-document-viewer.md +3 -2
- package/llms/components/lr-doughnut-chart.md +4 -3
- package/llms/components/lr-drawer.md +3 -3
- package/llms/components/lr-entity-card.md +3 -3
- package/llms/components/lr-entity-chip.md +1 -1
- package/llms/components/lr-entity-dossier.md +4 -1
- package/llms/components/lr-file-input.md +2 -2
- package/llms/components/lr-flag.md +20 -5
- package/llms/components/lr-heatmap.md +29 -1
- package/llms/components/lr-histogram.md +3 -1
- package/llms/components/lr-icon.md +1 -1
- package/llms/components/lr-json-schema-viewer.md +2 -1
- package/llms/components/lr-knowledge-graph-explorer.md +8 -3
- package/llms/components/lr-known-date.md +4 -2
- package/llms/components/lr-line-chart.md +4 -3
- package/llms/components/lr-lite-chart.md +16 -6
- package/llms/components/lr-map.md +72 -8
- package/llms/components/lr-markdown-core.md +3 -2
- package/llms/components/lr-media-card.md +28 -12
- package/llms/components/lr-message-parts.md +2 -1
- package/llms/components/lr-model-select.md +9 -10
- package/llms/components/lr-model-settings-panel.md +9 -9
- package/llms/components/lr-neighbor-list.md +1 -1
- package/llms/components/lr-notebook-viewer.md +6 -3
- package/llms/components/lr-option.md +5 -2
- package/llms/components/lr-pdf-viewer.md +62 -2
- package/llms/components/lr-pie-chart.md +4 -3
- package/llms/components/lr-polar-area-chart.md +4 -3
- package/llms/components/lr-popover.md +5 -0
- package/llms/components/lr-progress-ring.md +8 -1
- package/llms/components/lr-prompt-studio.md +1 -1
- package/llms/components/lr-provenance-panel.md +4 -2
- package/llms/components/lr-qr-code.md +1 -1
- package/llms/components/lr-radar-chart.md +4 -3
- package/llms/components/lr-rag-eval-dashboard.md +2 -2
- package/llms/components/lr-random-content.md +13 -0
- package/llms/components/lr-reorder-item.md +6 -1
- package/llms/components/lr-reorder-list.md +6 -1
- package/llms/components/lr-responsive-panel.md +11 -7
- package/llms/components/lr-scatter-chart.md +4 -3
- package/llms/components/lr-sequence-strip.md +16 -2
- package/llms/components/lr-slider.md +12 -5
- package/llms/components/lr-sparkline.md +1 -1
- package/llms/components/lr-suggestion-chips.md +7 -2
- package/llms/components/lr-swatch-picker.md +5 -5
- package/llms/components/lr-switch.md +5 -2
- package/llms/components/lr-table.md +30 -4
- package/llms/components/lr-terminal.md +3 -1
- package/llms/components/lr-thread-list.md +8 -8
- package/llms/components/lr-time-input.md +6 -1
- package/llms/components/lr-timeline-item.md +24 -0
- package/llms/components/lr-timeline.md +25 -1
- package/llms/components/lr-token-input.md +7 -2
- package/llms/components/lr-tool-approval-dialog.md +7 -8
- package/llms/components/lr-tool-call-chip.md +5 -1
- package/llms/components/lr-tool-param-form.md +14 -12
- package/llms/components/lr-tool-result-dialog.md +11 -9
- package/llms/components/lr-tool-result-view.md +7 -6
- package/llms/components/lr-tool-select-dialog.md +18 -16
- package/llms/components/lr-trace-tree.md +3 -1
- package/llms/components/lr-usage-badge.md +4 -1
- package/llms/components/lr-video-playlist.md +1 -1
- package/llms/components/lr-virtual-list.md +22 -14
- package/llms/components/lr-voice-picker.md +8 -5
- package/llms/components/lr-widget-renderer.md +3 -3
- package/llms/components/lr-widget.md +1 -1
- package/llms/components/lr-word-cloud.md +6 -2
- package/llms/index.md +1 -1
- package/llms/peers.md +13 -3
- package/llms/shared.md +83 -2
- package/llms-full.txt +1159 -288
- package/package.json +19 -7
- package/vscode-css-data.json +37 -2
- package/vscode-html-data.json +402 -45
- package/web-types.json +300 -56
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,query}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{activateOverlay}from"../../../internal/overlay-manager.js";import{isRtl}from"../../../internal/rtl.js";import{finiteRange}from"../../../internal/numbers.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}from"../../../internal/default-strings.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","position","inset-block","inset-inline-start","inset-inline-end","inline-size"];class LyraMultiSplit extends LyraElement{constructor(){super(...arguments),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.open=!1,this.panelCount=0,this.sizesReconciledForMembership=!1,this._collapseState="wide",this._forced=!1,this.overlayActive=!1,this.justOpened=!1,this.drags=new Map,this.ownedPanels=[],this.panelOwnership=new Map,this.panelOwnershipObserverGeneration=0,this.constraintIssueKey="",this.initializedSizes=!1,this.measuredInlineSize=Number.POSITIVE_INFINITY,this._effectiveOrientation="horizontal",this.collapseObserverGeneration=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.onPointerDown=(e,index)=>{if(e.button!==0||this.isDividerDisabled(index))return;const divider=e.currentTarget,ownerWindow=divider.ownerDocument.defaultView;ownerWindow&&(this.drags.size>0&&this.dragOwnerWindow!==ownerWindow||(this.drags.set(e.pointerId,{index,startPos:this.effectiveOrientation==="vertical"?e.clientY:e.clientX,base:this.baseEl,appliedDelta:0,acceptedResize:!1}),divider.setPointerCapture(e.pointerId),this.drags.size===1&&(this.dragOwnerWindow=ownerWindow,ownerWindow.addEventListener("pointermove",this.onPointerMove),ownerWindow.addEventListener("pointerup",this.onPointerUp),ownerWindow.addEventListener("pointercancel",this.onPointerUp),ownerWindow.addEventListener("lostpointercapture",this.onPointerUp))))},this.onPointerMove=e=>{const drag=this.drags.get(e.pointerId);if(!drag)return;if(this.isDividerDisabled(drag.index)){this.endDragGestures();return}const total=this.effectiveOrientation==="vertical"?drag.base.clientHeight:drag.base.clientWidth;if(!Number.isFinite(total)||total<=0){this.endDragGestures();return}let cumulativeDelta=((this.effectiveOrientation==="vertical"?e.clientY:e.clientX)-drag.startPos)/total*100;this.effectiveOrientation==="horizontal"&&isRtl(this)&&(cumulativeDelta=-cumulativeDelta);const incremental=cumulativeDelta-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.persist(),this.drags.size===0&&this.removeDragListeners())},this.onDividerKeyDown=(e,index)=>{if(this.isDividerDisabled(index))return;const rtl=this.effectiveOrientation==="horizontal"&&isRtl(this),forwardKey=this.effectiveOrientation==="vertical"?"ArrowDown":rtl?"ArrowLeft":"ArrowRight",backwardKey=this.effectiveOrientation==="vertical"?"ArrowUp":rtl?"ArrowRight":"ArrowLeft";e.key===forwardKey?this.applyDelta(index,KEYBOARD_STEP,!0)&&e.preventDefault():e.key===backwardKey&&this.applyDelta(index,-KEYBOARD_STEP,!0)&&e.preventDefault()}}static{this.defaultStrings={...super.defaultStrings,resizeDivider:LYRA_DEFAULT_resizeDivider}}static{this.ownedCollectionProperties=Object.freeze(["sizes","defaultSizes","panelConstraints"])}static{this.styles=[LyraElement.styles,styles]}static{this.immutableEventDetails=Object.freeze(["lr-resize-request","lr-resize"])}static{this.properties={collapseState:{reflect:!0,attribute:"collapse-state",noAccessor:!0}}}connectedCallback(){super.connectedCallback();const hostWidth=this.getBoundingClientRect().width;hostWidth>0&&(this.measuredInlineSize=hostWidth),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.overlayHandle?.focusInitial()))}disconnectedCallback(){super.disconnectedCallback(),this.endDragGestures(),this.resetCollapseObserver(),this.overlayHandle?.suspend(),this.releaseOwnedPanels()}adoptedCallback(){super.adoptedCallback(),this.endDragGestures(),this.resetCollapseObserver(),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),(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())}}get collapseState(){return this.effectiveCollapseStateFor(this.collapse)}set collapseState(next){if(next==="auto"){this._forced=!1,this.updateCollapseState(this.currentMeasuredWidth());return}this._forced=!0,this.setRequestedCollapseState(next)}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}))}currentMeasuredWidth(){return this.baseEl?.clientWidth??0}effectiveCollapseStateFor(collapse){return collapse!=="none"&&this.panelCount>=2?this._collapseState:"wide"}applyEffectiveCollapseTransition(previous,next,shouldEmit=!0){previous!==next&&(this.endDragGestures(),this.requestUpdate("collapseState",previous),shouldEmit&&this.emit("lr-multi-split-collapse-change",{state:next}),next!=="floating"&&this.open&&(this.open=!1))}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.loadPersisted()||this.validInitialSizes(this.sizes))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.panelOwnershipObserverGeneration+=1,this.panelOwnershipObserver?.disconnect(),this.panelOwnershipObserver=void 0,this.panelOwnershipObserverDocument=void 0}observeOwnedPanels(){this.resetPanelOwnershipObserver();const ownerDocument=this.ownerDocument,MutationObserverConstructor=ownerDocument.defaultView?.MutationObserver;if(!MutationObserverConstructor||!this.isConnected||this.ownedPanels.length===0)return;const generation=this.panelOwnershipObserverGeneration,observer=new MutationObserverConstructor(records=>{if(this.panelOwnershipObserver!==observer||this.panelOwnershipObserverDocument!==this.ownerDocument||this.panelOwnershipObserverGeneration!==generation||!this.isConnected)return;records.some(record=>{const panel=record.target,snapshot=this.panelOwnership.get(panel);return snapshot?this.panelProjectionDiverged(panel,snapshot):!1})&&this.requestUpdate()});this.panelOwnershipObserver=observer,this.panelOwnershipObserverDocument=ownerDocument;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];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}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){this.collapse!=="none"&&(this._forced||this.setRequestedCollapseState(this.collapseBreakpoints.classify(width),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}}}percentBounds(index,containerSize){return this.resolveConstraintBounds(containerSize).bounds[index]??{min:0,max:1/0}}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,a=this.percentBounds(i,containerSize),b=this.percentBounds(i+1,containerSize),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.persist(),!0)}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.overlayHandle=activateOverlay({host:this,panel:()=>this.floatingPanelEl,onEscape:()=>this.open=!1,onBackdrop:()=>this.open=!1,lockScroll:!0,suspendWhenUnrendered:!0})}deactivateFloatingOverlay(){this.overlayHandle?.deactivate(),this.overlayHandle=void 0}removeDragListeners(){const ownerWindow=this.dragOwnerWindow;this.dragOwnerWindow=void 0,ownerWindow?.removeEventListener("pointermove",this.onPointerMove),ownerWindow?.removeEventListener("pointerup",this.onPointerUp),ownerWindow?.removeEventListener("pointercancel",this.onPointerUp),ownerWindow?.removeEventListener("lostpointercapture",this.onPointerUp)}endDragGestures(){this.drags.clear(),this.removeDragListeners()}updated(changed){super.updated(changed),(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");const constraintResolution=this.resolveConstraintBounds(this.getContainerSize()),issue=constraintResolution.issue,issueKey=issue?`${issue.reason}:${issue.panelCount}:${issue.minimumTotal}:${issue.maximumTotal??"unbounded"}`:"";issueKey!==this.constraintIssueKey&&(this.constraintIssueKey=issueKey,issue&&this.emit("lr-multi-split-constraints-invalid",issue));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,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;for(const property2 of["position","inset-block","inset-inline-start","inset-inline-end","inline-size"])this.applyOwnedPanelStyle(panel,snapshot,property2,snapshot.styles.get(property2));if(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,"flex","none"),this.applyOwnedPanelStyleValue(panel,snapshot,"position","absolute"),this.applyOwnedPanelStyleValue(panel,snapshot,"inset-block","0"),this.applyOwnedPanelStyleValue(panel,snapshot,collapsingIndex===0?"inset-inline-start":"inset-inline-end","0"),this.applyOwnedPanelStyleValue(panel,snapshot,"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"),this.justOpened&&(this.justOpened=!1,this.overlayHandle?.focusInitial())}render(){const dividers=[],bounds=this.resolveConstraintBounds(this.getContainerSize()).bounds;for(let i=0;i<this.panelCount-1;i++){const pairTotal=(this.sizes[i]??0)+(this.sizes[i+1]??0),a=bounds[i],b=bounds[i+1],valueMin=Math.max(a.min,pairTotal-b.max),valueMax=Math.max(valueMin,Math.min(a.max,pairTotal-b.min)),disabled=this.isDividerDisabled(i);dividers.push(html`<div
|
|
1
|
+
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,query}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{activateOverlay}from"../../../internal/overlay-manager.js";import{isRtl}from"../../../internal/rtl.js";import{finiteRange}from"../../../internal/numbers.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}from"../../../internal/default-strings.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"];class LyraMultiSplit extends LyraElement{constructor(){super(...arguments),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.open=!1,this.panelCount=0,this.sizesReconciledForMembership=!1,this._collapseState="wide",this._forced=!1,this.overlayActive=!1,this.justOpened=!1,this.drags=new Map,this.ownedPanels=[],this.panelOwnership=new Map,this.panelOwnershipObserverGeneration=0,this.constraintIssueKey="",this.initializedSizes=!1,this.measuredInlineSize=Number.POSITIVE_INFINITY,this._effectiveOrientation="horizontal",this.collapseObserverGeneration=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.onPointerDown=(e,index)=>{if(e.button!==0||this.isDividerDisabled(index))return;const divider=e.currentTarget,ownerWindow=divider.ownerDocument.defaultView;ownerWindow&&(this.drags.size>0&&this.dragOwnerWindow!==ownerWindow||(this.drags.set(e.pointerId,{index,startPos:this.effectiveOrientation==="vertical"?e.clientY:e.clientX,base:this.baseEl,appliedDelta:0,acceptedResize:!1}),divider.setPointerCapture(e.pointerId),this.drags.size===1&&(this.dragOwnerWindow=ownerWindow,ownerWindow.addEventListener("pointermove",this.onPointerMove),ownerWindow.addEventListener("pointerup",this.onPointerUp),ownerWindow.addEventListener("pointercancel",this.onPointerUp),ownerWindow.addEventListener("lostpointercapture",this.onPointerUp))))},this.onPointerMove=e=>{const drag=this.drags.get(e.pointerId);if(!drag)return;if(this.isDividerDisabled(drag.index)){this.endDragGestures();return}const total=this.effectiveOrientation==="vertical"?drag.base.clientHeight:drag.base.clientWidth;if(!Number.isFinite(total)||total<=0){this.endDragGestures();return}let cumulativeDelta=((this.effectiveOrientation==="vertical"?e.clientY:e.clientX)-drag.startPos)/total*100;this.effectiveOrientation==="horizontal"&&isRtl(this)&&(cumulativeDelta=-cumulativeDelta);const incremental=cumulativeDelta-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.persist(),this.drags.size===0&&this.removeDragListeners())},this.onDividerKeyDown=(e,index)=>{if(this.isDividerDisabled(index))return;const rtl=this.effectiveOrientation==="horizontal"&&isRtl(this),forwardKey=this.effectiveOrientation==="vertical"?"ArrowDown":rtl?"ArrowLeft":"ArrowRight",backwardKey=this.effectiveOrientation==="vertical"?"ArrowUp":rtl?"ArrowRight":"ArrowLeft";e.key===forwardKey?this.applyDelta(index,KEYBOARD_STEP,!0)&&e.preventDefault():e.key===backwardKey&&this.applyDelta(index,-KEYBOARD_STEP,!0)&&e.preventDefault()}}static{this.defaultStrings={...super.defaultStrings,resizeDivider:LYRA_DEFAULT_resizeDivider}}static{this.ownedCollectionProperties=Object.freeze(["sizes","defaultSizes","panelConstraints"])}static{this.styles=[LyraElement.styles,styles]}static{this.immutableEventDetails=Object.freeze(["lr-resize-request","lr-resize"])}static{this.properties={collapseState:{reflect:!0,attribute:"collapse-state",noAccessor:!0}}}connectedCallback(){super.connectedCallback();const hostWidth=this.getBoundingClientRect().width;hostWidth>0&&(this.measuredInlineSize=hostWidth),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.overlayHandle?.focusInitial()))}disconnectedCallback(){super.disconnectedCallback(),this.endDragGestures(),this.resetCollapseObserver(),this.overlayHandle?.suspend(),this.releaseOwnedPanels()}adoptedCallback(){super.adoptedCallback(),this.endDragGestures(),this.resetCollapseObserver(),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),(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())}}get collapseState(){return this.effectiveCollapseStateFor(this.collapse)}set collapseState(next){if(next==="auto"){this._forced=!1,this.updateCollapseState(this.currentMeasuredWidth());return}this._forced=!0,this.setRequestedCollapseState(next)}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}))}currentMeasuredWidth(){return this.baseEl?.clientWidth??0}effectiveCollapseStateFor(collapse){return collapse!=="none"&&this.panelCount>=2?this._collapseState:"wide"}applyEffectiveCollapseTransition(previous,next,shouldEmit=!0){previous!==next&&(this.endDragGestures(),this.requestUpdate("collapseState",previous),shouldEmit&&this.emit("lr-multi-split-collapse-change",{state:next}),next!=="floating"&&this.open&&(this.open=!1))}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.loadPersisted()||this.validInitialSizes(this.sizes))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.panelOwnershipObserverGeneration+=1,this.panelOwnershipObserver?.disconnect(),this.panelOwnershipObserver=void 0,this.panelOwnershipObserverDocument=void 0}observeOwnedPanels(){this.resetPanelOwnershipObserver();const ownerDocument=this.ownerDocument,MutationObserverConstructor=ownerDocument.defaultView?.MutationObserver;if(!MutationObserverConstructor||!this.isConnected||this.ownedPanels.length===0)return;const generation=this.panelOwnershipObserverGeneration,observer=new MutationObserverConstructor(records=>{if(this.panelOwnershipObserver!==observer||this.panelOwnershipObserverDocument!==this.ownerDocument||this.panelOwnershipObserverGeneration!==generation||!this.isConnected)return;records.some(record=>{const panel=record.target,snapshot=this.panelOwnership.get(panel);return snapshot?this.panelProjectionDiverged(panel,snapshot):!1})&&this.requestUpdate()});this.panelOwnershipObserver=observer,this.panelOwnershipObserverDocument=ownerDocument;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];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}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){this.collapse!=="none"&&(this._forced||this.setRequestedCollapseState(this.collapseBreakpoints.classify(width),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}}}percentBounds(index,containerSize){return this.resolveConstraintBounds(containerSize).bounds[index]??{min:0,max:1/0}}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,a=this.percentBounds(i,containerSize),b=this.percentBounds(i+1,containerSize),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.persist(),!0)}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.overlayHandle=activateOverlay({host:this,panel:()=>this.floatingPanelEl,onEscape:()=>this.open=!1,onBackdrop:()=>this.open=!1,lockScroll:!0,suspendWhenUnrendered:!0})}deactivateFloatingOverlay(){this.overlayHandle?.deactivate(),this.overlayHandle=void 0}removeDragListeners(){const ownerWindow=this.dragOwnerWindow;this.dragOwnerWindow=void 0,ownerWindow?.removeEventListener("pointermove",this.onPointerMove),ownerWindow?.removeEventListener("pointerup",this.onPointerUp),ownerWindow?.removeEventListener("pointercancel",this.onPointerUp),ownerWindow?.removeEventListener("lostpointercapture",this.onPointerUp)}endDragGestures(){this.drags.clear(),this.removeDragListeners()}updated(changed){super.updated(changed),(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");const constraintResolution=this.resolveConstraintBounds(this.getContainerSize()),issue=constraintResolution.issue,issueKey=issue?`${issue.reason}:${issue.panelCount}:${issue.minimumTotal}:${issue.maximumTotal??"unbounded"}`:"";issueKey!==this.constraintIssueKey&&(this.constraintIssueKey=issueKey,issue&&this.emit("lr-multi-split-constraints-invalid",issue));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,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;if(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,"flex","none"),this.applyOwnedPanelStyleValue(panel,snapshot,"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"),this.justOpened&&(this.justOpened=!1,this.overlayHandle?.focusInitial())}render(){const dividers=[],bounds=this.resolveConstraintBounds(this.getContainerSize()).bounds;for(let i=0;i<this.panelCount-1;i++){const pairTotal=(this.sizes[i]??0)+(this.sizes[i+1]??0),a=bounds[i],b=bounds[i+1],valueMin=Math.max(a.min,pairTotal-b.max),valueMax=Math.max(valueMin,Math.min(a.max,pairTotal-b.min)),disabled=this.isDividerDisabled(i);dividers.push(html`<div
|
|
2
2
|
part="divider"
|
|
3
3
|
role="separator"
|
|
4
4
|
aria-label=${this.dividerLabel?this.dividerLabel(i,this.panelCount):this.localize("resizeDivider",void 0,{a:getNumberFormat(this.effectiveLocale).format(i+1),b:getNumberFormat(this.effectiveLocale).format(i+2)})}
|
|
@@ -5,13 +5,7 @@ import{css}from"lit";const styles=css`
|
|
|
5
5
|
min-inline-size: 0;
|
|
6
6
|
max-inline-size: 100%;
|
|
7
7
|
block-size: 100%;
|
|
8
|
-
/* Component-specific -- not a shared design token, so a consumer can
|
|
9
|
-
retheme it without a raw literal leaking into the public API (same
|
|
10
|
-
rationale as lr-app-rail's --lr-app-rail-overlay-color). */
|
|
11
8
|
--_lr-multi-split-overlay-color: var(--lr-color-overlay);
|
|
12
|
-
/* The divider owns a real target gutter instead of extending a pseudo
|
|
13
|
-
element over either neighboring panel. Only the centered line is
|
|
14
|
-
painted; the full track remains available for pointer/keyboard input. */
|
|
15
9
|
--_lr-multi-split-divider-target-size: max(
|
|
16
10
|
var(--lr-icon-button-size),
|
|
17
11
|
var(--lr-size-3px)
|
|
@@ -19,8 +13,6 @@ import{css}from"lit";const styles=css`
|
|
|
19
13
|
}
|
|
20
14
|
[part="base"] {
|
|
21
15
|
display: flex;
|
|
22
|
-
/* Anchor for the 'floating' collapse state's absolutely-positioned
|
|
23
|
-
overlay panel (set inline by multi-split.class.ts's updated()). */
|
|
24
16
|
position: relative;
|
|
25
17
|
inline-size: 100%;
|
|
26
18
|
min-inline-size: 0;
|
|
@@ -28,14 +20,9 @@ import{css}from"lit";const styles=css`
|
|
|
28
20
|
block-size: 100%;
|
|
29
21
|
}
|
|
30
22
|
::slotted(*) {
|
|
31
|
-
/* Honest no-JS/first-hydration fallback before child count and live sizes can be observed.
|
|
32
|
-
Browser reconciliation writes a more specific inline flex value once available. */
|
|
33
23
|
flex: 1 1 0;
|
|
34
24
|
min-inline-size: 0;
|
|
35
25
|
max-inline-size: 100%;
|
|
36
|
-
/* Direct panels own their overflow. The zero minimum lets a fixed-height
|
|
37
|
-
split shrink each flex item along the block axis instead of letting
|
|
38
|
-
long content expand the base and escape into following content. */
|
|
39
26
|
min-block-size: 0;
|
|
40
27
|
max-block-size: 100%;
|
|
41
28
|
overflow: auto;
|
|
@@ -63,7 +50,6 @@ import{css}from"lit";const styles=css`
|
|
|
63
50
|
cursor: col-resize;
|
|
64
51
|
touch-action: none;
|
|
65
52
|
}
|
|
66
|
-
/* Paint the narrow visual rule inside the allocated target track. */
|
|
67
53
|
[part="divider"]::before {
|
|
68
54
|
content: "";
|
|
69
55
|
position: absolute;
|
|
@@ -72,9 +58,6 @@ import{css}from"lit";const styles=css`
|
|
|
72
58
|
background: var(--lr-color-border);
|
|
73
59
|
pointer-events: none;
|
|
74
60
|
}
|
|
75
|
-
/* :where() zeroes the [orientation='vertical'] qualifier's specificity contribution -- otherwise
|
|
76
|
-
this (0,3,0) rule would beat a consumer's own ::part(divider) inline-size/cursor override
|
|
77
|
-
whenever orientation="vertical" is set. */
|
|
78
61
|
:host(:where([orientation="vertical"])) [part="divider"] {
|
|
79
62
|
inline-size: 100%;
|
|
80
63
|
min-inline-size: min(
|
|
@@ -96,20 +79,12 @@ import{css}from"lit";const styles=css`
|
|
|
96
79
|
inset-block: calc((100% - var(--lr-size-3px)) / 2);
|
|
97
80
|
inset-inline: 0;
|
|
98
81
|
}
|
|
99
|
-
/* orientationBreakpoint's live axis -- only present while that feature is opted into (see
|
|
100
|
-
multi-split.class.ts's updated()), so it can override the authored orientation rules above by source
|
|
101
|
-
order alone (equal specificity) whenever the effective axis diverges from it. */
|
|
102
82
|
:host([data-effective-orientation="vertical"]) [part="base"] {
|
|
103
83
|
flex-direction: column;
|
|
104
84
|
}
|
|
105
85
|
:host([data-effective-orientation="horizontal"]) [part="base"] {
|
|
106
86
|
flex-direction: row;
|
|
107
87
|
}
|
|
108
|
-
/* Same :where() treatment as [orientation='vertical'] above, applied to both effective-axis
|
|
109
|
-
variants -- these are the higher-specificity rules orientationBreakpoint's live axis relies on
|
|
110
|
-
to override the authored orientation by source order (see the comment above), so without
|
|
111
|
-
:where() they'd beat a consumer's ::part(divider) override even more readily than the
|
|
112
|
-
authored-orientation rules do. */
|
|
113
88
|
:host(:where([data-effective-orientation="vertical"])) [part="divider"] {
|
|
114
89
|
inline-size: 100%;
|
|
115
90
|
min-inline-size: min(
|
|
@@ -156,9 +131,6 @@ import{css}from"lit";const styles=css`
|
|
|
156
131
|
[part="divider"]:hover::before {
|
|
157
132
|
background: var(--lr-color-brand);
|
|
158
133
|
}
|
|
159
|
-
/* The drag itself. Pointer capture holds :active for the whole gesture, so the divider stays at
|
|
160
|
-
the deeper mix from mousedown until release -- and a divider adjacent to a collapsed pane
|
|
161
|
-
never reaches it, since [aria-disabled='true'] below takes its pointer events away. */
|
|
162
134
|
[part="divider"]:active::before {
|
|
163
135
|
background: color-mix(
|
|
164
136
|
in oklab,
|
|
@@ -170,35 +142,24 @@ import{css}from"lit";const styles=css`
|
|
|
170
142
|
outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);
|
|
171
143
|
outline-offset: var(--lr-focus-ring-offset);
|
|
172
144
|
}
|
|
173
|
-
/* The divider adjacent to a rail/floating-collapsed pane (see multi-split.class.ts's
|
|
174
|
-
isDividerDisabled()) — geometry (position/inset/inline-size) for the
|
|
175
|
-
collapsing panel itself is set inline by updated(), same as the
|
|
176
|
-
pre-existing flex/order styling; this only covers the divider's own
|
|
177
|
-
drag/hover affordance and the floating panel's elevation, which read
|
|
178
|
-
more naturally as stylesheet rules than one-off inline styles. */
|
|
179
145
|
[part="divider"][aria-disabled="true"] {
|
|
180
146
|
cursor: default;
|
|
181
147
|
pointer-events: none;
|
|
182
148
|
}
|
|
183
|
-
/* The 'floating' collapse state's overlay "card" look -- geometry
|
|
184
|
-
(position, the inset-* longhands, inline-size) is set inline by multi-split.class.ts's updated(),
|
|
185
|
-
matching how the ordinary flex/order styling is applied; only the
|
|
186
|
-
visual/stacking treatment lives here. z-index is above [part="backdrop"]
|
|
187
|
-
(below), so the drawer renders on top of its own scrim. */
|
|
188
149
|
::slotted([data-collapse-state="floating"]) {
|
|
150
|
+
position: absolute;
|
|
151
|
+
inset-block: 0;
|
|
189
152
|
z-index: var(--lr-layer-content);
|
|
190
153
|
background: var(--lr-color-surface);
|
|
191
154
|
border-radius: var(--lr-radius);
|
|
192
|
-
/* Modal step: this is a drawer rendered above its own scrim (see [part='backdrop'] below), not
|
|
193
|
-
an anchored popup, so it takes the modal tier. */
|
|
194
155
|
box-shadow: var(--lr-shadow-l);
|
|
195
156
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
157
|
+
:host([collapse="start"]) ::slotted([data-collapse-state="floating"]) {
|
|
158
|
+
inset-inline-start: 0;
|
|
159
|
+
}
|
|
160
|
+
:host([collapse="end"]) ::slotted([data-collapse-state="floating"]) {
|
|
161
|
+
inset-inline-end: 0;
|
|
162
|
+
}
|
|
202
163
|
[part="backdrop"] {
|
|
203
164
|
position: absolute;
|
|
204
165
|
inset: 0;
|
|
@@ -208,10 +169,6 @@ import{css}from"lit";const styles=css`
|
|
|
208
169
|
var(--_lr-multi-split-overlay-color)
|
|
209
170
|
);
|
|
210
171
|
}
|
|
211
|
-
/* Rail-clamped content can easily overflow the fixed rail-width — clip it
|
|
212
|
-
rather than letting it blow out the layout; the panel's own content is
|
|
213
|
-
expected to adapt to the narrower width itself (e.g. via a container
|
|
214
|
-
query), this is just a safety net. */
|
|
215
172
|
::slotted([data-collapse-state="rail"]) {
|
|
216
173
|
overflow: hidden;
|
|
217
174
|
}
|
|
@@ -118,6 +118,10 @@ export interface LyraPageEventMap {
|
|
|
118
118
|
* @since 8.0.0
|
|
119
119
|
*/
|
|
120
120
|
export declare class LyraPage extends LyraElement<LyraPageEventMap> {
|
|
121
|
+
/** `disable-sticky` is read only by `:host([disable-sticky~="..."])` rules in page.styles.ts,
|
|
122
|
+
* so it is deliberately not a reactive property. Declared here so authoring the documented
|
|
123
|
+
* attribute does not draw an "unknown attribute" dev warning. */
|
|
124
|
+
protected static readonly knownUnobservedAttributes: readonly string[];
|
|
121
125
|
static styles: import("lit").CSSResultGroup[];
|
|
122
126
|
/** Presentation derived from the Page's allocated inline size. It begins at `desktop` so server
|
|
123
127
|
* output is deterministic, then reflects the first live allocation measurement. */
|
|
@@ -14,7 +14,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
|
|
|
14
14
|
<line x1="4" y1="12" x2="20" y2="12"></line>
|
|
15
15
|
<line x1="4" y1="17" x2="20" y2="17"></line>
|
|
16
16
|
</svg>
|
|
17
|
-
`}class LyraPage extends LyraElement{constructor(){super(...arguments),this.view="desktop",this.navOpen=!1,this.mobileBreakpoint="768px",this.navigationPlacement="start",this.disableNavigationToggle=!1,this.accessibleLabel=null,this.mainId=nextId("page-main"),this.navigationId=nextId("page-navigation"),this.drawerId=nextId("page-drawer"),this.skipTargetId=nextId("page-skip-target"),this.skipLabelId=nextId("page-skip-label"),this.fragmentTargetId=this.getAttribute("id")||this.skipTargetId,this.fragmentTabIndex=this.getAttribute("tabindex")??"-1",this.customToggles=[],this.customToggleOwnership=new Map,this.onWindowResize=()=>this.measureAllocation(),this.resolveNavigationRestoreTarget=()=>{const owner=this.navigationTriggerOwner;if(owner?.isConnected){const accessible=resolveAccessibleTrigger(owner);if(isComposedFocusAvailable(accessible))return accessible}const builtIn=this.disableNavigationToggle?null:this.renderRoot.querySelector('[part~="navigation-toggle"]');return builtIn&&isComposedFocusAvailable(builtIn)?builtIn:this.mainElement&&isComposedFocusAvailable(this.mainElement)?this.mainElement:null},this.onDefaultToggleClick=event=>{this.rememberTriggerAndToggle(event.currentTarget)},this.onToggleSlotClick=event=>{const trigger=event.composedPath().find(candidate=>candidate?.nodeType===1&&candidate.getAttribute("slot")==="navigation-toggle");trigger&&this.customToggles.includes(trigger)&&!this.isUnavailableCustomToggle(trigger)&&this.rememberTriggerAndToggle(trigger)},this.onPageClick=event=>{const path=event.composedPath();if(path.some(candidate=>candidate?.nodeType===1&&candidate.getAttribute("slot")==="navigation-toggle"))return;const trigger=path.find(candidate=>candidate?.nodeType===1&&candidate.hasAttribute("data-toggle-nav"));trigger&&this.rememberTriggerAndToggle(trigger)},this.onBackdropClick=event=>{event.target===event.currentTarget&&this.overlayHandle?.dismissBackdrop()},this.onSkipClick=event=>{event.preventDefault(),this.mainElement?.focus(),this.mainElement?.scrollIntoView({block:"start"})}}static{this.defaultStrings={...super.defaultStrings,closeNavigation:LYRA_DEFAULT_closeNavigation,navigation:LYRA_DEFAULT_navigation,openNavigation:LYRA_DEFAULT_openNavigation,skipToContent:LYRA_DEFAULT_skipToContent}}static{this.styles=[LyraElement.styles,styles]}connectedCallback(){super.connectedCallback(),this.measureAllocation(),this.observeAllocation(),this.hasUpdated&&this.view==="mobile"&&this.navOpen&&(this.overlayHandle?.isActive()?this.overlayHandle.resume():this.syncOverlay(),queueMicrotask(()=>this.overlayHandle?.focusInitial())),this.hasUpdated&&queueMicrotask(()=>this.isConnected&&this.syncCustomToggle())}disconnectedCallback(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.resizeView?.removeEventListener("resize",this.onWindowResize),this.resizeView=void 0,this.overlayHandle?.suspend(),this.releaseCustomToggleA11y(),super.disconnectedCallback()}firstUpdated(changed){super.firstUpdated(changed),this.measureAllocation(),this.observeAllocation()}willUpdate(changed){super.willUpdate(changed),changed.has("fragmentTargetId")&&!this.fragmentTargetId&&(this.fragmentTargetId=this.skipTargetId),changed.has("fragmentTabIndex")&&this.fragmentTabIndex===null&&(this.fragmentTabIndex="-1")}updated(changed){super.updated(changed),changed.has("mobileBreakpoint")&&changed.get("mobileBreakpoint")!==void 0&&this.measureAllocation(),this.overlayHandle!==void 0&&(!this.isConnected||this.view!=="mobile"||!this.navOpen)?(this.syncOverlay(changed),this.syncCustomToggle()):(this.syncCustomToggle(),this.syncOverlay(changed))}observeAllocation(){if(!this.isConnected)return;this.resizeView?.removeEventListener("resize",this.onWindowResize),this.resizeView=void 0;const view=this.ownerDocument.defaultView,ResizeObserverConstructor=view?.ResizeObserver;if(ResizeObserverConstructor){this.resizeObserver??=new ResizeObserverConstructor(entries=>{const entry=entries.find(candidate=>candidate.target===this)??entries[0],inlineSize=entry?.contentBoxSize?.[0]?.inlineSize??entry?.contentRect.width;inlineSize!==void 0&&this.applyMeasuredInlineSize(inlineSize)}),this.resizeObserver.observe(this);return}view&&(this.resizeView=view,view.addEventListener("resize",this.onWindowResize))}measureAllocation(){const width=this.getBoundingClientRect().width;width>0&&this.applyMeasuredInlineSize(width)}applyMeasuredInlineSize(width){if(!Number.isFinite(width)||width<0)return;const resolved=resolveCssLength(this.mobileBreakpoint,{host:this}),fallback=resolveCssLength(DEFAULT_MOBILE_BREAKPOINT,{host:this})??768,breakpoint=Math.max(0,resolved!==void 0&&Number.isFinite(resolved)?resolved:fallback),next=width<=breakpoint?"mobile":"desktop";next!==this.view&&(this.view=next)}syncOverlay(changed){if(this.isConnected&&this.view==="mobile"&&this.navOpen){if(this.overlayHandle?.isActive()){this.overlayHandle.resume(),this.navigationTriggerOwner&&this.overlayHandle.updateRestoreFocusTo(this.resolveNavigationRestoreTarget);return}this.overlayHandle=activateOverlay({host:this,panel:()=>this.drawerElement??null,modalRoot:()=>this.drawerElement??null,onEscape:()=>this.hideNavigation(),onBackdrop:()=>this.hideNavigation(),...this.navigationTriggerOwner?{restoreFocusTo:this.resolveNavigationRestoreTarget}:{},lockScroll:!0,suspendWhenUnrendered:!0}),this.overlayHandle.focusInitial();return}if(this.overlayHandle){const restoreFocus=!!(changed?.has("navOpen")&&!this.navOpen);this.overlayHandle.deactivate({restoreFocus}),this.overlayHandle=void 0}this.navOpen||(this.navigationTriggerOwner=void 0)}syncCustomToggle(){const nextToggles=(this.shadowRoot?.querySelector('slot[name="navigation-toggle"]')?.assignedElements({flatten:!0})??[]).filter(candidate=>candidate.nodeType===1&&candidate.getRootNode()!==this.shadowRoot),previous=this.customToggle;this.customToggles=nextToggles,this.customToggle=nextToggles[0];for(const[host,ownership]of this.customToggleOwnership)nextToggles.includes(host)||(ownership.accessibleAria?.release(),ownership.hostAria.release(),this.customToggleOwnership.delete(host));const localizedLabel=this.localize(this.navOpen?"closeNavigation":"openNavigation"),drawer=this.drawerElement;for(const host of nextToggles){const accessible=resolveAccessibleTrigger(host);let ownership=this.customToggleOwnership.get(host);ownership?accessible!==ownership.accessible&&(ownership.accessibleAria?.release(),ownership.accessibleAria=void 0,ownership.accessible=accessible,ownership.accessibleAuthoredLabel=accessible.hasAttribute("aria-label")?accessible.getAttribute("aria-label")??"":null):(ownership={accessible,accessibleAuthoredLabel:accessible.hasAttribute("aria-label")?accessible.getAttribute("aria-label")??"":null,hostAria:acquireAriaOwnership(null,{}),hostAuthoredLabel:host.hasAttribute("aria-label")?host.getAttribute("aria-label")??"":null},this.customToggleOwnership.set(host,ownership)),ownership.hostAria.update(host,{attributes:{"aria-haspopup":"dialog","aria-expanded":this.navOpen?"true":"false","aria-label":ownership.hostAuthoredLabel??localizedLabel},controls:drawer?[drawer]:[]});const distinctAccessible=accessible===host?null:accessible,accessibleContribution={attributes:{"aria-haspopup":"dialog","aria-expanded":this.navOpen?"true":"false","aria-label":ownership.accessibleAuthoredLabel??ownership.hostAuthoredLabel??localizedLabel},controls:drawer?[drawer]:[]};ownership.accessibleAria?ownership.accessibleAria.update(distinctAccessible,accessibleContribution):ownership.accessibleAria=acquireAriaOwnership(distinctAccessible,accessibleContribution)}this.navOpen&&this.navigationTriggerOwner&&!nextToggles.includes(this.navigationTriggerOwner)?(this.navigationTriggerOwner=this.customToggle,this.overlayHandle?.updateRestoreFocusTo(this.resolveNavigationRestoreTarget)):this.navOpen&&previous&&this.navigationTriggerOwner===previous&&this.overlayHandle?.updateRestoreFocusTo(this.resolveNavigationRestoreTarget)}releaseCustomToggleA11y(){for(const ownership of this.customToggleOwnership.values())ownership.accessibleAria?.release(),ownership.hostAria.release();this.customToggleOwnership.clear(),this.customToggle=void 0,this.customToggles=[]}isUnavailableCustomToggle(trigger){const accessible=resolveAccessibleTrigger(trigger);return[trigger,accessible].some(candidate=>candidate.hasAttribute("hidden")||candidate.hasAttribute("inert")||candidate.matches(":disabled")||isAriaTrue(candidate.getAttribute("aria-hidden"))||isAriaTrue(candidate.getAttribute("aria-disabled")))}rememberTriggerAndToggle(trigger){this.syncCustomToggle(),this.navOpen||(this.navigationTriggerOwner=trigger),this.toggleNavigation()}requestNavOpen(next){this.navOpen!==next&&(this.emit("lr-nav-toggle",{open:next},{cancelable:!0}).defaultPrevented||(this.navOpen=next))}showNavigation(){this.requestNavOpen(!0)}hideNavigation(){this.requestNavOpen(!1)}toggleNavigation(){this.requestNavOpen(!this.navOpen)}visiblePixelsInViewport(element){if(!element)return 0;const rect=element.getBoundingClientRect();if(!Number.isFinite(rect.top)||!Number.isFinite(rect.bottom))return 0;const candidateHeight=element.ownerDocument.defaultView?.innerHeight??element.ownerDocument.documentElement.clientHeight;if(!Number.isFinite(candidateHeight)||candidateHeight<=0)return 0;const viewportHeight=finiteRange(candidateHeight,0,0),visible=Math.min(rect.bottom,viewportHeight)-Math.max(rect.top,0);return finiteRange(visible,0,0,viewportHeight)}render(){const mobile=this.view==="mobile",overlayOpen=mobile&&this.navOpen,navigationLabel=this.accessibleLabel??this.localize("navigation");return html`
|
|
17
|
+
`}class LyraPage extends LyraElement{constructor(){super(...arguments),this.view="desktop",this.navOpen=!1,this.mobileBreakpoint="768px",this.navigationPlacement="start",this.disableNavigationToggle=!1,this.accessibleLabel=null,this.mainId=nextId("page-main"),this.navigationId=nextId("page-navigation"),this.drawerId=nextId("page-drawer"),this.skipTargetId=nextId("page-skip-target"),this.skipLabelId=nextId("page-skip-label"),this.fragmentTargetId=this.getAttribute("id")||this.skipTargetId,this.fragmentTabIndex=this.getAttribute("tabindex")??"-1",this.customToggles=[],this.customToggleOwnership=new Map,this.onWindowResize=()=>this.measureAllocation(),this.resolveNavigationRestoreTarget=()=>{const owner=this.navigationTriggerOwner;if(owner?.isConnected){const accessible=resolveAccessibleTrigger(owner);if(isComposedFocusAvailable(accessible))return accessible}const builtIn=this.disableNavigationToggle?null:this.renderRoot.querySelector('[part~="navigation-toggle"]');return builtIn&&isComposedFocusAvailable(builtIn)?builtIn:this.mainElement&&isComposedFocusAvailable(this.mainElement)?this.mainElement:null},this.onDefaultToggleClick=event=>{this.rememberTriggerAndToggle(event.currentTarget)},this.onToggleSlotClick=event=>{const trigger=event.composedPath().find(candidate=>candidate?.nodeType===1&&candidate.getAttribute("slot")==="navigation-toggle");trigger&&this.customToggles.includes(trigger)&&!this.isUnavailableCustomToggle(trigger)&&this.rememberTriggerAndToggle(trigger)},this.onPageClick=event=>{const path=event.composedPath();if(path.some(candidate=>candidate?.nodeType===1&&candidate.getAttribute("slot")==="navigation-toggle"))return;const trigger=path.find(candidate=>candidate?.nodeType===1&&candidate.hasAttribute("data-toggle-nav"));trigger&&this.rememberTriggerAndToggle(trigger)},this.onBackdropClick=event=>{event.target===event.currentTarget&&this.overlayHandle?.dismissBackdrop()},this.onSkipClick=event=>{event.preventDefault(),this.mainElement?.focus(),this.mainElement?.scrollIntoView({block:"start"})}}static{this.defaultStrings={...super.defaultStrings,closeNavigation:LYRA_DEFAULT_closeNavigation,navigation:LYRA_DEFAULT_navigation,openNavigation:LYRA_DEFAULT_openNavigation,skipToContent:LYRA_DEFAULT_skipToContent}}static{this.knownUnobservedAttributes=["disable-sticky"]}static{this.styles=[LyraElement.styles,styles]}connectedCallback(){super.connectedCallback(),this.measureAllocation(),this.observeAllocation(),this.hasUpdated&&this.view==="mobile"&&this.navOpen&&(this.overlayHandle?.isActive()?this.overlayHandle.resume():this.syncOverlay(),queueMicrotask(()=>this.overlayHandle?.focusInitial())),this.hasUpdated&&queueMicrotask(()=>this.isConnected&&this.syncCustomToggle())}disconnectedCallback(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.resizeView?.removeEventListener("resize",this.onWindowResize),this.resizeView=void 0,this.overlayHandle?.suspend(),this.releaseCustomToggleA11y(),super.disconnectedCallback()}firstUpdated(changed){super.firstUpdated(changed),this.measureAllocation(),this.observeAllocation()}willUpdate(changed){super.willUpdate(changed),changed.has("fragmentTargetId")&&!this.fragmentTargetId&&(this.fragmentTargetId=this.skipTargetId),changed.has("fragmentTabIndex")&&this.fragmentTabIndex===null&&(this.fragmentTabIndex="-1")}updated(changed){super.updated(changed),changed.has("mobileBreakpoint")&&changed.get("mobileBreakpoint")!==void 0&&this.measureAllocation(),this.overlayHandle!==void 0&&(!this.isConnected||this.view!=="mobile"||!this.navOpen)?(this.syncOverlay(changed),this.syncCustomToggle()):(this.syncCustomToggle(),this.syncOverlay(changed))}observeAllocation(){if(!this.isConnected)return;this.resizeView?.removeEventListener("resize",this.onWindowResize),this.resizeView=void 0;const view=this.ownerDocument.defaultView,ResizeObserverConstructor=view?.ResizeObserver;if(ResizeObserverConstructor){this.resizeObserver??=new ResizeObserverConstructor(entries=>{const entry=entries.find(candidate=>candidate.target===this)??entries[0],inlineSize=entry?.contentBoxSize?.[0]?.inlineSize??entry?.contentRect.width;inlineSize!==void 0&&this.applyMeasuredInlineSize(inlineSize)}),this.resizeObserver.observe(this);return}view&&(this.resizeView=view,view.addEventListener("resize",this.onWindowResize))}measureAllocation(){const width=this.getBoundingClientRect().width;width>0&&this.applyMeasuredInlineSize(width)}applyMeasuredInlineSize(width){if(!Number.isFinite(width)||width<0)return;const resolved=resolveCssLength(this.mobileBreakpoint,{host:this}),fallback=resolveCssLength(DEFAULT_MOBILE_BREAKPOINT,{host:this})??768,breakpoint=Math.max(0,resolved!==void 0&&Number.isFinite(resolved)?resolved:fallback),next=width<=breakpoint?"mobile":"desktop";next!==this.view&&(this.view=next)}syncOverlay(changed){if(this.isConnected&&this.view==="mobile"&&this.navOpen){if(this.overlayHandle?.isActive()){this.overlayHandle.resume(),this.navigationTriggerOwner&&this.overlayHandle.updateRestoreFocusTo(this.resolveNavigationRestoreTarget);return}this.overlayHandle=activateOverlay({host:this,panel:()=>this.drawerElement??null,modalRoot:()=>this.drawerElement??null,onEscape:()=>this.hideNavigation(),onBackdrop:()=>this.hideNavigation(),...this.navigationTriggerOwner?{restoreFocusTo:this.resolveNavigationRestoreTarget}:{},lockScroll:!0,suspendWhenUnrendered:!0}),this.overlayHandle.focusInitial();return}if(this.overlayHandle){const restoreFocus=!!(changed?.has("navOpen")&&!this.navOpen);this.overlayHandle.deactivate({restoreFocus}),this.overlayHandle=void 0}this.navOpen||(this.navigationTriggerOwner=void 0)}syncCustomToggle(){const nextToggles=(this.shadowRoot?.querySelector('slot[name="navigation-toggle"]')?.assignedElements({flatten:!0})??[]).filter(candidate=>candidate.nodeType===1&&candidate.getRootNode()!==this.shadowRoot),previous=this.customToggle;this.customToggles=nextToggles,this.customToggle=nextToggles[0];for(const[host,ownership]of this.customToggleOwnership)nextToggles.includes(host)||(ownership.accessibleAria?.release(),ownership.hostAria.release(),this.customToggleOwnership.delete(host));const localizedLabel=this.localize(this.navOpen?"closeNavigation":"openNavigation"),drawer=this.drawerElement;for(const host of nextToggles){const accessible=resolveAccessibleTrigger(host);let ownership=this.customToggleOwnership.get(host);ownership?accessible!==ownership.accessible&&(ownership.accessibleAria?.release(),ownership.accessibleAria=void 0,ownership.accessible=accessible,ownership.accessibleAuthoredLabel=accessible.hasAttribute("aria-label")?accessible.getAttribute("aria-label")??"":null):(ownership={accessible,accessibleAuthoredLabel:accessible.hasAttribute("aria-label")?accessible.getAttribute("aria-label")??"":null,hostAria:acquireAriaOwnership(null,{}),hostAuthoredLabel:host.hasAttribute("aria-label")?host.getAttribute("aria-label")??"":null},this.customToggleOwnership.set(host,ownership)),ownership.hostAria.update(host,{attributes:{"aria-haspopup":"dialog","aria-expanded":this.navOpen?"true":"false","aria-label":ownership.hostAuthoredLabel??localizedLabel},controls:drawer?[drawer]:[]});const distinctAccessible=accessible===host?null:accessible,accessibleContribution={attributes:{"aria-haspopup":"dialog","aria-expanded":this.navOpen?"true":"false","aria-label":ownership.accessibleAuthoredLabel??ownership.hostAuthoredLabel??localizedLabel},controls:drawer?[drawer]:[]};ownership.accessibleAria?ownership.accessibleAria.update(distinctAccessible,accessibleContribution):ownership.accessibleAria=acquireAriaOwnership(distinctAccessible,accessibleContribution)}this.navOpen&&this.navigationTriggerOwner&&!nextToggles.includes(this.navigationTriggerOwner)?(this.navigationTriggerOwner=this.customToggle,this.overlayHandle?.updateRestoreFocusTo(this.resolveNavigationRestoreTarget)):this.navOpen&&previous&&this.navigationTriggerOwner===previous&&this.overlayHandle?.updateRestoreFocusTo(this.resolveNavigationRestoreTarget)}releaseCustomToggleA11y(){for(const ownership of this.customToggleOwnership.values())ownership.accessibleAria?.release(),ownership.hostAria.release();this.customToggleOwnership.clear(),this.customToggle=void 0,this.customToggles=[]}isUnavailableCustomToggle(trigger){const accessible=resolveAccessibleTrigger(trigger);return[trigger,accessible].some(candidate=>candidate.hasAttribute("hidden")||candidate.hasAttribute("inert")||candidate.matches(":disabled")||isAriaTrue(candidate.getAttribute("aria-hidden"))||isAriaTrue(candidate.getAttribute("aria-disabled")))}rememberTriggerAndToggle(trigger){this.syncCustomToggle(),this.navOpen||(this.navigationTriggerOwner=trigger),this.toggleNavigation()}requestNavOpen(next){this.navOpen!==next&&(this.emit("lr-nav-toggle",{open:next},{cancelable:!0}).defaultPrevented||(this.navOpen=next))}showNavigation(){this.requestNavOpen(!0)}hideNavigation(){this.requestNavOpen(!1)}toggleNavigation(){this.requestNavOpen(!this.navOpen)}visiblePixelsInViewport(element){if(!element)return 0;const rect=element.getBoundingClientRect();if(!Number.isFinite(rect.top)||!Number.isFinite(rect.bottom))return 0;const candidateHeight=element.ownerDocument.defaultView?.innerHeight??element.ownerDocument.documentElement.clientHeight;if(!Number.isFinite(candidateHeight)||candidateHeight<=0)return 0;const viewportHeight=finiteRange(candidateHeight,0,0),visible=Math.min(rect.bottom,viewportHeight)-Math.max(rect.top,0);return finiteRange(visible,0,0,viewportHeight)}render(){const mobile=this.view==="mobile",overlayOpen=mobile&&this.navOpen,navigationLabel=this.accessibleLabel??this.localize("navigation");return html`
|
|
18
18
|
<div part="base page" @click=${this.onPageClick}>
|
|
19
19
|
<a
|
|
20
20
|
part="skip-to-content"
|
|
@@ -26,8 +26,6 @@ import{css}from"lit";const styles=css`
|
|
|
26
26
|
cursor: pointer;
|
|
27
27
|
border-radius: var(--lr-radius);
|
|
28
28
|
}
|
|
29
|
-
/* chevronIcon() renders a right-pointing chevron with no baked-in rotation (see icons.ts) --
|
|
30
|
-
rotate the whole button, matching lr-tree-item's identical [part='toggle'] rotation approach. */
|
|
31
29
|
[part='move-up-button'] {
|
|
32
30
|
transform: rotate(-90deg);
|
|
33
31
|
}
|
|
@@ -45,8 +43,6 @@ import{css}from"lit";const styles=css`
|
|
|
45
43
|
var(--lr-color-brand)
|
|
46
44
|
);
|
|
47
45
|
}
|
|
48
|
-
/* Declared before the :disabled rule below, which restates background/color at equal
|
|
49
|
-
specificity, so a disabled arrow stays flat whatever the pointer does to it. */
|
|
50
46
|
[part='move-up-button']:active,
|
|
51
47
|
[part='move-down-button']:active {
|
|
52
48
|
background: var(
|
|
@@ -5,10 +5,6 @@ import{css}from"lit";const styles=css`
|
|
|
5
5
|
max-inline-size: 100%;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
/* [part="base"] is display:none whenever the panel isn't open, in both
|
|
9
|
-
presentations -- a docked (inline) panel can be toggled closed just like
|
|
10
|
-
an overlay one, it just doesn't need backdrop/focus-trap/scroll-lock
|
|
11
|
-
mechanics to do it. */
|
|
12
8
|
[part='base'] {
|
|
13
9
|
display: none;
|
|
14
10
|
min-inline-size: 0;
|
|
@@ -23,8 +19,6 @@ import{css}from"lit";const styles=css`
|
|
|
23
19
|
inset: 0;
|
|
24
20
|
z-index: var(--lr-overlay-stack-index, var(--lr-layer-modal));
|
|
25
21
|
}
|
|
26
|
-
/* Bottom-sheet anchors its panel to the block-end edge instead of
|
|
27
|
-
stretching it full-height like fullscreen does. */
|
|
28
22
|
:host([variant='bottom-sheet'][open]) [part='base'].overlay {
|
|
29
23
|
align-items: flex-end;
|
|
30
24
|
}
|
|
@@ -45,18 +39,12 @@ import{css}from"lit";const styles=css`
|
|
|
45
39
|
background: var(--lr-color-surface);
|
|
46
40
|
}
|
|
47
41
|
|
|
48
|
-
/* Inline (docked) presentation: a normal panel in the page's layout flow,
|
|
49
|
-
bordered like a card so it reads as a distinct region. */
|
|
50
42
|
[part='base']:not(.overlay) [part='panel'] {
|
|
51
43
|
border: var(--lr-border-width-thin) solid var(--lr-color-border);
|
|
52
44
|
border-radius: var(--lr-radius);
|
|
53
45
|
overflow: auto;
|
|
54
46
|
}
|
|
55
47
|
|
|
56
|
-
/* Overlay/fullscreen (default variant): the panel fills the entire
|
|
57
|
-
viewport edge-to-edge -- no backdrop is visible around it, but the
|
|
58
|
-
backdrop element still renders/still matters for the shared
|
|
59
|
-
Escape/backdrop-click dismissal wiring described on the class. */
|
|
60
48
|
[part='base'].overlay [part='panel'] {
|
|
61
49
|
inline-size: 100%;
|
|
62
50
|
block-size: 100%;
|
|
@@ -65,16 +53,10 @@ import{css}from"lit";const styles=css`
|
|
|
65
53
|
padding-block-end: var(--lr-safe-area-bottom);
|
|
66
54
|
padding-inline-start: var(--lr-safe-area-inline-start);
|
|
67
55
|
padding-inline-end: var(--lr-safe-area-inline-end);
|
|
68
|
-
/* Only the OVERLAY presentations repaint the panel: docked/inline is resting chrome in the
|
|
69
|
-
page's own flow and must keep the page surface, while an overlay sits over a scrim and in
|
|
70
|
-
dark mode would otherwise be the same near-black as the page behind it. The bottom-sheet
|
|
71
|
-
rule below narrows this same selector, so it inherits both declarations. */
|
|
72
56
|
background: var(
|
|
73
57
|
--lr-responsive-panel-overlay-panel-bg,
|
|
74
58
|
var(--lr-color-surface-overlay)
|
|
75
59
|
);
|
|
76
|
-
/* Modal layer, lower step: the panel is flush with every viewport edge (bottom-sheet with all
|
|
77
|
-
but one), so there is no free edge for a deeper shadow to read against. */
|
|
78
60
|
box-shadow: var(
|
|
79
61
|
--lr-responsive-panel-overlay-panel-shadow,
|
|
80
62
|
var(--lr-shadow-l)
|
|
@@ -82,21 +64,12 @@ import{css}from"lit";const styles=css`
|
|
|
82
64
|
overflow: auto;
|
|
83
65
|
}
|
|
84
66
|
|
|
85
|
-
/* Overlay/bottom-sheet: a partial-height sheet, rounded only on the top
|
|
86
|
-
edge, that leaves the backdrop (and whatever page content sits behind
|
|
87
|
-
it) visible above it. */
|
|
88
67
|
:host([variant='bottom-sheet']) [part='base'].overlay [part='panel'] {
|
|
89
68
|
block-size: auto;
|
|
90
69
|
max-block-size: var(--lr-responsive-panel-sheet-max-block-size, 85vh);
|
|
91
70
|
border-start-start-radius: var(--lr-radius);
|
|
92
71
|
border-start-end-radius: var(--lr-radius);
|
|
93
72
|
}
|
|
94
|
-
/* Dynamic-viewport refinement of the clamp above, so a mobile browser's
|
|
95
|
-
collapsing address bar doesn't leave the sheet taller than the visible
|
|
96
|
-
viewport. Guarded by @supports rather than written as a second plain
|
|
97
|
-
declaration: once the value comes from a custom property, an unsupported
|
|
98
|
-
dvh unit fails at computed-value time and resets max-block-size to none
|
|
99
|
-
instead of falling back to the preceding vh declaration. */
|
|
100
73
|
@supports (max-block-size: 1dvh) {
|
|
101
74
|
:host([variant='bottom-sheet']) [part='base'].overlay [part='panel'] {
|
|
102
75
|
max-block-size: var(--lr-responsive-panel-sheet-max-block-size, 85dvh);
|
|
@@ -3,11 +3,6 @@ import{css}from"lit";const styles=css`
|
|
|
3
3
|
display: block;
|
|
4
4
|
min-inline-size: 0;
|
|
5
5
|
max-inline-size: 100%;
|
|
6
|
-
/* --lr-scroller-shadow-color/-size are the Lyra-prefixed aliases of the upstream
|
|
7
|
-
--shadow-color/--shadow-size cssprops (see the class JSDoc) -- resolved once here so every
|
|
8
|
-
edge-shadow rule below reads one effective value instead of repeating the full three-level
|
|
9
|
-
fallback chain at each use site, same indirection lr-split-panel/lr-dock-panel already use
|
|
10
|
-
for their own component-scoped tokens. */
|
|
11
6
|
--_lr-scroller-effective-shadow-color: var(
|
|
12
7
|
--lr-scroller-shadow-color,
|
|
13
8
|
var(--shadow-color, var(--lr-color-surface))
|
|
@@ -113,11 +108,6 @@ import{css}from"lit";const styles=css`
|
|
|
113
108
|
}
|
|
114
109
|
|
|
115
110
|
[part~="control"] {
|
|
116
|
-
/* Keep the glyph-sized control compact by default (--lr-scroller-control-size
|
|
117
|
-
is a consumer-tunable custom property, not this floor) while still giving the
|
|
118
|
-
interactive box the shared minimum target size -- same "small glyph, padded hit
|
|
119
|
-
box" pattern as lr-code-block's/lr-json-viewer's [part='toggle']. Covers
|
|
120
|
-
both previous and next (the shared part on both, per csspart doc above). */
|
|
121
111
|
display: inline-grid;
|
|
122
112
|
place-items: center;
|
|
123
113
|
inline-size: var(--lr-scroller-control-size, var(--lr-size-2rem));
|
|
@@ -136,8 +126,6 @@ import{css}from"lit";const styles=css`
|
|
|
136
126
|
background: var(--lr-color-brand-quiet);
|
|
137
127
|
}
|
|
138
128
|
|
|
139
|
-
/* Held down, the control scrolls repeatedly, so the press is the long-lived state here rather
|
|
140
|
-
than an instant -- the deeper mix of the same brand-quiet fill marks it for its duration. */
|
|
141
129
|
[part~="control"]:active:not(:disabled) {
|
|
142
130
|
background: color-mix(
|
|
143
131
|
in oklab,
|
|
@@ -146,19 +134,11 @@ import{css}from"lit";const styles=css`
|
|
|
146
134
|
);
|
|
147
135
|
}
|
|
148
136
|
|
|
149
|
-
/* no-pressed-state: the viewport is a scroll port, not a target -- pressing it activates
|
|
150
|
-
nothing, and :active matches the ancestors of whatever was pressed, so clicking any slotted
|
|
151
|
-
item would flash this outline around the whole strip. */
|
|
152
137
|
[part="viewport"]:hover {
|
|
153
138
|
outline: var(--lr-border-width-thin) solid var(--lr-color-border);
|
|
154
139
|
outline-offset: var(--lr-focus-ring-offset);
|
|
155
140
|
}
|
|
156
141
|
|
|
157
|
-
/* previous/next are the same rendered button as [part='control'] above (each
|
|
158
|
-
button's part attribute carries both tokens, e.g. part="control previous", so
|
|
159
|
-
this needs the token-matching ~= form, not =, to actually hit it) -- this
|
|
160
|
-
restates the identical floor directly against each individual part name too,
|
|
161
|
-
since a shadow-part guard lookup is per-name, not per-rendered-element. */
|
|
162
142
|
[part~="previous"],
|
|
163
143
|
[part~="next"] {
|
|
164
144
|
min-inline-size: var(--lr-icon-button-size);
|
|
@@ -98,7 +98,13 @@ export declare class LyraSegmented extends LyraElement<LyraSegmentedEventMap> {
|
|
|
98
98
|
size: LyraSize;
|
|
99
99
|
private selectedItem?;
|
|
100
100
|
private rehomeSegmentFocus;
|
|
101
|
-
|
|
101
|
+
/** Gates the [part="base"] edge fade on the track genuinely overflowing, with one-sided/RTL-aware
|
|
102
|
+
* logical-edge state -- see --lr-scroll-fade-size and segmented.styles.ts. Stored (rather than a
|
|
103
|
+
* bare statement-expression call) so `updated()` can register each segment on the controller's
|
|
104
|
+
* own `ResizeObserver` via `observeExtra()` below -- a segment's own intrinsic content (a longer
|
|
105
|
+
* localized label, an icon loading in) can grow scrollWidth without [part="base"]'s own border
|
|
106
|
+
* box changing at all, which the plain per-track observation alone cannot see. */
|
|
107
|
+
private scrollOverflow;
|
|
102
108
|
private select;
|
|
103
109
|
private segmentButtonAt;
|
|
104
110
|
private focusItem;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{repeat}from"lit/directives/repeat.js";import{LyraElement}from"../../../internal/lyra-element.js";import{sizes}from"../../../internal/sizes.styles.js";import{isRtl}from"../../../internal/rtl.js";import{prefersReducedMotion}from"../../../internal/motion.js";import{observeScrollOverflow}from"../../../internal/scroll-overflow.js";import{hostAriaLabel}from"../../../internal/a11y.js";import{styles}from"./segmented.styles.js";import{activeElementIn}from"../../../internal/active-element.js";const MAX_SEGMENTED_ITEMS=256;function snapshotSegmentedItems(value){try{if(!Array.isArray(value))return Object.freeze([])}catch{return Object.freeze([])}const seenValues=new Set,normalized=[];let length=0;try{length=Math.min(value.length,MAX_SEGMENTED_ITEMS)}catch{return Object.freeze(normalized)}for(let index=0;index<length;index+=1)try{const candidate=value[index];if(!candidate||typeof candidate!="object")continue;const record=candidate,itemValue=record.value,label=record.label,disabled=record.disabled,icon=record.icon;if(typeof itemValue!="string"||itemValue.length===0||itemValue!==itemValue.trim()||seenValues.has(itemValue)||typeof label!="string"||disabled!==void 0&&typeof disabled!="boolean")continue;seenValues.add(itemValue),normalized.push(Object.freeze({value:itemValue,label,...icon!==void 0?{icon}:{},...disabled!==void 0?{disabled}:{}}))}catch{}return Object.freeze(normalized)}class LyraSegmented extends LyraElement{
|
|
1
|
+
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{repeat}from"lit/directives/repeat.js";import{LyraElement}from"../../../internal/lyra-element.js";import{sizes}from"../../../internal/sizes.styles.js";import{isRtl}from"../../../internal/rtl.js";import{prefersReducedMotion}from"../../../internal/motion.js";import{observeScrollOverflow}from"../../../internal/scroll-overflow.js";import{hostAriaLabel}from"../../../internal/a11y.js";import{styles}from"./segmented.styles.js";import{activeElementIn}from"../../../internal/active-element.js";const MAX_SEGMENTED_ITEMS=256;function snapshotSegmentedItems(value){try{if(!Array.isArray(value))return Object.freeze([])}catch{return Object.freeze([])}const seenValues=new Set,normalized=[];let length=0;try{length=Math.min(value.length,MAX_SEGMENTED_ITEMS)}catch{return Object.freeze(normalized)}for(let index=0;index<length;index+=1)try{const candidate=value[index];if(!candidate||typeof candidate!="object")continue;const record=candidate,itemValue=record.value,label=record.label,disabled=record.disabled,icon=record.icon;if(typeof itemValue!="string"||itemValue.length===0||itemValue!==itemValue.trim()||seenValues.has(itemValue)||typeof label!="string"||disabled!==void 0&&typeof disabled!="boolean")continue;seenValues.add(itemValue),normalized.push(Object.freeze({value:itemValue,label,...icon!==void 0?{icon}:{},...disabled!==void 0?{disabled}:{}}))}catch{}return Object.freeze(normalized)}class LyraSegmented extends LyraElement{constructor(){super(...arguments),this.effectiveItems=Object.freeze([]),this.value="",this.label="",this.size="m",this.rehomeSegmentFocus=!1,this.scrollOverflow=observeScrollOverflow(this,()=>this.renderRoot.querySelector('[part="base"]')),this.onKeyDown=e=>{const navigable=this.items.map((item,index)=>({item,index})).filter(({item})=>!item.disabled);if(navigable.length===0)return;const focusedIndex=this.keyboardOriginIndex(e),selectedIndex=this.items.indexOf(this.selectedItem),originIndex=focusedIndex>=0?focusedIndex:selectedIndex,currentIndex=selectedIndex<0&&this.segmentButtonAt(originIndex)?.tabIndex===0?-1:navigable.findIndex(({index})=>index===originIndex),rtl=isRtl(this),forwardKey=rtl?"ArrowLeft":"ArrowRight",backwardKey=rtl?"ArrowRight":"ArrowLeft";let targetIndex;switch(e.key){case forwardKey:targetIndex=currentIndex<0?0:(currentIndex+1)%navigable.length;break;case backwardKey:targetIndex=currentIndex<0?navigable.length-1:(currentIndex-1+navigable.length)%navigable.length;break;case"Home":targetIndex=0;break;case"End":targetIndex=navigable.length-1;break;default:return}e.preventDefault();const target=navigable[targetIndex];this.select(target.item),this.focusItem(target.index)}}static{this.styles=[LyraElement.styles,sizes,styles]}get items(){return this.effectiveItems}set items(value){const previous=this.effectiveItems;this.effectiveItems=snapshotSegmentedItems(value),this.requestUpdate("items",previous)}select(item){if(item.disabled||item===this.selectedItem)return;const valueChanged=item.value!==this.value;this.selectedItem=item,valueChanged&&(this.value=item.value,this.emit("lr-change",{value:item.value}))}segmentButtonAt(index){return this.renderRoot.querySelector(`[part="segment"][data-index="${index}"]`)}focusItem(index){this.segmentButtonAt(index)?.focus()}scrollToValue(value){const index=this.items.findIndex(item=>item.value===value);this.segmentButtonAt(index)?.scrollIntoView({block:"nearest",inline:"nearest",behavior:prefersReducedMotion(this.ownerDocument.defaultView)?"auto":"smooth"})}updated(changed){super.updated(changed),this.scrollOverflow.observeExtra(this.renderRoot.querySelectorAll('[part="segment"]')),this.rehomeSegmentFocus&&(this.rehomeSegmentFocus=!1,this.renderRoot.querySelector('[part="segment"][tabindex="0"]')?.focus()),changed.has("value")&&changed.get("value")!==void 0&&this.value&&this.scrollToValue(this.value)}willUpdate(changed){super.willUpdate(changed),changed.has("items")&&activeElementIn(this.renderRoot)?.getAttribute("part")==="segment"&&(this.rehomeSegmentFocus=!0),(changed.has("value")||changed.has("items")&&(!this.selectedItem||!this.items.includes(this.selectedItem)||this.selectedItem.value!==this.value||this.selectedItem.disabled))&&(this.selectedItem=this.items.find(item=>item.value===this.value&&!item.disabled))}keyboardOriginIndex(event){const fromEvent=event.composedPath().find(candidate2=>candidate2.nodeType===1&&candidate2.getAttribute?.("part")==="segment"&&candidate2.getRootNode()===this.renderRoot),focused=activeElementIn(this.renderRoot),candidate=fromEvent??(focused?.getAttribute("part")==="segment"?focused:void 0),index=Number(candidate?.dataset.index);return Number.isInteger(index)&&index>=0&&index<this.items.length?index:-1}render(){const ariaLabel=hostAriaLabel(this)??(this.label||nothing),selectedIndex=this.items.indexOf(this.selectedItem),fallbackSelectedIndex=selectedIndex>=0?selectedIndex:this.items.findIndex(item=>item.value===this.value&&!item.disabled),tabbableIndex=fallbackSelectedIndex!==-1?fallbackSelectedIndex:this.items.findIndex(item=>!item.disabled);return html`
|
|
2
2
|
<div
|
|
3
3
|
part="base"
|
|
4
4
|
role="radiogroup"
|