@aceshooting/lyra-ui 26.0.0 → 27.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 +63 -675
- package/README.md +281 -1130
- package/design-tokens.json +1 -1
- package/dist/ai/types.d.ts +5 -5
- package/dist/autoloader.js +1 -1
- package/dist/cli/agent-registry.mjs +1 -0
- package/dist/cli/component-inventory.mjs +1 -1
- package/dist/cli/init-agents.mjs +40 -0
- package/dist/cli/is-main-module.mjs +1 -0
- package/dist/cli/lyra-rename-ledger.mjs +1 -1
- package/dist/cli/lyra-ui.mjs +11 -0
- package/dist/cli/migrate-wa.mjs +4 -2
- package/dist/cli/migration-contract.json +1 -1
- package/dist/cli/migration-renames.mjs +1 -1
- package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.class.d.ts +1 -1
- package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.class.js +2 -2
- package/dist/components/agent-tools/approval-queue/approval-queue.class.js +1 -1
- package/dist/components/agent-tools/confirm-bar/confirm-bar.class.d.ts +2 -2
- package/dist/components/agent-tools/confirm-bar/confirm-bar.class.js +2 -2
- package/dist/components/agent-tools/connector-manager/connector-manager.class.d.ts +4 -2
- package/dist/components/agent-tools/connector-manager/connector-manager.class.js +6 -3
- package/dist/components/agent-tools/connector-manager/connector-manager.d.ts +1 -1
- package/dist/components/agent-tools/connector-manager/connector-manager.js +1 -1
- package/dist/components/agent-tools/connector-manager/connector-manager.styles.js +1 -1
- package/dist/components/agent-tools/context-inspector/context-inspector.class.d.ts +2 -2
- package/dist/components/agent-tools/context-inspector/context-inspector.class.js +6 -6
- package/dist/components/agent-tools/eval-dataset/eval-dataset.class.d.ts +8 -33
- package/dist/components/agent-tools/eval-dataset/eval-dataset.class.js +27 -4
- package/dist/components/agent-tools/eval-dataset/eval-dataset.d.ts +1 -1
- package/dist/components/agent-tools/eval-dataset/eval-dataset.js +1 -1
- package/dist/components/agent-tools/eval-dataset/eval-dataset.styles.js +1 -1
- package/dist/components/agent-tools/evaluation-run/evaluation-run.class.js +1 -1
- package/dist/components/agent-tools/permission-grant/permission-grant.class.d.ts +4 -2
- package/dist/components/agent-tools/permission-grant/permission-grant.class.js +6 -3
- package/dist/components/agent-tools/permission-grant/permission-grant.d.ts +1 -1
- package/dist/components/agent-tools/permission-grant/permission-grant.js +1 -1
- package/dist/components/agent-tools/permission-grant/permission-grant.styles.js +1 -1
- package/dist/components/agent-tools/prompt-studio/prompt-studio.class.d.ts +1 -1
- package/dist/components/agent-tools/prompt-studio/prompt-studio.class.js +2 -2
- package/dist/components/agent-tools/schema-viewer/schema-viewer.class.d.ts +3 -1
- package/dist/components/agent-tools/schema-viewer/schema-viewer.class.js +1 -1
- package/dist/components/agent-tools/stack-trace/stack-trace.class.js +1 -1
- package/dist/components/agent-tools/task-list/task-list.class.d.ts +2 -2
- package/dist/components/agent-tools/task-list/task-list.class.js +2 -2
- package/dist/components/agent-tools/terminal/terminal.class.d.ts +1 -1
- package/dist/components/agent-tools/terminal/terminal.class.js +4 -4
- package/dist/components/agent-tools/tool-approval-dialog/tool-approval-dialog.class.d.ts +15 -9
- package/dist/components/agent-tools/tool-approval-dialog/tool-approval-dialog.class.js +1 -1
- package/dist/components/agent-tools/tool-call-block/tool-call-block.class.d.ts +2 -2
- package/dist/components/agent-tools/tool-call-block/tool-call-block.class.js +1 -1
- package/dist/components/agent-tools/tool-call-block/tool-call-block.styles.js +1 -1
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.d.ts +2 -7
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.styles.js +1 -1
- package/dist/components/agent-tools/tool-param-form/tool-param-constraints.js +1 -1
- package/dist/components/agent-tools/tool-param-form/tool-param-form.class.d.ts +3 -5
- package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js +1 -1
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.class.d.ts +2 -5
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.styles.js +1 -1
- package/dist/components/agent-tools/tool-result-view/registry.d.ts +4 -12
- package/dist/components/agent-tools/tool-result-view/tool-result-view.class.d.ts +2 -2
- package/dist/components/agent-tools/tool-result-view/tool-result-view.class.js +1 -1
- package/dist/components/agent-tools/tool-status.d.ts +7 -0
- package/dist/components/agent-tools/tool-status.styles.js +1 -0
- package/dist/components/agent-tools/tool-timeline/tool-timeline.class.js +1 -1
- package/dist/components/agent-tools/tool-timeline/tool-timeline.d.ts +1 -1
- package/dist/components/agent-tools/tool-timeline/tool-timeline.js +1 -1
- package/dist/components/agent-tools/trace-tree/trace-tree.class.js +2 -2
- package/dist/components/charts/chart/box-plot.class.d.ts +1 -1
- package/dist/components/charts/chart/box-plot.class.js +1 -1
- package/dist/components/charts/chart/box-plot.styles.js +1 -1
- package/dist/components/charts/chart/chart-surface-shared.js +1 -0
- package/dist/components/charts/chart/chart-surface.styles.js +1 -1
- package/dist/components/charts/chart/chart-table-sampling.js +1 -1
- package/dist/components/charts/chart/chart.class.d.ts +2 -2
- package/dist/components/charts/chart/chart.class.js +2 -2
- package/dist/components/charts/chart/chart.styles.js +1 -1
- package/dist/components/charts/chart/histogram.class.js +1 -1
- package/dist/components/charts/chart/lite-chart.class.d.ts +1 -1
- package/dist/components/charts/chart/lite-chart.class.js +4 -4
- package/dist/components/conversation/catalog-picker-element.d.ts +28 -13
- package/dist/components/conversation/catalog-picker-element.js +1 -1
- package/dist/components/conversation/catalog-picker-trigger.styles.js +1 -0
- package/dist/components/conversation/chat-message/chat-message.class.js +1 -1
- package/dist/components/conversation/chat-message/chat-message.styles.js +1 -1
- package/dist/components/conversation/chat-viewport/chat-viewport.class.d.ts +1 -1
- package/dist/components/conversation/chat-viewport/chat-viewport.class.js +1 -1
- package/dist/components/conversation/code-block/code-block-shared.js +1 -1
- package/dist/components/conversation/conversation-item/conversation-item.class.js +1 -1
- package/dist/components/conversation/generation-metrics/generation-metrics.class.js +2 -2
- package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
- package/dist/components/conversation/markdown/markdown-code-header.js +1 -1
- package/dist/components/conversation/message-actions/message-actions.class.js +1 -1
- package/dist/components/conversation/model-select/model-select.class.d.ts +7 -34
- package/dist/components/conversation/model-select/model-select.class.js +3 -3
- package/dist/components/conversation/model-select/model-select.styles.js +1 -1
- package/dist/components/conversation/prompt-input/prompt-input.class.d.ts +7 -2
- package/dist/components/conversation/prompt-input/prompt-input.class.js +5 -2
- package/dist/components/conversation/prompt-queue/prompt-queue.class.js +1 -1
- package/dist/components/conversation/realtime-session/realtime-session.class.js +1 -1
- package/dist/components/conversation/selection-toolbar/selection-toolbar.class.js +1 -1
- package/dist/components/conversation/stream-status/stream-status.class.js +1 -1
- package/dist/components/conversation/voice-picker/voice-picker.class.d.ts +10 -27
- package/dist/components/conversation/voice-picker/voice-picker.class.js +3 -3
- package/dist/components/conversation/voice-picker/voice-picker.styles.js +1 -1
- package/dist/components/data/condition-builder/condition-builder.class.js +1 -1
- package/dist/components/data/data-grid/data-grid.class.js +1 -1
- package/dist/components/data/document-library/document-library.class.d.ts +2 -2
- package/dist/components/data/document-library/document-library.class.js +2 -2
- package/dist/components/data/graph-query-builder/graph-query-builder.class.d.ts +3 -3
- package/dist/components/data/graph-query-builder/graph-query-builder.class.js +1 -1
- package/dist/components/data/heatmap/heatmap.class.js +2 -2
- package/dist/components/data/sequence-strip/sequence-strip.class.d.ts +1 -1
- package/dist/components/data/sequence-strip/sequence-strip.class.js +1 -1
- package/dist/components/data/table/table.class.d.ts +10 -195
- package/dist/components/data/table/table.class.js +2 -2
- package/dist/components/data/table/table.styles.js +1 -1
- package/dist/components/data/timeline/timeline.class.js +1 -1
- package/dist/components/data/tree/tree.class.js +1 -1
- package/dist/components/forms/button/button.class.d.ts +3 -3
- package/dist/components/forms/button/button.class.js +1 -1
- package/dist/components/forms/catalog-picker-base.js +1 -1
- package/dist/components/forms/checkbox/checkbox.class.d.ts +13 -34
- package/dist/components/forms/checkbox/checkbox.class.js +3 -3
- package/dist/components/forms/checkbox-group/checkbox-group.class.d.ts +3 -3
- package/dist/components/forms/checkbox-group/checkbox-group.class.js +1 -1
- package/dist/components/forms/code-editor/code-editor.class.js +1 -1
- package/dist/components/forms/color-picker/color-picker.class.js +1 -1
- package/dist/components/forms/combobox/combobox.class.d.ts +6 -6
- package/dist/components/forms/combobox/combobox.class.js +3 -2
- package/dist/components/forms/combobox/option.class.d.ts +3 -0
- package/dist/components/forms/combobox/option.class.js +2 -2
- package/dist/components/forms/date-picker/date-input.class.d.ts +10 -11
- package/dist/components/forms/date-picker/date-input.class.js +4 -3
- package/dist/components/forms/date-picker/date-input.styles.js +1 -1
- package/dist/components/forms/date-picker/date-picker.class.d.ts +6 -0
- package/dist/components/forms/date-picker/date-picker.class.js +1 -1
- package/dist/components/forms/date-picker/date-picker.styles.js +1 -1
- package/dist/components/forms/emoji-picker/emoji-data-loader.js +1 -1
- package/dist/components/forms/emoji-picker/emoji-picker.class.js +1 -1
- package/dist/components/forms/input/input.styles.js +1 -1
- package/dist/components/forms/input/time-input.class.d.ts +1 -1
- package/dist/components/forms/input/time-input.class.js +1 -1
- package/dist/components/forms/input/time-input.styles.js +1 -1
- package/dist/components/forms/locale-picker/locale-picker.class.d.ts +5 -5
- package/dist/components/forms/locale-picker/locale-picker.class.js +1 -1
- package/dist/components/forms/otp-input/otp-input.class.js +1 -0
- package/dist/components/forms/phone-input/phone-input.class.d.ts +7 -9
- package/dist/components/forms/phone-input/phone-input.class.js +6 -5
- package/dist/components/forms/phone-input/phone-input.styles.js +1 -1
- package/dist/components/forms/radio/radio-group.class.d.ts +4 -4
- package/dist/components/forms/radio/radio-group.class.js +1 -1
- package/dist/components/forms/radio/radio.class.d.ts +11 -19
- package/dist/components/forms/radio/radio.class.js +2 -2
- package/dist/components/forms/rubric-form/rubric-form.class.d.ts +3 -5
- package/dist/components/forms/rubric-form/rubric-form.class.js +1 -1
- package/dist/components/forms/select/select.class.d.ts +5 -7
- package/dist/components/forms/select/select.class.js +3 -2
- package/dist/components/forms/slider/slider.class.d.ts +3 -3
- package/dist/components/forms/slider/slider.class.js +1 -1
- package/dist/components/forms/slider/slider.styles.js +1 -1
- package/dist/components/forms/swatch-picker/swatch-picker.class.js +1 -1
- package/dist/components/forms/switch/switch.class.d.ts +11 -36
- package/dist/components/forms/switch/switch.class.js +2 -2
- package/dist/components/forms/textarea/textarea.class.js +1 -0
- package/dist/components/forms/textarea/textarea.styles.js +1 -1
- package/dist/components/forms/time-range/time-range.class.d.ts +5 -3
- package/dist/components/forms/time-range/time-range.class.js +1 -1
- package/dist/components/forms/time-range/time-range.styles.js +1 -1
- package/dist/components/forms/toggle-group/toggle-group.class.d.ts +2 -2
- package/dist/components/forms/toggle-group/toggle-group.class.js +1 -1
- package/dist/components/forms/token-input/token-input.class.d.ts +3 -3
- package/dist/components/forms/token-input/token-input.class.js +1 -1
- package/dist/components/layout/app-rail/app-rail-item.class.js +1 -1
- package/dist/components/layout/app-rail/app-rail.class.d.ts +2 -2
- package/dist/components/layout/app-rail/app-rail.class.js +1 -1
- package/dist/components/layout/breadcrumb/breadcrumb-item.class.js +1 -1
- package/dist/components/layout/card/card.class.js +1 -1
- package/dist/components/layout/carousel/carousel.class.js +1 -1
- package/dist/components/layout/command-palette/command-palette.class.d.ts +6 -2
- package/dist/components/layout/command-palette/command-palette.class.js +1 -1
- package/dist/components/layout/dashboard-grid/dashboard-grid.class.js +1 -1
- package/dist/components/layout/details/accordion.class.js +1 -1
- package/dist/components/layout/dock-panel/dock-panel.class.d.ts +1 -1
- package/dist/components/layout/dock-panel/dock-panel.class.js +1 -1
- package/dist/components/layout/drilldown-panel/drilldown-panel.class.js +2 -2
- package/dist/components/layout/filter-bar/filter-bar.class.d.ts +3 -2
- package/dist/components/layout/filter-bar/filter-bar.class.js +18 -15
- package/dist/components/layout/filter-bar/filter-bar.styles.js +1 -1
- package/dist/components/layout/menu/menu.class.d.ts +1 -1
- package/dist/components/layout/menu/menu.class.js +1 -1
- package/dist/components/layout/multi-split/multi-split.class.d.ts +1 -1
- package/dist/components/layout/multi-split/multi-split.class.js +1 -1
- package/dist/components/layout/navigation-menu-item/navigation-menu-item.class.js +1 -1
- package/dist/components/layout/page/page.class.d.ts +1 -1
- package/dist/components/layout/page/page.class.js +1 -1
- package/dist/components/layout/responsive-panel/responsive-panel.class.d.ts +1 -1
- package/dist/components/layout/responsive-panel/responsive-panel.class.js +1 -1
- package/dist/components/layout/scroller/scroller.class.js +1 -1
- package/dist/components/layout/segmented/segmented.class.js +1 -1
- package/dist/components/layout/stepper/stepper.class.js +2 -2
- package/dist/components/layout/tab-group/tab-group.class.js +1 -1
- package/dist/components/layout/virtual-list/virtual-list.class.d.ts +1 -1
- package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
- package/dist/components/layout/widget/widget.class.d.ts +1 -1
- package/dist/components/layout/widget/widget.class.js +3 -3
- package/dist/components/media/drop-zone/drop-zone.class.d.ts +10 -0
- package/dist/components/media/drop-zone/drop-zone.class.js +2 -2
- package/dist/components/media/file-input/file-input.class.d.ts +3 -3
- package/dist/components/media/file-input/file-input.class.js +2 -2
- package/dist/components/media/file-input/file-intake.d.ts +5 -1
- package/dist/components/media/file-input/file-intake.js +1 -1
- package/dist/components/media/flag/flag.class.js +1 -1
- package/dist/components/media/image-viewer/image-viewer.styles.js +1 -1
- package/dist/components/media/lightbox/lightbox.class.js +1 -1
- package/dist/components/media/map/map.class.js +2 -2
- package/dist/components/media/qr-code/qr-code-loader.js +1 -1
- package/dist/components/media/qr-code/qr-code.class.js +1 -1
- package/dist/components/media/video/video.class.js +3 -3
- package/dist/components/media/video-playlist/video-playlist.class.js +1 -1
- package/dist/components/media/zoomable-frame/zoomable-frame.class.d.ts +2 -2
- package/dist/components/media/zoomable-frame/zoomable-frame.class.js +1 -1
- package/dist/components/overlays/alert/alert.class.d.ts +3 -3
- package/dist/components/overlays/alert/alert.class.js +1 -1
- package/dist/components/overlays/badge/badge.class.d.ts +2 -2
- package/dist/components/overlays/badge/badge.class.js +1 -1
- package/dist/components/overlays/badge/tag.class.d.ts +3 -1
- package/dist/components/overlays/badge/tag.class.js +3 -2
- package/dist/components/overlays/badge/tag.styles.js +1 -1
- package/dist/components/overlays/callout/callout.class.d.ts +2 -2
- package/dist/components/overlays/callout/callout.class.js +1 -1
- package/dist/components/overlays/chip/chip.class.d.ts +4 -2
- package/dist/components/overlays/chip/chip.class.js +2 -2
- package/dist/components/overlays/dialog/dialog.class.d.ts +1 -1
- package/dist/components/overlays/dialog/dialog.class.js +1 -1
- package/dist/components/overlays/overlay/overlay-shared.d.ts +9 -0
- package/dist/components/overlays/overlay/overlay-shared.js +1 -1
- package/dist/components/overlays/overlay/popover.class.d.ts +2 -2
- package/dist/components/overlays/overlay/popover.class.js +1 -1
- package/dist/components/overlays/overlay/tooltip.class.d.ts +1 -1
- package/dist/components/overlays/overlay/tooltip.class.js +1 -1
- package/dist/components/overlays/progress/progress-bar.class.d.ts +5 -22
- package/dist/components/overlays/progress/progress-bar.class.js +4 -4
- package/dist/components/overlays/progress/progress-base.d.ts +25 -0
- package/dist/components/overlays/progress/progress-base.js +1 -0
- package/dist/components/overlays/progress/progress-ring.class.d.ts +3 -24
- package/dist/components/overlays/progress/progress-ring.class.js +4 -4
- package/dist/components/overlays/rating/rating.class.d.ts +3 -3
- package/dist/components/overlays/rating/rating.class.js +1 -1
- package/dist/components/retrieval/chunk-inspector/chunk-inspector.class.d.ts +4 -2
- package/dist/components/retrieval/chunk-inspector/chunk-inspector.class.js +4 -4
- package/dist/components/retrieval/embedding-explorer/embedding-explorer.class.js +1 -1
- package/dist/components/retrieval/entity-dossier/entity-dossier.class.d.ts +1 -1
- package/dist/components/retrieval/graph/graph-canvas.js +1 -1
- package/dist/components/retrieval/graph/graph-model.js +1 -1
- package/dist/components/retrieval/graph/graph.class.d.ts +1 -3
- package/dist/components/retrieval/graph/graph.class.js +1 -1
- package/dist/components/retrieval/grounding-summary/grounding-summary.class.d.ts +1 -1
- package/dist/components/retrieval/grounding-summary/grounding-summary.class.js +2 -2
- package/dist/components/retrieval/knowledge-base/knowledge-base.class.d.ts +1 -1
- package/dist/components/retrieval/knowledge-base/knowledge-base.class.js +2 -2
- package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.class.js +1 -1
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +1 -0
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +2 -1
- package/dist/components/retrieval/memory-panel/memory-panel.class.d.ts +6 -2
- package/dist/components/retrieval/memory-panel/memory-panel.class.js +2 -2
- package/dist/components/retrieval/memory-panel/memory-panel.styles.js +1 -1
- package/dist/components/retrieval/node-palette/node-palette.class.js +1 -1
- package/dist/components/retrieval/path-strip/path-strip.class.js +1 -1
- package/dist/components/retrieval/provenance-panel/provenance-panel.class.d.ts +1 -1
- package/dist/components/retrieval/research-progress/research-progress.class.d.ts +5 -1
- package/dist/components/retrieval/research-progress/research-progress.class.js +3 -3
- package/dist/components/retrieval/research-progress/research-progress.d.ts +1 -1
- package/dist/components/retrieval/research-progress/research-progress.js +1 -1
- package/dist/components/retrieval/research-progress/research-progress.styles.js +1 -1
- package/dist/components/retrieval/retrieval-compare/retrieval-compare.class.d.ts +6 -2
- package/dist/components/retrieval/retrieval-compare/retrieval-compare.class.js +2 -2
- package/dist/components/retrieval/retrieval-compare/retrieval-compare.styles.js +1 -1
- package/dist/components/retrieval/retrieval-results/retrieval-results.class.d.ts +2 -2
- package/dist/components/retrieval/retrieval-results/retrieval-results.class.js +3 -2
- package/dist/components/retrieval/retrieval-search/retrieval-search.class.js +3 -3
- package/dist/components/retrieval/retrieval-trace/retrieval-trace.class.d.ts +6 -2
- package/dist/components/retrieval/retrieval-trace/retrieval-trace.class.js +2 -2
- package/dist/components/retrieval/retrieval-trace/retrieval-trace.styles.js +1 -1
- package/dist/components/retrieval/source-picker/source-picker.class.js +1 -1
- package/dist/components/utility/copy-button/copy-button.class.js +1 -1
- package/dist/components/utility/diff-view/diff-view.class.js +1 -1
- package/dist/components/utility/export-button/export-button.class.d.ts +1 -1
- package/dist/components/utility/export-button/export-button.class.js +1 -1
- package/dist/components/utility/icon/dompurify-loader.js +1 -1
- package/dist/components/utility/json-viewer/json-viewer.class.js +2 -2
- package/dist/components/utility/known-date/known-date.class.js +1 -1
- package/dist/components/utility/mention-popover/mention-popover.class.js +1 -1
- package/dist/components/utility/mutation-observer/mutation-observer.class.js +1 -1
- package/dist/components/utility/random-content/random-content.class.d.ts +1 -1
- package/dist/components/utility/random-content/random-content.class.js +1 -1
- package/dist/components/utility/tour/tour.class.d.ts +1 -1
- package/dist/components/utility/tour/tour.class.js +1 -1
- package/dist/components/viewers/archive-viewer/archive-viewer.class.js +1 -1
- package/dist/components/viewers/archive-viewer/archive-viewer.styles.js +1 -1
- package/dist/components/viewers/calendar-viewer/calendar-viewer.class.d.ts +3 -1
- package/dist/components/viewers/calendar-viewer/calendar-viewer.class.js +1 -1
- package/dist/components/viewers/contact-viewer/contact-viewer.class.d.ts +3 -1
- package/dist/components/viewers/contact-viewer/contact-viewer.class.js +1 -1
- package/dist/components/viewers/csv-viewer/csv-viewer.class.d.ts +2 -2
- package/dist/components/viewers/csv-viewer/csv-viewer.class.js +4 -18
- package/dist/components/viewers/csv-viewer/csv-viewer.styles.js +1 -1
- package/dist/components/viewers/dataset-viewer/dataset-viewer.class.d.ts +2 -2
- package/dist/components/viewers/dataset-viewer/dataset-viewer.class.js +4 -18
- package/dist/components/viewers/dataset-viewer/dataset-viewer.styles.js +1 -1
- package/dist/components/viewers/document-preview/document-preview.class.d.ts +1 -1
- package/dist/components/viewers/document-preview/document-preview.class.js +3 -16
- package/dist/components/viewers/document-viewer/ooxml-part-guard.js +1 -0
- package/dist/components/viewers/docx-viewer/docx-loader.js +1 -1
- package/dist/components/viewers/docx-viewer/docx-resource-guard.js +1 -1
- package/dist/components/viewers/docx-viewer/docx-viewer.class.d.ts +3 -3
- package/dist/components/viewers/docx-viewer/docx-viewer.class.js +3 -3
- package/dist/components/viewers/ebook-viewer/ebook-loader.js +1 -1
- package/dist/components/viewers/ebook-viewer/ebook-viewer.class.d.ts +1 -1
- package/dist/components/viewers/ebook-viewer/ebook-viewer.class.js +2 -1
- package/dist/components/viewers/ebook-viewer/epub-resource-guard.js +1 -1
- package/dist/components/viewers/email-viewer/email-viewer.class.d.ts +1 -1
- package/dist/components/viewers/email-viewer/email-viewer.class.js +2 -2
- package/dist/components/viewers/geojson-view/geojson-viewer.class.d.ts +1 -4
- package/dist/components/viewers/geojson-view/geojson-viewer.class.js +1 -1
- package/dist/components/viewers/highlight-layer/highlight-layer.class.js +1 -1
- package/dist/components/viewers/html-viewer/html-viewer.class.d.ts +3 -1
- package/dist/components/viewers/html-viewer/html-viewer.class.js +1 -1
- package/dist/components/viewers/html-viewer/html-viewer.styles.js +1 -1
- package/dist/components/viewers/notebook-viewer/dompurify-loader.js +1 -1
- package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +1 -1
- package/dist/components/viewers/page-rail/page-rail.class.js +2 -2
- package/dist/components/viewers/passive-markup.js +1 -1
- package/dist/components/viewers/pdf-viewer/pdf-loader.js +1 -1
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts +2 -2
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +4 -4
- package/dist/components/viewers/pptx-viewer/pptx-loader.js +1 -1
- package/dist/components/viewers/pptx-viewer/pptx-resource-guard.js +1 -1
- package/dist/components/viewers/pptx-viewer/pptx-viewer.class.js +1 -1
- package/dist/components/viewers/region-highlight-layer.js +15 -2
- package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.d.ts +2 -2
- package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.js +4 -18
- package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.styles.js +1 -1
- package/dist/components/viewers/svg-viewer/svg-viewer.class.d.ts +1 -1
- package/dist/components/viewers/svg-viewer/svg-viewer.class.js +2 -15
- package/dist/components/viewers/svg-viewer/svg-viewer.styles.js +1 -1
- package/dist/components/viewers/table-viewer-shared.js +15 -1
- package/dist/components/viewers/table-viewer-shared.styles.js +1 -0
- package/dist/events.d.ts +19 -18
- package/dist/framework-types.d.ts +1 -1
- package/dist/internal/accessibility-visibility.d.ts +3 -1
- package/dist/internal/accessibility-visibility.js +1 -1
- package/dist/internal/accessible-text-controller.js +1 -1
- package/dist/internal/active-element.d.ts +11 -0
- package/dist/internal/active-element.js +1 -1
- package/dist/internal/adjacent-runs.js +1 -1
- package/dist/internal/approval-wait-until.d.ts +7 -0
- package/dist/internal/approval-wait-until.js +1 -0
- package/dist/internal/aria-controls.js +1 -1
- package/dist/internal/catalog-picker.d.ts +2 -2
- package/dist/internal/catalog-picker.js +1 -1
- package/dist/internal/composed-tree.d.ts +18 -0
- package/dist/internal/composed-tree.js +1 -1
- package/dist/internal/copy-feedback.js +1 -0
- package/dist/internal/css-length.js +1 -1
- package/dist/internal/css-motion-time.js +1 -1
- package/dist/internal/css-number.js +1 -0
- package/dist/internal/default-strings.generated.js +1 -1
- package/dist/internal/deferred-focus-return.d.ts +33 -0
- package/dist/internal/deferred-focus-return.js +1 -1
- package/dist/internal/fixed-containing-block.js +1 -1
- package/dist/internal/form-associated.d.ts +38 -2
- package/dist/internal/form-associated.js +1 -1
- package/dist/internal/form-control-element.d.ts +13 -0
- package/dist/internal/form-control-element.js +1 -0
- package/dist/internal/form-control.styles.js +1 -1
- package/dist/internal/inherited-attribute-hub.js +1 -1
- package/dist/internal/locale-loaders.generated.js +1 -1
- package/dist/internal/localization-types.d.ts +1 -1
- package/dist/internal/localization.js +1 -1
- package/dist/internal/modal-surface-controller.js +1 -1
- package/dist/internal/object-guards.js +1 -1
- package/dist/internal/optional-peer-capabilities.d.ts +3 -1
- package/dist/internal/optional-peer-capabilities.js +1 -1
- package/dist/internal/orientation-breakpoint.js +1 -1
- package/dist/internal/overlay-manager.d.ts +6 -1
- package/dist/internal/overlay-manager.js +1 -1
- package/dist/internal/overlay-stack.d.ts +7 -3
- package/dist/internal/overlay-stack.js +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/persisted-restore.js +1 -1
- package/dist/internal/popup-controller.js +1 -0
- package/dist/internal/rendered-tree-traversal.d.ts +3 -1
- package/dist/internal/rendered-tree-traversal.js +1 -1
- package/dist/internal/retry-forwarder.js +1 -0
- package/dist/internal/roving-toolbar.js +1 -1
- package/dist/internal/scoped-definitions.generated.js +1 -1
- package/dist/internal/score-tiers.d.ts +4 -0
- package/dist/internal/score-tiers.js +1 -0
- package/dist/internal/semantic-variant.d.ts +7 -0
- package/dist/internal/semantic-variant.js +1 -0
- package/dist/internal/shared-unions.d.ts +1 -1
- package/dist/internal/viewer-search.js +1 -1
- package/dist/lyra.d.ts +1 -1
- package/dist/testing/happy-dom-shims.d.ts +18 -0
- package/dist/testing/happy-dom-shims.js +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +1 -1
- package/llms/components/lr-accordion-item.md +1 -1
- package/llms/components/lr-accordion.md +1 -1
- package/llms/components/lr-alert.md +2 -2
- package/llms/components/lr-app-rail-group.md +1 -1
- package/llms/components/lr-app-rail-item.md +1 -1
- package/llms/components/lr-app-rail.md +1 -1
- package/llms/components/lr-attachment-chip.md +1 -10
- package/llms/components/lr-attachment-trigger.md +0 -10
- package/llms/components/lr-avatar.md +4 -8
- package/llms/components/lr-badge.md +16 -20
- package/llms/components/lr-box-plot.md +1 -1
- package/llms/components/lr-breadcrumb-item.md +1 -1
- package/llms/components/lr-breadcrumb.md +1 -1
- package/llms/components/lr-button-group.md +1 -1
- package/llms/components/lr-button.md +1 -1
- package/llms/components/lr-calendar.md +1 -1
- package/llms/components/lr-callout.md +3 -13
- package/llms/components/lr-card.md +1 -1
- package/llms/components/lr-carousel-item.md +1 -1
- package/llms/components/lr-carousel.md +1 -1
- package/llms/components/lr-chart.md +5 -7
- package/llms/components/lr-checkbox-group.md +1 -1
- package/llms/components/lr-checkbox.md +2 -1
- package/llms/components/lr-chip.md +3 -17
- package/llms/components/lr-chunk-inspector.md +2 -1
- package/llms/components/lr-citation-badge.md +2 -2
- package/llms/components/lr-code-block.md +0 -10
- package/llms/components/lr-code-editor.md +1 -1
- package/llms/components/lr-color-picker.md +1 -1
- package/llms/components/lr-combobox.md +6 -3
- package/llms/components/lr-command-palette.md +5 -2
- package/llms/components/lr-commit-card.md +1 -3
- package/llms/components/lr-condition-builder.md +1 -1
- package/llms/components/lr-confirm-bar.md +7 -13
- package/llms/components/lr-connector-manager.md +3 -1
- package/llms/components/lr-context-inspector.md +1 -1
- package/llms/components/lr-context-meter.md +1 -1
- package/llms/components/lr-control-group.md +1 -1
- package/llms/components/lr-copy-button.md +8 -10
- package/llms/components/lr-country-picker.md +1 -1
- package/llms/components/lr-currency-picker.md +1 -1
- package/llms/components/lr-dashboard-grid.md +1 -1
- package/llms/components/lr-data-grid.md +1 -1
- package/llms/components/lr-date-input.md +1 -1
- package/llms/components/lr-date-picker.md +11 -4
- package/llms/components/lr-details.md +1 -1
- package/llms/components/lr-dialog.md +8 -31
- package/llms/components/lr-diff-view.md +1 -1
- package/llms/components/lr-divider.md +1 -1
- package/llms/components/lr-dock-panel.md +1 -1
- package/llms/components/lr-document-library.md +1 -1
- package/llms/components/lr-drawer.md +1 -13
- package/llms/components/lr-drilldown-panel.md +1 -1
- package/llms/components/lr-drop-zone.md +4 -0
- package/llms/components/lr-dropdown-item.md +1 -1
- package/llms/components/lr-ebook-viewer.md +4 -3
- package/llms/components/lr-emoji-picker.md +1 -1
- package/llms/components/lr-entity-chip.md +2 -2
- package/llms/components/lr-env-list.md +1 -1
- package/llms/components/lr-eval-dataset.md +4 -19
- package/llms/components/lr-export-button.md +3 -3
- package/llms/components/lr-file-icon.md +0 -5
- package/llms/components/lr-file-input.md +3 -5
- package/llms/components/lr-file-tree.md +1 -1
- package/llms/components/lr-filter-bar.md +5 -1
- package/llms/components/lr-flag.md +1 -2
- package/llms/components/lr-flow-canvas.md +1 -1
- package/llms/components/lr-flow-controls.md +1 -1
- package/llms/components/lr-flow-minimap.md +2 -2
- package/llms/components/lr-flow-node.md +1 -1
- package/llms/components/lr-flow-run-status.md +1 -1
- package/llms/components/lr-format-bytes.md +2 -3
- package/llms/components/lr-format-date.md +2 -3
- package/llms/components/lr-format-number.md +1 -1
- package/llms/components/lr-funnel.md +1 -1
- package/llms/components/lr-gauge.md +1 -1
- package/llms/components/lr-generation-metrics.md +1 -1
- package/llms/components/lr-graph-query-builder.md +1 -1
- package/llms/components/lr-heatmap.md +1 -1
- package/llms/components/lr-icon-button.md +1 -1
- package/llms/components/lr-icon.md +1 -1
- package/llms/components/lr-input.md +1 -1
- package/llms/components/lr-intersection-observer.md +1 -1
- package/llms/components/lr-json-viewer.md +1 -1
- package/llms/components/lr-knowledge-graph-explorer.md +2 -2
- package/llms/components/lr-known-date.md +1 -1
- package/llms/components/lr-lite-chart.md +3 -4
- package/llms/components/lr-live-region.md +1 -1
- package/llms/components/lr-locale-picker.md +1 -1
- package/llms/components/lr-map.md +1 -3
- package/llms/components/lr-media-card.md +1 -10
- package/llms/components/lr-memory-panel.md +2 -0
- package/llms/components/lr-mention-popover.md +3 -3
- package/llms/components/lr-menu-item.md +1 -1
- package/llms/components/lr-menu-label.md +1 -1
- package/llms/components/lr-menu.md +1 -1
- package/llms/components/lr-menubar-item.md +1 -1
- package/llms/components/lr-menubar.md +1 -1
- package/llms/components/lr-message-actions.md +1 -11
- package/llms/components/lr-message-parts.md +3 -5
- package/llms/components/lr-model-select.md +2 -4
- package/llms/components/lr-multi-split.md +1 -1
- package/llms/components/lr-mutation-observer.md +2 -2
- package/llms/components/lr-native-time-input.md +1 -1
- package/llms/components/lr-navigation-menu-item.md +1 -1
- package/llms/components/lr-navigation-menu.md +1 -1
- package/llms/components/lr-number-input.md +1 -1
- package/llms/components/lr-option.md +1 -1
- package/llms/components/lr-otp-input.md +1 -1
- package/llms/components/lr-page.md +1 -1
- package/llms/components/lr-pagination.md +1 -1
- package/llms/components/lr-pan-zoom.md +1 -3
- package/llms/components/lr-permission-grant.md +3 -1
- package/llms/components/lr-phone-input.md +7 -5
- package/llms/components/lr-poll-status.md +1 -1
- package/llms/components/lr-popover.md +5 -9
- package/llms/components/lr-popup.md +1 -3
- package/llms/components/lr-progress-bar.md +2 -1
- package/llms/components/lr-progress-ring.md +4 -8
- package/llms/components/lr-prompt-input.md +3 -1
- package/llms/components/lr-prompt-studio.md +4 -4
- package/llms/components/lr-radio-button.md +2 -2
- package/llms/components/lr-radio-group.md +1 -1
- package/llms/components/lr-radio.md +3 -2
- package/llms/components/lr-random-content.md +1 -1
- package/llms/components/lr-rating.md +2 -3
- package/llms/components/lr-relative-time.md +2 -3
- package/llms/components/lr-reorder-item.md +1 -1
- package/llms/components/lr-reorder-list.md +1 -1
- package/llms/components/lr-research-progress.md +2 -0
- package/llms/components/lr-resize-observer.md +1 -1
- package/llms/components/lr-responsive-panel.md +1 -1
- package/llms/components/lr-retrieval-compare.md +2 -0
- package/llms/components/lr-retrieval-trace.md +2 -0
- package/llms/components/lr-rubric-form.md +1 -1
- package/llms/components/lr-scroller.md +1 -1
- package/llms/components/lr-segmented.md +1 -1
- package/llms/components/lr-select.md +1 -1
- package/llms/components/lr-sequence-playback.md +1 -2
- package/llms/components/lr-sequence-strip.md +1 -1
- package/llms/components/lr-signature-pad.md +1 -1
- package/llms/components/lr-skeleton.md +2 -4
- package/llms/components/lr-slider.md +1 -1
- package/llms/components/lr-sparkline.md +1 -1
- package/llms/components/lr-split-panel.md +1 -1
- package/llms/components/lr-stat.md +1 -1
- package/llms/components/lr-stepper.md +1 -1
- package/llms/components/lr-swatch-picker.md +1 -1
- package/llms/components/lr-switch.md +2 -1
- package/llms/components/lr-tab-group.md +1 -1
- package/llms/components/lr-tab-panel.md +1 -1
- package/llms/components/lr-tab.md +1 -1
- package/llms/components/lr-table.md +3 -3
- package/llms/components/lr-task-list.md +3 -3
- package/llms/components/lr-test-results.md +2 -4
- package/llms/components/lr-textarea.md +1 -1
- package/llms/components/lr-time-input.md +1 -1
- package/llms/components/lr-time-range.md +5 -4
- package/llms/components/lr-time-zone-picker.md +1 -1
- package/llms/components/lr-timeline-item.md +1 -1
- package/llms/components/lr-timeline.md +1 -1
- package/llms/components/lr-toggle-group.md +1 -1
- package/llms/components/lr-toggle.md +1 -1
- package/llms/components/lr-token-input.md +1 -1
- package/llms/components/lr-tool-approval-dialog.md +12 -10
- package/llms/components/lr-tool-call-block.md +1 -1
- package/llms/components/lr-tool-call-chip.md +1 -3
- package/llms/components/lr-tool-result-view.md +3 -3
- package/llms/components/lr-tool-timeline.md +2 -2
- package/llms/components/lr-tooltip.md +8 -11
- package/llms/components/lr-tour.md +2 -2
- package/llms/components/lr-tree-item.md +1 -1
- package/llms/components/lr-tree.md +1 -1
- package/llms/components/lr-unit-picker.md +1 -1
- package/llms/components/lr-usage-badge.md +1 -3
- package/llms/components/lr-video.md +1 -2
- package/llms/components/lr-virtual-list.md +1 -1
- package/llms/components/lr-visually-hidden.md +1 -1
- package/llms/components/lr-voice-picker.md +1 -1
- package/llms/components/lr-widget.md +1 -1
- package/llms/components/lr-word-cloud.md +1 -1
- package/llms/components/lr-zoomable-frame.md +1 -6
- package/llms/migration.md +96 -2
- package/llms/peers.md +3 -2
- package/llms/shared/ai-and-peers.md +2 -2
- package/llms/shared/events-and-types.md +4 -1
- package/llms/shared/imports-and-registration.md +2 -2
- package/llms/shared/localization-and-rtl.md +18 -18
- package/llms/shared/styles-and-tokens.md +1 -1
- package/llms/shared/testing-and-utilities.md +44 -43
- package/llms/shared.md +71 -67
- package/llms.txt +14 -12
- package/locales.json +1002 -1002
- package/package.json +16 -6879
- package/registrations.json +1 -1
- package/skills/compose-lyra-interfaces/SKILL.md +60 -0
- package/skills/compose-lyra-interfaces/agents/openai.yaml +4 -0
- package/skills/compose-lyra-interfaces/references/composition-patterns.md +77 -0
- package/skills/lyra-ui/SKILL.md +145 -0
- package/skills/lyra-ui/commands/frontend.md +37 -0
- package/skills/lyra-ui/commands/migrate.md +44 -0
- package/skills/lyra-ui/commands/new-component.md +19 -0
- package/skills/lyra-ui/commands/review.md +247 -0
- package/skills/lyra-ui/commands/update.md +30 -0
- package/skills/lyra-ui/reporting.md +137 -0
- package/custom-elements.json +0 -1
- package/dist/internal/side-effect-only.d.ts +0 -1
- package/dist/translations/am/agent-tools.js +0 -1
- package/dist/translations/am/charts.js +0 -1
- package/dist/translations/am/conversation.js +0 -1
- package/dist/translations/am/data.js +0 -1
- package/dist/translations/am/forms.js +0 -1
- package/dist/translations/am/layout.js +0 -1
- package/dist/translations/am/media.js +0 -1
- package/dist/translations/am/overlays.js +0 -1
- package/dist/translations/am/retrieval.js +0 -1
- package/dist/translations/am/shared.js +0 -1
- package/dist/translations/am/utility.js +0 -1
- package/dist/translations/am/viewers.js +0 -5
- package/dist/translations/am.js +0 -1
- package/dist/translations/ar/agent-tools.js +0 -1
- package/dist/translations/ar/charts.js +0 -1
- package/dist/translations/ar/conversation.js +0 -1
- package/dist/translations/ar/data.js +0 -1
- package/dist/translations/ar/forms.js +0 -1
- package/dist/translations/ar/layout.js +0 -1
- package/dist/translations/ar/media.js +0 -1
- package/dist/translations/ar/overlays.js +0 -1
- package/dist/translations/ar/retrieval.js +0 -1
- package/dist/translations/ar/shared.js +0 -1
- package/dist/translations/ar/utility.js +0 -1
- package/dist/translations/ar/viewers.js +0 -5
- package/dist/translations/ar.js +0 -1
- package/dist/translations/bho/agent-tools.js +0 -1
- package/dist/translations/bho/charts.js +0 -1
- package/dist/translations/bho/conversation.js +0 -1
- package/dist/translations/bho/data.js +0 -1
- package/dist/translations/bho/forms.js +0 -1
- package/dist/translations/bho/layout.js +0 -1
- package/dist/translations/bho/media.js +0 -1
- package/dist/translations/bho/overlays.js +0 -1
- package/dist/translations/bho/retrieval.js +0 -1
- package/dist/translations/bho/shared.js +0 -1
- package/dist/translations/bho/utility.js +0 -1
- package/dist/translations/bho/viewers.js +0 -5
- package/dist/translations/bho.js +0 -1
- package/dist/translations/bn/agent-tools.js +0 -1
- package/dist/translations/bn/charts.js +0 -1
- package/dist/translations/bn/conversation.js +0 -1
- package/dist/translations/bn/data.js +0 -1
- package/dist/translations/bn/forms.js +0 -1
- package/dist/translations/bn/layout.js +0 -1
- package/dist/translations/bn/media.js +0 -1
- package/dist/translations/bn/overlays.js +0 -1
- package/dist/translations/bn/retrieval.js +0 -1
- package/dist/translations/bn/shared.js +0 -1
- package/dist/translations/bn/utility.js +0 -1
- package/dist/translations/bn/viewers.js +0 -5
- package/dist/translations/bn.js +0 -1
- package/dist/translations/cs/agent-tools.js +0 -1
- package/dist/translations/cs/charts.js +0 -1
- package/dist/translations/cs/conversation.js +0 -1
- package/dist/translations/cs/data.js +0 -1
- package/dist/translations/cs/forms.js +0 -1
- package/dist/translations/cs/layout.js +0 -1
- package/dist/translations/cs/media.js +0 -1
- package/dist/translations/cs/overlays.js +0 -1
- package/dist/translations/cs/retrieval.js +0 -1
- package/dist/translations/cs/shared.js +0 -1
- package/dist/translations/cs/utility.js +0 -1
- package/dist/translations/cs/viewers.js +0 -5
- package/dist/translations/cs.js +0 -1
- package/dist/translations/da/agent-tools.js +0 -1
- package/dist/translations/da/charts.js +0 -1
- package/dist/translations/da/conversation.js +0 -1
- package/dist/translations/da/data.js +0 -1
- package/dist/translations/da/forms.js +0 -1
- package/dist/translations/da/layout.js +0 -1
- package/dist/translations/da/media.js +0 -1
- package/dist/translations/da/overlays.js +0 -1
- package/dist/translations/da/retrieval.js +0 -1
- package/dist/translations/da/shared.js +0 -1
- package/dist/translations/da/utility.js +0 -1
- package/dist/translations/da/viewers.js +0 -5
- package/dist/translations/da.js +0 -1
- package/dist/translations/de/agent-tools.js +0 -1
- package/dist/translations/de/charts.js +0 -1
- package/dist/translations/de/conversation.js +0 -1
- package/dist/translations/de/data.js +0 -1
- package/dist/translations/de/forms.js +0 -1
- package/dist/translations/de/layout.js +0 -1
- package/dist/translations/de/media.js +0 -1
- package/dist/translations/de/overlays.js +0 -1
- package/dist/translations/de/retrieval.js +0 -1
- package/dist/translations/de/shared.js +0 -1
- package/dist/translations/de/utility.js +0 -1
- package/dist/translations/de/viewers.js +0 -5
- package/dist/translations/de-CH/agent-tools.js +0 -1
- package/dist/translations/de-CH/charts.js +0 -1
- package/dist/translations/de-CH/conversation.js +0 -1
- package/dist/translations/de-CH/data.js +0 -1
- package/dist/translations/de-CH/forms.js +0 -1
- package/dist/translations/de-CH/layout.js +0 -1
- package/dist/translations/de-CH/media.js +0 -1
- package/dist/translations/de-CH/overlays.js +0 -1
- package/dist/translations/de-CH/retrieval.js +0 -1
- package/dist/translations/de-CH/shared.js +0 -1
- package/dist/translations/de-CH/utility.js +0 -1
- package/dist/translations/de-CH/viewers.js +0 -1
- package/dist/translations/de-CH.js +0 -1
- package/dist/translations/de.js +0 -1
- package/dist/translations/el/agent-tools.js +0 -1
- package/dist/translations/el/charts.js +0 -1
- package/dist/translations/el/conversation.js +0 -1
- package/dist/translations/el/data.js +0 -1
- package/dist/translations/el/forms.js +0 -1
- package/dist/translations/el/layout.js +0 -1
- package/dist/translations/el/media.js +0 -1
- package/dist/translations/el/overlays.js +0 -1
- package/dist/translations/el/retrieval.js +0 -1
- package/dist/translations/el/shared.js +0 -1
- package/dist/translations/el/utility.js +0 -1
- package/dist/translations/el/viewers.js +0 -5
- package/dist/translations/el.js +0 -1
- package/dist/translations/es/agent-tools.js +0 -1
- package/dist/translations/es/charts.js +0 -1
- package/dist/translations/es/conversation.js +0 -1
- package/dist/translations/es/data.js +0 -1
- package/dist/translations/es/forms.js +0 -1
- package/dist/translations/es/layout.js +0 -1
- package/dist/translations/es/media.js +0 -1
- package/dist/translations/es/overlays.js +0 -1
- package/dist/translations/es/retrieval.js +0 -1
- package/dist/translations/es/shared.js +0 -1
- package/dist/translations/es/utility.js +0 -1
- package/dist/translations/es/viewers.js +0 -5
- package/dist/translations/es.js +0 -1
- package/dist/translations/fa/agent-tools.js +0 -1
- package/dist/translations/fa/charts.js +0 -1
- package/dist/translations/fa/conversation.js +0 -1
- package/dist/translations/fa/data.js +0 -1
- package/dist/translations/fa/forms.js +0 -1
- package/dist/translations/fa/layout.js +0 -1
- package/dist/translations/fa/media.js +0 -1
- package/dist/translations/fa/overlays.js +0 -1
- package/dist/translations/fa/retrieval.js +0 -1
- package/dist/translations/fa/shared.js +0 -1
- package/dist/translations/fa/utility.js +0 -1
- package/dist/translations/fa/viewers.js +0 -5
- package/dist/translations/fa-AF/agent-tools.js +0 -1
- package/dist/translations/fa-AF/charts.js +0 -1
- package/dist/translations/fa-AF/conversation.js +0 -1
- package/dist/translations/fa-AF/data.js +0 -1
- package/dist/translations/fa-AF/forms.js +0 -1
- package/dist/translations/fa-AF/layout.js +0 -1
- package/dist/translations/fa-AF/media.js +0 -1
- package/dist/translations/fa-AF/overlays.js +0 -1
- package/dist/translations/fa-AF/retrieval.js +0 -1
- package/dist/translations/fa-AF/shared.js +0 -1
- package/dist/translations/fa-AF/utility.js +0 -1
- package/dist/translations/fa-AF/viewers.js +0 -5
- package/dist/translations/fa-AF.js +0 -1
- package/dist/translations/fa.js +0 -1
- package/dist/translations/fi/agent-tools.js +0 -1
- package/dist/translations/fi/charts.js +0 -1
- package/dist/translations/fi/conversation.js +0 -1
- package/dist/translations/fi/data.js +0 -1
- package/dist/translations/fi/forms.js +0 -1
- package/dist/translations/fi/layout.js +0 -1
- package/dist/translations/fi/media.js +0 -1
- package/dist/translations/fi/overlays.js +0 -1
- package/dist/translations/fi/retrieval.js +0 -1
- package/dist/translations/fi/shared.js +0 -1
- package/dist/translations/fi/utility.js +0 -1
- package/dist/translations/fi/viewers.js +0 -5
- package/dist/translations/fi.js +0 -1
- package/dist/translations/fr/agent-tools.js +0 -1
- package/dist/translations/fr/charts.js +0 -1
- package/dist/translations/fr/conversation.js +0 -1
- package/dist/translations/fr/data.js +0 -1
- package/dist/translations/fr/forms.js +0 -1
- package/dist/translations/fr/layout.js +0 -1
- package/dist/translations/fr/media.js +0 -1
- package/dist/translations/fr/overlays.js +0 -1
- package/dist/translations/fr/retrieval.js +0 -1
- package/dist/translations/fr/shared.js +0 -1
- package/dist/translations/fr/utility.js +0 -1
- package/dist/translations/fr/viewers.js +0 -5
- package/dist/translations/fr.js +0 -1
- package/dist/translations/gu/agent-tools.js +0 -1
- package/dist/translations/gu/charts.js +0 -1
- package/dist/translations/gu/conversation.js +0 -1
- package/dist/translations/gu/data.js +0 -1
- package/dist/translations/gu/forms.js +0 -1
- package/dist/translations/gu/layout.js +0 -1
- package/dist/translations/gu/media.js +0 -1
- package/dist/translations/gu/overlays.js +0 -1
- package/dist/translations/gu/retrieval.js +0 -1
- package/dist/translations/gu/shared.js +0 -1
- package/dist/translations/gu/utility.js +0 -1
- package/dist/translations/gu/viewers.js +0 -5
- package/dist/translations/gu.js +0 -1
- package/dist/translations/ha/agent-tools.js +0 -1
- package/dist/translations/ha/charts.js +0 -1
- package/dist/translations/ha/conversation.js +0 -1
- package/dist/translations/ha/data.js +0 -1
- package/dist/translations/ha/forms.js +0 -1
- package/dist/translations/ha/layout.js +0 -1
- package/dist/translations/ha/media.js +0 -1
- package/dist/translations/ha/overlays.js +0 -1
- package/dist/translations/ha/retrieval.js +0 -1
- package/dist/translations/ha/shared.js +0 -1
- package/dist/translations/ha/utility.js +0 -1
- package/dist/translations/ha/viewers.js +0 -5
- package/dist/translations/ha.js +0 -1
- package/dist/translations/he/agent-tools.js +0 -1
- package/dist/translations/he/charts.js +0 -1
- package/dist/translations/he/conversation.js +0 -1
- package/dist/translations/he/data.js +0 -1
- package/dist/translations/he/forms.js +0 -1
- package/dist/translations/he/layout.js +0 -1
- package/dist/translations/he/media.js +0 -1
- package/dist/translations/he/overlays.js +0 -1
- package/dist/translations/he/retrieval.js +0 -1
- package/dist/translations/he/shared.js +0 -1
- package/dist/translations/he/utility.js +0 -1
- package/dist/translations/he/viewers.js +0 -5
- package/dist/translations/he.js +0 -1
- package/dist/translations/hi/agent-tools.js +0 -1
- package/dist/translations/hi/charts.js +0 -1
- package/dist/translations/hi/conversation.js +0 -1
- package/dist/translations/hi/data.js +0 -1
- package/dist/translations/hi/forms.js +0 -1
- package/dist/translations/hi/layout.js +0 -1
- package/dist/translations/hi/media.js +0 -1
- package/dist/translations/hi/overlays.js +0 -1
- package/dist/translations/hi/retrieval.js +0 -1
- package/dist/translations/hi/shared.js +0 -1
- package/dist/translations/hi/utility.js +0 -1
- package/dist/translations/hi/viewers.js +0 -5
- package/dist/translations/hi.js +0 -1
- package/dist/translations/hr/agent-tools.js +0 -1
- package/dist/translations/hr/charts.js +0 -1
- package/dist/translations/hr/conversation.js +0 -1
- package/dist/translations/hr/data.js +0 -1
- package/dist/translations/hr/forms.js +0 -1
- package/dist/translations/hr/layout.js +0 -1
- package/dist/translations/hr/media.js +0 -1
- package/dist/translations/hr/overlays.js +0 -1
- package/dist/translations/hr/retrieval.js +0 -1
- package/dist/translations/hr/shared.js +0 -1
- package/dist/translations/hr/utility.js +0 -1
- package/dist/translations/hr/viewers.js +0 -5
- package/dist/translations/hr.js +0 -1
- package/dist/translations/hu/agent-tools.js +0 -1
- package/dist/translations/hu/charts.js +0 -1
- package/dist/translations/hu/conversation.js +0 -1
- package/dist/translations/hu/data.js +0 -1
- package/dist/translations/hu/forms.js +0 -1
- package/dist/translations/hu/layout.js +0 -1
- package/dist/translations/hu/media.js +0 -1
- package/dist/translations/hu/overlays.js +0 -1
- package/dist/translations/hu/retrieval.js +0 -1
- package/dist/translations/hu/shared.js +0 -1
- package/dist/translations/hu/utility.js +0 -1
- package/dist/translations/hu/viewers.js +0 -5
- package/dist/translations/hu.js +0 -1
- package/dist/translations/id/agent-tools.js +0 -1
- package/dist/translations/id/charts.js +0 -1
- package/dist/translations/id/conversation.js +0 -1
- package/dist/translations/id/data.js +0 -1
- package/dist/translations/id/forms.js +0 -1
- package/dist/translations/id/layout.js +0 -1
- package/dist/translations/id/media.js +0 -1
- package/dist/translations/id/overlays.js +0 -1
- package/dist/translations/id/retrieval.js +0 -1
- package/dist/translations/id/shared.js +0 -1
- package/dist/translations/id/utility.js +0 -1
- package/dist/translations/id/viewers.js +0 -5
- package/dist/translations/id.js +0 -1
- package/dist/translations/ig/agent-tools.js +0 -1
- package/dist/translations/ig/charts.js +0 -1
- package/dist/translations/ig/conversation.js +0 -1
- package/dist/translations/ig/data.js +0 -1
- package/dist/translations/ig/forms.js +0 -1
- package/dist/translations/ig/layout.js +0 -1
- package/dist/translations/ig/media.js +0 -1
- package/dist/translations/ig/overlays.js +0 -1
- package/dist/translations/ig/retrieval.js +0 -1
- package/dist/translations/ig/shared.js +0 -1
- package/dist/translations/ig/utility.js +0 -1
- package/dist/translations/ig/viewers.js +0 -5
- package/dist/translations/ig.js +0 -1
- package/dist/translations/it/agent-tools.js +0 -1
- package/dist/translations/it/charts.js +0 -1
- package/dist/translations/it/conversation.js +0 -1
- package/dist/translations/it/data.js +0 -1
- package/dist/translations/it/forms.js +0 -1
- package/dist/translations/it/layout.js +0 -1
- package/dist/translations/it/media.js +0 -1
- package/dist/translations/it/overlays.js +0 -1
- package/dist/translations/it/retrieval.js +0 -1
- package/dist/translations/it/shared.js +0 -1
- package/dist/translations/it/utility.js +0 -1
- package/dist/translations/it/viewers.js +0 -5
- package/dist/translations/it.js +0 -1
- package/dist/translations/ja/agent-tools.js +0 -1
- package/dist/translations/ja/charts.js +0 -1
- package/dist/translations/ja/conversation.js +0 -1
- package/dist/translations/ja/data.js +0 -1
- package/dist/translations/ja/forms.js +0 -1
- package/dist/translations/ja/layout.js +0 -1
- package/dist/translations/ja/media.js +0 -1
- package/dist/translations/ja/overlays.js +0 -1
- package/dist/translations/ja/retrieval.js +0 -1
- package/dist/translations/ja/shared.js +0 -1
- package/dist/translations/ja/utility.js +0 -1
- package/dist/translations/ja/viewers.js +0 -4
- package/dist/translations/ja.js +0 -1
- package/dist/translations/jv/agent-tools.js +0 -1
- package/dist/translations/jv/charts.js +0 -1
- package/dist/translations/jv/conversation.js +0 -1
- package/dist/translations/jv/data.js +0 -1
- package/dist/translations/jv/forms.js +0 -1
- package/dist/translations/jv/layout.js +0 -1
- package/dist/translations/jv/media.js +0 -1
- package/dist/translations/jv/overlays.js +0 -1
- package/dist/translations/jv/retrieval.js +0 -1
- package/dist/translations/jv/shared.js +0 -1
- package/dist/translations/jv/utility.js +0 -1
- package/dist/translations/jv/viewers.js +0 -5
- package/dist/translations/jv.js +0 -1
- package/dist/translations/kk/agent-tools.js +0 -1
- package/dist/translations/kk/charts.js +0 -1
- package/dist/translations/kk/conversation.js +0 -1
- package/dist/translations/kk/data.js +0 -1
- package/dist/translations/kk/forms.js +0 -1
- package/dist/translations/kk/layout.js +0 -1
- package/dist/translations/kk/media.js +0 -1
- package/dist/translations/kk/overlays.js +0 -1
- package/dist/translations/kk/retrieval.js +0 -1
- package/dist/translations/kk/shared.js +0 -1
- package/dist/translations/kk/utility.js +0 -1
- package/dist/translations/kk/viewers.js +0 -5
- package/dist/translations/kk.js +0 -1
- package/dist/translations/kn/agent-tools.js +0 -1
- package/dist/translations/kn/charts.js +0 -1
- package/dist/translations/kn/conversation.js +0 -1
- package/dist/translations/kn/data.js +0 -1
- package/dist/translations/kn/forms.js +0 -1
- package/dist/translations/kn/layout.js +0 -1
- package/dist/translations/kn/media.js +0 -1
- package/dist/translations/kn/overlays.js +0 -1
- package/dist/translations/kn/retrieval.js +0 -1
- package/dist/translations/kn/shared.js +0 -1
- package/dist/translations/kn/utility.js +0 -1
- package/dist/translations/kn/viewers.js +0 -5
- package/dist/translations/kn.js +0 -1
- package/dist/translations/ko/agent-tools.js +0 -1
- package/dist/translations/ko/charts.js +0 -1
- package/dist/translations/ko/conversation.js +0 -1
- package/dist/translations/ko/data.js +0 -1
- package/dist/translations/ko/forms.js +0 -1
- package/dist/translations/ko/layout.js +0 -1
- package/dist/translations/ko/media.js +0 -1
- package/dist/translations/ko/overlays.js +0 -1
- package/dist/translations/ko/retrieval.js +0 -1
- package/dist/translations/ko/shared.js +0 -1
- package/dist/translations/ko/utility.js +0 -1
- package/dist/translations/ko/viewers.js +0 -5
- package/dist/translations/ko.js +0 -1
- package/dist/translations/ln/agent-tools.js +0 -1
- package/dist/translations/ln/charts.js +0 -1
- package/dist/translations/ln/conversation.js +0 -1
- package/dist/translations/ln/data.js +0 -1
- package/dist/translations/ln/forms.js +0 -1
- package/dist/translations/ln/layout.js +0 -1
- package/dist/translations/ln/media.js +0 -1
- package/dist/translations/ln/overlays.js +0 -1
- package/dist/translations/ln/retrieval.js +0 -1
- package/dist/translations/ln/shared.js +0 -1
- package/dist/translations/ln/utility.js +0 -1
- package/dist/translations/ln/viewers.js +0 -5
- package/dist/translations/ln.js +0 -1
- package/dist/translations/ml/agent-tools.js +0 -1
- package/dist/translations/ml/charts.js +0 -1
- package/dist/translations/ml/conversation.js +0 -1
- package/dist/translations/ml/data.js +0 -1
- package/dist/translations/ml/forms.js +0 -1
- package/dist/translations/ml/layout.js +0 -1
- package/dist/translations/ml/media.js +0 -1
- package/dist/translations/ml/overlays.js +0 -1
- package/dist/translations/ml/retrieval.js +0 -1
- package/dist/translations/ml/shared.js +0 -1
- package/dist/translations/ml/utility.js +0 -1
- package/dist/translations/ml/viewers.js +0 -5
- package/dist/translations/ml.js +0 -1
- package/dist/translations/mr/agent-tools.js +0 -1
- package/dist/translations/mr/charts.js +0 -1
- package/dist/translations/mr/conversation.js +0 -1
- package/dist/translations/mr/data.js +0 -1
- package/dist/translations/mr/forms.js +0 -1
- package/dist/translations/mr/layout.js +0 -1
- package/dist/translations/mr/media.js +0 -1
- package/dist/translations/mr/overlays.js +0 -1
- package/dist/translations/mr/retrieval.js +0 -1
- package/dist/translations/mr/shared.js +0 -1
- package/dist/translations/mr/utility.js +0 -1
- package/dist/translations/mr/viewers.js +0 -5
- package/dist/translations/mr.js +0 -1
- package/dist/translations/ms/agent-tools.js +0 -1
- package/dist/translations/ms/charts.js +0 -1
- package/dist/translations/ms/conversation.js +0 -1
- package/dist/translations/ms/data.js +0 -1
- package/dist/translations/ms/forms.js +0 -1
- package/dist/translations/ms/layout.js +0 -1
- package/dist/translations/ms/media.js +0 -1
- package/dist/translations/ms/overlays.js +0 -1
- package/dist/translations/ms/retrieval.js +0 -1
- package/dist/translations/ms/shared.js +0 -1
- package/dist/translations/ms/utility.js +0 -1
- package/dist/translations/ms/viewers.js +0 -5
- package/dist/translations/ms.js +0 -1
- package/dist/translations/my/agent-tools.js +0 -1
- package/dist/translations/my/charts.js +0 -1
- package/dist/translations/my/conversation.js +0 -1
- package/dist/translations/my/data.js +0 -1
- package/dist/translations/my/forms.js +0 -1
- package/dist/translations/my/layout.js +0 -1
- package/dist/translations/my/media.js +0 -1
- package/dist/translations/my/overlays.js +0 -1
- package/dist/translations/my/retrieval.js +0 -1
- package/dist/translations/my/shared.js +0 -1
- package/dist/translations/my/utility.js +0 -1
- package/dist/translations/my/viewers.js +0 -5
- package/dist/translations/my.js +0 -1
- package/dist/translations/nb/agent-tools.js +0 -1
- package/dist/translations/nb/charts.js +0 -1
- package/dist/translations/nb/conversation.js +0 -1
- package/dist/translations/nb/data.js +0 -1
- package/dist/translations/nb/forms.js +0 -1
- package/dist/translations/nb/layout.js +0 -1
- package/dist/translations/nb/media.js +0 -1
- package/dist/translations/nb/overlays.js +0 -1
- package/dist/translations/nb/retrieval.js +0 -1
- package/dist/translations/nb/shared.js +0 -1
- package/dist/translations/nb/utility.js +0 -1
- package/dist/translations/nb/viewers.js +0 -5
- package/dist/translations/nb.js +0 -1
- package/dist/translations/ne/agent-tools.js +0 -1
- package/dist/translations/ne/charts.js +0 -1
- package/dist/translations/ne/conversation.js +0 -1
- package/dist/translations/ne/data.js +0 -1
- package/dist/translations/ne/forms.js +0 -1
- package/dist/translations/ne/layout.js +0 -1
- package/dist/translations/ne/media.js +0 -1
- package/dist/translations/ne/overlays.js +0 -1
- package/dist/translations/ne/retrieval.js +0 -1
- package/dist/translations/ne/shared.js +0 -1
- package/dist/translations/ne/utility.js +0 -1
- package/dist/translations/ne/viewers.js +0 -5
- package/dist/translations/ne.js +0 -1
- package/dist/translations/nl/agent-tools.js +0 -1
- package/dist/translations/nl/charts.js +0 -1
- package/dist/translations/nl/conversation.js +0 -1
- package/dist/translations/nl/data.js +0 -1
- package/dist/translations/nl/forms.js +0 -1
- package/dist/translations/nl/layout.js +0 -1
- package/dist/translations/nl/media.js +0 -1
- package/dist/translations/nl/overlays.js +0 -1
- package/dist/translations/nl/retrieval.js +0 -1
- package/dist/translations/nl/shared.js +0 -1
- package/dist/translations/nl/utility.js +0 -1
- package/dist/translations/nl/viewers.js +0 -5
- package/dist/translations/nl.js +0 -1
- package/dist/translations/nn/agent-tools.js +0 -1
- package/dist/translations/nn/charts.js +0 -1
- package/dist/translations/nn/conversation.js +0 -1
- package/dist/translations/nn/data.js +0 -1
- package/dist/translations/nn/forms.js +0 -1
- package/dist/translations/nn/layout.js +0 -1
- package/dist/translations/nn/media.js +0 -1
- package/dist/translations/nn/overlays.js +0 -1
- package/dist/translations/nn/retrieval.js +0 -1
- package/dist/translations/nn/shared.js +0 -1
- package/dist/translations/nn/utility.js +0 -1
- package/dist/translations/nn/viewers.js +0 -5
- package/dist/translations/nn.js +0 -1
- package/dist/translations/om/agent-tools.js +0 -1
- package/dist/translations/om/charts.js +0 -1
- package/dist/translations/om/conversation.js +0 -1
- package/dist/translations/om/data.js +0 -1
- package/dist/translations/om/forms.js +0 -1
- package/dist/translations/om/layout.js +0 -1
- package/dist/translations/om/media.js +0 -1
- package/dist/translations/om/overlays.js +0 -1
- package/dist/translations/om/retrieval.js +0 -1
- package/dist/translations/om/shared.js +0 -1
- package/dist/translations/om/utility.js +0 -1
- package/dist/translations/om/viewers.js +0 -5
- package/dist/translations/om.js +0 -1
- package/dist/translations/or/agent-tools.js +0 -1
- package/dist/translations/or/charts.js +0 -1
- package/dist/translations/or/conversation.js +0 -1
- package/dist/translations/or/data.js +0 -1
- package/dist/translations/or/forms.js +0 -1
- package/dist/translations/or/layout.js +0 -1
- package/dist/translations/or/media.js +0 -1
- package/dist/translations/or/overlays.js +0 -1
- package/dist/translations/or/retrieval.js +0 -1
- package/dist/translations/or/shared.js +0 -1
- package/dist/translations/or/utility.js +0 -1
- package/dist/translations/or/viewers.js +0 -5
- package/dist/translations/or.js +0 -1
- package/dist/translations/pa/agent-tools.js +0 -1
- package/dist/translations/pa/charts.js +0 -1
- package/dist/translations/pa/conversation.js +0 -1
- package/dist/translations/pa/data.js +0 -1
- package/dist/translations/pa/forms.js +0 -1
- package/dist/translations/pa/layout.js +0 -1
- package/dist/translations/pa/media.js +0 -1
- package/dist/translations/pa/overlays.js +0 -1
- package/dist/translations/pa/retrieval.js +0 -1
- package/dist/translations/pa/shared.js +0 -1
- package/dist/translations/pa/utility.js +0 -1
- package/dist/translations/pa/viewers.js +0 -5
- package/dist/translations/pa.js +0 -1
- package/dist/translations/pcm/agent-tools.js +0 -1
- package/dist/translations/pcm/charts.js +0 -1
- package/dist/translations/pcm/conversation.js +0 -1
- package/dist/translations/pcm/data.js +0 -1
- package/dist/translations/pcm/forms.js +0 -1
- package/dist/translations/pcm/layout.js +0 -1
- package/dist/translations/pcm/media.js +0 -1
- package/dist/translations/pcm/overlays.js +0 -1
- package/dist/translations/pcm/retrieval.js +0 -1
- package/dist/translations/pcm/shared.js +0 -1
- package/dist/translations/pcm/utility.js +0 -1
- package/dist/translations/pcm/viewers.js +0 -5
- package/dist/translations/pcm.js +0 -1
- package/dist/translations/pl/agent-tools.js +0 -1
- package/dist/translations/pl/charts.js +0 -1
- package/dist/translations/pl/conversation.js +0 -1
- package/dist/translations/pl/data.js +0 -1
- package/dist/translations/pl/forms.js +0 -1
- package/dist/translations/pl/layout.js +0 -1
- package/dist/translations/pl/media.js +0 -1
- package/dist/translations/pl/overlays.js +0 -1
- package/dist/translations/pl/retrieval.js +0 -1
- package/dist/translations/pl/shared.js +0 -1
- package/dist/translations/pl/utility.js +0 -1
- package/dist/translations/pl/viewers.js +0 -5
- package/dist/translations/pl.js +0 -1
- package/dist/translations/pnb/agent-tools.js +0 -1
- package/dist/translations/pnb/charts.js +0 -1
- package/dist/translations/pnb/conversation.js +0 -1
- package/dist/translations/pnb/data.js +0 -1
- package/dist/translations/pnb/forms.js +0 -1
- package/dist/translations/pnb/layout.js +0 -1
- package/dist/translations/pnb/media.js +0 -1
- package/dist/translations/pnb/overlays.js +0 -1
- package/dist/translations/pnb/retrieval.js +0 -1
- package/dist/translations/pnb/shared.js +0 -1
- package/dist/translations/pnb/utility.js +0 -1
- package/dist/translations/pnb/viewers.js +0 -5
- package/dist/translations/pnb.js +0 -1
- package/dist/translations/ps/agent-tools.js +0 -1
- package/dist/translations/ps/charts.js +0 -1
- package/dist/translations/ps/conversation.js +0 -1
- package/dist/translations/ps/data.js +0 -1
- package/dist/translations/ps/forms.js +0 -1
- package/dist/translations/ps/layout.js +0 -1
- package/dist/translations/ps/media.js +0 -1
- package/dist/translations/ps/overlays.js +0 -1
- package/dist/translations/ps/retrieval.js +0 -1
- package/dist/translations/ps/shared.js +0 -1
- package/dist/translations/ps/utility.js +0 -1
- package/dist/translations/ps/viewers.js +0 -5
- package/dist/translations/ps.js +0 -1
- package/dist/translations/pt-BR/agent-tools.js +0 -1
- package/dist/translations/pt-BR/charts.js +0 -1
- package/dist/translations/pt-BR/conversation.js +0 -1
- package/dist/translations/pt-BR/data.js +0 -1
- package/dist/translations/pt-BR/forms.js +0 -1
- package/dist/translations/pt-BR/layout.js +0 -1
- package/dist/translations/pt-BR/media.js +0 -1
- package/dist/translations/pt-BR/overlays.js +0 -1
- package/dist/translations/pt-BR/retrieval.js +0 -1
- package/dist/translations/pt-BR/shared.js +0 -1
- package/dist/translations/pt-BR/utility.js +0 -1
- package/dist/translations/pt-BR/viewers.js +0 -5
- package/dist/translations/pt-BR.js +0 -1
- package/dist/translations/pt-PT/agent-tools.js +0 -1
- package/dist/translations/pt-PT/charts.js +0 -1
- package/dist/translations/pt-PT/conversation.js +0 -1
- package/dist/translations/pt-PT/data.js +0 -1
- package/dist/translations/pt-PT/forms.js +0 -1
- package/dist/translations/pt-PT/layout.js +0 -1
- package/dist/translations/pt-PT/media.js +0 -1
- package/dist/translations/pt-PT/overlays.js +0 -1
- package/dist/translations/pt-PT/retrieval.js +0 -1
- package/dist/translations/pt-PT/shared.js +0 -1
- package/dist/translations/pt-PT/utility.js +0 -1
- package/dist/translations/pt-PT/viewers.js +0 -5
- package/dist/translations/pt-PT.js +0 -1
- package/dist/translations/ro/agent-tools.js +0 -1
- package/dist/translations/ro/charts.js +0 -1
- package/dist/translations/ro/conversation.js +0 -1
- package/dist/translations/ro/data.js +0 -1
- package/dist/translations/ro/forms.js +0 -1
- package/dist/translations/ro/layout.js +0 -1
- package/dist/translations/ro/media.js +0 -1
- package/dist/translations/ro/overlays.js +0 -1
- package/dist/translations/ro/retrieval.js +0 -1
- package/dist/translations/ro/shared.js +0 -1
- package/dist/translations/ro/utility.js +0 -1
- package/dist/translations/ro/viewers.js +0 -5
- package/dist/translations/ro.js +0 -1
- package/dist/translations/ru/agent-tools.js +0 -1
- package/dist/translations/ru/charts.js +0 -1
- package/dist/translations/ru/conversation.js +0 -1
- package/dist/translations/ru/data.js +0 -1
- package/dist/translations/ru/forms.js +0 -1
- package/dist/translations/ru/layout.js +0 -1
- package/dist/translations/ru/media.js +0 -1
- package/dist/translations/ru/overlays.js +0 -1
- package/dist/translations/ru/retrieval.js +0 -1
- package/dist/translations/ru/shared.js +0 -1
- package/dist/translations/ru/utility.js +0 -1
- package/dist/translations/ru/viewers.js +0 -5
- package/dist/translations/ru.js +0 -1
- package/dist/translations/sd/agent-tools.js +0 -1
- package/dist/translations/sd/charts.js +0 -1
- package/dist/translations/sd/conversation.js +0 -1
- package/dist/translations/sd/data.js +0 -1
- package/dist/translations/sd/forms.js +0 -1
- package/dist/translations/sd/layout.js +0 -1
- package/dist/translations/sd/media.js +0 -1
- package/dist/translations/sd/overlays.js +0 -1
- package/dist/translations/sd/retrieval.js +0 -1
- package/dist/translations/sd/shared.js +0 -1
- package/dist/translations/sd/utility.js +0 -1
- package/dist/translations/sd/viewers.js +0 -5
- package/dist/translations/sd.js +0 -1
- package/dist/translations/sl/agent-tools.js +0 -1
- package/dist/translations/sl/charts.js +0 -1
- package/dist/translations/sl/conversation.js +0 -1
- package/dist/translations/sl/data.js +0 -1
- package/dist/translations/sl/forms.js +0 -1
- package/dist/translations/sl/layout.js +0 -1
- package/dist/translations/sl/media.js +0 -1
- package/dist/translations/sl/overlays.js +0 -1
- package/dist/translations/sl/retrieval.js +0 -1
- package/dist/translations/sl/shared.js +0 -1
- package/dist/translations/sl/utility.js +0 -1
- package/dist/translations/sl/viewers.js +0 -5
- package/dist/translations/sl.js +0 -1
- package/dist/translations/su/agent-tools.js +0 -1
- package/dist/translations/su/charts.js +0 -1
- package/dist/translations/su/conversation.js +0 -1
- package/dist/translations/su/data.js +0 -1
- package/dist/translations/su/forms.js +0 -1
- package/dist/translations/su/layout.js +0 -1
- package/dist/translations/su/media.js +0 -1
- package/dist/translations/su/overlays.js +0 -1
- package/dist/translations/su/retrieval.js +0 -1
- package/dist/translations/su/shared.js +0 -1
- package/dist/translations/su/utility.js +0 -1
- package/dist/translations/su/viewers.js +0 -5
- package/dist/translations/su.js +0 -1
- package/dist/translations/sv/agent-tools.js +0 -1
- package/dist/translations/sv/charts.js +0 -1
- package/dist/translations/sv/conversation.js +0 -1
- package/dist/translations/sv/data.js +0 -1
- package/dist/translations/sv/forms.js +0 -1
- package/dist/translations/sv/layout.js +0 -1
- package/dist/translations/sv/media.js +0 -1
- package/dist/translations/sv/overlays.js +0 -1
- package/dist/translations/sv/retrieval.js +0 -1
- package/dist/translations/sv/shared.js +0 -1
- package/dist/translations/sv/utility.js +0 -1
- package/dist/translations/sv/viewers.js +0 -5
- package/dist/translations/sv.js +0 -1
- package/dist/translations/sw/agent-tools.js +0 -1
- package/dist/translations/sw/charts.js +0 -1
- package/dist/translations/sw/conversation.js +0 -1
- package/dist/translations/sw/data.js +0 -1
- package/dist/translations/sw/forms.js +0 -1
- package/dist/translations/sw/layout.js +0 -1
- package/dist/translations/sw/media.js +0 -1
- package/dist/translations/sw/overlays.js +0 -1
- package/dist/translations/sw/retrieval.js +0 -1
- package/dist/translations/sw/shared.js +0 -1
- package/dist/translations/sw/utility.js +0 -1
- package/dist/translations/sw/viewers.js +0 -5
- package/dist/translations/sw.js +0 -1
- package/dist/translations/ta/agent-tools.js +0 -1
- package/dist/translations/ta/charts.js +0 -1
- package/dist/translations/ta/conversation.js +0 -1
- package/dist/translations/ta/data.js +0 -1
- package/dist/translations/ta/forms.js +0 -1
- package/dist/translations/ta/layout.js +0 -1
- package/dist/translations/ta/media.js +0 -1
- package/dist/translations/ta/overlays.js +0 -1
- package/dist/translations/ta/retrieval.js +0 -1
- package/dist/translations/ta/shared.js +0 -1
- package/dist/translations/ta/utility.js +0 -1
- package/dist/translations/ta/viewers.js +0 -5
- package/dist/translations/ta.js +0 -1
- package/dist/translations/te/agent-tools.js +0 -1
- package/dist/translations/te/charts.js +0 -1
- package/dist/translations/te/conversation.js +0 -1
- package/dist/translations/te/data.js +0 -1
- package/dist/translations/te/forms.js +0 -1
- package/dist/translations/te/layout.js +0 -1
- package/dist/translations/te/media.js +0 -1
- package/dist/translations/te/overlays.js +0 -1
- package/dist/translations/te/retrieval.js +0 -1
- package/dist/translations/te/shared.js +0 -1
- package/dist/translations/te/utility.js +0 -1
- package/dist/translations/te/viewers.js +0 -5
- package/dist/translations/te.js +0 -1
- package/dist/translations/th/agent-tools.js +0 -1
- package/dist/translations/th/charts.js +0 -1
- package/dist/translations/th/conversation.js +0 -1
- package/dist/translations/th/data.js +0 -1
- package/dist/translations/th/forms.js +0 -1
- package/dist/translations/th/layout.js +0 -1
- package/dist/translations/th/media.js +0 -1
- package/dist/translations/th/overlays.js +0 -1
- package/dist/translations/th/retrieval.js +0 -1
- package/dist/translations/th/shared.js +0 -1
- package/dist/translations/th/utility.js +0 -1
- package/dist/translations/th/viewers.js +0 -5
- package/dist/translations/th.js +0 -1
- package/dist/translations/tl/agent-tools.js +0 -1
- package/dist/translations/tl/charts.js +0 -1
- package/dist/translations/tl/conversation.js +0 -1
- package/dist/translations/tl/data.js +0 -1
- package/dist/translations/tl/forms.js +0 -1
- package/dist/translations/tl/layout.js +0 -1
- package/dist/translations/tl/media.js +0 -1
- package/dist/translations/tl/overlays.js +0 -1
- package/dist/translations/tl/retrieval.js +0 -1
- package/dist/translations/tl/shared.js +0 -1
- package/dist/translations/tl/utility.js +0 -1
- package/dist/translations/tl/viewers.js +0 -5
- package/dist/translations/tl.js +0 -1
- package/dist/translations/tr/agent-tools.js +0 -1
- package/dist/translations/tr/charts.js +0 -1
- package/dist/translations/tr/conversation.js +0 -1
- package/dist/translations/tr/data.js +0 -1
- package/dist/translations/tr/forms.js +0 -1
- package/dist/translations/tr/layout.js +0 -1
- package/dist/translations/tr/media.js +0 -1
- package/dist/translations/tr/overlays.js +0 -1
- package/dist/translations/tr/retrieval.js +0 -1
- package/dist/translations/tr/shared.js +0 -1
- package/dist/translations/tr/utility.js +0 -1
- package/dist/translations/tr/viewers.js +0 -5
- package/dist/translations/tr.js +0 -1
- package/dist/translations/uk/agent-tools.js +0 -1
- package/dist/translations/uk/charts.js +0 -1
- package/dist/translations/uk/conversation.js +0 -1
- package/dist/translations/uk/data.js +0 -1
- package/dist/translations/uk/forms.js +0 -1
- package/dist/translations/uk/layout.js +0 -1
- package/dist/translations/uk/media.js +0 -1
- package/dist/translations/uk/overlays.js +0 -1
- package/dist/translations/uk/retrieval.js +0 -1
- package/dist/translations/uk/shared.js +0 -1
- package/dist/translations/uk/utility.js +0 -1
- package/dist/translations/uk/viewers.js +0 -5
- package/dist/translations/uk.js +0 -1
- package/dist/translations/ur/agent-tools.js +0 -1
- package/dist/translations/ur/charts.js +0 -1
- package/dist/translations/ur/conversation.js +0 -1
- package/dist/translations/ur/data.js +0 -1
- package/dist/translations/ur/forms.js +0 -1
- package/dist/translations/ur/layout.js +0 -1
- package/dist/translations/ur/media.js +0 -1
- package/dist/translations/ur/overlays.js +0 -1
- package/dist/translations/ur/retrieval.js +0 -1
- package/dist/translations/ur/shared.js +0 -1
- package/dist/translations/ur/utility.js +0 -1
- package/dist/translations/ur/viewers.js +0 -5
- package/dist/translations/ur.js +0 -1
- package/dist/translations/uz/agent-tools.js +0 -1
- package/dist/translations/uz/charts.js +0 -1
- package/dist/translations/uz/conversation.js +0 -1
- package/dist/translations/uz/data.js +0 -1
- package/dist/translations/uz/forms.js +0 -1
- package/dist/translations/uz/layout.js +0 -1
- package/dist/translations/uz/media.js +0 -1
- package/dist/translations/uz/overlays.js +0 -1
- package/dist/translations/uz/retrieval.js +0 -1
- package/dist/translations/uz/shared.js +0 -1
- package/dist/translations/uz/utility.js +0 -1
- package/dist/translations/uz/viewers.js +0 -5
- package/dist/translations/uz.js +0 -1
- package/dist/translations/vi/agent-tools.js +0 -1
- package/dist/translations/vi/charts.js +0 -1
- package/dist/translations/vi/conversation.js +0 -1
- package/dist/translations/vi/data.js +0 -1
- package/dist/translations/vi/forms.js +0 -1
- package/dist/translations/vi/layout.js +0 -1
- package/dist/translations/vi/media.js +0 -1
- package/dist/translations/vi/overlays.js +0 -1
- package/dist/translations/vi/retrieval.js +0 -1
- package/dist/translations/vi/shared.js +0 -1
- package/dist/translations/vi/utility.js +0 -1
- package/dist/translations/vi/viewers.js +0 -5
- package/dist/translations/vi.js +0 -1
- package/dist/translations/yo/agent-tools.js +0 -1
- package/dist/translations/yo/charts.js +0 -1
- package/dist/translations/yo/conversation.js +0 -1
- package/dist/translations/yo/data.js +0 -1
- package/dist/translations/yo/forms.js +0 -1
- package/dist/translations/yo/layout.js +0 -1
- package/dist/translations/yo/media.js +0 -1
- package/dist/translations/yo/overlays.js +0 -1
- package/dist/translations/yo/retrieval.js +0 -1
- package/dist/translations/yo/shared.js +0 -1
- package/dist/translations/yo/utility.js +0 -1
- package/dist/translations/yo/viewers.js +0 -5
- package/dist/translations/yo.js +0 -1
- package/dist/translations/zh-CN/agent-tools.js +0 -1
- package/dist/translations/zh-CN/charts.js +0 -1
- package/dist/translations/zh-CN/conversation.js +0 -1
- package/dist/translations/zh-CN/data.js +0 -1
- package/dist/translations/zh-CN/forms.js +0 -1
- package/dist/translations/zh-CN/layout.js +0 -1
- package/dist/translations/zh-CN/media.js +0 -1
- package/dist/translations/zh-CN/overlays.js +0 -1
- package/dist/translations/zh-CN/retrieval.js +0 -1
- package/dist/translations/zh-CN/shared.js +0 -1
- package/dist/translations/zh-CN/utility.js +0 -1
- package/dist/translations/zh-CN/viewers.js +0 -5
- package/dist/translations/zh-CN.js +0 -1
- package/dist/translations/zh-TW/agent-tools.js +0 -1
- package/dist/translations/zh-TW/charts.js +0 -1
- package/dist/translations/zh-TW/conversation.js +0 -1
- package/dist/translations/zh-TW/data.js +0 -1
- package/dist/translations/zh-TW/forms.js +0 -1
- package/dist/translations/zh-TW/layout.js +0 -1
- package/dist/translations/zh-TW/media.js +0 -1
- package/dist/translations/zh-TW/overlays.js +0 -1
- package/dist/translations/zh-TW/retrieval.js +0 -1
- package/dist/translations/zh-TW/shared.js +0 -1
- package/dist/translations/zh-TW/utility.js +0 -1
- package/dist/translations/zh-TW/viewers.js +0 -5
- package/dist/translations/zh-TW.js +0 -1
- package/dist/translations/zu/agent-tools.js +0 -1
- package/dist/translations/zu/charts.js +0 -1
- package/dist/translations/zu/conversation.js +0 -1
- package/dist/translations/zu/data.js +0 -1
- package/dist/translations/zu/forms.js +0 -1
- package/dist/translations/zu/layout.js +0 -1
- package/dist/translations/zu/media.js +0 -1
- package/dist/translations/zu/overlays.js +0 -1
- package/dist/translations/zu/retrieval.js +0 -1
- package/dist/translations/zu/shared.js +0 -1
- package/dist/translations/zu/utility.js +0 -1
- package/dist/translations/zu/viewers.js +0 -5
- package/dist/translations/zu.js +0 -1
- package/vscode-css-data.json +0 -1
- package/vscode-html-data.json +0 -1
- package/web-types.json +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{eventCollectionSupport}from"../../../internal/collection-snapshot.js";import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{formatMediaTime}from"../../../internal/media-time.js";import{LyraElement}from"../../../internal/lyra-element.js";import{hostAriaLabel}from"../../../internal/a11y.js";import{activeElementIn}from"../../../internal/active-element.js";import{finiteRange}from"../../../internal/numbers.js";import{relayNativeEvent}from"../../../internal/native-event-relay.js";import{tag}from"../../../internal/prefix.js";import{safeMediaSrc}from"../../../internal/safe-url.js";import{styles}from"./video-playlist.styles.js";import{LYRA_DEFAULT_videoPlaylistLabel,LYRA_DEFAULT_videoPlaylistUntitled}from"../../../internal/default-strings.generated.js";function safeControls(value){return value==="none"||value==="standard"?value:"full"}function safeRepeat(value){return value==="one"||value==="all"?value:"none"}function sameVideos(left,right){return left.length===right.length&&left.every((video,index)=>video===right[index])}function sourceSnapshot(src,type,media){return{src,type,media}}function trackSnapshot(src,kind,srclang,label,isDefault){return{src,kind,srclang,label,default:isDefault}}class LyraVideoPlaylist extends LyraElement{constructor(){super(...arguments),this.controls="full",this.iconLibrary="system",this.withoutAutoAdvance=!1,this.repeat="none",this.items=[],this.playlistVideos=[],this.liveChildrenReady=!1,this.activeIndex=-1,this.navigationIndex=-1,this.listeners=new Map,this.lastKnownPlaying=new WeakMap,this.nativeVideos=new WeakMap,this.needsReload=new WeakSet,this.ownedVideoState=new WeakMap,this.preferences={},this.activationGeneration=0,this.reconcileGeneration=0,this.onSlotChange=()=>this.reconcileChildren(),this.onItemFocus=event=>{relayNativeEvent(this,event)},this.onItemBlur=event=>{relayNativeEvent(this,event)}}static{this.defaultStrings={...super.defaultStrings,videoPlaylistLabel:LYRA_DEFAULT_videoPlaylistLabel,videoPlaylistUntitled:LYRA_DEFAULT_videoPlaylistUntitled}}static{this.collectionSupport=eventCollectionSupport}static{this.immutableEventDetails=Object.freeze(["lr-video-change"])}static{this.styles=[LyraElement.styles,styles]}connectedCallback(){super.connectedCallback(),this.observeChildren(),this.hasUpdated?this.scheduleAfterUpdate(()=>this.reconcileChildren(),"video-playlist-reconcile"):this.seedFirstRenderState(()=>{this.directVideos().length>0&&this.reconcileChildren()})}disconnectedCallback(){this.activationGeneration+=1,this.reconcileGeneration+=1,this.pendingPlay=void 0,this.mutationObserver?.disconnect(),this.mutationObserver=void 0;for(const video of this.playlistVideos)this.unbindVideo(video),video.hidden=!0,this.pauseAndUnload(video);super.disconnectedCallback()}willUpdate(changed){super.willUpdate(changed),changed.has("controls")&&(this.controls=safeControls(this.controls)),changed.has("repeat")&&(this.repeat=safeRepeat(this.repeat)),(changed.has("controls")||changed.has("iconLibrary"))&&this.scheduleAfterUpdate(()=>this.reconcileChildren(),"video-playlist-reconcile")}observeChildren(){this.mutationObserver?.disconnect(),this.mutationObserver=void 0;const MutationObserverCtor=this.ownerDocument.defaultView?.MutationObserver;MutationObserverCtor&&(this.mutationObserver=new MutationObserverCtor(()=>{this.scheduleAfterUpdate(()=>{this.reconcileChildren(),this.requestUpdate()},"video-playlist-reconcile")}),this.mutationObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["default","inert","kind","label","media","poster","src","srclang","title","type"]}))}directVideos(){const videoTag=tag("video");return[...this.children].filter(child=>child.localName===videoTag)}isEnabled(video){return!video.inert}nearestEnabledIndex(videos,preferred){if(!videos.length)return-1;const start=Math.min(Math.max(preferred,0),videos.length-1);for(let index=start;index<videos.length;index+=1)if(this.isEnabled(videos[index]))return index;for(let index=start-1;index>=0;index-=1)if(this.isEnabled(videos[index]))return index;return-1}reconcileChildren(){if(!this.isConnected)return;const previousVideos=this.playlistVideos,previousActive=this.activeVideo,previousIndex=this.activeIndex,previousNavigation=previousVideos[this.navigationIndex],navigationHadFocus=activeElementIn(this.shadowRoot)?.getAttribute("part")==="playlist-item",videos=this.directVideos();(videos.length>0||this.liveChildrenReady)&&(this.liveChildrenReady=!0);let active=previousActive&&videos.includes(previousActive)&&this.isEnabled(previousActive)?previousActive:void 0,nextIndex=active?videos.indexOf(active):this.nearestEnabledIndex(videos,previousIndex);!active&&nextIndex>=0&&(active=videos[nextIndex]),active||(nextIndex=-1);const activeChanged=active!==previousActive,outgoingWasRemoved=!!(previousActive&&!videos.includes(previousActive)),resumePlayback=activeChanged&&previousActive?outgoingWasRemoved?this.lastKnownPlaying.get(previousActive)??previousActive.getState().playing:previousActive.getState().playing:!1,outgoingPreferences=activeChanged&&previousActive?outgoingWasRemoved?this.capturePreferences(previousActive,this.nativeVideos.get(previousActive)):this.capturePreferences(previousActive):void 0;for(const video of previousVideos)videos.includes(video)||this.releaseVideo(video);for(const video of videos)this.claimVideo(video),this.bindVideo(video);activeChanged&&previousActive?(this.preferences=outgoingPreferences??{},outgoingWasRemoved||this.pauseAndUnload(previousActive),this.activationGeneration+=1):activeChanged&&(this.activationGeneration+=1),this.activeVideo=active,this.activeIndex=nextIndex,sameVideos(previousVideos,videos)||(this.playlistVideos=videos);for(const video of videos){video.controls!==this.controls&&(video.controls=this.controls),video.iconLibrary!==this.iconLibrary&&(video.iconLibrary=this.iconLibrary);const isActive=video===active;video.hidden=!isActive,isActive||this.pauseAndUnload(video)}active?(activeChanged||this.needsReload.has(active))&&this.activateVideo(active,resumePlayback,this.activationGeneration):this.pendingPlay=void 0;const keptNavigation=previousNavigation&&videos.includes(previousNavigation)&&this.isEnabled(previousNavigation)?videos.indexOf(previousNavigation):-1;this.navigationIndex=keptNavigation>=0?keptNavigation:nextIndex,navigationHadFocus&&keptNavigation<0&&this.navigationIndex>=0&&this.focusItem(this.navigationIndex),activeChanged&&previousActive&&this.emitChange(previousIndex,nextIndex,active??null),this.scheduleChildrenReady(videos)}scheduleChildrenReady(videos){const reconcileGeneration=++this.reconcileGeneration;Promise.all(videos.map(video=>video.updateComplete)).then(()=>{if(!this.isConnected||reconcileGeneration!==this.reconcileGeneration)return;for(const video of this.playlistVideos)this.rememberNativeVideo(video);for(const video of this.playlistVideos)video!==this.activeVideo&&this.pauseAndUnload(video);const active=this.activeVideo;if(!active||!this.needsReload.has(active))return;const shouldPlay=this.pendingPlay?.video===active&&this.pendingPlay.generation===this.activationGeneration;this.activateVideo(active,shouldPlay,this.activationGeneration)})}bindVideo(video){if(this.listeners.has(video))return;const listeners={ended:()=>{this.rememberNativeVideo(video),this.lastKnownPlaying.set(video,!1),this.handleCompletion(video)},error:()=>{this.rememberNativeVideo(video),this.lastKnownPlaying.set(video,!1)},loadedmetadata:()=>{this.rememberNativeVideo(video),this.handleLoadedMetadata(video)},pause:()=>{this.rememberNativeVideo(video),this.lastKnownPlaying.set(video,!1)},play:()=>{this.rememberNativeVideo(video),this.lastKnownPlaying.set(video,!0),video!==this.activeVideo&&this.pauseAndUnload(video)}};this.lastKnownPlaying.set(video,video.getState().playing),this.rememberNativeVideo(video),this.listeners.set(video,listeners),video.addEventListener("ended",listeners.ended),video.addEventListener("error",listeners.error),video.addEventListener("loadedmetadata",listeners.loadedmetadata),video.addEventListener("pause",listeners.pause),video.addEventListener("play",listeners.play)}unbindVideo(video){const listeners=this.listeners.get(video);listeners&&(video.removeEventListener("ended",listeners.ended),video.removeEventListener("error",listeners.error),video.removeEventListener("loadedmetadata",listeners.loadedmetadata),video.removeEventListener("pause",listeners.pause),video.removeEventListener("play",listeners.play),this.listeners.delete(video))}claimVideo(video){this.ownedVideoState.has(video)||this.ownedVideoState.set(video,{controls:video.controls,iconLibrary:video.iconLibrary,hidden:!!video.hidden})}releaseVideo(video){const authored=this.ownedVideoState.get(video);this.unbindVideo(video),this.pauseAndUnload(video),authored&&(video.controls=authored.controls,video.iconLibrary=authored.iconLibrary,video.hidden=authored.hidden,this.ownedVideoState.delete(video),video.isConnected&&video.load())}rememberNativeVideo(video){const native=video.getVideoElement();native&&this.nativeVideos.set(video,native)}pauseAndUnload(video){video.pause(),video.hidden=!0,this.needsReload.add(video),video.unloadMedia()}activateVideo(video,shouldPlay,generation){if(video.hidden=!1,!video.getVideoElement()){this.needsReload.add(video),shouldPlay&&(this.pendingPlay={video,generation});return}if(this.rememberNativeVideo(video),video.load(),this.needsReload.delete(video),this.applyPreferences(video,this.preferences),!shouldPlay){this.pendingPlay?.video===video&&(this.pendingPlay=void 0);return}this.pendingPlay=void 0,video.play().catch(()=>{generation!==this.activationGeneration||this.activeVideo})}capturePreferences(video,native=video.getVideoElement()){return video.captureMediaPreferences(native)}applyPreferences(video,preferences){video.applyMediaPreferences(preferences)}handleLoadedMetadata(video){video===this.activeVideo&&(this.applyPreferences(video,this.preferences),this.requestUpdate())}handleCompletion(video){if(video!==this.activeVideo||this.withoutAutoAdvance)return;if(this.repeat==="one"){video.seek(0);const generation=this.activationGeneration;video.play().catch(()=>{generation!==this.activationGeneration||this.activeVideo});return}const nextIndex=this.nearestEnabledIndex(this.playlistVideos,this.activeIndex+1);if(nextIndex>this.activeIndex){this.switchTo(nextIndex,!0);return}if(this.repeat==="all"){const first=this.nearestEnabledIndex(this.playlistVideos,0);if(first>=0&&first!==this.activeIndex)this.switchTo(first,!0);else if(first===this.activeIndex){video.seek(0);const generation=this.activationGeneration;video.play().catch(()=>{generation!==this.activationGeneration||this.activeVideo})}}}snapshotVideo(video){const sources=[],directSrc=video.src.trim();directSrc&&sources.push(sourceSnapshot(directSrc,"",""));const tracks=[];for(const child of video.children)if(child.localName==="source"){const src=child.getAttribute("src")?.trim()??"";src&&sources.push(sourceSnapshot(src,child.getAttribute("type")??"",child.getAttribute("media")??""))}else if(child.localName==="track"){const src=child.getAttribute("src")?.trim()??"";src&&tracks.push(trackSnapshot(src,child.getAttribute("kind")??"",child.getAttribute("srclang")??"",child.getAttribute("label")??"",child.hasAttribute("default")))}return{title:video.title,poster:video.poster,sources,tracks}}emitChange(previousIndex,currentIndex,video){this.emit("lr-video-change",{previousIndex,currentIndex,video:video?this.snapshotVideo(video):null})}switchTo(index,forcePlay=!1){const incoming=this.playlistVideos[index];if(!incoming||!this.isEnabled(incoming))return;const previousIndex=this.activeIndex,outgoing=this.activeVideo;if(incoming===outgoing){if(this.navigationIndex=index,this.requestUpdate(),forcePlay){const generation=this.activationGeneration;incoming.play().catch(()=>{generation!==this.activationGeneration||this.activeVideo})}this.emitChange(previousIndex,index,incoming);return}const wasPlaying=forcePlay||!!outgoing?.getState().playing;outgoing&&(this.preferences=this.capturePreferences(outgoing),this.pauseAndUnload(outgoing)),this.activationGeneration+=1,this.activeVideo=incoming,this.activeIndex=index,this.navigationIndex=index;for(const video of this.playlistVideos){const isActive=video===incoming;video.hidden=!isActive,!isActive&&video!==outgoing&&this.pauseAndUnload(video)}this.activateVideo(incoming,wasPlaying,this.activationGeneration),this.requestUpdate(),this.emitChange(previousIndex,index,incoming)}goTo(index){!Number.isFinite(index)||!Number.isInteger(index)||index<0||index>=this.playlistVideos.length||this.switchTo(index)}next(){const index=this.nearestEnabledIndex(this.playlistVideos,this.activeIndex+1);index>this.activeIndex&&this.switchTo(index)}previous(){for(let index=this.activeIndex-1;index>=0;index-=1)if(this.isEnabled(this.playlistVideos[index])){this.switchTo(index);return}}onItemClick(event){const button=event.currentTarget,index=Number(button.dataset.index);Number.isInteger(index)&&(this.navigationIndex=index,this.goTo(index))}enabledIndices(){const result=[];for(let index=0;index<this.playlistVideos.length;index+=1)this.isEnabled(this.playlistVideos[index])&&result.push(index);return result}moveNavigation(from,direction){const enabled=this.enabledIndices(),position=enabled.indexOf(from);if(position<0)return;const next=enabled[position+direction];next!==void 0&&this.focusItem(next)}get navigationItem(){const rows=[...this.renderRoot.querySelectorAll('[part~="playlist-item"]')];return rows.find(row=>!row.disabled&&row.getAttribute("aria-current")==="true")??rows.find(row=>!row.disabled)??null}focus(options){this.navigationItem?.focus(options)}blur(){this.navigationItem?.blur()}click(){this.navigationItem?.click()}focusItem(index){this.isEnabled(this.playlistVideos[index])&&(this.navigationIndex=index,this.requestUpdate(),this.updateComplete.then(()=>{this.navigationIndex===index&&this.shadowRoot?.querySelector(`[data-index="${index}"]`)?.focus()}))}onItemKeyDown(event){const button=event.currentTarget,index=Number(button.dataset.index);if(!Number.isInteger(index)||button.disabled)return;const forward=this.effectiveDirection==="rtl"?"ArrowLeft":"ArrowRight",backward=this.effectiveDirection==="rtl"?"ArrowRight":"ArrowLeft";if(event.key==="Enter"||event.key===" ")event.preventDefault(),this.navigationIndex=index,this.goTo(index);else if(event.key==="ArrowDown"||event.key===forward)event.preventDefault(),this.moveNavigation(index,1);else if(event.key==="ArrowUp"||event.key===backward)event.preventDefault(),this.moveNavigation(index,-1);else if(event.key==="Home"){event.preventDefault();const first=this.enabledIndices()[0];first!==void 0&&this.focusItem(first)}else if(event.key==="End"){event.preventDefault();const enabled=this.enabledIndices(),last=enabled[enabled.length-1];last!==void 0&&this.focusItem(last)}}itemTitle(value,index){const title=typeof value=="string"?value.trim():"";if(title)return title;const position=getNumberFormat(this.effectiveLocale).format(index+1);return this.localize("videoPlaylistUntitled",void 0,{position})}renderItem(item,index,current,disabled){const title=this.itemTitle(item.title,index),poster=safeMediaSrc(typeof item.poster=="string"?item.poster:""),duration=finiteRange(typeof item.duration=="number"?item.duration:0,0,0),durationId=`playlist-duration-${index}`;return html`
|
|
1
|
+
import{__decorate}from"tslib";import{eventCollectionSupport}from"../../../internal/collection-snapshot.js";import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{formatMediaTime}from"../../../internal/media-time.js";import{LyraElement}from"../../../internal/lyra-element.js";import{hostAriaLabel}from"../../../internal/a11y.js";import{shadowFocusTarget}from"../../../internal/active-element.js";import{finiteRange}from"../../../internal/numbers.js";import{relayNativeEvent}from"../../../internal/native-event-relay.js";import{tag}from"../../../internal/prefix.js";import{safeMediaSrc}from"../../../internal/safe-url.js";import{styles}from"./video-playlist.styles.js";import{LYRA_DEFAULT_videoPlaylistLabel,LYRA_DEFAULT_videoPlaylistUntitled}from"../../../internal/default-strings.generated.js";function safeControls(value){return value==="none"||value==="standard"?value:"full"}function safeRepeat(value){return value==="one"||value==="all"?value:"none"}function sameVideos(left,right){return left.length===right.length&&left.every((video,index)=>video===right[index])}function sourceSnapshot(src,type,media){return{src,type,media}}function trackSnapshot(src,kind,srclang,label,isDefault){return{src,kind,srclang,label,default:isDefault}}class LyraVideoPlaylist extends LyraElement{constructor(){super(...arguments),this.controls="full",this.iconLibrary="system",this.withoutAutoAdvance=!1,this.repeat="none",this.items=[],this.playlistVideos=[],this.liveChildrenReady=!1,this.activeIndex=-1,this.navigationIndex=-1,this.listeners=new Map,this.lastKnownPlaying=new WeakMap,this.nativeVideos=new WeakMap,this.needsReload=new WeakSet,this.ownedVideoState=new WeakMap,this.preferences={},this.activationGeneration=0,this.reconcileGeneration=0,this.onSlotChange=()=>this.reconcileChildren(),this.onItemFocus=event=>{relayNativeEvent(this,event)},this.onItemBlur=event=>{relayNativeEvent(this,event)}}static{this.defaultStrings={...super.defaultStrings,videoPlaylistLabel:LYRA_DEFAULT_videoPlaylistLabel,videoPlaylistUntitled:LYRA_DEFAULT_videoPlaylistUntitled}}static{this.collectionSupport=eventCollectionSupport}static{this.immutableEventDetails=Object.freeze(["lr-video-change"])}static{this.styles=[LyraElement.styles,styles]}connectedCallback(){super.connectedCallback(),this.observeChildren(),this.hasUpdated?this.scheduleAfterUpdate(()=>this.reconcileChildren(),"video-playlist-reconcile"):this.seedFirstRenderState(()=>{this.directVideos().length>0&&this.reconcileChildren()})}disconnectedCallback(){this.activationGeneration+=1,this.reconcileGeneration+=1,this.pendingPlay=void 0,this.mutationObserver?.disconnect(),this.mutationObserver=void 0;for(const video of this.playlistVideos)this.unbindVideo(video),video.hidden=!0,this.pauseAndUnload(video);super.disconnectedCallback()}willUpdate(changed){super.willUpdate(changed),changed.has("controls")&&(this.controls=safeControls(this.controls)),changed.has("repeat")&&(this.repeat=safeRepeat(this.repeat)),(changed.has("controls")||changed.has("iconLibrary"))&&this.scheduleAfterUpdate(()=>this.reconcileChildren(),"video-playlist-reconcile")}observeChildren(){this.mutationObserver?.disconnect(),this.mutationObserver=void 0;const MutationObserverCtor=this.ownerDocument.defaultView?.MutationObserver;MutationObserverCtor&&(this.mutationObserver=new MutationObserverCtor(()=>{this.scheduleAfterUpdate(()=>{this.reconcileChildren(),this.requestUpdate()},"video-playlist-reconcile")}),this.mutationObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["default","inert","kind","label","media","poster","src","srclang","title","type"]}))}directVideos(){const videoTag=tag("video");return[...this.children].filter(child=>child.localName===videoTag)}isEnabled(video){return!video.inert}nearestEnabledIndex(videos,preferred){if(!videos.length)return-1;const start=Math.min(Math.max(preferred,0),videos.length-1);for(let index=start;index<videos.length;index+=1)if(this.isEnabled(videos[index]))return index;for(let index=start-1;index>=0;index-=1)if(this.isEnabled(videos[index]))return index;return-1}reconcileChildren(){if(!this.isConnected)return;const previousVideos=this.playlistVideos,previousActive=this.activeVideo,previousIndex=this.activeIndex,previousNavigation=previousVideos[this.navigationIndex],navigationHadFocus=shadowFocusTarget(this)?.getAttribute("part")==="playlist-item",videos=this.directVideos();(videos.length>0||this.liveChildrenReady)&&(this.liveChildrenReady=!0);let active=previousActive&&videos.includes(previousActive)&&this.isEnabled(previousActive)?previousActive:void 0,nextIndex=active?videos.indexOf(active):this.nearestEnabledIndex(videos,previousIndex);!active&&nextIndex>=0&&(active=videos[nextIndex]),active||(nextIndex=-1);const activeChanged=active!==previousActive,outgoingWasRemoved=!!(previousActive&&!videos.includes(previousActive)),resumePlayback=activeChanged&&previousActive?outgoingWasRemoved?this.lastKnownPlaying.get(previousActive)??previousActive.getState().playing:previousActive.getState().playing:!1,outgoingPreferences=activeChanged&&previousActive?outgoingWasRemoved?this.capturePreferences(previousActive,this.nativeVideos.get(previousActive)):this.capturePreferences(previousActive):void 0;for(const video of previousVideos)videos.includes(video)||this.releaseVideo(video);for(const video of videos)this.claimVideo(video),this.bindVideo(video);activeChanged&&previousActive?(this.preferences=outgoingPreferences??{},outgoingWasRemoved||this.pauseAndUnload(previousActive),this.activationGeneration+=1):activeChanged&&(this.activationGeneration+=1),this.activeVideo=active,this.activeIndex=nextIndex,sameVideos(previousVideos,videos)||(this.playlistVideos=videos);for(const video of videos){video.controls!==this.controls&&(video.controls=this.controls),video.iconLibrary!==this.iconLibrary&&(video.iconLibrary=this.iconLibrary);const isActive=video===active;video.hidden=!isActive,isActive||this.pauseAndUnload(video)}active?(activeChanged||this.needsReload.has(active))&&this.activateVideo(active,resumePlayback,this.activationGeneration):this.pendingPlay=void 0;const keptNavigation=previousNavigation&&videos.includes(previousNavigation)&&this.isEnabled(previousNavigation)?videos.indexOf(previousNavigation):-1;this.navigationIndex=keptNavigation>=0?keptNavigation:nextIndex,navigationHadFocus&&keptNavigation<0&&this.navigationIndex>=0&&this.focusItem(this.navigationIndex),activeChanged&&previousActive&&this.emitChange(previousIndex,nextIndex,active??null),this.scheduleChildrenReady(videos)}scheduleChildrenReady(videos){const reconcileGeneration=++this.reconcileGeneration;Promise.all(videos.map(video=>video.updateComplete)).then(()=>{if(!this.isConnected||reconcileGeneration!==this.reconcileGeneration)return;for(const video of this.playlistVideos)this.rememberNativeVideo(video);for(const video of this.playlistVideos)video!==this.activeVideo&&this.pauseAndUnload(video);const active=this.activeVideo;if(!active||!this.needsReload.has(active))return;const shouldPlay=this.pendingPlay?.video===active&&this.pendingPlay.generation===this.activationGeneration;this.activateVideo(active,shouldPlay,this.activationGeneration)})}bindVideo(video){if(this.listeners.has(video))return;const listeners={ended:()=>{this.rememberNativeVideo(video),this.lastKnownPlaying.set(video,!1),this.handleCompletion(video)},error:()=>{this.rememberNativeVideo(video),this.lastKnownPlaying.set(video,!1)},loadedmetadata:()=>{this.rememberNativeVideo(video),this.handleLoadedMetadata(video)},pause:()=>{this.rememberNativeVideo(video),this.lastKnownPlaying.set(video,!1)},play:()=>{this.rememberNativeVideo(video),this.lastKnownPlaying.set(video,!0),video!==this.activeVideo&&this.pauseAndUnload(video)}};this.lastKnownPlaying.set(video,video.getState().playing),this.rememberNativeVideo(video),this.listeners.set(video,listeners),video.addEventListener("ended",listeners.ended),video.addEventListener("error",listeners.error),video.addEventListener("loadedmetadata",listeners.loadedmetadata),video.addEventListener("pause",listeners.pause),video.addEventListener("play",listeners.play)}unbindVideo(video){const listeners=this.listeners.get(video);listeners&&(video.removeEventListener("ended",listeners.ended),video.removeEventListener("error",listeners.error),video.removeEventListener("loadedmetadata",listeners.loadedmetadata),video.removeEventListener("pause",listeners.pause),video.removeEventListener("play",listeners.play),this.listeners.delete(video))}claimVideo(video){this.ownedVideoState.has(video)||this.ownedVideoState.set(video,{controls:video.controls,iconLibrary:video.iconLibrary,hidden:!!video.hidden})}releaseVideo(video){const authored=this.ownedVideoState.get(video);this.unbindVideo(video),this.pauseAndUnload(video),authored&&(video.controls=authored.controls,video.iconLibrary=authored.iconLibrary,video.hidden=authored.hidden,this.ownedVideoState.delete(video),video.isConnected&&video.load())}rememberNativeVideo(video){const native=video.getVideoElement();native&&this.nativeVideos.set(video,native)}pauseAndUnload(video){video.pause(),video.hidden=!0,this.needsReload.add(video),video.unloadMedia()}activateVideo(video,shouldPlay,generation){if(video.hidden=!1,!video.getVideoElement()){this.needsReload.add(video),shouldPlay&&(this.pendingPlay={video,generation});return}if(this.rememberNativeVideo(video),video.load(),this.needsReload.delete(video),this.applyPreferences(video,this.preferences),!shouldPlay){this.pendingPlay?.video===video&&(this.pendingPlay=void 0);return}this.pendingPlay=void 0,video.play().catch(()=>{generation!==this.activationGeneration||this.activeVideo})}capturePreferences(video,native=video.getVideoElement()){return video.captureMediaPreferences(native)}applyPreferences(video,preferences){video.applyMediaPreferences(preferences)}handleLoadedMetadata(video){video===this.activeVideo&&(this.applyPreferences(video,this.preferences),this.requestUpdate())}handleCompletion(video){if(video!==this.activeVideo||this.withoutAutoAdvance)return;if(this.repeat==="one"){video.seek(0);const generation=this.activationGeneration;video.play().catch(()=>{generation!==this.activationGeneration||this.activeVideo});return}const nextIndex=this.nearestEnabledIndex(this.playlistVideos,this.activeIndex+1);if(nextIndex>this.activeIndex){this.switchTo(nextIndex,!0);return}if(this.repeat==="all"){const first=this.nearestEnabledIndex(this.playlistVideos,0);if(first>=0&&first!==this.activeIndex)this.switchTo(first,!0);else if(first===this.activeIndex){video.seek(0);const generation=this.activationGeneration;video.play().catch(()=>{generation!==this.activationGeneration||this.activeVideo})}}}snapshotVideo(video){const sources=[],directSrc=video.src.trim();directSrc&&sources.push(sourceSnapshot(directSrc,"",""));const tracks=[];for(const child of video.children)if(child.localName==="source"){const src=child.getAttribute("src")?.trim()??"";src&&sources.push(sourceSnapshot(src,child.getAttribute("type")??"",child.getAttribute("media")??""))}else if(child.localName==="track"){const src=child.getAttribute("src")?.trim()??"";src&&tracks.push(trackSnapshot(src,child.getAttribute("kind")??"",child.getAttribute("srclang")??"",child.getAttribute("label")??"",child.hasAttribute("default")))}return{title:video.title,poster:video.poster,sources,tracks}}emitChange(previousIndex,currentIndex,video){this.emit("lr-video-change",{previousIndex,currentIndex,video:video?this.snapshotVideo(video):null})}switchTo(index,forcePlay=!1){const incoming=this.playlistVideos[index];if(!incoming||!this.isEnabled(incoming))return;const previousIndex=this.activeIndex,outgoing=this.activeVideo;if(incoming===outgoing){if(this.navigationIndex=index,this.requestUpdate(),forcePlay){const generation=this.activationGeneration;incoming.play().catch(()=>{generation!==this.activationGeneration||this.activeVideo})}this.emitChange(previousIndex,index,incoming);return}const wasPlaying=forcePlay||!!outgoing?.getState().playing;outgoing&&(this.preferences=this.capturePreferences(outgoing),this.pauseAndUnload(outgoing)),this.activationGeneration+=1,this.activeVideo=incoming,this.activeIndex=index,this.navigationIndex=index;for(const video of this.playlistVideos){const isActive=video===incoming;video.hidden=!isActive,!isActive&&video!==outgoing&&this.pauseAndUnload(video)}this.activateVideo(incoming,wasPlaying,this.activationGeneration),this.requestUpdate(),this.emitChange(previousIndex,index,incoming)}goTo(index){!Number.isFinite(index)||!Number.isInteger(index)||index<0||index>=this.playlistVideos.length||this.switchTo(index)}next(){const index=this.nearestEnabledIndex(this.playlistVideos,this.activeIndex+1);index>this.activeIndex&&this.switchTo(index)}previous(){for(let index=this.activeIndex-1;index>=0;index-=1)if(this.isEnabled(this.playlistVideos[index])){this.switchTo(index);return}}onItemClick(event){const button=event.currentTarget,index=Number(button.dataset.index);Number.isInteger(index)&&(this.navigationIndex=index,this.goTo(index))}enabledIndices(){const result=[];for(let index=0;index<this.playlistVideos.length;index+=1)this.isEnabled(this.playlistVideos[index])&&result.push(index);return result}moveNavigation(from,direction){const enabled=this.enabledIndices(),position=enabled.indexOf(from);if(position<0)return;const next=enabled[position+direction];next!==void 0&&this.focusItem(next)}get navigationItem(){const rows=[...this.renderRoot.querySelectorAll('[part~="playlist-item"]')];return rows.find(row=>!row.disabled&&row.getAttribute("aria-current")==="true")??rows.find(row=>!row.disabled)??null}focus(options){this.navigationItem?.focus(options)}blur(){this.navigationItem?.blur()}click(){this.navigationItem?.click()}focusItem(index){this.isEnabled(this.playlistVideos[index])&&(this.navigationIndex=index,this.requestUpdate(),this.updateComplete.then(()=>{this.navigationIndex===index&&this.shadowRoot?.querySelector(`[data-index="${index}"]`)?.focus()}))}onItemKeyDown(event){const button=event.currentTarget,index=Number(button.dataset.index);if(!Number.isInteger(index)||button.disabled)return;const forward=this.effectiveDirection==="rtl"?"ArrowLeft":"ArrowRight",backward=this.effectiveDirection==="rtl"?"ArrowRight":"ArrowLeft";if(event.key==="Enter"||event.key===" ")event.preventDefault(),this.navigationIndex=index,this.goTo(index);else if(event.key==="ArrowDown"||event.key===forward)event.preventDefault(),this.moveNavigation(index,1);else if(event.key==="ArrowUp"||event.key===backward)event.preventDefault(),this.moveNavigation(index,-1);else if(event.key==="Home"){event.preventDefault();const first=this.enabledIndices()[0];first!==void 0&&this.focusItem(first)}else if(event.key==="End"){event.preventDefault();const enabled=this.enabledIndices(),last=enabled[enabled.length-1];last!==void 0&&this.focusItem(last)}}itemTitle(value,index){const title=typeof value=="string"?value.trim():"";if(title)return title;const position=getNumberFormat(this.effectiveLocale).format(index+1);return this.localize("videoPlaylistUntitled",void 0,{position})}renderItem(item,index,current,disabled){const title=this.itemTitle(item.title,index),poster=safeMediaSrc(typeof item.poster=="string"?item.poster:""),duration=finiteRange(typeof item.duration=="number"?item.duration:0,0,0),durationId=`playlist-duration-${index}`;return html`
|
|
2
2
|
<li>
|
|
3
3
|
<button
|
|
4
4
|
type="button"
|
|
@@ -78,11 +78,11 @@ accessibleLabel:string|null;
|
|
|
78
78
|
* than `@query`) so the generated manifest marks it readonly, not merely by convention. */
|
|
79
79
|
get iframe():HTMLIFrameElement|undefined;private cachedZoomLevelsSource;private cachedZoomLevels;
|
|
80
80
|
/** Focus the internal iframe when interaction is enabled and a live frame is connected. */
|
|
81
|
-
focus(options?:FocusOptions):void;
|
|
81
|
+
focus(options?:FocusOptions):void;private releaseFrameFocus;
|
|
82
82
|
/** Blur the internal iframe. Does not blur a focused zoom control. */
|
|
83
83
|
blur():void;
|
|
84
84
|
/** Activate the internal iframe only while interaction is enabled. */
|
|
85
|
-
click():void;private hasEmittedFocus;private frameIsActive;private frameOwnsFocus;private setFrameFocused;private dispatchHostFocusEvent;private emitHostFocus;private emitHostBlur;private onFrameFocus;private onFrameBlur;private focusReconciliationGeneration;private scheduleFrameFocusReconciliation;private focusBoundaryDocument?;private onFocusBoundaryKeyDown;private resetFocusBoundaryDocument;private bindFocusBoundaryDocument;private navigationGeneration;private needsReconnectFrame;private syncedThemeClasses;private syncedThemeProperties;private themeSyncState?;private themeWatcher?;connectedCallback():void;disconnectedCallback():void;attributeChangedCallback(name:string,oldValue:string|null,value:string|null):void;protected willUpdate(changed:PropertyValues<this>):void;protected updated(changed:PropertyValues<this>):void;
|
|
85
|
+
click():void;private hasEmittedFocus;private frameIsActive;private frameOwnsFocus;private setFrameFocused;private dispatchHostFocusEvent;private emitHostFocus;private emitHostBlur;private onFrameFocus;private onFrameBlur;private focusReconciliationGeneration;private scheduleFrameFocusReconciliation;private focusBoundaryDocument?;private onFocusBoundaryKeyDown;private leaveFocusBoundaryHub?;private resetFocusBoundaryDocument;private bindFocusBoundaryDocument;private navigationGeneration;private needsReconnectFrame;private syncedThemeClasses;private syncedThemeProperties;private themeSyncState?;private themeWatcher?;connectedCallback():void;disconnectedCallback():void;attributeChangedCallback(name:string,oldValue:string|null,value:string|null):void;protected willUpdate(changed:PropertyValues<this>):void;protected updated(changed:PropertyValues<this>):void;
|
|
86
86
|
/** Returns the current iframe window while connected. Cross-origin windows are still opaque. */
|
|
87
87
|
get contentWindow():Window|null;
|
|
88
88
|
/** Returns the current same-origin iframe document, or `null` when detached/cross-origin. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{keyed}from"lit/directives/keyed.js";import{activeElementIn}from"../../../internal/active-element.js";import{hostAriaLabel}from"../../../internal/a11y.js";import{LyraElement}from"../../../internal/lyra-element.js";import{HostDescriptionController}from"../../../internal/aria-controls.js";import{finiteRange}from"../../../internal/numbers.js";import{relayNativeEvent}from"../../../internal/native-event-relay.js";import{safeDownloadHref}from"../../../internal/safe-url.js";import{ThemeWatcher}from"../../../internal/theme-watcher.js";import{styles}from"./zoomable-frame.styles.js";import{LYRA_DEFAULT_zoomControls,LYRA_DEFAULT_zoomIn,LYRA_DEFAULT_zoomOut,LYRA_DEFAULT_zoomableFrameLabel}from"../../../internal/default-strings.generated.js";const DEFAULT_ZOOM_LEVELS="25% 50% 75% 100% 125% 150% 175% 200%",DEFAULT_IFRAME_SANDBOX="allow-same-origin",DEFAULT_ZOOM_LEVEL_VALUES=[.25,.5,.75,1,1.25,1.5,1.75,2],MIN_ZOOM=.01,MAX_ZOOM=1e3,MAX_ZOOM_LEVEL_SOURCE_CODE_UNITS=16384,MAX_ZOOM_LEVEL_TOKENS=256,SANDBOX_TOKENS=new Set(["allow-downloads","allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-same-origin","allow-scripts","allow-storage-access-by-user-activation","allow-top-navigation","allow-top-navigation-by-user-activation","allow-top-navigation-to-custom-protocols"]),REFERRER_POLICIES=new Set(["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"]),THEME_ATTRIBUTES=["data-lr-theme","data-theme","data-color-scheme"];function isLyraThemeClass(value){return value==="lr-light"||value==="lr-dark"||value.startsWith("lr-theme-")||value.startsWith("lr-brand-")||value.startsWith("lr-palette-")}function safeZoomableFrameSrc(value){return typeof value=="string"&&value.trim().toLowerCase()==="about:blank"?value.trim():safeDownloadHref(value)}function safeZoomableFrameSandbox(value){if(typeof value!="string")return"";const tokens=[...new Set(value.toLowerCase().split(/\s+/).filter(token=>SANDBOX_TOKENS.has(token)))];return tokens.includes("allow-scripts")&&tokens.includes("allow-same-origin")?tokens.filter(token=>token!=="allow-same-origin").join(" "):tokens.join(" ")}function safeLoading(value){return value==="lazy"?"lazy":"eager"}function safeReferrerPolicy(value){return value===""||value==null?null:typeof value=="string"&&REFERRER_POLICIES.has(value)?value:"no-referrer"}function parseZoomLevels(value){if(typeof value!="string")return DEFAULT_ZOOM_LEVEL_VALUES;const source=value.slice(0,MAX_ZOOM_LEVEL_SOURCE_CODE_UNITS),finalTokenContinues=value.length>MAX_ZOOM_LEVEL_SOURCE_CODE_UNITS&&/\S/u.test(source.at(-1)??"")&&/\S/u.test(value[MAX_ZOOM_LEVEL_SOURCE_CODE_UNITS]??""),tokenPattern=/\S+/g,unique=new Set;let tokenCount=0,match;for(;tokenCount<MAX_ZOOM_LEVEL_TOKENS&&(match=tokenPattern.exec(source))!==null&&!(finalTokenContinues&&tokenPattern.lastIndex===source.length);){tokenCount+=1;const token=match[0],percent=token.endsWith("%"),parsed=Number(percent?token.slice(0,-1):token),level=percent?parsed/100:parsed;Number.isFinite(level)&&level>=MIN_ZOOM&&level<=MAX_ZOOM&&unique.add(level)}return unique.size===0?DEFAULT_ZOOM_LEVEL_VALUES:Object.freeze([...unique].sort((left,right)=>left-right))}class LyraZoomableFrame extends LyraElement{constructor(){super(...arguments),this.hostDescription=new HostDescriptionController(this,()=>this.renderRoot.querySelector('[part="iframe"]')),this.src="",this.srcdoc="",this.allowfullscreen=!1,this.loading="eager",this.referrerpolicy="",this.sandbox=DEFAULT_IFRAME_SANDBOX,this.zoom=1,this.zoomLevels=DEFAULT_ZOOM_LEVELS,this.withoutControls=!1,this.withoutInteraction=!1,this.withThemeSync=!1,this.accessibleLabel=null,this.cachedZoomLevelsSource=Symbol("uncached zoom levels"),this.cachedZoomLevels=DEFAULT_ZOOM_LEVEL_VALUES,this.hasEmittedFocus=!1,this.onFrameFocus=event=>{event.stopPropagation(),this.frameOwnsFocus(event.currentTarget)&&this.emitHostFocus(event)},this.onFrameBlur=event=>{event.stopPropagation(),!this.frameOwnsFocus(event.currentTarget)&&this.emitHostBlur(event)},this.focusReconciliationGeneration=0,this.scheduleFrameFocusReconciliation=()=>{const view=this.ownerDocument.defaultView;if(!view)return;const generation=++this.focusReconciliationGeneration;view.setTimeout(()=>{generation!==this.focusReconciliationGeneration||!this.isConnected||(this.frameOwnsFocus()?this.emitHostFocus():this.emitHostBlur(void 0,activeElementIn(this.ownerDocument)))},0)},this.onFocusBoundaryKeyDown=event=>{event.key==="Tab"&&this.scheduleFrameFocusReconciliation()},this.navigationGeneration=0,this.needsReconnectFrame=!1,this.syncedThemeClasses=new Set,this.syncedThemeProperties=new Set,this.onControlsKeyDown=event=>{event.altKey||event.ctrlKey||event.metaKey||(event.key==="+"||event.key==="="?(event.preventDefault(),this.zoomIn()):(event.key==="-"||event.key==="_")&&(event.preventDefault(),this.zoomOut()))}}static{this.defaultStrings={...super.defaultStrings,zoomControls:LYRA_DEFAULT_zoomControls,zoomIn:LYRA_DEFAULT_zoomIn,zoomOut:LYRA_DEFAULT_zoomOut,zoomableFrameLabel:LYRA_DEFAULT_zoomableFrameLabel}}static{this.styles=[LyraElement.styles,styles]}adoptedCallback(){super.adoptedCallback(),this.hostDescription.adopted()}get iframe(){return this.renderRoot?.querySelector("iframe")??void 0}focus(options){const frame=this.iframe;if(!frame||!this.isConnected||this.withoutInteraction||frame.inert)return;const previous=activeElementIn(this.ownerDocument),wasFocused=this.frameOwnsFocus(frame);frame.focus(options),!wasFocused&&this.frameOwnsFocus(frame)&&this.emitHostFocus(void 0,previous)}blur(){const frame=this.iframe;!frame||!this.frameOwnsFocus(frame)||(frame.blur(),this.frameOwnsFocus(frame)||this.emitHostBlur(void 0,activeElementIn(this.ownerDocument)))}click(){this.isConnected&&!this.withoutInteraction&&!this.iframe?.inert&&this.iframe?.click()}frameIsActive(frame=this.iframe){return!!(frame&&this.isConnected&&activeElementIn(this.shadowRoot)===frame)}frameOwnsFocus(frame=this.iframe){return!!(frame&&!frame.inert&&!this.withoutInteraction&&this.frameIsActive(frame))}setFrameFocused(focused){this.toggleAttribute("data-frame-focused",focused)}dispatchHostFocusEvent(type,source,relatedTarget=null){const view=this.ownerDocument.defaultView;if(!view)return;const related=source?.relatedTarget??relatedTarget,relatedNode=related,internalRelated=related===this||relatedNode?.nodeType!==void 0&&this.shadowRoot?.contains(relatedNode),nativeSource=new view.FocusEvent(type,{relatedTarget:internalRelated?null:related,view,detail:source?.detail??0});relayNativeEvent(this,nativeSource)}emitHostFocus(source,relatedTarget=null){this.hasEmittedFocus||(this.hasEmittedFocus=!0,this.setFrameFocused(!0),this.dispatchHostFocusEvent("focus",source,relatedTarget))}emitHostBlur(source,relatedTarget=null){this.hasEmittedFocus&&(this.hasEmittedFocus=!1,this.setFrameFocused(!1),this.dispatchHostFocusEvent("blur",source,relatedTarget))}resetFocusBoundaryDocument(){this.focusBoundaryDocument?.removeEventListener("keydown",this.onFocusBoundaryKeyDown,!0),this.focusBoundaryDocument?.removeEventListener("pointerdown",this.scheduleFrameFocusReconciliation,!0),this.focusBoundaryDocument=void 0}bindFocusBoundaryDocument(){let target=null;try{target=this.contentDocument}catch{}!target||target===this.focusBoundaryDocument||(this.resetFocusBoundaryDocument(),this.focusBoundaryDocument=target,target.addEventListener("keydown",this.onFocusBoundaryKeyDown,!0),target.addEventListener("pointerdown",this.scheduleFrameFocusReconciliation,!0))}connectedCallback(){super.connectedCallback(),this.ownerDocument.addEventListener("focusin",this.scheduleFrameFocusReconciliation,!0),this.ownerDocument.addEventListener("focusout",this.scheduleFrameFocusReconciliation,!0),this.ownerDocument.addEventListener("keydown",this.onFocusBoundaryKeyDown,!0),this.ownerDocument.defaultView?.addEventListener("focus",this.scheduleFrameFocusReconciliation),this.ownerDocument.defaultView?.addEventListener("blur",this.scheduleFrameFocusReconciliation),this.needsReconnectFrame&&(this.needsReconnectFrame=!1,this.requestUpdate())}disconnectedCallback(){this.focusReconciliationGeneration++,this.ownerDocument.removeEventListener("focusin",this.scheduleFrameFocusReconciliation,!0),this.ownerDocument.removeEventListener("focusout",this.scheduleFrameFocusReconciliation,!0),this.ownerDocument.removeEventListener("keydown",this.onFocusBoundaryKeyDown,!0),this.ownerDocument.defaultView?.removeEventListener("focus",this.scheduleFrameFocusReconciliation),this.ownerDocument.defaultView?.removeEventListener("blur",this.scheduleFrameFocusReconciliation),this.navigationGeneration++,this.needsReconnectFrame=!0,this.hasEmittedFocus=!1,this.setFrameFocused(!1),this.resetFocusBoundaryDocument(),this.resetThemeSyncState(),super.disconnectedCallback()}attributeChangedCallback(name,oldValue,value){super.attributeChangedCallback(name,oldValue,value),name==="srcdoc"&&oldValue===null!=(value===null)&&(this.navigationGeneration++,this.requestUpdate())}willUpdate(changed){if(super.willUpdate(changed),changed.has("src")||changed.has("srcdoc")||changed.has("allowfullscreen")||changed.has("loading")||changed.has("referrerpolicy")||changed.has("sandbox")){const frame=this.iframe,wasFocused=this.frameIsActive(frame);frame?.blur(),wasFocused&&!this.frameIsActive(frame)&&this.emitHostBlur(void 0,activeElementIn(this.ownerDocument)),this.setFrameFocused(!1),this.resetFocusBoundaryDocument(),this.navigationGeneration++}if(changed.has("withoutInteraction")&&this.withoutInteraction){const frame=this.iframe,wasFocused=this.frameIsActive(frame);frame?.blur(),wasFocused&&this.emitHostBlur(void 0,activeElementIn(this.ownerDocument)),this.setFrameFocused(!1)}}updated(changed){super.updated(changed),changed.has("withThemeSync")&&(this.withThemeSync?(this.themeWatcher??=new ThemeWatcher(this,()=>this.syncTheme()),this.syncTheme()):this.restoreTheme())}get contentWindow(){return this.isConnected?this.iframe?.contentWindow??null:null}get contentDocument(){if(!this.isConnected)return null;try{return this.iframe?.contentDocument??null}catch{return null}}get safeZoom(){return finiteRange(this.zoom,1,MIN_ZOOM,MAX_ZOOM)}get availableZoomLevels(){const source=this.zoomLevels;return source===this.cachedZoomLevelsSource?this.cachedZoomLevels:(this.cachedZoomLevelsSource=source,this.cachedZoomLevels=parseZoomLevels(source),this.cachedZoomLevels)}get hasInlineDocument(){return this.hasAttribute("srcdoc")||typeof this.srcdoc=="string"&&this.srcdoc!==""}get hasNavigation(){return this.hasInlineDocument||safeZoomableFrameSrc(this.src)!==null}navigationSignature(){const inline=this.hasInlineDocument;return JSON.stringify([inline,inline?this.srcdoc:safeZoomableFrameSrc(this.src),this.allowfullscreen,safeLoading(this.loading),safeReferrerPolicy(this.referrerpolicy),safeZoomableFrameSandbox(this.sandbox)])}zoomIn(){const current=this.safeZoom,next=this.availableZoomLevels.find(level=>level>current);next!==void 0&&this.zoomTo(next)}zoomOut(){const current=this.safeZoom,levels=this.availableZoomLevels;for(let index=levels.length-1;index>=0;index--){const previous=levels[index];if(previous!==void 0&&previous<current){this.zoomTo(previous);return}}}zoomTo(zoom){this.zoom=zoom,this.emit("lr-zoom-change",{zoom})}isZoomInDisabled(){return!this.availableZoomLevels.some(level=>level>this.safeZoom)}isZoomOutDisabled(){return!this.availableZoomLevels.some(level=>level<this.safeZoom)}dispatchFrameEvent(type){const EventConstructor=this.ownerDocument.defaultView?.Event??Event;type==="load"?this.dispatchEvent(new EventConstructor("load",{bubbles:!1,composed:!1})):this.dispatchEvent(new EventConstructor("error",{bubbles:!1,composed:!1}))}onFrameEvent(type,source,generation,navigationSignature){source.stopPropagation(),!(!this.isConnected||!this.hasNavigation||generation!==this.navigationGeneration||navigationSignature!==this.navigationSignature()||source.currentTarget!==this.iframe)&&(type==="load"&&(this.bindFocusBoundaryDocument(),this.syncTheme()),this.dispatchFrameEvent(type))}syncTheme(){if(!this.withThemeSync||!this.isConnected)return;const target=this.contentDocument?.documentElement,source=this.ownerDocument.documentElement;if(!(!target||!source))try{const state=this.themeStateFor(target),nextClasses=new Set([...source.classList].filter(isLyraThemeClass));for(const className of this.syncedThemeClasses)nextClasses.has(className)||this.setSyncedThemeClass(state,className,!1);for(const className of nextClasses)this.setSyncedThemeClass(state,className,!0);this.syncedThemeClasses=nextClasses;for(const attribute of THEME_ATTRIBUTES){const value=source.getAttribute(attribute);this.setSyncedThemeAttribute(state,attribute,value)}const computed=this.ownerDocument.defaultView?.getComputedStyle(this);if(!computed)return;const nextProperties=new Set;for(let index=0;index<computed.length;index++){const property2=computed.item(index);property2.startsWith("--lr-theme-")&&(this.setSyncedThemeProperty(state,property2,computed.getPropertyValue(property2)),nextProperties.add(property2))}for(const property2 of this.syncedThemeProperties)nextProperties.has(property2)||this.setSyncedThemeProperty(state,property2,null);this.syncedThemeProperties=nextProperties,this.setSyncedThemeProperty(state,"color-scheme",computed.colorScheme)}catch{}}themeStateFor(target){if(this.themeSyncState?.target===target)return this.themeSyncState;this.resetThemeSyncState();const state={target,classes:new Map,attributes:new Map,properties:new Map};return this.themeSyncState=state,state}setSyncedThemeClass(state,className,present){let mutation=state.classes.get(className);mutation||(mutation={original:state.target.classList.contains(className),applied:state.target.classList.contains(className)},state.classes.set(className,mutation)),state.target.classList.toggle(className,present),mutation.applied=state.target.classList.contains(className)}setSyncedThemeAttribute(state,attribute,value){let mutation=state.attributes.get(attribute);if(!mutation){const original=state.target.getAttribute(attribute);mutation={original,applied:original},state.attributes.set(attribute,mutation)}value===null?state.target.removeAttribute(attribute):state.target.setAttribute(attribute,value),mutation.applied=state.target.getAttribute(attribute)}setSyncedThemeProperty(state,property2,value){let mutation=state.properties.get(property2);mutation||(mutation={original:state.target.style.getPropertyValue(property2),originalPriority:state.target.style.getPropertyPriority(property2),applied:state.target.style.getPropertyValue(property2),appliedPriority:state.target.style.getPropertyPriority(property2)},state.properties.set(property2,mutation)),value===null?state.target.style.removeProperty(property2):state.target.style.setProperty(property2,value),mutation.applied=state.target.style.getPropertyValue(property2),mutation.appliedPriority=state.target.style.getPropertyPriority(property2)}restoreTheme(){const state=this.themeSyncState;if(state)try{if(this.contentDocument?.documentElement!==state.target)return;for(const[className,mutation]of state.classes)state.target.classList.contains(className)===mutation.applied&&state.target.classList.toggle(className,mutation.original);for(const[attribute,mutation]of state.attributes)state.target.getAttribute(attribute)===mutation.applied&&(mutation.original===null?state.target.removeAttribute(attribute):state.target.setAttribute(attribute,mutation.original));for(const[property2,mutation]of state.properties)state.target.style.getPropertyValue(property2)!==mutation.applied||state.target.style.getPropertyPriority(property2)!==mutation.appliedPriority||(mutation.original?state.target.style.setProperty(property2,mutation.original,mutation.originalPriority):state.target.style.removeProperty(property2))}catch{}finally{this.resetThemeSyncState()}}resetThemeSyncState(){this.themeSyncState=void 0,this.syncedThemeClasses.clear(),this.syncedThemeProperties.clear()}renderControls(){return this.withoutControls?nothing:html`<div
|
|
1
|
+
import{__decorate}from"tslib";import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{keyed}from"lit/directives/keyed.js";import{activeElementIn,shadowFocusTarget}from"../../../internal/active-element.js";import{hostAriaLabel}from"../../../internal/a11y.js";import{LyraElement}from"../../../internal/lyra-element.js";import{HostDescriptionController}from"../../../internal/aria-controls.js";import{finiteRange}from"../../../internal/numbers.js";import{relayNativeEvent}from"../../../internal/native-event-relay.js";import{safeDownloadHref}from"../../../internal/safe-url.js";import{ThemeWatcher}from"../../../internal/theme-watcher.js";import{styles}from"./zoomable-frame.styles.js";import{LYRA_DEFAULT_zoomControls,LYRA_DEFAULT_zoomIn,LYRA_DEFAULT_zoomOut,LYRA_DEFAULT_zoomableFrameLabel}from"../../../internal/default-strings.generated.js";const focusBoundaryHubs=new WeakMap;function joinFocusBoundaryHub(doc,member){let hub=focusBoundaryHubs.get(doc);if(!hub){const members=new Set,view=doc.defaultView,onEvent=event=>{for(const m of[...members])m.onOwnerFocusBoundary(event)};doc.addEventListener("focusin",onEvent,!0),doc.addEventListener("focusout",onEvent,!0),doc.addEventListener("keydown",onEvent,!0),view?.addEventListener("focus",onEvent),view?.addEventListener("blur",onEvent),hub={members,dispose:()=>{doc.removeEventListener("focusin",onEvent,!0),doc.removeEventListener("focusout",onEvent,!0),doc.removeEventListener("keydown",onEvent,!0),view?.removeEventListener("focus",onEvent),view?.removeEventListener("blur",onEvent)}},focusBoundaryHubs.set(doc,hub)}hub.members.add(member);const joined=hub;return()=>{joined.members.delete(member),!joined.members.size&&focusBoundaryHubs.get(doc)===joined&&(joined.dispose(),focusBoundaryHubs.delete(doc))}}const DEFAULT_ZOOM_LEVELS="25% 50% 75% 100% 125% 150% 175% 200%",DEFAULT_IFRAME_SANDBOX="allow-same-origin",DEFAULT_ZOOM_LEVEL_VALUES=[.25,.5,.75,1,1.25,1.5,1.75,2],MIN_ZOOM=.01,MAX_ZOOM=1e3,MAX_ZOOM_LEVEL_SOURCE_CODE_UNITS=16384,MAX_ZOOM_LEVEL_TOKENS=256,SANDBOX_TOKENS=new Set(["allow-downloads","allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-same-origin","allow-scripts","allow-storage-access-by-user-activation","allow-top-navigation","allow-top-navigation-by-user-activation","allow-top-navigation-to-custom-protocols"]),REFERRER_POLICIES=new Set(["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"]),THEME_ATTRIBUTES=["data-lr-theme","data-theme","data-color-scheme"];function isLyraThemeClass(value){return value==="lr-light"||value==="lr-dark"||value.startsWith("lr-theme-")||value.startsWith("lr-brand-")||value.startsWith("lr-palette-")}function safeZoomableFrameSrc(value){return typeof value=="string"&&value.trim().toLowerCase()==="about:blank"?value.trim():safeDownloadHref(value)}function safeZoomableFrameSandbox(value){if(typeof value!="string")return"";const tokens=[...new Set(value.toLowerCase().split(/\s+/).filter(token=>SANDBOX_TOKENS.has(token)))];return tokens.includes("allow-scripts")&&tokens.includes("allow-same-origin")?tokens.filter(token=>token!=="allow-same-origin").join(" "):tokens.join(" ")}function safeLoading(value){return value==="lazy"?"lazy":"eager"}function safeReferrerPolicy(value){return value===""||value==null?null:typeof value=="string"&&REFERRER_POLICIES.has(value)?value:"no-referrer"}function parseZoomLevels(value){if(typeof value!="string")return DEFAULT_ZOOM_LEVEL_VALUES;const source=value.slice(0,MAX_ZOOM_LEVEL_SOURCE_CODE_UNITS),finalTokenContinues=value.length>MAX_ZOOM_LEVEL_SOURCE_CODE_UNITS&&/\S/u.test(source.at(-1)??"")&&/\S/u.test(value[MAX_ZOOM_LEVEL_SOURCE_CODE_UNITS]??""),tokenPattern=/\S+/g,unique=new Set;let tokenCount=0,match;for(;tokenCount<MAX_ZOOM_LEVEL_TOKENS&&(match=tokenPattern.exec(source))!==null&&!(finalTokenContinues&&tokenPattern.lastIndex===source.length);){tokenCount+=1;const token=match[0],percent=token.endsWith("%"),parsed=Number(percent?token.slice(0,-1):token),level=percent?parsed/100:parsed;Number.isFinite(level)&&level>=MIN_ZOOM&&level<=MAX_ZOOM&&unique.add(level)}return unique.size===0?DEFAULT_ZOOM_LEVEL_VALUES:Object.freeze([...unique].sort((left,right)=>left-right))}class LyraZoomableFrame extends LyraElement{constructor(){super(...arguments),this.hostDescription=new HostDescriptionController(this,()=>this.renderRoot.querySelector('[part="iframe"]')),this.src="",this.srcdoc="",this.allowfullscreen=!1,this.loading="eager",this.referrerpolicy="",this.sandbox=DEFAULT_IFRAME_SANDBOX,this.zoom=1,this.zoomLevels=DEFAULT_ZOOM_LEVELS,this.withoutControls=!1,this.withoutInteraction=!1,this.withThemeSync=!1,this.accessibleLabel=null,this.cachedZoomLevelsSource=Symbol("uncached zoom levels"),this.cachedZoomLevels=DEFAULT_ZOOM_LEVEL_VALUES,this.hasEmittedFocus=!1,this.onFrameFocus=event=>{event.stopPropagation(),this.frameOwnsFocus(event.currentTarget)&&this.emitHostFocus(event)},this.onFrameBlur=event=>{event.stopPropagation(),!this.frameOwnsFocus(event.currentTarget)&&this.emitHostBlur(event)},this.focusReconciliationGeneration=0,this.scheduleFrameFocusReconciliation=()=>{const view=this.ownerDocument.defaultView;if(!view)return;const generation=++this.focusReconciliationGeneration;view.setTimeout(()=>{generation!==this.focusReconciliationGeneration||!this.isConnected||(this.frameOwnsFocus()?this.emitHostFocus():this.emitHostBlur(void 0,activeElementIn(this.ownerDocument)))},0)},this.onFocusBoundaryKeyDown=event=>{event.key==="Tab"&&this.scheduleFrameFocusReconciliation()},this.navigationGeneration=0,this.needsReconnectFrame=!1,this.syncedThemeClasses=new Set,this.syncedThemeProperties=new Set,this.onControlsKeyDown=event=>{event.altKey||event.ctrlKey||event.metaKey||(event.key==="+"||event.key==="="?(event.preventDefault(),this.zoomIn()):(event.key==="-"||event.key==="_")&&(event.preventDefault(),this.zoomOut()))}}static{this.defaultStrings={...super.defaultStrings,zoomControls:LYRA_DEFAULT_zoomControls,zoomIn:LYRA_DEFAULT_zoomIn,zoomOut:LYRA_DEFAULT_zoomOut,zoomableFrameLabel:LYRA_DEFAULT_zoomableFrameLabel}}static{this.styles=[LyraElement.styles,styles]}adoptedCallback(){super.adoptedCallback(),this.hostDescription.adopted()}get iframe(){return this.renderRoot?.querySelector("iframe")??void 0}focus(options){const frame=this.iframe;if(!frame||!this.isConnected||this.withoutInteraction||frame.inert)return;const previous=activeElementIn(this.ownerDocument),wasFocused=this.frameOwnsFocus(frame);frame.focus(options),!wasFocused&&this.frameOwnsFocus(frame)&&this.emitHostFocus(void 0,previous)}releaseFrameFocus(frame){if(frame&&(frame.blur(),!!this.frameIsActive(frame))){try{frame.contentWindow?.blur()}catch{}frame.blur()}}blur(){const frame=this.iframe;!frame||!this.frameOwnsFocus(frame)||(this.releaseFrameFocus(frame),this.frameOwnsFocus(frame)||this.emitHostBlur(void 0,activeElementIn(this.ownerDocument)))}click(){this.isConnected&&!this.withoutInteraction&&!this.iframe?.inert&&this.iframe?.click()}frameIsActive(frame=this.iframe){return!!(frame&&this.isConnected&&shadowFocusTarget(this)===frame)}frameOwnsFocus(frame=this.iframe){return!!(frame&&!frame.inert&&!this.withoutInteraction&&this.frameIsActive(frame))}setFrameFocused(focused){this.toggleAttribute("data-frame-focused",focused)}dispatchHostFocusEvent(type,source,relatedTarget=null){const view=this.ownerDocument.defaultView;if(!view)return;const related=source?.relatedTarget??relatedTarget,relatedNode=related,internalRelated=related===this||relatedNode?.nodeType!==void 0&&this.shadowRoot?.contains(relatedNode),nativeSource=new view.FocusEvent(type,{relatedTarget:internalRelated?null:related,view,detail:source?.detail??0});relayNativeEvent(this,nativeSource)}emitHostFocus(source,relatedTarget=null){this.hasEmittedFocus||(this.hasEmittedFocus=!0,this.setFrameFocused(!0),this.dispatchHostFocusEvent("focus",source,relatedTarget))}emitHostBlur(source,relatedTarget=null){this.hasEmittedFocus&&(this.hasEmittedFocus=!1,this.setFrameFocused(!1),this.dispatchHostFocusEvent("blur",source,relatedTarget))}onOwnerFocusBoundary(event){event.type==="keydown"?this.onFocusBoundaryKeyDown(event):(this.hasEmittedFocus||this.frameOwnsFocus())&&this.scheduleFrameFocusReconciliation()}resetFocusBoundaryDocument(){this.focusBoundaryDocument?.removeEventListener("keydown",this.onFocusBoundaryKeyDown,!0),this.focusBoundaryDocument?.removeEventListener("pointerdown",this.scheduleFrameFocusReconciliation,!0),this.focusBoundaryDocument=void 0}bindFocusBoundaryDocument(){let target=null;try{target=this.contentDocument}catch{}!target||target===this.focusBoundaryDocument||(this.resetFocusBoundaryDocument(),this.focusBoundaryDocument=target,target.addEventListener("keydown",this.onFocusBoundaryKeyDown,!0),target.addEventListener("pointerdown",this.scheduleFrameFocusReconciliation,!0))}connectedCallback(){super.connectedCallback(),this.leaveFocusBoundaryHub?.(),this.leaveFocusBoundaryHub=joinFocusBoundaryHub(this.ownerDocument,this),this.needsReconnectFrame&&(this.needsReconnectFrame=!1,this.requestUpdate())}disconnectedCallback(){this.focusReconciliationGeneration++,this.leaveFocusBoundaryHub?.(),this.leaveFocusBoundaryHub=void 0,this.navigationGeneration++,this.needsReconnectFrame=!0,this.hasEmittedFocus=!1,this.setFrameFocused(!1),this.resetFocusBoundaryDocument(),this.resetThemeSyncState(),super.disconnectedCallback()}attributeChangedCallback(name,oldValue,value){super.attributeChangedCallback(name,oldValue,value),name==="srcdoc"&&oldValue===null!=(value===null)&&(this.navigationGeneration++,this.requestUpdate())}willUpdate(changed){if(super.willUpdate(changed),changed.has("src")||changed.has("srcdoc")||changed.has("allowfullscreen")||changed.has("loading")||changed.has("referrerpolicy")||changed.has("sandbox")){const frame=this.iframe,wasFocused=this.frameIsActive(frame);this.releaseFrameFocus(frame),wasFocused&&!this.frameIsActive(frame)&&this.emitHostBlur(void 0,activeElementIn(this.ownerDocument)),this.setFrameFocused(!1),this.resetFocusBoundaryDocument(),this.navigationGeneration++}if(changed.has("withoutInteraction")&&this.withoutInteraction){const frame=this.iframe,wasFocused=this.frameIsActive(frame);this.releaseFrameFocus(frame),wasFocused&&this.emitHostBlur(void 0,activeElementIn(this.ownerDocument)),this.setFrameFocused(!1)}}updated(changed){super.updated(changed),changed.has("withThemeSync")&&(this.withThemeSync?(this.themeWatcher??=new ThemeWatcher(this,()=>this.syncTheme()),this.syncTheme()):(this.themeWatcher&&(this.themeWatcher.hostDisconnected(),this.removeController(this.themeWatcher),this.themeWatcher=void 0),this.restoreTheme()))}get contentWindow(){return this.isConnected?this.iframe?.contentWindow??null:null}get contentDocument(){if(!this.isConnected)return null;try{return this.iframe?.contentDocument??null}catch{return null}}get safeZoom(){return finiteRange(this.zoom,1,MIN_ZOOM,MAX_ZOOM)}get availableZoomLevels(){const source=this.zoomLevels;return source===this.cachedZoomLevelsSource?this.cachedZoomLevels:(this.cachedZoomLevelsSource=source,this.cachedZoomLevels=parseZoomLevels(source),this.cachedZoomLevels)}get hasInlineDocument(){return this.hasAttribute("srcdoc")||typeof this.srcdoc=="string"&&this.srcdoc!==""}get hasNavigation(){return this.hasInlineDocument||safeZoomableFrameSrc(this.src)!==null}navigationSignature(){const inline=this.hasInlineDocument;return JSON.stringify([inline,inline?this.srcdoc:safeZoomableFrameSrc(this.src),this.allowfullscreen,safeLoading(this.loading),safeReferrerPolicy(this.referrerpolicy),safeZoomableFrameSandbox(this.sandbox)])}zoomIn(){const current=this.safeZoom,next=this.availableZoomLevels.find(level=>level>current);next!==void 0&&this.zoomTo(next)}zoomOut(){const current=this.safeZoom,levels=this.availableZoomLevels;for(let index=levels.length-1;index>=0;index--){const previous=levels[index];if(previous!==void 0&&previous<current){this.zoomTo(previous);return}}}zoomTo(zoom){this.zoom=zoom,this.emit("lr-zoom-change",{zoom})}isZoomInDisabled(){return!this.availableZoomLevels.some(level=>level>this.safeZoom)}isZoomOutDisabled(){return!this.availableZoomLevels.some(level=>level<this.safeZoom)}dispatchFrameEvent(type){const EventConstructor=this.ownerDocument.defaultView?.Event??Event;type==="load"?this.dispatchEvent(new EventConstructor("load",{bubbles:!1,composed:!1})):this.dispatchEvent(new EventConstructor("error",{bubbles:!1,composed:!1}))}onFrameEvent(type,source,generation,navigationSignature){source.stopPropagation(),!(!this.isConnected||!this.hasNavigation||generation!==this.navigationGeneration||navigationSignature!==this.navigationSignature()||source.currentTarget!==this.iframe)&&(type==="load"&&(this.bindFocusBoundaryDocument(),this.syncTheme()),this.dispatchFrameEvent(type))}syncTheme(){if(!this.withThemeSync||!this.isConnected)return;const target=this.contentDocument?.documentElement,source=this.ownerDocument.documentElement;if(!(!target||!source))try{const state=this.themeStateFor(target),nextClasses=new Set([...source.classList].filter(isLyraThemeClass));for(const className of this.syncedThemeClasses)nextClasses.has(className)||this.setSyncedThemeClass(state,className,!1);for(const className of nextClasses)this.setSyncedThemeClass(state,className,!0);this.syncedThemeClasses=nextClasses;for(const attribute of THEME_ATTRIBUTES){const value=source.getAttribute(attribute);this.setSyncedThemeAttribute(state,attribute,value)}const computed=this.ownerDocument.defaultView?.getComputedStyle(this);if(!computed)return;const nextProperties=new Set;for(let index=0;index<computed.length;index++){const property2=computed.item(index);property2.startsWith("--lr-theme-")&&(this.setSyncedThemeProperty(state,property2,computed.getPropertyValue(property2)),nextProperties.add(property2))}for(const property2 of this.syncedThemeProperties)nextProperties.has(property2)||this.setSyncedThemeProperty(state,property2,null);this.syncedThemeProperties=nextProperties,this.setSyncedThemeProperty(state,"color-scheme",computed.colorScheme)}catch{}}themeStateFor(target){if(this.themeSyncState?.target===target)return this.themeSyncState;this.resetThemeSyncState();const state={target,classes:new Map,attributes:new Map,properties:new Map};return this.themeSyncState=state,state}setSyncedThemeClass(state,className,present){let mutation=state.classes.get(className);mutation||(mutation={original:state.target.classList.contains(className),applied:state.target.classList.contains(className)},state.classes.set(className,mutation)),state.target.classList.toggle(className,present),mutation.applied=state.target.classList.contains(className)}setSyncedThemeAttribute(state,attribute,value){let mutation=state.attributes.get(attribute);if(!mutation){const original=state.target.getAttribute(attribute);mutation={original,applied:original},state.attributes.set(attribute,mutation)}value===null?state.target.removeAttribute(attribute):state.target.setAttribute(attribute,value),mutation.applied=state.target.getAttribute(attribute)}setSyncedThemeProperty(state,property2,value){let mutation=state.properties.get(property2);mutation||(mutation={original:state.target.style.getPropertyValue(property2),originalPriority:state.target.style.getPropertyPriority(property2),applied:state.target.style.getPropertyValue(property2),appliedPriority:state.target.style.getPropertyPriority(property2)},state.properties.set(property2,mutation)),value===null?state.target.style.removeProperty(property2):state.target.style.setProperty(property2,value),mutation.applied=state.target.style.getPropertyValue(property2),mutation.appliedPriority=state.target.style.getPropertyPriority(property2)}restoreTheme(){const state=this.themeSyncState;if(state)try{if(this.contentDocument?.documentElement!==state.target)return;for(const[className,mutation]of state.classes)state.target.classList.contains(className)===mutation.applied&&state.target.classList.toggle(className,mutation.original);for(const[attribute,mutation]of state.attributes)state.target.getAttribute(attribute)===mutation.applied&&(mutation.original===null?state.target.removeAttribute(attribute):state.target.setAttribute(attribute,mutation.original));for(const[property2,mutation]of state.properties)state.target.style.getPropertyValue(property2)!==mutation.applied||state.target.style.getPropertyPriority(property2)!==mutation.appliedPriority||(mutation.original?state.target.style.setProperty(property2,mutation.original,mutation.originalPriority):state.target.style.removeProperty(property2))}catch{}finally{this.resetThemeSyncState()}}resetThemeSyncState(){this.themeSyncState=void 0,this.syncedThemeClasses.clear(),this.syncedThemeProperties.clear()}renderControls(){return this.withoutControls?nothing:html`<div
|
|
2
2
|
part="controls"
|
|
3
3
|
role="group"
|
|
4
4
|
aria-label=${this.localize("zoomControls")}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type LyraSize
|
|
1
|
+
import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type LyraSize}from'../../../internal/variants.js';import{type SemanticVariant}from'../../../internal/semantic-variant.js';
|
|
2
2
|
/** Shoelace's physical countdown direction. */
|
|
3
3
|
export type AlertCountdown='rtl'|'ltr'|undefined;
|
|
4
|
-
/**
|
|
5
|
-
export type AlertVariant=
|
|
4
|
+
/** Alert tones; `primary` and `brand` resolve through Lyra's shared brand row. */
|
|
5
|
+
export type AlertVariant=SemanticVariant;export interface LyraAlertEventMap{'lr-show':CustomEvent<null>;'lr-after-show':CustomEvent<null>;'lr-hide':CustomEvent<null>;'lr-after-hide':CustomEvent<null>;}
|
|
6
6
|
/**
|
|
7
7
|
* `<lr-alert>` — a closed-by-default inline alert that can also move into the shared toast stack.
|
|
8
8
|
* It mirrors the public `<sl-alert>` contract under the `lr-` prefix. `lr-show`/`lr-hide` are
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{closeIcon}from"../../../internal/icons.js";import{applyComposedFocusRepair,captureComposedFocusRepair,nearestExternalFocusTarget}from"../../../internal/focus-navigation.js";import{renderInertPresentation}from"../../../internal/inert-presentation.js";import{LyraElement}from"../../../internal/lyra-element.js";import{tag}from"../../../internal/prefix.js";import{prefersReducedMotion}from"../../../internal/motion.js";import{finiteDuration}from"../../../internal/numbers.js";import{composedContains,deepActiveElement}from"../../../internal/overlay-manager.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{literalSetConverter,optionalLiteralSetConverter}from"../../../internal/converters.js";import{normalizeReflectedOptionalSize,optionalSizeConverter}from"../../../internal/variants.js";import{contextualSizes}from"../../../internal/contextual-vocabulary.styles.js";import{variants}from"../../../internal/variants.styles.js";import{getToastRegion}from"../toast/toast-region.js";import{TOAST_REGION_ENQUEUE,TOAST_REGION_EVICT,TOAST_REGION_REJECT,TOAST_REGION_SET_ACTIVE,toastRegionControllerFor}from"../toast/toast-region-protocol.js";import{styles}from"./alert.styles.js";import{LYRA_DEFAULT_close}from"../../../internal/default-strings.generated.js";const ALERT_VARIANT=literalSetConverter(["neutral","primary","success","warning","danger"],"primary"),ALERT_COUNTDOWN=optionalLiteralSetConverter(["rtl","ltr"]);class LyraAlert extends LyraElement{static{this.defaultStrings={...super.defaultStrings,close:LYRA_DEFAULT_close}}static{this.styles=[LyraElement.styles,variants,contextualSizes,styles]}get open(){return this._open}set open(next){this.requestOpenState(!!next)}requestOpenState(normalized){if(normalized===this._open)return!0;if(this.openRequest)return this.openRequest.target===normalized;const repair=normalized?null:captureComposedFocusRepair(this,()=>nearestExternalFocusTarget(this));let request;if(this.hasUpdated){let resolve,reject;const completion=new Promise((resolveCompletion,rejectCompletion)=>{resolve=resolveCompletion,reject=rejectCompletion});if(request={target:normalized,completion,resolve,reject,settled:!1,cancelled:!1},this.openRequest=request,this.transitionPromise=completion,this.emit(normalized?"lr-show":"lr-hide",null,{cancelable:!0}).defaultPrevented)return this.toggleAttribute("open",this._open),this.openRequest===request&&(this.openRequest=void 0),this.cancelTransition(request),!1}this.transitionRequest&&this.cancelTransition(this.transitionRequest);const previous=this._open;return repair&&applyComposedFocusRepair(repair),this._open=normalized,this.requestUpdate("open",previous),request&&(this.openRequest===request&&(this.openRequest=void 0),this.transitionRequest=request,this.runTransition(request)),!0}get size(){return this._size}set size(next){const normalized=normalizeReflectedOptionalSize(this,next),old=this._size;old!==normalized&&(this._size=normalized,this.requestUpdate("size",old))}get countdown(){return this._countdown}set countdown(next){const normalized=ALERT_COUNTDOWN.normalizeReflected(this,"countdown",next),old=this._countdown;old!==normalized&&(this._countdown=normalized,this.requestUpdate("countdown",old))}get variant(){return this._variant}set variant(next){const normalized=ALERT_VARIANT.normalizeReflected(this,"variant",next),old=this._variant;old!==normalized&&(this._variant=normalized,this.requestUpdate("variant",old))}constructor(){super(),this.role="alert",this._open=!1,this.closable=!1,this.duration=1/0,this._variant="primary",this.slotPresence=new SlotPresenceController(this),this.transitionToken=0,this.transitionPromise=Promise.resolve(),this.hovering=!1,this.focused=!1,this.toastConnectionGeneration=0,this.toastLifecycleGeneration=0,this.toastRegionActive=!1,this.toastActivationStarted=!1,this.onPointerEnter=()=>{this.hovering=!0,this.clearAutoHide()},this.onPointerLeave=()=>{this.hovering=!1,this.focused||this.restartAutoHide()},this.onFocusIn=event=>{const previous=event.relatedTarget;previous?.nodeType===1&&!composedContains(this,previous)&&previous.isConnected&&(this.focusReturnTarget=previous);const activeElement=deepActiveElement(this.ownerDocument);this.pendingFocusRepair=activeElement&&typeof activeElement.focus=="function"?captureComposedFocusRepair(this,activeElement)??void 0:void 0,this.focused=!0,this.clearAutoHide()},this.onFocusOut=event=>{const next=event.relatedTarget;if(!(next!==null&&next.nodeType===1&&composedContains(this,next))){if(next===null){const parent=this.parentElement,clearIfStillOwned=()=>{this.isConnected&&this.parentElement===parent&&(this.pendingFocusRepair=void 0)},view=this.ownerDocument.defaultView;view?view.queueMicrotask(clearIfStillOwned):queueMicrotask(clearIfStillOwned)}else{const external=next;external.isConnected&&(this.focusReturnTarget=external),this.pendingFocusRepair=void 0}this.focused=!1,this.hovering||this.restartAutoHide()}},this.close=()=>{this.hide()},this.addEventListener("pointerenter",this.onPointerEnter),this.addEventListener("pointerleave",this.onPointerLeave),this.addEventListener("focusin",event=>this.onFocusIn(event)),this.addEventListener("focusout",event=>this.onFocusOut(event))}connectedCallback(){if(super.connectedCallback(),this.toastConnectionGeneration+=1,this.hasAttribute("role")||this.setAttribute("role","alert"),this.toastPromise){const currentController=toastRegionControllerFor(this);currentController&¤tController!==this.toastRegionOwner&¤tController[TOAST_REGION_ENQUEUE](this);const completion=this.toastPromise,generation=this.toastLifecycleGeneration,owner=this.toastRegionOwner;if(owner&&this.parentElement!==owner){const settleLostOwnership=()=>{this.toastPromise===completion&&this.toastLifecycleGeneration===generation&&this.parentElement!==owner&&this.finishToast()},view=this.ownerDocument.defaultView;view?view.queueMicrotask(settleLostOwnership):queueMicrotask(settleLostOwnership)}if(!this.toastRegionActive)return;this.beginToastActivation()}if(this.transitionRequest){this.runTransition(this.transitionRequest);return}if(!this.hasUpdated||!this.open)return;this.removeAttribute("data-alert-showing"),this.removeAttribute("data-alert-hiding");const ownerDocument=this.ownerDocument;ownerDocument.defaultView?.queueMicrotask(()=>{this.isConnected&&this.ownerDocument===ownerDocument&&this.open&&this.restartAutoHide()})}disconnectedCallback(){const activeElement=deepActiveElement(this.ownerDocument);!this.pendingFocusRepair&&activeElement&&typeof activeElement.focus=="function"&&(this.pendingFocusRepair=captureComposedFocusRepair(this,activeElement)??void 0);const toastConnectionGeneration=++this.toastConnectionGeneration,transitionBelongedToToast=!!this.toastPromise;this.transitionToken++,this.clearAutoHide(),this.removeAttribute("data-alert-showing"),this.removeAttribute("data-alert-hiding"),this.hovering=!1,this.focused=!1;const settleLastingToastDisconnect=()=>{toastConnectionGeneration===this.toastConnectionGeneration&&!this.isConnected&&this.toastPromise&&this.finishToast(),toastConnectionGeneration===this.toastConnectionGeneration&&!this.isConnected&&this.transitionRequest&&(transitionBelongedToToast?this.cancelTransition(this.transitionRequest):this.settleTransitionCompletion(this.transitionRequest))},view=this.ownerDocument.defaultView;view?view.queueMicrotask(settleLastingToastDisconnect):queueMicrotask(settleLastingToastDisconnect),super.disconnectedCallback()}firstUpdated(changed){super.firstUpdated(changed),this.open&&this.restartAutoHide()}updated(changed){super.updated(changed),this.open&&!changed.has("open")&&(changed.has("duration")||changed.has("countdown"))&&this.restartAutoHide()}async show(){this.hasUpdated||await this.updateComplete,this.open||this.requestOpenState(!0),await this.transitionPromise}async hide(){this.hasUpdated||await this.updateComplete,this.open&&this.requestOpenState(!1),await this.transitionPromise}toast(){if(this.toastPromise)return this.toastPromise;let resolveCompletion;const completion=new Promise(resolve=>{resolveCompletion=resolve});this.toastPromise=completion,this.toastResolve=resolveCompletion,this.toastLifecycleGeneration+=1,this.toastActivationStarted=!1;const onAfterHide=()=>{this.toastRegionOwner&&this.parentElement===this.toastRegionOwner&&this.remove(),this.finishToast()};this.toastAfterHide=onAfterHide,this.addEventListener("lr-after-hide",onAfterHide,{once:!0});const enqueue=()=>{if(this.toastPromise!==completion)return;const region=getToastRegion(void 0,this.ownerDocument),controller=region;typeof controller[TOAST_REGION_ENQUEUE]=="function"?controller[TOAST_REGION_ENQUEUE](this):(region.childElementCount===0&®ion.remove(),this.remove(),this.finishToast())};return this.ownerDocument.defaultView?.customElements.get(tag("toast"))?enqueue():import("../toast/toast.js").then(enqueue,enqueue),completion}[TOAST_REGION_SET_ACTIVE](owner,active){if(this.parentElement!==owner)return;let resolvedFocusTarget;const focusTarget=()=>(resolvedFocusTarget!==void 0||(resolvedFocusTarget=this.focusReturnTarget?.isConnected&&!composedContains(this,this.focusReturnTarget)?this.focusReturnTarget:nearestExternalFocusTarget(this)),resolvedFocusTarget),focusRepair=active?this.pendingFocusRepair:this.pendingFocusRepair??captureComposedFocusRepair(this,focusTarget),returnFocusTarget=!active&&focusRepair?focusTarget():null;this.toastRegionOwner=owner,this.toastRegionActive=active,this.toggleAttribute("data-toast-queued",!active);const base=this.base;base&&(base.hidden=!active,base.inert=!active),this.requestUpdate(),active?(focusRepair&&applyComposedFocusRepair(focusRepair),this.pendingFocusRepair=void 0,this.transitionRequest&&this.runTransition(this.transitionRequest),this.beginToastActivation()):(this.transitionToken+=1,focusRepair&&applyComposedFocusRepair(focusRepair,returnFocusTarget),this.pendingFocusRepair=void 0,this.clearAutoHide())}[TOAST_REGION_EVICT](owner,_reason){this.toastRegionOwner===owner&&(this.toastRegionOwner=void 0,this.toastRegionActive=!1,this.removeAttribute("data-toast-queued"),this.parentElement===owner&&this.remove(),this.finishToast())}beginToastActivation(){const completion=this.toastPromise,owner=this.toastRegionOwner;if(!completion||!owner||!this.toastRegionActive||this.toastActivationStarted)return;this.toastActivationStarted=!0;const generation=this.toastLifecycleGeneration;this.updateComplete.then(()=>{if(this.toastPromise!==completion||this.toastLifecycleGeneration!==generation||this.toastRegionOwner!==owner||!this.toastRegionActive||!this.isConnected||this.parentElement!==owner)return;if(this.open){this.restartAutoHide();return}if(!this.requestOpenState(!0))if(this.toastPromise===completion&&this.toastLifecycleGeneration===generation&&this.toastRegionOwner===owner&&this.parentElement===owner){const controller=owner;typeof controller[TOAST_REGION_REJECT]=="function"?controller[TOAST_REGION_REJECT](this):(this.parentElement===owner&&this.remove(),this.finishToast())}else this.toastPromise===completion&&this.finishToast()})}finishToast(){this.toastAfterHide&&this.removeEventListener("lr-after-hide",this.toastAfterHide);const resolve=this.toastResolve;if(this.toastAfterHide=void 0,this.toastResolve=void 0,this.toastPromise=void 0,this.toastRegionOwner=void 0,this.toastRegionActive=!1,this.toastActivationStarted=!1,this.toastLifecycleGeneration+=1,this.removeAttribute("data-toast-queued"),this.requestUpdate(),this.isConnected){const base=this.base;base&&(base.hidden=!1,base.inert=!1),this.pendingFocusRepair&&(applyComposedFocusRepair(this.pendingFocusRepair),this.pendingFocusRepair=void 0)}resolve?.()}settleTransitionCompletion(request){request.settled||(request.settled=!0,request.resolve())}cancelTransition(request){request.cancelled=!0,this.transitionRequest===request&&(this.transitionRequest=void 0),this.openRequest===request&&(this.openRequest=void 0),this.settleTransitionCompletion(request)}finishTransition(request){request.cancelled||(this.transitionRequest===request&&(this.transitionRequest=void 0),this.openRequest===request&&(this.openRequest=void 0),this.settleTransitionCompletion(request))}async runTransition(request){if(request.cancelled||this.transitionRequest!==request||this.toastPromise&&!this.toastRegionActive)return;const opening=request.target,token=++this.transitionToken;if(this.clearAutoHide(),opening)this.removeAttribute("data-alert-hiding"),this.setAttribute("data-alert-showing","");else{const base2=this.base;base2&&base2.offsetWidth,this.removeAttribute("data-alert-showing"),this.setAttribute("data-alert-hiding","")}if(await this.updateComplete,!this.isConnected||token!==this.transitionToken||this.transitionRequest!==request)return;const base=this.base;if(opening){if(base&&base.offsetWidth,await this.nextFrame(),!this.isConnected||token!==this.transitionToken||this.transitionRequest!==request)return;this.removeAttribute("data-alert-showing")}await this.waitForMotion(base),!(!this.isConnected||token!==this.transitionToken||this.transitionRequest!==request)&&(opening?(this.emit("lr-after-show"),this.restartAutoHide()):(this.removeAttribute("data-alert-hiding"),this.emit("lr-after-hide")),this.finishTransition(request))}get base(){return this.shadowRoot?.querySelector('[part="base"]')??null}nextFrame(){const view=this.ownerDocument.defaultView;return!view||prefersReducedMotion(this)?Promise.resolve():new Promise(resolve=>view.requestAnimationFrame(()=>resolve()))}async waitForMotion(base){const view=this.ownerDocument.defaultView;if(!base||!view||prefersReducedMotion(this))return;view.getComputedStyle(base).opacity;const animations=base.getAnimations({subtree:!0});await Promise.all(animations.map(animation=>animation.finished.catch(()=>{})))}get safeDuration(){return this.duration===1/0?1/0:finiteDuration(this.duration,0,0)}clearAutoHide(){this.timer!==void 0&&this.timerOwner?.clearTimeout(this.timer),this.timer=void 0,this.timerOwner=void 0,this.countdownAnimation?.cancel(),this.countdownAnimation=void 0}restartAutoHide(){if(this.clearAutoHide(),this.toastPromise&&!this.toastRegionActive||!this.open||this.hovering||this.focused)return;const duration=this.safeDuration;if(duration===1/0)return;if(duration<=0){const ownerDocument=this.ownerDocument;ownerDocument.defaultView?.queueMicrotask(()=>{this.isConnected&&this.ownerDocument===ownerDocument&&this.open&&!this.hovering&&!this.focused&&this.hide()});return}const view=this.ownerDocument.defaultView;view&&(this.timerOwner=view,this.timer=view.setTimeout(()=>{this.timer=void 0,this.timerOwner=void 0,this.hide()},duration),this.startCountdown(duration))}startCountdown(duration){if(prefersReducedMotion(this)||this.countdown!=="ltr"&&this.countdown!=="rtl")return;const indicator=this.shadowRoot?.querySelector(".countdown");indicator&&(this.countdownAnimation=indicator.animate([{transform:"scaleX(1)"},{transform:"scaleX(0)"}],{duration,easing:"linear",fill:"forwards"}))}render(){const hasCountdown=this.countdown==="ltr"||this.countdown==="rtl",countdownOrigin=this.countdown==="rtl"?"right center":"left center";return html`
|
|
1
|
+
import{__decorate}from"tslib";import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{closeIcon}from"../../../internal/icons.js";import{applyComposedFocusRepair,captureComposedFocusRepair,nearestExternalFocusTarget}from"../../../internal/focus-navigation.js";import{renderInertPresentation}from"../../../internal/inert-presentation.js";import{LyraElement}from"../../../internal/lyra-element.js";import{tag}from"../../../internal/prefix.js";import{prefersReducedMotion}from"../../../internal/motion.js";import{finiteDuration}from"../../../internal/numbers.js";import{composedContains,deepActiveElement}from"../../../internal/overlay-manager.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{optionalLiteralSetConverter}from"../../../internal/converters.js";import{normalizeReflectedOptionalSize,optionalSizeConverter}from"../../../internal/variants.js";import{contextualSizes}from"../../../internal/contextual-vocabulary.styles.js";import{semanticVariantConverter}from"../../../internal/semantic-variant.js";import{variants}from"../../../internal/variants.styles.js";import{getToastRegion}from"../toast/toast-region.js";import{TOAST_REGION_ENQUEUE,TOAST_REGION_EVICT,TOAST_REGION_REJECT,TOAST_REGION_SET_ACTIVE,toastRegionControllerFor}from"../toast/toast-region-protocol.js";import{styles}from"./alert.styles.js";import{LYRA_DEFAULT_close}from"../../../internal/default-strings.generated.js";const ALERT_VARIANT=semanticVariantConverter("primary"),ALERT_COUNTDOWN=optionalLiteralSetConverter(["rtl","ltr"]);class LyraAlert extends LyraElement{static{this.defaultStrings={...super.defaultStrings,close:LYRA_DEFAULT_close}}static{this.styles=[LyraElement.styles,variants,contextualSizes,styles]}get open(){return this._open}set open(next){this.requestOpenState(!!next)}requestOpenState(normalized){if(normalized===this._open)return!0;if(this.openRequest)return this.openRequest.target===normalized;const repair=normalized?null:captureComposedFocusRepair(this,()=>nearestExternalFocusTarget(this));let request;if(this.hasUpdated){let resolve,reject;const completion=new Promise((resolveCompletion,rejectCompletion)=>{resolve=resolveCompletion,reject=rejectCompletion});if(request={target:normalized,completion,resolve,reject,settled:!1,cancelled:!1},this.openRequest=request,this.transitionPromise=completion,this.emit(normalized?"lr-show":"lr-hide",null,{cancelable:!0}).defaultPrevented)return this.toggleAttribute("open",this._open),this.openRequest===request&&(this.openRequest=void 0),this.cancelTransition(request),!1}this.transitionRequest&&this.cancelTransition(this.transitionRequest);const previous=this._open;return repair&&applyComposedFocusRepair(repair),this._open=normalized,this.requestUpdate("open",previous),request&&(this.openRequest===request&&(this.openRequest=void 0),this.transitionRequest=request,this.runTransition(request)),!0}get size(){return this._size}set size(next){const normalized=normalizeReflectedOptionalSize(this,next),old=this._size;old!==normalized&&(this._size=normalized,this.requestUpdate("size",old))}get countdown(){return this._countdown}set countdown(next){const normalized=ALERT_COUNTDOWN.normalizeReflected(this,"countdown",next),old=this._countdown;old!==normalized&&(this._countdown=normalized,this.requestUpdate("countdown",old))}get variant(){return this._variant}set variant(next){const normalized=ALERT_VARIANT.normalizeReflected(this,"variant",next),old=this._variant;old!==normalized&&(this._variant=normalized,this.requestUpdate("variant",old))}constructor(){super(),this.role="alert",this._open=!1,this.closable=!1,this.duration=1/0,this._variant="primary",this.slotPresence=new SlotPresenceController(this),this.transitionToken=0,this.transitionPromise=Promise.resolve(),this.hovering=!1,this.focused=!1,this.toastConnectionGeneration=0,this.toastLifecycleGeneration=0,this.toastRegionActive=!1,this.toastActivationStarted=!1,this.onPointerEnter=()=>{this.hovering=!0,this.clearAutoHide()},this.onPointerLeave=()=>{this.hovering=!1,this.focused||this.restartAutoHide()},this.onFocusIn=event=>{const previous=event.relatedTarget;previous?.nodeType===1&&!composedContains(this,previous)&&previous.isConnected&&(this.focusReturnTarget=previous);const activeElement=deepActiveElement(this.ownerDocument);this.pendingFocusRepair=activeElement&&typeof activeElement.focus=="function"?captureComposedFocusRepair(this,activeElement)??void 0:void 0,this.focused=!0,this.clearAutoHide()},this.onFocusOut=event=>{const next=event.relatedTarget;if(!(next!==null&&next.nodeType===1&&composedContains(this,next))){if(next===null){const parent=this.parentElement,clearIfStillOwned=()=>{this.isConnected&&this.parentElement===parent&&(this.pendingFocusRepair=void 0)},view=this.ownerDocument.defaultView;view?view.queueMicrotask(clearIfStillOwned):queueMicrotask(clearIfStillOwned)}else{const external=next;external.isConnected&&(this.focusReturnTarget=external),this.pendingFocusRepair=void 0}this.focused=!1,this.hovering||this.restartAutoHide()}},this.close=()=>{this.hide()},this.addEventListener("pointerenter",this.onPointerEnter),this.addEventListener("pointerleave",this.onPointerLeave),this.addEventListener("focusin",event=>this.onFocusIn(event)),this.addEventListener("focusout",event=>this.onFocusOut(event))}connectedCallback(){if(super.connectedCallback(),this.toastConnectionGeneration+=1,this.hasAttribute("role")||this.setAttribute("role","alert"),this.toastPromise){const currentController=toastRegionControllerFor(this);currentController&¤tController!==this.toastRegionOwner&¤tController[TOAST_REGION_ENQUEUE](this);const completion=this.toastPromise,generation=this.toastLifecycleGeneration,owner=this.toastRegionOwner;if(owner&&this.parentElement!==owner){const settleLostOwnership=()=>{this.toastPromise===completion&&this.toastLifecycleGeneration===generation&&this.parentElement!==owner&&this.finishToast()},view=this.ownerDocument.defaultView;view?view.queueMicrotask(settleLostOwnership):queueMicrotask(settleLostOwnership)}if(!this.toastRegionActive)return;this.beginToastActivation()}if(this.transitionRequest){this.runTransition(this.transitionRequest);return}if(!this.hasUpdated||!this.open)return;this.removeAttribute("data-alert-showing"),this.removeAttribute("data-alert-hiding");const ownerDocument=this.ownerDocument;ownerDocument.defaultView?.queueMicrotask(()=>{this.isConnected&&this.ownerDocument===ownerDocument&&this.open&&this.restartAutoHide()})}disconnectedCallback(){const activeElement=deepActiveElement(this.ownerDocument);!this.pendingFocusRepair&&activeElement&&typeof activeElement.focus=="function"&&(this.pendingFocusRepair=captureComposedFocusRepair(this,activeElement)??void 0);const toastConnectionGeneration=++this.toastConnectionGeneration,transitionBelongedToToast=!!this.toastPromise;this.transitionToken++,this.clearAutoHide(),this.removeAttribute("data-alert-showing"),this.removeAttribute("data-alert-hiding"),this.hovering=!1,this.focused=!1;const settleLastingToastDisconnect=()=>{toastConnectionGeneration===this.toastConnectionGeneration&&!this.isConnected&&this.toastPromise&&this.finishToast(),toastConnectionGeneration===this.toastConnectionGeneration&&!this.isConnected&&this.transitionRequest&&(transitionBelongedToToast?this.cancelTransition(this.transitionRequest):this.settleTransitionCompletion(this.transitionRequest))},view=this.ownerDocument.defaultView;view?view.queueMicrotask(settleLastingToastDisconnect):queueMicrotask(settleLastingToastDisconnect),super.disconnectedCallback()}firstUpdated(changed){super.firstUpdated(changed),this.open&&this.restartAutoHide()}updated(changed){super.updated(changed),this.open&&!changed.has("open")&&(changed.has("duration")||changed.has("countdown"))&&this.restartAutoHide()}async show(){this.hasUpdated||await this.updateComplete,this.open||this.requestOpenState(!0),await this.transitionPromise}async hide(){this.hasUpdated||await this.updateComplete,this.open&&this.requestOpenState(!1),await this.transitionPromise}toast(){if(this.toastPromise)return this.toastPromise;let resolveCompletion;const completion=new Promise(resolve=>{resolveCompletion=resolve});this.toastPromise=completion,this.toastResolve=resolveCompletion,this.toastLifecycleGeneration+=1,this.toastActivationStarted=!1;const onAfterHide=()=>{this.toastRegionOwner&&this.parentElement===this.toastRegionOwner&&this.remove(),this.finishToast()};this.toastAfterHide=onAfterHide,this.addEventListener("lr-after-hide",onAfterHide,{once:!0});const enqueue=()=>{if(this.toastPromise!==completion)return;const region=getToastRegion(void 0,this.ownerDocument),controller=region;typeof controller[TOAST_REGION_ENQUEUE]=="function"?controller[TOAST_REGION_ENQUEUE](this):(region.childElementCount===0&®ion.remove(),this.remove(),this.finishToast())};return this.ownerDocument.defaultView?.customElements.get(tag("toast"))?enqueue():import("../toast/toast.js").then(enqueue,enqueue),completion}[TOAST_REGION_SET_ACTIVE](owner,active){if(this.parentElement!==owner)return;let resolvedFocusTarget;const focusTarget=()=>(resolvedFocusTarget!==void 0||(resolvedFocusTarget=this.focusReturnTarget?.isConnected&&!composedContains(this,this.focusReturnTarget)?this.focusReturnTarget:nearestExternalFocusTarget(this)),resolvedFocusTarget),focusRepair=active?this.pendingFocusRepair:this.pendingFocusRepair??captureComposedFocusRepair(this,focusTarget),returnFocusTarget=!active&&focusRepair?focusTarget():null;this.toastRegionOwner=owner,this.toastRegionActive=active,this.toggleAttribute("data-toast-queued",!active);const base=this.base;base&&(base.hidden=!active,base.inert=!active),this.requestUpdate(),active?(focusRepair&&applyComposedFocusRepair(focusRepair),this.pendingFocusRepair=void 0,this.transitionRequest&&this.runTransition(this.transitionRequest),this.beginToastActivation()):(this.transitionToken+=1,focusRepair&&applyComposedFocusRepair(focusRepair,returnFocusTarget),this.pendingFocusRepair=void 0,this.clearAutoHide())}[TOAST_REGION_EVICT](owner,_reason){this.toastRegionOwner===owner&&(this.toastRegionOwner=void 0,this.toastRegionActive=!1,this.removeAttribute("data-toast-queued"),this.parentElement===owner&&this.remove(),this.finishToast())}beginToastActivation(){const completion=this.toastPromise,owner=this.toastRegionOwner;if(!completion||!owner||!this.toastRegionActive||this.toastActivationStarted)return;this.toastActivationStarted=!0;const generation=this.toastLifecycleGeneration;this.updateComplete.then(()=>{if(this.toastPromise!==completion||this.toastLifecycleGeneration!==generation||this.toastRegionOwner!==owner||!this.toastRegionActive||!this.isConnected||this.parentElement!==owner)return;if(this.open){this.restartAutoHide();return}if(!this.requestOpenState(!0))if(this.toastPromise===completion&&this.toastLifecycleGeneration===generation&&this.toastRegionOwner===owner&&this.parentElement===owner){const controller=owner;typeof controller[TOAST_REGION_REJECT]=="function"?controller[TOAST_REGION_REJECT](this):(this.parentElement===owner&&this.remove(),this.finishToast())}else this.toastPromise===completion&&this.finishToast()})}finishToast(){this.toastAfterHide&&this.removeEventListener("lr-after-hide",this.toastAfterHide);const resolve=this.toastResolve;if(this.toastAfterHide=void 0,this.toastResolve=void 0,this.toastPromise=void 0,this.toastRegionOwner=void 0,this.toastRegionActive=!1,this.toastActivationStarted=!1,this.toastLifecycleGeneration+=1,this.removeAttribute("data-toast-queued"),this.requestUpdate(),this.isConnected){const base=this.base;base&&(base.hidden=!1,base.inert=!1),this.pendingFocusRepair&&(applyComposedFocusRepair(this.pendingFocusRepair),this.pendingFocusRepair=void 0)}resolve?.()}settleTransitionCompletion(request){request.settled||(request.settled=!0,request.resolve())}cancelTransition(request){request.cancelled=!0,this.transitionRequest===request&&(this.transitionRequest=void 0),this.openRequest===request&&(this.openRequest=void 0),this.settleTransitionCompletion(request)}finishTransition(request){request.cancelled||(this.transitionRequest===request&&(this.transitionRequest=void 0),this.openRequest===request&&(this.openRequest=void 0),this.settleTransitionCompletion(request))}async runTransition(request){if(request.cancelled||this.transitionRequest!==request||this.toastPromise&&!this.toastRegionActive)return;const opening=request.target,token=++this.transitionToken;if(this.clearAutoHide(),opening)this.removeAttribute("data-alert-hiding"),this.setAttribute("data-alert-showing","");else{const base2=this.base;base2&&base2.offsetWidth,this.removeAttribute("data-alert-showing"),this.setAttribute("data-alert-hiding","")}if(await this.updateComplete,!this.isConnected||token!==this.transitionToken||this.transitionRequest!==request)return;const base=this.base;if(opening){if(base&&base.offsetWidth,await this.nextFrame(),!this.isConnected||token!==this.transitionToken||this.transitionRequest!==request)return;this.removeAttribute("data-alert-showing")}await this.waitForMotion(base),!(!this.isConnected||token!==this.transitionToken||this.transitionRequest!==request)&&(opening?(this.emit("lr-after-show"),this.restartAutoHide()):(this.removeAttribute("data-alert-hiding"),this.emit("lr-after-hide")),this.finishTransition(request))}get base(){return this.shadowRoot?.querySelector('[part="base"]')??null}nextFrame(){const view=this.ownerDocument.defaultView;return!view||prefersReducedMotion(this)?Promise.resolve():new Promise(resolve=>view.requestAnimationFrame(()=>resolve()))}async waitForMotion(base){const view=this.ownerDocument.defaultView;if(!base||!view||prefersReducedMotion(this))return;view.getComputedStyle(base).opacity;const animations=base.getAnimations({subtree:!0});await Promise.all(animations.map(animation=>animation.finished.catch(()=>{})))}get safeDuration(){return this.duration===1/0?1/0:finiteDuration(this.duration,0,0)}clearAutoHide(){this.timer!==void 0&&this.timerOwner?.clearTimeout(this.timer),this.timer=void 0,this.timerOwner=void 0,this.countdownAnimation?.cancel(),this.countdownAnimation=void 0}restartAutoHide(){if(this.clearAutoHide(),this.toastPromise&&!this.toastRegionActive||!this.open||this.hovering||this.focused)return;const duration=this.safeDuration;if(duration===1/0)return;if(duration<=0){const ownerDocument=this.ownerDocument;ownerDocument.defaultView?.queueMicrotask(()=>{this.isConnected&&this.ownerDocument===ownerDocument&&this.open&&!this.hovering&&!this.focused&&this.hide()});return}const view=this.ownerDocument.defaultView;view&&(this.timerOwner=view,this.timer=view.setTimeout(()=>{this.timer=void 0,this.timerOwner=void 0,this.hide()},duration),this.startCountdown(duration))}startCountdown(duration){if(prefersReducedMotion(this)||this.countdown!=="ltr"&&this.countdown!=="rtl")return;const indicator=this.shadowRoot?.querySelector(".countdown");indicator&&(this.countdownAnimation=indicator.animate([{transform:"scaleX(1)"},{transform:"scaleX(0)"}],{duration,easing:"linear",fill:"forwards"}))}render(){const hasCountdown=this.countdown==="ltr"||this.countdown==="rtl",countdownOrigin=this.countdown==="rtl"?"right center":"left center";return html`
|
|
2
2
|
<div
|
|
3
3
|
part="base"
|
|
4
4
|
?hidden=${!!(this.toastPromise&&!this.toastRegionActive)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement,type LyraEventMap}from'../../../internal/lyra-element.js';import{type LyraAppearance,type LyraSize,type LyraSizeStep,type LyraVariant}from'../../../internal/variants.js';
|
|
1
|
+
import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement,type LyraEventMap}from'../../../internal/lyra-element.js';import{type LyraAppearance,type LyraSize,type LyraSizeStep,type LyraVariant}from'../../../internal/variants.js';import{type SemanticVariant}from'../../../internal/semantic-variant.js';
|
|
2
2
|
/** The library's semantic-tone vocabulary plus Shoelace's spelling for the brand tone. */
|
|
3
|
-
export type BadgeVariant=
|
|
3
|
+
export type BadgeVariant=SemanticVariant;
|
|
4
4
|
/** The library's one size ladder, including both upstream long-form spellings. */
|
|
5
5
|
export type BadgeSize=LyraSize;
|
|
6
6
|
/** Visual treatment of a labelled surface: how much of the variant palette is spent on fill,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{normalizeSize}from"../../../internal/variants.js";import{variants}from"../../../internal/variants.styles.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{styles}from"./badge.styles.js";class LyraBadge extends LyraElement{constructor(){super(...arguments),this.variant="neutral",this.size="m",this.appearance="filled-outlined",this.pill=!1,this.attention="none",this.pulse=!1,this.slotPresence=new SlotPresenceController(this)}static{this.styles=[LyraElement.styles,variants,styles]}get effectiveVariant(){
|
|
1
|
+
import{__decorate}from"tslib";import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{normalizeSize}from"../../../internal/variants.js";import{effectiveSemanticVariant}from"../../../internal/semantic-variant.js";import{variants}from"../../../internal/variants.styles.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{styles}from"./badge.styles.js";class LyraBadge extends LyraElement{constructor(){super(...arguments),this.variant="neutral",this.size="m",this.appearance="filled-outlined",this.pill=!1,this.attention="none",this.pulse=!1,this.slotPresence=new SlotPresenceController(this)}static{this.styles=[LyraElement.styles,variants,styles]}get effectiveVariant(){return effectiveSemanticVariant(this.variant)}get effectiveSize(){const value=this.size;return["2xs","xs","s","m","l","xl","small","medium","large"].includes(value)?normalizeSize(value):"m"}willUpdate(changed){super.willUpdate(changed),this.setAttribute("data-effective-variant",this.effectiveVariant),this.setAttribute("data-effective-size",this.effectiveSize)}renderTrailing(){return nothing}render(){return html`<span part="base badge">
|
|
2
2
|
<span part="start" ?hidden=${!this.slotPresence.has("start")}>
|
|
3
3
|
<slot name="start"></slot>
|
|
4
4
|
</span>
|
|
@@ -37,7 +37,9 @@ export type TagVariant=BadgeVariant|'text';
|
|
|
37
37
|
export declare class LyraTag extends LyraBadge<LyraTagEventMap,TagVariant>{static styles:import("lit").CSSResultGroup[];static properties:{withRemove:{attribute:string;type:BooleanConstructor;noAccessor:boolean;};removable:{attribute:string;type:BooleanConstructor;noAccessor:boolean;};};protected get effectiveVariant():LyraVariant;
|
|
38
38
|
/** Opaque consumer bookkeeping value, echoed verbatim in `lr-remove`'s detail (`undefined` when
|
|
39
39
|
* never set) -- never read, validated or rendered by the tag itself. */
|
|
40
|
-
value?:string;
|
|
40
|
+
value?:string;
|
|
41
|
+
/** Disables the remove button and suppresses `lr-remove`; a plain tag has no action to gate. */
|
|
42
|
+
disabled:boolean;private removeEnabled;private changingRemoveAliasAttribute;
|
|
41
43
|
/** Renders the remove affordance. Either mirrored attribute enables the shared state; assigning
|
|
42
44
|
* false through either property clears both attributes so the write reads back truthfully. */
|
|
43
45
|
get withRemove():boolean;set withRemove(next:boolean);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{AccessibleTextController}from"../../../internal/accessible-text-controller.js";import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{composedAccessibilityText,isAccessibilitySubtreeExcluded}from"../../../internal/accessibility-visibility.js";import{applyComposedFocusRepair,captureComposedFocusRepair,nearestExternalFocusTarget}from"../../../internal/focus-navigation.js";import{LyraElement}from"../../../internal/lyra-element.js";import{closeIcon}from"../../../internal/icons.js";import{variants}from"../../../internal/variants.styles.js";import{LyraBadge}from"./badge.class.js";import{styles as badgeStyles}from"./badge.styles.js";import{styles as tagStyles}from"./tag.styles.js";import{LYRA_DEFAULT_remove,LYRA_DEFAULT_removeWithContext}from"../../../internal/default-strings.generated.js";function sourceParent(node){if(node.parentElement)return node.parentElement;const root=node.getRootNode();return"host"in root?root.host:null}function isClosedSourceDetailsBranch(details,branch){return details.localName!=="details"||details.hasAttribute("open")||branch===null?!1:Array.from(details.children).find(child=>child.localName==="summary")!==branch}function isSourceLabelAvailable(node){const target=node.nodeType===1?node:sourceParent(node);if(!target?.isConnected)return!1;let branch=target,current=sourceParent(target);if(isAccessibilitySubtreeExcluded(target))return!1;for(;current;){if(isAccessibilitySubtreeExcluded(current)||isClosedSourceDetailsBranch(current,branch))return!1;branch=current,current=sourceParent(current)}return!0}class LyraTag extends LyraBadge{constructor(){super(...arguments),this.removeEnabled=!1,this.changingRemoveAliasAttribute=!1,this.labelTextObserver=new AccessibleTextController(this,[""],()=>{this.syncHostActionRole(),this.updateBrowserDerivedState(()=>this.recomputeLabelText())},["slot","role"],!1),this.managedActionGroupRole=!1,this.labelText="",this.onLabelSlotChange=event=>{const target=event.target;target?.nodeType!==1||target.localName!=="slot"||(this.labelTextObserver.bind(),this.withRemove&&this.updateBrowserDerivedState(()=>this.recomputeLabelText()))},this.onRemoveClick=()=>{if(!this.withRemove)return;const repair=captureComposedFocusRepair(this,()=>nearestExternalFocusTarget(this));this.emit("lr-remove",{value:this.value}),repair&&(!this.isConnected||!this.withRemove)&&applyComposedFocusRepair(repair)}}static{this.defaultStrings={...super.defaultStrings,remove:LYRA_DEFAULT_remove,removeWithContext:LYRA_DEFAULT_removeWithContext}}static{this.styles=[LyraElement.styles,variants,badgeStyles,tagStyles]}static{this.properties={withRemove:{attribute:"with-remove",type:Boolean,noAccessor:!0},removable:{attribute:"removable",type:Boolean,noAccessor:!0}}}get effectiveVariant(){return this.variant==="text"?"neutral":super.effectiveVariant}get withRemove(){return this.removeEnabled}set withRemove(next){this.setRemoveEnabled(!!next,"with-remove")}get removable(){return this.removeEnabled}set removable(next){this.setRemoveEnabled(!!next,"removable")}attributeChangedCallback(name,oldValue,value){const isRemoveAlias=name==="with-remove"||name==="removable";isRemoveAlias&&(this.changingRemoveAliasAttribute=!0);try{super.attributeChangedCallback(name,oldValue,value)}finally{isRemoveAlias&&(this.changingRemoveAliasAttribute=!1)}}setRemoveEnabled(next,preferredAttribute){const old=this.removeEnabled;this.changingRemoveAliasAttribute?this.removeEnabled=this.hasAttribute("with-remove")||this.hasAttribute("removable"):next?(this.setAttribute(preferredAttribute,""),this.removeEnabled=!0):(this.removeAttribute("with-remove"),this.removeAttribute("removable"),this.removeEnabled=!1),old!==this.removeEnabled&&(this.requestUpdate("withRemove",old),this.requestUpdate("removable",old))}connectedCallback(){super.connectedCallback(),this.addEventListener("slotchange",this.onLabelSlotChange),this.syncLabelObserver(),this.hasUpdated?(this.withRemove&&this.recomputeLabelText(!0),this.ownerDocument.defaultView?.queueMicrotask(()=>{this.isConnected&&this.withRemove&&this.recomputeLabelText()})):this.seedFirstRenderState(()=>this.recomputeLabelText(!0))}disconnectedCallback(){this.removeEventListener("slotchange",this.onLabelSlotChange),this.releaseHostActionRole(),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.labelTextObserver.adopted()}syncLabelObserver(){this.labelTextObserver.setEnabled(this.withRemove)}recomputeLabelText(preferLightDom=!1){const slot=this.renderRoot?.querySelector("slot:not([name])"),lightDomNodes=this.childNodes,nodes=slot?slot.assignedNodes({flatten:!0}):Array.from(lightDomNodes??[]).filter(node=>{if(node.nodeType!==1)return!0;const slotName=node.getAttribute("slot");return slotName!=="start"&&slotName!=="end"});this.labelText=nodes.map(node=>composedAccessibilityText(node,{ancestorBoundary:this,isSubtreeExcluded:element=>element.getRootNode()===this.renderRoot&&element.getAttribute("part")?.split(/\s+/).includes("content")?!1:isAccessibilitySubtreeExcluded(element),requireRendered:preferLightDom?!1:node.nodeType!==1||node.localName!=="slot",shouldPruneNode:candidate=>!this.contains(candidate)&&!isSourceLabelAvailable(candidate),ignoreInheritedVisibility:!0})).join(" ").replace(/\s+/g," ").trim()}get accessibleRemoveLabel(){const text=this.labelText;return text?this.localize("removeWithContext",void 0,{label:text}):this.localize("remove")}focus(options){this.withRemove&&this.removeButtonEl?.focus(options)}blur(){this.removeButtonEl?.blur()}click(){if(!this.withRemove){super.click();return}this.removeButtonEl?.click()}willUpdate(changed){if(super.willUpdate(changed),changed.has("withRemove")){if(!this.withRemove){const repair=captureComposedFocusRepair(this,()=>nearestExternalFocusTarget(this));repair&&applyComposedFocusRepair(repair)}this.syncLabelObserver(),this.withRemove&&this.hasUpdated&&this.recomputeLabelText()}}updated(changed){super.updated(changed),this.syncHostActionRole()}syncHostActionRole(){const needsGroup=this.withRemove&&this.hasAttribute("aria-label");needsGroup&&!this.hasAttribute("role")?(this.setAttribute("role","group"),this.managedActionGroupRole=!0):needsGroup||this.releaseHostActionRole()}releaseHostActionRole(){this.managedActionGroupRole&&this.getAttribute("role")==="group"&&this.removeAttribute("role"),this.managedActionGroupRole=!1}renderTrailing(){return this.withRemove?html`<button
|
|
1
|
+
import{__decorate}from"tslib";import{AccessibleTextController}from"../../../internal/accessible-text-controller.js";import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{composedAccessibilityText,isAccessibilitySubtreeExcluded}from"../../../internal/accessibility-visibility.js";import{applyComposedFocusRepair,captureComposedFocusRepair,nearestExternalFocusTarget}from"../../../internal/focus-navigation.js";import{LyraElement}from"../../../internal/lyra-element.js";import{closeIcon}from"../../../internal/icons.js";import{variants}from"../../../internal/variants.styles.js";import{LyraBadge}from"./badge.class.js";import{styles as badgeStyles}from"./badge.styles.js";import{styles as tagStyles}from"./tag.styles.js";import{LYRA_DEFAULT_remove,LYRA_DEFAULT_removeWithContext}from"../../../internal/default-strings.generated.js";function sourceParent(node){if(node.parentElement)return node.parentElement;const root=node.getRootNode();return"host"in root?root.host:null}function isClosedSourceDetailsBranch(details,branch){return details.localName!=="details"||details.hasAttribute("open")||branch===null?!1:Array.from(details.children).find(child=>child.localName==="summary")!==branch}function isSourceLabelAvailable(node){const target=node.nodeType===1?node:sourceParent(node);if(!target?.isConnected)return!1;let branch=target,current=sourceParent(target);if(isAccessibilitySubtreeExcluded(target))return!1;for(;current;){if(isAccessibilitySubtreeExcluded(current)||isClosedSourceDetailsBranch(current,branch))return!1;branch=current,current=sourceParent(current)}return!0}class LyraTag extends LyraBadge{constructor(){super(...arguments),this.disabled=!1,this.removeEnabled=!1,this.changingRemoveAliasAttribute=!1,this.labelTextObserver=new AccessibleTextController(this,[""],()=>{this.syncHostActionRole(),this.updateBrowserDerivedState(()=>this.recomputeLabelText())},["slot","role"],!1),this.managedActionGroupRole=!1,this.labelText="",this.onLabelSlotChange=event=>{const target=event.target;target?.nodeType!==1||target.localName!=="slot"||(this.labelTextObserver.bind(),this.withRemove&&this.updateBrowserDerivedState(()=>this.recomputeLabelText()))},this.onRemoveClick=()=>{if(!this.withRemove||this.disabled)return;const repair=captureComposedFocusRepair(this,()=>nearestExternalFocusTarget(this));this.emit("lr-remove",{value:this.value}),repair&&(!this.isConnected||!this.withRemove)&&applyComposedFocusRepair(repair)}}static{this.defaultStrings={...super.defaultStrings,remove:LYRA_DEFAULT_remove,removeWithContext:LYRA_DEFAULT_removeWithContext}}static{this.styles=[LyraElement.styles,variants,badgeStyles,tagStyles]}static{this.properties={withRemove:{attribute:"with-remove",type:Boolean,noAccessor:!0},removable:{attribute:"removable",type:Boolean,noAccessor:!0}}}get effectiveVariant(){return this.variant==="text"?"neutral":super.effectiveVariant}get withRemove(){return this.removeEnabled}set withRemove(next){this.setRemoveEnabled(!!next,"with-remove")}get removable(){return this.removeEnabled}set removable(next){this.setRemoveEnabled(!!next,"removable")}attributeChangedCallback(name,oldValue,value){const isRemoveAlias=name==="with-remove"||name==="removable";isRemoveAlias&&(this.changingRemoveAliasAttribute=!0);try{super.attributeChangedCallback(name,oldValue,value)}finally{isRemoveAlias&&(this.changingRemoveAliasAttribute=!1)}}setRemoveEnabled(next,preferredAttribute){const old=this.removeEnabled;this.changingRemoveAliasAttribute?this.removeEnabled=this.hasAttribute("with-remove")||this.hasAttribute("removable"):next?(this.setAttribute(preferredAttribute,""),this.removeEnabled=!0):(this.removeAttribute("with-remove"),this.removeAttribute("removable"),this.removeEnabled=!1),old!==this.removeEnabled&&(this.requestUpdate("withRemove",old),this.requestUpdate("removable",old))}connectedCallback(){super.connectedCallback(),this.addEventListener("slotchange",this.onLabelSlotChange),this.syncLabelObserver(),this.hasUpdated?(this.withRemove&&this.recomputeLabelText(!0),this.ownerDocument.defaultView?.queueMicrotask(()=>{this.isConnected&&this.withRemove&&this.recomputeLabelText()})):this.seedFirstRenderState(()=>this.recomputeLabelText(!0))}disconnectedCallback(){this.removeEventListener("slotchange",this.onLabelSlotChange),this.releaseHostActionRole(),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.labelTextObserver.adopted()}syncLabelObserver(){this.labelTextObserver.setEnabled(this.withRemove)}recomputeLabelText(preferLightDom=!1){const slot=this.renderRoot?.querySelector("slot:not([name])"),lightDomNodes=this.childNodes,nodes=slot?slot.assignedNodes({flatten:!0}):Array.from(lightDomNodes??[]).filter(node=>{if(node.nodeType!==1)return!0;const slotName=node.getAttribute("slot");return slotName!=="start"&&slotName!=="end"});this.labelText=nodes.map(node=>composedAccessibilityText(node,{ancestorBoundary:this,isSubtreeExcluded:element=>element.getRootNode()===this.renderRoot&&element.getAttribute("part")?.split(/\s+/).includes("content")?!1:isAccessibilitySubtreeExcluded(element),requireRendered:preferLightDom?!1:node.nodeType!==1||node.localName!=="slot",shouldPruneNode:candidate=>!this.contains(candidate)&&!isSourceLabelAvailable(candidate),ignoreInheritedVisibility:!0})).join(" ").replace(/\s+/g," ").trim()}get accessibleRemoveLabel(){const text=this.labelText;return text?this.localize("removeWithContext",void 0,{label:text}):this.localize("remove")}focus(options){this.withRemove&&this.removeButtonEl?.focus(options)}blur(){this.removeButtonEl?.blur()}click(){if(!this.withRemove){super.click();return}this.removeButtonEl?.click()}willUpdate(changed){if(super.willUpdate(changed),changed.has("withRemove")){if(!this.withRemove){const repair=captureComposedFocusRepair(this,()=>nearestExternalFocusTarget(this));repair&&applyComposedFocusRepair(repair)}this.syncLabelObserver(),this.withRemove&&this.hasUpdated&&this.recomputeLabelText()}}updated(changed){super.updated(changed),this.syncHostActionRole()}syncHostActionRole(){const needsGroup=this.withRemove&&this.hasAttribute("aria-label");needsGroup&&!this.hasAttribute("role")?(this.setAttribute("role","group"),this.managedActionGroupRole=!0):needsGroup||this.releaseHostActionRole()}releaseHostActionRole(){this.managedActionGroupRole&&this.getAttribute("role")==="group"&&this.removeAttribute("role"),this.managedActionGroupRole=!1}renderTrailing(){return this.withRemove?html`<button
|
|
2
2
|
part="remove-button remove-button__base"
|
|
3
3
|
type="button"
|
|
4
|
+
?disabled=${this.disabled}
|
|
4
5
|
aria-label=${this.accessibleRemoveLabel}
|
|
5
6
|
@click=${this.onRemoveClick}
|
|
6
7
|
>
|
|
7
8
|
${closeIcon()}
|
|
8
|
-
</button>`:nothing}}__decorate([property()],LyraTag.prototype,"value",void 0),__decorate([state()],LyraTag.prototype,"labelText",void 0),__decorate([query('[part~="remove-button"]')],LyraTag.prototype,"removeButtonEl",void 0);export{LyraTag};
|
|
9
|
+
</button>`:nothing}}__decorate([property()],LyraTag.prototype,"value",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraTag.prototype,"disabled",void 0),__decorate([state()],LyraTag.prototype,"labelText",void 0),__decorate([query('[part~="remove-button"]')],LyraTag.prototype,"removeButtonEl",void 0);export{LyraTag};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{iconHitTarget,focusRing}from"../../../internal/interactive-control.styles.js";import{css}from"lit";const styles=css` :host { --_lr-tag-remove-radius: var(--lr-badge-radius, var(--_lr-badge-radius)); --_lr-tag-remove-hover-background: color-mix(in srgb, currentColor 16%, transparent); } :host([with-remove]) [part~='base'] { min-block-size: max(var(--lr-badge-min-height, var(--_lr-badge-min-height)), var(--lr-icon-button-size)); } :host([variant='text']) { --_lr-badge-fill: transparent; --_lr-badge-stroke: transparent; --_lr-badge-text: var(--lr-badge-ink, var(--_lr-badge-ink)); } [part~='remove-button'] { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; ${iconHitTarget} margin: 0; padding: 0; border: none; border-radius: var(--lr-tag-remove-radius, var(--_lr-tag-remove-radius)); background: transparent; color: inherit; font: inherit; font-size: var(--lr-size-0-75em); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--lr-transition-fast); } [part~='remove-button']:hover { background: var(--lr-tag-remove-hover-bg, var(--_lr-tag-remove-hover-background)); } [part~='remove-button']:active { background: color-mix(in srgb, currentColor var(--lr-color-mix-active), var(--lr-tag-remove-hover-bg, var(--_lr-tag-remove-hover-background))); } [part~='remove-button']:focus-visible { ${focusRing} } [part~='remove-button'] svg { display: block; } @media (prefers-reduced-motion: reduce) { [part~='remove-button'] { transition: none !important; } } `;export{styles};
|
|
1
|
+
import{iconHitTarget,focusRing}from"../../../internal/interactive-control.styles.js";import{css}from"lit";const styles=css` :host { --_lr-tag-remove-radius: var(--lr-badge-radius, var(--_lr-badge-radius)); --_lr-tag-remove-hover-background: color-mix(in srgb, currentColor 16%, transparent); } :host([with-remove]) [part~='base'] { min-block-size: max(var(--lr-badge-min-height, var(--_lr-badge-min-height)), var(--lr-icon-button-size)); } :host([variant='text']) { --_lr-badge-fill: transparent; --_lr-badge-stroke: transparent; --_lr-badge-text: var(--lr-badge-ink, var(--_lr-badge-ink)); } [part~='remove-button'] { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; ${iconHitTarget} margin: 0; padding: 0; border: none; border-radius: var(--lr-tag-remove-radius, var(--_lr-tag-remove-radius)); background: transparent; color: inherit; font: inherit; font-size: var(--lr-size-0-75em); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--lr-transition-fast); } [part~='remove-button']:not(:disabled):hover { background: var(--lr-tag-remove-hover-bg, var(--_lr-tag-remove-hover-background)); } [part~='remove-button']:not(:disabled):active { background: color-mix(in srgb, currentColor var(--lr-color-mix-active), var(--lr-tag-remove-hover-bg, var(--_lr-tag-remove-hover-background))); } [part~='remove-button']:focus-visible { ${focusRing} } [part~='remove-button']:disabled { cursor: not-allowed; opacity: var(--lr-opacity-disabled); } [part~='remove-button'] svg { display: block; } @media (prefers-reduced-motion: reduce) { [part~='remove-button'] { transition: none !important; } } `;export{styles};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type LyraHeadingLevel}from'../../../internal/heading-level.js';import type{LyraAppearance,LyraSize
|
|
1
|
+
import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type LyraHeadingLevel}from'../../../internal/heading-level.js';import type{LyraAppearance,LyraSize}from'../../../internal/variants.js';import{type SemanticVariant}from'../../../internal/semantic-variant.js';
|
|
2
2
|
/** The library's one semantic-tone vocabulary. */
|
|
3
|
-
export type CalloutVariant=
|
|
3
|
+
export type CalloutVariant=SemanticVariant;
|
|
4
4
|
/** The library's shared fill/border treatment vocabulary. */
|
|
5
5
|
export type CalloutAppearance=LyraAppearance;
|
|
6
6
|
/** The library's one size ladder, in either spelling. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{composedParentElement}from"../../../internal/active-element.js";import{closeIcon}from"../../../internal/icons.js";import{isAccessibilityVisible}from"../../../internal/accessibility-visibility.js";import{AnnouncementUpgradeObserver}from"../../../internal/announcement-text.js";import{applyComposedFocusRepair,captureComposedFocusRepair,nearestExternalFocusTarget}from"../../../internal/focus-navigation.js";import{LyraElement}from"../../../internal/lyra-element.js";import{resolveHeadingLevel}from"../../../internal/heading-level.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{contextualSizes,contextualVariants}from"../../../internal/contextual-vocabulary.styles.js";import{styles}from"./callout.styles.js";import{literalSetConverter,presenceTrueDefaultBooleanConverter as trueDefaultBooleanConverter}from"../../../internal/converters.js";import{LYRA_DEFAULT_calloutAnnouncementWithContext,LYRA_DEFAULT_close}from"../../../internal/default-strings.generated.js";const CALLOUT_VARIANT=
|
|
1
|
+
import{__decorate}from"tslib";import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{composedParentElement}from"../../../internal/active-element.js";import{closeIcon}from"../../../internal/icons.js";import{isAccessibilityVisible}from"../../../internal/accessibility-visibility.js";import{AnnouncementUpgradeObserver}from"../../../internal/announcement-text.js";import{applyComposedFocusRepair,captureComposedFocusRepair,nearestExternalFocusTarget}from"../../../internal/focus-navigation.js";import{LyraElement}from"../../../internal/lyra-element.js";import{resolveHeadingLevel}from"../../../internal/heading-level.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{contextualSizes,contextualVariants}from"../../../internal/contextual-vocabulary.styles.js";import{effectiveSemanticVariant,semanticVariantConverter}from"../../../internal/semantic-variant.js";import{styles}from"./callout.styles.js";import{literalSetConverter,presenceTrueDefaultBooleanConverter as trueDefaultBooleanConverter}from"../../../internal/converters.js";import{LYRA_DEFAULT_calloutAnnouncementWithContext,LYRA_DEFAULT_close}from"../../../internal/default-strings.generated.js";const CALLOUT_VARIANT=semanticVariantConverter("brand"),CALLOUT_SIZE=literalSetConverter(["2xs","xs","s","m","l","xl","small","medium","large"],"m"),CALLOUT_HEADING_LEVEL=literalSetConverter(["1","2","3","4","5","6","none"],"3"),CALLOUT_APPEARANCES=new Set(["accent","filled","outlined","filled-outlined","plain"]),normalizeCalloutAppearance=value=>typeof value=="string"&&CALLOUT_APPEARANCES.has(value)?value:void 0,calloutAppearanceConverter={fromAttribute:normalizeCalloutAppearance,toAttribute:value=>normalizeCalloutAppearance(value)??null};class LyraCallout extends LyraElement{constructor(){super(...arguments),this._variant="brand",this._size="m",this.heading="",this._headingLevel="3",this.closable=!1,this.inline=!1,this.announce=!1,this.open=!0,this.hostAriaLabel=null,this.slotPresence=new SlotPresenceController(this),this.liveActive=!1,this.initialContentAnnounced=!1,this.connectionGeneration=0,this.lastAnnouncementText="",this.announcementShadowRoots=new Set,this.announcementUpgrades=new AnnouncementUpgradeObserver(()=>{this.announceCurrentContent(),this.observeAnnouncementContent()}),this.onForwardedSlotChange=event=>{const slot=event.target;this.announcementForwardingSlots().includes(slot)&&(this.announceCurrentContent(),this.observeAnnouncementContent())},this.close=()=>{const repair=captureComposedFocusRepair(this,()=>nearestExternalFocusTarget(this));this.emit("lr-close-request",{reason:"close-button"},{cancelable:!0}).defaultPrevented||(repair&&applyComposedFocusRepair(repair),this.open=!1,this.emit("lr-close",{reason:"close-button"}))}}static{this.defaultStrings={...super.defaultStrings,calloutAnnouncementWithContext:LYRA_DEFAULT_calloutAnnouncementWithContext,close:LYRA_DEFAULT_close}}static{this.styles=[LyraElement.styles,contextualVariants,contextualSizes,styles]}get variant(){return this._variant}set variant(next){const normalized=CALLOUT_VARIANT.normalizeReflected(this,"variant",next==="primary"?"brand":next),old=this._variant;old!==normalized&&(this._variant=normalized,this.requestUpdate("variant",old))}get appearance(){return this._appearance}set appearance(next){const normalized=normalizeCalloutAppearance(next);this.hasAttribute("appearance")&&this.getAttribute("appearance")!==normalized&&(normalized===void 0?this.removeAttribute("appearance"):this.setAttribute("appearance",normalized));const old=this._appearance;old!==normalized&&(this._appearance=normalized,this.requestUpdate("appearance",old))}get size(){return this._size}set size(next){const normalized=CALLOUT_SIZE.normalizeReflected(this,"size",next),old=this._size;old!==normalized&&(this._size=normalized,this.requestUpdate("size",old))}get headingLevel(){return this._headingLevel}set headingLevel(next){const normalized=CALLOUT_HEADING_LEVEL.normalizeReflected(this,"heading-level",next),old=this._headingLevel;old!==normalized&&(this._headingLevel=normalized,this.requestUpdate("headingLevel",old))}connectedCallback(){super.connectedCallback(),this.addEventListener("slotchange",this.onForwardedSlotChange),this.politeSink??=acquireAnnouncementSink("polite",{document:this.ownerDocument,source:this}),this.assertiveSink??=acquireAnnouncementSink("assertive",{document:this.ownerDocument,source:this});const MutationObserverCtor=this.ownerDocument.defaultView?.MutationObserver;MutationObserverCtor&&(this.contentObserver=new MutationObserverCtor(records=>{records.some(record=>!this.contains(record.target)||this.isAnnouncementMutation(record))&&(this.announceCurrentContent(),this.observeAnnouncementContent())}),this.observeAnnouncementContent());const generation=++this.connectionGeneration;this.updateComplete.then(()=>{const view=this.ownerDocument?.defaultView;return typeof view?.requestAnimationFrame=="function"?new Promise(resolve=>view.requestAnimationFrame(()=>resolve())):Promise.resolve()}).then(()=>this.updateComplete).then(()=>{this.isConnected&&generation===this.connectionGeneration&&(this.lastAnnouncementText=this.announcementText(),this.observeAnnouncementContent(),this.liveActive=!0,this.announce&&!this.initialContentAnnounced&&(this.initialContentAnnounced=!0,this.announceCurrentContent(!0)))})}disconnectedCallback(){this.connectionGeneration+=1,this.liveActive=!1,this.lastAnnouncementText="",this.contentObserver?.disconnect(),this.contentObserver=void 0,this.announcementShadowRoots.clear(),this.announcementUpgrades.disconnect(),this.removeEventListener("slotchange",this.onForwardedSlotChange),this.politeSink?.release(),this.politeSink=void 0,this.assertiveSink?.release(),this.assertiveSink=void 0,super.disconnectedCallback()}updated(changed){super.updated(changed),!(!this.liveActive||!this.open)&&(changed.has("open")||changed.has("heading")||changed.has("hostAriaLabel"))&&(this.announceCurrentContent(changed.has("open")),this.observeAnnouncementContent())}willUpdate(changed){if(super.willUpdate(changed),changed.has("open")&&!this.open){const repair=captureComposedFocusRepair(this,()=>nearestExternalFocusTarget(this));repair&&applyComposedFocusRepair(repair)}}isAnnouncementMutation(record){if(record.target===this)return record.type==="childList"||record.type==="attributes"&&["aria-hidden","aria-label","class","hidden","inert","style"].includes(record.attributeName??"");let top=record.target;for(;top.parentNode&&top.parentNode!==this;)top=top.parentNode;return top.parentNode!==this?!1:record.type==="attributes"&&record.attributeName==="slot"&&record.target===top?!0:this.isAnnouncementSlotNode(top)}isAnnouncementSlotNode(node){if(node.nodeType!==1)return!0;const slotName=node.getAttribute("slot");return slotName===null||slotName===""||slotName==="heading"}announcementObservationOptions(){return{attributes:!0,attributeFilter:["alt","aria-hidden","aria-label","class","hidden","inert","open","slot","style"],characterData:!0,childList:!0,subtree:!0}}announcementForwardingSlots(){return Array.from(this.querySelectorAll("slot")).filter(slot=>{let top=slot;for(;top.parentNode&&top.parentNode!==this;)top=top.parentNode;return top.parentNode===this&&this.isAnnouncementSlotNode(top)})}observeAnnouncementContent(){const observer=this.contentObserver;if(!observer)return;observer.disconnect();const options=this.announcementObservationOptions();observer.observe(this,options);for(const slot of this.announcementForwardingSlots())if(slot.assignedNodes().length!==0)for(const assigned of slot.assignedNodes({flatten:!0}))observer.observe(assigned,options);for(const root of this.announcementShadowRoots)observer.observe(root,options)}normalizedText(value){return(value??"").replace(/\s+/g," ").trim()}resolvedAccessibleLabel(){const hostLabel=this.hostAriaLabel;return this.normalizedText(hostLabel)}announcementText(){const roots=new Set;if(this.announcementShadowRoots=roots,!isAccessibilityVisible(this))return"";const hostLabel=this.hostAriaLabel,context=this.normalizedText(hostLabel),heading=[this.heading,...Array.from(this.childNodes).filter(node=>node.nodeType===1&&node.getAttribute("slot")==="heading").map(node=>this.announcementUpgrades.collect(node,roots))],message=Array.from(this.childNodes).filter(node=>{if(node.nodeType!==1)return!0;const slotName=node.getAttribute("slot");return slotName===null||slotName===""}).map(node=>this.announcementUpgrades.collect(node,roots)),content=this.normalizedText([...heading,...message].join(" "));return!context||context===content?content:content?this.localize("calloutAnnouncementWithContext",void 0,{context,content}):context}announceCurrentContent(force=!1){if(!this.liveActive||!this.isConnected||!this.open)return;const text=this.announcementText();!force&&text===this.lastAnnouncementText||(this.lastAnnouncementText=text,(this.effectiveContextualVariant==="danger"?this.assertiveSink:this.politeSink)?.announce(text))}get effectiveContextualVariant(){if(this.hasAttribute("variant"))return effectiveSemanticVariant(this.variant);let ancestor=composedParentElement(this);for(;ancestor;){const candidate=ancestor.getAttribute("variant");if(candidate&&CALLOUT_VARIANT.normalize(candidate)===candidate)return effectiveSemanticVariant(candidate);ancestor=composedParentElement(ancestor)}return"brand"}render(){if(!this.open)return html``;const label=this.resolvedAccessibleLabel()||void 0,headingLevel=resolveHeadingLevel(this.headingLevel);return html`<div
|
|
2
2
|
part="base"
|
|
3
3
|
role=${label?"group":nothing}
|
|
4
4
|
aria-label=${label||nothing}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraSizeAlias,LyraSizeStep
|
|
1
|
+
import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraSizeAlias,LyraSizeStep}from'../../../internal/variants.js';import{type SemanticVariant}from'../../../internal/semantic-variant.js';
|
|
2
2
|
/** The library's one semantic-tone vocabulary. */
|
|
3
|
-
export type ChipVariant=
|
|
3
|
+
export type ChipVariant=SemanticVariant;
|
|
4
4
|
/** The shared six-step ladder plus one step below it (a chip is the library's smallest labelled
|
|
5
5
|
* surface and needs a tier that fits inside a table cell, which no other component does), plus
|
|
6
6
|
* the `small`/`medium`/`large` aliases `<lr-badge>`/`<lr-callout>` already accept for the six
|
|
@@ -120,6 +120,8 @@ export type ChipSize=LyraSizeStep|'3xs'|LyraSizeAlias;export interface ChipRemov
|
|
|
120
120
|
export declare class LyraChip extends LyraElement<LyraChipEventMap>{static styles:import("lit").CSSResultGroup[];private _size;get size():ChipSize;set size(next:ChipSize);private _variant;get variant():ChipVariant;set variant(next:ChipVariant);
|
|
121
121
|
/** Shows the remove (×) button. */
|
|
122
122
|
removable:boolean;
|
|
123
|
+
/** `<lr-tag>`'s spelling of `removable`; both name one state, and the last write wins. */
|
|
124
|
+
get withRemove():boolean;set withRemove(next:boolean);
|
|
123
125
|
/** Disables the active toggle/remove control and suppresses its request event. */
|
|
124
126
|
disabled:boolean;
|
|
125
127
|
/** Draws fully-rounded ends instead of the default rounded rectangle, matching
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{AccessibleTextController}from"../../../internal/accessible-text-controller.js";import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{composedAccessibilityText,isAccessibilitySubtreeExcluded}from"../../../internal/accessibility-visibility.js";import{applyComposedFocusRepair,captureComposedFocusRepair,nearestExternalFocusTarget}from"../../../internal/focus-navigation.js";import{renderInertPresentation}from"../../../internal/inert-presentation.js";import{LyraElement}from"../../../internal/lyra-element.js";import{closeIcon}from"../../../internal/icons.js";import{literalSetConverter}from"../../../internal/converters.js";import{variants}from"../../../internal/variants.styles.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{styles}from"./chip.styles.js";import{LYRA_DEFAULT_remove,LYRA_DEFAULT_removeWithContext,LYRA_DEFAULT_select}from"../../../internal/default-strings.generated.js";const CHIP_SIZE=literalSetConverter(["3xs","2xs","xs","s","m","l","xl","small","medium","large"],"m"),CHIP_VARIANT=
|
|
1
|
+
import{__decorate}from"tslib";import{AccessibleTextController}from"../../../internal/accessible-text-controller.js";import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{composedAccessibilityText,isAccessibilitySubtreeExcluded}from"../../../internal/accessibility-visibility.js";import{applyComposedFocusRepair,captureComposedFocusRepair,nearestExternalFocusTarget}from"../../../internal/focus-navigation.js";import{renderInertPresentation}from"../../../internal/inert-presentation.js";import{LyraElement}from"../../../internal/lyra-element.js";import{closeIcon}from"../../../internal/icons.js";import{literalSetConverter}from"../../../internal/converters.js";import{semanticVariantConverter}from"../../../internal/semantic-variant.js";import{variants}from"../../../internal/variants.styles.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{styles}from"./chip.styles.js";import{LYRA_DEFAULT_remove,LYRA_DEFAULT_removeWithContext,LYRA_DEFAULT_select}from"../../../internal/default-strings.generated.js";const CHIP_SIZE=literalSetConverter(["3xs","2xs","xs","s","m","l","xl","small","medium","large"],"m"),CHIP_VARIANT=semanticVariantConverter("neutral");function sourceParent(node){if(node.parentElement)return node.parentElement;const root=node.getRootNode();return"host"in root?root.host:null}function isClosedSourceDetailsBranch(details,branch){return details.localName!=="details"||details.hasAttribute("open")||branch===null?!1:Array.from(details.children).find(child=>child.localName==="summary")!==branch}function isSourceLabelAvailable(node){const target=node.nodeType===1?node:sourceParent(node);if(!target?.isConnected)return!1;let branch=target,current=sourceParent(target);if(isAccessibilitySubtreeExcluded(target))return!1;for(;current;){if(isAccessibilitySubtreeExcluded(current)||isClosedSourceDetailsBranch(current,branch))return!1;branch=current,current=sourceParent(current)}return!0}class LyraChip extends LyraElement{constructor(){super(...arguments),this._size="m",this._variant="neutral",this.removable=!1,this.disabled=!1,this.pill=!1,this.selected=!1,this.toggleable=!1,this.wrap=!1,this.slotPresence=new SlotPresenceController(this),this.cachedLabelText="",this.labelTextObserver=new AccessibleTextController(this,[""],()=>{this.syncHostActionRole(),this.updateBrowserDerivedState(()=>this.recomputeLabelText())},["slot","role"],!1),this.managedActionGroupRole=!1,this.onLabelSlotChange=event=>{const target=event.target;target?.nodeType!==1||target.localName!=="slot"||this.tracksActionLabel&&(this.labelTextObserver.bind(),this.updateBrowserDerivedState(()=>this.recomputeLabelText()))},this.onRemoveClick=()=>{if(this.disabled)return;const repair=captureComposedFocusRepair(this,()=>nearestExternalFocusTarget(this));this.emit("lr-remove",{value:this.value}),repair&&(!this.isConnected||!this.removable)&&applyComposedFocusRepair(repair)},this.onToggleClick=()=>{if(this.disabled)return;const selected=!this.selected;this.emit("lr-chip-toggle-request",{value:this.value,selected},{cancelable:!0}).defaultPrevented||(this.selected=selected,this.emit("lr-chip-change",{value:this.value,selected}))}}static{this.defaultStrings={...super.defaultStrings,remove:LYRA_DEFAULT_remove,removeWithContext:LYRA_DEFAULT_removeWithContext,select:LYRA_DEFAULT_select}}static{this.styles=[LyraElement.styles,variants,styles]}get size(){return this._size}set size(next){const normalized=CHIP_SIZE.normalizeReflected(this,"size",next),old=this._size;old!==normalized&&(this._size=normalized,this.requestUpdate("size",old))}get variant(){return this._variant}set variant(next){const normalized=CHIP_VARIANT.normalizeReflected(this,"variant",next),old=this._variant;old!==normalized&&(this._variant=normalized,this.requestUpdate("variant",old))}get withRemove(){return this.removable}set withRemove(next){this.removable=!!next}connectedCallback(){super.connectedCallback(),this.addEventListener("slotchange",this.onLabelSlotChange),this.syncLabelObservation();const sampleBrowserState=()=>{this.tracksActionLabel&&this.recomputeLabelText(!0,!0)};this.hasUpdated?(sampleBrowserState(),this.ownerDocument.defaultView?.queueMicrotask(()=>{this.isConnected&&this.tracksActionLabel&&this.recomputeLabelText()})):this.seedFirstRenderState(sampleBrowserState)}get tracksActionLabel(){return this.toggleable||this.removable}syncLabelObservation(){this.labelTextObserver.setEnabled(this.tracksActionLabel)}disconnectedCallback(){this.removeEventListener("slotchange",this.onLabelSlotChange),this.releaseHostActionRole(),this.pendingControlFocusRepair=void 0,super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.labelTextObserver.adopted()}computeLabelText(preferLightDom=!1){const slot=this.renderRoot?.querySelector("slot:not([name])"),lightDomNodes=this.childNodes,assigned=slot?.assignedNodes({flatten:!0})??[],direct=Array.from(lightDomNodes??[]).filter(node=>node.nodeType!==1||(node.getAttribute("slot")??"")==="");return(!preferLightDom&&assigned.length>0?assigned:direct).map(node=>composedAccessibilityText(node,{ancestorBoundary:this,isSubtreeExcluded:element=>element.getRootNode()===this.renderRoot&&element.getAttribute("part")?.split(/\s+/).includes("label")?!1:isAccessibilitySubtreeExcluded(element),requireRendered:preferLightDom?!1:node.nodeType!==1||node.localName!=="slot",shouldPruneNode:candidate=>!this.contains(candidate)&&!isSourceLabelAvailable(candidate),ignoreInheritedVisibility:!0})).join(" ").replace(/\s+/g," ").trim()}recomputeLabelText(request=!0,preferLightDom=!1){const next=this.computeLabelText(preferLightDom);next!==this.cachedLabelText&&(this.cachedLabelText=next,request&&this.requestUpdate())}get accessibleToggleLabel(){return this.cachedLabelText||this.localize("select")}get accessibleRemoveLabel(){const text=this.cachedLabelText;return text?this.localize("removeWithContext",void 0,{label:text}):this.localize("remove")}get primaryControl(){return this.renderRoot.querySelector(this.removable?'[part="remove-button"]':'[part="toggle-button"]')}focus(options){this.primaryControl?.focus(options)}blur(){this.primaryControl?.blur()}click(){const control=this.primaryControl;control?control.click():super.click()}willUpdate(changed){if(super.willUpdate(changed),changed.has("removable")&&!this.removable&&this.removeAttribute("with-remove"),(changed.has("removable")||changed.has("toggleable"))&&(this.syncLabelObservation(),this.hasUpdated&&(this.tracksActionLabel?this.recomputeLabelText(!1):this.cachedLabelText="")),this.pendingControlFocusRepair)return;const oldRemovable=changed.get("removable")??this.removable,oldToggleable=changed.get("toggleable")??this.toggleable,oldDisabled=changed.get("disabled")??this.disabled,oldMode=oldRemovable?"remove":oldToggleable?"toggle":"passive",newMode=this.removable?"remove":this.toggleable?"toggle":"passive";oldMode===newMode&&!(oldDisabled===!1&&this.disabled)||(this.pendingControlFocusRepair=captureComposedFocusRepair(this,()=>nearestExternalFocusTarget(this)??this.renderRoot.querySelector('[part="remove-button"], [part="toggle-button"]'))??void 0)}updated(changed){super.updated(changed),this.syncHostActionRole();const repair=this.pendingControlFocusRepair;if(this.pendingControlFocusRepair=void 0,!repair)return;const replacement=this.disabled?null:this.primaryControl;applyComposedFocusRepair(repair,replacement??repair.candidate)}syncHostActionRole(){const needsGroup=this.tracksActionLabel&&this.hasAttribute("aria-label");needsGroup&&!this.hasAttribute("role")?(this.setAttribute("role","group"),this.managedActionGroupRole=!0):needsGroup||this.releaseHostActionRole()}releaseHostActionRole(){this.managedActionGroupRole&&this.getAttribute("role")==="group"&&this.removeAttribute("role"),this.managedActionGroupRole=!1}render(){const toggleMode=this.toggleable&&!this.removable,pressed=this.selected&&!this.removable;return html`
|
|
2
2
|
<span part="base">
|
|
3
3
|
${renderInertPresentation(html`<slot name="start"></slot>`,{part:"start",hidden:!this.slotPresence.has("start")})}
|
|
4
4
|
${renderInertPresentation(html`<slot @slotchange=${this.onLabelSlotChange}></slot>`,{part:"label",presentation:toggleMode})}
|
|
@@ -21,4 +21,4 @@ import{__decorate}from"tslib";import{AccessibleTextController}from"../../../inte
|
|
|
21
21
|
${closeIcon()}
|
|
22
22
|
</button>`:nothing}
|
|
23
23
|
</span>
|
|
24
|
-
`}}__decorate([property({reflect:!0,converter:CHIP_SIZE})],LyraChip.prototype,"size",null),__decorate([property({reflect:!0,converter:CHIP_VARIANT})],LyraChip.prototype,"variant",null),__decorate([property({type:Boolean,reflect:!0})],LyraChip.prototype,"removable",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraChip.prototype,"disabled",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraChip.prototype,"pill",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraChip.prototype,"selected",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraChip.prototype,"toggleable",void 0),__decorate([property()],LyraChip.prototype,"value",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraChip.prototype,"wrap",void 0);export{LyraChip};
|
|
24
|
+
`}}__decorate([property({reflect:!0,converter:CHIP_SIZE})],LyraChip.prototype,"size",null),__decorate([property({reflect:!0,converter:CHIP_VARIANT})],LyraChip.prototype,"variant",null),__decorate([property({type:Boolean,reflect:!0})],LyraChip.prototype,"removable",void 0),__decorate([property({type:Boolean,attribute:"with-remove"})],LyraChip.prototype,"withRemove",null),__decorate([property({type:Boolean,reflect:!0})],LyraChip.prototype,"disabled",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraChip.prototype,"pill",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraChip.prototype,"selected",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraChip.prototype,"toggleable",void 0),__decorate([property()],LyraChip.prototype,"value",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraChip.prototype,"wrap",void 0);export{LyraChip};
|
|
@@ -242,7 +242,7 @@ size:LyraSize;private hostAriaLabel;
|
|
|
242
242
|
* backdrop dismissal on, so a mechanical `wa-dialog` → `lr-dialog` rename silently flipped the
|
|
243
243
|
* behaviour of every migrated dialog. A rename that changes what the markup does with nothing
|
|
244
244
|
* to warn on is worse than no rename at all, so the polarity now matches upstream exactly. */
|
|
245
|
-
lightDismiss:boolean;private hasFooterSlot;private hasLabelSlot;private hasHeaderActionsSlot;private headingText?;private overlay?;private focusReturnOpener;private hideSettled?;private readonly
|
|
245
|
+
lightDismiss:boolean;private hasFooterSlot;private hasLabelSlot;private hasHeaderActionsSlot;private headingText?;private overlay?;private focusReturnOpener;private hideSettled?;private readonly nativeModal;private pendingScrollLockRelease?;private headingObserver?;private headingObserverDocument?;private headingObserverOpen?;private headingObserverGeneration;private bodyOverflowObserver?;private bodyOverflowObservedBody?;private transitionToken;private openRequestTarget?;private openRequestDuringPreflight?;private transitionAnimations;private initialFocusDecision?;private readonly headingId;private externalModalDepth;
|
|
246
246
|
/** Shoelace-compatible modal controller. External activation suspends this dialog's focus/Escape
|
|
247
247
|
* ownership without changing its logical `open` state; deactivation restores it. */
|
|
248
248
|
modal:LyraDialogModalController;
|