@carbon/ai-chat-components 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (542) hide show
  1. package/custom-elements.json +1 -1
  2. package/es/components/code-snippet/src/codemirror/base-setup.js +3 -3
  3. package/es/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +1 -1
  4. package/es/components/code-snippet/src/codemirror/codemirror-runtime.js +1 -1
  5. package/es/components/code-snippet/src/codemirror/content-sync.d.ts +1 -1
  6. package/es/components/code-snippet/src/codemirror/editor-manager.d.ts +1 -1
  7. package/es/components/code-snippet/src/codemirror/editor-manager.js +1 -1
  8. package/es/components/code-snippet/src/codemirror/language-controller.d.ts +1 -1
  9. package/es/components/code-snippet/src/codemirror/theme.js +1 -1
  10. package/es-custom/components/card/index.d.ts +11 -0
  11. package/es-custom/components/card/index.js +11 -0
  12. package/es-custom/components/card/index.js.map +1 -0
  13. package/es-custom/components/card/src/card-footer.d.ts +43 -0
  14. package/es-custom/components/card/src/card-footer.js +141 -0
  15. package/es-custom/components/card/src/card-footer.js.map +1 -0
  16. package/es-custom/components/card/src/card-footer.scss.js +13 -0
  17. package/es-custom/components/card/src/card-footer.scss.js.map +1 -0
  18. package/es-custom/components/card/src/card-steps.d.ts +28 -0
  19. package/es-custom/components/card/src/card-steps.js +91 -0
  20. package/es-custom/components/card/src/card-steps.js.map +1 -0
  21. package/es-custom/components/card/src/card-steps.scss.js +13 -0
  22. package/es-custom/components/card/src/card-steps.scss.js.map +1 -0
  23. package/es-custom/components/card/src/card.d.ts +27 -0
  24. package/es-custom/components/card/src/card.js +65 -0
  25. package/es-custom/components/card/src/card.js.map +1 -0
  26. package/es-custom/components/card/src/card.scss.js +13 -0
  27. package/es-custom/components/card/src/card.scss.js.map +1 -0
  28. package/es-custom/components/chain-of-thought/defs.d.ts +54 -0
  29. package/es-custom/components/chain-of-thought/defs.js +38 -0
  30. package/es-custom/components/chain-of-thought/defs.js.map +1 -0
  31. package/es-custom/components/chain-of-thought/index.d.ts +10 -0
  32. package/es-custom/components/chain-of-thought/index.js +13 -0
  33. package/es-custom/components/chain-of-thought/index.js.map +1 -0
  34. package/es-custom/components/chain-of-thought/src/chain-of-thought-step.d.ts +43 -0
  35. package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js +351 -0
  36. package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -0
  37. package/es-custom/components/chain-of-thought/src/chain-of-thought-step.scss.js +13 -0
  38. package/es-custom/components/chain-of-thought/src/chain-of-thought-step.scss.js.map +1 -0
  39. package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.d.ts +33 -0
  40. package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js +107 -0
  41. package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js.map +1 -0
  42. package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.scss.js +13 -0
  43. package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.scss.js.map +1 -0
  44. package/es-custom/components/chain-of-thought/src/chain-of-thought.d.ts +41 -0
  45. package/es-custom/components/chain-of-thought/src/chain-of-thought.js +132 -0
  46. package/es-custom/components/chain-of-thought/src/chain-of-thought.js.map +1 -0
  47. package/es-custom/components/chain-of-thought/src/chain-of-thought.scss.js +13 -0
  48. package/es-custom/components/chain-of-thought/src/chain-of-thought.scss.js.map +1 -0
  49. package/es-custom/components/chain-of-thought/src/tool-call-data.d.ts +33 -0
  50. package/es-custom/components/chain-of-thought/src/tool-call-data.js +179 -0
  51. package/es-custom/components/chain-of-thought/src/tool-call-data.js.map +1 -0
  52. package/es-custom/components/chain-of-thought/src/tool-call-data.scss.js +13 -0
  53. package/es-custom/components/chain-of-thought/src/tool-call-data.scss.js.map +1 -0
  54. package/es-custom/components/chat-button/defs.d.ts +25 -0
  55. package/es-custom/components/chat-button/defs.js +36 -0
  56. package/es-custom/components/chat-button/defs.js.map +1 -0
  57. package/es-custom/components/chat-button/index.d.ts +9 -0
  58. package/es-custom/components/chat-button/index.js +9 -0
  59. package/es-custom/components/chat-button/index.js.map +1 -0
  60. package/es-custom/components/chat-button/src/chat-button.d.ts +40 -0
  61. package/es-custom/components/chat-button/src/chat-button.js +78 -0
  62. package/es-custom/components/chat-button/src/chat-button.js.map +1 -0
  63. package/es-custom/components/chat-button/src/chat-button.scss.js +13 -0
  64. package/es-custom/components/chat-button/src/chat-button.scss.js.map +1 -0
  65. package/es-custom/components/code-snippet/index.d.ts +3 -0
  66. package/es-custom/components/code-snippet/index.js +10 -0
  67. package/es-custom/components/code-snippet/index.js.map +1 -0
  68. package/es-custom/components/code-snippet/src/code-snippet-card.d.ts +63 -0
  69. package/es-custom/components/code-snippet/src/code-snippet-card.js +186 -0
  70. package/es-custom/components/code-snippet/src/code-snippet-card.js.map +1 -0
  71. package/es-custom/components/code-snippet/src/code-snippet.d.ts +461 -0
  72. package/es-custom/components/code-snippet/src/code-snippet.js +678 -0
  73. package/es-custom/components/code-snippet/src/code-snippet.js.map +1 -0
  74. package/es-custom/components/code-snippet/src/code-snippet.scss.js +13 -0
  75. package/es-custom/components/code-snippet/src/code-snippet.scss.js.map +1 -0
  76. package/es-custom/components/code-snippet/src/codemirror/base-setup.d.ts +12 -0
  77. package/es-custom/components/code-snippet/src/codemirror/base-setup.js +65 -0
  78. package/es-custom/components/code-snippet/src/codemirror/base-setup.js.map +1 -0
  79. package/es-custom/components/code-snippet/src/codemirror/codemirror-loader.d.ts +12 -0
  80. package/es-custom/components/code-snippet/src/codemirror/codemirror-loader.js +36 -0
  81. package/es-custom/components/code-snippet/src/codemirror/codemirror-loader.js.map +1 -0
  82. package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +7 -0
  83. package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.js +13 -0
  84. package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.js.map +1 -0
  85. package/es-custom/components/code-snippet/src/codemirror/content-sync.d.ts +12 -0
  86. package/es-custom/components/code-snippet/src/codemirror/content-sync.js +72 -0
  87. package/es-custom/components/code-snippet/src/codemirror/content-sync.js.map +1 -0
  88. package/es-custom/components/code-snippet/src/codemirror/editor-manager.d.ts +28 -0
  89. package/es-custom/components/code-snippet/src/codemirror/editor-manager.js +75 -0
  90. package/es-custom/components/code-snippet/src/codemirror/editor-manager.js.map +1 -0
  91. package/es-custom/components/code-snippet/src/codemirror/language-controller.d.ts +38 -0
  92. package/es-custom/components/code-snippet/src/codemirror/language-controller.js +220 -0
  93. package/es-custom/components/code-snippet/src/codemirror/language-controller.js.map +1 -0
  94. package/es-custom/components/code-snippet/src/codemirror/language-data.d.ts +6 -0
  95. package/es-custom/components/code-snippet/src/codemirror/language-data.js +1043 -0
  96. package/es-custom/components/code-snippet/src/codemirror/language-data.js.map +1 -0
  97. package/es-custom/components/code-snippet/src/codemirror/language-utils.d.ts +79 -0
  98. package/es-custom/components/code-snippet/src/codemirror/language-utils.js +219 -0
  99. package/es-custom/components/code-snippet/src/codemirror/language-utils.js.map +1 -0
  100. package/es-custom/components/code-snippet/src/codemirror/marker-utils.d.ts +123 -0
  101. package/es-custom/components/code-snippet/src/codemirror/marker-utils.js +183 -0
  102. package/es-custom/components/code-snippet/src/codemirror/marker-utils.js.map +1 -0
  103. package/es-custom/components/code-snippet/src/codemirror/theme.d.ts +54 -0
  104. package/es-custom/components/code-snippet/src/codemirror/theme.js +320 -0
  105. package/es-custom/components/code-snippet/src/codemirror/theme.js.map +1 -0
  106. package/es-custom/components/code-snippet/src/dom-utils.d.ts +24 -0
  107. package/es-custom/components/code-snippet/src/dom-utils.js +63 -0
  108. package/es-custom/components/code-snippet/src/dom-utils.js.map +1 -0
  109. package/es-custom/components/code-snippet/src/formatters.d.ts +4 -0
  110. package/es-custom/components/code-snippet/src/formatters.js +19 -0
  111. package/es-custom/components/code-snippet/src/formatters.js.map +1 -0
  112. package/es-custom/components/code-snippet/src/layout-utils.d.ts +22 -0
  113. package/es-custom/components/code-snippet/src/layout-utils.js +63 -0
  114. package/es-custom/components/code-snippet/src/layout-utils.js.map +1 -0
  115. package/es-custom/components/code-snippet/src/streaming-manager.d.ts +24 -0
  116. package/es-custom/components/code-snippet/src/streaming-manager.js +120 -0
  117. package/es-custom/components/code-snippet/src/streaming-manager.js.map +1 -0
  118. package/es-custom/components/feedback/index.d.ts +4 -0
  119. package/es-custom/components/feedback/index.js +10 -0
  120. package/es-custom/components/feedback/index.js.map +1 -0
  121. package/es-custom/components/feedback/src/feedback-buttons.d.ts +63 -0
  122. package/es-custom/components/feedback/src/feedback-buttons.js +113 -0
  123. package/es-custom/components/feedback/src/feedback-buttons.js.map +1 -0
  124. package/es-custom/components/feedback/src/feedback-buttons.scss.js +13 -0
  125. package/es-custom/components/feedback/src/feedback-buttons.scss.js.map +1 -0
  126. package/es-custom/components/feedback/src/feedback-buttons.template.d.ts +4 -0
  127. package/es-custom/components/feedback/src/feedback-buttons.template.js +79 -0
  128. package/es-custom/components/feedback/src/feedback-buttons.template.js.map +1 -0
  129. package/es-custom/components/feedback/src/feedback.d.ts +113 -0
  130. package/es-custom/components/feedback/src/feedback.js +195 -0
  131. package/es-custom/components/feedback/src/feedback.js.map +1 -0
  132. package/es-custom/components/feedback/src/feedback.scss.js +13 -0
  133. package/es-custom/components/feedback/src/feedback.scss.js.map +1 -0
  134. package/es-custom/components/feedback/src/feedback.template.d.ts +12 -0
  135. package/es-custom/components/feedback/src/feedback.template.js +115 -0
  136. package/es-custom/components/feedback/src/feedback.template.js.map +1 -0
  137. package/es-custom/components/markdown/index.d.ts +2 -0
  138. package/es-custom/components/markdown/index.js +9 -0
  139. package/es-custom/components/markdown/index.js.map +1 -0
  140. package/es-custom/components/markdown/src/markdown-renderer.d.ts +66 -0
  141. package/es-custom/components/markdown/src/markdown-renderer.js +359 -0
  142. package/es-custom/components/markdown/src/markdown-renderer.js.map +1 -0
  143. package/es-custom/components/markdown/src/markdown-token-tree.d.ts +32 -0
  144. package/es-custom/components/markdown/src/markdown-token-tree.js +180 -0
  145. package/es-custom/components/markdown/src/markdown-token-tree.js.map +1 -0
  146. package/es-custom/components/markdown/src/markdown.d.ts +72 -0
  147. package/es-custom/components/markdown/src/markdown.js +342 -0
  148. package/es-custom/components/markdown/src/markdown.js.map +1 -0
  149. package/es-custom/components/markdown/src/markdown.scss.js +13 -0
  150. package/es-custom/components/markdown/src/markdown.scss.js.map +1 -0
  151. package/es-custom/components/markdown/src/markdown.template.d.ts +6 -0
  152. package/es-custom/components/markdown/src/markdown.template.js +29 -0
  153. package/es-custom/components/markdown/src/markdown.template.js.map +1 -0
  154. package/es-custom/components/markdown/src/plugins/markdown-it-attrs.d.ts +7 -0
  155. package/es-custom/components/markdown/src/plugins/markdown-it-attrs.js +84 -0
  156. package/es-custom/components/markdown/src/plugins/markdown-it-attrs.js.map +1 -0
  157. package/es-custom/components/markdown/src/plugins/markdown-it-highlight.d.ts +7 -0
  158. package/es-custom/components/markdown/src/plugins/markdown-it-highlight.js +59 -0
  159. package/es-custom/components/markdown/src/plugins/markdown-it-highlight.js.map +1 -0
  160. package/es-custom/components/markdown/src/plugins/markdown-it-task-lists.d.ts +12 -0
  161. package/es-custom/components/markdown/src/plugins/markdown-it-task-lists.js +73 -0
  162. package/es-custom/components/markdown/src/plugins/markdown-it-task-lists.js.map +1 -0
  163. package/es-custom/components/markdown/src/plugins/markdownItAttrs/core.d.ts +26 -0
  164. package/es-custom/components/markdown/src/plugins/markdownItAttrs/core.js +330 -0
  165. package/es-custom/components/markdown/src/plugins/markdownItAttrs/core.js.map +1 -0
  166. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.d.ts +6 -0
  167. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js +63 -0
  168. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js.map +1 -0
  169. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/code.d.ts +6 -0
  170. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/code.js +43 -0
  171. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/code.js.map +1 -0
  172. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/index.d.ts +5 -0
  173. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/index.js +55 -0
  174. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/index.js.map +1 -0
  175. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/inline.d.ts +19 -0
  176. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js +210 -0
  177. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js.map +1 -0
  178. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/lists.d.ts +13 -0
  179. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js +156 -0
  180. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js.map +1 -0
  181. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/tables.d.ts +13 -0
  182. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js +216 -0
  183. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js.map +1 -0
  184. package/es-custom/components/markdown/src/plugins/markdownItAttrs/types.d.ts +34 -0
  185. package/es-custom/components/markdown/src/plugins/markdownItAttrs/types.js +8 -0
  186. package/es-custom/components/markdown/src/plugins/markdownItAttrs/types.js.map +1 -0
  187. package/es-custom/components/markdown/src/plugins/markdownItAttrs/utils.d.ts +25 -0
  188. package/es-custom/components/markdown/src/plugins/markdownItAttrs/utils.js +62 -0
  189. package/es-custom/components/markdown/src/plugins/markdownItAttrs/utils.js.map +1 -0
  190. package/es-custom/components/markdown/src/utils/html-helpers.d.ts +2 -0
  191. package/es-custom/components/markdown/src/utils/html-helpers.js +204 -0
  192. package/es-custom/components/markdown/src/utils/html-helpers.js.map +1 -0
  193. package/es-custom/components/markdown/src/utils/table-helpers.d.ts +31 -0
  194. package/es-custom/components/markdown/src/utils/table-helpers.js +106 -0
  195. package/es-custom/components/markdown/src/utils/table-helpers.js.map +1 -0
  196. package/es-custom/components/markdown/src/utils.d.ts +8 -0
  197. package/es-custom/components/markdown/src/utils.js +31 -0
  198. package/es-custom/components/markdown/src/utils.js.map +1 -0
  199. package/es-custom/components/processing/index.d.ts +1 -0
  200. package/es-custom/components/processing/index.js +9 -0
  201. package/es-custom/components/processing/index.js.map +1 -0
  202. package/es-custom/components/processing/src/processing.d.ts +16 -0
  203. package/es-custom/components/processing/src/processing.js +59 -0
  204. package/es-custom/components/processing/src/processing.js.map +1 -0
  205. package/es-custom/components/processing/src/processing.scss.js +13 -0
  206. package/es-custom/components/processing/src/processing.scss.js.map +1 -0
  207. package/es-custom/components/reasoning-steps/index.d.ts +4 -0
  208. package/es-custom/components/reasoning-steps/index.js +11 -0
  209. package/es-custom/components/reasoning-steps/index.js.map +1 -0
  210. package/es-custom/components/reasoning-steps/src/reasoning-step.d.ts +33 -0
  211. package/es-custom/components/reasoning-steps/src/reasoning-step.js +251 -0
  212. package/es-custom/components/reasoning-steps/src/reasoning-step.js.map +1 -0
  213. package/es-custom/components/reasoning-steps/src/reasoning-step.scss.js +13 -0
  214. package/es-custom/components/reasoning-steps/src/reasoning-step.scss.js.map +1 -0
  215. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.d.ts +36 -0
  216. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js +81 -0
  217. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js.map +1 -0
  218. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.scss.js +13 -0
  219. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.scss.js.map +1 -0
  220. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.d.ts +3 -0
  221. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.js +43 -0
  222. package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.js.map +1 -0
  223. package/es-custom/components/reasoning-steps/src/reasoning-steps.d.ts +19 -0
  224. package/es-custom/components/reasoning-steps/src/reasoning-steps.js +112 -0
  225. package/es-custom/components/reasoning-steps/src/reasoning-steps.js.map +1 -0
  226. package/es-custom/components/reasoning-steps/src/reasoning-steps.scss.js +13 -0
  227. package/es-custom/components/reasoning-steps/src/reasoning-steps.scss.js.map +1 -0
  228. package/es-custom/components/table/index.d.ts +3 -0
  229. package/es-custom/components/table/index.js +9 -0
  230. package/es-custom/components/table/index.js.map +1 -0
  231. package/es-custom/components/table/src/table-loader.d.ts +4 -0
  232. package/es-custom/components/table/src/table-loader.js +28 -0
  233. package/es-custom/components/table/src/table-loader.js.map +1 -0
  234. package/es-custom/components/table/src/table-pagination.template.d.ts +27 -0
  235. package/es-custom/components/table/src/table-pagination.template.js +55 -0
  236. package/es-custom/components/table/src/table-pagination.template.js.map +1 -0
  237. package/es-custom/components/table/src/table-runtime.d.ts +2 -0
  238. package/es-custom/components/table/src/table-runtime.js +10 -0
  239. package/es-custom/components/table/src/table-runtime.js.map +1 -0
  240. package/es-custom/components/table/src/table-skeleton.template.d.ts +6 -0
  241. package/es-custom/components/table/src/table-skeleton.template.js +34 -0
  242. package/es-custom/components/table/src/table-skeleton.template.js.map +1 -0
  243. package/es-custom/components/table/src/table.d.ts +184 -0
  244. package/es-custom/components/table/src/table.js +543 -0
  245. package/es-custom/components/table/src/table.js.map +1 -0
  246. package/es-custom/components/table/src/table.scss.js +13 -0
  247. package/es-custom/components/table/src/table.scss.js.map +1 -0
  248. package/es-custom/components/table/src/table.template.d.ts +10 -0
  249. package/es-custom/components/table/src/table.template.js +89 -0
  250. package/es-custom/components/table/src/table.template.js.map +1 -0
  251. package/es-custom/components/table/src/types.d.ts +13 -0
  252. package/es-custom/components/table/src/types.js +8 -0
  253. package/es-custom/components/table/src/types.js.map +1 -0
  254. package/es-custom/components/toolbar/index.d.ts +1 -0
  255. package/es-custom/components/toolbar/index.js +9 -0
  256. package/es-custom/components/toolbar/index.js.map +1 -0
  257. package/es-custom/components/toolbar/src/toolbar.d.ts +38 -0
  258. package/es-custom/components/toolbar/src/toolbar.js +191 -0
  259. package/es-custom/components/toolbar/src/toolbar.js.map +1 -0
  260. package/es-custom/components/toolbar/src/toolbar.scss.js +13 -0
  261. package/es-custom/components/toolbar/src/toolbar.scss.js.map +1 -0
  262. package/es-custom/components/workspace-shell/index.d.ts +4 -0
  263. package/es-custom/components/workspace-shell/index.js +12 -0
  264. package/es-custom/components/workspace-shell/index.js.map +1 -0
  265. package/es-custom/components/workspace-shell/src/workspace-shell-body.d.ts +17 -0
  266. package/es-custom/components/workspace-shell/src/workspace-shell-body.js +50 -0
  267. package/es-custom/components/workspace-shell/src/workspace-shell-body.js.map +1 -0
  268. package/es-custom/components/workspace-shell/src/workspace-shell-footer.d.ts +40 -0
  269. package/es-custom/components/workspace-shell/src/workspace-shell-footer.js +144 -0
  270. package/es-custom/components/workspace-shell/src/workspace-shell-footer.js.map +1 -0
  271. package/es-custom/components/workspace-shell/src/workspace-shell-footer.scss.js +13 -0
  272. package/es-custom/components/workspace-shell/src/workspace-shell-footer.scss.js.map +1 -0
  273. package/es-custom/components/workspace-shell/src/workspace-shell-header.d.ts +28 -0
  274. package/es-custom/components/workspace-shell/src/workspace-shell-header.js +78 -0
  275. package/es-custom/components/workspace-shell/src/workspace-shell-header.js.map +1 -0
  276. package/es-custom/components/workspace-shell/src/workspace-shell-header.scss.js +13 -0
  277. package/es-custom/components/workspace-shell/src/workspace-shell-header.scss.js.map +1 -0
  278. package/es-custom/components/workspace-shell/src/workspace-shell.d.ts +19 -0
  279. package/es-custom/components/workspace-shell/src/workspace-shell.js +56 -0
  280. package/es-custom/components/workspace-shell/src/workspace-shell.js.map +1 -0
  281. package/es-custom/components/workspace-shell/src/workspace-shell.scss.js +13 -0
  282. package/es-custom/components/workspace-shell/src/workspace-shell.scss.js.map +1 -0
  283. package/es-custom/globals/decorators/carbon-element.d.ts +37 -0
  284. package/es-custom/globals/decorators/carbon-element.js +68 -0
  285. package/es-custom/globals/decorators/carbon-element.js.map +1 -0
  286. package/es-custom/globals/decorators/index.d.ts +1 -0
  287. package/es-custom/globals/decorators/index.js +9 -0
  288. package/es-custom/globals/decorators/index.js.map +1 -0
  289. package/es-custom/globals/settings.d.ts +2 -0
  290. package/es-custom/globals/settings.js +20 -0
  291. package/es-custom/globals/settings.js.map +1 -0
  292. package/es-custom/globals/utils/uuid.d.ts +5 -0
  293. package/es-custom/globals/utils/uuid.js +32 -0
  294. package/es-custom/globals/utils/uuid.js.map +1 -0
  295. package/es-custom/node_modules/@carbon/utilities/es/documentLang/documentLang.js +9 -0
  296. package/es-custom/node_modules/@carbon/utilities/es/documentLang/documentLang.js.map +1 -0
  297. package/es-custom/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js +11 -0
  298. package/es-custom/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js.map +1 -0
  299. package/es-custom/react/ai-label.d.ts +4 -0
  300. package/es-custom/react/ai-label.js +28 -0
  301. package/es-custom/react/ai-label.js.map +1 -0
  302. package/es-custom/react/button.d.ts +6 -0
  303. package/es-custom/react/button.js +29 -0
  304. package/es-custom/react/button.js.map +1 -0
  305. package/es-custom/react/card.d.ts +9 -0
  306. package/es-custom/react/card.js +43 -0
  307. package/es-custom/react/card.js.map +1 -0
  308. package/es-custom/react/chain-of-thought-step.d.ts +4 -0
  309. package/es-custom/react/chain-of-thought-step.js +32 -0
  310. package/es-custom/react/chain-of-thought-step.js.map +1 -0
  311. package/es-custom/react/chain-of-thought-toggle.d.ts +6 -0
  312. package/es-custom/react/chain-of-thought-toggle.js +31 -0
  313. package/es-custom/react/chain-of-thought-toggle.js.map +1 -0
  314. package/es-custom/react/chain-of-thought.d.ts +7 -0
  315. package/es-custom/react/chain-of-thought.js +33 -0
  316. package/es-custom/react/chain-of-thought.js.map +1 -0
  317. package/es-custom/react/chat-button.d.ts +13 -0
  318. package/es-custom/react/chat-button.js +30 -0
  319. package/es-custom/react/chat-button.js.map +1 -0
  320. package/es-custom/react/code-snippet-card.d.ts +4 -0
  321. package/es-custom/react/code-snippet-card.js +31 -0
  322. package/es-custom/react/code-snippet-card.js.map +1 -0
  323. package/es-custom/react/code-snippet.d.ts +4 -0
  324. package/es-custom/react/code-snippet.js +31 -0
  325. package/es-custom/react/code-snippet.js.map +1 -0
  326. package/es-custom/react/content-switcher.d.ts +7 -0
  327. package/es-custom/react/content-switcher.js +37 -0
  328. package/es-custom/react/content-switcher.js.map +1 -0
  329. package/es-custom/react/feedback-buttons.d.ts +4 -0
  330. package/es-custom/react/feedback-buttons.js +31 -0
  331. package/es-custom/react/feedback-buttons.js.map +1 -0
  332. package/es-custom/react/feedback.d.ts +6 -0
  333. package/es-custom/react/feedback.js +32 -0
  334. package/es-custom/react/feedback.js.map +1 -0
  335. package/es-custom/react/icon-button.d.ts +4 -0
  336. package/es-custom/react/icon-button.js +28 -0
  337. package/es-custom/react/icon-button.js.map +1 -0
  338. package/es-custom/react/icon.d.ts +4 -0
  339. package/es-custom/react/icon.js +28 -0
  340. package/es-custom/react/icon.js.map +1 -0
  341. package/es-custom/react/inline-notification.d.ts +4 -0
  342. package/es-custom/react/inline-notification.js +28 -0
  343. package/es-custom/react/inline-notification.js.map +1 -0
  344. package/es-custom/react/markdown.d.ts +4 -0
  345. package/es-custom/react/markdown.js +28 -0
  346. package/es-custom/react/markdown.js.map +1 -0
  347. package/es-custom/react/overflow-menu.d.ts +9 -0
  348. package/es-custom/react/overflow-menu.js +40 -0
  349. package/es-custom/react/overflow-menu.js.map +1 -0
  350. package/es-custom/react/processing.d.ts +4 -0
  351. package/es-custom/react/processing.js +28 -0
  352. package/es-custom/react/processing.js.map +1 -0
  353. package/es-custom/react/reasoning-step.d.ts +4 -0
  354. package/es-custom/react/reasoning-step.js +32 -0
  355. package/es-custom/react/reasoning-step.js.map +1 -0
  356. package/es-custom/react/reasoning-steps-toggle.d.ts +6 -0
  357. package/es-custom/react/reasoning-steps-toggle.js +31 -0
  358. package/es-custom/react/reasoning-steps-toggle.js.map +1 -0
  359. package/es-custom/react/reasoning-steps.d.ts +4 -0
  360. package/es-custom/react/reasoning-steps.js +28 -0
  361. package/es-custom/react/reasoning-steps.js.map +1 -0
  362. package/es-custom/react/tag.d.ts +4 -0
  363. package/es-custom/react/tag.js +28 -0
  364. package/es-custom/react/tag.js.map +1 -0
  365. package/es-custom/react/tile.d.ts +7 -0
  366. package/es-custom/react/tile.js +34 -0
  367. package/es-custom/react/tile.js.map +1 -0
  368. package/es-custom/react/tool-call-data.d.ts +4 -0
  369. package/es-custom/react/tool-call-data.js +28 -0
  370. package/es-custom/react/tool-call-data.js.map +1 -0
  371. package/es-custom/react/toolbar.d.ts +4 -0
  372. package/es-custom/react/toolbar.js +28 -0
  373. package/es-custom/react/toolbar.js.map +1 -0
  374. package/es-custom/react/utils/withWebComponentBridge.d.ts +15 -0
  375. package/es-custom/react/utils/withWebComponentBridge.js +95 -0
  376. package/es-custom/react/utils/withWebComponentBridge.js.map +1 -0
  377. package/es-custom/react/workspace-shell.d.ts +11 -0
  378. package/es-custom/react/workspace-shell.js +49 -0
  379. package/es-custom/react/workspace-shell.js.map +1 -0
  380. package/es-custom/testing/load-all-lazy-deps.d.ts +10 -0
  381. package/es-custom/testing/load-all-lazy-deps.js +30 -0
  382. package/es-custom/testing/load-all-lazy-deps.js.map +1 -0
  383. package/package.json +8 -6
  384. package/dist/16-C9Ph5740.js +0 -91
  385. package/dist/16-Dw0Ci4Fd.js +0 -91
  386. package/dist/16-FH37w-8T.js +0 -91
  387. package/dist/apl-ugs9-gp6.js +0 -91
  388. package/dist/asciiarmor-BsIYfA6P.js +0 -91
  389. package/dist/asn1-HkF5z2_O.js +0 -91
  390. package/dist/asterisk-CAIjKZq6.js +0 -91
  391. package/dist/button-Bc3tNCYN.js +0 -157
  392. package/dist/button-skeleton-DH50p4bH.js +0 -131
  393. package/dist/carbon-element-C38isbCs.js +0 -91
  394. package/dist/card.min.js +0 -193
  395. package/dist/chain-of-thought.min.js +0 -294
  396. package/dist/chat-button.min.js +0 -107
  397. package/dist/checkbox-skeleton-CS3inOnf.js +0 -166
  398. package/dist/class-map-BE4cOc2X.js +0 -128
  399. package/dist/clike-BIFB3b_k.js +0 -91
  400. package/dist/clojure-CXNiCqqB.js +0 -91
  401. package/dist/cmake-CR9NkLsk.js +0 -91
  402. package/dist/cobol-Ck90O_9v.js +0 -91
  403. package/dist/code-snippet.min.js +0 -91
  404. package/dist/codemirror-runtime-D8qZsrKE.js +0 -173
  405. package/dist/coffeescript-C0nvD2I-.js +0 -91
  406. package/dist/collection-helpers-BqatNkHh.js +0 -91
  407. package/dist/commonlisp-BROP4IME.js +0 -91
  408. package/dist/crystal-D6K96_U-.js +0 -91
  409. package/dist/css-CdH_tvvW.js +0 -91
  410. package/dist/cypher-CtHiEXsa.js +0 -91
  411. package/dist/d-Dcs18F9P.js +0 -91
  412. package/dist/diff-Bp64yuxL.js +0 -91
  413. package/dist/dockerfile-1DOwDLks.js +0 -91
  414. package/dist/dtd-DBKuh-AW.js +0 -91
  415. package/dist/dylan-ZUYgifRI.js +0 -91
  416. package/dist/ebnf-CEelJcGq.js +0 -91
  417. package/dist/ecl-CphVX9Cq.js +0 -91
  418. package/dist/eiffel-BQPneqZH.js +0 -91
  419. package/dist/elm-DSPAgqOt.js +0 -91
  420. package/dist/erlang-D_rMo9WA.js +0 -91
  421. package/dist/factor-CMTQjKbR.js +0 -91
  422. package/dist/fcl-BX3Rw6-t.js +0 -91
  423. package/dist/feedback.min.js +0 -281
  424. package/dist/forth-BGhjMNd3.js +0 -91
  425. package/dist/fortran-AEBjaYMh.js +0 -91
  426. package/dist/gas-DZXAjJGb.js +0 -91
  427. package/dist/gherkin-DxJx7fVg.js +0 -91
  428. package/dist/groovy-dfLbXlDy.js +0 -91
  429. package/dist/haskell-DyZ9y283.js +0 -91
  430. package/dist/haxe-D47ScCJn.js +0 -91
  431. package/dist/http-CQ5YdFwi.js +0 -91
  432. package/dist/icon-button-jLtiwRb4.js +0 -143
  433. package/dist/icon-loader-BKTEuybf.js +0 -101
  434. package/dist/idl-DMLd56tu.js +0 -91
  435. package/dist/if-defined-Dk7gHH6I.js +0 -96
  436. package/dist/index--CctdwCC.js +0 -91
  437. package/dist/index--ktPsmev.js +0 -168
  438. package/dist/index-BHiWR-3B.js +0 -91
  439. package/dist/index-BI8bnAEd.js +0 -91
  440. package/dist/index-BbGF94cg.js +0 -91
  441. package/dist/index-BnQBLEPx.js +0 -91
  442. package/dist/index-BsUuLdXD.js +0 -91
  443. package/dist/index-C2xfmTPp.js +0 -91
  444. package/dist/index-C3BN0MYy.js +0 -91
  445. package/dist/index-CD4di8Cf.js +0 -91
  446. package/dist/index-CVyUt3LQ.js +0 -91
  447. package/dist/index-Cg7m4sg1.js +0 -91
  448. package/dist/index-ClimwzxW.js +0 -91
  449. package/dist/index-CrevYuI-.js +0 -91
  450. package/dist/index-D5kcnwm2.js +0 -91
  451. package/dist/index-DCbIO0Hl.js +0 -91
  452. package/dist/index-Db-BDibx.js +0 -91
  453. package/dist/index-DmpHBiKi.js +0 -91
  454. package/dist/index-DzPjFlOn.js +0 -91
  455. package/dist/index-MgVf_8OP.js +0 -91
  456. package/dist/index-WHfhssUV.js +0 -91
  457. package/dist/index-rdaURAlB.js +0 -91
  458. package/dist/index-tFrMu4B_.js +0 -278
  459. package/dist/index-yLnmvqXN.js +0 -91
  460. package/dist/javascript-CB_5CYW7.js +0 -91
  461. package/dist/julia-DmOIk9mc.js +0 -91
  462. package/dist/livescript-BkgLC0lL.js +0 -91
  463. package/dist/loading-icon-CmnM4I_H.js +0 -106
  464. package/dist/lua-CWM_r9JC.js +0 -91
  465. package/dist/markdown.min.js +0 -298
  466. package/dist/mathematica-BSatVfC1.js +0 -91
  467. package/dist/mbox-4am1R8hd.js +0 -91
  468. package/dist/mirc-pdtTGW9l.js +0 -91
  469. package/dist/mllike-C0YFsE1U.js +0 -91
  470. package/dist/modelica-DVTWSHR-.js +0 -91
  471. package/dist/mscgen-ByAgrjGx.js +0 -91
  472. package/dist/mumps-X97p0_h_.js +0 -91
  473. package/dist/nginx-CqUadVPT.js +0 -91
  474. package/dist/nsis-Urp7BrWk.js +0 -91
  475. package/dist/ntriples-CToxeTsT.js +0 -91
  476. package/dist/octave-Dc4mpp8A.js +0 -91
  477. package/dist/oz-DX2Pk_mI.js +0 -91
  478. package/dist/pascal-B9GL_nqz.js +0 -91
  479. package/dist/perl-BvZFpXKD.js +0 -91
  480. package/dist/pig-BxFxDHBk.js +0 -91
  481. package/dist/powershell-CwCLRM7O.js +0 -91
  482. package/dist/processing.min.js +0 -105
  483. package/dist/properties-3nFD-Vnh.js +0 -91
  484. package/dist/protobuf-RqEyuWlw.js +0 -91
  485. package/dist/pug-1L6dEUb3.js +0 -91
  486. package/dist/puppet-C-gxR1ON.js +0 -91
  487. package/dist/python-BSbm1-vO.js +0 -91
  488. package/dist/q-4yAbTbi2.js +0 -91
  489. package/dist/r-BxfoMXlJ.js +0 -91
  490. package/dist/reasoning-steps.min.js +0 -202
  491. package/dist/rpm-DOp6MTEb.js +0 -91
  492. package/dist/ruby-DD6QCAKT.js +0 -91
  493. package/dist/sas-Cb-4sFOe.js +0 -91
  494. package/dist/scheme-CZsCl8E_.js +0 -91
  495. package/dist/settings-e2aItLYn.js +0 -99
  496. package/dist/shell-Bba6ETw_.js +0 -91
  497. package/dist/sieve-DZz1QovM.js +0 -91
  498. package/dist/simple-mode-DAyX7kcU.js +0 -91
  499. package/dist/smalltalk-BVigbKw-.js +0 -91
  500. package/dist/solr-BRh8QRgo.js +0 -91
  501. package/dist/sparql-DPq9GGqu.js +0 -91
  502. package/dist/spreadsheet-DWXWohNi.js +0 -91
  503. package/dist/sql-HgNux1Fi.js +0 -91
  504. package/dist/state-Bv4FM_9B.js +0 -96
  505. package/dist/stex-DB306cTl.js +0 -91
  506. package/dist/stylus-BVbE3BhF.js +0 -91
  507. package/dist/swift-k2z0otOi.js +0 -91
  508. package/dist/sync-D3qEZKNY.js +0 -91
  509. package/dist/table-runtime-Q-ak_IZE.js +0 -510
  510. package/dist/table.min.js +0 -91
  511. package/dist/tcl-BJwoeXra.js +0 -91
  512. package/dist/text-input-BlCqTf_p.js +0 -158
  513. package/dist/textile-9DAvWy-Y.js +0 -91
  514. package/dist/throttle-Bst9TagJ.js +0 -91
  515. package/dist/tiddlywiki-CDJdAycW.js +0 -91
  516. package/dist/tiki-Dlg5DFIR.js +0 -91
  517. package/dist/toml-DGqt7oU6.js +0 -91
  518. package/dist/toolbar.min.js +0 -178
  519. package/dist/troff-xJv1Y_X_.js +0 -91
  520. package/dist/ttcn-cfg-CrKiCUlI.js +0 -91
  521. package/dist/ttcn-dBogkyiy.js +0 -91
  522. package/dist/turtle-qtDt5E0f.js +0 -91
  523. package/dist/vb-h5NatM2n.js +0 -91
  524. package/dist/vbscript-BnXXn72l.js +0 -91
  525. package/dist/velocity-C_ZqzMiT.js +0 -91
  526. package/dist/verilog-s8oM517K.js +0 -91
  527. package/dist/vhdl-BgZd0MBH.js +0 -91
  528. package/dist/webidl-CDRn4bGa.js +0 -91
  529. package/dist/workspace-shell.min.js +0 -157
  530. package/dist/xquery-DTfjYCD7.js +0 -91
  531. package/dist/yacas-DxV9-gAO.js +0 -91
  532. package/dist/z80-PFwavMao.js +0 -91
  533. package/es/node_modules/@codemirror/autocomplete/dist/index.js +0 -258
  534. package/es/node_modules/@codemirror/autocomplete/dist/index.js.map +0 -1
  535. package/es/node_modules/@codemirror/commands/dist/index.js +0 -1140
  536. package/es/node_modules/@codemirror/commands/dist/index.js.map +0 -1
  537. package/es/node_modules/@codemirror/lint/dist/index.js +0 -636
  538. package/es/node_modules/@codemirror/lint/dist/index.js.map +0 -1
  539. package/es/node_modules/@lezer/common/dist/index.js +0 -253
  540. package/es/node_modules/@lezer/common/dist/index.js.map +0 -1
  541. package/es/node_modules/crelt/index.js +0 -37
  542. package/es/node_modules/crelt/index.js.map +0 -1
@@ -0,0 +1,543 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { __decorate } from 'tslib';
9
+ import { LitElement, html } from 'lit';
10
+ import { property, state } from 'lit/decorators.js';
11
+ import { carbonElement } from '../../../globals/decorators/carbon-element.js';
12
+ import { tableSkeletonTemplate } from './table-skeleton.template.js';
13
+ import { loadTableRuntime } from './table-loader.js';
14
+ import styles from './table.scss.js';
15
+
16
+ /*
17
+ * Copyright IBM Corp. 2025
18
+ *
19
+ * This source code is licensed under the Apache-2.0 license found in the
20
+ * LICENSE file in the root directory of this source tree.
21
+ *
22
+ * @license
23
+ */
24
+ // Width threshold for determining default page size. Tables wider than this get 10 rows, narrower get 5 rows.
25
+ const PAGE_SIZE_WIDTH_THRESHOLD = 400;
26
+ /**
27
+ * Class functionality for the Table custom element.
28
+ */
29
+ let CDSAIChatTable = class CDSAIChatTable extends LitElement {
30
+ constructor() {
31
+ super(...arguments);
32
+ /**
33
+ * The array of cells for the header.
34
+ */
35
+ this.headers = [];
36
+ /**
37
+ * The array of rows. Each row includes an array of cells.
38
+ */
39
+ this.rows = [];
40
+ /**
41
+ * Whether or not the table content is loading. If it is then a skeleton state should be shown instead.
42
+ */
43
+ this.loading = false;
44
+ /**
45
+ * The text used for the filter placeholder.
46
+ */
47
+ this.filterPlaceholderText = "Filter table...";
48
+ /**
49
+ * The text used for the pagination's previous button tooltip.
50
+ */
51
+ this.previousPageText = "Previous page";
52
+ /**
53
+ * The text used for the pagination's next button tooltip.
54
+ */
55
+ this.nextPageText = "Next page";
56
+ /**
57
+ * The text used for the pagination's item pre page text.
58
+ */
59
+ this.itemsPerPageText = "Items per page:";
60
+ /**
61
+ * The text used for the download button's accessible label.
62
+ */
63
+ this.downloadLabelText = "Download table data";
64
+ /**
65
+ * The locale. Used by the carbon table component to change the collator for sorting.
66
+ */
67
+ this.locale = "en";
68
+ /**
69
+ * The calculated default page size based on component width.
70
+ * 10 for width > PAGE_SIZE_WIDTH_THRESHOLD, 5 for width <= PAGE_SIZE_WIDTH_THRESHOLD.
71
+ *
72
+ * @internal
73
+ */
74
+ this._defaultPageSize = 5;
75
+ /**
76
+ * If the table is valid or not.
77
+ *
78
+ * @internal
79
+ */
80
+ this._isValid = true;
81
+ /**
82
+ * The current page of the table we're on.
83
+ *
84
+ * @internal
85
+ */
86
+ this._currentPageNumber = 1;
87
+ /**
88
+ * How many rows are on each page of the table.
89
+ *
90
+ * @internal
91
+ */
92
+ this._currentPageSize = this.defaultPageSize;
93
+ /**
94
+ * Whether or not the number of rows per page was changed with the pagination component. If the user used the
95
+ * pagination controls to show all rows, the pagination component would normally hide itself because the number of is
96
+ * no longer greater than the page size. However the pagination component needs to persist in this case, since the
97
+ * user may want to change the page size again. This is used to keep track of whether the pagination controls were
98
+ * used to change page size, and if they have, it forces pagination component to persist.
99
+ *
100
+ * @internal
101
+ */
102
+ this._rowsPerPageChanged = false;
103
+ /**
104
+ * The rows that have not been filtered out.
105
+ *
106
+ * @internal
107
+ */
108
+ this._filterVisibleRowIDs = new Set();
109
+ /**
110
+ * All of the rows for the table with IDs.
111
+ *
112
+ * @internal
113
+ */
114
+ this._rowsWithIDs = [];
115
+ /**
116
+ * Whether or not the table should be able to be filtered.
117
+ *
118
+ * @internal
119
+ */
120
+ this._allowFiltering = false;
121
+ /**
122
+ * @internal
123
+ */
124
+ this.tableRuntime = null;
125
+ /**
126
+ * @internal
127
+ */
128
+ this.tableRuntimePromise = null;
129
+ /**
130
+ * Handles pagination events from the Carbon pagination component.
131
+ * Updates the visible rows when the user navigates to a different page.
132
+ *
133
+ * Note: This event sometimes fires twice due to a Carbon framework quirk,
134
+ * but since the page/size values are identical, it doesn't affect functionality.
135
+ *
136
+ * @param event - The page change event containing the new page number and size
137
+ * @public
138
+ *
139
+ * @internal
140
+ */
141
+ this._handlePageChangeEvent = (event) => {
142
+ this._updateVisibleRows(event.detail?.page, event.detail?.pageSize);
143
+ event.stopPropagation();
144
+ };
145
+ /**
146
+ * Handles page size change events from the pagination component.
147
+ * Updates the current page size and recalculates visible rows.
148
+ * Marks that the page size has been manually changed by the user.
149
+ *
150
+ * @param event - The page size change event containing the new page size
151
+ * @public
152
+ *
153
+ * @internal
154
+ */
155
+ this._handlePageSizeChangeEvent = (event) => {
156
+ this._rowsPerPageChanged = true;
157
+ this._currentPageSize = event.detail?.pageSize;
158
+ this._updateVisibleRows();
159
+ event.stopPropagation();
160
+ };
161
+ /**
162
+ * Handles filter and sort events from the Carbon table component.
163
+ * Updates the set of visible rows based on filtering/sorting results and resets to the first page.
164
+ *
165
+ * This event is triggered by:
166
+ * - Column sorting (clicking on sortable column headers)
167
+ * - Table filtering (using the search bar)
168
+ *
169
+ * @param event - The filter event containing the array of unfiltered rows
170
+ * @public
171
+ *
172
+ * @internal
173
+ */
174
+ this._handleFilterEvent = (event) => {
175
+ // Record the new set of unfiltered row ids.
176
+ this._filterVisibleRowIDs = new Set(event?.detail?.unfilteredRows.map((row) => row.id));
177
+ // Go back to the first page.
178
+ this._currentPageNumber = 1;
179
+ // Update which rows are visible.
180
+ this._updateVisibleRows();
181
+ event.stopPropagation();
182
+ };
183
+ }
184
+ get defaultPageSize() {
185
+ return this._defaultPageSize;
186
+ }
187
+ set defaultPageSize(value) {
188
+ this._defaultPageSize = value;
189
+ }
190
+ connectedCallback() {
191
+ super.connectedCallback();
192
+ void this.ensureTableRuntime();
193
+ }
194
+ /**
195
+ * Called after the element's DOM has been updated for the first time.
196
+ * Initializes the table page size.
197
+ *
198
+ * @param _changedProperties - Map of properties that changed during the update
199
+ */
200
+ async firstUpdated(_changedProperties) {
201
+ await this.updateComplete;
202
+ this._updateDefaultPageSize();
203
+ this._setPageSize();
204
+ }
205
+ /**
206
+ * Updates the CSS custom property `--cds-custom-chat-table-width` based on the parent element's width.
207
+ * Also calculates the default page size on first run based on the measured width.
208
+ * This method is called once during component initialization.
209
+ *
210
+ * @private
211
+ */
212
+ _updateDefaultPageSize() {
213
+ if (this.parentElement) {
214
+ let parentWidth = this.parentElement.offsetWidth;
215
+ // If parent width is 0, use fallback width that ensures 5-row default page size
216
+ if (parentWidth === 0) {
217
+ parentWidth = PAGE_SIZE_WIDTH_THRESHOLD - 1;
218
+ }
219
+ // Calculate default page size based on the width we just measured
220
+ // Only set it once, don't recalculate on resize
221
+ if (parentWidth > 0 && this._defaultPageSize === 5) {
222
+ this._defaultPageSize =
223
+ parentWidth > PAGE_SIZE_WIDTH_THRESHOLD ? 10 : 5;
224
+ // Update _currentPageSize if it's still at the initial value
225
+ if (this._currentPageSize === 5) {
226
+ this._currentPageSize = this._defaultPageSize;
227
+ }
228
+ }
229
+ }
230
+ }
231
+ /**
232
+ * Called before the element updates to prepare state changes.
233
+ * Handles validation and re-initialization of table data when headers or rows change.
234
+ *
235
+ * @param changedProperties - Map of properties that changed during the update
236
+ * @protected
237
+ */
238
+ willUpdate(changedProperties) {
239
+ // If the headers or rows has recently updated and both are defined than we should validate the table
240
+ // data. This will likely only happen on the web components first render cycle when the props go from undefined to
241
+ // defined.
242
+ if ((changedProperties.has("headers") || changedProperties.has("rows")) &&
243
+ this.headers !== undefined &&
244
+ this.rows !== undefined) {
245
+ this._calcIsTableValid();
246
+ }
247
+ // If the value of tableRows updated then initialize the internal rows arrays.
248
+ if (changedProperties.has("rows") && this.rows !== undefined) {
249
+ this._initializeRowsArrays();
250
+ this._setPageSize();
251
+ }
252
+ }
253
+ /**
254
+ * Validates the table structure by checking if all rows have the same number of cells as the header.
255
+ * Sets the internal `_isValid` state to false if any row has a mismatched cell count.
256
+ *
257
+ * A valid table requires:
258
+ * - All rows must have the same number of cells as there are headers
259
+ * - No rows can have more or fewer cells than the column count
260
+ *
261
+ * @private
262
+ */
263
+ _calcIsTableValid() {
264
+ const columnCount = this.headers.length;
265
+ // If one of the rows has a different number of cells than the number of columns in the header then set our internal
266
+ // valid state to false.
267
+ this._isValid = !this.rows.some((row) => row.cells.length !== columnCount);
268
+ // In the future, once we have an inlineError web component to use, we can render that when our table is not valid
269
+ // (as well as throwing the below error). Until then our React container is rendering the error component and
270
+ // throwing the error.
271
+ // throw new Error(
272
+ // `${WA_CONSOLE_PREFIX} Number of cells in the table header does not match the number of cells in one or more of the table rows. In order to render a table there needs to be the same number of columns in the table header and all of the table rows.`,
273
+ // );
274
+ }
275
+ /**
276
+ * Initializes internal arrays used for table functionality.
277
+ * Creates a new array of rows with unique IDs and initializes the filter visibility tracking.
278
+ *
279
+ * This method:
280
+ * 1. Resets the `_rowsWithIDs` array and `_filterVisibleRowIDs` set
281
+ * 2. Assigns string-based IDs to each row for tracking purposes
282
+ * 3. Marks all rows as initially visible (not filtered out)
283
+ *
284
+ * @private
285
+ */
286
+ _initializeRowsArrays() {
287
+ // Reset both arrays.
288
+ this._rowsWithIDs = [];
289
+ this._filterVisibleRowIDs = new Set();
290
+ this.rows.forEach((row, index) => {
291
+ const id = index.toString();
292
+ this._rowsWithIDs.push({ ...row, id });
293
+ this._filterVisibleRowIDs.add(id);
294
+ });
295
+ }
296
+ /**
297
+ * Configures the table's page size and filtering behavior.
298
+ * Determines whether filtering/searching should be enabled based on the number of rows
299
+ * relative to the current page size.
300
+ *
301
+ * Filtering is enabled when there are more rows than can fit on a single page,
302
+ * allowing users to search and paginate through large datasets.
303
+ *
304
+ * @private
305
+ */
306
+ _setPageSize() {
307
+ // If there are more rows than the page size then enable filtering.
308
+ this._allowFiltering = this.rows.length > this._currentPageSize;
309
+ // Update the visible rows in case the page size has changed or this is the first time this web component has
310
+ // rendered.
311
+ this._updateVisibleRows();
312
+ }
313
+ async ensureTableRuntime() {
314
+ if (this.tableRuntime) {
315
+ return this.tableRuntime;
316
+ }
317
+ if (typeof window === "undefined") {
318
+ return null;
319
+ }
320
+ if (!this.tableRuntimePromise) {
321
+ this.tableRuntimePromise = loadTableRuntime();
322
+ }
323
+ try {
324
+ const runtime = await this.tableRuntimePromise;
325
+ this.tableRuntime = runtime;
326
+ this.requestUpdate();
327
+ return runtime;
328
+ }
329
+ catch (error) {
330
+ console.error("Failed to load table runtime", error);
331
+ this.tableRuntimePromise = null;
332
+ return null;
333
+ }
334
+ }
335
+ /**
336
+ * Controls which table rows are visible based on pagination and filtering.
337
+ * Uses CSS display properties to show/hide rows rather than DOM manipulation.
338
+ *
339
+ * This approach is necessary because Carbon's table component handles its own
340
+ * sorting and we need to preserve the DOM order it creates. The method:
341
+ * 1. Hides all rows initially
342
+ * 2. Filters to only rows that haven't been filtered out
343
+ * 3. Shows only the rows that belong to the current page
344
+ *
345
+ * @param page - The page number to display (1-based)
346
+ * @param pageSize - Number of rows per page
347
+ * @private
348
+ */
349
+ _updateVisibleRows(page = this._currentPageNumber, pageSize = this._currentPageSize) {
350
+ // Set the current page number and only show the rows for that page.
351
+ this._currentPageNumber = page;
352
+ // Grab all the rows that have been rendered. It's necessary to grab them from the page because the cds-custom-table puts
353
+ // the rows in a specific order when sorting and we want to preserve that order.
354
+ const rows = Array.from(this.renderRoot.querySelectorAll("cds-custom-table-row"));
355
+ // This is similar to the carbon example here https://stackblitz.com/edit/github-kbd9xw-s3y3s6?file=index.html. I
356
+ // originally tried creating and passing an array of the specific rows the template should render for the current
357
+ // page. Unfortunately doing that doesn't work with the combination of the is-sortable prop for the table and
358
+ // page-size prop for pagination. What would happen is old rows would persist if you were on the last page and there
359
+ // weren't enough rows to fill the page (even though the old rows weren't included in the new rows provided to the
360
+ // template). Using Carbon's example of hiding the rows with styling works so I'm extending that concept here even
361
+ // though, ideally, render controls the view and reacts to the state that would be determined here.
362
+ // Hide all the rows to start.
363
+ rows.forEach((row) => row.style.setProperty("display", "none"));
364
+ // Now filter the rows down to what is visible according to the filter.
365
+ const filterVisibleRows = rows.filter((row) => this._filterVisibleRowIDs.has(row.id));
366
+ // Now show all the rows that are within the current page.
367
+ const pageStart = (page - 1) * pageSize;
368
+ const pageEnd = page * pageSize - 1;
369
+ for (let index = pageStart; index <= pageEnd; index++) {
370
+ // If there is a row at that index then show it. If there aren't enough rows to fill the page then there won't be
371
+ // a row at that index.
372
+ filterVisibleRows[index]?.removeAttribute("style");
373
+ }
374
+ }
375
+ /**
376
+ * Handles the table download functionality by exporting all table data as a CSV file.
377
+ *
378
+ * This custom implementation is necessary because Carbon's default download feature:
379
+ * - Only exports selected rows (we want all data)
380
+ * - Only exports as JSON (we want CSV format)
381
+ * - Doesn't include all the data we need
382
+ *
383
+ * The method dynamically imports the CSV stringify library to avoid bundle bloat,
384
+ * creates a data URL to comply with CSP policies, and triggers a download.
385
+ *
386
+ * @public
387
+ */
388
+ async _handleDownload() {
389
+ // Don't save content from the expandable rows at this time. This could be added in the future but it's unclear how
390
+ // this would look in the download.
391
+ const tableArray = [
392
+ this.headers.map((cell) => cell.text),
393
+ ...this.rows.map((row) => row.cells.map((cell) => cell.text)),
394
+ ];
395
+ try {
396
+ // Lazy load the CSV stringify function only when needed
397
+ const { stringify } = await import('csv-stringify/browser/esm/sync');
398
+ // Convert table data to CSV format
399
+ const csvContent = stringify(tableArray);
400
+ // Use data URL instead of Blob to avoid CSP issues with object-src
401
+ const dataUrl = `data:text/csv;charset=utf-8,${encodeURIComponent(csvContent)}`;
402
+ // Create and trigger download using anchor element
403
+ const link = document.createElement("a");
404
+ link.setAttribute("href", dataUrl);
405
+ link.setAttribute("download", "table-data.csv");
406
+ link.style.visibility = "hidden";
407
+ document.body.appendChild(link);
408
+ // Trigger download and cleanup
409
+ link.click();
410
+ document.body.removeChild(link);
411
+ }
412
+ catch (error) {
413
+ console.error("Failed to download table data:", error);
414
+ // Fallback: could show user notification or use alternative method
415
+ }
416
+ }
417
+ /**
418
+ * Renders the table component based on current state and data.
419
+ *
420
+ * The render logic follows this priority:
421
+ * 1. Shows skeleton loading state if `loading` is true
422
+ * 2. Shows table with pagination if there are more rows than the page size OR pagination was used
423
+ * 3. Shows table only if all rows fit on one page
424
+ *
425
+ * The method also applies the appropriate Carbon theme class (cds-custom--g90 for dark, cds-custom--white for light)
426
+ * to ensure proper styling based on the `dark` property.
427
+ *
428
+ * @returns The lit-html template for the table component
429
+ * @public
430
+ */
431
+ render() {
432
+ // TODO TABLE: Once we have a web component version of the inline error state we could render that here if
433
+ // !this._isValid.
434
+ // This could be used while we wait for a md stream containing a table to complete.
435
+ const runtime = this.tableRuntime;
436
+ if (this.loading || !runtime) {
437
+ if (!runtime) {
438
+ void this.ensureTableRuntime();
439
+ }
440
+ return tableSkeletonTemplate(this._currentPageSize);
441
+ }
442
+ const { tableTemplate, tablePaginationTemplate } = runtime;
443
+ // If there are more rows than the page size then we need to add the pagination component. If the rows per page has
444
+ // been changed by the pagination component then we need to keep the pagination component around so the user can
445
+ // change the page size again, even if the current page size is the same as the number of table rows.
446
+ if (this.rows.length > this._currentPageSize || this._rowsPerPageChanged) {
447
+ return html `<div class="cds-custom-ai-chat-table-container">
448
+ ${tableTemplate(this)}
449
+ ${tablePaginationTemplate({
450
+ _currentPageSize: this._currentPageSize,
451
+ _currentPageNumber: this._currentPageNumber,
452
+ _filterVisibleRowIDs: this._filterVisibleRowIDs,
453
+ rows: this.rows,
454
+ previousPageText: this.previousPageText,
455
+ nextPageText: this.nextPageText,
456
+ itemsPerPageText: this.itemsPerPageText,
457
+ getPaginationSupplementalText: this.getPaginationSupplementalText,
458
+ getPaginationStatusText: this.getPaginationStatusText,
459
+ _handlePageChangeEvent: this._handlePageChangeEvent,
460
+ _handlePageSizeChangeEvent: this._handlePageSizeChangeEvent,
461
+ })}
462
+ </div>`;
463
+ }
464
+ // Otherwise, just render the table.
465
+ return html `<div class="cds-custom-ai-chat-table-container">
466
+ ${tableTemplate(this)}
467
+ </div>`;
468
+ }
469
+ };
470
+ CDSAIChatTable.styles = styles;
471
+ __decorate([
472
+ property({ type: String, attribute: "table-title" })
473
+ ], CDSAIChatTable.prototype, "tableTitle", void 0);
474
+ __decorate([
475
+ property({ type: String, attribute: "table-description" })
476
+ ], CDSAIChatTable.prototype, "tableDescription", void 0);
477
+ __decorate([
478
+ property({ type: Array, attribute: false })
479
+ ], CDSAIChatTable.prototype, "headers", void 0);
480
+ __decorate([
481
+ property({ type: Array, attribute: false })
482
+ ], CDSAIChatTable.prototype, "rows", void 0);
483
+ __decorate([
484
+ property({ type: Boolean, attribute: "loading" })
485
+ ], CDSAIChatTable.prototype, "loading", void 0);
486
+ __decorate([
487
+ property({ type: String, attribute: "filter-placeholder-text" })
488
+ ], CDSAIChatTable.prototype, "filterPlaceholderText", void 0);
489
+ __decorate([
490
+ property({ type: String, attribute: "previous-page-text" })
491
+ ], CDSAIChatTable.prototype, "previousPageText", void 0);
492
+ __decorate([
493
+ property({ type: String, attribute: "next-page-text" })
494
+ ], CDSAIChatTable.prototype, "nextPageText", void 0);
495
+ __decorate([
496
+ property({ type: String, attribute: "items-per-page-text" })
497
+ ], CDSAIChatTable.prototype, "itemsPerPageText", void 0);
498
+ __decorate([
499
+ property({ type: String, attribute: "download-label-text" })
500
+ ], CDSAIChatTable.prototype, "downloadLabelText", void 0);
501
+ __decorate([
502
+ property({ type: String, attribute: "locale" })
503
+ ], CDSAIChatTable.prototype, "locale", void 0);
504
+ __decorate([
505
+ state()
506
+ ], CDSAIChatTable.prototype, "_defaultPageSize", void 0);
507
+ __decorate([
508
+ property({ type: Number, attribute: "default-page-size" })
509
+ ], CDSAIChatTable.prototype, "defaultPageSize", null);
510
+ __decorate([
511
+ property({ type: Function, attribute: false })
512
+ ], CDSAIChatTable.prototype, "getPaginationSupplementalText", void 0);
513
+ __decorate([
514
+ property({ type: Function, attribute: false })
515
+ ], CDSAIChatTable.prototype, "getPaginationStatusText", void 0);
516
+ __decorate([
517
+ state()
518
+ ], CDSAIChatTable.prototype, "_isValid", void 0);
519
+ __decorate([
520
+ state()
521
+ ], CDSAIChatTable.prototype, "_currentPageNumber", void 0);
522
+ __decorate([
523
+ state()
524
+ ], CDSAIChatTable.prototype, "_currentPageSize", void 0);
525
+ __decorate([
526
+ state()
527
+ ], CDSAIChatTable.prototype, "_rowsPerPageChanged", void 0);
528
+ __decorate([
529
+ state()
530
+ ], CDSAIChatTable.prototype, "_filterVisibleRowIDs", void 0);
531
+ __decorate([
532
+ state()
533
+ ], CDSAIChatTable.prototype, "_rowsWithIDs", void 0);
534
+ __decorate([
535
+ state()
536
+ ], CDSAIChatTable.prototype, "_allowFiltering", void 0);
537
+ CDSAIChatTable = __decorate([
538
+ carbonElement("cds-aichat-table")
539
+ ], CDSAIChatTable);
540
+ var CDSAIChatTable_default = CDSAIChatTable;
541
+
542
+ export { CDSAIChatTable, CDSAIChatTable_default as default };
543
+ //# sourceMappingURL=table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.js","sources":["../../../../src/components/table/src/table.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;AAOG;AAuCH;AACA,MAAM,yBAAyB,GAAG,GAAG;AAErC;;AAEG;AAEH,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU,CAAA;AAAvC,IAAA,WAAA,GAAA;;AAaE;;AAEG;QAEH,IAAA,CAAA,OAAO,GAAuB,EAAE;AAEhC;;AAEG;QAEH,IAAA,CAAA,IAAI,GAAsB,EAAE;AAE5B;;AAEG;QAEH,IAAA,CAAA,OAAO,GAAG,KAAK;AAEf;;AAEG;QAEH,IAAA,CAAA,qBAAqB,GAAG,iBAAiB;AAEzC;;AAEG;QAEH,IAAA,CAAA,gBAAgB,GAAG,eAAe;AAElC;;AAEG;QAEH,IAAA,CAAA,YAAY,GAAG,WAAW;AAE1B;;AAEG;QAEH,IAAA,CAAA,gBAAgB,GAAG,iBAAiB;AAEpC;;AAEG;QAEH,IAAA,CAAA,iBAAiB,GAAG,qBAAqB;AAEzC;;AAEG;QAEH,IAAA,CAAA,MAAM,GAAG,IAAI;AAEb;;;;;AAKG;QAEK,IAAA,CAAA,gBAAgB,GAAG,CAAC;AA+B5B;;;;AAIG;QAEO,IAAA,CAAA,QAAQ,GAAG,IAAI;AAEzB;;;;AAIG;QAEI,IAAA,CAAA,kBAAkB,GAAG,CAAC;AAE7B;;;;AAIG;AAEI,QAAA,IAAA,CAAA,gBAAgB,G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,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,kBAAA,EAAA,MAAA,CAAA;AAYhD,UAAA,CAAA;AADN,IAAA,KAAK;AAC6B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,qBAAA,EAAA,MAAA,CAAA;AAQ5B,UAAA,CAAA;AADN,IAAA,KAAK;AAC+C,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,sBAAA,EAAA,MAAA,CAAA;AAQ9C,UAAA,CAAA;AADN,IAAA,KAAK;AACsC,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAQrC,UAAA,CAAA;AADN,IAAA,KAAK;AACyB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,iBAAA,EAAA,MAAA,CAAA;AAnK3B,cAAc,GAAA,UAAA,CAAA;IADnB,aAAa,CAAC,kBAAkB;AAC3B,CAAA,EAAA,cAAc,CAkjBnB;AASD,6BAAe,cAAc;;;;"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { css } from 'lit';
9
+
10
+ var styles = css(["cds-custom-table::part(inner-container){display:grid;grid-template-columns:minmax(max-content,1fr)}"]);
11
+
12
+ export { styles as default };
13
+ //# sourceMappingURL=table.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -0,0 +1,10 @@
1
+ import "@carbon/web-components/es-custom/components/data-table/index.js";
2
+ import "@carbon/web-components/es-custom/components/checkbox/index.js";
3
+ import "@carbon/web-components/es-custom/components/button/index.js";
4
+ import "@carbon/web-components/es-custom/components/layer/index.js";
5
+ import type { CDSAIChatTable } from "./table.js";
6
+ /**
7
+ * Table view logic.
8
+ */
9
+ declare function tableTemplate(tableElement: CDSAIChatTable): import("lit-html").TemplateResult<1>;
10
+ export { tableTemplate };
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import '@carbon/web-components/es-custom/components/data-table/index.js';
9
+ import '@carbon/web-components/es-custom/components/checkbox/index.js';
10
+ import '@carbon/web-components/es-custom/components/button/index.js';
11
+ import '@carbon/web-components/es-custom/components/layer/index.js';
12
+ import { iconLoader } from '@carbon/web-components/es-custom/globals/internal/icon-loader.js';
13
+ import Download16 from '@carbon/icons/es/download/16.js';
14
+ import { html } from 'lit';
15
+ import { repeat } from 'lit-html/directives/repeat.js';
16
+
17
+ /*
18
+ * Copyright IBM Corp. 2025
19
+ *
20
+ * This source code is licensed under the Apache-2.0 license found in the
21
+ * LICENSE file in the root directory of this source tree.
22
+ *
23
+ * @license
24
+ */
25
+ /**
26
+ * Table view logic.
27
+ */
28
+ function tableTemplate(tableElement) {
29
+ const { tableTitle, tableDescription, headers, filterPlaceholderText, downloadLabelText, locale, _handleDownload: handleDownload, _rowsWithIDs: tableRowsWithIDs, _allowFiltering: allowTableFiltering, _handleFilterEvent: handleFilterEvent, } = tableElement;
30
+ function toolbarElement() {
31
+ return html `<cds-custom-table-toolbar slot="toolbar">
32
+ <cds-custom-table-toolbar-content>
33
+ ${allowTableFiltering
34
+ ? html `<cds-custom-table-toolbar-search
35
+ persistent
36
+ placeholder=${filterPlaceholderText}
37
+ ></cds-custom-table-toolbar-search>`
38
+ : ""}
39
+ <cds-custom-button @click=${handleDownload} aria-label=${downloadLabelText}
40
+ >${iconLoader(Download16)}</cds-custom-button
41
+ >
42
+ </cds-custom-table-toolbar-content>
43
+ </cds-custom-table-toolbar>`;
44
+ }
45
+ function headersElement() {
46
+ return html `<cds-custom-table-head>
47
+ <cds-custom-table-header-row>
48
+ ${headers.map((header) => html `<cds-custom-table-header-cell
49
+ >${header.template ?? header.text}</cds-custom-table-header-cell
50
+ >`)}
51
+ </cds-custom-table-header-row>
52
+ </cds-custom-table-head>`;
53
+ }
54
+ function rowsElement() {
55
+ return html `<cds-custom-table-body>
56
+ ${repeat(tableRowsWithIDs, (row) => row.id, (row) => html `<cds-custom-table-row id=${row.id}
57
+ >${row.cells.map((cell) => {
58
+ return html `<cds-custom-table-cell
59
+ >${cell.template ?? cell.text}</cds-custom-table-cell
60
+ >`;
61
+ })}</cds-custom-table-row
62
+ >`)}
63
+ </cds-custom-table-body>`;
64
+ }
65
+ // TODO TABLE: There is a bug with size="sm" and is-sortable that prevents the header row from being the same size as
66
+ // the rest of the rows https://github.com/carbon-design-system/carbon/issues/17680. For now keep size="md" until that
67
+ // bug is fixed.
68
+ // Enable sorting if filtering is enabled.
69
+ return html `<cds-custom-table
70
+ size="md"
71
+ locale=${locale}
72
+ .isSortable=${allowTableFiltering}
73
+ .useZebraStyles=${true}
74
+ @cds-custom-table-filtered=${handleFilterEvent}
75
+ >
76
+ ${tableTitle &&
77
+ html `<cds-custom-table-header-title slot="title"
78
+ >${tableTitle}</cds-custom-table-header-title
79
+ >`}
80
+ ${tableDescription &&
81
+ html `<cds-custom-table-header-description slot="description"
82
+ >${tableDescription}</cds-custom-table-header-description
83
+ >`}
84
+ ${toolbarElement()} ${headersElement()} ${rowsElement()}
85
+ </cds-custom-table>`;
86
+ }
87
+
88
+ export { tableTemplate };
89
+ //# sourceMappingURL=table.template.js.map