@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,29 @@
|
|
|
1
|
+
import { extractErrorMessage } from "@ai-matrx/data/net";
|
|
2
|
+
import { makeAssertData } from "@ai-matrx/kit/errors";
|
|
3
|
+
import {
|
|
4
|
+
humanizeBackendError,
|
|
5
|
+
makeAssertData as makeAssertData2,
|
|
6
|
+
operationFailed,
|
|
7
|
+
stripTerminalCodes
|
|
8
|
+
} from "@ai-matrx/kit/errors";
|
|
9
|
+
function makeGovernedDataAsserter(action, governanceCode) {
|
|
10
|
+
const assertData = makeAssertData(action);
|
|
11
|
+
return function assertGovernedData(data, error, override) {
|
|
12
|
+
if (error) {
|
|
13
|
+
const message = extractErrorMessage(error).split(" \xB7 ")[0];
|
|
14
|
+
const governed = message.match(governanceCode);
|
|
15
|
+
if (governed) {
|
|
16
|
+
throw new Error(message.slice(governed[0].length), { cause: error });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return assertData(data, error, override);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
extractErrorMessage,
|
|
24
|
+
humanizeBackendError,
|
|
25
|
+
makeAssertData2 as makeAssertData,
|
|
26
|
+
makeGovernedDataAsserter,
|
|
27
|
+
operationFailed,
|
|
28
|
+
stripTerminalCodes
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isCompleteHtmlDocument(code: string): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function isCompleteHtmlDocument(code) {
|
|
2
|
+
if (!code) return false;
|
|
3
|
+
const trimmed = code.trim();
|
|
4
|
+
const hasDoctype = /^\s*<!DOCTYPE\s+html/i.test(trimmed);
|
|
5
|
+
const hasHtmlTag = /<html[^>]*>/i.test(trimmed) && /<\/html>/i.test(trimmed);
|
|
6
|
+
const hasHead = /<head[^>]*>/i.test(trimmed) && /<\/head>/i.test(trimmed);
|
|
7
|
+
const hasBody = /<body[^>]*>/i.test(trimmed) && /<\/body>/i.test(trimmed);
|
|
8
|
+
return hasDoctype && hasHtmlTag && hasHead && hasBody;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
isCompleteHtmlDocument
|
|
12
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface LanguageOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
/** Common file extensions (no leading dot). */
|
|
5
|
+
exts: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare const LANGUAGE_OPTIONS: LanguageOption[];
|
|
8
|
+
export declare function extensionForLanguage(language: string): string;
|
|
9
|
+
export declare function languageFromName(name: string): string;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const LANGUAGE_OPTIONS = [
|
|
2
|
+
{ value: "plaintext", label: "Plain Text", exts: ["txt"] },
|
|
3
|
+
{ value: "typescript", label: "TypeScript", exts: ["ts", "tsx"] },
|
|
4
|
+
{
|
|
5
|
+
value: "javascript",
|
|
6
|
+
label: "JavaScript",
|
|
7
|
+
exts: ["js", "jsx", "mjs", "cjs"]
|
|
8
|
+
},
|
|
9
|
+
{ value: "python", label: "Python", exts: ["py"] },
|
|
10
|
+
{ value: "json", label: "JSON", exts: ["json"] },
|
|
11
|
+
{ value: "html", label: "HTML", exts: ["html", "htm"] },
|
|
12
|
+
{ value: "css", label: "CSS", exts: ["css"] },
|
|
13
|
+
{ value: "scss", label: "SCSS", exts: ["scss"] },
|
|
14
|
+
{ value: "markdown", label: "Markdown", exts: ["md", "mdx"] },
|
|
15
|
+
{ value: "yaml", label: "YAML", exts: ["yml", "yaml"] },
|
|
16
|
+
{ value: "xml", label: "XML", exts: ["xml"] },
|
|
17
|
+
{ value: "sql", label: "SQL", exts: ["sql"] },
|
|
18
|
+
{ value: "shell", label: "Shell", exts: ["sh", "bash", "zsh"] },
|
|
19
|
+
{ value: "go", label: "Go", exts: ["go"] },
|
|
20
|
+
{ value: "rust", label: "Rust", exts: ["rs"] },
|
|
21
|
+
{ value: "java", label: "Java", exts: ["java"] },
|
|
22
|
+
{ value: "csharp", label: "C#", exts: ["cs"] },
|
|
23
|
+
{ value: "cpp", label: "C++", exts: ["cpp", "cc", "cxx", "h", "hpp"] },
|
|
24
|
+
{ value: "c", label: "C", exts: ["c"] },
|
|
25
|
+
{ value: "php", label: "PHP", exts: ["php"] },
|
|
26
|
+
{ value: "ruby", label: "Ruby", exts: ["rb"] },
|
|
27
|
+
{ value: "swift", label: "Swift", exts: ["swift"] },
|
|
28
|
+
{ value: "kotlin", label: "Kotlin", exts: ["kt", "kts"] },
|
|
29
|
+
{ value: "dart", label: "Dart", exts: ["dart"] },
|
|
30
|
+
{ value: "dockerfile", label: "Dockerfile", exts: ["dockerfile"] },
|
|
31
|
+
{ value: "toml", label: "TOML", exts: ["toml"] },
|
|
32
|
+
{ value: "ini", label: "INI", exts: ["ini"] }
|
|
33
|
+
];
|
|
34
|
+
const EXT_TO_LANG = /* @__PURE__ */ new Map();
|
|
35
|
+
for (const opt of LANGUAGE_OPTIONS) {
|
|
36
|
+
for (const ext of opt.exts) EXT_TO_LANG.set(ext, opt.value);
|
|
37
|
+
}
|
|
38
|
+
function extensionForLanguage(language) {
|
|
39
|
+
const opt = LANGUAGE_OPTIONS.find((o) => o.value === language);
|
|
40
|
+
return opt?.exts[0] ?? "txt";
|
|
41
|
+
}
|
|
42
|
+
function languageFromName(name) {
|
|
43
|
+
const dot = name.lastIndexOf(".");
|
|
44
|
+
if (dot < 0) return "plaintext";
|
|
45
|
+
const ext = name.slice(dot + 1).toLowerCase();
|
|
46
|
+
return EXT_TO_LANG.get(ext) ?? "plaintext";
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
LANGUAGE_OPTIONS,
|
|
50
|
+
extensionForLanguage,
|
|
51
|
+
languageFromName
|
|
52
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central Language Utilities
|
|
3
|
+
* Single source of truth for all language mappings and conversions
|
|
4
|
+
*/
|
|
5
|
+
export declare function normalizeLanguage(lang: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Map language identifiers to Monaco Editor-compatible language names
|
|
8
|
+
* @param lang - The language identifier (may be undefined, null, or invalid)
|
|
9
|
+
* @returns A valid Monaco language name, defaulting to 'plaintext' if invalid
|
|
10
|
+
*/
|
|
11
|
+
export declare function mapLanguageForMonaco(lang: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Normalize a fence language to the canonical view-language name
|
|
14
|
+
* (`js` → `javascript`, `sh` → `bash`, …) — used for language checks such as
|
|
15
|
+
* "is this a complete HTML document". Highlighting itself is Shiki's
|
|
16
|
+
* (code-block/highlight/shiki-highlighter.ts), which resolves its own grammars.
|
|
17
|
+
* @param lang - The language identifier (may be undefined, null, or invalid)
|
|
18
|
+
* @returns The canonical language name, defaulting to 'text' if invalid
|
|
19
|
+
*/
|
|
20
|
+
export declare function normalizeViewLanguage(lang: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Get file extension for Monaco Editor JSX/TSX support
|
|
23
|
+
* Used when creating Monaco models to enable proper syntax highlighting
|
|
24
|
+
* @param lang - The language identifier
|
|
25
|
+
* @returns File extension (e.g., '.tsx', '.jsx') or undefined for other languages
|
|
26
|
+
*/
|
|
27
|
+
export declare function getMonacoFileExtension(lang: string): string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Get comprehensive file extension for any language
|
|
30
|
+
* Used for file downloads and general file identification
|
|
31
|
+
* @param lang - The language identifier
|
|
32
|
+
* @returns File extension string (e.g., '.ts', '.py', '.txt')
|
|
33
|
+
*/
|
|
34
|
+
export declare function getFileExtension(lang: string): string;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
function normalizeLanguage(lang) {
|
|
2
|
+
const langLower = lang.toLowerCase();
|
|
3
|
+
const languageMap = {
|
|
4
|
+
"js": "javascript",
|
|
5
|
+
"ts": "typescript",
|
|
6
|
+
"jsx": "jsx",
|
|
7
|
+
"tsx": "tsx",
|
|
8
|
+
"react": "typescript",
|
|
9
|
+
"typescript": "typescript",
|
|
10
|
+
"javascript": "javascript",
|
|
11
|
+
"py": "python",
|
|
12
|
+
"python": "python",
|
|
13
|
+
"rb": "ruby",
|
|
14
|
+
"ruby": "ruby",
|
|
15
|
+
"go": "go",
|
|
16
|
+
"rust": "rust",
|
|
17
|
+
"java": "java",
|
|
18
|
+
"cpp": "cpp",
|
|
19
|
+
"c": "c",
|
|
20
|
+
"cs": "csharp",
|
|
21
|
+
"csharp": "csharp",
|
|
22
|
+
"php": "php",
|
|
23
|
+
"swift": "swift",
|
|
24
|
+
"kotlin": "kotlin",
|
|
25
|
+
"html": "html",
|
|
26
|
+
"css": "css",
|
|
27
|
+
"scss": "scss",
|
|
28
|
+
"json": "json",
|
|
29
|
+
"yaml": "yaml",
|
|
30
|
+
"yml": "yaml",
|
|
31
|
+
"xml": "xml",
|
|
32
|
+
"sql": "sql",
|
|
33
|
+
"bash": "bash",
|
|
34
|
+
"sh": "bash",
|
|
35
|
+
"shell": "bash",
|
|
36
|
+
"markdown": "markdown",
|
|
37
|
+
"md": "markdown"
|
|
38
|
+
};
|
|
39
|
+
return languageMap[langLower] || lang;
|
|
40
|
+
}
|
|
41
|
+
function mapLanguageForMonaco(lang) {
|
|
42
|
+
if (!lang || typeof lang !== "string") {
|
|
43
|
+
return "plaintext";
|
|
44
|
+
}
|
|
45
|
+
const languageMap = {
|
|
46
|
+
"react": "typescript",
|
|
47
|
+
// React components → TypeScript (Monaco uses 'typescript' for TSX)
|
|
48
|
+
"jsx": "javascript",
|
|
49
|
+
// JavaScript JSX → Monaco uses 'javascript' for JSX
|
|
50
|
+
"tsx": "typescript",
|
|
51
|
+
// TypeScript JSX → Monaco uses 'typescript' for TSX
|
|
52
|
+
"typescript": "typescript",
|
|
53
|
+
"javascript": "javascript",
|
|
54
|
+
"js": "javascript",
|
|
55
|
+
"ts": "typescript",
|
|
56
|
+
"html": "html",
|
|
57
|
+
"css": "css",
|
|
58
|
+
"scss": "scss",
|
|
59
|
+
"json": "json",
|
|
60
|
+
"markdown": "markdown",
|
|
61
|
+
"md": "markdown",
|
|
62
|
+
"bash": "shell",
|
|
63
|
+
"shell": "shell",
|
|
64
|
+
"sh": "shell",
|
|
65
|
+
"sql": "sql",
|
|
66
|
+
"python": "python",
|
|
67
|
+
"py": "python",
|
|
68
|
+
"diff": "diff",
|
|
69
|
+
"java": "java",
|
|
70
|
+
"csharp": "csharp",
|
|
71
|
+
"cs": "csharp",
|
|
72
|
+
"php": "php",
|
|
73
|
+
"ruby": "ruby",
|
|
74
|
+
"go": "go",
|
|
75
|
+
"rust": "rust",
|
|
76
|
+
"yaml": "yaml",
|
|
77
|
+
"yml": "yaml",
|
|
78
|
+
"xml": "xml",
|
|
79
|
+
"text": "plaintext",
|
|
80
|
+
"plaintext": "plaintext"
|
|
81
|
+
};
|
|
82
|
+
const normalizedLang = lang.trim().toLowerCase();
|
|
83
|
+
return languageMap[normalizedLang] || normalizedLang || "plaintext";
|
|
84
|
+
}
|
|
85
|
+
function normalizeViewLanguage(lang) {
|
|
86
|
+
if (!lang || typeof lang !== "string") {
|
|
87
|
+
return "text";
|
|
88
|
+
}
|
|
89
|
+
const languageMap = {
|
|
90
|
+
"react": "tsx",
|
|
91
|
+
// React components → TypeScript JSX
|
|
92
|
+
"jsx": "jsx",
|
|
93
|
+
// JavaScript JSX
|
|
94
|
+
"tsx": "tsx",
|
|
95
|
+
// TypeScript JSX
|
|
96
|
+
"typescript": "typescript",
|
|
97
|
+
"javascript": "javascript",
|
|
98
|
+
"js": "javascript",
|
|
99
|
+
"ts": "typescript",
|
|
100
|
+
"html": "html",
|
|
101
|
+
"css": "css",
|
|
102
|
+
"json": "json",
|
|
103
|
+
"markdown": "markdown",
|
|
104
|
+
"md": "markdown",
|
|
105
|
+
"bash": "bash",
|
|
106
|
+
"shell": "bash",
|
|
107
|
+
"sql": "sql",
|
|
108
|
+
"python": "python",
|
|
109
|
+
"py": "python",
|
|
110
|
+
"diff": "diff",
|
|
111
|
+
"text": "text",
|
|
112
|
+
"plaintext": "text"
|
|
113
|
+
};
|
|
114
|
+
const normalizedLang = lang.trim().toLowerCase();
|
|
115
|
+
return languageMap[normalizedLang] || normalizedLang || "text";
|
|
116
|
+
}
|
|
117
|
+
function getMonacoFileExtension(lang) {
|
|
118
|
+
if (!lang || typeof lang !== "string") {
|
|
119
|
+
return void 0;
|
|
120
|
+
}
|
|
121
|
+
const normalized = lang.trim().toLowerCase();
|
|
122
|
+
if (normalized === "tsx" || normalized === "react") return ".tsx";
|
|
123
|
+
if (normalized === "jsx") return ".jsx";
|
|
124
|
+
return void 0;
|
|
125
|
+
}
|
|
126
|
+
function getFileExtension(lang) {
|
|
127
|
+
if (!lang || typeof lang !== "string") {
|
|
128
|
+
return ".txt";
|
|
129
|
+
}
|
|
130
|
+
const extensionMap = {
|
|
131
|
+
"typescript": ".ts",
|
|
132
|
+
"javascript": ".js",
|
|
133
|
+
"jsx": ".jsx",
|
|
134
|
+
"tsx": ".tsx",
|
|
135
|
+
"react": ".tsx",
|
|
136
|
+
"json": ".json",
|
|
137
|
+
"html": ".html",
|
|
138
|
+
"css": ".css",
|
|
139
|
+
"scss": ".scss",
|
|
140
|
+
"python": ".py",
|
|
141
|
+
"py": ".py",
|
|
142
|
+
"java": ".java",
|
|
143
|
+
"cpp": ".cpp",
|
|
144
|
+
"c": ".c",
|
|
145
|
+
"csharp": ".cs",
|
|
146
|
+
"cs": ".cs",
|
|
147
|
+
"php": ".php",
|
|
148
|
+
"ruby": ".rb",
|
|
149
|
+
"rb": ".rb",
|
|
150
|
+
"go": ".go",
|
|
151
|
+
"rust": ".rs",
|
|
152
|
+
"swift": ".swift",
|
|
153
|
+
"kotlin": ".kt",
|
|
154
|
+
"sql": ".sql",
|
|
155
|
+
"shell": ".sh",
|
|
156
|
+
"sh": ".sh",
|
|
157
|
+
"bash": ".sh",
|
|
158
|
+
"yaml": ".yaml",
|
|
159
|
+
"yml": ".yaml",
|
|
160
|
+
"xml": ".xml",
|
|
161
|
+
"markdown": ".md",
|
|
162
|
+
"md": ".md",
|
|
163
|
+
"text": ".txt",
|
|
164
|
+
"plaintext": ".txt"
|
|
165
|
+
};
|
|
166
|
+
const normalizedLang = lang.trim().toLowerCase();
|
|
167
|
+
return extensionMap[normalizedLang] || ".txt";
|
|
168
|
+
}
|
|
169
|
+
export {
|
|
170
|
+
getFileExtension,
|
|
171
|
+
getMonacoFileExtension,
|
|
172
|
+
mapLanguageForMonaco,
|
|
173
|
+
normalizeLanguage,
|
|
174
|
+
normalizeViewLanguage
|
|
175
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type LoadingVariant = 'dots' | 'bars' | 'brain' | 'minimal' | 'workflow';
|
|
3
|
+
type LoadingSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
interface LoadingSpinnerProps {
|
|
5
|
+
variant?: LoadingVariant;
|
|
6
|
+
size?: LoadingSize;
|
|
7
|
+
message?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
showMessage?: boolean;
|
|
10
|
+
fullscreen?: boolean;
|
|
11
|
+
overlay?: boolean;
|
|
12
|
+
title?: string;
|
|
13
|
+
subtitle?: string;
|
|
14
|
+
showFeatureIndicators?: boolean;
|
|
15
|
+
showProgressSteps?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const LoadingSpinner: React.FC<LoadingSpinnerProps>;
|
|
18
|
+
export default LoadingSpinner;
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { cn } from "@ai-matrx/design-system";
|
|
5
|
+
import { Loader2, Workflow, Plus } from "lucide-react";
|
|
6
|
+
const animationStyles = `
|
|
7
|
+
@keyframes pulseWave {
|
|
8
|
+
0% { opacity: 0.3; transform: scale(0.8); }
|
|
9
|
+
50% { opacity: 1; transform: scale(1); }
|
|
10
|
+
100% { opacity: 0.3; transform: scale(0.8); }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@keyframes bounce {
|
|
14
|
+
0%, 100% { transform: translateY(0); }
|
|
15
|
+
50% { transform: translateY(-5px); }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@keyframes neuronPulse {
|
|
19
|
+
0% { transform: scale(0.8); opacity: 0.3; }
|
|
20
|
+
40% { transform: scale(1.4); opacity: 1; }
|
|
21
|
+
80% { transform: scale(0.8); opacity: 0.3; }
|
|
22
|
+
100% { transform: scale(0.8); opacity: 0.3; }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@keyframes brainWavePulse {
|
|
26
|
+
0% { transform: scale(0.8); opacity: 0; }
|
|
27
|
+
20% { opacity: 0.2; }
|
|
28
|
+
50% { transform: scale(1.5); opacity: 0; }
|
|
29
|
+
100% { transform: scale(1.8); opacity: 0; }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.loading-pulse-1 { animation: pulseWave 1.5s infinite ease-in-out; animation-delay: 0s; }
|
|
33
|
+
.loading-pulse-2 { animation: pulseWave 1.5s infinite ease-in-out; animation-delay: 0.3s; }
|
|
34
|
+
.loading-pulse-3 { animation: pulseWave 1.5s infinite ease-in-out; animation-delay: 0.6s; }
|
|
35
|
+
|
|
36
|
+
.loading-bounce-1 { animation: bounce 1s infinite ease-in-out; animation-delay: 0s; }
|
|
37
|
+
.loading-bounce-2 { animation: bounce 1s infinite ease-in-out; animation-delay: 0.2s; }
|
|
38
|
+
.loading-bounce-3 { animation: bounce 1s infinite ease-in-out; animation-delay: 0.4s; }
|
|
39
|
+
.loading-bounce-4 { animation: bounce 1s infinite ease-in-out; animation-delay: 0.6s; }
|
|
40
|
+
|
|
41
|
+
.loading-neuron-1 { animation: neuronPulse 2s infinite ease-in-out; animation-delay: 0s; }
|
|
42
|
+
.loading-neuron-2 { animation: neuronPulse 2s infinite ease-in-out; animation-delay: 0.4s; }
|
|
43
|
+
.loading-neuron-3 { animation: neuronPulse 2s infinite ease-in-out; animation-delay: 0.8s; }
|
|
44
|
+
.loading-neuron-4 { animation: neuronPulse 2s infinite ease-in-out; animation-delay: 1.2s; }
|
|
45
|
+
.loading-neuron-5 { animation: neuronPulse 2s infinite ease-in-out; animation-delay: 1.6s; }
|
|
46
|
+
|
|
47
|
+
.loading-brain-pulse-1 { animation: brainWavePulse 2s infinite ease-in-out; animation-delay: 0s; }
|
|
48
|
+
.loading-brain-pulse-2 { animation: brainWavePulse 2s infinite ease-in-out; animation-delay: 0.5s; }
|
|
49
|
+
`;
|
|
50
|
+
const LoadingSpinner = ({
|
|
51
|
+
variant = "dots",
|
|
52
|
+
size = "md",
|
|
53
|
+
message,
|
|
54
|
+
className = "",
|
|
55
|
+
showMessage = true,
|
|
56
|
+
fullscreen = false,
|
|
57
|
+
overlay = false,
|
|
58
|
+
title,
|
|
59
|
+
subtitle,
|
|
60
|
+
showFeatureIndicators = false,
|
|
61
|
+
showProgressSteps = true
|
|
62
|
+
}) => {
|
|
63
|
+
React.useEffect(() => {
|
|
64
|
+
const styleId = "loading-spinner-styles";
|
|
65
|
+
if (!document.getElementById(styleId)) {
|
|
66
|
+
const style = document.createElement("style");
|
|
67
|
+
style.id = styleId;
|
|
68
|
+
style.textContent = animationStyles;
|
|
69
|
+
document.head.appendChild(style);
|
|
70
|
+
}
|
|
71
|
+
}, []);
|
|
72
|
+
const getSizeClasses = () => {
|
|
73
|
+
switch (size) {
|
|
74
|
+
case "sm":
|
|
75
|
+
return { container: "gap-2", dot: "w-1.5 h-1.5", bar: "w-0.5 h-2", text: "text-xs" };
|
|
76
|
+
case "lg":
|
|
77
|
+
return { container: "gap-4", dot: "w-2.5 h-2.5", bar: "w-1.5 h-4", text: "text-base" };
|
|
78
|
+
default:
|
|
79
|
+
return { container: "gap-3", dot: "w-2 h-2", bar: "w-1 h-2.5", text: "text-sm" };
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const sizeClasses = getSizeClasses();
|
|
83
|
+
const renderDots = () => /* @__PURE__ */ jsxs("div", { className: cn("flex items-center", sizeClasses.container), children: [
|
|
84
|
+
/* @__PURE__ */ jsx("div", { className: cn(sizeClasses.dot, "bg-primary dark:bg-primary-foreground rounded-full loading-pulse-1") }),
|
|
85
|
+
/* @__PURE__ */ jsx("div", { className: cn(sizeClasses.dot, "bg-primary dark:bg-primary-foreground rounded-full loading-pulse-2") }),
|
|
86
|
+
/* @__PURE__ */ jsx("div", { className: cn(sizeClasses.dot, "bg-primary dark:bg-primary-foreground rounded-full loading-pulse-3") })
|
|
87
|
+
] });
|
|
88
|
+
const renderBars = () => /* @__PURE__ */ jsxs("div", { className: cn("flex items-center", sizeClasses.container), children: [
|
|
89
|
+
/* @__PURE__ */ jsx("div", { className: cn(sizeClasses.bar, "bg-primary dark:bg-primary-foreground rounded-sm loading-bounce-1") }),
|
|
90
|
+
/* @__PURE__ */ jsx("div", { className: cn(sizeClasses.bar, "bg-primary dark:bg-primary-foreground rounded-sm loading-bounce-2") }),
|
|
91
|
+
/* @__PURE__ */ jsx("div", { className: cn(sizeClasses.bar, "bg-primary dark:bg-primary-foreground rounded-sm loading-bounce-3") }),
|
|
92
|
+
/* @__PURE__ */ jsx("div", { className: cn(sizeClasses.bar, "bg-primary dark:bg-primary-foreground rounded-sm loading-bounce-4") })
|
|
93
|
+
] });
|
|
94
|
+
const renderBrain = () => /* @__PURE__ */ jsxs("div", { className: "relative w-6 h-6 flex items-center justify-center", children: [
|
|
95
|
+
/* @__PURE__ */ jsx("div", { className: "absolute", children: /* @__PURE__ */ jsx(
|
|
96
|
+
"svg",
|
|
97
|
+
{
|
|
98
|
+
width: "24",
|
|
99
|
+
height: "24",
|
|
100
|
+
viewBox: "0 0 24 24",
|
|
101
|
+
fill: "none",
|
|
102
|
+
className: "w-5 h-5 text-primary dark:text-primary-foreground",
|
|
103
|
+
children: /* @__PURE__ */ jsx(
|
|
104
|
+
"path",
|
|
105
|
+
{
|
|
106
|
+
d: "M12 4C9.5 4 7.5 5.5 7.5 8C7.5 9 7.5 9.5 7 10.5C6.5 11.5 6 12 6 13.5C6 15.5 7.5 17 9.5 17C10.5 17 11 16.5 12 16.5C13 16.5 13.5 17 14.5 17C16.5 17 18 15.5 18 13.5C18 12 17.5 11.5 17 10.5C16.5 9.5 16.5 9 16.5 8C16.5 5.5 14.5 4 12 4Z",
|
|
107
|
+
className: "stroke-current",
|
|
108
|
+
fill: "none",
|
|
109
|
+
strokeWidth: "1.5"
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
) }),
|
|
114
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute inset-0", children: [
|
|
115
|
+
/* @__PURE__ */ jsx("div", { className: "absolute w-1 h-1 bg-primary/60 dark:bg-primary-foreground/60 rounded-full left-[8px] top-[10px] loading-neuron-1" }),
|
|
116
|
+
/* @__PURE__ */ jsx("div", { className: "absolute w-1 h-1 bg-primary/60 dark:bg-primary-foreground/60 rounded-full left-[12px] top-[8px] loading-neuron-2" }),
|
|
117
|
+
/* @__PURE__ */ jsx("div", { className: "absolute w-1 h-1 bg-primary/60 dark:bg-primary-foreground/60 rounded-full left-[16px] top-[10px] loading-neuron-3" }),
|
|
118
|
+
/* @__PURE__ */ jsx("div", { className: "absolute w-1 h-1 bg-primary/60 dark:bg-primary-foreground/60 rounded-full left-[10px] top-[14px] loading-neuron-4" }),
|
|
119
|
+
/* @__PURE__ */ jsx("div", { className: "absolute w-1 h-1 bg-primary/60 dark:bg-primary-foreground/60 rounded-full left-[14px] top-[14px] loading-neuron-5" })
|
|
120
|
+
] }),
|
|
121
|
+
/* @__PURE__ */ jsx("div", { className: "absolute w-full h-full rounded-full border border-primary/30 dark:border-primary-foreground/30 loading-brain-pulse-1" }),
|
|
122
|
+
/* @__PURE__ */ jsx("div", { className: "absolute w-full h-full rounded-full border border-primary/30 dark:border-primary-foreground/30 loading-brain-pulse-2" })
|
|
123
|
+
] });
|
|
124
|
+
const renderMinimal = () => /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx("div", { className: cn(sizeClasses.dot, "bg-primary dark:bg-primary-foreground rounded-full loading-pulse-1") }) });
|
|
125
|
+
const renderWorkflow = () => /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center space-y-6", children: [
|
|
126
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
127
|
+
/* @__PURE__ */ jsx("div", { className: "w-16 h-16 bg-primary/10 dark:bg-primary-foreground/10 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx(Workflow, { className: "w-8 h-8 text-primary dark:text-primary-foreground" }) }),
|
|
128
|
+
/* @__PURE__ */ jsx("div", { className: "absolute -top-1 -right-1 w-6 h-6 bg-primary dark:bg-primary-foreground rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx(Plus, { className: "w-3 h-3 text-primary-foreground dark:text-primary" }) }),
|
|
129
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 border-2 border-transparent border-t-primary dark:border-t-primary-foreground rounded-full animate-spin" })
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center space-y-2", children: [
|
|
132
|
+
/* @__PURE__ */ jsxs("h2", { className: "text-lg font-semibold text-foreground flex items-center gap-2 justify-center", children: [
|
|
133
|
+
/* @__PURE__ */ jsx(Loader2, { className: "w-4 h-4 animate-spin" }),
|
|
134
|
+
title || "Loading Workflow"
|
|
135
|
+
] }),
|
|
136
|
+
/* @__PURE__ */ jsx("p", { className: "type-body text-muted-foreground max-w-sm", children: subtitle || message || "Setting up your workflow..." })
|
|
137
|
+
] }),
|
|
138
|
+
showProgressSteps && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 type-secondary text-muted-foreground", children: [
|
|
139
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
140
|
+
/* @__PURE__ */ jsx("div", { className: "w-2 h-2 bg-primary dark:bg-primary-foreground rounded-full animate-pulse" }),
|
|
141
|
+
/* @__PURE__ */ jsx("span", { children: "Loading" })
|
|
142
|
+
] }),
|
|
143
|
+
/* @__PURE__ */ jsx("div", { className: "w-4 h-px bg-muted-foreground/30" }),
|
|
144
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 opacity-50", children: [
|
|
145
|
+
/* @__PURE__ */ jsx("div", { className: "w-2 h-2 bg-muted-foreground/30 rounded-full" }),
|
|
146
|
+
/* @__PURE__ */ jsx("span", { children: "Initializing" })
|
|
147
|
+
] }),
|
|
148
|
+
/* @__PURE__ */ jsx("div", { className: "w-4 h-px bg-muted-foreground/30" }),
|
|
149
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 opacity-30", children: [
|
|
150
|
+
/* @__PURE__ */ jsx("div", { className: "w-2 h-2 bg-muted-foreground/30 rounded-full" }),
|
|
151
|
+
/* @__PURE__ */ jsx("span", { children: "Ready" })
|
|
152
|
+
] })
|
|
153
|
+
] })
|
|
154
|
+
] });
|
|
155
|
+
const renderSpinner = () => {
|
|
156
|
+
switch (variant) {
|
|
157
|
+
case "bars":
|
|
158
|
+
return renderBars();
|
|
159
|
+
case "brain":
|
|
160
|
+
return renderBrain();
|
|
161
|
+
case "minimal":
|
|
162
|
+
return renderMinimal();
|
|
163
|
+
case "workflow":
|
|
164
|
+
return renderWorkflow();
|
|
165
|
+
default:
|
|
166
|
+
return renderDots();
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
const getDefaultMessage = () => {
|
|
170
|
+
switch (variant) {
|
|
171
|
+
case "brain":
|
|
172
|
+
return "Processing...";
|
|
173
|
+
case "workflow":
|
|
174
|
+
return "Loading workflows...";
|
|
175
|
+
default:
|
|
176
|
+
return "Loading...";
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
if (variant === "workflow" && (fullscreen || overlay)) {
|
|
180
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(
|
|
181
|
+
"flex items-center justify-center bg-background",
|
|
182
|
+
fullscreen && "h-dvh w-full",
|
|
183
|
+
className
|
|
184
|
+
), children: [
|
|
185
|
+
overlay && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-background/80 backdrop-blur-sm z-50" }),
|
|
186
|
+
/* @__PURE__ */ jsx("div", { className: cn(
|
|
187
|
+
"flex flex-col items-center justify-center",
|
|
188
|
+
overlay && "relative z-50"
|
|
189
|
+
), children: renderWorkflow() })
|
|
190
|
+
] });
|
|
191
|
+
}
|
|
192
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center", className), children: variant === "workflow" ? renderWorkflow() : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
193
|
+
renderSpinner(),
|
|
194
|
+
showMessage && /* @__PURE__ */ jsx("span", { className: cn("ml-3 text-muted-foreground", sizeClasses.text), children: message || getDefaultMessage() })
|
|
195
|
+
] }) });
|
|
196
|
+
};
|
|
197
|
+
var loading_spinner_default = LoadingSpinner;
|
|
198
|
+
export {
|
|
199
|
+
loading_spinner_default as default
|
|
200
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* features/files/media-client/refs.ts
|
|
3
|
+
*
|
|
4
|
+
* Identity conversion between the handler's `FileSource` vocabulary and the
|
|
5
|
+
* `@ai-matrx/media` `MediaRefLike` port. Used by call sites that build a
|
|
6
|
+
* `FileSource` (via `buildMediaSource`, `recognizeOurFileUrl`, …) but render
|
|
7
|
+
* through the package hooks/components. Pure — no I/O, no minting; the one
|
|
8
|
+
* URL it constructs (share token → public share URL) goes through the
|
|
9
|
+
* canonical builder in `handler/utils/python-base`.
|
|
10
|
+
*/
|
|
11
|
+
import type { MediaRefLike } from "@ai-matrx/media";
|
|
12
|
+
import type { FileSource } from "@ai-matrx/media/files/engine/handler/types";
|
|
13
|
+
export declare function fileSourceToMediaRef(source: FileSource | null | undefined): MediaRefLike | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { shareUrls } from "@ai-matrx/media/files/engine/handler/utils/python-base";
|
|
2
|
+
function fileSourceToMediaRef(source) {
|
|
3
|
+
if (!source) return null;
|
|
4
|
+
switch (source.kind) {
|
|
5
|
+
case "file_id":
|
|
6
|
+
return { file_id: source.fileId, mime_type: source.mime ?? void 0 };
|
|
7
|
+
case "external_url":
|
|
8
|
+
return { url: source.url, mime_type: source.mime ?? void 0 };
|
|
9
|
+
case "public_cdn":
|
|
10
|
+
return { url: source.url, mime_type: source.mime ?? void 0 };
|
|
11
|
+
case "cloud_file":
|
|
12
|
+
return {
|
|
13
|
+
file_id: source.cloudFile.id,
|
|
14
|
+
mime_type: source.cloudFile.mimeType ?? void 0
|
|
15
|
+
};
|
|
16
|
+
case "share_link":
|
|
17
|
+
return {
|
|
18
|
+
url: shareUrls(source.token).public,
|
|
19
|
+
mime_type: source.mime ?? void 0
|
|
20
|
+
};
|
|
21
|
+
default:
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
fileSourceToMediaRef
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function nearestScrollRoot(el: Element | null): Element | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const scrollsByStyle = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
const verticalScrollers = /* @__PURE__ */ new WeakSet();
|
|
3
|
+
function nearestScrollRoot(el) {
|
|
4
|
+
if (typeof window === "undefined" || !el) return null;
|
|
5
|
+
const page = document.scrollingElement;
|
|
6
|
+
for (let node = el.parentElement; node; node = node.parentElement) {
|
|
7
|
+
if (node === page || node === document.body || node === document.documentElement) return null;
|
|
8
|
+
let scrolls = scrollsByStyle.get(node);
|
|
9
|
+
if (scrolls === void 0) {
|
|
10
|
+
const { overflowY } = getComputedStyle(node);
|
|
11
|
+
scrolls = overflowY === "auto" || overflowY === "scroll";
|
|
12
|
+
scrollsByStyle.set(node, scrolls);
|
|
13
|
+
}
|
|
14
|
+
if (!scrolls) continue;
|
|
15
|
+
if (verticalScrollers.has(node)) return node;
|
|
16
|
+
if (node.scrollHeight > node.clientHeight + 1) {
|
|
17
|
+
verticalScrollers.add(node);
|
|
18
|
+
return node;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
nearestScrollRoot
|
|
25
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Syntax palette shared by the Shiki code view (code-block/highlight) and the
|
|
3
|
+
* Monaco editor: VS Code Dark+/Light+ everywhere, with JSON in a JetBrains
|
|
4
|
+
* Darcula–inspired palette.
|
|
5
|
+
*/
|
|
6
|
+
/** Darcula-inspired JSON palette — single source of truth for Shiki + Monaco. */
|
|
7
|
+
export declare const JSON_SYNTAX_COLORS: {
|
|
8
|
+
readonly dark: {
|
|
9
|
+
readonly key: "#7dd3fc";
|
|
10
|
+
readonly string: "#6ee7b7";
|
|
11
|
+
readonly number: "#fbbf24";
|
|
12
|
+
readonly boolean: "#c4b5fd";
|
|
13
|
+
readonly null: "#a1a1aa";
|
|
14
|
+
readonly punctuation: "#a1a1aa";
|
|
15
|
+
};
|
|
16
|
+
readonly light: {
|
|
17
|
+
readonly key: "#0369a1";
|
|
18
|
+
readonly string: "#047857";
|
|
19
|
+
readonly number: "#b45309";
|
|
20
|
+
readonly boolean: "#6d28d9";
|
|
21
|
+
readonly null: "#71717a";
|
|
22
|
+
readonly punctuation: "#4b5563";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare function registerJsonMonacoThemes(monaco: {
|
|
26
|
+
editor: {
|
|
27
|
+
defineTheme: (name: string, theme: unknown) => void;
|
|
28
|
+
};
|
|
29
|
+
}): void;
|
|
30
|
+
export declare function isJsonLanguage(language: string | undefined): boolean;
|
|
31
|
+
/** Monaco theme id for SmallCodeEditor edit mode. */
|
|
32
|
+
export declare function resolveMonacoEditorTheme(language: string | undefined, mode: "light" | "dark"): string;
|