@aceshooting/lyra-ui 9.1.1 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +785 -0
- package/custom-elements.json +1 -1
- package/design-tokens.json +13 -0
- package/dist/cli/migrate-wa.mjs +216 -1
- package/dist/cli/migration-contract.json +1 -1
- package/dist/components/agent-tools/activity-feed/activity-feed.class.js +1 -1
- 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 +7 -5
- 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.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.styles.js +3 -5
- 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.styles.js +0 -46
- package/dist/components/agent-tools/eval-dataset/eval-dataset.styles.js +0 -7
- package/dist/components/agent-tools/evaluation-run/evaluation-run.class.js +2 -2
- 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 +0 -3
- 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 +0 -3
- 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.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.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.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.styles.js +7 -31
- package/dist/components/charts/chart/box-plot.class.d.ts +27 -0
- package/dist/components/charts/chart/box-plot.class.js +14 -4
- package/dist/components/charts/chart/box-plot.styles.js +28 -20
- 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 +120 -0
- package/dist/components/charts/chart/chart.class.js +16 -6
- package/dist/components/charts/chart/chart.styles.js +28 -27
- 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/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.styles.js +7 -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/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 +0 -23
- 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.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/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 +117 -1
- 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.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 +0 -105
- 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.d.ts +71 -3
- package/dist/components/forms/combobox/combobox.class.js +5 -3
- package/dist/components/forms/combobox/combobox.styles.js +31 -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 +47 -0
- package/dist/components/forms/date-picker/date-picker.class.js +36 -22
- package/dist/components/forms/date-picker/date-picker.styles.js +82 -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 +0 -37
- 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 +3 -11
- 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.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.styles.js +0 -63
- 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 +1 -1
- package/dist/components/media/attachment-chip/attachment-chip.styles.js +0 -31
- package/dist/components/media/attachment-trigger/attachment-trigger.class.js +3 -3
- 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.styles.js +3 -24
- package/dist/components/media/flag/flag.class.d.ts +23 -1
- 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 +0 -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 +178 -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 +0 -11
- 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 +32 -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.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 +28 -4
- 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 +1 -1
- package/dist/components/overlays/popup/popup.class.d.ts +1 -0
- package/dist/components/overlays/popup/popup.class.js +1 -1
- 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 +0 -3
- 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.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/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/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 +0 -16
- 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.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.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.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/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.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.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 +72 -40
- 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 +27 -4
- package/dist/internal/dev-mode-attribute-warning.js +1 -1
- package/dist/internal/localization-runtime.js +1 -1
- package/dist/internal/localization-types.d.ts +1 -1
- package/dist/internal/localization.js +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 +20 -113
- package/dist/lyra.d.ts +9 -6
- package/dist/styles/reservations.css +82 -0
- package/dist/svelte.d.ts +72 -40
- 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 +72 -40
- 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 +7 -4
- package/llms/components/lr-av-player.md +3 -1
- package/llms/components/lr-avatar.md +6 -6
- package/llms/components/lr-bar-chart.md +8 -6
- package/llms/components/lr-box-plot.md +15 -4
- package/llms/components/lr-browser-frame.md +7 -3
- package/llms/components/lr-bubble-chart.md +8 -6
- package/llms/components/lr-calendar.md +9 -2
- package/llms/components/lr-card.md +24 -0
- package/llms/components/lr-chart.md +45 -11
- 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 +47 -8
- 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-date-input.md +22 -2
- package/llms/components/lr-date-picker.md +23 -3
- package/llms/components/lr-details.md +11 -2
- package/llms/components/lr-dialog.md +16 -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 +8 -6
- 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 +30 -8
- package/llms/components/lr-heatmap.md +46 -0
- package/llms/components/lr-histogram.md +7 -4
- 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 +8 -6
- package/llms/components/lr-lite-chart.md +16 -6
- package/llms/components/lr-map.md +91 -10
- 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 +46 -7
- package/llms/components/lr-pdf-viewer.md +62 -2
- package/llms/components/lr-pie-chart.md +8 -6
- package/llms/components/lr-polar-area-chart.md +8 -6
- package/llms/components/lr-popover.md +25 -1
- 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 +8 -6
- 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 +8 -6
- 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/peers.md +12 -2
- package/llms/shared.md +70 -2
- package/llms/tokens.md +15 -1
- package/llms-full.txt +1335 -306
- package/package.json +17 -5
- package/vscode-css-data.json +93 -2
- package/vscode-html-data.json +513 -59
- package/web-types.json +457 -72
|
@@ -101,6 +101,18 @@ export interface LyraFileInputEventMap {
|
|
|
101
101
|
* @csspart file-name - Selected filename.
|
|
102
102
|
* @csspart file-size - Localized selected-file size.
|
|
103
103
|
* @csspart remove-button - Removes one selected file.
|
|
104
|
+
* @cssstate required - Matches while `required` is set. Style with `lr-file-input:state(required)`.
|
|
105
|
+
* @cssstate optional - Matches while `required` is not set — the complement of `required`.
|
|
106
|
+
* @cssstate valid - Matches while the control satisfies its constraints — `required`, every entry
|
|
107
|
+
* in `validators`, and any `setCustomValidity()` error.
|
|
108
|
+
* @cssstate invalid - Matches while it does not — from the very first render, before the user has
|
|
109
|
+
* touched anything. Neither this nor `user-invalid` matches while the control is barred from
|
|
110
|
+
* constraint validation (disabled, or inside a disabled fieldset).
|
|
111
|
+
* @cssstate user-valid - `valid`, but only after the user has interacted: choosing or dropping
|
|
112
|
+
* files, removing one, a blur, or a `reportValidity()` call (which is what a submit attempt runs).
|
|
113
|
+
* @cssstate user-invalid - `invalid` after that same interaction. Style validation errors with this
|
|
114
|
+
* rather than `invalid`: a pristine required file input is genuinely invalid, but colouring it red
|
|
115
|
+
* before the user has done anything is hostile.
|
|
104
116
|
* @cssstate blank - Matches while no files are selected.
|
|
105
117
|
* @cssstate dragging - Matches during an active file drag session.
|
|
106
118
|
* @cssprop [--lr-file-input-font-size=var(--lr-form-control-font-size)] - Label and selected-filename
|
|
@@ -4,11 +4,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
4
4
|
min-inline-size: 0;
|
|
5
5
|
max-inline-size: 100%;
|
|
6
6
|
--_lr-file-input-font-size: var(--lr-form-control-font-size);
|
|
7
|
-
/* The dropzone's own ladder. sizes.styles.ts only carries the six shared --lr-form-control-*
|
|
8
|
-
knobs, which describe a single-line row control; this is a block drop target whose
|
|
9
|
-
instructional text, glyph, padding and detail text each need their own tier or size ends up
|
|
10
|
-
resizing the label alone. These :host values ARE the m/medium tier, so an unset or
|
|
11
|
-
default-size control renders exactly as it did before the ladder existed. */
|
|
12
7
|
--_lr-file-input-dropzone-font-size: var(--lr-font-size-md-sm);
|
|
13
8
|
--_lr-file-input-dropzone-icon-size: var(--lr-font-size-xl);
|
|
14
9
|
--_lr-file-input-dropzone-padding: var(--lr-space-l);
|
|
@@ -44,6 +39,7 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
44
39
|
[part="form-control"] {
|
|
45
40
|
min-inline-size: 0;
|
|
46
41
|
max-inline-size: 100%;
|
|
42
|
+
block-size: 100%;
|
|
47
43
|
}
|
|
48
44
|
[part~="form-control-label"] {
|
|
49
45
|
display: block;
|
|
@@ -58,18 +54,17 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
58
54
|
[part="error"][hidden] {
|
|
59
55
|
display: none;
|
|
60
56
|
}
|
|
61
|
-
/* This control accepts a required attribute and renders a visible label like every other field
|
|
62
|
-
in the library, so it marks it the same way -- the [hidden] rule above is what keeps the
|
|
63
|
-
marker from orphaning a stray glyph when no label is set. */
|
|
64
57
|
${formControlRequiredMarker}
|
|
65
58
|
.dropzone {
|
|
66
59
|
position: relative;
|
|
67
60
|
display: grid;
|
|
68
61
|
min-inline-size: 0;
|
|
62
|
+
block-size: 100%;
|
|
69
63
|
}
|
|
70
64
|
[part~="base"] {
|
|
71
65
|
grid-area: 1 / 1;
|
|
72
66
|
inline-size: 100%;
|
|
67
|
+
block-size: 100%;
|
|
73
68
|
min-inline-size: var(--lr-icon-button-size);
|
|
74
69
|
min-block-size: var(--lr-icon-button-size);
|
|
75
70
|
box-sizing: border-box;
|
|
@@ -132,11 +127,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
132
127
|
min-inline-size: 0;
|
|
133
128
|
pointer-events: auto;
|
|
134
129
|
}
|
|
135
|
-
/* Density escape -- same convention as lr-empty's compact. A --lr-space-l dropzone is unusable in
|
|
136
|
-
a toolbar or a table cell; compact shrinks the padding, gap and label font so the zone fits a
|
|
137
|
-
tight row. The tuned values sit behind inline var() fallbacks (rather than a :host declaration,
|
|
138
|
-
which every instance re-declares and so shadows any ancestor value) so a consumer can retune
|
|
139
|
-
them from outside; the fallbacks preserve today's rendering for an unset dropzone. */
|
|
140
130
|
:host([compact]) [part~="base"] {
|
|
141
131
|
padding: var(--lr-file-input-compact-padding, var(--lr-space-s));
|
|
142
132
|
font-size: var(--lr-file-input-compact-font-size, var(--lr-font-size-sm));
|
|
@@ -149,11 +139,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
149
139
|
);
|
|
150
140
|
font-size: var(--lr-file-input-compact-font-size, var(--lr-font-size-sm));
|
|
151
141
|
}
|
|
152
|
-
/* Inline var() fallbacks (rather than :host-declared properties, which every instance would
|
|
153
|
-
re-declare and so shadow any ancestor value) so a consumer can retint just this dropzone's
|
|
154
|
-
drag accept/reject highlight without hijacking the shared --lr-color-success/--lr-color-danger
|
|
155
|
-
tokens used everywhere else in their theme. Unset, each falls back to the same value this
|
|
156
|
-
rendered before the hatch existed, so the default rendering is unchanged. */
|
|
157
142
|
[part~="base"][data-drag-state="accept"] {
|
|
158
143
|
border-color: var(
|
|
159
144
|
--lr-file-input-accept-border-color,
|
|
@@ -194,10 +179,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
194
179
|
:host(:not(:disabled)) .dropzone:hover [part~="base"] {
|
|
195
180
|
border-color: var(--lr-color-brand);
|
|
196
181
|
}
|
|
197
|
-
/* [part~='base'] is the button that opens the file dialog, so the press is a real activation and
|
|
198
|
-
needs its own answer -- the hover border alone repeats what hover already said. Both selector
|
|
199
|
-
shapes are mirrored because the pointer can be over the button itself or over the
|
|
200
|
-
pointer-events: none content stacked on top of it in the same grid cell. */
|
|
201
182
|
:host(:not(:disabled)) [part~="base"]:active {
|
|
202
183
|
border-color: var(--lr-color-brand);
|
|
203
184
|
background: color-mix(
|
|
@@ -222,8 +203,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
222
203
|
opacity: var(--lr-opacity-disabled);
|
|
223
204
|
cursor: not-allowed;
|
|
224
205
|
}
|
|
225
|
-
/* Visible per-file rejection feedback, rendered alongside (not instead of) the sr-only status
|
|
226
|
-
count summary -- see file-input.class.ts's rejectionMessage(). */
|
|
227
206
|
[part="rejection"] {
|
|
228
207
|
min-inline-size: 0;
|
|
229
208
|
max-inline-size: 100%;
|
|
@@ -25,7 +25,9 @@ export declare function setFlagUrlResolver(value: LyraFlagUrlResolver | Promise<
|
|
|
25
25
|
* a representative country). While that peer package's `flagUrl()` resolves,
|
|
26
26
|
* the host carries `aria-busy="true"`; a decorative skeleton and ordinary, non-live localized
|
|
27
27
|
* loading text render in its place. A missing or failed peer resolver fails closed with a localized visible error and a
|
|
28
|
-
* shared light-DOM assertive announcement
|
|
28
|
+
* shared light-DOM assertive announcement, plus a one-time `console.warn` naming the code and the
|
|
29
|
+
* `flag-peer.js` import that registers a resolver -- the visible error alone cannot tell a
|
|
30
|
+
* developer that the fix is a missing import rather than missing flag data;
|
|
29
31
|
* an installed resolver returning no URL for an unknown code remains a valid
|
|
30
32
|
* empty result.
|
|
31
33
|
*
|
|
@@ -53,6 +55,12 @@ export declare function setFlagUrlResolver(value: LyraFlagUrlResolver | Promise<
|
|
|
53
55
|
* @example <lr-flag country="es" fidelity="compact"></lr-flag>
|
|
54
56
|
* @example <lr-flag country="es" fidelity="detailed" shape="circle"></lr-flag>
|
|
55
57
|
* @csspart image - The underlying <img>.
|
|
58
|
+
* @slot fallback - Rendered in place of the flag when `country`/`language` cannot resolve to a
|
|
59
|
+
* current flag (an unassigned, historical, or malformed code). Wins over the `fallback` property.
|
|
60
|
+
* Distinct from the peer-resolver failure that produces `[part="error"]`: an unresolvable code is
|
|
61
|
+
* data, not a defect.
|
|
62
|
+
* @csspart fallback-image - The `fallback` property's placeholder image, when no `fallback` slot
|
|
63
|
+
* content is supplied.
|
|
56
64
|
* @csspart error - Ordinary localized visible error rendered when the optional peer resolver is
|
|
57
65
|
* unavailable or fails; each fresh resolution failure appends the same localized message to the
|
|
58
66
|
* shared light-DOM assertive announcement sink.
|
|
@@ -66,6 +74,13 @@ export declare class LyraFlag extends LyraElement {
|
|
|
66
74
|
static styles: import("lit").CSSResultGroup[];
|
|
67
75
|
/** ISO 3166-1 alpha-2 country code (e.g. `fr`, `us`). Takes precedence over `language`. */
|
|
68
76
|
country?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Placeholder image URL rendered in place of a flag when the code cannot resolve — a historical
|
|
79
|
+
* or defunct state in a longitudinal dataset, say. Unset renders the `fallback` slot's content
|
|
80
|
+
* instead, or nothing at all, so the element still occupies its normal footprint in a table or
|
|
81
|
+
* card grid rather than showing error wording.
|
|
82
|
+
*/
|
|
83
|
+
fallback?: string;
|
|
69
84
|
/** BCP-47-ish language tag (e.g. `en`, `en-US`) resolved to a country flag. */
|
|
70
85
|
language?: string;
|
|
71
86
|
/**
|
|
@@ -124,6 +139,13 @@ export declare class LyraFlag extends LyraElement {
|
|
|
124
139
|
/** True while the effective source is resolving or its native image is loading. */
|
|
125
140
|
get loading(): boolean;
|
|
126
141
|
private get code();
|
|
142
|
+
/**
|
|
143
|
+
* True when the component has a `country`/`language` to resolve but no flag can be produced for
|
|
144
|
+
* it — an unassigned, historical, or malformed code. Distinct from the peer-resolver failure that
|
|
145
|
+
* drives `data-error`: a dissolved federation in a longitudinal dataset is *data*, not a bug, and
|
|
146
|
+
* a consumer needs to style the two apart.
|
|
147
|
+
*/
|
|
148
|
+
private get unresolved();
|
|
127
149
|
connectedCallback(): void;
|
|
128
150
|
disconnectedCallback(): void;
|
|
129
151
|
adoptedCallback(): void;
|
|
@@ -1,4 +1,6 @@
|
|
|
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}from"lit";import{property,state}from"lit/decorators.js";import{keyed}from"lit/directives/keyed.js";import{LyraElement}from"../../../internal/lyra-element.js";import{getDisplayNames}from"../../../internal/intl-cache.js";import{hostAriaLabel,srOnly}from"../../../internal/a11y.js";import{safeMediaSrc}from"../../../internal/safe-url.js";import{styles}from"./flag.styles.js";import{ALPHA2_RE,languageToCountry}from"./language-map.js";import"../../overlays/skeleton/skeleton.class.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{LYRA_DEFAULT_collapse,LYRA_DEFAULT_details,LYRA_DEFAULT_flagLoadError,LYRA_DEFAULT_loading,LYRA_DEFAULT_map,LYRA_DEFAULT_navigation,LYRA_DEFAULT_open,LYRA_DEFAULT_popover,LYRA_DEFAULT_progress,LYRA_DEFAULT_search,LYRA_DEFAULT_select}from"../../../internal/default-strings.generated.js";const FLAG_LOAD_ERROR_KEY="flagLoadError",FLAG_FIDELITIES=new Set(["compact","standard","detailed"]),FLAG_SHAPES=new Set(["rect","circle"]);function normalizeFlagFidelity(value){return FLAG_FIDELITIES.has(value)?value:"standard"}function normalizeFlagShape(value){return FLAG_SHAPES.has(value)?value:"rect"}function resolverFromModule(module){try{if(typeof module=="object"&&module!==null||typeof module=="function"){const named=module.flagUrl;if(typeof named=="function")return named;const fallback=module.default??module;if(typeof fallback=="function")return fallback;if(typeof fallback=="object"&&fallback!==null){const defaultNamed=fallback.flagUrl;if(typeof defaultNamed=="function")return defaultNamed}}}catch{}return null}async function loadFlagUrl(importFlags){try{const resolver=resolverFromModule(await importFlags());if(resolver)return resolver;throw new TypeError("The flag peer does not expose a callable flagUrl capability.")}catch{return console.warn("<lr-flag> needs the optional peer dependency '@aceshooting/lyra-flags' to render flag images \u2014 install it with `pnpm add @aceshooting/lyra-flags`."),null}}function displayNameFor(code,locale){try{return getDisplayNames(locale,{type:"region"}).of(code.toUpperCase())??code.toUpperCase()}catch{return code.toUpperCase()}}let flagUrlResolver,flagResolverGeneration=0;const flagResolverSubscribers=new Set;function setFlagUrlResolver(value){flagUrlResolver=value===null?Promise.resolve(null):Promise.resolve(value),flagResolverGeneration++;for(const subscriber of[...flagResolverSubscribers])subscriber(flagResolverGeneration)}function loadFlagUrlResolver(){return flagUrlResolver||(flagUrlResolver=Promise.resolve(null)),flagUrlResolver}class LyraFlag extends LyraElement{constructor(){super(...arguments),this._shape="rect",this._fidelity="standard",this.sourceState=Object.freeze({status:"idle",identity:"idle"}),this.resolverGeneration=flagResolverGeneration,this.sourceRestartPending=!0,this.activeSourceRequest=0,this.resolveToken=0,this.onResolverGeneration=generation=>{!this.isConnected||generation===this.resolverGeneration||(this.resolverGeneration=generation)}}static{this.defaultStrings={...super.defaultStrings,collapse:LYRA_DEFAULT_collapse,details:LYRA_DEFAULT_details,flagLoadError:LYRA_DEFAULT_flagLoadError,loading:LYRA_DEFAULT_loading,map:LYRA_DEFAULT_map,navigation:LYRA_DEFAULT_navigation,open:LYRA_DEFAULT_open,popover:LYRA_DEFAULT_popover,progress:LYRA_DEFAULT_progress,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select}}static{this.styles=[LyraElement.styles,styles,srOnly]}get shape(){return this._shape}set shape(value){const old=this._shape;this._shape=normalizeFlagShape(value),this.requestUpdate("shape",old)}get fidelity(){return this._fidelity}set fidelity(value){const old=this._fidelity;this._fidelity=normalizeFlagFidelity(value),this.requestUpdate("fidelity",old)}get effectiveFidelity(){return normalizeFlagFidelity(this.fidelity)}get loading(){return this.sourceState.status==="loading"}get code(){if(this.country)return ALPHA2_RE.test(this.country)?this.country.toLowerCase():
|
|
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{keyed}from"lit/directives/keyed.js";import{LyraElement}from"../../../internal/lyra-element.js";import{getDisplayNames}from"../../../internal/intl-cache.js";import{hostAriaLabel,srOnly}from"../../../internal/a11y.js";import{safeMediaSrc}from"../../../internal/safe-url.js";import{styles}from"./flag.styles.js";import{ALPHA2_RE,alpha3ToAlpha2,languageToCountry}from"./language-map.js";import"../../overlays/skeleton/skeleton.class.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{LYRA_DEFAULT_collapse,LYRA_DEFAULT_details,LYRA_DEFAULT_flagLoadError,LYRA_DEFAULT_loading,LYRA_DEFAULT_map,LYRA_DEFAULT_navigation,LYRA_DEFAULT_open,LYRA_DEFAULT_popover,LYRA_DEFAULT_progress,LYRA_DEFAULT_search,LYRA_DEFAULT_select}from"../../../internal/default-strings.generated.js";const FLAG_LOAD_ERROR_KEY="flagLoadError",FLAG_FIDELITIES=new Set(["compact","standard","detailed"]),FLAG_SHAPES=new Set(["rect","circle"]);function normalizeFlagFidelity(value){return FLAG_FIDELITIES.has(value)?value:"standard"}function normalizeFlagShape(value){return FLAG_SHAPES.has(value)?value:"rect"}function resolverFromModule(module){try{if(typeof module=="object"&&module!==null||typeof module=="function"){const named=module.flagUrl;if(typeof named=="function")return named;const fallback=module.default??module;if(typeof fallback=="function")return fallback;if(typeof fallback=="object"&&fallback!==null){const defaultNamed=fallback.flagUrl;if(typeof defaultNamed=="function")return defaultNamed}}}catch{}return null}async function loadFlagUrl(importFlags){try{const resolver=resolverFromModule(await importFlags());if(resolver)return resolver;throw new TypeError("The flag peer does not expose a callable flagUrl capability.")}catch{return console.warn("<lr-flag> needs the optional peer dependency '@aceshooting/lyra-flags' to render flag images \u2014 install it with `pnpm add @aceshooting/lyra-flags`."),null}}function displayNameFor(code,locale){try{return getDisplayNames(locale,{type:"region"}).of(code.toUpperCase())??code.toUpperCase()}catch{return code.toUpperCase()}}let flagUrlResolver,flagResolverGeneration=0;const flagResolverSubscribers=new Set;let warnedMissingFlagResolver=!1;function warnMissingFlagResolver(code){warnedMissingFlagResolver||(warnedMissingFlagResolver=!0,console.warn(`<lr-flag> could not resolve the code "${code}" because no flag resolver is registered. Import the optional peer entry once at startup -- import '@aceshooting/lyra-ui/components/media/flag/flag-peer.js' -- and install '@aceshooting/lyra-flags', or pass an already-resolved URL through 'src' instead.`))}function setFlagUrlResolver(value){flagUrlResolver=value===null?Promise.resolve(null):Promise.resolve(value),warnedMissingFlagResolver=!1,flagResolverGeneration++;for(const subscriber of[...flagResolverSubscribers])subscriber(flagResolverGeneration)}function loadFlagUrlResolver(){return flagUrlResolver||(flagUrlResolver=Promise.resolve(null)),flagUrlResolver}class LyraFlag extends LyraElement{constructor(){super(...arguments),this._shape="rect",this._fidelity="standard",this.sourceState=Object.freeze({status:"idle",identity:"idle"}),this.resolverGeneration=flagResolverGeneration,this.sourceRestartPending=!0,this.activeSourceRequest=0,this.resolveToken=0,this.onResolverGeneration=generation=>{!this.isConnected||generation===this.resolverGeneration||(this.resolverGeneration=generation)}}static{this.defaultStrings={...super.defaultStrings,collapse:LYRA_DEFAULT_collapse,details:LYRA_DEFAULT_details,flagLoadError:LYRA_DEFAULT_flagLoadError,loading:LYRA_DEFAULT_loading,map:LYRA_DEFAULT_map,navigation:LYRA_DEFAULT_navigation,open:LYRA_DEFAULT_open,popover:LYRA_DEFAULT_popover,progress:LYRA_DEFAULT_progress,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select}}static{this.styles=[LyraElement.styles,styles,srOnly]}get shape(){return this._shape}set shape(value){const old=this._shape;this._shape=normalizeFlagShape(value),this.requestUpdate("shape",old)}get fidelity(){return this._fidelity}set fidelity(value){const old=this._fidelity;this._fidelity=normalizeFlagFidelity(value),this.requestUpdate("fidelity",old)}get effectiveFidelity(){return normalizeFlagFidelity(this.fidelity)}get loading(){return this.sourceState.status==="loading"}get code(){if(this.country)return ALPHA2_RE.test(this.country)?this.country.toLowerCase():alpha3ToAlpha2(this.country);if(this.language)return languageToCountry(this.language)}get unresolved(){return this.src||!this.country&&!this.language?!1:this.code===void 0}connectedCallback(){super.connectedCallback(),this.sourceRestartPending=!0,flagResolverSubscribers.add(this.onResolverGeneration),this.syncErrorAnnouncementSink(),this.resolverGeneration!==flagResolverGeneration&&(this.resolverGeneration=flagResolverGeneration),this.requestUpdate()}disconnectedCallback(){this.resolveToken++,this.sourceRestartPending=!0,flagResolverSubscribers.delete(this.onResolverGeneration),this.releaseErrorAnnouncementSink(),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.resolveToken++,this.sourceRestartPending=!0,this.releaseErrorAnnouncementSink(),this.syncErrorAnnouncementSink(),this.requestUpdate()}syncErrorAnnouncementSink(){this.isConnected&&this.errorAnnouncementSink?.element.ownerDocument!==this.ownerDocument&&(this.releaseErrorAnnouncementSink(),this.errorAnnouncementSink=acquireAnnouncementSink("assertive",{document:this.ownerDocument,source:this}))}releaseErrorAnnouncementSink(){this.errorAnnouncementSink?.release(),this.errorAnnouncementSink=void 0}announceLoadError(){this.errorAnnouncementSink?.announce(this.localize(FLAG_LOAD_ERROR_KEY))}setSourceState(state2,announceError=!1){this.sourceState=Object.freeze(state2),this.toggleAttribute("data-error",state2.status==="error"),this.toggleAttribute("data-unresolved",this.unresolved),this.setAttribute("aria-busy",String(state2.status==="loading")),announceError&&this.isConnected&&this.announceLoadError()}failSource(identity,announce=!0){this.setSourceState({status:"error",identity},announce)}onImageLoad(event,identity,url,request){const image=event.currentTarget;!this.isConnected||request!==this.activeSourceRequest||!image||image!==this.renderRoot.querySelector('[part="image"]')||this.sourceState.status!=="loading"||this.sourceState.identity!==identity||this.sourceState.url!==url||this.setSourceState({status:"loaded",identity,url})}onImageError(event,identity,request){const image=event.currentTarget;!this.isConnected||request!==this.activeSourceRequest||!image||image!==this.renderRoot.querySelector('[part="image"]')||this.sourceState.status!=="loading"||this.sourceState.identity!==identity||this.failSource(identity)}willUpdate(changed){super.willUpdate(changed);const sourceChanged=changed.has("country")||changed.has("language")||changed.has("src")||changed.has("fidelity")||changed.has("resolverGeneration");if(typeof Node<"u"&&!this.isConnected){sourceChanged&&(this.resolveToken++,this.sourceRestartPending=!0);return}if(this.hasUpdated&&!sourceChanged&&!this.sourceRestartPending)return;const connectionBaseline=this.sourceRestartPending;this.sourceRestartPending=!1;const token=++this.resolveToken,request=++this.activeSourceRequest,URLCtor=this.ownerDocument?.defaultView?.URL??globalThis.URL,directValue=typeof this.src=="string"?this.src.trim():"";if(directValue){const identity2=`direct:${directValue}`,url=safeMediaSrc(directValue,URLCtor);if(!url){this.failSource(identity2,!connectionBaseline);return}this.setSourceState({status:"loading",identity:identity2,url});return}const code=this.code;if(!code){this.setSourceState({status:"idle",identity:"idle"});return}const fidelity=this.effectiveFidelity,identity=`peer:${code}:${fidelity}:${this.resolverGeneration}`;this.setSourceState({status:"loading",identity}),loadFlagUrlResolver().then(async resolve=>{if(token!==this.resolveToken||request!==this.activeSourceRequest||!this.isConnected)return;if(typeof resolve!="function"){warnMissingFlagResolver(code),this.failSource(identity);return}const candidate=await resolve(code,fidelity==="standard"?void 0:{variant:fidelity});if(token!==this.resolveToken||request!==this.activeSourceRequest||!this.isConnected)return;if(candidate===void 0){this.setSourceState({status:"idle",identity});return}const url=safeMediaSrc(candidate,URLCtor);if(!url){this.failSource(identity);return}this.setSourceState({status:"loading",identity,url})}).catch(err=>{token!==this.resolveToken||request!==this.activeSourceRequest||!this.isConnected||(console.warn(`<lr-flag> failed to resolve a flag URL for "${code}":`,err),this.failSource(identity))})}updated(changed){super.updated(changed),this.setAttribute("aria-busy",String(this.sourceState.status==="loading")),this.toggleAttribute("data-unresolved",this.unresolved)}render(){const state2=this.sourceState,request=this.activeSourceRequest;if(this.unresolved)return html`<slot name="fallback"
|
|
2
|
+
>${this.fallback?html`<img part="fallback-image" src=${this.fallback} alt=${this.label??""} />`:nothing}</slot
|
|
3
|
+
>`;if(state2.status==="error")return html`<span part="error">${this.localize(FLAG_LOAD_ERROR_KEY)}</span>`;const url=state2.status==="loading"||state2.status==="loaded"?state2.url:void 0;if(!url&&state2.status!=="loading")return html``;const code=this.code,alt=hostAriaLabel(this)??this.label??(code?displayNameFor(code,this.effectiveLocale):"");return html`
|
|
2
4
|
${state2.status==="loading"?html`
|
|
3
5
|
<span class="sr-only">${this.localize("loading")}</span>
|
|
4
6
|
<lr-skeleton shape="rect" .announce=${!1}></lr-skeleton>
|
|
@@ -13,4 +15,4 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
|
|
|
13
15
|
@load=${event=>this.onImageLoad(event,state2.identity,url,request)}
|
|
14
16
|
@error=${event=>this.onImageError(event,state2.identity,request)}
|
|
15
17
|
/>`):null}
|
|
16
|
-
`}}__decorate([property()],LyraFlag.prototype,"country",void 0),__decorate([property()],LyraFlag.prototype,"language",void 0),__decorate([property()],LyraFlag.prototype,"src",void 0),__decorate([property()],LyraFlag.prototype,"label",void 0),__decorate([property({reflect:!0})],LyraFlag.prototype,"shape",null),__decorate([property({reflect:!0})],LyraFlag.prototype,"fidelity",null),__decorate([state()],LyraFlag.prototype,"sourceState",void 0),__decorate([state()],LyraFlag.prototype,"resolverGeneration",void 0);export{LyraFlag,loadFlagUrl,setFlagUrlResolver};
|
|
18
|
+
`}}__decorate([property()],LyraFlag.prototype,"country",void 0),__decorate([property()],LyraFlag.prototype,"fallback",void 0),__decorate([property()],LyraFlag.prototype,"language",void 0),__decorate([property()],LyraFlag.prototype,"src",void 0),__decorate([property()],LyraFlag.prototype,"label",void 0),__decorate([property({reflect:!0})],LyraFlag.prototype,"shape",null),__decorate([property({reflect:!0})],LyraFlag.prototype,"fidelity",null),__decorate([state()],LyraFlag.prototype,"sourceState",void 0),__decorate([state()],LyraFlag.prototype,"resolverGeneration",void 0);export{LyraFlag,loadFlagUrl,setFlagUrlResolver};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import{css}from"lit";const styles=css`
|
|
2
2
|
:host {
|
|
3
3
|
display: inline-block;
|
|
4
|
+
position: relative;
|
|
4
5
|
aspect-ratio: var(--lr-flag-aspect-ratio, 4 / 3);
|
|
5
6
|
block-size: var(--lr-size-1em);
|
|
6
7
|
line-height: 0;
|
|
@@ -15,6 +16,11 @@ import{css}from"lit";const styles=css`
|
|
|
15
16
|
box-shadow: 0 0 0 var(--lr-size-1px) var(--lr-color-border) inset;
|
|
16
17
|
object-fit: var(--lr-flag-object-fit, cover);
|
|
17
18
|
}
|
|
19
|
+
[part='image'][hidden] {
|
|
20
|
+
position: absolute;
|
|
21
|
+
inset: 0;
|
|
22
|
+
visibility: hidden;
|
|
23
|
+
}
|
|
18
24
|
[part='error'] {
|
|
19
25
|
display: inline-block;
|
|
20
26
|
color: var(--lr-color-danger);
|
|
@@ -30,7 +36,7 @@ import{css}from"lit";const styles=css`
|
|
|
30
36
|
line-height: var(--lr-line-height-normal);
|
|
31
37
|
vertical-align: baseline;
|
|
32
38
|
}
|
|
33
|
-
:host([shape='circle']) {
|
|
39
|
+
:host([shape='circle']:not([data-error])) {
|
|
34
40
|
block-size: var(--lr-size-1em);
|
|
35
41
|
inline-size: var(--lr-size-1em);
|
|
36
42
|
}
|
|
@@ -9,6 +9,16 @@
|
|
|
9
9
|
* match this shape is treated the same as an unknown/missing flag.
|
|
10
10
|
*/
|
|
11
11
|
export declare const ALPHA2_RE: RegExp;
|
|
12
|
+
/** ISO 3166-1 alpha-3 shape: exactly three ASCII letters, case-insensitive. Length alone
|
|
13
|
+
* disambiguates the two code spaces, so no explicit format hint is needed. */
|
|
14
|
+
export declare const ALPHA3_RE: RegExp;
|
|
15
|
+
/**
|
|
16
|
+
* The alpha-2 code for an ISO 3166-1 alpha-3 code, or `undefined` when it isn't one. Case
|
|
17
|
+
* insensitive. Deliberately excludes user-assigned and withdrawn codes: a historical or defunct
|
|
18
|
+
* state has no current flag to resolve, so it takes the component's unresolved path rather than
|
|
19
|
+
* silently mapping to a successor state's flag.
|
|
20
|
+
*/
|
|
21
|
+
export declare function alpha3ToAlpha2(code: string): string | undefined;
|
|
12
22
|
/**
|
|
13
23
|
* Default mapping from a language subtag to a representative country flag
|
|
14
24
|
* (ISO 3166-1 alpha-2). Languages don't map 1:1 to countries; these are the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getDisplayNames}from"../../../internal/intl-cache.js";const ALPHA2_RE=/^[a-z]{2}$/i,LANGUAGE_TO_COUNTRY={en:"gb",fr:"fr",de:"de",es:"es",it:"it",pt:"pt",nl:"nl",ar:"sa",zh:"cn",ja:"jp",ko:"kr",ru:"ru",pl:"pl",tr:"tr",sv:"se",da:"dk",fi:"fi",no:"no",nb:"no",cs:"cz",sk:"sk",el:"gr",he:"il",hi:"in",th:"th",vi:"vn",id:"id",ms:"my",uk:"ua",ro:"ro",hu:"hu",bg:"bg",hr:"hr",sr:"rs",sl:"si",et:"ee",lv:"lv",lt:"lt",fa:"ir",ur:"pk",bn:"bd",ta:"in",ca:"es"};function mappedCountry(language){return Object.hasOwn(LANGUAGE_TO_COUNTRY,language)?LANGUAGE_TO_COUNTRY[language]:void 0}function languageToCountry(language){if(typeof language!="string")return;const normalized=language.trim().replaceAll("_","-");if(!normalized)return;try{const locale=new Intl.Locale(normalized);return locale.region&&ALPHA2_RE.test(locale.region)?locale.region.toLowerCase():mappedCountry(locale.language.toLowerCase())}catch{}const parts=normalized.toLowerCase().split("-").slice(0,16),base=parts[0];if(base.length!==1){for(const part of parts.slice(1)){if(!/^[a-z0-9]{1,8}$/.test(part)||part.length===1)break;if(ALPHA2_RE.test(part))return part}return mappedCountry(base)}}function localeNativeName(tag){try{return getDisplayNames(tag,{type:"language"}).of(tag)??tag}catch{return tag}}export{ALPHA2_RE,LANGUAGE_TO_COUNTRY,languageToCountry,localeNativeName};
|
|
1
|
+
import{getDisplayNames}from"../../../internal/intl-cache.js";const ALPHA2_RE=/^[a-z]{2}$/i,ALPHA3_RE=/^[a-z]{3}$/i,ALPHA3_TO_ALPHA2_PACKED="abwawafgafagoaoaiaaialaaxalbalandadareaeargararmamasmasataaqatftfatgagausauautatazeazbdibibelbebenbjbesbqbfabfbgdbdbgrbgbhrbhbhsbsbihbablmblblrbyblzbzbmubmbolbobrabrbrbbbbrnbnbtnbtbvtbvbwabwcafcfcancacckccchechchlclchncncivcicmrcmcodcdcogcgcokckcolcocomkmcpvcvcricrcubcucuwcwcxrcxcymkycypcyczeczdeudedjidjdmadmdnkdkdomdodzadzecuecegyegeriereshehespesesteeethetfinfifjifjflkfkfrafrfrofofsmfmgabgagbrgbgeogeggyggghaghgibgigingnglpgpgmbgmgnbgwgnqgqgrcgrgrdgdgrlglgtmgtgufgfgumguguygyhkghkhmdhmhndhnhrvhrhtihthunhuidnidimnimindiniotioirlieirnirirqiqislisisrilitaitjamjmjeyjejorjojpnjpkazkzkenkekgzkgkhmkhkirkiknaknkorkrkwtkwlaolalbnlblbrlrlbylylcalclielilkalklsolsltultluxlulvalvmacmomafmfmarmamcomcmdamdmdgmgmdvmvmexmxmhlmhmkdmkmlimlmltmtmmrmmmnememngmnmnpmpmozmzmrtmrmsrmsmtqmqmusmumwimwmysmymytytnamnanclncnernenfknfngangnicniniununldnlnornonplnpnrunrnzlnzomnompakpkpanpapcnpnperpephlphplwpwpngpgpolplpriprprkkpprtptprypypsepspyfpfqatqareurerourorusrurwarwsausasdnsdsensnsgpsgsgsgsshnshsjmsjslbsbsleslslvsvsmrsmsomsospmpmsrbrsssdssstpstsursrsvksksvnsisweseswzszsxmsxsycscsyrsytcatctcdtdtgotgthathtjktjtkltktkmtmtlstltontottotttuntnturtrtuvtvtwntwtzatzugaugukruaumiumuryuyusausuzbuzvatvavctvcvenvevgbvgvirvivnmvnvutvuwlfwfwsmwsyemyezafzazmbzmzwezw";let alpha3Lookup;function alpha3ToAlpha2(code){if(ALPHA3_RE.test(code)){if(!alpha3Lookup){alpha3Lookup=new Map;for(let index=0;index<ALPHA3_TO_ALPHA2_PACKED.length;index+=5)alpha3Lookup.set(ALPHA3_TO_ALPHA2_PACKED.slice(index,index+3),ALPHA3_TO_ALPHA2_PACKED.slice(index+3,index+5))}return alpha3Lookup.get(code.toLowerCase())}}const LANGUAGE_TO_COUNTRY={en:"gb",fr:"fr",de:"de",es:"es",it:"it",pt:"pt",nl:"nl",ar:"sa",zh:"cn",ja:"jp",ko:"kr",ru:"ru",pl:"pl",tr:"tr",sv:"se",da:"dk",fi:"fi",no:"no",nb:"no",cs:"cz",sk:"sk",el:"gr",he:"il",hi:"in",th:"th",vi:"vn",id:"id",ms:"my",uk:"ua",ro:"ro",hu:"hu",bg:"bg",hr:"hr",sr:"rs",sl:"si",et:"ee",lv:"lv",lt:"lt",fa:"ir",ur:"pk",bn:"bd",ta:"in",ca:"es"};function mappedCountry(language){return Object.hasOwn(LANGUAGE_TO_COUNTRY,language)?LANGUAGE_TO_COUNTRY[language]:void 0}function languageToCountry(language){if(typeof language!="string")return;const normalized=language.trim().replaceAll("_","-");if(!normalized)return;try{const locale=new Intl.Locale(normalized);return locale.region&&ALPHA2_RE.test(locale.region)?locale.region.toLowerCase():mappedCountry(locale.language.toLowerCase())}catch{}const parts=normalized.toLowerCase().split("-").slice(0,16),base=parts[0];if(base.length!==1){for(const part of parts.slice(1)){if(!/^[a-z0-9]{1,8}$/.test(part)||part.length===1)break;if(ALPHA2_RE.test(part))return part}return mappedCountry(base)}}function localeNativeName(tag){try{return getDisplayNames(tag,{type:"language"}).of(tag)??tag}catch{return tag}}export{ALPHA2_RE,ALPHA3_RE,LANGUAGE_TO_COUNTRY,alpha3ToAlpha2,languageToCountry,localeNativeName};
|
|
@@ -2,11 +2,6 @@ import{css}from"lit";const styles=css`
|
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
min-inline-size: 0;
|
|
5
|
-
/* Namespaced sizing surface, fed by the bare Shoelace-compat names. An unprefixed custom
|
|
6
|
-
property inherits, so a single --handle-size anywhere up the tree would otherwise silently
|
|
7
|
-
retune this component along with every other one reading a generically-named property.
|
|
8
|
-
Consumers override the --lr-image-comparer-* names on an ancestor or the host; the compat
|
|
9
|
-
names remain the private defaults' fallback source. */
|
|
10
5
|
--_lr-image-comparer-divider-width: var(
|
|
11
6
|
--divider-width,
|
|
12
7
|
var(--lr-size-1px)
|
|
@@ -39,13 +34,6 @@ import{css}from"lit";const styles=css`
|
|
|
39
34
|
[part~="base"][data-orientation="vertical"] [part="before"] {
|
|
40
35
|
clip-path: inset(0 0 calc(100% - var(--lr-comparer-position, 50%)) 0);
|
|
41
36
|
}
|
|
42
|
-
/* clip-path's inset() only accepts physical top/right/bottom/left offsets -- no logical
|
|
43
|
-
equivalent exists -- while [part='divider'] below is positioned with the logical
|
|
44
|
-
inset-inline-start, which the browser already mirrors under RTL on its own. Without this
|
|
45
|
-
override the clipped 'before' region stays pinned to the physical-left portion regardless of
|
|
46
|
-
direction, while the divider (and native range-input handle) move to the right under RTL,
|
|
47
|
-
visibly desyncing the boundary from the line the user is dragging. Vertical orientation is a
|
|
48
|
-
block-axis split, unaffected by inline direction, so it's excluded and keeps its own rule above. */
|
|
49
37
|
:host(:dir(rtl)) [part="before"] {
|
|
50
38
|
clip-path: inset(0 0 0 calc(100% - var(--lr-comparer-position, 50%)));
|
|
51
39
|
}
|
|
@@ -61,6 +49,10 @@ import{css}from"lit";const styles=css`
|
|
|
61
49
|
max-inline-size: 100%;
|
|
62
50
|
overflow-wrap: anywhere;
|
|
63
51
|
}
|
|
52
|
+
[part="before"] ::slotted([hidden]:not([hidden="until-found" i])),
|
|
53
|
+
[part="after"] ::slotted([hidden]:not([hidden="until-found" i])) {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
64
56
|
[part="divider"] {
|
|
65
57
|
position: absolute;
|
|
66
58
|
z-index: var(--lr-layer-popover);
|
|
@@ -71,8 +63,6 @@ import{css}from"lit";const styles=css`
|
|
|
71
63
|
var(--_lr-image-comparer-divider-width)
|
|
72
64
|
);
|
|
73
65
|
background: var(--lr-color-surface);
|
|
74
|
-
/* Card step, not the overlay step: the shadow here only has to keep a hairline legible against
|
|
75
|
-
arbitrary imagery on both sides -- a wider blur reads as a smudge along the seam. */
|
|
76
66
|
box-shadow: var(--lr-shadow-s);
|
|
77
67
|
pointer-events: none;
|
|
78
68
|
}
|
|
@@ -88,10 +78,6 @@ import{css}from"lit";const styles=css`
|
|
|
88
78
|
}
|
|
89
79
|
[part="handle"] {
|
|
90
80
|
position: absolute;
|
|
91
|
-
/* --lr-layer-tooltip does not exist (no fallback -> z-index: auto, stacking the interaction
|
|
92
|
-
wrapper BELOW [part='before']'s clipped pointer-events-enabled region and intercepting its
|
|
93
|
-
own drag/click input). Matching [part='divider']'s own --lr-layer-popover is sufficient: the
|
|
94
|
-
handle renders after the divider, so an equal z-index still wins the paint-order tie. */
|
|
95
81
|
z-index: var(--lr-layer-popover);
|
|
96
82
|
inset: 0;
|
|
97
83
|
}
|
|
@@ -105,16 +91,6 @@ import{css}from"lit";const styles=css`
|
|
|
105
91
|
cursor: ew-resize;
|
|
106
92
|
}
|
|
107
93
|
[part~="base"][data-orientation="vertical"] [part="input"] {
|
|
108
|
-
/* A native <input type="range"> always maps pointer position along its own inline axis,
|
|
109
|
-
which defaults to horizontal-tb -- so without this override, dragging up/down over the
|
|
110
|
-
visibly vertical divider does nothing; only a horizontal drag (invisible, off to the
|
|
111
|
-
side) would move the thumb. writing-mode: vertical-lr switches the input's inline axis to
|
|
112
|
-
run top-to-bottom, matching [part='divider']'s own top-anchored inset-block-start above.
|
|
113
|
-
direction is pinned to ltr (rather than left to inherit an ambient dir="rtl") because
|
|
114
|
-
vertical-lr's inline progression reverses to bottom-to-top under direction: rtl, which
|
|
115
|
-
would desync the native handle's value from the always-top-to-bottom divider position --
|
|
116
|
-
the same block-axis-is-unaffected-by-inline-direction invariant the 'before' clip-path
|
|
117
|
-
override above already relies on for vertical orientation. */
|
|
118
94
|
writing-mode: vertical-lr;
|
|
119
95
|
direction: ltr;
|
|
120
96
|
cursor: ns-resize;
|
|
@@ -177,14 +153,9 @@ import{css}from"lit";const styles=css`
|
|
|
177
153
|
outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);
|
|
178
154
|
outline-offset: var(--lr-focus-ring-offset);
|
|
179
155
|
}
|
|
180
|
-
/* [part='input'] is a fully-transparent full-bleed native <input type="range">. Keep hover
|
|
181
|
-
feedback on the divider too, so the full drag surface responds even when the pointer isn't
|
|
182
|
-
directly over the small visible handle. */
|
|
183
156
|
[part~="base"]:has([part="input"]:hover) [part="divider"] {
|
|
184
157
|
background: var(--lr-color-brand);
|
|
185
158
|
}
|
|
186
|
-
/* Pressed rides the same :has() indirection as the hover rule above: the transparent full-bleed
|
|
187
|
-
input has nothing of its own to tint, so mid-drag the seam deepens past its hover accent. */
|
|
188
159
|
[part~="base"]:has([part="input"]:active) [part="divider"] {
|
|
189
160
|
background: color-mix(
|
|
190
161
|
in oklab,
|
|
@@ -35,8 +35,6 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
|
|
|
35
35
|
@lr-zoom-change=${this.onFrameZoomChange}
|
|
36
36
|
@focus=${event=>event.stopPropagation()}
|
|
37
37
|
@blur=${event=>event.stopPropagation()}
|
|
38
|
-
@lr-focus=${event=>event.stopPropagation()}
|
|
39
|
-
@lr-blur=${event=>event.stopPropagation()}
|
|
40
38
|
>
|
|
41
39
|
<div
|
|
42
40
|
part="rotation-frame"
|
|
@@ -58,8 +58,6 @@ import{css}from"lit";const styles=css`
|
|
|
58
58
|
[part="annotate-toggle"]:hover {
|
|
59
59
|
background: var(--lr-color-brand-quiet);
|
|
60
60
|
}
|
|
61
|
-
/* Declared here rather than after the [aria-pressed='true'] rule below so the toggle's own "on"
|
|
62
|
-
fill keeps winning the source-order tie, exactly as it already does against :hover. */
|
|
63
61
|
[part="fit-control"]:active,
|
|
64
62
|
[part="rotate-button"]:active,
|
|
65
63
|
[part="annotate-toggle"]:active {
|
|
@@ -96,6 +94,13 @@ import{css}from"lit";const styles=css`
|
|
|
96
94
|
var(--lr-color-brand)
|
|
97
95
|
);
|
|
98
96
|
}
|
|
97
|
+
[part="annotate-toggle"][aria-pressed="true"]:active {
|
|
98
|
+
background: color-mix(
|
|
99
|
+
in oklab,
|
|
100
|
+
var(--lr-image-viewer-annotate-active-bg, var(--lr-color-brand-quiet)),
|
|
101
|
+
var(--lr-color-mix-partner) var(--lr-color-mix-active)
|
|
102
|
+
);
|
|
103
|
+
}
|
|
99
104
|
[part="rotation-frame"] {
|
|
100
105
|
position: relative;
|
|
101
106
|
display: inline-block;
|
|
@@ -106,7 +111,6 @@ import{css}from"lit";const styles=css`
|
|
|
106
111
|
}
|
|
107
112
|
[part="rotation-frame"][data-measured] [part="image-wrapper"] {
|
|
108
113
|
position: absolute;
|
|
109
|
-
/* policy-allow(physical-css): rotation geometry is a physical raster coordinate system. */
|
|
110
114
|
left: 50%;
|
|
111
115
|
top: 50%;
|
|
112
116
|
}
|
|
@@ -117,8 +121,6 @@ import{css}from"lit";const styles=css`
|
|
|
117
121
|
transition: transform var(--lr-transition-base);
|
|
118
122
|
outline: none;
|
|
119
123
|
}
|
|
120
|
-
/* 'actual' size intentionally keeps the image at its natural pixel dimensions -- undo the
|
|
121
|
-
100% cap above (and the 'width'/'contain' image constraints below) for that mode. */
|
|
122
124
|
:host([fit="actual"]) [part="image-wrapper"] {
|
|
123
125
|
max-inline-size: none;
|
|
124
126
|
}
|
|
@@ -127,11 +129,6 @@ import{css}from"lit";const styles=css`
|
|
|
127
129
|
transition: none;
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
|
-
/* The embedded pan-zoom's own [part='content'] sizes to its slotted content's natural
|
|
131
|
-
size by default (a max-content track), which leaves percentage sizing on the image below with
|
|
132
|
-
no definite basis to resolve against. Giving it the viewport's own inline size here is what
|
|
133
|
-
lets 'contain'/'width' scale the image to the available frame instead of its raw natural
|
|
134
|
-
pixel dimensions -- 'actual' leaves the default max-content sizing alone. */
|
|
135
132
|
:host([fit="contain"]) [part="frame"]::part(content),
|
|
136
133
|
:host([fit="width"]) [part="frame"]::part(content) {
|
|
137
134
|
inline-size: 100%;
|
|
@@ -155,13 +152,6 @@ import{css}from"lit";const styles=css`
|
|
|
155
152
|
position: absolute;
|
|
156
153
|
inset: 0;
|
|
157
154
|
}
|
|
158
|
-
/* Each tone sets --lr-image-viewer-highlight-fill rather than background directly, and the one
|
|
159
|
-
background declaration here reads it. That indirection is what lets the hover/active rules mix
|
|
160
|
-
from whichever fill a given highlight actually has: a background-mix written against the
|
|
161
|
-
untoned default would flatten every toned box to brand the instant the pointer touched it, and
|
|
162
|
-
a per-tone hover/active pair would be ten near-identical rules. The public
|
|
163
|
-
--lr-image-viewer-highlight-*-bg knobs are untouched -- still what each fill falls back
|
|
164
|
-
through. */
|
|
165
155
|
[part="highlight"] {
|
|
166
156
|
position: absolute;
|
|
167
157
|
min-inline-size: var(--lr-icon-button-size);
|
|
@@ -238,10 +228,6 @@ import{css}from"lit";const styles=css`
|
|
|
238
228
|
var(--lr-focus-ring-offset)
|
|
239
229
|
);
|
|
240
230
|
}
|
|
241
|
-
/* Was filter: brightness(), which multiplies every channel -- so it lightened a dark highlight,
|
|
242
|
-
did nothing at all to a white one, and (filter applying to the whole subtree) dragged
|
|
243
|
-
[part='highlight-label']'s text along with the box. Mixing the fill alone toward
|
|
244
|
-
--lr-color-mix-partner always moves, and only the fill moves. */
|
|
245
231
|
[part="highlight"]:hover {
|
|
246
232
|
background: color-mix(
|
|
247
233
|
in oklab,
|
|
@@ -269,12 +255,6 @@ import{css}from"lit";const styles=css`
|
|
|
269
255
|
[part="highlight-label"] {
|
|
270
256
|
position: absolute;
|
|
271
257
|
inset-block-start: calc(var(--lr-size-1-5em) * -1);
|
|
272
|
-
/* policy-allow(physical-css): the parent [part='highlight'] box is deliberately positioned with
|
|
273
|
-
physical left/top (see renderHighlights()'s comment -- region rects are physical
|
|
274
|
-
percent-of-image coordinates over a raster that never mirrors). The parent itself never moves
|
|
275
|
-
under RTL, so a logical inset here would flip this label to the box's opposite corner while
|
|
276
|
-
the box stayed put. Matching the parent's physical coordinate system keeps the label anchored
|
|
277
|
-
to the box's left edge in both directions. */
|
|
278
258
|
left: 0;
|
|
279
259
|
font-size: var(--lr-font-size-xs);
|
|
280
260
|
color: var(--lr-color-text);
|
|
@@ -41,8 +41,6 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
|
|
|
41
41
|
.accessibleLabel=${positionText||null}
|
|
42
42
|
@focus=${event=>event.stopPropagation()}
|
|
43
43
|
@blur=${event=>event.stopPropagation()}
|
|
44
|
-
@lr-focus=${event=>event.stopPropagation()}
|
|
45
|
-
@lr-blur=${event=>event.stopPropagation()}
|
|
46
44
|
></lr-pan-zoom>
|
|
47
45
|
${count>1?html`
|
|
48
46
|
<button
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import{css}from"lit";const styles=css`
|
|
2
2
|
:host {
|
|
3
3
|
--_lr-lightbox-overlay-color: var(--lr-color-overlay-strong);
|
|
4
|
-
/* Background for every floating/toolbar icon button (close-button, previous-button,
|
|
5
|
-
next-button). These buttons float directly over arbitrary image content, not the app's
|
|
6
|
-
normal surface, so they reuse the "solid, high-contrast neutral fill" token rather than
|
|
7
|
-
--lr-color-surface for guaranteed contrast independent of both the page theme and
|
|
8
|
-
whatever's in the photo. */
|
|
9
4
|
--_lr-lightbox-control-bg: var(--lr-color-neutral);
|
|
10
5
|
--_lr-lightbox-control-color: var(--lr-color-on-neutral);
|
|
11
6
|
display: none;
|
|
@@ -102,19 +97,12 @@ import{css}from"lit";const styles=css`
|
|
|
102
97
|
[part="close-button"] {
|
|
103
98
|
margin-inline-start: var(--lr-space-xs);
|
|
104
99
|
}
|
|
105
|
-
/* :where() zeroes the wrapped selectors' specificity contribution, leaving only :hover itself
|
|
106
|
-
-- mirrors lr-attachment-trigger's identical fix for the same [part='x']:hover:not(:disabled)
|
|
107
|
-
over-specificity shape, so a consumer's ::part(close-button):hover /
|
|
108
|
-
::part(previous-button):hover / ::part(next-button):hover override wins without !important. */
|
|
109
100
|
:where([part="close-button"]):hover,
|
|
110
101
|
:where([part="previous-button"]):hover:where(:not(:disabled)),
|
|
111
102
|
:where([part="next-button"]):hover:where(:not(:disabled)) {
|
|
112
103
|
background: var(--lr-color-brand-quiet);
|
|
113
104
|
color: var(--lr-color-brand);
|
|
114
105
|
}
|
|
115
|
-
/* Pressed carries the hover fill further toward --lr-color-mix-partner. These controls float over
|
|
116
|
-
arbitrary photography, so the press has to be legible on its own rather than relying on the
|
|
117
|
-
surrounding image to supply contrast. */
|
|
118
106
|
:where([part="close-button"]):active,
|
|
119
107
|
:where([part="previous-button"]):active:where(:not(:disabled)),
|
|
120
108
|
:where([part="next-button"]):active:where(:not(:disabled)) {
|
|
@@ -147,8 +135,6 @@ import{css}from"lit";const styles=css`
|
|
|
147
135
|
min-inline-size: 0;
|
|
148
136
|
min-block-size: 0;
|
|
149
137
|
}
|
|
150
|
-
/* Plain ::part() styling one level in, unrelated to exportparts -- stretches the embedded
|
|
151
|
-
frame to fill the stage, overriding pan-zoom's own min-block-size default. */
|
|
152
138
|
lr-pan-zoom[part="frame"] {
|
|
153
139
|
display: block;
|
|
154
140
|
inline-size: 100%;
|
|
@@ -173,10 +159,6 @@ import{css}from"lit";const styles=css`
|
|
|
173
159
|
[part="next-button"] {
|
|
174
160
|
inset-inline-end: var(--lr-space-s);
|
|
175
161
|
}
|
|
176
|
-
/* Rotate the wrapping part element, not the icon itself -- rotate(180deg) matches
|
|
177
|
-
pagination.styles.ts's existing previous-icon/next-icon recipe for a chevronIcon()-based
|
|
178
|
-
prev/next pair (carousel's scaleX(-1) recipe is for its literal ‹/› glyphs, a different base
|
|
179
|
-
case). */
|
|
180
162
|
[part="previous-glyph"] {
|
|
181
163
|
transform: rotate(180deg);
|
|
182
164
|
}
|
|
@@ -203,9 +185,6 @@ import{css}from"lit";const styles=css`
|
|
|
203
185
|
text-align: center;
|
|
204
186
|
overflow-wrap: anywhere;
|
|
205
187
|
}
|
|
206
|
-
/* Container-query lengths cannot reference custom properties. This is the documented 320px
|
|
207
|
-
narrow-allocation baseline expressed in root-relative units so it still follows the page's
|
|
208
|
-
type scale -- mirrors pagination.styles.ts's identical container query. */
|
|
209
188
|
@container (max-inline-size: 20rem) {
|
|
210
189
|
[part="counter"] {
|
|
211
190
|
max-inline-size: 45%;
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
export interface MapLibreGeoJsonSource {
|
|
2
2
|
setData(data: unknown): void;
|
|
3
|
+
/** maplibre-gl 3+ incremental update. Optional because older peers lack it. */
|
|
4
|
+
updateData?(diff: MapLibreGeoJsonDiff): void;
|
|
5
|
+
}
|
|
6
|
+
/** The subset of maplibre-gl's GeoJSON diff this component emits: per-feature property updates. */
|
|
7
|
+
export interface MapLibreGeoJsonDiff {
|
|
8
|
+
readonly update: readonly {
|
|
9
|
+
readonly id: string | number;
|
|
10
|
+
readonly addOrUpdateProperties: readonly {
|
|
11
|
+
readonly key: string;
|
|
12
|
+
readonly value: unknown;
|
|
13
|
+
}[];
|
|
14
|
+
readonly removeProperties: readonly string[];
|
|
15
|
+
}[];
|
|
3
16
|
}
|
|
4
17
|
export interface MapLibrePopupCapability {
|
|
5
18
|
setHTML(html: string): this;
|
|
@@ -17,7 +30,10 @@ export interface MapLibreMarkerCapability {
|
|
|
17
30
|
getElement?(): HTMLElement;
|
|
18
31
|
}
|
|
19
32
|
export interface MapLibreMapCapability {
|
|
20
|
-
|
|
33
|
+
/** Required, unlike setMaxBounds below: the loader validates getCanvas is callable and rejects a
|
|
34
|
+
* peer without it, so holding this type already implies the method is present. Call sites still
|
|
35
|
+
* guard with `?.()` against a peer that satisfies the shape check and then lies at runtime. */
|
|
36
|
+
getCanvas(): HTMLCanvasElement;
|
|
21
37
|
getCenter(): {
|
|
22
38
|
lng: number;
|
|
23
39
|
lat: number;
|
|
@@ -26,6 +42,8 @@ export interface MapLibreMapCapability {
|
|
|
26
42
|
setCenter(center: [number, number]): unknown;
|
|
27
43
|
setZoom(zoom: number): unknown;
|
|
28
44
|
resize(): unknown;
|
|
45
|
+
/** Optional: absent on peers predating it, and the caller feature-detects before use. */
|
|
46
|
+
setMaxBounds?(bounds: readonly [readonly [number, number], readonly [number, number]] | null): unknown;
|
|
29
47
|
remove(): void;
|
|
30
48
|
on(type: 'error', listener: (event: {
|
|
31
49
|
error?: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveOptionalPeerCapability,unwrapOptionalPeerDefault}from"../../../internal/optional-peer-capabilities.js";const MAP_METHODS=["getCenter","getZoom","setCenter","setZoom","resize","remove","on","once","setStyle","getSource","addSource","removeSource","getLayer","addLayer","removeLayer","setPaintProperty","queryRenderedFeatures"],MARKER_METHODS=["setLngLat","setPopup","getPopup","addTo","remove"],POPUP_METHODS=["setHTML","setText"];function isObjectLike(value){return(typeof value=="object"||typeof value=="function")&&value!==null}function isConstructor(value){if(typeof value!="function")return!1;try{return Reflect.construct(Object,[],value),!0}catch{return!1}}function missingConstructorCapability(module,name,methods){const Constructor=module[name];if(!isConstructor(Constructor))return name;const prototype=Constructor.prototype;if(!isObjectLike(prototype))return`${name}.prototype`;for(const method of methods)if(typeof prototype[method]!="function")return`${name}.prototype.${method}`}function missingMaplibreCapability(candidate){return isObjectLike(candidate)?missingConstructorCapability(candidate,"Map",MAP_METHODS)??missingConstructorCapability(candidate,"Marker",MARKER_METHODS)??missingConstructorCapability(candidate,"Popup",POPUP_METHODS):"module namespace"}function isMaplibreModule(candidate){return missingMaplibreCapability(candidate)===void 0}function resolveMaplibreModule(value){const module=resolveOptionalPeerCapability(value,isMaplibreModule);if(module)return module;const candidate=unwrapOptionalPeerDefault(value),missing=missingMaplibreCapability(candidate)??"module namespace";throw new Error(`Invalid optional peer \`maplibre-gl\`: missing or invalid \`${missing}\` capability.`)}let maplibre;async function loadMaplibreModule(importer=()=>import("maplibre-gl")){try{return resolveMaplibreModule(await importer())}catch(error){return console.warn("<lr-map> needs the optional peer dependency `maplibre-gl` \u2014 install it with `pnpm add maplibre-gl`.",error),null}}function loadMaplibre(){return maplibre||(maplibre=loadMaplibreModule()),maplibre}export{loadMaplibre,loadMaplibreModule};
|
|
1
|
+
import{resolveOptionalPeerCapability,unwrapOptionalPeerDefault}from"../../../internal/optional-peer-capabilities.js";const MAP_METHODS=["getCanvas","getCenter","getZoom","setCenter","setZoom","resize","remove","on","once","setStyle","getSource","addSource","removeSource","getLayer","addLayer","removeLayer","setPaintProperty","queryRenderedFeatures"],MARKER_METHODS=["setLngLat","setPopup","getPopup","addTo","remove"],POPUP_METHODS=["setHTML","setText"];function isObjectLike(value){return(typeof value=="object"||typeof value=="function")&&value!==null}function isConstructor(value){if(typeof value!="function")return!1;try{return Reflect.construct(Object,[],value),!0}catch{return!1}}function missingConstructorCapability(module,name,methods){const Constructor=module[name];if(!isConstructor(Constructor))return name;const prototype=Constructor.prototype;if(!isObjectLike(prototype))return`${name}.prototype`;for(const method of methods)if(typeof prototype[method]!="function")return`${name}.prototype.${method}`}function missingMaplibreCapability(candidate){return isObjectLike(candidate)?missingConstructorCapability(candidate,"Map",MAP_METHODS)??missingConstructorCapability(candidate,"Marker",MARKER_METHODS)??missingConstructorCapability(candidate,"Popup",POPUP_METHODS):"module namespace"}function isMaplibreModule(candidate){return missingMaplibreCapability(candidate)===void 0}function resolveMaplibreModule(value){const module=resolveOptionalPeerCapability(value,isMaplibreModule);if(module)return module;const candidate=unwrapOptionalPeerDefault(value),missing=missingMaplibreCapability(candidate)??"module namespace";throw new Error(`Invalid optional peer \`maplibre-gl\`: missing or invalid \`${missing}\` capability.`)}let maplibre;async function loadMaplibreModule(importer=()=>import("maplibre-gl")){try{return resolveMaplibreModule(await importer())}catch(error){return console.warn("<lr-map> needs the optional peer dependency `maplibre-gl` \u2014 install it with `pnpm add maplibre-gl`.",error),null}}function loadMaplibre(){return maplibre||(maplibre=loadMaplibreModule()),maplibre}export{loadMaplibre,loadMaplibreModule};
|