@ai-matrx/rich-content 0.2.4 → 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 (381) hide show
  1. package/CHANGELOG.md +18 -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/diagram/DiagramLoadingVisualization.d.ts +6 -0
  51. package/dist/display/blocks/diagram/DiagramLoadingVisualization.js +190 -0
  52. package/dist/display/blocks/diagram/InteractiveDiagramBlock.d.ts +51 -0
  53. package/dist/display/blocks/diagram/InteractiveDiagramBlock.js +2415 -0
  54. package/dist/display/blocks/diagram/diagram-printer.d.ts +16 -0
  55. package/dist/display/blocks/diagram/diagram-printer.js +294 -0
  56. package/dist/display/blocks/diagram/diagram-visual-defaults.d.ts +116 -0
  57. package/dist/display/blocks/diagram/diagram-visual-defaults.js +400 -0
  58. package/dist/display/blocks/diagram/layout-utils.d.ts +90 -0
  59. package/dist/display/blocks/diagram/layout-utils.js +347 -0
  60. package/dist/display/blocks/diagram/parseDiagramJSON.d.ts +105 -0
  61. package/dist/display/blocks/diagram/parseDiagramJSON.js +296 -0
  62. package/dist/display/blocks/diagram/presentation-direction.d.ts +29 -0
  63. package/dist/display/blocks/diagram/presentation-direction.js +19 -0
  64. package/dist/display/blocks/diagram/ui-utils.d.ts +1 -0
  65. package/dist/display/blocks/diagram/ui-utils.js +18 -0
  66. package/dist/display/blocks/diff/DiffBlock.d.ts +10 -0
  67. package/dist/display/blocks/diff/DiffBlock.js +119 -0
  68. package/dist/display/blocks/diff/DiffCanvas.d.ts +15 -0
  69. package/dist/display/blocks/diff/DiffCanvas.js +20 -0
  70. package/dist/display/blocks/generic/GenericStructuredBlock.d.ts +24 -0
  71. package/dist/display/blocks/generic/GenericStructuredBlock.js +53 -0
  72. package/dist/display/blocks/generic/StructuredValueTabs.d.ts +21 -0
  73. package/dist/display/blocks/generic/StructuredValueTabs.js +124 -0
  74. package/dist/display/blocks/generic/tile-actions-slot.d.ts +39 -0
  75. package/dist/display/blocks/generic/tile-actions-slot.js +33 -0
  76. package/dist/display/blocks/images/ImageBlock.d.ts +8 -0
  77. package/dist/display/blocks/images/ImageBlock.js +265 -0
  78. package/dist/display/blocks/json/JsonBlock.d.ts +34 -0
  79. package/dist/display/blocks/json/JsonBlock.js +562 -0
  80. package/dist/display/blocks/json/JsonTableView.d.ts +10 -0
  81. package/dist/display/blocks/json/JsonTableView.js +173 -0
  82. package/dist/display/blocks/json/json-compact-stringify.d.ts +25 -0
  83. package/dist/display/blocks/json/json-compact-stringify.js +52 -0
  84. package/dist/display/blocks/json/json-tabular-utils.d.ts +65 -0
  85. package/dist/display/blocks/json/json-tabular-utils.js +121 -0
  86. package/dist/display/blocks/links/LinkComponent.d.ts +6 -0
  87. package/dist/display/blocks/links/LinkComponent.js +373 -0
  88. package/dist/display/blocks/links/LinkComponentWithFetch.d.ts +1 -0
  89. package/dist/display/blocks/links/LinkComponentWithFetch.js +0 -0
  90. package/dist/display/blocks/markdown/MarkdownKindBlock.d.ts +48 -0
  91. package/dist/display/blocks/markdown/MarkdownKindBlock.js +52 -0
  92. package/dist/display/blocks/markdown-preview/MarkdownPreviewBlock.d.ts +17 -0
  93. package/dist/display/blocks/markdown-preview/MarkdownPreviewBlock.js +70 -0
  94. package/dist/display/blocks/mermaid/MermaidBlock.d.ts +19 -0
  95. package/dist/display/blocks/mermaid/MermaidBlock.js +386 -0
  96. package/dist/display/blocks/search-replace/SearchReplaceBlock.d.ts +50 -0
  97. package/dist/display/blocks/search-replace/SearchReplaceBlock.js +71 -0
  98. package/dist/display/blocks/svg/SvgBlock.d.ts +8 -0
  99. package/dist/display/blocks/svg/SvgBlock.js +126 -0
  100. package/dist/display/blocks/table/StreamingTableRenderer.d.ts +53 -0
  101. package/dist/display/blocks/table/StreamingTableRenderer.js +907 -0
  102. package/dist/display/blocks/table/TableRenderPathDiagnostic.d.ts +21 -0
  103. package/dist/display/blocks/table/TableRenderPathDiagnostic.js +79 -0
  104. package/dist/display/blocks/thinking-reasoning/ConsolidatedReasoningVisualization.d.ts +14 -0
  105. package/dist/display/blocks/thinking-reasoning/ConsolidatedReasoningVisualization.js +15 -0
  106. package/dist/display/blocks/thinking-reasoning/ReasoningVisualization.d.ts +13 -0
  107. package/dist/display/blocks/thinking-reasoning/ReasoningVisualization.js +19 -0
  108. package/dist/display/blocks/thinking-reasoning/ThinkingTrace.d.ts +30 -0
  109. package/dist/display/blocks/thinking-reasoning/ThinkingTrace.js +75 -0
  110. package/dist/display/blocks/thinking-reasoning/ThinkingTraceMarkdown.d.ts +13 -0
  111. package/dist/display/blocks/thinking-reasoning/ThinkingTraceMarkdown.js +48 -0
  112. package/dist/display/blocks/thinking-reasoning/ThinkingVisualization.d.ts +12 -0
  113. package/dist/display/blocks/thinking-reasoning/ThinkingVisualization.js +19 -0
  114. package/dist/display/blocks/toml/TomlBlock.d.ts +7 -0
  115. package/dist/display/blocks/toml/TomlBlock.js +167 -0
  116. package/dist/display/blocks/tree/TreeBlock.d.ts +7 -0
  117. package/dist/display/blocks/tree/TreeBlock.js +163 -0
  118. package/dist/display/blocks/xml/XmlBlock.d.ts +23 -0
  119. package/dist/display/blocks/xml/XmlBlock.js +197 -0
  120. package/dist/display/blocks/xml/readXmlTag.d.ts +1 -0
  121. package/dist/display/blocks/xml/readXmlTag.js +1 -0
  122. package/dist/display/blocks/xml/xml-tokenize.d.ts +13 -0
  123. package/dist/display/blocks/xml/xml-tokenize.js +169 -0
  124. package/dist/display/blocks/yaml/YamlBlock.d.ts +7 -0
  125. package/dist/display/blocks/yaml/YamlBlock.js +191 -0
  126. package/dist/display/chat-markdown/BasicMarkdownContent.d.ts +29 -0
  127. package/dist/display/chat-markdown/BasicMarkdownContent.js +122 -0
  128. package/dist/display/chat-markdown/BlockRenderingContext.d.ts +23 -0
  129. package/dist/display/chat-markdown/BlockRenderingContext.js +17 -0
  130. package/dist/display/chat-markdown/ConfigurableMarkdownContent.d.ts +172 -0
  131. package/dist/display/chat-markdown/ConfigurableMarkdownContent.js +649 -0
  132. package/dist/display/chat-markdown/InlineCodeSnippet.d.ts +19 -0
  133. package/dist/display/chat-markdown/InlineCodeSnippet.js +146 -0
  134. package/dist/display/chat-markdown/InlineCodeSnippetKindGate.d.ts +11 -0
  135. package/dist/display/chat-markdown/InlineCodeSnippetKindGate.js +9 -0
  136. package/dist/display/chat-markdown/KindTextGate.d.ts +31 -0
  137. package/dist/display/chat-markdown/KindTextGate.js +60 -0
  138. package/dist/display/chat-markdown/QuestionnaireLoadingVisualization.d.ts +6 -0
  139. package/dist/display/chat-markdown/QuestionnaireLoadingVisualization.js +92 -0
  140. package/dist/display/chat-markdown/block-registry/BlockComponentRegistry.d.ts +72 -0
  141. package/dist/display/chat-markdown/block-registry/BlockComponentRegistry.js +94 -0
  142. package/dist/display/chat-markdown/block-registry/BlockRenderer.d.ts +126 -0
  143. package/dist/display/chat-markdown/block-registry/BlockRenderer.js +473 -0
  144. package/dist/display/chat-markdown/block-registry/block-dispatch.d.ts +410 -0
  145. package/dist/display/chat-markdown/block-registry/block-dispatch.js +495 -0
  146. package/dist/display/chat-markdown/block-registry/json-parse-utils.d.ts +13 -0
  147. package/dist/display/chat-markdown/block-registry/json-parse-utils.js +236 -0
  148. package/dist/display/chat-markdown/constants.d.ts +14 -0
  149. package/dist/display/chat-markdown/constants.js +317 -0
  150. package/dist/display/chat-markdown/diff-blocks/DiffCollapsible.d.ts +31 -0
  151. package/dist/display/chat-markdown/diff-blocks/DiffCollapsible.js +62 -0
  152. package/dist/display/chat-markdown/diff-blocks/DiffLoadingIndicator.d.ts +12 -0
  153. package/dist/display/chat-markdown/diff-blocks/DiffLoadingIndicator.js +18 -0
  154. package/dist/display/chat-markdown/diff-blocks/StreamingDiffBlock.d.ts +22 -0
  155. package/dist/display/chat-markdown/diff-blocks/StreamingDiffBlock.js +130 -0
  156. package/dist/display/chat-markdown/diff-blocks/diff-style-registry.d.ts +21 -0
  157. package/dist/display/chat-markdown/diff-blocks/diff-style-registry.js +91 -0
  158. package/dist/display/chat-markdown/diff-blocks/renderers/SearchReplaceDiffRenderer.d.ts +26 -0
  159. package/dist/display/chat-markdown/diff-blocks/renderers/SearchReplaceDiffRenderer.js +186 -0
  160. package/dist/display/chat-markdown/diff-blocks/types.d.ts +56 -0
  161. package/dist/display/chat-markdown/diff-blocks/types.js +0 -0
  162. package/dist/display/chat-markdown/internal-handlers/BlockFallback.d.ts +20 -0
  163. package/dist/display/chat-markdown/internal-handlers/BlockFallback.js +83 -0
  164. package/dist/display/chat-markdown/internal-handlers/InlineStatusIndicator.d.ts +4 -0
  165. package/dist/display/chat-markdown/internal-handlers/InlineStatusIndicator.js +16 -0
  166. package/dist/display/chat-markdown/internal-handlers/MarkdownErrorBoundary.d.ts +17 -0
  167. package/dist/display/chat-markdown/internal-handlers/MarkdownErrorBoundary.js +40 -0
  168. package/dist/display/chat-markdown/internal-handlers/PlainTextFallback.d.ts +8 -0
  169. package/dist/display/chat-markdown/internal-handlers/PlainTextFallback.js +91 -0
  170. package/dist/display/chat-markdown/internal-handlers/SafeBlockRenderer.d.ts +20 -0
  171. package/dist/display/chat-markdown/internal-handlers/SafeBlockRenderer.js +72 -0
  172. package/dist/display/chat-markdown/kind-source-view.d.ts +14 -0
  173. package/dist/display/chat-markdown/kind-source-view.js +14 -0
  174. package/dist/display/chat-markdown/matrx-variables/MatrxVariableInline.d.ts +28 -0
  175. package/dist/display/chat-markdown/matrx-variables/MatrxVariableInline.js +65 -0
  176. package/dist/display/chat-markdown/progressive-mount.d.ts +18 -0
  177. package/dist/display/chat-markdown/progressive-mount.js +90 -0
  178. package/dist/display/chat-markdown/render-block-to-content-block.d.ts +31 -0
  179. package/dist/display/chat-markdown/render-block-to-content-block.js +32 -0
  180. package/dist/display/chat-markdown/settle-stream-blocks.d.ts +50 -0
  181. package/dist/display/chat-markdown/settle-stream-blocks.js +26 -0
  182. package/dist/display/chat-markdown/stable-blocks.d.ts +15 -0
  183. package/dist/display/chat-markdown/stable-blocks.js +54 -0
  184. package/dist/display/chat-markdown/types.d.ts +11 -0
  185. package/dist/display/chat-markdown/types.js +26 -0
  186. package/dist/display/specimen/SpecimenContext.d.ts +26 -0
  187. package/dist/display/specimen/SpecimenContext.js +64 -0
  188. package/dist/display/tables/MarkdownTable.d.ts +23 -0
  189. package/dist/display/tables/MarkdownTable.js +769 -0
  190. package/dist/display/tables/MarkdownTableScrollArea.d.ts +12 -0
  191. package/dist/display/tables/MarkdownTableScrollArea.js +92 -0
  192. package/dist/display/tables/SendToGoogleSheetButton.d.ts +19 -0
  193. package/dist/display/tables/SendToGoogleSheetButton.js +93 -0
  194. package/dist/display/tables/SendToWorkbookButton.d.ts +24 -0
  195. package/dist/display/tables/SendToWorkbookButton.js +93 -0
  196. package/dist/display/tables/TableSaveToMenu.d.ts +16 -0
  197. package/dist/display/tables/TableSaveToMenu.js +98 -0
  198. package/dist/display/tables/TableWithSeparatedControls.d.ts +22 -0
  199. package/dist/display/tables/TableWithSeparatedControls.js +574 -0
  200. package/dist/display/tables/ViewTableModal.d.ts +14 -0
  201. package/dist/display/tables/ViewTableModal.js +67 -0
  202. package/dist/display/tables/editing/ColumnActionsMenu.d.ts +16 -0
  203. package/dist/display/tables/editing/ColumnActionsMenu.js +80 -0
  204. package/dist/display/tables/editing/RowActionsMenu.d.ts +16 -0
  205. package/dist/display/tables/editing/RowActionsMenu.js +80 -0
  206. package/dist/display/tables/editing/TableEditToolbar.d.ts +15 -0
  207. package/dist/display/tables/editing/TableEditToolbar.js +63 -0
  208. package/dist/display/tables/editing/tableMutations.d.ts +50 -0
  209. package/dist/display/tables/editing/tableMutations.js +148 -0
  210. package/dist/display/tables/editing/useDoubleClickEdit.d.ts +43 -0
  211. package/dist/display/tables/editing/useDoubleClickEdit.js +51 -0
  212. package/dist/display/tables/editing/useTableUndo.d.ts +25 -0
  213. package/dist/display/tables/editing/useTableUndo.js +17 -0
  214. package/dist/display/tables/table-action-row.d.ts +8 -0
  215. package/dist/display/tables/table-action-row.js +31 -0
  216. package/dist/display/tables/table-viewer.d.ts +13 -0
  217. package/dist/display/tables/table-viewer.js +18 -0
  218. package/dist/host/ErrorActions.d.ts +1 -1
  219. package/dist/host/ErrorNotice.d.ts +10 -0
  220. package/dist/host/ErrorNotice.js +19 -0
  221. package/dist/host/app-bindings.d.ts +155 -0
  222. package/dist/host/app-bindings.js +160 -0
  223. package/dist/host/diagnostics.d.ts +2 -2
  224. package/dist/host/diagnostics.js +2 -1
  225. package/dist/host/tables.d.ts +1 -6
  226. package/dist/host/types.d.ts +14 -7
  227. package/dist/levels/RichContent.d.ts +3 -0
  228. package/dist/levels/RichContent.js +102 -0
  229. package/dist/levels/RichContentInline.d.ts +28 -0
  230. package/dist/levels/RichContentInline.js +61 -0
  231. package/dist/levels/RichContentPreview.d.ts +12 -0
  232. package/dist/levels/RichContentPreview.js +39 -0
  233. package/dist/levels/RichContentStandardImpl.d.ts +12 -0
  234. package/dist/levels/RichContentStandardImpl.js +27 -0
  235. package/dist/levels/RichContentStaticProse.d.ts +46 -0
  236. package/dist/levels/RichContentStaticProse.js +100 -0
  237. package/dist/levels/depth.d.ts +18 -0
  238. package/dist/levels/depth.js +32 -0
  239. package/dist/levels/prose/inline-level-elements.d.ts +19 -0
  240. package/dist/levels/prose/inline-level-elements.js +103 -0
  241. package/dist/levels/prose/prose-block-elements.d.ts +25 -0
  242. package/dist/levels/prose/prose-block-elements.js +313 -0
  243. package/dist/levels/prose/prose-inline-elements.d.ts +13 -0
  244. package/dist/levels/prose/prose-inline-elements.js +143 -0
  245. package/dist/levels/prose/prose-prepare.d.ts +50 -0
  246. package/dist/levels/prose/prose-prepare.js +246 -0
  247. package/dist/levels/prose/remote-image-policy.d.ts +34 -0
  248. package/dist/levels/prose/remote-image-policy.js +153 -0
  249. package/dist/levels/prose/variant-root.d.ts +9 -0
  250. package/dist/levels/prose/variant-root.js +34 -0
  251. package/dist/levels/rich-content-types.d.ts +93 -0
  252. package/dist/levels/rich-content-types.js +4 -0
  253. package/dist/levels/server/DelimiterViolationReport.d.ts +7 -0
  254. package/dist/levels/server/DelimiterViolationReport.js +24 -0
  255. package/dist/levels/server/RichContentServer.d.ts +27 -0
  256. package/dist/levels/server/RichContentServer.js +97 -0
  257. package/dist/levels/standard/NestedRichContent.d.ts +7 -0
  258. package/dist/levels/standard/NestedRichContent.js +70 -0
  259. package/dist/levels/standard/StandardBlocks.d.ts +13 -0
  260. package/dist/levels/standard/StandardBlocks.js +239 -0
  261. package/dist/levels/standard/StandardKindRegion.d.ts +14 -0
  262. package/dist/levels/standard/StandardKindRegion.js +69 -0
  263. package/dist/levels/standard/standard-kind-region.d.ts +19 -0
  264. package/dist/levels/standard/standard-kind-region.js +21 -0
  265. package/dist/levels/standard/static-standard.d.ts +23 -0
  266. package/dist/levels/standard/static-standard.js +187 -0
  267. package/dist/levels/standard/stream-holdback.d.ts +2 -0
  268. package/dist/levels/standard/stream-holdback.js +77 -0
  269. package/dist/mermaid/MermaidFullscreen.d.ts +17 -0
  270. package/dist/mermaid/MermaidFullscreen.js +71 -0
  271. package/dist/mermaid/MermaidRenderer.d.ts +20 -0
  272. package/dist/mermaid/MermaidRenderer.js +267 -0
  273. package/dist/mermaid/MermaidView.d.ts +27 -0
  274. package/dist/mermaid/MermaidView.js +68 -0
  275. package/dist/mermaid/MermaidViewport.d.ts +75 -0
  276. package/dist/mermaid/MermaidViewport.js +286 -0
  277. package/dist/mermaid/adapters/er.d.ts +10 -0
  278. package/dist/mermaid/adapters/er.js +205 -0
  279. package/dist/mermaid/adapters/flowchart.d.ts +17 -0
  280. package/dist/mermaid/adapters/flowchart.js +634 -0
  281. package/dist/mermaid/adapters/journey.d.ts +9 -0
  282. package/dist/mermaid/adapters/journey.js +207 -0
  283. package/dist/mermaid/adapters/mindmap.d.ts +12 -0
  284. package/dist/mermaid/adapters/mindmap.js +252 -0
  285. package/dist/mermaid/adapters/pie.d.ts +7 -0
  286. package/dist/mermaid/adapters/pie.js +172 -0
  287. package/dist/mermaid/adapters/quadrant.d.ts +8 -0
  288. package/dist/mermaid/adapters/quadrant.js +231 -0
  289. package/dist/mermaid/adapters/register.d.ts +7 -0
  290. package/dist/mermaid/adapters/register.js +19 -0
  291. package/dist/mermaid/adapters/sequence.d.ts +8 -0
  292. package/dist/mermaid/adapters/sequence.js +251 -0
  293. package/dist/mermaid/adapters/state.d.ts +12 -0
  294. package/dist/mermaid/adapters/state.js +245 -0
  295. package/dist/mermaid/adapters/timeline.d.ts +8 -0
  296. package/dist/mermaid/adapters/timeline.js +245 -0
  297. package/dist/mermaid/catalog.d.ts +33 -0
  298. package/dist/mermaid/catalog.js +202 -0
  299. package/dist/mermaid/diagram-type.d.ts +39 -0
  300. package/dist/mermaid/diagram-type.js +89 -0
  301. package/dist/mermaid/export.d.ts +21 -0
  302. package/dist/mermaid/export.js +112 -0
  303. package/dist/mermaid/extract-fence.d.ts +15 -0
  304. package/dist/mermaid/extract-fence.js +22 -0
  305. package/dist/mermaid/lazy-draw.d.ts +40 -0
  306. package/dist/mermaid/lazy-draw.js +168 -0
  307. package/dist/mermaid/model/adapter.d.ts +28 -0
  308. package/dist/mermaid/model/adapter.js +16 -0
  309. package/dist/mermaid/model/ops.d.ts +282 -0
  310. package/dist/mermaid/model/ops.js +9 -0
  311. package/dist/mermaid/model/round-trip.d.ts +22 -0
  312. package/dist/mermaid/model/round-trip.js +45 -0
  313. package/dist/mermaid/model/types.d.ts +271 -0
  314. package/dist/mermaid/model/types.js +0 -0
  315. package/dist/mermaid/print-render.d.ts +9 -0
  316. package/dist/mermaid/print-render.js +39 -0
  317. package/dist/mermaid/runtime.d.ts +25 -0
  318. package/dist/mermaid/runtime.js +183 -0
  319. package/dist/mermaid/sanitize.d.ts +46 -0
  320. package/dist/mermaid/sanitize.js +234 -0
  321. package/dist/mermaid/types.d.ts +43 -0
  322. package/dist/mermaid/types.js +21 -0
  323. package/dist/mermaid/view/ViewModePane.d.ts +24 -0
  324. package/dist/mermaid/view/ViewModePane.js +9 -0
  325. package/dist/utils/client-lazy.d.ts +1 -1
  326. package/dist/utils/client-lazy.js +4 -1
  327. package/dist/utils/lifted/DiffView.d.ts +10 -0
  328. package/dist/utils/lifted/DiffView.js +26 -0
  329. package/dist/utils/lifted/IconButton.d.ts +24 -0
  330. package/dist/utils/lifted/IconButton.js +43 -0
  331. package/dist/utils/lifted/MatrxMiniLoader.d.ts +1 -0
  332. package/dist/utils/lifted/MatrxMiniLoader.js +8 -0
  333. package/dist/utils/lifted/ShimmerText.d.ts +5 -0
  334. package/dist/utils/lifted/ShimmerText.js +21 -0
  335. package/dist/utils/lifted/SuspenseLoader.d.ts +16 -0
  336. package/dist/utils/lifted/SuspenseLoader.js +42 -0
  337. package/dist/utils/lifted/Tooltip.d.ts +20 -0
  338. package/dist/utils/lifted/Tooltip.js +52 -0
  339. package/dist/utils/lifted/artifactId.d.ts +34 -0
  340. package/dist/utils/lifted/artifactId.js +15 -0
  341. package/dist/utils/lifted/canvasContent.d.ts +63 -0
  342. package/dist/utils/lifted/canvasContent.js +98 -0
  343. package/dist/utils/lifted/captureReactError.d.ts +24 -0
  344. package/dist/utils/lifted/captureReactError.js +28 -0
  345. package/dist/utils/lifted/chunk-load-recovery.d.ts +25 -0
  346. package/dist/utils/lifted/chunk-load-recovery.js +36 -0
  347. package/dist/utils/lifted/code-editor-agent-types.d.ts +6 -0
  348. package/dist/utils/lifted/code-editor-agent-types.js +0 -0
  349. package/dist/utils/lifted/code-editor-agents.d.ts +39 -0
  350. package/dist/utils/lifted/code-editor-agents.js +52 -0
  351. package/dist/utils/lifted/code-language-extension.d.ts +1 -0
  352. package/dist/utils/lifted/code-language-extension.js +60 -0
  353. package/dist/utils/lifted/custom-icons.d.ts +16 -0
  354. package/dist/utils/lifted/custom-icons.js +47 -0
  355. package/dist/utils/lifted/durability.d.ts +16 -0
  356. package/dist/utils/lifted/durability.js +45 -0
  357. package/dist/utils/lifted/errors.d.ts +30 -0
  358. package/dist/utils/lifted/errors.js +29 -0
  359. package/dist/utils/lifted/html-document.d.ts +1 -0
  360. package/dist/utils/lifted/html-document.js +12 -0
  361. package/dist/utils/lifted/languageOptions.d.ts +9 -0
  362. package/dist/utils/lifted/languageOptions.js +52 -0
  363. package/dist/utils/lifted/languages.d.ts +34 -0
  364. package/dist/utils/lifted/languages.js +175 -0
  365. package/dist/utils/lifted/loading-spinner.d.ts +18 -0
  366. package/dist/utils/lifted/loading-spinner.js +200 -0
  367. package/dist/utils/lifted/media-refs.d.ts +13 -0
  368. package/dist/utils/lifted/media-refs.js +27 -0
  369. package/dist/utils/lifted/scroll-root.d.ts +1 -0
  370. package/dist/utils/lifted/scroll-root.js +25 -0
  371. package/dist/utils/lifted/syntax-themes.d.ts +32 -0
  372. package/dist/utils/lifted/syntax-themes.js +100 -0
  373. package/dist/utils/lifted/url-utm.d.ts +24 -0
  374. package/dist/utils/lifted/url-utm.js +66 -0
  375. package/dist/utils/lifted/use-is-mounted.d.ts +24 -0
  376. package/dist/utils/lifted/use-is-mounted.js +21 -0
  377. package/dist/utils/lifted/useToastManager.d.ts +1 -0
  378. package/dist/utils/lifted/useToastManager.js +7 -0
  379. package/dist/utils/report-kind-at-raw-renderer.d.ts +19 -0
  380. package/dist/utils/report-kind-at-raw-renderer.js +32 -0
  381. package/package.json +32 -3
@@ -0,0 +1,173 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useMemo, useState } from "react";
4
+ import {
5
+ ChevronDown,
6
+ ChevronRight,
7
+ ArrowUpDown,
8
+ ArrowUp,
9
+ ArrowDown,
10
+ Search
11
+ } from "lucide-react";
12
+ import { cn } from "@ai-matrx/design-system";
13
+ import { Button, Input } from "@ai-matrx/design-system/controls";
14
+ function formatPrimitive(value) {
15
+ if (value === null)
16
+ return /* @__PURE__ */ jsx("span", { className: "text-orange-500 italic", children: "null" });
17
+ if (value === void 0)
18
+ return /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u2014" });
19
+ if (typeof value === "boolean")
20
+ return /* @__PURE__ */ jsx("span", { className: "text-purple-600 dark:text-purple-400 font-mono", children: String(value) });
21
+ if (typeof value === "number")
22
+ return /* @__PURE__ */ jsx("span", { className: "text-blue-600 dark:text-blue-400 font-mono tabular-nums", children: value });
23
+ return /* @__PURE__ */ jsx("span", { children: String(value) });
24
+ }
25
+ const NestedCell = ({ value }) => {
26
+ const [expanded, setExpanded] = useState(false);
27
+ const isArr = Array.isArray(value);
28
+ const preview = isArr ? `Array(${value.length})` : `Object(${Object.keys(value).length})`;
29
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [
30
+ /* @__PURE__ */ jsx(Button, { variant: "quiet", icon: expanded ? /* @__PURE__ */ jsx(ChevronDown, {}) : /* @__PURE__ */ jsx(ChevronRight, {}), onClick: () => setExpanded((v) => !v), children: /* @__PURE__ */ jsx("span", { className: "font-mono", children: preview }) }),
31
+ expanded && /* @__PURE__ */ jsx("pre", { className: "text-[11px] bg-muted/50 rounded px-2 py-1 overflow-auto max-h-48 whitespace-pre-wrap break-all", children: JSON.stringify(value, null, 2) })
32
+ ] });
33
+ };
34
+ const Cell = ({ value }) => {
35
+ if (value !== null && typeof value === "object") {
36
+ return /* @__PURE__ */ jsx(NestedCell, { value });
37
+ }
38
+ return /* @__PURE__ */ jsx(Fragment, { children: formatPrimitive(value) });
39
+ };
40
+ function compareCells(a, b, dir) {
41
+ if (dir === null) return 0;
42
+ const mul = dir === "asc" ? 1 : -1;
43
+ if (a == null && b == null) return 0;
44
+ if (a == null) return -1 * mul;
45
+ if (b == null) return 1 * mul;
46
+ if (typeof a === "number" && typeof b === "number") return (a - b) * mul;
47
+ if (typeof a === "boolean" && typeof b === "boolean") {
48
+ return (Number(a) - Number(b)) * mul;
49
+ }
50
+ const sa = typeof a === "object" ? JSON.stringify(a) : String(a);
51
+ const sb = typeof b === "object" ? JSON.stringify(b) : String(b);
52
+ return sa.localeCompare(sb) * mul;
53
+ }
54
+ const JsonTableView = ({
55
+ rows,
56
+ columns,
57
+ caption,
58
+ className
59
+ }) => {
60
+ const [sortCol, setSortCol] = useState(null);
61
+ const [sortDir, setSortDir] = useState(null);
62
+ const [query, setQuery] = useState("");
63
+ const handleSort = (col) => {
64
+ if (sortCol === col) {
65
+ if (sortDir === "asc") setSortDir("desc");
66
+ else if (sortDir === "desc") {
67
+ setSortCol(null);
68
+ setSortDir(null);
69
+ }
70
+ } else {
71
+ setSortCol(col);
72
+ setSortDir("asc");
73
+ }
74
+ };
75
+ const filteredRows = useMemo(() => {
76
+ const q = query.trim().toLowerCase();
77
+ if (!q) return rows;
78
+ return rows.filter(
79
+ (row) => columns.some((c) => {
80
+ const v = row[c];
81
+ if (v == null) return false;
82
+ const s = typeof v === "object" ? JSON.stringify(v) : String(v);
83
+ return s.toLowerCase().includes(q);
84
+ })
85
+ );
86
+ }, [rows, columns, query]);
87
+ const sortedRows = useMemo(() => {
88
+ if (!sortCol || !sortDir) return filteredRows;
89
+ return [...filteredRows].sort(
90
+ (a, b) => compareCells(a[sortCol], b[sortCol], sortDir)
91
+ );
92
+ }, [filteredRows, sortCol, sortDir]);
93
+ const getSortIcon = (col) => {
94
+ if (sortCol !== col)
95
+ return /* @__PURE__ */ jsx(ArrowUpDown, { className: "w-3 h-3 opacity-0 group-hover/th:opacity-50" });
96
+ if (sortDir === "asc") return /* @__PURE__ */ jsx(ArrowUp, { className: "w-3 h-3 text-primary" });
97
+ return /* @__PURE__ */ jsx(ArrowDown, { className: "w-3 h-3 text-primary" });
98
+ };
99
+ return /* @__PURE__ */ jsxs(
100
+ "div",
101
+ {
102
+ className: cn(
103
+ "flex flex-col bg-card border-t border-border/30",
104
+ className
105
+ ),
106
+ children: [
107
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 px-3 py-1.5 border-b border-border/40 bg-muted/20", children: [
108
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: caption }),
109
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
110
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
111
+ /* @__PURE__ */ jsx(
112
+ Input,
113
+ {
114
+ adornment: "start",
115
+ value: query,
116
+ onChange: (e) => setQuery(e.target.value),
117
+ placeholder: "Filter rows\u2026",
118
+ className: "w-48"
119
+ }
120
+ )
121
+ ] })
122
+ ] }),
123
+ /* @__PURE__ */ jsx("div", { className: "overflow-auto max-h-[600px]", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-sm border-collapse", children: [
124
+ /* @__PURE__ */ jsx("thead", { className: "sticky top-0 z-10", children: /* @__PURE__ */ jsxs("tr", { className: "bg-muted/70 backdrop-blur", children: [
125
+ /* @__PURE__ */ jsx("th", { className: "px-1 py-1 text-center text-[10px] text-muted-foreground font-mono border-r border-border/30 w-10 sticky left-0 bg-muted/70 backdrop-blur", children: "#" }),
126
+ columns.map((col) => /* @__PURE__ */ jsx(
127
+ "th",
128
+ {
129
+ onClick: () => handleSort(col),
130
+ className: "group/th px-3 py-1.5 text-left text-xs font-semibold text-foreground border-r border-border/30 last:border-r-0 cursor-pointer hover:bg-muted transition-colors select-none whitespace-nowrap",
131
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
132
+ /* @__PURE__ */ jsx("span", { children: col }),
133
+ getSortIcon(col)
134
+ ] })
135
+ },
136
+ col
137
+ ))
138
+ ] }) }),
139
+ /* @__PURE__ */ jsx("tbody", { children: sortedRows.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
140
+ "td",
141
+ {
142
+ colSpan: columns.length + 1,
143
+ className: "px-3 py-6 text-center text-xs text-muted-foreground",
144
+ children: query ? "No rows match the filter." : "Empty table."
145
+ }
146
+ ) }) : sortedRows.map((row, rowIdx) => /* @__PURE__ */ jsxs(
147
+ "tr",
148
+ {
149
+ className: "border-t border-border/20 hover:bg-muted/20 transition-colors align-top",
150
+ children: [
151
+ /* @__PURE__ */ jsx("td", { className: "px-1 py-1 text-center text-[10px] text-muted-foreground font-mono border-r border-border/30 sticky left-0 bg-background", children: rowIdx + 1 }),
152
+ columns.map((col) => /* @__PURE__ */ jsx(
153
+ "td",
154
+ {
155
+ className: "px-3 py-1.5 text-foreground border-r border-border/30 last:border-r-0 align-top min-w-0 max-w-md",
156
+ children: /* @__PURE__ */ jsx(Cell, { value: row[col] })
157
+ },
158
+ col
159
+ ))
160
+ ]
161
+ },
162
+ rowIdx
163
+ )) })
164
+ ] }) })
165
+ ]
166
+ }
167
+ );
168
+ };
169
+ var JsonTableView_default = JsonTableView;
170
+ export {
171
+ JsonTableView,
172
+ JsonTableView_default as default
173
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Pretty-but-compact JSON stringifier.
3
+ *
4
+ * Inspired by `json-stringify-pretty-compact`: keep the outer structure
5
+ * indented for scannability, but collapse any sub-value whose one-line
6
+ * form fits within `maxWidth` back onto a single line. The result reads
7
+ * horizontally where possible without sacrificing top-level shape.
8
+ *
9
+ * Example output for a model definition:
10
+ *
11
+ * {
12
+ * "controls": {
13
+ * "temperature": { "type": "number", "min": 0, "max": 1, "default": 1 },
14
+ * "top_p": { "type": "number", "min": 0, "max": 1, "default": 1 },
15
+ * ...
16
+ * }
17
+ * }
18
+ */
19
+ export interface CompactStringifyOptions {
20
+ /** Wrap to multi-line when the single-line form exceeds this width. */
21
+ maxWidth?: number;
22
+ /** Spaces per indent level. */
23
+ indent?: number;
24
+ }
25
+ export declare function stringifyCompact(value: unknown, options?: CompactStringifyOptions): string;
@@ -0,0 +1,52 @@
1
+ function stringifyCompact(value, options = {}) {
2
+ const maxWidth = options.maxWidth ?? 100;
3
+ const indentSize = options.indent ?? 2;
4
+ const pad = " ".repeat(indentSize);
5
+ const render = (v, currentIndent) => {
6
+ const flat = JSON.stringify(v) ?? "null";
7
+ if (flat.length <= Math.max(0, maxWidth - currentIndent.length)) {
8
+ return prettifyFlat(flat);
9
+ }
10
+ if (Array.isArray(v)) {
11
+ if (v.length === 0) return "[]";
12
+ const nextIndent = currentIndent + pad;
13
+ const items = v.map((item) => nextIndent + render(item, nextIndent));
14
+ return "[\n" + items.join(",\n") + "\n" + currentIndent + "]";
15
+ }
16
+ if (v !== null && typeof v === "object") {
17
+ const keys = Object.keys(v);
18
+ if (keys.length === 0) return "{}";
19
+ const nextIndent = currentIndent + pad;
20
+ const items = keys.map((k) => {
21
+ const valueStr = render(v[k], nextIndent);
22
+ return nextIndent + JSON.stringify(k) + ": " + valueStr;
23
+ });
24
+ return "{\n" + items.join(",\n") + "\n" + currentIndent + "}";
25
+ }
26
+ return flat;
27
+ };
28
+ return render(value, "");
29
+ }
30
+ function prettifyFlat(flat) {
31
+ let out = "";
32
+ let inString = false;
33
+ for (let i = 0; i < flat.length; i++) {
34
+ const ch = flat[i];
35
+ out += ch;
36
+ if (ch === '"') {
37
+ let backslashes = 0;
38
+ for (let j = i - 1; j >= 0 && flat[j] === "\\"; j--) backslashes++;
39
+ if (backslashes % 2 === 0) inString = !inString;
40
+ continue;
41
+ }
42
+ if (inString) continue;
43
+ if (ch === ":" || ch === ",") {
44
+ const next = flat[i + 1];
45
+ if (next !== void 0 && next !== " ") out += " ";
46
+ }
47
+ }
48
+ return out;
49
+ }
50
+ export {
51
+ stringifyCompact
52
+ };
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Utilities for the JSON-aware code block: parse, detect tabular shape,
3
+ * and export to common interchange formats (CSV, NDJSON, XLSX).
4
+ *
5
+ * The detection rules are intentionally permissive — we offer Table view
6
+ * whenever a sensible interpretation exists, then let the user pick. A
7
+ * mediocre table render on borderline data is fine; an absent option on
8
+ * obviously-tabular data is the worse failure mode.
9
+ */
10
+ export type TabularSource = "array-of-objects" | "matrix" | "wrapped-array" | "none";
11
+ export interface TabularShape {
12
+ /** True when we can render `rows` as a sensible table. */
13
+ isTabular: boolean;
14
+ /** Normalized row records — never holds the original parsed value. */
15
+ rows: Record<string, unknown>[];
16
+ /** Ordered column names (union of keys for object-rows, indices for matrix). */
17
+ columns: string[];
18
+ /** Where the rows came from inside the original payload. */
19
+ source: TabularSource;
20
+ /** For `wrapped-array`: the key whose value held the inner array. */
21
+ wrapperKey?: string;
22
+ }
23
+ export interface ParseResult {
24
+ ok: boolean;
25
+ value?: unknown;
26
+ error?: string;
27
+ }
28
+ /**
29
+ * Strict JSON parse — no Python/single-quote/trailing-comma fallback.
30
+ * Streaming/partial content stays in code view, so we never want to be
31
+ * "clever" here and accidentally render half-baked structures as tables.
32
+ */
33
+ export declare function parseJsonSafe(text: string): ParseResult;
34
+ /**
35
+ * Detect a tabular interpretation of a parsed JSON value, in priority order:
36
+ *
37
+ * 1. Array of objects → array-of-objects
38
+ * 2. Matrix (array of equal-length arrays) → matrix
39
+ * 3. Object with exactly one array-valued key
40
+ * whose inner array satisfies (1) or (2) → wrapped-array
41
+ * 4. Otherwise → not tabular
42
+ *
43
+ * The cell values are returned as-is (still unknown). Rendering decides
44
+ * how to display nested objects/arrays in a cell.
45
+ */
46
+ export declare function detectTabular(value: unknown): TabularShape;
47
+ /**
48
+ * Stringify a cell for CSV/text export. Objects/arrays become compact JSON.
49
+ * `null` and `undefined` become empty strings (Excel-friendly).
50
+ */
51
+ export declare function cellToCsv(value: unknown): string;
52
+ export declare function rowsToCsv(rows: Record<string, unknown>[], columns: string[], delimiter?: string): string;
53
+ export declare function rowsToNdjson(rows: unknown[]): string;
54
+ /** Browser file-download for a text payload. */
55
+ export declare function downloadText(filename: string, content: string, mime?: string): void;
56
+ /**
57
+ * XLSX export uses the same `xlsx` package as `ImportTableModal`.
58
+ * Dynamically imported to keep it out of the initial chat bundle.
59
+ *
60
+ * Cell values are pre-stringified for objects/arrays so spreadsheets
61
+ * receive plain text instead of "[object Object]".
62
+ */
63
+ export declare function rowsToXlsx(rows: Record<string, unknown>[], columns: string[], filename: string): Promise<void>;
64
+ /** Default filename helper (no extension). */
65
+ export declare function defaultJsonFilename(): string;
@@ -0,0 +1,121 @@
1
+ import { announceBareHost, hostCapability } from "../../../host/registry.js";
2
+ function parseJsonSafe(text) {
3
+ if (!text || !text.trim()) {
4
+ return { ok: false, error: "Empty input" };
5
+ }
6
+ try {
7
+ return { ok: true, value: JSON.parse(text) };
8
+ } catch (err) {
9
+ return {
10
+ ok: false,
11
+ error: err instanceof Error ? err.message : String(err)
12
+ };
13
+ }
14
+ }
15
+ function isPlainObject(value) {
16
+ return value !== null && typeof value === "object" && !Array.isArray(value);
17
+ }
18
+ function detectTabular(value) {
19
+ if (Array.isArray(value) && value.length > 0 && value.every(isPlainObject)) {
20
+ const cols = /* @__PURE__ */ new Set();
21
+ for (const row of value) {
22
+ for (const k of Object.keys(row)) cols.add(k);
23
+ }
24
+ return {
25
+ isTabular: true,
26
+ rows: value,
27
+ columns: Array.from(cols),
28
+ source: "array-of-objects"
29
+ };
30
+ }
31
+ if (Array.isArray(value) && value.length > 0 && value.every(Array.isArray)) {
32
+ const lens = new Set(value.map((r) => r.length));
33
+ if (lens.size === 1) {
34
+ const first = value[0];
35
+ const allStrings = first.every((c) => typeof c === "string");
36
+ const columns = allStrings ? first.map(String) : first.map((_, i) => `col_${i + 1}`);
37
+ const dataRows = allStrings ? value.slice(1) : value;
38
+ const rows = dataRows.map(
39
+ (r) => Object.fromEntries(columns.map((c, i) => [c, r[i]]))
40
+ );
41
+ return {
42
+ isTabular: true,
43
+ rows,
44
+ columns,
45
+ source: "matrix"
46
+ };
47
+ }
48
+ }
49
+ if (isPlainObject(value)) {
50
+ const arrayKeys = Object.keys(value).filter(
51
+ (k) => Array.isArray(value[k])
52
+ );
53
+ if (arrayKeys.length === 1) {
54
+ const wrapperKey = arrayKeys[0];
55
+ const inner = value[wrapperKey];
56
+ const recur = detectTabular(inner);
57
+ if (recur.isTabular) {
58
+ return { ...recur, source: "wrapped-array", wrapperKey };
59
+ }
60
+ }
61
+ }
62
+ return { isTabular: false, rows: [], columns: [], source: "none" };
63
+ }
64
+ function cellToCsv(value) {
65
+ if (value === null || value === void 0) return "";
66
+ if (typeof value === "object") {
67
+ try {
68
+ return JSON.stringify(value);
69
+ } catch {
70
+ return String(value);
71
+ }
72
+ }
73
+ return String(value);
74
+ }
75
+ function escapeCsv(value, delimiter) {
76
+ const needsQuote = value.includes(delimiter) || value.includes('"') || value.includes("\n") || value.includes("\r");
77
+ if (!needsQuote) return value;
78
+ return `"${value.replace(/"/g, '""')}"`;
79
+ }
80
+ function rowsToCsv(rows, columns, delimiter = ",") {
81
+ const header = columns.map((c) => escapeCsv(c, delimiter)).join(delimiter);
82
+ const body = rows.map(
83
+ (row) => columns.map((c) => escapeCsv(cellToCsv(row[c]), delimiter)).join(delimiter)
84
+ ).join("\n");
85
+ return body ? `${header}
86
+ ${body}` : header;
87
+ }
88
+ function rowsToNdjson(rows) {
89
+ return rows.map((r) => JSON.stringify(r)).join("\n");
90
+ }
91
+ function downloadText(filename, content, mime = "text/plain") {
92
+ const blob = new Blob([content], { type: `${mime};charset=utf-8` });
93
+ const url = window.URL.createObjectURL(blob);
94
+ const a = document.createElement("a");
95
+ a.href = url;
96
+ a.download = filename;
97
+ document.body.appendChild(a);
98
+ a.click();
99
+ document.body.removeChild(a);
100
+ window.URL.revokeObjectURL(url);
101
+ }
102
+ async function rowsToXlsx(rows, columns, filename) {
103
+ const impl = hostCapability("app")?.rowsToXlsx;
104
+ if (impl) return impl(rows, columns, filename);
105
+ announceBareHost("app.rowsToXlsx", "spreadsheets download as CSV");
106
+ downloadText(rowsToCsv(rows, columns), filename.replace(/\.xlsx$/i, "") + ".csv", "text/csv");
107
+ }
108
+ function defaultJsonFilename() {
109
+ const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
110
+ return `json-${stamp}`;
111
+ }
112
+ export {
113
+ cellToCsv,
114
+ defaultJsonFilename,
115
+ detectTabular,
116
+ downloadText,
117
+ parseJsonSafe,
118
+ rowsToCsv,
119
+ rowsToNdjson,
120
+ rowsToXlsx
121
+ };
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export declare const LinkComponent: ({ href, children, }: {
3
+ href: string;
4
+ children: React.ReactNode;
5
+ }) => React.JSX.Element;
6
+ export default LinkComponent;