@aceshooting/lyra-ui 9.1.0 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +843 -0
- package/README.md +7 -0
- package/custom-elements.json +1 -1
- package/dist/cli/migrate-wa.mjs +52 -0
- package/dist/cli/migration-contract.json +1 -1
- package/dist/components/agent-tools/activity-feed/activity-feed.class.js +2 -2
- package/dist/components/agent-tools/activity-feed/activity-feed.styles.js +0 -16
- package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.class.js +1 -1
- package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.styles.js +9 -7
- package/dist/components/agent-tools/agent-run/agent-run.class.js +2 -2
- package/dist/components/agent-tools/agent-run/agent-run.styles.js +0 -13
- package/dist/components/agent-tools/agent-trace/agent-trace.class.js +1 -1
- package/dist/components/agent-tools/agent-trace/agent-trace.styles.js +7 -4
- package/dist/components/agent-tools/approval-queue/approval-queue.styles.js +7 -5
- package/dist/components/agent-tools/artifact-panel/artifact-panel.styles.js +0 -3
- package/dist/components/agent-tools/browser-frame/browser-frame.class.js +1 -1
- package/dist/components/agent-tools/browser-frame/browser-frame.styles.js +3 -5
- package/dist/components/agent-tools/commit-card/commit-card.class.js +1 -1
- package/dist/components/agent-tools/commit-card/commit-card.styles.js +0 -10
- package/dist/components/agent-tools/compare-panel/compare-panel.styles.js +11 -6
- package/dist/components/agent-tools/confirm-bar/confirm-bar.class.js +2 -2
- package/dist/components/agent-tools/confirm-bar/confirm-bar.styles.js +0 -46
- package/dist/components/agent-tools/context-inspector/context-inspector.class.js +1 -1
- package/dist/components/agent-tools/eval-dataset/eval-dataset.styles.js +0 -7
- package/dist/components/agent-tools/eval-result/eval-result.class.js +1 -1
- package/dist/components/agent-tools/evaluation-run/evaluation-run.class.js +2 -2
- package/dist/components/agent-tools/policy-summary/policy-summary.class.js +1 -1
- package/dist/components/agent-tools/prompt-studio/prompt-studio.styles.js +0 -15
- package/dist/components/agent-tools/result-card/result-card.styles.js +0 -7
- package/dist/components/agent-tools/result-card/result-field.styles.js +0 -5
- package/dist/components/agent-tools/schema-viewer/schema-viewer.styles.js +2 -5
- package/dist/components/agent-tools/span-waterfall/span-waterfall.class.js +1 -1
- package/dist/components/agent-tools/span-waterfall/span-waterfall.styles.js +0 -15
- package/dist/components/agent-tools/stack-trace/stack-trace.styles.js +0 -20
- package/dist/components/agent-tools/subagent-panel/subagent-panel.class.js +2 -2
- package/dist/components/agent-tools/subagent-panel/subagent-panel.styles.js +1 -4
- package/dist/components/agent-tools/task-list/task-list.class.js +2 -2
- package/dist/components/agent-tools/task-list/task-list.styles.js +0 -15
- package/dist/components/agent-tools/terminal/terminal.class.d.ts +11 -6
- package/dist/components/agent-tools/terminal/terminal.class.js +4 -4
- package/dist/components/agent-tools/terminal/terminal.styles.js +0 -46
- package/dist/components/agent-tools/test-results/test-results.class.js +2 -2
- package/dist/components/agent-tools/test-results/test-results.styles.js +0 -5
- package/dist/components/agent-tools/thinking-panel/thinking-panel.class.js +1 -1
- package/dist/components/agent-tools/thinking-panel/thinking-panel.styles.js +0 -41
- package/dist/components/agent-tools/tool-approval-dialog/tool-approval-dialog.styles.js +0 -41
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.js +2 -2
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.styles.js +0 -30
- package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js +6 -6
- package/dist/components/agent-tools/tool-param-form/tool-param-form.styles.js +0 -5
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.class.js +2 -2
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.styles.js +0 -20
- package/dist/components/agent-tools/tool-result-view/tool-result-view.styles.js +0 -4
- package/dist/components/agent-tools/tool-select-dialog/tool-select-dialog.styles.js +0 -21
- package/dist/components/agent-tools/trace-tree/trace-tree.class.js +2 -2
- package/dist/components/agent-tools/trace-tree/trace-tree.styles.js +7 -31
- package/dist/components/charts/chart/bar-chart.class.js +1 -1
- package/dist/components/charts/chart/box-plot.styles.js +0 -20
- package/dist/components/charts/chart/bubble-chart.class.js +1 -1
- package/dist/components/charts/chart/chart-colors.d.ts +1 -1
- package/dist/components/charts/chart/chart-colors.js +1 -1
- package/dist/components/charts/chart/chart-core-loader.d.ts +1 -0
- package/dist/components/charts/chart/chart-core-loader.js +1 -1
- package/dist/components/charts/chart/chart-feature-loader.d.ts +35 -0
- package/dist/components/charts/chart/chart-feature-loader.js +1 -1
- package/dist/components/charts/chart/chart.class.d.ts +93 -0
- package/dist/components/charts/chart/chart.class.js +3 -3
- package/dist/components/charts/chart/chart.styles.js +0 -27
- package/dist/components/charts/chart/doughnut-chart.class.js +1 -1
- package/dist/components/charts/chart/histogram.class.js +1 -1
- package/dist/components/charts/chart/line-chart.class.js +1 -1
- package/dist/components/charts/chart/lite-chart.class.d.ts +20 -1
- package/dist/components/charts/chart/lite-chart.class.js +4 -4
- package/dist/components/charts/chart/lite-chart.styles.js +0 -27
- package/dist/components/charts/chart/pie-chart.class.js +1 -1
- package/dist/components/charts/chart/polar-area-chart.class.js +1 -1
- package/dist/components/charts/chart/radar-chart.class.js +1 -1
- package/dist/components/charts/chart/scatter-chart.class.js +1 -1
- package/dist/components/conversation/agent-workspace/agent-workspace.class.d.ts +20 -0
- package/dist/components/conversation/agent-workspace/agent-workspace.class.js +3 -1
- package/dist/components/conversation/agent-workspace/agent-workspace.styles.js +3 -0
- package/dist/components/conversation/audio-visualizer/audio-visualizer.styles.js +0 -7
- package/dist/components/conversation/branch-picker/branch-picker.styles.js +0 -3
- package/dist/components/conversation/chat-composer/chat-composer.styles.js +0 -51
- package/dist/components/conversation/chat-message/chat-message.class.js +2 -2
- package/dist/components/conversation/chat-message/chat-message.styles.js +13 -35
- package/dist/components/conversation/chat-viewport/chat-viewport.class.js +1 -1
- package/dist/components/conversation/chat-viewport/chat-viewport.styles.js +0 -33
- package/dist/components/conversation/checkpoint/checkpoint.class.js +1 -1
- package/dist/components/conversation/checkpoint/checkpoint.styles.js +0 -3
- package/dist/components/conversation/code-block/code-block-shared.d.ts +5 -2
- package/dist/components/conversation/code-block/code-block.class.js +1 -1
- package/dist/components/conversation/code-block/code-block.styles.js +4 -95
- package/dist/components/conversation/code-block/code-loader.d.ts +11 -0
- package/dist/components/conversation/code-block/code-loader.js +1 -1
- package/dist/components/conversation/code-block/shiki-types.d.ts +12 -0
- package/dist/components/conversation/code-block/shiki-types.js +1 -1
- package/dist/components/conversation/conversation-item/conversation-item.styles.js +8 -54
- package/dist/components/conversation/generation-metrics/generation-metrics.class.js +2 -2
- package/dist/components/conversation/generation-metrics/generation-metrics.styles.js +0 -17
- package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
- package/dist/components/conversation/markdown/markdown.styles.js +0 -41
- package/dist/components/conversation/message-actions/message-actions.styles.js +0 -3
- package/dist/components/conversation/message-feedback/message-feedback.styles.js +0 -35
- package/dist/components/conversation/message-parts/message-parts.class.d.ts +1 -1
- package/dist/components/conversation/message-parts/message-parts.styles.js +0 -5
- package/dist/components/conversation/model-select/model-select.class.js +3 -3
- package/dist/components/conversation/model-select/model-select.styles.js +12 -47
- package/dist/components/conversation/model-settings-panel/model-settings-panel.styles.js +0 -6
- package/dist/components/conversation/prompt-input/prompt-input.class.d.ts +3 -0
- package/dist/components/conversation/prompt-input/prompt-input.styles.js +0 -10
- package/dist/components/conversation/push-to-talk/push-to-talk.styles.js +0 -8
- package/dist/components/conversation/realtime-session/realtime-session.styles.js +1 -1
- package/dist/components/conversation/selection-toolbar/selection-toolbar.styles.js +1 -11
- package/dist/components/conversation/stream-status/stream-status.styles.js +0 -16
- package/dist/components/conversation/streaming-text/streaming-text.styles.js +0 -15
- package/dist/components/conversation/suggestion-chips/suggestion-chips.styles.js +0 -5
- package/dist/components/conversation/thread-list/thread-list.styles.js +5 -19
- package/dist/components/conversation/transcript-feed/transcript-feed.class.d.ts +16 -4
- package/dist/components/conversation/transcript-feed/transcript-feed.class.js +1 -1
- package/dist/components/conversation/transcript-feed/transcript-feed.styles.js +0 -1
- package/dist/components/conversation/typing-indicator/typing-indicator.styles.js +0 -23
- package/dist/components/conversation/usage-badge/usage-badge.class.js +1 -1
- package/dist/components/conversation/usage-badge/usage-badge.styles.js +0 -3
- package/dist/components/conversation/voice-picker/voice-picker.class.js +3 -3
- package/dist/components/conversation/voice-picker/voice-picker.styles.js +9 -29
- package/dist/components/conversation/widget-renderer/resolve.d.ts +2 -0
- package/dist/components/conversation/widget-renderer/resolve.js +1 -1
- package/dist/components/data/calendar/calendar.class.d.ts +15 -2
- package/dist/components/data/calendar/calendar.class.js +2 -2
- package/dist/components/data/calendar/calendar.styles.js +2 -28
- package/dist/components/data/condition-builder/condition-builder.class.d.ts +10 -6
- package/dist/components/data/condition-builder/condition-builder.class.js +2 -2
- package/dist/components/data/condition-builder/condition-builder.styles.js +0 -6
- package/dist/components/data/context-meter/context-meter.styles.js +0 -24
- package/dist/components/data/data-grid/data-grid.class.js +3 -3
- package/dist/components/data/data-grid/data-grid.styles.js +0 -22
- package/dist/components/data/document-library/document-library.class.js +2 -2
- package/dist/components/data/document-library/document-library.styles.js +0 -4
- package/dist/components/data/env-list/env-list.class.js +1 -1
- package/dist/components/data/env-list/env-list.styles.js +7 -4
- package/dist/components/data/file-tree/file-tree.class.d.ts +12 -0
- package/dist/components/data/file-tree/file-tree.class.js +1 -1
- package/dist/components/data/flow-canvas/flow-canvas.styles.js +12 -19
- package/dist/components/data/flow-controls/flow-controls.class.js +2 -2
- package/dist/components/data/flow-controls/flow-controls.styles.js +3 -36
- package/dist/components/data/flow-minimap/flow-minimap.class.js +1 -1
- package/dist/components/data/flow-minimap/flow-minimap.styles.js +0 -9
- package/dist/components/data/flow-node/flow-node.styles.js +0 -23
- package/dist/components/data/flow-run-status/flow-run-status.class.js +1 -1
- package/dist/components/data/flow-run-status/flow-run-status.styles.js +0 -7
- package/dist/components/data/graph-query-builder/graph-query-builder.class.d.ts +0 -7
- package/dist/components/data/graph-query-builder/graph-query-builder.class.js +1 -1
- package/dist/components/data/graph-query-builder/graph-query-builder.styles.js +0 -10
- package/dist/components/data/heatmap/heatmap-scale.d.ts +20 -0
- package/dist/components/data/heatmap/heatmap-scale.js +1 -1
- package/dist/components/data/heatmap/heatmap.class.d.ts +85 -2
- package/dist/components/data/heatmap/heatmap.class.js +2 -2
- package/dist/components/data/heatmap/heatmap.styles.js +0 -54
- package/dist/components/data/pagination/pagination.class.js +1 -1
- package/dist/components/data/pagination/pagination.styles.js +23 -46
- package/dist/components/data/sequence-strip/sequence-strip.class.d.ts +34 -1
- package/dist/components/data/sequence-strip/sequence-strip.class.js +5 -2
- package/dist/components/data/sequence-strip/sequence-strip.styles.js +14 -20
- package/dist/components/data/sparkline/sparkline.class.js +1 -1
- package/dist/components/data/stat/stat.styles.js +0 -67
- package/dist/components/data/table/table.class.d.ts +42 -3
- package/dist/components/data/table/table.class.js +4 -4
- package/dist/components/data/table/table.styles.js +20 -91
- package/dist/components/data/timeline/timeline-item.styles.js +0 -30
- package/dist/components/data/timeline/timeline.class.d.ts +89 -1
- package/dist/components/data/timeline/timeline.class.js +2 -2
- package/dist/components/data/timeline/timeline.styles.js +111 -31
- package/dist/components/data/tree/tree-item.styles.js +1 -28
- package/dist/components/data/tree/tree.class.js +2 -2
- package/dist/components/data/tree/tree.styles.js +0 -6
- package/dist/components/data/word-cloud/word-cloud.styles.js +0 -5
- package/dist/components/forms/button/button.class.js +1 -1
- package/dist/components/forms/button/button.styles.js +1 -106
- package/dist/components/forms/checkbox/checkbox.class.d.ts +3 -0
- package/dist/components/forms/checkbox/checkbox.class.js +1 -1
- package/dist/components/forms/checkbox/checkbox.styles.js +0 -39
- package/dist/components/forms/checkbox-group/checkbox-group.class.d.ts +21 -2
- package/dist/components/forms/checkbox-group/checkbox-group.class.js +1 -1
- package/dist/components/forms/checkbox-group/checkbox-group.styles.js +0 -18
- package/dist/components/forms/code-editor/code-editor.styles.js +0 -30
- package/dist/components/forms/color-picker/color-picker.class.js +2 -2
- package/dist/components/forms/color-picker/color-picker.styles.js +0 -69
- package/dist/components/forms/combobox/combobox.class.js +2 -2
- package/dist/components/forms/combobox/combobox.styles.js +22 -111
- package/dist/components/forms/combobox/option.styles.js +7 -1
- package/dist/components/forms/date-picker/date-input.class.js +1 -1
- package/dist/components/forms/date-picker/date-input.styles.js +12 -67
- package/dist/components/forms/date-picker/date-picker.class.d.ts +1 -0
- package/dist/components/forms/date-picker/date-picker.class.js +22 -20
- package/dist/components/forms/date-picker/date-picker.styles.js +36 -29
- package/dist/components/forms/emoji-picker/emoji-data-loader.d.ts +6 -3
- package/dist/components/forms/emoji-picker/emoji-data-loader.js +1 -1
- package/dist/components/forms/emoji-picker/emoji-picker.class.d.ts +8 -1
- package/dist/components/forms/emoji-picker/emoji-picker.class.js +1 -1
- package/dist/components/forms/emoji-picker/emoji-picker.styles.js +3 -41
- package/dist/components/forms/icon-button/icon-button.class.js +1 -1
- package/dist/components/forms/icon-button/icon-button.styles.js +0 -16
- package/dist/components/forms/input/input.styles.js +0 -54
- package/dist/components/forms/input/number-input.styles.d.ts +4 -5
- package/dist/components/forms/input/number-input.styles.js +0 -11
- package/dist/components/forms/input/time-input-shared.d.ts +11 -0
- package/dist/components/forms/input/time-input-shared.js +1 -1
- package/dist/components/forms/input/time-input.class.d.ts +11 -2
- package/dist/components/forms/input/time-input.class.js +1 -1
- package/dist/components/forms/input/time-input.styles.js +0 -6
- package/dist/components/forms/locale-picker/locale-picker.class.js +2 -2
- package/dist/components/forms/locale-picker/locale-picker.styles.js +1 -26
- package/dist/components/forms/otp-input/otp-input.class.js +3 -3
- package/dist/components/forms/otp-input/otp-input.styles.js +0 -16
- package/dist/components/forms/phone-input/phone-input.class.d.ts +9 -1
- package/dist/components/forms/phone-input/phone-input.class.js +2 -2
- package/dist/components/forms/phone-input/phone-input.styles.js +0 -37
- package/dist/components/forms/radio/radio-button.styles.js +1 -30
- package/dist/components/forms/radio/radio-group.styles.js +0 -4
- package/dist/components/forms/radio/radio.styles.js +0 -44
- package/dist/components/forms/rubric-form/rubric-form.styles.js +0 -5
- package/dist/components/forms/select/select.class.js +1 -1
- package/dist/components/forms/select/select.styles.js +14 -114
- package/dist/components/forms/slider/slider.styles.js +0 -55
- package/dist/components/forms/swatch-picker/swatch-picker.class.d.ts +0 -11
- package/dist/components/forms/swatch-picker/swatch-picker.class.js +2 -2
- package/dist/components/forms/swatch-picker/swatch-picker.styles.js +0 -77
- package/dist/components/forms/switch/switch.class.d.ts +3 -0
- package/dist/components/forms/switch/switch.class.js +1 -1
- package/dist/components/forms/switch/switch.styles.js +3 -38
- package/dist/components/forms/textarea/textarea.styles.js +0 -28
- package/dist/components/forms/time-range/time-range.styles.js +12 -84
- package/dist/components/forms/token-input/token-input.class.d.ts +23 -9
- package/dist/components/forms/token-input/token-input.class.js +1 -1
- package/dist/components/forms/token-input/token-input.styles.js +1 -54
- package/dist/components/layout/app-rail/app-rail-item.class.js +2 -2
- package/dist/components/layout/app-rail/app-rail-item.styles.js +0 -13
- package/dist/components/layout/app-rail/app-rail.class.d.ts +5 -0
- package/dist/components/layout/app-rail/app-rail.class.js +1 -1
- package/dist/components/layout/app-rail/app-rail.styles.js +0 -46
- package/dist/components/layout/button-group/button-group.styles.js +0 -6
- package/dist/components/layout/card/card.class.d.ts +12 -0
- package/dist/components/layout/card/card.styles.js +5 -13
- package/dist/components/layout/carousel/carousel.styles.js +0 -1
- package/dist/components/layout/command-palette/command-palette.class.d.ts +8 -0
- package/dist/components/layout/command-palette/command-palette.class.js +3 -1
- package/dist/components/layout/command-palette/command-palette.styles.js +1 -13
- package/dist/components/layout/control-group/control-group.styles.js +0 -7
- package/dist/components/layout/dashboard-grid/dashboard-grid.class.js +1 -1
- package/dist/components/layout/dashboard-grid/dashboard-grid.styles.js +6 -25
- package/dist/components/layout/details/accordion.class.d.ts +13 -0
- package/dist/components/layout/details/accordion.class.js +1 -1
- package/dist/components/layout/details/details.class.js +1 -1
- package/dist/components/layout/details/details.styles.js +0 -12
- package/dist/components/layout/dock-panel/dock-panel.styles.js +0 -45
- package/dist/components/layout/drilldown-panel/drilldown-panel.class.d.ts +2 -0
- package/dist/components/layout/drilldown-panel/drilldown-panel.class.js +2 -2
- package/dist/components/layout/drilldown-panel/drilldown-panel.styles.js +0 -4
- package/dist/components/layout/filter-bar/filter-bar.class.js +1 -1
- package/dist/components/layout/filter-bar/filter-bar.styles.js +0 -9
- package/dist/components/layout/menu/menu-item.class.d.ts +5 -0
- package/dist/components/layout/menu/menu-item.class.js +1 -1
- package/dist/components/layout/menu/menu-item.styles.js +0 -49
- package/dist/components/layout/menu/menu-label.styles.js +0 -2
- package/dist/components/layout/menu/menu.styles.js +0 -18
- package/dist/components/layout/multi-split/multi-split.class.js +1 -1
- package/dist/components/layout/multi-split/multi-split.styles.js +8 -51
- package/dist/components/layout/page/page.class.d.ts +4 -0
- package/dist/components/layout/page/page.class.js +1 -1
- package/dist/components/layout/reorder-list/reorder-item.styles.js +0 -4
- package/dist/components/layout/responsive-panel/responsive-panel.styles.js +0 -27
- package/dist/components/layout/scroller/scroller.styles.js +0 -20
- package/dist/components/layout/segmented/segmented.class.d.ts +7 -1
- package/dist/components/layout/segmented/segmented.class.js +1 -1
- package/dist/components/layout/segmented/segmented.styles.js +69 -37
- package/dist/components/layout/split-panel/split-panel.styles.js +1 -7
- package/dist/components/layout/stepper/stepper.class.d.ts +8 -1
- package/dist/components/layout/stepper/stepper.class.js +1 -1
- package/dist/components/layout/stepper/stepper.styles.js +140 -41
- package/dist/components/layout/tab-group/tab-group.class.d.ts +4 -1
- package/dist/components/layout/tab-group/tab-group.styles.js +9 -75
- package/dist/components/layout/tab-group/tab.styles.js +0 -2
- package/dist/components/layout/virtual-list/virtual-list.class.d.ts +4 -4
- package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
- package/dist/components/layout/virtual-list/virtual-list.styles.js +0 -68
- package/dist/components/layout/widget/widget.class.d.ts +5 -1
- package/dist/components/layout/widget/widget.class.js +1 -1
- package/dist/components/layout/widget/widget.styles.js +97 -40
- package/dist/components/media/animated-image/animated-image.class.d.ts +3 -0
- package/dist/components/media/animated-image/animated-image.class.js +1 -1
- package/dist/components/media/animated-image/animated-image.styles.js +0 -28
- package/dist/components/media/attachment-chip/attachment-chip.class.d.ts +1 -1
- package/dist/components/media/attachment-chip/attachment-chip.class.js +2 -2
- package/dist/components/media/attachment-chip/attachment-chip.styles.js +0 -31
- package/dist/components/media/attachment-trigger/attachment-trigger.class.d.ts +1 -1
- package/dist/components/media/attachment-trigger/attachment-trigger.class.js +4 -4
- package/dist/components/media/attachment-trigger/attachment-trigger.styles.js +0 -40
- package/dist/components/media/av-player/av-player.class.d.ts +5 -6
- package/dist/components/media/av-player/av-player.class.js +1 -1
- package/dist/components/media/av-player/av-player.styles.js +0 -45
- package/dist/components/media/avatar/avatar.styles.js +3 -16
- package/dist/components/media/file-icon/file-icon.class.d.ts +1 -2
- package/dist/components/media/file-icon/file-icon.class.js +1 -1
- package/dist/components/media/file-input/file-input.class.d.ts +12 -0
- package/dist/components/media/file-input/file-input.class.js +1 -1
- package/dist/components/media/file-input/file-input.styles.js +3 -24
- package/dist/components/media/flag/flag.class.d.ts +20 -0
- package/dist/components/media/flag/flag.class.js +4 -2
- package/dist/components/media/flag/flag.styles.js +7 -1
- package/dist/components/media/flag/language-map.d.ts +10 -0
- package/dist/components/media/flag/language-map.js +1 -1
- package/dist/components/media/image-comparer/image-comparer.styles.js +4 -33
- package/dist/components/media/image-viewer/image-viewer.class.js +0 -2
- package/dist/components/media/image-viewer/image-viewer.styles.js +7 -27
- package/dist/components/media/lightbox/lightbox.class.js +0 -2
- package/dist/components/media/lightbox/lightbox.styles.js +2 -21
- package/dist/components/media/map/map-loader.d.ts +19 -1
- package/dist/components/media/map/map-loader.js +1 -1
- package/dist/components/media/map/map.class.d.ts +141 -1
- package/dist/components/media/map/map.class.js +15 -3
- package/dist/components/media/map/map.styles.js +20 -17
- package/dist/components/media/media-card/media-card.class.d.ts +14 -3
- package/dist/components/media/media-card/media-card.class.js +1 -1
- package/dist/components/media/media-card/media-card.styles.js +2 -28
- package/dist/components/media/pan-zoom/pan-zoom.styles.js +0 -3
- package/dist/components/media/qr-code/qr-code.class.d.ts +3 -2
- package/dist/components/media/qr-code/qr-code.class.js +2 -2
- package/dist/components/media/qr-code/qr-code.styles.js +0 -3
- package/dist/components/media/sequence-playback/sequence-playback.class.d.ts +2 -0
- package/dist/components/media/sequence-playback/sequence-playback.class.js +2 -1
- package/dist/components/media/sequence-playback/sequence-playback.styles.js +0 -19
- package/dist/components/media/video/video.class.d.ts +23 -2
- package/dist/components/media/video/video.class.js +3 -3
- package/dist/components/media/video/video.styles.js +4 -2
- package/dist/components/media/zoomable-frame/zoomable-frame.class.d.ts +3 -2
- package/dist/components/media/zoomable-frame/zoomable-frame.class.js +2 -2
- package/dist/components/media/zoomable-frame/zoomable-frame.styles.js +0 -5
- package/dist/components/overlays/alert/alert.styles.js +4 -2
- package/dist/components/overlays/badge/badge.styles.js +4 -48
- package/dist/components/overlays/badge/tag.styles.js +0 -14
- package/dist/components/overlays/callout/callout.styles.js +2 -13
- package/dist/components/overlays/chip/chip-group.styles.js +0 -18
- package/dist/components/overlays/chip/chip.styles.js +6 -69
- package/dist/components/overlays/dialog/confirm.d.ts +1 -4
- package/dist/components/overlays/dialog/confirm.js +1 -1
- package/dist/components/overlays/dialog/dialog.class.d.ts +12 -9
- package/dist/components/overlays/dialog/dialog.class.js +1 -1
- package/dist/components/overlays/dialog/dialog.styles.js +0 -43
- package/dist/components/overlays/drawer/drawer.class.d.ts +2 -2
- package/dist/components/overlays/drawer/drawer.styles.js +0 -9
- package/dist/components/overlays/empty/empty.styles.js +0 -12
- package/dist/components/overlays/kbd/kbd.class.js +1 -1
- package/dist/components/overlays/kbd/kbd.styles.js +0 -8
- package/dist/components/overlays/overlay/dropdown.class.d.ts +1 -6
- package/dist/components/overlays/overlay/dropdown.class.js +2 -2
- package/dist/components/overlays/overlay/overlay.styles.js +0 -28
- package/dist/components/overlays/overlay/popover.class.d.ts +9 -1
- package/dist/components/overlays/overlay/popover.class.js +2 -2
- package/dist/components/overlays/overlay/tooltip.class.d.ts +10 -0
- package/dist/components/overlays/overlay/tooltip.class.js +2 -2
- package/dist/components/overlays/popup/popup.class.d.ts +1 -0
- package/dist/components/overlays/popup/popup.class.js +2 -2
- package/dist/components/overlays/popup/popup.styles.js +0 -15
- package/dist/components/overlays/progress/progress-ring.class.d.ts +9 -1
- package/dist/components/overlays/progress/progress-ring.class.js +3 -3
- package/dist/components/overlays/progress/progress.styles.js +0 -21
- package/dist/components/overlays/rating/rating.styles.js +0 -25
- package/dist/components/overlays/skeleton/skeleton.styles.js +0 -4
- package/dist/components/overlays/spinner/spinner.styles.js +2 -5
- package/dist/components/overlays/toast/toast-item.styles.js +3 -45
- package/dist/components/retrieval/chunk-inspector/chunk-inspector.styles.js +0 -35
- package/dist/components/retrieval/citation-badge/citation-badge.class.d.ts +2 -2
- package/dist/components/retrieval/citation-badge/citation-badge.class.js +3 -3
- package/dist/components/retrieval/citation-badge/citation-badge.styles.js +0 -20
- package/dist/components/retrieval/claim-evidence/claim-evidence.class.js +1 -1
- package/dist/components/retrieval/claim-evidence/claim-evidence.styles.js +0 -8
- package/dist/components/retrieval/community-card/community-card.class.d.ts +1 -0
- package/dist/components/retrieval/community-card/community-card.styles.js +0 -6
- package/dist/components/retrieval/embedding-explorer/embedding-explorer.styles.js +8 -12
- package/dist/components/retrieval/entity-card/entity-card.class.d.ts +4 -3
- package/dist/components/retrieval/entity-card/entity-card.class.js +1 -1
- package/dist/components/retrieval/entity-card/entity-card.styles.js +0 -12
- package/dist/components/retrieval/entity-chip/entity-chip.class.d.ts +10 -4
- package/dist/components/retrieval/entity-chip/entity-chip.class.js +3 -3
- package/dist/components/retrieval/entity-chip/entity-chip.styles.js +6 -9
- package/dist/components/retrieval/entity-dossier/entity-dossier.class.d.ts +19 -5
- package/dist/components/retrieval/entity-dossier/entity-dossier.class.js +1 -1
- package/dist/components/retrieval/graph/graph.class.d.ts +5 -0
- package/dist/components/retrieval/graph/graph.class.js +1 -1
- package/dist/components/retrieval/graph/graph.styles.js +0 -30
- package/dist/components/retrieval/graph-legend/graph-legend.styles.js +0 -3
- package/dist/components/retrieval/grounding-summary/grounding-summary.class.js +2 -2
- package/dist/components/retrieval/ingestion-queue/ingestion-queue.styles.js +0 -25
- package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.class.d.ts +2 -0
- package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.styles.js +0 -7
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +20 -6
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +2 -2
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.styles.js +6 -11
- package/dist/components/retrieval/memory-panel/memory-panel.class.js +1 -1
- package/dist/components/retrieval/mind-map/mind-map.class.d.ts +5 -3
- package/dist/components/retrieval/mind-map/mind-map.class.js +1 -1
- package/dist/components/retrieval/mind-map/mind-map.styles.js +0 -2
- package/dist/components/retrieval/neighbor-list/neighbor-list.class.d.ts +3 -2
- package/dist/components/retrieval/neighbor-list/neighbor-list.class.js +1 -1
- package/dist/components/retrieval/neighbor-list/neighbor-list.styles.js +0 -30
- package/dist/components/retrieval/node-palette/node-palette.styles.js +0 -11
- package/dist/components/retrieval/path-strip/path-strip.styles.js +0 -10
- package/dist/components/retrieval/provenance-panel/provenance-panel.class.d.ts +12 -3
- package/dist/components/retrieval/provenance-panel/provenance-panel.class.js +1 -1
- package/dist/components/retrieval/provenance-panel/provenance-panel.styles.js +0 -2
- package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.d.ts +3 -2
- package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.js +2 -2
- package/dist/components/retrieval/retrieval-results/retrieval-results.styles.js +0 -28
- package/dist/components/retrieval/retrieval-search/retrieval-search.styles.js +0 -4
- package/dist/components/retrieval/retrieval-trace/retrieval-trace.class.js +1 -1
- package/dist/components/retrieval/retrieval-trace/retrieval-trace.styles.js +0 -2
- package/dist/components/retrieval/source-card/source-card.styles.js +0 -13
- package/dist/components/retrieval/source-list/source-list.styles.js +0 -7
- package/dist/components/retrieval/source-picker/source-picker.class.js +1 -1
- package/dist/components/retrieval/source-picker/source-picker.styles.js +0 -7
- package/dist/components/utility/copy-button/copy-button.styles.js +0 -10
- package/dist/components/utility/diff-view/diff-view.styles.js +0 -14
- package/dist/components/utility/export-button/export-button.styles.js +0 -22
- package/dist/components/utility/icon/icon.styles.js +0 -6
- package/dist/components/utility/json-viewer/json-viewer.styles.js +2 -48
- package/dist/components/utility/known-date/known-date.class.d.ts +7 -3
- package/dist/components/utility/known-date/known-date.styles.js +10 -51
- package/dist/components/utility/live-region/live-region.styles.js +0 -4
- package/dist/components/utility/mention-popover/mention-popover.styles.js +0 -25
- package/dist/components/utility/poll-status/poll-status.styles.js +0 -4
- package/dist/components/utility/random-content/random-content.class.d.ts +22 -0
- package/dist/components/utility/random-content/random-content.class.js +3 -2
- package/dist/components/utility/random-content/random-content.styles.js +6 -13
- package/dist/components/utility/tour/tour.class.d.ts +4 -2
- package/dist/components/utility/tour/tour.class.js +3 -3
- package/dist/components/utility/tour/tour.styles.js +0 -13
- package/dist/components/utility/visually-hidden/visually-hidden.styles.js +0 -5
- package/dist/components/viewers/archive-viewer/archive-viewer.class.js +1 -1
- package/dist/components/viewers/archive-viewer/archive-viewer.styles.d.ts +2 -2
- package/dist/components/viewers/archive-viewer/archive-viewer.styles.js +0 -10
- package/dist/components/viewers/contact-viewer/contact-viewer.class.js +1 -1
- package/dist/components/viewers/csv-viewer/csv-viewer.class.js +1 -1
- package/dist/components/viewers/csv-viewer/csv-viewer.styles.js +0 -19
- package/dist/components/viewers/dataset-viewer/dataset-viewer.class.js +1 -1
- package/dist/components/viewers/dataset-viewer/dataset-viewer.styles.js +0 -15
- package/dist/components/viewers/document-compare/document-compare.class.js +1 -1
- package/dist/components/viewers/document-compare/document-compare.styles.js +0 -3
- package/dist/components/viewers/document-preview/document-preview.styles.js +0 -25
- package/dist/components/viewers/document-viewer/document-viewer.class.d.ts +2 -1
- package/dist/components/viewers/document-viewer/document-viewer.class.js +1 -1
- package/dist/components/viewers/document-viewer/document-viewer.styles.js +0 -5
- package/dist/components/viewers/docx-viewer/docx-viewer.styles.js +0 -17
- package/dist/components/viewers/ebook-viewer/ebook-viewer.class.js +1 -1
- package/dist/components/viewers/ebook-viewer/ebook-viewer.styles.js +0 -4
- package/dist/components/viewers/email-viewer/email-viewer.styles.js +0 -7
- package/dist/components/viewers/geojson-view/geojson-view.styles.js +0 -5
- package/dist/components/viewers/highlight-layer/highlight-layer.styles.js +0 -3
- package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +1 -1
- package/dist/components/viewers/notebook-viewer/notebook-viewer.styles.js +0 -38
- package/dist/components/viewers/page-rail/page-rail.class.js +1 -1
- package/dist/components/viewers/page-rail/page-rail.styles.js +0 -13
- package/dist/components/viewers/pdf-viewer/pdf-loader.d.ts +13 -2
- package/dist/components/viewers/pdf-viewer/pdf-loader.js +1 -1
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts +32 -2
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +4 -4
- package/dist/components/viewers/pdf-viewer/pdf-viewer.styles.js +1 -27
- package/dist/components/viewers/pptx-viewer/pptx-viewer.styles.js +0 -3
- package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.js +1 -1
- package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.styles.js +0 -14
- package/dist/components/viewers/svg-viewer/svg-viewer.styles.js +0 -7
- package/dist/components/viewers/xml-viewer/xml-viewer.styles.js +2 -24
- package/dist/custom-elements-jsx.d.ts +56 -37
- package/dist/events.d.ts +43 -33
- package/dist/internal/agent-status-variants.d.ts +18 -0
- package/dist/internal/agent-status-variants.js +1 -0
- package/dist/internal/announcer.d.ts +8 -3
- package/dist/internal/announcer.js +1 -1
- package/dist/internal/autoloader-manifest.js +1 -1
- package/dist/internal/canvas-color.d.ts +16 -0
- package/dist/internal/canvas-color.js +1 -1
- package/dist/internal/catalog-picker.d.ts +0 -1
- package/dist/internal/catalog-picker.js +1 -1
- package/dist/internal/default-strings.generated.d.ts +1 -0
- package/dist/internal/default-strings.generated.js +1 -1
- package/dist/internal/dev-mode-attribute-warning.d.ts +30 -0
- package/dist/internal/dev-mode-attribute-warning.js +1 -0
- package/dist/internal/localization-runtime.js +1 -1
- package/dist/internal/localization-types.d.ts +1 -1
- package/dist/internal/localization.js +1 -1
- package/dist/internal/lyra-element.d.ts +13 -0
- package/dist/internal/lyra-element.js +1 -1
- package/dist/internal/media-controller.js +1 -1
- package/dist/internal/package-metadata.d.ts +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/scroll-overflow.d.ts +35 -13
- package/dist/internal/scroll-overflow.js +1 -1
- package/dist/internal/sizes.styles.js +0 -2
- package/dist/internal/specialist-tokens.styles.js +6 -11
- package/dist/internal/text-highlights.d.ts +4 -1
- package/dist/internal/text-highlights.js +1 -1
- package/dist/internal/tokens/palette.styles.js +0 -15
- package/dist/internal/tokens.styles.js +19 -113
- package/dist/lyra.d.ts +8 -5
- package/dist/styles/reservations.css +82 -0
- package/dist/svelte.d.ts +56 -37
- package/dist/translations/ar.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/pt-BR.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/zh-CN.js +1 -1
- package/dist/vue.d.ts +56 -37
- package/llms/components/lr-accordion-item.md +12 -3
- package/llms/components/lr-accordion.md +11 -2
- package/llms/components/lr-agent-eval-dashboard.md +1 -1
- package/llms/components/lr-agent-trace.md +3 -1
- package/llms/components/lr-agent-workspace.md +20 -0
- package/llms/components/lr-artifact-panel.md +10 -4
- package/llms/components/lr-attachment-chip.md +7 -4
- package/llms/components/lr-attachment-trigger.md +9 -6
- package/llms/components/lr-av-player.md +3 -1
- package/llms/components/lr-avatar.md +6 -6
- package/llms/components/lr-bar-chart.md +4 -3
- package/llms/components/lr-box-plot.md +1 -1
- package/llms/components/lr-browser-frame.md +7 -3
- package/llms/components/lr-bubble-chart.md +4 -3
- package/llms/components/lr-calendar.md +9 -2
- package/llms/components/lr-card.md +24 -0
- package/llms/components/lr-chart.md +32 -8
- package/llms/components/lr-chat-viewport.md +7 -2
- package/llms/components/lr-checkbox-group.md +13 -5
- package/llms/components/lr-checkbox.md +5 -2
- package/llms/components/lr-checkpoint.md +6 -2
- package/llms/components/lr-combobox.md +5 -2
- package/llms/components/lr-command-palette.md +4 -1
- package/llms/components/lr-confirm-bar.md +7 -3
- package/llms/components/lr-context-meter.md +12 -11
- package/llms/components/lr-conversation-item.md +7 -4
- package/llms/components/lr-details.md +11 -2
- package/llms/components/lr-dialog.md +15 -10
- package/llms/components/lr-dock-panel.md +7 -10
- package/llms/components/lr-document-preview.md +6 -1
- package/llms/components/lr-document-viewer.md +3 -2
- package/llms/components/lr-doughnut-chart.md +4 -3
- package/llms/components/lr-drawer.md +3 -3
- package/llms/components/lr-entity-card.md +3 -3
- package/llms/components/lr-entity-chip.md +1 -1
- package/llms/components/lr-entity-dossier.md +4 -1
- package/llms/components/lr-file-input.md +2 -2
- package/llms/components/lr-flag.md +20 -5
- package/llms/components/lr-heatmap.md +29 -1
- package/llms/components/lr-histogram.md +3 -1
- package/llms/components/lr-icon.md +1 -1
- package/llms/components/lr-json-schema-viewer.md +2 -1
- package/llms/components/lr-knowledge-graph-explorer.md +8 -3
- package/llms/components/lr-known-date.md +4 -2
- package/llms/components/lr-line-chart.md +4 -3
- package/llms/components/lr-lite-chart.md +16 -6
- package/llms/components/lr-map.md +72 -8
- package/llms/components/lr-markdown-core.md +3 -2
- package/llms/components/lr-media-card.md +28 -12
- package/llms/components/lr-message-parts.md +2 -1
- package/llms/components/lr-model-select.md +9 -10
- package/llms/components/lr-model-settings-panel.md +9 -9
- package/llms/components/lr-neighbor-list.md +1 -1
- package/llms/components/lr-notebook-viewer.md +6 -3
- package/llms/components/lr-option.md +5 -2
- package/llms/components/lr-pdf-viewer.md +62 -2
- package/llms/components/lr-pie-chart.md +4 -3
- package/llms/components/lr-polar-area-chart.md +4 -3
- package/llms/components/lr-popover.md +5 -0
- package/llms/components/lr-progress-ring.md +8 -1
- package/llms/components/lr-prompt-studio.md +1 -1
- package/llms/components/lr-provenance-panel.md +4 -2
- package/llms/components/lr-qr-code.md +1 -1
- package/llms/components/lr-radar-chart.md +4 -3
- package/llms/components/lr-rag-eval-dashboard.md +2 -2
- package/llms/components/lr-random-content.md +13 -0
- package/llms/components/lr-reorder-item.md +6 -1
- package/llms/components/lr-reorder-list.md +6 -1
- package/llms/components/lr-responsive-panel.md +11 -7
- package/llms/components/lr-scatter-chart.md +4 -3
- package/llms/components/lr-sequence-strip.md +16 -2
- package/llms/components/lr-slider.md +12 -5
- package/llms/components/lr-sparkline.md +1 -1
- package/llms/components/lr-suggestion-chips.md +7 -2
- package/llms/components/lr-swatch-picker.md +5 -5
- package/llms/components/lr-switch.md +5 -2
- package/llms/components/lr-table.md +30 -4
- package/llms/components/lr-terminal.md +3 -1
- package/llms/components/lr-thread-list.md +8 -8
- package/llms/components/lr-time-input.md +6 -1
- package/llms/components/lr-timeline-item.md +24 -0
- package/llms/components/lr-timeline.md +25 -1
- package/llms/components/lr-token-input.md +7 -2
- package/llms/components/lr-tool-approval-dialog.md +7 -8
- package/llms/components/lr-tool-call-chip.md +5 -1
- package/llms/components/lr-tool-param-form.md +14 -12
- package/llms/components/lr-tool-result-dialog.md +11 -9
- package/llms/components/lr-tool-result-view.md +7 -6
- package/llms/components/lr-tool-select-dialog.md +18 -16
- package/llms/components/lr-trace-tree.md +3 -1
- package/llms/components/lr-usage-badge.md +4 -1
- package/llms/components/lr-video-playlist.md +1 -1
- package/llms/components/lr-virtual-list.md +22 -14
- package/llms/components/lr-voice-picker.md +8 -5
- package/llms/components/lr-widget-renderer.md +3 -3
- package/llms/components/lr-widget.md +1 -1
- package/llms/components/lr-word-cloud.md +6 -2
- package/llms/index.md +1 -1
- package/llms/peers.md +13 -3
- package/llms/shared.md +83 -2
- package/llms-full.txt +1159 -288
- package/package.json +19 -7
- package/vscode-css-data.json +37 -2
- package/vscode-html-data.json +402 -45
- package/web-types.json +300 -56
|
@@ -20,14 +20,6 @@ import{css}from"lit";const styles=css`
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
[part='controls'] > * {
|
|
23
|
-
/* The prompt-scoped width hook avoids an ancestor-wide generic control collision. Unlike
|
|
24
|
-
lr-model-select's own
|
|
25
|
-
min-inline-size, which resolves through --lr-size-12rem directly) -- an unset custom
|
|
26
|
-
property makes var() invalid at computed-value time, which invalidates this whole
|
|
27
|
-
declaration (min-inline-size falls back to its auto initial value; flex-basis, below,
|
|
28
|
-
falls back to auto too) rather than merely omitting the min/basis. --lr-size-12rem
|
|
29
|
-
mirrors the min-inline-size lr-model-select's own popover uses for the same "one control
|
|
30
|
-
row item" sizing purpose. */
|
|
31
23
|
min-inline-size: min(100%, var(--lr-prompt-input-control-width, var(--lr-size-12rem)));
|
|
32
24
|
flex: 1 1 var(--lr-prompt-input-control-width, var(--lr-size-12rem));
|
|
33
25
|
}
|
|
@@ -48,8 +40,6 @@ import{css}from"lit";const styles=css`
|
|
|
48
40
|
[part='sources-summary']:hover {
|
|
49
41
|
color: var(--lr-color-brand);
|
|
50
42
|
}
|
|
51
|
-
/* The summary is a disclosure control, so the press gets a fill on top of the hover recolor --
|
|
52
|
-
mixed from [part='sources']'s own surface, which is what shows through the summary at rest. */
|
|
53
43
|
[part='sources-summary']:active {
|
|
54
44
|
color: var(--lr-color-brand);
|
|
55
45
|
background: color-mix(in oklab, var(--lr-color-surface), var(--lr-color-mix-partner) var(--lr-color-mix-active));
|
|
@@ -34,15 +34,9 @@ import{css}from"lit";const styles=css`
|
|
|
34
34
|
opacity: var(--lr-opacity-disabled);
|
|
35
35
|
cursor: not-allowed;
|
|
36
36
|
}
|
|
37
|
-
/* :where() zeroes the wrapped selectors' specificity contribution, leaving this at (0,1,0) --
|
|
38
|
-
matches lr-attachment-trigger's fixed convention, so a consumer's ::part(trigger):hover
|
|
39
|
-
override ((0,1,1)) still wins without needing !important. */
|
|
40
37
|
:where([part='trigger']):hover:where(:not(:disabled)) {
|
|
41
38
|
background: var(--lr-color-brand-quiet);
|
|
42
39
|
}
|
|
43
|
-
/* Press-and-hold is this component's entire interaction, so the pressed fill is not decoration:
|
|
44
|
-
it is the "I am registering your hold" signal, and it appears the instant the pointer goes
|
|
45
|
-
down -- before the recording state and its pulse ring have anything to show. */
|
|
46
40
|
:where([part='trigger']):active:where(:not(:disabled)) {
|
|
47
41
|
background: color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active));
|
|
48
42
|
}
|
|
@@ -64,8 +58,6 @@ import{css}from"lit";const styles=css`
|
|
|
64
58
|
position: absolute;
|
|
65
59
|
inset: calc(-1 * var(--lr-size-4px));
|
|
66
60
|
border-radius: 50%;
|
|
67
|
-
/* The aggregate recording color remains the shared fallback, while the ring can be retinted
|
|
68
|
-
independently from the trigger's border and foreground. */
|
|
69
61
|
border: var(--lr-border-width-medium) solid
|
|
70
62
|
var(
|
|
71
63
|
--lr-push-to-talk-pulse-recording-border-color,
|
|
@@ -3,7 +3,7 @@ import{css}from"lit";const styles=css`
|
|
|
3
3
|
[part='base'] { display: flex; flex-direction: column; gap: var(--lr-space-m); }
|
|
4
4
|
[part='header'] { display: grid; grid-template-columns: auto minmax(var(--lr-size-8rem), 1fr) auto; gap: var(--lr-space-s); align-items: center; }
|
|
5
5
|
[part='activity'] { min-inline-size: 0; }
|
|
6
|
-
[part='status'] { min-inline-size: 0; max-inline-size: 100%; overflow-wrap:
|
|
6
|
+
[part='status'] { min-inline-size: 0; max-inline-size: 100%; overflow-wrap: break-word; }
|
|
7
7
|
[part='controls'] { display: flex; flex-wrap: wrap; gap: var(--lr-space-xs); }
|
|
8
8
|
[part='controls'] button {
|
|
9
9
|
min-block-size: var(--lr-icon-button-size); padding: var(--lr-space-xs) var(--lr-space-s); border: var(--lr-border-width-thin) solid var(--lr-color-border);
|
|
@@ -6,7 +6,7 @@ import{css}from"lit";const styles=css`
|
|
|
6
6
|
|
|
7
7
|
[part='toolbar'] {
|
|
8
8
|
position: fixed;
|
|
9
|
-
z-index: var(--lr-overlay-stack-index,
|
|
9
|
+
z-index: var(--lr-overlay-stack-index, var(--lr-layer-popover));
|
|
10
10
|
inset-inline-start: var(--_lr-selection-toolbar-inline-start);
|
|
11
11
|
inset-block-start: var(--_lr-selection-toolbar-block-start);
|
|
12
12
|
display: flex;
|
|
@@ -24,7 +24,6 @@ import{css}from"lit";const styles=css`
|
|
|
24
24
|
border: var(--lr-border-width-thin) solid var(--lr-color-border);
|
|
25
25
|
border-radius: var(--lr-radius);
|
|
26
26
|
background: var(--lr-color-surface);
|
|
27
|
-
/* Anchored overlay: a floating toolbar pinned to the current selection, not a modal layer. */
|
|
28
27
|
box-shadow: var(--lr-shadow-m);
|
|
29
28
|
transform: translate(
|
|
30
29
|
-50%,
|
|
@@ -70,10 +69,6 @@ import{css}from"lit";const styles=css`
|
|
|
70
69
|
color: var(--lr-color-brand);
|
|
71
70
|
}
|
|
72
71
|
|
|
73
|
-
/* Each action is an <lr-button appearance="plain">, which already supplies its own pressed
|
|
74
|
-
treatment (--lr-button-active-scale) inside its shadow root. What this rule adds is the
|
|
75
|
-
toolbar's brand accent escalated one step -- a background box on the host would sit behind the
|
|
76
|
-
button's own transparent base and read as a second, misaligned control. */
|
|
77
72
|
[part~='action']:active {
|
|
78
73
|
color: color-mix(in oklab, var(--lr-color-brand), var(--lr-color-mix-partner) var(--lr-color-mix-active));
|
|
79
74
|
}
|
|
@@ -83,9 +78,4 @@ import{css}from"lit";const styles=css`
|
|
|
83
78
|
outline-offset: var(--lr-focus-ring-offset);
|
|
84
79
|
}
|
|
85
80
|
|
|
86
|
-
@media (prefers-reduced-motion: reduce) {
|
|
87
|
-
[part='toolbar'] {
|
|
88
|
-
transition: none;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
81
|
`;export{styles};
|
|
@@ -4,15 +4,10 @@ import{css}from"lit";const styles=css`
|
|
|
4
4
|
min-inline-size: 0;
|
|
5
5
|
max-inline-size: 100%;
|
|
6
6
|
vertical-align: middle;
|
|
7
|
-
/* Keep the public hooks undeclared here: a consumer may set either one
|
|
8
|
-
on an ancestor. The private values below retain per-phase defaults when
|
|
9
|
-
the public hook is unset, following lr-timeline-item's marker pattern. */
|
|
10
7
|
--_lr-stream-status-dot-color-default: var(--lr-color-text-quiet);
|
|
11
8
|
--_lr-stream-status-dot-opacity-default: 0.35;
|
|
12
9
|
}
|
|
13
10
|
|
|
14
|
-
/* 'connecting' gets a dimmer, static brand dot -- present but deliberately
|
|
15
|
-
quieter than 'streaming' so the two are never confused at a glance. */
|
|
16
11
|
:host([connection-state='connecting']) {
|
|
17
12
|
--_lr-stream-status-dot-color-default: var(--lr-color-brand);
|
|
18
13
|
--_lr-stream-status-dot-opacity-default: 0.6;
|
|
@@ -21,8 +16,6 @@ import{css}from"lit";const styles=css`
|
|
|
21
16
|
--_lr-stream-status-dot-color-default: var(--lr-color-brand);
|
|
22
17
|
--_lr-stream-status-dot-opacity-default: 1;
|
|
23
18
|
}
|
|
24
|
-
/* Warning, not danger -- see the class doc's "Visual" section for why a
|
|
25
|
-
stall defaults to the recoverable/actionable tone. */
|
|
26
19
|
:host([data-stalled]) {
|
|
27
20
|
--_lr-stream-status-dot-color-default: var(--lr-color-warning);
|
|
28
21
|
--_lr-stream-status-dot-opacity-default: 1;
|
|
@@ -41,9 +34,6 @@ import{css}from"lit";const styles=css`
|
|
|
41
34
|
border-color var(--lr-transition-base);
|
|
42
35
|
}
|
|
43
36
|
|
|
44
|
-
/* The one "unmistakable" treatment the spec calls for: a stall tints the
|
|
45
|
-
whole row, not just the dot, so the message/actions read as one alert
|
|
46
|
-
unit rather than a plain dot next to unrelated-looking text. */
|
|
47
37
|
:host([data-stalled]) [part='base'] {
|
|
48
38
|
padding: var(--lr-space-xs) var(--lr-space-s);
|
|
49
39
|
background: var(--lr-stream-status-stalled-bg, var(--lr-color-warning-quiet));
|
|
@@ -75,12 +65,6 @@ import{css}from"lit";const styles=css`
|
|
|
75
65
|
font-weight: var(--lr-font-weight-semibold);
|
|
76
66
|
}
|
|
77
67
|
|
|
78
|
-
/* Only 'streaming' pulses -- a moving dot reads as "actively receiving
|
|
79
|
-
data right now"; every other phase (including 'stalled', which wants
|
|
80
|
-
steady attention via color/tint, not extra motion) stays static. Same
|
|
81
|
-
token/rationale as lr-typing-indicator's pulse variant -- see that
|
|
82
|
-
component's styles for the full explanation of why
|
|
83
|
-
--lr-transition-ambient is the right length for an ambient loop. */
|
|
84
68
|
:host([connection-state='streaming']:not([data-stalled])) [part='indicator'] {
|
|
85
69
|
animation: lr-stream-status-pulse var(--lr-transition-ambient) infinite;
|
|
86
70
|
}
|
|
@@ -8,17 +8,10 @@ import{css}from"lit";const styles=css`
|
|
|
8
8
|
line-height: var(--lr-line-height-loose);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
/* Plain-text path only (Markdown mode never renders this element) -- see
|
|
12
|
-
the class doc for why Markdown content can't share this same
|
|
13
|
-
white-space treatment. */
|
|
14
11
|
.plain {
|
|
15
12
|
white-space: pre-wrap;
|
|
16
13
|
}
|
|
17
14
|
|
|
18
|
-
/* inline-block (not inline) so it participates in text layout on the same
|
|
19
|
-
line as the preceding content while still accepting a fixed block-size
|
|
20
|
-
for the bar -- in plain-text mode this sits at the visual tail of the
|
|
21
|
-
final wrapped line, immediately after the last character. */
|
|
22
15
|
[part='cursor'] {
|
|
23
16
|
display: inline-block;
|
|
24
17
|
vertical-align: text-bottom;
|
|
@@ -27,15 +20,9 @@ import{css}from"lit";const styles=css`
|
|
|
27
20
|
margin-inline-start: var(--lr-space-xs);
|
|
28
21
|
background: currentColor;
|
|
29
22
|
border-radius: var(--lr-inline-cursor-width, var(--lr-size-0-125rem));
|
|
30
|
-
/* Ambient, infinite "still alive" indicator, not a discrete state flip --
|
|
31
|
-
same reasoning as lr-typing-indicator's own cursor variant, which
|
|
32
|
-
uses this same token for the identical blink pattern. */
|
|
33
23
|
animation: lr-streaming-text-cursor-blink var(--lr-transition-ambient) infinite;
|
|
34
24
|
}
|
|
35
25
|
|
|
36
|
-
/* Two adjacent keyframe stops (49% / 50%) either side of an instant flip,
|
|
37
|
-
same shape as lr-typing-indicator's cursor variant, so the blink still
|
|
38
|
-
reads as a sharp on/off even under the token's own ease-out timing. */
|
|
39
26
|
@keyframes lr-streaming-text-cursor-blink {
|
|
40
27
|
0%,
|
|
41
28
|
49% {
|
|
@@ -47,8 +34,6 @@ import{css}from"lit";const styles=css`
|
|
|
47
34
|
}
|
|
48
35
|
}
|
|
49
36
|
|
|
50
|
-
/* Degrades to a static, fully-visible bar -- never a frozen mid-blink
|
|
51
|
-
(invisible) frame. */
|
|
52
37
|
@media (prefers-reduced-motion: reduce) {
|
|
53
38
|
[part='cursor'] {
|
|
54
39
|
animation: none !important;
|
|
@@ -6,9 +6,6 @@ import{css}from"lit";const styles=css`
|
|
|
6
6
|
[part='base'] {
|
|
7
7
|
max-inline-size: 100%;
|
|
8
8
|
}
|
|
9
|
-
/* Line packing is consumer-tunable because it is unreachable otherwise: centering the chips under
|
|
10
|
-
centered empty-state text needs the wrapped final line centered too, and ::part(base) can only
|
|
11
|
-
center the row while it still fits on one line. */
|
|
12
9
|
.row {
|
|
13
10
|
display: flex;
|
|
14
11
|
justify-content: var(--lr-suggestion-chips-justify, flex-start);
|
|
@@ -49,8 +46,6 @@ import{css}from"lit";const styles=css`
|
|
|
49
46
|
background: var(--lr-suggestion-chips-hover-bg, var(--lr-color-brand-quiet));
|
|
50
47
|
border-color: var(--lr-suggestion-chips-hover-border, var(--lr-color-brand));
|
|
51
48
|
}
|
|
52
|
-
/* Mixes the SAME --lr-suggestion-chips-hover-bg the rule above uses, so a consumer retinting the
|
|
53
|
-
hover fill gets a matching pressed step without a second custom property to keep in sync. */
|
|
54
49
|
[part~='chip']:active {
|
|
55
50
|
background: color-mix(
|
|
56
51
|
in oklab,
|
|
@@ -30,10 +30,6 @@ import{css}from"lit";const styles=css`
|
|
|
30
30
|
outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);
|
|
31
31
|
outline-offset: var(--lr-focus-ring-offset);
|
|
32
32
|
}
|
|
33
|
-
/* no-pressed-state: [part='search-input'] is a text field. A press on it is answered by the field
|
|
34
|
-
taking focus and raising its focus ring, which is both stronger than any momentary pressed tint
|
|
35
|
-
and outlasts the mouse button; a second, competing flash on mousedown would only add noise to
|
|
36
|
-
the one interaction that already has unambiguous feedback. */
|
|
37
33
|
[part='search-input']:hover {
|
|
38
34
|
border-color: var(--lr-color-brand);
|
|
39
35
|
}
|
|
@@ -52,14 +48,6 @@ import{css}from"lit";const styles=css`
|
|
|
52
48
|
display: flex;
|
|
53
49
|
flex-direction: column;
|
|
54
50
|
}
|
|
55
|
-
/* The internal list has to fill whatever height this component was given, instead of scrolling
|
|
56
|
-
inside lr-virtual-list's own 24rem --lr-virtual-list-height default. Deliberately *not*
|
|
57
|
-
--lr-virtual-list-height: 100%: that percentage resolves against this host, which is a flex
|
|
58
|
-
item, so in an auto-height container it chains to auto and the viewport either collapses to
|
|
59
|
-
zero (no rows) or grows to the full un-virtualized content height (rows). Making the list host
|
|
60
|
-
a column flex container instead turns the shipped block-size: 24rem on [part='base'] into its
|
|
61
|
-
*flex-basis*: it grows to fill a bounded pane, shrinks below 24rem in a short one, and in an
|
|
62
|
-
auto-height container falls back to exactly the 24rem it renders at today. */
|
|
63
51
|
lr-virtual-list {
|
|
64
52
|
flex: 1 1 auto;
|
|
65
53
|
min-block-size: 0;
|
|
@@ -84,11 +72,6 @@ import{css}from"lit";const styles=css`
|
|
|
84
72
|
background: var(--lr-color-surface);
|
|
85
73
|
color: var(--lr-color-text-quiet);
|
|
86
74
|
}
|
|
87
|
-
/* sticky-groups: the pinned copy of the current group header. lr-virtual-list ships that layer
|
|
88
|
-
pointer-transparent, because it is a copy of a row that already exists; this component's header
|
|
89
|
-
owns a real collapse toggle, so it opts back in. Everything else about the copy -- padding,
|
|
90
|
-
background, the toggle and icon -- comes from the group-header/group-toggle/group-icon rules
|
|
91
|
-
around this one, which the copy shares by rendering the same parts. */
|
|
92
75
|
lr-virtual-list::part(sticky-group) {
|
|
93
76
|
pointer-events: auto;
|
|
94
77
|
}
|
|
@@ -138,12 +121,15 @@ import{css}from"lit";const styles=css`
|
|
|
138
121
|
lr-virtual-list::part(row-actions) {
|
|
139
122
|
min-inline-size: 0;
|
|
140
123
|
}
|
|
124
|
+
lr-virtual-list::part(row-start),
|
|
125
|
+
lr-virtual-list::part(row-actions) {
|
|
126
|
+
display: inline-flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
}
|
|
141
129
|
lr-virtual-list::part(row-action) {
|
|
142
130
|
display: inline-flex;
|
|
143
131
|
align-items: center;
|
|
144
132
|
justify-content: center;
|
|
145
|
-
/* Keep the glyph compact while giving the interactive box the shared
|
|
146
|
-
minimum target size. */
|
|
147
133
|
inline-size: var(--lr-size-1-5rem);
|
|
148
134
|
block-size: var(--lr-size-1-5rem);
|
|
149
135
|
min-inline-size: var(--lr-icon-button-size);
|
|
@@ -42,9 +42,9 @@ export interface LyraTranscriptFeedEventMap {
|
|
|
42
42
|
*
|
|
43
43
|
* @customElement lr-transcript-feed
|
|
44
44
|
* @slot empty - Custom empty state. Default: the localized "No transcript yet".
|
|
45
|
-
* @event lr-follow-change - `detail: { following: boolean }` —
|
|
46
|
-
*
|
|
47
|
-
*
|
|
45
|
+
* @event lr-follow-change - `detail: { following: boolean }` — a user scroll or jump-button click
|
|
46
|
+
* changed stick-to-bottom. Direct `follow` assignments and calling `scrollToBottom()` directly
|
|
47
|
+
* are controlled input and do not echo an event, matching `lr-terminal`'s identical contract.
|
|
48
48
|
* @csspart base - The scroll container.
|
|
49
49
|
* @csspart log - The `role="log"` region wrapping final entries only.
|
|
50
50
|
* @csspart interim-area - The wrapper around the interim (not-yet-final) entries, rendered as a sibling of `log`. Only rendered while at least one interim entry exists.
|
|
@@ -114,9 +114,21 @@ export declare class LyraTranscriptFeed extends LyraElement<LyraTranscriptFeedEv
|
|
|
114
114
|
/** Re-engages `follow` and scrolls the feed to its current bottom, instantly -- matching the
|
|
115
115
|
* shared stick-to-bottom contract. New entries can arrive in rapid succession while streaming;
|
|
116
116
|
* an animated scroll on every single one would fight itself rather than settle cleanly, so this
|
|
117
|
-
* is a plain jump rather than a CSS-smoothed transition.
|
|
117
|
+
* is a plain jump rather than a CSS-smoothed transition. Imperative navigation, like a direct
|
|
118
|
+
* `follow` assignment: does not itself emit `lr-follow-change` (see `onJumpClick`, the
|
|
119
|
+
* user-driven wrapper that does, mirroring `lr-terminal`'s `scrollToBottom()`/`jumpToLatest()`
|
|
120
|
+
* split). */
|
|
118
121
|
scrollToBottom(): void;
|
|
122
|
+
/** The sole source of a user-driven `follow` transition from scrolling: this handler runs only
|
|
123
|
+
* in response to a real `scroll` event on `[part="base"]`, so setting `follow` here -- unlike a
|
|
124
|
+
* generic `updated()` diff of the property, which cannot tell a user scroll from a host
|
|
125
|
+
* assignment or this component's own `scrollToBottom()` -- is unambiguously the user's own
|
|
126
|
+
* action, and is the only path that emits `lr-follow-change`. */
|
|
119
127
|
private onScroll;
|
|
128
|
+
/** The jump-button's click handler: the other user-driven source of an `lr-follow-change`
|
|
129
|
+
* transition. Delegates the actual re-engage/scroll to `scrollToBottom()` (which does not
|
|
130
|
+
* itself emit) and emits only when clicking it actually changed `follow` -- identical shape to
|
|
131
|
+
* `lr-terminal`'s `jumpToLatest()`. */
|
|
120
132
|
private onJumpClick;
|
|
121
133
|
private showSpeakerFor;
|
|
122
134
|
private formatTs;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{repeat}from"lit/directives/repeat.js";import{LyraElement}from"../../../internal/lyra-element.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{getDateTimeFormat}from"../../../internal/intl-cache.js";import{finiteCount}from"../../../internal/numbers.js";import{styles}from"./transcript-feed.styles.js";import{presenceTrueDefaultBooleanConverter as trueDefaultBooleanConverter}from"../../../internal/converters.js";import{normalizeLyraTimestamp}from"../timestamp.js";import{LYRA_DEFAULT_jumpToLatest,LYRA_DEFAULT_transcriptFeedEmpty,LYRA_DEFAULT_transcriptFeedInterim,LYRA_DEFAULT_transcriptFeedLabel}from"../../../internal/default-strings.generated.js";const NEAR_BOTTOM_PX=48;class LyraTranscriptFeed extends LyraElement{constructor(){super(...arguments),this.entries=[],this.follow=!0,this.showTimestamps=!1,this.maxRenderedEntries=500,this.sessionId="",this.accessibleLabel=null,this._isFirstUpdate=!0,this.announcedFinalIds=new Set,this.sessionChanged=!1,this.onScroll=e=>{const base=e.currentTarget,atBottom=base.scrollHeight-base.scrollTop-base.clientHeight<=NEAR_BOTTOM_PX;atBottom!==this.follow&&(this.follow=atBottom)},this.onJumpClick=()=>{this.scrollToBottom()}}static{this.defaultStrings={...super.defaultStrings,jumpToLatest:LYRA_DEFAULT_jumpToLatest,transcriptFeedEmpty:LYRA_DEFAULT_transcriptFeedEmpty,transcriptFeedInterim:LYRA_DEFAULT_transcriptFeedInterim,transcriptFeedLabel:LYRA_DEFAULT_transcriptFeedLabel}}static{this.ownedCollectionProperties=Object.freeze(["entries"])}static{this.styles=[LyraElement.styles,styles]}get effectiveMaxRenderedEntries(){return finiteCount(this.maxRenderedEntries,500)}get normalizedEntries(){const seen=new Set;return this.entries.filter(entry=>entry===null||typeof entry!="object"||typeof entry.id!="string"||entry.id.trim().length===0||seen.has(entry.id)?!1:(seen.add(entry.id),!0))}get renderedEntries(){const entries=this.normalizedEntries,maxRenderedEntries=this.effectiveMaxRenderedEntries;return maxRenderedEntries>0&&entries.length>maxRenderedEntries?entries.slice(-maxRenderedEntries):entries}connectedCallback(){super.connectedCallback(),this.syncAnnouncementSink()}disconnectedCallback(){super.disconnectedCallback(),this.releaseAnnouncementSink()}adoptedCallback(){super.adoptedCallback(),this.syncAnnouncementSink()}releaseAnnouncementSink(){this.announcementSink?.release(),this.announcementSink=void 0}syncAnnouncementSink(){if(!this.isConnected){this.releaseAnnouncementSink();return}this.announcementSink?.element.ownerDocument!==this.ownerDocument&&(this.releaseAnnouncementSink(),this.announcementSink=acquireAnnouncementSink("polite",{document:this.ownerDocument,source:this}))}willUpdate(changed){super.willUpdate(changed),this._isFirstUpdate=!this.hasUpdated,this.sessionChanged=changed.has("sessionId")&&this.hasUpdated,this.sessionChanged&&this.announcedFinalIds.clear()}updated(changed){super.updated(changed),changed.has("entries")&&(this.follow&&this.scrollToBottom(),this.announceFinalizedEntries())
|
|
1
|
+
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{repeat}from"lit/directives/repeat.js";import{LyraElement}from"../../../internal/lyra-element.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{getDateTimeFormat}from"../../../internal/intl-cache.js";import{finiteCount}from"../../../internal/numbers.js";import{styles}from"./transcript-feed.styles.js";import{presenceTrueDefaultBooleanConverter as trueDefaultBooleanConverter}from"../../../internal/converters.js";import{normalizeLyraTimestamp}from"../timestamp.js";import{LYRA_DEFAULT_jumpToLatest,LYRA_DEFAULT_transcriptFeedEmpty,LYRA_DEFAULT_transcriptFeedInterim,LYRA_DEFAULT_transcriptFeedLabel}from"../../../internal/default-strings.generated.js";const NEAR_BOTTOM_PX=48;class LyraTranscriptFeed extends LyraElement{constructor(){super(...arguments),this.entries=[],this.follow=!0,this.showTimestamps=!1,this.maxRenderedEntries=500,this.sessionId="",this.accessibleLabel=null,this._isFirstUpdate=!0,this.announcedFinalIds=new Set,this.sessionChanged=!1,this.onScroll=e=>{const base=e.currentTarget,atBottom=base.scrollHeight-base.scrollTop-base.clientHeight<=NEAR_BOTTOM_PX;atBottom!==this.follow&&(this.follow=atBottom,this.emit("lr-follow-change",{following:atBottom}))},this.onJumpClick=()=>{const changed=!this.follow;this.scrollToBottom(),changed&&this.emit("lr-follow-change",{following:!0})}}static{this.defaultStrings={...super.defaultStrings,jumpToLatest:LYRA_DEFAULT_jumpToLatest,transcriptFeedEmpty:LYRA_DEFAULT_transcriptFeedEmpty,transcriptFeedInterim:LYRA_DEFAULT_transcriptFeedInterim,transcriptFeedLabel:LYRA_DEFAULT_transcriptFeedLabel}}static{this.ownedCollectionProperties=Object.freeze(["entries"])}static{this.styles=[LyraElement.styles,styles]}get effectiveMaxRenderedEntries(){return finiteCount(this.maxRenderedEntries,500)}get normalizedEntries(){const seen=new Set;return this.entries.filter(entry=>entry===null||typeof entry!="object"||typeof entry.id!="string"||entry.id.trim().length===0||seen.has(entry.id)?!1:(seen.add(entry.id),!0))}get renderedEntries(){const entries=this.normalizedEntries,maxRenderedEntries=this.effectiveMaxRenderedEntries;return maxRenderedEntries>0&&entries.length>maxRenderedEntries?entries.slice(-maxRenderedEntries):entries}connectedCallback(){super.connectedCallback(),this.syncAnnouncementSink()}disconnectedCallback(){super.disconnectedCallback(),this.releaseAnnouncementSink()}adoptedCallback(){super.adoptedCallback(),this.syncAnnouncementSink()}releaseAnnouncementSink(){this.announcementSink?.release(),this.announcementSink=void 0}syncAnnouncementSink(){if(!this.isConnected){this.releaseAnnouncementSink();return}this.announcementSink?.element.ownerDocument!==this.ownerDocument&&(this.releaseAnnouncementSink(),this.announcementSink=acquireAnnouncementSink("polite",{document:this.ownerDocument,source:this}))}willUpdate(changed){super.willUpdate(changed),this._isFirstUpdate=!this.hasUpdated,this.sessionChanged=changed.has("sessionId")&&this.hasUpdated,this.sessionChanged&&this.announcedFinalIds.clear()}updated(changed){super.updated(changed),changed.has("entries")&&(this.follow&&this.scrollToBottom(),this.announceFinalizedEntries())}announceFinalizedEntries(){const alreadyAnnounced=this.announcedFinalIds,fresh=[];for(const entry of this.normalizedEntries)entry.interim||alreadyAnnounced.has(entry.id)||(alreadyAnnounced.add(entry.id),fresh.push(entry.text));if(this._isFirstUpdate||this.sessionChanged)return;const sink=this.announcementSink;if(sink)for(const text of fresh){const message=text.replace(/\s+/g," ").trim();message&&sink.announce(message)}}scrollToBottom(){this.follow=!0;const base=this.renderRoot.querySelector('[part="base"]');base&&(base.scrollTop=base.scrollHeight)}showSpeakerFor(list,index){const prev=list[index-1],current=list[index];return!prev||prev.speaker!==current.speaker}formatTs(value){const date=normalizeLyraTimestamp(value);return date?this.formatTimestamp?this.formatTimestamp(date):getDateTimeFormat(this.effectiveLocale,{hour:"numeric",minute:"2-digit"}).format(date):null}renderEntry(entry,showSpeaker,interim){const parts=["entry"];interim&&parts.push("interim");const timestamp=entry.timestamp==null?null:this.formatTs(entry.timestamp);return html`
|
|
2
2
|
<div part=${parts.join(" ")} ?data-interim=${interim}>
|
|
3
3
|
${showSpeaker&&entry.speaker?html`<span part="speaker">${entry.speaker}</span>`:nothing}
|
|
4
4
|
<span part="text" dir="auto">${entry.text}</span>
|
|
@@ -95,7 +95,6 @@ import{css}from"lit";import{srOnly}from"../../../internal/a11y.js";const styles=
|
|
|
95
95
|
background: var(--lr-color-surface);
|
|
96
96
|
color: var(--lr-color-text);
|
|
97
97
|
cursor: pointer;
|
|
98
|
-
/* Overlay step, matching lr-chat-viewport's jump pill: it floats over the feed, not in it. */
|
|
99
98
|
box-shadow: var(--lr-shadow-m);
|
|
100
99
|
}
|
|
101
100
|
[part='jump-button']:focus-visible {
|
|
@@ -9,19 +9,9 @@ import{css}from"lit";const styles=css`
|
|
|
9
9
|
--_lr-inline-cursor-width-default: var(--lr-size-0-125rem);
|
|
10
10
|
--_lr-inline-cursor-height-default: var(--lr-size-1em);
|
|
11
11
|
--_lr-typing-duration-default: var(--lr-transition-ambient);
|
|
12
|
-
/* Themeable, not auto-derived from --lr-typing-duration: like the compound
|
|
13
|
-
--lr-transition-ambient it aliases (duration + timing-function, e.g. "1.8s ease-in-out")
|
|
14
|
-
baked into the animation: shorthand above, it can't be decomposed via calc() into a
|
|
15
|
-
fraction of just its duration. A consumer retiming --lr-typing-duration keeps the
|
|
16
|
-
stagger proportional by also setting these two explicitly. */
|
|
17
12
|
--_lr-typing-dot-stagger-1-default: 600ms;
|
|
18
13
|
--_lr-typing-dot-stagger-2-default: 1200ms;
|
|
19
14
|
}
|
|
20
|
-
/* The shared six-step size ladder renders here as three tiers: a presence cue is a few pixels of
|
|
21
|
-
decoration, and six distinguishable dot diameters inside a 1em line box do not exist. Every
|
|
22
|
-
step of the ladder still matches a rule -- a value the type accepts and no selector matches
|
|
23
|
-
would quietly render at the default tier, which nothing in this repo can detect. Both
|
|
24
|
-
spellings of each tier are listed, so migrating markup never loses its sizing. */
|
|
25
15
|
:host([size='2xs']),
|
|
26
16
|
:host([size='xs']),
|
|
27
17
|
:host([size='s']),
|
|
@@ -44,7 +34,6 @@ import{css}from"lit";const styles=css`
|
|
|
44
34
|
gap: var(--lr-typing-gap, var(--_lr-typing-gap-default));
|
|
45
35
|
}
|
|
46
36
|
|
|
47
|
-
/* -- dots -------------------------------------------------------------- */
|
|
48
37
|
[part='dot'] {
|
|
49
38
|
inline-size: var(--lr-typing-dot-size, var(--_lr-typing-dot-size-default));
|
|
50
39
|
block-size: var(--lr-typing-dot-size, var(--_lr-typing-dot-size-default));
|
|
@@ -72,8 +61,6 @@ import{css}from"lit";const styles=css`
|
|
|
72
61
|
}
|
|
73
62
|
}
|
|
74
63
|
|
|
75
|
-
/* -- pulse --------------------------------------------------------------
|
|
76
|
-
A single breathing dot, meant for tighter spaces than three dots allow. */
|
|
77
64
|
[part='pulse'] {
|
|
78
65
|
inline-size: var(--lr-typing-dot-size, var(--_lr-typing-dot-size-default));
|
|
79
66
|
block-size: var(--lr-typing-dot-size, var(--_lr-typing-dot-size-default));
|
|
@@ -95,12 +82,6 @@ import{css}from"lit";const styles=css`
|
|
|
95
82
|
}
|
|
96
83
|
}
|
|
97
84
|
|
|
98
|
-
/* -- cursor -------------------------------------------------------------
|
|
99
|
-
A blinking vertical bar for inline placement at the tail of streamed
|
|
100
|
-
text. The two adjacent keyframe stops (49% / 50%) hold identical values
|
|
101
|
-
either side of an instant flip, so the blink still reads as a sharp
|
|
102
|
-
on/off even though the token's ease-out timing-function is in effect
|
|
103
|
-
across the whole animation. */
|
|
104
85
|
[part='cursor'] {
|
|
105
86
|
inline-size: var(--lr-inline-cursor-width, var(--_lr-inline-cursor-width-default));
|
|
106
87
|
block-size: var(--lr-inline-cursor-height, var(--_lr-inline-cursor-height-default));
|
|
@@ -120,10 +101,6 @@ import{css}from"lit";const styles=css`
|
|
|
120
101
|
}
|
|
121
102
|
}
|
|
122
103
|
|
|
123
|
-
/* Every variant collapses to its plain, fully-visible resting state
|
|
124
|
-
under reduced motion -- never a static mid-animation frame (e.g. a
|
|
125
|
-
permanently-invisible cursor, had the blink's "off" half been frozen
|
|
126
|
-
instead). */
|
|
127
104
|
@media (prefers-reduced-motion: reduce) {
|
|
128
105
|
[part='dot'],
|
|
129
106
|
[part='pulse'],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{nextId,srOnly}from"../../../internal/a11y.js";import{place}from"../../../internal/positioner.js";import{finiteCount,finiteRange}from"../../../internal/numbers.js";import{styles}from"./usage-badge.styles.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{durationMessageValue}from"../../../internal/duration.js";import{LYRA_DEFAULT_collapse,LYRA_DEFAULT_details,LYRA_DEFAULT_durationMilliseconds,LYRA_DEFAULT_durationSeconds,LYRA_DEFAULT_map,LYRA_DEFAULT_navigation,LYRA_DEFAULT_open,LYRA_DEFAULT_progress,LYRA_DEFAULT_search,LYRA_DEFAULT_select,LYRA_DEFAULT_tokensIn,LYRA_DEFAULT_tokensOut,LYRA_DEFAULT_usageBadgeCostLabel,LYRA_DEFAULT_usageBadgeLabel,LYRA_DEFAULT_usageBadgeLatencyLabel,LYRA_DEFAULT_usageBadgeTokensIn,LYRA_DEFAULT_usageBadgeTokensInLabel,LYRA_DEFAULT_usageBadgeTokensOut,LYRA_DEFAULT_usageBadgeTokensOutLabel,LYRA_DEFAULT_usageBadgeTotalTokensLabel}from"../../../internal/default-strings.generated.js";class LyraUsageBadge extends LyraElement{constructor(){super(...arguments),this.costText="",this.summary="",this.abbreviate=!1,this.tooltipOpen=!1,this.hasDetailsSlot=!1,this.hasSummarySlot=!1,this.detailsText="",this.tooltipId=nextId("usage-badge-tooltip"),this.hovering=!1,this.focused=!1,this.onDetailsSlotChange=e=>{const assigned=e.target.assignedElements({flatten:!0});this.hasDetailsSlot=assigned.length>0,this.detailsText=assigned.slice(0,64).map(element=>{const renderedText=element.innerText;return typeof renderedText=="string"?renderedText:element.textContent??""}).join(" ").replace(/\s+/g," ").trim().slice(0,4096),this.hasInteractiveTooltip||this.closeTooltipLifecycle()},this.onSummarySlotChange=e=>{this.hasSummarySlot=e.target.assignedElements({flatten:!0}).length>0,this.hasInteractiveTooltip||this.closeTooltipLifecycle()},this.onMouseEnter=()=>{this.hovering=!0,this.showTooltip()},this.onMouseLeave=()=>{this.hovering=!1,!this.focused&&this.hideTooltip()},this.onFocus=()=>{this.focused=!0,this.showTooltip()},this.onBlur=()=>{this.focused=!1,!this.hovering&&this.hideTooltip()},this.onKeyDown=e=>{e.key==="Escape"&&this.tooltipOpen&&(e.stopPropagation(),this.hideTooltip())}}static{this.defaultStrings={...super.defaultStrings,collapse:LYRA_DEFAULT_collapse,details:LYRA_DEFAULT_details,durationMilliseconds:LYRA_DEFAULT_durationMilliseconds,durationSeconds:LYRA_DEFAULT_durationSeconds,map:LYRA_DEFAULT_map,navigation:LYRA_DEFAULT_navigation,open:LYRA_DEFAULT_open,progress:LYRA_DEFAULT_progress,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select,tokensIn:LYRA_DEFAULT_tokensIn,tokensOut:LYRA_DEFAULT_tokensOut,usageBadgeCostLabel:LYRA_DEFAULT_usageBadgeCostLabel,usageBadgeLabel:LYRA_DEFAULT_usageBadgeLabel,usageBadgeLatencyLabel:LYRA_DEFAULT_usageBadgeLatencyLabel,usageBadgeTokensIn:LYRA_DEFAULT_usageBadgeTokensIn,usageBadgeTokensInLabel:LYRA_DEFAULT_usageBadgeTokensInLabel,usageBadgeTokensOut:LYRA_DEFAULT_usageBadgeTokensOut,usageBadgeTokensOutLabel:LYRA_DEFAULT_usageBadgeTokensOutLabel,usageBadgeTotalTokensLabel:LYRA_DEFAULT_usageBadgeTotalTokensLabel}}static{this.styles=[LyraElement.styles,styles,srOnly]}willUpdate(changed){super.willUpdate(changed),this.seedFirstRenderState(()=>{const children=Array.from(this.children);this.hasDetailsSlot=children.some(child=>child.getAttribute("slot")==="details"),this.hasSummarySlot=children.some(child=>child.getAttribute("slot")==="summary")}),this.hasUpdated&&(changed.has("tokensIn")||changed.has("tokensOut")||changed.has("costText")||changed.has("latencyMs")||changed.has("summary"))&&!this.hasInteractiveTooltip&&this.closeTooltipLifecycle()}updated(changed){if(super.updated(changed),changed.has("tooltipOpen")&&(this.cleanupPositioner?.(),this.cleanupPositioner=void 0,this.tooltipOpen)){const anchor=this.renderRoot.querySelector('[part="base"]'),tooltip=this.renderRoot.querySelector('[part="tooltip"]');anchor&&tooltip&&(this.cleanupPositioner=place(anchor,tooltip,{placement:"top-start"}))}}disconnectedCallback(){super.disconnectedCallback(),this.cleanupPositioner?.(),this.cleanupPositioner=void 0,this.tooltipOpen=!1,this.hovering=!1,this.focused=!1}get hasTokensIn(){return this.tokensIn!=null&&Number.isFinite(this.tokensIn)}get hasTokensOut(){return this.tokensOut!=null&&Number.isFinite(this.tokensOut)}get hasCost(){return this.costText.length>0}get validLatencyMs(){if(!(this.latencyMs==null||!Number.isFinite(this.latencyMs)))return finiteRange(this.latencyMs,this.latencyMs,0)}get hasLatency(){return this.validLatencyMs!==void 0}get hasVisibleContent(){return this.hasTokensIn||this.hasTokensOut||this.hasCost||this.hasLatency}get hasVisibleSummary(){return this.summary.length>0||this.hasSummarySlot}get hasDisplayContent(){return this.hasVisibleContent||this.hasVisibleSummary}get hasTooltipContent(){return this.hasVisibleContent||this.hasDetailsSlot}get hasInteractiveTooltip(){return this.hasDisplayContent&&this.hasTooltipContent}formatTokenCount(n){return getNumberFormat(this.effectiveLocale,this.abbreviate?{notation:"compact"}:{}).format(n)}formatTokenCountFull(n){return getNumberFormat(this.effectiveLocale).format(n)}localizedDuration(ms){if(this.formatLatency)return this.formatLatency(ms);const duration=durationMessageValue(ms),value=getNumberFormat(this.effectiveLocale,{maximumFractionDigits:duration.key==="durationMilliseconds"?0:1}).format(duration.value);return this.localize(duration.key,void 0,{value})}showTooltip(){!this.hasInteractiveTooltip||this.tooltipOpen||(this.tooltipOpen=!0)}hideTooltip(){this.tooltipOpen&&(this.tooltipOpen=!1)}closeTooltipLifecycle(){this.tooltipOpen=!1,this.hovering=!1,this.focused=!1,this.cleanupPositioner?.(),this.cleanupPositioner=void 0}render(){const interactive=this.hasInteractiveTooltip,tokensIn=this.hasTokensIn?finiteCount(this.tokensIn):void 0,tokensOut=this.hasTokensOut?finiteCount(this.tokensOut):void 0,hasBoth=tokensIn!==void 0&&tokensOut!==void 0;return html`
|
|
1
|
+
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{nextId,srOnly}from"../../../internal/a11y.js";import{place}from"../../../internal/positioner.js";import{finiteCount,finiteRange}from"../../../internal/numbers.js";import{styles}from"./usage-badge.styles.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{durationMessageValue}from"../../../internal/duration.js";import{LYRA_DEFAULT_collapse,LYRA_DEFAULT_details,LYRA_DEFAULT_durationMilliseconds,LYRA_DEFAULT_durationSeconds,LYRA_DEFAULT_map,LYRA_DEFAULT_navigation,LYRA_DEFAULT_open,LYRA_DEFAULT_popover,LYRA_DEFAULT_progress,LYRA_DEFAULT_search,LYRA_DEFAULT_select,LYRA_DEFAULT_tokensIn,LYRA_DEFAULT_tokensOut,LYRA_DEFAULT_usageBadgeCostLabel,LYRA_DEFAULT_usageBadgeLabel,LYRA_DEFAULT_usageBadgeLatencyLabel,LYRA_DEFAULT_usageBadgeTokensIn,LYRA_DEFAULT_usageBadgeTokensInLabel,LYRA_DEFAULT_usageBadgeTokensOut,LYRA_DEFAULT_usageBadgeTokensOutLabel,LYRA_DEFAULT_usageBadgeTotalTokensLabel}from"../../../internal/default-strings.generated.js";class LyraUsageBadge extends LyraElement{constructor(){super(...arguments),this.costText="",this.summary="",this.abbreviate=!1,this.tooltipOpen=!1,this.hasDetailsSlot=!1,this.hasSummarySlot=!1,this.detailsText="",this.tooltipId=nextId("usage-badge-tooltip"),this.hovering=!1,this.focused=!1,this.onDetailsSlotChange=e=>{const assigned=e.target.assignedElements({flatten:!0});this.hasDetailsSlot=assigned.length>0,this.detailsText=assigned.slice(0,64).map(element=>{const renderedText=element.innerText;return typeof renderedText=="string"?renderedText:element.textContent??""}).join(" ").replace(/\s+/g," ").trim().slice(0,4096),this.hasInteractiveTooltip||this.closeTooltipLifecycle()},this.onSummarySlotChange=e=>{this.hasSummarySlot=e.target.assignedElements({flatten:!0}).length>0,this.hasInteractiveTooltip||this.closeTooltipLifecycle()},this.onMouseEnter=()=>{this.hovering=!0,this.showTooltip()},this.onMouseLeave=()=>{this.hovering=!1,!this.focused&&this.hideTooltip()},this.onFocus=()=>{this.focused=!0,this.showTooltip()},this.onBlur=()=>{this.focused=!1,!this.hovering&&this.hideTooltip()},this.onKeyDown=e=>{e.key==="Escape"&&this.tooltipOpen&&(e.stopPropagation(),this.hideTooltip())}}static{this.defaultStrings={...super.defaultStrings,collapse:LYRA_DEFAULT_collapse,details:LYRA_DEFAULT_details,durationMilliseconds:LYRA_DEFAULT_durationMilliseconds,durationSeconds:LYRA_DEFAULT_durationSeconds,map:LYRA_DEFAULT_map,navigation:LYRA_DEFAULT_navigation,open:LYRA_DEFAULT_open,popover:LYRA_DEFAULT_popover,progress:LYRA_DEFAULT_progress,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select,tokensIn:LYRA_DEFAULT_tokensIn,tokensOut:LYRA_DEFAULT_tokensOut,usageBadgeCostLabel:LYRA_DEFAULT_usageBadgeCostLabel,usageBadgeLabel:LYRA_DEFAULT_usageBadgeLabel,usageBadgeLatencyLabel:LYRA_DEFAULT_usageBadgeLatencyLabel,usageBadgeTokensIn:LYRA_DEFAULT_usageBadgeTokensIn,usageBadgeTokensInLabel:LYRA_DEFAULT_usageBadgeTokensInLabel,usageBadgeTokensOut:LYRA_DEFAULT_usageBadgeTokensOut,usageBadgeTokensOutLabel:LYRA_DEFAULT_usageBadgeTokensOutLabel,usageBadgeTotalTokensLabel:LYRA_DEFAULT_usageBadgeTotalTokensLabel}}static{this.styles=[LyraElement.styles,styles,srOnly]}willUpdate(changed){super.willUpdate(changed),this.seedFirstRenderState(()=>{const children=Array.from(this.children);this.hasDetailsSlot=children.some(child=>child.getAttribute("slot")==="details"),this.hasSummarySlot=children.some(child=>child.getAttribute("slot")==="summary")}),this.hasUpdated&&(changed.has("tokensIn")||changed.has("tokensOut")||changed.has("costText")||changed.has("latencyMs")||changed.has("summary"))&&!this.hasInteractiveTooltip&&this.closeTooltipLifecycle()}updated(changed){if(super.updated(changed),changed.has("tooltipOpen")&&(this.cleanupPositioner?.(),this.cleanupPositioner=void 0,this.tooltipOpen)){const anchor=this.renderRoot.querySelector('[part="base"]'),tooltip=this.renderRoot.querySelector('[part="tooltip"]');anchor&&tooltip&&(this.cleanupPositioner=place(anchor,tooltip,{placement:"top-start"}))}}disconnectedCallback(){super.disconnectedCallback(),this.cleanupPositioner?.(),this.cleanupPositioner=void 0,this.tooltipOpen=!1,this.hovering=!1,this.focused=!1}get hasTokensIn(){return this.tokensIn!=null&&Number.isFinite(this.tokensIn)}get hasTokensOut(){return this.tokensOut!=null&&Number.isFinite(this.tokensOut)}get hasCost(){return this.costText.length>0}get validLatencyMs(){if(!(this.latencyMs==null||!Number.isFinite(this.latencyMs)))return finiteRange(this.latencyMs,this.latencyMs,0)}get hasLatency(){return this.validLatencyMs!==void 0}get hasVisibleContent(){return this.hasTokensIn||this.hasTokensOut||this.hasCost||this.hasLatency}get hasVisibleSummary(){return this.summary.length>0||this.hasSummarySlot}get hasDisplayContent(){return this.hasVisibleContent||this.hasVisibleSummary}get hasTooltipContent(){return this.hasVisibleContent||this.hasDetailsSlot}get hasInteractiveTooltip(){return this.hasDisplayContent&&this.hasTooltipContent}formatTokenCount(n){return getNumberFormat(this.effectiveLocale,this.abbreviate?{notation:"compact"}:{}).format(n)}formatTokenCountFull(n){return getNumberFormat(this.effectiveLocale).format(n)}localizedDuration(ms){if(this.formatLatency)return this.formatLatency(ms);const duration=durationMessageValue(ms),value=getNumberFormat(this.effectiveLocale,{maximumFractionDigits:duration.key==="durationMilliseconds"?0:1}).format(duration.value);return this.localize(duration.key,void 0,{value})}showTooltip(){!this.hasInteractiveTooltip||this.tooltipOpen||(this.tooltipOpen=!0)}hideTooltip(){this.tooltipOpen&&(this.tooltipOpen=!1)}closeTooltipLifecycle(){this.tooltipOpen=!1,this.hovering=!1,this.focused=!1,this.cleanupPositioner?.(),this.cleanupPositioner=void 0}render(){const interactive=this.hasInteractiveTooltip,tokensIn=this.hasTokensIn?finiteCount(this.tokensIn):void 0,tokensOut=this.hasTokensOut?finiteCount(this.tokensOut):void 0,hasBoth=tokensIn!==void 0&&tokensOut!==void 0;return html`
|
|
2
2
|
<div
|
|
3
3
|
part="base"
|
|
4
4
|
role=${interactive?"group":nothing}
|
|
@@ -8,9 +8,6 @@ import{css}from"lit";const styles=css`
|
|
|
8
8
|
[part='base']:where([tabindex]) {
|
|
9
9
|
cursor: help;
|
|
10
10
|
}
|
|
11
|
-
/* no-pressed-state: with a tabindex, [part='base'] is a focusable role="group" that reveals a
|
|
12
|
-
tooltip (cursor: help) -- it is not activatable, has no click handler and nothing happens on
|
|
13
|
-
mousedown, so a pressed tint would promise an action the badge does not perform. */
|
|
14
11
|
:where([part='base'][tabindex]):hover {
|
|
15
12
|
background: var(--lr-color-surface-raised);
|
|
16
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{sizes}from"../../../internal/sizes.styles.js";import{nextId}from"../../../internal/a11y.js";import{chevronIcon,playIcon,pauseIcon}from"../../../internal/icons.js";import{AnchoredValidityController,VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{attachInternalsSafely,getFormOwner,installCustomErrorProperty,isBarredFromValidation,setFormOwner}from"../../../internal/form-associated.js";import{installInvalidEventAlias}from"../../../internal/invalid-event-alias.js";import{syncValidityStates}from"../../../internal/custom-states.js";import{safeMediaSrc}from"../../../internal/safe-url.js";import{styles}from"./voice-picker.styles.js";import{trueDefaultBooleanConverter,trueDefaultSpellcheckConverter as spellcheckConverter}from"../../../internal/converters.js";import{CatalogPickerController}from"../../../internal/catalog-picker.js";import{activeElementIn}from"../../../internal/active-element.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{LYRA_DEFAULT_fieldRequired,LYRA_DEFAULT_noMatches,LYRA_DEFAULT_notInCatalog,LYRA_DEFAULT_voice,LYRA_DEFAULT_voicePickerNoVoices,LYRA_DEFAULT_voicePickerPreview,LYRA_DEFAULT_voicePickerRequired,LYRA_DEFAULT_voicePickerStopPreview}from"../../../internal/default-strings.generated.js";const MAX_VOICE_CATALOG_ENTRIES=1e4;function ownString(value,key){try{const descriptor=Object.getOwnPropertyDescriptor(value,key);return descriptor&&"value"in descriptor&&typeof descriptor.value=="string"?descriptor.value:void 0}catch{return}}function snapshotVoiceCatalog(value){if(!Array.isArray(value))return;const stringSnapshot=[],entrySnapshot=[];let objectCatalog=!1,length=0;try{length=Math.min(value.length,MAX_VOICE_CATALOG_ENTRIES)}catch{return Object.freeze(stringSnapshot)}for(let index=0;index<length;index+=1){let descriptor;try{descriptor=Object.getOwnPropertyDescriptor(value,String(index))}catch{continue}if(!descriptor||!("value"in descriptor))continue;const candidate=descriptor.value;if(typeof candidate=="string"){objectCatalog?entrySnapshot.push(Object.freeze({id:candidate,label:candidate})):stringSnapshot.push(candidate);continue}if(candidate===null||typeof candidate!="object")continue;const id=ownString(candidate,"id"),label=ownString(candidate,"label");if(id===void 0||label===void 0)continue;objectCatalog||(entrySnapshot.push(...stringSnapshot.map(entry=>Object.freeze({id:entry,label:entry}))),objectCatalog=!0);const language=ownString(candidate,"language"),description=ownString(candidate,"description"),previewUrl=ownString(candidate,"previewUrl");entrySnapshot.push(Object.freeze({id,label,...language===void 0?{}:{language},...description===void 0?{}:{description},...previewUrl===void 0?{}:{previewUrl}}))}return Object.freeze(objectCatalog?entrySnapshot:stringSnapshot)}class LyraVoicePicker extends LyraElement{static{this.defaultStrings={...super.defaultStrings,fieldRequired:LYRA_DEFAULT_fieldRequired,noMatches:LYRA_DEFAULT_noMatches,notInCatalog:LYRA_DEFAULT_notInCatalog,voice:LYRA_DEFAULT_voice,voicePickerNoVoices:LYRA_DEFAULT_voicePickerNoVoices,voicePickerPreview:LYRA_DEFAULT_voicePickerPreview,voicePickerRequired:LYRA_DEFAULT_voicePickerRequired,voicePickerStopPreview:LYRA_DEFAULT_voicePickerStopPreview}}static{this.formAssociated=!0}static{this.styles=[LyraElement.styles,sizes,styles]}static{this.properties={customError:{attribute:"custom-error",reflect:!0,noAccessor:!0},disabled:{type:Boolean,reflect:!0,noAccessor:!0},required:{type:Boolean,reflect:!0,noAccessor:!0},value:{attribute:!1,noAccessor:!0},defaultValue:{attribute:"value",reflect:!1,useDefault:!0,noAccessor:!0},name:{reflect:!0,noAccessor:!0}}}get catalog(){return this._catalog}set catalog(next){const old=this._catalog;next!==old&&(this.internalPreviewTargetId!==null&&this.stopInternalPreview(),this._catalog=snapshotVoiceCatalog(next),this.requestUpdate("catalog",old))}get open(){return this.catalogPicker.open}set open(next){this.catalogPicker.setOpen(next)}get activeIndex(){return this.catalogPicker.activeIndex}get query(){return this.catalogPicker.query}constructor(){super(),this.provider="",this.allowCustom=!1,this.preview=!0,this.label="",this.hint="",this.errorText="",this.placeholder="",this.spellcheck=!0,this.autocapitalize="",this.autoCorrect="",this.autocomplete="off",this.inputMode="",this.enterKeyHint="",this.size="m",this.touched=!1,this.slotPresence=new SlotPresenceController(this),this.previewingId=null,this.listId=nextId("voice-picker-list"),this.controlId=nextId("voice-picker-control"),this.pendingPreviewId=null,this.previewGeneration=0,this._fieldsetDisabled=!1,this._name="",this._disabled=!1,this._required=!1,this.transferControlFocus=!1,this.catalogPicker=new CatalogPickerController(this,{catalog:()=>this.catalog,allowCustom:()=>this.allowCustom,locale:()=>this.effectiveLocale,searchableFields:entry=>[entry.id,entry.label,entry.language??"",entry.description??""],emitChange:detail=>this.emit("lr-change",detail),emitFocusAlias:()=>{},beforeValueChange:value=>{const previewTarget=this.internalPreviewTargetId;previewTarget!==null&&previewTarget!==value&&this.stopInternalPreview()},beforeActiveIndexChange:next=>this.reconcilePreviewForActiveIndex(next),afterQueryChange:()=>this.reconcilePreviewVisibility(this.open,this.catalogPicker.filteredEntries),onValueChange:(value,oldValue)=>{this.internals.setFormValue(value),this.updateValidity(),this.requestUpdate("value",oldValue)},onDefaultValueChange:(_value,oldValue)=>this.requestUpdate("defaultValue",oldValue),onStateChange:(state2,oldValue)=>{state2==="open"?(this.catalogPicker.open||this.reconcilePreviewVisibility(!1,[]),this.requestUpdate("open",oldValue)):this.requestUpdate()},onControlBlur:()=>{this.effectiveDisabled||(this.touched=!0)}}),this.onAudioEnded=event=>{event.currentTarget===this.audioEl&&this.stopInternalPreview()},this.onAudioLoadFailure=eventOrAudio=>{const direct=eventOrAudio,isDomErrorEvent=direct.localName!=="audio",audioLike=direct.localName==="audio"?eventOrAudio:eventOrAudio.currentTarget,failedAudio=audioLike?.localName==="audio"&&typeof audioLike.pause=="function"&&typeof audioLike.removeEventListener=="function"?audioLike:void 0;if(!failedAudio||(failedAudio.removeEventListener("ended",this.onAudioEnded),failedAudio.removeEventListener("error",this.onAudioLoadFailure),failedAudio.pause(),failedAudio!==this.audioEl))return;const pendingVoiceId=this.pendingPreviewId;this.previewGeneration++,this.audioEl=void 0,this.pendingPreviewId=null,isDomErrorEvent&&this.previewingId===null&&pendingVoiceId!==null&&(this.previewingId=pendingVoiceId,this.emit("lr-preview-change",{voiceId:pendingVoiceId})),this.previewingId!==null&&(this.previewingId=null,this.emit("lr-preview-change",{voiceId:null}))},this.onPreviewButtonClick=()=>{const candidate=this.previewCandidateId;candidate&&(this.internalPreviewTargetId===candidate?this.stopInternalPreview():this.requestPreview(candidate))},this.onOptionPreviewClick=(e,entry)=>{e.stopPropagation(),this.internalPreviewTargetId===entry.id?this.stopInternalPreview():this.requestPreview(entry.id)},this.onTriggerClick=()=>{this.effectiveDisabled||(this.open?this.hide():this.show())},this.onControlBlur=event=>{this.catalogPicker.handleControlBlur(event)},this.onControlFocus=event=>{this.catalogPicker.handleControlFocus(event)},this.onTriggerKeyDown=e=>{this.catalogPicker.handleTriggerKeyDown(e)},this.onComboMouseDown=e=>{this.catalogPicker.handleComboMouseDown(e)},this.onInputFocus=event=>{this.catalogPicker.handleInputFocus(event)},this.onInput=e=>{this.catalogPicker.handleInput(e)},this.onInputKeyDown=e=>{this.catalogPicker.handleInputKeyDown(e)},this.onListboxMouseDown=e=>{this.catalogPicker.handleListboxMouseDown(e)},this.onListboxClick=e=>{this.catalogPicker.handleListboxClick(e)},this.internals=attachInternalsSafely(this),this.validityController=new AnchoredValidityController(this,this.internals,()=>this[VALIDITY_ANCHOR]()),installCustomErrorProperty(this,()=>this.validityController.customValidityMessage),installInvalidEventAlias(this,init=>this.emit("lr-invalid",null,init)),this.internals.setFormValue("")}get form(){return getFormOwner(this.internals)}set form(owner){setFormOwner(this,owner)}getForm(){return getFormOwner(this.internals)}get labels(){return this.internals.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}[VALIDITY_ANCHOR](){return this.renderRoot?.querySelector('[part="trigger"], [part="combobox-input"]')??null}click(){this.catalogPicker.click()}focus(options){this.catalogPicker.focus(options)}blur(){this.catalogPicker.blur()}get input(){return this.catalogPicker.input}get selectionStart(){return this.input?.selectionStart??null}set selectionStart(value){this.input&&(this.input.selectionStart=value)}get selectionEnd(){return this.input?.selectionEnd??null}set selectionEnd(value){this.input&&(this.input.selectionEnd=value)}get selectionDirection(){return this.input?.selectionDirection??null}set selectionDirection(value){this.input&&(this.input.selectionDirection=value)}select(){this.catalogPicker.select()}setSelectionRange(start,end,direction){this.catalogPicker.setSelectionRange(start,end,direction)}setRangeText(replacement,start,end,selectMode){this.catalogPicker.setRangeText(replacement,start,end,selectMode)}connectedCallback(){super.connectedCallback(),this.updateValidity(),this.catalogPicker.connected(this.hasUpdated)}willUpdate(changed){if(super.willUpdate(changed),this.hasUpdated){const switchingMode=this.renderRoot.querySelector('[part="trigger"]')!==null!==this.closedMode,focused=activeElementIn(this.shadowRoot??this.ownerDocument);this.catalogPicker.suppressControlEvents=switchingMode,this.transferControlFocus=switchingMode&&focused?.nodeType===1&&focused.matches('[part="trigger"], [part="combobox-input"]')}if(this.hasUpdated&&(changed.has("catalog")||changed.has("allowCustom")||changed.has("value"))){const activeValue=this.renderRoot.querySelector('[part="option"][data-active]')?.dataset.value,rows=this.closedMode?this.effectiveEntries:this.filteredEntries;this.catalogPicker.reconcileRows(activeValue,!1),this.reconcilePreviewVisibility(this.open,rows)}changed.has("preview")&&!this.preview&&this.stopInternalPreview()}disconnectedCallback(){super.disconnectedCallback(),this.stopInternalPreview(),this.catalogPicker.disconnected()}adoptedCallback(){super.adoptedCallback(),this.stopInternalPreview(),this.catalogPicker.adopted()}get value(){return this.catalogPicker.value}set value(next){this.catalogPicker.value=next}get defaultValue(){return this.catalogPicker.defaultValue}set defaultValue(next){this.catalogPicker.defaultValue=next}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",this._name?this.setAttribute("name",this._name):this.removeAttribute("name"),this.requestUpdate("name",old)}get disabled(){return this._disabled}set disabled(next){const old=this._disabled;this._disabled=!!next,this.toggleAttribute("disabled",this._disabled),this._disabled&&(this.hide(),this.stopInternalPreview()),this.updateValidity(),this.requestUpdate("disabled",old)}get required(){return this._required}set required(next){const old=this._required;this._required=!!next,this.toggleAttribute("required",this._required),this.updateValidity(),this.requestUpdate("required",old)}get effectiveDisabled(){return this.disabled||this._fieldsetDisabled}get barredFromValidation(){return isBarredFromValidation(this,this.internals)}updateValidity(){this.barredFromValidation?this.validityController.setValidity({}):this.required&&!this.value?this.validityController.setValidity({valueMissing:!0},this.localize("voicePickerRequired")):this.validityController.setValidity({}),this.publishValidityStates()}publishValidityStates(){syncValidityStates(this.internals,{required:this.required,hasInteracted:this.touched,barred:this.barredFromValidation})}formResetCallback(){this.touched=!1,this.catalogPicker.resetValue()}formStateRestoreCallback(state2,_mode){this.catalogPicker.restoreState(state2)}formDisabledCallback(disabled){this._fieldsetDisabled=disabled,disabled&&(this.hide(),this.stopInternalPreview()),this.updateValidity(),this.requestUpdate()}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.touched=!0,this.publishValidityStates(),this.internals.reportValidity()}setCustomValidity(message){this.validityController.setCustomValidity(message??""),this.publishValidityStates()}get closedMode(){return this.catalogPicker.closedMode}get effectiveEntries(){return this.catalogPicker.effectiveEntries}get filteredEntries(){return this.catalogPicker.filteredEntries}get malformedCatalogEntries(){const raw=this.catalog;if(!raw||raw.length===0)return[];const out=[];for(const item of raw){const record=typeof item=="string"?{id:item,label:item}:item;typeof record?.id=="string"&&record.id.trim()!==""||out.push({...record,id:"",synthetic:!1})}return out}labelFor(id){return this.catalogPicker.labelFor(id)}show(){this.catalogPicker.show()}hide(){this.catalogPicker.hide()}updated(changed){super.updated(changed);const reposition=changed.has("open")||this.open&&(changed.has("catalog")||changed.has("allowCustom"));this.catalogPicker.updated(reposition),(changed.has("required")||changed.has("touched")||changed.has("value"))&&this.toggleAttribute("data-invalid",this.touched&&!this.internals.validity.valid),this.publishValidityStates(),this.transferControlFocus&&(this.transferControlFocus=!1,this.renderRoot.querySelector('[part="trigger"], [part="combobox-input"]')?.focus()),this.catalogPicker.suppressControlEvents=!1}get internalPreviewTargetId(){return this.pendingPreviewId??this.previewingId}reconcilePreviewVisibility(open,rows){const target=this.internalPreviewTargetId;if(target===null)return;const standaloneCandidate=open&&this.activeIndex>=0?rows[this.activeIndex]?.id??this.value:this.value,hasVisibleRow=open&&rows.some(entry=>entry.id===target&&!!entry.previewUrl);target!==standaloneCandidate&&!hasVisibleRow&&this.stopInternalPreview()}reconcilePreviewForActiveIndex(next){const target=this.internalPreviewTargetId;if(target!==null){const rows=this.closedMode?this.effectiveEntries:this.filteredEntries,nextCandidate=this.open&&next>=0?rows[next]?.id??this.value:this.value;target!==nextCandidate&&this.stopInternalPreview()}}get previewCandidateId(){return this.open&&this.activeIndex>=0?(this.closedMode?this.effectiveEntries:this.filteredEntries)[this.activeIndex]?.id??this.value:this.value}requestPreview(voiceId){if(!voiceId)return;const currentTarget=this.internalPreviewTargetId;currentTarget!==null&¤tTarget!==voiceId&&this.stopInternalPreview();const previewUrl=this.effectiveEntries.find(e=>e.id===voiceId)?.previewUrl;!this.emit("lr-preview-request",{voiceId,previewUrl},{cancelable:!0}).defaultPrevented&&previewUrl&&this.playInternal(voiceId,previewUrl)}playInternal(voiceId,url){const safe=safeMediaSrc(url);if(!safe)return;this.stopInternalPreview();const audio=this.ownerDocument.createElement("audio");audio.src=safe,audio.addEventListener("ended",this.onAudioEnded),audio.addEventListener("error",this.onAudioLoadFailure);const generation=++this.previewGeneration;this.audioEl=audio,this.pendingPreviewId=voiceId;let playResult;try{playResult=audio.play()}catch{this.onAudioLoadFailure(audio);return}Promise.resolve(playResult).then(()=>{generation!==this.previewGeneration||audio!==this.audioEl||this.pendingPreviewId!==voiceId||(this.pendingPreviewId=null,this.previewingId=voiceId,this.emit("lr-preview-change",{voiceId}))},()=>this.onAudioLoadFailure(audio))}stopInternalPreview(){const hadTarget=this.internalPreviewTargetId!==null||this.audioEl!==void 0;this.audioEl&&(this.audioEl.removeEventListener("ended",this.onAudioEnded),this.audioEl.removeEventListener("error",this.onAudioLoadFailure),this.audioEl.pause(),this.audioEl=void 0),hadTarget&&this.previewGeneration++,this.pendingPreviewId=null,this.previewingId!==null&&(this.previewingId=null,this.emit("lr-preview-change",{voiceId:null}))}get previewButtonLabel(){const candidate=this.previewCandidateId,playing=this.previewingId!==null&&this.previewingId===candidate,name=this.labelFor(candidate)||candidate;return playing?this.localize("voicePickerStopPreview"):this.localize("voicePickerPreview",void 0,{name})}renderRows(rows,activeId){return rows.map((entry,i)=>{const id=`${this.listId}-opt-${i}`,selected=entry.id!==""&&entry.id===this.value,meta=[entry.language,entry.description].filter(Boolean).join(" \xB7 ");return html`<div
|
|
1
|
+
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{sizes}from"../../../internal/sizes.styles.js";import{hostAriaLabel,nextId}from"../../../internal/a11y.js";import{chevronIcon,playIcon,pauseIcon}from"../../../internal/icons.js";import{AnchoredValidityController,VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{attachInternalsSafely,getFormOwner,installCustomErrorProperty,isBarredFromValidation,setFormOwner}from"../../../internal/form-associated.js";import{installInvalidEventAlias}from"../../../internal/invalid-event-alias.js";import{syncValidityStates}from"../../../internal/custom-states.js";import{safeMediaSrc}from"../../../internal/safe-url.js";import{styles}from"./voice-picker.styles.js";import{trueDefaultBooleanConverter,trueDefaultSpellcheckConverter as spellcheckConverter}from"../../../internal/converters.js";import{CatalogPickerController}from"../../../internal/catalog-picker.js";import{activeElementIn}from"../../../internal/active-element.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{LYRA_DEFAULT_fieldRequired,LYRA_DEFAULT_noMatches,LYRA_DEFAULT_notInCatalog,LYRA_DEFAULT_voice,LYRA_DEFAULT_voicePickerNoVoices,LYRA_DEFAULT_voicePickerPreview,LYRA_DEFAULT_voicePickerRequired,LYRA_DEFAULT_voicePickerStopPreview}from"../../../internal/default-strings.generated.js";const MAX_VOICE_CATALOG_ENTRIES=1e4;function ownString(value,key){try{const descriptor=Object.getOwnPropertyDescriptor(value,key);return descriptor&&"value"in descriptor&&typeof descriptor.value=="string"?descriptor.value:void 0}catch{return}}function snapshotVoiceCatalog(value){if(!Array.isArray(value))return;const stringSnapshot=[],entrySnapshot=[];let objectCatalog=!1,length=0;try{length=Math.min(value.length,MAX_VOICE_CATALOG_ENTRIES)}catch{return Object.freeze(stringSnapshot)}for(let index=0;index<length;index+=1){let descriptor;try{descriptor=Object.getOwnPropertyDescriptor(value,String(index))}catch{continue}if(!descriptor||!("value"in descriptor))continue;const candidate=descriptor.value;if(typeof candidate=="string"){objectCatalog?entrySnapshot.push(Object.freeze({id:candidate,label:candidate})):stringSnapshot.push(candidate);continue}if(candidate===null||typeof candidate!="object")continue;const id=ownString(candidate,"id"),label=ownString(candidate,"label");if(id===void 0||label===void 0)continue;objectCatalog||(entrySnapshot.push(...stringSnapshot.map(entry=>Object.freeze({id:entry,label:entry}))),objectCatalog=!0);const language=ownString(candidate,"language"),description=ownString(candidate,"description"),previewUrl=ownString(candidate,"previewUrl");entrySnapshot.push(Object.freeze({id,label,...language===void 0?{}:{language},...description===void 0?{}:{description},...previewUrl===void 0?{}:{previewUrl}}))}return Object.freeze(objectCatalog?entrySnapshot:stringSnapshot)}class LyraVoicePicker extends LyraElement{static{this.defaultStrings={...super.defaultStrings,fieldRequired:LYRA_DEFAULT_fieldRequired,noMatches:LYRA_DEFAULT_noMatches,notInCatalog:LYRA_DEFAULT_notInCatalog,voice:LYRA_DEFAULT_voice,voicePickerNoVoices:LYRA_DEFAULT_voicePickerNoVoices,voicePickerPreview:LYRA_DEFAULT_voicePickerPreview,voicePickerRequired:LYRA_DEFAULT_voicePickerRequired,voicePickerStopPreview:LYRA_DEFAULT_voicePickerStopPreview}}static{this.formAssociated=!0}static{this.styles=[LyraElement.styles,sizes,styles]}static{this.properties={customError:{attribute:"custom-error",reflect:!0,noAccessor:!0},disabled:{type:Boolean,reflect:!0,noAccessor:!0},required:{type:Boolean,reflect:!0,noAccessor:!0},value:{attribute:!1,noAccessor:!0},defaultValue:{attribute:"value",reflect:!1,useDefault:!0,noAccessor:!0},name:{reflect:!0,noAccessor:!0}}}get catalog(){return this._catalog}set catalog(next){const old=this._catalog;next!==old&&(this.internalPreviewTargetId!==null&&this.stopInternalPreview(),this._catalog=snapshotVoiceCatalog(next),this.requestUpdate("catalog",old))}get open(){return this.catalogPicker.open}set open(next){this.catalogPicker.setOpen(next)}get activeIndex(){return this.catalogPicker.activeIndex}get query(){return this.catalogPicker.query}constructor(){super(),this.provider="",this.allowCustom=!1,this.preview=!0,this.label="",this.hint="",this.errorText="",this.placeholder="",this.spellcheck=!0,this.autocapitalize="",this.autoCorrect="",this.autocomplete="off",this.inputMode="",this.enterKeyHint="",this.size="m",this.touched=!1,this.slotPresence=new SlotPresenceController(this),this.previewingId=null,this.listId=nextId("voice-picker-list"),this.controlId=nextId("voice-picker-control"),this.pendingPreviewId=null,this.previewGeneration=0,this._fieldsetDisabled=!1,this._name="",this._disabled=!1,this._required=!1,this.transferControlFocus=!1,this.catalogPicker=new CatalogPickerController(this,{catalog:()=>this.catalog,allowCustom:()=>this.allowCustom,locale:()=>this.effectiveLocale,searchableFields:entry=>[entry.id,entry.label,entry.language??"",entry.description??""],emitChange:detail=>this.emit("lr-change",detail),beforeValueChange:value=>{const previewTarget=this.internalPreviewTargetId;previewTarget!==null&&previewTarget!==value&&this.stopInternalPreview()},beforeActiveIndexChange:next=>this.reconcilePreviewForActiveIndex(next),afterQueryChange:()=>this.reconcilePreviewVisibility(this.open,this.catalogPicker.filteredEntries),onValueChange:(value,oldValue)=>{this.internals.setFormValue(value),this.updateValidity(),this.requestUpdate("value",oldValue)},onDefaultValueChange:(_value,oldValue)=>this.requestUpdate("defaultValue",oldValue),onStateChange:(state2,oldValue)=>{state2==="open"?(this.catalogPicker.open||this.reconcilePreviewVisibility(!1,[]),this.requestUpdate("open",oldValue)):this.requestUpdate()},onControlBlur:()=>{this.effectiveDisabled||(this.touched=!0)}}),this.onAudioEnded=event=>{event.currentTarget===this.audioEl&&this.stopInternalPreview()},this.onAudioLoadFailure=eventOrAudio=>{const direct=eventOrAudio,isDomErrorEvent=direct.localName!=="audio",audioLike=direct.localName==="audio"?eventOrAudio:eventOrAudio.currentTarget,failedAudio=audioLike?.localName==="audio"&&typeof audioLike.pause=="function"&&typeof audioLike.removeEventListener=="function"?audioLike:void 0;if(!failedAudio||(failedAudio.removeEventListener("ended",this.onAudioEnded),failedAudio.removeEventListener("error",this.onAudioLoadFailure),failedAudio.pause(),failedAudio!==this.audioEl))return;const pendingVoiceId=this.pendingPreviewId;this.previewGeneration++,this.audioEl=void 0,this.pendingPreviewId=null,isDomErrorEvent&&this.previewingId===null&&pendingVoiceId!==null&&(this.previewingId=pendingVoiceId,this.emit("lr-preview-change",{voiceId:pendingVoiceId})),this.previewingId!==null&&(this.previewingId=null,this.emit("lr-preview-change",{voiceId:null}))},this.onPreviewButtonClick=()=>{const candidate=this.previewCandidateId;candidate&&(this.internalPreviewTargetId===candidate?this.stopInternalPreview():this.requestPreview(candidate))},this.onOptionPreviewClick=(e,entry)=>{e.stopPropagation(),this.internalPreviewTargetId===entry.id?this.stopInternalPreview():this.requestPreview(entry.id)},this.onTriggerClick=()=>{this.effectiveDisabled||(this.open?this.hide():this.show())},this.onControlBlur=event=>{this.catalogPicker.handleControlBlur(event)},this.onControlFocus=event=>{this.catalogPicker.handleControlFocus(event)},this.onTriggerKeyDown=e=>{this.catalogPicker.handleTriggerKeyDown(e)},this.onComboMouseDown=e=>{this.catalogPicker.handleComboMouseDown(e)},this.onInputFocus=event=>{this.catalogPicker.handleInputFocus(event)},this.onInput=e=>{this.catalogPicker.handleInput(e)},this.onInputKeyDown=e=>{this.catalogPicker.handleInputKeyDown(e)},this.onListboxMouseDown=e=>{this.catalogPicker.handleListboxMouseDown(e)},this.onListboxClick=e=>{this.catalogPicker.handleListboxClick(e)},this.internals=attachInternalsSafely(this),this.validityController=new AnchoredValidityController(this,this.internals,()=>this[VALIDITY_ANCHOR]()),installCustomErrorProperty(this,()=>this.validityController.customValidityMessage),installInvalidEventAlias(this,init=>this.emit("lr-invalid",null,init)),this.internals.setFormValue("")}get form(){return getFormOwner(this.internals)}set form(owner){setFormOwner(this,owner)}getForm(){return getFormOwner(this.internals)}get labels(){return this.internals.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}[VALIDITY_ANCHOR](){return this.renderRoot?.querySelector('[part="trigger"], [part="combobox-input"]')??null}click(){this.catalogPicker.click()}focus(options){this.catalogPicker.focus(options)}blur(){this.catalogPicker.blur()}get input(){return this.catalogPicker.input}get selectionStart(){return this.input?.selectionStart??null}set selectionStart(value){this.input&&(this.input.selectionStart=value)}get selectionEnd(){return this.input?.selectionEnd??null}set selectionEnd(value){this.input&&(this.input.selectionEnd=value)}get selectionDirection(){return this.input?.selectionDirection??null}set selectionDirection(value){this.input&&(this.input.selectionDirection=value)}select(){this.catalogPicker.select()}setSelectionRange(start,end,direction){this.catalogPicker.setSelectionRange(start,end,direction)}setRangeText(replacement,start,end,selectMode){this.catalogPicker.setRangeText(replacement,start,end,selectMode)}connectedCallback(){super.connectedCallback(),this.updateValidity(),this.catalogPicker.connected(this.hasUpdated)}willUpdate(changed){if(super.willUpdate(changed),this.hasUpdated){const switchingMode=this.renderRoot.querySelector('[part="trigger"]')!==null!==this.closedMode,focused=activeElementIn(this.shadowRoot??this.ownerDocument);this.catalogPicker.suppressControlEvents=switchingMode,this.transferControlFocus=switchingMode&&focused?.nodeType===1&&focused.matches('[part="trigger"], [part="combobox-input"]')}if(this.hasUpdated&&(changed.has("catalog")||changed.has("allowCustom")||changed.has("value"))){const activeValue=this.renderRoot.querySelector('[part="option"][data-active]')?.dataset.value,rows=this.closedMode?this.effectiveEntries:this.filteredEntries;this.catalogPicker.reconcileRows(activeValue,!1),this.reconcilePreviewVisibility(this.open,rows)}changed.has("preview")&&!this.preview&&this.stopInternalPreview()}disconnectedCallback(){super.disconnectedCallback(),this.stopInternalPreview(),this.catalogPicker.disconnected()}adoptedCallback(){super.adoptedCallback(),this.stopInternalPreview(),this.catalogPicker.adopted()}get value(){return this.catalogPicker.value}set value(next){this.catalogPicker.value=next}get defaultValue(){return this.catalogPicker.defaultValue}set defaultValue(next){this.catalogPicker.defaultValue=next}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",this._name?this.setAttribute("name",this._name):this.removeAttribute("name"),this.requestUpdate("name",old)}get disabled(){return this._disabled}set disabled(next){const old=this._disabled;this._disabled=!!next,this.toggleAttribute("disabled",this._disabled),this._disabled&&(this.hide(),this.stopInternalPreview()),this.updateValidity(),this.requestUpdate("disabled",old)}get required(){return this._required}set required(next){const old=this._required;this._required=!!next,this.toggleAttribute("required",this._required),this.updateValidity(),this.requestUpdate("required",old)}get effectiveDisabled(){return this.disabled||this._fieldsetDisabled}get barredFromValidation(){return isBarredFromValidation(this,this.internals)}updateValidity(){this.barredFromValidation?this.validityController.setValidity({}):this.required&&!this.value?this.validityController.setValidity({valueMissing:!0},this.localize("voicePickerRequired")):this.validityController.setValidity({}),this.publishValidityStates()}publishValidityStates(){syncValidityStates(this.internals,{required:this.required,hasInteracted:this.touched,barred:this.barredFromValidation})}formResetCallback(){this.touched=!1,this.catalogPicker.resetValue()}formStateRestoreCallback(state2,_mode){this.catalogPicker.restoreState(state2)}formDisabledCallback(disabled){this._fieldsetDisabled=disabled,disabled&&(this.hide(),this.stopInternalPreview()),this.updateValidity(),this.requestUpdate()}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.touched=!0,this.publishValidityStates(),this.internals.reportValidity()}setCustomValidity(message){this.validityController.setCustomValidity(message??""),this.publishValidityStates()}get closedMode(){return this.catalogPicker.closedMode}get effectiveEntries(){return this.catalogPicker.effectiveEntries}get filteredEntries(){return this.catalogPicker.filteredEntries}get malformedCatalogEntries(){const raw=this.catalog;if(!raw||raw.length===0)return[];const out=[];for(const item of raw){const record=typeof item=="string"?{id:item,label:item}:item;typeof record?.id=="string"&&record.id.trim()!==""||out.push({...record,id:"",synthetic:!1})}return out}labelFor(id){return this.catalogPicker.labelFor(id)}show(){this.catalogPicker.show()}hide(){this.catalogPicker.hide()}updated(changed){super.updated(changed);const reposition=changed.has("open")||this.open&&(changed.has("catalog")||changed.has("allowCustom"));this.catalogPicker.updated(reposition),(changed.has("required")||changed.has("touched")||changed.has("value"))&&this.toggleAttribute("data-invalid",this.touched&&!this.internals.validity.valid),this.publishValidityStates(),this.transferControlFocus&&(this.transferControlFocus=!1,this.renderRoot.querySelector('[part="trigger"], [part="combobox-input"]')?.focus()),this.catalogPicker.suppressControlEvents=!1}get internalPreviewTargetId(){return this.pendingPreviewId??this.previewingId}reconcilePreviewVisibility(open,rows){const target=this.internalPreviewTargetId;if(target===null)return;const standaloneCandidate=open&&this.activeIndex>=0?rows[this.activeIndex]?.id??this.value:this.value,hasVisibleRow=open&&rows.some(entry=>entry.id===target&&!!entry.previewUrl);target!==standaloneCandidate&&!hasVisibleRow&&this.stopInternalPreview()}reconcilePreviewForActiveIndex(next){const target=this.internalPreviewTargetId;if(target!==null){const rows=this.closedMode?this.effectiveEntries:this.filteredEntries,nextCandidate=this.open&&next>=0?rows[next]?.id??this.value:this.value;target!==nextCandidate&&this.stopInternalPreview()}}get previewCandidateId(){return this.open&&this.activeIndex>=0?(this.closedMode?this.effectiveEntries:this.filteredEntries)[this.activeIndex]?.id??this.value:this.value}requestPreview(voiceId){if(!voiceId)return;const currentTarget=this.internalPreviewTargetId;currentTarget!==null&¤tTarget!==voiceId&&this.stopInternalPreview();const previewUrl=this.effectiveEntries.find(e=>e.id===voiceId)?.previewUrl;!this.emit("lr-preview-request",{voiceId,previewUrl},{cancelable:!0}).defaultPrevented&&previewUrl&&this.playInternal(voiceId,previewUrl)}playInternal(voiceId,url){const safe=safeMediaSrc(url);if(!safe)return;this.stopInternalPreview();const audio=this.ownerDocument.createElement("audio");audio.src=safe,audio.addEventListener("ended",this.onAudioEnded),audio.addEventListener("error",this.onAudioLoadFailure);const generation=++this.previewGeneration;this.audioEl=audio,this.pendingPreviewId=voiceId;let playResult;try{playResult=audio.play()}catch{this.onAudioLoadFailure(audio);return}Promise.resolve(playResult).then(()=>{generation!==this.previewGeneration||audio!==this.audioEl||this.pendingPreviewId!==voiceId||(this.pendingPreviewId=null,this.previewingId=voiceId,this.emit("lr-preview-change",{voiceId}))},()=>this.onAudioLoadFailure(audio))}stopInternalPreview(){const hadTarget=this.internalPreviewTargetId!==null||this.audioEl!==void 0;this.audioEl&&(this.audioEl.removeEventListener("ended",this.onAudioEnded),this.audioEl.removeEventListener("error",this.onAudioLoadFailure),this.audioEl.pause(),this.audioEl=void 0),hadTarget&&this.previewGeneration++,this.pendingPreviewId=null,this.previewingId!==null&&(this.previewingId=null,this.emit("lr-preview-change",{voiceId:null}))}get previewButtonLabel(){const candidate=this.previewCandidateId,playing=this.previewingId!==null&&this.previewingId===candidate,name=this.labelFor(candidate)||candidate;return playing?this.localize("voicePickerStopPreview"):this.localize("voicePickerPreview",void 0,{name})}renderRows(rows,activeId){return rows.map((entry,i)=>{const id=`${this.listId}-opt-${i}`,selected=entry.id!==""&&entry.id===this.value,meta=[entry.language,entry.description].filter(Boolean).join(" \xB7 ");return html`<div
|
|
2
2
|
part="option"
|
|
3
3
|
id=${id}
|
|
4
4
|
role="option"
|
|
@@ -63,7 +63,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
|
|
|
63
63
|
aria-expanded=${this.open?"true":"false"}
|
|
64
64
|
aria-controls=${this.listId}
|
|
65
65
|
aria-activedescendant=${activeId}
|
|
66
|
-
aria-label=${this
|
|
66
|
+
aria-label=${hostAriaLabel(this)??(hasLabel?nothing:this.placeholder||this.localize("voice"))}
|
|
67
67
|
aria-describedby=${describedBy||nothing}
|
|
68
68
|
aria-required=${this.required?"true":"false"}
|
|
69
69
|
aria-invalid=${this.touched&&!this.internals.validity.valid?"true":"false"}
|
|
@@ -92,7 +92,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
|
|
|
92
92
|
id=${this.controlId}
|
|
93
93
|
part="combobox-input"
|
|
94
94
|
role="combobox"
|
|
95
|
-
aria-label=${this
|
|
95
|
+
aria-label=${hostAriaLabel(this)??(hasLabel?nothing:this.placeholder||this.localize("voice"))}
|
|
96
96
|
aria-expanded=${this.open?"true":"false"}
|
|
97
97
|
aria-controls=${this.listId}
|
|
98
98
|
aria-activedescendant=${activeId}
|