@carbon/ai-chat-components 1.7.0 → 1.9.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +16062 -10795
- package/es/components/audio-player/src/audio-player.js +9 -10
- package/es/components/audio-player/src/audio-player.js.map +1 -1
- package/es/components/audio-player/src/providers/base-provider.js +0 -1
- package/es/components/audio-player/src/providers/base-provider.js.map +1 -1
- package/es/components/audio-player/src/providers/native-audio-provider.js +0 -1
- package/es/components/audio-player/src/providers/native-audio-provider.js.map +1 -1
- package/es/components/audio-player/src/providers/soundcloud-provider.js +0 -1
- package/es/components/audio-player/src/providers/soundcloud-provider.js.map +1 -1
- package/es/components/audio-player/src/transcript.js +15 -15
- package/es/components/audio-player/src/transcript.js.map +1 -1
- package/es/components/audio-player/src/utils/url-detector.js +0 -1
- package/es/components/audio-player/src/utils/url-detector.js.map +1 -1
- package/es/components/autocomplete/index.d.ts +15 -0
- package/es/components/autocomplete/index.js +11 -0
- package/es/components/autocomplete/index.js.map +1 -0
- package/es/components/autocomplete/src/autocomplete-item-group.d.ts +44 -0
- package/es/components/autocomplete/src/autocomplete-item-group.js +139 -0
- package/es/components/autocomplete/src/autocomplete-item-group.js.map +1 -0
- package/es/components/autocomplete/src/autocomplete-item-group.scss.js +13 -0
- package/es/components/autocomplete/src/autocomplete-item-group.scss.js.map +1 -0
- package/es/components/autocomplete/src/autocomplete-item.d.ts +54 -0
- package/es/components/autocomplete/src/autocomplete-item.js +197 -0
- package/es/components/autocomplete/src/autocomplete-item.js.map +1 -0
- package/es/components/autocomplete/src/autocomplete-item.scss.js +13 -0
- package/es/components/autocomplete/src/autocomplete-item.scss.js.map +1 -0
- package/es/components/autocomplete/src/autocomplete.d.ts +97 -0
- package/es/components/autocomplete/src/autocomplete.js +321 -0
- package/es/components/autocomplete/src/autocomplete.js.map +1 -0
- package/es/components/autocomplete/src/autocomplete.scss.js +13 -0
- package/es/components/autocomplete/src/autocomplete.scss.js.map +1 -0
- package/es/components/card/src/card-footer.d.ts +1 -1
- package/es/components/card/src/card-footer.js +1 -1
- 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 +1 -1
- package/es/components/card/src/card-steps.js +28 -28
- 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.scss.js +1 -1
- package/es/components/carousel/src/carousel.js +0 -1
- package/es/components/carousel/src/carousel.js.map +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought-step.js +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -1
- package/es/components/chain-of-thought/src/tool-call-data.js +4 -4
- package/es/components/chain-of-thought/src/tool-call-data.js.map +1 -1
- package/es/components/chat-button/src/chat-button.d.ts +1 -1
- package/es/components/chat-button/src/chat-button.js +1 -1
- package/es/components/chat-button/src/chat-button.js.map +1 -1
- package/es/components/chat-button/src/chat-button.scss.js +1 -1
- package/es/components/chat-history/src/chat-history.scss.js +1 -1
- package/es/components/chat-history/src/history-content.js +2 -2
- package/es/components/chat-history/src/history-content.js.map +1 -1
- package/es/components/chat-history/src/history-header.js +8 -8
- package/es/components/chat-history/src/history-header.js.map +1 -1
- package/es/components/chat-history/src/history-panel-item-input.d.ts +19 -2
- package/es/components/chat-history/src/history-panel-item-input.js +69 -19
- 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 +14 -0
- package/es/components/chat-history/src/history-panel-item.js +59 -27
- package/es/components/chat-history/src/history-panel-item.js.map +1 -1
- package/es/components/chat-history/src/history-toolbar.js +3 -3
- package/es/components/chat-history/src/history-toolbar.js.map +1 -1
- package/es/components/chat-shell/src/chat-header.js +15 -16
- 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 +1 -2
- package/es/components/chat-shell/src/corner-manager.js.map +1 -1
- package/es/components/chat-shell/src/initialization-manager.d.ts +1 -1
- package/es/components/chat-shell/src/initialization-manager.js +1 -2
- package/es/components/chat-shell/src/initialization-manager.js.map +1 -1
- package/es/components/chat-shell/src/resize-observer-manager.js +0 -1
- package/es/components/chat-shell/src/resize-observer-manager.js.map +1 -1
- package/es/components/chat-shell/src/shell.d.ts +1 -1
- package/es/components/chat-shell/src/shell.js +3 -3
- 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 +1 -2
- package/es/components/chat-shell/src/slot-observer.js.map +1 -1
- package/es/components/chat-shell/src/types.d.ts +1 -1
- package/es/components/chat-shell/src/workspace-manager-utils.d.ts +1 -1
- package/es/components/chat-shell/src/workspace-manager-utils.js +1 -2
- package/es/components/chat-shell/src/workspace-manager-utils.js.map +1 -1
- package/es/components/chat-shell/src/workspace-manager.d.ts +1 -1
- package/es/components/chat-shell/src/workspace-manager.js +1 -2
- package/es/components/chat-shell/src/workspace-manager.js.map +1 -1
- package/es/components/code-snippet/src/code-snippet.d.ts +23 -0
- package/es/components/code-snippet/src/code-snippet.js +111 -36
- package/es/components/code-snippet/src/code-snippet.js.map +1 -1
- package/es/components/code-snippet/src/code-snippet.scss.js +1 -1
- package/es/components/code-snippet/src/codemirror/diff-decorator.js +1 -1
- package/es/components/code-snippet/src/codemirror/diff-decorator.js.map +1 -1
- package/es/components/code-snippet/src/codemirror/theme.js +5 -0
- package/es/components/code-snippet/src/codemirror/theme.js.map +1 -1
- package/es/components/code-snippet/src/layout-utils.js +21 -8
- package/es/components/code-snippet/src/layout-utils.js.map +1 -1
- package/es/components/feedback/src/feedback-buttons.js +1 -1
- package/es/components/feedback/src/feedback-buttons.js.map +1 -1
- package/es/components/feedback/src/feedback.js +38 -38
- package/es/components/feedback/src/feedback.js.map +1 -1
- package/es/components/feedback/src/feedback.scss.js +1 -1
- package/es/components/file-uploads/index.d.ts +12 -0
- package/es/components/file-uploads/index.js +10 -0
- package/es/components/file-uploads/index.js.map +1 -0
- package/es/components/file-uploads/src/file-upload-item.d.ts +43 -0
- package/es/components/file-uploads/src/file-upload-item.js +267 -0
- package/es/components/file-uploads/src/file-upload-item.js.map +1 -0
- package/es/components/file-uploads/src/file-upload-item.scss.js +13 -0
- package/es/components/file-uploads/src/file-upload-item.scss.js.map +1 -0
- package/es/components/file-uploads/src/file-uploads.d.ts +87 -0
- package/es/components/file-uploads/src/file-uploads.js +213 -0
- package/es/components/file-uploads/src/file-uploads.js.map +1 -0
- package/es/components/file-uploads/src/file-uploads.scss.js +13 -0
- package/es/components/file-uploads/src/file-uploads.scss.js.map +1 -0
- package/es/components/markdown/index.d.ts +1 -0
- package/es/components/markdown/index.js +1 -0
- package/es/components/markdown/index.js.map +1 -1
- package/es/components/markdown/src/markdown-token-tree.d.ts +8 -0
- package/es/components/markdown/src/markdown-token-tree.js +12 -1
- package/es/components/markdown/src/markdown-token-tree.js.map +1 -1
- package/es/components/markdown/src/markdown.js +4 -0
- package/es/components/markdown/src/markdown.js.map +1 -1
- package/es/components/markdown/src/markdown.scss.js +1 -1
- package/es/components/markdown/src/utils/html-helpers.js.map +1 -1
- package/es/components/prompt-line/index.d.ts +26 -0
- package/es/components/prompt-line/index.js +32 -0
- package/es/components/prompt-line/index.js.map +1 -0
- package/es/components/prompt-line/src/autocomplete-controller.d.ts +178 -0
- package/es/components/prompt-line/src/autocomplete-controller.js +548 -0
- package/es/components/prompt-line/src/autocomplete-controller.js.map +1 -0
- package/es/components/prompt-line/src/error-message.d.ts +50 -0
- package/es/components/prompt-line/src/error-message.js +144 -0
- package/es/components/prompt-line/src/error-message.js.map +1 -0
- package/es/components/prompt-line/src/error-message.scss.js +13 -0
- package/es/components/prompt-line/src/error-message.scss.js.map +1 -0
- package/es/components/prompt-line/src/prompt-line-constants.d.ts +17 -0
- package/es/components/prompt-line/src/prompt-line-constants.js +27 -0
- package/es/components/prompt-line/src/prompt-line-constants.js.map +1 -0
- package/es/components/prompt-line/src/prompt-line-controller.d.ts +155 -0
- package/es/components/prompt-line/src/prompt-line-controller.js +394 -0
- package/es/components/prompt-line/src/prompt-line-controller.js.map +1 -0
- package/es/components/prompt-line/src/prompt-line-rich-loader.d.ts +34 -0
- package/es/components/prompt-line/src/prompt-line-rich-loader.js +51 -0
- package/es/components/prompt-line/src/prompt-line-rich-loader.js.map +1 -0
- package/es/components/prompt-line/src/prompt-line-rich-runtime.d.ts +14 -0
- package/es/components/prompt-line/src/prompt-line-rich-runtime.js +340 -0
- package/es/components/prompt-line/src/prompt-line-rich-runtime.js.map +1 -0
- package/es/components/prompt-line/src/prompt-line-shell.d.ts +72 -0
- package/es/components/prompt-line/src/prompt-line-shell.js +227 -0
- package/es/components/prompt-line/src/prompt-line-shell.js.map +1 -0
- package/es/components/prompt-line/src/prompt-line-shell.scss.js +13 -0
- package/es/components/prompt-line/src/prompt-line-shell.scss.js.map +1 -0
- package/es/components/prompt-line/src/prompt-line.d.ts +147 -0
- package/es/components/prompt-line/src/prompt-line.js +391 -0
- package/es/components/prompt-line/src/prompt-line.js.map +1 -0
- package/es/components/prompt-line/src/prompt-line.scss.js +13 -0
- package/es/components/prompt-line/src/prompt-line.scss.js.map +1 -0
- package/es/components/prompt-line/src/send-control.d.ts +46 -0
- package/es/components/prompt-line/src/send-control.js +138 -0
- package/es/components/prompt-line/src/send-control.js.map +1 -0
- package/es/components/prompt-line/src/send-control.scss.js +13 -0
- package/es/components/prompt-line/src/send-control.scss.js.map +1 -0
- package/es/components/prompt-line/src/stop-streaming-button.d.ts +42 -0
- package/es/components/prompt-line/src/stop-streaming-button.js +93 -0
- package/es/components/prompt-line/src/stop-streaming-button.js.map +1 -0
- package/es/components/prompt-line/src/stop-streaming-button.scss.js +13 -0
- package/es/components/prompt-line/src/stop-streaming-button.scss.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/build-extensions.d.ts +30 -0
- package/es/components/prompt-line/src/tiptap/build-extensions.js +38 -0
- package/es/components/prompt-line/src/tiptap/build-extensions.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/carbon-autocomplete.d.ts +21 -0
- package/es/components/prompt-line/src/tiptap/carbon-autocomplete.js +127 -0
- package/es/components/prompt-line/src/tiptap/carbon-autocomplete.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/carbon-mention.d.ts +19 -0
- package/es/components/prompt-line/src/tiptap/carbon-mention.js +237 -0
- package/es/components/prompt-line/src/tiptap/carbon-mention.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/carbon-starter-trigger.d.ts +22 -0
- package/es/components/prompt-line/src/tiptap/carbon-starter-trigger.js +64 -0
- package/es/components/prompt-line/src/tiptap/carbon-starter-trigger.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/chat-enter.d.ts +17 -0
- package/es/components/prompt-line/src/tiptap/chat-enter.js +46 -0
- package/es/components/prompt-line/src/tiptap/chat-enter.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/editor-styles.d.ts +18 -0
- package/es/components/prompt-line/src/tiptap/editor-styles.js +83 -0
- package/es/components/prompt-line/src/tiptap/editor-styles.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/index.d.ts +42 -0
- package/es/components/prompt-line/src/tiptap/index.js +43 -0
- package/es/components/prompt-line/src/tiptap/index.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/json-utils.d.ts +61 -0
- package/es/components/prompt-line/src/tiptap/json-utils.js +158 -0
- package/es/components/prompt-line/src/tiptap/json-utils.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/keymap.d.ts +31 -0
- package/es/components/prompt-line/src/tiptap/keymap.js +59 -0
- package/es/components/prompt-line/src/tiptap/keymap.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/origin-meta.d.ts +11 -0
- package/es/components/prompt-line/src/tiptap/origin-meta.js +33 -0
- package/es/components/prompt-line/src/tiptap/origin-meta.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/plain-text-paste.d.ts +16 -0
- package/es/components/prompt-line/src/tiptap/plain-text-paste.js +85 -0
- package/es/components/prompt-line/src/tiptap/plain-text-paste.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/render-in-light-dom.d.ts +87 -0
- package/es/components/prompt-line/src/tiptap/render-in-light-dom.js +41 -0
- package/es/components/prompt-line/src/tiptap/render-in-light-dom.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/render-token-chip.d.ts +57 -0
- package/es/components/prompt-line/src/tiptap/render-token-chip.js +95 -0
- package/es/components/prompt-line/src/tiptap/render-token-chip.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/token-node-view.d.ts +36 -0
- package/es/components/prompt-line/src/tiptap/token-node-view.js +41 -0
- package/es/components/prompt-line/src/tiptap/token-node-view.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/trigger-utils.d.ts +30 -0
- package/es/components/prompt-line/src/tiptap/trigger-utils.js +44 -0
- package/es/components/prompt-line/src/tiptap/trigger-utils.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/types.d.ts +161 -0
- package/es/components/prompt-line/src/tiptap/types.js +8 -0
- package/es/components/prompt-line/src/tiptap/types.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/typing-indicator.d.ts +30 -0
- package/es/components/prompt-line/src/tiptap/typing-indicator.js +104 -0
- package/es/components/prompt-line/src/tiptap/typing-indicator.js.map +1 -0
- package/es/components/prompt-line/src/tiptap/value-sync.d.ts +25 -0
- package/es/components/prompt-line/src/tiptap/value-sync.js +65 -0
- package/es/components/prompt-line/src/tiptap/value-sync.js.map +1 -0
- package/es/components/prompt-line/src/types.d.ts +100 -0
- package/es/components/prompt-line/src/types.js +50 -0
- package/es/components/prompt-line/src/types.js.map +1 -0
- package/es/components/reasoning-steps/src/reasoning-step.d.ts +13 -0
- package/es/components/reasoning-steps/src/reasoning-step.js +38 -0
- package/es/components/reasoning-steps/src/reasoning-step.js.map +1 -1
- package/es/components/reasoning-steps/src/reasoning-steps.d.ts +23 -0
- package/es/components/reasoning-steps/src/reasoning-steps.js +56 -1
- package/es/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
- package/es/components/shared/dynamic-css-var-sheet.js +4 -1
- package/es/components/shared/dynamic-css-var-sheet.js.map +1 -1
- package/es/components/shared/media-utils/script-loader.js +0 -1
- package/es/components/shared/media-utils/script-loader.js.map +1 -1
- package/es/components/table/src/table.scss.js +1 -1
- package/es/components/table/src/table.template.js +9 -9
- package/es/components/table/src/table.template.js.map +1 -1
- package/es/components/toolbar/src/toolbar.js +51 -53
- package/es/components/toolbar/src/toolbar.js.map +1 -1
- package/es/components/video-player/src/providers/base-provider.js +0 -1
- package/es/components/video-player/src/providers/base-provider.js.map +1 -1
- package/es/components/video-player/src/providers/kaltura-provider.js +0 -1
- package/es/components/video-player/src/providers/kaltura-provider.js.map +1 -1
- package/es/components/video-player/src/providers/native-video-provider.js +0 -1
- package/es/components/video-player/src/providers/native-video-provider.js.map +1 -1
- package/es/components/video-player/src/providers/vimeo-provider.js +0 -1
- package/es/components/video-player/src/providers/vimeo-provider.js.map +1 -1
- package/es/components/video-player/src/providers/youtube-provider.js +0 -1
- package/es/components/video-player/src/providers/youtube-provider.js.map +1 -1
- package/es/components/video-player/src/utils/url-detector.js +0 -1
- package/es/components/video-player/src/utils/url-detector.js.map +1 -1
- package/es/components/video-player/src/video-player.js +9 -10
- package/es/components/video-player/src/video-player.js.map +1 -1
- package/es/components/workspace-shell/src/header-collapsible-manager.js +0 -1
- package/es/components/workspace-shell/src/header-collapsible-manager.js.map +1 -1
- package/es/components/workspace-shell/src/workspace-shell-header.js +25 -25
- package/es/components/workspace-shell/src/workspace-shell-header.js.map +1 -1
- package/es/globals/utils/aria-announcer-manager.d.ts +62 -0
- package/es/globals/utils/aria-announcer-manager.js +125 -0
- package/es/globals/utils/aria-announcer-manager.js.map +1 -0
- package/es/globals/utils/browser-utils.d.ts +10 -0
- package/es/globals/utils/browser-utils.js +37 -0
- package/es/globals/utils/browser-utils.js.map +1 -0
- package/es/globals/utils/dom-utils.d.ts +6 -0
- package/es/globals/utils/dom-utils.js +39 -0
- package/es/globals/utils/dom-utils.js.map +1 -0
- package/{es-custom/react → es/globals}/utils/iconTransform.js +1 -2
- package/es/globals/utils/iconTransform.js.map +1 -0
- package/es/react/__tests__/jest.setup.js +1 -2
- package/es/react/__tests__/jest.setup.js.map +1 -1
- package/es/react/audio-player.js +0 -1
- package/es/react/audio-player.js.map +1 -1
- package/es/react/autocomplete.d.ts +11 -0
- package/es/react/autocomplete.js +36 -0
- package/es/react/autocomplete.js.map +1 -0
- package/es/react/chat-header.js +1 -1
- package/es/react/code-snippet.js +1 -1
- package/es/react/error-message.d.ts +11 -0
- package/es/react/error-message.js +28 -0
- package/es/react/error-message.js.map +1 -0
- package/es/react/file-uploads.d.ts +11 -0
- package/es/react/file-uploads.js +31 -0
- package/es/react/file-uploads.js.map +1 -0
- package/es/react/history/history-panel-item-input.js +1 -0
- package/es/react/history/history-panel-item-input.js.map +1 -1
- package/es/react/history/history-panel-item.js +1 -0
- package/es/react/history/history-panel-item.js.map +1 -1
- package/es/react/hooks/useChatAutocomplete.d.ts +41 -0
- package/es/react/hooks/useChatAutocomplete.js +178 -0
- package/es/react/hooks/useChatAutocomplete.js.map +1 -0
- package/es/react/input-send-control.d.ts +11 -0
- package/es/react/input-send-control.js +32 -0
- package/es/react/input-send-control.js.map +1 -0
- package/es/react/prompt-line-shell.d.ts +18 -0
- package/es/react/prompt-line-shell.js +36 -0
- package/es/react/prompt-line-shell.js.map +1 -0
- package/es/react/prompt-line.d.ts +25 -0
- package/es/react/prompt-line.js +52 -0
- package/es/react/prompt-line.js.map +1 -0
- package/es/react/stop-streaming-button.d.ts +11 -0
- package/es/react/stop-streaming-button.js +28 -0
- package/es/react/stop-streaming-button.js.map +1 -0
- package/es/react/toolbar.js +1 -1
- package/es/react/transcript.js +0 -1
- package/es/react/transcript.js.map +1 -1
- package/es/react/utils/transformSuggestionConfig.d.ts +21 -0
- package/es/react/utils/transformSuggestionConfig.js +67 -0
- package/es/react/utils/transformSuggestionConfig.js.map +1 -0
- package/es/react/video-player.js +0 -1
- package/es/react/video-player.js.map +1 -1
- package/es/testing/PageObjectId.js +1 -2
- package/es/testing/PageObjectId.js.map +1 -1
- package/es-custom/components/audio-player/src/audio-player.js +9 -10
- package/es-custom/components/audio-player/src/audio-player.js.map +1 -1
- package/es-custom/components/audio-player/src/providers/base-provider.js +0 -1
- package/es-custom/components/audio-player/src/providers/base-provider.js.map +1 -1
- package/es-custom/components/audio-player/src/providers/native-audio-provider.js +0 -1
- package/es-custom/components/audio-player/src/providers/native-audio-provider.js.map +1 -1
- package/es-custom/components/audio-player/src/providers/soundcloud-provider.js +0 -1
- package/es-custom/components/audio-player/src/providers/soundcloud-provider.js.map +1 -1
- package/es-custom/components/audio-player/src/transcript.js +15 -15
- package/es-custom/components/audio-player/src/transcript.js.map +1 -1
- package/es-custom/components/audio-player/src/utils/url-detector.js +0 -1
- package/es-custom/components/audio-player/src/utils/url-detector.js.map +1 -1
- package/es-custom/components/autocomplete/index.d.ts +15 -0
- package/es-custom/components/autocomplete/index.js +11 -0
- package/es-custom/components/autocomplete/index.js.map +1 -0
- package/es-custom/components/autocomplete/src/autocomplete-item-group.d.ts +44 -0
- package/es-custom/components/autocomplete/src/autocomplete-item-group.js +139 -0
- package/es-custom/components/autocomplete/src/autocomplete-item-group.js.map +1 -0
- package/es-custom/components/autocomplete/src/autocomplete-item-group.scss.js +13 -0
- package/es-custom/components/autocomplete/src/autocomplete-item-group.scss.js.map +1 -0
- package/es-custom/components/autocomplete/src/autocomplete-item.d.ts +54 -0
- package/es-custom/components/autocomplete/src/autocomplete-item.js +197 -0
- package/es-custom/components/autocomplete/src/autocomplete-item.js.map +1 -0
- package/es-custom/components/autocomplete/src/autocomplete-item.scss.js +13 -0
- package/es-custom/components/autocomplete/src/autocomplete-item.scss.js.map +1 -0
- package/es-custom/components/autocomplete/src/autocomplete.d.ts +97 -0
- package/es-custom/components/autocomplete/src/autocomplete.js +321 -0
- package/es-custom/components/autocomplete/src/autocomplete.js.map +1 -0
- package/es-custom/components/autocomplete/src/autocomplete.scss.js +13 -0
- package/es-custom/components/autocomplete/src/autocomplete.scss.js.map +1 -0
- package/es-custom/components/card/src/card-footer.d.ts +1 -1
- package/es-custom/components/card/src/card-footer.js +1 -1
- 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 +1 -1
- package/es-custom/components/card/src/card-steps.js +28 -28
- 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.scss.js +1 -1
- package/es-custom/components/carousel/src/carousel.js +0 -1
- package/es-custom/components/carousel/src/carousel.js.map +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -1
- package/es-custom/components/chain-of-thought/src/tool-call-data.js +4 -4
- package/es-custom/components/chain-of-thought/src/tool-call-data.js.map +1 -1
- package/es-custom/components/chat-button/src/chat-button.d.ts +1 -1
- package/es-custom/components/chat-button/src/chat-button.js +1 -1
- package/es-custom/components/chat-button/src/chat-button.js.map +1 -1
- package/es-custom/components/chat-button/src/chat-button.scss.js +1 -1
- package/es-custom/components/chat-history/src/chat-history.scss.js +1 -1
- package/es-custom/components/chat-history/src/history-content.js +2 -2
- package/es-custom/components/chat-history/src/history-content.js.map +1 -1
- package/es-custom/components/chat-history/src/history-header.js +8 -8
- package/es-custom/components/chat-history/src/history-header.js.map +1 -1
- package/es-custom/components/chat-history/src/history-panel-item-input.d.ts +19 -2
- package/es-custom/components/chat-history/src/history-panel-item-input.js +69 -19
- 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 +14 -0
- package/es-custom/components/chat-history/src/history-panel-item.js +59 -27
- package/es-custom/components/chat-history/src/history-panel-item.js.map +1 -1
- package/es-custom/components/chat-history/src/history-toolbar.js +3 -3
- package/es-custom/components/chat-history/src/history-toolbar.js.map +1 -1
- package/es-custom/components/chat-shell/src/chat-header.js +15 -16
- 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 +1 -2
- package/es-custom/components/chat-shell/src/corner-manager.js.map +1 -1
- package/es-custom/components/chat-shell/src/initialization-manager.d.ts +1 -1
- package/es-custom/components/chat-shell/src/initialization-manager.js +1 -2
- package/es-custom/components/chat-shell/src/initialization-manager.js.map +1 -1
- package/es-custom/components/chat-shell/src/resize-observer-manager.js +0 -1
- package/es-custom/components/chat-shell/src/resize-observer-manager.js.map +1 -1
- package/es-custom/components/chat-shell/src/shell.d.ts +1 -1
- package/es-custom/components/chat-shell/src/shell.js +3 -3
- 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 +1 -2
- package/es-custom/components/chat-shell/src/slot-observer.js.map +1 -1
- package/es-custom/components/chat-shell/src/types.d.ts +1 -1
- package/es-custom/components/chat-shell/src/workspace-manager-utils.d.ts +1 -1
- package/es-custom/components/chat-shell/src/workspace-manager-utils.js +1 -2
- package/es-custom/components/chat-shell/src/workspace-manager-utils.js.map +1 -1
- package/es-custom/components/chat-shell/src/workspace-manager.d.ts +1 -1
- package/es-custom/components/chat-shell/src/workspace-manager.js +1 -2
- package/es-custom/components/chat-shell/src/workspace-manager.js.map +1 -1
- package/es-custom/components/code-snippet/src/code-snippet.d.ts +23 -0
- package/es-custom/components/code-snippet/src/code-snippet.js +111 -36
- package/es-custom/components/code-snippet/src/code-snippet.js.map +1 -1
- package/es-custom/components/code-snippet/src/code-snippet.scss.js +1 -1
- package/es-custom/components/code-snippet/src/codemirror/diff-decorator.js +1 -1
- package/es-custom/components/code-snippet/src/codemirror/diff-decorator.js.map +1 -1
- package/es-custom/components/code-snippet/src/codemirror/theme.js +5 -0
- package/es-custom/components/code-snippet/src/codemirror/theme.js.map +1 -1
- package/es-custom/components/code-snippet/src/layout-utils.js +21 -8
- package/es-custom/components/code-snippet/src/layout-utils.js.map +1 -1
- package/es-custom/components/feedback/src/feedback-buttons.js +1 -1
- package/es-custom/components/feedback/src/feedback-buttons.js.map +1 -1
- package/es-custom/components/feedback/src/feedback.js +38 -38
- package/es-custom/components/feedback/src/feedback.js.map +1 -1
- package/es-custom/components/feedback/src/feedback.scss.js +1 -1
- package/es-custom/components/file-uploads/index.d.ts +12 -0
- package/es-custom/components/file-uploads/index.js +10 -0
- package/es-custom/components/file-uploads/index.js.map +1 -0
- package/es-custom/components/file-uploads/src/file-upload-item.d.ts +43 -0
- package/es-custom/components/file-uploads/src/file-upload-item.js +267 -0
- package/es-custom/components/file-uploads/src/file-upload-item.js.map +1 -0
- package/es-custom/components/file-uploads/src/file-upload-item.scss.js +13 -0
- package/es-custom/components/file-uploads/src/file-upload-item.scss.js.map +1 -0
- package/es-custom/components/file-uploads/src/file-uploads.d.ts +87 -0
- package/es-custom/components/file-uploads/src/file-uploads.js +213 -0
- package/es-custom/components/file-uploads/src/file-uploads.js.map +1 -0
- package/es-custom/components/file-uploads/src/file-uploads.scss.js +13 -0
- package/es-custom/components/file-uploads/src/file-uploads.scss.js.map +1 -0
- package/es-custom/components/markdown/index.d.ts +1 -0
- package/es-custom/components/markdown/index.js +1 -0
- package/es-custom/components/markdown/index.js.map +1 -1
- package/es-custom/components/markdown/src/markdown-token-tree.d.ts +8 -0
- package/es-custom/components/markdown/src/markdown-token-tree.js +12 -1
- package/es-custom/components/markdown/src/markdown-token-tree.js.map +1 -1
- package/es-custom/components/markdown/src/markdown.js +4 -0
- package/es-custom/components/markdown/src/markdown.js.map +1 -1
- package/es-custom/components/markdown/src/markdown.scss.js +1 -1
- package/es-custom/components/markdown/src/utils/html-helpers.js.map +1 -1
- package/es-custom/components/prompt-line/index.d.ts +26 -0
- package/es-custom/components/prompt-line/index.js +32 -0
- package/es-custom/components/prompt-line/index.js.map +1 -0
- package/es-custom/components/prompt-line/src/autocomplete-controller.d.ts +178 -0
- package/es-custom/components/prompt-line/src/autocomplete-controller.js +548 -0
- package/es-custom/components/prompt-line/src/autocomplete-controller.js.map +1 -0
- package/es-custom/components/prompt-line/src/error-message.d.ts +50 -0
- package/es-custom/components/prompt-line/src/error-message.js +144 -0
- package/es-custom/components/prompt-line/src/error-message.js.map +1 -0
- package/es-custom/components/prompt-line/src/error-message.scss.js +13 -0
- package/es-custom/components/prompt-line/src/error-message.scss.js.map +1 -0
- package/es-custom/components/prompt-line/src/prompt-line-constants.d.ts +17 -0
- package/es-custom/components/prompt-line/src/prompt-line-constants.js +27 -0
- package/es-custom/components/prompt-line/src/prompt-line-constants.js.map +1 -0
- package/es-custom/components/prompt-line/src/prompt-line-controller.d.ts +155 -0
- package/es-custom/components/prompt-line/src/prompt-line-controller.js +394 -0
- package/es-custom/components/prompt-line/src/prompt-line-controller.js.map +1 -0
- package/es-custom/components/prompt-line/src/prompt-line-rich-loader.d.ts +34 -0
- package/es-custom/components/prompt-line/src/prompt-line-rich-loader.js +51 -0
- package/es-custom/components/prompt-line/src/prompt-line-rich-loader.js.map +1 -0
- package/es-custom/components/prompt-line/src/prompt-line-rich-runtime.d.ts +14 -0
- package/es-custom/components/prompt-line/src/prompt-line-rich-runtime.js +340 -0
- package/es-custom/components/prompt-line/src/prompt-line-rich-runtime.js.map +1 -0
- package/es-custom/components/prompt-line/src/prompt-line-shell.d.ts +72 -0
- package/es-custom/components/prompt-line/src/prompt-line-shell.js +227 -0
- package/es-custom/components/prompt-line/src/prompt-line-shell.js.map +1 -0
- package/es-custom/components/prompt-line/src/prompt-line-shell.scss.js +13 -0
- package/es-custom/components/prompt-line/src/prompt-line-shell.scss.js.map +1 -0
- package/es-custom/components/prompt-line/src/prompt-line.d.ts +147 -0
- package/es-custom/components/prompt-line/src/prompt-line.js +391 -0
- package/es-custom/components/prompt-line/src/prompt-line.js.map +1 -0
- package/es-custom/components/prompt-line/src/prompt-line.scss.js +13 -0
- package/es-custom/components/prompt-line/src/prompt-line.scss.js.map +1 -0
- package/es-custom/components/prompt-line/src/send-control.d.ts +46 -0
- package/es-custom/components/prompt-line/src/send-control.js +138 -0
- package/es-custom/components/prompt-line/src/send-control.js.map +1 -0
- package/es-custom/components/prompt-line/src/send-control.scss.js +13 -0
- package/es-custom/components/prompt-line/src/send-control.scss.js.map +1 -0
- package/es-custom/components/prompt-line/src/stop-streaming-button.d.ts +42 -0
- package/es-custom/components/prompt-line/src/stop-streaming-button.js +93 -0
- package/es-custom/components/prompt-line/src/stop-streaming-button.js.map +1 -0
- package/es-custom/components/prompt-line/src/stop-streaming-button.scss.js +13 -0
- package/es-custom/components/prompt-line/src/stop-streaming-button.scss.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/build-extensions.d.ts +30 -0
- package/es-custom/components/prompt-line/src/tiptap/build-extensions.js +38 -0
- package/es-custom/components/prompt-line/src/tiptap/build-extensions.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/carbon-autocomplete.d.ts +21 -0
- package/es-custom/components/prompt-line/src/tiptap/carbon-autocomplete.js +127 -0
- package/es-custom/components/prompt-line/src/tiptap/carbon-autocomplete.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/carbon-mention.d.ts +19 -0
- package/es-custom/components/prompt-line/src/tiptap/carbon-mention.js +237 -0
- package/es-custom/components/prompt-line/src/tiptap/carbon-mention.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/carbon-starter-trigger.d.ts +22 -0
- package/es-custom/components/prompt-line/src/tiptap/carbon-starter-trigger.js +64 -0
- package/es-custom/components/prompt-line/src/tiptap/carbon-starter-trigger.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/chat-enter.d.ts +17 -0
- package/es-custom/components/prompt-line/src/tiptap/chat-enter.js +46 -0
- package/es-custom/components/prompt-line/src/tiptap/chat-enter.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/editor-styles.d.ts +18 -0
- package/es-custom/components/prompt-line/src/tiptap/editor-styles.js +83 -0
- package/es-custom/components/prompt-line/src/tiptap/editor-styles.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/index.d.ts +42 -0
- package/es-custom/components/prompt-line/src/tiptap/index.js +43 -0
- package/es-custom/components/prompt-line/src/tiptap/index.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/json-utils.d.ts +61 -0
- package/es-custom/components/prompt-line/src/tiptap/json-utils.js +158 -0
- package/es-custom/components/prompt-line/src/tiptap/json-utils.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/keymap.d.ts +31 -0
- package/es-custom/components/prompt-line/src/tiptap/keymap.js +59 -0
- package/es-custom/components/prompt-line/src/tiptap/keymap.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/origin-meta.d.ts +11 -0
- package/es-custom/components/prompt-line/src/tiptap/origin-meta.js +33 -0
- package/es-custom/components/prompt-line/src/tiptap/origin-meta.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/plain-text-paste.d.ts +16 -0
- package/es-custom/components/prompt-line/src/tiptap/plain-text-paste.js +85 -0
- package/es-custom/components/prompt-line/src/tiptap/plain-text-paste.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/render-in-light-dom.d.ts +87 -0
- package/es-custom/components/prompt-line/src/tiptap/render-in-light-dom.js +41 -0
- package/es-custom/components/prompt-line/src/tiptap/render-in-light-dom.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/render-token-chip.d.ts +57 -0
- package/es-custom/components/prompt-line/src/tiptap/render-token-chip.js +95 -0
- package/es-custom/components/prompt-line/src/tiptap/render-token-chip.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/token-node-view.d.ts +36 -0
- package/es-custom/components/prompt-line/src/tiptap/token-node-view.js +41 -0
- package/es-custom/components/prompt-line/src/tiptap/token-node-view.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/trigger-utils.d.ts +30 -0
- package/es-custom/components/prompt-line/src/tiptap/trigger-utils.js +44 -0
- package/es-custom/components/prompt-line/src/tiptap/trigger-utils.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/types.d.ts +161 -0
- package/es-custom/components/prompt-line/src/tiptap/types.js +8 -0
- package/es-custom/components/prompt-line/src/tiptap/types.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/typing-indicator.d.ts +30 -0
- package/es-custom/components/prompt-line/src/tiptap/typing-indicator.js +104 -0
- package/es-custom/components/prompt-line/src/tiptap/typing-indicator.js.map +1 -0
- package/es-custom/components/prompt-line/src/tiptap/value-sync.d.ts +25 -0
- package/es-custom/components/prompt-line/src/tiptap/value-sync.js +65 -0
- package/es-custom/components/prompt-line/src/tiptap/value-sync.js.map +1 -0
- package/es-custom/components/prompt-line/src/types.d.ts +100 -0
- package/es-custom/components/prompt-line/src/types.js +50 -0
- package/es-custom/components/prompt-line/src/types.js.map +1 -0
- package/es-custom/components/reasoning-steps/src/reasoning-step.d.ts +13 -0
- package/es-custom/components/reasoning-steps/src/reasoning-step.js +38 -0
- package/es-custom/components/reasoning-steps/src/reasoning-step.js.map +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps.d.ts +23 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps.js +56 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
- package/es-custom/components/shared/dynamic-css-var-sheet.js +4 -1
- package/es-custom/components/shared/dynamic-css-var-sheet.js.map +1 -1
- package/es-custom/components/shared/media-utils/script-loader.js +0 -1
- package/es-custom/components/shared/media-utils/script-loader.js.map +1 -1
- package/es-custom/components/table/src/table.scss.js +1 -1
- package/es-custom/components/table/src/table.template.js +9 -9
- package/es-custom/components/table/src/table.template.js.map +1 -1
- package/es-custom/components/toolbar/src/toolbar.js +51 -53
- package/es-custom/components/toolbar/src/toolbar.js.map +1 -1
- package/es-custom/components/video-player/src/providers/base-provider.js +0 -1
- package/es-custom/components/video-player/src/providers/base-provider.js.map +1 -1
- package/es-custom/components/video-player/src/providers/kaltura-provider.js +0 -1
- package/es-custom/components/video-player/src/providers/kaltura-provider.js.map +1 -1
- package/es-custom/components/video-player/src/providers/native-video-provider.js +0 -1
- package/es-custom/components/video-player/src/providers/native-video-provider.js.map +1 -1
- package/es-custom/components/video-player/src/providers/vimeo-provider.js +0 -1
- package/es-custom/components/video-player/src/providers/vimeo-provider.js.map +1 -1
- package/es-custom/components/video-player/src/providers/youtube-provider.js +0 -1
- package/es-custom/components/video-player/src/providers/youtube-provider.js.map +1 -1
- package/es-custom/components/video-player/src/utils/url-detector.js +0 -1
- package/es-custom/components/video-player/src/utils/url-detector.js.map +1 -1
- package/es-custom/components/video-player/src/video-player.js +9 -10
- package/es-custom/components/video-player/src/video-player.js.map +1 -1
- package/es-custom/components/workspace-shell/src/header-collapsible-manager.js +0 -1
- package/es-custom/components/workspace-shell/src/header-collapsible-manager.js.map +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-header.js +25 -25
- package/es-custom/components/workspace-shell/src/workspace-shell-header.js.map +1 -1
- package/es-custom/globals/utils/aria-announcer-manager.d.ts +62 -0
- package/es-custom/globals/utils/aria-announcer-manager.js +125 -0
- package/es-custom/globals/utils/aria-announcer-manager.js.map +1 -0
- package/es-custom/globals/utils/browser-utils.d.ts +10 -0
- package/es-custom/globals/utils/browser-utils.js +37 -0
- package/es-custom/globals/utils/browser-utils.js.map +1 -0
- package/es-custom/globals/utils/dom-utils.d.ts +6 -0
- package/es-custom/globals/utils/dom-utils.js +39 -0
- package/es-custom/globals/utils/dom-utils.js.map +1 -0
- package/{es/react → es-custom/globals}/utils/iconTransform.js +1 -2
- package/es-custom/globals/utils/iconTransform.js.map +1 -0
- package/es-custom/react/__tests__/jest.setup.js +1 -2
- package/es-custom/react/__tests__/jest.setup.js.map +1 -1
- package/es-custom/react/audio-player.js +0 -1
- package/es-custom/react/audio-player.js.map +1 -1
- package/es-custom/react/autocomplete.d.ts +11 -0
- package/es-custom/react/autocomplete.js +36 -0
- package/es-custom/react/autocomplete.js.map +1 -0
- package/es-custom/react/chat-header.js +1 -1
- package/es-custom/react/code-snippet.js +1 -1
- package/es-custom/react/error-message.d.ts +11 -0
- package/es-custom/react/error-message.js +28 -0
- package/es-custom/react/error-message.js.map +1 -0
- package/es-custom/react/file-uploads.d.ts +11 -0
- package/es-custom/react/file-uploads.js +31 -0
- package/es-custom/react/file-uploads.js.map +1 -0
- package/es-custom/react/history/history-panel-item-input.js +1 -0
- package/es-custom/react/history/history-panel-item-input.js.map +1 -1
- package/es-custom/react/history/history-panel-item.js +1 -0
- package/es-custom/react/history/history-panel-item.js.map +1 -1
- package/es-custom/react/hooks/useChatAutocomplete.d.ts +41 -0
- package/es-custom/react/hooks/useChatAutocomplete.js +178 -0
- package/es-custom/react/hooks/useChatAutocomplete.js.map +1 -0
- package/es-custom/react/input-send-control.d.ts +11 -0
- package/es-custom/react/input-send-control.js +32 -0
- package/es-custom/react/input-send-control.js.map +1 -0
- package/es-custom/react/prompt-line-shell.d.ts +18 -0
- package/es-custom/react/prompt-line-shell.js +36 -0
- package/es-custom/react/prompt-line-shell.js.map +1 -0
- package/es-custom/react/prompt-line.d.ts +25 -0
- package/es-custom/react/prompt-line.js +52 -0
- package/es-custom/react/prompt-line.js.map +1 -0
- package/es-custom/react/stop-streaming-button.d.ts +11 -0
- package/es-custom/react/stop-streaming-button.js +28 -0
- package/es-custom/react/stop-streaming-button.js.map +1 -0
- package/es-custom/react/toolbar.js +1 -1
- package/es-custom/react/transcript.js +0 -1
- package/es-custom/react/transcript.js.map +1 -1
- package/es-custom/react/utils/transformSuggestionConfig.d.ts +21 -0
- package/es-custom/react/utils/transformSuggestionConfig.js +67 -0
- package/es-custom/react/utils/transformSuggestionConfig.js.map +1 -0
- package/es-custom/react/video-player.js +0 -1
- package/es-custom/react/video-player.js.map +1 -1
- package/es-custom/testing/PageObjectId.js +1 -2
- package/es-custom/testing/PageObjectId.js.map +1 -1
- package/package.json +27 -6
- package/scss/_custom-properties.scss +1 -3
- package/scss/_modifiers.scss +17 -49
- package/scss/_tokens-component.scss +1 -3
- package/scss/_tokens-layout.scss +1 -3
- package/scss/_utilities.scss +1 -3
- package/LICENSE +0 -201
- package/es/components/chat-shell/src/aria-announcer-manager.d.ts +0 -40
- package/es/components/chat-shell/src/aria-announcer-manager.js +0 -104
- package/es/components/chat-shell/src/aria-announcer-manager.js.map +0 -1
- package/es/react/utils/iconTransform.js.map +0 -1
- package/es-custom/components/chat-shell/src/aria-announcer-manager.d.ts +0 -40
- package/es-custom/components/chat-shell/src/aria-announcer-manager.js +0 -104
- package/es-custom/components/chat-shell/src/aria-announcer-manager.js.map +0 -1
- package/es-custom/react/utils/iconTransform.js.map +0 -1
- /package/es/{react → globals}/utils/iconTransform.d.ts +0 -0
- /package/es-custom/{react → globals}/utils/iconTransform.d.ts +0 -0
|
@@ -0,0 +1,548 @@
|
|
|
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 { LitElement, nothing, 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 '../../autocomplete/src/autocomplete.js';
|
|
14
|
+
import { resolveShowTriggerInChip } from './tiptap/carbon-mention.js';
|
|
15
|
+
import { projectRawValue } from './tiptap/json-utils.js';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @license
|
|
19
|
+
*
|
|
20
|
+
* Copyright IBM Corp. 2026
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*/
|
|
25
|
+
class AutocompleteController {
|
|
26
|
+
constructor(options) {
|
|
27
|
+
this._trigger = null;
|
|
28
|
+
this._items = [];
|
|
29
|
+
/**
|
|
30
|
+
* Identifies the source prompt-line of the active trigger. Set from the
|
|
31
|
+
* trigger event's target (when feeding via `handleTriggerChangeEvent`) or
|
|
32
|
+
* via `setPromptLine` (e.g. by the React hook, which has a stable ref).
|
|
33
|
+
*/
|
|
34
|
+
this._promptLine = null;
|
|
35
|
+
/**
|
|
36
|
+
* The active suggestion-list element. Surface wrappers (React hook, WC
|
|
37
|
+
* element) register this so the controller can forward Arrow/Enter/Escape
|
|
38
|
+
* key events from the prompt-line editor without the user having to Tab
|
|
39
|
+
* to the list.
|
|
40
|
+
*/
|
|
41
|
+
this._listElement = null;
|
|
42
|
+
/**
|
|
43
|
+
* Editor DOM the key-forwarding handler is currently attached to, or null
|
|
44
|
+
* if not attached. Tracked separately from `_promptLine` so we always
|
|
45
|
+
* detach from the exact node we attached to (the editor view can be
|
|
46
|
+
* recreated underneath us).
|
|
47
|
+
*/
|
|
48
|
+
this._editorDomBound = null;
|
|
49
|
+
/**
|
|
50
|
+
* Monotonic counter — incremented on every new trigger / dismiss so an
|
|
51
|
+
* in-flight async resolve from an older trigger cannot clobber state.
|
|
52
|
+
*/
|
|
53
|
+
this._resolveToken = 0;
|
|
54
|
+
this._destroyed = false;
|
|
55
|
+
this._handleEditorKeyDown = (event) => {
|
|
56
|
+
if (event.key !== "ArrowUp" &&
|
|
57
|
+
event.key !== "ArrowDown" &&
|
|
58
|
+
event.key !== "Enter" &&
|
|
59
|
+
event.key !== "Escape") {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const listEl = this._listElement;
|
|
63
|
+
if (!listEl || !this._trigger) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
// Stop Tiptap and the editor from acting on the same key. `capture: true`
|
|
67
|
+
// (when listening) plus stopPropagation here gets us in ahead of
|
|
68
|
+
// ProseMirror's own keydown handler.
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
event.stopPropagation();
|
|
71
|
+
listEl.dispatchEvent(new KeyboardEvent("keydown", {
|
|
72
|
+
key: event.key,
|
|
73
|
+
bubbles: true,
|
|
74
|
+
cancelable: true,
|
|
75
|
+
}));
|
|
76
|
+
};
|
|
77
|
+
this._mention = options.mention;
|
|
78
|
+
this._command = options.command;
|
|
79
|
+
this._autocomplete = options.autocomplete;
|
|
80
|
+
this._starters = options.starters;
|
|
81
|
+
this._isSendDisabled = Boolean(options.isSendDisabled);
|
|
82
|
+
this._onStarterSelected = options.onStarterSelected;
|
|
83
|
+
this._onChange = options.onChange;
|
|
84
|
+
}
|
|
85
|
+
// ---------------------------------------------------------------------
|
|
86
|
+
// Config / prompt-line wiring
|
|
87
|
+
// ---------------------------------------------------------------------
|
|
88
|
+
/**
|
|
89
|
+
* Update any subset of configs. The active trigger (if any) is re-resolved
|
|
90
|
+
* against the new configs so the visible item list stays current.
|
|
91
|
+
*/
|
|
92
|
+
setConfigs(next) {
|
|
93
|
+
if ("mention" in next) {
|
|
94
|
+
this._mention = next.mention;
|
|
95
|
+
}
|
|
96
|
+
if ("command" in next) {
|
|
97
|
+
this._command = next.command;
|
|
98
|
+
}
|
|
99
|
+
if ("autocomplete" in next) {
|
|
100
|
+
this._autocomplete = next.autocomplete;
|
|
101
|
+
}
|
|
102
|
+
if ("starters" in next) {
|
|
103
|
+
this._starters = next.starters;
|
|
104
|
+
}
|
|
105
|
+
if ("isSendDisabled" in next) {
|
|
106
|
+
this._isSendDisabled = Boolean(next.isSendDisabled);
|
|
107
|
+
}
|
|
108
|
+
if ("onStarterSelected" in next) {
|
|
109
|
+
this._onStarterSelected = next.onStarterSelected;
|
|
110
|
+
}
|
|
111
|
+
if (this._trigger) {
|
|
112
|
+
// Re-resolve items against the new configs.
|
|
113
|
+
this._kickoffResolve(this._trigger);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** Set or clear the active prompt-line. */
|
|
117
|
+
setPromptLine(promptLine) {
|
|
118
|
+
if (this._promptLine === promptLine) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this._promptLine = promptLine;
|
|
122
|
+
// Re-evaluate the key-forwarding handler — the editor DOM we were bound
|
|
123
|
+
// to may now be gone, or a new one may need binding.
|
|
124
|
+
this._refreshEditorKeyHandler();
|
|
125
|
+
}
|
|
126
|
+
/** Read the currently associated prompt-line. */
|
|
127
|
+
getPromptLine() {
|
|
128
|
+
return this._promptLine;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Set the active suggestion-list element. When both this and an active
|
|
132
|
+
* trigger are present, ArrowUp/ArrowDown/Enter/Escape on the prompt-line
|
|
133
|
+
* editor are forwarded to the list as synthetic `keydown` events.
|
|
134
|
+
*/
|
|
135
|
+
setListElement(el) {
|
|
136
|
+
if (this._listElement === el) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
this._listElement = el;
|
|
140
|
+
this._refreshEditorKeyHandler();
|
|
141
|
+
}
|
|
142
|
+
// ---------------------------------------------------------------------
|
|
143
|
+
// Trigger handling
|
|
144
|
+
// ---------------------------------------------------------------------
|
|
145
|
+
/**
|
|
146
|
+
* Feed a raw `cds-custom-aichat-trigger-change` event. The event's `target` is the
|
|
147
|
+
* originating prompt-line (since the event is `composed: true, bubbles:
|
|
148
|
+
* true`), so we capture it here for later selection-routing.
|
|
149
|
+
*/
|
|
150
|
+
handleTriggerChangeEvent(event) {
|
|
151
|
+
const target = findPromptLineFromTarget(event.composedPath());
|
|
152
|
+
if (target) {
|
|
153
|
+
this._promptLine = target;
|
|
154
|
+
}
|
|
155
|
+
this.handleTriggerChange(event.detail ?? null);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Feed a trigger-change detail directly. Use this when the caller already
|
|
159
|
+
* has the detail object and a separate way to know which prompt-line it
|
|
160
|
+
* belongs to (e.g. the React hook holds a ref).
|
|
161
|
+
*/
|
|
162
|
+
handleTriggerChange(detail) {
|
|
163
|
+
if (this._destroyed) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
this._trigger = detail;
|
|
167
|
+
if (!detail) {
|
|
168
|
+
this._items = [];
|
|
169
|
+
this._resolveToken++;
|
|
170
|
+
this._refreshEditorKeyHandler();
|
|
171
|
+
this._emit();
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
this._kickoffResolve(detail);
|
|
175
|
+
this._refreshEditorKeyHandler();
|
|
176
|
+
}
|
|
177
|
+
/** Clear active trigger + items. */
|
|
178
|
+
dismiss() {
|
|
179
|
+
if (this._destroyed) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (!this._trigger && this._items.length === 0) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this._trigger = null;
|
|
186
|
+
this._items = [];
|
|
187
|
+
this._resolveToken++;
|
|
188
|
+
this._refreshEditorKeyHandler();
|
|
189
|
+
this._emit();
|
|
190
|
+
}
|
|
191
|
+
// ---------------------------------------------------------------------
|
|
192
|
+
// Selection
|
|
193
|
+
// ---------------------------------------------------------------------
|
|
194
|
+
/**
|
|
195
|
+
* Apply a user selection. Routes by trigger type:
|
|
196
|
+
* - starter → insert text + (if not send-disabled) fire onStarterSelected
|
|
197
|
+
* - mention / command → insert chip node at trigger range
|
|
198
|
+
* - autocomplete → insert plain text at trigger range
|
|
199
|
+
*/
|
|
200
|
+
select(item) {
|
|
201
|
+
if (this._destroyed) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const trigger = this._trigger;
|
|
205
|
+
const promptLine = this._promptLine;
|
|
206
|
+
const editor = promptLine?.getEditor() ?? null;
|
|
207
|
+
if (!trigger || !editor) {
|
|
208
|
+
this.dismiss();
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (trigger.type === "starter") {
|
|
212
|
+
const text = item.value ?? item.label;
|
|
213
|
+
editor.commands.insertContent(text);
|
|
214
|
+
this.dismiss();
|
|
215
|
+
if (!this._isSendDisabled) {
|
|
216
|
+
this._onStarterSelected?.(projectRawValue(editor));
|
|
217
|
+
}
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (trigger.type === "mention" || trigger.type === "command") {
|
|
221
|
+
const config = trigger.type === "mention" ? this._mention : this._command;
|
|
222
|
+
const nodeName = trigger.type;
|
|
223
|
+
const range = {
|
|
224
|
+
from: trigger.triggerOffset,
|
|
225
|
+
to: editor.state.selection.from,
|
|
226
|
+
};
|
|
227
|
+
editor
|
|
228
|
+
.chain()
|
|
229
|
+
.focus()
|
|
230
|
+
.insertContentAt(range, [
|
|
231
|
+
{
|
|
232
|
+
type: nodeName,
|
|
233
|
+
attrs: {
|
|
234
|
+
id: item.id,
|
|
235
|
+
label: item.label,
|
|
236
|
+
value: item.value ?? item.label,
|
|
237
|
+
trigger: resolveShowTriggerInChip(item, config ?? {}, trigger.type === "command")
|
|
238
|
+
? config?.trigger
|
|
239
|
+
: null,
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
{ type: "text", text: " " },
|
|
243
|
+
])
|
|
244
|
+
.run();
|
|
245
|
+
config?.onSelect?.(item);
|
|
246
|
+
}
|
|
247
|
+
else if (trigger.type === "autocomplete") {
|
|
248
|
+
const text = item.value ?? item.label;
|
|
249
|
+
const range = {
|
|
250
|
+
from: trigger.triggerOffset,
|
|
251
|
+
to: editor.state.selection.from,
|
|
252
|
+
};
|
|
253
|
+
editor
|
|
254
|
+
.chain()
|
|
255
|
+
.focus()
|
|
256
|
+
.insertContentAt(range, [{ type: "text", text }])
|
|
257
|
+
.run();
|
|
258
|
+
this._autocomplete?.onSelect?.(item);
|
|
259
|
+
}
|
|
260
|
+
this.dismiss();
|
|
261
|
+
}
|
|
262
|
+
// ---------------------------------------------------------------------
|
|
263
|
+
// Lifecycle
|
|
264
|
+
// ---------------------------------------------------------------------
|
|
265
|
+
destroy() {
|
|
266
|
+
this._detachEditorKeyHandler();
|
|
267
|
+
this._destroyed = true;
|
|
268
|
+
this._resolveToken++;
|
|
269
|
+
this._trigger = null;
|
|
270
|
+
this._items = [];
|
|
271
|
+
this._promptLine = null;
|
|
272
|
+
this._listElement = null;
|
|
273
|
+
}
|
|
274
|
+
// ---------------------------------------------------------------------
|
|
275
|
+
// Editor-DOM key forwarding
|
|
276
|
+
// ---------------------------------------------------------------------
|
|
277
|
+
/**
|
|
278
|
+
* When a trigger and a list element are both active, bind a keydown
|
|
279
|
+
* handler to the prompt-line editor DOM so ArrowUp / ArrowDown / Enter /
|
|
280
|
+
* Escape pressed while typing get re-dispatched on the list — same effect
|
|
281
|
+
* as if the list had focus, without taking focus from the editor.
|
|
282
|
+
*/
|
|
283
|
+
_refreshEditorKeyHandler() {
|
|
284
|
+
if (this._destroyed) {
|
|
285
|
+
this._detachEditorKeyHandler();
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
const editorDom = this._trigger && this._listElement
|
|
289
|
+
? (this._promptLine?.getEditor()?.view.dom ?? null)
|
|
290
|
+
: null;
|
|
291
|
+
if (editorDom === this._editorDomBound) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
this._detachEditorKeyHandler();
|
|
295
|
+
if (editorDom) {
|
|
296
|
+
editorDom.addEventListener("keydown", this._handleEditorKeyDown, true);
|
|
297
|
+
this._editorDomBound = editorDom;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
_detachEditorKeyHandler() {
|
|
301
|
+
if (this._editorDomBound) {
|
|
302
|
+
this._editorDomBound.removeEventListener("keydown", this._handleEditorKeyDown, true);
|
|
303
|
+
this._editorDomBound = null;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
// ---------------------------------------------------------------------
|
|
307
|
+
// Internals
|
|
308
|
+
// ---------------------------------------------------------------------
|
|
309
|
+
_kickoffResolve(trigger) {
|
|
310
|
+
const token = ++this._resolveToken;
|
|
311
|
+
void (async () => {
|
|
312
|
+
const items = await this._resolveItems(trigger);
|
|
313
|
+
if (this._destroyed || this._resolveToken !== token) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
this._items = items;
|
|
317
|
+
this._emit();
|
|
318
|
+
})();
|
|
319
|
+
}
|
|
320
|
+
async _resolveItems(trigger) {
|
|
321
|
+
if (trigger.type === "starter") {
|
|
322
|
+
return this._starters ?? [];
|
|
323
|
+
}
|
|
324
|
+
const config = trigger.type === "mention"
|
|
325
|
+
? this._mention
|
|
326
|
+
: trigger.type === "command"
|
|
327
|
+
? this._command
|
|
328
|
+
: trigger.type === "autocomplete"
|
|
329
|
+
? this._autocomplete
|
|
330
|
+
: undefined;
|
|
331
|
+
if (!config) {
|
|
332
|
+
return [];
|
|
333
|
+
}
|
|
334
|
+
return resolveConfigItems(config, trigger.query);
|
|
335
|
+
}
|
|
336
|
+
_resolveRenderCustomList() {
|
|
337
|
+
const trigger = this._trigger;
|
|
338
|
+
if (!trigger || trigger.type === "starter") {
|
|
339
|
+
return undefined;
|
|
340
|
+
}
|
|
341
|
+
const config = trigger.type === "mention"
|
|
342
|
+
? this._mention
|
|
343
|
+
: trigger.type === "command"
|
|
344
|
+
? this._command
|
|
345
|
+
: trigger.type === "autocomplete"
|
|
346
|
+
? this._autocomplete
|
|
347
|
+
: undefined;
|
|
348
|
+
return config?.renderCustomList;
|
|
349
|
+
}
|
|
350
|
+
_emit() {
|
|
351
|
+
this._onChange({
|
|
352
|
+
trigger: this._trigger,
|
|
353
|
+
items: this._items,
|
|
354
|
+
renderCustomList: this._resolveRenderCustomList(),
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
// ---------------------------------------------------------------------------
|
|
359
|
+
// Controller helpers
|
|
360
|
+
// ---------------------------------------------------------------------------
|
|
361
|
+
/** Walks an event's composedPath looking for a `cds-custom-aichat-prompt-line`. */
|
|
362
|
+
function findPromptLineFromTarget(path) {
|
|
363
|
+
for (const target of path) {
|
|
364
|
+
if (target instanceof HTMLElement &&
|
|
365
|
+
target.tagName === "CDS-AICHAT-PROMPT-LINE") {
|
|
366
|
+
return target;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return null;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Resolve a `BaseSuggestionConfig`'s `items` field (array or async resolver)
|
|
373
|
+
* to a flat list, applying `minQueryLength` filtering.
|
|
374
|
+
*/
|
|
375
|
+
async function resolveConfigItems(config, query) {
|
|
376
|
+
const minQueryLength = config.minQueryLength ?? 0;
|
|
377
|
+
if (query.length < minQueryLength) {
|
|
378
|
+
return [];
|
|
379
|
+
}
|
|
380
|
+
if (typeof config.items === "function") {
|
|
381
|
+
return await Promise.resolve(config.items(query));
|
|
382
|
+
}
|
|
383
|
+
if (!query) {
|
|
384
|
+
return config.items;
|
|
385
|
+
}
|
|
386
|
+
const lower = query.toLowerCase();
|
|
387
|
+
return config.items.filter((item) => item.label.toLowerCase().includes(lower));
|
|
388
|
+
}
|
|
389
|
+
// ---------------------------------------------------------------------------
|
|
390
|
+
// <cds-custom-aichat-autocomplete-controller> — Lit element wrapping the class
|
|
391
|
+
// ---------------------------------------------------------------------------
|
|
392
|
+
/**
|
|
393
|
+
* `<cds-custom-aichat-autocomplete-controller>` — drops the autocomplete overlay
|
|
394
|
+
* lifecycle into a `<cds-custom-aichat-prompt-line-shell>`'s `autocomplete-content` slot.
|
|
395
|
+
*
|
|
396
|
+
* Listens for `cds-custom-aichat-trigger-change` events bubbling up from the
|
|
397
|
+
* enclosing prompt-line-shell (the events are `composed: true, bubbles: true`, so
|
|
398
|
+
* they reach here from inside the prompt-line's shadow root). Scoping the
|
|
399
|
+
* listener to the shell — rather than `window` — keeps multiple
|
|
400
|
+
* shell/controller pairs on the same page from cross-talking. Renders the
|
|
401
|
+
* built-in `<cds-custom-aichat-autocomplete>` or the active config's
|
|
402
|
+
* `renderCustomList` output. Selection routes back into the originating
|
|
403
|
+
* prompt-line.
|
|
404
|
+
*
|
|
405
|
+
* @element cds-custom-aichat-autocomplete-controller
|
|
406
|
+
* @fires cds-custom-aichat-starter-selected — `{ text: string }` after a starter is
|
|
407
|
+
* inserted into the editor; consumer triggers send.
|
|
408
|
+
*/
|
|
409
|
+
let AutocompleteControllerElement = class AutocompleteControllerElement extends LitElement {
|
|
410
|
+
constructor() {
|
|
411
|
+
super(...arguments);
|
|
412
|
+
/** When true, starter selection inserts text without firing the send event. */
|
|
413
|
+
this.isSendDisabled = false;
|
|
414
|
+
this._state = { trigger: null, items: [] };
|
|
415
|
+
this._controller = null;
|
|
416
|
+
/**
|
|
417
|
+
* Ancestor we subscribed `cds-custom-aichat-trigger-change` on. Scoping the
|
|
418
|
+
* listener to the enclosing `<cds-custom-aichat-prompt-line-shell>` (rather than
|
|
419
|
+
* `window`) keeps a second shell/controller pair on the same page from
|
|
420
|
+
* receiving each other's events.
|
|
421
|
+
*/
|
|
422
|
+
this._eventSource = null;
|
|
423
|
+
this._handleTriggerChange = (event) => {
|
|
424
|
+
this._controller?.handleTriggerChangeEvent(event);
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
// Render in light DOM so consumers' page-level CSS / portals can reach
|
|
428
|
+
// any custom list element they've slotted in via renderCustomList.
|
|
429
|
+
createRenderRoot() {
|
|
430
|
+
return this;
|
|
431
|
+
}
|
|
432
|
+
connectedCallback() {
|
|
433
|
+
super.connectedCallback();
|
|
434
|
+
this._controller = new AutocompleteController({
|
|
435
|
+
mention: this.mention,
|
|
436
|
+
command: this.command,
|
|
437
|
+
autocomplete: this.autocomplete,
|
|
438
|
+
starters: this.starters,
|
|
439
|
+
isSendDisabled: this.isSendDisabled,
|
|
440
|
+
onStarterSelected: (text) => {
|
|
441
|
+
this.dispatchEvent(new CustomEvent("cds-custom-aichat-starter-selected", {
|
|
442
|
+
detail: { text },
|
|
443
|
+
bubbles: true,
|
|
444
|
+
composed: true,
|
|
445
|
+
}));
|
|
446
|
+
},
|
|
447
|
+
onChange: (next) => {
|
|
448
|
+
this._state = next;
|
|
449
|
+
},
|
|
450
|
+
});
|
|
451
|
+
// Scope to the enclosing prompt-line-shell so multiple shell/controller pairs
|
|
452
|
+
// on the same page don't cross-talk. Falls back to `this` if the
|
|
453
|
+
// controller is used outside a shell — in that case the consumer
|
|
454
|
+
// should make sure their prompt-line bubbles events into this element.
|
|
455
|
+
this._eventSource = this.closest("cds-custom-aichat-prompt-line-shell") ?? this;
|
|
456
|
+
this._eventSource.addEventListener("cds-custom-aichat-trigger-change", this._handleTriggerChange);
|
|
457
|
+
}
|
|
458
|
+
disconnectedCallback() {
|
|
459
|
+
this._eventSource?.removeEventListener("cds-custom-aichat-trigger-change", this._handleTriggerChange);
|
|
460
|
+
this._eventSource = null;
|
|
461
|
+
this._controller?.destroy();
|
|
462
|
+
this._controller = null;
|
|
463
|
+
super.disconnectedCallback();
|
|
464
|
+
}
|
|
465
|
+
updated(changed) {
|
|
466
|
+
if (!this._controller) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
if (changed.has("mention") ||
|
|
470
|
+
changed.has("command") ||
|
|
471
|
+
changed.has("autocomplete") ||
|
|
472
|
+
changed.has("starters") ||
|
|
473
|
+
changed.has("isSendDisabled")) {
|
|
474
|
+
this._controller.setConfigs({
|
|
475
|
+
mention: this.mention,
|
|
476
|
+
command: this.command,
|
|
477
|
+
autocomplete: this.autocomplete,
|
|
478
|
+
starters: this.starters,
|
|
479
|
+
isSendDisabled: this.isSendDisabled,
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
// Register the currently-rendered list element with the controller so
|
|
483
|
+
// arrow / Enter / Escape on the editor get forwarded into it.
|
|
484
|
+
const listEl = this.querySelector("cds-custom-aichat-autocomplete") ??
|
|
485
|
+
(this.firstElementChild instanceof HTMLElement
|
|
486
|
+
? this.firstElementChild
|
|
487
|
+
: null);
|
|
488
|
+
this._controller.setListElement(listEl);
|
|
489
|
+
}
|
|
490
|
+
render() {
|
|
491
|
+
const { trigger, items, renderCustomList } = this._state;
|
|
492
|
+
if (!trigger || items.length === 0) {
|
|
493
|
+
return nothing;
|
|
494
|
+
}
|
|
495
|
+
if (renderCustomList) {
|
|
496
|
+
const result = renderCustomList({
|
|
497
|
+
items,
|
|
498
|
+
query: trigger.query,
|
|
499
|
+
onSelect: (item) => this._controller?.select(item),
|
|
500
|
+
onDismiss: () => this._controller?.dismiss(),
|
|
501
|
+
});
|
|
502
|
+
if (result instanceof HTMLElement) {
|
|
503
|
+
return html `${result}`;
|
|
504
|
+
}
|
|
505
|
+
// Custom renderer returned something other than an HTMLElement (e.g.
|
|
506
|
+
// a React node). Surface it on a side-channel event so React adapters
|
|
507
|
+
// can portal it into place themselves.
|
|
508
|
+
this.dispatchEvent(new CustomEvent("cds-custom-aichat-custom-list-render", {
|
|
509
|
+
detail: { reactNode: result },
|
|
510
|
+
bubbles: true,
|
|
511
|
+
composed: true,
|
|
512
|
+
}));
|
|
513
|
+
return nothing;
|
|
514
|
+
}
|
|
515
|
+
return html `
|
|
516
|
+
<cds-custom-aichat-autocomplete
|
|
517
|
+
.items=${items}
|
|
518
|
+
@cds-custom-aichat-autocomplete-select=${(event) => this._controller?.select(event.detail.item)}
|
|
519
|
+
@cds-custom-aichat-autocomplete-dismiss=${() => this._controller?.dismiss()}
|
|
520
|
+
></cds-custom-aichat-autocomplete>
|
|
521
|
+
`;
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
__decorate([
|
|
525
|
+
property({ attribute: false })
|
|
526
|
+
], AutocompleteControllerElement.prototype, "mention", void 0);
|
|
527
|
+
__decorate([
|
|
528
|
+
property({ attribute: false })
|
|
529
|
+
], AutocompleteControllerElement.prototype, "command", void 0);
|
|
530
|
+
__decorate([
|
|
531
|
+
property({ attribute: false })
|
|
532
|
+
], AutocompleteControllerElement.prototype, "autocomplete", void 0);
|
|
533
|
+
__decorate([
|
|
534
|
+
property({ type: Array, attribute: false })
|
|
535
|
+
], AutocompleteControllerElement.prototype, "starters", void 0);
|
|
536
|
+
__decorate([
|
|
537
|
+
property({ type: Boolean, attribute: "is-send-disabled" })
|
|
538
|
+
], AutocompleteControllerElement.prototype, "isSendDisabled", void 0);
|
|
539
|
+
__decorate([
|
|
540
|
+
state()
|
|
541
|
+
], AutocompleteControllerElement.prototype, "_state", void 0);
|
|
542
|
+
AutocompleteControllerElement = __decorate([
|
|
543
|
+
carbonElement(`${prefix}-autocomplete-controller`)
|
|
544
|
+
], AutocompleteControllerElement);
|
|
545
|
+
var AutocompleteControllerElement_default = AutocompleteControllerElement;
|
|
546
|
+
|
|
547
|
+
export { AutocompleteController, AutocompleteControllerElement_default as default };
|
|
548
|
+
//# sourceMappingURL=autocomplete-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autocomplete-controller.js","sources":["../../../../src/components/prompt-line/src/autocomplete-controller.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;AAOG;MAsDU,sBAAsB,CAAA;AA0CjC,IAAA,WAAA,CAAY,OAAsC,EAAA;QAjC1C,IAAA,CAAA,QAAQ,GAAoC,IAAI;QAChD,IAAA,CAAA,MAAM,GAAqB,EAAE;AAErC;;;;AAIG;QACK,IAAA,CAAA,WAAW,GAA6B,IAAI;AAEpD;;;;;AAKG;QACK,IAAA,CAAA,YAAY,GAAuB,IAAI;AAE/C;;;;;AAKG;QACK,IAAA,CAAA,eAAe,GAAuB,IAAI;AAElD;;;AAGG;QACK,IAAA,CAAA,aAAa,GAAG,CAAC;QACjB,IAAA,CAAA,UAAU,GAAG,KAAK;AAkRlB,QAAA,IAAA,CAAA,oBAAoB,GAAG,CAAC,KAAoB,KAAU;AAC5D,YAAA,IACE,KAAK,CAAC,GAAG,KAAK,SAAS;gBACvB,KAAK,CAAC,GAAG,KAAK,WAAW;gBACzB,KAAK,CAAC,GAAG,KAAK,OAAO;AACrB,gBAAA,KAAK,CAAC,GAAG,KAAK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,CAAA,EAAA,6BAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAIlC,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE;AACI,CAAA,EAAA,6BAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAIlC,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE;AACI,CAAA,EAAA,6BAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAIlC,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE;AACf,CAAA,EAAA,6BAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAI5B,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE;AACnC,CAAA,EAAA,6BAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AAGf,UAAA,CAAA;AADP,IAAA,KAAK;AACqE,CAAA,EAAA,6BAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAtBvE,6BAA6B,GAAA,UAAA,CAAA;AADlC,IAAA,aAAa,CAAC,CAAA,EAAG,MAAM,CAAA,wBAAA,CAA0B;AAC5C,CAAA,EAAA,6BAA6B,CA4JlC;AAQD,4CAAe,6BAA6B;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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, PropertyValues, TemplateResult } from "lit";
|
|
10
|
+
import "@carbon/web-components/es-custom/components/icon-button/index.js";
|
|
11
|
+
/**
|
|
12
|
+
* Error message component for AI Chat prompt line.
|
|
13
|
+
*
|
|
14
|
+
* @element cds-custom-aichat-error-message
|
|
15
|
+
*/
|
|
16
|
+
declare class ErrorMessage extends LitElement {
|
|
17
|
+
static styles: import("lit").CSSResult;
|
|
18
|
+
/**
|
|
19
|
+
* The error title text to display.
|
|
20
|
+
*/
|
|
21
|
+
title: string;
|
|
22
|
+
/**
|
|
23
|
+
* The error description text to display.
|
|
24
|
+
*/
|
|
25
|
+
description: string;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the error message is collapsible.
|
|
28
|
+
*/
|
|
29
|
+
collapsible: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the prompt line has alternate layout for expanded mode and/or message actions.
|
|
32
|
+
*/
|
|
33
|
+
actionsLayout: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the error message is in fullscreen layout.
|
|
36
|
+
*/
|
|
37
|
+
fullscreen: boolean;
|
|
38
|
+
protected updated(changedProps: PropertyValues): void;
|
|
39
|
+
/**
|
|
40
|
+
* Toggles the expanded state to show more or less of the error message.
|
|
41
|
+
*/
|
|
42
|
+
private _handleClickExpanded;
|
|
43
|
+
render(): TemplateResult<1>;
|
|
44
|
+
}
|
|
45
|
+
declare global {
|
|
46
|
+
interface HTMLElementTagNameMap {
|
|
47
|
+
"cds-custom-aichat-error-message": ErrorMessage;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export default ErrorMessage;
|