@ai-matrx/rich-content 0.2.4 → 0.2.7
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 +25 -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 +48 -10
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useClipboard } from "@ai-matrx/kit/clipboard";
|
|
4
|
+
import { toast } from "../../host/toast.js";
|
|
5
|
+
import { Suspense, lazy, useState } from "react";
|
|
6
|
+
import { useKindSourceView } from "./kind-source-view.js";
|
|
7
|
+
import {
|
|
8
|
+
isJsonFenceLanguage,
|
|
9
|
+
isKindJsonText,
|
|
10
|
+
valueCarriesKind,
|
|
11
|
+
withoutLeadingJsonComments
|
|
12
|
+
} from "@ai-matrx/content-ir/surfaces";
|
|
13
|
+
import { cn } from "@ai-matrx/design-system";
|
|
14
|
+
import { Copy, Check } from "lucide-react";
|
|
15
|
+
import { useThemeMode } from "../../host/app-bindings.js";
|
|
16
|
+
import { ShikiCodeView } from "../../code-block/highlight/ShikiCodeView.js";
|
|
17
|
+
import { MatrxVariableInline } from "./matrx-variables/MatrxVariableInline.js";
|
|
18
|
+
import { Button } from "@ai-matrx/design-system/controls";
|
|
19
|
+
const KindGate = lazy(() => import("./InlineCodeSnippetKindGate.js"));
|
|
20
|
+
function settledKindValue(code, language) {
|
|
21
|
+
if (!isJsonFenceLanguage(language)) return void 0;
|
|
22
|
+
const body = withoutLeadingJsonComments(code).trim();
|
|
23
|
+
if (!isKindJsonText(body)) return void 0;
|
|
24
|
+
try {
|
|
25
|
+
const value = JSON.parse(body);
|
|
26
|
+
return valueCarriesKind(value) ? value : void 0;
|
|
27
|
+
} catch {
|
|
28
|
+
return void 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const VARIABLE_RE = /\{\{([a-zA-Z_][a-zA-Z0-9_.]*)\}\}/g;
|
|
32
|
+
function splitWithVariables(text) {
|
|
33
|
+
VARIABLE_RE.lastIndex = 0;
|
|
34
|
+
const nodes = [];
|
|
35
|
+
let lastIdx = 0;
|
|
36
|
+
let match;
|
|
37
|
+
let i = 0;
|
|
38
|
+
while ((match = VARIABLE_RE.exec(text)) !== null) {
|
|
39
|
+
if (match.index > lastIdx) {
|
|
40
|
+
nodes.push(text.slice(lastIdx, match.index));
|
|
41
|
+
}
|
|
42
|
+
nodes.push(/* @__PURE__ */ jsx(MatrxVariableInline, { "data-name": match[1] }, i++));
|
|
43
|
+
lastIdx = match.index + match[0].length;
|
|
44
|
+
}
|
|
45
|
+
if (lastIdx < text.length) {
|
|
46
|
+
nodes.push(text.slice(lastIdx));
|
|
47
|
+
}
|
|
48
|
+
return nodes.length > 0 ? nodes : [text];
|
|
49
|
+
}
|
|
50
|
+
const LANGUAGE_COLORS = {
|
|
51
|
+
json: "text-emerald-600 dark:text-emerald-400",
|
|
52
|
+
yaml: "text-rose-600 dark:text-rose-400",
|
|
53
|
+
yml: "text-rose-600 dark:text-rose-400",
|
|
54
|
+
xml: "text-teal-600 dark:text-teal-400",
|
|
55
|
+
html: "text-orange-600 dark:text-orange-400",
|
|
56
|
+
css: "text-pink-600 dark:text-pink-400",
|
|
57
|
+
python: "text-yellow-600 dark:text-yellow-400",
|
|
58
|
+
javascript: "text-amber-600 dark:text-amber-400",
|
|
59
|
+
typescript: "text-blue-600 dark:text-blue-400",
|
|
60
|
+
bash: "text-green-600 dark:text-green-400",
|
|
61
|
+
shell: "text-green-600 dark:text-green-400",
|
|
62
|
+
sql: "text-purple-600 dark:text-purple-400",
|
|
63
|
+
rust: "text-orange-600 dark:text-orange-400",
|
|
64
|
+
go: "text-cyan-600 dark:text-cyan-400",
|
|
65
|
+
toml: "text-violet-600 dark:text-violet-400",
|
|
66
|
+
csv: "text-lime-600 dark:text-lime-400"
|
|
67
|
+
};
|
|
68
|
+
const InlineCodeSnippet = ({
|
|
69
|
+
code,
|
|
70
|
+
language,
|
|
71
|
+
className,
|
|
72
|
+
renderVariables = false,
|
|
73
|
+
isStreamActive = false,
|
|
74
|
+
showSource = false
|
|
75
|
+
}) => {
|
|
76
|
+
const { copyText } = useClipboard({
|
|
77
|
+
notify: (message, kind) => kind === "error" ? toast.error(message) : toast.success(message)
|
|
78
|
+
});
|
|
79
|
+
const [copied, setCopied] = useState(false);
|
|
80
|
+
const sourceView = useKindSourceView();
|
|
81
|
+
const kindValue = showSource || sourceView || isStreamActive ? void 0 : settledKindValue(code, language);
|
|
82
|
+
const themeMode = useThemeMode();
|
|
83
|
+
const mode = themeMode === "dark" ? "dark" : "light";
|
|
84
|
+
VARIABLE_RE.lastIndex = 0;
|
|
85
|
+
const hasVariables = VARIABLE_RE.test(code);
|
|
86
|
+
const highlight = !!language && !(renderVariables && hasVariables);
|
|
87
|
+
if (code.length === 0) return null;
|
|
88
|
+
if (kindValue !== void 0) {
|
|
89
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { role: "status", "aria-label": "Loading", className: "my-2 h-12 animate-pulse rounded-md bg-muted/40" }), children: /* @__PURE__ */ jsx(KindGate, { value: kindValue }) });
|
|
90
|
+
}
|
|
91
|
+
const langColor = language ? LANGUAGE_COLORS[language] : void 0;
|
|
92
|
+
const handleCopy = async () => {
|
|
93
|
+
try {
|
|
94
|
+
await copyText(code);
|
|
95
|
+
setCopied(true);
|
|
96
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
97
|
+
} catch {
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
return /* @__PURE__ */ jsxs(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
"data-code-snippet": "",
|
|
104
|
+
"data-kind-source": showSource || sourceView || !isJsonFenceLanguage(language) ? "explicit" : void 0,
|
|
105
|
+
className: cn(
|
|
106
|
+
// not-prose: a surrounding `prose` block gave the <pre> its own
|
|
107
|
+
// ~1.7em top and bottom margins inside this frame (a tall empty band
|
|
108
|
+
// around one line of code on phones).
|
|
109
|
+
"not-prose my-2 rounded-md border border-border bg-muted/50 overflow-x-auto",
|
|
110
|
+
className
|
|
111
|
+
),
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsxs("div", { "data-code-snippet-header": "", className: "flex items-center justify-between px-3 py-1 border-b border-border/50", children: [
|
|
114
|
+
/* @__PURE__ */ jsx(
|
|
115
|
+
"span",
|
|
116
|
+
{
|
|
117
|
+
className: cn(
|
|
118
|
+
"text-xs font-mono font-medium text-muted-foreground",
|
|
119
|
+
langColor
|
|
120
|
+
),
|
|
121
|
+
"data-content-chrome": "",
|
|
122
|
+
children: language || "code"
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
/* @__PURE__ */ jsx(Button, { variant: "quiet", icon: copied ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Copy, {}), onClick: handleCopy, "aria-label": "Copy code", className: "pointer-coarse:-my-3 pointer-coarse:-mr-2" })
|
|
126
|
+
] }),
|
|
127
|
+
highlight ? /* @__PURE__ */ jsx(
|
|
128
|
+
ShikiCodeView,
|
|
129
|
+
{
|
|
130
|
+
code,
|
|
131
|
+
language,
|
|
132
|
+
mode,
|
|
133
|
+
surface: "transparent",
|
|
134
|
+
padding: { y: 0.5, x: 0.75 },
|
|
135
|
+
fontSize: 14
|
|
136
|
+
}
|
|
137
|
+
) : /* @__PURE__ */ jsx("pre", { className: "px-3 py-2 text-sm font-mono leading-relaxed text-foreground whitespace-pre-wrap break-words", children: /* @__PURE__ */ jsx("code", { children: renderVariables && hasVariables ? splitWithVariables(code) : code }) })
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
var InlineCodeSnippet_default = InlineCodeSnippet;
|
|
143
|
+
export {
|
|
144
|
+
InlineCodeSnippet,
|
|
145
|
+
InlineCodeSnippet_default as default
|
|
146
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The compact snippet's kind refusal (X1): a settled json / jsonc / json5 /
|
|
3
|
+
* unlabelled snippet whose text is kind JSON is drawn as its kind, exactly as
|
|
4
|
+
* `CodeBlock` does (`KindDataGate` — and the caller is reported). Behind a
|
|
5
|
+
* lazy edge from `InlineCodeSnippet`, which the block engine imports
|
|
6
|
+
* statically and which must not pull the kind route into that graph.
|
|
7
|
+
*/
|
|
8
|
+
import React from "react";
|
|
9
|
+
export default function InlineCodeSnippetKindGate({ value }: {
|
|
10
|
+
value: unknown;
|
|
11
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { KindDataGate } from "../../host/app-bindings.js";
|
|
4
|
+
function InlineCodeSnippetKindGate({ value }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(KindDataGate, { component: "InlineCodeSnippet", data: value, children: null });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
InlineCodeSnippetKindGate as default
|
|
9
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KindTextGate — the bottom-layer refusal for the plain markdown leaves
|
|
3
|
+
* (`BasicMarkdownContent`, `ConfigurableMarkdownContent`, `MarkdownRenderer`,
|
|
4
|
+
* `MarkdownWithPlugins`). Each of them draws a ```json fence as a code card and
|
|
5
|
+
* a bare object as prose, so text carrying a `__kind` key (Arman, 2026-09-30:
|
|
6
|
+
* a kind is never drawn as raw JSON) is handed to the canonical pipeline,
|
|
7
|
+
* `MarkdownStream`, instead — and the caller is filed in the Error Inspector.
|
|
8
|
+
*
|
|
9
|
+
* Recursion: `MarkdownStream` itself draws prose through `BasicMarkdownContent`.
|
|
10
|
+
* Every rerouted text is recorded in context; a leaf below handed that same
|
|
11
|
+
* text (or a slice of it) renders it itself, so the pipeline never loops back.
|
|
12
|
+
*/
|
|
13
|
+
import React from "react";
|
|
14
|
+
import type { ImagePolicyDeclaration } from "../../levels/prose/remote-image-policy.js";
|
|
15
|
+
export { KindSourceView, useKindSourceView } from "./kind-source-view.js";
|
|
16
|
+
export interface KindTextGateProps {
|
|
17
|
+
/** The leaf's own name, for the report. */
|
|
18
|
+
component: string;
|
|
19
|
+
content: string;
|
|
20
|
+
isStreamActive?: boolean;
|
|
21
|
+
imagePolicy?: ImagePolicyDeclaration;
|
|
22
|
+
/** A deliberate source view (docs, authoring) keeps the leaf's own rendering. */
|
|
23
|
+
showSource?: boolean;
|
|
24
|
+
/** Whether the pipeline shows its copy control (the leaf's own setting). */
|
|
25
|
+
showCopyButton?: boolean;
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
/** Whether a leaf should hand this text to the pipeline instead of drawing it. */
|
|
29
|
+
export declare function textNeedsKindPipeline(content: string, rerouted: readonly string[]): boolean;
|
|
30
|
+
export declare function KindTextGate({ component, content, isStreamActive, imagePolicy, showSource, showCopyButton, children, }: KindTextGateProps): React.JSX.Element;
|
|
31
|
+
export default KindTextGate;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
import { MarkdownStream } from "../../host/app-bindings.js";
|
|
5
|
+
import {
|
|
6
|
+
firstKindSlug,
|
|
7
|
+
isKindJsonText,
|
|
8
|
+
markdownCarriesKind
|
|
9
|
+
} from "@ai-matrx/content-ir/surfaces";
|
|
10
|
+
import { KindSourceView, useKindSourceView } from "./kind-source-view.js";
|
|
11
|
+
import { spelledKindsAsOneLine } from "@ai-matrx/content-ir/surfaces";
|
|
12
|
+
import { useReportKindAtRawRenderer } from "../../utils/report-kind-at-raw-renderer.js";
|
|
13
|
+
const ReroutedTextsContext = createContext([]);
|
|
14
|
+
import { KindSourceView as KindSourceView2, useKindSourceView as useKindSourceView2 } from "./kind-source-view.js";
|
|
15
|
+
function textNeedsKindPipeline(content, rerouted) {
|
|
16
|
+
if (!content || !markdownCarriesKind(spelledKindsAsOneLine(content))) return false;
|
|
17
|
+
const own = content.trim();
|
|
18
|
+
return !rerouted.some((text) => text.includes(own));
|
|
19
|
+
}
|
|
20
|
+
function KindTextGate({
|
|
21
|
+
component,
|
|
22
|
+
content,
|
|
23
|
+
isStreamActive,
|
|
24
|
+
imagePolicy,
|
|
25
|
+
showSource = false,
|
|
26
|
+
showCopyButton = false,
|
|
27
|
+
children
|
|
28
|
+
}) {
|
|
29
|
+
const rerouted = useContext(ReroutedTextsContext);
|
|
30
|
+
const sourceView = useKindSourceView();
|
|
31
|
+
const reroute = !showSource && !sourceView && textNeedsKindPipeline(content, rerouted);
|
|
32
|
+
useReportKindAtRawRenderer(
|
|
33
|
+
component,
|
|
34
|
+
reroute ? firstKindSlug(content) : null,
|
|
35
|
+
reroute
|
|
36
|
+
);
|
|
37
|
+
if (!reroute) return showSource ? /* @__PURE__ */ jsx(KindSourceView, { children }) : /* @__PURE__ */ jsx(Fragment, { children });
|
|
38
|
+
const trimmed = content.trim();
|
|
39
|
+
const pipelineText = isKindJsonText(trimmed) ? `\`\`\`json
|
|
40
|
+
${trimmed}
|
|
41
|
+
\`\`\`` : content;
|
|
42
|
+
const nextRerouted = [...rerouted, trimmed, pipelineText.trim()];
|
|
43
|
+
return /* @__PURE__ */ jsx(ReroutedTextsContext.Provider, { value: nextRerouted, children: /* @__PURE__ */ jsx(
|
|
44
|
+
MarkdownStream,
|
|
45
|
+
{
|
|
46
|
+
content: pipelineText,
|
|
47
|
+
isStreamActive,
|
|
48
|
+
imagePolicy: imagePolicy ?? "inherit",
|
|
49
|
+
hideCopyButton: !showCopyButton
|
|
50
|
+
}
|
|
51
|
+
) });
|
|
52
|
+
}
|
|
53
|
+
var KindTextGate_default = KindTextGate;
|
|
54
|
+
export {
|
|
55
|
+
KindSourceView2 as KindSourceView,
|
|
56
|
+
KindTextGate,
|
|
57
|
+
KindTextGate_default as default,
|
|
58
|
+
textNeedsKindPipeline,
|
|
59
|
+
useKindSourceView2 as useKindSourceView
|
|
60
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import { cn } from "@ai-matrx/design-system";
|
|
5
|
+
const QuestionnaireLoadingVisualization = ({
|
|
6
|
+
className
|
|
7
|
+
}) => {
|
|
8
|
+
const messages = [
|
|
9
|
+
"I'm reviewing your request...",
|
|
10
|
+
"Analyzing what I already know...",
|
|
11
|
+
"Looking for missing information...",
|
|
12
|
+
"Coming up with some good questions...",
|
|
13
|
+
"Identifying additional information gaps...",
|
|
14
|
+
"Creating answer options to make this easier for you...",
|
|
15
|
+
"Finalizing a simple & complete questionnaire..."
|
|
16
|
+
];
|
|
17
|
+
const [currentMessageIndex, setCurrentMessageIndex] = useState(0);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (currentMessageIndex >= messages.length - 1) {
|
|
20
|
+
return void 0;
|
|
21
|
+
}
|
|
22
|
+
const interval = setInterval(() => {
|
|
23
|
+
setCurrentMessageIndex((prev) => {
|
|
24
|
+
const nextIndex = prev + 1;
|
|
25
|
+
return nextIndex >= messages.length - 1 ? messages.length - 1 : nextIndex;
|
|
26
|
+
});
|
|
27
|
+
}, 2e3);
|
|
28
|
+
return () => clearInterval(interval);
|
|
29
|
+
}, [currentMessageIndex, messages.length]);
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(
|
|
31
|
+
"w-full space-y-6 p-6 rounded-lg",
|
|
32
|
+
"bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-950/30 dark:to-indigo-950/30",
|
|
33
|
+
"border border-blue-200 dark:border-blue-800/50",
|
|
34
|
+
className
|
|
35
|
+
), children: [
|
|
36
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
37
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 bg-gradient-to-r from-blue-200 to-blue-300 dark:from-blue-700 dark:to-blue-600 rounded animate-pulse" }),
|
|
38
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 bg-gradient-to-r from-blue-100 to-blue-200 dark:from-blue-800 dark:to-blue-700 rounded w-3/4 animate-pulse" })
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
41
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
42
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 bg-gray-200 dark:bg-gray-700 rounded w-1/3 animate-pulse" }),
|
|
43
|
+
/* @__PURE__ */ jsx("div", { className: "h-10 bg-textured border border-gray-300 dark:border-gray-600 rounded-md animate-pulse" })
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
46
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 bg-gray-200 dark:bg-gray-700 rounded w-1/2 animate-pulse" }),
|
|
47
|
+
/* @__PURE__ */ jsx("div", { className: "h-10 bg-textured border border-gray-300 dark:border-gray-600 rounded-md animate-pulse" })
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
50
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 bg-gray-200 dark:bg-gray-700 rounded w-2/5 animate-pulse" }),
|
|
51
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2 pl-4", children: [
|
|
52
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-3", children: [
|
|
53
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-4 bg-gray-300 dark:bg-gray-600 rounded animate-pulse" }),
|
|
54
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 bg-gray-200 dark:bg-gray-700 rounded w-24 animate-pulse" })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-3", children: [
|
|
57
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-4 bg-gray-300 dark:bg-gray-600 rounded animate-pulse" }),
|
|
58
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 bg-gray-200 dark:bg-gray-700 rounded w-32 animate-pulse" })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-3", children: [
|
|
61
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-4 bg-gray-300 dark:bg-gray-600 rounded animate-pulse" }),
|
|
62
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 bg-gray-200 dark:bg-gray-700 rounded w-20 animate-pulse" })
|
|
63
|
+
] })
|
|
64
|
+
] })
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
67
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 bg-gray-200 dark:bg-gray-700 rounded w-1/4 animate-pulse" }),
|
|
68
|
+
/* @__PURE__ */ jsx("div", { className: "h-20 bg-textured border border-gray-300 dark:border-gray-600 rounded-md animate-pulse" })
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
71
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 bg-gray-200 dark:bg-gray-700 rounded w-2/5 animate-pulse" }),
|
|
72
|
+
/* @__PURE__ */ jsx("div", { className: "h-10 bg-textured border border-gray-300 dark:border-gray-600 rounded-md animate-pulse" })
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
75
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 bg-gray-200 dark:bg-gray-700 rounded w-1/3 animate-pulse" }),
|
|
76
|
+
/* @__PURE__ */ jsx("div", { className: "h-10 bg-textured border border-gray-300 dark:border-gray-600 rounded-md animate-pulse relative", children: /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsx("div", { className: "h-2 w-2 bg-gray-400 dark:bg-gray-500 rounded animate-pulse" }) }) })
|
|
77
|
+
] })
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center space-x-3 pt-4", children: [
|
|
80
|
+
/* @__PURE__ */ jsxs("div", { className: "flex space-x-1", children: [
|
|
81
|
+
/* @__PURE__ */ jsx("div", { className: "h-2 w-2 bg-blue-500 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
|
|
82
|
+
/* @__PURE__ */ jsx("div", { className: "h-2 w-2 bg-blue-500 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
|
|
83
|
+
/* @__PURE__ */ jsx("div", { className: "h-2 w-2 bg-blue-500 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-blue-600 dark:text-blue-400 font-medium transition-all duration-300", children: messages[currentMessageIndex] })
|
|
86
|
+
] })
|
|
87
|
+
] });
|
|
88
|
+
};
|
|
89
|
+
var QuestionnaireLoadingVisualization_default = QuestionnaireLoadingVisualization;
|
|
90
|
+
export {
|
|
91
|
+
QuestionnaireLoadingVisualization_default as default
|
|
92
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ThinkingVisualization from "../../blocks/thinking-reasoning/ThinkingVisualization.js";
|
|
3
|
+
import ReasoningVisualization from "../../blocks/thinking-reasoning/ReasoningVisualization.js";
|
|
4
|
+
import ConsolidatedReasoningVisualization from "../../blocks/thinking-reasoning/ConsolidatedReasoningVisualization.js";
|
|
5
|
+
import ImageBlock from "../../blocks/images/ImageBlock.js";
|
|
6
|
+
import SvgBlock from "../../blocks/svg/SvgBlock.js";
|
|
7
|
+
import ChartBlock from "../../blocks/chart/ChartBlock.js";
|
|
8
|
+
import MarkdownTable from "../../tables/MarkdownTable.js";
|
|
9
|
+
import { StreamingTableRenderer as StreamingTableRenderer } from "../../blocks/table/StreamingTableRenderer.js";
|
|
10
|
+
import YamlBlock from "../../blocks/yaml/YamlBlock.js";
|
|
11
|
+
import XmlBlock from "../../blocks/xml/XmlBlock.js";
|
|
12
|
+
import CsvBlock from "../../blocks/csv/CsvBlock.js";
|
|
13
|
+
import { JsonBlock as JsonBlock } from "../../blocks/json/JsonBlock.js";
|
|
14
|
+
import TomlBlock from "../../blocks/toml/TomlBlock.js";
|
|
15
|
+
import TreeBlock from "../../blocks/tree/TreeBlock.js";
|
|
16
|
+
import MarkdownPreviewBlock from "../../blocks/markdown-preview/MarkdownPreviewBlock.js";
|
|
17
|
+
declare const CodeBlock: React.LazyExoticComponent<React.FC<import("../../../code-block/CodeBlock.js").CodeBlockProps>>;
|
|
18
|
+
declare const InteractiveDiagramBlock: React.LazyExoticComponent<React.FC<import("../../blocks/diagram/InteractiveDiagramBlock.js").InteractiveDiagramBlockProps>>;
|
|
19
|
+
declare const MermaidBlock: React.LazyExoticComponent<React.FC<import("../../blocks/mermaid/MermaidBlock.js").MermaidBlockProps>>;
|
|
20
|
+
declare const StreamingDiffBlock: React.LazyExoticComponent<React.FC<import("../diff-blocks/StreamingDiffBlock.js").StreamingDiffBlockProps>>;
|
|
21
|
+
declare const SearchReplaceBlock: React.LazyExoticComponent<React.FC<import("../../blocks/search-replace/SearchReplaceBlock.js").SearchReplaceBlockProps>>;
|
|
22
|
+
/**
|
|
23
|
+
* Export wrapped components for use in MarkdownStream
|
|
24
|
+
*/
|
|
25
|
+
declare const BUILTIN_BLOCK_COMPONENTS: {
|
|
26
|
+
BasicMarkdownContent: React.FC<import("../BasicMarkdownContent.js").BasicMarkdownContentProps>;
|
|
27
|
+
CodeBlock: (props: React.ComponentProps<typeof CodeBlock>) => React.JSX.Element;
|
|
28
|
+
ThinkingVisualization: (props: React.ComponentProps<typeof ThinkingVisualization>) => React.JSX.Element;
|
|
29
|
+
ReasoningVisualization: (props: React.ComponentProps<typeof ReasoningVisualization>) => React.JSX.Element;
|
|
30
|
+
ConsolidatedReasoningVisualization: (props: React.ComponentProps<typeof ConsolidatedReasoningVisualization>) => React.JSX.Element;
|
|
31
|
+
ImageBlock: (props: React.ComponentProps<typeof ImageBlock>) => React.JSX.Element;
|
|
32
|
+
InteractiveDiagramBlock: (props: React.ComponentProps<typeof InteractiveDiagramBlock>) => React.JSX.Element;
|
|
33
|
+
MermaidBlock: (props: React.ComponentProps<typeof MermaidBlock>) => React.JSX.Element;
|
|
34
|
+
SvgBlock: (props: React.ComponentProps<typeof SvgBlock>) => React.JSX.Element;
|
|
35
|
+
ChartBlock: (props: React.ComponentProps<typeof ChartBlock>) => React.JSX.Element;
|
|
36
|
+
MarkdownTable: (props: React.ComponentProps<typeof MarkdownTable>) => React.JSX.Element;
|
|
37
|
+
StreamingTableRenderer: (props: React.ComponentProps<typeof StreamingTableRenderer>) => React.JSX.Element;
|
|
38
|
+
StreamingDiffBlock: (props: React.ComponentProps<typeof StreamingDiffBlock>) => React.JSX.Element;
|
|
39
|
+
SearchReplaceBlock: (props: React.ComponentProps<typeof SearchReplaceBlock>) => React.JSX.Element;
|
|
40
|
+
YamlBlock: (props: React.ComponentProps<typeof YamlBlock>) => React.JSX.Element;
|
|
41
|
+
XmlBlock: (props: React.ComponentProps<typeof XmlBlock>) => React.JSX.Element;
|
|
42
|
+
CsvBlock: (props: React.ComponentProps<typeof CsvBlock>) => React.JSX.Element;
|
|
43
|
+
JsonBlock: (props: React.ComponentProps<typeof JsonBlock>) => React.JSX.Element;
|
|
44
|
+
TomlBlock: (props: React.ComponentProps<typeof TomlBlock>) => React.JSX.Element;
|
|
45
|
+
TreeBlock: (props: React.ComponentProps<typeof TreeBlock>) => React.JSX.Element;
|
|
46
|
+
MarkdownPreviewBlock: (props: React.ComponentProps<typeof MarkdownPreviewBlock>) => React.JSX.Element;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Export wrapped loading visualization components
|
|
50
|
+
*/
|
|
51
|
+
declare const BUILTIN_LOADING_COMPONENTS: {
|
|
52
|
+
DiagramLoading: () => React.JSX.Element;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* THE BLOCK COMPONENT REGISTRY. The engine ships the generic components above; a host registers
|
|
56
|
+
* its own (domain kinds, app previews) with `registerBlockComponents` — matrx-frontend does so
|
|
57
|
+
* from `components/mardown-display/chat-markdown/block-registry/BlockComponentRegistry.tsx`.
|
|
58
|
+
* Lookups read the registered map first, so a host can also replace a built-in. Kept on
|
|
59
|
+
* `globalThis` so a dual-loader graph sees one registry.
|
|
60
|
+
*/
|
|
61
|
+
export type RegisteredBlockComponent = React.ComponentType<any>;
|
|
62
|
+
export declare function registerBlockComponents(components: Record<string, RegisteredBlockComponent>): void;
|
|
63
|
+
export declare function registerLoadingComponents(components: Record<string, RegisteredBlockComponent>): void;
|
|
64
|
+
type BlockComponentMap = typeof BUILTIN_BLOCK_COMPONENTS & {
|
|
65
|
+
readonly [name: string]: RegisteredBlockComponent | undefined;
|
|
66
|
+
};
|
|
67
|
+
type LoadingComponentMap = typeof BUILTIN_LOADING_COMPONENTS & {
|
|
68
|
+
readonly [name: string]: RegisteredBlockComponent | undefined;
|
|
69
|
+
};
|
|
70
|
+
export declare const BlockComponents: BlockComponentMap;
|
|
71
|
+
export declare const LoadingComponents: LoadingComponentMap;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Suspense, lazy } from "react";
|
|
4
|
+
import ThinkingVisualization from "../../blocks/thinking-reasoning/ThinkingVisualization.js";
|
|
5
|
+
import ReasoningVisualization from "../../blocks/thinking-reasoning/ReasoningVisualization.js";
|
|
6
|
+
import ConsolidatedReasoningVisualization from "../../blocks/thinking-reasoning/ConsolidatedReasoningVisualization.js";
|
|
7
|
+
import ImageBlock from "../../blocks/images/ImageBlock.js";
|
|
8
|
+
import SvgBlock from "../../blocks/svg/SvgBlock.js";
|
|
9
|
+
import ChartBlock from "../../blocks/chart/ChartBlock.js";
|
|
10
|
+
import MarkdownTable from "../../tables/MarkdownTable.js";
|
|
11
|
+
import { StreamingTableRenderer } from "../../blocks/table/StreamingTableRenderer.js";
|
|
12
|
+
import YamlBlock from "../../blocks/yaml/YamlBlock.js";
|
|
13
|
+
import XmlBlock from "../../blocks/xml/XmlBlock.js";
|
|
14
|
+
import CsvBlock from "../../blocks/csv/CsvBlock.js";
|
|
15
|
+
import { JsonBlock } from "../../blocks/json/JsonBlock.js";
|
|
16
|
+
import TomlBlock from "../../blocks/toml/TomlBlock.js";
|
|
17
|
+
import TreeBlock from "../../blocks/tree/TreeBlock.js";
|
|
18
|
+
import MarkdownPreviewBlock from "../../blocks/markdown-preview/MarkdownPreviewBlock.js";
|
|
19
|
+
import DiagramLoadingVisualization from "../../blocks/diagram/DiagramLoadingVisualization.js";
|
|
20
|
+
import MatrxMiniLoader from "../../../utils/lifted/MatrxMiniLoader.js";
|
|
21
|
+
import BasicMarkdownContent from "../BasicMarkdownContent.js";
|
|
22
|
+
const CodeBlock = lazy(
|
|
23
|
+
() => import("../../../code-block/CodeBlock.js")
|
|
24
|
+
);
|
|
25
|
+
const InteractiveDiagramBlock = lazy(
|
|
26
|
+
() => import("../../blocks/diagram/InteractiveDiagramBlock.js")
|
|
27
|
+
);
|
|
28
|
+
const MermaidBlock = lazy(() => import("../../blocks/mermaid/MermaidBlock.js"));
|
|
29
|
+
const StreamingDiffBlock = lazy(
|
|
30
|
+
() => import("../diff-blocks/StreamingDiffBlock.js").then((m) => ({
|
|
31
|
+
default: m.StreamingDiffBlock
|
|
32
|
+
}))
|
|
33
|
+
);
|
|
34
|
+
const SearchReplaceBlock = lazy(
|
|
35
|
+
() => import("../../blocks/search-replace/SearchReplaceBlock.js").then((m) => ({
|
|
36
|
+
default: m.SearchReplaceBlock
|
|
37
|
+
}))
|
|
38
|
+
);
|
|
39
|
+
const LazyBlockWrapper = ({
|
|
40
|
+
children,
|
|
41
|
+
fallback
|
|
42
|
+
}) => /* @__PURE__ */ jsx(Suspense, { fallback: fallback || /* @__PURE__ */ jsx(MatrxMiniLoader, {}), children });
|
|
43
|
+
const BUILTIN_BLOCK_COMPONENTS = {
|
|
44
|
+
// Lightweight components
|
|
45
|
+
BasicMarkdownContent,
|
|
46
|
+
// CodeBlock is lazy-loaded to avoid circular dependency with Redux
|
|
47
|
+
CodeBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(CodeBlock, { ...props }) }),
|
|
48
|
+
// Wrapped lazy components
|
|
49
|
+
ThinkingVisualization: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(ThinkingVisualization, { ...props }) }),
|
|
50
|
+
ReasoningVisualization: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(ReasoningVisualization, { ...props }) }),
|
|
51
|
+
ConsolidatedReasoningVisualization: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(ConsolidatedReasoningVisualization, { ...props }) }),
|
|
52
|
+
ImageBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(ImageBlock, { ...props }) }),
|
|
53
|
+
InteractiveDiagramBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(InteractiveDiagramBlock, { ...props }) }),
|
|
54
|
+
MermaidBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(MermaidBlock, { ...props }) }),
|
|
55
|
+
SvgBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(SvgBlock, { ...props }) }),
|
|
56
|
+
ChartBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(ChartBlock, { ...props }) }),
|
|
57
|
+
MarkdownTable: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(MarkdownTable, { ...props }) }),
|
|
58
|
+
StreamingTableRenderer: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(StreamingTableRenderer, { ...props }) }),
|
|
59
|
+
StreamingDiffBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(StreamingDiffBlock, { ...props }) }),
|
|
60
|
+
SearchReplaceBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(SearchReplaceBlock, { ...props }) }),
|
|
61
|
+
YamlBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(YamlBlock, { ...props }) }),
|
|
62
|
+
XmlBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(XmlBlock, { ...props }) }),
|
|
63
|
+
CsvBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(CsvBlock, { ...props }) }),
|
|
64
|
+
JsonBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(JsonBlock, { ...props }) }),
|
|
65
|
+
TomlBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(TomlBlock, { ...props }) }),
|
|
66
|
+
TreeBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(TreeBlock, { ...props }) }),
|
|
67
|
+
MarkdownPreviewBlock: (props) => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(MarkdownPreviewBlock, { ...props }) })
|
|
68
|
+
};
|
|
69
|
+
const BUILTIN_LOADING_COMPONENTS = {
|
|
70
|
+
DiagramLoading: () => /* @__PURE__ */ jsx(LazyBlockWrapper, { children: /* @__PURE__ */ jsx(DiagramLoadingVisualization, {}) })
|
|
71
|
+
};
|
|
72
|
+
const REGISTRY_KEY = /* @__PURE__ */ Symbol.for("ai-matrx.rich-content.block-components");
|
|
73
|
+
function registry() {
|
|
74
|
+
const g = globalThis;
|
|
75
|
+
return g[REGISTRY_KEY] ??= { blocks: {}, loading: {} };
|
|
76
|
+
}
|
|
77
|
+
function registerBlockComponents(components) {
|
|
78
|
+
Object.assign(registry().blocks, components);
|
|
79
|
+
}
|
|
80
|
+
function registerLoadingComponents(components) {
|
|
81
|
+
Object.assign(registry().loading, components);
|
|
82
|
+
}
|
|
83
|
+
const BlockComponents = new Proxy(BUILTIN_BLOCK_COMPONENTS, {
|
|
84
|
+
get: (target, key) => typeof key === "string" && registry().blocks[key] || target[key]
|
|
85
|
+
});
|
|
86
|
+
const LoadingComponents = new Proxy(BUILTIN_LOADING_COMPONENTS, {
|
|
87
|
+
get: (target, key) => typeof key === "string" && registry().loading[key] || target[key]
|
|
88
|
+
});
|
|
89
|
+
export {
|
|
90
|
+
BlockComponents,
|
|
91
|
+
LoadingComponents,
|
|
92
|
+
registerBlockComponents,
|
|
93
|
+
registerLoadingComponents
|
|
94
|
+
};
|