@carbon/ai-chat-components 0.5.0 → 0.6.0-rc.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 (483) hide show
  1. package/custom-elements.json +9201 -295
  2. package/dist/16-dhcD1XnN.js +91 -0
  3. package/dist/apl-DqFn9Cbk.js +91 -0
  4. package/dist/asciiarmor-CQVR_D9L.js +91 -0
  5. package/dist/asn1-Bdl290ll.js +91 -0
  6. package/dist/asterisk-CHhwduFx.js +91 -0
  7. package/dist/button-C7jiyqgq.js +157 -0
  8. package/dist/button-skeleton-CmP7IJd9.js +116 -0
  9. package/dist/carbon-element-Bx5dT_rO.js +91 -0
  10. package/dist/carbon-element-GZbOyRvd.js +91 -0
  11. package/dist/chain-of-thought.min.js +276 -0
  12. package/dist/chat-button.min.js +71 -81
  13. package/dist/checkbox-skeleton-DwliWSxe.js +166 -0
  14. package/dist/class-map-C991A_SZ.js +106 -0
  15. package/dist/clike-D_BRCCKx.js +91 -0
  16. package/dist/clojure-DJgQfSNr.js +91 -0
  17. package/dist/cmake-B-ZvYGPj.js +91 -0
  18. package/dist/cobol-DQkSt8H4.js +91 -0
  19. package/dist/code-snippet.min.js +91 -0
  20. package/dist/codemirror-runtime-BNdgITbn.js +173 -0
  21. package/dist/coffeescript-BLbmGaLw.js +91 -0
  22. package/dist/collection-helpers-CFQuvZZA.js +91 -0
  23. package/dist/commonlisp-C9udfub_.js +91 -0
  24. package/dist/crystal-Cx264mZy.js +91 -0
  25. package/dist/css-C3wBe_UD.js +91 -0
  26. package/dist/custom-element-Cn0sJQhF.js +96 -0
  27. package/dist/cypher-B6v9gzB5.js +91 -0
  28. package/dist/d-TP3OUaM_.js +91 -0
  29. package/dist/diff-Y92SrBOy.js +91 -0
  30. package/dist/dockerfile-b9e_zbYe.js +91 -0
  31. package/dist/dtd-CyzcM_UR.js +91 -0
  32. package/dist/dylan-CLgWKLaP.js +91 -0
  33. package/dist/ebnf-Cj21Kqae.js +91 -0
  34. package/dist/ecl-BcwtDAaq.js +91 -0
  35. package/dist/eiffel-Dgs2eMt8.js +91 -0
  36. package/dist/elm-Lz8luKdH.js +91 -0
  37. package/dist/erlang-M1-xYwsL.js +91 -0
  38. package/dist/factor-DMuLpKP7.js +91 -0
  39. package/dist/fcl-6D51jO4g.js +91 -0
  40. package/dist/feedback.min.js +300 -0
  41. package/dist/forth-C50AZvgy.js +91 -0
  42. package/dist/fortran-Dpu0QrPi.js +91 -0
  43. package/dist/gas-B9QnMcpy.js +91 -0
  44. package/dist/gherkin-DTyHG7By.js +91 -0
  45. package/dist/groovy-C5hIRvZS.js +91 -0
  46. package/dist/haskell-riE-Rg6U.js +91 -0
  47. package/dist/haxe-BKi5Bt6T.js +91 -0
  48. package/dist/http-CCf5f1Lw.js +91 -0
  49. package/dist/icon-button-slcp5_YI.js +143 -0
  50. package/dist/icon-loader-B470ctm0.js +101 -0
  51. package/dist/idl-ChujC8hT.js +91 -0
  52. package/dist/if-defined-KYZWA80L.js +96 -0
  53. package/dist/index-BE2hQiYV.js +91 -0
  54. package/dist/index-BJSu7ZrY.js +91 -0
  55. package/dist/index-BNCWBho3.js +91 -0
  56. package/dist/index-Bo9Cedlp.js +91 -0
  57. package/dist/index-BtGjzzQh.js +91 -0
  58. package/dist/index-BvcTcg8N.js +91 -0
  59. package/dist/index-CL7jwlI7.js +91 -0
  60. package/dist/index-CPho0oBg.js +91 -0
  61. package/dist/index-CSzVoPB_.js +91 -0
  62. package/dist/index-CbsQNetX.js +91 -0
  63. package/dist/index-CdZ_a1WB.js +91 -0
  64. package/dist/index-Ce_RTZPK.js +91 -0
  65. package/dist/index-Cic4krlv.js +91 -0
  66. package/dist/index-CqP0C8Q_.js +91 -0
  67. package/dist/index-CsEIBvob.js +91 -0
  68. package/dist/index-D5o8uLCI.js +168 -0
  69. package/dist/index-D8SIiSq6.js +367 -0
  70. package/dist/index-DP_9bMys.js +91 -0
  71. package/dist/index-DofS9KDk.js +91 -0
  72. package/dist/index-Duo7vkZg.js +91 -0
  73. package/dist/index-DxcNpyu9.js +91 -0
  74. package/dist/index-ET89Rloy.js +91 -0
  75. package/dist/index-LQA85hjt.js +91 -0
  76. package/dist/index-T4fwu_xG.js +91 -0
  77. package/dist/javascript-BXzknqbJ.js +91 -0
  78. package/dist/julia-Ks6uUXS_.js +91 -0
  79. package/dist/{settings-XW6XylsZ.js → lit-element-Cj6JUqRW.js} +70 -12
  80. package/dist/livescript-C-N_oa0B.js +91 -0
  81. package/dist/lua-DyvKK1uJ.js +91 -0
  82. package/dist/markdown.min.js +296 -0
  83. package/dist/mathematica-DEg7Ra1Y.js +91 -0
  84. package/dist/mbox-DreqCmNH.js +91 -0
  85. package/dist/mirc-Cf2JTO1B.js +91 -0
  86. package/dist/mllike-BrIsM2v2.js +91 -0
  87. package/dist/modelica-B8SYrhCg.js +91 -0
  88. package/dist/mscgen-Ci9STQqX.js +91 -0
  89. package/dist/mumps-DdZIEnoV.js +91 -0
  90. package/dist/nginx-csHLvOI4.js +91 -0
  91. package/dist/nsis-BJ14NiV_.js +91 -0
  92. package/dist/ntriples-r4TsB1vg.js +91 -0
  93. package/dist/octave-DAywLo7W.js +91 -0
  94. package/dist/oz-DF39EOLJ.js +91 -0
  95. package/dist/pascal-Cdx2JBFI.js +91 -0
  96. package/dist/perl-CUDzEjb5.js +91 -0
  97. package/dist/pig-BgGDN3Fs.js +91 -0
  98. package/dist/powershell-yf7ZzrwA.js +91 -0
  99. package/dist/processing.min.js +71 -4
  100. package/dist/properties-Cna57Jh2.js +91 -0
  101. package/dist/protobuf-CWUMO8BP.js +91 -0
  102. package/dist/pug-D44aRpDl.js +91 -0
  103. package/dist/puppet-9oZPpLZK.js +91 -0
  104. package/dist/python-BzmgDs2d.js +91 -0
  105. package/dist/q-DDRrIilQ.js +91 -0
  106. package/dist/query-CIc5rDzI.js +101 -0
  107. package/dist/r-DT4JIpvb.js +91 -0
  108. package/dist/radio-group-manager-Dy7yXQky.js +91 -0
  109. package/dist/reasoning-steps.min.js +171 -0
  110. package/dist/repeat-DA7noZfi.js +96 -0
  111. package/dist/rpm-Q94njsnC.js +91 -0
  112. package/dist/ruby-p6VwoSsc.js +91 -0
  113. package/dist/sas-C8r72_Ai.js +91 -0
  114. package/dist/scheme-Bw1qfPdY.js +91 -0
  115. package/dist/settings-Bx1fCry0.js +99 -0
  116. package/dist/shell-B0162WXP.js +91 -0
  117. package/dist/sieve-DcAl9TNY.js +91 -0
  118. package/dist/simple-mode-dBIHJK_w.js +91 -0
  119. package/dist/smalltalk-BRpoyy0q.js +91 -0
  120. package/dist/solr-CntivwdY.js +91 -0
  121. package/dist/sparql-CPxRv-GB.js +91 -0
  122. package/dist/spreadsheet-DiWzltX0.js +91 -0
  123. package/dist/sql-BZFWK8-D.js +91 -0
  124. package/dist/state-ldHJ0lGt.js +96 -0
  125. package/dist/stex-DVnajZzj.js +91 -0
  126. package/dist/stylus-BCkTgCvi.js +91 -0
  127. package/dist/swift-DumH6rGA.js +91 -0
  128. package/dist/sync-BrWXU4C6.js +91 -0
  129. package/dist/table-runtime-C-85Ozvo.js +510 -0
  130. package/dist/table.min.js +91 -0
  131. package/dist/tcl-Ds60z3Ro.js +91 -0
  132. package/dist/text-input-BNmEJ8ys.js +158 -0
  133. package/dist/textile-CgTb_UUX.js +91 -0
  134. package/dist/throttle-CT5ZAUBU.js +91 -0
  135. package/dist/tiddlywiki-D0BukLzX.js +91 -0
  136. package/dist/tiki-DlrtqA5_.js +91 -0
  137. package/dist/tile-container.min.js +70 -14
  138. package/dist/toml-CG0tgYZ1.js +91 -0
  139. package/dist/toolbar.min.js +180 -0
  140. package/dist/troff-DZdS2uzR.js +91 -0
  141. package/dist/ttcn-D2NdeEoM.js +91 -0
  142. package/dist/ttcn-cfg-dCpHFW8J.js +91 -0
  143. package/dist/turtle-DBImhCBD.js +91 -0
  144. package/dist/vb-BdASAZha.js +91 -0
  145. package/dist/vbscript-DlJph2V7.js +91 -0
  146. package/dist/velocity-ds6Akj1B.js +91 -0
  147. package/dist/verilog-KFajwNWD.js +91 -0
  148. package/dist/vhdl-DWozufY6.js +91 -0
  149. package/dist/webidl-BSUbcB__.js +91 -0
  150. package/dist/workspace-shell.min.js +162 -0
  151. package/dist/xquery-CvISDSSw.js +91 -0
  152. package/dist/yacas-BNn6e9ff.js +91 -0
  153. package/dist/z80-BwinLJKG.js +91 -0
  154. package/es/components/chain-of-thought/index.d.ts +4 -0
  155. package/es/components/chain-of-thought/index.js +11 -0
  156. package/es/components/chain-of-thought/index.js.map +1 -0
  157. package/es/components/chain-of-thought/src/cds-aichat-chain-of-thought.d.ts +15 -0
  158. package/es/components/chain-of-thought/src/cds-aichat-chain-of-thought.js +36 -0
  159. package/es/components/chain-of-thought/src/cds-aichat-chain-of-thought.js.map +1 -0
  160. package/es/components/chain-of-thought/src/chain-of-thought.d.ts +87 -0
  161. package/es/components/chain-of-thought/src/chain-of-thought.js +189 -0
  162. package/es/components/chain-of-thought/src/chain-of-thought.js.map +1 -0
  163. package/es/components/chain-of-thought/src/chain-of-thought.scss.js +13 -0
  164. package/es/components/chain-of-thought/src/chain-of-thought.scss.js.map +1 -0
  165. package/es/components/chain-of-thought/src/chain-of-thought.template.d.ts +5 -0
  166. package/es/components/chain-of-thought/src/chain-of-thought.template.js +206 -0
  167. package/es/components/chain-of-thought/src/chain-of-thought.template.js.map +1 -0
  168. package/es/components/chain-of-thought/src/parse-unknown-data-to-markdown.d.ts +10 -0
  169. package/es/components/chain-of-thought/src/parse-unknown-data-to-markdown.js +50 -0
  170. package/es/components/chain-of-thought/src/parse-unknown-data-to-markdown.js.map +1 -0
  171. package/es/components/chain-of-thought/src/types.d.ts +73 -0
  172. package/es/components/chain-of-thought/src/types.js +29 -0
  173. package/es/components/chain-of-thought/src/types.js.map +1 -0
  174. package/es/components/chat-button/defs.d.ts +25 -0
  175. package/es/components/chat-button/defs.js +36 -0
  176. package/es/components/chat-button/defs.js.map +1 -0
  177. package/es/components/chat-button/index.d.ts +1 -1
  178. package/es/components/chat-button/index.js +1 -1
  179. package/es/components/chat-button/src/chat-button.d.ts +32 -0
  180. package/es/components/chat-button/{chat-button.js → src/chat-button.js} +16 -10
  181. package/es/components/chat-button/src/chat-button.js.map +1 -0
  182. package/es/components/chat-button/src/chat-button.scss.js +1 -1
  183. package/es/components/code-snippet/index.d.ts +3 -0
  184. package/es/components/code-snippet/index.js +10 -0
  185. package/es/components/code-snippet/index.js.map +1 -0
  186. package/es/components/code-snippet/src/code-snippet-tile-container.d.ts +32 -0
  187. package/es/components/code-snippet/src/code-snippet-tile-container.js +143 -0
  188. package/es/components/code-snippet/src/code-snippet-tile-container.js.map +1 -0
  189. package/es/components/code-snippet/src/code-snippet.d.ts +482 -0
  190. package/es/components/code-snippet/src/code-snippet.js +592 -0
  191. package/es/components/code-snippet/src/code-snippet.js.map +1 -0
  192. package/es/components/code-snippet/src/code-snippet.scss.js +13 -0
  193. package/es/components/code-snippet/src/code-snippet.scss.js.map +1 -0
  194. package/es/components/code-snippet/src/codemirror/base-setup.d.ts +12 -0
  195. package/es/components/code-snippet/src/codemirror/base-setup.js +65 -0
  196. package/es/components/code-snippet/src/codemirror/base-setup.js.map +1 -0
  197. package/es/components/code-snippet/src/codemirror/codemirror-loader.d.ts +12 -0
  198. package/es/components/code-snippet/src/codemirror/codemirror-loader.js +36 -0
  199. package/es/components/code-snippet/src/codemirror/codemirror-loader.js.map +1 -0
  200. package/es/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +7 -0
  201. package/es/components/code-snippet/src/codemirror/codemirror-runtime.js +13 -0
  202. package/es/components/code-snippet/src/codemirror/codemirror-runtime.js.map +1 -0
  203. package/es/components/code-snippet/src/codemirror/content-sync.d.ts +12 -0
  204. package/es/components/code-snippet/src/codemirror/content-sync.js +72 -0
  205. package/es/components/code-snippet/src/codemirror/content-sync.js.map +1 -0
  206. package/es/components/code-snippet/src/codemirror/editor-manager.d.ts +28 -0
  207. package/es/components/code-snippet/src/codemirror/editor-manager.js +75 -0
  208. package/es/components/code-snippet/src/codemirror/editor-manager.js.map +1 -0
  209. package/es/components/code-snippet/src/codemirror/language-controller.d.ts +38 -0
  210. package/es/components/code-snippet/src/codemirror/language-controller.js +220 -0
  211. package/es/components/code-snippet/src/codemirror/language-controller.js.map +1 -0
  212. package/es/components/code-snippet/src/codemirror/language-data.d.ts +6 -0
  213. package/es/components/code-snippet/src/codemirror/language-data.js +1043 -0
  214. package/es/components/code-snippet/src/codemirror/language-data.js.map +1 -0
  215. package/es/components/code-snippet/src/codemirror/language-utils.d.ts +79 -0
  216. package/es/components/code-snippet/src/codemirror/language-utils.js +219 -0
  217. package/es/components/code-snippet/src/codemirror/language-utils.js.map +1 -0
  218. package/es/components/code-snippet/src/codemirror/marker-utils.d.ts +123 -0
  219. package/es/components/code-snippet/src/codemirror/marker-utils.js +183 -0
  220. package/es/components/code-snippet/src/codemirror/marker-utils.js.map +1 -0
  221. package/es/components/code-snippet/src/codemirror/theme.d.ts +54 -0
  222. package/es/components/code-snippet/src/codemirror/theme.js +320 -0
  223. package/es/components/code-snippet/src/codemirror/theme.js.map +1 -0
  224. package/es/components/code-snippet/src/dom-utils.d.ts +24 -0
  225. package/es/components/code-snippet/src/dom-utils.js +63 -0
  226. package/es/components/code-snippet/src/dom-utils.js.map +1 -0
  227. package/es/components/code-snippet/src/formatters.d.ts +4 -0
  228. package/es/components/code-snippet/src/formatters.js +19 -0
  229. package/es/components/code-snippet/src/formatters.js.map +1 -0
  230. package/es/components/code-snippet/src/layout-utils.d.ts +22 -0
  231. package/es/components/code-snippet/src/layout-utils.js +63 -0
  232. package/es/components/code-snippet/src/layout-utils.js.map +1 -0
  233. package/es/components/code-snippet/src/streaming-manager.d.ts +24 -0
  234. package/es/components/code-snippet/src/streaming-manager.js +120 -0
  235. package/es/components/code-snippet/src/streaming-manager.js.map +1 -0
  236. package/es/components/feedback/index.d.ts +7 -0
  237. package/es/components/feedback/index.js +12 -0
  238. package/es/components/feedback/index.js.map +1 -0
  239. package/es/components/feedback/src/cds-aichat-feedback-buttons.d.ts +15 -0
  240. package/es/components/feedback/src/cds-aichat-feedback-buttons.js +36 -0
  241. package/es/components/feedback/src/cds-aichat-feedback-buttons.js.map +1 -0
  242. package/es/components/feedback/src/cds-aichat-feedback.d.ts +15 -0
  243. package/es/components/feedback/src/cds-aichat-feedback.js +36 -0
  244. package/es/components/feedback/src/cds-aichat-feedback.js.map +1 -0
  245. package/es/components/feedback/src/feedback-buttons.d.ts +56 -0
  246. package/es/components/feedback/src/feedback-buttons.js +104 -0
  247. package/es/components/feedback/src/feedback-buttons.js.map +1 -0
  248. package/es/components/feedback/src/feedback-buttons.scss.js +13 -0
  249. package/es/components/feedback/src/feedback-buttons.scss.js.map +1 -0
  250. package/es/components/feedback/src/feedback-buttons.template.d.ts +4 -0
  251. package/es/components/feedback/src/feedback-buttons.template.js +79 -0
  252. package/es/components/feedback/src/feedback-buttons.template.js.map +1 -0
  253. package/es/components/feedback/src/feedback.d.ts +114 -0
  254. package/es/components/feedback/src/feedback.js +182 -0
  255. package/es/components/feedback/src/feedback.js.map +1 -0
  256. package/es/components/feedback/src/feedback.scss.js +13 -0
  257. package/es/components/feedback/src/feedback.scss.js.map +1 -0
  258. package/es/components/feedback/src/feedback.template.d.ts +12 -0
  259. package/es/components/feedback/src/feedback.template.js +115 -0
  260. package/es/components/feedback/src/feedback.template.js.map +1 -0
  261. package/es/components/markdown/index.d.ts +2 -0
  262. package/es/components/markdown/index.js +9 -0
  263. package/es/components/markdown/index.js.map +1 -0
  264. package/es/components/markdown/src/cds-aichat-markdown.d.ts +13 -0
  265. package/es/components/markdown/src/cds-aichat-markdown.js +35 -0
  266. package/es/components/markdown/src/cds-aichat-markdown.js.map +1 -0
  267. package/es/components/markdown/src/markdown-renderer.d.ts +62 -0
  268. package/es/components/markdown/src/markdown-renderer.js +353 -0
  269. package/es/components/markdown/src/markdown-renderer.js.map +1 -0
  270. package/es/components/markdown/src/markdown-token-tree.d.ts +32 -0
  271. package/es/components/markdown/src/markdown-token-tree.js +178 -0
  272. package/es/components/markdown/src/markdown-token-tree.js.map +1 -0
  273. package/es/components/markdown/src/markdown.d.ts +44 -0
  274. package/es/components/markdown/src/markdown.js +238 -0
  275. package/es/components/markdown/src/markdown.js.map +1 -0
  276. package/es/components/markdown/src/markdown.scss.js +13 -0
  277. package/es/components/markdown/src/markdown.scss.js.map +1 -0
  278. package/es/components/markdown/src/markdown.template.d.ts +3 -0
  279. package/es/components/markdown/src/markdown.template.js +24 -0
  280. package/es/components/markdown/src/markdown.template.js.map +1 -0
  281. package/es/components/markdown/src/plugins/markdown-it-attrs.d.ts +7 -0
  282. package/es/components/markdown/src/plugins/markdown-it-attrs.js +84 -0
  283. package/es/components/markdown/src/plugins/markdown-it-attrs.js.map +1 -0
  284. package/es/components/markdown/src/plugins/markdown-it-highlight.d.ts +7 -0
  285. package/es/components/markdown/src/plugins/markdown-it-highlight.js +59 -0
  286. package/es/components/markdown/src/plugins/markdown-it-highlight.js.map +1 -0
  287. package/es/components/markdown/src/plugins/markdown-it-task-lists.d.ts +12 -0
  288. package/es/components/markdown/src/plugins/markdown-it-task-lists.js +73 -0
  289. package/es/components/markdown/src/plugins/markdown-it-task-lists.js.map +1 -0
  290. package/es/components/markdown/src/plugins/markdownItAttrs/core.d.ts +26 -0
  291. package/es/components/markdown/src/plugins/markdownItAttrs/core.js +330 -0
  292. package/es/components/markdown/src/plugins/markdownItAttrs/core.js.map +1 -0
  293. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.d.ts +6 -0
  294. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js +63 -0
  295. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js.map +1 -0
  296. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.d.ts +6 -0
  297. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.js +43 -0
  298. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.js.map +1 -0
  299. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.d.ts +5 -0
  300. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.js +55 -0
  301. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.js.map +1 -0
  302. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.d.ts +19 -0
  303. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js +210 -0
  304. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js.map +1 -0
  305. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.d.ts +13 -0
  306. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js +156 -0
  307. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js.map +1 -0
  308. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.d.ts +13 -0
  309. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js +216 -0
  310. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js.map +1 -0
  311. package/es/components/markdown/src/plugins/markdownItAttrs/types.d.ts +34 -0
  312. package/es/components/markdown/src/plugins/markdownItAttrs/types.js +8 -0
  313. package/es/components/markdown/src/plugins/markdownItAttrs/types.js.map +1 -0
  314. package/es/components/markdown/src/plugins/markdownItAttrs/utils.d.ts +25 -0
  315. package/es/components/markdown/src/plugins/markdownItAttrs/utils.js +62 -0
  316. package/es/components/markdown/src/plugins/markdownItAttrs/utils.js.map +1 -0
  317. package/es/components/markdown/src/utils/html-helpers.d.ts +2 -0
  318. package/es/components/markdown/src/utils/html-helpers.js +204 -0
  319. package/es/components/markdown/src/utils/html-helpers.js.map +1 -0
  320. package/es/components/markdown/src/utils/table-helpers.d.ts +31 -0
  321. package/es/components/markdown/src/utils/table-helpers.js +106 -0
  322. package/es/components/markdown/src/utils/table-helpers.js.map +1 -0
  323. package/es/components/markdown/src/utils.d.ts +8 -0
  324. package/es/components/markdown/src/utils.js +31 -0
  325. package/es/components/markdown/src/utils.js.map +1 -0
  326. package/es/components/reasoning-steps/index.d.ts +2 -0
  327. package/es/components/reasoning-steps/index.js +10 -0
  328. package/es/components/reasoning-steps/index.js.map +1 -0
  329. package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.d.ts +29 -0
  330. package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.js +231 -0
  331. package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.js.map +1 -0
  332. package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.scss.js +13 -0
  333. package/es/components/reasoning-steps/src/cds-aichat-reasoning-step.scss.js.map +1 -0
  334. package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.d.ts +13 -0
  335. package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.js +96 -0
  336. package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.js.map +1 -0
  337. package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.scss.js +13 -0
  338. package/es/components/reasoning-steps/src/cds-aichat-reasoning-steps.scss.js.map +1 -0
  339. package/es/components/table/index.d.ts +3 -0
  340. package/es/components/table/index.js +9 -0
  341. package/es/components/table/index.js.map +1 -0
  342. package/es/components/table/src/cds-aichat-table.d.ts +262 -0
  343. package/es/components/table/src/cds-aichat-table.js +511 -0
  344. package/es/components/table/src/cds-aichat-table.js.map +1 -0
  345. package/es/components/table/src/table-loader.d.ts +4 -0
  346. package/es/components/table/src/table-loader.js +28 -0
  347. package/es/components/table/src/table-loader.js.map +1 -0
  348. package/es/components/table/src/table-pagination.template.d.ts +27 -0
  349. package/es/components/table/src/table-pagination.template.js +55 -0
  350. package/es/components/table/src/table-pagination.template.js.map +1 -0
  351. package/es/components/table/src/table-runtime.d.ts +2 -0
  352. package/es/components/table/src/table-runtime.js +10 -0
  353. package/es/components/table/src/table-runtime.js.map +1 -0
  354. package/es/components/table/src/table-skeleton.template.d.ts +6 -0
  355. package/es/components/table/src/table-skeleton.template.js +34 -0
  356. package/es/components/table/src/table-skeleton.template.js.map +1 -0
  357. package/es/components/table/src/table.scss.js +13 -0
  358. package/es/components/table/src/table.scss.js.map +1 -0
  359. package/es/components/table/src/table.template.d.ts +10 -0
  360. package/es/components/table/src/table.template.js +89 -0
  361. package/es/components/table/src/table.template.js.map +1 -0
  362. package/es/components/table/src/types.d.ts +13 -0
  363. package/es/components/table/src/types.js +8 -0
  364. package/es/components/table/src/types.js.map +1 -0
  365. package/es/components/tile-container/src/styles.scss.js +1 -1
  366. package/es/components/toolbar/index.d.ts +1 -0
  367. package/es/components/toolbar/index.js +9 -0
  368. package/es/components/toolbar/index.js.map +1 -0
  369. package/es/components/toolbar/src/toolbar.d.ts +39 -0
  370. package/es/components/toolbar/src/toolbar.js +179 -0
  371. package/es/components/toolbar/src/toolbar.js.map +1 -0
  372. package/es/components/toolbar/src/toolbar.scss.js +13 -0
  373. package/es/components/toolbar/src/toolbar.scss.js.map +1 -0
  374. package/es/components/workspace-shell/index.d.ts +5 -0
  375. package/es/components/workspace-shell/index.js +13 -0
  376. package/es/components/workspace-shell/index.js.map +1 -0
  377. package/es/components/workspace-shell/src/styles.scss.js +13 -0
  378. package/es/components/workspace-shell/src/styles.scss.js.map +1 -0
  379. package/es/components/workspace-shell/src/workspace-shell-body.d.ts +16 -0
  380. package/es/components/workspace-shell/src/workspace-shell-body.js +50 -0
  381. package/es/components/workspace-shell/src/workspace-shell-body.js.map +1 -0
  382. package/es/components/workspace-shell/src/workspace-shell-footer.d.ts +19 -0
  383. package/es/components/workspace-shell/src/workspace-shell-footer.js +53 -0
  384. package/es/components/workspace-shell/src/workspace-shell-footer.js.map +1 -0
  385. package/es/components/workspace-shell/src/workspace-shell-header.d.ts +27 -0
  386. package/es/components/workspace-shell/src/workspace-shell-header.js +77 -0
  387. package/es/components/workspace-shell/src/workspace-shell-header.js.map +1 -0
  388. package/es/components/workspace-shell/src/workspace-shell-toolbar.d.ts +22 -0
  389. package/es/components/workspace-shell/src/workspace-shell-toolbar.js +61 -0
  390. package/es/components/workspace-shell/src/workspace-shell-toolbar.js.map +1 -0
  391. package/es/components/workspace-shell/src/workspace-shell.d.ts +20 -0
  392. package/es/components/workspace-shell/src/workspace-shell.js +83 -0
  393. package/es/components/workspace-shell/src/workspace-shell.js.map +1 -0
  394. package/es/components/workspace-shell/src/workspace-shell.scss.js +13 -0
  395. package/es/components/workspace-shell/src/workspace-shell.scss.js.map +1 -0
  396. package/es/globals/utils/uuid.d.ts +5 -0
  397. package/es/globals/utils/uuid.js +32 -0
  398. package/es/globals/utils/uuid.js.map +1 -0
  399. package/es/node_modules/@carbon/utilities/es/documentLang/documentLang.js +9 -0
  400. package/es/node_modules/@carbon/utilities/es/documentLang/documentLang.js.map +1 -0
  401. package/es/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js +11 -0
  402. package/es/node_modules/@carbon/utilities/es/overflowHandler/overflowHandler.js.map +1 -0
  403. package/es/node_modules/@codemirror/autocomplete/dist/index.js +258 -0
  404. package/es/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -0
  405. package/es/node_modules/@codemirror/commands/dist/index.js +1140 -0
  406. package/es/node_modules/@codemirror/commands/dist/index.js.map +1 -0
  407. package/es/node_modules/@codemirror/lint/dist/index.js +636 -0
  408. package/es/node_modules/@codemirror/lint/dist/index.js.map +1 -0
  409. package/es/node_modules/@lezer/common/dist/index.js +253 -0
  410. package/es/node_modules/@lezer/common/dist/index.js.map +1 -0
  411. package/es/node_modules/crelt/index.js +37 -0
  412. package/es/node_modules/crelt/index.js.map +1 -0
  413. package/es/react/ai-label.d.ts +2 -1
  414. package/es/react/ai-label.js +3 -2
  415. package/es/react/ai-label.js.map +1 -1
  416. package/es/react/button.d.ts +2 -1
  417. package/es/react/button.js +3 -2
  418. package/es/react/button.js.map +1 -1
  419. package/es/react/chain-of-thought.d.ts +7 -0
  420. package/es/react/chain-of-thought.js +29 -0
  421. package/es/react/chain-of-thought.js.map +1 -0
  422. package/es/react/chat-button.d.ts +4 -4
  423. package/es/react/chat-button.js +6 -4
  424. package/es/react/chat-button.js.map +1 -1
  425. package/es/react/code-snippet-tile-container.d.ts +5 -0
  426. package/es/react/code-snippet-tile-container.js +30 -0
  427. package/es/react/code-snippet-tile-container.js.map +1 -0
  428. package/es/react/code-snippet.d.ts +4 -0
  429. package/es/react/code-snippet.js +31 -0
  430. package/es/react/code-snippet.js.map +1 -0
  431. package/es/react/content-switcher.d.ts +7 -0
  432. package/es/react/content-switcher.js +37 -0
  433. package/es/react/content-switcher.js.map +1 -0
  434. package/es/react/feedback-buttons.d.ts +4 -0
  435. package/es/react/feedback-buttons.js +28 -0
  436. package/es/react/feedback-buttons.js.map +1 -0
  437. package/es/react/feedback.d.ts +6 -0
  438. package/es/react/feedback.js +32 -0
  439. package/es/react/feedback.js.map +1 -0
  440. package/es/react/icon-button.d.ts +2 -1
  441. package/es/react/icon-button.js +3 -2
  442. package/es/react/icon-button.js.map +1 -1
  443. package/es/react/icon.d.ts +4 -0
  444. package/es/react/icon.js +28 -0
  445. package/es/react/icon.js.map +1 -0
  446. package/es/react/markdown.d.ts +4 -0
  447. package/es/react/markdown.js +28 -0
  448. package/es/react/markdown.js.map +1 -0
  449. package/es/react/overflow-menu.d.ts +9 -0
  450. package/es/react/overflow-menu.js +40 -0
  451. package/es/react/overflow-menu.js.map +1 -0
  452. package/es/react/processing.d.ts +2 -1
  453. package/es/react/processing.js +3 -2
  454. package/es/react/processing.js.map +1 -1
  455. package/es/react/reasoning-step.d.ts +6 -0
  456. package/es/react/reasoning-step.js +31 -0
  457. package/es/react/reasoning-step.js.map +1 -0
  458. package/es/react/reasoning-steps.d.ts +3 -0
  459. package/es/react/reasoning-steps.js +27 -0
  460. package/es/react/reasoning-steps.js.map +1 -0
  461. package/es/react/tile-container.d.ts +2 -1
  462. package/es/react/tile-container.js +3 -2
  463. package/es/react/tile-container.js.map +1 -1
  464. package/es/react/tile.d.ts +3 -2
  465. package/es/react/tile.js +5 -4
  466. package/es/react/tile.js.map +1 -1
  467. package/es/react/toolbar.d.ts +4 -0
  468. package/es/react/toolbar.js +28 -0
  469. package/es/react/toolbar.js.map +1 -0
  470. package/es/react/utils/withWebComponentBridge.d.ts +15 -0
  471. package/es/react/utils/withWebComponentBridge.js +95 -0
  472. package/es/react/utils/withWebComponentBridge.js.map +1 -0
  473. package/es/testing/load-all-lazy-deps.d.ts +10 -0
  474. package/es/testing/load-all-lazy-deps.js +30 -0
  475. package/es/testing/load-all-lazy-deps.js.map +1 -0
  476. package/package.json +39 -5
  477. package/dist/carbon-element-CMR7BOhG.js +0 -24
  478. package/dist/class-map-h7IEvsL_.js +0 -39
  479. package/es/components/chat-button/chat-button.d.ts +0 -23
  480. package/es/components/chat-button/chat-button.js.map +0 -1
  481. package/es/components/chat-button/src/chat-button.template.d.ts +0 -16
  482. package/es/components/chat-button/src/chat-button.template.js +0 -27
  483. package/es/components/chat-button/src/chat-button.template.js.map +0 -1
@@ -0,0 +1,26 @@
1
+ import type { Token } from "markdown-it";
2
+ import type { MarkdownItAttrsOptions, AttributePair, DetectingStrRule, DetectingRule, MatchedResult } from "./types.js";
3
+ /**
4
+ * Parses attribute strings in the format {.class #id key=val} and returns an array of attribute key-value pairs.
5
+ */
6
+ export declare function getAttrs(str: string, start: number, options: Required<MarkdownItAttrsOptions>): AttributePair[];
7
+ /**
8
+ * Applies an array of attribute pairs to a token, handling special cases for class and css-module attributes.
9
+ */
10
+ export declare function addAttrs(attrs: AttributePair[], token: Token): Token;
11
+ /**
12
+ * Creates a function that tests whether a string contains attribute delimiters at a specified position (start, end, or only).
13
+ */
14
+ export declare function hasDelimiters(where: "start" | "end" | "only", options: Required<MarkdownItAttrsOptions>): DetectingStrRule;
15
+ /**
16
+ * Removes attribute delimiters and their contents from the end of a string.
17
+ */
18
+ export declare function removeDelimiter(str: string, options: Required<MarkdownItAttrsOptions>): string;
19
+ /**
20
+ * Finds the matching opening token for a given closing token by searching backwards through the token array.
21
+ */
22
+ export declare function getMatchingOpeningToken(tokens: Token[], closingTokenIndex: number): Token | false;
23
+ /**
24
+ * Tests whether a token at a given index matches a detecting rule, recursively checking nested rules.
25
+ */
26
+ export declare function test(tokens: Token[], baseIndex: number, rule: DetectingRule): MatchedResult;
@@ -0,0 +1,330 @@
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 { get, isArrayOfObjects, last, isArrayOfFunctions, escapeRegExp } from './utils.js';
9
+
10
+ /*
11
+ * Copyright IBM Corp. 2025
12
+ *
13
+ * This source code is licensed under the Apache-2.0 license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ *
16
+ * @license
17
+ */
18
+ /**
19
+ * Parses attribute strings in the format {.class #id key=val} and returns an array of attribute key-value pairs.
20
+ */
21
+ function getAttrs(str, start, options) {
22
+ const allowedKeyChars = /[^\t\n\f />"'=]/;
23
+ const pairSeparator = " ";
24
+ const keySeparator = "=";
25
+ const classChar = ".";
26
+ const idChar = "#";
27
+ const attrs = [];
28
+ let key = "";
29
+ let value = "";
30
+ let parsingKey = true;
31
+ let valueInsideQuotes = false;
32
+ // Iterate through the string starting after the left delimiter
33
+ for (let characterIndex = start + options.leftDelimiter.length; characterIndex < str.length; characterIndex++) {
34
+ // Check if we've reached the right delimiter (end of attributes)
35
+ if (str.slice(characterIndex, characterIndex + options.rightDelimiter.length) === options.rightDelimiter) {
36
+ if (key !== "") {
37
+ attrs.push([key, value]);
38
+ }
39
+ break;
40
+ }
41
+ const char_ = str.charAt(characterIndex);
42
+ // Switch from parsing key to parsing value when we hit '='
43
+ if (char_ === keySeparator && parsingKey) {
44
+ parsingKey = false;
45
+ continue;
46
+ }
47
+ // Handle class shorthand syntax: .classname or ..css-module
48
+ if (char_ === classChar && key === "") {
49
+ if (str.charAt(characterIndex + 1) === classChar) {
50
+ key = "css-module";
51
+ characterIndex += 1;
52
+ }
53
+ else {
54
+ key = "class";
55
+ }
56
+ parsingKey = false;
57
+ continue;
58
+ }
59
+ // Handle id shorthand syntax: #idname
60
+ if (char_ === idChar && key === "") {
61
+ key = "id";
62
+ parsingKey = false;
63
+ continue;
64
+ }
65
+ // Handle opening quote for attribute values
66
+ if (char_ === '"' && value === "" && !valueInsideQuotes) {
67
+ valueInsideQuotes = true;
68
+ continue;
69
+ }
70
+ // Handle closing quote for attribute values
71
+ if (char_ === '"' && valueInsideQuotes) {
72
+ valueInsideQuotes = false;
73
+ continue;
74
+ }
75
+ // Space separates attribute pairs (unless inside quotes)
76
+ if (char_ === pairSeparator && !valueInsideQuotes) {
77
+ if (key === "") {
78
+ continue;
79
+ }
80
+ attrs.push([key, value]);
81
+ key = "";
82
+ value = "";
83
+ parsingKey = true;
84
+ continue;
85
+ }
86
+ // Skip invalid characters in key names
87
+ if (parsingKey && char_.search(allowedKeyChars) === -1) {
88
+ continue;
89
+ }
90
+ // Append character to either key or value
91
+ if (parsingKey) {
92
+ key += char_;
93
+ continue;
94
+ }
95
+ value += char_;
96
+ }
97
+ // Filter attributes based on allowedAttributes option
98
+ if (options.allowedAttributes && options.allowedAttributes.length) {
99
+ return attrs.filter((attrPair) => {
100
+ const attr = attrPair[0];
101
+ return options.allowedAttributes.some((allowedAttribute) => allowedAttribute instanceof RegExp
102
+ ? allowedAttribute.test(attr)
103
+ : attr === allowedAttribute);
104
+ });
105
+ }
106
+ return attrs;
107
+ }
108
+ /**
109
+ * Applies an array of attribute pairs to a token, handling special cases for class and css-module attributes.
110
+ */
111
+ function addAttrs(attrs, token) {
112
+ for (let attributeIndex = 0; attributeIndex < attrs.length; attributeIndex += 1) {
113
+ const key = attrs[attributeIndex][0];
114
+ if (key === "class") {
115
+ token.attrJoin("class", attrs[attributeIndex][1]);
116
+ }
117
+ else if (key === "css-module") {
118
+ token.attrJoin("css-module", attrs[attributeIndex][1]);
119
+ }
120
+ else {
121
+ token.attrPush(attrs[attributeIndex]);
122
+ }
123
+ }
124
+ return token;
125
+ }
126
+ /**
127
+ * Creates a function that tests whether a string contains attribute delimiters at a specified position (start, end, or only).
128
+ */
129
+ function hasDelimiters(where, options) {
130
+ if (!where) {
131
+ throw new Error('Parameter `where` not passed. Should be "start", "end" or "only".');
132
+ }
133
+ return function (str) {
134
+ // Minimum length needed: { + at least one char + }
135
+ const minCurlyLength = options.leftDelimiter.length + 1 + options.rightDelimiter.length;
136
+ if (!str || typeof str !== "string" || str.length < minCurlyLength) {
137
+ return false;
138
+ }
139
+ // Class/ID syntax requires an extra character (.class or #id)
140
+ function validCurlyLength(curly) {
141
+ const isClass = curly.charAt(options.leftDelimiter.length) === ".";
142
+ const isId = curly.charAt(options.leftDelimiter.length) === "#";
143
+ return isClass || isId
144
+ ? curly.length >= minCurlyLength + 1
145
+ : curly.length >= minCurlyLength;
146
+ }
147
+ let start, end, slice, nextChar;
148
+ const rightDelimiterMinimumShift = minCurlyLength - options.rightDelimiter.length;
149
+ switch (where) {
150
+ case "start":
151
+ // Check if delimiters are at the start of the string
152
+ slice = str.slice(0, options.leftDelimiter.length);
153
+ start = slice === options.leftDelimiter ? 0 : -1;
154
+ end =
155
+ start === -1
156
+ ? -1
157
+ : str.indexOf(options.rightDelimiter, rightDelimiterMinimumShift);
158
+ // Ensure the character after closing delimiter isn't part of the delimiter itself
159
+ nextChar = str.charAt(end + options.rightDelimiter.length);
160
+ if (nextChar && options.rightDelimiter.indexOf(nextChar) !== -1) {
161
+ end = -1;
162
+ }
163
+ break;
164
+ case "end":
165
+ // Check if delimiters are at the end of the string
166
+ start = str.lastIndexOf(options.leftDelimiter);
167
+ end =
168
+ start === -1
169
+ ? -1
170
+ : str.indexOf(options.rightDelimiter, start + rightDelimiterMinimumShift);
171
+ // Verify the closing delimiter is actually at the string's end
172
+ end = end === str.length - options.rightDelimiter.length ? end : -1;
173
+ break;
174
+ case "only":
175
+ // Check if the entire string is delimiters with content inside
176
+ slice = str.slice(0, options.leftDelimiter.length);
177
+ start = slice === options.leftDelimiter ? 0 : -1;
178
+ slice = str.slice(str.length - options.rightDelimiter.length);
179
+ end =
180
+ slice === options.rightDelimiter
181
+ ? str.length - options.rightDelimiter.length
182
+ : -1;
183
+ break;
184
+ default:
185
+ throw new Error(`Unexpected case ${where}, expected 'start', 'end' or 'only'`);
186
+ }
187
+ // Valid if we found both delimiters and the content between them is valid
188
+ return (start !== -1 &&
189
+ end !== -1 &&
190
+ validCurlyLength(str.substring(start, end + options.rightDelimiter.length)));
191
+ };
192
+ }
193
+ /**
194
+ * Removes attribute delimiters and their contents from the end of a string.
195
+ */
196
+ function removeDelimiter(str, options) {
197
+ const start = escapeRegExp(options.leftDelimiter);
198
+ const end = escapeRegExp(options.rightDelimiter);
199
+ const curly = new RegExp("[ \\n]?" + start + "[^" + start + end + "]+" + end + "$");
200
+ const pos = str.search(curly);
201
+ return pos !== -1 ? str.slice(0, pos) : str;
202
+ }
203
+ /**
204
+ * Finds the matching opening token for a given closing token by searching backwards through the token array.
205
+ */
206
+ function getMatchingOpeningToken(tokens, closingTokenIndex) {
207
+ if (tokens[closingTokenIndex].type === "softbreak") {
208
+ return false;
209
+ }
210
+ if (tokens[closingTokenIndex].nesting === 0) {
211
+ return tokens[closingTokenIndex];
212
+ }
213
+ const targetLevel = tokens[closingTokenIndex].level;
214
+ const expectedType = tokens[closingTokenIndex].type.replace("_close", "_open");
215
+ for (let searchIndex = closingTokenIndex; searchIndex >= 0; searchIndex--) {
216
+ if (tokens[searchIndex].type === expectedType &&
217
+ tokens[searchIndex].level === targetLevel) {
218
+ return tokens[searchIndex];
219
+ }
220
+ }
221
+ return false;
222
+ }
223
+ /**
224
+ * Tests whether a token at a given index matches a detecting rule, recursively checking nested rules.
225
+ */
226
+ function test(tokens, baseIndex, rule) {
227
+ const result = {
228
+ match: false,
229
+ j: null,
230
+ };
231
+ // Calculate the actual token index using shift (relative) or position (absolute)
232
+ const targetIndex = rule.shift !== undefined ? baseIndex + rule.shift : rule.position;
233
+ // Negative indices are invalid when using shift
234
+ if (rule.shift !== undefined &&
235
+ targetIndex !== undefined &&
236
+ targetIndex < 0) {
237
+ return result;
238
+ }
239
+ // Get the token at the calculated index
240
+ const token = get(tokens, targetIndex ?? 0);
241
+ if (token === undefined) {
242
+ return result;
243
+ }
244
+ // Test each property in the detecting rule
245
+ for (const key of Object.keys(rule)) {
246
+ // Skip internal position markers
247
+ if (key === "shift" || key === "position") {
248
+ continue;
249
+ }
250
+ // Token must have the property being tested
251
+ if (token[key] === undefined) {
252
+ return result;
253
+ }
254
+ // Special handling for children array matching
255
+ if (key === "children" && isArrayOfObjects(rule.children)) {
256
+ if (!token.children || token.children.length === 0) {
257
+ return result;
258
+ }
259
+ let match;
260
+ const childTests = rule.children;
261
+ const children = token.children;
262
+ // If all child tests use absolute positions, test those specific positions
263
+ if (childTests.every((childRule) => childRule.position !== undefined)) {
264
+ match = childTests.every((childRule) => test(children, childRule.position, childRule).match);
265
+ if (match) {
266
+ // Calculate the actual index (handling negative positions)
267
+ const childPosition = last(childTests).position;
268
+ result.j =
269
+ childPosition >= 0
270
+ ? childPosition
271
+ : children.length + childPosition;
272
+ }
273
+ }
274
+ else {
275
+ // Otherwise, scan through all children to find a matching sequence
276
+ match = false;
277
+ for (let childIndex = 0; childIndex < children.length; childIndex++) {
278
+ match = childTests.every((childRule) => test(children, childIndex, childRule).match);
279
+ if (match) {
280
+ result.j = childIndex;
281
+ break;
282
+ }
283
+ }
284
+ }
285
+ if (match === false) {
286
+ return result;
287
+ }
288
+ continue;
289
+ }
290
+ // Get the values to compare
291
+ const ruleValue = rule[key];
292
+ const tokenValue = token[key];
293
+ // Match based on the type of the test value
294
+ switch (typeof ruleValue) {
295
+ case "boolean":
296
+ case "number":
297
+ case "string":
298
+ // Direct value comparison
299
+ if (tokenValue !== ruleValue) {
300
+ return result;
301
+ }
302
+ break;
303
+ case "function":
304
+ // Function predicate test
305
+ if (!ruleValue(tokenValue)) {
306
+ return result;
307
+ }
308
+ break;
309
+ case "object":
310
+ // Array of function predicates (all must pass)
311
+ if (isArrayOfFunctions(ruleValue)) {
312
+ const allPass = ruleValue.every((predicate) => predicate(tokenValue));
313
+ if (allPass === false) {
314
+ return result;
315
+ }
316
+ break;
317
+ }
318
+ // For objects !== arrays of functions, throw error
319
+ throw new Error(`Unknown type of pattern test (key: ${key}). Test should be of type boolean, number, string, function or array of functions.`);
320
+ default:
321
+ throw new Error(`Unknown type of pattern test (key: ${key}). Test should be of type boolean, number, string, function or array of functions.`);
322
+ }
323
+ }
324
+ // All tests passed
325
+ result.match = true;
326
+ return result;
327
+ }
328
+
329
+ export { addAttrs, getAttrs, getMatchingOpeningToken, hasDelimiters, removeDelimiter, test };
330
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sources":["../../../../../../src/components/markdown/src/plugins/markdownItAttrs/core.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;AAOG;AAkBH;;AAEG;SACa,QAAQ,CACtB,GAAW,EACX,KAAa,EACb,OAAyC,EAAA;IAEzC,MAAM,eAAe,GAAG,iBAAiB;IACzC,MAAM,aAAa,GAAG,GAAG;IACzB,MAAM,YAAY,GAAG,GAAG;IACxB,MAAM,SAAS,GAAG,GAAG;IACrB,MAAM,MAAM,GAAG,GAAG;IAElB,MAAM,KAAK,GAAoB,EAAE;IACjC,IAAI,GAAG,GAAG,EAAE;IACZ,IAAI,KAAK,GAAG,EAAE;IACd,IAAI,UAAU,GAAG,IAAI;IACrB,IAAI,iBAAiB,GAAG,KAAK;;IAG7B,KACE,IAAI,cAAc,GAAG,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,EACzD,cAAc,GAAG,GAAG,CAAC,MAAM,EAC3B,cAAc,EAAE,EAChB;;AAEA,QAAA,IACE,GAAG,CAAC,KAAK,CACP,cAAc,EACd,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,CAC/C,KAAK,OAAO,CAAC,cAAc,EAC5B;AACA,YAAA,IAAI,GAAG,KAAK,EAAE,EAAE;gBACd,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;Y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AAS,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,UAAU,CAAC,CAAC;AACrE,oBAAA,IAAI,OAAO,KAAK,KAAK,EAAE;AACrB,wBAAA,OAAO,MAAM;oBACf;oBACA;gBACF;;AAEA,gBAAA,MAAM,IAAI,KAAK,CACb,sCAAsC,GAAG,CAAA,kFAAA,CAAoF,CAC9H;AACH,YAAA;AACE,gBAAA,MAAM,IAAI,KAAK,CACb,sCAAsC,GAAG,CAAA,kFAAA,CAAoF,CAC9H;;IAEP;;AAGA,IAAA,MAAM,CAAC,KAAK,GAAG,IAAI;AACnB,IAAA,OAAO,MAAM;AACf;;;;"}
@@ -0,0 +1,6 @@
1
+ import type { MarkdownItAttrsOptions, CurlyAttrsPattern } from "../types.js";
2
+ /**
3
+ * Pattern for horizontal rules with attributes.
4
+ * Example: --- {.class}
5
+ */
6
+ export declare function createHorizontalRulePattern(options: Required<MarkdownItAttrsOptions>): CurlyAttrsPattern;
@@ -0,0 +1,63 @@
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 { getAttrs, addAttrs } from '../core.js';
9
+ import { escapeRegExp } from '../utils.js';
10
+
11
+ /*
12
+ * Copyright IBM Corp. 2025
13
+ *
14
+ * This source code is licensed under the Apache-2.0 license found in the
15
+ * LICENSE file in the root directory of this source tree.
16
+ *
17
+ * @license
18
+ */
19
+ /**
20
+ * Pattern for horizontal rules with attributes.
21
+ * Example: --- {.class}
22
+ */
23
+ function createHorizontalRulePattern(options) {
24
+ const __hr = new RegExp("^ {0,3}[-*_]{3,} ?" +
25
+ escapeRegExp(options.leftDelimiter) +
26
+ "[^" +
27
+ escapeRegExp(options.rightDelimiter) +
28
+ "]");
29
+ return {
30
+ name: "horizontal rule",
31
+ tests: [
32
+ {
33
+ shift: 0,
34
+ type: "paragraph_open",
35
+ },
36
+ {
37
+ shift: 1,
38
+ type: "inline",
39
+ children: (arr) => arr.length === 1,
40
+ content: (str) => str.match(__hr) !== null,
41
+ },
42
+ {
43
+ shift: 2,
44
+ type: "paragraph_close",
45
+ },
46
+ ],
47
+ transform: (tokens, tokenIndex) => {
48
+ const token = tokens[tokenIndex];
49
+ token.type = "hr";
50
+ token.tag = "hr";
51
+ token.nesting = 0;
52
+ const content = tokens[tokenIndex + 1].content;
53
+ const attrStart = content.lastIndexOf(options.leftDelimiter);
54
+ const attrs = getAttrs(content, attrStart, options);
55
+ addAttrs(attrs, token);
56
+ token.markup = content;
57
+ tokens.splice(tokenIndex + 1, 2);
58
+ },
59
+ };
60
+ }
61
+
62
+ export { createHorizontalRulePattern };
63
+ //# sourceMappingURL=blocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blocks.js","sources":["../../../../../../../src/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;;;AAOG;AAMH;;;AAGG;AACG,SAAU,2BAA2B,CACzC,OAAyC,EAAA;AAEzC,IAAA,MAAM,IAAI,GAAG,IAAI,MAAM,CACrB,oBAAoB;AAClB,QAAA,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC;QACnC,IAAI;AACJ,QAAA,YAAY,CAAC,OAAO,CAAC,cAAc,CAAC;AACpC,QAAA,GAAG,CACN;IAED,OAAO;AACL,QAAA,IAAI,EAAE,iBAAiB;AACvB,QAAA,KAAK,EAAE;AACL,YAAA;AACE,gBAAA,KAAK,EAAE,CAAC;AACR,gBAAA,IAAI,EAAE,gBAAgB;AACvB,aAAA;AACD,YAAA;AACE,gBAAA,KAAK,EAAE,CAAC;AACR,gBAAA,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,CAAC,GAAc,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC;AAC9C,gBAAA,OAAO,EAAE,CAAC,GAAW,KAAK,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI;AACnD,aAAA;AACD,YAAA;AACE,gBAAA,KAAK,EAAE,CAAC;AACR,gBAAA,IAAI,EAAE,iBAAiB;AACxB,aAAA;AACF,SAAA;AACD,QAAA,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,KAAI;AAChC,YAAA,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,YAAA,KAAK,CAAC,IAAI,GAAG,IAAI;AACjB,YAAA,KAAK,CAAC,GAAG,GAAG,IAAI;AAChB,YAAA,KAAK,CAAC,OAAO,GAAG,CAAC;YACjB,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,OAAO;YAC9C,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC;YAC5D,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC;AACnD,YAAA,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;AACtB,YAAA,KAAK,CAAC,MAAM,GAAG,OAAO;YACtB,MAAM,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC,CAAC;QAClC,CAAC;KACF;AACH;;;;"}
@@ -0,0 +1,6 @@
1
+ import type { MarkdownItAttrsOptions, CurlyAttrsPattern } from "../types.js";
2
+ /**
3
+ * Pattern for fenced code blocks with attributes.
4
+ * Example: ```js {.highlight}
5
+ */
6
+ export declare function createFencedCodeBlockPattern(options: Required<MarkdownItAttrsOptions>): CurlyAttrsPattern;
@@ -0,0 +1,43 @@
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 { hasDelimiters, getAttrs, addAttrs, removeDelimiter } from '../core.js';
9
+
10
+ /*
11
+ * Copyright IBM Corp. 2025
12
+ *
13
+ * This source code is licensed under the Apache-2.0 license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ *
16
+ * @license
17
+ */
18
+ /**
19
+ * Pattern for fenced code blocks with attributes.
20
+ * Example: ```js {.highlight}
21
+ */
22
+ function createFencedCodeBlockPattern(options) {
23
+ return {
24
+ name: "fenced code blocks",
25
+ tests: [
26
+ {
27
+ shift: 0,
28
+ block: true,
29
+ info: hasDelimiters("end", options),
30
+ },
31
+ ],
32
+ transform: (tokens, tokenIndex) => {
33
+ const token = tokens[tokenIndex];
34
+ const attrStart = token.info.lastIndexOf(options.leftDelimiter);
35
+ const attrs = getAttrs(token.info, attrStart, options);
36
+ addAttrs(attrs, token);
37
+ token.info = removeDelimiter(token.info, options);
38
+ },
39
+ };
40
+ }
41
+
42
+ export { createFencedCodeBlockPattern };
43
+ //# sourceMappingURL=code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code.js","sources":["../../../../../../../src/components/markdown/src/plugins/markdownItAttrs/patterns/code.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;AAOG;AAKH;;;AAGG;AACG,SAAU,4BAA4B,CAC1C,OAAyC,EAAA;IAEzC,OAAO;AACL,QAAA,IAAI,EAAE,oBAAoB;AAC1B,QAAA,KAAK,EAAE;AACL,YAAA;AACE,gBAAA,KAAK,EAAE,CAAC;AACR,gBAAA,KAAK,EAAE,IAAI;AACX,gBAAA,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC;AACpC,aAAA;AACF,SAAA;AACD,QAAA,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,KAAI;AAChC,YAAA,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,YAAA,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC;AAC/D,YAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC;AACtD,YAAA,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;YACtB,KAAK,CAAC,IAAI,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC;QACnD,CAAC;KACF;AACH;;;;"}
@@ -0,0 +1,5 @@
1
+ import type { MarkdownItAttrsOptions, CurlyAttrsPattern } from "../types.js";
2
+ /**
3
+ * Creates an array of patterns used to detect and transform markdown tokens with attribute syntax.
4
+ */
5
+ export declare function createPatterns(options: Required<MarkdownItAttrsOptions>): CurlyAttrsPattern[];
@@ -0,0 +1,55 @@
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 { createFencedCodeBlockPattern } from './code.js';
9
+ import { createInlineNesting0Pattern, createInlineAttributesPattern, createSoftbreakCurlyPattern, createEndOfBlockPattern } from './inline.js';
10
+ import { createTablePattern, createTableTheadMetadataPattern, createTableTbodyCalculatePattern } from './tables.js';
11
+ import { createListSoftbreakPattern, createListDoubleSoftbreakPattern, createListItemEndPattern } from './lists.js';
12
+ import { createHorizontalRulePattern } from './blocks.js';
13
+
14
+ /*
15
+ * Copyright IBM Corp. 2025
16
+ *
17
+ * This source code is licensed under the Apache-2.0 license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ *
20
+ * @license
21
+ */
22
+ /**
23
+ * Creates an array of patterns used to detect and transform markdown tokens with attribute syntax.
24
+ */
25
+ function createPatterns(options) {
26
+ return [
27
+ // Fenced code blocks: ```js {.highlight}
28
+ createFencedCodeBlockPattern(options),
29
+ // Inline elements with nesting 0: ![alt](img.jpg){.class} or `code`{.class}
30
+ createInlineNesting0Pattern(options),
31
+ // Tables with attributes
32
+ createTablePattern(options),
33
+ // Table header metadata calculation (used for colspan/rowspan)
34
+ createTableTheadMetadataPattern(),
35
+ // Table body calculation for handling colspan/rowspan
36
+ createTableTbodyCalculatePattern(),
37
+ // Inline attributes on emphasized/strong text: **bold**{.class}
38
+ createInlineAttributesPattern(options),
39
+ // List items with attributes after softbreak
40
+ createListSoftbreakPattern(options),
41
+ // Lists with double softbreak before attributes
42
+ createListDoubleSoftbreakPattern(options),
43
+ // List items with attributes at the end
44
+ createListItemEndPattern(options),
45
+ // Softbreak followed by attributes at start of line
46
+ createSoftbreakCurlyPattern(options),
47
+ // Horizontal rules with attributes: --- {.class}
48
+ createHorizontalRulePattern(options),
49
+ // Attributes at the end of a block
50
+ createEndOfBlockPattern(options),
51
+ ];
52
+ }
53
+
54
+ export { createPatterns };
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../src/components/markdown/src/plugins/markdownItAttrs/patterns/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;AAOG;AAsBH;;AAEG;AACG,SAAU,cAAc,CAC5B,OAAyC,EAAA;IAEzC,OAAO;;QAEL,4BAA4B,CAAC,OAAO,CAAC;;QAGrC,2BAA2B,CAAC,OAAO,CAAC;;QAGpC,kBAAkB,CAAC,OAAO,CAAC;;AAG3B,QAAA,+BAA+B,EAAE;;AAGjC,QAAA,gCAAgC,EAAE;;QAGlC,6BAA6B,CAAC,OAAO,CAAC;;QAGtC,0BAA0B,CAAC,OAAO,CAAC;;QAGnC,gCAAgC,CAAC,OAAO,CAAC;;QAGzC,wBAAwB,CAAC,OAAO,CAAC;;QAGjC,2BAA2B,CAAC,OAAO,CAAC;;QAGpC,2BAA2B,CAAC,OAAO,CAAC;;QAGpC,uBAAuB,CAAC,OAAO,CAAC;KACjC;AACH;;;;"}
@@ -0,0 +1,19 @@
1
+ import type { MarkdownItAttrsOptions, CurlyAttrsPattern } from "../types.js";
2
+ /**
3
+ * Pattern for inline elements with nesting level 0 (images, inline code).
4
+ * Example: ![alt](img.jpg){.class} or `code`{.class}
5
+ */
6
+ export declare function createInlineNesting0Pattern(options: Required<MarkdownItAttrsOptions>): CurlyAttrsPattern;
7
+ /**
8
+ * Pattern for inline attributes on emphasized/strong text.
9
+ * Example: **bold**{.class}
10
+ */
11
+ export declare function createInlineAttributesPattern(options: Required<MarkdownItAttrsOptions>): CurlyAttrsPattern;
12
+ /**
13
+ * Pattern for softbreak followed by attributes at start of line.
14
+ */
15
+ export declare function createSoftbreakCurlyPattern(options: Required<MarkdownItAttrsOptions>): CurlyAttrsPattern;
16
+ /**
17
+ * Pattern for attributes at the end of a block.
18
+ */
19
+ export declare function createEndOfBlockPattern(options: Required<MarkdownItAttrsOptions>): CurlyAttrsPattern;