@aceshooting/lyra-ui 9.1.0 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +843 -0
- package/README.md +7 -0
- package/custom-elements.json +1 -1
- package/dist/cli/migrate-wa.mjs +52 -0
- package/dist/cli/migration-contract.json +1 -1
- package/dist/components/agent-tools/activity-feed/activity-feed.class.js +2 -2
- package/dist/components/agent-tools/activity-feed/activity-feed.styles.js +0 -16
- package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.class.js +1 -1
- package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.styles.js +9 -7
- package/dist/components/agent-tools/agent-run/agent-run.class.js +2 -2
- package/dist/components/agent-tools/agent-run/agent-run.styles.js +0 -13
- package/dist/components/agent-tools/agent-trace/agent-trace.class.js +1 -1
- package/dist/components/agent-tools/agent-trace/agent-trace.styles.js +7 -4
- package/dist/components/agent-tools/approval-queue/approval-queue.styles.js +7 -5
- package/dist/components/agent-tools/artifact-panel/artifact-panel.styles.js +0 -3
- package/dist/components/agent-tools/browser-frame/browser-frame.class.js +1 -1
- package/dist/components/agent-tools/browser-frame/browser-frame.styles.js +3 -5
- package/dist/components/agent-tools/commit-card/commit-card.class.js +1 -1
- package/dist/components/agent-tools/commit-card/commit-card.styles.js +0 -10
- package/dist/components/agent-tools/compare-panel/compare-panel.styles.js +11 -6
- package/dist/components/agent-tools/confirm-bar/confirm-bar.class.js +2 -2
- package/dist/components/agent-tools/confirm-bar/confirm-bar.styles.js +0 -46
- package/dist/components/agent-tools/context-inspector/context-inspector.class.js +1 -1
- package/dist/components/agent-tools/eval-dataset/eval-dataset.styles.js +0 -7
- package/dist/components/agent-tools/eval-result/eval-result.class.js +1 -1
- package/dist/components/agent-tools/evaluation-run/evaluation-run.class.js +2 -2
- package/dist/components/agent-tools/policy-summary/policy-summary.class.js +1 -1
- package/dist/components/agent-tools/prompt-studio/prompt-studio.styles.js +0 -15
- package/dist/components/agent-tools/result-card/result-card.styles.js +0 -7
- package/dist/components/agent-tools/result-card/result-field.styles.js +0 -5
- package/dist/components/agent-tools/schema-viewer/schema-viewer.styles.js +2 -5
- package/dist/components/agent-tools/span-waterfall/span-waterfall.class.js +1 -1
- package/dist/components/agent-tools/span-waterfall/span-waterfall.styles.js +0 -15
- package/dist/components/agent-tools/stack-trace/stack-trace.styles.js +0 -20
- package/dist/components/agent-tools/subagent-panel/subagent-panel.class.js +2 -2
- package/dist/components/agent-tools/subagent-panel/subagent-panel.styles.js +1 -4
- package/dist/components/agent-tools/task-list/task-list.class.js +2 -2
- package/dist/components/agent-tools/task-list/task-list.styles.js +0 -15
- package/dist/components/agent-tools/terminal/terminal.class.d.ts +11 -6
- package/dist/components/agent-tools/terminal/terminal.class.js +4 -4
- package/dist/components/agent-tools/terminal/terminal.styles.js +0 -46
- package/dist/components/agent-tools/test-results/test-results.class.js +2 -2
- package/dist/components/agent-tools/test-results/test-results.styles.js +0 -5
- package/dist/components/agent-tools/thinking-panel/thinking-panel.class.js +1 -1
- package/dist/components/agent-tools/thinking-panel/thinking-panel.styles.js +0 -41
- package/dist/components/agent-tools/tool-approval-dialog/tool-approval-dialog.styles.js +0 -41
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.js +2 -2
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.styles.js +0 -30
- package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js +6 -6
- package/dist/components/agent-tools/tool-param-form/tool-param-form.styles.js +0 -5
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.class.js +2 -2
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.styles.js +0 -20
- package/dist/components/agent-tools/tool-result-view/tool-result-view.styles.js +0 -4
- package/dist/components/agent-tools/tool-select-dialog/tool-select-dialog.styles.js +0 -21
- package/dist/components/agent-tools/trace-tree/trace-tree.class.js +2 -2
- package/dist/components/agent-tools/trace-tree/trace-tree.styles.js +7 -31
- package/dist/components/charts/chart/bar-chart.class.js +1 -1
- package/dist/components/charts/chart/box-plot.styles.js +0 -20
- package/dist/components/charts/chart/bubble-chart.class.js +1 -1
- package/dist/components/charts/chart/chart-colors.d.ts +1 -1
- package/dist/components/charts/chart/chart-colors.js +1 -1
- package/dist/components/charts/chart/chart-core-loader.d.ts +1 -0
- package/dist/components/charts/chart/chart-core-loader.js +1 -1
- package/dist/components/charts/chart/chart-feature-loader.d.ts +35 -0
- package/dist/components/charts/chart/chart-feature-loader.js +1 -1
- package/dist/components/charts/chart/chart.class.d.ts +93 -0
- package/dist/components/charts/chart/chart.class.js +3 -3
- package/dist/components/charts/chart/chart.styles.js +0 -27
- package/dist/components/charts/chart/doughnut-chart.class.js +1 -1
- package/dist/components/charts/chart/histogram.class.js +1 -1
- package/dist/components/charts/chart/line-chart.class.js +1 -1
- package/dist/components/charts/chart/lite-chart.class.d.ts +20 -1
- package/dist/components/charts/chart/lite-chart.class.js +4 -4
- package/dist/components/charts/chart/lite-chart.styles.js +0 -27
- package/dist/components/charts/chart/pie-chart.class.js +1 -1
- package/dist/components/charts/chart/polar-area-chart.class.js +1 -1
- package/dist/components/charts/chart/radar-chart.class.js +1 -1
- package/dist/components/charts/chart/scatter-chart.class.js +1 -1
- package/dist/components/conversation/agent-workspace/agent-workspace.class.d.ts +20 -0
- package/dist/components/conversation/agent-workspace/agent-workspace.class.js +3 -1
- package/dist/components/conversation/agent-workspace/agent-workspace.styles.js +3 -0
- package/dist/components/conversation/audio-visualizer/audio-visualizer.styles.js +0 -7
- package/dist/components/conversation/branch-picker/branch-picker.styles.js +0 -3
- package/dist/components/conversation/chat-composer/chat-composer.styles.js +0 -51
- package/dist/components/conversation/chat-message/chat-message.class.js +2 -2
- package/dist/components/conversation/chat-message/chat-message.styles.js +13 -35
- package/dist/components/conversation/chat-viewport/chat-viewport.class.js +1 -1
- package/dist/components/conversation/chat-viewport/chat-viewport.styles.js +0 -33
- package/dist/components/conversation/checkpoint/checkpoint.class.js +1 -1
- package/dist/components/conversation/checkpoint/checkpoint.styles.js +0 -3
- package/dist/components/conversation/code-block/code-block-shared.d.ts +5 -2
- package/dist/components/conversation/code-block/code-block.class.js +1 -1
- package/dist/components/conversation/code-block/code-block.styles.js +4 -95
- package/dist/components/conversation/code-block/code-loader.d.ts +11 -0
- package/dist/components/conversation/code-block/code-loader.js +1 -1
- package/dist/components/conversation/code-block/shiki-types.d.ts +12 -0
- package/dist/components/conversation/code-block/shiki-types.js +1 -1
- package/dist/components/conversation/conversation-item/conversation-item.styles.js +8 -54
- package/dist/components/conversation/generation-metrics/generation-metrics.class.js +2 -2
- package/dist/components/conversation/generation-metrics/generation-metrics.styles.js +0 -17
- package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
- package/dist/components/conversation/markdown/markdown.styles.js +0 -41
- package/dist/components/conversation/message-actions/message-actions.styles.js +0 -3
- package/dist/components/conversation/message-feedback/message-feedback.styles.js +0 -35
- package/dist/components/conversation/message-parts/message-parts.class.d.ts +1 -1
- package/dist/components/conversation/message-parts/message-parts.styles.js +0 -5
- package/dist/components/conversation/model-select/model-select.class.js +3 -3
- package/dist/components/conversation/model-select/model-select.styles.js +12 -47
- package/dist/components/conversation/model-settings-panel/model-settings-panel.styles.js +0 -6
- package/dist/components/conversation/prompt-input/prompt-input.class.d.ts +3 -0
- package/dist/components/conversation/prompt-input/prompt-input.styles.js +0 -10
- package/dist/components/conversation/push-to-talk/push-to-talk.styles.js +0 -8
- package/dist/components/conversation/realtime-session/realtime-session.styles.js +1 -1
- package/dist/components/conversation/selection-toolbar/selection-toolbar.styles.js +1 -11
- package/dist/components/conversation/stream-status/stream-status.styles.js +0 -16
- package/dist/components/conversation/streaming-text/streaming-text.styles.js +0 -15
- package/dist/components/conversation/suggestion-chips/suggestion-chips.styles.js +0 -5
- package/dist/components/conversation/thread-list/thread-list.styles.js +5 -19
- package/dist/components/conversation/transcript-feed/transcript-feed.class.d.ts +16 -4
- package/dist/components/conversation/transcript-feed/transcript-feed.class.js +1 -1
- package/dist/components/conversation/transcript-feed/transcript-feed.styles.js +0 -1
- package/dist/components/conversation/typing-indicator/typing-indicator.styles.js +0 -23
- package/dist/components/conversation/usage-badge/usage-badge.class.js +1 -1
- package/dist/components/conversation/usage-badge/usage-badge.styles.js +0 -3
- package/dist/components/conversation/voice-picker/voice-picker.class.js +3 -3
- package/dist/components/conversation/voice-picker/voice-picker.styles.js +9 -29
- package/dist/components/conversation/widget-renderer/resolve.d.ts +2 -0
- package/dist/components/conversation/widget-renderer/resolve.js +1 -1
- package/dist/components/data/calendar/calendar.class.d.ts +15 -2
- package/dist/components/data/calendar/calendar.class.js +2 -2
- package/dist/components/data/calendar/calendar.styles.js +2 -28
- package/dist/components/data/condition-builder/condition-builder.class.d.ts +10 -6
- package/dist/components/data/condition-builder/condition-builder.class.js +2 -2
- package/dist/components/data/condition-builder/condition-builder.styles.js +0 -6
- package/dist/components/data/context-meter/context-meter.styles.js +0 -24
- package/dist/components/data/data-grid/data-grid.class.js +3 -3
- package/dist/components/data/data-grid/data-grid.styles.js +0 -22
- package/dist/components/data/document-library/document-library.class.js +2 -2
- package/dist/components/data/document-library/document-library.styles.js +0 -4
- package/dist/components/data/env-list/env-list.class.js +1 -1
- package/dist/components/data/env-list/env-list.styles.js +7 -4
- package/dist/components/data/file-tree/file-tree.class.d.ts +12 -0
- package/dist/components/data/file-tree/file-tree.class.js +1 -1
- package/dist/components/data/flow-canvas/flow-canvas.styles.js +12 -19
- package/dist/components/data/flow-controls/flow-controls.class.js +2 -2
- package/dist/components/data/flow-controls/flow-controls.styles.js +3 -36
- package/dist/components/data/flow-minimap/flow-minimap.class.js +1 -1
- package/dist/components/data/flow-minimap/flow-minimap.styles.js +0 -9
- package/dist/components/data/flow-node/flow-node.styles.js +0 -23
- package/dist/components/data/flow-run-status/flow-run-status.class.js +1 -1
- package/dist/components/data/flow-run-status/flow-run-status.styles.js +0 -7
- package/dist/components/data/graph-query-builder/graph-query-builder.class.d.ts +0 -7
- package/dist/components/data/graph-query-builder/graph-query-builder.class.js +1 -1
- package/dist/components/data/graph-query-builder/graph-query-builder.styles.js +0 -10
- package/dist/components/data/heatmap/heatmap-scale.d.ts +20 -0
- package/dist/components/data/heatmap/heatmap-scale.js +1 -1
- package/dist/components/data/heatmap/heatmap.class.d.ts +85 -2
- package/dist/components/data/heatmap/heatmap.class.js +2 -2
- package/dist/components/data/heatmap/heatmap.styles.js +0 -54
- package/dist/components/data/pagination/pagination.class.js +1 -1
- package/dist/components/data/pagination/pagination.styles.js +23 -46
- package/dist/components/data/sequence-strip/sequence-strip.class.d.ts +34 -1
- package/dist/components/data/sequence-strip/sequence-strip.class.js +5 -2
- package/dist/components/data/sequence-strip/sequence-strip.styles.js +14 -20
- package/dist/components/data/sparkline/sparkline.class.js +1 -1
- package/dist/components/data/stat/stat.styles.js +0 -67
- package/dist/components/data/table/table.class.d.ts +42 -3
- package/dist/components/data/table/table.class.js +4 -4
- package/dist/components/data/table/table.styles.js +20 -91
- package/dist/components/data/timeline/timeline-item.styles.js +0 -30
- package/dist/components/data/timeline/timeline.class.d.ts +89 -1
- package/dist/components/data/timeline/timeline.class.js +2 -2
- package/dist/components/data/timeline/timeline.styles.js +111 -31
- package/dist/components/data/tree/tree-item.styles.js +1 -28
- package/dist/components/data/tree/tree.class.js +2 -2
- package/dist/components/data/tree/tree.styles.js +0 -6
- package/dist/components/data/word-cloud/word-cloud.styles.js +0 -5
- package/dist/components/forms/button/button.class.js +1 -1
- package/dist/components/forms/button/button.styles.js +1 -106
- package/dist/components/forms/checkbox/checkbox.class.d.ts +3 -0
- package/dist/components/forms/checkbox/checkbox.class.js +1 -1
- package/dist/components/forms/checkbox/checkbox.styles.js +0 -39
- package/dist/components/forms/checkbox-group/checkbox-group.class.d.ts +21 -2
- package/dist/components/forms/checkbox-group/checkbox-group.class.js +1 -1
- package/dist/components/forms/checkbox-group/checkbox-group.styles.js +0 -18
- package/dist/components/forms/code-editor/code-editor.styles.js +0 -30
- package/dist/components/forms/color-picker/color-picker.class.js +2 -2
- package/dist/components/forms/color-picker/color-picker.styles.js +0 -69
- package/dist/components/forms/combobox/combobox.class.js +2 -2
- package/dist/components/forms/combobox/combobox.styles.js +22 -111
- package/dist/components/forms/combobox/option.styles.js +7 -1
- package/dist/components/forms/date-picker/date-input.class.js +1 -1
- package/dist/components/forms/date-picker/date-input.styles.js +12 -67
- package/dist/components/forms/date-picker/date-picker.class.d.ts +1 -0
- package/dist/components/forms/date-picker/date-picker.class.js +22 -20
- package/dist/components/forms/date-picker/date-picker.styles.js +36 -29
- package/dist/components/forms/emoji-picker/emoji-data-loader.d.ts +6 -3
- package/dist/components/forms/emoji-picker/emoji-data-loader.js +1 -1
- package/dist/components/forms/emoji-picker/emoji-picker.class.d.ts +8 -1
- package/dist/components/forms/emoji-picker/emoji-picker.class.js +1 -1
- package/dist/components/forms/emoji-picker/emoji-picker.styles.js +3 -41
- package/dist/components/forms/icon-button/icon-button.class.js +1 -1
- package/dist/components/forms/icon-button/icon-button.styles.js +0 -16
- package/dist/components/forms/input/input.styles.js +0 -54
- package/dist/components/forms/input/number-input.styles.d.ts +4 -5
- package/dist/components/forms/input/number-input.styles.js +0 -11
- package/dist/components/forms/input/time-input-shared.d.ts +11 -0
- package/dist/components/forms/input/time-input-shared.js +1 -1
- package/dist/components/forms/input/time-input.class.d.ts +11 -2
- package/dist/components/forms/input/time-input.class.js +1 -1
- package/dist/components/forms/input/time-input.styles.js +0 -6
- package/dist/components/forms/locale-picker/locale-picker.class.js +2 -2
- package/dist/components/forms/locale-picker/locale-picker.styles.js +1 -26
- package/dist/components/forms/otp-input/otp-input.class.js +3 -3
- package/dist/components/forms/otp-input/otp-input.styles.js +0 -16
- package/dist/components/forms/phone-input/phone-input.class.d.ts +9 -1
- package/dist/components/forms/phone-input/phone-input.class.js +2 -2
- package/dist/components/forms/phone-input/phone-input.styles.js +0 -37
- package/dist/components/forms/radio/radio-button.styles.js +1 -30
- package/dist/components/forms/radio/radio-group.styles.js +0 -4
- package/dist/components/forms/radio/radio.styles.js +0 -44
- package/dist/components/forms/rubric-form/rubric-form.styles.js +0 -5
- package/dist/components/forms/select/select.class.js +1 -1
- package/dist/components/forms/select/select.styles.js +14 -114
- package/dist/components/forms/slider/slider.styles.js +0 -55
- package/dist/components/forms/swatch-picker/swatch-picker.class.d.ts +0 -11
- package/dist/components/forms/swatch-picker/swatch-picker.class.js +2 -2
- package/dist/components/forms/swatch-picker/swatch-picker.styles.js +0 -77
- package/dist/components/forms/switch/switch.class.d.ts +3 -0
- package/dist/components/forms/switch/switch.class.js +1 -1
- package/dist/components/forms/switch/switch.styles.js +3 -38
- package/dist/components/forms/textarea/textarea.styles.js +0 -28
- package/dist/components/forms/time-range/time-range.styles.js +12 -84
- package/dist/components/forms/token-input/token-input.class.d.ts +23 -9
- package/dist/components/forms/token-input/token-input.class.js +1 -1
- package/dist/components/forms/token-input/token-input.styles.js +1 -54
- package/dist/components/layout/app-rail/app-rail-item.class.js +2 -2
- package/dist/components/layout/app-rail/app-rail-item.styles.js +0 -13
- package/dist/components/layout/app-rail/app-rail.class.d.ts +5 -0
- package/dist/components/layout/app-rail/app-rail.class.js +1 -1
- package/dist/components/layout/app-rail/app-rail.styles.js +0 -46
- package/dist/components/layout/button-group/button-group.styles.js +0 -6
- package/dist/components/layout/card/card.class.d.ts +12 -0
- package/dist/components/layout/card/card.styles.js +5 -13
- package/dist/components/layout/carousel/carousel.styles.js +0 -1
- package/dist/components/layout/command-palette/command-palette.class.d.ts +8 -0
- package/dist/components/layout/command-palette/command-palette.class.js +3 -1
- package/dist/components/layout/command-palette/command-palette.styles.js +1 -13
- package/dist/components/layout/control-group/control-group.styles.js +0 -7
- package/dist/components/layout/dashboard-grid/dashboard-grid.class.js +1 -1
- package/dist/components/layout/dashboard-grid/dashboard-grid.styles.js +6 -25
- package/dist/components/layout/details/accordion.class.d.ts +13 -0
- package/dist/components/layout/details/accordion.class.js +1 -1
- package/dist/components/layout/details/details.class.js +1 -1
- package/dist/components/layout/details/details.styles.js +0 -12
- package/dist/components/layout/dock-panel/dock-panel.styles.js +0 -45
- package/dist/components/layout/drilldown-panel/drilldown-panel.class.d.ts +2 -0
- package/dist/components/layout/drilldown-panel/drilldown-panel.class.js +2 -2
- package/dist/components/layout/drilldown-panel/drilldown-panel.styles.js +0 -4
- package/dist/components/layout/filter-bar/filter-bar.class.js +1 -1
- package/dist/components/layout/filter-bar/filter-bar.styles.js +0 -9
- package/dist/components/layout/menu/menu-item.class.d.ts +5 -0
- package/dist/components/layout/menu/menu-item.class.js +1 -1
- package/dist/components/layout/menu/menu-item.styles.js +0 -49
- package/dist/components/layout/menu/menu-label.styles.js +0 -2
- package/dist/components/layout/menu/menu.styles.js +0 -18
- package/dist/components/layout/multi-split/multi-split.class.js +1 -1
- package/dist/components/layout/multi-split/multi-split.styles.js +8 -51
- package/dist/components/layout/page/page.class.d.ts +4 -0
- package/dist/components/layout/page/page.class.js +1 -1
- package/dist/components/layout/reorder-list/reorder-item.styles.js +0 -4
- package/dist/components/layout/responsive-panel/responsive-panel.styles.js +0 -27
- package/dist/components/layout/scroller/scroller.styles.js +0 -20
- package/dist/components/layout/segmented/segmented.class.d.ts +7 -1
- package/dist/components/layout/segmented/segmented.class.js +1 -1
- package/dist/components/layout/segmented/segmented.styles.js +69 -37
- package/dist/components/layout/split-panel/split-panel.styles.js +1 -7
- package/dist/components/layout/stepper/stepper.class.d.ts +8 -1
- package/dist/components/layout/stepper/stepper.class.js +1 -1
- package/dist/components/layout/stepper/stepper.styles.js +140 -41
- package/dist/components/layout/tab-group/tab-group.class.d.ts +4 -1
- package/dist/components/layout/tab-group/tab-group.styles.js +9 -75
- package/dist/components/layout/tab-group/tab.styles.js +0 -2
- package/dist/components/layout/virtual-list/virtual-list.class.d.ts +4 -4
- package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
- package/dist/components/layout/virtual-list/virtual-list.styles.js +0 -68
- package/dist/components/layout/widget/widget.class.d.ts +5 -1
- package/dist/components/layout/widget/widget.class.js +1 -1
- package/dist/components/layout/widget/widget.styles.js +97 -40
- package/dist/components/media/animated-image/animated-image.class.d.ts +3 -0
- package/dist/components/media/animated-image/animated-image.class.js +1 -1
- package/dist/components/media/animated-image/animated-image.styles.js +0 -28
- package/dist/components/media/attachment-chip/attachment-chip.class.d.ts +1 -1
- package/dist/components/media/attachment-chip/attachment-chip.class.js +2 -2
- package/dist/components/media/attachment-chip/attachment-chip.styles.js +0 -31
- package/dist/components/media/attachment-trigger/attachment-trigger.class.d.ts +1 -1
- package/dist/components/media/attachment-trigger/attachment-trigger.class.js +4 -4
- package/dist/components/media/attachment-trigger/attachment-trigger.styles.js +0 -40
- package/dist/components/media/av-player/av-player.class.d.ts +5 -6
- package/dist/components/media/av-player/av-player.class.js +1 -1
- package/dist/components/media/av-player/av-player.styles.js +0 -45
- package/dist/components/media/avatar/avatar.styles.js +3 -16
- package/dist/components/media/file-icon/file-icon.class.d.ts +1 -2
- package/dist/components/media/file-icon/file-icon.class.js +1 -1
- package/dist/components/media/file-input/file-input.class.d.ts +12 -0
- package/dist/components/media/file-input/file-input.class.js +1 -1
- package/dist/components/media/file-input/file-input.styles.js +3 -24
- package/dist/components/media/flag/flag.class.d.ts +20 -0
- package/dist/components/media/flag/flag.class.js +4 -2
- package/dist/components/media/flag/flag.styles.js +7 -1
- package/dist/components/media/flag/language-map.d.ts +10 -0
- package/dist/components/media/flag/language-map.js +1 -1
- package/dist/components/media/image-comparer/image-comparer.styles.js +4 -33
- package/dist/components/media/image-viewer/image-viewer.class.js +0 -2
- package/dist/components/media/image-viewer/image-viewer.styles.js +7 -27
- package/dist/components/media/lightbox/lightbox.class.js +0 -2
- package/dist/components/media/lightbox/lightbox.styles.js +2 -21
- package/dist/components/media/map/map-loader.d.ts +19 -1
- package/dist/components/media/map/map-loader.js +1 -1
- package/dist/components/media/map/map.class.d.ts +141 -1
- package/dist/components/media/map/map.class.js +15 -3
- package/dist/components/media/map/map.styles.js +20 -17
- package/dist/components/media/media-card/media-card.class.d.ts +14 -3
- package/dist/components/media/media-card/media-card.class.js +1 -1
- package/dist/components/media/media-card/media-card.styles.js +2 -28
- package/dist/components/media/pan-zoom/pan-zoom.styles.js +0 -3
- package/dist/components/media/qr-code/qr-code.class.d.ts +3 -2
- package/dist/components/media/qr-code/qr-code.class.js +2 -2
- package/dist/components/media/qr-code/qr-code.styles.js +0 -3
- package/dist/components/media/sequence-playback/sequence-playback.class.d.ts +2 -0
- package/dist/components/media/sequence-playback/sequence-playback.class.js +2 -1
- package/dist/components/media/sequence-playback/sequence-playback.styles.js +0 -19
- package/dist/components/media/video/video.class.d.ts +23 -2
- package/dist/components/media/video/video.class.js +3 -3
- package/dist/components/media/video/video.styles.js +4 -2
- package/dist/components/media/zoomable-frame/zoomable-frame.class.d.ts +3 -2
- package/dist/components/media/zoomable-frame/zoomable-frame.class.js +2 -2
- package/dist/components/media/zoomable-frame/zoomable-frame.styles.js +0 -5
- package/dist/components/overlays/alert/alert.styles.js +4 -2
- package/dist/components/overlays/badge/badge.styles.js +4 -48
- package/dist/components/overlays/badge/tag.styles.js +0 -14
- package/dist/components/overlays/callout/callout.styles.js +2 -13
- package/dist/components/overlays/chip/chip-group.styles.js +0 -18
- package/dist/components/overlays/chip/chip.styles.js +6 -69
- package/dist/components/overlays/dialog/confirm.d.ts +1 -4
- package/dist/components/overlays/dialog/confirm.js +1 -1
- package/dist/components/overlays/dialog/dialog.class.d.ts +12 -9
- package/dist/components/overlays/dialog/dialog.class.js +1 -1
- package/dist/components/overlays/dialog/dialog.styles.js +0 -43
- package/dist/components/overlays/drawer/drawer.class.d.ts +2 -2
- package/dist/components/overlays/drawer/drawer.styles.js +0 -9
- package/dist/components/overlays/empty/empty.styles.js +0 -12
- package/dist/components/overlays/kbd/kbd.class.js +1 -1
- package/dist/components/overlays/kbd/kbd.styles.js +0 -8
- package/dist/components/overlays/overlay/dropdown.class.d.ts +1 -6
- package/dist/components/overlays/overlay/dropdown.class.js +2 -2
- package/dist/components/overlays/overlay/overlay.styles.js +0 -28
- package/dist/components/overlays/overlay/popover.class.d.ts +9 -1
- package/dist/components/overlays/overlay/popover.class.js +2 -2
- package/dist/components/overlays/overlay/tooltip.class.d.ts +10 -0
- package/dist/components/overlays/overlay/tooltip.class.js +2 -2
- package/dist/components/overlays/popup/popup.class.d.ts +1 -0
- package/dist/components/overlays/popup/popup.class.js +2 -2
- package/dist/components/overlays/popup/popup.styles.js +0 -15
- package/dist/components/overlays/progress/progress-ring.class.d.ts +9 -1
- package/dist/components/overlays/progress/progress-ring.class.js +3 -3
- package/dist/components/overlays/progress/progress.styles.js +0 -21
- package/dist/components/overlays/rating/rating.styles.js +0 -25
- package/dist/components/overlays/skeleton/skeleton.styles.js +0 -4
- package/dist/components/overlays/spinner/spinner.styles.js +2 -5
- package/dist/components/overlays/toast/toast-item.styles.js +3 -45
- package/dist/components/retrieval/chunk-inspector/chunk-inspector.styles.js +0 -35
- package/dist/components/retrieval/citation-badge/citation-badge.class.d.ts +2 -2
- package/dist/components/retrieval/citation-badge/citation-badge.class.js +3 -3
- package/dist/components/retrieval/citation-badge/citation-badge.styles.js +0 -20
- package/dist/components/retrieval/claim-evidence/claim-evidence.class.js +1 -1
- package/dist/components/retrieval/claim-evidence/claim-evidence.styles.js +0 -8
- package/dist/components/retrieval/community-card/community-card.class.d.ts +1 -0
- package/dist/components/retrieval/community-card/community-card.styles.js +0 -6
- package/dist/components/retrieval/embedding-explorer/embedding-explorer.styles.js +8 -12
- package/dist/components/retrieval/entity-card/entity-card.class.d.ts +4 -3
- package/dist/components/retrieval/entity-card/entity-card.class.js +1 -1
- package/dist/components/retrieval/entity-card/entity-card.styles.js +0 -12
- package/dist/components/retrieval/entity-chip/entity-chip.class.d.ts +10 -4
- package/dist/components/retrieval/entity-chip/entity-chip.class.js +3 -3
- package/dist/components/retrieval/entity-chip/entity-chip.styles.js +6 -9
- package/dist/components/retrieval/entity-dossier/entity-dossier.class.d.ts +19 -5
- package/dist/components/retrieval/entity-dossier/entity-dossier.class.js +1 -1
- package/dist/components/retrieval/graph/graph.class.d.ts +5 -0
- package/dist/components/retrieval/graph/graph.class.js +1 -1
- package/dist/components/retrieval/graph/graph.styles.js +0 -30
- package/dist/components/retrieval/graph-legend/graph-legend.styles.js +0 -3
- package/dist/components/retrieval/grounding-summary/grounding-summary.class.js +2 -2
- package/dist/components/retrieval/ingestion-queue/ingestion-queue.styles.js +0 -25
- package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.class.d.ts +2 -0
- package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.styles.js +0 -7
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +20 -6
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +2 -2
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.styles.js +6 -11
- package/dist/components/retrieval/memory-panel/memory-panel.class.js +1 -1
- package/dist/components/retrieval/mind-map/mind-map.class.d.ts +5 -3
- package/dist/components/retrieval/mind-map/mind-map.class.js +1 -1
- package/dist/components/retrieval/mind-map/mind-map.styles.js +0 -2
- package/dist/components/retrieval/neighbor-list/neighbor-list.class.d.ts +3 -2
- package/dist/components/retrieval/neighbor-list/neighbor-list.class.js +1 -1
- package/dist/components/retrieval/neighbor-list/neighbor-list.styles.js +0 -30
- package/dist/components/retrieval/node-palette/node-palette.styles.js +0 -11
- package/dist/components/retrieval/path-strip/path-strip.styles.js +0 -10
- package/dist/components/retrieval/provenance-panel/provenance-panel.class.d.ts +12 -3
- package/dist/components/retrieval/provenance-panel/provenance-panel.class.js +1 -1
- package/dist/components/retrieval/provenance-panel/provenance-panel.styles.js +0 -2
- package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.d.ts +3 -2
- package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.js +2 -2
- package/dist/components/retrieval/retrieval-results/retrieval-results.styles.js +0 -28
- package/dist/components/retrieval/retrieval-search/retrieval-search.styles.js +0 -4
- package/dist/components/retrieval/retrieval-trace/retrieval-trace.class.js +1 -1
- package/dist/components/retrieval/retrieval-trace/retrieval-trace.styles.js +0 -2
- package/dist/components/retrieval/source-card/source-card.styles.js +0 -13
- package/dist/components/retrieval/source-list/source-list.styles.js +0 -7
- package/dist/components/retrieval/source-picker/source-picker.class.js +1 -1
- package/dist/components/retrieval/source-picker/source-picker.styles.js +0 -7
- package/dist/components/utility/copy-button/copy-button.styles.js +0 -10
- package/dist/components/utility/diff-view/diff-view.styles.js +0 -14
- package/dist/components/utility/export-button/export-button.styles.js +0 -22
- package/dist/components/utility/icon/icon.styles.js +0 -6
- package/dist/components/utility/json-viewer/json-viewer.styles.js +2 -48
- package/dist/components/utility/known-date/known-date.class.d.ts +7 -3
- package/dist/components/utility/known-date/known-date.styles.js +10 -51
- package/dist/components/utility/live-region/live-region.styles.js +0 -4
- package/dist/components/utility/mention-popover/mention-popover.styles.js +0 -25
- package/dist/components/utility/poll-status/poll-status.styles.js +0 -4
- package/dist/components/utility/random-content/random-content.class.d.ts +22 -0
- package/dist/components/utility/random-content/random-content.class.js +3 -2
- package/dist/components/utility/random-content/random-content.styles.js +6 -13
- package/dist/components/utility/tour/tour.class.d.ts +4 -2
- package/dist/components/utility/tour/tour.class.js +3 -3
- package/dist/components/utility/tour/tour.styles.js +0 -13
- package/dist/components/utility/visually-hidden/visually-hidden.styles.js +0 -5
- package/dist/components/viewers/archive-viewer/archive-viewer.class.js +1 -1
- package/dist/components/viewers/archive-viewer/archive-viewer.styles.d.ts +2 -2
- package/dist/components/viewers/archive-viewer/archive-viewer.styles.js +0 -10
- package/dist/components/viewers/contact-viewer/contact-viewer.class.js +1 -1
- package/dist/components/viewers/csv-viewer/csv-viewer.class.js +1 -1
- package/dist/components/viewers/csv-viewer/csv-viewer.styles.js +0 -19
- package/dist/components/viewers/dataset-viewer/dataset-viewer.class.js +1 -1
- package/dist/components/viewers/dataset-viewer/dataset-viewer.styles.js +0 -15
- package/dist/components/viewers/document-compare/document-compare.class.js +1 -1
- package/dist/components/viewers/document-compare/document-compare.styles.js +0 -3
- package/dist/components/viewers/document-preview/document-preview.styles.js +0 -25
- package/dist/components/viewers/document-viewer/document-viewer.class.d.ts +2 -1
- package/dist/components/viewers/document-viewer/document-viewer.class.js +1 -1
- package/dist/components/viewers/document-viewer/document-viewer.styles.js +0 -5
- package/dist/components/viewers/docx-viewer/docx-viewer.styles.js +0 -17
- package/dist/components/viewers/ebook-viewer/ebook-viewer.class.js +1 -1
- package/dist/components/viewers/ebook-viewer/ebook-viewer.styles.js +0 -4
- package/dist/components/viewers/email-viewer/email-viewer.styles.js +0 -7
- package/dist/components/viewers/geojson-view/geojson-view.styles.js +0 -5
- package/dist/components/viewers/highlight-layer/highlight-layer.styles.js +0 -3
- package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +1 -1
- package/dist/components/viewers/notebook-viewer/notebook-viewer.styles.js +0 -38
- package/dist/components/viewers/page-rail/page-rail.class.js +1 -1
- package/dist/components/viewers/page-rail/page-rail.styles.js +0 -13
- package/dist/components/viewers/pdf-viewer/pdf-loader.d.ts +13 -2
- package/dist/components/viewers/pdf-viewer/pdf-loader.js +1 -1
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts +32 -2
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +4 -4
- package/dist/components/viewers/pdf-viewer/pdf-viewer.styles.js +1 -27
- package/dist/components/viewers/pptx-viewer/pptx-viewer.styles.js +0 -3
- package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.js +1 -1
- package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.styles.js +0 -14
- package/dist/components/viewers/svg-viewer/svg-viewer.styles.js +0 -7
- package/dist/components/viewers/xml-viewer/xml-viewer.styles.js +2 -24
- package/dist/custom-elements-jsx.d.ts +56 -37
- package/dist/events.d.ts +43 -33
- package/dist/internal/agent-status-variants.d.ts +18 -0
- package/dist/internal/agent-status-variants.js +1 -0
- package/dist/internal/announcer.d.ts +8 -3
- package/dist/internal/announcer.js +1 -1
- package/dist/internal/autoloader-manifest.js +1 -1
- package/dist/internal/canvas-color.d.ts +16 -0
- package/dist/internal/canvas-color.js +1 -1
- package/dist/internal/catalog-picker.d.ts +0 -1
- package/dist/internal/catalog-picker.js +1 -1
- package/dist/internal/default-strings.generated.d.ts +1 -0
- package/dist/internal/default-strings.generated.js +1 -1
- package/dist/internal/dev-mode-attribute-warning.d.ts +30 -0
- package/dist/internal/dev-mode-attribute-warning.js +1 -0
- package/dist/internal/localization-runtime.js +1 -1
- package/dist/internal/localization-types.d.ts +1 -1
- package/dist/internal/localization.js +1 -1
- package/dist/internal/lyra-element.d.ts +13 -0
- package/dist/internal/lyra-element.js +1 -1
- package/dist/internal/media-controller.js +1 -1
- package/dist/internal/package-metadata.d.ts +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/scroll-overflow.d.ts +35 -13
- package/dist/internal/scroll-overflow.js +1 -1
- package/dist/internal/sizes.styles.js +0 -2
- package/dist/internal/specialist-tokens.styles.js +6 -11
- package/dist/internal/text-highlights.d.ts +4 -1
- package/dist/internal/text-highlights.js +1 -1
- package/dist/internal/tokens/palette.styles.js +0 -15
- package/dist/internal/tokens.styles.js +19 -113
- package/dist/lyra.d.ts +8 -5
- package/dist/styles/reservations.css +82 -0
- package/dist/svelte.d.ts +56 -37
- package/dist/translations/ar.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/pt-BR.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/zh-CN.js +1 -1
- package/dist/vue.d.ts +56 -37
- package/llms/components/lr-accordion-item.md +12 -3
- package/llms/components/lr-accordion.md +11 -2
- package/llms/components/lr-agent-eval-dashboard.md +1 -1
- package/llms/components/lr-agent-trace.md +3 -1
- package/llms/components/lr-agent-workspace.md +20 -0
- package/llms/components/lr-artifact-panel.md +10 -4
- package/llms/components/lr-attachment-chip.md +7 -4
- package/llms/components/lr-attachment-trigger.md +9 -6
- package/llms/components/lr-av-player.md +3 -1
- package/llms/components/lr-avatar.md +6 -6
- package/llms/components/lr-bar-chart.md +4 -3
- package/llms/components/lr-box-plot.md +1 -1
- package/llms/components/lr-browser-frame.md +7 -3
- package/llms/components/lr-bubble-chart.md +4 -3
- package/llms/components/lr-calendar.md +9 -2
- package/llms/components/lr-card.md +24 -0
- package/llms/components/lr-chart.md +32 -8
- package/llms/components/lr-chat-viewport.md +7 -2
- package/llms/components/lr-checkbox-group.md +13 -5
- package/llms/components/lr-checkbox.md +5 -2
- package/llms/components/lr-checkpoint.md +6 -2
- package/llms/components/lr-combobox.md +5 -2
- package/llms/components/lr-command-palette.md +4 -1
- package/llms/components/lr-confirm-bar.md +7 -3
- package/llms/components/lr-context-meter.md +12 -11
- package/llms/components/lr-conversation-item.md +7 -4
- package/llms/components/lr-details.md +11 -2
- package/llms/components/lr-dialog.md +15 -10
- package/llms/components/lr-dock-panel.md +7 -10
- package/llms/components/lr-document-preview.md +6 -1
- package/llms/components/lr-document-viewer.md +3 -2
- package/llms/components/lr-doughnut-chart.md +4 -3
- package/llms/components/lr-drawer.md +3 -3
- package/llms/components/lr-entity-card.md +3 -3
- package/llms/components/lr-entity-chip.md +1 -1
- package/llms/components/lr-entity-dossier.md +4 -1
- package/llms/components/lr-file-input.md +2 -2
- package/llms/components/lr-flag.md +20 -5
- package/llms/components/lr-heatmap.md +29 -1
- package/llms/components/lr-histogram.md +3 -1
- package/llms/components/lr-icon.md +1 -1
- package/llms/components/lr-json-schema-viewer.md +2 -1
- package/llms/components/lr-knowledge-graph-explorer.md +8 -3
- package/llms/components/lr-known-date.md +4 -2
- package/llms/components/lr-line-chart.md +4 -3
- package/llms/components/lr-lite-chart.md +16 -6
- package/llms/components/lr-map.md +72 -8
- package/llms/components/lr-markdown-core.md +3 -2
- package/llms/components/lr-media-card.md +28 -12
- package/llms/components/lr-message-parts.md +2 -1
- package/llms/components/lr-model-select.md +9 -10
- package/llms/components/lr-model-settings-panel.md +9 -9
- package/llms/components/lr-neighbor-list.md +1 -1
- package/llms/components/lr-notebook-viewer.md +6 -3
- package/llms/components/lr-option.md +5 -2
- package/llms/components/lr-pdf-viewer.md +62 -2
- package/llms/components/lr-pie-chart.md +4 -3
- package/llms/components/lr-polar-area-chart.md +4 -3
- package/llms/components/lr-popover.md +5 -0
- package/llms/components/lr-progress-ring.md +8 -1
- package/llms/components/lr-prompt-studio.md +1 -1
- package/llms/components/lr-provenance-panel.md +4 -2
- package/llms/components/lr-qr-code.md +1 -1
- package/llms/components/lr-radar-chart.md +4 -3
- package/llms/components/lr-rag-eval-dashboard.md +2 -2
- package/llms/components/lr-random-content.md +13 -0
- package/llms/components/lr-reorder-item.md +6 -1
- package/llms/components/lr-reorder-list.md +6 -1
- package/llms/components/lr-responsive-panel.md +11 -7
- package/llms/components/lr-scatter-chart.md +4 -3
- package/llms/components/lr-sequence-strip.md +16 -2
- package/llms/components/lr-slider.md +12 -5
- package/llms/components/lr-sparkline.md +1 -1
- package/llms/components/lr-suggestion-chips.md +7 -2
- package/llms/components/lr-swatch-picker.md +5 -5
- package/llms/components/lr-switch.md +5 -2
- package/llms/components/lr-table.md +30 -4
- package/llms/components/lr-terminal.md +3 -1
- package/llms/components/lr-thread-list.md +8 -8
- package/llms/components/lr-time-input.md +6 -1
- package/llms/components/lr-timeline-item.md +24 -0
- package/llms/components/lr-timeline.md +25 -1
- package/llms/components/lr-token-input.md +7 -2
- package/llms/components/lr-tool-approval-dialog.md +7 -8
- package/llms/components/lr-tool-call-chip.md +5 -1
- package/llms/components/lr-tool-param-form.md +14 -12
- package/llms/components/lr-tool-result-dialog.md +11 -9
- package/llms/components/lr-tool-result-view.md +7 -6
- package/llms/components/lr-tool-select-dialog.md +18 -16
- package/llms/components/lr-trace-tree.md +3 -1
- package/llms/components/lr-usage-badge.md +4 -1
- package/llms/components/lr-video-playlist.md +1 -1
- package/llms/components/lr-virtual-list.md +22 -14
- package/llms/components/lr-voice-picker.md +8 -5
- package/llms/components/lr-widget-renderer.md +3 -3
- package/llms/components/lr-widget.md +1 -1
- package/llms/components/lr-word-cloud.md +6 -2
- package/llms/index.md +1 -1
- package/llms/peers.md +13 -3
- package/llms/shared.md +83 -2
- package/llms-full.txt +1159 -288
- package/package.json +19 -7
- package/vscode-css-data.json +37 -2
- package/vscode-html-data.json +402 -45
- package/web-types.json +300 -56
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing,svg}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{finiteCount,finiteRange}from"../../../internal/numbers.js";import{literalSetConverter}from"../../../internal/converters.js";import{styles}from"./generation-metrics.styles.js";import{getNumberFormat,getPluralRules}from"../../../internal/intl-cache.js";import{
|
|
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,svg}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{finiteCount,finiteRange}from"../../../internal/numbers.js";import{literalSetConverter}from"../../../internal/converters.js";import{styles}from"./generation-metrics.styles.js";import{getNumberFormat,getPluralRules}from"../../../internal/intl-cache.js";import{LYRA_DEFAULT_elapsedMinutesSecondsTemplate,LYRA_DEFAULT_generationStatusElapsedSeconds,LYRA_DEFAULT_generationStatusThroughput,LYRA_DEFAULT_generationStatusTokenCount,LYRA_DEFAULT_generationStatusTokensCount,LYRA_DEFAULT_stopGenerating}from"../../../internal/default-strings.generated.js";function stopIcon(){return svg`
|
|
2
2
|
<svg
|
|
3
3
|
width="1em"
|
|
4
4
|
height="1em"
|
|
@@ -8,7 +8,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
|
|
|
8
8
|
aria-hidden="true"
|
|
9
9
|
focusable="false"
|
|
10
10
|
><rect x="6" y="6" width="12" height="12" rx="1.5"></rect></svg>
|
|
11
|
-
`}function formatElapsed(ms,locale){const totalSeconds=Math.max(0,ms)/1e3;if(totalSeconds<59.95)return{key:"generationStatusElapsedSeconds",values:{seconds:getNumberFormat(locale,{minimumFractionDigits:1,maximumFractionDigits:1}).format(Math.round(totalSeconds*10)/10)}};const wholeSeconds=Math.round(totalSeconds),minutes=Math.floor(wholeSeconds/60),seconds=wholeSeconds%60,numberFormat=getNumberFormat(locale,{maximumFractionDigits:0});return{key:"elapsedMinutesSecondsTemplate",values:{minutes:numberFormat.format(minutes),seconds:numberFormat.format(seconds)}}}function formatTokenCount(count,locale){const rounded=Math.max(0,Math.round(count));return{rounded,formatted:getNumberFormat(locale).format(rounded)}}function formatThroughput(value,locale){const clamped=Math.max(0,value),rounded=clamped<10?Math.round(clamped*10)/10:Math.round(clamped);return getNumberFormat(locale,{maximumFractionDigits:clamped<10?1:0}).format(rounded)}const showStopConverter={fromAttribute(value){return value!=="false"},toAttribute(value){return value?null:"false"}},GENERATION_METRICS_STATUS=literalSetConverter(["idle","running","complete"],"idle");class LyraGenerationMetrics extends LyraElement{static{this.defaultStrings={...super.defaultStrings,
|
|
11
|
+
`}function formatElapsed(ms,locale){const totalSeconds=Math.max(0,ms)/1e3;if(totalSeconds<59.95)return{key:"generationStatusElapsedSeconds",values:{seconds:getNumberFormat(locale,{minimumFractionDigits:1,maximumFractionDigits:1}).format(Math.round(totalSeconds*10)/10)}};const wholeSeconds=Math.round(totalSeconds),minutes=Math.floor(wholeSeconds/60),seconds=wholeSeconds%60,numberFormat=getNumberFormat(locale,{maximumFractionDigits:0});return{key:"elapsedMinutesSecondsTemplate",values:{minutes:numberFormat.format(minutes),seconds:numberFormat.format(seconds)}}}function formatTokenCount(count,locale){const rounded=Math.max(0,Math.round(count));return{rounded,formatted:getNumberFormat(locale).format(rounded)}}function formatThroughput(value,locale){const clamped=Math.max(0,value),rounded=clamped<10?Math.round(clamped*10)/10:Math.round(clamped);return getNumberFormat(locale,{maximumFractionDigits:clamped<10?1:0}).format(rounded)}const showStopConverter={fromAttribute(value){return value!=="false"},toAttribute(value){return value?null:"false"}},GENERATION_METRICS_STATUS=literalSetConverter(["idle","running","complete"],"idle");class LyraGenerationMetrics extends LyraElement{static{this.defaultStrings={...super.defaultStrings,elapsedMinutesSecondsTemplate:LYRA_DEFAULT_elapsedMinutesSecondsTemplate,generationStatusElapsedSeconds:LYRA_DEFAULT_generationStatusElapsedSeconds,generationStatusThroughput:LYRA_DEFAULT_generationStatusThroughput,generationStatusTokenCount:LYRA_DEFAULT_generationStatusTokenCount,generationStatusTokensCount:LYRA_DEFAULT_generationStatusTokensCount,stopGenerating:LYRA_DEFAULT_stopGenerating}}static{this.styles=[LyraElement.styles,styles]}get status(){return this._status}set status(next){const normalized=GENERATION_METRICS_STATUS.normalize(next),old=this._status;old!==normalized&&(this._status=normalized,this.requestUpdate("status",old))}constructor(){super(),this._status="idle",this.showStop=!0,this.elapsedMs=0,this.tickerGeneration=0,this.onStopClick=()=>{this.emit("lr-stop",null)},this.requestUpdate("status",void 0)}connectedCallback(){super.connectedCallback(),this.status==="running"&&(this.elapsedMs=this.computeElapsedMs(),this.startTicker())}disconnectedCallback(){this.stopTicker(),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.stopTicker(),this.isConnected&&this.status==="running"&&this.startTicker()}willUpdate(changed){super.willUpdate(changed),changed.has("status")?this.status==="running"?(this.validStartedAt==null&&(this.fallbackStartMs=Date.now()),this.elapsedMs=this.computeElapsedMs()):this.status==="idle"&&(this.fallbackStartMs=void 0,this.elapsedMs=0):this.status==="running"&&changed.has("startedAt")&&(this.validStartedAt==null?this.fallbackStartMs=Date.now()-this.elapsedMs:this.fallbackStartMs=void 0,this.elapsedMs=this.computeElapsedMs())}updated(changed){super.updated(changed),changed.has("status")&&(this.status==="running"?this.startTicker():this.stopTicker())}startTicker(){if(this.stopTicker(),!this.isConnected||this.status!=="running")return;const ownerDocument=this.ownerDocument,ownerWindow=ownerDocument.defaultView;if(!ownerWindow)return;const generation=this.tickerGeneration,handle=ownerWindow.setInterval(()=>{this.tickTimer!==handle||this.tickTimerOwner!==ownerWindow||this.tickTimerDocument!==ownerDocument||this.tickerGeneration!==generation||!this.isConnected||this.status!=="running"||this.ownerDocument!==ownerDocument||(this.elapsedMs=this.computeElapsedMs())},1e3);this.tickTimer=handle,this.tickTimerOwner=ownerWindow,this.tickTimerDocument=ownerDocument}stopTicker(){this.tickerGeneration+=1,this.tickTimer!==void 0&&this.tickTimerOwner?.clearInterval(this.tickTimer),this.tickTimer=void 0,this.tickTimerOwner=void 0,this.tickTimerDocument=void 0}get validStartedAt(){if(!(this.startedAt==null||!Number.isFinite(this.startedAt)))return finiteRange(this.startedAt,this.startedAt,0)}computeElapsedMs(){const start=this.validStartedAt??this.fallbackStartMs;return start==null?0:Math.max(0,Date.now()-start)}get validTokenCount(){if(!(this.tokenCount==null||!Number.isFinite(this.tokenCount)))return finiteCount(Math.round(this.tokenCount))}get effectiveTokensPerSecond(){if(this.tokensPerSecond!=null&&Number.isFinite(this.tokensPerSecond))return finiteRange(this.tokensPerSecond,this.tokensPerSecond,0);const tokenCount=this.validTokenCount;if(tokenCount!==void 0){const elapsedSeconds=this.elapsedMs/1e3;if(elapsedSeconds>=1)return tokenCount/elapsedSeconds}}render(){const validTokenCount=this.validTokenCount,hasTokens=validTokenCount!==void 0,throughput=this.effectiveTokensPerSecond,hasThroughput=throughput!==void 0,locale=this.effectiveLocale,elapsed=formatElapsed(this.elapsedMs,locale),tokenCount=hasTokens?formatTokenCount(validTokenCount,locale):void 0,tokenMessageKey=tokenCount&&getPluralRules(locale).select(tokenCount.rounded)==="one"?"generationStatusTokenCount":"generationStatusTokensCount";return html`
|
|
12
12
|
<div part="base">
|
|
13
13
|
<span part="elapsed">${this.localize(elapsed.key,void 0,elapsed.values)}</span>
|
|
14
14
|
${hasTokens?html`<span part="tokens"
|
|
@@ -17,10 +17,6 @@ import{css}from"lit";const styles=css`
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
[part='elapsed'] {
|
|
20
|
-
/* Full-strength text, not the quieter --lr-color-text-quiet the rest
|
|
21
|
-
of the readout uses -- elapsed time is the one figure this component
|
|
22
|
-
always shows (tokens/throughput are optional), so it gets the higher-
|
|
23
|
-
contrast treatment to read as the primary value at a glance. */
|
|
24
20
|
color: var(--lr-color-text);
|
|
25
21
|
font-variant-numeric: tabular-nums;
|
|
26
22
|
white-space: nowrap;
|
|
@@ -32,11 +28,6 @@ import{css}from"lit";const styles=css`
|
|
|
32
28
|
overflow-wrap: anywhere;
|
|
33
29
|
}
|
|
34
30
|
|
|
35
|
-
/* Segments are joined with a middot rather than a flex gap + separate
|
|
36
|
-
separator element, so a segment that doesn't render (tokens/throughput
|
|
37
|
-
are both optional, see the class doc) never leaves a dangling
|
|
38
|
-
double-gap -- the dot only ever appears immediately before a segment
|
|
39
|
-
that's actually present. */
|
|
40
31
|
[part='tokens']::before,
|
|
41
32
|
[part='throughput']::before {
|
|
42
33
|
content: '·';
|
|
@@ -49,11 +40,6 @@ import{css}from"lit";const styles=css`
|
|
|
49
40
|
display: inline-flex;
|
|
50
41
|
align-items: center;
|
|
51
42
|
justify-content: center;
|
|
52
|
-
/* Meets the shared minimum tappable size (--lr-icon-button-size) --
|
|
53
|
-
previously shrunk below the floor (min(...) capped at 1.75rem/28px)
|
|
54
|
-
for a compact inline look, but the readout row has no width
|
|
55
|
-
constraint that requires it, so the full 40px floor applies
|
|
56
|
-
directly instead of via invisible hit-slop. */
|
|
57
43
|
min-inline-size: var(--lr-icon-button-size);
|
|
58
44
|
min-block-size: var(--lr-icon-button-size);
|
|
59
45
|
margin-inline-start: var(--lr-space-s);
|
|
@@ -73,9 +59,6 @@ import{css}from"lit";const styles=css`
|
|
|
73
59
|
border-color: var(--lr-color-brand);
|
|
74
60
|
color: var(--lr-color-brand);
|
|
75
61
|
}
|
|
76
|
-
/* Hover recolors the chrome only; the press additionally fills the disc, mixing its resting
|
|
77
|
-
surface toward the text color so the pressed state escalates the hover one instead of
|
|
78
|
-
replacing it with an unrelated color. */
|
|
79
62
|
[part='stop-button']:active {
|
|
80
63
|
border-color: var(--lr-color-brand);
|
|
81
64
|
color: var(--lr-color-brand);
|
|
@@ -1 +1 @@
|
|
|
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"lit";import{state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{finiteInteger}from"../../../internal/numbers.js";import{DocumentAnchorTarget}from"../../../internal/anchor-target.js";import{buildQuoteAnchor,createTextQuoteIndex,scopeFromElement}from"../../../internal/text-quote.js";import{acquireHighlightHandle,supportsCustomHighlights}from"../../../internal/text-highlights.js";import{ThemeWatcher}from"../../../internal/theme-watcher.js";import{addFailedHighlightKey,applyMarkdownAriaBusy,applyMarkdownFragmentAnchor,applyMarkdownTextQuoteAnchor,beginMarkdownDepsLoad,getCachedHighlight,hitTestHighlightRanges,HIGHLIGHT_CACHE_MAX,internalLinkHrefFrom,markdownHighlightConfigChanged,markdownLanguageSetChanged,markdownMathPeerError,markdownNeedsReparse,MarkdownOwnedAnimationFrameController,MarkdownParserController,normalizeMarkdownHtmlMode,normalizeMarkdownLeadingTabs,parseMarkdownDocument,processPendingHighlights,renderMarkdownContent,renderMarkdownDocument,repaintMarkdownHighlights,resolveMarkdownDarkTheme,setCachedHighlight}from"./markdown-shared.js";import{LYRA_DEFAULT_anchorJumped,LYRA_DEFAULT_anchorJumpedToPage,LYRA_DEFAULT_anchorNotFound}from"../../../internal/default-strings.generated.js";class LyraMarkdownRuntimeElement extends LyraElement{static{this.defaultStrings={...super.defaultStrings,anchorJumped:LYRA_DEFAULT_anchorJumped,anchorJumpedToPage:LYRA_DEFAULT_anchorJumpedToPage,anchorNotFound:LYRA_DEFAULT_anchorNotFound}}}function createMarkdownVariantContext(tag,katexState){return{tag,connectedInstances:new Set,sharedParser:new MarkdownParserController,katexState}}class MarkdownRuntimeBase extends DocumentAnchorTarget(LyraMarkdownRuntimeElement){constructor(){super(),this.anchorKinds=["fragment","text-quote"],this.renderedHtml=null,this.isDarkTheme=!1,this.parser=new MarkdownParserController,this.headingTree=[],this.markdownTextScopeBuilds=0,this.resolvedHighlightRanges=[],this.mathFailureReported=!1,this.highlightCache=new Map,this.highlightToken=0,this.streamingRenderFrames=new MarkdownOwnedAnimationFrameController,this.failedHighlightKeys=new Set,this.inFlightHighlightKeys=new Set,this.handleKatexResolved=()=>{this.isConnected&&this.renderMarkdown()},this.onContentClick=event=>{const highlightId=hitTestHighlightRanges(this.resolvedHighlightRanges,event.clientX,event.clientY);if(highlightId){this.emit("lr-highlight-activate",{highlightId});return}const href=internalLinkHrefFrom(event,this.internalLinkPrefix);href!==null&&(event.preventDefault(),this.emit("lr-link-click",{href}))},new ThemeWatcher(this,()=>this.refreshTheme())}get marked(){return this.parser.get(this.deps?.marked)}refreshTheme(){this.isDarkTheme=resolveMarkdownDarkTheme(this)}connectedCallback(){super.connectedCallback(),this.markdownVariant.connectedInstances.add(this),this.refreshTheme(),beginMarkdownDepsLoad(this,resolved=>{this.deps=resolved,this.renderMarkdown()})}disconnectedCallback(){this.markdownVariant.connectedInstances.delete(this),super.disconnectedCallback(),this.highlightToken++,this.cancelStreamingRender(),this.highlightHandle?.release(),this.highlightHandle=void 0,this.textQuoteIndexCache=void 0}adoptedCallback(){super.adoptedCallback(),this.cancelStreamingRender()}firstUpdated(changed){super.firstUpdated(changed);const contentRoot=this.renderRoot.querySelector('[part="content"]');contentRoot&&this.bindTextSelection(contentRoot)}willUpdate(changed){if(super.willUpdate(changed),changed.has("math")&&(this.mathFailureReported=!1),!this.deps||!markdownNeedsReparse(changed))return;if((changed.has("content")||changed.has("streaming")||markdownHighlightConfigChanged(changed))&&this.highlightToken++,markdownHighlightConfigChanged(changed)&&(this.failedHighlightKeys.clear(),markdownLanguageSetChanged(changed)&&this.highlightCache.clear()),this.streaming){this.scheduleStreamingRender();return}this.cancelStreamingRender(),this.renderMarkdown()}cancelStreamingRender(){const handle=this.streamingRenderRaf;this.streamingRenderRaf=void 0,!this.streamingRenderFrames.cancel()&&handle!==void 0&&this.ownerDocument.defaultView?.cancelAnimationFrame(handle)}scheduleStreamingRender(){if(this.streamingRenderRaf!==void 0)return;const view=this.ownerDocument.defaultView;if(!view){this.isConnected&&this.renderMarkdown();return}const handle=this.streamingRenderFrames.request(view,()=>{this.streamingRenderRaf=void 0,this.isConnected&&this.ownerDocument.defaultView===view&&this.renderMarkdown()});handle===void 0?this.isConnected&&this.renderMarkdown():this.streamingRenderFrames.handle===handle&&(this.streamingRenderRaf=handle)}async getUpdateComplete(){const complete=await super.getUpdateComplete(),settled=this.streamingRenderFrames.settled;return settled?(await settled,super.getUpdateComplete()):complete}updated(changed){super.updated(changed),applyMarkdownAriaBusy(this,!this.deps||this.streaming);const locale=this.effectiveLocale,localeChanged=this.textQuoteLocale!==void 0&&this.textQuoteLocale!==locale;this.textQuoteLocale=locale,localeChanged&&(this.textQuoteIndexCache=void 0),changed.has("renderedHtml")&&(this.textQuoteIndexCache=void 0),(changed.has("renderedHtml")||changed.has("highlights")||changed.has("activeHighlightId")||localeChanged&&this.highlights.length>0)&&this.repaintHighlights()}renderMarkdown(){if(this.streaming){this.renderedHtml=null,this.headingTree=[];return}const deps=this.deps;if(!deps)return;const variant=this.markdownVariant,outcome=renderMarkdownDocument({tag:variant.tag,deps,htmlMode:normalizeMarkdownHtmlMode(this.htmlMode),math:this.math,parse:(marked,pendingKeys,headingTreeOut)=>this.parseMarkdown(marked,pendingKeys,headingTreeOut),onParsed:()=>this.maybeLoadKatex(),isKatexConfirmedMissing:()=>variant.katexState.isConfirmedMissing()});if(outcome.headingTree&&(this.headingTree=outcome.headingTree),outcome.status==="fallback"){this.renderedHtml=null,this.emit("lr-render-error",{error:outcome.error});return}this.renderedHtml=outcome.html,outcome.mathFailed&&this.reportMathFailure(),outcome.pendingKeys.length>0&&this.highlightCode&&!this.streaming&&this.highlightPending(outcome.pendingKeys)}maybeLoadKatex(){this.math&&this.markdownVariant.katexState.startLoad(this.handleKatexResolved)}reportMathFailure(){this.mathFailureReported||(this.mathFailureReported=!0,this.emit("lr-render-error",{error:markdownMathPeerError(this.markdownVariant.tag)}))}getCachedHighlight(key){return getCachedHighlight(this.highlightCache,key)}setCachedHighlight(key,html){return setCachedHighlight(this.highlightCache,key,html,HIGHLIGHT_CACHE_MAX)}async highlightPending(pendingKeys){const work=pendingKeys.filter(({key})=>!this.inFlightHighlightKeys.has(key));if(work.length===0)return;for(const{key}of work)this.inFlightHighlightKeys.add(key);const token=this.highlightToken,languages=this.languages,isCurrent=()=>token===this.highlightToken&&this.isConnected,tokenizeOne=async pending=>{const html=await this.tokenizePendingHighlight(pending,languages,isCurrent);!isCurrent()||html===void 0||(html===null||!this.setCachedHighlight(pending.key,html))&&addFailedHighlightKey(this.failedHighlightKeys,pending.key)};try{await processPendingHighlights(work,tokenizeOne)}finally{for(const{key}of work)this.inFlightHighlightKeys.delete(key)}this.isConnected&&this.renderMarkdown()}parseMarkdown(marked,pendingKeys,headingTreeOut){const variant=this.markdownVariant;return parseMarkdownDocument({marked,content:normalizeMarkdownLeadingTabs(this.content,finiteInteger(this.tabSize,4,1,32)),markedConfigurations:[variant.sharedParser.get(marked)?.defaults,this.marked?.defaults],gfm:this.gfm,linkTarget:this.linkTarget,headingOffset:finiteInteger(this.headingOffset,0,0,6),escapeHtmlOption:normalizeMarkdownHtmlMode(this.htmlMode)==="escape",trustedHtmlOption:normalizeMarkdownHtmlMode(this.htmlMode)==="trusted",highlightCodeOption:this.highlightCode&&!this.streaming,getCachedHighlight:key=>this.getCachedHighlight(key),failedHighlightKeys:this.failedHighlightKeys,headingAnchorsOption:this.headingAnchors,mathOption:this.math,cachedKatex:this.math?variant.katexState.getIfLoaded():null,pendingKeys,headingTreeOut})}getHeadingTree(){return[...this.headingTree]}contentRoot(){return this.renderRoot.querySelector('[part="content"]')}async applyAnchor(anchor){const root=this.contentRoot();if(!root)return!1;if(anchor.kind==="fragment")return applyMarkdownFragmentAnchor(root,anchor,this.headingTree);if(anchor.kind==="text-quote"){const index=this.markdownTextIndex(root),found=applyMarkdownTextQuoteAnchor(root,anchor,this.effectiveLocale,index);return!supportsCustomHighlights(this.ownerDocument)&&this.highlights.length>0&&this.repaintHighlights(),found}return!1}computeSelectionAnchor(range){const root=this.contentRoot();if(!root)return null;const anchor=buildQuoteAnchor(range,this.markdownTextIndex(root).scope);return!supportsCustomHighlights(this.ownerDocument)&&this.highlights.length>0&&this.scheduleAfterUpdate(()=>this.repaintHighlights()),anchor}ensureHighlightHandle(){return this.highlightHandle??=acquireHighlightHandle(this,this.ownerDocument),this.highlightHandle}markdownTextIndex(root){const locale=this.effectiveLocale,cached=this.textQuoteIndexCache;if(cached?.root===root&&cached.locale===locale&&!cached.mappingDirty)return cached.index;if(cached?.mappingDirty){const handle=this.ensureHighlightHandle();for(const tone of["accent","success","warning","danger","neutral"])handle.setRanges(tone,[]);handle.setActive(null)}const scope=scopeFromElement(root);if(this.markdownTextScopeBuilds++,cached?.root===root&&cached.locale===locale&&cached.index.rebindScope(scope))return cached.mappingDirty=!1,cached.index;const index=createTextQuoteIndex(scope,locale);return this.textQuoteIndexCache={root,locale,index,mappingDirty:!1},index}markdownTextScopeBuildCount(){return this.markdownTextScopeBuilds}markdownTextQuoteScanCount(){return this.textQuoteIndexCache?.index.scanCount??0}repaintHighlights(){this.resolvedHighlightRanges=[];const root=this.contentRoot();if(!root)return;const index=this.markdownTextIndex(root);this.resolvedHighlightRanges=repaintMarkdownHighlights({locale:this.effectiveLocale,root,handle:this.ensureHighlightHandle(),highlights:this.highlights,activeHighlightId:this.activeHighlightId,index}),!supportsCustomHighlights(this.ownerDocument)&&this.textQuoteIndexCache&&(this.textQuoteIndexCache.mappingDirty=!0)}render(){return renderMarkdownContent({content:this.content,sanitized:normalizeMarkdownHtmlMode(this.htmlMode)==="sanitize",renderedHtml:this.renderedHtml,hostAriaLabel:this.getAttribute("aria-label"),isDarkTheme:this.isDarkTheme,onClick:this.onContentClick,liveRegion:this.renderAnchorLiveRegion()})}}__decorate([state()],MarkdownRuntimeBase.prototype,"renderedHtml",void 0),__decorate([state()],MarkdownRuntimeBase.prototype,"isDarkTheme",void 0);export{MarkdownRuntimeBase,createMarkdownVariantContext};
|
|
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"lit";import{state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{finiteInteger}from"../../../internal/numbers.js";import{DocumentAnchorTarget}from"../../../internal/anchor-target.js";import{buildQuoteAnchor,createTextQuoteIndex,scopeFromElement}from"../../../internal/text-quote.js";import{acquireHighlightHandle,supportsCustomHighlights}from"../../../internal/text-highlights.js";import{ThemeWatcher}from"../../../internal/theme-watcher.js";import{addFailedHighlightKey,applyMarkdownAriaBusy,applyMarkdownFragmentAnchor,applyMarkdownTextQuoteAnchor,beginMarkdownDepsLoad,getCachedHighlight,hitTestHighlightRanges,HIGHLIGHT_CACHE_MAX,internalLinkHrefFrom,markdownHighlightConfigChanged,markdownLanguageSetChanged,markdownMathPeerError,markdownNeedsReparse,MarkdownOwnedAnimationFrameController,MarkdownParserController,normalizeMarkdownHtmlMode,normalizeMarkdownLeadingTabs,parseMarkdownDocument,processPendingHighlights,renderMarkdownContent,renderMarkdownDocument,repaintMarkdownHighlights,resolveMarkdownDarkTheme,setCachedHighlight}from"./markdown-shared.js";import{LYRA_DEFAULT_anchorJumped,LYRA_DEFAULT_anchorJumpedToPage,LYRA_DEFAULT_anchorNotFound}from"../../../internal/default-strings.generated.js";class LyraMarkdownRuntimeElement extends LyraElement{static{this.defaultStrings={...super.defaultStrings,anchorJumped:LYRA_DEFAULT_anchorJumped,anchorJumpedToPage:LYRA_DEFAULT_anchorJumpedToPage,anchorNotFound:LYRA_DEFAULT_anchorNotFound}}}function createMarkdownVariantContext(tag,katexState){return{tag,connectedInstances:new Set,sharedParser:new MarkdownParserController,katexState}}class MarkdownRuntimeBase extends DocumentAnchorTarget(LyraMarkdownRuntimeElement){constructor(){super(),this.anchorKinds=["fragment","text-quote"],this.renderedHtml=null,this.isDarkTheme=!1,this.parser=new MarkdownParserController,this.headingTree=[],this.markdownTextScopeBuilds=0,this.resolvedHighlightRanges=[],this.mathFailureReported=!1,this.highlightCache=new Map,this.highlightToken=0,this.streamingRenderFrames=new MarkdownOwnedAnimationFrameController,this.failedHighlightKeys=new Set,this.inFlightHighlightKeys=new Set,this.handleKatexResolved=()=>{this.isConnected&&this.renderMarkdown()},this.onContentClick=event=>{const highlightId=hitTestHighlightRanges(this.resolvedHighlightRanges,event.clientX,event.clientY);if(highlightId){this.emit("lr-highlight-activate",{highlightId});return}const href=internalLinkHrefFrom(event,this.internalLinkPrefix);href!==null&&(event.preventDefault(),this.emit("lr-link-click",{href}))},new ThemeWatcher(this,()=>this.refreshTheme())}get marked(){return this.parser.get(this.deps?.marked)}refreshTheme(){this.isDarkTheme=resolveMarkdownDarkTheme(this)}connectedCallback(){super.connectedCallback(),this.markdownVariant.connectedInstances.add(this),this.refreshTheme(),beginMarkdownDepsLoad(this,resolved=>{this.deps=resolved,this.renderMarkdown()})}disconnectedCallback(){this.markdownVariant.connectedInstances.delete(this),super.disconnectedCallback(),this.highlightToken++,this.cancelStreamingRender(),this.highlightHandle?.release(),this.highlightHandle=void 0,this.textQuoteIndexCache=void 0}adoptedCallback(){super.adoptedCallback(),this.cancelStreamingRender()}firstUpdated(changed){super.firstUpdated(changed);const contentRoot=this.renderRoot.querySelector('[part="content"]');contentRoot&&this.bindTextSelection(contentRoot)}willUpdate(changed){if(super.willUpdate(changed),changed.has("math")&&(this.mathFailureReported=!1),!this.deps||!markdownNeedsReparse(changed))return;if((changed.has("content")||changed.has("streaming")||markdownHighlightConfigChanged(changed))&&this.highlightToken++,markdownHighlightConfigChanged(changed)&&(this.failedHighlightKeys.clear(),markdownLanguageSetChanged(changed)&&this.highlightCache.clear()),this.streaming){this.scheduleStreamingRender();return}this.cancelStreamingRender(),this.renderMarkdown()}cancelStreamingRender(){const handle=this.streamingRenderRaf;this.streamingRenderRaf=void 0,!this.streamingRenderFrames.cancel()&&handle!==void 0&&this.ownerDocument.defaultView?.cancelAnimationFrame(handle)}scheduleStreamingRender(){if(this.streamingRenderRaf!==void 0)return;const view=this.ownerDocument.defaultView;if(!view){this.isConnected&&this.renderMarkdown();return}const handle=this.streamingRenderFrames.request(view,()=>{this.streamingRenderRaf=void 0,this.isConnected&&this.ownerDocument.defaultView===view&&this.renderMarkdown()});handle===void 0?this.isConnected&&this.renderMarkdown():this.streamingRenderFrames.handle===handle&&(this.streamingRenderRaf=handle)}async getUpdateComplete(){const complete=await super.getUpdateComplete(),settled=this.streamingRenderFrames.settled;return settled?(await settled,super.getUpdateComplete()):complete}updated(changed){super.updated(changed),applyMarkdownAriaBusy(this,!this.deps||this.streaming);const locale=this.effectiveLocale,localeChanged=this.textQuoteLocale!==void 0&&this.textQuoteLocale!==locale;this.textQuoteLocale=locale,localeChanged&&(this.textQuoteIndexCache=void 0),changed.has("renderedHtml")&&(this.textQuoteIndexCache=void 0),(changed.has("renderedHtml")||changed.has("highlights")||changed.has("activeHighlightId")||localeChanged&&this.highlights.length>0)&&this.repaintHighlights()}renderMarkdown(){if(this.streaming){this.renderedHtml=null,this.headingTree=[];return}const deps=this.deps;if(!deps)return;const variant=this.markdownVariant,outcome=renderMarkdownDocument({tag:variant.tag,deps,htmlMode:normalizeMarkdownHtmlMode(this.htmlMode),math:this.math,parse:(marked,pendingKeys,headingTreeOut)=>this.parseMarkdown(marked,pendingKeys,headingTreeOut),onParsed:()=>this.maybeLoadKatex(),isKatexConfirmedMissing:()=>variant.katexState.isConfirmedMissing()});if(outcome.headingTree&&(this.headingTree=outcome.headingTree),outcome.status==="fallback"){this.renderedHtml=null,this.emit("lr-render-error",{error:outcome.error});return}this.renderedHtml=outcome.html,outcome.mathFailed&&this.reportMathFailure(),outcome.pendingKeys.length>0&&this.highlightCode&&!this.streaming&&this.highlightPending(outcome.pendingKeys)}maybeLoadKatex(){this.math&&this.markdownVariant.katexState.startLoad(this.handleKatexResolved)}reportMathFailure(){this.mathFailureReported||(this.mathFailureReported=!0,this.emit("lr-render-error",{error:markdownMathPeerError(this.markdownVariant.tag)}))}getCachedHighlight(key){return getCachedHighlight(this.highlightCache,key)}setCachedHighlight(key,html){return setCachedHighlight(this.highlightCache,key,html,HIGHLIGHT_CACHE_MAX)}async highlightPending(pendingKeys){const work=pendingKeys.filter(({key})=>!this.inFlightHighlightKeys.has(key));if(work.length===0)return;for(const{key}of work)this.inFlightHighlightKeys.add(key);const token=this.highlightToken,languages=this.languages,isCurrent=()=>token===this.highlightToken&&this.isConnected,tokenizeOne=async pending=>{const html=await this.tokenizePendingHighlight(pending,languages,isCurrent);!isCurrent()||html===void 0||(html===null||!this.setCachedHighlight(pending.key,html))&&addFailedHighlightKey(this.failedHighlightKeys,pending.key)};try{await processPendingHighlights(work,tokenizeOne)}catch(error){console.warn("<lr-markdown>/<lr-markdown-core> failed to tokenize a pending highlight:",error)}finally{for(const{key}of work)this.inFlightHighlightKeys.delete(key)}this.isConnected&&this.renderMarkdown()}parseMarkdown(marked,pendingKeys,headingTreeOut){const variant=this.markdownVariant;return parseMarkdownDocument({marked,content:normalizeMarkdownLeadingTabs(this.content,finiteInteger(this.tabSize,4,1,32)),markedConfigurations:[variant.sharedParser.get(marked)?.defaults,this.marked?.defaults],gfm:this.gfm,linkTarget:this.linkTarget,headingOffset:finiteInteger(this.headingOffset,0,0,6),escapeHtmlOption:normalizeMarkdownHtmlMode(this.htmlMode)==="escape",trustedHtmlOption:normalizeMarkdownHtmlMode(this.htmlMode)==="trusted",highlightCodeOption:this.highlightCode&&!this.streaming,getCachedHighlight:key=>this.getCachedHighlight(key),failedHighlightKeys:this.failedHighlightKeys,headingAnchorsOption:this.headingAnchors,mathOption:this.math,cachedKatex:this.math?variant.katexState.getIfLoaded():null,pendingKeys,headingTreeOut})}getHeadingTree(){return[...this.headingTree]}contentRoot(){return this.renderRoot.querySelector('[part="content"]')}async applyAnchor(anchor){const root=this.contentRoot();if(!root)return!1;if(anchor.kind==="fragment")return applyMarkdownFragmentAnchor(root,anchor,this.headingTree);if(anchor.kind==="text-quote"){const index=this.markdownTextIndex(root),found=applyMarkdownTextQuoteAnchor(root,anchor,this.effectiveLocale,index);return!supportsCustomHighlights(this.ownerDocument)&&this.highlights.length>0&&this.repaintHighlights(),found}return!1}computeSelectionAnchor(range){const root=this.contentRoot();if(!root)return null;const anchor=buildQuoteAnchor(range,this.markdownTextIndex(root).scope);return!supportsCustomHighlights(this.ownerDocument)&&this.highlights.length>0&&this.scheduleAfterUpdate(()=>this.repaintHighlights()),anchor}ensureHighlightHandle(){return this.highlightHandle??=acquireHighlightHandle(this,this.ownerDocument),this.highlightHandle}markdownTextIndex(root){const locale=this.effectiveLocale,cached=this.textQuoteIndexCache;if(cached?.root===root&&cached.locale===locale&&!cached.mappingDirty)return cached.index;if(cached?.mappingDirty){const handle=this.ensureHighlightHandle();for(const tone of["accent","success","warning","danger","neutral"])handle.setRanges(tone,[]);handle.setActive(null)}const scope=scopeFromElement(root);if(this.markdownTextScopeBuilds++,cached?.root===root&&cached.locale===locale&&cached.index.rebindScope(scope))return cached.mappingDirty=!1,cached.index;const index=createTextQuoteIndex(scope,locale);return this.textQuoteIndexCache={root,locale,index,mappingDirty:!1},index}markdownTextScopeBuildCount(){return this.markdownTextScopeBuilds}markdownTextQuoteScanCount(){return this.textQuoteIndexCache?.index.scanCount??0}repaintHighlights(){this.resolvedHighlightRanges=[];const root=this.contentRoot();if(!root)return;const index=this.markdownTextIndex(root);this.resolvedHighlightRanges=repaintMarkdownHighlights({locale:this.effectiveLocale,root,handle:this.ensureHighlightHandle(),highlights:this.highlights,activeHighlightId:this.activeHighlightId,index}),!supportsCustomHighlights(this.ownerDocument)&&this.textQuoteIndexCache&&(this.textQuoteIndexCache.mappingDirty=!0)}render(){return renderMarkdownContent({content:this.content,sanitized:normalizeMarkdownHtmlMode(this.htmlMode)==="sanitize",renderedHtml:this.renderedHtml,hostAriaLabel:this.getAttribute("aria-label"),isDarkTheme:this.isDarkTheme,onClick:this.onContentClick,liveRegion:this.renderAnchorLiveRegion()})}}__decorate([state()],MarkdownRuntimeBase.prototype,"renderedHtml",void 0),__decorate([state()],MarkdownRuntimeBase.prototype,"isDarkTheme",void 0);export{MarkdownRuntimeBase,createMarkdownVariantContext};
|
|
@@ -11,17 +11,10 @@ import{css}from"lit";const styles=css`
|
|
|
11
11
|
min-inline-size: var(--lr-icon-button-size);
|
|
12
12
|
max-inline-size: 100%;
|
|
13
13
|
overflow-inline: auto;
|
|
14
|
-
/* Paired with overflow-inline above: per the CSS overflow spec, pinning one axis to a
|
|
15
|
-
non-'visible' value forces the browser to resolve the other to 'auto' too (never
|
|
16
|
-
'visible') -- left implicit, a sub-pixel content/box mismatch on the block axis can trip a
|
|
17
|
-
spurious, non-interactive vertical scrollbar even though nothing here needs one. Mirrors
|
|
18
|
-
lr-tab-group's tablist fix (overflow-x: auto; overflow-y: hidden) for the identical bug. */
|
|
19
14
|
overflow-block: hidden;
|
|
20
15
|
overflow-wrap: anywhere;
|
|
21
16
|
}
|
|
22
17
|
[part='content'][data-unsanitized] {
|
|
23
|
-
/* Explicitly unsanitized content may carry positioned descendants. Keep that trusted-content
|
|
24
|
-
escape hatch clipped to this document surface instead of covering the surrounding app. */
|
|
25
18
|
contain: paint;
|
|
26
19
|
}
|
|
27
20
|
[part='content']:focus-visible,
|
|
@@ -29,8 +22,6 @@ import{css}from"lit";const styles=css`
|
|
|
29
22
|
outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);
|
|
30
23
|
outline-offset: calc(-1 * var(--lr-focus-ring-offset));
|
|
31
24
|
}
|
|
32
|
-
/* Shared by both the "still loading" and "fell back after a failure"
|
|
33
|
-
states -- see the renderedHtml field doc in markdown.ts. */
|
|
34
25
|
[part='content'][data-fallback] {
|
|
35
26
|
white-space: pre-wrap;
|
|
36
27
|
font-family: inherit;
|
|
@@ -63,16 +54,7 @@ import{css}from"lit";const styles=css`
|
|
|
63
54
|
border-radius: var(--lr-radius);
|
|
64
55
|
background: var(--lr-color-brand-quiet);
|
|
65
56
|
overflow-inline: auto;
|
|
66
|
-
/* See [part='content']'s identical overflow-block above -- same paired-axis rationale. */
|
|
67
57
|
overflow-block: hidden;
|
|
68
|
-
/* Deliberately the *shared* --lr-code-block-* name, not a --lr-markdown- one: a consumer setting
|
|
69
|
-
one tab width expects every code surface in the library to honour it. The default lives here
|
|
70
|
-
as a var() fallback rather than a :host declaration so a page- or container-level value can
|
|
71
|
-
actually reach it; lr-code-block carries the same fallback for its own <pre>, since it is a
|
|
72
|
-
sibling custom element rather than an ancestor and no single rule covers both.
|
|
73
|
-
Same value, but not necessarily the same look: this part inherits pre-wrap from
|
|
74
|
-
[part='content'] while lr-code-block's <pre> is white-space: pre, and tab stops are measured
|
|
75
|
-
from the start of each visual line, so a wrapped markdown code line restarts them. */
|
|
76
58
|
tab-size: var(--lr-code-block-tab-size, 2);
|
|
77
59
|
}
|
|
78
60
|
[part='code-block'] code {
|
|
@@ -81,21 +63,6 @@ import{css}from"lit";const styles=css`
|
|
|
81
63
|
font-size: var(--lr-font-size-sm);
|
|
82
64
|
line-height: var(--lr-line-height-normal);
|
|
83
65
|
}
|
|
84
|
-
/*
|
|
85
|
-
* Activates shiki's "dual themes" dark variant for highlighted fenced blocks, exactly as
|
|
86
|
-
* code-block.styles.ts does for lr-code-block's own pre. tokenizeMarkdownHighlight() renders
|
|
87
|
-
* every token with its light color as a plain inline color/background-color and its dark color
|
|
88
|
-
* stashed in the --shiki-dark/--shiki-dark-bg custom properties on the same element; shiki's own
|
|
89
|
-
* documented way to toggle them is a stylesheet rule that reassigns color/background-color from
|
|
90
|
-
* those variables. !important is required because an inline style attribute outranks an external
|
|
91
|
-
* stylesheet at any selector specificity short of it. These values come from shiki's theme data
|
|
92
|
-
* rather than this library's design tokens -- the one deliberate exception in this file.
|
|
93
|
-
*
|
|
94
|
-
* Gated on [data-dark-theme='true'] (kept live by the shared ThemeWatcher, off the component's
|
|
95
|
-
* own resolved --lr-color-text/--lr-color-surface) rather than the OS-level
|
|
96
|
-
* prefers-color-scheme media query, so a consumer who sets --lr-theme-color-* explicitly still
|
|
97
|
-
* gets the dark shiki palette.
|
|
98
|
-
*/
|
|
99
66
|
[part='content'][data-dark-theme='true'] [part='code-block'],
|
|
100
67
|
[part='content'][data-dark-theme='true'] [part='code-block'] span {
|
|
101
68
|
color: var(--shiki-dark, inherit) !important;
|
|
@@ -105,9 +72,6 @@ import{css}from"lit";const styles=css`
|
|
|
105
72
|
color: var(--lr-color-brand);
|
|
106
73
|
text-underline-offset: var(--lr-size-0-125rem);
|
|
107
74
|
}
|
|
108
|
-
/* Keeps an oversized source image from overflowing the content wrapper --
|
|
109
|
-
matches the overflow-wrap: anywhere guard on [part='content'] above,
|
|
110
|
-
which only covers text, not replaced elements like <img>. */
|
|
111
75
|
[part='img'] {
|
|
112
76
|
max-inline-size: 100%;
|
|
113
77
|
}
|
|
@@ -138,17 +102,12 @@ import{css}from"lit";const styles=css`
|
|
|
138
102
|
display: block;
|
|
139
103
|
margin-block: var(--lr-space-s) var(--lr-space-s);
|
|
140
104
|
overflow-inline: auto;
|
|
141
|
-
/* See [part='content']'s identical overflow-block above -- same paired-axis rationale. */
|
|
142
105
|
overflow-block: hidden;
|
|
143
106
|
text-align: center;
|
|
144
107
|
}
|
|
145
108
|
[part='math'][data-display='inline'] {
|
|
146
109
|
display: inline-block;
|
|
147
110
|
}
|
|
148
|
-
/* Painted text-quote highlights: the CSS Custom Highlight API path styles the browser-native
|
|
149
|
-
::highlight() pseudo (no element exists to select, so a [part='content'] mark[...] selector
|
|
150
|
-
below never matches on that path); the <mark>-wrap fallback path styles the real elements
|
|
151
|
-
text-highlights.ts creates in this same shadow tree. Both are kept in sync by tone. */
|
|
152
111
|
::highlight(lr-highlight-accent) {
|
|
153
112
|
background-color: var(--lr-markdown-highlight-accent-bg, var(--lr-color-brand-quiet));
|
|
154
113
|
}
|
|
@@ -29,9 +29,6 @@ import{css}from"lit";const styles=css`
|
|
|
29
29
|
}
|
|
30
30
|
[part~='regenerate-button'],
|
|
31
31
|
[part~='edit-button'] {
|
|
32
|
-
/* Keep the glyph compact while giving the interactive box the shared
|
|
33
|
-
minimum target size -- same "small glyph, padded hit box" pattern as
|
|
34
|
-
lr-code-block's/lr-json-viewer's [part='toggle']. */
|
|
35
32
|
display: inline-flex;
|
|
36
33
|
align-items: center;
|
|
37
34
|
justify-content: center;
|
|
@@ -14,9 +14,6 @@ import{css}from"lit";const styles=css`
|
|
|
14
14
|
}
|
|
15
15
|
[part="up-button"],
|
|
16
16
|
[part="down-button"] {
|
|
17
|
-
/* Keep the glyph compact while giving the interactive box the shared
|
|
18
|
-
minimum target size -- same "small glyph, padded hit box" pattern as
|
|
19
|
-
lr-code-block's/lr-json-viewer's [part='toggle']. */
|
|
20
17
|
display: inline-flex;
|
|
21
18
|
align-items: center;
|
|
22
19
|
justify-content: center;
|
|
@@ -31,8 +28,6 @@ import{css}from"lit";const styles=css`
|
|
|
31
28
|
color: var(--lr-color-text-quiet);
|
|
32
29
|
cursor: pointer;
|
|
33
30
|
}
|
|
34
|
-
/* Keep authored state qualifiers low-weight and easy to compose. Consumer-part precedence is
|
|
35
|
-
verified from rendered computed style rather than inferred from selector arithmetic. */
|
|
36
31
|
:where([part="up-button"]):hover:where(:not(:disabled)),
|
|
37
32
|
:where([part="down-button"]):hover:where(:not(:disabled)) {
|
|
38
33
|
background: var(--lr-color-surface-raised);
|
|
@@ -52,15 +47,6 @@ import{css}from"lit";const styles=css`
|
|
|
52
47
|
outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);
|
|
53
48
|
outline-offset: var(--lr-focus-ring-offset);
|
|
54
49
|
}
|
|
55
|
-
/* The pressed state is never color-alone -- the icon itself swaps to a filled glyph in
|
|
56
|
-
lockstep with aria-pressed. These color/background/border rules are additive emphasis
|
|
57
|
-
layered on top of that shape change, not the sole signal. */
|
|
58
|
-
/* Inline var() fallbacks rather than :host-declared properties, so a consumer can set them on the
|
|
59
|
-
element or any ancestor and a :host declaration can never shadow that.
|
|
60
|
-
::part(up-button)[aria-pressed='true'] is invalid CSS -- Shadow Parts forbids an attribute
|
|
61
|
-
selector after ::part() -- so retinting the pressed state used to mean hijacking the shared
|
|
62
|
-
--lr-color-success/-danger tokens, which repainted every other surface reading them. Unset,
|
|
63
|
-
each falls back to the token the rule already used, so the rendering is unchanged. */
|
|
64
50
|
[part="up-button"][aria-pressed="true"] {
|
|
65
51
|
color: var(--lr-message-feedback-up-active-color, var(--lr-color-success));
|
|
66
52
|
background: var(
|
|
@@ -88,9 +74,6 @@ import{css}from"lit";const styles=css`
|
|
|
88
74
|
cursor: not-allowed;
|
|
89
75
|
opacity: var(--lr-opacity-disabled);
|
|
90
76
|
}
|
|
91
|
-
/* A 0fr/1fr grid-row trick animates the disclosure's block size without measuring content --
|
|
92
|
-
min-block-size: 0 on the inner wrapper plus overflow: hidden here keeps collapsed content from
|
|
93
|
-
leaking through during the transition. */
|
|
94
77
|
[part="panel"] {
|
|
95
78
|
display: grid;
|
|
96
79
|
grid-template-rows: 0fr;
|
|
@@ -144,10 +127,6 @@ import{css}from"lit";const styles=css`
|
|
|
144
127
|
outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);
|
|
145
128
|
outline-offset: var(--lr-focus-ring-offset);
|
|
146
129
|
}
|
|
147
|
-
/* no-pressed-state: [part='comment'] is a textarea. A press on a text field is answered by the
|
|
148
|
-
field taking focus and raising its focus ring, which is both stronger than any momentary
|
|
149
|
-
pressed tint and outlasts the mouse button; a second, competing flash on mousedown would only
|
|
150
|
-
add noise to the one interaction that already has unambiguous feedback. */
|
|
151
130
|
:where([part="comment"]):hover:where(:not(:disabled)) {
|
|
152
131
|
border-color: var(--lr-color-brand);
|
|
153
132
|
}
|
|
@@ -169,16 +148,6 @@ import{css}from"lit";const styles=css`
|
|
|
169
148
|
overflow-wrap: anywhere;
|
|
170
149
|
cursor: pointer;
|
|
171
150
|
}
|
|
172
|
-
/* Hover/press are a background mix, never filter: brightness(). brightness() multiplies every
|
|
173
|
-
channel, so it lightens a dark fill and darkens a light one only by accident, does nothing at
|
|
174
|
-
all to a pure white or pure black brand color, and -- because filter applies to the whole
|
|
175
|
-
subtree -- dims the label along with the fill. Mixing the resting fill toward
|
|
176
|
-
--lr-color-mix-partner (which tracks the text color) always moves, always in the direction the
|
|
177
|
-
surface needs, and leaves the label alone. */
|
|
178
|
-
/* Gated on :not(:disabled) through the same :where() wrapper the thumb buttons use above -- a
|
|
179
|
-
submit button held disabled by the disabled or a long-lived pending state still matches :hover
|
|
180
|
-
(CSS keeps matching it on a disabled control), so an ungated rule made the one control the
|
|
181
|
-
user cannot activate look like the most activatable thing on the panel. */
|
|
182
151
|
:where([part="submit-button"]):hover:where(:not(:disabled)) {
|
|
183
152
|
background: color-mix(
|
|
184
153
|
in oklab,
|
|
@@ -193,8 +162,6 @@ import{css}from"lit";const styles=css`
|
|
|
193
162
|
var(--lr-color-mix-partner) var(--lr-color-mix-active)
|
|
194
163
|
);
|
|
195
164
|
}
|
|
196
|
-
/* Matches the up/down thumb buttons' own disabled treatment, so every control in the component
|
|
197
|
-
reads as unavailable from the same two signals (dimmed fill, not-allowed cursor). */
|
|
198
165
|
[part="submit-button"]:disabled {
|
|
199
166
|
cursor: not-allowed;
|
|
200
167
|
opacity: var(--lr-opacity-disabled);
|
|
@@ -207,6 +174,4 @@ import{css}from"lit";const styles=css`
|
|
|
207
174
|
outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);
|
|
208
175
|
outline-offset: var(--lr-focus-ring-offset);
|
|
209
176
|
}
|
|
210
|
-
/* 320px baseline: the panel already stacks in a flex column and the comment field is full-width
|
|
211
|
-
by construction, so no additional narrow-specific rule is needed. */
|
|
212
177
|
`;export{styles};
|
|
@@ -48,7 +48,7 @@ export interface LyraMessagePartsEventMap extends Omit<LyraMarkdownEventMap, 'lr
|
|
|
48
48
|
* @event lr-highlight-activate - Passthrough from rendered Markdown.
|
|
49
49
|
* @event lr-text-select - Passthrough from rendered Markdown.
|
|
50
50
|
* @event lr-anchor-result - Passthrough from rendered Markdown.
|
|
51
|
-
* @event lr-preview-request -
|
|
51
|
+
* @event lr-preview-request - Passthrough from a rendered attachment. Not cancelable since 10.0.0.
|
|
52
52
|
* @event lr-retry - Passthrough from a rendered attachment.
|
|
53
53
|
* @event lr-remove - Passthrough from a rendered attachment.
|
|
54
54
|
* @event lr-citation-open - Passthrough from a rendered citation's full-preview action.
|
|
@@ -16,11 +16,6 @@ import{css}from"lit";const styles=css`
|
|
|
16
16
|
min-inline-size: 0;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
/* De-emphasises this part's OWN text while an answer is still streaming. Deliberately a colour
|
|
20
|
-
change rather than an opacity on the subtree: a streaming part can contain a nested component
|
|
21
|
-
(an <lr-thinking-panel>, a tool-call chip) that sets its own colour at the contrast floor, and
|
|
22
|
-
a container opacity multiplies that down through it — which is a WCAG 1.4.3 failure the nested
|
|
23
|
-
component cannot see or defend against. color only reaches text that actually inherits it. */
|
|
24
19
|
[part~='part-streaming'] {
|
|
25
20
|
color: var(--lr-message-parts-streaming-color, var(--lr-color-text-quiet));
|
|
26
21
|
}
|
|
@@ -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{activeElementIn}from"../../../internal/active-element.js";import{applyComposedFocusRepair,captureComposedFocusRepair,isComposedFocusAvailable}from"../../../internal/focus-navigation.js";import{LyraElement}from"../../../internal/lyra-element.js";import{sizes}from"../../../internal/sizes.styles.js";import{nextId}from"../../../internal/a11y.js";import{chevronIcon}from"../../../internal/icons.js";import{AnchoredValidityController,VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{syncValidityStates}from"../../../internal/custom-states.js";import{styles}from"./model-select.styles.js";import{spellcheckFromAttributeConverter as spellcheckConverter}from"../../../internal/converters.js";import{attachInternalsSafely,getFormOwner,installCustomErrorProperty,isBarredFromValidation,setFormOwner}from"../../../internal/form-associated.js";import{installInvalidEventAlias}from"../../../internal/invalid-event-alias.js";import{CatalogPickerController}from"../../../internal/catalog-picker.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{LYRA_DEFAULT_fieldRequired,LYRA_DEFAULT_model,LYRA_DEFAULT_modelSelectNoModels,LYRA_DEFAULT_modelSelectRequired,LYRA_DEFAULT_noMatches,LYRA_DEFAULT_notInCatalog}from"../../../internal/default-strings.generated.js";class LyraModelSelect extends LyraElement{static{this.defaultStrings={...super.defaultStrings,fieldRequired:LYRA_DEFAULT_fieldRequired,model:LYRA_DEFAULT_model,modelSelectNoModels:LYRA_DEFAULT_modelSelectNoModels,modelSelectRequired:LYRA_DEFAULT_modelSelectRequired,noMatches:LYRA_DEFAULT_noMatches,notInCatalog:LYRA_DEFAULT_notInCatalog}}static{this.ownedCollectionProperties=Object.freeze(["catalog"])}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:!0,useDefault:!0,noAccessor:!0},name:{reflect:!0,noAccessor:!0}}}get open(){return this.catalogPicker.open}set open(next){this.catalogPicker.setOpen(next)}get activeIndex(){return this.catalogPicker.activeIndex}set activeIndex(next){this.catalogPicker.setActiveIndex(next)}get query(){return this.catalogPicker.query}set query(next){this.catalogPicker.setQuery(next)}constructor(){super(),this.provider="",this.allowCustom=!1,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.listId=nextId("model-select-list"),this.controlId=nextId("model-select-control"),this._fieldsetDisabled=!1,this._name="",this._disabled=!1,this._required=!1,this.suppressControlBlur=!1,this.catalogPicker=new CatalogPickerController(this,{catalog:()=>this.catalog,allowCustom:()=>this.allowCustom,locale:()=>this.effectiveLocale,searchableFields:entry=>[entry.id,entry.label],emitChange:detail=>this.emit("lr-change",detail),emitFocusAlias:()=>{},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.requestUpdate("open",oldValue):this.requestUpdate()},onControlFocus:event=>this.captureModeFocus(event),onControlBlur:event=>{this.effectiveDisabled||(this.touched=!0),this.retireModeFocusAfterBlur(event)},forwardFreeInputClick:!0}),this.onTriggerClick=()=>{this.effectiveDisabled||(this.open?this.hide():this.show())},this.onTriggerBlur=event=>{this.catalogPicker.handleControlBlur(event)},this.onTriggerFocus=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.onInputBlur=event=>{this.catalogPicker.handleControlBlur(event)},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("")}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)}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}connectedCallback(){super.connectedCallback(),this.updateValidity(),this.catalogPicker.connected(this.hasUpdated)}willUpdate(changed){super.willUpdate(changed);let modeChanged=!1;if(this.hasUpdated){const renderedControl=this.renderRoot.querySelector('[part="trigger"], [part="combobox-input"]');modeChanged=renderedControl?.getAttribute("part")==="trigger"!==this.closedMode,this.suppressControlBlur=modeChanged,this.catalogPicker.suppressControlEvents=modeChanged,this.modeFocusRepair=modeChanged&&renderedControl!==null&&activeElementIn(this.shadowRoot)===renderedControl?captureComposedFocusRepair(this,this.modeFocusFallback()??renderedControl)??void 0:modeChanged?this.focusedModeRepair:void 0}this.open&&(changed.has("catalog")||changed.has("value")||changed.has("allowCustom"))&&this.catalogPicker.reconcileRows(void 0,changed.has("value")||changed.has("allowCustom")||modeChanged,!1)}disconnectedCallback(){super.disconnectedCallback(),this.modeFocusRepair=void 0,this.focusedModeRepair=void 0,this.focusReturnTarget=void 0,this.catalogPicker.disconnected()}adoptedCallback(){super.adoptedCallback(),this.modeFocusRepair=void 0,this.focusedModeRepair=void 0,this.focusReturnTarget=void 0,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.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("modelSelectRequired")):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.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}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.suppressControlBlur=!1,this.catalogPicker.suppressControlEvents=!1;const focusRepair=this.modeFocusRepair;this.modeFocusRepair=void 0,focusRepair&&this.scheduleAfterUpdate(()=>{const replacement=this[VALIDITY_ANCHOR](),target=replacement&&isComposedFocusAvailable(replacement)?replacement:this.modeFocusFallback();applyComposedFocusRepair(focusRepair,target),this.focusedModeRepair===focusRepair&&(this.focusedModeRepair=void 0)},"model-select-mode-focus")}rememberFocusReturn(event){const related=event.relatedTarget;related&&related.nodeType===1&&isComposedFocusAvailable(related)&&(this.focusReturnTarget=related)}captureModeFocus(event){this.rememberFocusReturn(event);const control=event.currentTarget;!control||control.nodeType!==1||(this.focusedModeRepair=captureComposedFocusRepair(this,this.modeFocusFallback()??control)??void 0)}retireModeFocusAfterBlur(event){const destination=event.relatedTarget;if(destination&&destination.nodeType===1){this.focusedModeRepair=void 0;return}queueMicrotask(()=>{!this.suppressControlBlur&&!this.effectiveDisabled&&!this.hasAttribute("inert")&&(this.focusedModeRepair=void 0)})}modeFocusFallback(){if(this.focusReturnTarget&&isComposedFocusAvailable(this.focusReturnTarget))return this.focusReturnTarget;const owner=this.renderRoot.querySelector('[part="form-control"]');return owner&&isComposedFocusAvailable(owner)?owner:null}renderRows(rows,activeId){return rows.map((entry,i)=>{const id=`${this.listId}-opt-${i}`,selected=entry.id===this.value;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{activeElementIn}from"../../../internal/active-element.js";import{applyComposedFocusRepair,captureComposedFocusRepair,isComposedFocusAvailable}from"../../../internal/focus-navigation.js";import{LyraElement}from"../../../internal/lyra-element.js";import{sizes}from"../../../internal/sizes.styles.js";import{hostAriaLabel,nextId}from"../../../internal/a11y.js";import{chevronIcon}from"../../../internal/icons.js";import{AnchoredValidityController,VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{syncValidityStates}from"../../../internal/custom-states.js";import{styles}from"./model-select.styles.js";import{spellcheckFromAttributeConverter as spellcheckConverter}from"../../../internal/converters.js";import{attachInternalsSafely,getFormOwner,installCustomErrorProperty,isBarredFromValidation,setFormOwner}from"../../../internal/form-associated.js";import{installInvalidEventAlias}from"../../../internal/invalid-event-alias.js";import{CatalogPickerController}from"../../../internal/catalog-picker.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{LYRA_DEFAULT_fieldRequired,LYRA_DEFAULT_model,LYRA_DEFAULT_modelSelectNoModels,LYRA_DEFAULT_modelSelectRequired,LYRA_DEFAULT_noMatches,LYRA_DEFAULT_notInCatalog}from"../../../internal/default-strings.generated.js";class LyraModelSelect extends LyraElement{static{this.defaultStrings={...super.defaultStrings,fieldRequired:LYRA_DEFAULT_fieldRequired,model:LYRA_DEFAULT_model,modelSelectNoModels:LYRA_DEFAULT_modelSelectNoModels,modelSelectRequired:LYRA_DEFAULT_modelSelectRequired,noMatches:LYRA_DEFAULT_noMatches,notInCatalog:LYRA_DEFAULT_notInCatalog}}static{this.ownedCollectionProperties=Object.freeze(["catalog"])}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:!0,useDefault:!0,noAccessor:!0},name:{reflect:!0,noAccessor:!0}}}get open(){return this.catalogPicker.open}set open(next){this.catalogPicker.setOpen(next)}get activeIndex(){return this.catalogPicker.activeIndex}set activeIndex(next){this.catalogPicker.setActiveIndex(next)}get query(){return this.catalogPicker.query}set query(next){this.catalogPicker.setQuery(next)}constructor(){super(),this.provider="",this.allowCustom=!1,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.listId=nextId("model-select-list"),this.controlId=nextId("model-select-control"),this._fieldsetDisabled=!1,this._name="",this._disabled=!1,this._required=!1,this.suppressControlBlur=!1,this.catalogPicker=new CatalogPickerController(this,{catalog:()=>this.catalog,allowCustom:()=>this.allowCustom,locale:()=>this.effectiveLocale,searchableFields:entry=>[entry.id,entry.label],emitChange:detail=>this.emit("lr-change",detail),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.requestUpdate("open",oldValue):this.requestUpdate()},onControlFocus:event=>this.captureModeFocus(event),onControlBlur:event=>{this.effectiveDisabled||(this.touched=!0),this.retireModeFocusAfterBlur(event)},forwardFreeInputClick:!0}),this.onTriggerClick=()=>{this.effectiveDisabled||(this.open?this.hide():this.show())},this.onTriggerBlur=event=>{this.catalogPicker.handleControlBlur(event)},this.onTriggerFocus=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.onInputBlur=event=>{this.catalogPicker.handleControlBlur(event)},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("")}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)}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}connectedCallback(){super.connectedCallback(),this.updateValidity(),this.catalogPicker.connected(this.hasUpdated)}willUpdate(changed){super.willUpdate(changed);let modeChanged=!1;if(this.hasUpdated){const renderedControl=this.renderRoot.querySelector('[part="trigger"], [part="combobox-input"]');modeChanged=renderedControl?.getAttribute("part")==="trigger"!==this.closedMode,this.suppressControlBlur=modeChanged,this.catalogPicker.suppressControlEvents=modeChanged,this.modeFocusRepair=modeChanged&&renderedControl!==null&&activeElementIn(this.shadowRoot)===renderedControl?captureComposedFocusRepair(this,this.modeFocusFallback()??renderedControl)??void 0:modeChanged?this.focusedModeRepair:void 0}this.open&&(changed.has("catalog")||changed.has("value")||changed.has("allowCustom"))&&this.catalogPicker.reconcileRows(void 0,changed.has("value")||changed.has("allowCustom")||modeChanged,!1)}disconnectedCallback(){super.disconnectedCallback(),this.modeFocusRepair=void 0,this.focusedModeRepair=void 0,this.focusReturnTarget=void 0,this.catalogPicker.disconnected()}adoptedCallback(){super.adoptedCallback(),this.modeFocusRepair=void 0,this.focusedModeRepair=void 0,this.focusReturnTarget=void 0,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.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("modelSelectRequired")):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.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}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.suppressControlBlur=!1,this.catalogPicker.suppressControlEvents=!1;const focusRepair=this.modeFocusRepair;this.modeFocusRepair=void 0,focusRepair&&this.scheduleAfterUpdate(()=>{const replacement=this[VALIDITY_ANCHOR](),target=replacement&&isComposedFocusAvailable(replacement)?replacement:this.modeFocusFallback();applyComposedFocusRepair(focusRepair,target),this.focusedModeRepair===focusRepair&&(this.focusedModeRepair=void 0)},"model-select-mode-focus")}rememberFocusReturn(event){const related=event.relatedTarget;related&&related.nodeType===1&&isComposedFocusAvailable(related)&&(this.focusReturnTarget=related)}captureModeFocus(event){this.rememberFocusReturn(event);const control=event.currentTarget;!control||control.nodeType!==1||(this.focusedModeRepair=captureComposedFocusRepair(this,this.modeFocusFallback()??control)??void 0)}retireModeFocusAfterBlur(event){const destination=event.relatedTarget;if(destination&&destination.nodeType===1){this.focusedModeRepair=void 0;return}queueMicrotask(()=>{!this.suppressControlBlur&&!this.effectiveDisabled&&!this.hasAttribute("inert")&&(this.focusedModeRepair=void 0)})}modeFocusFallback(){if(this.focusReturnTarget&&isComposedFocusAvailable(this.focusReturnTarget))return this.focusReturnTarget;const owner=this.renderRoot.querySelector('[part="form-control"]');return owner&&isComposedFocusAvailable(owner)?owner:null}renderRows(rows,activeId){return rows.map((entry,i)=>{const id=`${this.listId}-opt-${i}`,selected=entry.id===this.value;return html`<div
|
|
2
2
|
part="option"
|
|
3
3
|
id=${id}
|
|
4
4
|
role="option"
|
|
@@ -40,7 +40,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
|
|
|
40
40
|
aria-expanded=${this.open?"true":"false"}
|
|
41
41
|
aria-controls=${this.listId}
|
|
42
42
|
aria-activedescendant=${activeId}
|
|
43
|
-
aria-label=${this
|
|
43
|
+
aria-label=${hostAriaLabel(this)??(hasLabel?nothing:this.placeholder||this.localize("model"))}
|
|
44
44
|
aria-describedby=${describedBy||nothing}
|
|
45
45
|
aria-required=${this.required?"true":"false"}
|
|
46
46
|
aria-invalid=${this.touched&&!this.internals.validity.valid?"true":"false"}
|
|
@@ -66,7 +66,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
|
|
|
66
66
|
id=${this.controlId}
|
|
67
67
|
part="combobox-input"
|
|
68
68
|
role="combobox"
|
|
69
|
-
aria-label=${this
|
|
69
|
+
aria-label=${hostAriaLabel(this)??(hasLabel?nothing:this.placeholder||this.localize("model"))}
|
|
70
70
|
aria-expanded=${this.open?"true":"false"}
|
|
71
71
|
aria-controls=${this.listId}
|
|
72
72
|
aria-activedescendant=${activeId}
|
|
@@ -5,13 +5,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
5
5
|
inline-size: 100%;
|
|
6
6
|
min-inline-size: 0;
|
|
7
7
|
max-inline-size: var(--lr-size-24rem);
|
|
8
|
-
/* The size ladder itself lives in internal/sizes.styles.ts, which this component composes ahead
|
|
9
|
-
of this sheet. Only the indirection is here: the public --lr-model-select-* surface stays
|
|
10
|
-
exactly as documented, while its VALUES come from the one --lr-form-control-* scale every
|
|
11
|
-
other control in the library sizes against. That keeps a model select the same height as the
|
|
12
|
-
lr-select / lr-input / lr-button next to it in a toolbar row at every tier, and it means the
|
|
13
|
-
shared sheet's per-tier :host([size='...']) rules (which list both spellings of each step)
|
|
14
|
-
are the only place a tier is ever restated. */
|
|
15
8
|
--_lr-model-select-trigger-padding: var(--lr-form-control-padding-block)
|
|
16
9
|
var(--lr-form-control-padding-inline);
|
|
17
10
|
--_lr-model-select-trigger-min-height: var(--lr-form-control-height);
|
|
@@ -23,9 +16,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
23
16
|
:host(:disabled) {
|
|
24
17
|
cursor: not-allowed;
|
|
25
18
|
}
|
|
26
|
-
/* The decorative expand icon is the one knob the shared ladder has no equivalent for -- it is a
|
|
27
|
-
glyph box, not a control metric -- so its three sizes stay here, listed in both spellings of
|
|
28
|
-
each tier so they track the shared sheet exactly. */
|
|
29
19
|
:host([size="2xs"]),
|
|
30
20
|
:host([size="xs"]) {
|
|
31
21
|
--_lr-model-select-expand-size: var(--lr-size-1rem);
|
|
@@ -41,14 +31,9 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
41
31
|
font-size: var(--lr-font-size-md-sm);
|
|
42
32
|
font-weight: var(--lr-font-weight-semibold);
|
|
43
33
|
}
|
|
44
|
-
/* :empty never matches here because the part always contains a slot element. Visible-label
|
|
45
|
-
presence is tracked from both the property and named slot, then reflected through hidden. */
|
|
46
34
|
[part="form-control-label"][hidden] {
|
|
47
35
|
display: none;
|
|
48
36
|
}
|
|
49
|
-
/* This control accepts required and renders a visible label like every other field in the
|
|
50
|
-
library, so it marks it the same way -- the [hidden] rule above is what keeps the marker from
|
|
51
|
-
orphaning a stray glyph when no label is set. */
|
|
52
37
|
${formControlRequiredMarker}
|
|
53
38
|
|
|
54
39
|
[part='trigger'],
|
|
@@ -92,9 +77,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
92
77
|
outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);
|
|
93
78
|
outline-offset: var(--lr-focus-ring-offset);
|
|
94
79
|
}
|
|
95
|
-
/* :where() zeroes the wrapped selectors' specificity contribution, keeping this at (0,1,0) --
|
|
96
|
-
matches lr-attachment-trigger's fixed convention, so a consumer's ::part(trigger):hover
|
|
97
|
-
override ((0,1,1)) still wins without needing !important. */
|
|
98
80
|
:where([part="trigger"]):hover:where(:not(:disabled)) {
|
|
99
81
|
background: var(--lr-color-brand-quiet);
|
|
100
82
|
}
|
|
@@ -199,11 +181,7 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
199
181
|
--lr-model-select-radius,
|
|
200
182
|
var(--_lr-model-select-radius-default)
|
|
201
183
|
);
|
|
202
|
-
/* Anchored overlay: a positioner-placed listbox floating over page content, not a modal layer. */
|
|
203
184
|
box-shadow: var(--lr-shadow-m);
|
|
204
|
-
/* Closed state: invisible + slightly raised. visibility (not
|
|
205
|
-
display:none) so opacity/transform can actually transition; hit-testing
|
|
206
|
-
and a11y exposure stay off since this part is already position:fixed. */
|
|
207
185
|
visibility: hidden;
|
|
208
186
|
opacity: 0;
|
|
209
187
|
transform: translateY(var(--lr-size-neg-0-25rem));
|
|
@@ -239,6 +217,18 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
239
217
|
text-align: start;
|
|
240
218
|
cursor: pointer;
|
|
241
219
|
}
|
|
220
|
+
[part="option"][aria-selected="true"] {
|
|
221
|
+
background: var(--lr-model-select-option-selected-bg, transparent);
|
|
222
|
+
border-color: var(
|
|
223
|
+
--lr-model-select-option-selected-border,
|
|
224
|
+
var(--lr-color-brand)
|
|
225
|
+
);
|
|
226
|
+
color: var(--lr-model-select-option-selected-color, var(--lr-color-brand));
|
|
227
|
+
font-weight: var(
|
|
228
|
+
--lr-model-select-option-selected-font-weight,
|
|
229
|
+
var(--lr-font-weight-semibold)
|
|
230
|
+
);
|
|
231
|
+
}
|
|
242
232
|
[part="option"]:hover,
|
|
243
233
|
[part="option"][data-active] {
|
|
244
234
|
background: var(
|
|
@@ -246,8 +236,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
246
236
|
var(--lr-color-brand-quiet)
|
|
247
237
|
);
|
|
248
238
|
}
|
|
249
|
-
/* Mixes the SAME --lr-model-select-option-active-bg the hover/active-descendant rule above uses,
|
|
250
|
-
so a consumer retinting the highlight gets a matching pressed step for free. */
|
|
251
239
|
[part="option"]:active {
|
|
252
240
|
background: color-mix(
|
|
253
241
|
in oklab,
|
|
@@ -255,21 +243,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
255
243
|
var(--lr-color-mix-partner) var(--lr-color-mix-active)
|
|
256
244
|
);
|
|
257
245
|
}
|
|
258
|
-
[part="option"][aria-selected="true"] {
|
|
259
|
-
/* Per-component indirection (inline var() fallbacks to the shared brand tokens, so unset
|
|
260
|
-
rendering is byte-for-byte unchanged) -- so a consumer can retheme just the selected row
|
|
261
|
-
without hijacking --lr-color-brand library-wide. */
|
|
262
|
-
background: var(--lr-model-select-option-selected-bg, transparent);
|
|
263
|
-
border-color: var(
|
|
264
|
-
--lr-model-select-option-selected-border,
|
|
265
|
-
var(--lr-color-brand)
|
|
266
|
-
);
|
|
267
|
-
color: var(--lr-model-select-option-selected-color, var(--lr-color-brand));
|
|
268
|
-
font-weight: var(
|
|
269
|
-
--lr-model-select-option-selected-font-weight,
|
|
270
|
-
var(--lr-font-weight-semibold)
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
246
|
[part="option-icon"] {
|
|
274
247
|
flex: 0 0 auto;
|
|
275
248
|
line-height: var(--lr-line-height-1-4);
|
|
@@ -281,10 +254,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
281
254
|
text-overflow: ellipsis;
|
|
282
255
|
white-space: nowrap;
|
|
283
256
|
}
|
|
284
|
-
/* Stale-value row: a previously-saved value that no longer appears in the
|
|
285
|
-
catalog. Marked with a dashed border + italic label (instead of the
|
|
286
|
-
solid border every real row uses) so it visually reads as "remembered,
|
|
287
|
-
not offered" rather than a normal selectable catalog entry. */
|
|
288
257
|
[part="option"][data-synthetic] {
|
|
289
258
|
border-style: var(--lr-model-select-option-synthetic-border-style, dashed);
|
|
290
259
|
border-color: var(
|
|
@@ -315,10 +284,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
315
284
|
font-size: var(--lr-font-size-sm);
|
|
316
285
|
color: var(--lr-color-text-quiet);
|
|
317
286
|
}
|
|
318
|
-
/* :empty never matches here -- the part always contains a literal slot
|
|
319
|
-
child element regardless of assigned/text content -- so real emptiness
|
|
320
|
-
is tracked in JS (hasHintSlot) and reflected via the hidden attribute
|
|
321
|
-
instead (same fix as lr-select's identical part). */
|
|
322
287
|
[part="hint"][hidden] {
|
|
323
288
|
display: none;
|
|
324
289
|
}
|
|
@@ -21,8 +21,6 @@ import{css}from"lit";const styles=css`
|
|
|
21
21
|
gap: var(--lr-space-xs);
|
|
22
22
|
min-inline-size: 0;
|
|
23
23
|
}
|
|
24
|
-
/* The nested control's own max-inline-size (24rem, sized for a standalone
|
|
25
|
-
dropdown) would otherwise clip a full-width row inside this card. */
|
|
26
24
|
[part='model-row'] lr-model-select {
|
|
27
25
|
inline-size: 100%;
|
|
28
26
|
max-inline-size: none;
|
|
@@ -52,10 +50,6 @@ import{css}from"lit";const styles=css`
|
|
|
52
50
|
text-align: end;
|
|
53
51
|
}
|
|
54
52
|
|
|
55
|
-
/* Compact layout: the two rows sit side by side instead of stacked, and
|
|
56
|
-
the temperature caption shrinks to an uppercase micro-label -- a denser
|
|
57
|
-
treatment for toolbars/sidebars where the vertical layout's full-height
|
|
58
|
-
rows don't fit. */
|
|
59
53
|
:host([layout='compact']) {
|
|
60
54
|
max-inline-size: none;
|
|
61
55
|
}
|
|
@@ -4,13 +4,16 @@ import type { DocumentRef } from '../../../ai/types.js';
|
|
|
4
4
|
import { LyraElement } from '../../../internal/lyra-element.js';
|
|
5
5
|
import type { LyraAttachmentCapability, LyraAttachmentFilesDetail } from '../../media/attachment-trigger/attachment-trigger.class.js';
|
|
6
6
|
import type { LyraSourceEntry } from '../../retrieval/source-picker/source-picker.class.js';
|
|
7
|
+
export type { LyraSourceEntry } from '../../retrieval/source-picker/source-picker.class.js';
|
|
7
8
|
import type { LyraMentionItem } from '../../utility/mention-popover/mention-popover.class.js';
|
|
8
9
|
import type { ChatComposerSelectionDirection, ChatComposerStatus, ChatComposerWrap } from '../chat-composer/chat-composer.class.js';
|
|
9
10
|
import type { LyraCatalog, LyraModelCatalogEntry } from '../model-select/model-select.class.js';
|
|
10
11
|
import type { PromptQueueItem } from '../prompt-queue/prompt-queue.class.js';
|
|
12
|
+
export type { PromptQueueItem } from '../prompt-queue/prompt-queue.class.js';
|
|
11
13
|
import type { PromptQueueChangeDetail } from '../prompt-queue/prompt-queue.class.js';
|
|
12
14
|
import type { LyraAttachmentIdDetail, LyraAttachmentPreviewRequestDetail, LyraAttachmentUploadStatus } from '../../media/attachment-chip/attachment-chip.class.js';
|
|
13
15
|
import type { LyraVoiceCatalogEntry } from '../voice-picker/voice-picker.class.js';
|
|
16
|
+
export type { LyraVoiceCatalogEntry } from '../voice-picker/voice-picker.class.js';
|
|
14
17
|
export interface LyraPromptSuggestion extends LyraMentionItem {
|
|
15
18
|
/** Inserted after the trigger. Defaults to `label`. */
|
|
16
19
|
insertText?: string;
|