@ai-matrx/rich-content 0.2.3 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -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/csv/CsvBlock.js +5 -1
- 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,347 @@
|
|
|
1
|
+
import dagre from "dagre";
|
|
2
|
+
import { Position, MarkerType } from "@xyflow/react";
|
|
3
|
+
const getLayoutedElements = (nodes, edges, options = {}) => {
|
|
4
|
+
const {
|
|
5
|
+
direction = "TB",
|
|
6
|
+
nodeWidth = 200,
|
|
7
|
+
nodeHeight = 100,
|
|
8
|
+
rankSep = 100,
|
|
9
|
+
nodeSep = 80
|
|
10
|
+
} = options;
|
|
11
|
+
const dagreGraph = new dagre.graphlib.Graph();
|
|
12
|
+
dagreGraph.setDefaultEdgeLabel(() => ({}));
|
|
13
|
+
dagreGraph.setGraph({
|
|
14
|
+
rankdir: direction,
|
|
15
|
+
ranksep: rankSep,
|
|
16
|
+
nodesep: nodeSep,
|
|
17
|
+
marginx: 20,
|
|
18
|
+
marginy: 20
|
|
19
|
+
});
|
|
20
|
+
nodes.forEach((node) => {
|
|
21
|
+
dagreGraph.setNode(node.id, {
|
|
22
|
+
width: node.measured?.width ?? node.width ?? nodeWidth,
|
|
23
|
+
height: node.measured?.height ?? node.height ?? nodeHeight
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
edges.forEach((edge) => {
|
|
27
|
+
dagreGraph.setEdge(edge.source, edge.target);
|
|
28
|
+
});
|
|
29
|
+
dagre.layout(dagreGraph);
|
|
30
|
+
const layoutedNodes = nodes.map((node) => {
|
|
31
|
+
const nodeWithPosition = dagreGraph.node(node.id);
|
|
32
|
+
const width = node.measured?.width ?? node.width ?? nodeWidth;
|
|
33
|
+
const height = node.measured?.height ?? node.height ?? nodeHeight;
|
|
34
|
+
return {
|
|
35
|
+
...node,
|
|
36
|
+
targetPosition: getTargetPosition(direction),
|
|
37
|
+
sourcePosition: getSourcePosition(direction),
|
|
38
|
+
position: {
|
|
39
|
+
x: nodeWithPosition.x - width / 2,
|
|
40
|
+
y: nodeWithPosition.y - height / 2
|
|
41
|
+
},
|
|
42
|
+
data: { ...node.data }
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
return { nodes: layoutedNodes, edges };
|
|
46
|
+
};
|
|
47
|
+
const getTargetPosition = (direction) => {
|
|
48
|
+
switch (direction) {
|
|
49
|
+
case "TB":
|
|
50
|
+
return Position.Top;
|
|
51
|
+
case "BT":
|
|
52
|
+
return Position.Bottom;
|
|
53
|
+
case "LR":
|
|
54
|
+
return Position.Left;
|
|
55
|
+
case "RL":
|
|
56
|
+
return Position.Right;
|
|
57
|
+
default:
|
|
58
|
+
return Position.Top;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const getSourcePosition = (direction) => {
|
|
62
|
+
switch (direction) {
|
|
63
|
+
case "TB":
|
|
64
|
+
return Position.Bottom;
|
|
65
|
+
case "BT":
|
|
66
|
+
return Position.Top;
|
|
67
|
+
case "LR":
|
|
68
|
+
return Position.Right;
|
|
69
|
+
case "RL":
|
|
70
|
+
return Position.Left;
|
|
71
|
+
default:
|
|
72
|
+
return Position.Bottom;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const getLayoutOptionsForDiagramType = (diagramType, nodeCount, preferredDirection) => {
|
|
76
|
+
const baseOptions = {
|
|
77
|
+
nodeWidth: 200,
|
|
78
|
+
nodeHeight: 100,
|
|
79
|
+
rankSep: 100,
|
|
80
|
+
nodeSep: 80
|
|
81
|
+
};
|
|
82
|
+
const dir = preferredDirection;
|
|
83
|
+
switch (diagramType) {
|
|
84
|
+
case "flowchart":
|
|
85
|
+
case "process":
|
|
86
|
+
return {
|
|
87
|
+
...baseOptions,
|
|
88
|
+
direction: dir ?? "TB",
|
|
89
|
+
rankSep: 120,
|
|
90
|
+
nodeSep: 100
|
|
91
|
+
};
|
|
92
|
+
case "orgchart":
|
|
93
|
+
return {
|
|
94
|
+
...baseOptions,
|
|
95
|
+
direction: dir ?? "TB",
|
|
96
|
+
rankSep: 200,
|
|
97
|
+
nodeSep: 150,
|
|
98
|
+
nodeWidth: 220,
|
|
99
|
+
nodeHeight: 120
|
|
100
|
+
};
|
|
101
|
+
case "pedigree":
|
|
102
|
+
return {
|
|
103
|
+
...baseOptions,
|
|
104
|
+
direction: dir ?? "TB",
|
|
105
|
+
rankSep: 180,
|
|
106
|
+
nodeSep: 120,
|
|
107
|
+
nodeWidth: 120,
|
|
108
|
+
nodeHeight: 120
|
|
109
|
+
};
|
|
110
|
+
case "mindmap":
|
|
111
|
+
return {
|
|
112
|
+
...baseOptions,
|
|
113
|
+
direction: dir ?? (nodeCount > 10 ? "LR" : "TB"),
|
|
114
|
+
rankSep: 80,
|
|
115
|
+
nodeSep: 60
|
|
116
|
+
};
|
|
117
|
+
case "network":
|
|
118
|
+
case "system":
|
|
119
|
+
return {
|
|
120
|
+
...baseOptions,
|
|
121
|
+
direction: dir ?? "LR",
|
|
122
|
+
rankSep: 150,
|
|
123
|
+
nodeSep: 100
|
|
124
|
+
};
|
|
125
|
+
case "timeline":
|
|
126
|
+
return {
|
|
127
|
+
...baseOptions,
|
|
128
|
+
direction: dir ?? "LR",
|
|
129
|
+
rankSep: 60,
|
|
130
|
+
nodeSep: 40,
|
|
131
|
+
nodeWidth: 160,
|
|
132
|
+
nodeHeight: 80
|
|
133
|
+
};
|
|
134
|
+
case "erd":
|
|
135
|
+
return {
|
|
136
|
+
...baseOptions,
|
|
137
|
+
direction: dir ?? "LR",
|
|
138
|
+
rankSep: 160,
|
|
139
|
+
nodeSep: 120,
|
|
140
|
+
nodeWidth: 200,
|
|
141
|
+
nodeHeight: 140
|
|
142
|
+
};
|
|
143
|
+
case "sequence":
|
|
144
|
+
return {
|
|
145
|
+
...baseOptions,
|
|
146
|
+
direction: dir ?? "LR",
|
|
147
|
+
rankSep: 120,
|
|
148
|
+
nodeSep: 100
|
|
149
|
+
};
|
|
150
|
+
default:
|
|
151
|
+
return {
|
|
152
|
+
...baseOptions,
|
|
153
|
+
direction: dir ?? "TB"
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
const getRadialLayout = (nodes, edges, centerNodeId) => {
|
|
158
|
+
if (nodes.length === 0) return { nodes, edges };
|
|
159
|
+
const foundCenterNode = centerNodeId ? nodes.find((n) => n.id === centerNodeId) : findCenterNode(nodes, edges);
|
|
160
|
+
const centerNode = foundCenterNode ?? nodes[0];
|
|
161
|
+
const centerX = 400;
|
|
162
|
+
const centerY = 300;
|
|
163
|
+
const radius = 220;
|
|
164
|
+
const angleStep = 2 * Math.PI / (nodes.length - 1);
|
|
165
|
+
const layoutedNodes = nodes.map((node, index) => {
|
|
166
|
+
if (node.id === centerNode.id) {
|
|
167
|
+
return { ...node, position: { x: centerX, y: centerY } };
|
|
168
|
+
}
|
|
169
|
+
const adjustedIndex = index > nodes.findIndex((n) => n.id === centerNode.id) ? index - 1 : index;
|
|
170
|
+
const angle = adjustedIndex * angleStep;
|
|
171
|
+
return {
|
|
172
|
+
...node,
|
|
173
|
+
position: {
|
|
174
|
+
x: centerX + radius * Math.cos(angle) - 100,
|
|
175
|
+
y: centerY + radius * Math.sin(angle) - 50
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
});
|
|
179
|
+
return { nodes: layoutedNodes, edges };
|
|
180
|
+
};
|
|
181
|
+
const getGridLayout = (nodes, edges) => {
|
|
182
|
+
if (nodes.length === 0) return { nodes, edges };
|
|
183
|
+
const rootNodes = nodes.filter((node) => !node.parentId);
|
|
184
|
+
const columns = Math.max(1, Math.ceil(Math.sqrt(rootNodes.length)));
|
|
185
|
+
const widestRoot = Math.max(
|
|
186
|
+
...rootNodes.map((node) => node.measured?.width ?? node.width ?? 220)
|
|
187
|
+
);
|
|
188
|
+
const tallestRoot = Math.max(
|
|
189
|
+
...rootNodes.map((node) => node.measured?.height ?? node.height ?? 120)
|
|
190
|
+
);
|
|
191
|
+
const columnWidth = widestRoot + 80;
|
|
192
|
+
const rowHeight = tallestRoot + 80;
|
|
193
|
+
const rootPosition = new Map(
|
|
194
|
+
rootNodes.map((node, index) => [
|
|
195
|
+
node.id,
|
|
196
|
+
{
|
|
197
|
+
x: index % columns * columnWidth + 40,
|
|
198
|
+
y: Math.floor(index / columns) * rowHeight + 40
|
|
199
|
+
}
|
|
200
|
+
])
|
|
201
|
+
);
|
|
202
|
+
return {
|
|
203
|
+
nodes: nodes.map((node) => ({
|
|
204
|
+
...node,
|
|
205
|
+
position: rootPosition.get(node.id) ?? node.position
|
|
206
|
+
})),
|
|
207
|
+
edges
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
const findCenterNode = (nodes, edges) => {
|
|
211
|
+
const connectionCounts = /* @__PURE__ */ new Map();
|
|
212
|
+
nodes.forEach((node) => connectionCounts.set(node.id, 0));
|
|
213
|
+
edges.forEach((edge) => {
|
|
214
|
+
connectionCounts.set(
|
|
215
|
+
edge.source,
|
|
216
|
+
(connectionCounts.get(edge.source) || 0) + 1
|
|
217
|
+
);
|
|
218
|
+
connectionCounts.set(
|
|
219
|
+
edge.target,
|
|
220
|
+
(connectionCounts.get(edge.target) || 0) + 1
|
|
221
|
+
);
|
|
222
|
+
});
|
|
223
|
+
let maxConnections = 0;
|
|
224
|
+
let centerNodeId = "";
|
|
225
|
+
connectionCounts.forEach((count, nodeId) => {
|
|
226
|
+
if (count > maxConnections) {
|
|
227
|
+
maxConnections = count;
|
|
228
|
+
centerNodeId = nodeId;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
return nodes.find((node) => node.id === centerNodeId);
|
|
232
|
+
};
|
|
233
|
+
const getOrgChartLayout = (nodes, edges, options = {}) => {
|
|
234
|
+
const {
|
|
235
|
+
direction = "TB",
|
|
236
|
+
nodeWidth = 220,
|
|
237
|
+
nodeHeight = 120,
|
|
238
|
+
rankSep = 200,
|
|
239
|
+
nodeSep = 150
|
|
240
|
+
} = options;
|
|
241
|
+
const dagreGraph = new dagre.graphlib.Graph();
|
|
242
|
+
dagreGraph.setDefaultEdgeLabel(() => ({}));
|
|
243
|
+
dagreGraph.setGraph({
|
|
244
|
+
rankdir: direction,
|
|
245
|
+
ranksep: rankSep,
|
|
246
|
+
nodesep: nodeSep,
|
|
247
|
+
marginx: 40,
|
|
248
|
+
marginy: 40,
|
|
249
|
+
align: "UL"
|
|
250
|
+
});
|
|
251
|
+
nodes.forEach(
|
|
252
|
+
(node) => dagreGraph.setNode(node.id, {
|
|
253
|
+
width: node.measured?.width ?? node.width ?? nodeWidth,
|
|
254
|
+
height: node.measured?.height ?? node.height ?? nodeHeight
|
|
255
|
+
})
|
|
256
|
+
);
|
|
257
|
+
edges.forEach((edge) => dagreGraph.setEdge(edge.source, edge.target));
|
|
258
|
+
dagre.layout(dagreGraph);
|
|
259
|
+
const layoutedNodes = nodes.map((node) => {
|
|
260
|
+
const nodeWithPosition = dagreGraph.node(node.id);
|
|
261
|
+
const width = node.measured?.width ?? node.width ?? nodeWidth;
|
|
262
|
+
const height = node.measured?.height ?? node.height ?? nodeHeight;
|
|
263
|
+
return {
|
|
264
|
+
...node,
|
|
265
|
+
targetPosition: getTargetPosition(direction),
|
|
266
|
+
sourcePosition: getSourcePosition(direction),
|
|
267
|
+
position: {
|
|
268
|
+
x: nodeWithPosition.x - width / 2,
|
|
269
|
+
y: nodeWithPosition.y - height / 2
|
|
270
|
+
},
|
|
271
|
+
data: { ...node.data, diagramType: "orgchart" }
|
|
272
|
+
};
|
|
273
|
+
});
|
|
274
|
+
const cleanedEdges = edges.map((edge) => ({
|
|
275
|
+
...edge,
|
|
276
|
+
label: void 0,
|
|
277
|
+
labelStyle: void 0,
|
|
278
|
+
labelBgStyle: void 0,
|
|
279
|
+
style: {
|
|
280
|
+
...edge.style,
|
|
281
|
+
stroke: "#6b7280",
|
|
282
|
+
strokeWidth: 2,
|
|
283
|
+
strokeDasharray: "none"
|
|
284
|
+
},
|
|
285
|
+
markerEnd: {
|
|
286
|
+
type: MarkerType.ArrowClosed,
|
|
287
|
+
width: 16,
|
|
288
|
+
height: 16,
|
|
289
|
+
color: "#6b7280"
|
|
290
|
+
}
|
|
291
|
+
}));
|
|
292
|
+
return { nodes: layoutedNodes, edges: cleanedEdges };
|
|
293
|
+
};
|
|
294
|
+
const getPedigreeLayout = (nodes, edges) => {
|
|
295
|
+
const generationMap = /* @__PURE__ */ new Map();
|
|
296
|
+
nodes.forEach((node) => {
|
|
297
|
+
const gen = typeof node.data.generation === "number" ? node.data.generation : 0;
|
|
298
|
+
const genNodes = generationMap.get(gen);
|
|
299
|
+
if (genNodes) {
|
|
300
|
+
genNodes.push(node);
|
|
301
|
+
} else {
|
|
302
|
+
generationMap.set(gen, [node]);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
if (generationMap.size <= 1) {
|
|
306
|
+
return getLayoutedElements(nodes, edges, {
|
|
307
|
+
direction: "TB",
|
|
308
|
+
nodeWidth: 120,
|
|
309
|
+
nodeHeight: 120,
|
|
310
|
+
rankSep: 180,
|
|
311
|
+
nodeSep: 120
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
const GENERATION_HEIGHT = 220;
|
|
315
|
+
const NODE_WIDTH = 130;
|
|
316
|
+
const NODE_SPACING = 60;
|
|
317
|
+
const generations = Array.from(generationMap.keys()).sort((a, b) => a - b);
|
|
318
|
+
const maxNodesInGen = Math.max(
|
|
319
|
+
...generations.map((g) => generationMap.get(g)?.length ?? 0)
|
|
320
|
+
);
|
|
321
|
+
const totalWidth = maxNodesInGen * (NODE_WIDTH + NODE_SPACING);
|
|
322
|
+
const layoutedNodes = nodes.map((node) => {
|
|
323
|
+
const gen = typeof node.data.generation === "number" ? node.data.generation : 0;
|
|
324
|
+
const genNodes = generationMap.get(gen) ?? [];
|
|
325
|
+
const indexInGen = genNodes.findIndex((n) => n.id === node.id);
|
|
326
|
+
const genWidth = genNodes.length * (NODE_WIDTH + NODE_SPACING);
|
|
327
|
+
const xOffset = (totalWidth - genWidth) / 2;
|
|
328
|
+
return {
|
|
329
|
+
...node,
|
|
330
|
+
position: {
|
|
331
|
+
x: xOffset + indexInGen * (NODE_WIDTH + NODE_SPACING),
|
|
332
|
+
y: generations.indexOf(gen) * GENERATION_HEIGHT + 50
|
|
333
|
+
},
|
|
334
|
+
targetPosition: Position.Top,
|
|
335
|
+
sourcePosition: Position.Bottom
|
|
336
|
+
};
|
|
337
|
+
});
|
|
338
|
+
return { nodes: layoutedNodes, edges };
|
|
339
|
+
};
|
|
340
|
+
export {
|
|
341
|
+
getGridLayout,
|
|
342
|
+
getLayoutOptionsForDiagramType,
|
|
343
|
+
getLayoutedElements,
|
|
344
|
+
getOrgChartLayout,
|
|
345
|
+
getPedigreeLayout,
|
|
346
|
+
getRadialLayout
|
|
347
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { KIND_KEY } from "@ai-matrx/content-ir";
|
|
2
|
+
interface DiagramEdgeKind {
|
|
3
|
+
id?: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
arrow?: boolean;
|
|
6
|
+
color?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The registered kind this payload is an instance of.
|
|
10
|
+
*/
|
|
11
|
+
__kind: "diagram_edge";
|
|
12
|
+
dashed?: boolean;
|
|
13
|
+
source: string;
|
|
14
|
+
target: string;
|
|
15
|
+
animated?: boolean;
|
|
16
|
+
strokeWidth?: number;
|
|
17
|
+
relationship?: string;
|
|
18
|
+
}
|
|
19
|
+
interface DiagramNodeKind {
|
|
20
|
+
id: string;
|
|
21
|
+
icon?: string;
|
|
22
|
+
type?: string;
|
|
23
|
+
color?: string;
|
|
24
|
+
label: string;
|
|
25
|
+
/**
|
|
26
|
+
* The registered kind this payload is an instance of.
|
|
27
|
+
*/
|
|
28
|
+
__kind: "diagram_node";
|
|
29
|
+
gender?: string;
|
|
30
|
+
details?: string;
|
|
31
|
+
proband?: boolean;
|
|
32
|
+
affected?: boolean;
|
|
33
|
+
deceased?: boolean;
|
|
34
|
+
position?: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
/**
|
|
38
|
+
* The registered kind this payload is an instance of, when it is one.
|
|
39
|
+
*/
|
|
40
|
+
__kind?: string;
|
|
41
|
+
};
|
|
42
|
+
birthYear?: string;
|
|
43
|
+
deathYear?: string;
|
|
44
|
+
generation?: number;
|
|
45
|
+
description?: string;
|
|
46
|
+
}
|
|
47
|
+
import { type DiagramBackground } from "./diagram-visual-defaults.js";
|
|
48
|
+
export type DiagramNode = Omit<DiagramNodeKind, typeof KIND_KEY> & {
|
|
49
|
+
/** Layout/presentation the RENDERER owns — never part of the wire kind. */
|
|
50
|
+
nodeType?: string;
|
|
51
|
+
metadata?: Record<string, unknown>;
|
|
52
|
+
isGroup?: boolean;
|
|
53
|
+
parentId?: string;
|
|
54
|
+
width?: number;
|
|
55
|
+
height?: number;
|
|
56
|
+
groupStyle?: string;
|
|
57
|
+
shape?: string;
|
|
58
|
+
borderStyle?: string;
|
|
59
|
+
textAlign?: string;
|
|
60
|
+
};
|
|
61
|
+
export type DiagramEdge = Omit<DiagramEdgeKind, typeof KIND_KEY> & Required<Pick<DiagramEdgeKind, "id">> & {
|
|
62
|
+
/** Presentation the RENDERER owns — never part of the wire kind. */
|
|
63
|
+
lineStyle?: string;
|
|
64
|
+
marker?: string;
|
|
65
|
+
};
|
|
66
|
+
export interface DiagramData {
|
|
67
|
+
title: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
type: "flowchart" | "mindmap" | "orgchart" | "network" | "system" | "process" | "pedigree" | "timeline" | "erd" | "sequence" | string;
|
|
70
|
+
nodes: DiagramNode[];
|
|
71
|
+
edges: DiagramEdge[];
|
|
72
|
+
layout?: {
|
|
73
|
+
direction?: "TB" | "LR" | "BT" | "RL";
|
|
74
|
+
spacing?: number;
|
|
75
|
+
algorithm?: "dagre" | "grid" | "radial" | "pedigree";
|
|
76
|
+
};
|
|
77
|
+
renderHints?: {
|
|
78
|
+
showLegend?: boolean;
|
|
79
|
+
showEdgeLabels?: boolean;
|
|
80
|
+
compactNodes?: boolean;
|
|
81
|
+
hideArrows?: boolean;
|
|
82
|
+
background?: DiagramBackground;
|
|
83
|
+
showMiniMap?: boolean;
|
|
84
|
+
snapToGrid?: boolean;
|
|
85
|
+
showControls?: boolean;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** Make every renderer-chosen visual decision explicit in the document. */
|
|
89
|
+
export declare function materializeDiagramDefaults(diagram: DiagramData): DiagramData;
|
|
90
|
+
/**
|
|
91
|
+
* Parses JSON content into structured diagram data.
|
|
92
|
+
*
|
|
93
|
+
* Supported input formats:
|
|
94
|
+
* - { "diagram": { ... } } — wrapped format
|
|
95
|
+
* - { "title": ..., "nodes": ... } — direct format
|
|
96
|
+
* - JSON inside markdown code fences
|
|
97
|
+
*
|
|
98
|
+
* Edge fields accept both from/to AND source/target.
|
|
99
|
+
* All new fields (gender, affected, generation, relationship, etc.) are passed through.
|
|
100
|
+
*/
|
|
101
|
+
export declare function parseDiagramJSON(content: string): DiagramData;
|
|
102
|
+
export declare function validateDiagram(diagram: DiagramData): boolean;
|
|
103
|
+
export declare function diagramToJSON(diagram: DiagramData): string;
|
|
104
|
+
export declare function parseDiagramContent(content: string): DiagramData;
|
|
105
|
+
export {};
|