@ai-matrx/rich-content 0.2.3 → 0.2.6

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 (382) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/code-block/CodeBlock.d.ts +44 -0
  3. package/dist/code-block/CodeBlock.js +449 -0
  4. package/dist/code-block/CodeBlockHeader.d.ts +63 -0
  5. package/dist/code-block/CodeBlockHeader.js +472 -0
  6. package/dist/code-block/CodeEditorLoading.d.ts +3 -0
  7. package/dist/code-block/CodeEditorLoading.js +34 -0
  8. package/dist/code-block/LanguageDisplay.d.ts +28 -0
  9. package/dist/code-block/LanguageDisplay.js +279 -0
  10. package/dist/code-block/SmallCodeEditor.d.ts +30 -0
  11. package/dist/code-block/SmallCodeEditor.js +22 -0
  12. package/dist/code-block/StickyButtons.d.ts +35 -0
  13. package/dist/code-block/StickyButtons.js +88 -0
  14. package/dist/code-block/highlight/ShikiCodeView.d.ts +26 -0
  15. package/dist/code-block/highlight/ShikiCodeView.js +134 -0
  16. package/dist/code-block/highlight/shiki-highlighter.d.ts +14 -0
  17. package/dist/code-block/highlight/shiki-highlighter.js +126 -0
  18. package/dist/code-block/highlight/useHighlightedLines.d.ts +18 -0
  19. package/dist/code-block/highlight/useHighlightedLines.js +142 -0
  20. package/dist/code-block/sticky-inset.d.ts +6 -0
  21. package/dist/code-block/sticky-inset.js +10 -0
  22. package/dist/display/block-interaction.d.ts +33 -0
  23. package/dist/display/block-interaction.js +13 -0
  24. package/dist/display/blocks/ChatCollapsibleWrapper.d.ts +13 -0
  25. package/dist/display/blocks/ChatCollapsibleWrapper.js +56 -0
  26. package/dist/display/blocks/buildMediaSource.d.ts +25 -0
  27. package/dist/display/blocks/buildMediaSource.js +43 -0
  28. package/dist/display/blocks/canvas-adaptive.d.ts +118 -0
  29. package/dist/display/blocks/canvas-adaptive.js +127 -0
  30. package/dist/display/blocks/canvas-fit.d.ts +24 -0
  31. package/dist/display/blocks/canvas-fit.js +19 -0
  32. package/dist/display/blocks/chart/ChartBlock.d.ts +8 -0
  33. package/dist/display/blocks/chart/ChartBlock.js +125 -0
  34. package/dist/display/blocks/chart/ChartCanvas.d.ts +18 -0
  35. package/dist/display/blocks/chart/ChartCanvas.js +159 -0
  36. package/dist/display/blocks/chart/TableChart.d.ts +25 -0
  37. package/dist/display/blocks/chart/TableChart.js +97 -0
  38. package/dist/display/blocks/chart/chart-spec.d.ts +39 -0
  39. package/dist/display/blocks/chart/chart-spec.js +128 -0
  40. package/dist/display/blocks/chart/labels.d.ts +20 -0
  41. package/dist/display/blocks/chart/labels.js +7 -0
  42. package/dist/display/blocks/chart/table-chart.d.ts +37 -0
  43. package/dist/display/blocks/chart/table-chart.js +231 -0
  44. package/dist/display/blocks/common/BlockHeaderWrapper.d.ts +56 -0
  45. package/dist/display/blocks/common/BlockHeaderWrapper.js +310 -0
  46. package/dist/display/blocks/common/ContentBlockWrapper.d.ts +40 -0
  47. package/dist/display/blocks/common/ContentBlockWrapper.js +214 -0
  48. package/dist/display/blocks/common/SandboxedHtml.d.ts +27 -0
  49. package/dist/display/blocks/common/SandboxedHtml.js +26 -0
  50. package/dist/display/blocks/csv/CsvBlock.js +5 -1
  51. package/dist/display/blocks/diagram/DiagramLoadingVisualization.d.ts +6 -0
  52. package/dist/display/blocks/diagram/DiagramLoadingVisualization.js +190 -0
  53. package/dist/display/blocks/diagram/InteractiveDiagramBlock.d.ts +51 -0
  54. package/dist/display/blocks/diagram/InteractiveDiagramBlock.js +2415 -0
  55. package/dist/display/blocks/diagram/diagram-printer.d.ts +16 -0
  56. package/dist/display/blocks/diagram/diagram-printer.js +294 -0
  57. package/dist/display/blocks/diagram/diagram-visual-defaults.d.ts +116 -0
  58. package/dist/display/blocks/diagram/diagram-visual-defaults.js +400 -0
  59. package/dist/display/blocks/diagram/layout-utils.d.ts +90 -0
  60. package/dist/display/blocks/diagram/layout-utils.js +347 -0
  61. package/dist/display/blocks/diagram/parseDiagramJSON.d.ts +105 -0
  62. package/dist/display/blocks/diagram/parseDiagramJSON.js +296 -0
  63. package/dist/display/blocks/diagram/presentation-direction.d.ts +29 -0
  64. package/dist/display/blocks/diagram/presentation-direction.js +19 -0
  65. package/dist/display/blocks/diagram/ui-utils.d.ts +1 -0
  66. package/dist/display/blocks/diagram/ui-utils.js +18 -0
  67. package/dist/display/blocks/diff/DiffBlock.d.ts +10 -0
  68. package/dist/display/blocks/diff/DiffBlock.js +119 -0
  69. package/dist/display/blocks/diff/DiffCanvas.d.ts +15 -0
  70. package/dist/display/blocks/diff/DiffCanvas.js +20 -0
  71. package/dist/display/blocks/generic/GenericStructuredBlock.d.ts +24 -0
  72. package/dist/display/blocks/generic/GenericStructuredBlock.js +53 -0
  73. package/dist/display/blocks/generic/StructuredValueTabs.d.ts +21 -0
  74. package/dist/display/blocks/generic/StructuredValueTabs.js +124 -0
  75. package/dist/display/blocks/generic/tile-actions-slot.d.ts +39 -0
  76. package/dist/display/blocks/generic/tile-actions-slot.js +33 -0
  77. package/dist/display/blocks/images/ImageBlock.d.ts +8 -0
  78. package/dist/display/blocks/images/ImageBlock.js +265 -0
  79. package/dist/display/blocks/json/JsonBlock.d.ts +34 -0
  80. package/dist/display/blocks/json/JsonBlock.js +562 -0
  81. package/dist/display/blocks/json/JsonTableView.d.ts +10 -0
  82. package/dist/display/blocks/json/JsonTableView.js +173 -0
  83. package/dist/display/blocks/json/json-compact-stringify.d.ts +25 -0
  84. package/dist/display/blocks/json/json-compact-stringify.js +52 -0
  85. package/dist/display/blocks/json/json-tabular-utils.d.ts +65 -0
  86. package/dist/display/blocks/json/json-tabular-utils.js +121 -0
  87. package/dist/display/blocks/links/LinkComponent.d.ts +6 -0
  88. package/dist/display/blocks/links/LinkComponent.js +373 -0
  89. package/dist/display/blocks/links/LinkComponentWithFetch.d.ts +1 -0
  90. package/dist/display/blocks/links/LinkComponentWithFetch.js +0 -0
  91. package/dist/display/blocks/markdown/MarkdownKindBlock.d.ts +48 -0
  92. package/dist/display/blocks/markdown/MarkdownKindBlock.js +52 -0
  93. package/dist/display/blocks/markdown-preview/MarkdownPreviewBlock.d.ts +17 -0
  94. package/dist/display/blocks/markdown-preview/MarkdownPreviewBlock.js +70 -0
  95. package/dist/display/blocks/mermaid/MermaidBlock.d.ts +19 -0
  96. package/dist/display/blocks/mermaid/MermaidBlock.js +386 -0
  97. package/dist/display/blocks/search-replace/SearchReplaceBlock.d.ts +50 -0
  98. package/dist/display/blocks/search-replace/SearchReplaceBlock.js +71 -0
  99. package/dist/display/blocks/svg/SvgBlock.d.ts +8 -0
  100. package/dist/display/blocks/svg/SvgBlock.js +126 -0
  101. package/dist/display/blocks/table/StreamingTableRenderer.d.ts +53 -0
  102. package/dist/display/blocks/table/StreamingTableRenderer.js +907 -0
  103. package/dist/display/blocks/table/TableRenderPathDiagnostic.d.ts +21 -0
  104. package/dist/display/blocks/table/TableRenderPathDiagnostic.js +79 -0
  105. package/dist/display/blocks/thinking-reasoning/ConsolidatedReasoningVisualization.d.ts +14 -0
  106. package/dist/display/blocks/thinking-reasoning/ConsolidatedReasoningVisualization.js +15 -0
  107. package/dist/display/blocks/thinking-reasoning/ReasoningVisualization.d.ts +13 -0
  108. package/dist/display/blocks/thinking-reasoning/ReasoningVisualization.js +19 -0
  109. package/dist/display/blocks/thinking-reasoning/ThinkingTrace.d.ts +30 -0
  110. package/dist/display/blocks/thinking-reasoning/ThinkingTrace.js +75 -0
  111. package/dist/display/blocks/thinking-reasoning/ThinkingTraceMarkdown.d.ts +13 -0
  112. package/dist/display/blocks/thinking-reasoning/ThinkingTraceMarkdown.js +48 -0
  113. package/dist/display/blocks/thinking-reasoning/ThinkingVisualization.d.ts +12 -0
  114. package/dist/display/blocks/thinking-reasoning/ThinkingVisualization.js +19 -0
  115. package/dist/display/blocks/toml/TomlBlock.d.ts +7 -0
  116. package/dist/display/blocks/toml/TomlBlock.js +167 -0
  117. package/dist/display/blocks/tree/TreeBlock.d.ts +7 -0
  118. package/dist/display/blocks/tree/TreeBlock.js +163 -0
  119. package/dist/display/blocks/xml/XmlBlock.d.ts +23 -0
  120. package/dist/display/blocks/xml/XmlBlock.js +197 -0
  121. package/dist/display/blocks/xml/readXmlTag.d.ts +1 -0
  122. package/dist/display/blocks/xml/readXmlTag.js +1 -0
  123. package/dist/display/blocks/xml/xml-tokenize.d.ts +13 -0
  124. package/dist/display/blocks/xml/xml-tokenize.js +169 -0
  125. package/dist/display/blocks/yaml/YamlBlock.d.ts +7 -0
  126. package/dist/display/blocks/yaml/YamlBlock.js +191 -0
  127. package/dist/display/chat-markdown/BasicMarkdownContent.d.ts +29 -0
  128. package/dist/display/chat-markdown/BasicMarkdownContent.js +122 -0
  129. package/dist/display/chat-markdown/BlockRenderingContext.d.ts +23 -0
  130. package/dist/display/chat-markdown/BlockRenderingContext.js +17 -0
  131. package/dist/display/chat-markdown/ConfigurableMarkdownContent.d.ts +172 -0
  132. package/dist/display/chat-markdown/ConfigurableMarkdownContent.js +649 -0
  133. package/dist/display/chat-markdown/InlineCodeSnippet.d.ts +19 -0
  134. package/dist/display/chat-markdown/InlineCodeSnippet.js +146 -0
  135. package/dist/display/chat-markdown/InlineCodeSnippetKindGate.d.ts +11 -0
  136. package/dist/display/chat-markdown/InlineCodeSnippetKindGate.js +9 -0
  137. package/dist/display/chat-markdown/KindTextGate.d.ts +31 -0
  138. package/dist/display/chat-markdown/KindTextGate.js +60 -0
  139. package/dist/display/chat-markdown/QuestionnaireLoadingVisualization.d.ts +6 -0
  140. package/dist/display/chat-markdown/QuestionnaireLoadingVisualization.js +92 -0
  141. package/dist/display/chat-markdown/block-registry/BlockComponentRegistry.d.ts +72 -0
  142. package/dist/display/chat-markdown/block-registry/BlockComponentRegistry.js +94 -0
  143. package/dist/display/chat-markdown/block-registry/BlockRenderer.d.ts +126 -0
  144. package/dist/display/chat-markdown/block-registry/BlockRenderer.js +473 -0
  145. package/dist/display/chat-markdown/block-registry/block-dispatch.d.ts +410 -0
  146. package/dist/display/chat-markdown/block-registry/block-dispatch.js +495 -0
  147. package/dist/display/chat-markdown/block-registry/json-parse-utils.d.ts +13 -0
  148. package/dist/display/chat-markdown/block-registry/json-parse-utils.js +236 -0
  149. package/dist/display/chat-markdown/constants.d.ts +14 -0
  150. package/dist/display/chat-markdown/constants.js +317 -0
  151. package/dist/display/chat-markdown/diff-blocks/DiffCollapsible.d.ts +31 -0
  152. package/dist/display/chat-markdown/diff-blocks/DiffCollapsible.js +62 -0
  153. package/dist/display/chat-markdown/diff-blocks/DiffLoadingIndicator.d.ts +12 -0
  154. package/dist/display/chat-markdown/diff-blocks/DiffLoadingIndicator.js +18 -0
  155. package/dist/display/chat-markdown/diff-blocks/StreamingDiffBlock.d.ts +22 -0
  156. package/dist/display/chat-markdown/diff-blocks/StreamingDiffBlock.js +130 -0
  157. package/dist/display/chat-markdown/diff-blocks/diff-style-registry.d.ts +21 -0
  158. package/dist/display/chat-markdown/diff-blocks/diff-style-registry.js +91 -0
  159. package/dist/display/chat-markdown/diff-blocks/renderers/SearchReplaceDiffRenderer.d.ts +26 -0
  160. package/dist/display/chat-markdown/diff-blocks/renderers/SearchReplaceDiffRenderer.js +186 -0
  161. package/dist/display/chat-markdown/diff-blocks/types.d.ts +56 -0
  162. package/dist/display/chat-markdown/diff-blocks/types.js +0 -0
  163. package/dist/display/chat-markdown/internal-handlers/BlockFallback.d.ts +20 -0
  164. package/dist/display/chat-markdown/internal-handlers/BlockFallback.js +83 -0
  165. package/dist/display/chat-markdown/internal-handlers/InlineStatusIndicator.d.ts +4 -0
  166. package/dist/display/chat-markdown/internal-handlers/InlineStatusIndicator.js +16 -0
  167. package/dist/display/chat-markdown/internal-handlers/MarkdownErrorBoundary.d.ts +17 -0
  168. package/dist/display/chat-markdown/internal-handlers/MarkdownErrorBoundary.js +40 -0
  169. package/dist/display/chat-markdown/internal-handlers/PlainTextFallback.d.ts +8 -0
  170. package/dist/display/chat-markdown/internal-handlers/PlainTextFallback.js +91 -0
  171. package/dist/display/chat-markdown/internal-handlers/SafeBlockRenderer.d.ts +20 -0
  172. package/dist/display/chat-markdown/internal-handlers/SafeBlockRenderer.js +72 -0
  173. package/dist/display/chat-markdown/kind-source-view.d.ts +14 -0
  174. package/dist/display/chat-markdown/kind-source-view.js +14 -0
  175. package/dist/display/chat-markdown/matrx-variables/MatrxVariableInline.d.ts +28 -0
  176. package/dist/display/chat-markdown/matrx-variables/MatrxVariableInline.js +65 -0
  177. package/dist/display/chat-markdown/progressive-mount.d.ts +18 -0
  178. package/dist/display/chat-markdown/progressive-mount.js +90 -0
  179. package/dist/display/chat-markdown/render-block-to-content-block.d.ts +31 -0
  180. package/dist/display/chat-markdown/render-block-to-content-block.js +32 -0
  181. package/dist/display/chat-markdown/settle-stream-blocks.d.ts +50 -0
  182. package/dist/display/chat-markdown/settle-stream-blocks.js +26 -0
  183. package/dist/display/chat-markdown/stable-blocks.d.ts +15 -0
  184. package/dist/display/chat-markdown/stable-blocks.js +54 -0
  185. package/dist/display/chat-markdown/types.d.ts +11 -0
  186. package/dist/display/chat-markdown/types.js +26 -0
  187. package/dist/display/specimen/SpecimenContext.d.ts +26 -0
  188. package/dist/display/specimen/SpecimenContext.js +64 -0
  189. package/dist/display/tables/MarkdownTable.d.ts +23 -0
  190. package/dist/display/tables/MarkdownTable.js +769 -0
  191. package/dist/display/tables/MarkdownTableScrollArea.d.ts +12 -0
  192. package/dist/display/tables/MarkdownTableScrollArea.js +92 -0
  193. package/dist/display/tables/SendToGoogleSheetButton.d.ts +19 -0
  194. package/dist/display/tables/SendToGoogleSheetButton.js +93 -0
  195. package/dist/display/tables/SendToWorkbookButton.d.ts +24 -0
  196. package/dist/display/tables/SendToWorkbookButton.js +93 -0
  197. package/dist/display/tables/TableSaveToMenu.d.ts +16 -0
  198. package/dist/display/tables/TableSaveToMenu.js +98 -0
  199. package/dist/display/tables/TableWithSeparatedControls.d.ts +22 -0
  200. package/dist/display/tables/TableWithSeparatedControls.js +574 -0
  201. package/dist/display/tables/ViewTableModal.d.ts +14 -0
  202. package/dist/display/tables/ViewTableModal.js +67 -0
  203. package/dist/display/tables/editing/ColumnActionsMenu.d.ts +16 -0
  204. package/dist/display/tables/editing/ColumnActionsMenu.js +80 -0
  205. package/dist/display/tables/editing/RowActionsMenu.d.ts +16 -0
  206. package/dist/display/tables/editing/RowActionsMenu.js +80 -0
  207. package/dist/display/tables/editing/TableEditToolbar.d.ts +15 -0
  208. package/dist/display/tables/editing/TableEditToolbar.js +63 -0
  209. package/dist/display/tables/editing/tableMutations.d.ts +50 -0
  210. package/dist/display/tables/editing/tableMutations.js +148 -0
  211. package/dist/display/tables/editing/useDoubleClickEdit.d.ts +43 -0
  212. package/dist/display/tables/editing/useDoubleClickEdit.js +51 -0
  213. package/dist/display/tables/editing/useTableUndo.d.ts +25 -0
  214. package/dist/display/tables/editing/useTableUndo.js +17 -0
  215. package/dist/display/tables/table-action-row.d.ts +8 -0
  216. package/dist/display/tables/table-action-row.js +31 -0
  217. package/dist/display/tables/table-viewer.d.ts +13 -0
  218. package/dist/display/tables/table-viewer.js +18 -0
  219. package/dist/host/ErrorActions.d.ts +1 -1
  220. package/dist/host/ErrorNotice.d.ts +10 -0
  221. package/dist/host/ErrorNotice.js +19 -0
  222. package/dist/host/app-bindings.d.ts +155 -0
  223. package/dist/host/app-bindings.js +160 -0
  224. package/dist/host/diagnostics.d.ts +2 -2
  225. package/dist/host/diagnostics.js +2 -1
  226. package/dist/host/tables.d.ts +1 -6
  227. package/dist/host/types.d.ts +14 -7
  228. package/dist/levels/RichContent.d.ts +3 -0
  229. package/dist/levels/RichContent.js +102 -0
  230. package/dist/levels/RichContentInline.d.ts +28 -0
  231. package/dist/levels/RichContentInline.js +61 -0
  232. package/dist/levels/RichContentPreview.d.ts +12 -0
  233. package/dist/levels/RichContentPreview.js +39 -0
  234. package/dist/levels/RichContentStandardImpl.d.ts +12 -0
  235. package/dist/levels/RichContentStandardImpl.js +27 -0
  236. package/dist/levels/RichContentStaticProse.d.ts +46 -0
  237. package/dist/levels/RichContentStaticProse.js +100 -0
  238. package/dist/levels/depth.d.ts +18 -0
  239. package/dist/levels/depth.js +32 -0
  240. package/dist/levels/prose/inline-level-elements.d.ts +19 -0
  241. package/dist/levels/prose/inline-level-elements.js +103 -0
  242. package/dist/levels/prose/prose-block-elements.d.ts +25 -0
  243. package/dist/levels/prose/prose-block-elements.js +313 -0
  244. package/dist/levels/prose/prose-inline-elements.d.ts +13 -0
  245. package/dist/levels/prose/prose-inline-elements.js +143 -0
  246. package/dist/levels/prose/prose-prepare.d.ts +50 -0
  247. package/dist/levels/prose/prose-prepare.js +246 -0
  248. package/dist/levels/prose/remote-image-policy.d.ts +34 -0
  249. package/dist/levels/prose/remote-image-policy.js +153 -0
  250. package/dist/levels/prose/variant-root.d.ts +9 -0
  251. package/dist/levels/prose/variant-root.js +34 -0
  252. package/dist/levels/rich-content-types.d.ts +93 -0
  253. package/dist/levels/rich-content-types.js +4 -0
  254. package/dist/levels/server/DelimiterViolationReport.d.ts +7 -0
  255. package/dist/levels/server/DelimiterViolationReport.js +24 -0
  256. package/dist/levels/server/RichContentServer.d.ts +27 -0
  257. package/dist/levels/server/RichContentServer.js +97 -0
  258. package/dist/levels/standard/NestedRichContent.d.ts +7 -0
  259. package/dist/levels/standard/NestedRichContent.js +70 -0
  260. package/dist/levels/standard/StandardBlocks.d.ts +13 -0
  261. package/dist/levels/standard/StandardBlocks.js +239 -0
  262. package/dist/levels/standard/StandardKindRegion.d.ts +14 -0
  263. package/dist/levels/standard/StandardKindRegion.js +69 -0
  264. package/dist/levels/standard/standard-kind-region.d.ts +19 -0
  265. package/dist/levels/standard/standard-kind-region.js +21 -0
  266. package/dist/levels/standard/static-standard.d.ts +23 -0
  267. package/dist/levels/standard/static-standard.js +187 -0
  268. package/dist/levels/standard/stream-holdback.d.ts +2 -0
  269. package/dist/levels/standard/stream-holdback.js +77 -0
  270. package/dist/mermaid/MermaidFullscreen.d.ts +17 -0
  271. package/dist/mermaid/MermaidFullscreen.js +71 -0
  272. package/dist/mermaid/MermaidRenderer.d.ts +20 -0
  273. package/dist/mermaid/MermaidRenderer.js +267 -0
  274. package/dist/mermaid/MermaidView.d.ts +27 -0
  275. package/dist/mermaid/MermaidView.js +68 -0
  276. package/dist/mermaid/MermaidViewport.d.ts +75 -0
  277. package/dist/mermaid/MermaidViewport.js +286 -0
  278. package/dist/mermaid/adapters/er.d.ts +10 -0
  279. package/dist/mermaid/adapters/er.js +205 -0
  280. package/dist/mermaid/adapters/flowchart.d.ts +17 -0
  281. package/dist/mermaid/adapters/flowchart.js +634 -0
  282. package/dist/mermaid/adapters/journey.d.ts +9 -0
  283. package/dist/mermaid/adapters/journey.js +207 -0
  284. package/dist/mermaid/adapters/mindmap.d.ts +12 -0
  285. package/dist/mermaid/adapters/mindmap.js +252 -0
  286. package/dist/mermaid/adapters/pie.d.ts +7 -0
  287. package/dist/mermaid/adapters/pie.js +172 -0
  288. package/dist/mermaid/adapters/quadrant.d.ts +8 -0
  289. package/dist/mermaid/adapters/quadrant.js +231 -0
  290. package/dist/mermaid/adapters/register.d.ts +7 -0
  291. package/dist/mermaid/adapters/register.js +19 -0
  292. package/dist/mermaid/adapters/sequence.d.ts +8 -0
  293. package/dist/mermaid/adapters/sequence.js +251 -0
  294. package/dist/mermaid/adapters/state.d.ts +12 -0
  295. package/dist/mermaid/adapters/state.js +245 -0
  296. package/dist/mermaid/adapters/timeline.d.ts +8 -0
  297. package/dist/mermaid/adapters/timeline.js +245 -0
  298. package/dist/mermaid/catalog.d.ts +33 -0
  299. package/dist/mermaid/catalog.js +202 -0
  300. package/dist/mermaid/diagram-type.d.ts +39 -0
  301. package/dist/mermaid/diagram-type.js +89 -0
  302. package/dist/mermaid/export.d.ts +21 -0
  303. package/dist/mermaid/export.js +112 -0
  304. package/dist/mermaid/extract-fence.d.ts +15 -0
  305. package/dist/mermaid/extract-fence.js +22 -0
  306. package/dist/mermaid/lazy-draw.d.ts +40 -0
  307. package/dist/mermaid/lazy-draw.js +168 -0
  308. package/dist/mermaid/model/adapter.d.ts +28 -0
  309. package/dist/mermaid/model/adapter.js +16 -0
  310. package/dist/mermaid/model/ops.d.ts +282 -0
  311. package/dist/mermaid/model/ops.js +9 -0
  312. package/dist/mermaid/model/round-trip.d.ts +22 -0
  313. package/dist/mermaid/model/round-trip.js +45 -0
  314. package/dist/mermaid/model/types.d.ts +271 -0
  315. package/dist/mermaid/model/types.js +0 -0
  316. package/dist/mermaid/print-render.d.ts +9 -0
  317. package/dist/mermaid/print-render.js +39 -0
  318. package/dist/mermaid/runtime.d.ts +25 -0
  319. package/dist/mermaid/runtime.js +183 -0
  320. package/dist/mermaid/sanitize.d.ts +46 -0
  321. package/dist/mermaid/sanitize.js +234 -0
  322. package/dist/mermaid/types.d.ts +43 -0
  323. package/dist/mermaid/types.js +21 -0
  324. package/dist/mermaid/view/ViewModePane.d.ts +24 -0
  325. package/dist/mermaid/view/ViewModePane.js +9 -0
  326. package/dist/utils/client-lazy.d.ts +1 -1
  327. package/dist/utils/client-lazy.js +4 -1
  328. package/dist/utils/lifted/DiffView.d.ts +10 -0
  329. package/dist/utils/lifted/DiffView.js +26 -0
  330. package/dist/utils/lifted/IconButton.d.ts +24 -0
  331. package/dist/utils/lifted/IconButton.js +43 -0
  332. package/dist/utils/lifted/MatrxMiniLoader.d.ts +1 -0
  333. package/dist/utils/lifted/MatrxMiniLoader.js +8 -0
  334. package/dist/utils/lifted/ShimmerText.d.ts +5 -0
  335. package/dist/utils/lifted/ShimmerText.js +21 -0
  336. package/dist/utils/lifted/SuspenseLoader.d.ts +16 -0
  337. package/dist/utils/lifted/SuspenseLoader.js +42 -0
  338. package/dist/utils/lifted/Tooltip.d.ts +20 -0
  339. package/dist/utils/lifted/Tooltip.js +52 -0
  340. package/dist/utils/lifted/artifactId.d.ts +34 -0
  341. package/dist/utils/lifted/artifactId.js +15 -0
  342. package/dist/utils/lifted/canvasContent.d.ts +63 -0
  343. package/dist/utils/lifted/canvasContent.js +98 -0
  344. package/dist/utils/lifted/captureReactError.d.ts +24 -0
  345. package/dist/utils/lifted/captureReactError.js +28 -0
  346. package/dist/utils/lifted/chunk-load-recovery.d.ts +25 -0
  347. package/dist/utils/lifted/chunk-load-recovery.js +36 -0
  348. package/dist/utils/lifted/code-editor-agent-types.d.ts +6 -0
  349. package/dist/utils/lifted/code-editor-agent-types.js +0 -0
  350. package/dist/utils/lifted/code-editor-agents.d.ts +39 -0
  351. package/dist/utils/lifted/code-editor-agents.js +52 -0
  352. package/dist/utils/lifted/code-language-extension.d.ts +1 -0
  353. package/dist/utils/lifted/code-language-extension.js +60 -0
  354. package/dist/utils/lifted/custom-icons.d.ts +16 -0
  355. package/dist/utils/lifted/custom-icons.js +47 -0
  356. package/dist/utils/lifted/durability.d.ts +16 -0
  357. package/dist/utils/lifted/durability.js +45 -0
  358. package/dist/utils/lifted/errors.d.ts +30 -0
  359. package/dist/utils/lifted/errors.js +29 -0
  360. package/dist/utils/lifted/html-document.d.ts +1 -0
  361. package/dist/utils/lifted/html-document.js +12 -0
  362. package/dist/utils/lifted/languageOptions.d.ts +9 -0
  363. package/dist/utils/lifted/languageOptions.js +52 -0
  364. package/dist/utils/lifted/languages.d.ts +34 -0
  365. package/dist/utils/lifted/languages.js +175 -0
  366. package/dist/utils/lifted/loading-spinner.d.ts +18 -0
  367. package/dist/utils/lifted/loading-spinner.js +200 -0
  368. package/dist/utils/lifted/media-refs.d.ts +13 -0
  369. package/dist/utils/lifted/media-refs.js +27 -0
  370. package/dist/utils/lifted/scroll-root.d.ts +1 -0
  371. package/dist/utils/lifted/scroll-root.js +25 -0
  372. package/dist/utils/lifted/syntax-themes.d.ts +32 -0
  373. package/dist/utils/lifted/syntax-themes.js +100 -0
  374. package/dist/utils/lifted/url-utm.d.ts +24 -0
  375. package/dist/utils/lifted/url-utm.js +66 -0
  376. package/dist/utils/lifted/use-is-mounted.d.ts +24 -0
  377. package/dist/utils/lifted/use-is-mounted.js +21 -0
  378. package/dist/utils/lifted/useToastManager.d.ts +1 -0
  379. package/dist/utils/lifted/useToastManager.js +7 -0
  380. package/dist/utils/report-kind-at-raw-renderer.d.ts +19 -0
  381. package/dist/utils/report-kind-at-raw-renderer.js +32 -0
  382. package/package.json +32 -3
@@ -0,0 +1,191 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useClipboard } from "@ai-matrx/kit/clipboard";
4
+ import { toast } from "../../../host/toast.js";
5
+ import { useState } from "react";
6
+ import { cn } from "@ai-matrx/design-system";
7
+ import { ChevronRight, ChevronDown, Copy, Check } from "lucide-react";
8
+ import { Button } from "@ai-matrx/design-system/controls";
9
+ function parseYamlLines(content) {
10
+ return content.split("\n").map((raw) => {
11
+ const indent = raw.search(/\S|$/);
12
+ const trimmed = raw.trim();
13
+ if (!trimmed || trimmed === "---" || trimmed === "...") {
14
+ return {
15
+ indent,
16
+ isComment: false,
17
+ isArrayItem: false,
18
+ isSection: false,
19
+ raw
20
+ };
21
+ }
22
+ if (trimmed.startsWith("#")) {
23
+ return {
24
+ indent,
25
+ isComment: true,
26
+ isArrayItem: false,
27
+ isSection: false,
28
+ raw
29
+ };
30
+ }
31
+ const isArrayItem = trimmed.startsWith("- ");
32
+ let effectiveTrimmed = isArrayItem ? trimmed.slice(2) : trimmed;
33
+ const colonIdx = effectiveTrimmed.indexOf(":");
34
+ if (colonIdx !== -1) {
35
+ const key = effectiveTrimmed.slice(0, colonIdx).trim();
36
+ const afterColon = effectiveTrimmed.slice(colonIdx + 1).trim();
37
+ const isSection = afterColon === "" || afterColon === "|" || afterColon === ">" || afterColon === "|-" || afterColon === ">-";
38
+ return {
39
+ indent,
40
+ key,
41
+ value: isSection ? void 0 : afterColon,
42
+ isComment: false,
43
+ isArrayItem,
44
+ isSection,
45
+ raw
46
+ };
47
+ }
48
+ return {
49
+ indent,
50
+ value: effectiveTrimmed,
51
+ isComment: false,
52
+ isArrayItem,
53
+ isSection: false,
54
+ raw
55
+ };
56
+ });
57
+ }
58
+ function renderValue(value) {
59
+ if (value === "true" || value === "false") {
60
+ return /* @__PURE__ */ jsx("span", { className: "text-orange-600 dark:text-orange-400 font-medium", children: value });
61
+ }
62
+ if (value === "null" || value === "~") {
63
+ return /* @__PURE__ */ jsx("span", { className: "text-muted-foreground italic", children: "null" });
64
+ }
65
+ if (/^-?\d+(\.\d+)?$/.test(value)) {
66
+ return /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-400", children: value });
67
+ }
68
+ if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
69
+ return /* @__PURE__ */ jsx("span", { className: "text-green-600 dark:text-green-400", children: value });
70
+ }
71
+ if (value.startsWith("[") && value.endsWith("]")) {
72
+ return /* @__PURE__ */ jsx("span", { className: "text-green-600 dark:text-green-400", children: value });
73
+ }
74
+ return /* @__PURE__ */ jsx("span", { className: "text-green-600 dark:text-green-400", children: value });
75
+ }
76
+ const YamlBlock = ({ content, className }) => {
77
+ const { copyText } = useClipboard({
78
+ notify: (message, kind) => kind === "error" ? toast.error(message) : toast.success(message)
79
+ });
80
+ const [copied, setCopied] = useState(false);
81
+ const [collapsed, setCollapsed] = useState(/* @__PURE__ */ new Set());
82
+ const lines = parseYamlLines(content);
83
+ const handleCopy = async () => {
84
+ await copyText(content);
85
+ setCopied(true);
86
+ setTimeout(() => setCopied(false), 2e3);
87
+ };
88
+ const toggleCollapse = (lineIdx) => {
89
+ setCollapsed((prev) => {
90
+ const next = new Set(prev);
91
+ if (next.has(lineIdx)) next.delete(lineIdx);
92
+ else next.add(lineIdx);
93
+ return next;
94
+ });
95
+ };
96
+ const getChildRange = (parentIdx) => {
97
+ const parentIndent = lines[parentIdx].indent;
98
+ let end = parentIdx + 1;
99
+ while (end < lines.length) {
100
+ const line = lines[end];
101
+ if (line.raw.trim() === "") {
102
+ end++;
103
+ continue;
104
+ }
105
+ if (line.indent <= parentIndent) break;
106
+ end++;
107
+ }
108
+ return [parentIdx + 1, end];
109
+ };
110
+ const visibleLines = [];
111
+ const hiddenSections = /* @__PURE__ */ new Set();
112
+ for (let idx = 0; idx < lines.length; idx++) {
113
+ if (hiddenSections.has(idx)) continue;
114
+ visibleLines.push(idx);
115
+ if (collapsed.has(idx)) {
116
+ const [start, end] = getChildRange(idx);
117
+ for (let j = start; j < end; j++) hiddenSections.add(j);
118
+ }
119
+ }
120
+ return /* @__PURE__ */ jsxs(
121
+ "div",
122
+ {
123
+ className: cn(
124
+ "my-3 rounded-lg border border-border bg-card overflow-hidden",
125
+ className
126
+ ),
127
+ children: [
128
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-3 py-1.5 border-b border-border/50 bg-muted/30", children: [
129
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-mono font-semibold text-amber-600 dark:text-amber-400", children: "YAML" }),
130
+ /* @__PURE__ */ jsx(Button, { variant: "quiet", icon: copied ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Copy, {}), glyphTone: copied ? "success" : void 0, onClick: handleCopy, "aria-label": "Copy" })
131
+ ] }),
132
+ /* @__PURE__ */ jsx("div", { className: "px-3 py-2 font-mono text-sm leading-relaxed overflow-x-auto", children: visibleLines.map((idx) => {
133
+ const line = lines[idx];
134
+ const trimmed = line.raw.trim();
135
+ if (!trimmed) {
136
+ return /* @__PURE__ */ jsx("div", { className: "h-3" }, idx);
137
+ }
138
+ if (trimmed === "---" || trimmed === "...") {
139
+ return /* @__PURE__ */ jsx(
140
+ "div",
141
+ {
142
+ className: "text-muted-foreground/50",
143
+ style: { paddingLeft: line.indent * 8 },
144
+ children: trimmed
145
+ },
146
+ idx
147
+ );
148
+ }
149
+ if (line.isComment) {
150
+ return /* @__PURE__ */ jsx(
151
+ "div",
152
+ {
153
+ className: "text-muted-foreground italic",
154
+ style: { paddingLeft: line.indent * 8 },
155
+ children: trimmed
156
+ },
157
+ idx
158
+ );
159
+ }
160
+ const hasChildren = line.isSection || line.key && idx + 1 < lines.length && lines[idx + 1].indent > line.indent;
161
+ const isCollapsed = collapsed.has(idx);
162
+ return /* @__PURE__ */ jsxs(
163
+ "div",
164
+ {
165
+ className: "flex items-start group/line hover:bg-muted/30 rounded-sm -mx-1 px-1",
166
+ style: { paddingLeft: line.indent * 8 },
167
+ children: [
168
+ hasChildren ? /* @__PURE__ */ jsx(Button, { variant: "quiet", icon: isCollapsed ? /* @__PURE__ */ jsx(ChevronRight, {}) : /* @__PURE__ */ jsx(ChevronDown, {}), onClick: () => toggleCollapse(idx), "aria-label": isCollapsed ? "Expand" : "Collapse", "aria-expanded": !isCollapsed, className: "mr-1 mt-0.5" }) : /* @__PURE__ */ jsx("span", { className: "w-[18px] flex-shrink-0" }),
169
+ /* @__PURE__ */ jsxs("span", { children: [
170
+ line.isArrayItem && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "- " }),
171
+ line.key && /* @__PURE__ */ jsxs(Fragment, { children: [
172
+ /* @__PURE__ */ jsx("code", { className: "text-blue-600 dark:text-blue-400 font-medium", children: line.key }),
173
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: ":" })
174
+ ] }),
175
+ line.value !== void 0 && /* @__PURE__ */ jsx("span", { className: "ml-1", children: renderValue(line.value) }),
176
+ !line.key && line.value === void 0 && /* @__PURE__ */ jsx("span", { className: "text-foreground", children: trimmed }),
177
+ isCollapsed && /* @__PURE__ */ jsx("span", { className: "ml-2 text-xs text-muted-foreground bg-muted px-1.5 py-0.5 rounded", children: "..." })
178
+ ] })
179
+ ]
180
+ },
181
+ idx
182
+ );
183
+ }) })
184
+ ]
185
+ }
186
+ );
187
+ };
188
+ var YamlBlock_default = YamlBlock;
189
+ export {
190
+ YamlBlock_default as default
191
+ };
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import { type TableRenderDiagnosticContext } from "../blocks/table/TableRenderPathDiagnostic.js";
3
+ import { type ImagePolicyDeclaration } from "../../levels/prose/remote-image-policy.js";
4
+ export interface BasicMarkdownContentProps {
5
+ content: string;
6
+ isStreamActive?: boolean;
7
+ onEditRequest?: () => void;
8
+ messageId?: string;
9
+ showCopyButton?: boolean;
10
+ /** Admin-only table fallback diagnostics (see TableRenderPathDiagnostic). */
11
+ tableRenderDiagnostic?: Omit<TableRenderDiagnosticContext, "renderPath">;
12
+ /**
13
+ * WHO WROTE this text — "ai" | "other" | "self", or "inherit" when rendered
14
+ * inside a surface that already declared. Decides whether remote images load
15
+ * by themselves (components/rich-content/prose/remote-image-policy.tsx).
16
+ */
17
+ imagePolicy?: ImagePolicyDeclaration;
18
+ /**
19
+ * A deliberate source view (documentation, authoring) — text carrying a
20
+ * `__kind` key is drawn as written instead of as its kind. Default false.
21
+ */
22
+ showSource?: boolean;
23
+ }
24
+ /**
25
+ * Text carrying a `__kind` key is handed to the canonical pipeline
26
+ * (`KindTextGate`) — this leaf never draws a kind as a JSON code card.
27
+ */
28
+ export declare const BasicMarkdownContent: React.FC<BasicMarkdownContentProps>;
29
+ export default BasicMarkdownContent;
@@ -0,0 +1,122 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import MarkdownCore from "../../markdown-core/MarkdownCore.js";
4
+ import { useState, useMemo, useEffect } from "react";
5
+ import {
6
+ guardMarkdownDelimiters,
7
+ reportDelimiterViolations
8
+ } from "@ai-matrx/kit/delimiter-guard";
9
+ import { captureError } from "../../host/diagnostics.js";
10
+ import { InlineCopyButton } from "../../host/app-bindings.js";
11
+ import {
12
+ TableRenderPathDiagnostic
13
+ } from "../blocks/table/TableRenderPathDiagnostic.js";
14
+ import {
15
+ detectTextDirection,
16
+ preprocessProse
17
+ } from "../../levels/prose/prose-prepare.js";
18
+ import {
19
+ PROSE_BLOCK_ELEMENTS,
20
+ PROSE_FRAME_CSS,
21
+ proseFrameClass,
22
+ renderProseTable
23
+ } from "../../levels/prose/prose-block-elements.js";
24
+ import { withImagePolicy } from "../../levels/prose/remote-image-policy.js";
25
+ import { KindTextGate } from "./KindTextGate.js";
26
+ import { nonJsonKindsAsCode, spelledKindsAsOneLine } from "@ai-matrx/content-ir/surfaces";
27
+ const BasicMarkdownContent = (props) => /* @__PURE__ */ jsx(
28
+ KindTextGate,
29
+ {
30
+ component: "BasicMarkdownContent",
31
+ content: props.content,
32
+ isStreamActive: props.isStreamActive,
33
+ imagePolicy: props.imagePolicy,
34
+ showSource: props.showSource,
35
+ showCopyButton: props.showCopyButton ?? true,
36
+ children: /* @__PURE__ */ jsx(BasicMarkdownContentBody, { ...props })
37
+ }
38
+ );
39
+ const BasicMarkdownContentBody = ({
40
+ content,
41
+ isStreamActive,
42
+ onEditRequest,
43
+ messageId,
44
+ showCopyButton = true,
45
+ tableRenderDiagnostic,
46
+ imagePolicy
47
+ }) => {
48
+ const [isHovering, setIsHovering] = useState(false);
49
+ const textDirection = useMemo(() => detectTextDirection(content), [content]);
50
+ const { text: processedContent, violations: delimiterViolations } = (
51
+ // The one prose leaf live and reloaded text both pass through: a real JSON
52
+ // kind that broke in prose reads as its one-line label; a non-JSON spelling
53
+ // is drawn exactly as written, as an inline code span (round 10 — detection
54
+ // only; a markdown-escaping pass here hung the renderer on nested escapes).
55
+ guardMarkdownDelimiters(preprocessProse(nonJsonKindsAsCode(spelledKindsAsOneLine(content))))
56
+ );
57
+ const delimiterViolationSignature = delimiterViolations.map((v) => `${v.reason}@${v.index}`).join("|");
58
+ useEffect(() => {
59
+ if (isStreamActive || !delimiterViolationSignature) return;
60
+ reportDelimiterViolations(delimiterViolations, {
61
+ renderPath: "BasicMarkdownContent",
62
+ messageId,
63
+ capture: (input) => captureError({ ...input })
64
+ });
65
+ }, [delimiterViolationSignature, isStreamActive, messageId]);
66
+ const handleEdit = () => {
67
+ onEditRequest?.();
68
+ };
69
+ const handleMouseEnter = !isStreamActive ? () => setIsHovering(true) : void 0;
70
+ const handleMouseLeave = !isStreamActive ? () => setIsHovering(false) : void 0;
71
+ const components = useMemo(
72
+ () => tableRenderDiagnostic ? {
73
+ ...PROSE_BLOCK_ELEMENTS,
74
+ table: (props) => renderProseTable(
75
+ props,
76
+ // HTML tables (parsed by rehypeSafeRawHtml) are correctly
77
+ // rendered here and were never promotion candidates — skip
78
+ // the diagnostic so it only flags genuinely un-promoted
79
+ // markdown pipe tables.
80
+ !props.node?.data?.matrxRawHtmlTable ? /* @__PURE__ */ jsx(
81
+ TableRenderPathDiagnostic,
82
+ {
83
+ context: {
84
+ ...tableRenderDiagnostic,
85
+ renderPath: "BasicMarkdownContent",
86
+ contentPreview: tableRenderDiagnostic.contentPreview ?? content.slice(0, 120).replace(/\n/g, " ")
87
+ }
88
+ }
89
+ ) : null
90
+ )
91
+ } : PROSE_BLOCK_ELEMENTS,
92
+ [tableRenderDiagnostic, content]
93
+ );
94
+ const rendered = /* @__PURE__ */ jsxs(
95
+ "div",
96
+ {
97
+ className: proseFrameClass(textDirection),
98
+ dir: textDirection,
99
+ onMouseEnter: handleMouseEnter,
100
+ onMouseLeave: handleMouseLeave,
101
+ children: [
102
+ /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: PROSE_FRAME_CSS } }),
103
+ /* @__PURE__ */ jsx(MarkdownCore, { preset: "chat", components, children: processedContent }),
104
+ !isStreamActive && isHovering && /* @__PURE__ */ jsx("div", { className: "absolute top-0 right-0 p-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200", children: showCopyButton && /* @__PURE__ */ jsx(
105
+ InlineCopyButton,
106
+ {
107
+ markdownContent: content,
108
+ position: "top-right",
109
+ className: "mt-1 mr-1",
110
+ isMarkdown: true
111
+ }
112
+ ) })
113
+ ]
114
+ }
115
+ );
116
+ return /* @__PURE__ */ jsx(Fragment, { children: withImagePolicy(imagePolicy, rendered) });
117
+ };
118
+ var BasicMarkdownContent_default = BasicMarkdownContent;
119
+ export {
120
+ BasicMarkdownContent,
121
+ BasicMarkdownContent_default as default
122
+ };
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ /**
3
+ * Controls rendering behaviour for the block pipeline.
4
+ *
5
+ * strictServerData — when true, structured blocks (quiz, presentation, table, etc.)
6
+ * will NOT fall back to client-side content parsing when block.serverData is null.
7
+ * Instead they render a visible error panel so you immediately know Python failed to
8
+ * populate the `data` field.
9
+ *
10
+ * Leave false (default) for production — the existing graceful fallback runs.
11
+ * Set to true in any debug/testing UI to catch Python pipeline failures early.
12
+ */
13
+ export interface BlockRenderingConfig {
14
+ strictServerData: boolean;
15
+ }
16
+ export declare const BlockRenderingContext: React.Context<BlockRenderingConfig>;
17
+ export declare const useBlockRenderingConfig: () => BlockRenderingConfig;
18
+ interface BlockRenderingProviderProps {
19
+ children: React.ReactNode;
20
+ strictServerData?: boolean;
21
+ }
22
+ export declare const BlockRenderingProvider: React.FC<BlockRenderingProviderProps>;
23
+ export {};
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { createContext, useContext } from "react";
4
+ const defaultConfig = {
5
+ strictServerData: false
6
+ };
7
+ const BlockRenderingContext = createContext(defaultConfig);
8
+ const useBlockRenderingConfig = () => useContext(BlockRenderingContext);
9
+ const BlockRenderingProvider = ({
10
+ children,
11
+ strictServerData = false
12
+ }) => /* @__PURE__ */ jsx(BlockRenderingContext.Provider, { value: { strictServerData }, children });
13
+ export {
14
+ BlockRenderingContext,
15
+ BlockRenderingProvider,
16
+ useBlockRenderingConfig
17
+ };
@@ -0,0 +1,172 @@
1
+ import React from "react";
2
+ import type { Components } from "react-markdown";
3
+ import { type ImagePolicyDeclaration } from "../../levels/prose/remote-image-policy.js";
4
+ /**
5
+ * Durable markdown <img> — the media-durability fix for the default renderer.
6
+ * On a load failure the file-session cookie is refreshed and the SAME durable
7
+ * URL retried once (useMediaLoadRecovery); a URL that still fails (link rot on a
8
+ * hotlinked card/web image) hides gracefully instead of rendering the
9
+ * broken-image glyph.
10
+ */
11
+ /** A remote image obeys the surrounding policy (remote-image-policy.tsx); our own files always draw. */
12
+ export declare function DurableMarkdownImg(props: React.ComponentProps<"img">): React.JSX.Element;
13
+ export interface MarkdownTypographyConfig {
14
+ /** Font family class applied to paragraphs. Default: "font-sans" */
15
+ fontFamily?: string;
16
+ /** Base font size for LTR text. Default: "text-sm" */
17
+ fontSizeLtr?: string;
18
+ /** Base font size for RTL text (Arabic/Hebrew etc). Default: "text-base" */
19
+ fontSizeRtl?: string;
20
+ /** Letter-spacing class applied to paragraphs. Default: "tracking-wide" */
21
+ tracking?: string;
22
+ /** Line-height class applied to paragraphs/lists. Default: "leading-relaxed" */
23
+ leading?: string;
24
+ }
25
+ export interface MarkdownColorConfig {
26
+ /** Primary accent color (headings, links, code bg tint, etc.). Default: "blue" Tailwind color name */
27
+ accent?: string;
28
+ /** Inline code bg light. Default: "bg-blue-100" */
29
+ codeBgLight?: string;
30
+ /** Inline code text light. Default: "text-blue-800" */
31
+ codeTextLight?: string;
32
+ /** Inline code bg dark. Default: "dark:bg-blue-900/30" */
33
+ codeBgDark?: string;
34
+ /** Inline code text dark. Default: "dark:text-blue-300" */
35
+ codeTextDark?: string;
36
+ /** Blockquote border light. Default: "border-blue-200" */
37
+ blockquoteBorderLight?: string;
38
+ /** Blockquote border dark. Default: "dark:border-blue-700" */
39
+ blockquoteBorderDark?: string;
40
+ /** Blockquote bg light. Default: "bg-blue-50" */
41
+ blockquoteBgLight?: string;
42
+ /** Blockquote bg dark. Default: "dark:bg-blue-950/20" */
43
+ blockquoteBgDark?: string;
44
+ /** Blockquote text light. Default: "text-gray-700" */
45
+ blockquoteTextLight?: string;
46
+ /** Blockquote text dark. Default: "dark:text-gray-300" */
47
+ blockquoteTextDark?: string;
48
+ /** Italic (em) color outside headings, light. Default: "text-blue-600" */
49
+ emColorLight?: string;
50
+ /** Italic (em) color outside headings, dark. Default: "dark:text-blue-400" */
51
+ emColorDark?: string;
52
+ /** Heading color class. Default: "text-blue-500" */
53
+ headingColor?: string;
54
+ /** HR border light. Default: "border-gray-300" */
55
+ hrBorderLight?: string;
56
+ /** HR border dark. Default: "dark:border-gray-600" */
57
+ hrBorderDark?: string;
58
+ /** Checkbox border light. Default: "border-blue-400" */
59
+ checkboxBorderLight?: string;
60
+ /** Checkbox checked bg light. Default: "bg-blue-600" */
61
+ checkboxCheckedBgLight?: string;
62
+ /** Edit button text color. Default: "text-gray-500" */
63
+ editButtonColor?: string;
64
+ /** Edit button hover color. Default: "hover:text-gray-700" */
65
+ editButtonHoverColor?: string;
66
+ }
67
+ export interface MarkdownSpacingConfig {
68
+ /** Margin bottom for paragraphs. Default: "mb-2" */
69
+ paragraphMb?: string;
70
+ /** Margin bottom for lists. Default: "mb-3" */
71
+ listMb?: string;
72
+ /** Left/right padding for lists. Default: "pl-6" */
73
+ listPl?: string;
74
+ /** Margin bottom for list items. Default: "mb-1" */
75
+ listItemMb?: string;
76
+ /** Blockquote padding horizontal (LTR). Default: "pl-4" */
77
+ blockquotePl?: string;
78
+ /** Blockquote padding horizontal (RTL). Default: "pr-4" */
79
+ blockquotePr?: string;
80
+ /** Blockquote padding vertical. Default: "py-3" */
81
+ blockquotePy?: string;
82
+ /** Pre/code block vertical margin. Default: "my-3" */
83
+ preMy?: string;
84
+ /** Image vertical margin. Default: "my-4" */
85
+ imgMy?: string;
86
+ /** HR vertical margin. Default: "my-3" */
87
+ hrMy?: string;
88
+ /** Math-only paragraph margin bottom. Default: "mb-4" */
89
+ mathParagraphMb?: string;
90
+ /** Blank-line spacer height. Default: "h-[0.75em]" */
91
+ blankLineHeight?: string;
92
+ /** Wrapper top/bottom margin. Default: "my-2" */
93
+ wrapperMy?: string;
94
+ }
95
+ export interface MarkdownHeadingConfig {
96
+ h1?: string;
97
+ h2?: string;
98
+ h3?: string;
99
+ h4?: string;
100
+ }
101
+ export interface MarkdownComponentOverrides {
102
+ /** Fully replace the `<a>` renderer. Receives { node, href, children, ...props } */
103
+ a?: Components["a"];
104
+ /** Fully replace the `<p>` renderer */
105
+ p?: Components["p"];
106
+ /** Fully replace the `<strong>` renderer */
107
+ strong?: Components["strong"];
108
+ /** Fully replace the `<em>` renderer */
109
+ em?: Components["em"];
110
+ /** Fully replace the `<blockquote>` renderer */
111
+ blockquote?: Components["blockquote"];
112
+ /** Fully replace the `<ul>` renderer */
113
+ ul?: Components["ul"];
114
+ /** Fully replace the `<ol>` renderer */
115
+ ol?: Components["ol"];
116
+ /** Fully replace the `<li>` renderer */
117
+ li?: Components["li"];
118
+ /** Fully replace the `<h1>` renderer */
119
+ h1?: Components["h1"];
120
+ /** Fully replace the `<h2>` renderer */
121
+ h2?: Components["h2"];
122
+ /** Fully replace the `<h3>` renderer */
123
+ h3?: Components["h3"];
124
+ /** Fully replace the `<h4>` renderer */
125
+ h4?: Components["h4"];
126
+ /** Fully replace the `<code>` renderer */
127
+ code?: Components["code"];
128
+ /** Fully replace the `<pre>` renderer */
129
+ pre?: Components["pre"];
130
+ /** Fully replace the `<img>` renderer */
131
+ img?: Components["img"];
132
+ /** Fully replace the `<hr>` renderer */
133
+ hr?: Components["hr"];
134
+ /** Fully replace the `<table>` renderer (default: hidden) */
135
+ table?: Components["table"];
136
+ }
137
+ export interface MarkdownStyleConfig {
138
+ typography?: MarkdownTypographyConfig;
139
+ colors?: MarkdownColorConfig;
140
+ spacing?: MarkdownSpacingConfig;
141
+ headings?: MarkdownHeadingConfig;
142
+ /** Arbitrary extra classes appended to the outer wrapper div */
143
+ wrapperClassName?: string;
144
+ }
145
+ export interface ConfigurableMarkdownContentProps {
146
+ content: string;
147
+ isStreamActive?: boolean;
148
+ onEditRequest?: () => void;
149
+ messageId?: string;
150
+ showCopyButton?: boolean;
151
+ /** Style/theme overrides. Anything not provided falls back to defaults. */
152
+ styleConfig?: MarkdownStyleConfig;
153
+ /** Per-element renderer overrides. Fully replaces the built-in renderer for that element. */
154
+ componentOverrides?: MarkdownComponentOverrides;
155
+ /**
156
+ * WHO WROTE this text — "ai" | "other" | "self", or "inherit" when rendered
157
+ * inside a surface that already declared. Decides whether remote images load
158
+ * by themselves (components/rich-content/prose/remote-image-policy.tsx).
159
+ */
160
+ imagePolicy?: ImagePolicyDeclaration;
161
+ /**
162
+ * A deliberate source view — text carrying a `__kind` key is drawn as
163
+ * written instead of as its kind. Default false.
164
+ */
165
+ showSource?: boolean;
166
+ }
167
+ /**
168
+ * Text carrying a `__kind` key is handed to the canonical pipeline
169
+ * (`KindTextGate`) — this leaf never draws a kind as a JSON code card.
170
+ */
171
+ export declare const ConfigurableMarkdownContent: React.FC<ConfigurableMarkdownContentProps>;
172
+ export default ConfigurableMarkdownContent;