@carbon/ai-chat-components 1.9.0-alpha.0 → 1.9.0-rc.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/LICENSE +201 -0
- package/README.md +1 -5
- package/custom-elements.json +2466 -1911
- package/es/components/audio-player/index.d.ts +4 -4
- package/es/components/audio-player/src/audio-player.d.ts +1 -1
- package/es/components/audio-player/src/audio-player.js +33 -38
- package/es/components/audio-player/src/audio-player.js.map +1 -1
- package/es/components/audio-player/src/providers/base-provider.d.ts +2 -2
- package/es/components/audio-player/src/providers/base-provider.js +9 -9
- package/es/components/audio-player/src/providers/native-audio-provider.d.ts +2 -2
- package/es/components/audio-player/src/providers/native-audio-provider.js +18 -18
- package/es/components/audio-player/src/providers/soundcloud-provider.d.ts +2 -2
- package/es/components/audio-player/src/providers/soundcloud-provider.js +14 -14
- package/es/components/audio-player/src/transcript.d.ts +2 -2
- package/es/components/audio-player/src/transcript.js +13 -16
- package/es/components/audio-player/src/transcript.js.map +1 -1
- package/es/components/audio-player/src/utils/url-detector.js +1 -1
- package/es/components/card/index.d.ts +4 -4
- package/es/components/card/src/card-footer.d.ts +5 -5
- package/es/components/card/src/card-footer.js +12 -16
- package/es/components/card/src/card-footer.js.map +1 -1
- package/es/components/card/src/card-footer.scss.js +1 -1
- package/es/components/card/src/card-steps.d.ts +4 -4
- package/es/components/card/src/card-steps.js +3 -5
- package/es/components/card/src/card-steps.js.map +1 -1
- package/es/components/card/src/card-steps.scss.js +1 -1
- package/es/components/card/src/card.d.ts +2 -2
- package/es/components/card/src/card.js +3 -3
- package/es/components/card/src/card.scss.js +1 -1
- package/es/components/carousel/index.d.ts +1 -1
- package/es/components/carousel/src/carousel.d.ts +2 -2
- package/es/components/carousel/src/carousel.js +4 -6
- package/es/components/carousel/src/carousel.js.map +1 -1
- package/es/components/carousel/src/carousel.scss.js +1 -1
- package/es/components/chain-of-thought/defs.js +1 -1
- package/es/components/chain-of-thought/index.d.ts +10 -10
- package/es/components/chain-of-thought/src/chain-of-thought-step.d.ts +4 -4
- package/es/components/chain-of-thought/src/chain-of-thought-step.js +36 -42
- package/es/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought-toggle.d.ts +2 -2
- package/es/components/chain-of-thought/src/chain-of-thought-toggle.js +11 -14
- package/es/components/chain-of-thought/src/chain-of-thought-toggle.js.map +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought.d.ts +4 -4
- package/es/components/chain-of-thought/src/chain-of-thought.js +16 -17
- package/es/components/chain-of-thought/src/chain-of-thought.js.map +1 -1
- package/es/components/chain-of-thought/src/tool-call-data.d.ts +2 -2
- package/es/components/chain-of-thought/src/tool-call-data.js +17 -23
- package/es/components/chain-of-thought/src/tool-call-data.js.map +1 -1
- package/es/components/chat-button/defs.d.ts +1 -1
- package/es/components/chat-button/defs.js +1 -1
- package/es/components/chat-button/index.d.ts +2 -2
- package/es/components/chat-button/src/chat-button.d.ts +5 -5
- package/es/components/chat-button/src/chat-button.js +6 -6
- package/es/components/chat-button/src/chat-button.scss.js +1 -1
- package/es/components/chat-history/index.d.ts +11 -11
- package/es/components/chat-history/src/history-content.d.ts +1 -1
- package/es/components/chat-history/src/history-content.js +6 -6
- package/es/components/chat-history/src/history-delete-panel.d.ts +2 -2
- package/es/components/chat-history/src/history-delete-panel.js +11 -11
- package/es/components/chat-history/src/history-header.d.ts +2 -2
- package/es/components/chat-history/src/history-header.js +9 -10
- package/es/components/chat-history/src/history-header.js.map +1 -1
- package/es/components/chat-history/src/history-loading.d.ts +2 -2
- package/es/components/chat-history/src/history-loading.js +1 -1
- package/es/components/chat-history/src/history-panel-item-input.d.ts +2 -2
- package/es/components/chat-history/src/history-panel-item-input.js +21 -22
- package/es/components/chat-history/src/history-panel-item-input.js.map +1 -1
- package/es/components/chat-history/src/history-panel-item.d.ts +5 -5
- package/es/components/chat-history/src/history-panel-item.js +39 -41
- package/es/components/chat-history/src/history-panel-item.js.map +1 -1
- package/es/components/chat-history/src/history-panel-items.d.ts +1 -1
- package/es/components/chat-history/src/history-panel-items.js +1 -1
- package/es/components/chat-history/src/history-panel-menu.d.ts +1 -1
- package/es/components/chat-history/src/history-panel.d.ts +1 -1
- package/es/components/chat-history/src/history-panel.js +3 -3
- package/es/components/chat-history/src/history-search-item.d.ts +1 -1
- package/es/components/chat-history/src/history-search-item.js +4 -4
- package/es/components/chat-history/src/history-shell.d.ts +1 -1
- package/es/components/chat-history/src/history-shell.js +3 -3
- package/es/components/chat-history/src/history-toolbar.d.ts +9 -5
- package/es/components/chat-history/src/history-toolbar.js +13 -10
- package/es/components/chat-history/src/history-toolbar.js.map +1 -1
- package/es/components/chat-shell/index.d.ts +5 -5
- package/es/components/chat-shell/src/chat-header.d.ts +8 -8
- package/es/components/chat-shell/src/chat-header.js +37 -44
- package/es/components/chat-shell/src/chat-header.js.map +1 -1
- package/es/components/chat-shell/src/corner-manager.d.ts +1 -1
- package/es/components/chat-shell/src/corner-manager.js +30 -30
- package/es/components/chat-shell/src/initialization-manager.d.ts +1 -1
- package/es/components/chat-shell/src/panel-manager.d.ts +1 -1
- package/es/components/chat-shell/src/panel-manager.js +12 -12
- package/es/components/chat-shell/src/panel.d.ts +2 -2
- package/es/components/chat-shell/src/panel.js +99 -100
- package/es/components/chat-shell/src/panel.js.map +1 -1
- package/es/components/chat-shell/src/resize-observer-manager.d.ts +1 -1
- package/es/components/chat-shell/src/resize-observer-manager.js +10 -10
- package/es/components/chat-shell/src/shell.d.ts +8 -8
- package/es/components/chat-shell/src/shell.js +128 -135
- package/es/components/chat-shell/src/shell.js.map +1 -1
- package/es/components/chat-shell/src/slot-observer.d.ts +1 -1
- package/es/components/chat-shell/src/slot-observer.js +4 -7
- package/es/components/chat-shell/src/slot-observer.js.map +1 -1
- package/es/components/chat-shell/src/types.d.ts +4 -4
- package/es/components/chat-shell/src/workspace-manager-utils.js +4 -4
- package/es/components/chat-shell/src/workspace-manager.d.ts +1 -1
- package/es/components/chat-shell/src/workspace-manager.js +32 -32
- package/es/components/code-snippet/index.d.ts +4 -4
- package/es/components/code-snippet/src/code-snippet.d.ts +8 -8
- package/es/components/code-snippet/src/code-snippet.js +87 -93
- package/es/components/code-snippet/src/code-snippet.js.map +1 -1
- package/es/components/code-snippet/src/codemirror/base-setup.d.ts +1 -1
- package/es/components/code-snippet/src/codemirror/base-setup.js +1 -1
- package/es/components/code-snippet/src/codemirror/codemirror-loader.d.ts +1 -1
- package/es/components/code-snippet/src/codemirror/codemirror-loader.js +1 -1
- package/es/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +8 -8
- package/es/components/code-snippet/src/codemirror/content-sync.d.ts +1 -1
- package/es/components/code-snippet/src/codemirror/content-sync.js +2 -2
- package/es/components/code-snippet/src/codemirror/detect-language.d.ts +6 -0
- package/es/components/code-snippet/src/codemirror/detect-language.js +77 -0
- package/es/components/code-snippet/src/codemirror/detect-language.js.map +1 -0
- package/es/components/code-snippet/src/codemirror/diff-decorator.d.ts +2 -2
- package/es/components/code-snippet/src/codemirror/diff-decorator.js +4 -4
- package/es/components/code-snippet/src/codemirror/editor-manager.d.ts +4 -4
- package/es/components/code-snippet/src/codemirror/editor-manager.js +4 -4
- package/es/components/code-snippet/src/codemirror/language-controller.d.ts +3 -3
- package/es/components/code-snippet/src/codemirror/language-controller.js +3 -3
- package/es/components/code-snippet/src/codemirror/language-data.d.ts +1 -1
- package/es/components/code-snippet/src/codemirror/language-data.js +299 -299
- package/es/components/code-snippet/src/codemirror/language-utils.d.ts +2 -2
- package/es/components/code-snippet/src/codemirror/language-utils.js +60 -66
- package/es/components/code-snippet/src/codemirror/language-utils.js.map +1 -1
- package/es/components/code-snippet/src/codemirror/marker-utils.js +15 -15
- package/es/components/code-snippet/src/codemirror/theme.d.ts +1 -1
- package/es/components/code-snippet/src/codemirror/theme.js +163 -163
- package/es/components/code-snippet/src/dom-utils.js +6 -6
- package/es/components/code-snippet/src/layout-utils.d.ts +2 -2
- package/es/components/code-snippet/src/layout-utils.js +9 -9
- package/es/components/code-snippet/src/streaming-manager.js +5 -5
- package/es/components/feedback/index.d.ts +4 -4
- package/es/components/feedback/src/feedback-buttons.d.ts +3 -3
- package/es/components/feedback/src/feedback-buttons.js +17 -19
- package/es/components/feedback/src/feedback-buttons.js.map +1 -1
- package/es/components/feedback/src/feedback.d.ts +9 -9
- package/es/components/feedback/src/feedback.js +38 -45
- package/es/components/feedback/src/feedback.js.map +1 -1
- package/es/components/file-uploads/index.d.ts +5 -4
- package/es/components/file-uploads/src/file-type-icon.d.ts +18 -0
- package/es/components/file-uploads/src/file-type-icon.js +87 -0
- package/es/components/file-uploads/src/file-type-icon.js.map +1 -0
- package/es/components/file-uploads/src/file-upload-item.d.ts +69 -8
- package/es/components/file-uploads/src/file-upload-item.js +211 -112
- package/es/components/file-uploads/src/file-upload-item.js.map +1 -1
- package/es/components/file-uploads/src/file-uploads.d.ts +8 -4
- package/es/components/file-uploads/src/file-uploads.js +54 -29
- package/es/components/file-uploads/src/file-uploads.js.map +1 -1
- package/es/components/file-uploads/src/file-uploads.scss.js +1 -1
- package/es/components/file-uploads/src/types.d.ts +39 -0
- package/es/components/file-uploads/src/types.js +8 -0
- package/es/components/file-uploads/src/types.js.map +1 -0
- package/es/components/launcher/index.d.ts +9 -0
- package/es/components/launcher/index.js +9 -0
- package/es/components/launcher/index.js.map +1 -0
- package/es/components/launcher/src/launcher.d.ts +68 -0
- package/es/components/launcher/src/launcher.js +152 -0
- package/es/components/launcher/src/launcher.js.map +1 -0
- package/es/components/launcher/src/launcher.scss.js +13 -0
- package/es/components/launcher/src/launcher.scss.js.map +1 -0
- package/es/components/markdown/index.d.ts +5 -5
- package/es/components/markdown/src/markdown-renderer-types.d.ts +20 -9
- package/es/components/markdown/src/markdown-renderer.d.ts +9 -9
- package/es/components/markdown/src/markdown-renderer.js +97 -85
- package/es/components/markdown/src/markdown-renderer.js.map +1 -1
- package/es/components/markdown/src/markdown-token-tree.d.ts +1 -1
- package/es/components/markdown/src/markdown-token-tree.js +20 -20
- package/es/components/markdown/src/markdown.d.ts +4 -7
- package/es/components/markdown/src/markdown.js +110 -82
- package/es/components/markdown/src/markdown.js.map +1 -1
- package/es/components/markdown/src/markdown.template.js +1 -1
- package/es/components/markdown/src/plugins/markdown-it-attrs.d.ts +1 -1
- package/es/components/markdown/src/plugins/markdown-it-attrs.js +19 -19
- package/es/components/markdown/src/plugins/markdown-it-highlight.d.ts +1 -1
- package/es/components/markdown/src/plugins/markdown-it-highlight.js +5 -5
- package/es/components/markdown/src/plugins/markdown-it-task-lists.d.ts +1 -1
- package/es/components/markdown/src/plugins/markdown-it-task-lists.js +14 -14
- package/es/components/markdown/src/utils/html-helpers.d.ts +1 -1
- package/es/components/markdown/src/utils/html-helpers.js +72 -72
- package/es/components/markdown/src/utils/lit-directives.d.ts +2 -2
- package/es/components/markdown/src/utils/lit-directives.js +5 -5
- package/es/components/markdown/src/utils/plugin-fallback.d.ts +4 -4
- package/es/components/markdown/src/utils/plugin-fallback.js +68 -66
- package/es/components/markdown/src/utils/plugin-fallback.js.map +1 -1
- package/es/components/markdown/src/utils/slot-names.d.ts +1 -0
- package/es/components/markdown/src/utils/slot-names.js +83 -0
- package/es/components/markdown/src/utils/slot-names.js.map +1 -0
- package/es/components/markdown/src/utils/streaming-table.d.ts +1 -1
- package/es/components/markdown/src/utils/streaming-table.js +6 -6
- package/es/components/markdown/src/utils/table-helpers.d.ts +4 -4
- package/es/components/markdown/src/utils/table-helpers.js +17 -18
- package/es/components/markdown/src/utils/table-helpers.js.map +1 -1
- package/es/components/processing/index.d.ts +1 -1
- package/es/components/processing/src/processing.d.ts +2 -2
- package/es/components/processing/src/processing.js +2 -2
- package/es/components/prompt-line/autocomplete/index.d.ts +12 -0
- package/es/components/prompt-line/autocomplete/index.js +9 -0
- package/es/components/prompt-line/autocomplete/index.js.map +1 -0
- package/es/components/prompt-line/autocomplete/src/autocomplete.d.ts +175 -0
- package/es/components/prompt-line/autocomplete/src/autocomplete.js +494 -0
- package/es/components/prompt-line/autocomplete/src/autocomplete.js.map +1 -0
- package/es/components/{autocomplete → prompt-line/autocomplete}/src/autocomplete.scss.js +1 -1
- package/es/components/prompt-line/index.d.ts +18 -18
- package/es/components/prompt-line/src/autocomplete-controller.d.ts +28 -10
- package/es/components/prompt-line/src/autocomplete-controller.js +162 -52
- package/es/components/prompt-line/src/autocomplete-controller.js.map +1 -1
- package/es/components/prompt-line/src/error-message.d.ts +3 -7
- package/es/components/prompt-line/src/error-message.js +13 -23
- package/es/components/prompt-line/src/error-message.js.map +1 -1
- package/es/components/prompt-line/src/error-message.scss.js +1 -1
- package/es/components/prompt-line/src/prompt-line-constants.js +1 -1
- package/es/components/prompt-line/src/prompt-line-controller.d.ts +1 -1
- package/es/components/prompt-line/src/prompt-line-controller.js +83 -83
- package/es/components/prompt-line/src/prompt-line-rich-loader.d.ts +1 -1
- package/es/components/prompt-line/src/prompt-line-rich-loader.js +1 -1
- package/es/components/prompt-line/src/prompt-line-rich-runtime.d.ts +1 -1
- package/es/components/prompt-line/src/prompt-line-rich-runtime.js +30 -28
- package/es/components/prompt-line/src/prompt-line-rich-runtime.js.map +1 -1
- package/es/components/prompt-line/src/prompt-line-shell.d.ts +2 -2
- package/es/components/prompt-line/src/prompt-line-shell.js +11 -13
- package/es/components/prompt-line/src/prompt-line-shell.js.map +1 -1
- package/es/components/prompt-line/src/prompt-line-shell.scss.js +1 -1
- package/es/components/prompt-line/src/prompt-line.d.ts +5 -5
- package/es/components/prompt-line/src/prompt-line.js +35 -35
- package/es/components/prompt-line/src/prompt-line.js.map +1 -1
- package/es/components/prompt-line/src/send-control.d.ts +4 -4
- package/es/components/prompt-line/src/send-control.js +18 -20
- package/es/components/prompt-line/src/send-control.js.map +1 -1
- package/es/components/prompt-line/src/send-control.scss.js +1 -1
- package/es/components/prompt-line/src/stop-streaming-button.d.ts +3 -3
- package/es/components/prompt-line/src/stop-streaming-button.js +7 -8
- package/es/components/prompt-line/src/stop-streaming-button.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/build-extensions.d.ts +3 -3
- package/es/components/prompt-line/src/tiptap/build-extensions.js +2 -2
- package/es/components/prompt-line/src/tiptap/build-extensions.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/carbon-autocomplete.d.ts +2 -2
- package/es/components/prompt-line/src/tiptap/carbon-autocomplete.js +7 -7
- package/es/components/prompt-line/src/tiptap/carbon-mention.d.ts +2 -2
- package/es/components/prompt-line/src/tiptap/carbon-mention.js +9 -9
- package/es/components/prompt-line/src/tiptap/carbon-starter-trigger.d.ts +4 -3
- package/es/components/prompt-line/src/tiptap/carbon-starter-trigger.js +24 -12
- package/es/components/prompt-line/src/tiptap/carbon-starter-trigger.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/chat-enter.d.ts +1 -1
- package/es/components/prompt-line/src/tiptap/chat-enter.js +2 -2
- package/es/components/prompt-line/src/tiptap/editor-styles.js +26 -26
- package/es/components/prompt-line/src/tiptap/index.d.ts +24 -24
- package/es/components/prompt-line/src/tiptap/index.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/json-utils.d.ts +1 -1
- package/es/components/prompt-line/src/tiptap/json-utils.js +17 -17
- package/es/components/prompt-line/src/tiptap/keymap.d.ts +1 -1
- package/es/components/prompt-line/src/tiptap/keymap.js +3 -3
- package/es/components/prompt-line/src/tiptap/origin-meta.d.ts +1 -1
- package/es/components/prompt-line/src/tiptap/origin-meta.js +2 -2
- package/es/components/prompt-line/src/tiptap/plain-text-paste.d.ts +1 -1
- package/es/components/prompt-line/src/tiptap/plain-text-paste.js +5 -5
- package/es/components/prompt-line/src/tiptap/render-in-light-dom.d.ts +3 -3
- package/es/components/prompt-line/src/tiptap/render-in-light-dom.js +3 -3
- package/es/components/prompt-line/src/tiptap/render-token-chip.d.ts +4 -4
- package/es/components/prompt-line/src/tiptap/render-token-chip.js +22 -22
- package/es/components/prompt-line/src/tiptap/token-node-view.d.ts +4 -4
- package/es/components/prompt-line/src/tiptap/token-node-view.js +1 -1
- package/es/components/prompt-line/src/tiptap/trigger-utils.d.ts +9 -2
- package/es/components/prompt-line/src/tiptap/trigger-utils.js +11 -2
- package/es/components/prompt-line/src/tiptap/trigger-utils.js.map +1 -1
- package/es/components/prompt-line/src/tiptap/types.d.ts +46 -6
- package/es/components/prompt-line/src/tiptap/typing-indicator.d.ts +1 -1
- package/es/components/prompt-line/src/tiptap/typing-indicator.js +2 -2
- package/es/components/prompt-line/src/tiptap/value-sync.d.ts +1 -1
- package/es/components/prompt-line/src/tiptap/value-sync.js +2 -2
- package/es/components/prompt-line/src/types.d.ts +2 -2
- package/es/components/prompt-line/src/types.js.map +1 -1
- package/es/components/reasoning-steps/index.d.ts +4 -4
- package/es/components/reasoning-steps/src/reasoning-step.d.ts +2 -2
- package/es/components/reasoning-steps/src/reasoning-step.js +27 -31
- package/es/components/reasoning-steps/src/reasoning-step.js.map +1 -1
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.d.ts +2 -2
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.js +12 -14
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.js.map +1 -1
- package/es/components/reasoning-steps/src/reasoning-steps.d.ts +2 -2
- package/es/components/reasoning-steps/src/reasoning-steps.js +19 -20
- package/es/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
- package/es/components/shared/dynamic-css-var-sheet.js +7 -7
- package/es/components/shared/media-utils/script-loader.js +1 -1
- package/es/components/table/index.d.ts +3 -3
- package/es/components/table/src/table-loader.d.ts +1 -1
- package/es/components/table/src/table-loader.js +1 -1
- package/es/components/table/src/table-pagination.template.d.ts +3 -3
- package/es/components/table/src/table-pagination.template.js +4 -5
- package/es/components/table/src/table-pagination.template.js.map +1 -1
- package/es/components/table/src/table-runtime.d.ts +2 -2
- package/es/components/table/src/table-skeleton.template.d.ts +1 -1
- package/es/components/table/src/table-skeleton.template.js +2 -3
- package/es/components/table/src/table-skeleton.template.js.map +1 -1
- package/es/components/table/src/table.d.ts +3 -4
- package/es/components/table/src/table.js +36 -39
- package/es/components/table/src/table.js.map +1 -1
- package/es/components/table/src/table.template.d.ts +5 -5
- package/es/components/table/src/table.template.js +6 -9
- package/es/components/table/src/table.template.js.map +1 -1
- package/es/components/toolbar/index.d.ts +1 -1
- package/es/components/toolbar/src/toolbar.d.ts +9 -7
- package/es/components/toolbar/src/toolbar.js +52 -36
- package/es/components/toolbar/src/toolbar.js.map +1 -1
- package/es/components/toolbar/src/toolbar.scss.js +1 -1
- package/es/components/truncated-text/index.d.ts +1 -1
- package/es/components/truncated-text/src/truncated-text.d.ts +5 -5
- package/es/components/truncated-text/src/truncated-text.js +26 -28
- package/es/components/truncated-text/src/truncated-text.js.map +1 -1
- package/es/components/truncated-text/src/truncated-text.scss.js +1 -1
- package/es/components/video-player/index.d.ts +2 -2
- package/es/components/video-player/src/providers/base-provider.d.ts +3 -3
- package/es/components/video-player/src/providers/base-provider.js +5 -5
- package/es/components/video-player/src/providers/kaltura-provider.d.ts +2 -2
- package/es/components/video-player/src/providers/kaltura-provider.js +23 -23
- package/es/components/video-player/src/providers/native-video-provider.d.ts +2 -2
- package/es/components/video-player/src/providers/native-video-provider.js +20 -20
- package/es/components/video-player/src/providers/vimeo-provider.d.ts +2 -2
- package/es/components/video-player/src/providers/vimeo-provider.js +23 -23
- package/es/components/video-player/src/providers/youtube-provider.d.ts +2 -2
- package/es/components/video-player/src/providers/youtube-provider.js +15 -15
- package/es/components/video-player/src/utils/url-detector.js +1 -1
- package/es/components/video-player/src/video-player.d.ts +2 -2
- package/es/components/video-player/src/video-player.js +37 -41
- package/es/components/video-player/src/video-player.js.map +1 -1
- package/es/components/workspace-shell/index.d.ts +4 -4
- package/es/components/workspace-shell/src/header-collapsible-manager.js +13 -13
- package/es/components/workspace-shell/src/workspace-shell-body.d.ts +1 -1
- package/es/components/workspace-shell/src/workspace-shell-body.js +2 -2
- package/es/components/workspace-shell/src/workspace-shell-footer.d.ts +4 -4
- package/es/components/workspace-shell/src/workspace-shell-footer.js +10 -11
- package/es/components/workspace-shell/src/workspace-shell-footer.js.map +1 -1
- package/es/components/workspace-shell/src/workspace-shell-header.d.ts +2 -2
- package/es/components/workspace-shell/src/workspace-shell-header.js +10 -13
- package/es/components/workspace-shell/src/workspace-shell-header.js.map +1 -1
- package/es/components/workspace-shell/src/workspace-shell.d.ts +1 -1
- package/es/components/workspace-shell/src/workspace-shell.js +3 -3
- package/es/globals/decorators/carbon-element.d.ts +4 -4
- package/es/globals/decorators/carbon-element.js +2 -2
- package/es/globals/decorators/index.d.ts +1 -1
- package/es/globals/scss/common.scss.js +1 -1
- package/es/globals/settings.js +2 -2
- package/es/globals/utils/aria-announcer-manager.d.ts +1 -1
- package/es/globals/utils/aria-announcer-manager.js +6 -6
- package/es/globals/utils/browser-utils.js +1 -1
- package/es/globals/utils/csv.d.ts +8 -0
- package/es/globals/utils/csv.js +37 -0
- package/es/globals/utils/csv.js.map +1 -0
- package/es/globals/utils/dom-utils.js +1 -1
- package/es/globals/utils/focus-utils.js +4 -4
- package/es/globals/utils/iconTransform.d.ts +2 -2
- package/es/globals/utils/iconTransform.js +21 -21
- package/es/globals/utils/rtl-utils.js +1 -1
- package/es/globals/utils/uuid.js +5 -5
- package/es/react/__tests__/jest.setup.js +12 -12
- package/es/react/ai-label-action-button.d.ts +1 -1
- package/es/react/ai-label-action-button.js +1 -1
- package/es/react/audio-player.d.ts +1 -1
- package/es/react/audio-player.js +5 -5
- package/es/react/autocomplete.d.ts +1 -1
- package/es/react/autocomplete.js +5 -5
- package/es/react/card.d.ts +1 -1
- package/es/react/card.js +5 -5
- package/es/react/carousel.d.ts +1 -1
- package/es/react/carousel.js +2 -2
- package/es/react/chain-of-thought-step.d.ts +1 -1
- package/es/react/chain-of-thought-step.js +4 -4
- package/es/react/chain-of-thought-toggle.d.ts +2 -2
- package/es/react/chain-of-thought-toggle.js +3 -3
- package/es/react/chain-of-thought.d.ts +2 -2
- package/es/react/chain-of-thought.js +4 -4
- package/es/react/chat-button.d.ts +3 -3
- package/es/react/chat-button.js +2 -2
- package/es/react/chat-header.d.ts +3 -3
- package/es/react/chat-header.js +2 -2
- package/es/react/chat-shell.d.ts +2 -2
- package/es/react/chat-shell.js +2 -2
- package/es/react/code-snippet.d.ts +4 -4
- package/es/react/code-snippet.js +3 -3
- package/es/react/error-message.d.ts +1 -1
- package/es/react/error-message.js +1 -1
- package/es/react/feedback-buttons.d.ts +1 -1
- package/es/react/feedback-buttons.js +3 -3
- package/es/react/feedback.d.ts +2 -2
- package/es/react/feedback.js +4 -4
- package/es/react/file-upload-item.d.ts +11 -0
- package/es/react/file-upload-item.js +31 -0
- package/es/react/file-upload-item.js.map +1 -0
- package/es/react/file-uploads.d.ts +1 -1
- package/es/react/file-uploads.js +2 -2
- package/es/react/history/history-content.d.ts +1 -1
- package/es/react/history/history-content.js +1 -1
- package/es/react/history/history-delete-panel.d.ts +1 -1
- package/es/react/history/history-delete-panel.js +3 -3
- package/es/react/history/history-header.d.ts +1 -1
- package/es/react/history/history-header.js +2 -2
- package/es/react/history/history-loading.d.ts +1 -1
- package/es/react/history/history-loading.js +1 -1
- package/es/react/history/history-panel-item-input.d.ts +1 -1
- package/es/react/history/history-panel-item-input.js +4 -4
- package/es/react/history/history-panel-item.d.ts +1 -1
- package/es/react/history/history-panel-item.js +6 -6
- package/es/react/history/history-panel-items.d.ts +1 -1
- package/es/react/history/history-panel-items.js +1 -1
- package/es/react/history/history-panel-menu.d.ts +1 -1
- package/es/react/history/history-panel-menu.js +1 -1
- package/es/react/history/history-panel.d.ts +1 -1
- package/es/react/history/history-panel.js +1 -1
- package/es/react/history/history-search-item.d.ts +1 -1
- package/es/react/history/history-search-item.js +2 -2
- package/es/react/history/history-shell.d.ts +1 -1
- package/es/react/history/history-shell.js +1 -1
- package/es/react/history/history-toolbar.d.ts +1 -1
- package/es/react/history/history-toolbar.js +3 -3
- package/es/react/history/index.d.ts +12 -12
- package/es/react/hooks/useChatAutocomplete.d.ts +9 -4
- package/es/react/hooks/useChatAutocomplete.js +50 -19
- package/es/react/hooks/useChatAutocomplete.js.map +1 -1
- package/es/react/input-send-control.d.ts +1 -1
- package/es/react/input-send-control.js +3 -3
- package/es/react/launcher.d.ts +11 -0
- package/es/react/launcher.js +31 -0
- package/es/react/launcher.js.map +1 -0
- package/es/react/markdown.d.ts +7 -7
- package/es/react/markdown.js +13 -13
- package/es/react/markdown.js.map +1 -1
- package/es/react/panel.d.ts +1 -1
- package/es/react/panel.js +7 -7
- package/es/react/processing.d.ts +1 -1
- package/es/react/processing.js +2 -2
- package/es/react/prompt-line-shell.d.ts +1 -1
- package/es/react/prompt-line-shell.js +1 -1
- package/es/react/prompt-line.d.ts +1 -1
- package/es/react/prompt-line.js +9 -9
- package/es/react/reasoning-step.d.ts +1 -1
- package/es/react/reasoning-step.js +4 -4
- package/es/react/reasoning-steps-toggle.d.ts +2 -2
- package/es/react/reasoning-steps-toggle.js +3 -3
- package/es/react/reasoning-steps.d.ts +1 -1
- package/es/react/reasoning-steps.js +2 -2
- package/es/react/stop-streaming-button.d.ts +1 -1
- package/es/react/stop-streaming-button.js +1 -1
- package/es/react/table.d.ts +2 -2
- package/es/react/table.js +1 -1
- package/es/react/tool-call-data.d.ts +1 -1
- package/es/react/tool-call-data.js +2 -2
- package/es/react/toolbar.d.ts +4 -4
- package/es/react/toolbar.js +2 -2
- package/es/react/transcript.d.ts +1 -1
- package/es/react/transcript.js +3 -3
- package/es/react/utils/transformSuggestionConfig.d.ts +3 -3
- package/es/react/utils/transformSuggestionConfig.js +3 -3
- package/es/react/utils/transformSuggestionConfig.js.map +1 -1
- package/es/react/utils/withWebComponentBridge.d.ts +1 -1
- package/es/react/utils/withWebComponentBridge.js +22 -22
- package/es/react/video-player.d.ts +1 -1
- package/es/react/video-player.js +5 -5
- package/es/react/workspace-shell.d.ts +1 -1
- package/es/react/workspace-shell.js +6 -6
- package/es/testing/load-all-lazy-deps.d.ts +2 -2
- package/es/testing/load-all-lazy-deps.js +1 -1
- package/es/typings/overflow-menu.d.ts +2 -2
- package/es-custom/components/audio-player/index.d.ts +4 -4
- package/es-custom/components/audio-player/src/audio-player.d.ts +1 -1
- package/es-custom/components/audio-player/src/audio-player.js +33 -38
- package/es-custom/components/audio-player/src/audio-player.js.map +1 -1
- package/es-custom/components/audio-player/src/providers/base-provider.d.ts +2 -2
- package/es-custom/components/audio-player/src/providers/base-provider.js +9 -9
- package/es-custom/components/audio-player/src/providers/native-audio-provider.d.ts +2 -2
- package/es-custom/components/audio-player/src/providers/native-audio-provider.js +18 -18
- package/es-custom/components/audio-player/src/providers/soundcloud-provider.d.ts +2 -2
- package/es-custom/components/audio-player/src/providers/soundcloud-provider.js +14 -14
- package/es-custom/components/audio-player/src/transcript.d.ts +2 -2
- package/es-custom/components/audio-player/src/transcript.js +13 -16
- package/es-custom/components/audio-player/src/transcript.js.map +1 -1
- package/es-custom/components/audio-player/src/utils/url-detector.js +1 -1
- package/es-custom/components/card/index.d.ts +4 -4
- package/es-custom/components/card/src/card-footer.d.ts +5 -5
- package/es-custom/components/card/src/card-footer.js +12 -16
- package/es-custom/components/card/src/card-footer.js.map +1 -1
- package/es-custom/components/card/src/card-footer.scss.js +1 -1
- package/es-custom/components/card/src/card-steps.d.ts +4 -4
- package/es-custom/components/card/src/card-steps.js +3 -5
- package/es-custom/components/card/src/card-steps.js.map +1 -1
- package/es-custom/components/card/src/card-steps.scss.js +1 -1
- package/es-custom/components/card/src/card.d.ts +2 -2
- package/es-custom/components/card/src/card.js +3 -3
- package/es-custom/components/card/src/card.scss.js +1 -1
- package/es-custom/components/carousel/index.d.ts +1 -1
- package/es-custom/components/carousel/src/carousel.d.ts +2 -2
- package/es-custom/components/carousel/src/carousel.js +4 -6
- package/es-custom/components/carousel/src/carousel.js.map +1 -1
- package/es-custom/components/carousel/src/carousel.scss.js +1 -1
- package/es-custom/components/chain-of-thought/defs.js +1 -1
- package/es-custom/components/chain-of-thought/index.d.ts +10 -10
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.d.ts +4 -4
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js +36 -42
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.d.ts +2 -2
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js +11 -14
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js.map +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought.d.ts +4 -4
- package/es-custom/components/chain-of-thought/src/chain-of-thought.js +16 -17
- package/es-custom/components/chain-of-thought/src/chain-of-thought.js.map +1 -1
- package/es-custom/components/chain-of-thought/src/tool-call-data.d.ts +2 -2
- package/es-custom/components/chain-of-thought/src/tool-call-data.js +17 -23
- package/es-custom/components/chain-of-thought/src/tool-call-data.js.map +1 -1
- package/es-custom/components/chat-button/defs.d.ts +1 -1
- package/es-custom/components/chat-button/defs.js +1 -1
- package/es-custom/components/chat-button/index.d.ts +2 -2
- package/es-custom/components/chat-button/src/chat-button.d.ts +5 -5
- package/es-custom/components/chat-button/src/chat-button.js +6 -6
- package/es-custom/components/chat-button/src/chat-button.scss.js +1 -1
- package/es-custom/components/chat-history/index.d.ts +11 -11
- package/es-custom/components/chat-history/src/history-content.d.ts +1 -1
- package/es-custom/components/chat-history/src/history-content.js +6 -6
- package/es-custom/components/chat-history/src/history-delete-panel.d.ts +2 -2
- package/es-custom/components/chat-history/src/history-delete-panel.js +11 -11
- package/es-custom/components/chat-history/src/history-header.d.ts +2 -2
- package/es-custom/components/chat-history/src/history-header.js +9 -10
- package/es-custom/components/chat-history/src/history-header.js.map +1 -1
- package/es-custom/components/chat-history/src/history-loading.d.ts +2 -2
- package/es-custom/components/chat-history/src/history-loading.js +1 -1
- package/es-custom/components/chat-history/src/history-panel-item-input.d.ts +2 -2
- package/es-custom/components/chat-history/src/history-panel-item-input.js +21 -22
- package/es-custom/components/chat-history/src/history-panel-item-input.js.map +1 -1
- package/es-custom/components/chat-history/src/history-panel-item.d.ts +5 -5
- package/es-custom/components/chat-history/src/history-panel-item.js +39 -41
- package/es-custom/components/chat-history/src/history-panel-item.js.map +1 -1
- package/es-custom/components/chat-history/src/history-panel-items.d.ts +1 -1
- package/es-custom/components/chat-history/src/history-panel-items.js +1 -1
- package/es-custom/components/chat-history/src/history-panel-menu.d.ts +1 -1
- package/es-custom/components/chat-history/src/history-panel.d.ts +1 -1
- package/es-custom/components/chat-history/src/history-panel.js +3 -3
- package/es-custom/components/chat-history/src/history-search-item.d.ts +1 -1
- package/es-custom/components/chat-history/src/history-search-item.js +4 -4
- package/es-custom/components/chat-history/src/history-shell.d.ts +1 -1
- package/es-custom/components/chat-history/src/history-shell.js +3 -3
- package/es-custom/components/chat-history/src/history-toolbar.d.ts +9 -5
- package/es-custom/components/chat-history/src/history-toolbar.js +13 -10
- package/es-custom/components/chat-history/src/history-toolbar.js.map +1 -1
- package/es-custom/components/chat-shell/index.d.ts +5 -5
- package/es-custom/components/chat-shell/src/chat-header.d.ts +8 -8
- package/es-custom/components/chat-shell/src/chat-header.js +37 -44
- package/es-custom/components/chat-shell/src/chat-header.js.map +1 -1
- package/es-custom/components/chat-shell/src/corner-manager.d.ts +1 -1
- package/es-custom/components/chat-shell/src/corner-manager.js +30 -30
- package/es-custom/components/chat-shell/src/initialization-manager.d.ts +1 -1
- package/es-custom/components/chat-shell/src/panel-manager.d.ts +1 -1
- package/es-custom/components/chat-shell/src/panel-manager.js +12 -12
- package/es-custom/components/chat-shell/src/panel.d.ts +2 -2
- package/es-custom/components/chat-shell/src/panel.js +99 -100
- package/es-custom/components/chat-shell/src/panel.js.map +1 -1
- package/es-custom/components/chat-shell/src/resize-observer-manager.d.ts +1 -1
- package/es-custom/components/chat-shell/src/resize-observer-manager.js +10 -10
- package/es-custom/components/chat-shell/src/shell.d.ts +8 -8
- package/es-custom/components/chat-shell/src/shell.js +128 -135
- package/es-custom/components/chat-shell/src/shell.js.map +1 -1
- package/es-custom/components/chat-shell/src/slot-observer.d.ts +1 -1
- package/es-custom/components/chat-shell/src/slot-observer.js +4 -7
- package/es-custom/components/chat-shell/src/slot-observer.js.map +1 -1
- package/es-custom/components/chat-shell/src/types.d.ts +4 -4
- package/es-custom/components/chat-shell/src/workspace-manager-utils.js +4 -4
- package/es-custom/components/chat-shell/src/workspace-manager.d.ts +1 -1
- package/es-custom/components/chat-shell/src/workspace-manager.js +32 -32
- package/es-custom/components/code-snippet/index.d.ts +4 -4
- package/es-custom/components/code-snippet/src/code-snippet.d.ts +8 -8
- package/es-custom/components/code-snippet/src/code-snippet.js +87 -93
- package/es-custom/components/code-snippet/src/code-snippet.js.map +1 -1
- package/es-custom/components/code-snippet/src/codemirror/base-setup.d.ts +1 -1
- package/es-custom/components/code-snippet/src/codemirror/base-setup.js +1 -1
- package/es-custom/components/code-snippet/src/codemirror/codemirror-loader.d.ts +1 -1
- package/es-custom/components/code-snippet/src/codemirror/codemirror-loader.js +1 -1
- package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +8 -8
- package/es-custom/components/code-snippet/src/codemirror/content-sync.d.ts +1 -1
- package/es-custom/components/code-snippet/src/codemirror/content-sync.js +2 -2
- package/es-custom/components/code-snippet/src/codemirror/detect-language.d.ts +6 -0
- package/es-custom/components/code-snippet/src/codemirror/detect-language.js +77 -0
- package/es-custom/components/code-snippet/src/codemirror/detect-language.js.map +1 -0
- package/es-custom/components/code-snippet/src/codemirror/diff-decorator.d.ts +2 -2
- package/es-custom/components/code-snippet/src/codemirror/diff-decorator.js +4 -4
- package/es-custom/components/code-snippet/src/codemirror/editor-manager.d.ts +4 -4
- package/es-custom/components/code-snippet/src/codemirror/editor-manager.js +4 -4
- package/es-custom/components/code-snippet/src/codemirror/language-controller.d.ts +3 -3
- package/es-custom/components/code-snippet/src/codemirror/language-controller.js +3 -3
- package/es-custom/components/code-snippet/src/codemirror/language-data.d.ts +1 -1
- package/es-custom/components/code-snippet/src/codemirror/language-data.js +299 -299
- package/es-custom/components/code-snippet/src/codemirror/language-utils.d.ts +2 -2
- package/es-custom/components/code-snippet/src/codemirror/language-utils.js +60 -66
- package/es-custom/components/code-snippet/src/codemirror/language-utils.js.map +1 -1
- package/es-custom/components/code-snippet/src/codemirror/marker-utils.js +15 -15
- package/es-custom/components/code-snippet/src/codemirror/theme.d.ts +1 -1
- package/es-custom/components/code-snippet/src/codemirror/theme.js +163 -163
- package/es-custom/components/code-snippet/src/dom-utils.js +6 -6
- package/es-custom/components/code-snippet/src/layout-utils.d.ts +2 -2
- package/es-custom/components/code-snippet/src/layout-utils.js +9 -9
- package/es-custom/components/code-snippet/src/streaming-manager.js +5 -5
- package/es-custom/components/feedback/index.d.ts +4 -4
- package/es-custom/components/feedback/src/feedback-buttons.d.ts +3 -3
- package/es-custom/components/feedback/src/feedback-buttons.js +17 -19
- package/es-custom/components/feedback/src/feedback-buttons.js.map +1 -1
- package/es-custom/components/feedback/src/feedback.d.ts +9 -9
- package/es-custom/components/feedback/src/feedback.js +38 -45
- package/es-custom/components/feedback/src/feedback.js.map +1 -1
- package/es-custom/components/file-uploads/index.d.ts +5 -4
- package/es-custom/components/file-uploads/src/file-type-icon.d.ts +18 -0
- package/es-custom/components/file-uploads/src/file-type-icon.js +87 -0
- package/es-custom/components/file-uploads/src/file-type-icon.js.map +1 -0
- package/es-custom/components/file-uploads/src/file-upload-item.d.ts +69 -8
- package/es-custom/components/file-uploads/src/file-upload-item.js +211 -112
- package/es-custom/components/file-uploads/src/file-upload-item.js.map +1 -1
- package/es-custom/components/file-uploads/src/file-uploads.d.ts +8 -4
- package/es-custom/components/file-uploads/src/file-uploads.js +54 -29
- package/es-custom/components/file-uploads/src/file-uploads.js.map +1 -1
- package/es-custom/components/file-uploads/src/file-uploads.scss.js +1 -1
- package/es-custom/components/file-uploads/src/types.d.ts +39 -0
- package/es-custom/components/file-uploads/src/types.js +8 -0
- package/es-custom/components/file-uploads/src/types.js.map +1 -0
- package/es-custom/components/launcher/index.d.ts +9 -0
- package/es-custom/components/launcher/index.js +9 -0
- package/{es/components/autocomplete → es-custom/components/launcher}/index.js.map +1 -1
- package/es-custom/components/launcher/src/launcher.d.ts +68 -0
- package/es-custom/components/launcher/src/launcher.js +152 -0
- package/es-custom/components/launcher/src/launcher.js.map +1 -0
- package/es-custom/components/launcher/src/launcher.scss.js +13 -0
- package/es-custom/components/launcher/src/launcher.scss.js.map +1 -0
- package/es-custom/components/markdown/index.d.ts +5 -5
- package/es-custom/components/markdown/src/markdown-renderer-types.d.ts +20 -9
- package/es-custom/components/markdown/src/markdown-renderer.d.ts +9 -9
- package/es-custom/components/markdown/src/markdown-renderer.js +97 -85
- package/es-custom/components/markdown/src/markdown-renderer.js.map +1 -1
- package/es-custom/components/markdown/src/markdown-token-tree.d.ts +1 -1
- package/es-custom/components/markdown/src/markdown-token-tree.js +20 -20
- package/es-custom/components/markdown/src/markdown.d.ts +4 -7
- package/es-custom/components/markdown/src/markdown.js +110 -82
- package/es-custom/components/markdown/src/markdown.js.map +1 -1
- package/es-custom/components/markdown/src/markdown.template.js +1 -1
- package/es-custom/components/markdown/src/plugins/markdown-it-attrs.d.ts +1 -1
- package/es-custom/components/markdown/src/plugins/markdown-it-attrs.js +19 -19
- package/es-custom/components/markdown/src/plugins/markdown-it-highlight.d.ts +1 -1
- package/es-custom/components/markdown/src/plugins/markdown-it-highlight.js +5 -5
- package/es-custom/components/markdown/src/plugins/markdown-it-task-lists.d.ts +1 -1
- package/es-custom/components/markdown/src/plugins/markdown-it-task-lists.js +14 -14
- package/es-custom/components/markdown/src/utils/html-helpers.d.ts +1 -1
- package/es-custom/components/markdown/src/utils/html-helpers.js +72 -72
- package/es-custom/components/markdown/src/utils/lit-directives.d.ts +2 -2
- package/es-custom/components/markdown/src/utils/lit-directives.js +5 -5
- package/es-custom/components/markdown/src/utils/plugin-fallback.d.ts +4 -4
- package/es-custom/components/markdown/src/utils/plugin-fallback.js +68 -66
- package/es-custom/components/markdown/src/utils/plugin-fallback.js.map +1 -1
- package/es-custom/components/markdown/src/utils/slot-names.d.ts +1 -0
- package/es-custom/components/markdown/src/utils/slot-names.js +83 -0
- package/es-custom/components/markdown/src/utils/slot-names.js.map +1 -0
- package/es-custom/components/markdown/src/utils/streaming-table.d.ts +1 -1
- package/es-custom/components/markdown/src/utils/streaming-table.js +6 -6
- package/es-custom/components/markdown/src/utils/table-helpers.d.ts +4 -4
- package/es-custom/components/markdown/src/utils/table-helpers.js +17 -18
- package/es-custom/components/markdown/src/utils/table-helpers.js.map +1 -1
- package/es-custom/components/processing/index.d.ts +1 -1
- package/es-custom/components/processing/src/processing.d.ts +2 -2
- package/es-custom/components/processing/src/processing.js +2 -2
- package/es-custom/components/prompt-line/autocomplete/index.d.ts +12 -0
- package/es-custom/components/prompt-line/autocomplete/index.js +9 -0
- package/es-custom/components/{autocomplete → prompt-line/autocomplete}/index.js.map +1 -1
- package/es-custom/components/prompt-line/autocomplete/src/autocomplete.d.ts +175 -0
- package/es-custom/components/prompt-line/autocomplete/src/autocomplete.js +494 -0
- package/es-custom/components/prompt-line/autocomplete/src/autocomplete.js.map +1 -0
- package/es-custom/components/{autocomplete → prompt-line/autocomplete}/src/autocomplete.scss.js +1 -1
- package/es-custom/components/prompt-line/index.d.ts +18 -18
- package/es-custom/components/prompt-line/src/autocomplete-controller.d.ts +28 -10
- package/es-custom/components/prompt-line/src/autocomplete-controller.js +162 -52
- package/es-custom/components/prompt-line/src/autocomplete-controller.js.map +1 -1
- package/es-custom/components/prompt-line/src/error-message.d.ts +3 -7
- package/es-custom/components/prompt-line/src/error-message.js +13 -23
- package/es-custom/components/prompt-line/src/error-message.js.map +1 -1
- package/es-custom/components/prompt-line/src/error-message.scss.js +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-constants.js +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-controller.d.ts +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-controller.js +83 -83
- package/es-custom/components/prompt-line/src/prompt-line-rich-loader.d.ts +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-rich-loader.js +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-rich-runtime.d.ts +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-rich-runtime.js +30 -28
- package/es-custom/components/prompt-line/src/prompt-line-rich-runtime.js.map +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-shell.d.ts +2 -2
- package/es-custom/components/prompt-line/src/prompt-line-shell.js +11 -13
- package/es-custom/components/prompt-line/src/prompt-line-shell.js.map +1 -1
- package/es-custom/components/prompt-line/src/prompt-line-shell.scss.js +1 -1
- package/es-custom/components/prompt-line/src/prompt-line.d.ts +5 -5
- package/es-custom/components/prompt-line/src/prompt-line.js +35 -35
- package/es-custom/components/prompt-line/src/prompt-line.js.map +1 -1
- package/es-custom/components/prompt-line/src/send-control.d.ts +4 -4
- package/es-custom/components/prompt-line/src/send-control.js +18 -20
- package/es-custom/components/prompt-line/src/send-control.js.map +1 -1
- package/es-custom/components/prompt-line/src/send-control.scss.js +1 -1
- package/es-custom/components/prompt-line/src/stop-streaming-button.d.ts +3 -3
- package/es-custom/components/prompt-line/src/stop-streaming-button.js +7 -8
- package/es-custom/components/prompt-line/src/stop-streaming-button.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/build-extensions.d.ts +3 -3
- package/es-custom/components/prompt-line/src/tiptap/build-extensions.js +2 -2
- package/es-custom/components/prompt-line/src/tiptap/build-extensions.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/carbon-autocomplete.d.ts +2 -2
- package/es-custom/components/prompt-line/src/tiptap/carbon-autocomplete.js +7 -7
- package/es-custom/components/prompt-line/src/tiptap/carbon-mention.d.ts +2 -2
- package/es-custom/components/prompt-line/src/tiptap/carbon-mention.js +9 -9
- package/es-custom/components/prompt-line/src/tiptap/carbon-starter-trigger.d.ts +4 -3
- package/es-custom/components/prompt-line/src/tiptap/carbon-starter-trigger.js +24 -12
- package/es-custom/components/prompt-line/src/tiptap/carbon-starter-trigger.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/chat-enter.d.ts +1 -1
- package/es-custom/components/prompt-line/src/tiptap/chat-enter.js +2 -2
- package/es-custom/components/prompt-line/src/tiptap/editor-styles.js +26 -26
- package/es-custom/components/prompt-line/src/tiptap/index.d.ts +24 -24
- package/es-custom/components/prompt-line/src/tiptap/index.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/json-utils.d.ts +1 -1
- package/es-custom/components/prompt-line/src/tiptap/json-utils.js +17 -17
- package/es-custom/components/prompt-line/src/tiptap/keymap.d.ts +1 -1
- package/es-custom/components/prompt-line/src/tiptap/keymap.js +3 -3
- package/es-custom/components/prompt-line/src/tiptap/origin-meta.d.ts +1 -1
- package/es-custom/components/prompt-line/src/tiptap/origin-meta.js +2 -2
- package/es-custom/components/prompt-line/src/tiptap/plain-text-paste.d.ts +1 -1
- package/es-custom/components/prompt-line/src/tiptap/plain-text-paste.js +5 -5
- package/es-custom/components/prompt-line/src/tiptap/render-in-light-dom.d.ts +3 -3
- package/es-custom/components/prompt-line/src/tiptap/render-in-light-dom.js +3 -3
- package/es-custom/components/prompt-line/src/tiptap/render-token-chip.d.ts +4 -4
- package/es-custom/components/prompt-line/src/tiptap/render-token-chip.js +22 -22
- package/es-custom/components/prompt-line/src/tiptap/token-node-view.d.ts +4 -4
- package/es-custom/components/prompt-line/src/tiptap/token-node-view.js +1 -1
- package/es-custom/components/prompt-line/src/tiptap/trigger-utils.d.ts +9 -2
- package/es-custom/components/prompt-line/src/tiptap/trigger-utils.js +11 -2
- package/es-custom/components/prompt-line/src/tiptap/trigger-utils.js.map +1 -1
- package/es-custom/components/prompt-line/src/tiptap/types.d.ts +46 -6
- package/es-custom/components/prompt-line/src/tiptap/typing-indicator.d.ts +1 -1
- package/es-custom/components/prompt-line/src/tiptap/typing-indicator.js +2 -2
- package/es-custom/components/prompt-line/src/tiptap/value-sync.d.ts +1 -1
- package/es-custom/components/prompt-line/src/tiptap/value-sync.js +2 -2
- package/es-custom/components/prompt-line/src/types.d.ts +2 -2
- package/es-custom/components/prompt-line/src/types.js.map +1 -1
- package/es-custom/components/reasoning-steps/index.d.ts +4 -4
- package/es-custom/components/reasoning-steps/src/reasoning-step.d.ts +2 -2
- package/es-custom/components/reasoning-steps/src/reasoning-step.js +27 -31
- package/es-custom/components/reasoning-steps/src/reasoning-step.js.map +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.d.ts +2 -2
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js +12 -14
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js.map +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps.d.ts +2 -2
- package/es-custom/components/reasoning-steps/src/reasoning-steps.js +19 -20
- package/es-custom/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
- package/es-custom/components/shared/dynamic-css-var-sheet.js +7 -7
- package/es-custom/components/shared/media-utils/script-loader.js +1 -1
- package/es-custom/components/table/index.d.ts +3 -3
- package/es-custom/components/table/src/table-loader.d.ts +1 -1
- package/es-custom/components/table/src/table-loader.js +1 -1
- package/es-custom/components/table/src/table-pagination.template.d.ts +3 -3
- package/es-custom/components/table/src/table-pagination.template.js +4 -5
- package/es-custom/components/table/src/table-pagination.template.js.map +1 -1
- package/es-custom/components/table/src/table-runtime.d.ts +2 -2
- package/es-custom/components/table/src/table-skeleton.template.d.ts +1 -1
- package/es-custom/components/table/src/table-skeleton.template.js +2 -3
- package/es-custom/components/table/src/table-skeleton.template.js.map +1 -1
- package/es-custom/components/table/src/table.d.ts +3 -4
- package/es-custom/components/table/src/table.js +36 -39
- package/es-custom/components/table/src/table.js.map +1 -1
- package/es-custom/components/table/src/table.template.d.ts +5 -5
- package/es-custom/components/table/src/table.template.js +6 -9
- package/es-custom/components/table/src/table.template.js.map +1 -1
- package/es-custom/components/toolbar/index.d.ts +1 -1
- package/es-custom/components/toolbar/src/toolbar.d.ts +9 -7
- package/es-custom/components/toolbar/src/toolbar.js +52 -36
- package/es-custom/components/toolbar/src/toolbar.js.map +1 -1
- package/es-custom/components/toolbar/src/toolbar.scss.js +1 -1
- package/es-custom/components/truncated-text/index.d.ts +1 -1
- package/es-custom/components/truncated-text/src/truncated-text.d.ts +5 -5
- package/es-custom/components/truncated-text/src/truncated-text.js +26 -28
- package/es-custom/components/truncated-text/src/truncated-text.js.map +1 -1
- package/es-custom/components/truncated-text/src/truncated-text.scss.js +1 -1
- package/es-custom/components/video-player/index.d.ts +2 -2
- package/es-custom/components/video-player/src/providers/base-provider.d.ts +3 -3
- package/es-custom/components/video-player/src/providers/base-provider.js +5 -5
- package/es-custom/components/video-player/src/providers/kaltura-provider.d.ts +2 -2
- package/es-custom/components/video-player/src/providers/kaltura-provider.js +23 -23
- package/es-custom/components/video-player/src/providers/native-video-provider.d.ts +2 -2
- package/es-custom/components/video-player/src/providers/native-video-provider.js +20 -20
- package/es-custom/components/video-player/src/providers/vimeo-provider.d.ts +2 -2
- package/es-custom/components/video-player/src/providers/vimeo-provider.js +23 -23
- package/es-custom/components/video-player/src/providers/youtube-provider.d.ts +2 -2
- package/es-custom/components/video-player/src/providers/youtube-provider.js +15 -15
- package/es-custom/components/video-player/src/utils/url-detector.js +1 -1
- package/es-custom/components/video-player/src/video-player.d.ts +2 -2
- package/es-custom/components/video-player/src/video-player.js +37 -41
- package/es-custom/components/video-player/src/video-player.js.map +1 -1
- package/es-custom/components/workspace-shell/index.d.ts +4 -4
- package/es-custom/components/workspace-shell/src/header-collapsible-manager.js +13 -13
- package/es-custom/components/workspace-shell/src/workspace-shell-body.d.ts +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-body.js +2 -2
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.d.ts +4 -4
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.js +10 -11
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.js.map +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-header.d.ts +2 -2
- package/es-custom/components/workspace-shell/src/workspace-shell-header.js +10 -13
- package/es-custom/components/workspace-shell/src/workspace-shell-header.js.map +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell.d.ts +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell.js +3 -3
- package/es-custom/globals/decorators/carbon-element.d.ts +4 -4
- package/es-custom/globals/decorators/carbon-element.js +2 -2
- package/es-custom/globals/decorators/index.d.ts +1 -1
- package/es-custom/globals/scss/common.scss.js +1 -1
- package/es-custom/globals/settings.js +2 -2
- package/es-custom/globals/utils/aria-announcer-manager.d.ts +1 -1
- package/es-custom/globals/utils/aria-announcer-manager.js +6 -6
- package/es-custom/globals/utils/browser-utils.js +1 -1
- package/es-custom/globals/utils/csv.d.ts +8 -0
- package/es-custom/globals/utils/csv.js +37 -0
- package/es-custom/globals/utils/csv.js.map +1 -0
- package/es-custom/globals/utils/dom-utils.js +1 -1
- package/es-custom/globals/utils/focus-utils.js +4 -4
- package/es-custom/globals/utils/iconTransform.d.ts +2 -2
- package/es-custom/globals/utils/iconTransform.js +21 -21
- package/es-custom/globals/utils/rtl-utils.js +1 -1
- package/es-custom/globals/utils/uuid.js +5 -5
- package/es-custom/react/__tests__/jest.setup.js +12 -12
- package/es-custom/react/ai-label-action-button.d.ts +1 -1
- package/es-custom/react/ai-label-action-button.js +1 -1
- package/es-custom/react/audio-player.d.ts +1 -1
- package/es-custom/react/audio-player.js +5 -5
- package/es-custom/react/autocomplete.d.ts +1 -1
- package/es-custom/react/autocomplete.js +5 -5
- package/es-custom/react/card.d.ts +1 -1
- package/es-custom/react/card.js +5 -5
- package/es-custom/react/carousel.d.ts +1 -1
- package/es-custom/react/carousel.js +2 -2
- package/es-custom/react/chain-of-thought-step.d.ts +1 -1
- package/es-custom/react/chain-of-thought-step.js +4 -4
- package/es-custom/react/chain-of-thought-toggle.d.ts +2 -2
- package/es-custom/react/chain-of-thought-toggle.js +3 -3
- package/es-custom/react/chain-of-thought.d.ts +2 -2
- package/es-custom/react/chain-of-thought.js +4 -4
- package/es-custom/react/chat-button.d.ts +3 -3
- package/es-custom/react/chat-button.js +2 -2
- package/es-custom/react/chat-header.d.ts +3 -3
- package/es-custom/react/chat-header.js +2 -2
- package/es-custom/react/chat-shell.d.ts +2 -2
- package/es-custom/react/chat-shell.js +2 -2
- package/es-custom/react/code-snippet.d.ts +4 -4
- package/es-custom/react/code-snippet.js +3 -3
- package/es-custom/react/error-message.d.ts +1 -1
- package/es-custom/react/error-message.js +1 -1
- package/es-custom/react/feedback-buttons.d.ts +1 -1
- package/es-custom/react/feedback-buttons.js +3 -3
- package/es-custom/react/feedback.d.ts +2 -2
- package/es-custom/react/feedback.js +4 -4
- package/es-custom/react/file-upload-item.d.ts +11 -0
- package/es-custom/react/file-upload-item.js +31 -0
- package/es-custom/react/file-upload-item.js.map +1 -0
- package/es-custom/react/file-uploads.d.ts +1 -1
- package/es-custom/react/file-uploads.js +2 -2
- package/es-custom/react/history/history-content.d.ts +1 -1
- package/es-custom/react/history/history-content.js +1 -1
- package/es-custom/react/history/history-delete-panel.d.ts +1 -1
- package/es-custom/react/history/history-delete-panel.js +3 -3
- package/es-custom/react/history/history-header.d.ts +1 -1
- package/es-custom/react/history/history-header.js +2 -2
- package/es-custom/react/history/history-loading.d.ts +1 -1
- package/es-custom/react/history/history-loading.js +1 -1
- package/es-custom/react/history/history-panel-item-input.d.ts +1 -1
- package/es-custom/react/history/history-panel-item-input.js +4 -4
- package/es-custom/react/history/history-panel-item.d.ts +1 -1
- package/es-custom/react/history/history-panel-item.js +6 -6
- package/es-custom/react/history/history-panel-items.d.ts +1 -1
- package/es-custom/react/history/history-panel-items.js +1 -1
- package/es-custom/react/history/history-panel-menu.d.ts +1 -1
- package/es-custom/react/history/history-panel-menu.js +1 -1
- package/es-custom/react/history/history-panel.d.ts +1 -1
- package/es-custom/react/history/history-panel.js +1 -1
- package/es-custom/react/history/history-search-item.d.ts +1 -1
- package/es-custom/react/history/history-search-item.js +2 -2
- package/es-custom/react/history/history-shell.d.ts +1 -1
- package/es-custom/react/history/history-shell.js +1 -1
- package/es-custom/react/history/history-toolbar.d.ts +1 -1
- package/es-custom/react/history/history-toolbar.js +3 -3
- package/es-custom/react/history/index.d.ts +12 -12
- package/es-custom/react/hooks/useChatAutocomplete.d.ts +9 -4
- package/es-custom/react/hooks/useChatAutocomplete.js +50 -19
- package/es-custom/react/hooks/useChatAutocomplete.js.map +1 -1
- package/es-custom/react/input-send-control.d.ts +1 -1
- package/es-custom/react/input-send-control.js +3 -3
- package/es-custom/react/launcher.d.ts +11 -0
- package/es-custom/react/launcher.js +31 -0
- package/es-custom/react/launcher.js.map +1 -0
- package/es-custom/react/markdown.d.ts +7 -7
- package/es-custom/react/markdown.js +13 -13
- package/es-custom/react/markdown.js.map +1 -1
- package/es-custom/react/panel.d.ts +1 -1
- package/es-custom/react/panel.js +7 -7
- package/es-custom/react/processing.d.ts +1 -1
- package/es-custom/react/processing.js +2 -2
- package/es-custom/react/prompt-line-shell.d.ts +1 -1
- package/es-custom/react/prompt-line-shell.js +1 -1
- package/es-custom/react/prompt-line.d.ts +1 -1
- package/es-custom/react/prompt-line.js +9 -9
- package/es-custom/react/reasoning-step.d.ts +1 -1
- package/es-custom/react/reasoning-step.js +4 -4
- package/es-custom/react/reasoning-steps-toggle.d.ts +2 -2
- package/es-custom/react/reasoning-steps-toggle.js +3 -3
- package/es-custom/react/reasoning-steps.d.ts +1 -1
- package/es-custom/react/reasoning-steps.js +2 -2
- package/es-custom/react/stop-streaming-button.d.ts +1 -1
- package/es-custom/react/stop-streaming-button.js +1 -1
- package/es-custom/react/table.d.ts +2 -2
- package/es-custom/react/table.js +1 -1
- package/es-custom/react/tool-call-data.d.ts +1 -1
- package/es-custom/react/tool-call-data.js +2 -2
- package/es-custom/react/toolbar.d.ts +4 -4
- package/es-custom/react/toolbar.js +2 -2
- package/es-custom/react/transcript.d.ts +1 -1
- package/es-custom/react/transcript.js +3 -3
- package/es-custom/react/utils/transformSuggestionConfig.d.ts +3 -3
- package/es-custom/react/utils/transformSuggestionConfig.js +3 -3
- package/es-custom/react/utils/transformSuggestionConfig.js.map +1 -1
- package/es-custom/react/utils/withWebComponentBridge.d.ts +1 -1
- package/es-custom/react/utils/withWebComponentBridge.js +22 -22
- package/es-custom/react/video-player.d.ts +1 -1
- package/es-custom/react/video-player.js +5 -5
- package/es-custom/react/workspace-shell.d.ts +1 -1
- package/es-custom/react/workspace-shell.js +6 -6
- package/es-custom/testing/load-all-lazy-deps.d.ts +2 -2
- package/es-custom/testing/load-all-lazy-deps.js +1 -1
- package/es-custom/typings/overflow-menu.d.ts +2 -2
- package/package.json +4 -5
- package/scss/_custom-properties.scss +15 -15
- package/scss/_modifiers.scss +8 -8
- package/scss/_tokens-component.scss +1 -1
- package/scss/_tokens-layout.scss +1 -1
- package/scss/_utilities.scss +2 -2
- package/scss/common.scss +3 -3
- package/scss/grid.scss +2 -2
- package/scss/themes.scss +7 -7
- package/scss/vars.scss +3 -3
- package/telemetry.yml +64 -5
- package/es/components/autocomplete/index.d.ts +0 -15
- package/es/components/autocomplete/index.js +0 -11
- package/es/components/autocomplete/src/autocomplete-item-group.d.ts +0 -44
- package/es/components/autocomplete/src/autocomplete-item-group.js +0 -139
- package/es/components/autocomplete/src/autocomplete-item-group.js.map +0 -1
- package/es/components/autocomplete/src/autocomplete-item-group.scss.js +0 -13
- package/es/components/autocomplete/src/autocomplete-item-group.scss.js.map +0 -1
- package/es/components/autocomplete/src/autocomplete-item.d.ts +0 -54
- package/es/components/autocomplete/src/autocomplete-item.js +0 -197
- package/es/components/autocomplete/src/autocomplete-item.js.map +0 -1
- package/es/components/autocomplete/src/autocomplete-item.scss.js +0 -13
- package/es/components/autocomplete/src/autocomplete-item.scss.js.map +0 -1
- package/es/components/autocomplete/src/autocomplete.d.ts +0 -97
- package/es/components/autocomplete/src/autocomplete.js +0 -321
- package/es/components/autocomplete/src/autocomplete.js.map +0 -1
- package/es-custom/components/autocomplete/index.d.ts +0 -15
- package/es-custom/components/autocomplete/index.js +0 -11
- package/es-custom/components/autocomplete/src/autocomplete-item-group.d.ts +0 -44
- package/es-custom/components/autocomplete/src/autocomplete-item-group.js +0 -139
- package/es-custom/components/autocomplete/src/autocomplete-item-group.js.map +0 -1
- package/es-custom/components/autocomplete/src/autocomplete-item-group.scss.js +0 -13
- package/es-custom/components/autocomplete/src/autocomplete-item-group.scss.js.map +0 -1
- package/es-custom/components/autocomplete/src/autocomplete-item.d.ts +0 -54
- package/es-custom/components/autocomplete/src/autocomplete-item.js +0 -197
- package/es-custom/components/autocomplete/src/autocomplete-item.js.map +0 -1
- package/es-custom/components/autocomplete/src/autocomplete-item.scss.js +0 -13
- package/es-custom/components/autocomplete/src/autocomplete-item.scss.js.map +0 -1
- package/es-custom/components/autocomplete/src/autocomplete.d.ts +0 -97
- package/es-custom/components/autocomplete/src/autocomplete.js +0 -321
- package/es-custom/components/autocomplete/src/autocomplete.js.map +0 -1
- /package/es/components/{autocomplete → prompt-line/autocomplete}/src/autocomplete.scss.js.map +0 -0
- /package/es-custom/components/{autocomplete → prompt-line/autocomplete}/src/autocomplete.scss.js.map +0 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Copyright IBM Corp. 2026
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
import { LitElement } from 'lit';
|
|
10
|
+
import type { SuggestionItem, SuggestionItemGroup } from '../../src/tiptap/types.js';
|
|
11
|
+
export type { SuggestionItem, SuggestionItemGroup, } from '../../src/tiptap/types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Configuration for the autocomplete header
|
|
14
|
+
*/
|
|
15
|
+
export interface HeaderConfig {
|
|
16
|
+
/** Whether to show the header */
|
|
17
|
+
showHeader: boolean;
|
|
18
|
+
/** Title text to display in the header */
|
|
19
|
+
title: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Localized / consumer-supplied strings for the autocomplete component.
|
|
23
|
+
* All fields are required so callers explicitly provide every user-visible string.
|
|
24
|
+
*/
|
|
25
|
+
export interface AutocompleteI18n {
|
|
26
|
+
/** Announced when the suggestions list is empty. */
|
|
27
|
+
noSuggestions: string;
|
|
28
|
+
/**
|
|
29
|
+
* Announced when the suggestions list first opens.
|
|
30
|
+
* Receives the item count so the caller can form the full phrase.
|
|
31
|
+
*
|
|
32
|
+
* @example (count) => `${count} suggestion${count === 1 ? "" : "s"}. Use up and down arrows to move, Enter to pick, Escape to close.`
|
|
33
|
+
*/
|
|
34
|
+
suggestionsAvailable: (count: number) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Announced when the user moves focus to an item via arrow keys.
|
|
37
|
+
* Receives the item label, optional description, and position info.
|
|
38
|
+
*
|
|
39
|
+
* @example (label, description, position) => `${label}${description ? `, ${description}` : ""}, ${position}`
|
|
40
|
+
*/
|
|
41
|
+
itemNavigation: (label: string, description: string | undefined, position: string) => string;
|
|
42
|
+
/**
|
|
43
|
+
* Announced when an item is selected/inserted.
|
|
44
|
+
* Receives the item label.
|
|
45
|
+
*
|
|
46
|
+
* @example (label) => `${label} inserted.`
|
|
47
|
+
*/
|
|
48
|
+
itemInserted: (label: string) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Announced when an item is sent to the chat.
|
|
51
|
+
* Receives the item label.
|
|
52
|
+
*
|
|
53
|
+
* @example (label) => `${label} sent.`
|
|
54
|
+
*/
|
|
55
|
+
itemSent: (label: string) => string;
|
|
56
|
+
/** Announced when the suggestions list is closed/dismissed. */
|
|
57
|
+
suggestionsClosed: string;
|
|
58
|
+
/** Accessible label for the listbox element. */
|
|
59
|
+
listboxLabel: string;
|
|
60
|
+
}
|
|
61
|
+
/** Default English strings — used as the fallback value for `i18n`. */
|
|
62
|
+
export declare const defaultAutocompleteI18n: AutocompleteI18n;
|
|
63
|
+
/**
|
|
64
|
+
* Custom event detail for autocomplete select events
|
|
65
|
+
*/
|
|
66
|
+
export interface AutocompleteSelectEventDetail {
|
|
67
|
+
item: SuggestionItem;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Custom event detail for autocomplete send events
|
|
71
|
+
*/
|
|
72
|
+
export interface AutocompleteSendEventDetail {
|
|
73
|
+
text: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Autocomplete component for AI Chat input suggestions.
|
|
77
|
+
*
|
|
78
|
+
* @element cds-custom-aichat-autocomplete
|
|
79
|
+
* @fires {CustomEvent<AutocompleteSelectEventDetail>} cds-custom-aichat-autocomplete-select - Fired when an item is clicked/activated and `disableDirectSend` is true (insert-into-editor path)
|
|
80
|
+
* @fires {CustomEvent<AutocompleteSendEventDetail>} cds-custom-aichat-autocomplete-send - Fired when an item is clicked/activated and `disableDirectSend` is false (default: sends directly to chat)
|
|
81
|
+
* @fires {CustomEvent} cds-custom-aichat-autocomplete-dismiss - Fired when the autocomplete is dismissed
|
|
82
|
+
*/
|
|
83
|
+
declare class AutocompleteElement extends LitElement {
|
|
84
|
+
static styles: import("lit").CSSResult;
|
|
85
|
+
/**
|
|
86
|
+
* Array of suggestion items to display
|
|
87
|
+
*/
|
|
88
|
+
items: SuggestionItem[];
|
|
89
|
+
/**
|
|
90
|
+
* Array of grouped suggestion items to display. These will be displayed after any provided `items`.
|
|
91
|
+
*/
|
|
92
|
+
groups: SuggestionItemGroup[];
|
|
93
|
+
/**
|
|
94
|
+
* Optional header configuration
|
|
95
|
+
*/
|
|
96
|
+
headerConfig?: HeaderConfig;
|
|
97
|
+
/**
|
|
98
|
+
* Localized strings for announcements and labels.
|
|
99
|
+
* Defaults to English via `defaultAutocompleteI18n`.
|
|
100
|
+
*/
|
|
101
|
+
i18n: AutocompleteI18n;
|
|
102
|
+
/**
|
|
103
|
+
* The current text in the input (used to apply styling to indicate what user has already typed)
|
|
104
|
+
*/
|
|
105
|
+
inputText: string;
|
|
106
|
+
/**
|
|
107
|
+
* When `false` (default), clicking an item fires `cds-custom-aichat-autocomplete-send` and
|
|
108
|
+
* the item sends directly to chat.
|
|
109
|
+
*
|
|
110
|
+
* When `true`, clicking an item fires `cds-custom-aichat-autocomplete-select` instead
|
|
111
|
+
* and inserts it into the editor rather than send immediately.
|
|
112
|
+
*/
|
|
113
|
+
disableDirectSend: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Whether the autocomplete is attached to another element (e.g., an input field).
|
|
116
|
+
* When true, the bottom corners will not be rounded.
|
|
117
|
+
*/
|
|
118
|
+
attached: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Optional element that "owns" this list (e.g. the editor). Clicks on the
|
|
121
|
+
* anchor element are treated as inside-clicks and do not dismiss the list.
|
|
122
|
+
*/
|
|
123
|
+
anchorElement: Element | null;
|
|
124
|
+
private _announcer;
|
|
125
|
+
private _listboxEl;
|
|
126
|
+
/**
|
|
127
|
+
* Pending arrow-move announcement timer. Held-key rapid fires are collapsed:
|
|
128
|
+
* only the last pending label is spoken.
|
|
129
|
+
*/
|
|
130
|
+
private _moveAnnouncePending;
|
|
131
|
+
/** Whether the open announcement has already fired for this show. */
|
|
132
|
+
private _openAnnounced;
|
|
133
|
+
connectedCallback(): void;
|
|
134
|
+
disconnectedCallback(): void;
|
|
135
|
+
firstUpdated(): void;
|
|
136
|
+
updated(changedProperties: Map<string, any>): void;
|
|
137
|
+
/**
|
|
138
|
+
* Get the total count of all items (flat items + items in groups)
|
|
139
|
+
*/
|
|
140
|
+
private _getTotalItemCount;
|
|
141
|
+
/**
|
|
142
|
+
* Get the item at a specific index (accounting for both flat items and groups)
|
|
143
|
+
*/
|
|
144
|
+
private _getItemAtIndex;
|
|
145
|
+
private _handleKeydown;
|
|
146
|
+
/**
|
|
147
|
+
* Schedule a move announcement, replacing any pending one so rapid arrow
|
|
148
|
+
* holds only speak the final position.
|
|
149
|
+
*/
|
|
150
|
+
private _scheduleMoveAnnouncement;
|
|
151
|
+
private _handleSend;
|
|
152
|
+
private _handleMousedown;
|
|
153
|
+
private _handleClickOutside;
|
|
154
|
+
private _scrollActiveItemIntoView;
|
|
155
|
+
private _selectItem;
|
|
156
|
+
private _dismiss;
|
|
157
|
+
private _handleItemClick;
|
|
158
|
+
private _getActiveOptionId;
|
|
159
|
+
private _getLabelParts;
|
|
160
|
+
/**
|
|
161
|
+
* Render the avatar if provided
|
|
162
|
+
*/
|
|
163
|
+
private _renderAvatar;
|
|
164
|
+
/**
|
|
165
|
+
* Render a single `<li role="option">` for both flat and grouped contexts.
|
|
166
|
+
*/
|
|
167
|
+
private _renderItem;
|
|
168
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
169
|
+
}
|
|
170
|
+
declare global {
|
|
171
|
+
interface HTMLElementTagNameMap {
|
|
172
|
+
'cds-custom-aichat-autocomplete': AutocompleteElement;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
export default AutocompleteElement;
|
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { __decorate } from 'tslib';
|
|
9
|
+
import { unsafeCSS, css, LitElement, html } from 'lit';
|
|
10
|
+
import { property, state } from 'lit/decorators.js';
|
|
11
|
+
import { carbonElement } from '../../../../globals/decorators/carbon-element.js';
|
|
12
|
+
import prefix from '../../../../globals/settings.js';
|
|
13
|
+
import { AriaAnnouncerManager } from '../../../../globals/utils/aria-announcer-manager.js';
|
|
14
|
+
import styles from './autocomplete.scss.js';
|
|
15
|
+
import { iconLoader } from '@carbon/web-components/es-custom/globals/internal/icon-loader.js';
|
|
16
|
+
import SendFilled16 from '@carbon/icons/es/send--filled/16.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @license
|
|
20
|
+
*
|
|
21
|
+
* Copyright IBM Corp. 2026
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/
|
|
26
|
+
const blockClass = `${prefix}-autocomplete`;
|
|
27
|
+
const itemClass = `${blockClass}-item`;
|
|
28
|
+
const groupClass = `${itemClass}-group`;
|
|
29
|
+
/** Default English strings — used as the fallback value for `i18n`. */
|
|
30
|
+
const defaultAutocompleteI18n = {
|
|
31
|
+
noSuggestions: 'No suggestions.',
|
|
32
|
+
suggestionsAvailable: (count) => `${count} suggestion${count === 1 ? '' : 's'}. Use up and down arrows to move, Enter to pick, Escape to close.`,
|
|
33
|
+
itemNavigation: (label, description, position) => `${label}${description ? `, ${description}` : ''}, ${position}`,
|
|
34
|
+
itemInserted: (label) => `${label} inserted.`,
|
|
35
|
+
itemSent: (label) => `${label} sent.`,
|
|
36
|
+
suggestionsClosed: 'Suggestions closed.',
|
|
37
|
+
listboxLabel: 'Autocomplete options',
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Autocomplete component for AI Chat input suggestions.
|
|
41
|
+
*
|
|
42
|
+
* @element cds-custom-aichat-autocomplete
|
|
43
|
+
* @fires {CustomEvent<AutocompleteSelectEventDetail>} cds-custom-aichat-autocomplete-select - Fired when an item is clicked/activated and `disableDirectSend` is true (insert-into-editor path)
|
|
44
|
+
* @fires {CustomEvent<AutocompleteSendEventDetail>} cds-custom-aichat-autocomplete-send - Fired when an item is clicked/activated and `disableDirectSend` is false (default: sends directly to chat)
|
|
45
|
+
* @fires {CustomEvent} cds-custom-aichat-autocomplete-dismiss - Fired when the autocomplete is dismissed
|
|
46
|
+
*/
|
|
47
|
+
let AutocompleteElement = class AutocompleteElement extends LitElement {
|
|
48
|
+
constructor() {
|
|
49
|
+
super(...arguments);
|
|
50
|
+
/**
|
|
51
|
+
* Array of suggestion items to display
|
|
52
|
+
*/
|
|
53
|
+
this.items = [];
|
|
54
|
+
/**
|
|
55
|
+
* Array of grouped suggestion items to display. These will be displayed after any provided `items`.
|
|
56
|
+
*/
|
|
57
|
+
this.groups = [];
|
|
58
|
+
/**
|
|
59
|
+
* Localized strings for announcements and labels.
|
|
60
|
+
* Defaults to English via `defaultAutocompleteI18n`.
|
|
61
|
+
*/
|
|
62
|
+
this.i18n = defaultAutocompleteI18n;
|
|
63
|
+
/**
|
|
64
|
+
* The current text in the input (used to apply styling to indicate what user has already typed)
|
|
65
|
+
*/
|
|
66
|
+
this.inputText = '';
|
|
67
|
+
/**
|
|
68
|
+
* When `false` (default), clicking an item fires `cds-custom-aichat-autocomplete-send` and
|
|
69
|
+
* the item sends directly to chat.
|
|
70
|
+
*
|
|
71
|
+
* When `true`, clicking an item fires `cds-custom-aichat-autocomplete-select` instead
|
|
72
|
+
* and inserts it into the editor rather than send immediately.
|
|
73
|
+
*/
|
|
74
|
+
this.disableDirectSend = false;
|
|
75
|
+
/**
|
|
76
|
+
* Whether the autocomplete is attached to another element (e.g., an input field).
|
|
77
|
+
* When true, the bottom corners will not be rounded.
|
|
78
|
+
*/
|
|
79
|
+
this.attached = true;
|
|
80
|
+
/**
|
|
81
|
+
* Optional element that "owns" this list (e.g. the editor). Clicks on the
|
|
82
|
+
* anchor element are treated as inside-clicks and do not dismiss the list.
|
|
83
|
+
*/
|
|
84
|
+
this.anchorElement = null;
|
|
85
|
+
/**
|
|
86
|
+
* Currently active item index
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
this._focusedIndex = 0;
|
|
90
|
+
this._announcer = new AriaAnnouncerManager();
|
|
91
|
+
this._listboxEl = null;
|
|
92
|
+
/**
|
|
93
|
+
* Pending arrow-move announcement timer. Held-key rapid fires are collapsed:
|
|
94
|
+
* only the last pending label is spoken.
|
|
95
|
+
*/
|
|
96
|
+
this._moveAnnouncePending = null;
|
|
97
|
+
/** Whether the open announcement has already fired for this show. */
|
|
98
|
+
this._openAnnounced = false;
|
|
99
|
+
this._handleKeydown = (event) => {
|
|
100
|
+
const totalItems = this._getTotalItemCount();
|
|
101
|
+
if (totalItems === 0) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
switch (event.key) {
|
|
105
|
+
case 'ArrowDown':
|
|
106
|
+
event.preventDefault();
|
|
107
|
+
this._focusedIndex = Math.min(this._focusedIndex + 1, totalItems - 1);
|
|
108
|
+
this._scheduleMoveAnnouncement(this._focusedIndex, totalItems);
|
|
109
|
+
this._scrollActiveItemIntoView();
|
|
110
|
+
break;
|
|
111
|
+
case 'ArrowUp':
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
this._focusedIndex = Math.max(this._focusedIndex - 1, 0);
|
|
114
|
+
this._scheduleMoveAnnouncement(this._focusedIndex, totalItems);
|
|
115
|
+
this._scrollActiveItemIntoView();
|
|
116
|
+
break;
|
|
117
|
+
case 'Home':
|
|
118
|
+
event.preventDefault();
|
|
119
|
+
this._focusedIndex = 0;
|
|
120
|
+
this._scheduleMoveAnnouncement(this._focusedIndex, totalItems);
|
|
121
|
+
this._scrollActiveItemIntoView();
|
|
122
|
+
break;
|
|
123
|
+
case 'End':
|
|
124
|
+
event.preventDefault();
|
|
125
|
+
this._focusedIndex = totalItems - 1;
|
|
126
|
+
this._scheduleMoveAnnouncement(this._focusedIndex, totalItems);
|
|
127
|
+
this._scrollActiveItemIntoView();
|
|
128
|
+
break;
|
|
129
|
+
case 'Escape':
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
this._dismiss();
|
|
132
|
+
break;
|
|
133
|
+
case 'Enter':
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
this._handleItemClick(this._focusedIndex);
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
this._handleMousedown = (event) => {
|
|
140
|
+
// Prevent the editor from losing focus when the user clicks one of the list
|
|
141
|
+
// items. Without this, mousedown transfers focus away from the editor,
|
|
142
|
+
// carbonStarterTrigger.onTransaction fires, sees editor.isFocused === false,
|
|
143
|
+
// and dismisses the list before the click event can trigger onSelect.
|
|
144
|
+
event.preventDefault();
|
|
145
|
+
};
|
|
146
|
+
this._handleClickOutside = (event) => {
|
|
147
|
+
// Use composedPath() instead of event.target so clicks originating inside
|
|
148
|
+
// a shadow root are visible.
|
|
149
|
+
const path = event.composedPath();
|
|
150
|
+
const isNode = (t) => t instanceof Node;
|
|
151
|
+
// Check if click is on autocomplete itself
|
|
152
|
+
if (path.filter(isNode).some((n) => this.contains(n))) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
// Check if click is on anchor element
|
|
156
|
+
const { anchorElement } = this;
|
|
157
|
+
if (anchorElement &&
|
|
158
|
+
path.filter(isNode).some((n) => anchorElement.contains(n))) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
this._dismiss();
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
connectedCallback() {
|
|
165
|
+
super.connectedCallback();
|
|
166
|
+
this.addEventListener('keydown', this._handleKeydown);
|
|
167
|
+
document.addEventListener('click', this._handleClickOutside);
|
|
168
|
+
}
|
|
169
|
+
disconnectedCallback() {
|
|
170
|
+
super.disconnectedCallback();
|
|
171
|
+
this.removeEventListener('keydown', this._handleKeydown);
|
|
172
|
+
this._listboxEl?.removeEventListener('mousedown', this._handleMousedown);
|
|
173
|
+
document.removeEventListener('click', this._handleClickOutside);
|
|
174
|
+
this._announcer.disconnect();
|
|
175
|
+
if (this._moveAnnouncePending !== null) {
|
|
176
|
+
clearTimeout(this._moveAnnouncePending);
|
|
177
|
+
this._moveAnnouncePending = null;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
firstUpdated() {
|
|
181
|
+
const regions = this.renderRoot.querySelectorAll(`.${blockClass}__live-region`);
|
|
182
|
+
this._announcer.connect(Array.from(regions));
|
|
183
|
+
this._listboxEl = this.renderRoot.querySelector(`.${blockClass}__items`);
|
|
184
|
+
this._listboxEl?.addEventListener('mousedown', this._handleMousedown);
|
|
185
|
+
}
|
|
186
|
+
updated(changedProperties) {
|
|
187
|
+
super.updated(changedProperties);
|
|
188
|
+
const itemsChanged = changedProperties.has('items') || changedProperties.has('groups');
|
|
189
|
+
if (itemsChanged) {
|
|
190
|
+
const totalItems = this._getTotalItemCount();
|
|
191
|
+
if (totalItems === 0) {
|
|
192
|
+
this._announcer.announce(this.i18n.noSuggestions);
|
|
193
|
+
this._openAnnounced = false;
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
// Reset to first item and announce list opened (once per show).
|
|
197
|
+
this._focusedIndex = 0;
|
|
198
|
+
if (!this._openAnnounced) {
|
|
199
|
+
this._openAnnounced = true;
|
|
200
|
+
this._announcer.announce(this.i18n.suggestionsAvailable(totalItems));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Get the total count of all items (flat items + items in groups)
|
|
206
|
+
*/
|
|
207
|
+
_getTotalItemCount() {
|
|
208
|
+
const flatCount = this.items.length;
|
|
209
|
+
const groupedCount = this.groups.reduce((sum, group) => sum + group.items.length, 0);
|
|
210
|
+
return flatCount + groupedCount;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Get the item at a specific index (accounting for both flat items and groups)
|
|
214
|
+
*/
|
|
215
|
+
_getItemAtIndex(index) {
|
|
216
|
+
if (index < this.items.length) {
|
|
217
|
+
return this.items[index];
|
|
218
|
+
}
|
|
219
|
+
let currentIndex = this.items.length;
|
|
220
|
+
for (const group of this.groups) {
|
|
221
|
+
if (index < currentIndex + group.items.length) {
|
|
222
|
+
return group.items[index - currentIndex];
|
|
223
|
+
}
|
|
224
|
+
currentIndex += group.items.length;
|
|
225
|
+
}
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Schedule a move announcement, replacing any pending one so rapid arrow
|
|
230
|
+
* holds only speak the final position.
|
|
231
|
+
*/
|
|
232
|
+
_scheduleMoveAnnouncement(index, total) {
|
|
233
|
+
if (this._moveAnnouncePending !== null) {
|
|
234
|
+
clearTimeout(this._moveAnnouncePending);
|
|
235
|
+
}
|
|
236
|
+
this._moveAnnouncePending = window.setTimeout(() => {
|
|
237
|
+
this._moveAnnouncePending = null;
|
|
238
|
+
const item = this._getItemAtIndex(index);
|
|
239
|
+
if (!item) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const position = `${index + 1} of ${total}`;
|
|
243
|
+
this._announcer.announce(this.i18n.itemNavigation(item.label, item.description, position));
|
|
244
|
+
}, 50);
|
|
245
|
+
}
|
|
246
|
+
_handleSend(index) {
|
|
247
|
+
const item = this._getItemAtIndex(index);
|
|
248
|
+
if (!item) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
this._focusedIndex = index;
|
|
252
|
+
this._announcer.announce(this.i18n.itemSent(item.label));
|
|
253
|
+
this.dispatchEvent(new CustomEvent('cds-custom-aichat-autocomplete-send', {
|
|
254
|
+
detail: { text: item.value ?? item.label },
|
|
255
|
+
bubbles: true,
|
|
256
|
+
composed: true,
|
|
257
|
+
}));
|
|
258
|
+
}
|
|
259
|
+
_scrollActiveItemIntoView() {
|
|
260
|
+
this.updateComplete.then(() => {
|
|
261
|
+
const itemsContainer = this.shadowRoot?.querySelector(`.${blockClass}__items`);
|
|
262
|
+
const options = Array.from(itemsContainer?.querySelectorAll('li[role="option"]') ?? []);
|
|
263
|
+
options[this._focusedIndex]?.scrollIntoView({
|
|
264
|
+
block: 'nearest',
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
_selectItem(item) {
|
|
269
|
+
this._announcer.announce(this.i18n.itemInserted(item.label));
|
|
270
|
+
this.dispatchEvent(new CustomEvent('cds-custom-aichat-autocomplete-select', {
|
|
271
|
+
detail: { item },
|
|
272
|
+
bubbles: true,
|
|
273
|
+
composed: true,
|
|
274
|
+
}));
|
|
275
|
+
}
|
|
276
|
+
_dismiss() {
|
|
277
|
+
this._openAnnounced = false;
|
|
278
|
+
this._announcer.announce(this.i18n.suggestionsClosed);
|
|
279
|
+
this.dispatchEvent(new CustomEvent('cds-custom-aichat-autocomplete-dismiss', {
|
|
280
|
+
bubbles: true,
|
|
281
|
+
composed: true,
|
|
282
|
+
}));
|
|
283
|
+
}
|
|
284
|
+
_handleItemClick(index) {
|
|
285
|
+
if (!this.disableDirectSend) {
|
|
286
|
+
this._handleSend(index);
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
const item = this._getItemAtIndex(index);
|
|
290
|
+
if (!item) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
this._focusedIndex = index;
|
|
294
|
+
this._selectItem(item);
|
|
295
|
+
}
|
|
296
|
+
_getActiveOptionId() {
|
|
297
|
+
const item = this._getItemAtIndex(this._focusedIndex);
|
|
298
|
+
return item ? `${item.id}--option` : undefined;
|
|
299
|
+
}
|
|
300
|
+
_getLabelParts(item) {
|
|
301
|
+
const label = item.label;
|
|
302
|
+
const input = this.inputText.toLowerCase();
|
|
303
|
+
if (input && label.toLowerCase().startsWith(input)) {
|
|
304
|
+
return {
|
|
305
|
+
typed: label.substring(0, input.length),
|
|
306
|
+
remainder: label.substring(input.length),
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
return { typed: '', remainder: label };
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Render the avatar if provided
|
|
313
|
+
*/
|
|
314
|
+
_renderAvatar(item) {
|
|
315
|
+
const { avatar } = item;
|
|
316
|
+
if (!avatar) {
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
if (typeof avatar === 'string') {
|
|
320
|
+
return html `<div class="${itemClass}__avatar">
|
|
321
|
+
<img src="${avatar}" alt="" />
|
|
322
|
+
</div>`;
|
|
323
|
+
}
|
|
324
|
+
// CarbonIcon descriptor (object, not a function)
|
|
325
|
+
if (typeof avatar !== 'function') {
|
|
326
|
+
return html `<div class="${itemClass}__avatar">
|
|
327
|
+
${iconLoader(avatar)}
|
|
328
|
+
</div>`;
|
|
329
|
+
}
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Render a single `<li role="option">` for both flat and grouped contexts.
|
|
334
|
+
*/
|
|
335
|
+
_renderItem(item, index, opts = {}) {
|
|
336
|
+
const { typed, remainder } = this._getLabelParts(item);
|
|
337
|
+
const isActive = index === this._focusedIndex;
|
|
338
|
+
const id = `${item.id}--option`;
|
|
339
|
+
return html `
|
|
340
|
+
<li
|
|
341
|
+
@click="${() => this._handleItemClick(index)}"
|
|
342
|
+
@keydown="${(e) => {
|
|
343
|
+
if (e.key === 'Enter') {
|
|
344
|
+
e.preventDefault();
|
|
345
|
+
this._handleItemClick(index);
|
|
346
|
+
}
|
|
347
|
+
}}"
|
|
348
|
+
aria-selected="${isActive ? 'true' : 'false'}"
|
|
349
|
+
class="${itemClass} ${isActive ? `${itemClass}--active` : ''}"
|
|
350
|
+
id="${id}"
|
|
351
|
+
role="option"
|
|
352
|
+
tabindex="-1"
|
|
353
|
+
?first-item="${opts.firstItem}"
|
|
354
|
+
?last-item="${opts.lastItem}">
|
|
355
|
+
<div class="${itemClass}__content">
|
|
356
|
+
${this._renderAvatar(item)}
|
|
357
|
+
<div class="${itemClass}__text">
|
|
358
|
+
<div class="${itemClass}__label">
|
|
359
|
+
${typed
|
|
360
|
+
? html `<span class="${itemClass}__label-typed"
|
|
361
|
+
>${typed}</span
|
|
362
|
+
>`
|
|
363
|
+
: ''}${remainder
|
|
364
|
+
? html `<span class="${itemClass}__label-remainder"
|
|
365
|
+
>${remainder}</span
|
|
366
|
+
>`
|
|
367
|
+
: ''}
|
|
368
|
+
</div>
|
|
369
|
+
${item.description
|
|
370
|
+
? html `<div class="${itemClass}__description">
|
|
371
|
+
${item.description}
|
|
372
|
+
</div>`
|
|
373
|
+
: null}
|
|
374
|
+
</div>
|
|
375
|
+
</div>
|
|
376
|
+
${!this.disableDirectSend
|
|
377
|
+
? html `<span aria-hidden="true" class="${itemClass}__send-icon">
|
|
378
|
+
${iconLoader(SendFilled16)}
|
|
379
|
+
</span>`
|
|
380
|
+
: null}
|
|
381
|
+
</li>
|
|
382
|
+
`;
|
|
383
|
+
}
|
|
384
|
+
render() {
|
|
385
|
+
const totalItems = this._getTotalItemCount();
|
|
386
|
+
// Always render the live regions so the last announcement is not lost
|
|
387
|
+
// when the list empties (e.g. "No suggestions." or "Suggestions closed.").
|
|
388
|
+
const liveRegions = html `
|
|
389
|
+
<div
|
|
390
|
+
class="${blockClass}__live-region"
|
|
391
|
+
aria-live="polite"
|
|
392
|
+
aria-atomic="false"></div>
|
|
393
|
+
<div
|
|
394
|
+
class="${blockClass}__live-region"
|
|
395
|
+
aria-live="polite"
|
|
396
|
+
aria-atomic="false"></div>
|
|
397
|
+
`;
|
|
398
|
+
if (totalItems === 0) {
|
|
399
|
+
return liveRegions;
|
|
400
|
+
}
|
|
401
|
+
let currentIndex = 0;
|
|
402
|
+
return html `
|
|
403
|
+
${liveRegions}
|
|
404
|
+
<div class="${blockClass}">
|
|
405
|
+
${this.headerConfig?.showHeader
|
|
406
|
+
? html `
|
|
407
|
+
<div class="${blockClass}__header">
|
|
408
|
+
<span class="${blockClass}__title">
|
|
409
|
+
${this.headerConfig.title}
|
|
410
|
+
</span>
|
|
411
|
+
</div>
|
|
412
|
+
`
|
|
413
|
+
: ''}
|
|
414
|
+
|
|
415
|
+
<ul
|
|
416
|
+
aria-activedescendant="${this._getActiveOptionId()}"
|
|
417
|
+
aria-label="${this.i18n.listboxLabel}"
|
|
418
|
+
class="${blockClass}__items"
|
|
419
|
+
id="${blockClass}-listbox"
|
|
420
|
+
role="listbox">
|
|
421
|
+
<!-- Flat items -->
|
|
422
|
+
${this.items.map((item, index) => {
|
|
423
|
+
const itemIndex = currentIndex++;
|
|
424
|
+
return this._renderItem(item, itemIndex, {
|
|
425
|
+
firstItem: !this.headerConfig?.showHeader && index === 0,
|
|
426
|
+
lastItem: this.groups.length === 0 && index === this.items.length - 1,
|
|
427
|
+
});
|
|
428
|
+
})}
|
|
429
|
+
|
|
430
|
+
<!-- Grouped items -->
|
|
431
|
+
${this.groups.map((group, groupIndex) => {
|
|
432
|
+
const groupStartIndex = currentIndex;
|
|
433
|
+
currentIndex += group.items.length;
|
|
434
|
+
const isLastGroup = groupIndex === this.groups.length - 1;
|
|
435
|
+
return html `
|
|
436
|
+
<li
|
|
437
|
+
role="group"
|
|
438
|
+
aria-label="${group.title}"
|
|
439
|
+
class="${groupClass}">
|
|
440
|
+
${group.title
|
|
441
|
+
? html `<div class="${groupClass}__title">
|
|
442
|
+
${group.title}
|
|
443
|
+
</div>`
|
|
444
|
+
: null}
|
|
445
|
+
<ul class="${groupClass}__items">
|
|
446
|
+
${group.items.map((item, itemIndex) => this._renderItem(item, groupStartIndex + itemIndex, {
|
|
447
|
+
lastItem: isLastGroup && itemIndex === group.items.length - 1,
|
|
448
|
+
}))}
|
|
449
|
+
</ul>
|
|
450
|
+
</li>
|
|
451
|
+
`;
|
|
452
|
+
})}
|
|
453
|
+
</ul>
|
|
454
|
+
</div>
|
|
455
|
+
`;
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
AutocompleteElement.styles = css `
|
|
459
|
+
${unsafeCSS(styles)}
|
|
460
|
+
`;
|
|
461
|
+
__decorate([
|
|
462
|
+
property({ type: Array, attribute: false })
|
|
463
|
+
], AutocompleteElement.prototype, "items", void 0);
|
|
464
|
+
__decorate([
|
|
465
|
+
property({ type: Array, attribute: false })
|
|
466
|
+
], AutocompleteElement.prototype, "groups", void 0);
|
|
467
|
+
__decorate([
|
|
468
|
+
property({ type: Object, attribute: false })
|
|
469
|
+
], AutocompleteElement.prototype, "headerConfig", void 0);
|
|
470
|
+
__decorate([
|
|
471
|
+
property({ type: Object, attribute: false })
|
|
472
|
+
], AutocompleteElement.prototype, "i18n", void 0);
|
|
473
|
+
__decorate([
|
|
474
|
+
property({ type: String, attribute: 'input-text', reflect: true })
|
|
475
|
+
], AutocompleteElement.prototype, "inputText", void 0);
|
|
476
|
+
__decorate([
|
|
477
|
+
property({ type: Boolean, reflect: true, attribute: 'disable-direct-send' })
|
|
478
|
+
], AutocompleteElement.prototype, "disableDirectSend", void 0);
|
|
479
|
+
__decorate([
|
|
480
|
+
property({ type: Boolean, reflect: true })
|
|
481
|
+
], AutocompleteElement.prototype, "attached", void 0);
|
|
482
|
+
__decorate([
|
|
483
|
+
property({ type: Object, attribute: false })
|
|
484
|
+
], AutocompleteElement.prototype, "anchorElement", void 0);
|
|
485
|
+
__decorate([
|
|
486
|
+
state()
|
|
487
|
+
], AutocompleteElement.prototype, "_focusedIndex", void 0);
|
|
488
|
+
AutocompleteElement = __decorate([
|
|
489
|
+
carbonElement(`${prefix}-autocomplete`)
|
|
490
|
+
], AutocompleteElement);
|
|
491
|
+
var AutocompleteElement$1 = AutocompleteElement;
|
|
492
|
+
|
|
493
|
+
export { AutocompleteElement$1 as default, defaultAutocompleteI18n };
|
|
494
|
+
//# sourceMappingURL=autocomplete.js.map
|