@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,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-custom-chat-shell-background,#fff);background-image:none;block-size:100%;border:1px solid var(--cds-custom-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-custom-chat-shell-background,var(--cds-custom-ai-popover-background,#fff)) 0,var(--cds-custom-ai-aura-start,rgba(69,137,255,.1)) 0,15%,var(--cds-custom-ai-aura-end,hsla(0,0%,100%,0)) 50%) padding-box,linear-gradient(to top,var(--cds-custom-chat-shell-background,var(--cds-custom-ai-popover-background,#fff)),var(--cds-custom-chat-shell-background,var(--cds-custom-ai-popover-background,#fff))) padding-box,linear-gradient(to bottom,var(--cds-custom-ai-border-start,rgba(166,200,255,.64)),var(--cds-custom-ai-border-end,#78a9ff)) border-box,linear-gradient(to top,var(--cds-custom-chat-shell-background,var(--cds-custom-ai-popover-background,#fff)),var(--cds-custom-chat-shell-background,var(--cds-custom-ai-popover-background,#fff))) border-box;border:1px solid transparent;box-shadow:0 4px 10px 2px var(--cds-custom-ai-drop-shadow,rgba(15,98,254,.1))}.shell.ai-theme,.shell.ai-theme .main-chat{background-color:var(--cds-custom-chat-shell-background,#fff)}.shell.ai-theme .main-chat{background-image:linear-gradient(0deg,var(--cds-custom-ai-aura-start-sm,rgba(69,137,255,.16)) 0,15%,var(--cds-custom-ai-aura-end,hsla(0,0%,100%,0)) 50%,transparent 100%);border-block-end-color:var(--cds-custom-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
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
*
|
|
11
|
+
* Copyright IBM Corp. 2025
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
class PanelManager {
|
|
17
|
+
constructor(panelsSlot, shellRoot) {
|
|
18
|
+
this.panelsSlot = panelsSlot;
|
|
19
|
+
this.shellRoot = shellRoot;
|
|
20
|
+
this.panelObservers = new Map();
|
|
21
|
+
this.slotElements = [];
|
|
22
|
+
this.onSlotChange = () => {
|
|
23
|
+
this.observeAssignedPanels();
|
|
24
|
+
this.updateState();
|
|
25
|
+
};
|
|
26
|
+
this.onPanelMutation = () => {
|
|
27
|
+
this.updateState();
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
connect() {
|
|
31
|
+
this.syncSlotElements();
|
|
32
|
+
this.panelsSlot.addEventListener("slotchange", this.onSlotChange);
|
|
33
|
+
this.observeAssignedPanels();
|
|
34
|
+
this.updateState();
|
|
35
|
+
}
|
|
36
|
+
disconnect() {
|
|
37
|
+
this.panelsSlot.removeEventListener("slotchange", this.onSlotChange);
|
|
38
|
+
this.stopObservingPanels();
|
|
39
|
+
}
|
|
40
|
+
refresh() {
|
|
41
|
+
this.observeAssignedPanels();
|
|
42
|
+
this.updateState();
|
|
43
|
+
}
|
|
44
|
+
observeAssignedPanels() {
|
|
45
|
+
const panels = this.getAssignedPanelElements();
|
|
46
|
+
const current = new Set(panels);
|
|
47
|
+
for (const [panel, observer] of this.panelObservers) {
|
|
48
|
+
if (!current.has(panel)) {
|
|
49
|
+
observer.disconnect();
|
|
50
|
+
this.panelObservers.delete(panel);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
for (const panel of panels) {
|
|
54
|
+
if (!this.panelObservers.has(panel)) {
|
|
55
|
+
const observer = new MutationObserver(this.onPanelMutation);
|
|
56
|
+
observer.observe(panel, { attributes: true });
|
|
57
|
+
this.panelObservers.set(panel, observer);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
stopObservingPanels() {
|
|
62
|
+
for (const observer of this.panelObservers.values()) {
|
|
63
|
+
observer.disconnect();
|
|
64
|
+
}
|
|
65
|
+
this.panelObservers.clear();
|
|
66
|
+
}
|
|
67
|
+
updateState() {
|
|
68
|
+
this.syncSlotElements();
|
|
69
|
+
const panels = this.getPanelStates();
|
|
70
|
+
const active = this.pickActivePanel(panels);
|
|
71
|
+
const hasActive = Boolean(active);
|
|
72
|
+
const headerInert = hasActive && !active?.showChatHeader;
|
|
73
|
+
this.slotElements.forEach((slot) => {
|
|
74
|
+
const slotName = slot.dataset.panelSlot;
|
|
75
|
+
if (slotName === "header" || slotName === "header-after") {
|
|
76
|
+
this.setInert(slot, headerInert);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.setInert(slot, hasActive);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
panels.forEach((panel) => {
|
|
83
|
+
const shouldInert = hasActive && panel.element !== active?.element && panel.open;
|
|
84
|
+
this.setInert(panel.element, shouldInert);
|
|
85
|
+
});
|
|
86
|
+
const isAnyPanelAnimating = panels.some((panelState) => this.isPanelAnimating(panelState.element));
|
|
87
|
+
this.shellRoot.classList.toggle("shell--panels-animating", isAnyPanelAnimating);
|
|
88
|
+
}
|
|
89
|
+
getAssignedPanelElements() {
|
|
90
|
+
const internalPanels = Array.from(this.shellRoot.querySelectorAll("cds-aichat-panel[data-internal-panel]"));
|
|
91
|
+
const panelsElement = this.panelsSlot
|
|
92
|
+
.assignedElements({ flatten: true })
|
|
93
|
+
.find((element) => element instanceof HTMLElement);
|
|
94
|
+
const slottedPanels = panelsElement
|
|
95
|
+
? Array.from(panelsElement.querySelectorAll("cds-aichat-panel"))
|
|
96
|
+
: [];
|
|
97
|
+
const panels = [...internalPanels, ...slottedPanels];
|
|
98
|
+
return Array.from(new Set(panels));
|
|
99
|
+
}
|
|
100
|
+
getPanelStates() {
|
|
101
|
+
const panels = this.getAssignedPanelElements();
|
|
102
|
+
return panels.map((element, index) => ({
|
|
103
|
+
element,
|
|
104
|
+
open: element.hasAttribute("open"),
|
|
105
|
+
priority: Number(element.getAttribute("priority") ?? 0),
|
|
106
|
+
showChatHeader: element.hasAttribute("show-chat-header"),
|
|
107
|
+
index,
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
pickActivePanel(panels) {
|
|
111
|
+
if (panels?.length) {
|
|
112
|
+
const sortedPanels = panels
|
|
113
|
+
.filter((panel) => panel.open)
|
|
114
|
+
.sort((a, b) => {
|
|
115
|
+
if (a.priority !== b.priority) {
|
|
116
|
+
return b.priority - a.priority;
|
|
117
|
+
}
|
|
118
|
+
return b.index - a.index;
|
|
119
|
+
});
|
|
120
|
+
return sortedPanels[0];
|
|
121
|
+
}
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
setInert(target, value) {
|
|
125
|
+
if (!target) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (value) {
|
|
129
|
+
target.inert = true;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
target.inert = false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
isPanelAnimating(panelElement) {
|
|
136
|
+
return panelElement.classList.contains("panel-container--animating");
|
|
137
|
+
}
|
|
138
|
+
syncSlotElements() {
|
|
139
|
+
this.slotElements = Array.from(this.shellRoot.querySelectorAll("[data-panel-slot]"));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export { PanelManager };
|
|
144
|
+
//# sourceMappingURL=panel-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-manager.js","sources":["../../../../src/components/chat-shell/src/panel-manager.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AAOG;MAUU,YAAY,CAAA;IAIvB,WAAA,CACmB,UAA2B,EAC3B,SAAsB,EAAA;QADtB,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,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,CAAC;YACxD,KAAK;AACN,SAAA,CAAC,CAAC;IACL;AAEQ,IAAA,eAAe,CAAC,MAAoB,EAAA;AAC1C,QAAA,IAAI,MAAM,EAAE,MAAM,EAAE;YAClB,MAAM,YAAY,GAAG;iBAClB,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI;AAC5B,iBAAA,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAI;gBACb,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ,EAAE;AAC7B,oBAAA,OAAO,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ;gBAChC;AACA,gBAAA,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK;AAC1B,YAAA,CAAC,CAAC;AAEJ,YAAA,OAAO,YAAY,CAAC,CAAC,CAAC;QACxB;QACA;IACF;IAEQ,QAAQ,CAAC,MAA+B,EAAE,KAAc,EAAA;QAC9D,IAAI,CAAC,MAAM,EAAE;YACX;QACF;QACA,IAAI,KAAK,EAAE;AACT,YAAA,MAAM,CAAC,KAAK,GAAG,IAAI;QACrB;aAAO;AACL,YAAA,MAAM,CAAC,KAAK,GAAG,KAAK;QACtB;IACF;AAEQ,IAAA,gBAAgB,CAAC,YAAyB,EAAA;QAChD,OAAO,YAAY,CAAC,SAAS,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IACtE;IAEQ,gBAAgB,GAAA;AACtB,QAAA,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI,CAC5B,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAc,mBAAmB,CAAC,CAClE;IACH;AACD;;;;"}
|
|
@@ -0,0 +1,118 @@
|
|
|
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
|
+
interface WorkspaceConfig {
|
|
10
|
+
showWorkspace: boolean;
|
|
11
|
+
showHistory: boolean;
|
|
12
|
+
workspaceLocation: "start" | "end";
|
|
13
|
+
roundedCorners: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface WorkspaceState {
|
|
16
|
+
inPanel: boolean;
|
|
17
|
+
contentVisible: boolean;
|
|
18
|
+
containerVisible: boolean;
|
|
19
|
+
isExpanding: boolean;
|
|
20
|
+
isContracting: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Manages workspace layout, responsive behavior, and transitions for cds-aichat-shell.
|
|
24
|
+
* Handles switching between inline and panel modes based on available width,
|
|
25
|
+
* and orchestrates smooth transitions when workspace visibility changes.
|
|
26
|
+
*/
|
|
27
|
+
export declare class WorkspaceManager {
|
|
28
|
+
private readonly shellRoot;
|
|
29
|
+
private readonly hostElement;
|
|
30
|
+
private config;
|
|
31
|
+
private state;
|
|
32
|
+
private hostResizeObserver?;
|
|
33
|
+
private windowResizeHandler?;
|
|
34
|
+
private expansionCheckInterval?;
|
|
35
|
+
private expansionLastInlineSize?;
|
|
36
|
+
private closingCheckInterval?;
|
|
37
|
+
private closingLastInlineSize?;
|
|
38
|
+
private throttledHandleHostResize;
|
|
39
|
+
private cssPropertyObserver?;
|
|
40
|
+
private lastKnownCssValues;
|
|
41
|
+
constructor(shellRoot: HTMLElement, hostElement: HTMLElement, config: WorkspaceConfig);
|
|
42
|
+
/**
|
|
43
|
+
* Initialize workspace management and start observing resize events.
|
|
44
|
+
* Should be called after the shell component is fully rendered.
|
|
45
|
+
*/
|
|
46
|
+
connect(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Clean up observers and timers.
|
|
49
|
+
* Should be called when the shell component is disconnected.
|
|
50
|
+
*/
|
|
51
|
+
disconnect(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Refresh workspace state and re-evaluate layout.
|
|
54
|
+
* Useful after external changes that might affect layout.
|
|
55
|
+
*/
|
|
56
|
+
refresh(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Update workspace configuration.
|
|
59
|
+
* Handles transitions when workspace visibility or related settings change.
|
|
60
|
+
*/
|
|
61
|
+
updateConfig(newConfig: Partial<WorkspaceConfig>): void;
|
|
62
|
+
/**
|
|
63
|
+
* Get current workspace state.
|
|
64
|
+
* Returns a readonly copy to prevent external mutations.
|
|
65
|
+
*/
|
|
66
|
+
getState(): Readonly<WorkspaceState>;
|
|
67
|
+
/**
|
|
68
|
+
* Check if workspace should be rendered inline (side-by-side with messages).
|
|
69
|
+
*/
|
|
70
|
+
shouldRenderInline(): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Check if workspace should be rendered as a panel (overlay).
|
|
73
|
+
*/
|
|
74
|
+
shouldRenderPanel(): boolean;
|
|
75
|
+
private observeHostWidth;
|
|
76
|
+
private setupWindowResizeListener;
|
|
77
|
+
private createHostResizeObserver;
|
|
78
|
+
private reconnectHostResizeObserver;
|
|
79
|
+
private performInitialHostMeasurement;
|
|
80
|
+
private handleHostResize;
|
|
81
|
+
private updateWorkspaceInPanelState;
|
|
82
|
+
private handleShowWorkspaceEnabled;
|
|
83
|
+
private handleShowWorkspaceDisabled;
|
|
84
|
+
private startExpansionPolling;
|
|
85
|
+
private startClosingPolling;
|
|
86
|
+
private finishWorkspaceExpansion;
|
|
87
|
+
private finishWorkspaceClosing;
|
|
88
|
+
private trackExpectedExpansion;
|
|
89
|
+
private clearExpansionTimers;
|
|
90
|
+
private clearClosingTimer;
|
|
91
|
+
private setWorkspaceInPanel;
|
|
92
|
+
private setWorkspaceContentVisible;
|
|
93
|
+
private setShowWorkspaceContainer;
|
|
94
|
+
private setState;
|
|
95
|
+
private updateShellClasses;
|
|
96
|
+
private requestHostUpdate;
|
|
97
|
+
private getRequiredMinWidth;
|
|
98
|
+
private isWideEnough;
|
|
99
|
+
private canHostGrow;
|
|
100
|
+
private finalizeImmediateDisplay;
|
|
101
|
+
private setupExpansionTracking;
|
|
102
|
+
private getInlineSizeFromEntry;
|
|
103
|
+
private getCssLengthFromProperty;
|
|
104
|
+
/**
|
|
105
|
+
* Observe CSS custom properties that affect workspace layout.
|
|
106
|
+
* When these properties change, recalculate workspace positioning.
|
|
107
|
+
*/
|
|
108
|
+
private observeCssProperties;
|
|
109
|
+
/**
|
|
110
|
+
* Update the cached CSS property values.
|
|
111
|
+
*/
|
|
112
|
+
private updateLastKnownCssValues;
|
|
113
|
+
/**
|
|
114
|
+
* Check if any relevant CSS properties have changed and trigger recalculation.
|
|
115
|
+
*/
|
|
116
|
+
private checkCssPropertyChanges;
|
|
117
|
+
}
|
|
118
|
+
export {};
|