@carbon/ai-chat-components 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/custom-elements.json +1705 -467
- package/es/components/card/src/card-footer.d.ts +1 -0
- package/es/components/card/src/card-footer.js +3 -2
- package/es/components/card/src/card-footer.js.map +1 -1
- package/es/components/card/src/card-footer.scss.js +1 -1
- package/es/components/card/src/card-steps.d.ts +1 -0
- package/es/components/card/src/card-steps.js +2 -1
- package/es/components/card/src/card-steps.js.map +1 -1
- package/es/components/card/src/card.d.ts +1 -0
- package/es/components/card/src/card.js +3 -1
- package/es/components/card/src/card.js.map +1 -1
- package/es/components/card/src/card.scss.js +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought-step.d.ts +4 -0
- package/es/components/chain-of-thought/src/chain-of-thought-step.js +5 -1
- package/es/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought-toggle.d.ts +4 -0
- package/es/components/chain-of-thought/src/chain-of-thought-toggle.js +5 -1
- package/es/components/chain-of-thought/src/chain-of-thought-toggle.js.map +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought.d.ts +4 -0
- package/es/components/chain-of-thought/src/chain-of-thought.js +5 -1
- package/es/components/chain-of-thought/src/chain-of-thought.js.map +1 -1
- package/es/components/chain-of-thought/src/tool-call-data.d.ts +4 -0
- package/es/components/chain-of-thought/src/tool-call-data.js +5 -1
- package/es/components/chain-of-thought/src/tool-call-data.js.map +1 -1
- package/es/components/chat-button/src/chat-button.js +4 -3
- package/es/components/chat-button/src/chat-button.js.map +1 -1
- package/es/components/chat-shell/index.d.ts +10 -0
- package/es/{node_modules/@carbon/utilities/es/documentLang/documentLang.js → components/chat-shell/index.js} +3 -2
- package/es/components/chat-shell/index.js.map +1 -0
- package/es/components/chat-shell/src/cds-aichat-panel.d.ts +66 -0
- package/es/components/chat-shell/src/cds-aichat-panel.js +433 -0
- package/es/components/chat-shell/src/cds-aichat-panel.js.map +1 -0
- package/es/components/chat-shell/src/cds-aichat-panel.scss.js +13 -0
- package/es/components/chat-shell/src/cds-aichat-panel.scss.js.map +1 -0
- package/es/components/chat-shell/src/cds-aichat-shell.d.ts +73 -0
- package/es/components/chat-shell/src/cds-aichat-shell.js +554 -0
- package/es/components/chat-shell/src/cds-aichat-shell.js.map +1 -0
- package/es/components/chat-shell/src/cds-aichat-shell.scss.js +13 -0
- package/es/components/chat-shell/src/cds-aichat-shell.scss.js.map +1 -0
- package/es/components/chat-shell/src/panel-manager.d.ts +29 -0
- package/es/components/chat-shell/src/panel-manager.js +144 -0
- package/es/components/chat-shell/src/panel-manager.js.map +1 -0
- package/es/components/chat-shell/src/workspace-manager.d.ts +118 -0
- package/es/components/chat-shell/src/workspace-manager.js +465 -0
- package/es/components/chat-shell/src/workspace-manager.js.map +1 -0
- package/es/components/code-snippet/src/code-snippet-card.js +2 -1
- package/es/components/code-snippet/src/code-snippet-card.js.map +1 -1
- package/es/components/code-snippet/src/code-snippet.d.ts +1 -0
- package/es/components/code-snippet/src/code-snippet.js +3 -1
- package/es/components/code-snippet/src/code-snippet.js.map +1 -1
- package/es/components/code-snippet/src/code-snippet.scss.js +1 -1
- package/es/components/feedback/src/feedback-buttons.d.ts +4 -0
- package/es/components/feedback/src/feedback-buttons.js +6 -1
- package/es/components/feedback/src/feedback-buttons.js.map +1 -1
- package/es/components/feedback/src/feedback.d.ts +1 -0
- package/es/components/feedback/src/feedback.js +3 -1
- package/es/components/feedback/src/feedback.js.map +1 -1
- package/es/components/feedback/src/feedback.scss.js +1 -1
- package/es/components/markdown/src/markdown-token-tree.js +1 -1
- package/es/components/markdown/src/markdown.d.ts +4 -0
- package/es/components/markdown/src/markdown.js +6 -1
- package/es/components/markdown/src/markdown.js.map +1 -1
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.js +1 -1
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js +1 -1
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js +1 -1
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js +1 -1
- package/es/components/processing/src/processing.d.ts +4 -0
- package/es/components/processing/src/processing.js +6 -1
- package/es/components/processing/src/processing.js.map +1 -1
- package/es/components/reasoning-steps/src/reasoning-step.d.ts +4 -0
- package/es/components/reasoning-steps/src/reasoning-step.js +5 -1
- package/es/components/reasoning-steps/src/reasoning-step.js.map +1 -1
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.d.ts +4 -0
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.js +6 -1
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.js.map +1 -1
- package/es/components/reasoning-steps/src/reasoning-steps.d.ts +4 -0
- package/es/components/reasoning-steps/src/reasoning-steps.js +5 -1
- package/es/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
- package/es/components/table/src/table.d.ts +1 -0
- package/es/components/table/src/table.js +5 -3
- package/es/components/table/src/table.js.map +1 -1
- package/es/components/table/src/table.template.js +2 -2
- package/es/components/table/src/table.template.js.map +1 -1
- package/es/components/toolbar/src/toolbar.js +3 -4
- package/es/components/toolbar/src/toolbar.js.map +1 -1
- package/es/components/toolbar/src/toolbar.scss.js +1 -1
- package/es/components/workspace-shell/src/workspace-shell-body.js +2 -1
- package/es/components/workspace-shell/src/workspace-shell-body.js.map +1 -1
- package/es/components/workspace-shell/src/workspace-shell-footer.js +2 -2
- package/es/components/workspace-shell/src/workspace-shell-footer.js.map +1 -1
- package/es/components/workspace-shell/src/workspace-shell-footer.scss.js +1 -1
- package/es/components/workspace-shell/src/workspace-shell-header.js +2 -2
- package/es/components/workspace-shell/src/workspace-shell-header.js.map +1 -1
- package/es/components/workspace-shell/src/workspace-shell.js +2 -1
- package/es/components/workspace-shell/src/workspace-shell.js.map +1 -1
- package/es/components/workspace-shell/src/workspace-shell.scss.js +1 -1
- package/es/react/__tests__/jest.setup.js +83 -0
- package/es/react/__tests__/jest.setup.js.map +1 -0
- package/es/react/chat-shell.d.ts +12 -0
- package/es/react/chat-shell.js +28 -0
- package/es/react/chat-shell.js.map +1 -0
- package/es/react/panel.d.ts +4 -0
- package/{es-custom/react/inline-notification.js → es/react/panel.js} +12 -6
- package/es/react/panel.js.map +1 -0
- package/es/react/toolbar.d.ts +14 -2
- package/es/react/toolbar.js +59 -9
- package/es/react/toolbar.js.map +1 -1
- package/es/react/utils/iconTransform.d.ts +37 -0
- package/es/react/utils/iconTransform.js +176 -0
- package/es/react/utils/iconTransform.js.map +1 -0
- package/es-custom/components/card/src/card-footer.d.ts +1 -0
- package/es-custom/components/card/src/card-footer.js +3 -2
- package/es-custom/components/card/src/card-footer.js.map +1 -1
- package/es-custom/components/card/src/card-footer.scss.js +1 -1
- package/es-custom/components/card/src/card-steps.d.ts +1 -0
- package/es-custom/components/card/src/card-steps.js +2 -1
- package/es-custom/components/card/src/card-steps.js.map +1 -1
- package/es-custom/components/card/src/card.d.ts +1 -0
- package/es-custom/components/card/src/card.js +3 -1
- package/es-custom/components/card/src/card.js.map +1 -1
- package/es-custom/components/card/src/card.scss.js +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.d.ts +4 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js +5 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.d.ts +4 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js +5 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js.map +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought.d.ts +4 -0
- package/es-custom/components/chain-of-thought/src/chain-of-thought.js +5 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought.js.map +1 -1
- package/es-custom/components/chain-of-thought/src/tool-call-data.d.ts +4 -0
- package/es-custom/components/chain-of-thought/src/tool-call-data.js +5 -1
- package/es-custom/components/chain-of-thought/src/tool-call-data.js.map +1 -1
- package/es-custom/components/chat-button/src/chat-button.js +4 -3
- package/es-custom/components/chat-button/src/chat-button.js.map +1 -1
- package/es-custom/components/chat-shell/index.d.ts +10 -0
- package/es-custom/{node_modules/@carbon/utilities/es/documentLang/documentLang.js → components/chat-shell/index.js} +3 -2
- package/es-custom/components/chat-shell/index.js.map +1 -0
- package/es-custom/components/chat-shell/src/cds-aichat-panel.d.ts +66 -0
- package/es-custom/components/chat-shell/src/cds-aichat-panel.js +433 -0
- package/es-custom/components/chat-shell/src/cds-aichat-panel.js.map +1 -0
- package/es-custom/components/chat-shell/src/cds-aichat-panel.scss.js +13 -0
- package/es-custom/components/chat-shell/src/cds-aichat-panel.scss.js.map +1 -0
- package/es-custom/components/chat-shell/src/cds-aichat-shell.d.ts +73 -0
- package/es-custom/components/chat-shell/src/cds-aichat-shell.js +554 -0
- package/es-custom/components/chat-shell/src/cds-aichat-shell.js.map +1 -0
- package/es-custom/components/chat-shell/src/cds-aichat-shell.scss.js +13 -0
- package/es-custom/components/chat-shell/src/cds-aichat-shell.scss.js.map +1 -0
- package/es-custom/components/chat-shell/src/panel-manager.d.ts +29 -0
- package/es-custom/components/chat-shell/src/panel-manager.js +144 -0
- package/es-custom/components/chat-shell/src/panel-manager.js.map +1 -0
- package/es-custom/components/chat-shell/src/workspace-manager.d.ts +118 -0
- package/es-custom/components/chat-shell/src/workspace-manager.js +465 -0
- package/es-custom/components/chat-shell/src/workspace-manager.js.map +1 -0
- package/es-custom/components/code-snippet/src/code-snippet-card.js +2 -1
- package/es-custom/components/code-snippet/src/code-snippet-card.js.map +1 -1
- package/es-custom/components/code-snippet/src/code-snippet.d.ts +1 -0
- package/es-custom/components/code-snippet/src/code-snippet.js +3 -1
- package/es-custom/components/code-snippet/src/code-snippet.js.map +1 -1
- package/es-custom/components/code-snippet/src/code-snippet.scss.js +1 -1
- package/es-custom/components/feedback/src/feedback-buttons.d.ts +4 -0
- package/es-custom/components/feedback/src/feedback-buttons.js +6 -1
- package/es-custom/components/feedback/src/feedback-buttons.js.map +1 -1
- package/es-custom/components/feedback/src/feedback.d.ts +1 -0
- package/es-custom/components/feedback/src/feedback.js +3 -1
- package/es-custom/components/feedback/src/feedback.js.map +1 -1
- package/es-custom/components/feedback/src/feedback.scss.js +1 -1
- package/es-custom/components/markdown/src/markdown-token-tree.js +1 -1
- package/es-custom/components/markdown/src/markdown.d.ts +4 -0
- package/es-custom/components/markdown/src/markdown.js +6 -1
- package/es-custom/components/markdown/src/markdown.js.map +1 -1
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/code.js +1 -1
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js +1 -1
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js +1 -1
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js +1 -1
- package/es-custom/components/processing/src/processing.d.ts +4 -0
- package/es-custom/components/processing/src/processing.js +6 -1
- package/es-custom/components/processing/src/processing.js.map +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-step.d.ts +4 -0
- package/es-custom/components/reasoning-steps/src/reasoning-step.js +5 -1
- package/es-custom/components/reasoning-steps/src/reasoning-step.js.map +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.d.ts +4 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js +6 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js.map +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps.d.ts +4 -0
- package/es-custom/components/reasoning-steps/src/reasoning-steps.js +5 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
- package/es-custom/components/table/src/table.d.ts +1 -0
- package/es-custom/components/table/src/table.js +5 -3
- package/es-custom/components/table/src/table.js.map +1 -1
- package/es-custom/components/table/src/table.template.js +2 -2
- package/es-custom/components/table/src/table.template.js.map +1 -1
- package/es-custom/components/toolbar/src/toolbar.js +3 -4
- package/es-custom/components/toolbar/src/toolbar.js.map +1 -1
- package/es-custom/components/toolbar/src/toolbar.scss.js +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-body.js +2 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-body.js.map +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.js +2 -2
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.js.map +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.scss.js +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-header.js +2 -2
- package/es-custom/components/workspace-shell/src/workspace-shell-header.js.map +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell.js +2 -1
- package/es-custom/components/workspace-shell/src/workspace-shell.js.map +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell.scss.js +1 -1
- package/es-custom/react/__tests__/jest.setup.js +83 -0
- package/es-custom/react/__tests__/jest.setup.js.map +1 -0
- package/es-custom/react/chat-shell.d.ts +12 -0
- package/es-custom/react/chat-shell.js +28 -0
- package/es-custom/react/chat-shell.js.map +1 -0
- package/es-custom/react/panel.d.ts +4 -0
- package/es-custom/react/{ai-label.js → panel.js} +12 -6
- package/es-custom/react/panel.js.map +1 -0
- package/es-custom/react/toolbar.d.ts +14 -2
- package/es-custom/react/toolbar.js +59 -9
- package/es-custom/react/toolbar.js.map +1 -1
- package/es-custom/react/utils/iconTransform.d.ts +37 -0
- package/es-custom/react/utils/iconTransform.js +176 -0
- package/es-custom/react/utils/iconTransform.js.map +1 -0
- package/package.json +21 -6
- package/telemetry.yml +125 -2
- package/es/node_modules/@carbon/utilities/es/documentLang/documentLang.js.map +0 -1
- package/es/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js +0 -11
- package/es/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js.map +0 -1
- package/es/react/ai-label.d.ts +0 -4
- package/es/react/ai-label.js +0 -28
- package/es/react/ai-label.js.map +0 -1
- package/es/react/button.d.ts +0 -6
- package/es/react/button.js +0 -29
- package/es/react/button.js.map +0 -1
- package/es/react/content-switcher.d.ts +0 -7
- package/es/react/content-switcher.js +0 -37
- package/es/react/content-switcher.js.map +0 -1
- package/es/react/icon-button.d.ts +0 -4
- package/es/react/icon-button.js +0 -28
- package/es/react/icon-button.js.map +0 -1
- package/es/react/icon.d.ts +0 -4
- package/es/react/icon.js +0 -28
- package/es/react/icon.js.map +0 -1
- package/es/react/inline-notification.d.ts +0 -4
- package/es/react/inline-notification.js +0 -28
- package/es/react/inline-notification.js.map +0 -1
- package/es/react/overflow-menu.d.ts +0 -9
- package/es/react/overflow-menu.js +0 -40
- package/es/react/overflow-menu.js.map +0 -1
- package/es/react/tag.d.ts +0 -4
- package/es/react/tag.js +0 -28
- package/es/react/tag.js.map +0 -1
- package/es/react/tile.d.ts +0 -7
- package/es/react/tile.js +0 -34
- package/es/react/tile.js.map +0 -1
- package/es-custom/node_modules/@carbon/utilities/es/documentLang/documentLang.js.map +0 -1
- package/es-custom/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js +0 -11
- package/es-custom/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js.map +0 -1
- package/es-custom/react/ai-label.d.ts +0 -4
- package/es-custom/react/ai-label.js.map +0 -1
- package/es-custom/react/button.d.ts +0 -6
- package/es-custom/react/button.js +0 -29
- package/es-custom/react/button.js.map +0 -1
- package/es-custom/react/content-switcher.d.ts +0 -7
- package/es-custom/react/content-switcher.js +0 -37
- package/es-custom/react/content-switcher.js.map +0 -1
- package/es-custom/react/icon-button.d.ts +0 -4
- package/es-custom/react/icon-button.js +0 -28
- package/es-custom/react/icon-button.js.map +0 -1
- package/es-custom/react/icon.d.ts +0 -4
- package/es-custom/react/icon.js +0 -28
- package/es-custom/react/icon.js.map +0 -1
- package/es-custom/react/inline-notification.d.ts +0 -4
- package/es-custom/react/inline-notification.js.map +0 -1
- package/es-custom/react/overflow-menu.d.ts +0 -9
- package/es-custom/react/overflow-menu.js +0 -40
- package/es-custom/react/overflow-menu.js.map +0 -1
- package/es-custom/react/tag.d.ts +0 -4
- package/es-custom/react/tag.js +0 -28
- package/es-custom/react/tag.js.map +0 -1
- package/es-custom/react/tile.d.ts +0 -7
- package/es-custom/react/tile.js +0 -34
- package/es-custom/react/tile.js.map +0 -1
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { __decorate } from 'tslib';
|
|
9
|
+
import { LitElement, nothing, html } from 'lit';
|
|
10
|
+
import { property } from 'lit/decorators.js';
|
|
11
|
+
import styles from './cds-aichat-shell.scss.js';
|
|
12
|
+
import { PanelManager } from './panel-manager.js';
|
|
13
|
+
import { WorkspaceManager } from './workspace-manager.js';
|
|
14
|
+
import { carbonElement } from '../../../globals/decorators/carbon-element.js';
|
|
15
|
+
import './cds-aichat-panel.js';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @license
|
|
19
|
+
*
|
|
20
|
+
* Copyright IBM Corp. 2025
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*/
|
|
25
|
+
var CdsAiChatShell_1;
|
|
26
|
+
let CdsAiChatShell = CdsAiChatShell_1 = class CdsAiChatShell extends LitElement {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
/**
|
|
30
|
+
* Enables AI-specific theming for the chat shell
|
|
31
|
+
*/
|
|
32
|
+
this.aiEnabled = false;
|
|
33
|
+
/**
|
|
34
|
+
* Shows a frame border around the chat shell
|
|
35
|
+
*/
|
|
36
|
+
this.showFrame = false;
|
|
37
|
+
/**
|
|
38
|
+
* Applies rounded corners to the chat shell
|
|
39
|
+
*/
|
|
40
|
+
this.roundedCorners = false;
|
|
41
|
+
/**
|
|
42
|
+
* Shows the history panel in the chat shell
|
|
43
|
+
*/
|
|
44
|
+
this.showHistory = false;
|
|
45
|
+
/**
|
|
46
|
+
* Shows the workspace panel in the chat shell
|
|
47
|
+
*/
|
|
48
|
+
this.showWorkspace = false;
|
|
49
|
+
/**
|
|
50
|
+
* Determines the location of the workspace panel ("start" or "end")
|
|
51
|
+
*/
|
|
52
|
+
this.workspaceLocation = "start";
|
|
53
|
+
/**
|
|
54
|
+
* Determines the location of the history panel ("start" or "end")
|
|
55
|
+
*/
|
|
56
|
+
this.historyLocation = "start";
|
|
57
|
+
/**
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
this.hasHeaderContent = false;
|
|
61
|
+
/**
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
this.hasHeaderAfterContent = false;
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
this.hasMessagesBeforeContent = false;
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
this.hasFooterContent = false;
|
|
73
|
+
/**
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
this.hasInputAfterContent = false;
|
|
77
|
+
/**
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
this.hasInputContent = false;
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
this.hasInputBeforeContent = false;
|
|
85
|
+
/**
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
this.hasMessagesAfterContent = false;
|
|
89
|
+
/**
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
this.inputAndMessagesAtMaxWidth = false;
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
this.shouldRenderHistory = true;
|
|
97
|
+
}
|
|
98
|
+
getWidgetClasses() {
|
|
99
|
+
const workspaceState = this.workspaceManager?.getState();
|
|
100
|
+
return [
|
|
101
|
+
"shell",
|
|
102
|
+
this.aiEnabled ? "ai-theme" : "",
|
|
103
|
+
this.showFrame ? "" : "frameless",
|
|
104
|
+
this.roundedCorners ? "rounded" : "",
|
|
105
|
+
this.hasHeaderContent || this.hasHeaderAfterContent
|
|
106
|
+
? "has-header-content"
|
|
107
|
+
: "",
|
|
108
|
+
this.hasFooterContent ? "has-footer-content" : "",
|
|
109
|
+
workspaceState?.isContracting ? "workspace-closing" : "",
|
|
110
|
+
workspaceState?.isExpanding ? "workspace-opening" : "",
|
|
111
|
+
]
|
|
112
|
+
.filter(Boolean)
|
|
113
|
+
.join(" ");
|
|
114
|
+
}
|
|
115
|
+
getInputAndMessagesClasses() {
|
|
116
|
+
return [
|
|
117
|
+
"input-and-messages",
|
|
118
|
+
this.hasMessagesBeforeContent ? "has-messages-before-content" : "",
|
|
119
|
+
this.hasMessagesAfterContent ? "has-messages-after-content" : "",
|
|
120
|
+
this.hasInputBeforeContent ? "has-input-before-content" : "",
|
|
121
|
+
this.hasInputContent ? "has-input-content" : "",
|
|
122
|
+
this.hasInputAfterContent ? "has-input-after-content" : "",
|
|
123
|
+
this.inputAndMessagesAtMaxWidth ? "at-max-width" : "",
|
|
124
|
+
]
|
|
125
|
+
.filter(Boolean)
|
|
126
|
+
.join(" ");
|
|
127
|
+
}
|
|
128
|
+
renderSlot(name, className, condition = true) {
|
|
129
|
+
if (!condition) {
|
|
130
|
+
return nothing;
|
|
131
|
+
}
|
|
132
|
+
// Determine if this slot has content
|
|
133
|
+
const hasContent = this.getSlotContentState(name);
|
|
134
|
+
const classes = [className, hasContent ? "has-content" : ""]
|
|
135
|
+
.filter(Boolean)
|
|
136
|
+
.join(" ");
|
|
137
|
+
return html `
|
|
138
|
+
<div class=${classes} part="slot-${name}" data-panel-slot=${name}>
|
|
139
|
+
<slot name=${name}></slot>
|
|
140
|
+
</div>
|
|
141
|
+
`;
|
|
142
|
+
}
|
|
143
|
+
getSlotContentState(slotName) {
|
|
144
|
+
switch (slotName) {
|
|
145
|
+
case "header":
|
|
146
|
+
return this.hasHeaderContent;
|
|
147
|
+
case "header-after":
|
|
148
|
+
return this.hasHeaderAfterContent;
|
|
149
|
+
case "messages-before":
|
|
150
|
+
return this.hasMessagesBeforeContent;
|
|
151
|
+
case "footer":
|
|
152
|
+
return this.hasFooterContent;
|
|
153
|
+
case "input-after":
|
|
154
|
+
return this.hasInputAfterContent;
|
|
155
|
+
case "input":
|
|
156
|
+
return this.hasInputContent;
|
|
157
|
+
case "input-before":
|
|
158
|
+
return this.hasInputBeforeContent;
|
|
159
|
+
case "messages-after":
|
|
160
|
+
return this.hasMessagesAfterContent;
|
|
161
|
+
case "messages":
|
|
162
|
+
return true; // messages slot is always considered to have content
|
|
163
|
+
default:
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
renderWorkspaceInline() {
|
|
168
|
+
const shouldRender = this.workspaceManager?.shouldRenderInline() ?? false;
|
|
169
|
+
if (!shouldRender) {
|
|
170
|
+
return nothing;
|
|
171
|
+
}
|
|
172
|
+
const workspaceState = this.workspaceManager?.getState();
|
|
173
|
+
return html `
|
|
174
|
+
<div class="workspace" part="slot-workspace" data-panel-slot="workspace">
|
|
175
|
+
<div
|
|
176
|
+
class=${workspaceState?.contentVisible
|
|
177
|
+
? "workspace-content"
|
|
178
|
+
: "workspace-content workspace-content--hidden"}
|
|
179
|
+
?inert=${!workspaceState?.contentVisible}
|
|
180
|
+
>
|
|
181
|
+
<slot name="workspace"></slot>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
`;
|
|
185
|
+
}
|
|
186
|
+
renderWorkspacePanel() {
|
|
187
|
+
const shouldRender = this.workspaceManager?.shouldRenderPanel() ?? false;
|
|
188
|
+
if (!shouldRender) {
|
|
189
|
+
return nothing;
|
|
190
|
+
}
|
|
191
|
+
return html `
|
|
192
|
+
<cds-aichat-panel
|
|
193
|
+
data-internal-panel
|
|
194
|
+
open
|
|
195
|
+
priority="0"
|
|
196
|
+
full-width
|
|
197
|
+
show-chat-header
|
|
198
|
+
animation-on-open="slide-in-from-bottom"
|
|
199
|
+
animation-on-close="slide-out-to-bottom"
|
|
200
|
+
>
|
|
201
|
+
<div slot="body" class="workspace-slot">
|
|
202
|
+
<slot name="workspace"></slot>
|
|
203
|
+
</div>
|
|
204
|
+
</cds-aichat-panel>
|
|
205
|
+
`;
|
|
206
|
+
}
|
|
207
|
+
renderHeader() {
|
|
208
|
+
return html `
|
|
209
|
+
<div class="header-with-header-after">
|
|
210
|
+
${this.renderHeaderSlot("header", "header")}
|
|
211
|
+
${this.renderHeaderSlot("header-after", "header-after")}
|
|
212
|
+
</div>
|
|
213
|
+
`;
|
|
214
|
+
}
|
|
215
|
+
renderHeaderSlot(name, className) {
|
|
216
|
+
const hasContent = name === "header"
|
|
217
|
+
? this.hasHeaderContent
|
|
218
|
+
: name === "header-after"
|
|
219
|
+
? this.hasHeaderAfterContent
|
|
220
|
+
: false;
|
|
221
|
+
const classes = [className, hasContent ? "has-content" : ""]
|
|
222
|
+
.filter(Boolean)
|
|
223
|
+
.join(" ");
|
|
224
|
+
return html `
|
|
225
|
+
<div class=${classes} part="slot-${name}" data-panel-slot=${name}>
|
|
226
|
+
<slot name=${name}></slot>
|
|
227
|
+
</div>
|
|
228
|
+
`;
|
|
229
|
+
}
|
|
230
|
+
renderMessagesSection() {
|
|
231
|
+
return html `
|
|
232
|
+
<div class=${this.getInputAndMessagesClasses()}>
|
|
233
|
+
${this.renderSlot("messages-before", "messages-before")}
|
|
234
|
+
${this.renderSlot("messages", "messages")}
|
|
235
|
+
${this.renderSlot("messages-after", "messages-after")}
|
|
236
|
+
${this.renderSlot("input-before", "input-before")}
|
|
237
|
+
${this.renderSlot("input", "input")}
|
|
238
|
+
${this.renderSlot("input-after", "input-after")}
|
|
239
|
+
</div>
|
|
240
|
+
`;
|
|
241
|
+
}
|
|
242
|
+
renderHistory() {
|
|
243
|
+
if (!this.showHistory || !this.shouldRenderHistory) {
|
|
244
|
+
return nothing;
|
|
245
|
+
}
|
|
246
|
+
return html `<div class="history">
|
|
247
|
+
${this.renderSlot("history", "history")}
|
|
248
|
+
</div>`;
|
|
249
|
+
}
|
|
250
|
+
render() {
|
|
251
|
+
return html `
|
|
252
|
+
<div class=${this.getWidgetClasses()}>
|
|
253
|
+
<div class="main-chat">
|
|
254
|
+
${this.renderHeader()}
|
|
255
|
+
<div class="main-content">
|
|
256
|
+
<div class="main-content-body">
|
|
257
|
+
${this.renderHistory()} ${this.renderWorkspaceInline()}
|
|
258
|
+
${this.renderMessagesSection()}
|
|
259
|
+
</div>
|
|
260
|
+
${this.renderSlot("footer", "footer")}
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
<div class="panels open" part="slot-panels">
|
|
264
|
+
${this.renderWorkspacePanel()}
|
|
265
|
+
<slot name="panels"></slot>
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
`;
|
|
269
|
+
}
|
|
270
|
+
firstUpdated(changedProperties) {
|
|
271
|
+
super.firstUpdated(changedProperties);
|
|
272
|
+
const panelsSlot = this.renderRoot.querySelector('slot[name="panels"]');
|
|
273
|
+
if (!panelsSlot) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
const widgetRoot = this.renderRoot.querySelector(".shell");
|
|
277
|
+
if (!widgetRoot) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
this.panelManager = new PanelManager(panelsSlot, widgetRoot);
|
|
281
|
+
this.panelManager.connect();
|
|
282
|
+
this.workspaceManager = new WorkspaceManager(widgetRoot, this, {
|
|
283
|
+
showWorkspace: this.showWorkspace,
|
|
284
|
+
showHistory: this.showHistory,
|
|
285
|
+
workspaceLocation: this.workspaceLocation,
|
|
286
|
+
roundedCorners: this.roundedCorners,
|
|
287
|
+
});
|
|
288
|
+
this.workspaceManager.connect();
|
|
289
|
+
this.observeHeaderHeight();
|
|
290
|
+
this.observeInputAndMessagesWidth();
|
|
291
|
+
this.observeMainContentBodyWidth();
|
|
292
|
+
this.observeSlotContent();
|
|
293
|
+
this.observeCssProperties();
|
|
294
|
+
}
|
|
295
|
+
hasSlotContent(slotName) {
|
|
296
|
+
const slot = this.renderRoot.querySelector(`slot[name="${slotName}"]`);
|
|
297
|
+
if (!slot) {
|
|
298
|
+
return false;
|
|
299
|
+
}
|
|
300
|
+
return slot
|
|
301
|
+
.assignedNodes({ flatten: true })
|
|
302
|
+
.some((node) => node.nodeType === Node.ELEMENT_NODE ||
|
|
303
|
+
(node.nodeType === Node.TEXT_NODE && node.textContent?.trim()));
|
|
304
|
+
}
|
|
305
|
+
observeSlotContent() {
|
|
306
|
+
const updateSlotStates = () => {
|
|
307
|
+
const previousStates = new Map(CdsAiChatShell_1.OBSERVED_SLOTS.map(({ stateKey }) => [
|
|
308
|
+
stateKey,
|
|
309
|
+
this[stateKey],
|
|
310
|
+
]));
|
|
311
|
+
CdsAiChatShell_1.OBSERVED_SLOTS.forEach(({ name, stateKey }) => {
|
|
312
|
+
this[stateKey] = this.hasSlotContent(name);
|
|
313
|
+
});
|
|
314
|
+
const hasChanged = CdsAiChatShell_1.OBSERVED_SLOTS.some(({ stateKey }) => previousStates.get(stateKey) !== this[stateKey]);
|
|
315
|
+
if (hasChanged) {
|
|
316
|
+
this.requestUpdate();
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
// Initial check
|
|
320
|
+
updateSlotStates();
|
|
321
|
+
// Observe slot changes
|
|
322
|
+
const slots = CdsAiChatShell_1.OBSERVED_SLOTS.map(({ name }) => this.renderRoot.querySelector(`slot[name="${name}"]`)).filter((slot) => slot !== null);
|
|
323
|
+
slots.forEach((slot) => {
|
|
324
|
+
slot.addEventListener("slotchange", updateSlotStates);
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
updated(changedProperties) {
|
|
328
|
+
super.updated(changedProperties);
|
|
329
|
+
if (changedProperties.has("showWorkspace") ||
|
|
330
|
+
changedProperties.has("showHistory") ||
|
|
331
|
+
changedProperties.has("workspaceLocation") ||
|
|
332
|
+
changedProperties.has("roundedCorners")) {
|
|
333
|
+
this.workspaceManager?.updateConfig({
|
|
334
|
+
showWorkspace: this.showWorkspace,
|
|
335
|
+
showHistory: this.showHistory,
|
|
336
|
+
workspaceLocation: this.workspaceLocation,
|
|
337
|
+
roundedCorners: this.roundedCorners,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
this.panelManager?.refresh();
|
|
341
|
+
}
|
|
342
|
+
disconnectedCallback() {
|
|
343
|
+
this.panelManager?.disconnect();
|
|
344
|
+
this.workspaceManager?.disconnect();
|
|
345
|
+
this.headerResizeObserver?.disconnect();
|
|
346
|
+
this.inputAndMessagesResizeObserver?.disconnect();
|
|
347
|
+
this.mainContentBodyResizeObserver?.disconnect();
|
|
348
|
+
this.cssPropertyObserver?.disconnect();
|
|
349
|
+
super.disconnectedCallback();
|
|
350
|
+
}
|
|
351
|
+
observeInputAndMessagesWidth() {
|
|
352
|
+
// We need to observe the :host width, not .input-and-messages width
|
|
353
|
+
// When :host < max-width, .input-and-messages fills the container and needs rounded corners
|
|
354
|
+
if (typeof ResizeObserver === "undefined") {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
const messagesMaxWidth = this.getMessagesMaxWidth();
|
|
358
|
+
const updateAtMaxWidth = (hostWidth) => {
|
|
359
|
+
// When host is less than max-width, input-and-messages is "at max width" (filling container)
|
|
360
|
+
const isAtMaxWidth = hostWidth < messagesMaxWidth;
|
|
361
|
+
if (this.inputAndMessagesAtMaxWidth !== isAtMaxWidth) {
|
|
362
|
+
this.inputAndMessagesAtMaxWidth = isAtMaxWidth;
|
|
363
|
+
this.requestUpdate();
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
const measure = () => {
|
|
367
|
+
const rect = this.getBoundingClientRect();
|
|
368
|
+
updateAtMaxWidth(rect.width);
|
|
369
|
+
};
|
|
370
|
+
this.inputAndMessagesResizeObserver = new ResizeObserver((entries) => {
|
|
371
|
+
for (const entry of entries) {
|
|
372
|
+
if (entry.target !== this) {
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
375
|
+
const borderBoxSize = Array.isArray(entry.borderBoxSize)
|
|
376
|
+
? entry.borderBoxSize[0]
|
|
377
|
+
: entry.borderBoxSize;
|
|
378
|
+
if (borderBoxSize?.inlineSize) {
|
|
379
|
+
updateAtMaxWidth(borderBoxSize.inlineSize);
|
|
380
|
+
}
|
|
381
|
+
else {
|
|
382
|
+
updateAtMaxWidth(entry.contentRect.width);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
this.inputAndMessagesResizeObserver.observe(this);
|
|
387
|
+
measure();
|
|
388
|
+
}
|
|
389
|
+
observeMainContentBodyWidth() {
|
|
390
|
+
if (typeof ResizeObserver === "undefined" || !this.showHistory) {
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
const mainContentBody = this.renderRoot.querySelector(".main-content-body");
|
|
394
|
+
if (!mainContentBody) {
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
const updateHistoryVisibility = (width) => {
|
|
398
|
+
const messagesMinWidth = this.getCssLengthFromProperty("--cds-aichat-messages-min-width", 320);
|
|
399
|
+
const historyWidth = this.getCssLengthFromProperty("--cds-aichat-history-width", 320);
|
|
400
|
+
const requiredWidth = messagesMinWidth + historyWidth;
|
|
401
|
+
const newShouldRenderHistory = width >= requiredWidth;
|
|
402
|
+
if (this.shouldRenderHistory !== newShouldRenderHistory) {
|
|
403
|
+
this.shouldRenderHistory = newShouldRenderHistory;
|
|
404
|
+
this.requestUpdate();
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
this.mainContentBodyResizeObserver = new ResizeObserver((entries) => {
|
|
408
|
+
for (const entry of entries) {
|
|
409
|
+
if (entry.target !== mainContentBody) {
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
const borderBoxSize = Array.isArray(entry.borderBoxSize)
|
|
413
|
+
? entry.borderBoxSize[0]
|
|
414
|
+
: entry.borderBoxSize;
|
|
415
|
+
if (borderBoxSize?.inlineSize) {
|
|
416
|
+
updateHistoryVisibility(borderBoxSize.inlineSize);
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
updateHistoryVisibility(entry.contentRect.width);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
this.mainContentBodyResizeObserver.observe(mainContentBody);
|
|
424
|
+
// Initial measurement
|
|
425
|
+
const rect = mainContentBody.getBoundingClientRect();
|
|
426
|
+
updateHistoryVisibility(rect.width);
|
|
427
|
+
}
|
|
428
|
+
getCssLengthFromProperty(propertyName, fallback) {
|
|
429
|
+
const value = getComputedStyle(this).getPropertyValue(propertyName).trim();
|
|
430
|
+
if (!value) {
|
|
431
|
+
return fallback;
|
|
432
|
+
}
|
|
433
|
+
const parsed = Number.parseFloat(value);
|
|
434
|
+
return Number.isNaN(parsed) ? fallback : parsed;
|
|
435
|
+
}
|
|
436
|
+
getMessagesMaxWidth() {
|
|
437
|
+
const value = getComputedStyle(this)
|
|
438
|
+
.getPropertyValue("--cds-aichat-messages-max-width")
|
|
439
|
+
.trim();
|
|
440
|
+
if (!value) {
|
|
441
|
+
return 672; // Default fallback from SCSS
|
|
442
|
+
}
|
|
443
|
+
const parsed = Number.parseFloat(value);
|
|
444
|
+
return Number.isNaN(parsed) ? 672 : parsed;
|
|
445
|
+
}
|
|
446
|
+
observeHeaderHeight() {
|
|
447
|
+
const headerWrapper = this.renderRoot.querySelector(".header-with-header-after");
|
|
448
|
+
if (!headerWrapper || typeof ResizeObserver === "undefined") {
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
const updateHeight = (height) => {
|
|
452
|
+
this.style.setProperty("--cds-aichat--header-height", `${height}px`);
|
|
453
|
+
};
|
|
454
|
+
const measure = () => {
|
|
455
|
+
const rect = headerWrapper.getBoundingClientRect();
|
|
456
|
+
updateHeight(rect.height);
|
|
457
|
+
};
|
|
458
|
+
this.headerResizeObserver = new ResizeObserver((entries) => {
|
|
459
|
+
for (const entry of entries) {
|
|
460
|
+
if (entry.target !== headerWrapper) {
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
const borderBoxSize = Array.isArray(entry.borderBoxSize)
|
|
464
|
+
? entry.borderBoxSize[0]
|
|
465
|
+
: entry.borderBoxSize;
|
|
466
|
+
if (borderBoxSize?.blockSize) {
|
|
467
|
+
updateHeight(borderBoxSize.blockSize);
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
updateHeight(entry.contentRect.height);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
this.headerResizeObserver.observe(headerWrapper);
|
|
475
|
+
measure();
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Observe CSS custom properties that affect messages max width.
|
|
479
|
+
* When --cds-aichat-messages-max-width changes, recalculate the at-max-width state.
|
|
480
|
+
*/
|
|
481
|
+
observeCssProperties() {
|
|
482
|
+
if (typeof MutationObserver === "undefined") {
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
// Store initial value
|
|
486
|
+
this.lastKnownMessagesMaxWidth = this.getMessagesMaxWidth();
|
|
487
|
+
// Watch for style attribute changes on the host element
|
|
488
|
+
this.cssPropertyObserver = new MutationObserver(() => {
|
|
489
|
+
this.checkMessagesMaxWidthChange();
|
|
490
|
+
});
|
|
491
|
+
this.cssPropertyObserver.observe(this, {
|
|
492
|
+
attributes: true,
|
|
493
|
+
attributeFilter: ["style"],
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Check if --cds-aichat-messages-max-width has changed and trigger recalculation.
|
|
498
|
+
*/
|
|
499
|
+
checkMessagesMaxWidthChange() {
|
|
500
|
+
const currentMaxWidth = this.getMessagesMaxWidth();
|
|
501
|
+
if (currentMaxWidth !== this.lastKnownMessagesMaxWidth) {
|
|
502
|
+
this.lastKnownMessagesMaxWidth = currentMaxWidth;
|
|
503
|
+
// Recalculate the at-max-width state with the new max width
|
|
504
|
+
const rect = this.getBoundingClientRect();
|
|
505
|
+
const isAtMaxWidth = rect.width < currentMaxWidth;
|
|
506
|
+
if (this.inputAndMessagesAtMaxWidth !== isAtMaxWidth) {
|
|
507
|
+
this.inputAndMessagesAtMaxWidth = isAtMaxWidth;
|
|
508
|
+
this.requestUpdate();
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
CdsAiChatShell.styles = styles;
|
|
514
|
+
/**
|
|
515
|
+
* @internal
|
|
516
|
+
*/
|
|
517
|
+
CdsAiChatShell.OBSERVED_SLOTS = [
|
|
518
|
+
{ name: "header", stateKey: "hasHeaderContent" },
|
|
519
|
+
{ name: "header-after", stateKey: "hasHeaderAfterContent" },
|
|
520
|
+
{ name: "messages-before", stateKey: "hasMessagesBeforeContent" },
|
|
521
|
+
{ name: "footer", stateKey: "hasFooterContent" },
|
|
522
|
+
{ name: "input-after", stateKey: "hasInputAfterContent" },
|
|
523
|
+
{ name: "input", stateKey: "hasInputContent" },
|
|
524
|
+
{ name: "input-before", stateKey: "hasInputBeforeContent" },
|
|
525
|
+
{ name: "messages-after", stateKey: "hasMessagesAfterContent" },
|
|
526
|
+
];
|
|
527
|
+
__decorate([
|
|
528
|
+
property({ type: Boolean, attribute: "ai-enabled", reflect: true })
|
|
529
|
+
], CdsAiChatShell.prototype, "aiEnabled", void 0);
|
|
530
|
+
__decorate([
|
|
531
|
+
property({ type: Boolean, attribute: "show-frame", reflect: true })
|
|
532
|
+
], CdsAiChatShell.prototype, "showFrame", void 0);
|
|
533
|
+
__decorate([
|
|
534
|
+
property({ type: Boolean, attribute: "rounded-corners", reflect: true })
|
|
535
|
+
], CdsAiChatShell.prototype, "roundedCorners", void 0);
|
|
536
|
+
__decorate([
|
|
537
|
+
property({ type: Boolean, attribute: "show-history", reflect: true })
|
|
538
|
+
], CdsAiChatShell.prototype, "showHistory", void 0);
|
|
539
|
+
__decorate([
|
|
540
|
+
property({ type: Boolean, attribute: "show-workspace", reflect: true })
|
|
541
|
+
], CdsAiChatShell.prototype, "showWorkspace", void 0);
|
|
542
|
+
__decorate([
|
|
543
|
+
property({ type: String, attribute: "workspace-location", reflect: true })
|
|
544
|
+
], CdsAiChatShell.prototype, "workspaceLocation", void 0);
|
|
545
|
+
__decorate([
|
|
546
|
+
property({ type: String, attribute: "history-location", reflect: true })
|
|
547
|
+
], CdsAiChatShell.prototype, "historyLocation", void 0);
|
|
548
|
+
CdsAiChatShell = CdsAiChatShell_1 = __decorate([
|
|
549
|
+
carbonElement("cds-aichat-shell")
|
|
550
|
+
], CdsAiChatShell);
|
|
551
|
+
var CdsAiChatShellElement = CdsAiChatShell;
|
|
552
|
+
|
|
553
|
+
export { CdsAiChatShellElement as default };
|
|
554
|
+
//# sourceMappingURL=cds-aichat-shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cds-aichat-shell.js","sources":["../../../../src/components/chat-shell/src/cds-aichat-shell.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;AAOG;;AAaH,IAAM,cAAc,GAAA,gBAAA,GAApB,MAAM,cAAe,SAAQ,UAAU,CAAA;AAAvC,IAAA,WAAA,GAAA;;AAiBE;;AAEG;QAEH,IAAA,CAAA,SAAS,GAAG,KAAK;AAEjB;;AAEG;QAEH,IAAA,CAAA,SAAS,GAAG,KAAK;AAEjB;;AAEG;QAEH,IAAA,CAAA,cAAc,GAAG,KAAK;AAEtB;;AAEG;QAEH,IAAA,CAAA,WAAW,GAAG,KAAK;AAEnB;;AAEG;QAEH,IAAA,CAAA,aAAa,GAAG,KAAK;AAErB;;AAEG;QAEH,IAAA,CAAA,iBAAiB,GAAe,OAAO;AAEvC;;AAEG;QAEH,IAAA,CAAA,eAAe,GAAe,OAAO;AAqCrC;;AAEG;QACK,IAAA,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,gBAAA,EAAA,MAAA,CAAA;AAMvB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE;AACjD,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAMpB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE;AACjD,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAMtB,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB,EAAE,OAAO,EAAE,IAAI,EAAE;AAClC,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,MAAA,CAAA;AAMxC,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE;AAClC,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,MAAA,CAAA;AAzDlC,cAAc,GAAA,gBAAA,GAAA,UAAA,CAAA;IADnB,aAAa,CAAC,kBAAkB;AAC3B,CAAA,EAAA,cAAc,CA4oBnB;AAED,4BAAe,cAAc;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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 { css } from 'lit';
|
|
9
|
+
|
|
10
|
+
var styles = css([":host{background:transparent;block-size:100%;box-sizing:border-box;container-type:inline-size;display:block;inline-size:100%}.shell{--cds-aichat-rounded-radius:0;--cds-aichat-rounded-radius-start-start:0;--cds-aichat-rounded-radius-start-end:0;--cds-aichat-rounded-radius-end-start:0;--cds-aichat-rounded-radius-end-end:0;background-color:var(--cds-chat-shell-background,#fff);background-image:none;block-size:100%;border:1px solid var(--cds-border-subtle-00,#e0e0e0);border-radius:var(--cds-aichat-rounded-radius,0);box-shadow:var(--cds-aichat-box-shadow,1px 0 4px hsla(0,0%,9%,.3));display:block;inline-size:100%;position:relative}[data-panel-slot]{opacity:1}[data-panel-slot][inert]{opacity:0}@media screen and (prefers-reduced-motion:no-preference){[data-panel-slot]{transition:opacity .11s cubic-bezier(.2,0,.38,.9)}}.shell.shell--panels-animating{overflow:hidden}.main-content-body{align-items:stretch;block-size:100%;display:flex;flex:1 1 0%;max-inline-size:100%;min-block-size:inherit;min-inline-size:0;overflow-x:visible;position:relative}.shell.workspace-closing .main-content-body,.shell.workspace-opening .main-content-body{overflow-x:hidden}.main-chat{align-items:stretch;block-size:100%;display:flex;flex-direction:column;inline-size:100%}.shell.ai-theme{background:linear-gradient(to top,var(--cds-chat-shell-background,var(--cds-ai-popover-background,#fff)) 0,var(--cds-ai-aura-start,rgba(69,137,255,.1)) 0,15%,var(--cds-ai-aura-end,hsla(0,0%,100%,0)) 50%) padding-box,linear-gradient(to top,var(--cds-chat-shell-background,var(--cds-ai-popover-background,#fff)),var(--cds-chat-shell-background,var(--cds-ai-popover-background,#fff))) padding-box,linear-gradient(to bottom,var(--cds-ai-border-start,rgba(166,200,255,.64)),var(--cds-ai-border-end,#78a9ff)) border-box,linear-gradient(to top,var(--cds-chat-shell-background,var(--cds-ai-popover-background,#fff)),var(--cds-chat-shell-background,var(--cds-ai-popover-background,#fff))) border-box;border:1px solid transparent;box-shadow:0 4px 10px 2px var(--cds-ai-drop-shadow,rgba(15,98,254,.1))}.shell.ai-theme,.shell.ai-theme .main-chat{background-color:var(--cds-chat-shell-background,#fff)}.shell.ai-theme .main-chat{background-image:linear-gradient(0deg,var(--cds-ai-aura-start-sm,rgba(69,137,255,.16)) 0,15%,var(--cds-ai-aura-end,hsla(0,0%,100%,0)) 50%,transparent 100%);border-block-end-color:var(--cds-ai-border-strong,#4589ff)}.shell.frameless,.shell.frameless.rounded{--cds-aichat-rounded-radius:0;--cds-aichat-rounded-radius-start-start:0;--cds-aichat-rounded-radius-start-end:0;--cds-aichat-rounded-radius-end-start:0;--cds-aichat-rounded-radius-end-end:0;border:none;border-radius:var(--cds-aichat-rounded-radius,0);box-shadow:none}.shell.rounded{--cds-aichat-rounded-radius:0.5rem;--cds-aichat-rounded-radius-start-start:0.5rem;--cds-aichat-rounded-radius-start-end:0.5rem;--cds-aichat-rounded-radius-end-start:0.5rem;--cds-aichat-rounded-radius-end-end:0.5rem}.shell.rounded,.shell.rounded .main-chat{border-radius:var(--cds-aichat-rounded-radius,0)}.shell.rounded .header-with-header-after,.shell.rounded .header-with-header-after>.header.has-content,.shell.rounded .header-with-header-after>.header:not(.has-content)+.header-after.has-content{border-start-end-radius:var(--cds-aichat-rounded-radius-start-end,0);border-start-start-radius:var(--cds-aichat-rounded-radius-start-start,0)}.shell.rounded .header-with-header-after>.header-after:not(.has-content),.shell.rounded .header-with-header-after>.header.has-content+.header-after,.shell.rounded .header-with-header-after>.header:not(.has-content){--cds-aichat-rounded-radius-start-end:0;--cds-aichat-rounded-radius-start-start:0;border-start-end-radius:0;border-start-start-radius:0}.main-content{align-items:stretch;display:flex;flex-direction:column;flex-grow:1;max-inline-size:100%;min-inline-size:0}.shell.workspace-closing .main-content-body,.shell.workspace-opening .main-content-body,:host([show-workspace]) .main-content-body{container-name:main-content-body;container-type:inline-size;flex-direction:row}:host([workspace-in-panel]) .main-content-body{flex-direction:column}.input-and-messages{align-items:stretch;block-size:100%;display:flex;flex-direction:column;flex-grow:1;inline-size:100%;margin:auto;max-inline-size:var(--cds-aichat-messages-max-width,672px);min-inline-size:var(--cds-aichat-messages-min-width,320px)}.shell.workspace-closing .input-and-messages,.shell.workspace-opening .input-and-messages,:host([show-workspace]) .input-and-messages{flex:0 0 var(--cds-aichat-messages-min-width,320px);inline-size:var(--cds-aichat-messages-min-width,320px);max-inline-size:var(--cds-aichat-messages-min-width,320px)}:host([workspace-in-panel][show-workspace]) .input-and-messages{flex:1 1 auto;inline-size:100%;max-inline-size:var(--cds-aichat-messages-max-width,672px)}.workspace{display:flex;flex-direction:column}:host([show-workspace]) .workspace{flex:1 1 auto;min-inline-size:var(--cds-aichat-workspace-min-width,640px)}.shell.workspace-closing .workspace,.shell.workspace-opening .workspace{flex:1 1 auto;min-inline-size:0}:host(:not([workspace-in-panel])[show-workspace]) .input-and-messages,:host(:not([workspace-in-panel])[show-workspace]) .workspace{box-sizing:border-box;padding-block-end:1rem;padding-block-start:1rem;padding-inline-end:1rem;padding-inline-start:1rem}:host(:not([workspace-in-panel])[show-workspace]) .workspace{padding-inline-end:0}:host([show-workspace][workspace-location=end]) .workspace,:host([workspace-location=end]) .shell.workspace-closing .workspace,:host([workspace-location=end]) .shell.workspace-opening .workspace{order:2}.history{display:flex;flex-direction:column}.history>[data-panel-slot]{block-size:100%;display:flex;flex:1;flex-direction:column;min-block-size:0}:host([show-history]) .history{flex:0 0 auto;inline-size:var(--cds-aichat-history-width,320px);max-inline-size:var(--cds-aichat-history-width,320px)}.shell.rounded .input-and-messages:not(.at-max-width),.shell.rounded.has-header-content .input-and-messages{--cds-aichat-rounded-radius-start-start:0;--cds-aichat-rounded-radius-start-end:0}.shell.rounded .input-and-messages:not(.at-max-width),.shell.rounded.has-footer-content .input-and-messages{--cds-aichat-rounded-radius-end-start:0;--cds-aichat-rounded-radius-end-end:0}:host([show-history][history-location=end]) .input-and-messages{order:1}:host([show-workspace][workspace-location=end]) .input-and-messages,:host([workspace-location=end]) .shell.workspace-closing .input-and-messages,:host([workspace-location=end]) .shell.workspace-opening .input-and-messages{order:1}:host([show-history][history-location=end]) .history{order:3}:host([show-history][show-workspace][workspace-location=end]) .workspace{order:2}:host(:not([workspace-in-panel])[show-workspace][workspace-location=end]) .workspace{padding-inline-end:1rem}:host(:not([workspace-in-panel])[show-workspace][workspace-location=end]) .input-and-messages{padding-inline-end:0}.messages{flex-grow:1}.shell.rounded:not(.has-header-content) .input-and-messages.at-max-width{--cds-aichat-rounded-radius-start-start:0.5rem;--cds-aichat-rounded-radius-start-end:0.5rem}.shell.rounded .input-and-messages.has-messages-before-content>.messages{--cds-aichat-rounded-radius-start-start:0;--cds-aichat-rounded-radius-start-end:0}.shell.rounded .main-content,.shell.rounded .main-content>.footer.has-content{border-end-end-radius:var(--cds-aichat-rounded-radius-end-end,0);border-end-start-radius:var(--cds-aichat-rounded-radius-end-start,0)}.shell.rounded .main-content>.footer:not(.has-content){--cds-aichat-rounded-radius-end-start:0;--cds-aichat-rounded-radius-end-end:0;border-end-end-radius:0;border-end-start-radius:0}.shell.rounded:not(.has-footer-content) .input-and-messages.at-max-width{--cds-aichat-rounded-radius-end-start:0.5rem;--cds-aichat-rounded-radius-end-end:0.5rem}.shell.rounded .input-and-messages>.input-after:not(.has-content),.shell.rounded .input-and-messages>.input-before:not(.has-content),.shell.rounded .input-and-messages>.input:not(.has-content),.shell.rounded .input-and-messages>.messages-after:not(.has-content){--cds-aichat-rounded-radius-end-start:0;--cds-aichat-rounded-radius-end-end:0;border-end-end-radius:0;border-end-start-radius:0}.shell.rounded .input-and-messages:not(.has-input-after-content,.has-input-content,.has-input-before-content,.has-messages-after-content)>.messages{border-end-end-radius:var(--cds-aichat-rounded-radius-end-end,0);border-end-start-radius:var(--cds-aichat-rounded-radius-end-start,0)}.shell.rounded .input-and-messages.has-input-after-content>.messages,.shell.rounded .input-and-messages:not(.has-input-after-content).has-input-content>.messages,.shell.rounded .input-and-messages:not(.has-input-after-content,.has-input-content).has-input-before-content>.messages{--cds-aichat-rounded-radius-end-start:0;--cds-aichat-rounded-radius-end-end:0;border-end-end-radius:0;border-end-start-radius:0}.shell.rounded .input-and-messages:not(.has-input-after-content)>.input.has-content,.shell.rounded .input-and-messages:not(.has-input-after-content,.has-input-content)>.input-before.has-content,.shell.rounded .input-and-messages:not(.has-input-after-content,.has-input-content,.has-input-before-content)>.messages-after.has-content,.shell.rounded .input-and-messages>.input-after.has-content{border-end-end-radius:var(--cds-aichat-rounded-radius-end-end,0);border-end-start-radius:var(--cds-aichat-rounded-radius-end-start,0)}.shell.rounded .input-and-messages.has-input-after-content>.input,.shell.rounded .input-and-messages.has-input-after-content>.input-before,.shell.rounded .input-and-messages.has-input-after-content>.messages-after,.shell.rounded .input-and-messages:not(.has-input-after-content).has-input-content>.input-before,.shell.rounded .input-and-messages:not(.has-input-after-content).has-input-content>.messages-after,.shell.rounded .input-and-messages:not(.has-input-after-content,.has-input-content).has-input-before-content>.messages-after,.shell.rounded .input-and-messages:not(.has-input-after-content,.has-input-content,.has-input-before-content).has-messages-after-content>.messages{--cds-aichat-rounded-radius-end-start:0;--cds-aichat-rounded-radius-end-end:0;border-end-end-radius:0;border-end-start-radius:0}.workspace-content,.workspace-slot{block-size:100%;inline-size:100%}.workspace-content{opacity:1}@media (prefers-reduced-motion:no-preference){.workspace-content{transition:opacity .11s cubic-bezier(.2,0,.38,.9)}}.workspace-content--hidden{opacity:0;pointer-events:none}"]);
|
|
11
|
+
|
|
12
|
+
export { styles as default };
|
|
13
|
+
//# sourceMappingURL=cds-aichat-shell.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cds-aichat-shell.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Copyright IBM Corp. 2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
export declare class PanelManager {
|
|
10
|
+
private readonly panelsSlot;
|
|
11
|
+
private readonly shellRoot;
|
|
12
|
+
private panelObservers;
|
|
13
|
+
private slotElements;
|
|
14
|
+
constructor(panelsSlot: HTMLSlotElement, shellRoot: HTMLElement);
|
|
15
|
+
connect(): void;
|
|
16
|
+
disconnect(): void;
|
|
17
|
+
refresh(): void;
|
|
18
|
+
private onSlotChange;
|
|
19
|
+
private observeAssignedPanels;
|
|
20
|
+
private stopObservingPanels;
|
|
21
|
+
private onPanelMutation;
|
|
22
|
+
private updateState;
|
|
23
|
+
private getAssignedPanelElements;
|
|
24
|
+
private getPanelStates;
|
|
25
|
+
private pickActivePanel;
|
|
26
|
+
private setInert;
|
|
27
|
+
private isPanelAnimating;
|
|
28
|
+
private syncSlotElements;
|
|
29
|
+
}
|