@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,678 @@
|
|
|
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, html } from 'lit';
|
|
10
|
+
import { property, state } from 'lit/decorators.js';
|
|
11
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
|
12
|
+
import ChevronDown16 from '@carbon/icons/es/chevron--down/16.js';
|
|
13
|
+
import FocusMixin from '@carbon/web-components/es-custom/globals/mixins/focus.js';
|
|
14
|
+
import { iconLoader } from '@carbon/web-components/es-custom/globals/internal/icon-loader.js';
|
|
15
|
+
import { carbonElement } from '../../../globals/decorators/carbon-element.js';
|
|
16
|
+
import { observeResize } from './dom-utils.js';
|
|
17
|
+
import { buildContainerStyles, evaluateShowMoreButton } from './layout-utils.js';
|
|
18
|
+
import { StreamingManager } from './streaming-manager.js';
|
|
19
|
+
import { defaultLineCountText } from './formatters.js';
|
|
20
|
+
import { Compartment } from '@codemirror/state';
|
|
21
|
+
import { loadCodeMirrorRuntime } from './codemirror/codemirror-loader.js';
|
|
22
|
+
import '@carbon/web-components/es-custom/components/skeleton-text/index.js';
|
|
23
|
+
import styles from './code-snippet.scss.js';
|
|
24
|
+
import '@carbon/web-components/es-custom/components/copy-button/index.js';
|
|
25
|
+
import '@carbon/web-components/es-custom/components/copy/copy.js';
|
|
26
|
+
import '@carbon/web-components/es-custom/components/button/button.js';
|
|
27
|
+
|
|
28
|
+
/*
|
|
29
|
+
* Copyright IBM Corp. 2025
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*
|
|
34
|
+
* @license
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* AI Chat code snippet orchestrator that keeps CodeMirror in sync with streamed slot content,
|
|
38
|
+
* automatically detects and loads language highlighting, and optionally exposes an editable surface
|
|
39
|
+
* with live language re-detection and change notifications.
|
|
40
|
+
*/
|
|
41
|
+
let CDSAIChatCodeSnippet = class CDSAIChatCodeSnippet extends FocusMixin(LitElement) {
|
|
42
|
+
constructor() {
|
|
43
|
+
super();
|
|
44
|
+
// CodeMirror properties
|
|
45
|
+
/** Language used for syntax highlighting. */
|
|
46
|
+
this.language = "";
|
|
47
|
+
/** Whether the snippet should be editable. */
|
|
48
|
+
this.editable = false;
|
|
49
|
+
/** Whether to enable syntax highlighting. */
|
|
50
|
+
this.highlight = false;
|
|
51
|
+
/** Fallback language to use when detection fails. */
|
|
52
|
+
this.defaultLanguage = "javascript";
|
|
53
|
+
/** Text to copy when clicking the copy button. Defaults to slotted content. */
|
|
54
|
+
this.copyText = "";
|
|
55
|
+
/** Disable interactions on the snippet. */
|
|
56
|
+
this.disabled = false;
|
|
57
|
+
/** Feedback text shown after copy. */
|
|
58
|
+
this.feedback = "Copied!";
|
|
59
|
+
/** Duration (ms) to show feedback text. */
|
|
60
|
+
this.feedbackTimeout = 2000;
|
|
61
|
+
/** Hide the copy button. */
|
|
62
|
+
this.hideCopyButton = false;
|
|
63
|
+
/** Maximum rows to show when collapsed. */
|
|
64
|
+
this.maxCollapsedNumberOfRows = 15;
|
|
65
|
+
/** Maximum rows to show when expanded (0 = unlimited). */
|
|
66
|
+
this.maxExpandedNumberOfRows = 0;
|
|
67
|
+
/** Minimum rows to show when collapsed. */
|
|
68
|
+
this.minCollapsedNumberOfRows = 3;
|
|
69
|
+
/** Minimum rows to show when expanded. */
|
|
70
|
+
this.minExpandedNumberOfRows = 16;
|
|
71
|
+
/** Label for the “show less” control. */
|
|
72
|
+
this.showLessText = "Show less";
|
|
73
|
+
/** Label for the “show more” control. */
|
|
74
|
+
this.showMoreText = "Show more";
|
|
75
|
+
/** Tooltip label for the copy action. */
|
|
76
|
+
this.tooltipContent = "Copy to clipboard";
|
|
77
|
+
/** Wrap text instead of horizontal scrolling. */
|
|
78
|
+
this.wrapText = false;
|
|
79
|
+
/** Label for folding/collapsing code. */
|
|
80
|
+
this.foldCollapseLabel = "Collapse code block";
|
|
81
|
+
/** Label for unfolding/expanding code. */
|
|
82
|
+
this.foldExpandLabel = "Expand code block";
|
|
83
|
+
/**
|
|
84
|
+
* The function used to format the line count text.
|
|
85
|
+
* Receives the line count and returns a formatted string.
|
|
86
|
+
* Defaults to `${count} lines` in en-US.
|
|
87
|
+
*/
|
|
88
|
+
this.getLineCountText = defaultLineCountText;
|
|
89
|
+
/**
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
this._slottedContent = "";
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
this._detectedLanguage = null;
|
|
97
|
+
/**
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
this._languageLabelLockedIn = false;
|
|
101
|
+
/**
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
this._lineCount = null;
|
|
105
|
+
/**
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
108
|
+
this._isEditorLoading = true;
|
|
109
|
+
/**
|
|
110
|
+
* @internal
|
|
111
|
+
*/
|
|
112
|
+
this._expandedCode = false;
|
|
113
|
+
/**
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
116
|
+
this._shouldShowMoreLessBtn = false;
|
|
117
|
+
/**
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
this._hObserveResize = null;
|
|
121
|
+
/**
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
this._rowHeightInPixels = 16;
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
this._isCreatingEditor = false;
|
|
129
|
+
/**
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
this.contentSlot = createRef();
|
|
133
|
+
/**
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
this.editorContainer = createRef();
|
|
137
|
+
/**
|
|
138
|
+
* @internal
|
|
139
|
+
*/
|
|
140
|
+
this.languageCompartment = null;
|
|
141
|
+
/**
|
|
142
|
+
* @internal
|
|
143
|
+
*/
|
|
144
|
+
this.readOnlyCompartment = null;
|
|
145
|
+
/**
|
|
146
|
+
* @internal
|
|
147
|
+
*/
|
|
148
|
+
this.wrapCompartment = null;
|
|
149
|
+
/**
|
|
150
|
+
* @internal
|
|
151
|
+
*/
|
|
152
|
+
this.languageController = null;
|
|
153
|
+
/**
|
|
154
|
+
* @internal
|
|
155
|
+
*/
|
|
156
|
+
this.codemirrorRuntime = null;
|
|
157
|
+
/**
|
|
158
|
+
* @internal
|
|
159
|
+
*/
|
|
160
|
+
this.codemirrorRuntimePromise = null;
|
|
161
|
+
/**
|
|
162
|
+
* @internal
|
|
163
|
+
*/
|
|
164
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
165
|
+
// Use requestAnimationFrame to avoid ResizeObserver loop errors
|
|
166
|
+
requestAnimationFrame(() => {
|
|
167
|
+
this._checkShowMoreButton();
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
this.streamingManager = new StreamingManager({
|
|
171
|
+
getSlot: () => this.contentSlot.value ?? null,
|
|
172
|
+
getHost: () => this,
|
|
173
|
+
onContentUpdate: (content) => {
|
|
174
|
+
const previous = this._slottedContent;
|
|
175
|
+
if (content !== previous) {
|
|
176
|
+
this._slottedContent = content;
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
_applyLanguageState(update) {
|
|
182
|
+
if ("detectedLanguage" in update) {
|
|
183
|
+
this._detectedLanguage = update.detectedLanguage ?? null;
|
|
184
|
+
}
|
|
185
|
+
if (update.lockLabel !== undefined) {
|
|
186
|
+
this._languageLabelLockedIn = update.lockLabel;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Carbon methods
|
|
190
|
+
/**
|
|
191
|
+
* Copies the visible snippet so downstream chat experiences can share code without exposing the editor internals.
|
|
192
|
+
*/
|
|
193
|
+
async _handleCopyClick() {
|
|
194
|
+
try {
|
|
195
|
+
await navigator.clipboard.writeText(this._slottedContent || this.copyText || "");
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
console.error("Failed to copy text:", error);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Toggles the expanded state so long snippets can collapse inside chat tiles while still offering full visibility on demand.
|
|
203
|
+
*/
|
|
204
|
+
_handleClickExpanded() {
|
|
205
|
+
this._expandedCode = !this._expandedCode;
|
|
206
|
+
}
|
|
207
|
+
// CodeMirror methods
|
|
208
|
+
async ensureCodeMirrorRuntime() {
|
|
209
|
+
if (this.codemirrorRuntime && this.languageController) {
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
if (typeof window === "undefined") {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
if (!this.codemirrorRuntimePromise) {
|
|
216
|
+
this._isEditorLoading = true;
|
|
217
|
+
this.codemirrorRuntimePromise = loadCodeMirrorRuntime();
|
|
218
|
+
}
|
|
219
|
+
try {
|
|
220
|
+
const runtime = await this.codemirrorRuntimePromise;
|
|
221
|
+
if (!this.codemirrorRuntime) {
|
|
222
|
+
this.codemirrorRuntime = runtime;
|
|
223
|
+
this.languageCompartment = new runtime.Compartment();
|
|
224
|
+
this.readOnlyCompartment = new runtime.Compartment();
|
|
225
|
+
this.wrapCompartment = new runtime.Compartment();
|
|
226
|
+
this.languageController = new runtime.LanguageController({
|
|
227
|
+
getLanguageAttribute: () => this.language,
|
|
228
|
+
getContent: () => this._slottedContent,
|
|
229
|
+
isHighlightEnabled: () => this.highlight,
|
|
230
|
+
getEditorView: () => this.editorView,
|
|
231
|
+
getLanguageCompartment: () => {
|
|
232
|
+
if (!this.languageCompartment) {
|
|
233
|
+
this.languageCompartment = new Compartment();
|
|
234
|
+
}
|
|
235
|
+
return this.languageCompartment;
|
|
236
|
+
},
|
|
237
|
+
isLanguageLabelLocked: () => this._languageLabelLockedIn,
|
|
238
|
+
getDefaultLanguage: () => this.defaultLanguage,
|
|
239
|
+
updateState: (update) => this._applyLanguageState(update),
|
|
240
|
+
});
|
|
241
|
+
this.requestUpdate();
|
|
242
|
+
}
|
|
243
|
+
return true;
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
console.error("Failed to load CodeMirror runtime", error);
|
|
247
|
+
this._isEditorLoading = false;
|
|
248
|
+
this.codemirrorRuntimePromise = null;
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Tears down the CodeMirror view when the component is destroyed to avoid leaking editors between chat messages.
|
|
254
|
+
*/
|
|
255
|
+
destroyEditor() {
|
|
256
|
+
if (this.editorView) {
|
|
257
|
+
this.editorView.destroy();
|
|
258
|
+
this.editorView = undefined;
|
|
259
|
+
}
|
|
260
|
+
this.languageController?.reset();
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Synchronizes CodeMirror with the latest props and streamed slot content while minimizing unnecessary re-creation work and only appending diffs when possible.
|
|
264
|
+
*/
|
|
265
|
+
async updateEditor(changedProperties) {
|
|
266
|
+
if (!this.editorContainer.value) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
const isReady = await this.ensureCodeMirrorRuntime();
|
|
270
|
+
if (!isReady ||
|
|
271
|
+
!this.codemirrorRuntime ||
|
|
272
|
+
!this.languageController ||
|
|
273
|
+
!this.languageCompartment ||
|
|
274
|
+
!this.readOnlyCompartment) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const { createContentSync, applyLanguageSupport, updateReadOnlyConfiguration, } = this.codemirrorRuntime;
|
|
278
|
+
const languageController = this.languageController;
|
|
279
|
+
const languageCompartment = this.languageCompartment;
|
|
280
|
+
const readOnlyCompartment = this.readOnlyCompartment;
|
|
281
|
+
const needsRecreate = !this.editorView || changedProperties.has("editable");
|
|
282
|
+
if (needsRecreate) {
|
|
283
|
+
// Prevent creating multiple editors simultaneously
|
|
284
|
+
if (this._isCreatingEditor) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
this._isCreatingEditor = true;
|
|
288
|
+
this.destroyEditor();
|
|
289
|
+
await this.createEditor();
|
|
290
|
+
this._isCreatingEditor = false;
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
if (changedProperties.has("_slottedContent")) {
|
|
294
|
+
if (!this.contentSync) {
|
|
295
|
+
this.contentSync = createContentSync({
|
|
296
|
+
getEditorView: () => this.editorView,
|
|
297
|
+
onAfterApply: () => {
|
|
298
|
+
if (this.editorView) {
|
|
299
|
+
this._lineCount = this.editorView.state.doc.lines;
|
|
300
|
+
}
|
|
301
|
+
this._checkShowMoreButton();
|
|
302
|
+
},
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
this.contentSync.update(this._slottedContent);
|
|
306
|
+
await languageController.handleStreamingLanguageDetection();
|
|
307
|
+
}
|
|
308
|
+
if (changedProperties.has("language") ||
|
|
309
|
+
changedProperties.has("highlight")) {
|
|
310
|
+
const languageSupport = await languageController.resolveLanguageSupport();
|
|
311
|
+
applyLanguageSupport(this.editorView, languageCompartment, languageSupport);
|
|
312
|
+
}
|
|
313
|
+
if (changedProperties.has("disabled")) {
|
|
314
|
+
updateReadOnlyConfiguration(this.editorView, readOnlyCompartment, {
|
|
315
|
+
editable: this.editable,
|
|
316
|
+
disabled: this.disabled,
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Builds the CodeMirror instance that powers the formatted snippet surface inside the chat response tile.
|
|
323
|
+
*/
|
|
324
|
+
async createEditor() {
|
|
325
|
+
const container = this.editorContainer.value;
|
|
326
|
+
const runtime = this.codemirrorRuntime;
|
|
327
|
+
const languageController = this.languageController;
|
|
328
|
+
const languageCompartment = this.languageCompartment;
|
|
329
|
+
const readOnlyCompartment = this.readOnlyCompartment;
|
|
330
|
+
const wrapCompartment = this.wrapCompartment;
|
|
331
|
+
if (!container ||
|
|
332
|
+
!runtime ||
|
|
333
|
+
!languageController ||
|
|
334
|
+
!languageCompartment ||
|
|
335
|
+
!readOnlyCompartment ||
|
|
336
|
+
!wrapCompartment) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
this._isEditorLoading = true;
|
|
340
|
+
const languageSupport = await languageController.resolveLanguageSupport();
|
|
341
|
+
try {
|
|
342
|
+
container.replaceChildren();
|
|
343
|
+
this.editorView = runtime.createEditorView({
|
|
344
|
+
container,
|
|
345
|
+
doc: this._slottedContent,
|
|
346
|
+
languageSupport,
|
|
347
|
+
languageCompartment,
|
|
348
|
+
readOnlyCompartment,
|
|
349
|
+
wrapCompartment,
|
|
350
|
+
editable: this.editable,
|
|
351
|
+
disabled: this.disabled,
|
|
352
|
+
wrapText: this.wrapText,
|
|
353
|
+
onDocChanged: ({ content, lineCount }) => {
|
|
354
|
+
this._lineCount = lineCount;
|
|
355
|
+
this.dispatchEvent(new CustomEvent("content-change", {
|
|
356
|
+
detail: { content },
|
|
357
|
+
bubbles: true,
|
|
358
|
+
composed: true,
|
|
359
|
+
}));
|
|
360
|
+
if (this.editable) {
|
|
361
|
+
languageController.detectLanguageForEditable(content);
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
setupOptions: {
|
|
365
|
+
foldCollapseLabel: this.foldCollapseLabel,
|
|
366
|
+
foldExpandLabel: this.foldExpandLabel,
|
|
367
|
+
},
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
finally {
|
|
371
|
+
this._isEditorLoading = false;
|
|
372
|
+
}
|
|
373
|
+
this._lineCount = this.editorView.state.doc.lines;
|
|
374
|
+
// Check height after editor renders
|
|
375
|
+
requestAnimationFrame(() => {
|
|
376
|
+
this._checkShowMoreButton();
|
|
377
|
+
});
|
|
378
|
+
languageController.handleStreamingLanguageDetection();
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Calculates the inline styles for the snippet container based on expanded state and min/max row constraints.
|
|
382
|
+
*/
|
|
383
|
+
_getContainerStyles(expandedCode) {
|
|
384
|
+
return buildContainerStyles({
|
|
385
|
+
expanded: expandedCode,
|
|
386
|
+
maxCollapsed: this.maxCollapsedNumberOfRows,
|
|
387
|
+
maxExpanded: this.maxExpandedNumberOfRows,
|
|
388
|
+
minCollapsed: this.minCollapsedNumberOfRows,
|
|
389
|
+
minExpanded: this.minExpandedNumberOfRows,
|
|
390
|
+
rowHeight: this._rowHeightInPixels,
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Shows or hides the expand button so the chat message can adapt to long snippets without overwhelming the layout.
|
|
395
|
+
*/
|
|
396
|
+
_checkShowMoreButton() {
|
|
397
|
+
const { shouldShowButton, shouldCollapse } = evaluateShowMoreButton({
|
|
398
|
+
shadowRoot: this.shadowRoot,
|
|
399
|
+
rowHeight: this._rowHeightInPixels,
|
|
400
|
+
expanded: this._expandedCode,
|
|
401
|
+
maxCollapsed: this.maxCollapsedNumberOfRows,
|
|
402
|
+
maxExpanded: this.maxExpandedNumberOfRows,
|
|
403
|
+
minExpanded: this.minExpandedNumberOfRows,
|
|
404
|
+
});
|
|
405
|
+
if (this._shouldShowMoreLessBtn !== shouldShowButton) {
|
|
406
|
+
this._shouldShowMoreLessBtn = shouldShowButton;
|
|
407
|
+
}
|
|
408
|
+
if (shouldCollapse) {
|
|
409
|
+
this._expandedCode = false;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
renderEditorFallback() {
|
|
413
|
+
if (!this._isEditorLoading) {
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
return html `<div
|
|
417
|
+
class="cds-aichat--snippet__editor-skeleton"
|
|
418
|
+
aria-hidden="true"
|
|
419
|
+
>
|
|
420
|
+
<cds-custom-skeleton-text lines="4"></cds-custom-skeleton-text>
|
|
421
|
+
</div>`;
|
|
422
|
+
}
|
|
423
|
+
// Lifecycle methods
|
|
424
|
+
/**
|
|
425
|
+
* Wires up resize and content observers so the snippet reacts to streaming updates and layout changes as soon as it attaches.
|
|
426
|
+
*/
|
|
427
|
+
connectedCallback() {
|
|
428
|
+
super.connectedCallback();
|
|
429
|
+
if (this._hObserveResize) {
|
|
430
|
+
this._hObserveResize = this._hObserveResize.release();
|
|
431
|
+
}
|
|
432
|
+
this._hObserveResize = observeResize(this._resizeObserver, this);
|
|
433
|
+
this.streamingManager.reset(this._slottedContent);
|
|
434
|
+
this.streamingManager.connect();
|
|
435
|
+
void this.ensureCodeMirrorRuntime();
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Hooks into the rendered slot once Lit has stamped the template so we can observe streaming updates.
|
|
439
|
+
*/
|
|
440
|
+
firstUpdated() {
|
|
441
|
+
this.streamingManager.syncSlotObservers();
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Ensures we capture any pre-rendered slot content before the initial paint, keeping the editor in sync from the first frame.
|
|
445
|
+
*/
|
|
446
|
+
willUpdate(_changedProperties) {
|
|
447
|
+
this.streamingManager.ensureInitialContent();
|
|
448
|
+
// Update expanded-code attribute before render to avoid change-in-update warning
|
|
449
|
+
if (this._expandedCode) {
|
|
450
|
+
this.setAttribute("expanded-code", "");
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
this.removeAttribute("expanded-code");
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Responds to slot churn caused by streaming tokens emitted from the chat pipeline, forcing a full rescan when the slot re-projects.
|
|
458
|
+
*/
|
|
459
|
+
_handleSlotChange() {
|
|
460
|
+
this.streamingManager.handleSlotChange();
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Cleans up observers, throttles, and the editor when the chat snippet unmounts.
|
|
464
|
+
*/
|
|
465
|
+
disconnectedCallback() {
|
|
466
|
+
super.disconnectedCallback();
|
|
467
|
+
if (this._hObserveResize) {
|
|
468
|
+
this._hObserveResize = this._hObserveResize.release();
|
|
469
|
+
}
|
|
470
|
+
// Cancel any pending throttled updates
|
|
471
|
+
this.contentSync?.cancel();
|
|
472
|
+
this.streamingManager.dispose();
|
|
473
|
+
this.languageController?.dispose();
|
|
474
|
+
this.destroyEditor();
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Drives incremental editor updates after Lit commits.
|
|
478
|
+
*/
|
|
479
|
+
updated(changedProperties) {
|
|
480
|
+
this.updateEditor(changedProperties);
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Renders the CodeMirror host along with the controls that make the chat snippet interactive and accessible.
|
|
484
|
+
*/
|
|
485
|
+
render() {
|
|
486
|
+
const { disabled, feedback, feedbackTimeout, hideCopyButton, tooltipContent, showMoreText, showLessText, _expandedCode: expandedCode, _handleCopyClick: handleCopyClick, _shouldShowMoreLessBtn: shouldShowMoreLessBtn, } = this;
|
|
487
|
+
const disabledCopyButtonClasses = disabled
|
|
488
|
+
? `cds-aichat--snippet--disabled`
|
|
489
|
+
: "";
|
|
490
|
+
const expandCodeBtnText = expandedCode ? showLessText : showMoreText;
|
|
491
|
+
let containerClasses = `cds-aichat--snippet-container cds-aichat--snippet--codemirror`;
|
|
492
|
+
if (!expandedCode) {
|
|
493
|
+
containerClasses += ` cds-aichat--snippet-container--collapsed`;
|
|
494
|
+
}
|
|
495
|
+
return html ` <div class="cds-aichat--snippet">
|
|
496
|
+
<div class="cds-aichat--snippet__header" data-rounded="top">
|
|
497
|
+
<div class="cds-aichat--snippet__meta">
|
|
498
|
+
${this._detectedLanguage && this._languageLabelLockedIn
|
|
499
|
+
? html `<div class="cds-aichat--snippet__language">
|
|
500
|
+
${this._detectedLanguage}
|
|
501
|
+
</div>`
|
|
502
|
+
: ""}
|
|
503
|
+
${this._detectedLanguage &&
|
|
504
|
+
this._languageLabelLockedIn &&
|
|
505
|
+
this._lineCount
|
|
506
|
+
? html `<div class="cds-aichat--snippet__header-separator">
|
|
507
|
+
—
|
|
508
|
+
</div>`
|
|
509
|
+
: ""}
|
|
510
|
+
${this._lineCount
|
|
511
|
+
? html `<div class="cds-aichat--snippet__linecount">
|
|
512
|
+
${this.getLineCountText({ count: this._lineCount })}
|
|
513
|
+
</div>`
|
|
514
|
+
: ""}
|
|
515
|
+
</div>
|
|
516
|
+
${hideCopyButton
|
|
517
|
+
? ``
|
|
518
|
+
: html `
|
|
519
|
+
<div class="cds-aichat--snippet__copy" data-rounded="top-right">
|
|
520
|
+
<!-- we need the button part exposed to the top level cds-custom-copy-button -->
|
|
521
|
+
<cds-custom-copy-button
|
|
522
|
+
?disabled=${disabled}
|
|
523
|
+
button-class-name=${disabledCopyButtonClasses}
|
|
524
|
+
feedback=${feedback}
|
|
525
|
+
feedback-timeout=${feedbackTimeout}
|
|
526
|
+
@click="${handleCopyClick}"
|
|
527
|
+
>
|
|
528
|
+
${tooltipContent}
|
|
529
|
+
</cds-custom-copy-button>
|
|
530
|
+
</div>
|
|
531
|
+
`}
|
|
532
|
+
</div>
|
|
533
|
+
<div
|
|
534
|
+
role="${this.editable ? "textbox" : "region"}"
|
|
535
|
+
tabindex="${this.editable && !disabled ? 0 : null}"
|
|
536
|
+
class="${containerClasses}"
|
|
537
|
+
data-rounded="bottom"
|
|
538
|
+
aria-label="code-snippet"
|
|
539
|
+
${this.editable ? 'aria-readonly="false" aria-multiline="true"' : ""}
|
|
540
|
+
style="${this._getContainerStyles(expandedCode)}"
|
|
541
|
+
>
|
|
542
|
+
<div class="cds-aichat--code-editor" ${ref(this.editorContainer)}></div>
|
|
543
|
+
${this.renderEditorFallback()}
|
|
544
|
+
</div>
|
|
545
|
+
|
|
546
|
+
${shouldShowMoreLessBtn
|
|
547
|
+
? html `
|
|
548
|
+
<div
|
|
549
|
+
class="cds-aichat--snippet__footer"
|
|
550
|
+
data-rounded="bottom-right"
|
|
551
|
+
>
|
|
552
|
+
<cds-custom-button
|
|
553
|
+
kind="ghost"
|
|
554
|
+
size="sm"
|
|
555
|
+
button-class-name="cds-aichat--snippet-btn--expand"
|
|
556
|
+
?disabled=${disabled}
|
|
557
|
+
@click=${() => this._handleClickExpanded()}
|
|
558
|
+
>
|
|
559
|
+
<span class="cds-aichat--snippet-btn--text">
|
|
560
|
+
${expandCodeBtnText}
|
|
561
|
+
</span>
|
|
562
|
+
${iconLoader(ChevronDown16, {
|
|
563
|
+
class: `cds-aichat--icon-chevron--down cds-aichat--snippet__icon`,
|
|
564
|
+
role: "img",
|
|
565
|
+
slot: "icon",
|
|
566
|
+
})}
|
|
567
|
+
</cds-custom-button>
|
|
568
|
+
</div>
|
|
569
|
+
`
|
|
570
|
+
: ``}
|
|
571
|
+
<div class="cds-aichat--visually-hidden">
|
|
572
|
+
<slot
|
|
573
|
+
${ref(this.contentSlot)}
|
|
574
|
+
@slotchange=${this._handleSlotChange}
|
|
575
|
+
></slot>
|
|
576
|
+
</div>
|
|
577
|
+
</div>`;
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
CDSAIChatCodeSnippet.styles = [styles];
|
|
581
|
+
/**
|
|
582
|
+
* @internal
|
|
583
|
+
*/
|
|
584
|
+
CDSAIChatCodeSnippet.shadowRootOptions = {
|
|
585
|
+
...LitElement.shadowRootOptions,
|
|
586
|
+
delegatesFocus: true,
|
|
587
|
+
};
|
|
588
|
+
__decorate([
|
|
589
|
+
property({ type: String, attribute: "language" })
|
|
590
|
+
], CDSAIChatCodeSnippet.prototype, "language", void 0);
|
|
591
|
+
__decorate([
|
|
592
|
+
property({ type: Boolean, attribute: "editable" })
|
|
593
|
+
], CDSAIChatCodeSnippet.prototype, "editable", void 0);
|
|
594
|
+
__decorate([
|
|
595
|
+
property({ type: Boolean, attribute: "highlight" })
|
|
596
|
+
], CDSAIChatCodeSnippet.prototype, "highlight", void 0);
|
|
597
|
+
__decorate([
|
|
598
|
+
property({ type: String, attribute: "default-language" })
|
|
599
|
+
], CDSAIChatCodeSnippet.prototype, "defaultLanguage", void 0);
|
|
600
|
+
__decorate([
|
|
601
|
+
property({ attribute: "copy-text" })
|
|
602
|
+
], CDSAIChatCodeSnippet.prototype, "copyText", void 0);
|
|
603
|
+
__decorate([
|
|
604
|
+
property({ type: Boolean, reflect: true, attribute: "disabled" })
|
|
605
|
+
], CDSAIChatCodeSnippet.prototype, "disabled", void 0);
|
|
606
|
+
__decorate([
|
|
607
|
+
property({ attribute: "feedback" })
|
|
608
|
+
], CDSAIChatCodeSnippet.prototype, "feedback", void 0);
|
|
609
|
+
__decorate([
|
|
610
|
+
property({ type: Number, attribute: "feedback-timeout" })
|
|
611
|
+
], CDSAIChatCodeSnippet.prototype, "feedbackTimeout", void 0);
|
|
612
|
+
__decorate([
|
|
613
|
+
property({ type: Boolean, reflect: true, attribute: "hide-copy-button" })
|
|
614
|
+
], CDSAIChatCodeSnippet.prototype, "hideCopyButton", void 0);
|
|
615
|
+
__decorate([
|
|
616
|
+
property({ attribute: "max-collapsed-number-of-rows" })
|
|
617
|
+
], CDSAIChatCodeSnippet.prototype, "maxCollapsedNumberOfRows", void 0);
|
|
618
|
+
__decorate([
|
|
619
|
+
property({ attribute: "max-expanded-number-of-rows" })
|
|
620
|
+
], CDSAIChatCodeSnippet.prototype, "maxExpandedNumberOfRows", void 0);
|
|
621
|
+
__decorate([
|
|
622
|
+
property({ attribute: "min-collapsed-number-of-rows" })
|
|
623
|
+
], CDSAIChatCodeSnippet.prototype, "minCollapsedNumberOfRows", void 0);
|
|
624
|
+
__decorate([
|
|
625
|
+
property({ attribute: "min-expanded-number-of-rows" })
|
|
626
|
+
], CDSAIChatCodeSnippet.prototype, "minExpandedNumberOfRows", void 0);
|
|
627
|
+
__decorate([
|
|
628
|
+
property({ attribute: "show-less-text" })
|
|
629
|
+
], CDSAIChatCodeSnippet.prototype, "showLessText", void 0);
|
|
630
|
+
__decorate([
|
|
631
|
+
property({ attribute: "show-more-text" })
|
|
632
|
+
], CDSAIChatCodeSnippet.prototype, "showMoreText", void 0);
|
|
633
|
+
__decorate([
|
|
634
|
+
property({ attribute: "tooltip-content" })
|
|
635
|
+
], CDSAIChatCodeSnippet.prototype, "tooltipContent", void 0);
|
|
636
|
+
__decorate([
|
|
637
|
+
property({ type: Boolean, reflect: true, attribute: "wrap-text" })
|
|
638
|
+
], CDSAIChatCodeSnippet.prototype, "wrapText", void 0);
|
|
639
|
+
__decorate([
|
|
640
|
+
property({ attribute: "fold-collapse-label" })
|
|
641
|
+
], CDSAIChatCodeSnippet.prototype, "foldCollapseLabel", void 0);
|
|
642
|
+
__decorate([
|
|
643
|
+
property({ attribute: "fold-expand-label" })
|
|
644
|
+
], CDSAIChatCodeSnippet.prototype, "foldExpandLabel", void 0);
|
|
645
|
+
__decorate([
|
|
646
|
+
property({ attribute: false })
|
|
647
|
+
], CDSAIChatCodeSnippet.prototype, "getLineCountText", void 0);
|
|
648
|
+
__decorate([
|
|
649
|
+
property({ attribute: false })
|
|
650
|
+
], CDSAIChatCodeSnippet.prototype, "_slottedContent", void 0);
|
|
651
|
+
__decorate([
|
|
652
|
+
state()
|
|
653
|
+
], CDSAIChatCodeSnippet.prototype, "_detectedLanguage", void 0);
|
|
654
|
+
__decorate([
|
|
655
|
+
state()
|
|
656
|
+
], CDSAIChatCodeSnippet.prototype, "_languageLabelLockedIn", void 0);
|
|
657
|
+
__decorate([
|
|
658
|
+
state()
|
|
659
|
+
], CDSAIChatCodeSnippet.prototype, "_lineCount", void 0);
|
|
660
|
+
__decorate([
|
|
661
|
+
state()
|
|
662
|
+
], CDSAIChatCodeSnippet.prototype, "editorView", void 0);
|
|
663
|
+
__decorate([
|
|
664
|
+
state()
|
|
665
|
+
], CDSAIChatCodeSnippet.prototype, "_isEditorLoading", void 0);
|
|
666
|
+
__decorate([
|
|
667
|
+
state()
|
|
668
|
+
], CDSAIChatCodeSnippet.prototype, "_expandedCode", void 0);
|
|
669
|
+
__decorate([
|
|
670
|
+
state()
|
|
671
|
+
], CDSAIChatCodeSnippet.prototype, "_shouldShowMoreLessBtn", void 0);
|
|
672
|
+
CDSAIChatCodeSnippet = __decorate([
|
|
673
|
+
carbonElement("cds-aichat-code-snippet")
|
|
674
|
+
], CDSAIChatCodeSnippet);
|
|
675
|
+
var CDSAIChatCodeSnippet$1 = CDSAIChatCodeSnippet;
|
|
676
|
+
|
|
677
|
+
export { CDSAIChatCodeSnippet, CDSAIChatCodeSnippet$1 as default };
|
|
678
|
+
//# sourceMappingURL=code-snippet.js.map
|