@carbon/ai-chat-components 0.10.0 → 0.11.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.
Files changed (461) hide show
  1. package/README.md +0 -3
  2. package/custom-elements.json +4827 -2917
  3. package/es/components/card/src/card-footer.d.ts +1 -1
  4. package/es/components/card/src/card-footer.js +2 -1
  5. package/es/components/card/src/card-footer.js.map +1 -1
  6. package/es/components/card/src/card-footer.scss.js +1 -1
  7. package/es/components/card/src/card-steps.d.ts +1 -1
  8. package/es/components/card/src/card-steps.js +2 -1
  9. package/es/components/card/src/card-steps.js.map +1 -1
  10. package/es/components/card/src/card-steps.scss.js +1 -1
  11. package/es/components/card/src/card.d.ts +1 -1
  12. package/es/components/card/src/card.js +2 -1
  13. package/es/components/card/src/card.js.map +1 -1
  14. package/es/components/card/src/card.scss.js +1 -1
  15. package/es/components/chain-of-thought/src/chain-of-thought-step.d.ts +1 -1
  16. package/es/components/chain-of-thought/src/chain-of-thought-step.js +4 -5
  17. package/es/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -1
  18. package/es/components/chain-of-thought/src/chain-of-thought-toggle.d.ts +1 -1
  19. package/es/components/chain-of-thought/src/chain-of-thought-toggle.js +3 -3
  20. package/es/components/chain-of-thought/src/chain-of-thought-toggle.js.map +1 -1
  21. package/es/components/chain-of-thought/src/chain-of-thought.d.ts +1 -1
  22. package/es/components/chain-of-thought/src/chain-of-thought.js +3 -2
  23. package/es/components/chain-of-thought/src/chain-of-thought.js.map +1 -1
  24. package/es/components/chain-of-thought/src/chain-of-thought.scss.js +1 -1
  25. package/es/components/chain-of-thought/src/tool-call-data.d.ts +1 -1
  26. package/es/components/chain-of-thought/src/tool-call-data.js +2 -1
  27. package/es/components/chain-of-thought/src/tool-call-data.js.map +1 -1
  28. package/es/components/chat-button/src/chat-button.d.ts +2 -2
  29. package/es/components/chat-button/src/chat-button.js +3 -2
  30. package/es/components/chat-button/src/chat-button.js.map +1 -1
  31. package/es/components/chat-button/src/chat-button.scss.js +1 -1
  32. package/es/components/chat-shell/index.d.ts +2 -0
  33. package/es/components/chat-shell/index.js +1 -0
  34. package/es/components/chat-shell/index.js.map +1 -1
  35. package/es/components/chat-shell/src/aria-announcer-manager.d.ts +40 -0
  36. package/es/components/chat-shell/src/aria-announcer-manager.js +104 -0
  37. package/es/components/chat-shell/src/aria-announcer-manager.js.map +1 -0
  38. package/es/components/chat-shell/src/chat-header.d.ts +177 -0
  39. package/es/components/chat-shell/src/chat-header.js +415 -0
  40. package/es/components/chat-shell/src/chat-header.js.map +1 -0
  41. package/es/components/chat-shell/src/chat-header.scss.js +13 -0
  42. package/es/components/chat-shell/src/chat-header.scss.js.map +1 -0
  43. package/es/components/chat-shell/src/corner-manager.d.ts +35 -0
  44. package/es/components/chat-shell/src/corner-manager.js +87 -0
  45. package/es/components/chat-shell/src/corner-manager.js.map +1 -0
  46. package/es/components/chat-shell/src/initialization-manager.d.ts +44 -0
  47. package/es/components/chat-shell/src/initialization-manager.js +88 -0
  48. package/es/components/chat-shell/src/initialization-manager.js.map +1 -0
  49. package/es/components/chat-shell/src/panel.d.ts +14 -1
  50. package/es/components/chat-shell/src/panel.js +32 -4
  51. package/es/components/chat-shell/src/panel.js.map +1 -1
  52. package/es/components/chat-shell/src/panel.scss.js +1 -1
  53. package/es/components/chat-shell/src/resize-observer-manager.d.ts +55 -0
  54. package/es/components/chat-shell/src/resize-observer-manager.js +219 -0
  55. package/es/components/chat-shell/src/resize-observer-manager.js.map +1 -0
  56. package/es/components/chat-shell/src/shell.d.ts +54 -21
  57. package/es/components/chat-shell/src/shell.js +297 -287
  58. package/es/components/chat-shell/src/shell.js.map +1 -1
  59. package/es/components/chat-shell/src/shell.scss.js +1 -1
  60. package/es/components/chat-shell/src/slot-observer.d.ts +53 -0
  61. package/es/components/chat-shell/src/slot-observer.js +156 -0
  62. package/es/components/chat-shell/src/slot-observer.js.map +1 -0
  63. package/es/components/chat-shell/src/types.d.ts +66 -0
  64. package/es/components/chat-shell/src/types.js +8 -0
  65. package/es/components/chat-shell/src/types.js.map +1 -0
  66. package/es/components/chat-shell/src/workspace-manager.d.ts +12 -1
  67. package/es/components/chat-shell/src/workspace-manager.js +42 -2
  68. package/es/components/chat-shell/src/workspace-manager.js.map +1 -1
  69. package/es/components/code-snippet/index.d.ts +3 -2
  70. package/es/components/code-snippet/index.js +1 -1
  71. package/es/components/code-snippet/src/code-snippet.d.ts +58 -15
  72. package/es/components/code-snippet/src/code-snippet.js +261 -95
  73. package/es/components/code-snippet/src/code-snippet.js.map +1 -1
  74. package/es/components/code-snippet/src/code-snippet.scss.js +1 -1
  75. package/es/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +1 -1
  76. package/es/components/code-snippet/src/codemirror/codemirror-runtime.js +1 -1
  77. package/es/components/code-snippet/src/codemirror/editor-manager.d.ts +4 -2
  78. package/es/components/code-snippet/src/codemirror/editor-manager.js +18 -3
  79. package/es/components/code-snippet/src/codemirror/editor-manager.js.map +1 -1
  80. package/es/components/code-snippet/src/codemirror/language-controller.d.ts +1 -0
  81. package/es/components/code-snippet/src/codemirror/language-controller.js +11 -5
  82. package/es/components/code-snippet/src/codemirror/language-controller.js.map +1 -1
  83. package/es/components/code-snippet/src/codemirror/marker-utils.js +2 -1
  84. package/es/components/code-snippet/src/codemirror/marker-utils.js.map +1 -1
  85. package/es/components/code-snippet/src/codemirror/theme.d.ts +12 -0
  86. package/es/components/code-snippet/src/codemirror/theme.js +26 -2
  87. package/es/components/code-snippet/src/codemirror/theme.js.map +1 -1
  88. package/es/components/code-snippet/src/dom-utils.d.ts +1 -0
  89. package/es/components/code-snippet/src/dom-utils.js +12 -1
  90. package/es/components/code-snippet/src/dom-utils.js.map +1 -1
  91. package/es/components/code-snippet/src/layout-utils.d.ts +9 -1
  92. package/es/components/code-snippet/src/layout-utils.js +21 -16
  93. package/es/components/code-snippet/src/layout-utils.js.map +1 -1
  94. package/es/components/code-snippet/src/streaming-manager.js +7 -0
  95. package/es/components/code-snippet/src/streaming-manager.js.map +1 -1
  96. package/es/components/feedback/src/feedback-buttons.d.ts +2 -0
  97. package/es/components/feedback/src/feedback-buttons.js +65 -3
  98. package/es/components/feedback/src/feedback-buttons.js.map +1 -1
  99. package/es/components/feedback/src/feedback-buttons.scss.js +13 -0
  100. package/es/components/feedback/src/feedback-buttons.scss.js.map +1 -0
  101. package/es/components/feedback/src/feedback.d.ts +20 -10
  102. package/es/components/feedback/src/feedback.js +114 -20
  103. package/es/components/feedback/src/feedback.js.map +1 -1
  104. package/es/components/feedback/src/feedback.scss.js +1 -1
  105. package/es/components/markdown/src/markdown-renderer.d.ts +31 -21
  106. package/es/components/markdown/src/markdown-renderer.js +57 -48
  107. package/es/components/markdown/src/markdown-renderer.js.map +1 -1
  108. package/es/components/markdown/src/markdown.d.ts +34 -31
  109. package/es/components/markdown/src/markdown.js +221 -138
  110. package/es/components/markdown/src/markdown.js.map +1 -1
  111. package/es/components/markdown/src/markdown.scss.js +1 -1
  112. package/es/components/markdown/src/markdown.template.js +1 -1
  113. package/es/components/markdown/src/utils.d.ts +0 -4
  114. package/es/components/markdown/src/utils.js +1 -7
  115. package/es/components/markdown/src/utils.js.map +1 -1
  116. package/es/components/processing/src/processing.d.ts +1 -1
  117. package/es/components/processing/src/processing.js +2 -1
  118. package/es/components/processing/src/processing.js.map +1 -1
  119. package/es/components/processing/src/processing.scss.js +1 -1
  120. package/es/components/reasoning-steps/src/reasoning-step.d.ts +1 -1
  121. package/es/components/reasoning-steps/src/reasoning-step.js +2 -1
  122. package/es/components/reasoning-steps/src/reasoning-step.js.map +1 -1
  123. package/es/components/reasoning-steps/src/reasoning-steps-toggle.d.ts +1 -1
  124. package/es/components/reasoning-steps/src/reasoning-steps-toggle.js +27 -4
  125. package/es/components/reasoning-steps/src/reasoning-steps-toggle.js.map +1 -1
  126. package/es/components/reasoning-steps/src/reasoning-steps-toggle.scss.js +1 -1
  127. package/es/components/reasoning-steps/src/reasoning-steps.d.ts +1 -1
  128. package/es/components/reasoning-steps/src/reasoning-steps.js +3 -5
  129. package/es/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
  130. package/es/components/table/src/table-pagination.template.js +3 -2
  131. package/es/components/table/src/table-pagination.template.js.map +1 -1
  132. package/es/components/table/src/table-skeleton.template.js +8 -6
  133. package/es/components/table/src/table-skeleton.template.js.map +1 -1
  134. package/es/components/table/src/table.d.ts +29 -3
  135. package/es/components/table/src/table.js +99 -6
  136. package/es/components/table/src/table.js.map +1 -1
  137. package/es/components/table/src/table.scss.js +1 -1
  138. package/es/components/table/src/table.template.js +11 -2
  139. package/es/components/table/src/table.template.js.map +1 -1
  140. package/es/components/toolbar/src/toolbar.d.ts +32 -5
  141. package/es/components/toolbar/src/toolbar.js +111 -47
  142. package/es/components/toolbar/src/toolbar.js.map +1 -1
  143. package/es/components/toolbar/src/toolbar.scss.js +1 -1
  144. package/es/components/truncated-text/index.d.ts +9 -0
  145. package/es/components/truncated-text/index.js +9 -0
  146. package/es/components/truncated-text/index.js.map +1 -0
  147. package/es/components/truncated-text/src/truncated-text.d.ts +81 -0
  148. package/es/components/truncated-text/src/truncated-text.js +282 -0
  149. package/es/components/truncated-text/src/truncated-text.js.map +1 -0
  150. package/es/components/truncated-text/src/truncated-text.scss.js +13 -0
  151. package/es/components/truncated-text/src/truncated-text.scss.js.map +1 -0
  152. package/es/components/workspace-shell/src/header-collapsible-manager.d.ts +77 -0
  153. package/es/components/workspace-shell/src/header-collapsible-manager.js +223 -0
  154. package/es/components/workspace-shell/src/header-collapsible-manager.js.map +1 -0
  155. package/es/components/workspace-shell/src/workspace-shell-body.d.ts +1 -1
  156. package/es/components/workspace-shell/src/workspace-shell-body.js +2 -1
  157. package/es/components/workspace-shell/src/workspace-shell-body.js.map +1 -1
  158. package/es/components/workspace-shell/src/workspace-shell-footer.d.ts +1 -3
  159. package/es/components/workspace-shell/src/workspace-shell-footer.js +8 -6
  160. package/es/components/workspace-shell/src/workspace-shell-footer.js.map +1 -1
  161. package/es/components/workspace-shell/src/workspace-shell-footer.scss.js +1 -1
  162. package/es/components/workspace-shell/src/workspace-shell-header.d.ts +11 -1
  163. package/es/components/workspace-shell/src/workspace-shell-header.js +88 -14
  164. package/es/components/workspace-shell/src/workspace-shell-header.js.map +1 -1
  165. package/es/components/workspace-shell/src/workspace-shell-header.scss.js +1 -1
  166. package/es/components/workspace-shell/src/workspace-shell.d.ts +16 -2
  167. package/es/components/workspace-shell/src/workspace-shell.js +77 -7
  168. package/es/components/workspace-shell/src/workspace-shell.js.map +1 -1
  169. package/es/components/workspace-shell/src/workspace-shell.scss.js +1 -1
  170. package/es/globals/scss/common.scss.js +13 -0
  171. package/es/globals/scss/common.scss.js.map +1 -0
  172. package/es/globals/utils/focus-utils.d.ts +57 -0
  173. package/es/globals/utils/focus-utils.js +180 -0
  174. package/es/globals/utils/focus-utils.js.map +1 -0
  175. package/es/react/card.d.ts +3 -6
  176. package/es/react/chain-of-thought-step.d.ts +1 -2
  177. package/es/react/chain-of-thought-toggle.d.ts +1 -2
  178. package/es/react/chain-of-thought.d.ts +1 -2
  179. package/es/react/chat-button.d.ts +2 -2
  180. package/es/react/chat-button.js +1 -1
  181. package/es/react/chat-header.d.ts +73 -0
  182. package/es/react/chat-header.js +55 -0
  183. package/es/react/chat-header.js.map +1 -0
  184. package/es/react/chat-shell.d.ts +1 -2
  185. package/es/react/code-snippet.d.ts +35 -2
  186. package/es/react/code-snippet.js +65 -9
  187. package/es/react/code-snippet.js.map +1 -1
  188. package/es/react/feedback-buttons.d.ts +1 -2
  189. package/es/react/feedback.d.ts +1 -2
  190. package/es/react/markdown.d.ts +1 -2
  191. package/es/react/markdown.js +11 -1
  192. package/es/react/markdown.js.map +1 -1
  193. package/es/react/panel.d.ts +1 -2
  194. package/es/react/processing.d.ts +1 -2
  195. package/es/react/reasoning-step.d.ts +1 -2
  196. package/es/react/reasoning-steps-toggle.d.ts +1 -2
  197. package/es/react/reasoning-steps.d.ts +1 -2
  198. package/es/react/tool-call-data.d.ts +1 -2
  199. package/es/react/toolbar.d.ts +14 -10
  200. package/es/react/toolbar.js +2 -0
  201. package/es/react/toolbar.js.map +1 -1
  202. package/es/react/utils/withWebComponentBridge.d.ts +5 -2
  203. package/es/react/utils/withWebComponentBridge.js +49 -1
  204. package/es/react/utils/withWebComponentBridge.js.map +1 -1
  205. package/es/react/workspace-shell.d.ts +4 -8
  206. package/es/testing/PageObjectId.d.ts +22 -0
  207. package/es/testing/PageObjectId.js +38 -0
  208. package/es/testing/PageObjectId.js.map +1 -0
  209. package/es/typings/overflow-menu.d.ts +30 -0
  210. package/es/typings/overflow-menu.js +8 -0
  211. package/es/typings/overflow-menu.js.map +1 -0
  212. package/es-custom/components/card/src/card-footer.d.ts +1 -1
  213. package/es-custom/components/card/src/card-footer.js +2 -1
  214. package/es-custom/components/card/src/card-footer.js.map +1 -1
  215. package/es-custom/components/card/src/card-footer.scss.js +1 -1
  216. package/es-custom/components/card/src/card-steps.d.ts +1 -1
  217. package/es-custom/components/card/src/card-steps.js +2 -1
  218. package/es-custom/components/card/src/card-steps.js.map +1 -1
  219. package/es-custom/components/card/src/card-steps.scss.js +1 -1
  220. package/es-custom/components/card/src/card.d.ts +1 -1
  221. package/es-custom/components/card/src/card.js +2 -1
  222. package/es-custom/components/card/src/card.js.map +1 -1
  223. package/es-custom/components/card/src/card.scss.js +1 -1
  224. package/es-custom/components/chain-of-thought/src/chain-of-thought-step.d.ts +1 -1
  225. package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js +4 -5
  226. package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -1
  227. package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.d.ts +1 -1
  228. package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js +3 -3
  229. package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js.map +1 -1
  230. package/es-custom/components/chain-of-thought/src/chain-of-thought.d.ts +1 -1
  231. package/es-custom/components/chain-of-thought/src/chain-of-thought.js +3 -2
  232. package/es-custom/components/chain-of-thought/src/chain-of-thought.js.map +1 -1
  233. package/es-custom/components/chain-of-thought/src/chain-of-thought.scss.js +1 -1
  234. package/es-custom/components/chain-of-thought/src/tool-call-data.d.ts +1 -1
  235. package/es-custom/components/chain-of-thought/src/tool-call-data.js +2 -1
  236. package/es-custom/components/chain-of-thought/src/tool-call-data.js.map +1 -1
  237. package/es-custom/components/chat-button/src/chat-button.d.ts +2 -2
  238. package/es-custom/components/chat-button/src/chat-button.js +3 -2
  239. package/es-custom/components/chat-button/src/chat-button.js.map +1 -1
  240. package/es-custom/components/chat-button/src/chat-button.scss.js +1 -1
  241. package/es-custom/components/chat-shell/index.d.ts +2 -0
  242. package/es-custom/components/chat-shell/index.js +1 -0
  243. package/es-custom/components/chat-shell/index.js.map +1 -1
  244. package/es-custom/components/chat-shell/src/aria-announcer-manager.d.ts +40 -0
  245. package/es-custom/components/chat-shell/src/aria-announcer-manager.js +104 -0
  246. package/es-custom/components/chat-shell/src/aria-announcer-manager.js.map +1 -0
  247. package/es-custom/components/chat-shell/src/chat-header.d.ts +177 -0
  248. package/es-custom/components/chat-shell/src/chat-header.js +415 -0
  249. package/es-custom/components/chat-shell/src/chat-header.js.map +1 -0
  250. package/es-custom/components/chat-shell/src/chat-header.scss.js +13 -0
  251. package/es-custom/components/chat-shell/src/chat-header.scss.js.map +1 -0
  252. package/es-custom/components/chat-shell/src/corner-manager.d.ts +35 -0
  253. package/es-custom/components/chat-shell/src/corner-manager.js +87 -0
  254. package/es-custom/components/chat-shell/src/corner-manager.js.map +1 -0
  255. package/es-custom/components/chat-shell/src/initialization-manager.d.ts +44 -0
  256. package/es-custom/components/chat-shell/src/initialization-manager.js +88 -0
  257. package/es-custom/components/chat-shell/src/initialization-manager.js.map +1 -0
  258. package/es-custom/components/chat-shell/src/panel.d.ts +14 -1
  259. package/es-custom/components/chat-shell/src/panel.js +32 -4
  260. package/es-custom/components/chat-shell/src/panel.js.map +1 -1
  261. package/es-custom/components/chat-shell/src/panel.scss.js +1 -1
  262. package/es-custom/components/chat-shell/src/resize-observer-manager.d.ts +55 -0
  263. package/es-custom/components/chat-shell/src/resize-observer-manager.js +219 -0
  264. package/es-custom/components/chat-shell/src/resize-observer-manager.js.map +1 -0
  265. package/es-custom/components/chat-shell/src/shell.d.ts +54 -21
  266. package/es-custom/components/chat-shell/src/shell.js +297 -287
  267. package/es-custom/components/chat-shell/src/shell.js.map +1 -1
  268. package/es-custom/components/chat-shell/src/shell.scss.js +1 -1
  269. package/es-custom/components/chat-shell/src/slot-observer.d.ts +53 -0
  270. package/es-custom/components/chat-shell/src/slot-observer.js +156 -0
  271. package/es-custom/components/chat-shell/src/slot-observer.js.map +1 -0
  272. package/es-custom/components/chat-shell/src/types.d.ts +66 -0
  273. package/es-custom/components/chat-shell/src/types.js +8 -0
  274. package/es-custom/components/chat-shell/src/types.js.map +1 -0
  275. package/es-custom/components/chat-shell/src/workspace-manager.d.ts +12 -1
  276. package/es-custom/components/chat-shell/src/workspace-manager.js +42 -2
  277. package/es-custom/components/chat-shell/src/workspace-manager.js.map +1 -1
  278. package/es-custom/components/code-snippet/index.d.ts +3 -2
  279. package/es-custom/components/code-snippet/index.js +1 -1
  280. package/es-custom/components/code-snippet/src/code-snippet.d.ts +58 -15
  281. package/es-custom/components/code-snippet/src/code-snippet.js +261 -95
  282. package/es-custom/components/code-snippet/src/code-snippet.js.map +1 -1
  283. package/es-custom/components/code-snippet/src/code-snippet.scss.js +1 -1
  284. package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +1 -1
  285. package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.js +1 -1
  286. package/es-custom/components/code-snippet/src/codemirror/editor-manager.d.ts +4 -2
  287. package/es-custom/components/code-snippet/src/codemirror/editor-manager.js +18 -3
  288. package/es-custom/components/code-snippet/src/codemirror/editor-manager.js.map +1 -1
  289. package/es-custom/components/code-snippet/src/codemirror/language-controller.d.ts +1 -0
  290. package/es-custom/components/code-snippet/src/codemirror/language-controller.js +11 -5
  291. package/es-custom/components/code-snippet/src/codemirror/language-controller.js.map +1 -1
  292. package/es-custom/components/code-snippet/src/codemirror/marker-utils.js +2 -1
  293. package/es-custom/components/code-snippet/src/codemirror/marker-utils.js.map +1 -1
  294. package/es-custom/components/code-snippet/src/codemirror/theme.d.ts +12 -0
  295. package/es-custom/components/code-snippet/src/codemirror/theme.js +26 -2
  296. package/es-custom/components/code-snippet/src/codemirror/theme.js.map +1 -1
  297. package/es-custom/components/code-snippet/src/dom-utils.d.ts +1 -0
  298. package/es-custom/components/code-snippet/src/dom-utils.js +12 -1
  299. package/es-custom/components/code-snippet/src/dom-utils.js.map +1 -1
  300. package/es-custom/components/code-snippet/src/layout-utils.d.ts +9 -1
  301. package/es-custom/components/code-snippet/src/layout-utils.js +21 -16
  302. package/es-custom/components/code-snippet/src/layout-utils.js.map +1 -1
  303. package/es-custom/components/code-snippet/src/streaming-manager.js +7 -0
  304. package/es-custom/components/code-snippet/src/streaming-manager.js.map +1 -1
  305. package/es-custom/components/feedback/src/feedback-buttons.d.ts +2 -0
  306. package/es-custom/components/feedback/src/feedback-buttons.js +65 -3
  307. package/es-custom/components/feedback/src/feedback-buttons.js.map +1 -1
  308. package/es-custom/components/feedback/src/feedback-buttons.scss.js +13 -0
  309. package/es-custom/components/feedback/src/feedback-buttons.scss.js.map +1 -0
  310. package/es-custom/components/feedback/src/feedback.d.ts +20 -10
  311. package/es-custom/components/feedback/src/feedback.js +114 -20
  312. package/es-custom/components/feedback/src/feedback.js.map +1 -1
  313. package/es-custom/components/feedback/src/feedback.scss.js +1 -1
  314. package/es-custom/components/markdown/src/markdown-renderer.d.ts +31 -21
  315. package/es-custom/components/markdown/src/markdown-renderer.js +57 -48
  316. package/es-custom/components/markdown/src/markdown-renderer.js.map +1 -1
  317. package/es-custom/components/markdown/src/markdown.d.ts +34 -31
  318. package/es-custom/components/markdown/src/markdown.js +221 -138
  319. package/es-custom/components/markdown/src/markdown.js.map +1 -1
  320. package/es-custom/components/markdown/src/markdown.scss.js +1 -1
  321. package/es-custom/components/markdown/src/markdown.template.js +1 -1
  322. package/es-custom/components/markdown/src/utils.d.ts +0 -4
  323. package/es-custom/components/markdown/src/utils.js +1 -7
  324. package/es-custom/components/markdown/src/utils.js.map +1 -1
  325. package/es-custom/components/processing/src/processing.d.ts +1 -1
  326. package/es-custom/components/processing/src/processing.js +2 -1
  327. package/es-custom/components/processing/src/processing.js.map +1 -1
  328. package/es-custom/components/processing/src/processing.scss.js +1 -1
  329. package/es-custom/components/reasoning-steps/src/reasoning-step.d.ts +1 -1
  330. package/es-custom/components/reasoning-steps/src/reasoning-step.js +2 -1
  331. package/es-custom/components/reasoning-steps/src/reasoning-step.js.map +1 -1
  332. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.d.ts +1 -1
  333. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js +27 -4
  334. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js.map +1 -1
  335. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.scss.js +1 -1
  336. package/es-custom/components/reasoning-steps/src/reasoning-steps.d.ts +1 -1
  337. package/es-custom/components/reasoning-steps/src/reasoning-steps.js +3 -5
  338. package/es-custom/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
  339. package/es-custom/components/table/src/table-pagination.template.js +3 -2
  340. package/es-custom/components/table/src/table-pagination.template.js.map +1 -1
  341. package/es-custom/components/table/src/table-skeleton.template.js +8 -6
  342. package/es-custom/components/table/src/table-skeleton.template.js.map +1 -1
  343. package/es-custom/components/table/src/table.d.ts +29 -3
  344. package/es-custom/components/table/src/table.js +99 -6
  345. package/es-custom/components/table/src/table.js.map +1 -1
  346. package/es-custom/components/table/src/table.scss.js +1 -1
  347. package/es-custom/components/table/src/table.template.js +11 -2
  348. package/es-custom/components/table/src/table.template.js.map +1 -1
  349. package/es-custom/components/toolbar/src/toolbar.d.ts +32 -5
  350. package/es-custom/components/toolbar/src/toolbar.js +111 -47
  351. package/es-custom/components/toolbar/src/toolbar.js.map +1 -1
  352. package/es-custom/components/toolbar/src/toolbar.scss.js +1 -1
  353. package/es-custom/components/truncated-text/index.d.ts +9 -0
  354. package/es-custom/components/truncated-text/index.js +9 -0
  355. package/es-custom/components/truncated-text/index.js.map +1 -0
  356. package/es-custom/components/truncated-text/src/truncated-text.d.ts +81 -0
  357. package/es-custom/components/truncated-text/src/truncated-text.js +282 -0
  358. package/es-custom/components/truncated-text/src/truncated-text.js.map +1 -0
  359. package/es-custom/components/truncated-text/src/truncated-text.scss.js +13 -0
  360. package/es-custom/components/truncated-text/src/truncated-text.scss.js.map +1 -0
  361. package/es-custom/components/workspace-shell/src/header-collapsible-manager.d.ts +77 -0
  362. package/es-custom/components/workspace-shell/src/header-collapsible-manager.js +223 -0
  363. package/es-custom/components/workspace-shell/src/header-collapsible-manager.js.map +1 -0
  364. package/es-custom/components/workspace-shell/src/workspace-shell-body.d.ts +1 -1
  365. package/es-custom/components/workspace-shell/src/workspace-shell-body.js +2 -1
  366. package/es-custom/components/workspace-shell/src/workspace-shell-body.js.map +1 -1
  367. package/es-custom/components/workspace-shell/src/workspace-shell-footer.d.ts +1 -3
  368. package/es-custom/components/workspace-shell/src/workspace-shell-footer.js +8 -6
  369. package/es-custom/components/workspace-shell/src/workspace-shell-footer.js.map +1 -1
  370. package/es-custom/components/workspace-shell/src/workspace-shell-footer.scss.js +1 -1
  371. package/es-custom/components/workspace-shell/src/workspace-shell-header.d.ts +11 -1
  372. package/es-custom/components/workspace-shell/src/workspace-shell-header.js +88 -14
  373. package/es-custom/components/workspace-shell/src/workspace-shell-header.js.map +1 -1
  374. package/es-custom/components/workspace-shell/src/workspace-shell-header.scss.js +1 -1
  375. package/es-custom/components/workspace-shell/src/workspace-shell.d.ts +16 -2
  376. package/es-custom/components/workspace-shell/src/workspace-shell.js +77 -7
  377. package/es-custom/components/workspace-shell/src/workspace-shell.js.map +1 -1
  378. package/es-custom/components/workspace-shell/src/workspace-shell.scss.js +1 -1
  379. package/es-custom/globals/scss/common.scss.js +13 -0
  380. package/es-custom/globals/scss/common.scss.js.map +1 -0
  381. package/es-custom/globals/utils/focus-utils.d.ts +57 -0
  382. package/es-custom/globals/utils/focus-utils.js +180 -0
  383. package/es-custom/globals/utils/focus-utils.js.map +1 -0
  384. package/es-custom/react/card.d.ts +3 -6
  385. package/es-custom/react/chain-of-thought-step.d.ts +1 -2
  386. package/es-custom/react/chain-of-thought-toggle.d.ts +1 -2
  387. package/es-custom/react/chain-of-thought.d.ts +1 -2
  388. package/es-custom/react/chat-button.d.ts +2 -2
  389. package/es-custom/react/chat-button.js +1 -1
  390. package/es-custom/react/chat-header.d.ts +73 -0
  391. package/es-custom/react/chat-header.js +55 -0
  392. package/es-custom/react/chat-header.js.map +1 -0
  393. package/es-custom/react/chat-shell.d.ts +1 -2
  394. package/es-custom/react/code-snippet.d.ts +35 -2
  395. package/es-custom/react/code-snippet.js +65 -9
  396. package/es-custom/react/code-snippet.js.map +1 -1
  397. package/es-custom/react/feedback-buttons.d.ts +1 -2
  398. package/es-custom/react/feedback.d.ts +1 -2
  399. package/es-custom/react/markdown.d.ts +1 -2
  400. package/es-custom/react/markdown.js +11 -1
  401. package/es-custom/react/markdown.js.map +1 -1
  402. package/es-custom/react/panel.d.ts +1 -2
  403. package/es-custom/react/processing.d.ts +1 -2
  404. package/es-custom/react/reasoning-step.d.ts +1 -2
  405. package/es-custom/react/reasoning-steps-toggle.d.ts +1 -2
  406. package/es-custom/react/reasoning-steps.d.ts +1 -2
  407. package/es-custom/react/tool-call-data.d.ts +1 -2
  408. package/es-custom/react/toolbar.d.ts +14 -10
  409. package/es-custom/react/toolbar.js +2 -0
  410. package/es-custom/react/toolbar.js.map +1 -1
  411. package/es-custom/react/utils/withWebComponentBridge.d.ts +5 -2
  412. package/es-custom/react/utils/withWebComponentBridge.js +49 -1
  413. package/es-custom/react/utils/withWebComponentBridge.js.map +1 -1
  414. package/es-custom/react/workspace-shell.d.ts +4 -8
  415. package/es-custom/testing/PageObjectId.d.ts +22 -0
  416. package/es-custom/testing/PageObjectId.js +38 -0
  417. package/es-custom/testing/PageObjectId.js.map +1 -0
  418. package/es-custom/typings/overflow-menu.d.ts +30 -0
  419. package/es-custom/typings/overflow-menu.js +8 -0
  420. package/es-custom/typings/overflow-menu.js.map +1 -0
  421. package/package.json +6 -4
  422. package/scss/_custom-properties.scss +70 -0
  423. package/scss/_modifiers.scss +231 -0
  424. package/scss/_tokens-component.scss +30 -0
  425. package/scss/_tokens-layout.scss +29 -0
  426. package/scss/_utilities.scss +32 -0
  427. package/scss/common.scss +150 -0
  428. package/scss/grid.scss +11 -0
  429. package/scss/themes.scss +33 -0
  430. package/scss/vars.scss +12 -0
  431. package/telemetry.yml +73 -33
  432. package/es/components/code-snippet/src/code-snippet-card.d.ts +0 -63
  433. package/es/components/code-snippet/src/code-snippet-card.js +0 -187
  434. package/es/components/code-snippet/src/code-snippet-card.js.map +0 -1
  435. package/es/components/feedback/src/feedback-buttons.template.d.ts +0 -4
  436. package/es/components/feedback/src/feedback-buttons.template.js +0 -79
  437. package/es/components/feedback/src/feedback-buttons.template.js.map +0 -1
  438. package/es/components/feedback/src/feedback.template.d.ts +0 -12
  439. package/es/components/feedback/src/feedback.template.js +0 -115
  440. package/es/components/feedback/src/feedback.template.js.map +0 -1
  441. package/es/components/reasoning-steps/src/reasoning-steps-toggle.template.d.ts +0 -3
  442. package/es/components/reasoning-steps/src/reasoning-steps-toggle.template.js +0 -43
  443. package/es/components/reasoning-steps/src/reasoning-steps-toggle.template.js.map +0 -1
  444. package/es/react/code-snippet-card.d.ts +0 -4
  445. package/es/react/code-snippet-card.js +0 -31
  446. package/es/react/code-snippet-card.js.map +0 -1
  447. package/es-custom/components/code-snippet/src/code-snippet-card.d.ts +0 -63
  448. package/es-custom/components/code-snippet/src/code-snippet-card.js +0 -187
  449. package/es-custom/components/code-snippet/src/code-snippet-card.js.map +0 -1
  450. package/es-custom/components/feedback/src/feedback-buttons.template.d.ts +0 -4
  451. package/es-custom/components/feedback/src/feedback-buttons.template.js +0 -79
  452. package/es-custom/components/feedback/src/feedback-buttons.template.js.map +0 -1
  453. package/es-custom/components/feedback/src/feedback.template.d.ts +0 -12
  454. package/es-custom/components/feedback/src/feedback.template.js +0 -115
  455. package/es-custom/components/feedback/src/feedback.template.js.map +0 -1
  456. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.d.ts +0 -3
  457. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.js +0 -43
  458. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.js.map +0 -1
  459. package/es-custom/react/code-snippet-card.d.ts +0 -4
  460. package/es-custom/react/code-snippet-card.js +0 -31
  461. package/es-custom/react/code-snippet-card.js.map +0 -1
@@ -7,11 +7,18 @@
7
7
 
8
8
  import { __decorate } from 'tslib';
9
9
  import { LitElement, nothing, html } from 'lit';
10
- import { property } from 'lit/decorators.js';
10
+ import { property, state } from 'lit/decorators.js';
11
+ import commonStyles from '../../../globals/scss/common.scss.js';
11
12
  import styles from './shell.scss.js';
12
13
  import { PanelManager } from './panel-manager.js';
13
14
  import { WorkspaceManager } from './workspace-manager.js';
15
+ import { CornerManager } from './corner-manager.js';
16
+ import { SlotObserver } from './slot-observer.js';
17
+ import { InitializationManager } from './initialization-manager.js';
18
+ import { ResizeObserverManager } from './resize-observer-manager.js';
19
+ import { AriaAnnouncerManager } from './aria-announcer-manager.js';
14
20
  import { carbonElement } from '../../../globals/decorators/carbon-element.js';
21
+ import prefix from '../../../globals/settings.js';
15
22
  import './panel.js';
16
23
 
17
24
  /**
@@ -35,9 +42,10 @@ let CDSAIChatShell = CDSAIChatShell_1 = class CDSAIChatShell extends LitElement
35
42
  */
36
43
  this.showFrame = false;
37
44
  /**
38
- * Applies rounded corners to the chat shell
45
+ * Sets the corner style for all corners. Individual corner-* attributes override this value.
46
+ * Values: "round" or "square". Defaults to "square".
39
47
  */
40
- this.roundedCorners = false;
48
+ this.cornerAll = "square";
41
49
  /**
42
50
  * Shows the history panel in the chat shell
43
51
  */
@@ -67,33 +75,49 @@ let CDSAIChatShell = CDSAIChatShell_1 = class CDSAIChatShell extends LitElement
67
75
  */
68
76
  this.messagesAriaLabel = "Chat messages";
69
77
  /**
70
- * Constrains content to a maximum width. When false, input and related
71
- * slots will extend to full container width without max-width constraints.
78
+ * Announcement text for when a panel opens
72
79
  */
73
- this.contentMaxWidth = true;
80
+ this.panelOpenedAnnouncement = "Panel opened";
74
81
  /**
75
- * @internal
82
+ * Announcement text for when a panel closes
76
83
  */
77
- this.hasHeaderContent = false;
84
+ this.panelClosedAnnouncement = "Panel closed";
78
85
  /**
79
- * @internal
86
+ * Announcement text for when workspace opens
80
87
  */
81
- this.hasHeaderAfterContent = false;
88
+ this.workspaceOpenedAnnouncement = "Workspace opened";
82
89
  /**
83
- * @internal
90
+ * Announcement text for when workspace closes
84
91
  */
85
- this.hasFooterContent = false;
92
+ this.workspaceClosedAnnouncement = "Workspace closed, returned to chat";
86
93
  /**
87
- * @internal
94
+ * Announcement text for when history becomes visible
88
95
  */
89
- this.hasInputAfterContent = false;
96
+ this.historyShownAnnouncement = "Conversation history is now visible";
97
+ /**
98
+ * Announcement text for when history becomes hidden
99
+ */
100
+ this.historyHiddenAnnouncement = "Conversation history is now hidden";
101
+ /**
102
+ * Constrains content to a maximum width. When false, input and related
103
+ * slots will extend to full container width without max-width constraints.
104
+ */
105
+ this.contentMaxWidth = false;
90
106
  /**
91
107
  * @internal
108
+ * Flag to track if the component is still initializing.
109
+ * Used to hide content during initial layout calculations to prevent visible thrashing.
92
110
  */
93
- this.hasInputContent = false;
111
+ this._isInitializing = true;
94
112
  /**
95
113
  * @internal
114
+ * Cached slot content state from SlotObserver
96
115
  */
116
+ this.hasHeaderContent = false;
117
+ this.hasHeaderAfterContent = false;
118
+ this.hasFooterContent = false;
119
+ this.hasInputAfterContent = false;
120
+ this.hasInputContent = false;
97
121
  this.hasInputBeforeContent = false;
98
122
  /**
99
123
  * @internal
@@ -139,6 +163,70 @@ let CDSAIChatShell = CDSAIChatShell_1 = class CDSAIChatShell extends LitElement
139
163
  * @internal
140
164
  */
141
165
  this.suppressWorkspacePanelCloseAnimation = false;
166
+ /**
167
+ * Handles panel open events and announces to screen readers
168
+ * @internal
169
+ */
170
+ this.handlePanelOpen = (event) => {
171
+ // Only announce for non-workspace panels (workspace has its own announcement)
172
+ const target = event.target;
173
+ // Check if the event target is the internal workspace panel
174
+ // or if it's a child of the internal panel
175
+ if (target?.hasAttribute("data-internal-panel")) {
176
+ return;
177
+ }
178
+ // Also check if the target is inside an internal panel
179
+ const closestPanel = target?.closest?.("cds-aichat-panel[data-internal-panel]");
180
+ if (closestPanel) {
181
+ return;
182
+ }
183
+ this.ariaAnnouncerManager?.announce(this.panelOpenedAnnouncement);
184
+ };
185
+ /**
186
+ * Handles panel close events and announces to screen readers
187
+ * @internal
188
+ */
189
+ this.handlePanelClose = (event) => {
190
+ // Only announce for non-workspace panels (workspace has its own announcement)
191
+ const target = event.target;
192
+ // Check if the event target is the internal workspace panel
193
+ // or if it's a child of the internal panel
194
+ if (target?.hasAttribute("data-internal-panel")) {
195
+ return;
196
+ }
197
+ // Also check if the target is inside an internal panel
198
+ const closestPanel = target?.closest?.("cds-aichat-panel[data-internal-panel]");
199
+ if (closestPanel) {
200
+ return;
201
+ }
202
+ this.ariaAnnouncerManager?.announce(this.panelClosedAnnouncement);
203
+ };
204
+ /**
205
+ * Handles workspace visibility changes from WorkspaceManager
206
+ * @internal
207
+ */
208
+ this.handleWorkspaceVisibilityChange = (visible, inPanel) => {
209
+ // Don't announce during initialization
210
+ if (!this.initializationManager?.isInitializationComplete()) {
211
+ return;
212
+ }
213
+ // For panel mode, syncWorkspacePanelState already handles announcements
214
+ // Only announce for inline mode changes
215
+ if (!inPanel) {
216
+ // Add extra delay to allow button state changes to be announced first
217
+ // This prevents the workspace announcement from being interrupted
218
+ if (typeof window !== "undefined") {
219
+ window.setTimeout(() => {
220
+ if (visible) {
221
+ this.ariaAnnouncerManager?.announce(this.workspaceOpenedAnnouncement);
222
+ }
223
+ else {
224
+ this.ariaAnnouncerManager?.announce(this.workspaceClosedAnnouncement);
225
+ }
226
+ }, 100); // 100ms delay before queuing the announcement (which has its own 250ms delay)
227
+ }
228
+ }
229
+ };
142
230
  this.handleWorkspacePanelCloseEnd = () => {
143
231
  if (this.workspaceManager?.shouldRenderPanel()) {
144
232
  return;
@@ -148,13 +236,33 @@ let CDSAIChatShell = CDSAIChatShell_1 = class CDSAIChatShell extends LitElement
148
236
  this.requestUpdate();
149
237
  };
150
238
  }
239
+ /**
240
+ * Announces workspace opened to screen readers
241
+ * @internal
242
+ */
243
+ announceWorkspaceOpened() {
244
+ this.ariaAnnouncerManager?.announce(this.workspaceOpenedAnnouncement);
245
+ }
246
+ /**
247
+ * Announces workspace closed to screen readers
248
+ * @internal
249
+ */
250
+ announceWorkspaceClosed() {
251
+ this.ariaAnnouncerManager?.announce(this.workspaceClosedAnnouncement);
252
+ }
151
253
  getWidgetClasses() {
152
254
  const workspaceState = this.workspaceManager?.getState();
255
+ const hasAnyRoundedCorner = this.cornerAll === "round" ||
256
+ this.cornerStartStart === "round" ||
257
+ this.cornerStartEnd === "round" ||
258
+ this.cornerEndStart === "round" ||
259
+ this.cornerEndEnd === "round";
153
260
  return [
154
261
  "shell",
262
+ this._isInitializing ? "initializing" : "",
155
263
  this.aiEnabled ? "ai-theme" : "",
156
264
  this.showFrame ? "" : "frameless",
157
- this.roundedCorners ? "rounded" : "",
265
+ hasAnyRoundedCorner ? "rounded" : "",
158
266
  this.hasHeaderContent || this.hasHeaderAfterContent
159
267
  ? "has-header-content"
160
268
  : "",
@@ -252,6 +360,7 @@ let CDSAIChatShell = CDSAIChatShell_1 = class CDSAIChatShell extends LitElement
252
360
  data-internal-panel
253
361
  ?open=${this.workspacePanelOpen}
254
362
  full-width
363
+ no-scroll
255
364
  show-chat-header
256
365
  body-no-padding
257
366
  animation-on-open=${animationOnOpen}
@@ -319,6 +428,17 @@ let CDSAIChatShell = CDSAIChatShell_1 = class CDSAIChatShell extends LitElement
319
428
  render() {
320
429
  return html `
321
430
  <div class=${this.getWidgetClasses()}>
431
+ <!-- Hidden aria-live regions for screen reader announcements -->
432
+ <div
433
+ class="visually-hidden"
434
+ aria-live="polite"
435
+ aria-atomic="true"
436
+ ></div>
437
+ <div
438
+ class="visually-hidden"
439
+ aria-live="polite"
440
+ aria-atomic="true"
441
+ ></div>
322
442
  <div class="main-chat">
323
443
  ${this.renderHeader()}
324
444
  <div class="main-content">
@@ -338,118 +458,138 @@ let CDSAIChatShell = CDSAIChatShell_1 = class CDSAIChatShell extends LitElement
338
458
  }
339
459
  firstUpdated(changedProperties) {
340
460
  super.firstUpdated(changedProperties);
341
- const panelsSlot = this.renderRoot.querySelector('slot[name="panels"]');
342
- if (!panelsSlot) {
343
- return;
344
- }
345
461
  const widgetRoot = this.renderRoot.querySelector(".shell");
346
462
  if (!widgetRoot) {
347
463
  return;
348
464
  }
349
- this.panelManager = new PanelManager(panelsSlot, widgetRoot);
350
- this.panelManager.connect();
351
- this.workspaceManager = new WorkspaceManager(widgetRoot, this, {
352
- showWorkspace: this.showWorkspace,
353
- showHistory: this.showHistory,
354
- workspaceLocation: this.workspaceLocation,
355
- roundedCorners: this.roundedCorners,
356
- });
357
- this.workspaceManager.connect();
358
- this.observeHeaderHeight();
359
- this.observeInputAndMessagesWidth();
360
- this.observeMainContentBodyWidth();
361
- this.observeSlotContent();
362
- this.observeCssProperties();
363
- this.syncWorkspacePanelState();
364
- }
365
- hasSlotContent(slotName) {
366
- const slot = this.renderRoot.querySelector(`slot[name="${slotName}"]`);
367
- if (!slot) {
368
- return false;
465
+ // Initialize aria announcer manager
466
+ const ariaLiveRegions = this.renderRoot.querySelectorAll('[aria-live="polite"]');
467
+ if (ariaLiveRegions.length >= 2) {
468
+ this.ariaAnnouncerManager = new AriaAnnouncerManager();
469
+ this.ariaAnnouncerManager.connect(ariaLiveRegions[0], ariaLiveRegions[1]);
369
470
  }
370
- return slot.assignedNodes({ flatten: true }).some((node) => {
371
- // Check for non-empty text nodes
372
- if (node.nodeType === Node.TEXT_NODE && node.textContent?.trim()) {
373
- return true;
374
- }
375
- // Check for element nodes
376
- if (node.nodeType === Node.ELEMENT_NODE) {
377
- const element = node;
378
- return this.hasElementContent(element);
379
- }
380
- return false;
471
+ // Listen for panel open/close events
472
+ this.addEventListener("openend", this.handlePanelOpen);
473
+ this.addEventListener("closeend", this.handlePanelClose);
474
+ // Initialize corner manager
475
+ this.cornerManager = new CornerManager(widgetRoot, {
476
+ cornerAll: this.cornerAll,
477
+ cornerStartStart: this.cornerStartStart,
478
+ cornerStartEnd: this.cornerStartEnd,
479
+ cornerEndStart: this.cornerEndStart,
480
+ cornerEndEnd: this.cornerEndEnd,
381
481
  });
382
- }
383
- hasElementContent(element) {
384
- // Check if element has child nodes with meaningful content (light DOM)
385
- const hasChildContent = Array.from(element.childNodes).some((child) => {
386
- if (child.nodeType === Node.TEXT_NODE) {
387
- return child.textContent?.trim();
482
+ // Initialize initialization manager FIRST (before observers that use it)
483
+ this.initializationManager = new InitializationManager();
484
+ this.initializationManager.onComplete(() => {
485
+ this._isInitializing = false;
486
+ this.requestUpdate();
487
+ // Enable workspace announcements after initialization is complete
488
+ this.workspaceManager?.enableAnnouncements();
489
+ });
490
+ // Initialize slot observer
491
+ this.slotObserver = new SlotObserver(this.renderRoot, CDSAIChatShell_1.OBSERVED_SLOTS);
492
+ this.slotObserver.connect(() => {
493
+ // Update cached slot state
494
+ const state = this.slotObserver?.getSlotContentState();
495
+ this.hasHeaderContent = state?.hasHeaderContent || false;
496
+ this.hasHeaderAfterContent = state?.hasHeaderAfterContent || false;
497
+ this.hasFooterContent = state?.hasFooterContent || false;
498
+ this.hasInputContent = state?.hasInputContent || false;
499
+ this.hasInputAfterContent = state?.hasInputAfterContent || false;
500
+ this.hasInputBeforeContent = state?.hasInputBeforeContent || false;
501
+ // Mark initialization complete
502
+ this.initializationManager?.markStateSet("hasSlotContent");
503
+ this.requestUpdate();
504
+ });
505
+ // Initialize resize observer manager
506
+ this.resizeObserverManager = new ResizeObserverManager(this.renderRoot, this);
507
+ // Observe header height
508
+ this.resizeObserverManager.observeHeaderHeight((height) => {
509
+ widgetRoot.style.setProperty("--cds-aichat-header-height", `${height}px`);
510
+ });
511
+ // Observe input and messages width
512
+ this.resizeObserverManager.observeInputAndMessagesWidth(({ isAtMaxWidth }) => {
513
+ if (this.inputAndMessagesAtMaxWidth !== isAtMaxWidth) {
514
+ this.inputAndMessagesAtMaxWidth = isAtMaxWidth;
515
+ this.requestUpdate();
388
516
  }
389
- if (child.nodeType === Node.ELEMENT_NODE) {
390
- const childElement = child;
391
- // Check slot elements recursively - they may have assigned content
392
- if (childElement.tagName.toLowerCase() === "slot") {
393
- const slotElement = childElement;
394
- const assignedNodes = slotElement.assignedNodes({ flatten: true });
395
- return assignedNodes.some((node) => {
396
- if (node.nodeType === Node.TEXT_NODE) {
397
- return node.textContent?.trim();
398
- }
399
- if (node.nodeType === Node.ELEMENT_NODE) {
400
- return this.hasElementContent(node);
401
- }
402
- return false;
403
- });
517
+ }, () => {
518
+ // Initial measurement callback
519
+ this.initializationManager?.markStateSet("inputAndMessagesAtMaxWidth");
520
+ });
521
+ // Observe main content body width
522
+ this.resizeObserverManager.observeMainContentBodyWidth(this.showHistory, ({ shouldRenderHistory }) => {
523
+ if (this.shouldRenderHistory !== shouldRenderHistory) {
524
+ const wasVisible = this.shouldRenderHistory;
525
+ this.shouldRenderHistory = shouldRenderHistory;
526
+ // Announce history visibility changes (but not on initial load)
527
+ if (this.initializationManager?.isInitializationComplete()) {
528
+ if (shouldRenderHistory && !wasVisible) {
529
+ this.ariaAnnouncerManager?.announce(this.historyShownAnnouncement);
530
+ }
531
+ else if (!shouldRenderHistory && wasVisible) {
532
+ this.ariaAnnouncerManager?.announce(this.historyHiddenAnnouncement);
533
+ }
404
534
  }
405
- return true;
535
+ this.requestUpdate();
406
536
  }
407
- return false;
537
+ }, () => {
538
+ // Initial measurement callback
539
+ this.initializationManager?.markStateSet("shouldRenderHistory");
408
540
  });
409
- if (hasChildContent) {
410
- return true;
411
- }
412
- // If no light DOM children, check if element has shadow root (Shadow DOM content)
413
- if (element.shadowRoot) {
414
- return true;
541
+ // Observe CSS properties
542
+ this.resizeObserverManager.observeCssProperties(() => {
543
+ this.requestUpdate();
544
+ });
545
+ // Initialize panel manager
546
+ const panelsSlot = this.renderRoot.querySelector('slot[name="panels"]');
547
+ if (panelsSlot) {
548
+ this.panelManager = new PanelManager(panelsSlot, widgetRoot);
549
+ this.panelManager.connect();
415
550
  }
416
- // Check text content as fallback
417
- const textContent = element.textContent?.trim();
418
- return Boolean(textContent);
419
- }
420
- observeSlotContent() {
421
- const updateSlotStates = () => {
422
- const previousStates = new Map(CDSAIChatShell_1.OBSERVED_SLOTS.map(({ stateKey }) => [
423
- stateKey,
424
- this[stateKey],
425
- ]));
426
- CDSAIChatShell_1.OBSERVED_SLOTS.forEach(({ name, stateKey }) => {
427
- this[stateKey] = this.hasSlotContent(name);
428
- });
429
- const hasChanged = CDSAIChatShell_1.OBSERVED_SLOTS.some(({ stateKey }) => previousStates.get(stateKey) !== this[stateKey]);
430
- if (hasChanged) {
431
- this.requestUpdate();
432
- }
433
- };
434
- // Initial check
435
- updateSlotStates();
436
- // Observe slot changes
437
- const slots = CDSAIChatShell_1.OBSERVED_SLOTS.map(({ name }) => this.renderRoot.querySelector(`slot[name="${name}"]`)).filter((slot) => slot !== null);
438
- slots.forEach((slot) => {
439
- slot.addEventListener("slotchange", updateSlotStates);
551
+ // Initialize workspace manager
552
+ this.workspaceManager = new WorkspaceManager(widgetRoot, this, {
553
+ showWorkspace: this.showWorkspace,
554
+ showHistory: this.showHistory,
555
+ workspaceLocation: this.workspaceLocation,
556
+ roundedCorners: this.cornerManager.hasAnyRoundedCorner(),
557
+ }, {
558
+ onWorkspaceVisibilityChange: this.handleWorkspaceVisibilityChange,
440
559
  });
560
+ this.workspaceManager.connect();
561
+ this.syncWorkspacePanelState();
441
562
  }
442
563
  updated(changedProperties) {
443
564
  super.updated(changedProperties);
565
+ // Update corner manager when corner properties change
566
+ if (changedProperties.has("cornerAll") ||
567
+ changedProperties.has("cornerStartStart") ||
568
+ changedProperties.has("cornerStartEnd") ||
569
+ changedProperties.has("cornerEndStart") ||
570
+ changedProperties.has("cornerEndEnd")) {
571
+ this.cornerManager?.updateCorners({
572
+ cornerAll: this.cornerAll,
573
+ cornerStartStart: this.cornerStartStart,
574
+ cornerStartEnd: this.cornerStartEnd,
575
+ cornerEndStart: this.cornerEndStart,
576
+ cornerEndEnd: this.cornerEndEnd,
577
+ });
578
+ }
579
+ // Update workspace manager when relevant properties change
444
580
  if (changedProperties.has("showWorkspace") ||
445
581
  changedProperties.has("showHistory") ||
446
582
  changedProperties.has("workspaceLocation") ||
447
- changedProperties.has("roundedCorners")) {
583
+ changedProperties.has("cornerAll") ||
584
+ changedProperties.has("cornerStartStart") ||
585
+ changedProperties.has("cornerStartEnd") ||
586
+ changedProperties.has("cornerEndStart") ||
587
+ changedProperties.has("cornerEndEnd")) {
448
588
  this.workspaceManager?.updateConfig({
449
589
  showWorkspace: this.showWorkspace,
450
590
  showHistory: this.showHistory,
451
591
  workspaceLocation: this.workspaceLocation,
452
- roundedCorners: this.roundedCorners,
592
+ roundedCorners: this.cornerManager?.hasAnyRoundedCorner() ?? false,
453
593
  });
454
594
  }
455
595
  this.syncWorkspacePanelState();
@@ -458,183 +598,15 @@ let CDSAIChatShell = CDSAIChatShell_1 = class CDSAIChatShell extends LitElement
458
598
  disconnectedCallback() {
459
599
  this.panelManager?.disconnect();
460
600
  this.workspaceManager?.disconnect();
461
- this.headerResizeObserver?.disconnect();
462
- this.inputAndMessagesResizeObserver?.disconnect();
463
- this.mainContentBodyResizeObserver?.disconnect();
464
- this.cssPropertyObserver?.disconnect();
601
+ this.slotObserver?.disconnect();
602
+ this.resizeObserverManager?.disconnect();
603
+ this.ariaAnnouncerManager?.disconnect();
465
604
  this.cancelWorkspacePanelOpenSchedule();
605
+ // Clean up event listeners
606
+ this.removeEventListener("openend", this.handlePanelOpen);
607
+ this.removeEventListener("closeend", this.handlePanelClose);
466
608
  super.disconnectedCallback();
467
609
  }
468
- observeInputAndMessagesWidth() {
469
- // We need to observe the :host width, not .input-and-messages width
470
- // When :host < max-width, .input-and-messages fills the container and needs rounded corners
471
- if (typeof ResizeObserver === "undefined") {
472
- return;
473
- }
474
- const messagesMaxWidth = this.getMessagesMaxWidth();
475
- const updateAtMaxWidth = (hostWidth) => {
476
- // When host is less than max-width, input-and-messages is "at max width" (filling container)
477
- const isAtMaxWidth = hostWidth < messagesMaxWidth;
478
- if (this.inputAndMessagesAtMaxWidth !== isAtMaxWidth) {
479
- this.inputAndMessagesAtMaxWidth = isAtMaxWidth;
480
- this.requestUpdate();
481
- }
482
- };
483
- const measure = () => {
484
- const rect = this.getBoundingClientRect();
485
- updateAtMaxWidth(rect.width);
486
- };
487
- this.inputAndMessagesResizeObserver = new ResizeObserver((entries) => {
488
- // Use requestAnimationFrame to avoid ResizeObserver loop errors
489
- requestAnimationFrame(() => {
490
- for (const entry of entries) {
491
- if (entry.target !== this) {
492
- continue;
493
- }
494
- const borderBoxSize = Array.isArray(entry.borderBoxSize)
495
- ? entry.borderBoxSize[0]
496
- : entry.borderBoxSize;
497
- if (borderBoxSize?.inlineSize) {
498
- updateAtMaxWidth(borderBoxSize.inlineSize);
499
- }
500
- else {
501
- updateAtMaxWidth(entry.contentRect.width);
502
- }
503
- }
504
- });
505
- });
506
- this.inputAndMessagesResizeObserver.observe(this);
507
- measure();
508
- }
509
- observeMainContentBodyWidth() {
510
- if (typeof ResizeObserver === "undefined" || !this.showHistory) {
511
- return;
512
- }
513
- const mainContentBody = this.renderRoot.querySelector(".main-content-body");
514
- if (!mainContentBody) {
515
- return;
516
- }
517
- const updateHistoryVisibility = (width) => {
518
- const messagesMinWidth = this.getCssLengthFromProperty("--cds-aichat-messages-min-width", 320);
519
- const historyWidth = this.getCssLengthFromProperty("--cds-aichat-history-width", 320);
520
- const requiredWidth = messagesMinWidth + historyWidth;
521
- const newShouldRenderHistory = width >= requiredWidth;
522
- if (this.shouldRenderHistory !== newShouldRenderHistory) {
523
- this.shouldRenderHistory = newShouldRenderHistory;
524
- this.requestUpdate();
525
- }
526
- };
527
- this.mainContentBodyResizeObserver = new ResizeObserver((entries) => {
528
- // Use requestAnimationFrame to avoid ResizeObserver loop errors
529
- requestAnimationFrame(() => {
530
- for (const entry of entries) {
531
- if (entry.target !== mainContentBody) {
532
- continue;
533
- }
534
- const borderBoxSize = Array.isArray(entry.borderBoxSize)
535
- ? entry.borderBoxSize[0]
536
- : entry.borderBoxSize;
537
- if (borderBoxSize?.inlineSize) {
538
- updateHistoryVisibility(borderBoxSize.inlineSize);
539
- }
540
- else {
541
- updateHistoryVisibility(entry.contentRect.width);
542
- }
543
- }
544
- });
545
- });
546
- this.mainContentBodyResizeObserver.observe(mainContentBody);
547
- // Initial measurement
548
- const rect = mainContentBody.getBoundingClientRect();
549
- updateHistoryVisibility(rect.width);
550
- }
551
- getCssLengthFromProperty(propertyName, fallback) {
552
- const value = getComputedStyle(this).getPropertyValue(propertyName).trim();
553
- if (!value) {
554
- return fallback;
555
- }
556
- const parsed = Number.parseFloat(value);
557
- return Number.isNaN(parsed) ? fallback : parsed;
558
- }
559
- getMessagesMaxWidth() {
560
- const value = getComputedStyle(this)
561
- .getPropertyValue("--cds-aichat-messages-max-width")
562
- .trim();
563
- if (!value) {
564
- return 672; // Default fallback from SCSS
565
- }
566
- const parsed = Number.parseFloat(value);
567
- return Number.isNaN(parsed) ? 672 : parsed;
568
- }
569
- observeHeaderHeight() {
570
- const headerWrapper = this.renderRoot.querySelector(".header-with-header-after");
571
- if (!headerWrapper || typeof ResizeObserver === "undefined") {
572
- return;
573
- }
574
- const updateHeight = (height) => {
575
- this.style.setProperty("--cds-aichat-header-height", `${height}px`);
576
- };
577
- const measure = () => {
578
- const rect = headerWrapper.getBoundingClientRect();
579
- updateHeight(rect.height);
580
- };
581
- this.headerResizeObserver = new ResizeObserver((entries) => {
582
- // Use requestAnimationFrame to avoid ResizeObserver loop errors
583
- requestAnimationFrame(() => {
584
- for (const entry of entries) {
585
- if (entry.target !== headerWrapper) {
586
- continue;
587
- }
588
- const borderBoxSize = Array.isArray(entry.borderBoxSize)
589
- ? entry.borderBoxSize[0]
590
- : entry.borderBoxSize;
591
- if (borderBoxSize?.blockSize) {
592
- updateHeight(borderBoxSize.blockSize);
593
- }
594
- else {
595
- updateHeight(entry.contentRect.height);
596
- }
597
- }
598
- });
599
- });
600
- this.headerResizeObserver.observe(headerWrapper);
601
- measure();
602
- }
603
- /**
604
- * Observe CSS custom properties that affect messages max width.
605
- * When --cds-aichat-messages-max-width changes, recalculate the at-max-width state.
606
- */
607
- observeCssProperties() {
608
- if (typeof MutationObserver === "undefined") {
609
- return;
610
- }
611
- // Store initial value
612
- this.lastKnownMessagesMaxWidth = this.getMessagesMaxWidth();
613
- // Watch for style attribute changes on the host element
614
- this.cssPropertyObserver = new MutationObserver(() => {
615
- this.checkMessagesMaxWidthChange();
616
- });
617
- this.cssPropertyObserver.observe(this, {
618
- attributes: true,
619
- attributeFilter: ["style"],
620
- });
621
- }
622
- /**
623
- * Check if --cds-aichat-messages-max-width has changed and trigger recalculation.
624
- */
625
- checkMessagesMaxWidthChange() {
626
- const currentMaxWidth = this.getMessagesMaxWidth();
627
- if (currentMaxWidth !== this.lastKnownMessagesMaxWidth) {
628
- this.lastKnownMessagesMaxWidth = currentMaxWidth;
629
- // Recalculate the at-max-width state with the new max width
630
- const rect = this.getBoundingClientRect();
631
- const isAtMaxWidth = rect.width < currentMaxWidth;
632
- if (this.inputAndMessagesAtMaxWidth !== isAtMaxWidth) {
633
- this.inputAndMessagesAtMaxWidth = isAtMaxWidth;
634
- this.requestUpdate();
635
- }
636
- }
637
- }
638
610
  syncWorkspacePanelState() {
639
611
  const shouldRenderPanel = this.workspaceManager?.shouldRenderPanel() ?? false;
640
612
  const workspaceState = this.workspaceManager?.getState();
@@ -652,20 +624,25 @@ let CDSAIChatShell = CDSAIChatShell_1 = class CDSAIChatShell extends LitElement
652
624
  this.requestUpdate();
653
625
  // Schedule opening after the panel is rendered
654
626
  this.scheduleWorkspacePanelOpen();
627
+ // Announce workspace opened (only when actually opening, not switching views)
628
+ if (!shouldSuppressAnimation) {
629
+ this.announceWorkspaceOpened();
630
+ }
655
631
  }
656
632
  else if (!shouldRenderPanel && this.lastShouldRenderWorkspacePanel) {
657
633
  // Suppress animation when switching from panel to inline container
658
634
  // (workspace was in panel and now moving to inline)
659
635
  const shouldSuppressAnimation = this.lastWorkspaceInPanel &&
660
636
  (workspaceState?.containerVisible ?? false);
661
- console.log("[syncWorkspacePanelState] CLOSING PANEL", {
662
- shouldSuppressAnimation,
663
- });
664
637
  this.suppressWorkspacePanelCloseAnimation = shouldSuppressAnimation;
665
638
  this.cancelWorkspacePanelOpenSchedule();
666
639
  if (this.workspacePanelOpen) {
667
640
  this.workspacePanelOpen = false;
668
641
  this.requestUpdate();
642
+ // Announce workspace closed (only when actually closing, not switching views)
643
+ if (!shouldSuppressAnimation) {
644
+ this.announceWorkspaceClosed();
645
+ }
669
646
  }
670
647
  else {
671
648
  this.workspacePanelRendering = false;
@@ -710,7 +687,7 @@ let CDSAIChatShell = CDSAIChatShell_1 = class CDSAIChatShell extends LitElement
710
687
  this.workspacePanelOpenScheduled = false;
711
688
  }
712
689
  };
713
- CDSAIChatShell.styles = styles;
690
+ CDSAIChatShell.styles = [commonStyles, styles];
714
691
  /**
715
692
  * @internal
716
693
  */
@@ -729,8 +706,20 @@ __decorate([
729
706
  property({ type: Boolean, attribute: "show-frame", reflect: true })
730
707
  ], CDSAIChatShell.prototype, "showFrame", void 0);
731
708
  __decorate([
732
- property({ type: Boolean, attribute: "rounded-corners", reflect: true })
733
- ], CDSAIChatShell.prototype, "roundedCorners", void 0);
709
+ property({ type: String, attribute: "corner-all", reflect: true })
710
+ ], CDSAIChatShell.prototype, "cornerAll", void 0);
711
+ __decorate([
712
+ property({ type: String, attribute: "corner-start-start", reflect: true })
713
+ ], CDSAIChatShell.prototype, "cornerStartStart", void 0);
714
+ __decorate([
715
+ property({ type: String, attribute: "corner-start-end", reflect: true })
716
+ ], CDSAIChatShell.prototype, "cornerStartEnd", void 0);
717
+ __decorate([
718
+ property({ type: String, attribute: "corner-end-start", reflect: true })
719
+ ], CDSAIChatShell.prototype, "cornerEndStart", void 0);
720
+ __decorate([
721
+ property({ type: String, attribute: "corner-end-end", reflect: true })
722
+ ], CDSAIChatShell.prototype, "cornerEndEnd", void 0);
734
723
  __decorate([
735
724
  property({ type: Boolean, attribute: "show-history", reflect: true })
736
725
  ], CDSAIChatShell.prototype, "showHistory", void 0);
@@ -752,11 +741,32 @@ __decorate([
752
741
  __decorate([
753
742
  property({ type: String, attribute: "messages-aria-label" })
754
743
  ], CDSAIChatShell.prototype, "messagesAriaLabel", void 0);
744
+ __decorate([
745
+ property({ type: String, attribute: "panel-opened-announcement" })
746
+ ], CDSAIChatShell.prototype, "panelOpenedAnnouncement", void 0);
747
+ __decorate([
748
+ property({ type: String, attribute: "panel-closed-announcement" })
749
+ ], CDSAIChatShell.prototype, "panelClosedAnnouncement", void 0);
750
+ __decorate([
751
+ property({ type: String, attribute: "workspace-opened-announcement" })
752
+ ], CDSAIChatShell.prototype, "workspaceOpenedAnnouncement", void 0);
753
+ __decorate([
754
+ property({ type: String, attribute: "workspace-closed-announcement" })
755
+ ], CDSAIChatShell.prototype, "workspaceClosedAnnouncement", void 0);
756
+ __decorate([
757
+ property({ type: String, attribute: "history-shown-announcement" })
758
+ ], CDSAIChatShell.prototype, "historyShownAnnouncement", void 0);
759
+ __decorate([
760
+ property({ type: String, attribute: "history-hidden-announcement" })
761
+ ], CDSAIChatShell.prototype, "historyHiddenAnnouncement", void 0);
755
762
  __decorate([
756
763
  property({ type: Boolean, attribute: "content-max-width", reflect: true })
757
764
  ], CDSAIChatShell.prototype, "contentMaxWidth", void 0);
765
+ __decorate([
766
+ state()
767
+ ], CDSAIChatShell.prototype, "_isInitializing", void 0);
758
768
  CDSAIChatShell = CDSAIChatShell_1 = __decorate([
759
- carbonElement("cds-aichat-shell")
769
+ carbonElement(`${prefix}-shell`)
760
770
  ], CDSAIChatShell);
761
771
  var CDSChatShellElement = CDSAIChatShell;
762
772