@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
@@ -1,4 +1,4 @@
1
1
  export declare function ErrorAlchemyMenu({ error }: {
2
- error: unknown;
2
+ error?: unknown;
3
3
  }): import("react").JSX.Element | null;
4
4
  export { ErrorAlchemyMenu as ErrorActions };
@@ -0,0 +1,10 @@
1
+ /** The host's error notice (matrx-frontend: components/errors/ErrorNotice); a bordered message on a bare host. */
2
+ import type { ReactNode } from "react";
3
+ export declare function ErrorNotice(props: {
4
+ message?: ReactNode;
5
+ error?: unknown;
6
+ title?: string;
7
+ className?: string;
8
+ size?: string;
9
+ children?: ReactNode;
10
+ }): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { BARE_HOST_ATTR, hostCapability } from "./registry.js";
4
+ function ErrorNotice(props) {
5
+ const Impl = hostCapability("ErrorNotice");
6
+ if (Impl) return /* @__PURE__ */ jsx(Impl, { ...props, error: props.error ?? props.message });
7
+ const text = props.message ?? (props.error instanceof Error ? props.error.message : props.error ? String(props.error) : null);
8
+ return /* @__PURE__ */ jsxs("span", { ...BARE_HOST_ATTR, role: "alert", className: `rounded border border-destructive/40 px-2 py-1 text-xs text-destructive ${props.className ?? ""}`, children: [
9
+ props.title ? /* @__PURE__ */ jsxs("strong", { children: [
10
+ props.title,
11
+ ": "
12
+ ] }) : null,
13
+ text,
14
+ props.children
15
+ ] });
16
+ }
17
+ export {
18
+ ErrorNotice
19
+ };
@@ -0,0 +1,155 @@
1
+ /**
2
+ * APP BINDINGS — the host's own windows, records, canvas, menus and kind views that the engine's
3
+ * blocks offer when a host has them. Each export keeps the name the engine code used when it
4
+ * lived in matrx-frontend, so call sites read the same; each one delegates to
5
+ * `configureRichContent({ app: { … } })` and falls back to an honest default (absent control,
6
+ * plain rendering, announced once) on a bare host.
7
+ *
8
+ * Typing debt (recorded in FEATURE.md): these host callables are typed loosely (`HostFn`,
9
+ * `HostComponent`) because their real signatures live in the host app. Tighten each one when it
10
+ * gets a package-owned contract.
11
+ */
12
+ import { type ComponentType } from "react";
13
+ export type HostFn = (...args: any[]) => any;
14
+ export type HostComponent = ComponentType<any>;
15
+ /** Every binding a host may supply (all optional). */
16
+ export interface RichContentAppBindings {
17
+ useCanvas: HostFn;
18
+ useCanvasOpenGuard: HostFn;
19
+ useOpenArtifactInCanvas: HostFn;
20
+ reportCanvasOpenDrop: HostFn;
21
+ getArtifactDef: HostFn;
22
+ resolveArtifactDef: HostFn;
23
+ hasArtifactRenderer: HostFn;
24
+ ArtifactRender: HostComponent;
25
+ CodeBlockWithContextAttach: HostComponent;
26
+ useOpenConvertToShapeWindow: HostFn;
27
+ useOpenSmartCodeEditorWindow: HostFn;
28
+ useOpenTableViewerWindow: HostFn;
29
+ useSaveAndOpenInCodeEditor: HostFn;
30
+ useOpenOverlay: HostFn;
31
+ useThemeMode: HostFn;
32
+ useHostUser: HostFn;
33
+ useIsAdminDebugger: HostFn;
34
+ useIsAuthenticated: HostFn;
35
+ useMermaidPreferences: HostFn;
36
+ useSetMermaidPreferences: HostFn;
37
+ useImageKnob: HostFn;
38
+ imageKnobPrincipals: HostFn;
39
+ setImageKnobMapEntry: HostFn;
40
+ StructuredValueView: HostComponent;
41
+ KindDataGate: HostComponent;
42
+ KindValueFrontDoor: HostComponent;
43
+ KindInstanceRender: HostComponent;
44
+ KindRecordChrome: HostComponent;
45
+ kindHasRecordChrome: HostFn;
46
+ KindFixItBar: HostComponent;
47
+ MarkdownStream: HostComponent;
48
+ CitationMarkerInline: HostComponent;
49
+ InlineCopyButton: HostComponent;
50
+ AdvancedMenu: HostComponent;
51
+ useAdvancedMenu: HostFn;
52
+ EntityRef: HostComponent;
53
+ JsonTreeViewer: HostComponent;
54
+ RawJsonExplorer: HostComponent;
55
+ NonEditableContextMenu: HostComponent;
56
+ IconInputWithValidation: HostComponent;
57
+ LocatedTableViewer: HostComponent;
58
+ OpenDestinationDialog: HostComponent;
59
+ HTMLPageService: unknown;
60
+ ensureOrganizationContext: HostFn;
61
+ isOrganizationSelectionCancelled: HostFn;
62
+ loadExportTargets: HostFn;
63
+ loadSendToGoogle: HostFn;
64
+ announceProposedGoogleWrite: HostFn;
65
+ isProposedGoogleWrite: HostFn;
66
+ codeEditorAgents: unknown;
67
+ mermaidEditorManifest: unknown;
68
+ createMermaidEditorScope: HostFn;
69
+ useDiagramAgents: HostFn;
70
+ useHideReasoning: HostFn;
71
+ useHideToolResults: HostFn;
72
+ useMachineFramesVisible: HostFn;
73
+ }
74
+ /** A block menu row (matrx-frontend components/official/AdvancedMenu `MenuItem`). */
75
+ export interface MenuItem {
76
+ key: string;
77
+ icon: ComponentType<{
78
+ className?: string;
79
+ }>;
80
+ iconColor?: string;
81
+ label: string;
82
+ description?: string;
83
+ action: () => void | Promise<void>;
84
+ category?: string;
85
+ disabled?: boolean;
86
+ hidden?: boolean;
87
+ children?: MenuItem[];
88
+ [extra: string]: unknown;
89
+ }
90
+ /** The full renderer's props (matrx-frontend components/MarkdownStream `MarkdownStreamProps`), as the engine passes them. */
91
+ export interface MarkdownStreamProps {
92
+ content?: string;
93
+ className?: string;
94
+ isStreamActive?: boolean;
95
+ onContentChange?: (newContent: string, previousContent?: string) => void;
96
+ hideCopyButton?: boolean;
97
+ allowFullScreenEditor?: boolean;
98
+ [extra: string]: unknown;
99
+ }
100
+ export declare const useCanvas: HostFn;
101
+ export declare const useCanvasOpenGuard: HostFn;
102
+ export declare const useOpenArtifactInCanvas: HostFn;
103
+ export declare const reportCanvasOpenDrop: HostFn;
104
+ export declare const getArtifactDef: HostFn;
105
+ export declare const resolveArtifactDef: HostFn;
106
+ export declare const hasArtifactRenderer: HostFn;
107
+ export declare const ArtifactRender: HostComponent;
108
+ export declare const CodeBlockWithContextAttach: HostComponent;
109
+ export declare const useOpenConvertToShapeWindow: HostFn;
110
+ export declare const useOpenSmartCodeEditorWindow: HostFn;
111
+ export declare const useOpenTableViewerWindow: HostFn;
112
+ export declare const useSaveAndOpenInCodeEditor: HostFn;
113
+ export declare const useOpenOverlay: HostFn;
114
+ export declare const useThemeMode: HostFn;
115
+ export declare const useHostUser: HostFn;
116
+ export declare const useIsAdminDebugger: HostFn;
117
+ export declare const useIsAuthenticated: HostFn;
118
+ export declare const useMermaidPreferences: HostFn;
119
+ export declare const useSetMermaidPreferences: HostFn;
120
+ export declare const useImageKnob: HostFn;
121
+ export declare const imageKnobPrincipals: HostFn;
122
+ export declare const setImageKnobMapEntry: HostFn;
123
+ export declare const StructuredValueView: HostComponent;
124
+ export declare const KindDataGate: HostComponent;
125
+ export declare const KindValueFrontDoor: HostComponent;
126
+ export declare const KindInstanceRender: HostComponent;
127
+ export declare const KindRecordChrome: HostComponent;
128
+ export declare const kindHasRecordChrome: HostFn;
129
+ export declare const KindFixItBar: HostComponent;
130
+ export declare const MarkdownStream: HostComponent;
131
+ export declare const CitationMarkerInline: HostComponent;
132
+ export declare const InlineCopyButton: HostComponent;
133
+ export declare const AdvancedMenu: HostComponent;
134
+ export declare const useAdvancedMenu: HostFn;
135
+ export declare const EntityRef: HostComponent;
136
+ export declare const JsonTreeViewer: HostComponent;
137
+ export declare const RawJsonExplorer: HostComponent;
138
+ export declare const NonEditableContextMenu: HostComponent;
139
+ export declare const IconInputWithValidation: HostComponent;
140
+ export declare const LocatedTableViewer: HostComponent;
141
+ export declare const OpenDestinationDialog: HostComponent;
142
+ export declare function hostHtmlPageService(): unknown;
143
+ export declare const ensureOrganizationContext: HostFn;
144
+ export declare const isOrganizationSelectionCancelled: HostFn;
145
+ export declare const loadExportTargets: HostFn;
146
+ export declare const loadSendToGoogle: HostFn;
147
+ export declare const announceProposedGoogleWrite: HostFn;
148
+ export declare const isProposedGoogleWrite: HostFn;
149
+ export declare function hostCodeEditorAgents(): Record<string, unknown>;
150
+ export declare function hostMermaidEditorManifest(): unknown;
151
+ export declare const useDiagramAgents: HostFn;
152
+ export declare const createMermaidEditorScope: HostFn;
153
+ export declare const useHideReasoning: HostFn;
154
+ export declare const useHideToolResults: HostFn;
155
+ export declare const useMachineFramesVisible: HostFn;
@@ -0,0 +1,160 @@
1
+ "use client";
2
+ import { createElement } from "react";
3
+ import { GenericStructuredView } from "@ai-matrx/content-ir-react";
4
+ import { announceBareHost, BARE_HOST_ATTR, hostCapability } from "./registry.js";
5
+ function binding(key) {
6
+ return hostCapability("app")?.[key];
7
+ }
8
+ function fn(key, fallback, degraded) {
9
+ return (...args) => {
10
+ const impl = binding(key);
11
+ if (impl) return impl(...args);
12
+ announceBareHost(`app.${String(key)}`, degraded);
13
+ return fallback(...args);
14
+ };
15
+ }
16
+ function component(key, Fallback, degraded) {
17
+ function HostBound(props) {
18
+ const Impl = binding(key);
19
+ if (Impl) return createElement(Impl, props);
20
+ announceBareHost(`app.${String(key)}`, degraded);
21
+ return Fallback ? createElement(Fallback, props) : null;
22
+ }
23
+ HostBound.displayName = `HostBound(${String(key)})`;
24
+ return HostBound;
25
+ }
26
+ const nothing = () => null;
27
+ const noop = () => {
28
+ };
29
+ const prefersDark = () => typeof window !== "undefined" && window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
30
+ function ValueFloor(props) {
31
+ const value = props.value ?? props.data;
32
+ if (value === void 0) return createElement("div", BARE_HOST_ATTR, props.children ?? null);
33
+ return createElement("div", BARE_HOST_ATTR, createElement(GenericStructuredView, { value, kind: props.kind ?? void 0 }));
34
+ }
35
+ function Passthrough(props) {
36
+ return createElement("div", BARE_HOST_ATTR, props.children ?? null);
37
+ }
38
+ function TextOnly(props) {
39
+ return createElement("span", BARE_HOST_ATTR, props.label ?? props.children ?? props.id ?? null);
40
+ }
41
+ const useCanvas = fn("useCanvas", () => ({ open: () => false, close: noop, clear: noop, update: noop, isCanvasAvailable: false }), "nothing opens in a canvas");
42
+ const useCanvasOpenGuard = fn("useCanvasOpenGuard", () => ({ isCanvasAvailable: false, ensureCanvasReachable: () => false }), "nothing opens in a canvas");
43
+ const useOpenArtifactInCanvas = fn("useOpenArtifactInCanvas", () => ({ openArtifact: async () => false, busy: false, lastResult: null }), "nothing opens in a canvas");
44
+ const reportCanvasOpenDrop = fn("reportCanvasOpenDrop", () => false, "canvas drops are not reported");
45
+ const getArtifactDef = fn("getArtifactDef", nothing, "no artifact types are known");
46
+ const resolveArtifactDef = fn("resolveArtifactDef", nothing, "no artifact types are known");
47
+ const hasArtifactRenderer = fn("hasArtifactRenderer", () => false, "no artifact renderers are known");
48
+ const ArtifactRender = component("ArtifactRender", ValueFloor, "artifacts render through the generic structured view");
49
+ const CodeBlockWithContextAttach = component("CodeBlockWithContextAttach", null, "code blocks render without the attach-to-context action");
50
+ const useOpenConvertToShapeWindow = fn("useOpenConvertToShapeWindow", nothing, "no convert-to-shape window");
51
+ const useOpenSmartCodeEditorWindow = fn("useOpenSmartCodeEditorWindow", nothing, "no code editor window");
52
+ const useOpenTableViewerWindow = fn("useOpenTableViewerWindow", nothing, "no table viewer window");
53
+ const useSaveAndOpenInCodeEditor = fn("useSaveAndOpenInCodeEditor", nothing, "code cannot be saved to files");
54
+ const useOpenOverlay = fn("useOpenOverlay", () => noop, "no overlays open");
55
+ const useThemeMode = fn("useThemeMode", prefersDark, "theme follows prefers-color-scheme");
56
+ const useHostUser = fn("useHostUser", nothing, "no signed-in user is known");
57
+ const useIsAdminDebugger = fn("useIsAdminDebugger", () => false, "admin diagnostics are off");
58
+ const useIsAuthenticated = fn("useIsAuthenticated", () => false, "the viewer is treated as signed out");
59
+ const useMermaidPreferences = fn("useMermaidPreferences", () => ({}), "mermaid uses default preferences");
60
+ const useSetMermaidPreferences = fn("useSetMermaidPreferences", () => noop, "mermaid preferences are not saved");
61
+ const useImageKnob = fn("useImageKnob", () => void 0, "remote images follow the default policy");
62
+ const imageKnobPrincipals = fn("imageKnobPrincipals", () => ({ organizationId: null, userId: null }), "no one can trust an image host");
63
+ const setImageKnobMapEntry = fn("setImageKnobMapEntry", async () => ({ ok: false, reason: "This app does not save image preferences." }), "image preferences are not saved");
64
+ const StructuredValueView = component("StructuredValueView", ValueFloor, "values render through the generic structured view");
65
+ const KindDataGate = component("KindDataGate", Passthrough, "kind data shows as written");
66
+ const KindValueFrontDoor = component("KindValueFrontDoor", ValueFloor, "kind values render through the generic structured view");
67
+ const KindInstanceRender = component("KindInstanceRender", ValueFloor, "kind instances render through the generic structured view");
68
+ const KindRecordChrome = component("KindRecordChrome", Passthrough, "kind records show without record chrome");
69
+ const kindHasRecordChrome = fn("kindHasRecordChrome", () => false, "kind records show without record chrome");
70
+ const KindFixItBar = component("KindFixItBar", null, "no fix-it bar on broken kinds");
71
+ const MarkdownStream = component("MarkdownStream", null, "the full renderer is not registered");
72
+ const CitationMarkerInline = component("CitationMarkerInline", TextOnly, "citation markers show as text");
73
+ const InlineCopyButton = component("InlineCopyButton", null, "no inline copy button");
74
+ const AdvancedMenu = component("AdvancedMenu", null, "no block menus");
75
+ const useAdvancedMenu = fn("useAdvancedMenu", () => ({ isOpen: false, open: noop, close: noop, toggle: noop, menuProps: {} }), "no block menus");
76
+ const EntityRef = component("EntityRef", TextOnly, "record references show as text");
77
+ const JsonTreeViewer = component("JsonTreeViewer", ValueFloor, "JSON renders through the generic structured view");
78
+ const RawJsonExplorer = component("RawJsonExplorer", ValueFloor, "JSON renders through the generic structured view");
79
+ const NonEditableContextMenu = component("NonEditableContextMenu", Passthrough, "no context menu");
80
+ const IconInputWithValidation = component("IconInputWithValidation", null, "no icon picker");
81
+ const LocatedTableViewer = component("LocatedTableViewer", null, "no table viewer");
82
+ const OpenDestinationDialog = component("OpenDestinationDialog", null, "no destination dialog");
83
+ function hostHtmlPageService() {
84
+ return binding("HTMLPageService") ?? null;
85
+ }
86
+ const ensureOrganizationContext = fn("ensureOrganizationContext", async () => null, "no organization can be chosen");
87
+ const isOrganizationSelectionCancelled = fn("isOrganizationSelectionCancelled", () => false, "no organization can be chosen");
88
+ const loadExportTargets = fn("loadExportTargets", async () => null, "no workbook export");
89
+ const loadSendToGoogle = fn("loadSendToGoogle", async () => null, "no Google Sheets export");
90
+ const announceProposedGoogleWrite = fn("announceProposedGoogleWrite", noop, "no Google Sheets export");
91
+ const isProposedGoogleWrite = fn("isProposedGoogleWrite", () => false, "no Google Sheets export");
92
+ function hostCodeEditorAgents() {
93
+ return binding("codeEditorAgents") ?? {};
94
+ }
95
+ function hostMermaidEditorManifest() {
96
+ return binding("mermaidEditorManifest") ?? null;
97
+ }
98
+ const useDiagramAgents = fn("useDiagramAgents", () => [], "no AI actions on diagrams");
99
+ const createMermaidEditorScope = fn("createMermaidEditorScope", nothing, "no AI actions on diagrams");
100
+ const useHideReasoning = fn("useHideReasoning", () => false, "reasoning is shown");
101
+ const useHideToolResults = fn("useHideToolResults", () => false, "tool results are shown");
102
+ const useMachineFramesVisible = fn("useMachineFramesVisible", () => false, "machine frames are hidden");
103
+ export {
104
+ AdvancedMenu,
105
+ ArtifactRender,
106
+ CitationMarkerInline,
107
+ CodeBlockWithContextAttach,
108
+ EntityRef,
109
+ IconInputWithValidation,
110
+ InlineCopyButton,
111
+ JsonTreeViewer,
112
+ KindDataGate,
113
+ KindFixItBar,
114
+ KindInstanceRender,
115
+ KindRecordChrome,
116
+ KindValueFrontDoor,
117
+ LocatedTableViewer,
118
+ MarkdownStream,
119
+ NonEditableContextMenu,
120
+ OpenDestinationDialog,
121
+ RawJsonExplorer,
122
+ StructuredValueView,
123
+ announceProposedGoogleWrite,
124
+ createMermaidEditorScope,
125
+ ensureOrganizationContext,
126
+ getArtifactDef,
127
+ hasArtifactRenderer,
128
+ hostCodeEditorAgents,
129
+ hostHtmlPageService,
130
+ hostMermaidEditorManifest,
131
+ imageKnobPrincipals,
132
+ isOrganizationSelectionCancelled,
133
+ isProposedGoogleWrite,
134
+ kindHasRecordChrome,
135
+ loadExportTargets,
136
+ loadSendToGoogle,
137
+ reportCanvasOpenDrop,
138
+ resolveArtifactDef,
139
+ setImageKnobMapEntry,
140
+ useAdvancedMenu,
141
+ useCanvas,
142
+ useCanvasOpenGuard,
143
+ useDiagramAgents,
144
+ useHideReasoning,
145
+ useHideToolResults,
146
+ useHostUser,
147
+ useImageKnob,
148
+ useIsAdminDebugger,
149
+ useIsAuthenticated,
150
+ useMachineFramesVisible,
151
+ useMermaidPreferences,
152
+ useOpenArtifactInCanvas,
153
+ useOpenConvertToShapeWindow,
154
+ useOpenOverlay,
155
+ useOpenSmartCodeEditorWindow,
156
+ useOpenTableViewerWindow,
157
+ useSaveAndOpenInCodeEditor,
158
+ useSetMermaidPreferences,
159
+ useThemeMode
160
+ };
@@ -1,2 +1,2 @@
1
- import type { RichContentErrorReport } from "./types.js";
2
- export declare function captureError(report: RichContentErrorReport): void;
1
+ import type { RichContentErrorInput } from "./types.js";
2
+ export declare function captureError(input: RichContentErrorInput): void;
@@ -1,5 +1,6 @@
1
1
  import { hostCapability } from "./registry.js";
2
- function captureError(report) {
2
+ function captureError(input) {
3
+ const report = { source: "rich-content", message: "", ...input };
3
4
  const sink = hostCapability("captureError");
4
5
  if (sink) {
5
6
  try {
@@ -1,6 +1 @@
1
- export declare function useOpenSaveToTable(): ((options: {
2
- grid: {
3
- headers: string[];
4
- rows: string[][];
5
- };
6
- }) => unknown) | null;
1
+ export declare function useOpenSaveToTable(): ((options: Record<string, unknown>) => unknown) | null;
@@ -59,6 +59,12 @@ export interface RichContentErrorReport {
59
59
  message: string;
60
60
  [field: string]: unknown;
61
61
  }
62
+ /** Anything an engine module reports (a delimiter-guard capture, a kind incident, …). */
63
+ export type RichContentErrorInput = {
64
+ source?: string;
65
+ message?: string;
66
+ [field: string]: unknown;
67
+ };
62
68
  /** A wikilink target resolved against the host's records. */
63
69
  export type WikiResolution = {
64
70
  status: "found";
@@ -107,6 +113,8 @@ export interface RichContentSplitterEnvelopes {
107
113
  xmlRegion(tag: string, regionText: string): unknown;
108
114
  }
109
115
  export interface RichContentHost {
116
+ /** The host's windows, canvas, menus, kind views and services (`host/app-bindings`). Each has an announced default. */
117
+ app: Partial<import("./app-bindings.js").RichContentAppBindings>;
110
118
  /** User-visible notices. Default: the console (announced). */
111
119
  toast: RichContentToast;
112
120
  /** The Error Inspector sink. Default: `console.error`. */
@@ -121,7 +129,7 @@ export interface RichContentHost {
121
129
  }>;
122
130
  /** Extra actions beside an error message (matrx-frontend: the Alchemy error menu). Default: none — the message itself always shows. */
123
131
  ErrorActions: ComponentType<{
124
- error: unknown;
132
+ error?: unknown;
125
133
  }>;
126
134
  /** Renders nested markdown at the `standard` level, one depth deeper. Default: the source as plain text. */
127
135
  NestedContent: ComponentType<{
@@ -140,12 +148,11 @@ export interface RichContentHost {
140
148
  /** The splitter's kind-envelope hooks. Default: no envelopes (regions carry no `metadata.__ir`). */
141
149
  splitterEnvelopes: RichContentSplitterEnvelopes;
142
150
  /** A hook returning the host's "save these rows as a table" opener, or null. Default: no opener (the button is absent). */
143
- useOpenSaveToTable: () => ((options: {
144
- grid: {
145
- headers: string[];
146
- rows: string[][];
147
- };
148
- }) => unknown) | null;
151
+ useOpenSaveToTable: () => ((options: Record<string, unknown>) => unknown) | null;
152
+ /** Loads mermaid (`() => import("mermaid").then((m) => m.default)`). Default: none — diagrams show their source. */
153
+ loadMermaid: () => Promise<unknown>;
154
+ /** Loads the ELK layout loaders (`() => import("@mermaid-js/layout-elk").then((m) => m.default)`). Default: dagre only. */
155
+ loadMermaidElk: () => Promise<unknown>;
149
156
  /** The kind registry. Default: no kinds known (kind JSON renders through the generic structured floor). */
150
157
  kindRegistry: RichContentKindRegistry;
151
158
  /** The (kind, platform, role) component resolver. Default: a resolver with no rows. */
@@ -0,0 +1,3 @@
1
+ import type { RichContentProps } from "./rich-content-types.js";
2
+ export declare function RichContent({ source, level, isStreaming, className, depthCap, variant, links, headingAnchors, imagePolicy, gfmCell, onContentChange, applyLocalEdits, analysisData, messageId, conversationId, allowFullScreenEditor, hideCopyButton, }: RichContentProps): import("react").JSX.Element;
3
+ export default RichContent;
@@ -0,0 +1,102 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { clientLazy } from "../utils/client-lazy.js";
4
+ import { MarkdownStream } from "../host/app-bindings.js";
5
+ import { RichContentDepthProvider } from "./depth.js";
6
+ import { HeadingAnchorsProvider } from "../markdown-core/heading-anchors-context.js";
7
+ import { RichContentInline } from "./RichContentInline.js";
8
+ import { RichContentVariantRoot } from "./prose/variant-root.js";
9
+ const RichContentStandardImpl = clientLazy(
10
+ () => import("./RichContentStandardImpl.js"),
11
+ { loading: () => null }
12
+ );
13
+ function RichContent({
14
+ source,
15
+ level,
16
+ isStreaming,
17
+ className,
18
+ depthCap,
19
+ variant,
20
+ links,
21
+ headingAnchors = true,
22
+ imagePolicy,
23
+ gfmCell,
24
+ onContentChange,
25
+ applyLocalEdits,
26
+ analysisData,
27
+ messageId,
28
+ conversationId,
29
+ allowFullScreenEditor,
30
+ hideCopyButton
31
+ }) {
32
+ if (level === "inline") {
33
+ return /* @__PURE__ */ jsx(
34
+ RichContentInline,
35
+ {
36
+ source,
37
+ className,
38
+ links,
39
+ streaming: isStreaming,
40
+ imagePolicy,
41
+ gfmCell
42
+ }
43
+ );
44
+ }
45
+ if (!headingAnchors) {
46
+ return /* @__PURE__ */ jsx(HeadingAnchorsProvider, { value: false, children: /* @__PURE__ */ jsx(
47
+ RichContent,
48
+ {
49
+ source,
50
+ level,
51
+ isStreaming,
52
+ className,
53
+ depthCap,
54
+ variant,
55
+ imagePolicy,
56
+ onContentChange,
57
+ applyLocalEdits,
58
+ analysisData,
59
+ messageId,
60
+ conversationId,
61
+ allowFullScreenEditor,
62
+ hideCopyButton
63
+ }
64
+ ) });
65
+ }
66
+ if (level === "standard") {
67
+ return /* @__PURE__ */ jsx(
68
+ RichContentStandardImpl,
69
+ {
70
+ source,
71
+ isStreaming,
72
+ className,
73
+ depthCap,
74
+ variant,
75
+ imagePolicy
76
+ }
77
+ );
78
+ }
79
+ const full = /* @__PURE__ */ jsx(
80
+ MarkdownStream,
81
+ {
82
+ imagePolicy,
83
+ content: source,
84
+ isStreamActive: isStreaming,
85
+ className,
86
+ onContentChange,
87
+ applyLocalEdits,
88
+ analysisData,
89
+ messageId,
90
+ conversationId,
91
+ allowFullScreenEditor,
92
+ hideCopyButton
93
+ }
94
+ );
95
+ const rendered = /* @__PURE__ */ jsx(RichContentVariantRoot, { variant, children: depthCap === void 0 ? full : /* @__PURE__ */ jsx(RichContentDepthProvider, { depth: 0, cap: depthCap, children: full }) });
96
+ return rendered;
97
+ }
98
+ var RichContent_default = RichContent;
99
+ export {
100
+ RichContent,
101
+ RichContent_default as default
102
+ };
@@ -0,0 +1,28 @@
1
+ import { INLINE_LEVEL_ELEMENTS, type InlineLinks } from "./prose/inline-level-elements.js";
2
+ import { type ImagePolicyDeclaration } from "./prose/remote-image-policy.js";
3
+ export { INLINE_LEVEL_ELEMENTS };
4
+ export interface RichContentInlineProps {
5
+ source: string;
6
+ className?: string;
7
+ /** `text` inside a link (card previews): formatting kept, no nested anchor. */
8
+ links?: InlineLinks;
9
+ /**
10
+ * The source is still arriving (a table cell of a streaming row): the core
11
+ * heals half-arrived links, emphasis, code and math. Omit to inherit from a
12
+ * live MarkdownStreamingProvider; `false` for text that is already whole.
13
+ */
14
+ streaming?: boolean;
15
+ /**
16
+ * Who wrote this text — decides whether remote images load by themselves
17
+ * (remote-image-policy.tsx). Omit to inherit the surrounding declaration;
18
+ * with none anywhere, remote images wait for a click.
19
+ */
20
+ imagePolicy?: ImagePolicyDeclaration;
21
+ /**
22
+ * The source is ONE GFM table cell: inline constructs only (block syntax is
23
+ * text, as GFM reads a cell) and `\|` shows as `|`. verify-RC-B4 R6-1.
24
+ */
25
+ gfmCell?: boolean;
26
+ }
27
+ export declare function RichContentInline({ source, className, links, streaming, imagePolicy, gfmCell, }: RichContentInlineProps): import("react").JSX.Element | null;
28
+ export default RichContentInline;
@@ -0,0 +1,61 @@
1
+ "use client";
2
+ import { Fragment, jsx } from "react/jsx-runtime";
3
+ import { useEffect } from "react";
4
+ import MarkdownCore from "../markdown-core/MarkdownCore.js";
5
+ import {
6
+ guardMarkdownDelimiters,
7
+ reportDelimiterViolations
8
+ } from "@ai-matrx/kit/delimiter-guard";
9
+ import { captureError } from "../host/diagnostics.js";
10
+ import { cn } from "@ai-matrx/design-system";
11
+ import { preprocessCellProse, preprocessProse } from "./prose/prose-prepare.js";
12
+ import { unescapeCellPipes } from "../markdown-core/syntax/gfm-cell-pipes.js";
13
+ import {
14
+ INLINE_LEVEL_ELEMENTS,
15
+ INLINE_LEVEL_WRAPPER_CLASS,
16
+ inlineLevelElements
17
+ } from "./prose/inline-level-elements.js";
18
+ import { withImagePolicy } from "./prose/remote-image-policy.js";
19
+ import { inlineKindText, nonJsonKindsAsCode } from "@ai-matrx/content-ir/surfaces";
20
+ function RichContentInline({
21
+ source,
22
+ className,
23
+ links = "link",
24
+ streaming,
25
+ imagePolicy,
26
+ gfmCell = false
27
+ }) {
28
+ const prose = nonJsonKindsAsCode(inlineKindText(gfmCell ? unescapeCellPipes(source) : source));
29
+ const { text, violations } = guardMarkdownDelimiters(gfmCell ? preprocessCellProse(prose) : preprocessProse(prose));
30
+ useEffect(() => {
31
+ if (violations.length === 0) return;
32
+ reportDelimiterViolations(violations, {
33
+ renderPath: "RichContentInline",
34
+ capture: (input) => captureError({ ...input })
35
+ });
36
+ }, [violations]);
37
+ if (!source.trim()) return null;
38
+ const rendered = /* @__PURE__ */ jsx(
39
+ "span",
40
+ {
41
+ "data-rich-content": "inline",
42
+ className: cn(INLINE_LEVEL_WRAPPER_CLASS, className),
43
+ children: /* @__PURE__ */ jsx(
44
+ MarkdownCore,
45
+ {
46
+ preset: gfmCell ? "chat-cell" : "chat",
47
+ components: inlineLevelElements(links),
48
+ streaming,
49
+ children: text
50
+ }
51
+ )
52
+ }
53
+ );
54
+ return /* @__PURE__ */ jsx(Fragment, { children: withImagePolicy(imagePolicy, rendered) });
55
+ }
56
+ var RichContentInline_default = RichContentInline;
57
+ export {
58
+ INLINE_LEVEL_ELEMENTS,
59
+ RichContentInline,
60
+ RichContentInline_default as default
61
+ };
@@ -0,0 +1,12 @@
1
+ /** Cut at a line boundary: the first non-empty lines, bounded by characters. */
2
+ export declare function previewSource(source: string, lines: number, maxChars: number): string;
3
+ export interface RichContentPreviewProps {
4
+ source: string | null | undefined;
5
+ /** CSS line clamp (1 = single-line truncate). Default 2. */
6
+ lines?: 1 | 2 | 3 | 4 | 6;
7
+ /** Hard cap on source characters handed to the renderer. Default 400. */
8
+ maxChars?: number;
9
+ className?: string;
10
+ }
11
+ export declare function RichContentPreview({ source, lines, maxChars, className, }: RichContentPreviewProps): import("react").JSX.Element | null;
12
+ export default RichContentPreview;