@aceshooting/lyra-ui 7.3.0 → 7.4.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 (363) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/custom-elements.json +1703 -379
  3. package/dist/components/agent-tools/activity-feed/activity-feed.class.d.ts.map +1 -1
  4. package/dist/components/agent-tools/activity-feed/activity-feed.class.js +1 -0
  5. package/dist/components/agent-tools/activity-feed/activity-feed.class.js.map +1 -1
  6. package/dist/components/agent-tools/approval-queue/approval-queue.class.d.ts.map +1 -1
  7. package/dist/components/agent-tools/approval-queue/approval-queue.class.js +1 -0
  8. package/dist/components/agent-tools/approval-queue/approval-queue.class.js.map +1 -1
  9. package/dist/components/agent-tools/browser-frame/browser-frame.styles.d.ts.map +1 -1
  10. package/dist/components/agent-tools/browser-frame/browser-frame.styles.js +3 -0
  11. package/dist/components/agent-tools/browser-frame/browser-frame.styles.js.map +1 -1
  12. package/dist/components/agent-tools/commit-card/commit-card.class.d.ts +3 -0
  13. package/dist/components/agent-tools/commit-card/commit-card.class.d.ts.map +1 -1
  14. package/dist/components/agent-tools/commit-card/commit-card.class.js +21 -1
  15. package/dist/components/agent-tools/commit-card/commit-card.class.js.map +1 -1
  16. package/dist/components/agent-tools/compare-panel/compare-panel.class.d.ts.map +1 -1
  17. package/dist/components/agent-tools/compare-panel/compare-panel.class.js +7 -1
  18. package/dist/components/agent-tools/compare-panel/compare-panel.class.js.map +1 -1
  19. package/dist/components/agent-tools/confirm-bar/confirm-bar.class.d.ts +4 -0
  20. package/dist/components/agent-tools/confirm-bar/confirm-bar.class.d.ts.map +1 -1
  21. package/dist/components/agent-tools/confirm-bar/confirm-bar.class.js +4 -0
  22. package/dist/components/agent-tools/confirm-bar/confirm-bar.class.js.map +1 -1
  23. package/dist/components/agent-tools/confirm-bar/confirm-bar.styles.js +2 -2
  24. package/dist/components/agent-tools/prompt-studio/prompt-studio.class.d.ts +2 -0
  25. package/dist/components/agent-tools/prompt-studio/prompt-studio.class.d.ts.map +1 -1
  26. package/dist/components/agent-tools/prompt-studio/prompt-studio.class.js +24 -9
  27. package/dist/components/agent-tools/prompt-studio/prompt-studio.class.js.map +1 -1
  28. package/dist/components/agent-tools/prompt-studio/prompt-studio.styles.d.ts.map +1 -1
  29. package/dist/components/agent-tools/prompt-studio/prompt-studio.styles.js +23 -2
  30. package/dist/components/agent-tools/prompt-studio/prompt-studio.styles.js.map +1 -1
  31. package/dist/components/agent-tools/result-card/result-card.class.d.ts +4 -0
  32. package/dist/components/agent-tools/result-card/result-card.class.d.ts.map +1 -1
  33. package/dist/components/agent-tools/result-card/result-card.class.js +4 -0
  34. package/dist/components/agent-tools/result-card/result-card.class.js.map +1 -1
  35. package/dist/components/agent-tools/result-card/result-card.styles.d.ts.map +1 -1
  36. package/dist/components/agent-tools/result-card/result-card.styles.js +2 -0
  37. package/dist/components/agent-tools/result-card/result-card.styles.js.map +1 -1
  38. package/dist/components/agent-tools/schema-viewer/schema-viewer.class.d.ts +2 -0
  39. package/dist/components/agent-tools/schema-viewer/schema-viewer.class.d.ts.map +1 -1
  40. package/dist/components/agent-tools/schema-viewer/schema-viewer.class.js +2 -0
  41. package/dist/components/agent-tools/schema-viewer/schema-viewer.class.js.map +1 -1
  42. package/dist/components/agent-tools/schema-viewer/schema-viewer.styles.d.ts.map +1 -1
  43. package/dist/components/agent-tools/schema-viewer/schema-viewer.styles.js +4 -0
  44. package/dist/components/agent-tools/schema-viewer/schema-viewer.styles.js.map +1 -1
  45. package/dist/components/agent-tools/subagent-panel/subagent-panel.class.d.ts +6 -1
  46. package/dist/components/agent-tools/subagent-panel/subagent-panel.class.d.ts.map +1 -1
  47. package/dist/components/agent-tools/subagent-panel/subagent-panel.class.js +61 -3
  48. package/dist/components/agent-tools/subagent-panel/subagent-panel.class.js.map +1 -1
  49. package/dist/components/agent-tools/task-list/task-list.class.d.ts +2 -0
  50. package/dist/components/agent-tools/task-list/task-list.class.d.ts.map +1 -1
  51. package/dist/components/agent-tools/task-list/task-list.class.js +2 -0
  52. package/dist/components/agent-tools/task-list/task-list.class.js.map +1 -1
  53. package/dist/components/agent-tools/task-list/task-list.styles.d.ts.map +1 -1
  54. package/dist/components/agent-tools/task-list/task-list.styles.js +1 -0
  55. package/dist/components/agent-tools/task-list/task-list.styles.js.map +1 -1
  56. package/dist/components/agent-tools/test-results/test-results.class.d.ts.map +1 -1
  57. package/dist/components/agent-tools/test-results/test-results.class.js +15 -10
  58. package/dist/components/agent-tools/test-results/test-results.class.js.map +1 -1
  59. package/dist/components/agent-tools/tool-param-form/tool-param-form.class.d.ts +3 -0
  60. package/dist/components/agent-tools/tool-param-form/tool-param-form.class.d.ts.map +1 -1
  61. package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js +5 -0
  62. package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js.map +1 -1
  63. package/dist/components/charts/chart/box-plot.class.d.ts.map +1 -1
  64. package/dist/components/charts/chart/box-plot.class.js +31 -0
  65. package/dist/components/charts/chart/box-plot.class.js.map +1 -1
  66. package/dist/components/charts/chart/chart-loader.d.ts +2 -2
  67. package/dist/components/charts/chart/chart-loader.d.ts.map +1 -1
  68. package/dist/components/charts/chart/chart-loader.js +7 -1
  69. package/dist/components/charts/chart/chart-loader.js.map +1 -1
  70. package/dist/components/charts/chart/chart.class.d.ts +5 -1
  71. package/dist/components/charts/chart/chart.class.d.ts.map +1 -1
  72. package/dist/components/charts/chart/chart.class.js +17 -2
  73. package/dist/components/charts/chart/chart.class.js.map +1 -1
  74. package/dist/components/charts/chart/chart.styles.d.ts.map +1 -1
  75. package/dist/components/charts/chart/chart.styles.js +5 -1
  76. package/dist/components/charts/chart/chart.styles.js.map +1 -1
  77. package/dist/components/charts/chart/lite-chart.class.d.ts.map +1 -1
  78. package/dist/components/charts/chart/lite-chart.class.js +2 -0
  79. package/dist/components/charts/chart/lite-chart.class.js.map +1 -1
  80. package/dist/components/conversation/code-block/code-block-core.class.d.ts +7 -8
  81. package/dist/components/conversation/code-block/code-block-core.class.d.ts.map +1 -1
  82. package/dist/components/conversation/code-block/code-block-core.class.js +75 -227
  83. package/dist/components/conversation/code-block/code-block-core.class.js.map +1 -1
  84. package/dist/components/conversation/code-block/code-block-shared.d.ts +173 -7
  85. package/dist/components/conversation/code-block/code-block-shared.d.ts.map +1 -1
  86. package/dist/components/conversation/code-block/code-block-shared.js +312 -6
  87. package/dist/components/conversation/code-block/code-block-shared.js.map +1 -1
  88. package/dist/components/conversation/code-block/code-block.class.d.ts +6 -7
  89. package/dist/components/conversation/code-block/code-block.class.d.ts.map +1 -1
  90. package/dist/components/conversation/code-block/code-block.class.js +70 -231
  91. package/dist/components/conversation/code-block/code-block.class.js.map +1 -1
  92. package/dist/components/conversation/markdown/markdown-core.class.d.ts +9 -22
  93. package/dist/components/conversation/markdown/markdown-core.class.d.ts.map +1 -1
  94. package/dist/components/conversation/markdown/markdown-core.class.js +87 -314
  95. package/dist/components/conversation/markdown/markdown-core.class.js.map +1 -1
  96. package/dist/components/conversation/markdown/markdown-shared.d.ts +213 -9
  97. package/dist/components/conversation/markdown/markdown-shared.d.ts.map +1 -1
  98. package/dist/components/conversation/markdown/markdown-shared.js +362 -8
  99. package/dist/components/conversation/markdown/markdown-shared.js.map +1 -1
  100. package/dist/components/conversation/markdown/markdown.class.d.ts +9 -22
  101. package/dist/components/conversation/markdown/markdown.class.d.ts.map +1 -1
  102. package/dist/components/conversation/markdown/markdown.class.js +81 -311
  103. package/dist/components/conversation/markdown/markdown.class.js.map +1 -1
  104. package/dist/components/conversation/message-feedback/message-feedback.class.d.ts.map +1 -1
  105. package/dist/components/conversation/message-feedback/message-feedback.class.js +4 -1
  106. package/dist/components/conversation/message-feedback/message-feedback.class.js.map +1 -1
  107. package/dist/components/conversation/prompt-input/prompt-input.styles.d.ts.map +1 -1
  108. package/dist/components/conversation/prompt-input/prompt-input.styles.js +9 -2
  109. package/dist/components/conversation/prompt-input/prompt-input.styles.js.map +1 -1
  110. package/dist/components/conversation/selection-toolbar/selection-toolbar.class.d.ts.map +1 -1
  111. package/dist/components/conversation/selection-toolbar/selection-toolbar.class.js +8 -1
  112. package/dist/components/conversation/selection-toolbar/selection-toolbar.class.js.map +1 -1
  113. package/dist/components/conversation/voice-picker/voice-picker.class.d.ts.map +1 -1
  114. package/dist/components/conversation/voice-picker/voice-picker.class.js +5 -1
  115. package/dist/components/conversation/voice-picker/voice-picker.class.js.map +1 -1
  116. package/dist/components/data/document-library/document-library.class.d.ts.map +1 -1
  117. package/dist/components/data/document-library/document-library.class.js +4 -1
  118. package/dist/components/data/document-library/document-library.class.js.map +1 -1
  119. package/dist/components/data/env-list/env-list.styles.d.ts.map +1 -1
  120. package/dist/components/data/env-list/env-list.styles.js +5 -0
  121. package/dist/components/data/env-list/env-list.styles.js.map +1 -1
  122. package/dist/components/data/flow-canvas/flow-canvas.class.js +1 -1
  123. package/dist/components/data/flow-canvas/flow-canvas.class.js.map +1 -1
  124. package/dist/components/data/flow-minimap/flow-minimap.styles.d.ts.map +1 -1
  125. package/dist/components/data/flow-minimap/flow-minimap.styles.js +6 -0
  126. package/dist/components/data/flow-minimap/flow-minimap.styles.js.map +1 -1
  127. package/dist/components/data/graph-query-builder/graph-query-builder.class.d.ts.map +1 -1
  128. package/dist/components/data/graph-query-builder/graph-query-builder.class.js +10 -1
  129. package/dist/components/data/graph-query-builder/graph-query-builder.class.js.map +1 -1
  130. package/dist/components/data/heatmap/heatmap.class.d.ts.map +1 -1
  131. package/dist/components/data/heatmap/heatmap.class.js +17 -2
  132. package/dist/components/data/heatmap/heatmap.class.js.map +1 -1
  133. package/dist/components/data/pagination/pagination.class.d.ts +2 -0
  134. package/dist/components/data/pagination/pagination.class.d.ts.map +1 -1
  135. package/dist/components/data/pagination/pagination.class.js +2 -0
  136. package/dist/components/data/pagination/pagination.class.js.map +1 -1
  137. package/dist/components/data/pagination/pagination.styles.d.ts.map +1 -1
  138. package/dist/components/data/pagination/pagination.styles.js +7 -2
  139. package/dist/components/data/pagination/pagination.styles.js.map +1 -1
  140. package/dist/components/data/table/table.class.d.ts +7 -2
  141. package/dist/components/data/table/table.class.d.ts.map +1 -1
  142. package/dist/components/data/table/table.class.js +40 -6
  143. package/dist/components/data/table/table.class.js.map +1 -1
  144. package/dist/components/data/tree/tree-node.class.d.ts +2 -0
  145. package/dist/components/data/tree/tree-node.class.d.ts.map +1 -1
  146. package/dist/components/data/tree/tree-node.class.js +2 -0
  147. package/dist/components/data/tree/tree-node.class.js.map +1 -1
  148. package/dist/components/forms/color-picker/color-picker.class.d.ts.map +1 -1
  149. package/dist/components/forms/color-picker/color-picker.class.js +9 -0
  150. package/dist/components/forms/color-picker/color-picker.class.js.map +1 -1
  151. package/dist/components/forms/date-picker/date-picker.class.d.ts +2 -0
  152. package/dist/components/forms/date-picker/date-picker.class.d.ts.map +1 -1
  153. package/dist/components/forms/date-picker/date-picker.class.js +2 -0
  154. package/dist/components/forms/date-picker/date-picker.class.js.map +1 -1
  155. package/dist/components/forms/date-picker/date-picker.styles.d.ts.map +1 -1
  156. package/dist/components/forms/date-picker/date-picker.styles.js +8 -3
  157. package/dist/components/forms/date-picker/date-picker.styles.js.map +1 -1
  158. package/dist/components/forms/emoji-picker/emoji-data-loader.js +28 -2
  159. package/dist/components/forms/emoji-picker/emoji-data-loader.js.map +1 -1
  160. package/dist/components/forms/emoji-picker/emoji-picker.class.d.ts +4 -0
  161. package/dist/components/forms/emoji-picker/emoji-picker.class.d.ts.map +1 -1
  162. package/dist/components/forms/emoji-picker/emoji-picker.class.js +8 -2
  163. package/dist/components/forms/emoji-picker/emoji-picker.class.js.map +1 -1
  164. package/dist/components/forms/emoji-picker/emoji-types.d.ts +9 -0
  165. package/dist/components/forms/emoji-picker/emoji-types.d.ts.map +1 -1
  166. package/dist/components/forms/input/input.styles.d.ts.map +1 -1
  167. package/dist/components/forms/input/input.styles.js +17 -4
  168. package/dist/components/forms/input/input.styles.js.map +1 -1
  169. package/dist/components/forms/locale-picker/locale-picker.class.d.ts +1 -1
  170. package/dist/components/forms/locale-picker/locale-picker.class.d.ts.map +1 -1
  171. package/dist/components/forms/locale-picker/locale-picker.class.js +3 -1
  172. package/dist/components/forms/locale-picker/locale-picker.class.js.map +1 -1
  173. package/dist/components/forms/radio/radio.class.d.ts +5 -0
  174. package/dist/components/forms/radio/radio.class.d.ts.map +1 -1
  175. package/dist/components/forms/radio/radio.class.js +5 -0
  176. package/dist/components/forms/radio/radio.class.js.map +1 -1
  177. package/dist/components/forms/radio/radio.styles.d.ts.map +1 -1
  178. package/dist/components/forms/radio/radio.styles.js +5 -2
  179. package/dist/components/forms/radio/radio.styles.js.map +1 -1
  180. package/dist/components/forms/select/select.class.d.ts +9 -1
  181. package/dist/components/forms/select/select.class.d.ts.map +1 -1
  182. package/dist/components/forms/select/select.class.js +9 -1
  183. package/dist/components/forms/select/select.class.js.map +1 -1
  184. package/dist/components/forms/slider/slider.class.d.ts +8 -0
  185. package/dist/components/forms/slider/slider.class.d.ts.map +1 -1
  186. package/dist/components/forms/slider/slider.class.js +14 -0
  187. package/dist/components/forms/slider/slider.class.js.map +1 -1
  188. package/dist/components/forms/swatch-picker/swatch-picker.class.d.ts +12 -0
  189. package/dist/components/forms/swatch-picker/swatch-picker.class.d.ts.map +1 -1
  190. package/dist/components/forms/swatch-picker/swatch-picker.class.js +22 -0
  191. package/dist/components/forms/swatch-picker/swatch-picker.class.js.map +1 -1
  192. package/dist/components/forms/time-range/time-range.class.d.ts +9 -0
  193. package/dist/components/forms/time-range/time-range.class.d.ts.map +1 -1
  194. package/dist/components/forms/time-range/time-range.class.js +15 -0
  195. package/dist/components/forms/time-range/time-range.class.js.map +1 -1
  196. package/dist/components/layout/button-group/button-group.styles.d.ts.map +1 -1
  197. package/dist/components/layout/button-group/button-group.styles.js +10 -1
  198. package/dist/components/layout/button-group/button-group.styles.js.map +1 -1
  199. package/dist/components/layout/drilldown-panel/drilldown-panel.class.d.ts.map +1 -1
  200. package/dist/components/layout/drilldown-panel/drilldown-panel.class.js +5 -1
  201. package/dist/components/layout/drilldown-panel/drilldown-panel.class.js.map +1 -1
  202. package/dist/components/layout/filter-bar/filter-bar.class.d.ts.map +1 -1
  203. package/dist/components/layout/filter-bar/filter-bar.class.js +4 -1
  204. package/dist/components/layout/filter-bar/filter-bar.class.js.map +1 -1
  205. package/dist/components/layout/split/split.class.d.ts +8 -0
  206. package/dist/components/layout/split/split.class.d.ts.map +1 -1
  207. package/dist/components/layout/split/split.class.js +8 -0
  208. package/dist/components/layout/split/split.class.js.map +1 -1
  209. package/dist/components/layout/split/split.styles.d.ts.map +1 -1
  210. package/dist/components/layout/split/split.styles.js +26 -10
  211. package/dist/components/layout/split/split.styles.js.map +1 -1
  212. package/dist/components/layout/widget/widget.class.d.ts +4 -0
  213. package/dist/components/layout/widget/widget.class.d.ts.map +1 -1
  214. package/dist/components/layout/widget/widget.class.js +4 -0
  215. package/dist/components/layout/widget/widget.class.js.map +1 -1
  216. package/dist/components/layout/widget/widget.styles.d.ts.map +1 -1
  217. package/dist/components/layout/widget/widget.styles.js +9 -3
  218. package/dist/components/layout/widget/widget.styles.js.map +1 -1
  219. package/dist/components/media/flag/flag.class.d.ts +1 -1
  220. package/dist/components/media/flag/flag.class.d.ts.map +1 -1
  221. package/dist/components/media/flag/flag.class.js +2 -1
  222. package/dist/components/media/flag/flag.class.js.map +1 -1
  223. package/dist/components/media/image-viewer/image-viewer.styles.d.ts.map +1 -1
  224. package/dist/components/media/image-viewer/image-viewer.styles.js +1 -0
  225. package/dist/components/media/image-viewer/image-viewer.styles.js.map +1 -1
  226. package/dist/components/overlays/chip/chip-group.class.d.ts +4 -0
  227. package/dist/components/overlays/chip/chip-group.class.d.ts.map +1 -1
  228. package/dist/components/overlays/chip/chip-group.class.js +4 -0
  229. package/dist/components/overlays/chip/chip-group.class.js.map +1 -1
  230. package/dist/components/overlays/chip/chip-group.styles.d.ts.map +1 -1
  231. package/dist/components/overlays/chip/chip-group.styles.js +7 -2
  232. package/dist/components/overlays/chip/chip-group.styles.js.map +1 -1
  233. package/dist/components/overlays/rating/rating.styles.d.ts.map +1 -1
  234. package/dist/components/overlays/rating/rating.styles.js +11 -4
  235. package/dist/components/overlays/rating/rating.styles.js.map +1 -1
  236. package/dist/components/retrieval/claim-evidence/claim-evidence.class.d.ts.map +1 -1
  237. package/dist/components/retrieval/claim-evidence/claim-evidence.class.js +4 -1
  238. package/dist/components/retrieval/claim-evidence/claim-evidence.class.js.map +1 -1
  239. package/dist/components/retrieval/graph/graph-canvas.d.ts +25 -0
  240. package/dist/components/retrieval/graph/graph-canvas.d.ts.map +1 -1
  241. package/dist/components/retrieval/graph/graph-canvas.js +30 -1
  242. package/dist/components/retrieval/graph/graph-canvas.js.map +1 -1
  243. package/dist/components/retrieval/graph/graph.class.d.ts +2 -1
  244. package/dist/components/retrieval/graph/graph.class.d.ts.map +1 -1
  245. package/dist/components/retrieval/graph/graph.class.js +12 -1
  246. package/dist/components/retrieval/graph/graph.class.js.map +1 -1
  247. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.class.d.ts +5 -0
  248. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.class.d.ts.map +1 -1
  249. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.class.js +5 -0
  250. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.class.js.map +1 -1
  251. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.styles.d.ts.map +1 -1
  252. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.styles.js +7 -3
  253. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.styles.js.map +1 -1
  254. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts.map +1 -1
  255. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +10 -1
  256. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js.map +1 -1
  257. package/dist/components/utility/diff-view/diff-view.styles.d.ts.map +1 -1
  258. package/dist/components/utility/diff-view/diff-view.styles.js +11 -0
  259. package/dist/components/utility/diff-view/diff-view.styles.js.map +1 -1
  260. package/dist/components/viewers/archive-viewer/archive-viewer-register.js +16 -3
  261. package/dist/components/viewers/archive-viewer/archive-viewer-register.js.map +1 -1
  262. package/dist/components/viewers/document-viewer/document-viewer.class.d.ts.map +1 -1
  263. package/dist/components/viewers/document-viewer/document-viewer.class.js +1 -0
  264. package/dist/components/viewers/document-viewer/document-viewer.class.js.map +1 -1
  265. package/dist/components/viewers/docx-viewer/docx-viewer.js +6 -1
  266. package/dist/components/viewers/docx-viewer/docx-viewer.js.map +1 -1
  267. package/dist/components/viewers/ebook-viewer/ebook-viewer.class.d.ts +10 -4
  268. package/dist/components/viewers/ebook-viewer/ebook-viewer.class.d.ts.map +1 -1
  269. package/dist/components/viewers/ebook-viewer/ebook-viewer.class.js +31 -6
  270. package/dist/components/viewers/ebook-viewer/ebook-viewer.class.js.map +1 -1
  271. package/dist/components/viewers/html-viewer/html-viewer.js +7 -0
  272. package/dist/components/viewers/html-viewer/html-viewer.js.map +1 -1
  273. package/dist/components/viewers/notebook-viewer/notebook-viewer.class.d.ts +3 -0
  274. package/dist/components/viewers/notebook-viewer/notebook-viewer.class.d.ts.map +1 -1
  275. package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +7 -1
  276. package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js.map +1 -1
  277. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts +4 -0
  278. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts.map +1 -1
  279. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +8 -4
  280. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js.map +1 -1
  281. package/dist/components/viewers/pptx-viewer/pptx-viewer.js +11 -1
  282. package/dist/components/viewers/pptx-viewer/pptx-viewer.js.map +1 -1
  283. package/dist/components/viewers/svg-viewer/svg-viewer.class.d.ts +29 -17
  284. package/dist/components/viewers/svg-viewer/svg-viewer.class.d.ts.map +1 -1
  285. package/dist/components/viewers/svg-viewer/svg-viewer.class.js +27 -22
  286. package/dist/components/viewers/svg-viewer/svg-viewer.class.js.map +1 -1
  287. package/dist/components/viewers/svg-viewer/svg-viewer.d.ts.map +1 -1
  288. package/dist/components/viewers/svg-viewer/svg-viewer.js +7 -6
  289. package/dist/components/viewers/svg-viewer/svg-viewer.js.map +1 -1
  290. package/dist/internal/form-associated.d.ts +21 -0
  291. package/dist/internal/form-associated.d.ts.map +1 -1
  292. package/dist/internal/form-associated.js +25 -8
  293. package/dist/internal/form-associated.js.map +1 -1
  294. package/dist/internal/localization.d.ts +1 -1
  295. package/dist/internal/localization.d.ts.map +1 -1
  296. package/dist/internal/localization.js +17 -0
  297. package/dist/internal/localization.js.map +1 -1
  298. package/llms/components/lr-agent-run.md +3 -2
  299. package/llms/components/lr-approval-queue.md +6 -1
  300. package/llms/components/lr-archive-viewer.md +6 -2
  301. package/llms/components/lr-artifact-panel.md +7 -3
  302. package/llms/components/lr-attachment-chip.md +8 -6
  303. package/llms/components/lr-avatar.md +6 -4
  304. package/llms/components/lr-bar-chart.md +4 -2
  305. package/llms/components/lr-bubble-chart.md +4 -2
  306. package/llms/components/lr-button-group.md +10 -0
  307. package/llms/components/lr-button.md +11 -6
  308. package/llms/components/lr-chart.md +8 -2
  309. package/llms/components/lr-chip-group.md +9 -2
  310. package/llms/components/lr-chip.md +8 -1
  311. package/llms/components/lr-commit-card.md +11 -3
  312. package/llms/components/lr-confirm-bar.md +9 -1
  313. package/llms/components/lr-date-input.md +4 -0
  314. package/llms/components/lr-date-picker.md +5 -1
  315. package/llms/components/lr-document-viewer.md +1 -1
  316. package/llms/components/lr-doughnut-chart.md +4 -2
  317. package/llms/components/lr-emoji-picker.md +16 -4
  318. package/llms/components/lr-export-button.md +2 -1
  319. package/llms/components/lr-flag.md +9 -5
  320. package/llms/components/lr-graph-query-builder.md +6 -5
  321. package/llms/components/lr-heatmap.md +12 -7
  322. package/llms/components/lr-histogram.md +3 -2
  323. package/llms/components/lr-html-viewer.md +4 -1
  324. package/llms/components/lr-json-viewer.md +2 -1
  325. package/llms/components/lr-knowledge-base-admin.md +10 -1
  326. package/llms/components/lr-known-date.md +8 -4
  327. package/llms/components/lr-line-chart.md +4 -2
  328. package/llms/components/lr-locale-picker.md +1 -1
  329. package/llms/components/lr-model-select.md +3 -0
  330. package/llms/components/lr-notebook-viewer.md +4 -2
  331. package/llms/components/lr-pagination.md +6 -3
  332. package/llms/components/lr-pdf-viewer.md +5 -2
  333. package/llms/components/lr-pie-chart.md +4 -2
  334. package/llms/components/lr-polar-area-chart.md +4 -2
  335. package/llms/components/lr-pptx-viewer.md +3 -1
  336. package/llms/components/lr-push-to-talk.md +4 -0
  337. package/llms/components/lr-radar-chart.md +4 -2
  338. package/llms/components/lr-radio.md +7 -1
  339. package/llms/components/lr-result-card.md +9 -3
  340. package/llms/components/lr-result-field.md +8 -2
  341. package/llms/components/lr-retrieval-results.md +12 -7
  342. package/llms/components/lr-scatter-chart.md +4 -2
  343. package/llms/components/lr-schema-viewer.md +13 -1
  344. package/llms/components/lr-sequence-strip.md +21 -16
  345. package/llms/components/lr-slider.md +4 -0
  346. package/llms/components/lr-split.md +9 -1
  347. package/llms/components/lr-stepper.md +5 -3
  348. package/llms/components/lr-svg-viewer.md +24 -8
  349. package/llms/components/lr-table.md +21 -3
  350. package/llms/components/lr-task-list.md +7 -3
  351. package/llms/components/lr-terminal.md +10 -4
  352. package/llms/components/lr-time-range.md +6 -0
  353. package/llms/components/lr-tool-call-chip.md +4 -3
  354. package/llms/components/lr-tool-param-form.md +7 -2
  355. package/llms/components/lr-tool-result-dialog.md +2 -1
  356. package/llms/components/lr-tree-node.md +1 -1
  357. package/llms/components/lr-widget.md +6 -1
  358. package/llms/shared.md +1 -1
  359. package/llms-full.txt +353 -117
  360. package/package.json +7 -4
  361. package/vscode-css-data.json +141 -1
  362. package/vscode-html-data.json +29 -36
  363. package/web-types.json +111 -35
@@ -1,13 +1,25 @@
1
1
  /**
2
- * Localized label helpers, line-highlighting parsing, and the shared shiki
3
- * transformer for `<lr-code-block>` and `<lr-code-block-core>`. Both
4
- * components render an otherwise-identical header/body, and pulling their
5
- * common `this.localize()` call sites and line-addressing logic out into
6
- * one place keeps their behavior from silently drifting apart the way it
7
- * previously did between the two.
2
+ * Everything `<lr-code-block>` and `<lr-code-block-core>` render and compute identically:
3
+ * localized label helpers, line addressing (`highlight-lines`/`highlights` parsing, line counting,
4
+ * `line-range` anchor scrolling), the gutter's roving-tabindex keyboard contract, selection
5
+ * anchoring, clipboard writes, the shiki transformer plus the `codeToHtml()` call around it, and
6
+ * the header/body templates themselves.
7
+ *
8
+ * The two components differ in exactly one axis -- *which* shiki loader they reach for (the full
9
+ * ~200-language dynamic-import table vs. `shiki/core` seeded from a pre-supplied `languages` map),
10
+ * which is why `connectedCallback()` and `syncHighlight()` stay on each class. Everything else was
11
+ * previously duplicated verbatim across both class files and had already drifted (the lean variant
12
+ * had silently dropped both of its `super.willUpdate()`/`super.updated()` chain-ups); routing both
13
+ * through this module is what keeps a fix landing in one place from here on.
14
+ *
15
+ * Nothing here may `import` a *value* from `code-loader.js`'s full-table half
16
+ * (`loadShikiHighlighter`/`loadShikiLanguage`): `<lr-code-block-core>`'s build-leanness claim rests
17
+ * on its own module graph never reaching that call, and this module is in that graph.
8
18
  */
9
- import { type TemplateResult } from 'lit';
19
+ import { type TemplateResult, type PropertyValues } from 'lit';
10
20
  import type { ShikiTransformer } from 'shiki';
21
+ import { type ShikiHighlighterCore, type ShikiLanguageInput } from './code-loader.js';
22
+ import type { LyraAnchor, LyraHighlight } from '../../viewers/document-viewer/anchors.js';
11
23
  /** Matches `LyraElement.localize()`'s signature so either component's bound
12
24
  * method can be passed straight through. */
13
25
  export type LyraLocalizeFn = (key: string, fallback?: string, values?: Record<string, string | number>) => string;
@@ -26,6 +38,103 @@ export declare function codeBlockBodyLabel(localize: LyraLocalizeFn, filename: s
26
38
  * than throwing or discarding the otherwise-valid segments around it.
27
39
  */
28
40
  export declare function addBoundedLineRange(lines: Set<number>, start: number, end: number, maxLine: number): void;
41
+ /** How long the copy button's confirmation state lasts before reverting. */
42
+ export declare const CODE_BLOCK_COPY_CONFIRM_MS = 1500;
43
+ /** One-based line count of `code`, the upper bound every line-addressing helper below clamps to.
44
+ * A trailing newline still yields the (empty) line after it, matching the rendered line count. */
45
+ export declare function codeBlockLineCount(code: string): number;
46
+ /** Keeps the roving-tabindex gutter's focused line inside `[1, lineCount]` after a `code` change
47
+ * shrinks the document out from under it. */
48
+ export declare function clampCodeBlockFocusedLine(focusedLine: number, lineCount: number): number;
49
+ /** The merged set of one-based line numbers to emphasize: the `highlight-lines` spec plus the
50
+ * `line-range` slice of `highlights`. Shared by both the shiki transformer options and the
51
+ * plain-text fallback path so their emphasis is always identical. */
52
+ export declare function codeBlockLineHighlightSet(highlightLines: string, highlights: readonly LyraHighlight[], maxLine: number): Set<number>;
53
+ /** The line numbers covered by the `highlights` entry matching `activeHighlightId`, if any. */
54
+ export declare function codeBlockActiveHighlightLineSet(highlights: readonly LyraHighlight[], activeHighlightId: string | null, maxLine: number): Set<number>;
55
+ /** The `languages` entry for the *current* `language`, if any -- looked up under both the
56
+ * shiki-normalized id and the raw property value, so `willUpdate()`/`updated()`/`render()`/
57
+ * `syncHighlight()` on either component all agree on whether the fine-grained path applies. */
58
+ export declare function codeBlockPreSuppliedGrammar(languages: Record<string, ShikiLanguageInput> | undefined, language: string): ShikiLanguageInput | undefined;
59
+ /** The LitElement surface `scrollCodeBlockToAnchor()` reads -- everything it touches is public on
60
+ * both components, so neither needs to widen a private field to route through this. */
61
+ export interface CodeBlockAnchorHost {
62
+ readonly code: string;
63
+ readonly highlights: readonly LyraHighlight[];
64
+ readonly renderRoot: HTMLElement | DocumentFragment;
65
+ readonly updateComplete: Promise<boolean>;
66
+ }
67
+ /** Resolves a `line-range` anchor (or a `highlights` id string resolving to one) by scrolling its
68
+ * start line into view within `[part="body"]`. Resolves `false` when the anchor isn't a
69
+ * `line-range`, the id isn't found, or the start line is out of bounds. */
70
+ export declare function scrollCodeBlockToAnchor(host: CodeBlockAnchorHost, target: LyraAnchor | string): Promise<boolean>;
71
+ /** The one-based gutter line an event originated in, or `null` when it didn't come from a line
72
+ * button at all. */
73
+ export declare function codeBlockEventLine(e: Event): number | null;
74
+ /** What a keystroke on a gutter line button means. `null` covers both an unhandled key and a
75
+ * movement key that would land on the line already focused -- neither of which may
76
+ * `preventDefault()`, so the caller must not treat them differently. */
77
+ export type CodeBlockLineKeyAction = {
78
+ kind: 'activate';
79
+ } | {
80
+ kind: 'move';
81
+ line: number;
82
+ } | null;
83
+ /** The roving-tabindex keyboard contract for the (`line-numbers`-gated) gutter. */
84
+ export declare function codeBlockLineKeyAction(key: string, line: number, total: number): CodeBlockLineKeyAction;
85
+ /** An `lr-text-select` payload for a selection ending inside `[part="body"]`. */
86
+ export interface CodeBlockSelection {
87
+ text: string;
88
+ anchor: LyraAnchor;
89
+ rects: DOMRect[];
90
+ }
91
+ /** Anchors the current selection to the `line-range` it spans. `null` whenever there's nothing to
92
+ * report: no selection, a collapsed/whitespace-only one, or endpoints outside any `[data-line]`. */
93
+ export declare function codeBlockSelectionAnchor(shadowRoot: ShadowRoot | null): CodeBlockSelection | null;
94
+ /** Best-effort clipboard write. `navigator.clipboard` is absent in insecure contexts / older
95
+ * browsers, and some engines throw synchronously rather than rejecting -- either way the caller
96
+ * still emits `lr-copy` regardless of whether the OS clipboard was actually reached, the same
97
+ * convention `<lr-json-viewer>`'s own copy button follows. */
98
+ export declare function writeCodeBlockClipboard(text: string): void;
99
+ /** Every property whose change invalidates the cached `highlightedHtml`. `code`/`language`/
100
+ * `languages`/`languagesOnly` change *what* is tokenized; `highlightLines`/`highlights`/
101
+ * `activeHighlightId`/`lineNumbers`/`interactiveLines` all feed `codeBlockLineTransformer()`'s
102
+ * options, so a change to any of them needs a re-tokenize to stay in sync even when the code
103
+ * itself is untouched. `languagesOnly` is listed for `<lr-code-block>`; `<lr-code-block-core>` has
104
+ * no such property, so it simply never appears in that component's changed map. */
105
+ export declare function codeBlockNeedsHighlightResync(changed: PropertyValues): boolean;
106
+ /**
107
+ * Whether the `<lr-skeleton>` placeholder stands in for the code this render. Both components gate
108
+ * it on "a highlighter this instance is actually waiting for hasn't settled yet, and there's a
109
+ * `language` worth highlighting" -- they differ only in *which* loader that is, which is what
110
+ * `loaderPending` carries: `<lr-code-block>` passes `!languagesOnly && !preSuppliedGrammar` (it is
111
+ * waiting on the shared full-table singleton), `<lr-code-block-core>` passes `!!preSuppliedGrammar`
112
+ * (it is waiting on the fine-grained `languages` highlighter, its only one). Called from both
113
+ * `updated()` and `render()` on each class so the `aria-busy` host attribute can never disagree
114
+ * with what is actually on screen.
115
+ */
116
+ export declare function codeBlockShowsSkeleton(shikiReady: boolean, language: string, loaderPending: boolean): boolean;
117
+ /** Mirrors the skeleton state onto the host as `aria-busy`, so assistive tech knows the code
118
+ * region is still resolving. */
119
+ export declare function applyCodeBlockAriaBusy(host: Element, showingSkeleton: boolean): void;
120
+ export interface CodeBlockTokenizeOptions extends CodeBlockLineTransformerOptions {
121
+ code: string;
122
+ lang: string;
123
+ }
124
+ /**
125
+ * The `codeToHtml()` call both components make once their own loader has produced a highlighter.
126
+ * `hl` is deliberately typed as the fine-grained `ShikiHighlighterCore` -- it and
127
+ * `ShikiHighlighter` are the same structural type (see `code-loader.ts`), and naming the
128
+ * fine-grained one keeps this module free of any reference to the full-table half.
129
+ *
130
+ * shiki's generated per-token colors are theme-specific inline styles/CSS variables (from
131
+ * `SHIKI_THEMES`'s github-light/github-dark theme data), not this library's `--lr-*` design tokens
132
+ * -- the one deliberate exception to every other color in these components being a `--lr-*` token.
133
+ * See the dark-mode override in `code-block.styles.ts` for how the dark half of this activates.
134
+ * Returns `null` on malformed input for the grammar or any other shiki-internal failure, so the
135
+ * caller falls back to plain text rather than a blank code block.
136
+ */
137
+ export declare function tokenizeCodeBlock(hl: ShikiHighlighterCore, options: CodeBlockTokenizeOptions): string | null;
29
138
  export declare function parseHighlightLines(spec: string, maxLine?: number): Set<number>;
30
139
  export interface CodeBlockLineTransformerOptions {
31
140
  lineNumbers: boolean;
@@ -70,4 +179,61 @@ export interface CodeBlockPlainCodeOptions {
70
179
  * `part="line-highlight"` from `codeBlockLineTransformer` above.
71
180
  */
72
181
  export declare function renderCodeBlockPlainCode(options: CodeBlockPlainCodeOptions): TemplateResult;
182
+ export interface CodeBlockHeaderOptions {
183
+ collapsible: boolean;
184
+ collapsed: boolean;
185
+ /** `id` of `[part="body"]`, for the toggle's `aria-controls`. */
186
+ bodyId: string;
187
+ filename: string;
188
+ language: string;
189
+ copyable: boolean;
190
+ justCopied: boolean;
191
+ localize: LyraLocalizeFn;
192
+ onToggle: () => void;
193
+ onCopy: () => void;
194
+ }
195
+ /**
196
+ * The header row above the code (filename/language/copy/toggle) shared by `<lr-code-block>` and
197
+ * `<lr-code-block-core>`. `aria-expanded` renders both `"true"` and `"false"` rather than being
198
+ * conditionally omitted -- the collapse toggle's state is meaningless to assistive tech otherwise.
199
+ */
200
+ export declare function renderCodeBlockHeader(options: CodeBlockHeaderOptions): TemplateResult;
201
+ export interface CodeBlockShellOptions {
202
+ filename: string;
203
+ language: string;
204
+ copyable: boolean;
205
+ collapsible: boolean;
206
+ collapsed: boolean;
207
+ justCopied: boolean;
208
+ bodyId: string;
209
+ /** Wins over the filename/language-derived default -- the host's own `aria-label`. */
210
+ accessibleLabel: string;
211
+ maxHeight: string;
212
+ isDarkTheme: boolean;
213
+ showSkeleton: boolean;
214
+ /** shiki's own markup for this render, or `null` for the plain-text fallback path. */
215
+ highlightedHtml: string | null;
216
+ lineNumbers: boolean;
217
+ localize: LyraLocalizeFn;
218
+ renderPlainCode: () => TemplateResult;
219
+ onToggle: () => void;
220
+ onCopy: () => void;
221
+ onBodyMouseUp: (e: MouseEvent) => void;
222
+ onBodyClick: (e: MouseEvent) => void;
223
+ onBodyKeyDown: (e: KeyboardEvent) => void;
224
+ onBodyFocusIn: (e: FocusEvent) => void;
225
+ }
226
+ /**
227
+ * The whole rendered tree for both components: the header (only when there's anything to put in
228
+ * it) plus the scrollable code body.
229
+ *
230
+ * `[part="body"]` is `tabindex="0"` because it's the scrollable region for arbitrarily-wide/tall
231
+ * code (`max-height`, plus horizontal overflow from long lines) -- a scrollable region with no
232
+ * other focusable content of its own is otherwise unreachable by keyboard, the same reasoning
233
+ * `<lr-virtual-list>`'s own `[part="base"]` documents for its identical tabindex. `role="group"`
234
+ * (rather than e.g. `region`, a page landmark role) plus `aria-label` gives it an accessible name
235
+ * without claiming landmark/navigation significance for what is, structurally, just one small piece
236
+ * of a larger document.
237
+ */
238
+ export declare function renderCodeBlockShell(options: CodeBlockShellOptions): TemplateResult;
73
239
  //# sourceMappingURL=code-block-shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-block-shared.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation/code-block/code-block-shared.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAG9C;6CAC6C;AAC7C,MAAM,MAAM,cAAc,GAAG,CAC3B,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KACrC,MAAM,CAAC;AAEZ,+DAA+D;AAC/D,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAEzF;AAED,0DAA0D;AAC1D,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,GAAG,MAAM,CAExF;AAED;0CAC0C;AAC1C,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,QAA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gB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,cAAc,CAsCrF;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,sFAAsF;IACtF,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,eAAe,EAAE,MAAM,cAAc,CAAC;IACtC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,aAAa,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACvC,WAAW,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,aAAa,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,aAAa,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CA8CnF"}
@@ -1,12 +1,26 @@
1
1
  /**
2
- * Localized label helpers, line-highlighting parsing, and the shared shiki
3
- * transformer for `<lr-code-block>` and `<lr-code-block-core>`. Both
4
- * components render an otherwise-identical header/body, and pulling their
5
- * common `this.localize()` call sites and line-addressing logic out into
6
- * one place keeps their behavior from silently drifting apart the way it
7
- * previously did between the two.
2
+ * Everything `<lr-code-block>` and `<lr-code-block-core>` render and compute identically:
3
+ * localized label helpers, line addressing (`highlight-lines`/`highlights` parsing, line counting,
4
+ * `line-range` anchor scrolling), the gutter's roving-tabindex keyboard contract, selection
5
+ * anchoring, clipboard writes, the shiki transformer plus the `codeToHtml()` call around it, and
6
+ * the header/body templates themselves.
7
+ *
8
+ * The two components differ in exactly one axis -- *which* shiki loader they reach for (the full
9
+ * ~200-language dynamic-import table vs. `shiki/core` seeded from a pre-supplied `languages` map),
10
+ * which is why `connectedCallback()` and `syncHighlight()` stay on each class. Everything else was
11
+ * previously duplicated verbatim across both class files and had already drifted (the lean variant
12
+ * had silently dropped both of its `super.willUpdate()`/`super.updated()` chain-ups); routing both
13
+ * through this module is what keeps a fix landing in one place from here on.
14
+ *
15
+ * Nothing here may `import` a *value* from `code-loader.js`'s full-table half
16
+ * (`loadShikiHighlighter`/`loadShikiLanguage`): `<lr-code-block-core>`'s build-leanness claim rests
17
+ * on its own module graph never reaching that call, and this module is in that graph.
8
18
  */
9
19
  import { html, nothing } from 'lit';
20
+ import { unsafeHTML } from 'lit/directives/unsafe-html.js';
21
+ import { chevronIcon } from '../../../internal/icons.js';
22
+ import { prefersReducedMotion } from '../../../internal/motion.js';
23
+ import { normalizeShikiLanguage, SHIKI_THEMES } from './code-loader.js';
10
24
  /** The collapse/expand header toggle button's `aria-label`. */
11
25
  export function codeBlockToggleLabel(localize, collapsed) {
12
26
  return collapsed ? localize('expandCode') : localize('collapseCode');
@@ -35,6 +49,197 @@ export function addBoundedLineRange(lines, start, end, maxLine) {
35
49
  for (let line = low; line <= high; line++)
36
50
  lines.add(line);
37
51
  }
52
+ /** How long the copy button's confirmation state lasts before reverting. */
53
+ export const CODE_BLOCK_COPY_CONFIRM_MS = 1500;
54
+ /** One-based line count of `code`, the upper bound every line-addressing helper below clamps to.
55
+ * A trailing newline still yields the (empty) line after it, matching the rendered line count. */
56
+ export function codeBlockLineCount(code) {
57
+ return code.split(/\r\n|\r|\n/).length;
58
+ }
59
+ /** Keeps the roving-tabindex gutter's focused line inside `[1, lineCount]` after a `code` change
60
+ * shrinks the document out from under it. */
61
+ export function clampCodeBlockFocusedLine(focusedLine, lineCount) {
62
+ return Math.min(Math.max(1, focusedLine), lineCount);
63
+ }
64
+ /** The merged set of one-based line numbers to emphasize: the `highlight-lines` spec plus the
65
+ * `line-range` slice of `highlights`. Shared by both the shiki transformer options and the
66
+ * plain-text fallback path so their emphasis is always identical. */
67
+ export function codeBlockLineHighlightSet(highlightLines, highlights, maxLine) {
68
+ const merged = parseHighlightLines(highlightLines, maxLine);
69
+ for (const highlight of highlights) {
70
+ if (highlight.anchor.kind !== 'line-range')
71
+ continue;
72
+ const end = highlight.anchor.end ?? highlight.anchor.start;
73
+ addBoundedLineRange(merged, highlight.anchor.start, end, maxLine);
74
+ }
75
+ return merged;
76
+ }
77
+ /** The line numbers covered by the `highlights` entry matching `activeHighlightId`, if any. */
78
+ export function codeBlockActiveHighlightLineSet(highlights, activeHighlightId, maxLine) {
79
+ const active = highlights.find((h) => h.id === activeHighlightId);
80
+ const result = new Set();
81
+ if (!active || active.anchor.kind !== 'line-range')
82
+ return result;
83
+ const end = active.anchor.end ?? active.anchor.start;
84
+ addBoundedLineRange(result, active.anchor.start, end, maxLine);
85
+ return result;
86
+ }
87
+ /** The `languages` entry for the *current* `language`, if any -- looked up under both the
88
+ * shiki-normalized id and the raw property value, so `willUpdate()`/`updated()`/`render()`/
89
+ * `syncHighlight()` on either component all agree on whether the fine-grained path applies. */
90
+ export function codeBlockPreSuppliedGrammar(languages, language) {
91
+ const normalized = normalizeShikiLanguage(language);
92
+ return languages?.[normalized] ?? languages?.[language];
93
+ }
94
+ /** Resolves a `line-range` anchor (or a `highlights` id string resolving to one) by scrolling its
95
+ * start line into view within `[part="body"]`. Resolves `false` when the anchor isn't a
96
+ * `line-range`, the id isn't found, or the start line is out of bounds. */
97
+ export async function scrollCodeBlockToAnchor(host, target) {
98
+ const anchor = typeof target === 'string' ? host.highlights.find((h) => h.id === target)?.anchor : target;
99
+ if (!anchor || anchor.kind !== 'line-range')
100
+ return false;
101
+ if (anchor.start < 1 || anchor.start > codeBlockLineCount(host.code))
102
+ return false;
103
+ await host.updateComplete;
104
+ const body = host.renderRoot.querySelector('[part="body"]');
105
+ const lineEl = host.renderRoot.querySelector(`[data-line="${anchor.start}"]`);
106
+ if (!body || !lineEl)
107
+ return false;
108
+ const offset = lineEl.offsetTop - body.clientHeight / 2;
109
+ body.scrollTo({ top: Math.max(0, offset), behavior: prefersReducedMotion() ? 'auto' : 'smooth' });
110
+ return true;
111
+ }
112
+ /** The one-based gutter line an event originated in, or `null` when it didn't come from a line
113
+ * button at all. */
114
+ export function codeBlockEventLine(e) {
115
+ const target = e.composedPath()[0];
116
+ if (!(target instanceof Element))
117
+ return null;
118
+ const lineElement = target.closest('[data-line][part~="line-button"]');
119
+ const line = Number(lineElement?.dataset['line']);
120
+ return Number.isInteger(line) && line >= 1 ? line : null;
121
+ }
122
+ /** The roving-tabindex keyboard contract for the (`line-numbers`-gated) gutter. */
123
+ export function codeBlockLineKeyAction(key, line, total) {
124
+ if (key === 'Enter' || key === ' ')
125
+ return { kind: 'activate' };
126
+ let next = null;
127
+ if (key === 'ArrowDown')
128
+ next = Math.min(total, line + 1);
129
+ else if (key === 'ArrowUp')
130
+ next = Math.max(1, line - 1);
131
+ else if (key === 'Home')
132
+ next = 1;
133
+ else if (key === 'End')
134
+ next = total;
135
+ if (next === null || next === line)
136
+ return null;
137
+ return { kind: 'move', line: next };
138
+ }
139
+ /** Anchors the current selection to the `line-range` it spans. `null` whenever there's nothing to
140
+ * report: no selection, a collapsed/whitespace-only one, or endpoints outside any `[data-line]`. */
141
+ export function codeBlockSelectionAnchor(shadowRoot) {
142
+ // `ShadowRoot.getSelection` is a Chromium-only extension absent from the standard DOM lib
143
+ // types -- same shadow-scoped-selection precedent as <lr-terminal>'s own onViewportPointerUp.
144
+ const shadowSelection = shadowRoot?.getSelection?.();
145
+ const selection = shadowSelection ?? window.getSelection();
146
+ if (!selection || selection.isCollapsed || selection.rangeCount === 0)
147
+ return null;
148
+ const text = selection.toString();
149
+ if (!text.trim())
150
+ return null;
151
+ const range = selection.getRangeAt(0);
152
+ const lineOf = (node) => {
153
+ const el = node.nodeType === Node.TEXT_NODE ? node.parentElement : node;
154
+ const lineEl = el?.closest('[data-line]');
155
+ const attr = lineEl?.getAttribute('data-line');
156
+ return attr === null || attr === undefined ? null : Number(attr);
157
+ };
158
+ const start = lineOf(range.startContainer);
159
+ const end = lineOf(range.endContainer);
160
+ if (start === null || end === null)
161
+ return null;
162
+ return {
163
+ text,
164
+ anchor: { kind: 'line-range', start: Math.min(start, end), end: Math.max(start, end) },
165
+ rects: Array.from(range.getClientRects()),
166
+ };
167
+ }
168
+ /** Best-effort clipboard write. `navigator.clipboard` is absent in insecure contexts / older
169
+ * browsers, and some engines throw synchronously rather than rejecting -- either way the caller
170
+ * still emits `lr-copy` regardless of whether the OS clipboard was actually reached, the same
171
+ * convention `<lr-json-viewer>`'s own copy button follows. */
172
+ export function writeCodeBlockClipboard(text) {
173
+ try {
174
+ void navigator.clipboard?.writeText(text)?.catch(() => { });
175
+ }
176
+ catch {
177
+ // see above
178
+ }
179
+ }
180
+ /** Every property whose change invalidates the cached `highlightedHtml`. `code`/`language`/
181
+ * `languages`/`languagesOnly` change *what* is tokenized; `highlightLines`/`highlights`/
182
+ * `activeHighlightId`/`lineNumbers`/`interactiveLines` all feed `codeBlockLineTransformer()`'s
183
+ * options, so a change to any of them needs a re-tokenize to stay in sync even when the code
184
+ * itself is untouched. `languagesOnly` is listed for `<lr-code-block>`; `<lr-code-block-core>` has
185
+ * no such property, so it simply never appears in that component's changed map. */
186
+ export function codeBlockNeedsHighlightResync(changed) {
187
+ return (changed.has('code') ||
188
+ changed.has('language') ||
189
+ changed.has('languages') ||
190
+ changed.has('highlightLines') ||
191
+ changed.has('highlights') ||
192
+ changed.has('activeHighlightId') ||
193
+ changed.has('lineNumbers') ||
194
+ changed.has('interactiveLines') ||
195
+ changed.has('languagesOnly'));
196
+ }
197
+ /**
198
+ * Whether the `<lr-skeleton>` placeholder stands in for the code this render. Both components gate
199
+ * it on "a highlighter this instance is actually waiting for hasn't settled yet, and there's a
200
+ * `language` worth highlighting" -- they differ only in *which* loader that is, which is what
201
+ * `loaderPending` carries: `<lr-code-block>` passes `!languagesOnly && !preSuppliedGrammar` (it is
202
+ * waiting on the shared full-table singleton), `<lr-code-block-core>` passes `!!preSuppliedGrammar`
203
+ * (it is waiting on the fine-grained `languages` highlighter, its only one). Called from both
204
+ * `updated()` and `render()` on each class so the `aria-busy` host attribute can never disagree
205
+ * with what is actually on screen.
206
+ */
207
+ export function codeBlockShowsSkeleton(shikiReady, language, loaderPending) {
208
+ return !shikiReady && !!language && loaderPending;
209
+ }
210
+ /** Mirrors the skeleton state onto the host as `aria-busy`, so assistive tech knows the code
211
+ * region is still resolving. */
212
+ export function applyCodeBlockAriaBusy(host, showingSkeleton) {
213
+ if (showingSkeleton)
214
+ host.setAttribute('aria-busy', 'true');
215
+ else
216
+ host.removeAttribute('aria-busy');
217
+ }
218
+ /**
219
+ * The `codeToHtml()` call both components make once their own loader has produced a highlighter.
220
+ * `hl` is deliberately typed as the fine-grained `ShikiHighlighterCore` -- it and
221
+ * `ShikiHighlighter` are the same structural type (see `code-loader.ts`), and naming the
222
+ * fine-grained one keeps this module free of any reference to the full-table half.
223
+ *
224
+ * shiki's generated per-token colors are theme-specific inline styles/CSS variables (from
225
+ * `SHIKI_THEMES`'s github-light/github-dark theme data), not this library's `--lr-*` design tokens
226
+ * -- the one deliberate exception to every other color in these components being a `--lr-*` token.
227
+ * See the dark-mode override in `code-block.styles.ts` for how the dark half of this activates.
228
+ * Returns `null` on malformed input for the grammar or any other shiki-internal failure, so the
229
+ * caller falls back to plain text rather than a blank code block.
230
+ */
231
+ export function tokenizeCodeBlock(hl, options) {
232
+ try {
233
+ return hl.codeToHtml(options.code, {
234
+ lang: options.lang,
235
+ themes: SHIKI_THEMES,
236
+ transformers: [codeBlockLineTransformer(options)],
237
+ });
238
+ }
239
+ catch {
240
+ return null;
241
+ }
242
+ }
38
243
  export function parseHighlightLines(spec, maxLine = Number.MAX_SAFE_INTEGER) {
39
244
  const lines = new Set();
40
245
  for (const raw of spec.split(',')) {
@@ -163,4 +368,105 @@ export function renderCodeBlockPlainCode(options) {
163
368
  })}</code
164
369
  >`;
165
370
  }
371
+ /**
372
+ * The header row above the code (filename/language/copy/toggle) shared by `<lr-code-block>` and
373
+ * `<lr-code-block-core>`. `aria-expanded` renders both `"true"` and `"false"` rather than being
374
+ * conditionally omitted -- the collapse toggle's state is meaningless to assistive tech otherwise.
375
+ */
376
+ export function renderCodeBlockHeader(options) {
377
+ // Indented two levels deeper than this function body on purpose: the literal text between these
378
+ // tags becomes real whitespace text nodes, so keeping the exact indentation both class files
379
+ // used before the extraction keeps the rendered DOM byte-identical (see renderCodeBlockShell()
380
+ // below, where the same whitespace lands inside a `white-space`-sensitive region).
381
+ // prettier-ignore
382
+ return html `
383
+ <div part="header">
384
+ ${options.collapsible
385
+ ? html `
386
+ <button
387
+ part="toggle"
388
+ type="button"
389
+ aria-expanded=${options.collapsed ? 'false' : 'true'}
390
+ aria-controls=${options.bodyId}
391
+ aria-label=${codeBlockToggleLabel(options.localize, options.collapsed)}
392
+ @click=${options.onToggle}
393
+ >
394
+ <span class="chevron" aria-hidden="true">${chevronIcon()}</span>
395
+ </button>
396
+ `
397
+ : nothing}
398
+ ${options.filename ? html `<span part="filename">${options.filename}</span>` : nothing}
399
+ ${options.language ? html `<span part="language">${options.language}</span>` : nothing}
400
+ ${options.copyable
401
+ ? html `
402
+ <button
403
+ part="copy-button"
404
+ type="button"
405
+ aria-label=${codeBlockCopyLabel(options.localize, options.justCopied)}
406
+ @click=${options.onCopy}
407
+ >
408
+ ${options.justCopied ? options.localize('copied') : options.localize('copy')}
409
+ </button>
410
+ `
411
+ : nothing}
412
+ </div>
413
+ `;
414
+ }
415
+ /**
416
+ * The whole rendered tree for both components: the header (only when there's anything to put in
417
+ * it) plus the scrollable code body.
418
+ *
419
+ * `[part="body"]` is `tabindex="0"` because it's the scrollable region for arbitrarily-wide/tall
420
+ * code (`max-height`, plus horizontal overflow from long lines) -- a scrollable region with no
421
+ * other focusable content of its own is otherwise unreachable by keyboard, the same reasoning
422
+ * `<lr-virtual-list>`'s own `[part="base"]` documents for its identical tabindex. `role="group"`
423
+ * (rather than e.g. `region`, a page landmark role) plus `aria-label` gives it an accessible name
424
+ * without claiming landmark/navigation significance for what is, structurally, just one small piece
425
+ * of a larger document.
426
+ */
427
+ export function renderCodeBlockShell(options) {
428
+ const hasHeader = !!options.filename || !!options.language || options.copyable || options.collapsible;
429
+ const bodyHidden = options.collapsible && options.collapsed;
430
+ const bodyLabel = options.accessibleLabel || codeBlockBodyLabel(options.localize, options.filename, options.language);
431
+ // Indentation preserved from both class files' own render() -- see renderCodeBlockHeader() above.
432
+ // prettier-ignore
433
+ return html `
434
+ <div part="base">
435
+ ${hasHeader
436
+ ? renderCodeBlockHeader({
437
+ collapsible: options.collapsible,
438
+ collapsed: options.collapsed,
439
+ bodyId: options.bodyId,
440
+ filename: options.filename,
441
+ language: options.language,
442
+ copyable: options.copyable,
443
+ justCopied: options.justCopied,
444
+ localize: options.localize,
445
+ onToggle: options.onToggle,
446
+ onCopy: options.onCopy,
447
+ })
448
+ : nothing}
449
+ <div
450
+ part="body"
451
+ id=${options.bodyId}
452
+ role="group"
453
+ aria-label=${bodyLabel}
454
+ tabindex="0"
455
+ ?hidden=${bodyHidden}
456
+ data-dark-theme=${options.isDarkTheme ? 'true' : nothing}
457
+ style=${options.maxHeight ? `--lr-code-block-max-height:${options.maxHeight}` : nothing}
458
+ @mouseup=${options.onBodyMouseUp}
459
+ @click=${options.onBodyClick}
460
+ @keydown=${options.onBodyKeyDown}
461
+ @focusin=${options.onBodyFocusIn}
462
+ >
463
+ ${options.showSkeleton
464
+ ? html `<lr-skeleton variant="rect"></lr-skeleton>`
465
+ : options.highlightedHtml !== null
466
+ ? unsafeHTML(options.highlightedHtml)
467
+ : html `<pre part="pre" class=${options.lineNumbers ? 'line-numbers' : nothing}>${options.renderPlainCode()}</pre>`}
468
+ </div>
469
+ </div>
470
+ `;
471
+ }
166
472
  //# sourceMappingURL=code-block-shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-block-shared.js","sourceRoot":"","sources":["../../../../src/components/conversation/code-block/code-block-shared.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAYzD,+DAA+D;AAC/D,MAAM,UAAU,oBAAoB,CAAC,QAAwB,EAAE,SAAkB;IAC/E,OAAO,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;AACvE,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,kBAAkB,CAAC,QAAwB,EAAE,UAAmB;IAC9E,OAAO,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAC3E,CAAC;AAED;0CAC0C;AAC1C,MAAM,UAAU,kBAAkB,CAAC,QAAwB,EAAE,QAAgB,EAAE,QAAgB;IAC7F,OAAO,QAAQ,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,wBAAwB,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;AACvH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAkB,EAAE,KAAa,EAAE,GAAW,EAAE,OAAe;IACjG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,OAAO,G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 -205,11 +205,7 @@ export declare class LyraCodeBlock extends LyraElement<LyraCodeBlockEventMap> {
205
205
  private ensureDefaultHighlighter;
206
206
  disconnectedCallback(): void;
207
207
  private preSuppliedGrammar;
208
- /** The merged set of one-based line numbers to emphasize: `highlightLines` plus the `line-range`
209
- * slice of `highlights`. Shared by both the shiki transformer options and the plain-text
210
- * fallback path so their emphasis is always identical. */
211
208
  private lineHighlightSet;
212
- /** The line numbers covered by the `highlights` entry matching `activeHighlightId`, if any. */
213
209
  private activeHighlightLineSet;
214
210
  private lineCount;
215
211
  /** Resolves a `line-range` anchor (or a `highlights` id string resolving to one) by scrolling
@@ -219,7 +215,6 @@ export declare class LyraCodeBlock extends LyraElement<LyraCodeBlockEventMap> {
219
215
  private onLineActivate;
220
216
  private setFocusedLine;
221
217
  private onLineKeyDown;
222
- private eventLine;
223
218
  private onBodyClick;
224
219
  private onBodyKeyDown;
225
220
  private onBodyFocusIn;
@@ -228,13 +223,17 @@ export declare class LyraCodeBlock extends LyraElement<LyraCodeBlockEventMap> {
228
223
  private onBodyMouseUp;
229
224
  protected willUpdate(changed: PropertyValues): void;
230
225
  protected updated(changed: PropertyValues): void;
226
+ /** Whether this render shows the loading skeleton instead of the code. `languagesOnly` skips the
227
+ * default loader entirely (see `ensureDefaultHighlighter()`), so `shikiReady` never becomes true
228
+ * for it -- treat that as "nothing to wait for" rather than "still loading", the same way a
229
+ * `preSuppliedGrammar()` match already does. Read by both `updated()` and `render()` so the
230
+ * `aria-busy` host attribute can never disagree with what's on screen. */
231
+ private showsSkeleton;
231
232
  private syncHighlight;
232
233
  private tokenize;
233
234
  private renderPlainCode;
234
- private writeClipboard;
235
235
  private copy;
236
236
  private toggleCollapsed;
237
- private renderHeader;
238
237
  render(): TemplateResult;
239
238
  }
240
239
  declare global {