@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.
- package/CHANGELOG.md +18 -0
- package/dist/code-block/CodeBlock.d.ts +44 -0
- package/dist/code-block/CodeBlock.js +449 -0
- package/dist/code-block/CodeBlockHeader.d.ts +63 -0
- package/dist/code-block/CodeBlockHeader.js +472 -0
- package/dist/code-block/CodeEditorLoading.d.ts +3 -0
- package/dist/code-block/CodeEditorLoading.js +34 -0
- package/dist/code-block/LanguageDisplay.d.ts +28 -0
- package/dist/code-block/LanguageDisplay.js +279 -0
- package/dist/code-block/SmallCodeEditor.d.ts +30 -0
- package/dist/code-block/SmallCodeEditor.js +22 -0
- package/dist/code-block/StickyButtons.d.ts +35 -0
- package/dist/code-block/StickyButtons.js +88 -0
- package/dist/code-block/highlight/ShikiCodeView.d.ts +26 -0
- package/dist/code-block/highlight/ShikiCodeView.js +134 -0
- package/dist/code-block/highlight/shiki-highlighter.d.ts +14 -0
- package/dist/code-block/highlight/shiki-highlighter.js +126 -0
- package/dist/code-block/highlight/useHighlightedLines.d.ts +18 -0
- package/dist/code-block/highlight/useHighlightedLines.js +142 -0
- package/dist/code-block/sticky-inset.d.ts +6 -0
- package/dist/code-block/sticky-inset.js +10 -0
- package/dist/display/block-interaction.d.ts +33 -0
- package/dist/display/block-interaction.js +13 -0
- package/dist/display/blocks/ChatCollapsibleWrapper.d.ts +13 -0
- package/dist/display/blocks/ChatCollapsibleWrapper.js +56 -0
- package/dist/display/blocks/buildMediaSource.d.ts +25 -0
- package/dist/display/blocks/buildMediaSource.js +43 -0
- package/dist/display/blocks/canvas-adaptive.d.ts +118 -0
- package/dist/display/blocks/canvas-adaptive.js +127 -0
- package/dist/display/blocks/canvas-fit.d.ts +24 -0
- package/dist/display/blocks/canvas-fit.js +19 -0
- package/dist/display/blocks/chart/ChartBlock.d.ts +8 -0
- package/dist/display/blocks/chart/ChartBlock.js +125 -0
- package/dist/display/blocks/chart/ChartCanvas.d.ts +18 -0
- package/dist/display/blocks/chart/ChartCanvas.js +159 -0
- package/dist/display/blocks/chart/TableChart.d.ts +25 -0
- package/dist/display/blocks/chart/TableChart.js +97 -0
- package/dist/display/blocks/chart/chart-spec.d.ts +39 -0
- package/dist/display/blocks/chart/chart-spec.js +128 -0
- package/dist/display/blocks/chart/labels.d.ts +20 -0
- package/dist/display/blocks/chart/labels.js +7 -0
- package/dist/display/blocks/chart/table-chart.d.ts +37 -0
- package/dist/display/blocks/chart/table-chart.js +231 -0
- package/dist/display/blocks/common/BlockHeaderWrapper.d.ts +56 -0
- package/dist/display/blocks/common/BlockHeaderWrapper.js +310 -0
- package/dist/display/blocks/common/ContentBlockWrapper.d.ts +40 -0
- package/dist/display/blocks/common/ContentBlockWrapper.js +214 -0
- package/dist/display/blocks/common/SandboxedHtml.d.ts +27 -0
- package/dist/display/blocks/common/SandboxedHtml.js +26 -0
- package/dist/display/blocks/diagram/DiagramLoadingVisualization.d.ts +6 -0
- package/dist/display/blocks/diagram/DiagramLoadingVisualization.js +190 -0
- package/dist/display/blocks/diagram/InteractiveDiagramBlock.d.ts +51 -0
- package/dist/display/blocks/diagram/InteractiveDiagramBlock.js +2415 -0
- package/dist/display/blocks/diagram/diagram-printer.d.ts +16 -0
- package/dist/display/blocks/diagram/diagram-printer.js +294 -0
- package/dist/display/blocks/diagram/diagram-visual-defaults.d.ts +116 -0
- package/dist/display/blocks/diagram/diagram-visual-defaults.js +400 -0
- package/dist/display/blocks/diagram/layout-utils.d.ts +90 -0
- package/dist/display/blocks/diagram/layout-utils.js +347 -0
- package/dist/display/blocks/diagram/parseDiagramJSON.d.ts +105 -0
- package/dist/display/blocks/diagram/parseDiagramJSON.js +296 -0
- package/dist/display/blocks/diagram/presentation-direction.d.ts +29 -0
- package/dist/display/blocks/diagram/presentation-direction.js +19 -0
- package/dist/display/blocks/diagram/ui-utils.d.ts +1 -0
- package/dist/display/blocks/diagram/ui-utils.js +18 -0
- package/dist/display/blocks/diff/DiffBlock.d.ts +10 -0
- package/dist/display/blocks/diff/DiffBlock.js +119 -0
- package/dist/display/blocks/diff/DiffCanvas.d.ts +15 -0
- package/dist/display/blocks/diff/DiffCanvas.js +20 -0
- package/dist/display/blocks/generic/GenericStructuredBlock.d.ts +24 -0
- package/dist/display/blocks/generic/GenericStructuredBlock.js +53 -0
- package/dist/display/blocks/generic/StructuredValueTabs.d.ts +21 -0
- package/dist/display/blocks/generic/StructuredValueTabs.js +124 -0
- package/dist/display/blocks/generic/tile-actions-slot.d.ts +39 -0
- package/dist/display/blocks/generic/tile-actions-slot.js +33 -0
- package/dist/display/blocks/images/ImageBlock.d.ts +8 -0
- package/dist/display/blocks/images/ImageBlock.js +265 -0
- package/dist/display/blocks/json/JsonBlock.d.ts +34 -0
- package/dist/display/blocks/json/JsonBlock.js +562 -0
- package/dist/display/blocks/json/JsonTableView.d.ts +10 -0
- package/dist/display/blocks/json/JsonTableView.js +173 -0
- package/dist/display/blocks/json/json-compact-stringify.d.ts +25 -0
- package/dist/display/blocks/json/json-compact-stringify.js +52 -0
- package/dist/display/blocks/json/json-tabular-utils.d.ts +65 -0
- package/dist/display/blocks/json/json-tabular-utils.js +121 -0
- package/dist/display/blocks/links/LinkComponent.d.ts +6 -0
- package/dist/display/blocks/links/LinkComponent.js +373 -0
- package/dist/display/blocks/links/LinkComponentWithFetch.d.ts +1 -0
- package/dist/display/blocks/links/LinkComponentWithFetch.js +0 -0
- package/dist/display/blocks/markdown/MarkdownKindBlock.d.ts +48 -0
- package/dist/display/blocks/markdown/MarkdownKindBlock.js +52 -0
- package/dist/display/blocks/markdown-preview/MarkdownPreviewBlock.d.ts +17 -0
- package/dist/display/blocks/markdown-preview/MarkdownPreviewBlock.js +70 -0
- package/dist/display/blocks/mermaid/MermaidBlock.d.ts +19 -0
- package/dist/display/blocks/mermaid/MermaidBlock.js +386 -0
- package/dist/display/blocks/search-replace/SearchReplaceBlock.d.ts +50 -0
- package/dist/display/blocks/search-replace/SearchReplaceBlock.js +71 -0
- package/dist/display/blocks/svg/SvgBlock.d.ts +8 -0
- package/dist/display/blocks/svg/SvgBlock.js +126 -0
- package/dist/display/blocks/table/StreamingTableRenderer.d.ts +53 -0
- package/dist/display/blocks/table/StreamingTableRenderer.js +907 -0
- package/dist/display/blocks/table/TableRenderPathDiagnostic.d.ts +21 -0
- package/dist/display/blocks/table/TableRenderPathDiagnostic.js +79 -0
- package/dist/display/blocks/thinking-reasoning/ConsolidatedReasoningVisualization.d.ts +14 -0
- package/dist/display/blocks/thinking-reasoning/ConsolidatedReasoningVisualization.js +15 -0
- package/dist/display/blocks/thinking-reasoning/ReasoningVisualization.d.ts +13 -0
- package/dist/display/blocks/thinking-reasoning/ReasoningVisualization.js +19 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingTrace.d.ts +30 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingTrace.js +75 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingTraceMarkdown.d.ts +13 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingTraceMarkdown.js +48 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingVisualization.d.ts +12 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingVisualization.js +19 -0
- package/dist/display/blocks/toml/TomlBlock.d.ts +7 -0
- package/dist/display/blocks/toml/TomlBlock.js +167 -0
- package/dist/display/blocks/tree/TreeBlock.d.ts +7 -0
- package/dist/display/blocks/tree/TreeBlock.js +163 -0
- package/dist/display/blocks/xml/XmlBlock.d.ts +23 -0
- package/dist/display/blocks/xml/XmlBlock.js +197 -0
- package/dist/display/blocks/xml/readXmlTag.d.ts +1 -0
- package/dist/display/blocks/xml/readXmlTag.js +1 -0
- package/dist/display/blocks/xml/xml-tokenize.d.ts +13 -0
- package/dist/display/blocks/xml/xml-tokenize.js +169 -0
- package/dist/display/blocks/yaml/YamlBlock.d.ts +7 -0
- package/dist/display/blocks/yaml/YamlBlock.js +191 -0
- package/dist/display/chat-markdown/BasicMarkdownContent.d.ts +29 -0
- package/dist/display/chat-markdown/BasicMarkdownContent.js +122 -0
- package/dist/display/chat-markdown/BlockRenderingContext.d.ts +23 -0
- package/dist/display/chat-markdown/BlockRenderingContext.js +17 -0
- package/dist/display/chat-markdown/ConfigurableMarkdownContent.d.ts +172 -0
- package/dist/display/chat-markdown/ConfigurableMarkdownContent.js +649 -0
- package/dist/display/chat-markdown/InlineCodeSnippet.d.ts +19 -0
- package/dist/display/chat-markdown/InlineCodeSnippet.js +146 -0
- package/dist/display/chat-markdown/InlineCodeSnippetKindGate.d.ts +11 -0
- package/dist/display/chat-markdown/InlineCodeSnippetKindGate.js +9 -0
- package/dist/display/chat-markdown/KindTextGate.d.ts +31 -0
- package/dist/display/chat-markdown/KindTextGate.js +60 -0
- package/dist/display/chat-markdown/QuestionnaireLoadingVisualization.d.ts +6 -0
- package/dist/display/chat-markdown/QuestionnaireLoadingVisualization.js +92 -0
- package/dist/display/chat-markdown/block-registry/BlockComponentRegistry.d.ts +72 -0
- package/dist/display/chat-markdown/block-registry/BlockComponentRegistry.js +94 -0
- package/dist/display/chat-markdown/block-registry/BlockRenderer.d.ts +126 -0
- package/dist/display/chat-markdown/block-registry/BlockRenderer.js +473 -0
- package/dist/display/chat-markdown/block-registry/block-dispatch.d.ts +410 -0
- package/dist/display/chat-markdown/block-registry/block-dispatch.js +495 -0
- package/dist/display/chat-markdown/block-registry/json-parse-utils.d.ts +13 -0
- package/dist/display/chat-markdown/block-registry/json-parse-utils.js +236 -0
- package/dist/display/chat-markdown/constants.d.ts +14 -0
- package/dist/display/chat-markdown/constants.js +317 -0
- package/dist/display/chat-markdown/diff-blocks/DiffCollapsible.d.ts +31 -0
- package/dist/display/chat-markdown/diff-blocks/DiffCollapsible.js +62 -0
- package/dist/display/chat-markdown/diff-blocks/DiffLoadingIndicator.d.ts +12 -0
- package/dist/display/chat-markdown/diff-blocks/DiffLoadingIndicator.js +18 -0
- package/dist/display/chat-markdown/diff-blocks/StreamingDiffBlock.d.ts +22 -0
- package/dist/display/chat-markdown/diff-blocks/StreamingDiffBlock.js +130 -0
- package/dist/display/chat-markdown/diff-blocks/diff-style-registry.d.ts +21 -0
- package/dist/display/chat-markdown/diff-blocks/diff-style-registry.js +91 -0
- package/dist/display/chat-markdown/diff-blocks/renderers/SearchReplaceDiffRenderer.d.ts +26 -0
- package/dist/display/chat-markdown/diff-blocks/renderers/SearchReplaceDiffRenderer.js +186 -0
- package/dist/display/chat-markdown/diff-blocks/types.d.ts +56 -0
- package/dist/display/chat-markdown/diff-blocks/types.js +0 -0
- package/dist/display/chat-markdown/internal-handlers/BlockFallback.d.ts +20 -0
- package/dist/display/chat-markdown/internal-handlers/BlockFallback.js +83 -0
- package/dist/display/chat-markdown/internal-handlers/InlineStatusIndicator.d.ts +4 -0
- package/dist/display/chat-markdown/internal-handlers/InlineStatusIndicator.js +16 -0
- package/dist/display/chat-markdown/internal-handlers/MarkdownErrorBoundary.d.ts +17 -0
- package/dist/display/chat-markdown/internal-handlers/MarkdownErrorBoundary.js +40 -0
- package/dist/display/chat-markdown/internal-handlers/PlainTextFallback.d.ts +8 -0
- package/dist/display/chat-markdown/internal-handlers/PlainTextFallback.js +91 -0
- package/dist/display/chat-markdown/internal-handlers/SafeBlockRenderer.d.ts +20 -0
- package/dist/display/chat-markdown/internal-handlers/SafeBlockRenderer.js +72 -0
- package/dist/display/chat-markdown/kind-source-view.d.ts +14 -0
- package/dist/display/chat-markdown/kind-source-view.js +14 -0
- package/dist/display/chat-markdown/matrx-variables/MatrxVariableInline.d.ts +28 -0
- package/dist/display/chat-markdown/matrx-variables/MatrxVariableInline.js +65 -0
- package/dist/display/chat-markdown/progressive-mount.d.ts +18 -0
- package/dist/display/chat-markdown/progressive-mount.js +90 -0
- package/dist/display/chat-markdown/render-block-to-content-block.d.ts +31 -0
- package/dist/display/chat-markdown/render-block-to-content-block.js +32 -0
- package/dist/display/chat-markdown/settle-stream-blocks.d.ts +50 -0
- package/dist/display/chat-markdown/settle-stream-blocks.js +26 -0
- package/dist/display/chat-markdown/stable-blocks.d.ts +15 -0
- package/dist/display/chat-markdown/stable-blocks.js +54 -0
- package/dist/display/chat-markdown/types.d.ts +11 -0
- package/dist/display/chat-markdown/types.js +26 -0
- package/dist/display/specimen/SpecimenContext.d.ts +26 -0
- package/dist/display/specimen/SpecimenContext.js +64 -0
- package/dist/display/tables/MarkdownTable.d.ts +23 -0
- package/dist/display/tables/MarkdownTable.js +769 -0
- package/dist/display/tables/MarkdownTableScrollArea.d.ts +12 -0
- package/dist/display/tables/MarkdownTableScrollArea.js +92 -0
- package/dist/display/tables/SendToGoogleSheetButton.d.ts +19 -0
- package/dist/display/tables/SendToGoogleSheetButton.js +93 -0
- package/dist/display/tables/SendToWorkbookButton.d.ts +24 -0
- package/dist/display/tables/SendToWorkbookButton.js +93 -0
- package/dist/display/tables/TableSaveToMenu.d.ts +16 -0
- package/dist/display/tables/TableSaveToMenu.js +98 -0
- package/dist/display/tables/TableWithSeparatedControls.d.ts +22 -0
- package/dist/display/tables/TableWithSeparatedControls.js +574 -0
- package/dist/display/tables/ViewTableModal.d.ts +14 -0
- package/dist/display/tables/ViewTableModal.js +67 -0
- package/dist/display/tables/editing/ColumnActionsMenu.d.ts +16 -0
- package/dist/display/tables/editing/ColumnActionsMenu.js +80 -0
- package/dist/display/tables/editing/RowActionsMenu.d.ts +16 -0
- package/dist/display/tables/editing/RowActionsMenu.js +80 -0
- package/dist/display/tables/editing/TableEditToolbar.d.ts +15 -0
- package/dist/display/tables/editing/TableEditToolbar.js +63 -0
- package/dist/display/tables/editing/tableMutations.d.ts +50 -0
- package/dist/display/tables/editing/tableMutations.js +148 -0
- package/dist/display/tables/editing/useDoubleClickEdit.d.ts +43 -0
- package/dist/display/tables/editing/useDoubleClickEdit.js +51 -0
- package/dist/display/tables/editing/useTableUndo.d.ts +25 -0
- package/dist/display/tables/editing/useTableUndo.js +17 -0
- package/dist/display/tables/table-action-row.d.ts +8 -0
- package/dist/display/tables/table-action-row.js +31 -0
- package/dist/display/tables/table-viewer.d.ts +13 -0
- package/dist/display/tables/table-viewer.js +18 -0
- package/dist/host/ErrorActions.d.ts +1 -1
- package/dist/host/ErrorNotice.d.ts +10 -0
- package/dist/host/ErrorNotice.js +19 -0
- package/dist/host/app-bindings.d.ts +155 -0
- package/dist/host/app-bindings.js +160 -0
- package/dist/host/diagnostics.d.ts +2 -2
- package/dist/host/diagnostics.js +2 -1
- package/dist/host/tables.d.ts +1 -6
- package/dist/host/types.d.ts +14 -7
- package/dist/levels/RichContent.d.ts +3 -0
- package/dist/levels/RichContent.js +102 -0
- package/dist/levels/RichContentInline.d.ts +28 -0
- package/dist/levels/RichContentInline.js +61 -0
- package/dist/levels/RichContentPreview.d.ts +12 -0
- package/dist/levels/RichContentPreview.js +39 -0
- package/dist/levels/RichContentStandardImpl.d.ts +12 -0
- package/dist/levels/RichContentStandardImpl.js +27 -0
- package/dist/levels/RichContentStaticProse.d.ts +46 -0
- package/dist/levels/RichContentStaticProse.js +100 -0
- package/dist/levels/depth.d.ts +18 -0
- package/dist/levels/depth.js +32 -0
- package/dist/levels/prose/inline-level-elements.d.ts +19 -0
- package/dist/levels/prose/inline-level-elements.js +103 -0
- package/dist/levels/prose/prose-block-elements.d.ts +25 -0
- package/dist/levels/prose/prose-block-elements.js +313 -0
- package/dist/levels/prose/prose-inline-elements.d.ts +13 -0
- package/dist/levels/prose/prose-inline-elements.js +143 -0
- package/dist/levels/prose/prose-prepare.d.ts +50 -0
- package/dist/levels/prose/prose-prepare.js +246 -0
- package/dist/levels/prose/remote-image-policy.d.ts +34 -0
- package/dist/levels/prose/remote-image-policy.js +153 -0
- package/dist/levels/prose/variant-root.d.ts +9 -0
- package/dist/levels/prose/variant-root.js +34 -0
- package/dist/levels/rich-content-types.d.ts +93 -0
- package/dist/levels/rich-content-types.js +4 -0
- package/dist/levels/server/DelimiterViolationReport.d.ts +7 -0
- package/dist/levels/server/DelimiterViolationReport.js +24 -0
- package/dist/levels/server/RichContentServer.d.ts +27 -0
- package/dist/levels/server/RichContentServer.js +97 -0
- package/dist/levels/standard/NestedRichContent.d.ts +7 -0
- package/dist/levels/standard/NestedRichContent.js +70 -0
- package/dist/levels/standard/StandardBlocks.d.ts +13 -0
- package/dist/levels/standard/StandardBlocks.js +239 -0
- package/dist/levels/standard/StandardKindRegion.d.ts +14 -0
- package/dist/levels/standard/StandardKindRegion.js +69 -0
- package/dist/levels/standard/standard-kind-region.d.ts +19 -0
- package/dist/levels/standard/standard-kind-region.js +21 -0
- package/dist/levels/standard/static-standard.d.ts +23 -0
- package/dist/levels/standard/static-standard.js +187 -0
- package/dist/levels/standard/stream-holdback.d.ts +2 -0
- package/dist/levels/standard/stream-holdback.js +77 -0
- package/dist/mermaid/MermaidFullscreen.d.ts +17 -0
- package/dist/mermaid/MermaidFullscreen.js +71 -0
- package/dist/mermaid/MermaidRenderer.d.ts +20 -0
- package/dist/mermaid/MermaidRenderer.js +267 -0
- package/dist/mermaid/MermaidView.d.ts +27 -0
- package/dist/mermaid/MermaidView.js +68 -0
- package/dist/mermaid/MermaidViewport.d.ts +75 -0
- package/dist/mermaid/MermaidViewport.js +286 -0
- package/dist/mermaid/adapters/er.d.ts +10 -0
- package/dist/mermaid/adapters/er.js +205 -0
- package/dist/mermaid/adapters/flowchart.d.ts +17 -0
- package/dist/mermaid/adapters/flowchart.js +634 -0
- package/dist/mermaid/adapters/journey.d.ts +9 -0
- package/dist/mermaid/adapters/journey.js +207 -0
- package/dist/mermaid/adapters/mindmap.d.ts +12 -0
- package/dist/mermaid/adapters/mindmap.js +252 -0
- package/dist/mermaid/adapters/pie.d.ts +7 -0
- package/dist/mermaid/adapters/pie.js +172 -0
- package/dist/mermaid/adapters/quadrant.d.ts +8 -0
- package/dist/mermaid/adapters/quadrant.js +231 -0
- package/dist/mermaid/adapters/register.d.ts +7 -0
- package/dist/mermaid/adapters/register.js +19 -0
- package/dist/mermaid/adapters/sequence.d.ts +8 -0
- package/dist/mermaid/adapters/sequence.js +251 -0
- package/dist/mermaid/adapters/state.d.ts +12 -0
- package/dist/mermaid/adapters/state.js +245 -0
- package/dist/mermaid/adapters/timeline.d.ts +8 -0
- package/dist/mermaid/adapters/timeline.js +245 -0
- package/dist/mermaid/catalog.d.ts +33 -0
- package/dist/mermaid/catalog.js +202 -0
- package/dist/mermaid/diagram-type.d.ts +39 -0
- package/dist/mermaid/diagram-type.js +89 -0
- package/dist/mermaid/export.d.ts +21 -0
- package/dist/mermaid/export.js +112 -0
- package/dist/mermaid/extract-fence.d.ts +15 -0
- package/dist/mermaid/extract-fence.js +22 -0
- package/dist/mermaid/lazy-draw.d.ts +40 -0
- package/dist/mermaid/lazy-draw.js +168 -0
- package/dist/mermaid/model/adapter.d.ts +28 -0
- package/dist/mermaid/model/adapter.js +16 -0
- package/dist/mermaid/model/ops.d.ts +282 -0
- package/dist/mermaid/model/ops.js +9 -0
- package/dist/mermaid/model/round-trip.d.ts +22 -0
- package/dist/mermaid/model/round-trip.js +45 -0
- package/dist/mermaid/model/types.d.ts +271 -0
- package/dist/mermaid/model/types.js +0 -0
- package/dist/mermaid/print-render.d.ts +9 -0
- package/dist/mermaid/print-render.js +39 -0
- package/dist/mermaid/runtime.d.ts +25 -0
- package/dist/mermaid/runtime.js +183 -0
- package/dist/mermaid/sanitize.d.ts +46 -0
- package/dist/mermaid/sanitize.js +234 -0
- package/dist/mermaid/types.d.ts +43 -0
- package/dist/mermaid/types.js +21 -0
- package/dist/mermaid/view/ViewModePane.d.ts +24 -0
- package/dist/mermaid/view/ViewModePane.js +9 -0
- package/dist/utils/client-lazy.d.ts +1 -1
- package/dist/utils/client-lazy.js +4 -1
- package/dist/utils/lifted/DiffView.d.ts +10 -0
- package/dist/utils/lifted/DiffView.js +26 -0
- package/dist/utils/lifted/IconButton.d.ts +24 -0
- package/dist/utils/lifted/IconButton.js +43 -0
- package/dist/utils/lifted/MatrxMiniLoader.d.ts +1 -0
- package/dist/utils/lifted/MatrxMiniLoader.js +8 -0
- package/dist/utils/lifted/ShimmerText.d.ts +5 -0
- package/dist/utils/lifted/ShimmerText.js +21 -0
- package/dist/utils/lifted/SuspenseLoader.d.ts +16 -0
- package/dist/utils/lifted/SuspenseLoader.js +42 -0
- package/dist/utils/lifted/Tooltip.d.ts +20 -0
- package/dist/utils/lifted/Tooltip.js +52 -0
- package/dist/utils/lifted/artifactId.d.ts +34 -0
- package/dist/utils/lifted/artifactId.js +15 -0
- package/dist/utils/lifted/canvasContent.d.ts +63 -0
- package/dist/utils/lifted/canvasContent.js +98 -0
- package/dist/utils/lifted/captureReactError.d.ts +24 -0
- package/dist/utils/lifted/captureReactError.js +28 -0
- package/dist/utils/lifted/chunk-load-recovery.d.ts +25 -0
- package/dist/utils/lifted/chunk-load-recovery.js +36 -0
- package/dist/utils/lifted/code-editor-agent-types.d.ts +6 -0
- package/dist/utils/lifted/code-editor-agent-types.js +0 -0
- package/dist/utils/lifted/code-editor-agents.d.ts +39 -0
- package/dist/utils/lifted/code-editor-agents.js +52 -0
- package/dist/utils/lifted/code-language-extension.d.ts +1 -0
- package/dist/utils/lifted/code-language-extension.js +60 -0
- package/dist/utils/lifted/custom-icons.d.ts +16 -0
- package/dist/utils/lifted/custom-icons.js +47 -0
- package/dist/utils/lifted/durability.d.ts +16 -0
- package/dist/utils/lifted/durability.js +45 -0
- package/dist/utils/lifted/errors.d.ts +30 -0
- package/dist/utils/lifted/errors.js +29 -0
- package/dist/utils/lifted/html-document.d.ts +1 -0
- package/dist/utils/lifted/html-document.js +12 -0
- package/dist/utils/lifted/languageOptions.d.ts +9 -0
- package/dist/utils/lifted/languageOptions.js +52 -0
- package/dist/utils/lifted/languages.d.ts +34 -0
- package/dist/utils/lifted/languages.js +175 -0
- package/dist/utils/lifted/loading-spinner.d.ts +18 -0
- package/dist/utils/lifted/loading-spinner.js +200 -0
- package/dist/utils/lifted/media-refs.d.ts +13 -0
- package/dist/utils/lifted/media-refs.js +27 -0
- package/dist/utils/lifted/scroll-root.d.ts +1 -0
- package/dist/utils/lifted/scroll-root.js +25 -0
- package/dist/utils/lifted/syntax-themes.d.ts +32 -0
- package/dist/utils/lifted/syntax-themes.js +100 -0
- package/dist/utils/lifted/url-utm.d.ts +24 -0
- package/dist/utils/lifted/url-utm.js +66 -0
- package/dist/utils/lifted/use-is-mounted.d.ts +24 -0
- package/dist/utils/lifted/use-is-mounted.js +21 -0
- package/dist/utils/lifted/useToastManager.d.ts +1 -0
- package/dist/utils/lifted/useToastManager.js +7 -0
- package/dist/utils/report-kind-at-raw-renderer.d.ts +19 -0
- package/dist/utils/report-kind-at-raw-renderer.js +32 -0
- package/package.json +32 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@ai-matrx/design-system";
|
|
4
|
+
import { RichContent } from "./RichContent.js";
|
|
5
|
+
import { inlineKindText } from "@ai-matrx/content-ir/surfaces";
|
|
6
|
+
const CLAMP = {
|
|
7
|
+
1: "truncate",
|
|
8
|
+
2: "line-clamp-2",
|
|
9
|
+
3: "line-clamp-3",
|
|
10
|
+
4: "line-clamp-4",
|
|
11
|
+
6: "line-clamp-6"
|
|
12
|
+
};
|
|
13
|
+
function previewSource(source, lines, maxChars) {
|
|
14
|
+
const picked = [];
|
|
15
|
+
let used = 0;
|
|
16
|
+
for (const line of source.split("\n")) {
|
|
17
|
+
if (!line.trim()) continue;
|
|
18
|
+
if (picked.length >= lines + 1 || used >= maxChars) break;
|
|
19
|
+
picked.push(line.length > maxChars ? line.slice(0, maxChars) : line);
|
|
20
|
+
used += line.length;
|
|
21
|
+
}
|
|
22
|
+
return picked.join("\n\n");
|
|
23
|
+
}
|
|
24
|
+
function RichContentPreview({
|
|
25
|
+
source,
|
|
26
|
+
lines = 2,
|
|
27
|
+
maxChars = 400,
|
|
28
|
+
className
|
|
29
|
+
}) {
|
|
30
|
+
if (!source || !source.trim()) return null;
|
|
31
|
+
const cut = previewSource(inlineKindText(source), lines, maxChars);
|
|
32
|
+
return /* @__PURE__ */ jsx("span", { className: cn("block min-w-0", CLAMP[lines], className), children: /* @__PURE__ */ jsx(RichContent, { source: cut, level: "inline", links: "text", isStreaming: false }) });
|
|
33
|
+
}
|
|
34
|
+
var RichContentPreview_default = RichContentPreview;
|
|
35
|
+
export {
|
|
36
|
+
RichContentPreview,
|
|
37
|
+
RichContentPreview_default as default,
|
|
38
|
+
previewSource
|
|
39
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RichContentVariant } from "./rich-content-types.js";
|
|
2
|
+
import { type ImagePolicyDeclaration } from "./prose/remote-image-policy.js";
|
|
3
|
+
export interface RichContentStandardImplProps {
|
|
4
|
+
source: string;
|
|
5
|
+
isStreaming?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
depthCap?: number;
|
|
8
|
+
variant?: RichContentVariant;
|
|
9
|
+
/** Who wrote this text (remote-image-policy.tsx). Omit to inherit; none anywhere = click to load. */
|
|
10
|
+
imagePolicy?: ImagePolicyDeclaration;
|
|
11
|
+
}
|
|
12
|
+
export default function RichContentStandardImpl({ source, isStreaming, className, depthCap, variant, imagePolicy, }: RichContentStandardImplProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { RichContentDepthProvider } from "./depth.js";
|
|
4
|
+
import { StandardBlocks } from "./standard/StandardBlocks.js";
|
|
5
|
+
import { RichContentVariantRoot } from "./prose/variant-root.js";
|
|
6
|
+
import { withImagePolicy } from "./prose/remote-image-policy.js";
|
|
7
|
+
function RichContentStandardImpl({
|
|
8
|
+
source,
|
|
9
|
+
isStreaming,
|
|
10
|
+
className,
|
|
11
|
+
depthCap,
|
|
12
|
+
variant,
|
|
13
|
+
imagePolicy
|
|
14
|
+
}) {
|
|
15
|
+
const rendered = /* @__PURE__ */ jsx(RichContentVariantRoot, { variant, children: /* @__PURE__ */ jsx(RichContentDepthProvider, { depth: 0, cap: depthCap, children: /* @__PURE__ */ jsx(
|
|
16
|
+
StandardBlocks,
|
|
17
|
+
{
|
|
18
|
+
source,
|
|
19
|
+
isStreaming,
|
|
20
|
+
className
|
|
21
|
+
}
|
|
22
|
+
) }) });
|
|
23
|
+
return /* @__PURE__ */ jsx(Fragment, { children: withImagePolicy(imagePolicy, rendered) });
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
RichContentStandardImpl as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { type InlineLinks } from "./prose/inline-level-elements.js";
|
|
3
|
+
import { type RichContentVariant } from "./rich-content-types.js";
|
|
4
|
+
/** The prose leaf alone (frame + one prose map), statically. */
|
|
5
|
+
export declare function StaticProseLeaf({ content, renderNested, }: {
|
|
6
|
+
content: string;
|
|
7
|
+
/** Accepted for the StaticProse contract; the client core reads the numbering from DocumentNumberingProvider. */
|
|
8
|
+
numbering?: unknown;
|
|
9
|
+
/** Block bodies of directive containers, rendered by the static root. */
|
|
10
|
+
renderNested?: (source: string) => React.ReactNode;
|
|
11
|
+
}): React.JSX.Element | null;
|
|
12
|
+
/**
|
|
13
|
+
* Prose ONLY — one prose leaf, no block splitting. For text that is known to
|
|
14
|
+
* be a single prose block. A document (a note, a shared body, anything that
|
|
15
|
+
* may hold fences or XML sections) uses RichContentStaticStandard.
|
|
16
|
+
*/
|
|
17
|
+
export declare function RichContentStaticProse({ source, variant, }: {
|
|
18
|
+
source: string;
|
|
19
|
+
variant?: RichContentVariant;
|
|
20
|
+
}): React.JSX.Element | null;
|
|
21
|
+
/**
|
|
22
|
+
* The `standard` level, statically (SSR'd client) — the SAME block routing as
|
|
23
|
+
* the server level (standard/static-standard.tsx): the one splitter and
|
|
24
|
+
* nested-fence rule, sections to the depth cap, engine blocks through the
|
|
25
|
+
* client StandardBlock. Markup identical to RichContentServer
|
|
26
|
+
* level="standard" (parity guard, incl. a ```markdown fence with an inner
|
|
27
|
+
* fence). For share pages, public resources and signed documents.
|
|
28
|
+
*/
|
|
29
|
+
export declare function RichContentStaticStandard({ source, variant, depthCap, className, }: {
|
|
30
|
+
source: string;
|
|
31
|
+
variant?: RichContentVariant;
|
|
32
|
+
depthCap?: number;
|
|
33
|
+
className?: string;
|
|
34
|
+
}): React.JSX.Element;
|
|
35
|
+
/**
|
|
36
|
+
* The `inline` level, statically (SSR'd) — phrasing only, valid inside a <p>.
|
|
37
|
+
* Markup identical to RichContentServer level="inline" (parity guard).
|
|
38
|
+
* Inside a link, pass `links="text"` (no nested anchor).
|
|
39
|
+
*/
|
|
40
|
+
export declare function RichContentStaticInline({ source, className, links, }: {
|
|
41
|
+
source: string;
|
|
42
|
+
className?: string;
|
|
43
|
+
/** `text` when the content sits inside a link. */
|
|
44
|
+
links?: InlineLinks;
|
|
45
|
+
}): React.JSX.Element | null;
|
|
46
|
+
export default RichContentStaticProse;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { guardMarkdownDelimiters } from "@ai-matrx/kit/delimiter-guard";
|
|
4
|
+
import MarkdownCoreImpl from "../markdown-core/MarkdownCoreImpl.js";
|
|
5
|
+
import { cn } from "@ai-matrx/design-system";
|
|
6
|
+
import { detectTextDirection, preprocessProse } from "./prose/prose-prepare.js";
|
|
7
|
+
import {
|
|
8
|
+
INLINE_LEVEL_WRAPPER_CLASS,
|
|
9
|
+
inlineLevelElements
|
|
10
|
+
} from "./prose/inline-level-elements.js";
|
|
11
|
+
import {
|
|
12
|
+
proseElementsWithNested,
|
|
13
|
+
PROSE_FRAME_CSS,
|
|
14
|
+
proseFrameClass
|
|
15
|
+
} from "./prose/prose-block-elements.js";
|
|
16
|
+
import { DelimiterViolationReport } from "./server/DelimiterViolationReport.js";
|
|
17
|
+
import { RichContentVariantRoot } from "./prose/variant-root.js";
|
|
18
|
+
import {
|
|
19
|
+
DEFAULT_RICH_CONTENT_DEPTH_CAP
|
|
20
|
+
} from "./rich-content-types.js";
|
|
21
|
+
import { StaticStandard } from "./standard/static-standard.js";
|
|
22
|
+
import { ImagePolicyProvider } from "./prose/remote-image-policy.js";
|
|
23
|
+
function StaticProseLeaf({
|
|
24
|
+
content,
|
|
25
|
+
renderNested
|
|
26
|
+
}) {
|
|
27
|
+
if (!content.trim()) return null;
|
|
28
|
+
const direction = detectTextDirection(content);
|
|
29
|
+
const { text, violations } = guardMarkdownDelimiters(preprocessProse(content));
|
|
30
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
31
|
+
/* @__PURE__ */ jsxs("div", { className: proseFrameClass(direction), dir: direction, children: [
|
|
32
|
+
/* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: PROSE_FRAME_CSS } }),
|
|
33
|
+
/* @__PURE__ */ jsx(MarkdownCoreImpl, { preset: "chat", components: proseElementsWithNested(renderNested), children: text })
|
|
34
|
+
] }),
|
|
35
|
+
violations.length > 0 ? /* @__PURE__ */ jsx(
|
|
36
|
+
DelimiterViolationReport,
|
|
37
|
+
{
|
|
38
|
+
violations,
|
|
39
|
+
renderPath: "RichContentStaticProse"
|
|
40
|
+
}
|
|
41
|
+
) : null
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
function RichContentStaticProse({
|
|
45
|
+
source,
|
|
46
|
+
variant
|
|
47
|
+
}) {
|
|
48
|
+
if (!source.trim()) return null;
|
|
49
|
+
return /* @__PURE__ */ jsx(ImagePolicyProvider, { value: "other", children: /* @__PURE__ */ jsx(RichContentVariantRoot, { variant, children: /* @__PURE__ */ jsx(StaticProseLeaf, { content: source }) }) });
|
|
50
|
+
}
|
|
51
|
+
function RichContentStaticStandard({
|
|
52
|
+
source,
|
|
53
|
+
variant,
|
|
54
|
+
depthCap = DEFAULT_RICH_CONTENT_DEPTH_CAP,
|
|
55
|
+
className
|
|
56
|
+
}) {
|
|
57
|
+
return /* @__PURE__ */ jsx(ImagePolicyProvider, { value: "other", children: /* @__PURE__ */ jsx(RichContentVariantRoot, { variant, children: /* @__PURE__ */ jsx(
|
|
58
|
+
StaticStandard,
|
|
59
|
+
{
|
|
60
|
+
source,
|
|
61
|
+
depth: 0,
|
|
62
|
+
cap: depthCap,
|
|
63
|
+
className,
|
|
64
|
+
Prose: StaticProseLeaf
|
|
65
|
+
}
|
|
66
|
+
) }) });
|
|
67
|
+
}
|
|
68
|
+
function RichContentStaticInline({
|
|
69
|
+
source,
|
|
70
|
+
className,
|
|
71
|
+
links
|
|
72
|
+
}) {
|
|
73
|
+
if (!source.trim()) return null;
|
|
74
|
+
const { text, violations } = guardMarkdownDelimiters(preprocessProse(source));
|
|
75
|
+
return /* @__PURE__ */ jsxs(ImagePolicyProvider, { value: "other", children: [
|
|
76
|
+
/* @__PURE__ */ jsx(
|
|
77
|
+
"span",
|
|
78
|
+
{
|
|
79
|
+
"data-rich-content": "inline",
|
|
80
|
+
className: cn(INLINE_LEVEL_WRAPPER_CLASS, className),
|
|
81
|
+
children: /* @__PURE__ */ jsx(MarkdownCoreImpl, { preset: "chat", components: inlineLevelElements(links), children: text })
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
violations.length > 0 ? /* @__PURE__ */ jsx(
|
|
85
|
+
DelimiterViolationReport,
|
|
86
|
+
{
|
|
87
|
+
violations,
|
|
88
|
+
renderPath: "RichContentStaticInline"
|
|
89
|
+
}
|
|
90
|
+
) : null
|
|
91
|
+
] });
|
|
92
|
+
}
|
|
93
|
+
var RichContentStaticProse_default = RichContentStaticProse;
|
|
94
|
+
export {
|
|
95
|
+
RichContentStaticInline,
|
|
96
|
+
RichContentStaticProse,
|
|
97
|
+
RichContentStaticStandard,
|
|
98
|
+
StaticProseLeaf,
|
|
99
|
+
RichContentStaticProse_default as default
|
|
100
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
interface RichContentDepth {
|
|
3
|
+
/** 0 = top-level content; +1 per nested section/fence/field. */
|
|
4
|
+
depth: number;
|
|
5
|
+
/** Deepest level that still renders formatted. */
|
|
6
|
+
cap: number;
|
|
7
|
+
/** Source of every NestedRichContent above this point (outermost first). */
|
|
8
|
+
ancestors: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
export declare function useRichContentDepth(): RichContentDepth;
|
|
11
|
+
export declare function RichContentDepthProvider({ depth, cap, source, children, }: {
|
|
12
|
+
depth: number;
|
|
13
|
+
cap?: number;
|
|
14
|
+
/** The source rendered under this provider (a nested section's body). */
|
|
15
|
+
source?: string;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
import { DEFAULT_RICH_CONTENT_DEPTH_CAP } from "./rich-content-types.js";
|
|
5
|
+
const RichContentDepthContext = createContext({
|
|
6
|
+
depth: 0,
|
|
7
|
+
cap: DEFAULT_RICH_CONTENT_DEPTH_CAP,
|
|
8
|
+
ancestors: []
|
|
9
|
+
});
|
|
10
|
+
function useRichContentDepth() {
|
|
11
|
+
return useContext(RichContentDepthContext);
|
|
12
|
+
}
|
|
13
|
+
function RichContentDepthProvider({
|
|
14
|
+
depth,
|
|
15
|
+
cap,
|
|
16
|
+
source,
|
|
17
|
+
children
|
|
18
|
+
}) {
|
|
19
|
+
const parent = useContext(RichContentDepthContext);
|
|
20
|
+
const ancestors = source === void 0 ? parent.ancestors : [...parent.ancestors, source];
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
RichContentDepthContext.Provider,
|
|
23
|
+
{
|
|
24
|
+
value: { depth, cap: cap ?? parent.cap, ancestors },
|
|
25
|
+
children
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
RichContentDepthProvider,
|
|
31
|
+
useRichContentDepth
|
|
32
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MarkdownComponents as Components } from "../../markdown-core/markdown-core-types.js";
|
|
2
|
+
/** Paragraph-level spans; a second one in a row starts on its own line. */
|
|
3
|
+
export declare const INLINE_P_CLASS = "rc-inline-p";
|
|
4
|
+
export declare const INLINE_LEVEL_ELEMENTS: Components;
|
|
5
|
+
/** The wrapper classes of the inline level (a second paragraph-level span starts its own line; a lone one flows). */
|
|
6
|
+
export declare const INLINE_LEVEL_WRAPPER_CLASS: string;
|
|
7
|
+
/**
|
|
8
|
+
* How the inline level renders markdown links.
|
|
9
|
+
* - `link` a real link (default).
|
|
10
|
+
* - `text` the link's text with its formatting, no anchor — for inline
|
|
11
|
+
* content that already sits INSIDE a link (a card preview whose
|
|
12
|
+
* whole card is a `<Link>`); a nested `<a>` is invalid HTML and
|
|
13
|
+
* breaks hydration.
|
|
14
|
+
*/
|
|
15
|
+
export type InlineLinks = "link" | "text";
|
|
16
|
+
/** The inline map with links rendered as their text (no anchor). */
|
|
17
|
+
export declare const INLINE_LEVEL_ELEMENTS_LINKS_AS_TEXT: Components;
|
|
18
|
+
/** The inline element map for a `links` choice. */
|
|
19
|
+
export declare function inlineLevelElements(links?: InlineLinks): Components;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@ai-matrx/design-system";
|
|
3
|
+
import { isHeadingAnchorProps } from "../../markdown-core/heading-anchors-props.js";
|
|
4
|
+
import { THICK_HR_SENTINEL } from "./prose-prepare.js";
|
|
5
|
+
import { PROSE_INLINE_ELEMENTS } from "./prose-inline-elements.js";
|
|
6
|
+
import { INLINE_SYNTAX_ELEMENTS } from "../../markdown-core/syntax/elements/core-syntax-elements.js";
|
|
7
|
+
const INLINE_P_CLASS = "rc-inline-p";
|
|
8
|
+
const InlineLink = PROSE_INLINE_ELEMENTS.a;
|
|
9
|
+
const INLINE_LEVEL_ELEMENTS = {
|
|
10
|
+
...PROSE_INLINE_ELEMENTS,
|
|
11
|
+
// The extended syntax's block constructs (callouts, tabs, figures…) as spans.
|
|
12
|
+
...INLINE_SYNTAX_ELEMENTS,
|
|
13
|
+
// The inline level renders no sections, so a heading's hover anchor would
|
|
14
|
+
// link to nothing and read as part of the title: never rendered here.
|
|
15
|
+
a: (props) => isHeadingAnchorProps(props) ? null : /* @__PURE__ */ jsx(InlineLink, { ...props }),
|
|
16
|
+
p: ({ children }) => {
|
|
17
|
+
const only = Array.isArray(children) ? null : children;
|
|
18
|
+
if (only === "\xA0") return /* @__PURE__ */ jsx("span", { "data-rc-block": true, className: "block h-[0.4em]" });
|
|
19
|
+
if (only === THICK_HR_SENTINEL)
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
"span",
|
|
22
|
+
{
|
|
23
|
+
"data-rc-block": true,
|
|
24
|
+
role: "separator",
|
|
25
|
+
className: "my-1.5 block h-[3px] rounded-full bg-blue-500 dark:bg-blue-400"
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
return /* @__PURE__ */ jsx("span", { "data-rc-block": true, className: INLINE_P_CLASS, children });
|
|
29
|
+
},
|
|
30
|
+
h1: ({ children }) => /* @__PURE__ */ jsx("span", { "data-rc-block": true, className: "font-semibold", children }),
|
|
31
|
+
h2: ({ children }) => /* @__PURE__ */ jsx("span", { "data-rc-block": true, className: "font-semibold", children }),
|
|
32
|
+
h3: ({ children }) => /* @__PURE__ */ jsx("span", { "data-rc-block": true, className: "font-semibold", children }),
|
|
33
|
+
h4: ({ children }) => /* @__PURE__ */ jsx("span", { "data-rc-block": true, className: "font-semibold", children }),
|
|
34
|
+
h5: ({ children }) => /* @__PURE__ */ jsx("span", { "data-rc-block": true, className: "font-semibold", children }),
|
|
35
|
+
h6: ({ children }) => /* @__PURE__ */ jsx("span", { "data-rc-block": true, className: "font-semibold", children }),
|
|
36
|
+
ul: ({ children }) => /* @__PURE__ */ jsx("span", { "data-rc-block": true, className: "block list-inside list-disc", children }),
|
|
37
|
+
ol: ({ children }) => /* @__PURE__ */ jsx("span", { "data-rc-block": true, className: "block list-inside list-decimal", children }),
|
|
38
|
+
li: ({ children }) => /* @__PURE__ */ jsx("span", { className: "list-item", children }),
|
|
39
|
+
blockquote: ({ children }) => /* @__PURE__ */ jsx(
|
|
40
|
+
"span",
|
|
41
|
+
{
|
|
42
|
+
"data-rc-block": true,
|
|
43
|
+
className: "block border-l-2 border-border pl-2 italic text-muted-foreground",
|
|
44
|
+
children
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
pre: ({ children }) => /* @__PURE__ */ jsx(
|
|
48
|
+
"span",
|
|
49
|
+
{
|
|
50
|
+
"data-rc-block": true,
|
|
51
|
+
className: "block overflow-x-auto whitespace-pre-wrap rounded bg-muted/60 px-1.5 py-1 font-mono text-[0.9em]",
|
|
52
|
+
children
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
hr: () => /* @__PURE__ */ jsx(
|
|
56
|
+
"span",
|
|
57
|
+
{
|
|
58
|
+
"data-rc-block": true,
|
|
59
|
+
role: "separator",
|
|
60
|
+
className: "my-1 block border-t border-border"
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
div: ({ children, className }) => /* @__PURE__ */ jsx("span", { className: cn("block", className), children }),
|
|
64
|
+
table: ({ children }) => /* @__PURE__ */ jsx(
|
|
65
|
+
"span",
|
|
66
|
+
{
|
|
67
|
+
"data-rc-block": true,
|
|
68
|
+
role: "table",
|
|
69
|
+
className: "my-1 table border-collapse text-[0.9em]",
|
|
70
|
+
children
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
thead: ({ children }) => /* @__PURE__ */ jsx("span", { role: "rowgroup", className: "table-header-group font-semibold", children }),
|
|
74
|
+
tbody: ({ children }) => /* @__PURE__ */ jsx("span", { role: "rowgroup", className: "table-row-group", children }),
|
|
75
|
+
tr: ({ children }) => /* @__PURE__ */ jsx("span", { role: "row", className: "table-row", children }),
|
|
76
|
+
th: ({ children }) => /* @__PURE__ */ jsx(
|
|
77
|
+
"span",
|
|
78
|
+
{
|
|
79
|
+
role: "columnheader",
|
|
80
|
+
className: "table-cell border border-border px-1.5 py-0.5 text-left",
|
|
81
|
+
children
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
td: ({ children }) => /* @__PURE__ */ jsx("span", { role: "cell", className: "table-cell border border-border px-1.5 py-0.5", children })
|
|
85
|
+
};
|
|
86
|
+
const INLINE_LEVEL_WRAPPER_CLASS = cn(
|
|
87
|
+
"rich-content-inline min-w-0 break-words",
|
|
88
|
+
"[&>[data-rc-block]+[data-rc-block]]:mt-1 [&>[data-rc-block]+[data-rc-block]]:block"
|
|
89
|
+
);
|
|
90
|
+
const INLINE_LEVEL_ELEMENTS_LINKS_AS_TEXT = {
|
|
91
|
+
...INLINE_LEVEL_ELEMENTS,
|
|
92
|
+
a: (props) => isHeadingAnchorProps(props) ? null : /* @__PURE__ */ jsx("span", { "data-rc-link-text": "", children: props.children })
|
|
93
|
+
};
|
|
94
|
+
function inlineLevelElements(links = "link") {
|
|
95
|
+
return links === "text" ? INLINE_LEVEL_ELEMENTS_LINKS_AS_TEXT : INLINE_LEVEL_ELEMENTS;
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
INLINE_LEVEL_ELEMENTS,
|
|
99
|
+
INLINE_LEVEL_ELEMENTS_LINKS_AS_TEXT,
|
|
100
|
+
INLINE_LEVEL_WRAPPER_CLASS,
|
|
101
|
+
INLINE_P_CLASS,
|
|
102
|
+
inlineLevelElements
|
|
103
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Element } from "hast";
|
|
3
|
+
import type { MarkdownComponents as Components } from "../../markdown-core/markdown-core-types.js";
|
|
4
|
+
/** The extra prop the core passes every element renderer (react-markdown's `ExtraProps`). */
|
|
5
|
+
type ExtraProps = {
|
|
6
|
+
node?: Element;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A markdown table in the prose leaf's scroll frame. `after` renders beside
|
|
10
|
+
* it (BasicMarkdownContent's admin-only render-path diagnostic).
|
|
11
|
+
*/
|
|
12
|
+
export declare function renderProseTable({ node, children, ...props }: React.TableHTMLAttributes<HTMLTableElement> & ExtraProps, after?: React.ReactNode): React.JSX.Element;
|
|
13
|
+
/** Every element the prose leaf renders. Module scope: stable identity. */
|
|
14
|
+
export declare const PROSE_BLOCK_ELEMENTS: Components;
|
|
15
|
+
/** The prose frame's scoped CSS (display-math centering, indented-code blocks). */
|
|
16
|
+
export declare const PROSE_FRAME_CSS = "\n /* Center display math that appears after a line break */\n .math-content-wrapper p > .block + .katex {\n display: block;\n text-align: center;\n margin: 1em 0;\n font-size: 1.5em;\n }\n /* Increase font size for standalone math paragraphs */\n .math-content-wrapper p.text-center .katex {\n font-size: 1.5em;\n }\n /* Override pre tags that contain inline code (indented text blocks) */\n .math-content-wrapper pre:has(> code.bg-blue-100),\n .math-content-wrapper pre:has(> code.dark\\:bg-blue-900\\/30) {\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow-wrap: anywhere;\n font-family: inherit;\n background: transparent;\n padding: 0;\n margin: 0;\n }\n /* Make the code inside these pre tags behave like inline code */\n .math-content-wrapper pre:has(> code.bg-blue-100) > code,\n .math-content-wrapper pre:has(> code.dark\\:bg-blue-900\\/30) > code {\n white-space: normal;\n display: inline;\n overflow-wrap: anywhere;\n word-break: normal;\n }\n ";
|
|
17
|
+
/** The prose frame's classes for a detected text direction. */
|
|
18
|
+
export declare function proseFrameClass(direction: "rtl" | "ltr"): string;
|
|
19
|
+
/**
|
|
20
|
+
* The prose map for a STATIC root: `matrx-nested` (a directive container's
|
|
21
|
+
* block body) renders through the root's own routing instead of the
|
|
22
|
+
* client-only NestedBody, so its text is in the server HTML.
|
|
23
|
+
*/
|
|
24
|
+
export declare function proseElementsWithNested(renderNested: ((source: string) => React.ReactNode) | undefined): Components;
|
|
25
|
+
export {};
|