@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,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diagram Block Printer
|
|
3
|
+
*
|
|
4
|
+
* Two output strategies:
|
|
5
|
+
* 1. "capture" variants — screenshot the live ReactFlow canvas via
|
|
6
|
+
* dom-capture-print-utils (handles oklch/lab CSS) → PDF
|
|
7
|
+
* 2. "svg-export" variant — walk the diagram JSON and emit a pure SVG
|
|
8
|
+
* placed inside a styled print document → browser print dialog
|
|
9
|
+
*
|
|
10
|
+
* The capture approach is highest-fidelity (matches what the user sees).
|
|
11
|
+
* The SVG approach is resolution-independent and works better for very
|
|
12
|
+
* large or complex diagrams.
|
|
13
|
+
*/
|
|
14
|
+
import type { BlockPrinter } from "@ai-matrx/print/core";
|
|
15
|
+
import type { DiagramData } from "./parseDiagramJSON.js";
|
|
16
|
+
export declare function createDiagramPrinter(getElement: () => HTMLElement | null, diagram: DiagramData): BlockPrinter;
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import {
|
|
2
|
+
openPrintWindow
|
|
3
|
+
} from "@ai-matrx/print/core";
|
|
4
|
+
async function captureDiagramToPDF(element, diagram, settings) {
|
|
5
|
+
const { captureToPDF } = await import("@ai-matrx/print/pdf");
|
|
6
|
+
const orientation = settings["orientation"] ?? "landscape";
|
|
7
|
+
const paperSize = settings["paperSize"] ?? "a4";
|
|
8
|
+
const isDark = settings["darkMode"] ?? false;
|
|
9
|
+
const background = isDark ? "#111827" : "#ffffff";
|
|
10
|
+
await captureToPDF(element, {
|
|
11
|
+
orientation,
|
|
12
|
+
paperSize,
|
|
13
|
+
background,
|
|
14
|
+
filename: diagram.title.replace(/[^a-z0-9]/gi, "_").toLowerCase() || "diagram",
|
|
15
|
+
scale: settings["highRes"] ? 3 : 2
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const SVG_COLORS = {
|
|
19
|
+
start: { bg: "#dcfce7", border: "#16a34a", text: "#14532d" },
|
|
20
|
+
end: { bg: "#fee2e2", border: "#dc2626", text: "#7f1d1d" },
|
|
21
|
+
decision: { bg: "#ffedd5", border: "#ea580c", text: "#7c2d12" },
|
|
22
|
+
process: { bg: "#dbeafe", border: "#2563eb", text: "#1e3a8a" },
|
|
23
|
+
data: { bg: "#f3e8ff", border: "#9333ea", text: "#4a044e" },
|
|
24
|
+
user: { bg: "#e0e7ff", border: "#4338ca", text: "#1e1b4b" },
|
|
25
|
+
system: { bg: "#f3f4f6", border: "#4b5563", text: "#111827" },
|
|
26
|
+
api: { bg: "#ccfbf1", border: "#0d9488", text: "#134e4a" },
|
|
27
|
+
compute: { bg: "#fef9c3", border: "#ca8a04", text: "#713f12" },
|
|
28
|
+
storage: { bg: "#fce7f3", border: "#db2777", text: "#500724" },
|
|
29
|
+
event: { bg: "#cffafe", border: "#0891b2", text: "#164e63" },
|
|
30
|
+
entity: { bg: "#ede9fe", border: "#7c3aed", text: "#2e1065" },
|
|
31
|
+
gateway: { bg: "#fef3c7", border: "#d97706", text: "#78350f" },
|
|
32
|
+
default: { bg: "#f9fafb", border: "#6b7280", text: "#111827" },
|
|
33
|
+
// Pedigree
|
|
34
|
+
pedigree_male: { bg: "#f9fafb", border: "#374151", text: "#111827" },
|
|
35
|
+
pedigree_female: { bg: "#f9fafb", border: "#374151", text: "#111827" },
|
|
36
|
+
pedigree_male_affected: { bg: "#1f2937", border: "#111827", text: "#ffffff" },
|
|
37
|
+
pedigree_female_affected: {
|
|
38
|
+
bg: "#1f2937",
|
|
39
|
+
border: "#111827",
|
|
40
|
+
text: "#ffffff"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
function esc(str) {
|
|
44
|
+
return String(str ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
45
|
+
}
|
|
46
|
+
function buildSvgDocument(diagram, settings) {
|
|
47
|
+
const orientation = settings["orientation"] ?? "landscape";
|
|
48
|
+
const isLandscape = orientation === "landscape";
|
|
49
|
+
const NODE_W = 160;
|
|
50
|
+
const NODE_H = 60;
|
|
51
|
+
const PEDIGREE_SIZE = 70;
|
|
52
|
+
const H_GAP = 60;
|
|
53
|
+
const V_GAP = 80;
|
|
54
|
+
const COLS = isLandscape ? 5 : 3;
|
|
55
|
+
const MARGIN = 40;
|
|
56
|
+
const isPedigree = diagram.type === "pedigree";
|
|
57
|
+
const positioned = diagram.nodes.map((node, i) => ({
|
|
58
|
+
...node,
|
|
59
|
+
x: node.position?.x ?? i % COLS * (NODE_W + H_GAP) + MARGIN,
|
|
60
|
+
y: node.position?.y ?? Math.floor(i / COLS) * (NODE_H + V_GAP) + MARGIN
|
|
61
|
+
}));
|
|
62
|
+
const allX = positioned.map((n) => n.x);
|
|
63
|
+
const allY = positioned.map((n) => n.y);
|
|
64
|
+
const minX = Math.min(...allX) - MARGIN;
|
|
65
|
+
const minY = Math.min(...allY) - MARGIN;
|
|
66
|
+
const maxX = Math.max(...allX) + NODE_W + MARGIN;
|
|
67
|
+
const maxY = Math.max(...allY) + (isPedigree ? PEDIGREE_SIZE + 40 : NODE_H) + MARGIN;
|
|
68
|
+
const svgW = maxX - minX;
|
|
69
|
+
const svgH = maxY - minY;
|
|
70
|
+
const posMap = new Map(
|
|
71
|
+
positioned.map((n) => [n.id, { x: n.x - minX, y: n.y - minY }])
|
|
72
|
+
);
|
|
73
|
+
const nodesSvg = positioned.map((node) => {
|
|
74
|
+
const pos = posMap.get(node.id);
|
|
75
|
+
if (!pos) return "";
|
|
76
|
+
const nodeType = node.nodeType || node.type || "default";
|
|
77
|
+
const customColor = node.color;
|
|
78
|
+
if (isPedigree) {
|
|
79
|
+
const isAffected = node.affected;
|
|
80
|
+
const isFemale = node.gender === "female";
|
|
81
|
+
const isUnknown = !node.gender || node.gender === "unknown";
|
|
82
|
+
const colorKey = isFemale ? isAffected ? "pedigree_female_affected" : "pedigree_female" : isAffected ? "pedigree_male_affected" : "pedigree_male";
|
|
83
|
+
const c = SVG_COLORS[colorKey];
|
|
84
|
+
const cx = pos.x + PEDIGREE_SIZE / 2;
|
|
85
|
+
const cy = pos.y + PEDIGREE_SIZE / 2;
|
|
86
|
+
const label2 = esc(node.label);
|
|
87
|
+
const years = node.birthYear && node.deathYear ? `${node.birthYear}\u2013${node.deathYear}` : node.birthYear ? `b.${node.birthYear}` : node.deathYear ? `d.${node.deathYear}` : "";
|
|
88
|
+
const shape = isFemale ? `<circle cx="${cx}" cy="${cy}" r="${PEDIGREE_SIZE / 2}" fill="${c.bg}" stroke="${c.border}" stroke-width="2.5"/>` : isUnknown ? `<rect x="${pos.x}" y="${pos.y}" width="${PEDIGREE_SIZE}" height="${PEDIGREE_SIZE}" fill="${c.bg}" stroke="${c.border}" stroke-width="2.5" transform="rotate(45 ${cx} ${cy})"/>` : `<rect x="${pos.x}" y="${pos.y}" width="${PEDIGREE_SIZE}" height="${PEDIGREE_SIZE}" fill="${c.bg}" stroke="${c.border}" stroke-width="2.5"/>`;
|
|
89
|
+
const deceased = node.deceased ? `<line x1="${pos.x + 8}" y1="${pos.y + PEDIGREE_SIZE - 8}" x2="${pos.x + PEDIGREE_SIZE - 8}" y2="${pos.y + 8}" stroke="${c.border}" stroke-width="1.5"/>` : "";
|
|
90
|
+
const proband = node.proband ? `<text x="${pos.x - 12}" y="${cy + 4}" font-size="14" fill="#2563eb">\u2197</text>` : "";
|
|
91
|
+
return `
|
|
92
|
+
<g>
|
|
93
|
+
${shape}
|
|
94
|
+
${deceased}
|
|
95
|
+
${proband}
|
|
96
|
+
<text x="${cx}" y="${cy + 4}" text-anchor="middle" font-size="9" font-family="sans-serif" fill="${c.text}">${label2}</text>
|
|
97
|
+
${node.description ? `<text x="${cx}" y="${pos.y + PEDIGREE_SIZE + 14}" text-anchor="middle" font-size="8" font-family="sans-serif" fill="#374151">${esc(node.description)}</text>` : ""}
|
|
98
|
+
${years ? `<text x="${cx}" y="${pos.y + PEDIGREE_SIZE + 24}" text-anchor="middle" font-size="7" font-family="sans-serif" fill="#6b7280">${esc(years)}</text>` : ""}
|
|
99
|
+
</g>`;
|
|
100
|
+
}
|
|
101
|
+
const colors = customColor ? { bg: `${customColor}20`, border: customColor, text: customColor } : SVG_COLORS[nodeType in SVG_COLORS ? nodeType : "default"];
|
|
102
|
+
const label = esc(node.label);
|
|
103
|
+
const description = node.description ? esc(node.description) : "";
|
|
104
|
+
return `
|
|
105
|
+
<g>
|
|
106
|
+
<rect x="${pos.x}" y="${pos.y}" width="${NODE_W}" height="${NODE_H}" rx="8" ry="8"
|
|
107
|
+
fill="${colors.bg}" stroke="${colors.border}" stroke-width="2"/>
|
|
108
|
+
<text x="${pos.x + NODE_W / 2}" y="${pos.y + (description ? 20 : NODE_H / 2 + 5)}"
|
|
109
|
+
text-anchor="middle" font-size="11" font-weight="600" font-family="sans-serif" fill="${colors.text}">${label}</text>
|
|
110
|
+
${description ? `<text x="${pos.x + NODE_W / 2}" y="${pos.y + 36}" text-anchor="middle" font-size="9" font-family="sans-serif" fill="${colors.text}" opacity="0.7">${description}</text>` : ""}
|
|
111
|
+
</g>`;
|
|
112
|
+
}).join("\n");
|
|
113
|
+
const nodeIds = new Set(diagram.nodes.map((n) => n.id));
|
|
114
|
+
const edgesSvg = diagram.edges.filter((e) => nodeIds.has(e.source) && nodeIds.has(e.target)).map((edge) => {
|
|
115
|
+
const src = posMap.get(edge.source);
|
|
116
|
+
const tgt = posMap.get(edge.target);
|
|
117
|
+
if (!src || !tgt) return "";
|
|
118
|
+
const isPedigreeMarriage = diagram.type === "pedigree" && edge.relationship === "marriage";
|
|
119
|
+
const isPedigreeParent = diagram.type === "pedigree" && edge.relationship === "parent";
|
|
120
|
+
const nodeSize = isPedigree ? PEDIGREE_SIZE : NODE_H;
|
|
121
|
+
const nodeWidth = isPedigree ? PEDIGREE_SIZE : NODE_W;
|
|
122
|
+
const x1 = src.x + nodeWidth / 2;
|
|
123
|
+
const y1 = src.y + (isPedigreeMarriage ? nodeSize / 2 : nodeSize);
|
|
124
|
+
const x2 = tgt.x + nodeWidth / 2;
|
|
125
|
+
const y2 = tgt.y + (isPedigreeMarriage ? nodeSize / 2 : 0);
|
|
126
|
+
const stroke = edge.color ?? (isPedigreeMarriage ? "#374151" : "#6b7280");
|
|
127
|
+
const strokeWidth = isPedigreeMarriage ? 2.5 : edge.strokeWidth ?? 2;
|
|
128
|
+
const dashArray = edge.dashed || edge.relationship === "divorced" ? "6,3" : "none";
|
|
129
|
+
const markerEnd = isPedigreeMarriage ? "" : "url(#arrow)";
|
|
130
|
+
const midY = (y1 + y2) / 2;
|
|
131
|
+
const d = `M ${x1} ${y1} C ${x1} ${midY}, ${x2} ${midY}, ${x2} ${y2}`;
|
|
132
|
+
const labelEl = edge.label && diagram.type !== "pedigree" ? `<text x="${(x1 + x2) / 2}" y="${(y1 + y2) / 2 - 4}" text-anchor="middle" font-size="9" font-family="sans-serif" fill="#6b7280">${esc(edge.label)}</text>` : "";
|
|
133
|
+
return `
|
|
134
|
+
<path d="${d}" fill="none" stroke="${stroke}" stroke-width="${strokeWidth}"
|
|
135
|
+
stroke-dasharray="${dashArray}" marker-end="${markerEnd}"/>
|
|
136
|
+
${labelEl}`;
|
|
137
|
+
}).join("\n");
|
|
138
|
+
const pageW = isLandscape ? 297 : 210;
|
|
139
|
+
const pageH = isLandscape ? 210 : 297;
|
|
140
|
+
const html = `<!DOCTYPE html>
|
|
141
|
+
<html lang="en">
|
|
142
|
+
<head>
|
|
143
|
+
<meta charset="UTF-8">
|
|
144
|
+
<title>${esc(diagram.title)}</title>
|
|
145
|
+
<style>
|
|
146
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
147
|
+
body {
|
|
148
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
|
|
149
|
+
background: #fff;
|
|
150
|
+
padding: 20px;
|
|
151
|
+
}
|
|
152
|
+
h1 {
|
|
153
|
+
font-size: 18pt;
|
|
154
|
+
font-weight: 700;
|
|
155
|
+
color: #111827;
|
|
156
|
+
margin-bottom: 6px;
|
|
157
|
+
}
|
|
158
|
+
.description {
|
|
159
|
+
font-size: 11pt;
|
|
160
|
+
color: #4b5563;
|
|
161
|
+
margin-bottom: 16px;
|
|
162
|
+
}
|
|
163
|
+
.badge {
|
|
164
|
+
display: inline-block;
|
|
165
|
+
font-size: 9pt;
|
|
166
|
+
padding: 2px 10px;
|
|
167
|
+
border-radius: 999px;
|
|
168
|
+
background: #dbeafe;
|
|
169
|
+
color: #1d4ed8;
|
|
170
|
+
margin-bottom: 16px;
|
|
171
|
+
}
|
|
172
|
+
.diagram-wrap {
|
|
173
|
+
overflow: auto;
|
|
174
|
+
border: 1px solid #e5e7eb;
|
|
175
|
+
border-radius: 10px;
|
|
176
|
+
padding: 16px;
|
|
177
|
+
background: #fafafa;
|
|
178
|
+
}
|
|
179
|
+
svg { display: block; max-width: 100%; height: auto; }
|
|
180
|
+
.print-actions {
|
|
181
|
+
display: flex;
|
|
182
|
+
gap: 10px;
|
|
183
|
+
margin-bottom: 20px;
|
|
184
|
+
}
|
|
185
|
+
.print-btn {
|
|
186
|
+
padding: 8px 20px;
|
|
187
|
+
border-radius: 8px;
|
|
188
|
+
font-size: 13px;
|
|
189
|
+
font-family: inherit;
|
|
190
|
+
cursor: pointer;
|
|
191
|
+
border: none;
|
|
192
|
+
font-weight: 600;
|
|
193
|
+
}
|
|
194
|
+
.print-btn-primary { background: #2563eb; color: #fff; }
|
|
195
|
+
.print-btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
|
|
196
|
+
@page { size: ${isLandscape ? "landscape" : "portrait"}; margin: 15mm; }
|
|
197
|
+
@media print {
|
|
198
|
+
.print-actions { display: none !important; }
|
|
199
|
+
body { padding: 0; }
|
|
200
|
+
.diagram-wrap { border: none; padding: 0; background: none; }
|
|
201
|
+
svg { width: 100% !important; height: auto !important; }
|
|
202
|
+
}
|
|
203
|
+
</style>
|
|
204
|
+
</head>
|
|
205
|
+
<body>
|
|
206
|
+
<div class="print-actions">
|
|
207
|
+
<button class="print-btn print-btn-primary" onclick="window.print()">Print / Save as PDF</button>
|
|
208
|
+
<button class="print-btn print-btn-secondary" onclick="window.close()">Close</button>
|
|
209
|
+
</div>
|
|
210
|
+
<h1>${esc(diagram.title)}</h1>
|
|
211
|
+
${diagram.description ? `<p class="description">${esc(diagram.description)}</p>` : ""}
|
|
212
|
+
<span class="badge">${esc(diagram.type.charAt(0).toUpperCase() + diagram.type.slice(1))}</span>
|
|
213
|
+
<div class="diagram-wrap">
|
|
214
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
215
|
+
viewBox="0 0 ${svgW} ${svgH}"
|
|
216
|
+
width="${svgW}"
|
|
217
|
+
height="${svgH}">
|
|
218
|
+
<defs>
|
|
219
|
+
<marker id="arrow" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
|
|
220
|
+
<polygon points="0 0, 10 3.5, 0 7" fill="#6b7280"/>
|
|
221
|
+
</marker>
|
|
222
|
+
</defs>
|
|
223
|
+
${edgesSvg}
|
|
224
|
+
${nodesSvg}
|
|
225
|
+
</svg>
|
|
226
|
+
</div>
|
|
227
|
+
</body>
|
|
228
|
+
</html>`;
|
|
229
|
+
return html;
|
|
230
|
+
}
|
|
231
|
+
function createDiagramPrinter(getElement, diagram) {
|
|
232
|
+
return {
|
|
233
|
+
label: "Print Diagram",
|
|
234
|
+
variants: [
|
|
235
|
+
{
|
|
236
|
+
id: "capture-landscape",
|
|
237
|
+
label: "Screenshot \u2014 Landscape PDF",
|
|
238
|
+
description: "Captures the diagram exactly as displayed. Best for most diagrams."
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: "capture-portrait",
|
|
242
|
+
label: "Screenshot \u2014 Portrait PDF",
|
|
243
|
+
description: "Same capture, rotated to portrait orientation."
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
id: "svg-landscape",
|
|
247
|
+
label: "Vector \u2014 Landscape (print dialog)",
|
|
248
|
+
description: "Resolution-independent SVG. Opens browser print dialog. Best for large diagrams."
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: "svg-portrait",
|
|
252
|
+
label: "Vector \u2014 Portrait (print dialog)",
|
|
253
|
+
description: "Same vector output, portrait layout."
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
settings: [
|
|
257
|
+
{
|
|
258
|
+
type: "boolean",
|
|
259
|
+
id: "highRes",
|
|
260
|
+
label: "High resolution",
|
|
261
|
+
description: "Render at 3\xD7 scale instead of 2\xD7. Larger file, sharper output.",
|
|
262
|
+
defaultValue: false,
|
|
263
|
+
appliesTo: ["capture-landscape", "capture-portrait"]
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
type: "boolean",
|
|
267
|
+
id: "darkMode",
|
|
268
|
+
label: "Dark background",
|
|
269
|
+
description: "Use dark theme colors in the exported PDF.",
|
|
270
|
+
defaultValue: false,
|
|
271
|
+
appliesTo: ["capture-landscape", "capture-portrait"]
|
|
272
|
+
}
|
|
273
|
+
],
|
|
274
|
+
print: async (data, variantId, settings = {}) => {
|
|
275
|
+
const d = data?.diagram ?? data;
|
|
276
|
+
if (!variantId || variantId.startsWith("capture")) {
|
|
277
|
+
const el = getElement();
|
|
278
|
+
if (!el) {
|
|
279
|
+
console.warn("[DiagramPrinter] No element to capture");
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const orientation = variantId === "capture-portrait" ? "portrait" : "landscape";
|
|
283
|
+
await captureDiagramToPDF(el, d, { ...settings, orientation });
|
|
284
|
+
} else {
|
|
285
|
+
const orientation = variantId === "svg-portrait" ? "portrait" : "landscape";
|
|
286
|
+
const html = buildSvgDocument(d, { ...settings, orientation });
|
|
287
|
+
openPrintWindow(html, d.title || "diagram");
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
export {
|
|
293
|
+
createDiagramPrinter
|
|
294
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure visual vocabulary and default inference for the canonical diagram
|
|
3
|
+
* document. Defaults are materialized into DiagramData before render/save so
|
|
4
|
+
* the renderer never owns an invisible styling decision the user cannot edit.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DIAGRAM_NODE_SHAPES: readonly ["rounded", "rectangle", "pill", "circle", "diamond", "hexagon"];
|
|
7
|
+
export type DiagramNodeShape = (typeof DIAGRAM_NODE_SHAPES)[number];
|
|
8
|
+
export declare const DIAGRAM_BORDER_STYLES: readonly ["solid", "dashed", "dotted"];
|
|
9
|
+
export type DiagramBorderStyle = (typeof DIAGRAM_BORDER_STYLES)[number];
|
|
10
|
+
export declare const DIAGRAM_EDGE_MARKERS: readonly ["none", "end", "start", "both"];
|
|
11
|
+
export type DiagramEdgeMarker = (typeof DIAGRAM_EDGE_MARKERS)[number];
|
|
12
|
+
export declare const DIAGRAM_BACKGROUNDS: readonly ["dots", "lines", "cross"];
|
|
13
|
+
export type DiagramBackground = (typeof DIAGRAM_BACKGROUNDS)[number];
|
|
14
|
+
export declare const DIAGRAM_COLOR_PRESETS: readonly [{
|
|
15
|
+
readonly value: "gray";
|
|
16
|
+
readonly label: "Gray";
|
|
17
|
+
readonly hex: "#6b7280";
|
|
18
|
+
readonly nodeClass: "bg-textured border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300";
|
|
19
|
+
}, {
|
|
20
|
+
readonly value: "purple";
|
|
21
|
+
readonly label: "Purple";
|
|
22
|
+
readonly hex: "#8b5cf6";
|
|
23
|
+
readonly nodeClass: "bg-purple-100 dark:bg-purple-950/30 border-purple-500 text-purple-700 dark:text-purple-300";
|
|
24
|
+
}, {
|
|
25
|
+
readonly value: "slate";
|
|
26
|
+
readonly label: "Slate";
|
|
27
|
+
readonly hex: "#64748b";
|
|
28
|
+
readonly nodeClass: "bg-slate-100 dark:bg-slate-950/30 border-slate-500 text-slate-700 dark:text-slate-300";
|
|
29
|
+
}, {
|
|
30
|
+
readonly value: "blue";
|
|
31
|
+
readonly label: "Blue";
|
|
32
|
+
readonly hex: "#3b82f6";
|
|
33
|
+
readonly nodeClass: "bg-blue-100 dark:bg-blue-950/30 border-blue-500 text-blue-700 dark:text-blue-300";
|
|
34
|
+
}, {
|
|
35
|
+
readonly value: "indigo";
|
|
36
|
+
readonly label: "Indigo";
|
|
37
|
+
readonly hex: "#6366f1";
|
|
38
|
+
readonly nodeClass: "bg-indigo-100 dark:bg-indigo-950/30 border-indigo-500 text-indigo-700 dark:text-indigo-300";
|
|
39
|
+
}, {
|
|
40
|
+
readonly value: "violet";
|
|
41
|
+
readonly label: "Violet";
|
|
42
|
+
readonly hex: "#8b5cf6";
|
|
43
|
+
readonly nodeClass: "bg-violet-100 dark:bg-violet-950/30 border-violet-500 text-violet-700 dark:text-violet-300";
|
|
44
|
+
}, {
|
|
45
|
+
readonly value: "pink";
|
|
46
|
+
readonly label: "Pink";
|
|
47
|
+
readonly hex: "#ec4899";
|
|
48
|
+
readonly nodeClass: "bg-pink-100 dark:bg-pink-950/30 border-pink-500 text-pink-700 dark:text-pink-300";
|
|
49
|
+
}, {
|
|
50
|
+
readonly value: "red";
|
|
51
|
+
readonly label: "Red";
|
|
52
|
+
readonly hex: "#ef4444";
|
|
53
|
+
readonly nodeClass: "bg-red-100 dark:bg-red-950/30 border-red-500 text-red-700 dark:text-red-300";
|
|
54
|
+
}, {
|
|
55
|
+
readonly value: "orange";
|
|
56
|
+
readonly label: "Orange";
|
|
57
|
+
readonly hex: "#f97316";
|
|
58
|
+
readonly nodeClass: "bg-orange-100 dark:bg-orange-950/30 border-orange-500 text-orange-700 dark:text-orange-300";
|
|
59
|
+
}, {
|
|
60
|
+
readonly value: "amber";
|
|
61
|
+
readonly label: "Amber";
|
|
62
|
+
readonly hex: "#f59e0b";
|
|
63
|
+
readonly nodeClass: "bg-amber-100 dark:bg-amber-950/30 border-amber-500 text-amber-700 dark:text-amber-300";
|
|
64
|
+
}, {
|
|
65
|
+
readonly value: "yellow";
|
|
66
|
+
readonly label: "Yellow";
|
|
67
|
+
readonly hex: "#eab308";
|
|
68
|
+
readonly nodeClass: "bg-yellow-100 dark:bg-yellow-950/30 border-yellow-500 text-yellow-700 dark:text-yellow-300";
|
|
69
|
+
}, {
|
|
70
|
+
readonly value: "green";
|
|
71
|
+
readonly label: "Green";
|
|
72
|
+
readonly hex: "#10b981";
|
|
73
|
+
readonly nodeClass: "bg-green-100 dark:bg-green-950/30 border-green-500 text-green-700 dark:text-green-300";
|
|
74
|
+
}, {
|
|
75
|
+
readonly value: "teal";
|
|
76
|
+
readonly label: "Teal";
|
|
77
|
+
readonly hex: "#14b8a6";
|
|
78
|
+
readonly nodeClass: "bg-teal-100 dark:bg-teal-950/30 border-teal-500 text-teal-700 dark:text-teal-300";
|
|
79
|
+
}, {
|
|
80
|
+
readonly value: "cyan";
|
|
81
|
+
readonly label: "Cyan";
|
|
82
|
+
readonly hex: "#06b6d4";
|
|
83
|
+
readonly nodeClass: "bg-cyan-100 dark:bg-cyan-950/30 border-cyan-500 text-cyan-700 dark:text-cyan-300";
|
|
84
|
+
}];
|
|
85
|
+
export type DiagramColorPreset = (typeof DIAGRAM_COLOR_PRESETS)[number]["value"];
|
|
86
|
+
export declare function getDiagramColorHex(color: unknown): string;
|
|
87
|
+
export declare function getDiagramNodeColorClass(color: unknown): string;
|
|
88
|
+
export declare function isCustomDiagramColor(color: unknown): color is string;
|
|
89
|
+
export declare function normalizeDiagramIconName(iconName: string | null | undefined): string;
|
|
90
|
+
interface VisualInferenceInput {
|
|
91
|
+
diagramType: string;
|
|
92
|
+
nodeType: string;
|
|
93
|
+
label: string;
|
|
94
|
+
description?: string;
|
|
95
|
+
details?: string;
|
|
96
|
+
isGroup?: boolean;
|
|
97
|
+
}
|
|
98
|
+
export declare function inferOrgChartRoleIconName(label: string, description?: string, details?: string): string;
|
|
99
|
+
export declare function inferDiagramNodeVisuals(input: VisualInferenceInput): {
|
|
100
|
+
color: string;
|
|
101
|
+
icon: string;
|
|
102
|
+
shape: DiagramNodeShape;
|
|
103
|
+
borderStyle: DiagramBorderStyle;
|
|
104
|
+
textAlign: "left" | "center";
|
|
105
|
+
};
|
|
106
|
+
export declare const DEFAULT_DIAGRAM_RENDER_HINTS: {
|
|
107
|
+
showLegend: boolean;
|
|
108
|
+
showEdgeLabels: boolean;
|
|
109
|
+
compactNodes: boolean;
|
|
110
|
+
hideArrows: boolean;
|
|
111
|
+
background: DiagramBackground;
|
|
112
|
+
showMiniMap: boolean;
|
|
113
|
+
snapToGrid: boolean;
|
|
114
|
+
showControls: boolean;
|
|
115
|
+
};
|
|
116
|
+
export {};
|