@aceshooting/lyra-ui 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/custom-elements.json +23341 -11202
- package/dist/components/app-rail/app-rail.d.ts +171 -0
- package/dist/components/app-rail/app-rail.js +483 -0
- package/dist/components/app-rail/app-rail.styles.d.ts +1 -0
- package/dist/components/app-rail/app-rail.styles.js +125 -0
- package/dist/components/attachment-chip/attachment-chip.d.ts +114 -0
- package/dist/components/attachment-chip/attachment-chip.js +312 -0
- package/dist/components/attachment-chip/attachment-chip.styles.d.ts +1 -0
- package/dist/components/attachment-chip/attachment-chip.styles.js +184 -0
- package/dist/components/attachment-trigger/attachment-trigger.d.ts +83 -0
- package/dist/components/attachment-trigger/attachment-trigger.js +258 -0
- package/dist/components/attachment-trigger/attachment-trigger.styles.d.ts +1 -0
- package/dist/components/attachment-trigger/attachment-trigger.styles.js +68 -0
- package/dist/components/chart/box-plot.js +11 -1
- package/dist/components/chart/chart-loader.d.ts +44 -13
- package/dist/components/chart/chart-loader.js +65 -18
- package/dist/components/chart/chart.d.ts +1 -2
- package/dist/components/chart/chart.js +67 -12
- package/dist/components/chart/histogram-bin.d.ts +4 -1
- package/dist/components/chart/histogram-bin.js +24 -14
- package/dist/components/chart/lite-chart.d.ts +54 -0
- package/dist/components/chart/lite-chart.js +140 -22
- package/dist/components/chart/lite-chart.styles.js +9 -0
- package/dist/components/chat-composer/chat-composer.d.ts +92 -0
- package/dist/components/chat-composer/chat-composer.js +285 -0
- package/dist/components/chat-composer/chat-composer.styles.d.ts +1 -0
- package/dist/components/chat-composer/chat-composer.styles.js +135 -0
- package/dist/components/chat-message/chat-message.d.ts +113 -0
- package/dist/components/chat-message/chat-message.js +291 -0
- package/dist/components/chat-message/chat-message.styles.d.ts +1 -0
- package/dist/components/chat-message/chat-message.styles.js +203 -0
- package/dist/components/checkbox/checkbox.d.ts +59 -0
- package/dist/components/checkbox/checkbox.js +230 -0
- package/dist/components/checkbox/checkbox.styles.d.ts +1 -0
- package/dist/components/checkbox/checkbox.styles.js +70 -0
- package/dist/components/chip/chip-group.d.ts +56 -0
- package/dist/components/chip/chip-group.js +124 -0
- package/dist/components/chip/chip-group.styles.d.ts +1 -0
- package/dist/components/chip/chip-group.styles.js +57 -0
- package/dist/components/chip/chip.d.ts +64 -0
- package/dist/components/chip/chip.js +115 -0
- package/dist/components/chip/chip.styles.d.ts +1 -0
- package/dist/components/chip/chip.styles.js +115 -0
- package/dist/components/citation-badge/citation-badge.d.ts +113 -0
- package/dist/components/citation-badge/citation-badge.js +300 -0
- package/dist/components/citation-badge/citation-badge.styles.d.ts +1 -0
- package/dist/components/citation-badge/citation-badge.styles.js +96 -0
- package/dist/components/code-block/code-block.d.ts +89 -0
- package/dist/components/code-block/code-block.js +317 -0
- package/dist/components/code-block/code-block.styles.d.ts +1 -0
- package/dist/components/code-block/code-block.styles.js +187 -0
- package/dist/components/code-block/code-loader.d.ts +44 -0
- package/dist/components/code-block/code-loader.js +79 -0
- package/dist/components/combobox/combobox.d.ts +19 -1
- package/dist/components/combobox/combobox.js +84 -14
- package/dist/components/combobox/option.d.ts +5 -1
- package/dist/components/combobox/option.js +35 -0
- package/dist/components/context-meter/context-meter.d.ts +53 -0
- package/dist/components/context-meter/context-meter.js +150 -0
- package/dist/components/context-meter/context-meter.styles.d.ts +1 -0
- package/dist/components/context-meter/context-meter.styles.js +120 -0
- package/dist/components/conversation-item/conversation-item.d.ts +128 -0
- package/dist/components/conversation-item/conversation-item.js +322 -0
- package/dist/components/conversation-item/conversation-item.styles.d.ts +1 -0
- package/dist/components/conversation-item/conversation-item.styles.js +155 -0
- package/dist/components/date-picker/date-input.d.ts +24 -0
- package/dist/components/date-picker/date-input.js +134 -22
- package/dist/components/date-picker/date-picker.d.ts +7 -0
- package/dist/components/date-picker/date-picker.js +85 -16
- package/dist/components/dialog/confirm.d.ts +40 -0
- package/dist/components/dialog/confirm.js +79 -0
- package/dist/components/dialog/dialog.d.ts +85 -0
- package/dist/components/dialog/dialog.js +272 -0
- package/dist/components/dialog/dialog.styles.d.ts +1 -0
- package/dist/components/dialog/dialog.styles.js +52 -0
- package/dist/components/dock-panel/dock-panel.d.ts +134 -0
- package/dist/components/dock-panel/dock-panel.js +345 -0
- package/dist/components/dock-panel/dock-panel.styles.d.ts +1 -0
- package/dist/components/dock-panel/dock-panel.styles.js +145 -0
- package/dist/components/document-preview/document-preview.d.ts +135 -0
- package/dist/components/document-preview/document-preview.js +372 -0
- package/dist/components/document-preview/document-preview.styles.d.ts +1 -0
- package/dist/components/document-preview/document-preview.styles.js +191 -0
- package/dist/components/export-button/csv.js +1 -1
- package/dist/components/export-button/export-button.js +2 -0
- package/dist/components/flag/flag.d.ts +29 -13
- package/dist/components/flag/flag.js +39 -13
- package/dist/components/gauge/gauge.js +19 -10
- package/dist/components/generation-status/generation-status.d.ts +109 -0
- package/dist/components/generation-status/generation-status.js +273 -0
- package/dist/components/generation-status/generation-status.styles.d.ts +1 -0
- package/dist/components/generation-status/generation-status.styles.js +84 -0
- package/dist/components/heatmap/calendar-grid.d.ts +4 -1
- package/dist/components/heatmap/calendar-grid.js +25 -12
- package/dist/components/heatmap/heatmap-scale.d.ts +6 -0
- package/dist/components/heatmap/heatmap-scale.js +7 -1
- package/dist/components/heatmap/heatmap.d.ts +74 -0
- package/dist/components/heatmap/heatmap.js +135 -23
- package/dist/components/json-viewer/json-viewer.d.ts +53 -0
- package/dist/components/json-viewer/json-viewer.js +283 -0
- package/dist/components/json-viewer/json-viewer.styles.d.ts +1 -0
- package/dist/components/json-viewer/json-viewer.styles.js +176 -0
- package/dist/components/kbd/kbd.d.ts +77 -0
- package/dist/components/kbd/kbd.js +214 -0
- package/dist/components/kbd/kbd.styles.d.ts +1 -0
- package/dist/components/kbd/kbd.styles.js +52 -0
- package/dist/components/live-region/live-region.d.ts +81 -0
- package/dist/components/live-region/live-region.js +153 -0
- package/dist/components/live-region/live-region.styles.d.ts +1 -0
- package/dist/components/live-region/live-region.styles.js +10 -0
- package/dist/components/map/map.d.ts +8 -6
- package/dist/components/map/map.js +44 -8
- package/dist/components/markdown/markdown-loader.d.ts +34 -0
- package/dist/components/markdown/markdown-loader.js +43 -0
- package/dist/components/markdown/markdown.d.ts +81 -0
- package/dist/components/markdown/markdown.js +284 -0
- package/dist/components/markdown/markdown.styles.d.ts +1 -0
- package/dist/components/markdown/markdown.styles.js +82 -0
- package/dist/components/media-card/media-card.d.ts +122 -0
- package/dist/components/media-card/media-card.js +295 -0
- package/dist/components/media-card/media-card.styles.d.ts +1 -0
- package/dist/components/media-card/media-card.styles.js +132 -0
- package/dist/components/mention-popover/mention-popover.d.ts +200 -0
- package/dist/components/mention-popover/mention-popover.js +475 -0
- package/dist/components/mention-popover/mention-popover.styles.d.ts +1 -0
- package/dist/components/mention-popover/mention-popover.styles.js +101 -0
- package/dist/components/menu/menu-item.d.ts +62 -0
- package/dist/components/menu/menu-item.js +119 -0
- package/dist/components/menu/menu-item.styles.d.ts +1 -0
- package/dist/components/menu/menu-item.styles.js +67 -0
- package/dist/components/menu/menu.d.ts +143 -0
- package/dist/components/menu/menu.js +365 -0
- package/dist/components/menu/menu.styles.d.ts +1 -0
- package/dist/components/menu/menu.styles.js +66 -0
- package/dist/components/model-select/model-select.d.ts +125 -0
- package/dist/components/model-select/model-select.js +490 -0
- package/dist/components/model-select/model-select.styles.d.ts +1 -0
- package/dist/components/model-select/model-select.styles.js +189 -0
- package/dist/components/model-settings-panel/model-settings-panel.d.ts +69 -0
- package/dist/components/model-settings-panel/model-settings-panel.js +145 -0
- package/dist/components/model-settings-panel/model-settings-panel.styles.d.ts +1 -0
- package/dist/components/model-settings-panel/model-settings-panel.styles.js +82 -0
- package/dist/components/playback/playback.d.ts +13 -1
- package/dist/components/playback/playback.js +47 -14
- package/dist/components/responsive-panel/responsive-panel.d.ts +150 -0
- package/dist/components/responsive-panel/responsive-panel.js +365 -0
- package/dist/components/responsive-panel/responsive-panel.styles.d.ts +1 -0
- package/dist/components/responsive-panel/responsive-panel.styles.js +103 -0
- package/dist/components/result-card/result-card.d.ts +44 -0
- package/dist/components/result-card/result-card.js +83 -0
- package/dist/components/result-card/result-card.styles.d.ts +1 -0
- package/dist/components/result-card/result-card.styles.js +50 -0
- package/dist/components/result-card/result-field.d.ts +36 -0
- package/dist/components/result-card/result-field.js +87 -0
- package/dist/components/result-card/result-field.styles.d.ts +1 -0
- package/dist/components/result-card/result-field.styles.js +32 -0
- package/dist/components/select/select.d.ts +43 -2
- package/dist/components/select/select.js +150 -17
- package/dist/components/slider/slider.d.ts +89 -0
- package/dist/components/slider/slider.js +352 -0
- package/dist/components/slider/slider.styles.d.ts +1 -0
- package/dist/components/slider/slider.styles.js +87 -0
- package/dist/components/source-card/source-card.d.ts +92 -0
- package/dist/components/source-card/source-card.js +148 -0
- package/dist/components/source-card/source-card.styles.d.ts +1 -0
- package/dist/components/source-card/source-card.styles.js +69 -0
- package/dist/components/source-list/source-list.d.ts +63 -0
- package/dist/components/source-list/source-list.js +122 -0
- package/dist/components/source-list/source-list.styles.d.ts +1 -0
- package/dist/components/source-list/source-list.styles.js +59 -0
- package/dist/components/sparkline/sparkline.js +27 -13
- package/dist/components/split/split.d.ts +93 -1
- package/dist/components/split/split.js +284 -15
- package/dist/components/split/split.styles.js +30 -0
- package/dist/components/stat/stat.d.ts +6 -1
- package/dist/components/stat/stat.js +8 -2
- package/dist/components/stream-status/stream-status.d.ts +110 -0
- package/dist/components/stream-status/stream-status.js +210 -0
- package/dist/components/stream-status/stream-status.styles.d.ts +1 -0
- package/dist/components/stream-status/stream-status.styles.js +103 -0
- package/dist/components/streaming-text/streaming-text.d.ts +98 -0
- package/dist/components/streaming-text/streaming-text.js +209 -0
- package/dist/components/streaming-text/streaming-text.styles.d.ts +1 -0
- package/dist/components/streaming-text/streaming-text.styles.js +62 -0
- package/dist/components/switch/switch.d.ts +58 -0
- package/dist/components/switch/switch.js +179 -0
- package/dist/components/switch/switch.styles.d.ts +1 -0
- package/dist/components/switch/switch.styles.js +75 -0
- package/dist/components/table/table.d.ts +73 -4
- package/dist/components/table/table.js +169 -20
- package/dist/components/table/table.styles.js +6 -1
- package/dist/components/tabs/tabs.d.ts +51 -0
- package/dist/components/tabs/tabs.js +190 -0
- package/dist/components/tabs/tabs.styles.d.ts +1 -0
- package/dist/components/tabs/tabs.styles.js +63 -0
- package/dist/components/thinking-panel/thinking-panel.d.ts +121 -0
- package/dist/components/thinking-panel/thinking-panel.js +235 -0
- package/dist/components/thinking-panel/thinking-panel.styles.d.ts +1 -0
- package/dist/components/thinking-panel/thinking-panel.styles.js +117 -0
- package/dist/components/toast/toast-item.d.ts +1 -0
- package/dist/components/toast/toast-item.js +31 -6
- package/dist/components/tool-approval-dialog/tool-approval-dialog.d.ts +130 -0
- package/dist/components/tool-approval-dialog/tool-approval-dialog.js +403 -0
- package/dist/components/tool-approval-dialog/tool-approval-dialog.styles.d.ts +1 -0
- package/dist/components/tool-approval-dialog/tool-approval-dialog.styles.js +160 -0
- package/dist/components/tool-call-chip/tool-call-chip.d.ts +89 -0
- package/dist/components/tool-call-chip/tool-call-chip.js +288 -0
- package/dist/components/tool-call-chip/tool-call-chip.styles.d.ts +1 -0
- package/dist/components/tool-call-chip/tool-call-chip.styles.js +203 -0
- package/dist/components/tool-param-form/tool-param-form.d.ts +145 -0
- package/dist/components/tool-param-form/tool-param-form.js +366 -0
- package/dist/components/tool-param-form/tool-param-form.styles.d.ts +1 -0
- package/dist/components/tool-param-form/tool-param-form.styles.js +75 -0
- package/dist/components/tool-result-dialog/tool-result-dialog.d.ts +102 -0
- package/dist/components/tool-result-dialog/tool-result-dialog.js +393 -0
- package/dist/components/tool-result-dialog/tool-result-dialog.styles.d.ts +1 -0
- package/dist/components/tool-result-dialog/tool-result-dialog.styles.js +176 -0
- package/dist/components/tool-result-view/registry.d.ts +81 -0
- package/dist/components/tool-result-view/registry.js +84 -0
- package/dist/components/tool-result-view/tool-result-view.d.ts +55 -0
- package/dist/components/tool-result-view/tool-result-view.js +138 -0
- package/dist/components/tool-result-view/tool-result-view.styles.d.ts +1 -0
- package/dist/components/tool-result-view/tool-result-view.styles.js +13 -0
- package/dist/components/tool-select-dialog/tool-select-dialog.d.ts +151 -0
- package/dist/components/tool-select-dialog/tool-select-dialog.js +439 -0
- package/dist/components/tool-select-dialog/tool-select-dialog.styles.d.ts +1 -0
- package/dist/components/tool-select-dialog/tool-select-dialog.styles.js +182 -0
- package/dist/components/tree/tree-node.d.ts +11 -2
- package/dist/components/tree/tree-node.js +16 -6
- package/dist/components/tree/tree.d.ts +8 -2
- package/dist/components/tree/tree.js +18 -11
- package/dist/components/typing-indicator/typing-indicator.d.ts +60 -0
- package/dist/components/typing-indicator/typing-indicator.js +96 -0
- package/dist/components/typing-indicator/typing-indicator.styles.d.ts +1 -0
- package/dist/components/typing-indicator/typing-indicator.styles.js +132 -0
- package/dist/components/virtual-list/virtual-list.d.ts +173 -0
- package/dist/components/virtual-list/virtual-list.js +461 -0
- package/dist/components/virtual-list/virtual-list.styles.d.ts +1 -0
- package/dist/components/virtual-list/virtual-list.styles.js +44 -0
- package/dist/components/word-cloud/word-cloud-layout.js +14 -1
- package/dist/components/word-cloud/word-cloud.d.ts +6 -0
- package/dist/components/word-cloud/word-cloud.js +25 -14
- package/dist/components/word-cloud/word-cloud.styles.js +3 -2
- package/dist/internal/announcer.d.ts +57 -0
- package/dist/internal/announcer.js +71 -0
- package/dist/internal/form-associated.d.ts +1 -0
- package/dist/internal/form-associated.js +55 -11
- package/dist/internal/group-by-recency.d.ts +50 -0
- package/dist/internal/group-by-recency.js +80 -0
- package/dist/internal/rtl.d.ts +23 -0
- package/dist/internal/rtl.js +28 -0
- package/dist/internal/scroll-lock.d.ts +10 -5
- package/dist/internal/scroll-lock.js +30 -14
- package/dist/internal/tokens.styles.js +6 -0
- package/dist/lyra.d.ts +130 -31
- package/dist/lyra.js +94 -26
- package/llms-full.txt +3836 -17
- package/llms.txt +16 -1
- package/package.json +23 -5
- package/dist/components/chart/bar-chart.stories.d.ts +0 -5
- package/dist/components/chart/bar-chart.stories.js +0 -20
- package/dist/components/chart/box-plot.stories.d.ts +0 -5
- package/dist/components/chart/box-plot.stories.js +0 -29
- package/dist/components/chart/bubble-chart.stories.d.ts +0 -5
- package/dist/components/chart/bubble-chart.stories.js +0 -26
- package/dist/components/chart/chart.stories.d.ts +0 -32
- package/dist/components/chart/chart.stories.js +0 -141
- package/dist/components/chart/doughnut-chart.stories.d.ts +0 -5
- package/dist/components/chart/doughnut-chart.stories.js +0 -26
- package/dist/components/chart/histogram.stories.d.ts +0 -5
- package/dist/components/chart/histogram.stories.js +0 -17
- package/dist/components/chart/line-chart.stories.d.ts +0 -22
- package/dist/components/chart/line-chart.stories.js +0 -99
- package/dist/components/chart/lite-chart.stories.d.ts +0 -14
- package/dist/components/chart/lite-chart.stories.js +0 -114
- package/dist/components/chart/pie-chart.stories.d.ts +0 -5
- package/dist/components/chart/pie-chart.stories.js +0 -26
- package/dist/components/chart/polar-area-chart.stories.d.ts +0 -5
- package/dist/components/chart/polar-area-chart.stories.js +0 -20
- package/dist/components/chart/radar-chart.stories.d.ts +0 -5
- package/dist/components/chart/radar-chart.stories.js +0 -20
- package/dist/components/chart/scatter-chart.stories.d.ts +0 -5
- package/dist/components/chart/scatter-chart.stories.js +0 -31
- package/dist/components/combobox/combobox.stories.d.ts +0 -24
- package/dist/components/combobox/combobox.stories.js +0 -102
- package/dist/components/date-picker/date-input.stories.d.ts +0 -10
- package/dist/components/date-picker/date-input.stories.js +0 -48
- package/dist/components/date-picker/date-picker.stories.d.ts +0 -10
- package/dist/components/date-picker/date-picker.stories.js +0 -25
- package/dist/components/empty/empty.stories.d.ts +0 -7
- package/dist/components/empty/empty.stories.js +0 -34
- package/dist/components/export-button/export-button.stories.d.ts +0 -7
- package/dist/components/export-button/export-button.stories.js +0 -37
- package/dist/components/file-input/file-input.stories.d.ts +0 -7
- package/dist/components/file-input/file-input.stories.js +0 -19
- package/dist/components/flag/flag.stories.d.ts +0 -6
- package/dist/components/flag/flag.stories.js +0 -31
- package/dist/components/gauge/gauge.stories.d.ts +0 -8
- package/dist/components/gauge/gauge.stories.js +0 -19
- package/dist/components/graph/graph.stories.d.ts +0 -8
- package/dist/components/graph/graph.stories.js +0 -68
- package/dist/components/heatmap/heatmap.stories.d.ts +0 -27
- package/dist/components/heatmap/heatmap.stories.js +0 -179
- package/dist/components/map/map.stories.d.ts +0 -15
- package/dist/components/map/map.stories.js +0 -135
- package/dist/components/playback/playback.stories.d.ts +0 -7
- package/dist/components/playback/playback.stories.js +0 -16
- package/dist/components/select/select.stories.d.ts +0 -21
- package/dist/components/select/select.stories.js +0 -91
- package/dist/components/skeleton/skeleton.stories.d.ts +0 -5
- package/dist/components/skeleton/skeleton.stories.js +0 -16
- package/dist/components/sparkline/sparkline.stories.d.ts +0 -11
- package/dist/components/sparkline/sparkline.stories.js +0 -39
- package/dist/components/split/split.stories.d.ts +0 -7
- package/dist/components/split/split.stories.js +0 -36
- package/dist/components/stat/stat.stories.d.ts +0 -9
- package/dist/components/stat/stat.stories.js +0 -81
- package/dist/components/table/table.stories.d.ts +0 -12
- package/dist/components/table/table.stories.js +0 -67
- package/dist/components/time-range/time-range.stories.d.ts +0 -8
- package/dist/components/time-range/time-range.stories.js +0 -26
- package/dist/components/toast/toast.stories.d.ts +0 -8
- package/dist/components/toast/toast.stories.js +0 -72
- package/dist/components/tree/tree.stories.d.ts +0 -9
- package/dist/components/tree/tree.stories.js +0 -52
- package/dist/components/widget/widget.stories.d.ts +0 -9
- package/dist/components/widget/widget.stories.js +0 -74
- package/dist/components/word-cloud/word-cloud.stories.d.ts +0 -10
- package/dist/components/word-cloud/word-cloud.stories.js +0 -55
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A type-keyed dispatch registry for tool-result renderers -- a tiny plugin
|
|
3
|
+
* system so a host app can teach `<lyra-tool-result-view>` how to draw the
|
|
4
|
+
* result of e.g. a `get_weather` or `run_query` tool call without this
|
|
5
|
+
* library knowing anything about either. Dispatch is a two-step lookup
|
|
6
|
+
* (elipa-inspired): an exact match on the tool's name first, falling back to
|
|
7
|
+
* a facade/shape-based `matches(payload)` scan when no name matches --
|
|
8
|
+
* useful when several tool names share one result shape (e.g. every
|
|
9
|
+
* "*_search" tool returning `{ results: [...] }`) or when the caller doesn't
|
|
10
|
+
* reliably know the tool name at all.
|
|
11
|
+
*/
|
|
12
|
+
/** The module-level registry every `<lyra-tool-result-view>` dispatches against by default (see its `registry` prop to opt a given instance into a different one instead). */
|
|
13
|
+
const defaultRegistry = new Map();
|
|
14
|
+
/**
|
|
15
|
+
* Resolved-`load()` cache, keyed by *definition object identity* rather than
|
|
16
|
+
* by tool name. Keying by name would let two different registries that
|
|
17
|
+
* happen to reuse the same tool-name string (a default-registry entry and an
|
|
18
|
+
* unrelated custom-registry entry, say) silently share one cached module --
|
|
19
|
+
* identity keying makes that impossible while still giving every distinct
|
|
20
|
+
* definition the "call `load()` at most once" behavior a repeatedly-dispatched
|
|
21
|
+
* lazy renderer needs.
|
|
22
|
+
*/
|
|
23
|
+
let loadCache = new WeakMap();
|
|
24
|
+
/** Registers (or overwrites) the renderer for `name` in the default registry. */
|
|
25
|
+
export function registerToolRenderer(name, def) {
|
|
26
|
+
defaultRegistry.set(name, def);
|
|
27
|
+
}
|
|
28
|
+
/** The module-level default registry `registerToolRenderer()` writes to and `<lyra-tool-result-view>` reads from when no `registry` prop is set. */
|
|
29
|
+
export function getDefaultToolRendererRegistry() {
|
|
30
|
+
return defaultRegistry;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Finds the renderer definition for `toolName`/`payload` in `registry`
|
|
34
|
+
* (the default registry when omitted), in dispatch order:
|
|
35
|
+
* 1. An exact `toolName` key match.
|
|
36
|
+
* 2. Failing that, the first entry (in registration order -- a `Map`
|
|
37
|
+
* already iterates that way) whose `matches(payload)` returns `true`.
|
|
38
|
+
* 3. `undefined` -- the caller falls back to `<lyra-json-viewer>`.
|
|
39
|
+
*/
|
|
40
|
+
export function findToolRenderer(toolName, payload, registry = defaultRegistry) {
|
|
41
|
+
const exact = registry.get(toolName);
|
|
42
|
+
if (exact)
|
|
43
|
+
return exact;
|
|
44
|
+
for (const def of registry.values()) {
|
|
45
|
+
if (def.matches?.(payload))
|
|
46
|
+
return def;
|
|
47
|
+
}
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
function isModuleWrapper(mod) {
|
|
51
|
+
return 'default' in mod && typeof mod.default === 'object' && mod.default !== null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Resolves `def` to a definition guaranteed to carry a real `render` --
|
|
55
|
+
* awaiting and unwrapping `def.load()` (caching the result so a lazy
|
|
56
|
+
* definition's `load()` runs at most once no matter how many times it's
|
|
57
|
+
* dispatched to) when `def.load` is present, or returning `def` as-is
|
|
58
|
+
* otherwise. A rejected `load()` is *not* cached -- the definition stays
|
|
59
|
+
* registered, so a later resolution attempt (e.g. after a transient network
|
|
60
|
+
* failure) gets a fresh `load()` call rather than being stuck replaying one
|
|
61
|
+
* failed promise forever.
|
|
62
|
+
*/
|
|
63
|
+
export function loadToolRenderer(def) {
|
|
64
|
+
if (!def.load)
|
|
65
|
+
return Promise.resolve(def);
|
|
66
|
+
const cached = loadCache.get(def);
|
|
67
|
+
if (cached)
|
|
68
|
+
return cached;
|
|
69
|
+
const promise = def.load().then((mod) => (isModuleWrapper(mod) ? mod.default : mod));
|
|
70
|
+
loadCache.set(def, promise);
|
|
71
|
+
promise.catch(() => loadCache.delete(def));
|
|
72
|
+
return promise;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Test-only utility: empties the default registry and its `load()` cache so
|
|
76
|
+
* one test's `registerToolRenderer()` calls can't leak into the next. Mirrors
|
|
77
|
+
* the fact that this module (like `toaster.ts`'s per-placement region map) is
|
|
78
|
+
* deliberately singleton, module-level state -- there is no per-instance
|
|
79
|
+
* registry to construct fresh in a test's own `fixture()` call instead.
|
|
80
|
+
*/
|
|
81
|
+
export function clearToolRenderers() {
|
|
82
|
+
defaultRegistry.clear();
|
|
83
|
+
loadCache = new WeakMap();
|
|
84
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type TemplateResult, type PropertyValues } from 'lit';
|
|
2
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
3
|
+
import { type ToolRendererRegistry } from './registry.js';
|
|
4
|
+
import '../skeleton/skeleton.js';
|
|
5
|
+
import '../json-viewer/json-viewer.js';
|
|
6
|
+
/**
|
|
7
|
+
* `<lyra-tool-result-view>` — renders a tool call's result via whichever
|
|
8
|
+
* custom renderer a host app has registered for it (see `registerToolRenderer()`
|
|
9
|
+
* in `registry.ts`), falling back to `<lyra-json-viewer>` whenever no
|
|
10
|
+
* renderer matches, a renderer's optional `load()` rejects, or its `render()`
|
|
11
|
+
* throws. This component owns none of the actual visual weight of a
|
|
12
|
+
* populated tool result — that's entirely whatever the registered renderer
|
|
13
|
+
* returns; this is just the dispatch + fallback + loading-state shell.
|
|
14
|
+
*
|
|
15
|
+
* Dispatch runs against `registry` when set, otherwise against the
|
|
16
|
+
* module-level default registry `registerToolRenderer()` writes to — see
|
|
17
|
+
* `findToolRenderer()`'s two-step (exact name, then shape-based `matches()`)
|
|
18
|
+
* lookup order for the full rule.
|
|
19
|
+
*
|
|
20
|
+
* `fallback` only implements `"json"` today (an unconditional
|
|
21
|
+
* `<lyra-json-viewer>`) but is still accepted/reflected as an attribute so a
|
|
22
|
+
* consumer's markup that already sets `fallback="…"` for some future value
|
|
23
|
+
* doesn't need to change again once more fallback kinds land.
|
|
24
|
+
*
|
|
25
|
+
* @customElement lyra-tool-result-view
|
|
26
|
+
* @event lyra-render-error - `detail: { toolName, error }` — fired immediately
|
|
27
|
+
* before falling back to `<lyra-json-viewer>`, whether because no renderer
|
|
28
|
+
* matched, a renderer's `load()` rejected, or its `render()` threw.
|
|
29
|
+
* @csspart base - The root wrapper around the resolved renderer's output (or the loading/fallback view).
|
|
30
|
+
*/
|
|
31
|
+
export declare class LyraToolResultView extends LyraElement {
|
|
32
|
+
static styles: import("lit").CSSResultGroup[];
|
|
33
|
+
/** Custom registry to dispatch against instead of the module-level default one (see `registry.ts`). */
|
|
34
|
+
registry?: ToolRendererRegistry;
|
|
35
|
+
/** The tool's name — the primary dispatch key (see `findToolRenderer()`). */
|
|
36
|
+
toolName: string;
|
|
37
|
+
/** The tool call's result payload, handed to the matched renderer's `render()` (and to `matches()` for shape-based dispatch, and to the `<lyra-json-viewer>` fallback). */
|
|
38
|
+
result: unknown;
|
|
39
|
+
/** The tool call's original arguments, if available — handed to the matched renderer's `render()` alongside `result`. */
|
|
40
|
+
args: unknown;
|
|
41
|
+
/** Forward-compatible fallback-kind selector — see the class doc; only `"json"` is implemented today. */
|
|
42
|
+
fallback: string;
|
|
43
|
+
private renderState;
|
|
44
|
+
private generation;
|
|
45
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
46
|
+
private resolve;
|
|
47
|
+
private renderWith;
|
|
48
|
+
private fail;
|
|
49
|
+
render(): TemplateResult;
|
|
50
|
+
}
|
|
51
|
+
declare global {
|
|
52
|
+
interface HTMLElementTagNameMap {
|
|
53
|
+
'lyra-tool-result-view': LyraToolResultView;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html } from 'lit';
|
|
8
|
+
import { property, state } from 'lit/decorators.js';
|
|
9
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
10
|
+
import { defineElement } from '../../internal/prefix.js';
|
|
11
|
+
import { findToolRenderer, getDefaultToolRendererRegistry, loadToolRenderer, } from './registry.js';
|
|
12
|
+
import { styles } from './tool-result-view.styles.js';
|
|
13
|
+
import '../skeleton/skeleton.js';
|
|
14
|
+
import '../json-viewer/json-viewer.js';
|
|
15
|
+
const FALLBACK_STATE = { kind: 'fallback' };
|
|
16
|
+
/**
|
|
17
|
+
* `<lyra-tool-result-view>` — renders a tool call's result via whichever
|
|
18
|
+
* custom renderer a host app has registered for it (see `registerToolRenderer()`
|
|
19
|
+
* in `registry.ts`), falling back to `<lyra-json-viewer>` whenever no
|
|
20
|
+
* renderer matches, a renderer's optional `load()` rejects, or its `render()`
|
|
21
|
+
* throws. This component owns none of the actual visual weight of a
|
|
22
|
+
* populated tool result — that's entirely whatever the registered renderer
|
|
23
|
+
* returns; this is just the dispatch + fallback + loading-state shell.
|
|
24
|
+
*
|
|
25
|
+
* Dispatch runs against `registry` when set, otherwise against the
|
|
26
|
+
* module-level default registry `registerToolRenderer()` writes to — see
|
|
27
|
+
* `findToolRenderer()`'s two-step (exact name, then shape-based `matches()`)
|
|
28
|
+
* lookup order for the full rule.
|
|
29
|
+
*
|
|
30
|
+
* `fallback` only implements `"json"` today (an unconditional
|
|
31
|
+
* `<lyra-json-viewer>`) but is still accepted/reflected as an attribute so a
|
|
32
|
+
* consumer's markup that already sets `fallback="…"` for some future value
|
|
33
|
+
* doesn't need to change again once more fallback kinds land.
|
|
34
|
+
*
|
|
35
|
+
* @customElement lyra-tool-result-view
|
|
36
|
+
* @event lyra-render-error - `detail: { toolName, error }` — fired immediately
|
|
37
|
+
* before falling back to `<lyra-json-viewer>`, whether because no renderer
|
|
38
|
+
* matched, a renderer's `load()` rejected, or its `render()` threw.
|
|
39
|
+
* @csspart base - The root wrapper around the resolved renderer's output (or the loading/fallback view).
|
|
40
|
+
*/
|
|
41
|
+
export class LyraToolResultView extends LyraElement {
|
|
42
|
+
constructor() {
|
|
43
|
+
super(...arguments);
|
|
44
|
+
/** The tool's name — the primary dispatch key (see `findToolRenderer()`). */
|
|
45
|
+
this.toolName = '';
|
|
46
|
+
/** Forward-compatible fallback-kind selector — see the class doc; only `"json"` is implemented today. */
|
|
47
|
+
this.fallback = 'json';
|
|
48
|
+
this.renderState = FALLBACK_STATE;
|
|
49
|
+
// Bumped on every resolve() call so a stale in-flight load() (superseded by
|
|
50
|
+
// a newer toolName/result/args/registry before it settles) can detect it's
|
|
51
|
+
// no longer current and skip writing its result over a more recent one.
|
|
52
|
+
this.generation = 0;
|
|
53
|
+
}
|
|
54
|
+
static { this.styles = [LyraElement.styles, styles]; }
|
|
55
|
+
willUpdate(changed) {
|
|
56
|
+
if (!this.hasUpdated ||
|
|
57
|
+
changed.has('toolName') ||
|
|
58
|
+
changed.has('result') ||
|
|
59
|
+
changed.has('args') ||
|
|
60
|
+
changed.has('registry')) {
|
|
61
|
+
void this.resolve();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async resolve() {
|
|
65
|
+
const generation = ++this.generation;
|
|
66
|
+
const registry = this.registry ?? getDefaultToolRendererRegistry();
|
|
67
|
+
const def = findToolRenderer(this.toolName, this.result, registry);
|
|
68
|
+
if (!def) {
|
|
69
|
+
this.fail(new Error(`<lyra-tool-result-view>: no renderer registered for tool "${this.toolName}"`));
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (def.load) {
|
|
73
|
+
this.renderState = { kind: 'loading' };
|
|
74
|
+
let resolved;
|
|
75
|
+
try {
|
|
76
|
+
resolved = await loadToolRenderer(def);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
if (generation !== this.generation)
|
|
80
|
+
return;
|
|
81
|
+
this.fail(error);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (generation !== this.generation)
|
|
85
|
+
return;
|
|
86
|
+
this.renderWith(resolved);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this.renderWith(def);
|
|
90
|
+
}
|
|
91
|
+
renderWith(def) {
|
|
92
|
+
if (!def.render) {
|
|
93
|
+
this.fail(new Error(`<lyra-tool-result-view>: renderer for tool "${this.toolName}" has no render()`));
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
this.renderState = { kind: 'rendered', template: def.render(this.result, this.args) };
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
this.fail(error);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
fail(error) {
|
|
104
|
+
this.emit('lyra-render-error', { toolName: this.toolName, error });
|
|
105
|
+
this.renderState = FALLBACK_STATE;
|
|
106
|
+
}
|
|
107
|
+
render() {
|
|
108
|
+
const state = this.renderState;
|
|
109
|
+
return html `
|
|
110
|
+
<div part="base">
|
|
111
|
+
${state.kind === 'loading'
|
|
112
|
+
? html `<lyra-skeleton variant="rect" height="4rem"></lyra-skeleton>`
|
|
113
|
+
: state.kind === 'rendered'
|
|
114
|
+
? state.template
|
|
115
|
+
: html `<lyra-json-viewer .data=${this.result}></lyra-json-viewer>`}
|
|
116
|
+
</div>
|
|
117
|
+
`;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
__decorate([
|
|
121
|
+
property({ attribute: false })
|
|
122
|
+
], LyraToolResultView.prototype, "registry", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
property({ attribute: 'tool-name' })
|
|
125
|
+
], LyraToolResultView.prototype, "toolName", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
property({ attribute: false })
|
|
128
|
+
], LyraToolResultView.prototype, "result", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
property({ attribute: false })
|
|
131
|
+
], LyraToolResultView.prototype, "args", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
property({ reflect: true })
|
|
134
|
+
], LyraToolResultView.prototype, "fallback", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
state()
|
|
137
|
+
], LyraToolResultView.prototype, "renderState", void 0);
|
|
138
|
+
defineElement('tool-result-view', LyraToolResultView);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
// Deliberately minimal -- most visual weight comes from whatever the
|
|
3
|
+
// registered renderer's own template contributes; this wrapper only needs to
|
|
4
|
+
// not collapse to a zero-height inline box while a renderer/skeleton/
|
|
5
|
+
// json-viewer child lays itself out.
|
|
6
|
+
export const styles = css `
|
|
7
|
+
:host {
|
|
8
|
+
display: block;
|
|
9
|
+
}
|
|
10
|
+
[part='base'] {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { type TemplateResult, type PropertyValues } from 'lit';
|
|
2
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
3
|
+
import '../checkbox/checkbox.js';
|
|
4
|
+
import '../switch/switch.js';
|
|
5
|
+
/** One selectable agent tool. `category` groups the row; tools with no
|
|
6
|
+
* `category` (or an empty one) fall into the trailing "Other" bucket. */
|
|
7
|
+
export interface ToolSelectDialogTool {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
category?: string;
|
|
12
|
+
/** Literal icon hint (e.g. an emoji), rendered next to `name` -- same
|
|
13
|
+
* "opaque string, not a registry lookup" convention as `<lyra-tool-call-chip>`'s `icon`. */
|
|
14
|
+
icon?: string;
|
|
15
|
+
/** Individually gates this tool regardless of `useDefaults`/`selected` -- e.g. a tool that
|
|
16
|
+
* requires admin approval before it can ever be enabled. */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Supporting text shown under a `disabled` row (e.g. "requires admin approval"). Ignored when `disabled` is falsy. */
|
|
19
|
+
disabledReason?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Predicate deciding whether `tool` matches a (already-trimmed, already-lowercased) `query`.
|
|
22
|
+
* Mirrors `<lyra-combobox>`'s `OptionFilter` convention -- override `filter` to replace the
|
|
23
|
+
* built-in case-insensitive name/description substring match entirely. */
|
|
24
|
+
export type ToolSelectFilter = (tool: ToolSelectDialogTool, query: string) => boolean;
|
|
25
|
+
export interface ToolSelectionChangeDetail {
|
|
26
|
+
selected: string[];
|
|
27
|
+
useDefaults: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Reason the dialog was dismissed, forwarded as the `lyra-close` event detail
|
|
31
|
+
* -- mirrors `<lyra-dialog>`'s own `DialogCloseReason` shape. `'escape'`/
|
|
32
|
+
* `'backdrop'` come from the dialog's own built-in dismiss triggers; any
|
|
33
|
+
* other string is whatever a caller passes to `close()` directly (e.g. a
|
|
34
|
+
* consumer's own footer Done button).
|
|
35
|
+
*/
|
|
36
|
+
export type ToolSelectDialogCloseReason = 'escape' | 'backdrop' | 'api' | string;
|
|
37
|
+
/**
|
|
38
|
+
* `<lyra-tool-select-dialog>` — a category-grouped, filterable, searchable
|
|
39
|
+
* tool-enablement dialog for picking which agent tools are available in a
|
|
40
|
+
* conversation.
|
|
41
|
+
*
|
|
42
|
+
* This is its own standalone overlay implementation (`role="dialog"`,
|
|
43
|
+
* focus-trapped, Escape/backdrop-dismissible, scroll-locking) rather than
|
|
44
|
+
* nesting a `<lyra-dialog>` in its shadow template — see `<lyra-dialog>`'s
|
|
45
|
+
* own header comment for why a new overlay component in this library
|
|
46
|
+
* duplicates that pattern locally instead of composing the previous one.
|
|
47
|
+
*
|
|
48
|
+
* `useDefaults` is a single top-level switch: while `true`, every per-tool
|
|
49
|
+
* checkbox below renders disabled (still reflecting whatever `selected`
|
|
50
|
+
* holds — a consumer should populate that with its own default tool set
|
|
51
|
+
* whenever `useDefaults` is true) and a hint explains that turning the
|
|
52
|
+
* switch off is how to customize. Turning it off is the "customize"
|
|
53
|
+
* affordance — it's the only thing that both flips `useDefaults` to `false`
|
|
54
|
+
* *and* unlocks the per-tool checkboxes for editing, so there's exactly one
|
|
55
|
+
* control for that transition rather than a separate button duplicating it.
|
|
56
|
+
*
|
|
57
|
+
* There is no built-in footer/close button — like `<lyra-dialog>`, dismissal
|
|
58
|
+
* happens via Escape, a backdrop click, or a consumer's own `footer`-slotted
|
|
59
|
+
* action calling `close()`. This also means the search input is the very
|
|
60
|
+
* first focusable element in the panel with no special-casing needed, so
|
|
61
|
+
* it's what receives focus on open (see `updated()`).
|
|
62
|
+
*
|
|
63
|
+
* @customElement lyra-tool-select-dialog
|
|
64
|
+
* @slot footer - Optional action buttons (e.g. a "Done" button), rendered in a bottom row.
|
|
65
|
+
* Changes already apply live via `lyra-change`, so this is optional.
|
|
66
|
+
* @event lyra-change - The enabled-tool selection or the `useDefaults` toggle changed.
|
|
67
|
+
* `detail: { selected: string[], useDefaults: boolean }`.
|
|
68
|
+
* @event lyra-close - `detail: ToolSelectDialogCloseReason`. Fired exactly once per dismissal,
|
|
69
|
+
* via Escape, a backdrop click, or a `close()` call.
|
|
70
|
+
* @csspart backdrop - The full-viewport scrim behind the panel.
|
|
71
|
+
* @csspart panel - The dialog panel itself (`role="dialog"` while open).
|
|
72
|
+
* @csspart header - The wrapper around the title/subtitle.
|
|
73
|
+
* @csspart title - The dialog's heading.
|
|
74
|
+
* @csspart subtitle - The "N of M tools enabled" summary line.
|
|
75
|
+
* @csspart search-row - The wrapper around the search input.
|
|
76
|
+
* @csspart search-input - The filter text input.
|
|
77
|
+
* @csspart defaults-row - The wrapper around the use-defaults switch and its hint.
|
|
78
|
+
* @csspart defaults-toggle - The built-in `<lyra-switch>` bound to `useDefaults`.
|
|
79
|
+
* @csspart defaults-hint - The "turn off to customize" hint, shown only while `useDefaults` is true.
|
|
80
|
+
* @csspart body - The scrollable wrapper around the grouped tool list.
|
|
81
|
+
* @csspart empty - The "no tools" / "no matches" message.
|
|
82
|
+
* @csspart category - A single category's wrapper (`role="group"`).
|
|
83
|
+
* @csspart category-heading - A category's heading.
|
|
84
|
+
* @csspart category-count - The visible tool count next to a category heading.
|
|
85
|
+
* @csspart category-list - The `<ul>` of tool rows within a category.
|
|
86
|
+
* @csspart tool-row - A single tool's `<li>` row.
|
|
87
|
+
* @csspart tool-checkbox - A row's `<lyra-checkbox>`.
|
|
88
|
+
* @csspart tool-name - A row's name text (plus its `icon`, if set).
|
|
89
|
+
* @csspart tool-icon - A row's leading icon glyph, when `icon` is set.
|
|
90
|
+
* @csspart tool-description - A row's optional description text.
|
|
91
|
+
* @csspart tool-disabled-reason - A disabled row's `disabledReason` text.
|
|
92
|
+
* @csspart footer - The wrapper around the `footer` slot.
|
|
93
|
+
*/
|
|
94
|
+
export declare class LyraToolSelectDialog extends LyraElement {
|
|
95
|
+
static styles: import("lit").CSSResultGroup[];
|
|
96
|
+
/** Whether the dialog is open. Set this (or call `close()`) — there is no separate `show()`/`hide()` pair. */
|
|
97
|
+
open: boolean;
|
|
98
|
+
/** The full set of tools a consumer offers, across all categories. */
|
|
99
|
+
tools: ToolSelectDialogTool[];
|
|
100
|
+
/** The currently-enabled tool ids. */
|
|
101
|
+
selected: string[];
|
|
102
|
+
/** Whether the conversation is using the default tool set (`true`) or a custom selection (`false`) — see the class doc for the exact interaction with `selected`/per-tool editing. */
|
|
103
|
+
useDefaults: boolean;
|
|
104
|
+
/** The dialog's visible heading and accessible name. */
|
|
105
|
+
label: string;
|
|
106
|
+
searchPlaceholder: string;
|
|
107
|
+
/** Overrides the built-in case-insensitive name/description substring match. */
|
|
108
|
+
filter: ToolSelectFilter | null;
|
|
109
|
+
private query;
|
|
110
|
+
private hasFooterSlot;
|
|
111
|
+
private releaseScrollLock?;
|
|
112
|
+
private lastTrigger?;
|
|
113
|
+
private readonly titleId;
|
|
114
|
+
private readonly categoryIds;
|
|
115
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
116
|
+
protected updated(changed: PropertyValues): void;
|
|
117
|
+
connectedCallback(): void;
|
|
118
|
+
disconnectedCallback(): void;
|
|
119
|
+
private onFooterSlotChange;
|
|
120
|
+
/**
|
|
121
|
+
* Close the dialog and return focus to whatever had it before the dialog
|
|
122
|
+
* opened. `reason` is forwarded as the `lyra-close` detail — built-in
|
|
123
|
+
* triggers pass `'escape'`/`'backdrop'`; a consumer's own close affordance
|
|
124
|
+
* (e.g. a footer Done button) should call this directly with its own
|
|
125
|
+
* reason string, so every dismissal path funnels through the same event
|
|
126
|
+
* instead of the consumer having to also toggle `open` itself.
|
|
127
|
+
*/
|
|
128
|
+
close(reason?: ToolSelectDialogCloseReason): void;
|
|
129
|
+
private onBackdropClick;
|
|
130
|
+
private onDocKeyDown;
|
|
131
|
+
private getFocusableElements;
|
|
132
|
+
private getActiveElement;
|
|
133
|
+
private emitChange;
|
|
134
|
+
private onSearchInput;
|
|
135
|
+
private onDefaultsToggle;
|
|
136
|
+
private onToolToggle;
|
|
137
|
+
private categoryId;
|
|
138
|
+
/** Tools grouped by `category` (first-seen order), with an uncategorized
|
|
139
|
+
* bucket always last, then filtered by the active search query -- a
|
|
140
|
+
* category left with zero matches is dropped entirely rather than
|
|
141
|
+
* rendered as an empty heading. */
|
|
142
|
+
private get groups();
|
|
143
|
+
private renderTool;
|
|
144
|
+
private renderCategory;
|
|
145
|
+
render(): TemplateResult;
|
|
146
|
+
}
|
|
147
|
+
declare global {
|
|
148
|
+
interface HTMLElementTagNameMap {
|
|
149
|
+
'lyra-tool-select-dialog': LyraToolSelectDialog;
|
|
150
|
+
}
|
|
151
|
+
}
|