@carbon/ai-chat-components 0.7.0 → 0.7.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/custom-elements.json +1 -1
- package/es/components/code-snippet/src/codemirror/base-setup.js +3 -3
- package/es/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +1 -1
- package/es/components/code-snippet/src/codemirror/codemirror-runtime.js +1 -1
- package/es/components/code-snippet/src/codemirror/content-sync.d.ts +1 -1
- package/es/components/code-snippet/src/codemirror/editor-manager.d.ts +1 -1
- package/es/components/code-snippet/src/codemirror/editor-manager.js +1 -1
- package/es/components/code-snippet/src/codemirror/language-controller.d.ts +1 -1
- package/es/components/code-snippet/src/codemirror/theme.js +1 -1
- package/es-custom/components/card/index.d.ts +11 -0
- package/es-custom/components/card/index.js +11 -0
- package/es-custom/components/card/index.js.map +1 -0
- package/es-custom/components/card/src/card-footer.d.ts +43 -0
- package/es-custom/components/card/src/card-footer.js +141 -0
- package/es-custom/components/card/src/card-footer.js.map +1 -0
- package/es-custom/components/card/src/card-footer.scss.js +13 -0
- package/es-custom/components/card/src/card-footer.scss.js.map +1 -0
- package/es-custom/components/card/src/card-steps.d.ts +28 -0
- package/es-custom/components/card/src/card-steps.js +91 -0
- package/es-custom/components/card/src/card-steps.js.map +1 -0
- package/es-custom/components/card/src/card-steps.scss.js +13 -0
- package/es-custom/components/card/src/card-steps.scss.js.map +1 -0
- package/es-custom/components/card/src/card.d.ts +27 -0
- package/es-custom/components/card/src/card.js +65 -0
- package/es-custom/components/card/src/card.js.map +1 -0
- package/es-custom/components/card/src/card.scss.js +13 -0
- package/es-custom/components/card/src/card.scss.js.map +1 -0
- package/es-custom/components/chain-of-thought/defs.d.ts +54 -0
- package/es-custom/components/chain-of-thought/defs.js +38 -0
- package/es-custom/components/chain-of-thought/defs.js.map +1 -0
- package/es-custom/components/chain-of-thought/index.d.ts +10 -0
- package/es-custom/components/chain-of-thought/index.js +13 -0
- package/es-custom/components/chain-of-thought/index.js.map +1 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.d.ts +43 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js +351 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.scss.js +13 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.scss.js.map +1 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.d.ts +33 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js +107 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js.map +1 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.scss.js +13 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.scss.js.map +1 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought.d.ts +41 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought.js +132 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought.js.map +1 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought.scss.js +13 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought.scss.js.map +1 -0
- package/es-custom/components/chain-of-thought/src/tool-call-data.d.ts +33 -0
- package/es-custom/components/chain-of-thought/src/tool-call-data.js +179 -0
- package/es-custom/components/chain-of-thought/src/tool-call-data.js.map +1 -0
- package/es-custom/components/chain-of-thought/src/tool-call-data.scss.js +13 -0
- package/es-custom/components/chain-of-thought/src/tool-call-data.scss.js.map +1 -0
- package/es-custom/components/chat-button/defs.d.ts +25 -0
- package/es-custom/components/chat-button/defs.js +36 -0
- package/es-custom/components/chat-button/defs.js.map +1 -0
- package/es-custom/components/chat-button/index.d.ts +9 -0
- package/es-custom/components/chat-button/index.js +9 -0
- package/es-custom/components/chat-button/index.js.map +1 -0
- package/es-custom/components/chat-button/src/chat-button.d.ts +40 -0
- package/es-custom/components/chat-button/src/chat-button.js +78 -0
- package/es-custom/components/chat-button/src/chat-button.js.map +1 -0
- package/es-custom/components/chat-button/src/chat-button.scss.js +13 -0
- package/es-custom/components/chat-button/src/chat-button.scss.js.map +1 -0
- package/es-custom/components/code-snippet/index.d.ts +3 -0
- package/es-custom/components/code-snippet/index.js +10 -0
- package/es-custom/components/code-snippet/index.js.map +1 -0
- package/es-custom/components/code-snippet/src/code-snippet-card.d.ts +63 -0
- package/es-custom/components/code-snippet/src/code-snippet-card.js +186 -0
- package/es-custom/components/code-snippet/src/code-snippet-card.js.map +1 -0
- package/es-custom/components/code-snippet/src/code-snippet.d.ts +461 -0
- package/es-custom/components/code-snippet/src/code-snippet.js +678 -0
- package/es-custom/components/code-snippet/src/code-snippet.js.map +1 -0
- package/es-custom/components/code-snippet/src/code-snippet.scss.js +13 -0
- package/es-custom/components/code-snippet/src/code-snippet.scss.js.map +1 -0
- package/es-custom/components/code-snippet/src/codemirror/base-setup.d.ts +12 -0
- package/es-custom/components/code-snippet/src/codemirror/base-setup.js +65 -0
- package/es-custom/components/code-snippet/src/codemirror/base-setup.js.map +1 -0
- package/es-custom/components/code-snippet/src/codemirror/codemirror-loader.d.ts +12 -0
- package/es-custom/components/code-snippet/src/codemirror/codemirror-loader.js +36 -0
- package/es-custom/components/code-snippet/src/codemirror/codemirror-loader.js.map +1 -0
- package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +7 -0
- package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.js +13 -0
- package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.js.map +1 -0
- package/es-custom/components/code-snippet/src/codemirror/content-sync.d.ts +12 -0
- package/es-custom/components/code-snippet/src/codemirror/content-sync.js +72 -0
- package/es-custom/components/code-snippet/src/codemirror/content-sync.js.map +1 -0
- package/es-custom/components/code-snippet/src/codemirror/editor-manager.d.ts +28 -0
- package/es-custom/components/code-snippet/src/codemirror/editor-manager.js +75 -0
- package/es-custom/components/code-snippet/src/codemirror/editor-manager.js.map +1 -0
- package/es-custom/components/code-snippet/src/codemirror/language-controller.d.ts +38 -0
- package/es-custom/components/code-snippet/src/codemirror/language-controller.js +220 -0
- package/es-custom/components/code-snippet/src/codemirror/language-controller.js.map +1 -0
- package/es-custom/components/code-snippet/src/codemirror/language-data.d.ts +6 -0
- package/es-custom/components/code-snippet/src/codemirror/language-data.js +1043 -0
- package/es-custom/components/code-snippet/src/codemirror/language-data.js.map +1 -0
- package/es-custom/components/code-snippet/src/codemirror/language-utils.d.ts +79 -0
- package/es-custom/components/code-snippet/src/codemirror/language-utils.js +219 -0
- package/es-custom/components/code-snippet/src/codemirror/language-utils.js.map +1 -0
- package/es-custom/components/code-snippet/src/codemirror/marker-utils.d.ts +123 -0
- package/es-custom/components/code-snippet/src/codemirror/marker-utils.js +183 -0
- package/es-custom/components/code-snippet/src/codemirror/marker-utils.js.map +1 -0
- package/es-custom/components/code-snippet/src/codemirror/theme.d.ts +54 -0
- package/es-custom/components/code-snippet/src/codemirror/theme.js +320 -0
- package/es-custom/components/code-snippet/src/codemirror/theme.js.map +1 -0
- package/es-custom/components/code-snippet/src/dom-utils.d.ts +24 -0
- package/es-custom/components/code-snippet/src/dom-utils.js +63 -0
- package/es-custom/components/code-snippet/src/dom-utils.js.map +1 -0
- package/es-custom/components/code-snippet/src/formatters.d.ts +4 -0
- package/es-custom/components/code-snippet/src/formatters.js +19 -0
- package/es-custom/components/code-snippet/src/formatters.js.map +1 -0
- package/es-custom/components/code-snippet/src/layout-utils.d.ts +22 -0
- package/es-custom/components/code-snippet/src/layout-utils.js +63 -0
- package/es-custom/components/code-snippet/src/layout-utils.js.map +1 -0
- package/es-custom/components/code-snippet/src/streaming-manager.d.ts +24 -0
- package/es-custom/components/code-snippet/src/streaming-manager.js +120 -0
- package/es-custom/components/code-snippet/src/streaming-manager.js.map +1 -0
- package/es-custom/components/feedback/index.d.ts +4 -0
- package/es-custom/components/feedback/index.js +10 -0
- package/es-custom/components/feedback/index.js.map +1 -0
- package/es-custom/components/feedback/src/feedback-buttons.d.ts +63 -0
- package/es-custom/components/feedback/src/feedback-buttons.js +113 -0
- package/es-custom/components/feedback/src/feedback-buttons.js.map +1 -0
- package/es-custom/components/feedback/src/feedback-buttons.scss.js +13 -0
- package/es-custom/components/feedback/src/feedback-buttons.scss.js.map +1 -0
- package/es-custom/components/feedback/src/feedback-buttons.template.d.ts +4 -0
- package/es-custom/components/feedback/src/feedback-buttons.template.js +79 -0
- package/es-custom/components/feedback/src/feedback-buttons.template.js.map +1 -0
- package/es-custom/components/feedback/src/feedback.d.ts +113 -0
- package/es-custom/components/feedback/src/feedback.js +195 -0
- package/es-custom/components/feedback/src/feedback.js.map +1 -0
- package/es-custom/components/feedback/src/feedback.scss.js +13 -0
- package/es-custom/components/feedback/src/feedback.scss.js.map +1 -0
- package/es-custom/components/feedback/src/feedback.template.d.ts +12 -0
- package/es-custom/components/feedback/src/feedback.template.js +115 -0
- package/es-custom/components/feedback/src/feedback.template.js.map +1 -0
- package/es-custom/components/markdown/index.d.ts +2 -0
- package/es-custom/components/markdown/index.js +9 -0
- package/es-custom/components/markdown/index.js.map +1 -0
- package/es-custom/components/markdown/src/markdown-renderer.d.ts +66 -0
- package/es-custom/components/markdown/src/markdown-renderer.js +359 -0
- package/es-custom/components/markdown/src/markdown-renderer.js.map +1 -0
- package/es-custom/components/markdown/src/markdown-token-tree.d.ts +32 -0
- package/es-custom/components/markdown/src/markdown-token-tree.js +180 -0
- package/es-custom/components/markdown/src/markdown-token-tree.js.map +1 -0
- package/es-custom/components/markdown/src/markdown.d.ts +72 -0
- package/es-custom/components/markdown/src/markdown.js +342 -0
- package/es-custom/components/markdown/src/markdown.js.map +1 -0
- package/es-custom/components/markdown/src/markdown.scss.js +13 -0
- package/es-custom/components/markdown/src/markdown.scss.js.map +1 -0
- package/es-custom/components/markdown/src/markdown.template.d.ts +6 -0
- package/es-custom/components/markdown/src/markdown.template.js +29 -0
- package/es-custom/components/markdown/src/markdown.template.js.map +1 -0
- package/es-custom/components/markdown/src/plugins/markdown-it-attrs.d.ts +7 -0
- package/es-custom/components/markdown/src/plugins/markdown-it-attrs.js +84 -0
- package/es-custom/components/markdown/src/plugins/markdown-it-attrs.js.map +1 -0
- package/es-custom/components/markdown/src/plugins/markdown-it-highlight.d.ts +7 -0
- package/es-custom/components/markdown/src/plugins/markdown-it-highlight.js +59 -0
- package/es-custom/components/markdown/src/plugins/markdown-it-highlight.js.map +1 -0
- package/es-custom/components/markdown/src/plugins/markdown-it-task-lists.d.ts +12 -0
- package/es-custom/components/markdown/src/plugins/markdown-it-task-lists.js +73 -0
- package/es-custom/components/markdown/src/plugins/markdown-it-task-lists.js.map +1 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/core.d.ts +26 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/core.js +330 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/core.js.map +1 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.d.ts +6 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js +63 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js.map +1 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/code.d.ts +6 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/code.js +43 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/code.js.map +1 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/index.d.ts +5 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/index.js +55 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/index.js.map +1 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/inline.d.ts +19 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js +210 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js.map +1 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/lists.d.ts +13 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js +156 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js.map +1 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/tables.d.ts +13 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js +216 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js.map +1 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/types.d.ts +34 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/types.js +8 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/types.js.map +1 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/utils.d.ts +25 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/utils.js +62 -0
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/utils.js.map +1 -0
- package/es-custom/components/markdown/src/utils/html-helpers.d.ts +2 -0
- package/es-custom/components/markdown/src/utils/html-helpers.js +204 -0
- package/es-custom/components/markdown/src/utils/html-helpers.js.map +1 -0
- package/es-custom/components/markdown/src/utils/table-helpers.d.ts +31 -0
- package/es-custom/components/markdown/src/utils/table-helpers.js +106 -0
- package/es-custom/components/markdown/src/utils/table-helpers.js.map +1 -0
- package/es-custom/components/markdown/src/utils.d.ts +8 -0
- package/es-custom/components/markdown/src/utils.js +31 -0
- package/es-custom/components/markdown/src/utils.js.map +1 -0
- package/es-custom/components/processing/index.d.ts +1 -0
- package/es-custom/components/processing/index.js +9 -0
- package/es-custom/components/processing/index.js.map +1 -0
- package/es-custom/components/processing/src/processing.d.ts +16 -0
- package/es-custom/components/processing/src/processing.js +59 -0
- package/es-custom/components/processing/src/processing.js.map +1 -0
- package/es-custom/components/processing/src/processing.scss.js +13 -0
- package/es-custom/components/processing/src/processing.scss.js.map +1 -0
- package/es-custom/components/reasoning-steps/index.d.ts +4 -0
- package/es-custom/components/reasoning-steps/index.js +11 -0
- package/es-custom/components/reasoning-steps/index.js.map +1 -0
- package/es-custom/components/reasoning-steps/src/reasoning-step.d.ts +33 -0
- package/es-custom/components/reasoning-steps/src/reasoning-step.js +251 -0
- package/es-custom/components/reasoning-steps/src/reasoning-step.js.map +1 -0
- package/es-custom/components/reasoning-steps/src/reasoning-step.scss.js +13 -0
- package/es-custom/components/reasoning-steps/src/reasoning-step.scss.js.map +1 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.d.ts +36 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js +81 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js.map +1 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.scss.js +13 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.scss.js.map +1 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.d.ts +3 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.js +43 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.js.map +1 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps.d.ts +19 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps.js +112 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps.js.map +1 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps.scss.js +13 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps.scss.js.map +1 -0
- package/es-custom/components/table/index.d.ts +3 -0
- package/es-custom/components/table/index.js +9 -0
- package/es-custom/components/table/index.js.map +1 -0
- package/es-custom/components/table/src/table-loader.d.ts +4 -0
- package/es-custom/components/table/src/table-loader.js +28 -0
- package/es-custom/components/table/src/table-loader.js.map +1 -0
- package/es-custom/components/table/src/table-pagination.template.d.ts +27 -0
- package/es-custom/components/table/src/table-pagination.template.js +55 -0
- package/es-custom/components/table/src/table-pagination.template.js.map +1 -0
- package/es-custom/components/table/src/table-runtime.d.ts +2 -0
- package/es-custom/components/table/src/table-runtime.js +10 -0
- package/es-custom/components/table/src/table-runtime.js.map +1 -0
- package/es-custom/components/table/src/table-skeleton.template.d.ts +6 -0
- package/es-custom/components/table/src/table-skeleton.template.js +34 -0
- package/es-custom/components/table/src/table-skeleton.template.js.map +1 -0
- package/es-custom/components/table/src/table.d.ts +184 -0
- package/es-custom/components/table/src/table.js +543 -0
- package/es-custom/components/table/src/table.js.map +1 -0
- package/es-custom/components/table/src/table.scss.js +13 -0
- package/es-custom/components/table/src/table.scss.js.map +1 -0
- package/es-custom/components/table/src/table.template.d.ts +10 -0
- package/es-custom/components/table/src/table.template.js +89 -0
- package/es-custom/components/table/src/table.template.js.map +1 -0
- package/es-custom/components/table/src/types.d.ts +13 -0
- package/es-custom/components/table/src/types.js +8 -0
- package/es-custom/components/table/src/types.js.map +1 -0
- package/es-custom/components/toolbar/index.d.ts +1 -0
- package/es-custom/components/toolbar/index.js +9 -0
- package/es-custom/components/toolbar/index.js.map +1 -0
- package/es-custom/components/toolbar/src/toolbar.d.ts +38 -0
- package/es-custom/components/toolbar/src/toolbar.js +191 -0
- package/es-custom/components/toolbar/src/toolbar.js.map +1 -0
- package/es-custom/components/toolbar/src/toolbar.scss.js +13 -0
- package/es-custom/components/toolbar/src/toolbar.scss.js.map +1 -0
- package/es-custom/components/workspace-shell/index.d.ts +4 -0
- package/es-custom/components/workspace-shell/index.js +12 -0
- package/es-custom/components/workspace-shell/index.js.map +1 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-body.d.ts +17 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-body.js +50 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-body.js.map +1 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.d.ts +40 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.js +144 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.js.map +1 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.scss.js +13 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.scss.js.map +1 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-header.d.ts +28 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-header.js +78 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-header.js.map +1 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-header.scss.js +13 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-header.scss.js.map +1 -0
- package/es-custom/components/workspace-shell/src/workspace-shell.d.ts +19 -0
- package/es-custom/components/workspace-shell/src/workspace-shell.js +56 -0
- package/es-custom/components/workspace-shell/src/workspace-shell.js.map +1 -0
- package/es-custom/components/workspace-shell/src/workspace-shell.scss.js +13 -0
- package/es-custom/components/workspace-shell/src/workspace-shell.scss.js.map +1 -0
- package/es-custom/globals/decorators/carbon-element.d.ts +37 -0
- package/es-custom/globals/decorators/carbon-element.js +68 -0
- package/es-custom/globals/decorators/carbon-element.js.map +1 -0
- package/es-custom/globals/decorators/index.d.ts +1 -0
- package/es-custom/globals/decorators/index.js +9 -0
- package/es-custom/globals/decorators/index.js.map +1 -0
- package/es-custom/globals/settings.d.ts +2 -0
- package/es-custom/globals/settings.js +20 -0
- package/es-custom/globals/settings.js.map +1 -0
- package/es-custom/globals/utils/uuid.d.ts +5 -0
- package/es-custom/globals/utils/uuid.js +32 -0
- package/es-custom/globals/utils/uuid.js.map +1 -0
- package/es-custom/node_modules/@carbon/utilities/es/documentLang/documentLang.js +9 -0
- package/es-custom/node_modules/@carbon/utilities/es/documentLang/documentLang.js.map +1 -0
- package/es-custom/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js +11 -0
- package/es-custom/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js.map +1 -0
- package/es-custom/react/ai-label.d.ts +4 -0
- package/es-custom/react/ai-label.js +28 -0
- package/es-custom/react/ai-label.js.map +1 -0
- package/es-custom/react/button.d.ts +6 -0
- package/es-custom/react/button.js +29 -0
- package/es-custom/react/button.js.map +1 -0
- package/es-custom/react/card.d.ts +9 -0
- package/es-custom/react/card.js +43 -0
- package/es-custom/react/card.js.map +1 -0
- package/es-custom/react/chain-of-thought-step.d.ts +4 -0
- package/es-custom/react/chain-of-thought-step.js +32 -0
- package/es-custom/react/chain-of-thought-step.js.map +1 -0
- package/es-custom/react/chain-of-thought-toggle.d.ts +6 -0
- package/es-custom/react/chain-of-thought-toggle.js +31 -0
- package/es-custom/react/chain-of-thought-toggle.js.map +1 -0
- package/es-custom/react/chain-of-thought.d.ts +7 -0
- package/es-custom/react/chain-of-thought.js +33 -0
- package/es-custom/react/chain-of-thought.js.map +1 -0
- package/es-custom/react/chat-button.d.ts +13 -0
- package/es-custom/react/chat-button.js +30 -0
- package/es-custom/react/chat-button.js.map +1 -0
- package/es-custom/react/code-snippet-card.d.ts +4 -0
- package/es-custom/react/code-snippet-card.js +31 -0
- package/es-custom/react/code-snippet-card.js.map +1 -0
- package/es-custom/react/code-snippet.d.ts +4 -0
- package/es-custom/react/code-snippet.js +31 -0
- package/es-custom/react/code-snippet.js.map +1 -0
- package/es-custom/react/content-switcher.d.ts +7 -0
- package/es-custom/react/content-switcher.js +37 -0
- package/es-custom/react/content-switcher.js.map +1 -0
- package/es-custom/react/feedback-buttons.d.ts +4 -0
- package/es-custom/react/feedback-buttons.js +31 -0
- package/es-custom/react/feedback-buttons.js.map +1 -0
- package/es-custom/react/feedback.d.ts +6 -0
- package/es-custom/react/feedback.js +32 -0
- package/es-custom/react/feedback.js.map +1 -0
- package/es-custom/react/icon-button.d.ts +4 -0
- package/es-custom/react/icon-button.js +28 -0
- package/es-custom/react/icon-button.js.map +1 -0
- package/es-custom/react/icon.d.ts +4 -0
- package/es-custom/react/icon.js +28 -0
- package/es-custom/react/icon.js.map +1 -0
- package/es-custom/react/inline-notification.d.ts +4 -0
- package/es-custom/react/inline-notification.js +28 -0
- package/es-custom/react/inline-notification.js.map +1 -0
- package/es-custom/react/markdown.d.ts +4 -0
- package/es-custom/react/markdown.js +28 -0
- package/es-custom/react/markdown.js.map +1 -0
- package/es-custom/react/overflow-menu.d.ts +9 -0
- package/es-custom/react/overflow-menu.js +40 -0
- package/es-custom/react/overflow-menu.js.map +1 -0
- package/es-custom/react/processing.d.ts +4 -0
- package/es-custom/react/processing.js +28 -0
- package/es-custom/react/processing.js.map +1 -0
- package/es-custom/react/reasoning-step.d.ts +4 -0
- package/es-custom/react/reasoning-step.js +32 -0
- package/es-custom/react/reasoning-step.js.map +1 -0
- package/es-custom/react/reasoning-steps-toggle.d.ts +6 -0
- package/es-custom/react/reasoning-steps-toggle.js +31 -0
- package/es-custom/react/reasoning-steps-toggle.js.map +1 -0
- package/es-custom/react/reasoning-steps.d.ts +4 -0
- package/es-custom/react/reasoning-steps.js +28 -0
- package/es-custom/react/reasoning-steps.js.map +1 -0
- package/es-custom/react/tag.d.ts +4 -0
- package/es-custom/react/tag.js +28 -0
- package/es-custom/react/tag.js.map +1 -0
- package/es-custom/react/tile.d.ts +7 -0
- package/es-custom/react/tile.js +34 -0
- package/es-custom/react/tile.js.map +1 -0
- package/es-custom/react/tool-call-data.d.ts +4 -0
- package/es-custom/react/tool-call-data.js +28 -0
- package/es-custom/react/tool-call-data.js.map +1 -0
- package/es-custom/react/toolbar.d.ts +4 -0
- package/es-custom/react/toolbar.js +28 -0
- package/es-custom/react/toolbar.js.map +1 -0
- package/es-custom/react/utils/withWebComponentBridge.d.ts +15 -0
- package/es-custom/react/utils/withWebComponentBridge.js +95 -0
- package/es-custom/react/utils/withWebComponentBridge.js.map +1 -0
- package/es-custom/react/workspace-shell.d.ts +11 -0
- package/es-custom/react/workspace-shell.js +49 -0
- package/es-custom/react/workspace-shell.js.map +1 -0
- package/es-custom/testing/load-all-lazy-deps.d.ts +10 -0
- package/es-custom/testing/load-all-lazy-deps.js +30 -0
- package/es-custom/testing/load-all-lazy-deps.js.map +1 -0
- package/package.json +8 -6
- package/dist/16-C9Ph5740.js +0 -91
- package/dist/16-Dw0Ci4Fd.js +0 -91
- package/dist/16-FH37w-8T.js +0 -91
- package/dist/apl-ugs9-gp6.js +0 -91
- package/dist/asciiarmor-BsIYfA6P.js +0 -91
- package/dist/asn1-HkF5z2_O.js +0 -91
- package/dist/asterisk-CAIjKZq6.js +0 -91
- package/dist/button-Bc3tNCYN.js +0 -157
- package/dist/button-skeleton-DH50p4bH.js +0 -131
- package/dist/carbon-element-C38isbCs.js +0 -91
- package/dist/card.min.js +0 -193
- package/dist/chain-of-thought.min.js +0 -294
- package/dist/chat-button.min.js +0 -107
- package/dist/checkbox-skeleton-CS3inOnf.js +0 -166
- package/dist/class-map-BE4cOc2X.js +0 -128
- package/dist/clike-BIFB3b_k.js +0 -91
- package/dist/clojure-CXNiCqqB.js +0 -91
- package/dist/cmake-CR9NkLsk.js +0 -91
- package/dist/cobol-Ck90O_9v.js +0 -91
- package/dist/code-snippet.min.js +0 -91
- package/dist/codemirror-runtime-D8qZsrKE.js +0 -173
- package/dist/coffeescript-C0nvD2I-.js +0 -91
- package/dist/collection-helpers-BqatNkHh.js +0 -91
- package/dist/commonlisp-BROP4IME.js +0 -91
- package/dist/crystal-D6K96_U-.js +0 -91
- package/dist/css-CdH_tvvW.js +0 -91
- package/dist/cypher-CtHiEXsa.js +0 -91
- package/dist/d-Dcs18F9P.js +0 -91
- package/dist/diff-Bp64yuxL.js +0 -91
- package/dist/dockerfile-1DOwDLks.js +0 -91
- package/dist/dtd-DBKuh-AW.js +0 -91
- package/dist/dylan-ZUYgifRI.js +0 -91
- package/dist/ebnf-CEelJcGq.js +0 -91
- package/dist/ecl-CphVX9Cq.js +0 -91
- package/dist/eiffel-BQPneqZH.js +0 -91
- package/dist/elm-DSPAgqOt.js +0 -91
- package/dist/erlang-D_rMo9WA.js +0 -91
- package/dist/factor-CMTQjKbR.js +0 -91
- package/dist/fcl-BX3Rw6-t.js +0 -91
- package/dist/feedback.min.js +0 -281
- package/dist/forth-BGhjMNd3.js +0 -91
- package/dist/fortran-AEBjaYMh.js +0 -91
- package/dist/gas-DZXAjJGb.js +0 -91
- package/dist/gherkin-DxJx7fVg.js +0 -91
- package/dist/groovy-dfLbXlDy.js +0 -91
- package/dist/haskell-DyZ9y283.js +0 -91
- package/dist/haxe-D47ScCJn.js +0 -91
- package/dist/http-CQ5YdFwi.js +0 -91
- package/dist/icon-button-jLtiwRb4.js +0 -143
- package/dist/icon-loader-BKTEuybf.js +0 -101
- package/dist/idl-DMLd56tu.js +0 -91
- package/dist/if-defined-Dk7gHH6I.js +0 -96
- package/dist/index--CctdwCC.js +0 -91
- package/dist/index--ktPsmev.js +0 -168
- package/dist/index-BHiWR-3B.js +0 -91
- package/dist/index-BI8bnAEd.js +0 -91
- package/dist/index-BbGF94cg.js +0 -91
- package/dist/index-BnQBLEPx.js +0 -91
- package/dist/index-BsUuLdXD.js +0 -91
- package/dist/index-C2xfmTPp.js +0 -91
- package/dist/index-C3BN0MYy.js +0 -91
- package/dist/index-CD4di8Cf.js +0 -91
- package/dist/index-CVyUt3LQ.js +0 -91
- package/dist/index-Cg7m4sg1.js +0 -91
- package/dist/index-ClimwzxW.js +0 -91
- package/dist/index-CrevYuI-.js +0 -91
- package/dist/index-D5kcnwm2.js +0 -91
- package/dist/index-DCbIO0Hl.js +0 -91
- package/dist/index-Db-BDibx.js +0 -91
- package/dist/index-DmpHBiKi.js +0 -91
- package/dist/index-DzPjFlOn.js +0 -91
- package/dist/index-MgVf_8OP.js +0 -91
- package/dist/index-WHfhssUV.js +0 -91
- package/dist/index-rdaURAlB.js +0 -91
- package/dist/index-tFrMu4B_.js +0 -278
- package/dist/index-yLnmvqXN.js +0 -91
- package/dist/javascript-CB_5CYW7.js +0 -91
- package/dist/julia-DmOIk9mc.js +0 -91
- package/dist/livescript-BkgLC0lL.js +0 -91
- package/dist/loading-icon-CmnM4I_H.js +0 -106
- package/dist/lua-CWM_r9JC.js +0 -91
- package/dist/markdown.min.js +0 -298
- package/dist/mathematica-BSatVfC1.js +0 -91
- package/dist/mbox-4am1R8hd.js +0 -91
- package/dist/mirc-pdtTGW9l.js +0 -91
- package/dist/mllike-C0YFsE1U.js +0 -91
- package/dist/modelica-DVTWSHR-.js +0 -91
- package/dist/mscgen-ByAgrjGx.js +0 -91
- package/dist/mumps-X97p0_h_.js +0 -91
- package/dist/nginx-CqUadVPT.js +0 -91
- package/dist/nsis-Urp7BrWk.js +0 -91
- package/dist/ntriples-CToxeTsT.js +0 -91
- package/dist/octave-Dc4mpp8A.js +0 -91
- package/dist/oz-DX2Pk_mI.js +0 -91
- package/dist/pascal-B9GL_nqz.js +0 -91
- package/dist/perl-BvZFpXKD.js +0 -91
- package/dist/pig-BxFxDHBk.js +0 -91
- package/dist/powershell-CwCLRM7O.js +0 -91
- package/dist/processing.min.js +0 -105
- package/dist/properties-3nFD-Vnh.js +0 -91
- package/dist/protobuf-RqEyuWlw.js +0 -91
- package/dist/pug-1L6dEUb3.js +0 -91
- package/dist/puppet-C-gxR1ON.js +0 -91
- package/dist/python-BSbm1-vO.js +0 -91
- package/dist/q-4yAbTbi2.js +0 -91
- package/dist/r-BxfoMXlJ.js +0 -91
- package/dist/reasoning-steps.min.js +0 -202
- package/dist/rpm-DOp6MTEb.js +0 -91
- package/dist/ruby-DD6QCAKT.js +0 -91
- package/dist/sas-Cb-4sFOe.js +0 -91
- package/dist/scheme-CZsCl8E_.js +0 -91
- package/dist/settings-e2aItLYn.js +0 -99
- package/dist/shell-Bba6ETw_.js +0 -91
- package/dist/sieve-DZz1QovM.js +0 -91
- package/dist/simple-mode-DAyX7kcU.js +0 -91
- package/dist/smalltalk-BVigbKw-.js +0 -91
- package/dist/solr-BRh8QRgo.js +0 -91
- package/dist/sparql-DPq9GGqu.js +0 -91
- package/dist/spreadsheet-DWXWohNi.js +0 -91
- package/dist/sql-HgNux1Fi.js +0 -91
- package/dist/state-Bv4FM_9B.js +0 -96
- package/dist/stex-DB306cTl.js +0 -91
- package/dist/stylus-BVbE3BhF.js +0 -91
- package/dist/swift-k2z0otOi.js +0 -91
- package/dist/sync-D3qEZKNY.js +0 -91
- package/dist/table-runtime-Q-ak_IZE.js +0 -510
- package/dist/table.min.js +0 -91
- package/dist/tcl-BJwoeXra.js +0 -91
- package/dist/text-input-BlCqTf_p.js +0 -158
- package/dist/textile-9DAvWy-Y.js +0 -91
- package/dist/throttle-Bst9TagJ.js +0 -91
- package/dist/tiddlywiki-CDJdAycW.js +0 -91
- package/dist/tiki-Dlg5DFIR.js +0 -91
- package/dist/toml-DGqt7oU6.js +0 -91
- package/dist/toolbar.min.js +0 -178
- package/dist/troff-xJv1Y_X_.js +0 -91
- package/dist/ttcn-cfg-CrKiCUlI.js +0 -91
- package/dist/ttcn-dBogkyiy.js +0 -91
- package/dist/turtle-qtDt5E0f.js +0 -91
- package/dist/vb-h5NatM2n.js +0 -91
- package/dist/vbscript-BnXXn72l.js +0 -91
- package/dist/velocity-C_ZqzMiT.js +0 -91
- package/dist/verilog-s8oM517K.js +0 -91
- package/dist/vhdl-BgZd0MBH.js +0 -91
- package/dist/webidl-CDRn4bGa.js +0 -91
- package/dist/workspace-shell.min.js +0 -157
- package/dist/xquery-DTfjYCD7.js +0 -91
- package/dist/yacas-DxV9-gAO.js +0 -91
- package/dist/z80-PFwavMao.js +0 -91
- package/es/node_modules/@codemirror/autocomplete/dist/index.js +0 -258
- package/es/node_modules/@codemirror/autocomplete/dist/index.js.map +0 -1
- package/es/node_modules/@codemirror/commands/dist/index.js +0 -1140
- package/es/node_modules/@codemirror/commands/dist/index.js.map +0 -1
- package/es/node_modules/@codemirror/lint/dist/index.js +0 -636
- package/es/node_modules/@codemirror/lint/dist/index.js.map +0 -1
- package/es/node_modules/@lezer/common/dist/index.js +0 -253
- package/es/node_modules/@lezer/common/dist/index.js.map +0 -1
- package/es/node_modules/crelt/index.js +0 -37
- package/es/node_modules/crelt/index.js.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
/*
|
|
9
|
+
* Copyright IBM Corp. 2025
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*
|
|
14
|
+
* @license
|
|
15
|
+
*/
|
|
16
|
+
const defaultLineCountText = ({ count }) => `${count} lines`;
|
|
17
|
+
|
|
18
|
+
export { defaultLineCountText };
|
|
19
|
+
//# sourceMappingURL=formatters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.js","sources":["../../../../src/components/code-snippet/src/formatters.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AAOG;AAII,MAAM,oBAAoB,GAAuB,CAAC,EAAE,KAAK,EAAE,KAChE,CAAA,EAAG,KAAK;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface ContainerStyleConfig {
|
|
2
|
+
expanded: boolean;
|
|
3
|
+
maxCollapsed: number;
|
|
4
|
+
maxExpanded: number;
|
|
5
|
+
minCollapsed: number;
|
|
6
|
+
minExpanded: number;
|
|
7
|
+
rowHeight: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildContainerStyles({ expanded, maxCollapsed, maxExpanded, minCollapsed, minExpanded, rowHeight, }: ContainerStyleConfig): string;
|
|
10
|
+
interface ShowMoreEvaluationInput {
|
|
11
|
+
shadowRoot: ShadowRoot | null;
|
|
12
|
+
rowHeight: number;
|
|
13
|
+
expanded: boolean;
|
|
14
|
+
maxCollapsed: number;
|
|
15
|
+
maxExpanded: number;
|
|
16
|
+
minExpanded: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function evaluateShowMoreButton({ shadowRoot, rowHeight, expanded, maxCollapsed, maxExpanded, minExpanded, }: ShowMoreEvaluationInput): {
|
|
19
|
+
shouldShowButton: boolean;
|
|
20
|
+
shouldCollapse: boolean;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
/*
|
|
9
|
+
* Copyright IBM Corp. 2025
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*
|
|
14
|
+
* @license
|
|
15
|
+
*/
|
|
16
|
+
function buildContainerStyles({ expanded, maxCollapsed, maxExpanded, minCollapsed, minExpanded, rowHeight, }) {
|
|
17
|
+
const styles = [];
|
|
18
|
+
if (expanded) {
|
|
19
|
+
if (maxExpanded > 0) {
|
|
20
|
+
const maxHeight = `${maxExpanded * rowHeight}px`;
|
|
21
|
+
styles.push(`max-height: ${maxHeight}`);
|
|
22
|
+
styles.push(`--cds-custom-snippet-max-height: ${maxHeight}`);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
// Remove the default CodeMirror max height so expanded snippets can grow to fit content
|
|
26
|
+
styles.push(`max-height: none`);
|
|
27
|
+
styles.push(`--cds-custom-snippet-max-height: none`);
|
|
28
|
+
}
|
|
29
|
+
if (minExpanded > 0) {
|
|
30
|
+
const minHeight = `${minExpanded * rowHeight}px`;
|
|
31
|
+
styles.push(`min-height: ${minHeight}`);
|
|
32
|
+
styles.push(`--cds-custom-snippet-min-height: ${minHeight}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
if (maxCollapsed > 0) {
|
|
37
|
+
const maxHeight = `${maxCollapsed * rowHeight}px`;
|
|
38
|
+
styles.push(`max-height: ${maxHeight}`);
|
|
39
|
+
styles.push(`--cds-custom-snippet-max-height: ${maxHeight}`);
|
|
40
|
+
}
|
|
41
|
+
if (minCollapsed > 0) {
|
|
42
|
+
const minHeight = `${minCollapsed * rowHeight}px`;
|
|
43
|
+
styles.push(`min-height: ${minHeight}`);
|
|
44
|
+
styles.push(`--cds-custom-snippet-min-height: ${minHeight}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return styles.join("; ");
|
|
48
|
+
}
|
|
49
|
+
function evaluateShowMoreButton({ shadowRoot, rowHeight, expanded, maxCollapsed, maxExpanded, minExpanded, }) {
|
|
50
|
+
const editorNode = shadowRoot?.querySelector(`.cm-content`);
|
|
51
|
+
if (!editorNode) {
|
|
52
|
+
return { shouldShowButton: false, shouldCollapse: false };
|
|
53
|
+
}
|
|
54
|
+
const { height } = editorNode.getBoundingClientRect();
|
|
55
|
+
const shouldShowButton = maxCollapsed > 0 &&
|
|
56
|
+
(maxExpanded <= 0 || maxExpanded > maxCollapsed) &&
|
|
57
|
+
height > maxCollapsed * rowHeight;
|
|
58
|
+
const shouldCollapse = expanded && minExpanded > 0 && height <= minExpanded * rowHeight;
|
|
59
|
+
return { shouldShowButton, shouldCollapse };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { buildContainerStyles, evaluateShowMoreButton };
|
|
63
|
+
//# sourceMappingURL=layout-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-utils.js","sources":["../../../../src/components/code-snippet/src/layout-utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AAOG;AAWG,SAAU,oBAAoB,CAAC,EACnC,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,WAAW,EACX,SAAS,GACY,EAAA;IACrB,MAAM,MAAM,GAAa,EAAE;IAE3B,IAAI,QAAQ,EAAE;AACZ,QAAA,IAAI,WAAW,GAAG,CAAC,EAAE;AACnB,YAAA,MAAM,SAAS,GAAG,CAAA,EAAG,WAAW,GAAG,SAAS,IAAI;AAChD,YAAA,MAAM,CAAC,IAAI,CAAC,eAAe,SAAS,CAAA,CAAE,C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,CAAC,UAAU,EAAE;QACf,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE;IAC3D;IAEA,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,qBAAqB,EAAE;AAErD,IAAA,MAAM,gBAAgB,GACpB,YAAY,GAAG,CAAC;AAChB,SAAC,WAAW,IAAI,CAAC,IAAI,WAAW,GAAG,YAAY,CAAC;AAChD,QAAA,MAAM,GAAG,YAAY,GAAG,SAAS;AAEnC,IAAA,MAAM,cAAc,GAClB,QAAQ,IAAI,WAAW,GAAG,CAAC,IAAI,MAAM,IAAI,WAAW,GAAG,SAAS;AAElE,IAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE;AAC7C;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface StreamingManagerConfig {
|
|
2
|
+
getSlot(): HTMLSlotElement | null | undefined;
|
|
3
|
+
getHost(): Element;
|
|
4
|
+
onContentUpdate(content: string): void;
|
|
5
|
+
}
|
|
6
|
+
export declare class StreamingManager {
|
|
7
|
+
private readonly config;
|
|
8
|
+
private observer;
|
|
9
|
+
private pendingFrame;
|
|
10
|
+
private hasExtractedInitial;
|
|
11
|
+
private cachedContent;
|
|
12
|
+
constructor(config: StreamingManagerConfig);
|
|
13
|
+
reset(initialContent?: string): void;
|
|
14
|
+
connect(): void;
|
|
15
|
+
disconnect(): void;
|
|
16
|
+
dispose(): void;
|
|
17
|
+
ensureInitialContent(): void;
|
|
18
|
+
handleSlotChange(): void;
|
|
19
|
+
syncSlotObservers(): void;
|
|
20
|
+
private observeAssignedNodes;
|
|
21
|
+
private handleMutations;
|
|
22
|
+
private extractContent;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
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 { extractSlotContent, extractTextContent } from './dom-utils.js';
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Copyright IBM Corp. 2025
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*
|
|
16
|
+
* @license
|
|
17
|
+
*/
|
|
18
|
+
class StreamingManager {
|
|
19
|
+
constructor(config) {
|
|
20
|
+
this.config = config;
|
|
21
|
+
this.observer = null;
|
|
22
|
+
this.pendingFrame = null;
|
|
23
|
+
this.hasExtractedInitial = false;
|
|
24
|
+
this.cachedContent = "";
|
|
25
|
+
}
|
|
26
|
+
reset(initialContent) {
|
|
27
|
+
this.hasExtractedInitial = false;
|
|
28
|
+
if (typeof initialContent === "string") {
|
|
29
|
+
this.cachedContent = initialContent;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
connect() {
|
|
33
|
+
if (!this.observer) {
|
|
34
|
+
this.observer = new MutationObserver(() => {
|
|
35
|
+
this.handleMutations();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
this.observeAssignedNodes();
|
|
39
|
+
}
|
|
40
|
+
disconnect() {
|
|
41
|
+
if (this.observer) {
|
|
42
|
+
this.observer.disconnect();
|
|
43
|
+
}
|
|
44
|
+
if (this.pendingFrame !== null) {
|
|
45
|
+
cancelAnimationFrame(this.pendingFrame);
|
|
46
|
+
this.pendingFrame = null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
dispose() {
|
|
50
|
+
this.disconnect();
|
|
51
|
+
this.observer = null;
|
|
52
|
+
}
|
|
53
|
+
ensureInitialContent() {
|
|
54
|
+
if (this.hasExtractedInitial) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this.extractContent();
|
|
58
|
+
this.hasExtractedInitial = true;
|
|
59
|
+
}
|
|
60
|
+
handleSlotChange() {
|
|
61
|
+
this.observeAssignedNodes();
|
|
62
|
+
this.extractContent();
|
|
63
|
+
}
|
|
64
|
+
syncSlotObservers() {
|
|
65
|
+
this.observeAssignedNodes();
|
|
66
|
+
}
|
|
67
|
+
observeAssignedNodes() {
|
|
68
|
+
if (!this.observer) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const slot = this.config.getSlot();
|
|
72
|
+
if (!slot) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.observer.disconnect();
|
|
76
|
+
const assignedNodes = slot.assignedNodes({ flatten: true });
|
|
77
|
+
if (!assignedNodes.length) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
for (const node of assignedNodes) {
|
|
81
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
82
|
+
this.observer.observe(node, {
|
|
83
|
+
characterData: true,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
this.observer.observe(node, {
|
|
88
|
+
characterData: true,
|
|
89
|
+
subtree: true,
|
|
90
|
+
childList: true,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
handleMutations() {
|
|
96
|
+
if (this.pendingFrame !== null) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this.pendingFrame = requestAnimationFrame(() => {
|
|
100
|
+
this.pendingFrame = null;
|
|
101
|
+
this.extractContent();
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
extractContent() {
|
|
105
|
+
const slot = this.config.getSlot();
|
|
106
|
+
const host = this.config.getHost();
|
|
107
|
+
const rawContent = slot
|
|
108
|
+
? extractSlotContent(slot)
|
|
109
|
+
: extractTextContent(host);
|
|
110
|
+
const normalized = rawContent.replace(/\r\n/g, "\n").trim();
|
|
111
|
+
if (normalized === this.cachedContent) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
this.cachedContent = normalized;
|
|
115
|
+
this.config.onContentUpdate(normalized);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { StreamingManager };
|
|
120
|
+
//# sourceMappingURL=streaming-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streaming-manager.js","sources":["../../../../src/components/code-snippet/src/streaming-manager.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;AAOG;MAUU,gBAAgB,CAAA;AAM3B,IAAA,WAAA,CAA6B,MAA8B,EAAA;QAA9B,IAAA,CAAA,MAAM,GAAN,MAAM;QAL3B,IAAA,CAAA,QAAQ,GAA4B,IAAI;QACxC,IAAA,CAAA,YAAY,GAAkB,IAAI;QAClC,IAAA,CAAA,mBAAmB,GAAG,KAAK;QAC3B,IAAA,CAAA,aAAa,GAAG,EAAE;IAEoC;AAE9D,IAAA,KAAK,CAAC,cAAuB,EAAA;AAC3B,QAAA,IAAI,CAAC,mBAAmB,GAAG,KAAK;AAChC,QAAA,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;AACtC,YAAA,IAAI,CAAC,aAAa,GAAG,cAAc;QACrC;IACF;IAEA,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAClB,YAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,MAAK;gBACxC,IAAI,CAAC,eAAe,EAAE;AACxB,YAAA,CAAC,CAAC;QACJ;QACA,IAAI,CAAC,oBAAoB,EAAE;IAC7B;IAEA,UAAU,GAAA;AACR,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;AACjB,YAAA,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;QAC5B;AACA,QAAA,IAAI,IAAI,CAAC,YAAY,KAAK,IAAI,EAAE;AAC9B,YAAA,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC;AACvC,YAAA,IAAI,CAAC,YAAY,GAAG,IAAI;QAC1B;IACF;IAEA,OAAO,GA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I,IAAI,CAAC,YAAY,KAAK,IAAI,EAAE;YAC9B;QACF;AAEA,QAAA,IAAI,CAAC,YAAY,GAAG,qBAAqB,CAAC,MAAK;AAC7C,YAAA,IAAI,CAAC,YAAY,GAAG,IAAI;YACxB,IAAI,CAAC,cAAc,EAAE;AACvB,QAAA,CAAC,CAAC;IACJ;IAEQ,cAAc,GAAA;QACpB,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;QAClC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;QAElC,MAAM,UAAU,GAAG;AACjB,cAAE,kBAAkB,CAAC,IAAI;AACzB,cAAE,kBAAkB,CAAC,IAAI,CAAC;AAC5B,QAAA,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE;AAE3D,QAAA,IAAI,UAAU,KAAK,IAAI,CAAC,aAAa,EAAE;YACrC;QACF;AAEA,QAAA,IAAI,CAAC,aAAa,GAAG,UAAU;AAC/B,QAAA,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC;IACzC;AACD;;;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "./src/feedback.js";
|
|
2
|
+
import "./src/feedback-buttons.js";
|
|
3
|
+
export { CDSAIChatFeedback, type FeedbackInitialValues, type FeedbackSubmitDetails, } from "./src/feedback.js";
|
|
4
|
+
export { CDSAIChatFeedbackButtons, type FeedbackButtonsClickEventDetail, } from "./src/feedback-buttons.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export { CDSAIChatFeedback } from './src/feedback.js';
|
|
9
|
+
export { CDSAIChatFeedbackButtons } from './src/feedback-buttons.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
declare class CDSAIChatFeedbackButtons extends LitElement {
|
|
3
|
+
static styles: any;
|
|
4
|
+
/**
|
|
5
|
+
* Indicates if the details panel for the positive feedback is open.
|
|
6
|
+
*/
|
|
7
|
+
isPositiveOpen: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Indicates if the details panel for the negative feedback is open.
|
|
10
|
+
*/
|
|
11
|
+
isNegativeOpen: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Indicates if the positive feedback button should shown as selected.
|
|
14
|
+
*/
|
|
15
|
+
isPositiveSelected: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Indicates if the positive feedback button will be used to show or hide a details panel.
|
|
18
|
+
*/
|
|
19
|
+
hasPositiveDetails: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Indicates if the negative feedback button will be used to show or hide a details panel.
|
|
22
|
+
*/
|
|
23
|
+
hasNegativeDetails: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Indicates if the positive feedback button should shown as selected.
|
|
26
|
+
*/
|
|
27
|
+
isNegativeSelected: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Indicates if the positive feedback button should shown as disabled.
|
|
30
|
+
*/
|
|
31
|
+
isPositiveDisabled: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Indicates if the negative feedback button should shown as disabled.
|
|
34
|
+
*/
|
|
35
|
+
isNegativeDisabled: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The label for the positive button.
|
|
38
|
+
*/
|
|
39
|
+
positiveLabel?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The label for the negative button.
|
|
42
|
+
*/
|
|
43
|
+
negativeLabel?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The unique ID of the panel that is used for showing details.
|
|
46
|
+
*/
|
|
47
|
+
panelID?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Dispatches an event notifying listeners that a button has been clicked.
|
|
50
|
+
*/
|
|
51
|
+
handleButtonClick(isPositive: boolean): void;
|
|
52
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
53
|
+
}
|
|
54
|
+
interface FeedbackButtonsClickEventDetail {
|
|
55
|
+
isPositive: boolean;
|
|
56
|
+
}
|
|
57
|
+
declare global {
|
|
58
|
+
interface HTMLElementTagNameMap {
|
|
59
|
+
"cds-aichat-feedback-buttons": CDSAIChatFeedbackButtons;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export { CDSAIChatFeedbackButtons, type FeedbackButtonsClickEventDetail };
|
|
63
|
+
export default CDSAIChatFeedbackButtons;
|
|
@@ -0,0 +1,113 @@
|
|
|
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 } from 'lit';
|
|
10
|
+
import { property } from 'lit/decorators.js';
|
|
11
|
+
import { carbonElement } from '../../../globals/decorators/carbon-element.js';
|
|
12
|
+
import { feedbackButtonsElementTemplate } from './feedback-buttons.template.js';
|
|
13
|
+
import styles from './feedback-buttons.scss.js';
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
* Copyright IBM Corp. 2025
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
19
|
+
* LICENSE file in the root directory of this source tree.
|
|
20
|
+
*
|
|
21
|
+
* @license
|
|
22
|
+
*/
|
|
23
|
+
let CDSAIChatFeedbackButtons = class CDSAIChatFeedbackButtons extends LitElement {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
/**
|
|
27
|
+
* Indicates if the details panel for the positive feedback is open.
|
|
28
|
+
*/
|
|
29
|
+
this.isPositiveOpen = false;
|
|
30
|
+
/**
|
|
31
|
+
* Indicates if the details panel for the negative feedback is open.
|
|
32
|
+
*/
|
|
33
|
+
this.isNegativeOpen = false;
|
|
34
|
+
/**
|
|
35
|
+
* Indicates if the positive feedback button should shown as selected.
|
|
36
|
+
*/
|
|
37
|
+
this.isPositiveSelected = false;
|
|
38
|
+
/**
|
|
39
|
+
* Indicates if the positive feedback button will be used to show or hide a details panel.
|
|
40
|
+
*/
|
|
41
|
+
this.hasPositiveDetails = false;
|
|
42
|
+
/**
|
|
43
|
+
* Indicates if the negative feedback button will be used to show or hide a details panel.
|
|
44
|
+
*/
|
|
45
|
+
this.hasNegativeDetails = false;
|
|
46
|
+
/**
|
|
47
|
+
* Indicates if the positive feedback button should shown as selected.
|
|
48
|
+
*/
|
|
49
|
+
this.isNegativeSelected = false;
|
|
50
|
+
/**
|
|
51
|
+
* Indicates if the positive feedback button should shown as disabled.
|
|
52
|
+
*/
|
|
53
|
+
this.isPositiveDisabled = false;
|
|
54
|
+
/**
|
|
55
|
+
* Indicates if the negative feedback button should shown as disabled.
|
|
56
|
+
*/
|
|
57
|
+
this.isNegativeDisabled = false;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Dispatches an event notifying listeners that a button has been clicked.
|
|
61
|
+
*/
|
|
62
|
+
handleButtonClick(isPositive) {
|
|
63
|
+
this.dispatchEvent(new CustomEvent("feedback-buttons-click", {
|
|
64
|
+
detail: { isPositive },
|
|
65
|
+
bubbles: true,
|
|
66
|
+
composed: true,
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
render() {
|
|
70
|
+
return feedbackButtonsElementTemplate(this);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
CDSAIChatFeedbackButtons.styles = styles;
|
|
74
|
+
__decorate([
|
|
75
|
+
property({ type: Boolean, attribute: "is-positive-open", reflect: true })
|
|
76
|
+
], CDSAIChatFeedbackButtons.prototype, "isPositiveOpen", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
property({ type: Boolean, attribute: "is-negative-open", reflect: true })
|
|
79
|
+
], CDSAIChatFeedbackButtons.prototype, "isNegativeOpen", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
property({ type: Boolean, attribute: "is-positive-selected", reflect: true })
|
|
82
|
+
], CDSAIChatFeedbackButtons.prototype, "isPositiveSelected", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
property({ type: Boolean, attribute: "has-positive-details", reflect: true })
|
|
85
|
+
], CDSAIChatFeedbackButtons.prototype, "hasPositiveDetails", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
property({ type: Boolean, attribute: "has-negative-details", reflect: true })
|
|
88
|
+
], CDSAIChatFeedbackButtons.prototype, "hasNegativeDetails", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
property({ type: Boolean, attribute: "is-negative-selected", reflect: true })
|
|
91
|
+
], CDSAIChatFeedbackButtons.prototype, "isNegativeSelected", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
property({ type: Boolean, attribute: "is-positive-disabled", reflect: true })
|
|
94
|
+
], CDSAIChatFeedbackButtons.prototype, "isPositiveDisabled", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
property({ type: Boolean, attribute: "is-negative-disabled", reflect: true })
|
|
97
|
+
], CDSAIChatFeedbackButtons.prototype, "isNegativeDisabled", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
property({ type: String, attribute: "positive-label", reflect: true })
|
|
100
|
+
], CDSAIChatFeedbackButtons.prototype, "positiveLabel", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
property({ type: String, attribute: "negative-label", reflect: true })
|
|
103
|
+
], CDSAIChatFeedbackButtons.prototype, "negativeLabel", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
property({ type: String, attribute: "panel-id", reflect: true })
|
|
106
|
+
], CDSAIChatFeedbackButtons.prototype, "panelID", void 0);
|
|
107
|
+
CDSAIChatFeedbackButtons = __decorate([
|
|
108
|
+
carbonElement("cds-aichat-feedback-buttons")
|
|
109
|
+
], CDSAIChatFeedbackButtons);
|
|
110
|
+
var CDSAIChatFeedbackButtons$1 = CDSAIChatFeedbackButtons;
|
|
111
|
+
|
|
112
|
+
export { CDSAIChatFeedbackButtons, CDSAIChatFeedbackButtons$1 as default };
|
|
113
|
+
//# sourceMappingURL=feedback-buttons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-buttons.js","sources":["../../../../src/components/feedback/src/feedback-buttons.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;AAOG;AAUH,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,UAAU,CAAA;AAAjD,IAAA,WAAA,GAAA;;AAGE;;AAEG;QAEH,IAAA,CAAA,cAAc,GAAG,KAAK;AAEtB;;AAEG;QAEH,IAAA,CAAA,cAAc,GAAG,KAAK;AAEtB;;AAEG;QAEH,IAAA,CAAA,kBAAkB,GAAG,KAAK;AAE1B;;AAEG;QAEH,IAAA,CAAA,kBAAkB,GAAG,KAAK;AAE1B;;AAEG;QAEH,IAAA,CAAA,kBAAkB,GAAG,KAAK;AAE1B;;AAEG;QAEH,IAAA,CAAA,kBAAkB,GAAG,KAAK;AAE1B;;AAEG;QAEH,IAAA,CAAA,kBAAkB,GAAG,KAAK;AAE1B;;AAEG;QAEH,IAAA,CAAA,kBAAkB,GAAG,KAAK;IAuC5B;AAnBE;;AAEG;AACH,IAAA,iBAAiB,CAAC,UAAmB,EAAA;AACnC,QAAA,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CACb,wBAAwB,EACxB;YACE,MAAM,EAAE,EAAE,UAAU,EAAE;AACtB,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA,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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 { css } from 'lit';
|
|
9
|
+
|
|
10
|
+
var styles = css([".cds-aichat--feedback-buttons{display:flex;margin-block-start:.5rem}"]);
|
|
11
|
+
|
|
12
|
+
export { styles as default };
|
|
13
|
+
//# sourceMappingURL=feedback-buttons.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-buttons.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@carbon/web-components/es-custom/components/icon-button/index.js";
|
|
2
|
+
import { CDSAIChatFeedbackButtons } from "./feedback-buttons.js";
|
|
3
|
+
declare function feedbackButtonsElementTemplate(customElementClass: CDSAIChatFeedbackButtons): import("lit-html").TemplateResult<1>;
|
|
4
|
+
export { feedbackButtonsElementTemplate };
|
|
@@ -0,0 +1,79 @@
|
|
|
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 '@carbon/web-components/es-custom/components/icon-button/index.js';
|
|
9
|
+
import { iconLoader } from '@carbon/web-components/es-custom/globals/internal/icon-loader.js';
|
|
10
|
+
import ThumbsDown16 from '@carbon/icons/es/thumbs-down/16.js';
|
|
11
|
+
import ThumbsDownFilled16 from '@carbon/icons/es/thumbs-down--filled/16.js';
|
|
12
|
+
import ThumbsUp16 from '@carbon/icons/es/thumbs-up/16.js';
|
|
13
|
+
import ThumbsUpFilled16 from '@carbon/icons/es/thumbs-up--filled/16.js';
|
|
14
|
+
import { nothing, html } from 'lit';
|
|
15
|
+
import prefix from '../../../globals/settings.js';
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* Copyright IBM Corp. 2025
|
|
19
|
+
*
|
|
20
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
21
|
+
* LICENSE file in the root directory of this source tree.
|
|
22
|
+
*
|
|
23
|
+
* @license
|
|
24
|
+
*/
|
|
25
|
+
const DEFAULT_POSITIVE_LABEL = "Good response";
|
|
26
|
+
const DEFAULT_NEGATIVE_LABEL = "Bad response";
|
|
27
|
+
function feedbackButtonsElementTemplate(customElementClass) {
|
|
28
|
+
const { isPositiveOpen, isNegativeOpen, isPositiveSelected, isNegativeSelected, hasPositiveDetails, hasNegativeDetails, isPositiveDisabled, isNegativeDisabled, positiveLabel, negativeLabel, panelID, } = customElementClass;
|
|
29
|
+
const handleButtonClick = (isPositive) => {
|
|
30
|
+
customElementClass.handleButtonClick?.call(customElementClass, isPositive);
|
|
31
|
+
};
|
|
32
|
+
return html `<div class="${prefix}--feedback-buttons">
|
|
33
|
+
<cds-custom-icon-button
|
|
34
|
+
class="${prefix}--feedback-buttons-positive"
|
|
35
|
+
size="sm"
|
|
36
|
+
align="top-left"
|
|
37
|
+
kind="ghost"
|
|
38
|
+
role="button"
|
|
39
|
+
?disabled=${isPositiveDisabled}
|
|
40
|
+
aria-expanded="${isPositiveDisabled || !hasPositiveDetails
|
|
41
|
+
? nothing
|
|
42
|
+
: isPositiveOpen}"
|
|
43
|
+
aria-pressed="${isPositiveSelected || nothing}"
|
|
44
|
+
aria-controls="${panelID}-feedback-positive"
|
|
45
|
+
@click="${() => handleButtonClick(true)}"
|
|
46
|
+
>
|
|
47
|
+
<span slot="icon"
|
|
48
|
+
>${iconLoader(isPositiveSelected ? ThumbsUpFilled16 : ThumbsUp16)}</span
|
|
49
|
+
>
|
|
50
|
+
<span slot="tooltip-content"
|
|
51
|
+
>${positiveLabel || DEFAULT_POSITIVE_LABEL}</span
|
|
52
|
+
>
|
|
53
|
+
</cds-custom-icon-button>
|
|
54
|
+
<cds-custom-icon-button
|
|
55
|
+
class="${prefix}--feedback-buttons-negative"
|
|
56
|
+
size="sm"
|
|
57
|
+
align="top-left"
|
|
58
|
+
kind="ghost"
|
|
59
|
+
role="button"
|
|
60
|
+
?disabled=${isNegativeDisabled}
|
|
61
|
+
aria-expanded="${isNegativeDisabled || !hasNegativeDetails
|
|
62
|
+
? nothing
|
|
63
|
+
: isNegativeOpen}"
|
|
64
|
+
aria-pressed="${isNegativeSelected || nothing}"
|
|
65
|
+
aria-controls="${panelID}-feedback-negative"
|
|
66
|
+
@click="${() => handleButtonClick(false)}"
|
|
67
|
+
>
|
|
68
|
+
<span slot="icon"
|
|
69
|
+
>${iconLoader(isNegativeSelected ? ThumbsDownFilled16 : ThumbsDown16)}</span
|
|
70
|
+
>
|
|
71
|
+
<span slot="tooltip-content"
|
|
72
|
+
>${negativeLabel || DEFAULT_NEGATIVE_LABEL}</span
|
|
73
|
+
>
|
|
74
|
+
</cds-custom-icon-button>
|
|
75
|
+
</div>`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { feedbackButtonsElementTemplate };
|
|
79
|
+
//# sourceMappingURL=feedback-buttons.template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-buttons.template.js","sources":["../../../../src/components/feedback/src/feedback-buttons.template.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;AAOG;AAcH,MAAM,sBAAsB,GAAG,eAAe;AAC9C,MAAM,sBAAsB,GAAG,cAAc;AAE7C,SAAS,8BAA8B,CACrC,kBAA4C,EAAA;IAE5C,MAAM,EACJ,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,OAAO,GACR,GAAG,kBAAkB;AAEtB,IAAA,MAAM,iBAAiB,GAAG,CAAC,UAAmB,KAAI;QAChD,kBAAkB,CAAC,iBAAiB,EAAE,IAAI,CAAC,k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