@ai-matrx/rich-content 0.2.4 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/code-block/CodeBlock.d.ts +44 -0
- package/dist/code-block/CodeBlock.js +449 -0
- package/dist/code-block/CodeBlockHeader.d.ts +63 -0
- package/dist/code-block/CodeBlockHeader.js +472 -0
- package/dist/code-block/CodeEditorLoading.d.ts +3 -0
- package/dist/code-block/CodeEditorLoading.js +34 -0
- package/dist/code-block/LanguageDisplay.d.ts +28 -0
- package/dist/code-block/LanguageDisplay.js +279 -0
- package/dist/code-block/SmallCodeEditor.d.ts +30 -0
- package/dist/code-block/SmallCodeEditor.js +22 -0
- package/dist/code-block/StickyButtons.d.ts +35 -0
- package/dist/code-block/StickyButtons.js +88 -0
- package/dist/code-block/highlight/ShikiCodeView.d.ts +26 -0
- package/dist/code-block/highlight/ShikiCodeView.js +134 -0
- package/dist/code-block/highlight/shiki-highlighter.d.ts +14 -0
- package/dist/code-block/highlight/shiki-highlighter.js +126 -0
- package/dist/code-block/highlight/useHighlightedLines.d.ts +18 -0
- package/dist/code-block/highlight/useHighlightedLines.js +142 -0
- package/dist/code-block/sticky-inset.d.ts +6 -0
- package/dist/code-block/sticky-inset.js +10 -0
- package/dist/display/block-interaction.d.ts +33 -0
- package/dist/display/block-interaction.js +13 -0
- package/dist/display/blocks/ChatCollapsibleWrapper.d.ts +13 -0
- package/dist/display/blocks/ChatCollapsibleWrapper.js +56 -0
- package/dist/display/blocks/buildMediaSource.d.ts +25 -0
- package/dist/display/blocks/buildMediaSource.js +43 -0
- package/dist/display/blocks/canvas-adaptive.d.ts +118 -0
- package/dist/display/blocks/canvas-adaptive.js +127 -0
- package/dist/display/blocks/canvas-fit.d.ts +24 -0
- package/dist/display/blocks/canvas-fit.js +19 -0
- package/dist/display/blocks/chart/ChartBlock.d.ts +8 -0
- package/dist/display/blocks/chart/ChartBlock.js +125 -0
- package/dist/display/blocks/chart/ChartCanvas.d.ts +18 -0
- package/dist/display/blocks/chart/ChartCanvas.js +159 -0
- package/dist/display/blocks/chart/TableChart.d.ts +25 -0
- package/dist/display/blocks/chart/TableChart.js +97 -0
- package/dist/display/blocks/chart/chart-spec.d.ts +39 -0
- package/dist/display/blocks/chart/chart-spec.js +128 -0
- package/dist/display/blocks/chart/labels.d.ts +20 -0
- package/dist/display/blocks/chart/labels.js +7 -0
- package/dist/display/blocks/chart/table-chart.d.ts +37 -0
- package/dist/display/blocks/chart/table-chart.js +231 -0
- package/dist/display/blocks/common/BlockHeaderWrapper.d.ts +56 -0
- package/dist/display/blocks/common/BlockHeaderWrapper.js +310 -0
- package/dist/display/blocks/common/ContentBlockWrapper.d.ts +40 -0
- package/dist/display/blocks/common/ContentBlockWrapper.js +214 -0
- package/dist/display/blocks/common/SandboxedHtml.d.ts +27 -0
- package/dist/display/blocks/common/SandboxedHtml.js +26 -0
- package/dist/display/blocks/diagram/DiagramLoadingVisualization.d.ts +6 -0
- package/dist/display/blocks/diagram/DiagramLoadingVisualization.js +190 -0
- package/dist/display/blocks/diagram/InteractiveDiagramBlock.d.ts +51 -0
- package/dist/display/blocks/diagram/InteractiveDiagramBlock.js +2415 -0
- package/dist/display/blocks/diagram/diagram-printer.d.ts +16 -0
- package/dist/display/blocks/diagram/diagram-printer.js +294 -0
- package/dist/display/blocks/diagram/diagram-visual-defaults.d.ts +116 -0
- package/dist/display/blocks/diagram/diagram-visual-defaults.js +400 -0
- package/dist/display/blocks/diagram/layout-utils.d.ts +90 -0
- package/dist/display/blocks/diagram/layout-utils.js +347 -0
- package/dist/display/blocks/diagram/parseDiagramJSON.d.ts +105 -0
- package/dist/display/blocks/diagram/parseDiagramJSON.js +296 -0
- package/dist/display/blocks/diagram/presentation-direction.d.ts +29 -0
- package/dist/display/blocks/diagram/presentation-direction.js +19 -0
- package/dist/display/blocks/diagram/ui-utils.d.ts +1 -0
- package/dist/display/blocks/diagram/ui-utils.js +18 -0
- package/dist/display/blocks/diff/DiffBlock.d.ts +10 -0
- package/dist/display/blocks/diff/DiffBlock.js +119 -0
- package/dist/display/blocks/diff/DiffCanvas.d.ts +15 -0
- package/dist/display/blocks/diff/DiffCanvas.js +20 -0
- package/dist/display/blocks/generic/GenericStructuredBlock.d.ts +24 -0
- package/dist/display/blocks/generic/GenericStructuredBlock.js +53 -0
- package/dist/display/blocks/generic/StructuredValueTabs.d.ts +21 -0
- package/dist/display/blocks/generic/StructuredValueTabs.js +124 -0
- package/dist/display/blocks/generic/tile-actions-slot.d.ts +39 -0
- package/dist/display/blocks/generic/tile-actions-slot.js +33 -0
- package/dist/display/blocks/images/ImageBlock.d.ts +8 -0
- package/dist/display/blocks/images/ImageBlock.js +265 -0
- package/dist/display/blocks/json/JsonBlock.d.ts +34 -0
- package/dist/display/blocks/json/JsonBlock.js +562 -0
- package/dist/display/blocks/json/JsonTableView.d.ts +10 -0
- package/dist/display/blocks/json/JsonTableView.js +173 -0
- package/dist/display/blocks/json/json-compact-stringify.d.ts +25 -0
- package/dist/display/blocks/json/json-compact-stringify.js +52 -0
- package/dist/display/blocks/json/json-tabular-utils.d.ts +65 -0
- package/dist/display/blocks/json/json-tabular-utils.js +121 -0
- package/dist/display/blocks/links/LinkComponent.d.ts +6 -0
- package/dist/display/blocks/links/LinkComponent.js +373 -0
- package/dist/display/blocks/links/LinkComponentWithFetch.d.ts +1 -0
- package/dist/display/blocks/links/LinkComponentWithFetch.js +0 -0
- package/dist/display/blocks/markdown/MarkdownKindBlock.d.ts +48 -0
- package/dist/display/blocks/markdown/MarkdownKindBlock.js +52 -0
- package/dist/display/blocks/markdown-preview/MarkdownPreviewBlock.d.ts +17 -0
- package/dist/display/blocks/markdown-preview/MarkdownPreviewBlock.js +70 -0
- package/dist/display/blocks/mermaid/MermaidBlock.d.ts +19 -0
- package/dist/display/blocks/mermaid/MermaidBlock.js +386 -0
- package/dist/display/blocks/search-replace/SearchReplaceBlock.d.ts +50 -0
- package/dist/display/blocks/search-replace/SearchReplaceBlock.js +71 -0
- package/dist/display/blocks/svg/SvgBlock.d.ts +8 -0
- package/dist/display/blocks/svg/SvgBlock.js +126 -0
- package/dist/display/blocks/table/StreamingTableRenderer.d.ts +53 -0
- package/dist/display/blocks/table/StreamingTableRenderer.js +907 -0
- package/dist/display/blocks/table/TableRenderPathDiagnostic.d.ts +21 -0
- package/dist/display/blocks/table/TableRenderPathDiagnostic.js +79 -0
- package/dist/display/blocks/thinking-reasoning/ConsolidatedReasoningVisualization.d.ts +14 -0
- package/dist/display/blocks/thinking-reasoning/ConsolidatedReasoningVisualization.js +15 -0
- package/dist/display/blocks/thinking-reasoning/ReasoningVisualization.d.ts +13 -0
- package/dist/display/blocks/thinking-reasoning/ReasoningVisualization.js +19 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingTrace.d.ts +30 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingTrace.js +75 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingTraceMarkdown.d.ts +13 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingTraceMarkdown.js +48 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingVisualization.d.ts +12 -0
- package/dist/display/blocks/thinking-reasoning/ThinkingVisualization.js +19 -0
- package/dist/display/blocks/toml/TomlBlock.d.ts +7 -0
- package/dist/display/blocks/toml/TomlBlock.js +167 -0
- package/dist/display/blocks/tree/TreeBlock.d.ts +7 -0
- package/dist/display/blocks/tree/TreeBlock.js +163 -0
- package/dist/display/blocks/xml/XmlBlock.d.ts +23 -0
- package/dist/display/blocks/xml/XmlBlock.js +197 -0
- package/dist/display/blocks/xml/readXmlTag.d.ts +1 -0
- package/dist/display/blocks/xml/readXmlTag.js +1 -0
- package/dist/display/blocks/xml/xml-tokenize.d.ts +13 -0
- package/dist/display/blocks/xml/xml-tokenize.js +169 -0
- package/dist/display/blocks/yaml/YamlBlock.d.ts +7 -0
- package/dist/display/blocks/yaml/YamlBlock.js +191 -0
- package/dist/display/chat-markdown/BasicMarkdownContent.d.ts +29 -0
- package/dist/display/chat-markdown/BasicMarkdownContent.js +122 -0
- package/dist/display/chat-markdown/BlockRenderingContext.d.ts +23 -0
- package/dist/display/chat-markdown/BlockRenderingContext.js +17 -0
- package/dist/display/chat-markdown/ConfigurableMarkdownContent.d.ts +172 -0
- package/dist/display/chat-markdown/ConfigurableMarkdownContent.js +649 -0
- package/dist/display/chat-markdown/InlineCodeSnippet.d.ts +19 -0
- package/dist/display/chat-markdown/InlineCodeSnippet.js +146 -0
- package/dist/display/chat-markdown/InlineCodeSnippetKindGate.d.ts +11 -0
- package/dist/display/chat-markdown/InlineCodeSnippetKindGate.js +9 -0
- package/dist/display/chat-markdown/KindTextGate.d.ts +31 -0
- package/dist/display/chat-markdown/KindTextGate.js +60 -0
- package/dist/display/chat-markdown/QuestionnaireLoadingVisualization.d.ts +6 -0
- package/dist/display/chat-markdown/QuestionnaireLoadingVisualization.js +92 -0
- package/dist/display/chat-markdown/block-registry/BlockComponentRegistry.d.ts +72 -0
- package/dist/display/chat-markdown/block-registry/BlockComponentRegistry.js +94 -0
- package/dist/display/chat-markdown/block-registry/BlockRenderer.d.ts +126 -0
- package/dist/display/chat-markdown/block-registry/BlockRenderer.js +473 -0
- package/dist/display/chat-markdown/block-registry/block-dispatch.d.ts +410 -0
- package/dist/display/chat-markdown/block-registry/block-dispatch.js +495 -0
- package/dist/display/chat-markdown/block-registry/json-parse-utils.d.ts +13 -0
- package/dist/display/chat-markdown/block-registry/json-parse-utils.js +236 -0
- package/dist/display/chat-markdown/constants.d.ts +14 -0
- package/dist/display/chat-markdown/constants.js +317 -0
- package/dist/display/chat-markdown/diff-blocks/DiffCollapsible.d.ts +31 -0
- package/dist/display/chat-markdown/diff-blocks/DiffCollapsible.js +62 -0
- package/dist/display/chat-markdown/diff-blocks/DiffLoadingIndicator.d.ts +12 -0
- package/dist/display/chat-markdown/diff-blocks/DiffLoadingIndicator.js +18 -0
- package/dist/display/chat-markdown/diff-blocks/StreamingDiffBlock.d.ts +22 -0
- package/dist/display/chat-markdown/diff-blocks/StreamingDiffBlock.js +130 -0
- package/dist/display/chat-markdown/diff-blocks/diff-style-registry.d.ts +21 -0
- package/dist/display/chat-markdown/diff-blocks/diff-style-registry.js +91 -0
- package/dist/display/chat-markdown/diff-blocks/renderers/SearchReplaceDiffRenderer.d.ts +26 -0
- package/dist/display/chat-markdown/diff-blocks/renderers/SearchReplaceDiffRenderer.js +186 -0
- package/dist/display/chat-markdown/diff-blocks/types.d.ts +56 -0
- package/dist/display/chat-markdown/diff-blocks/types.js +0 -0
- package/dist/display/chat-markdown/internal-handlers/BlockFallback.d.ts +20 -0
- package/dist/display/chat-markdown/internal-handlers/BlockFallback.js +83 -0
- package/dist/display/chat-markdown/internal-handlers/InlineStatusIndicator.d.ts +4 -0
- package/dist/display/chat-markdown/internal-handlers/InlineStatusIndicator.js +16 -0
- package/dist/display/chat-markdown/internal-handlers/MarkdownErrorBoundary.d.ts +17 -0
- package/dist/display/chat-markdown/internal-handlers/MarkdownErrorBoundary.js +40 -0
- package/dist/display/chat-markdown/internal-handlers/PlainTextFallback.d.ts +8 -0
- package/dist/display/chat-markdown/internal-handlers/PlainTextFallback.js +91 -0
- package/dist/display/chat-markdown/internal-handlers/SafeBlockRenderer.d.ts +20 -0
- package/dist/display/chat-markdown/internal-handlers/SafeBlockRenderer.js +72 -0
- package/dist/display/chat-markdown/kind-source-view.d.ts +14 -0
- package/dist/display/chat-markdown/kind-source-view.js +14 -0
- package/dist/display/chat-markdown/matrx-variables/MatrxVariableInline.d.ts +28 -0
- package/dist/display/chat-markdown/matrx-variables/MatrxVariableInline.js +65 -0
- package/dist/display/chat-markdown/progressive-mount.d.ts +18 -0
- package/dist/display/chat-markdown/progressive-mount.js +90 -0
- package/dist/display/chat-markdown/render-block-to-content-block.d.ts +31 -0
- package/dist/display/chat-markdown/render-block-to-content-block.js +32 -0
- package/dist/display/chat-markdown/settle-stream-blocks.d.ts +50 -0
- package/dist/display/chat-markdown/settle-stream-blocks.js +26 -0
- package/dist/display/chat-markdown/stable-blocks.d.ts +15 -0
- package/dist/display/chat-markdown/stable-blocks.js +54 -0
- package/dist/display/chat-markdown/types.d.ts +11 -0
- package/dist/display/chat-markdown/types.js +26 -0
- package/dist/display/specimen/SpecimenContext.d.ts +26 -0
- package/dist/display/specimen/SpecimenContext.js +64 -0
- package/dist/display/tables/MarkdownTable.d.ts +23 -0
- package/dist/display/tables/MarkdownTable.js +769 -0
- package/dist/display/tables/MarkdownTableScrollArea.d.ts +12 -0
- package/dist/display/tables/MarkdownTableScrollArea.js +92 -0
- package/dist/display/tables/SendToGoogleSheetButton.d.ts +19 -0
- package/dist/display/tables/SendToGoogleSheetButton.js +93 -0
- package/dist/display/tables/SendToWorkbookButton.d.ts +24 -0
- package/dist/display/tables/SendToWorkbookButton.js +93 -0
- package/dist/display/tables/TableSaveToMenu.d.ts +16 -0
- package/dist/display/tables/TableSaveToMenu.js +98 -0
- package/dist/display/tables/TableWithSeparatedControls.d.ts +22 -0
- package/dist/display/tables/TableWithSeparatedControls.js +574 -0
- package/dist/display/tables/ViewTableModal.d.ts +14 -0
- package/dist/display/tables/ViewTableModal.js +67 -0
- package/dist/display/tables/editing/ColumnActionsMenu.d.ts +16 -0
- package/dist/display/tables/editing/ColumnActionsMenu.js +80 -0
- package/dist/display/tables/editing/RowActionsMenu.d.ts +16 -0
- package/dist/display/tables/editing/RowActionsMenu.js +80 -0
- package/dist/display/tables/editing/TableEditToolbar.d.ts +15 -0
- package/dist/display/tables/editing/TableEditToolbar.js +63 -0
- package/dist/display/tables/editing/tableMutations.d.ts +50 -0
- package/dist/display/tables/editing/tableMutations.js +148 -0
- package/dist/display/tables/editing/useDoubleClickEdit.d.ts +43 -0
- package/dist/display/tables/editing/useDoubleClickEdit.js +51 -0
- package/dist/display/tables/editing/useTableUndo.d.ts +25 -0
- package/dist/display/tables/editing/useTableUndo.js +17 -0
- package/dist/display/tables/table-action-row.d.ts +8 -0
- package/dist/display/tables/table-action-row.js +31 -0
- package/dist/display/tables/table-viewer.d.ts +13 -0
- package/dist/display/tables/table-viewer.js +18 -0
- package/dist/host/ErrorActions.d.ts +1 -1
- package/dist/host/ErrorNotice.d.ts +10 -0
- package/dist/host/ErrorNotice.js +19 -0
- package/dist/host/app-bindings.d.ts +155 -0
- package/dist/host/app-bindings.js +160 -0
- package/dist/host/diagnostics.d.ts +2 -2
- package/dist/host/diagnostics.js +2 -1
- package/dist/host/tables.d.ts +1 -6
- package/dist/host/types.d.ts +14 -7
- package/dist/levels/RichContent.d.ts +3 -0
- package/dist/levels/RichContent.js +102 -0
- package/dist/levels/RichContentInline.d.ts +28 -0
- package/dist/levels/RichContentInline.js +61 -0
- package/dist/levels/RichContentPreview.d.ts +12 -0
- package/dist/levels/RichContentPreview.js +39 -0
- package/dist/levels/RichContentStandardImpl.d.ts +12 -0
- package/dist/levels/RichContentStandardImpl.js +27 -0
- package/dist/levels/RichContentStaticProse.d.ts +46 -0
- package/dist/levels/RichContentStaticProse.js +100 -0
- package/dist/levels/depth.d.ts +18 -0
- package/dist/levels/depth.js +32 -0
- package/dist/levels/prose/inline-level-elements.d.ts +19 -0
- package/dist/levels/prose/inline-level-elements.js +103 -0
- package/dist/levels/prose/prose-block-elements.d.ts +25 -0
- package/dist/levels/prose/prose-block-elements.js +313 -0
- package/dist/levels/prose/prose-inline-elements.d.ts +13 -0
- package/dist/levels/prose/prose-inline-elements.js +143 -0
- package/dist/levels/prose/prose-prepare.d.ts +50 -0
- package/dist/levels/prose/prose-prepare.js +246 -0
- package/dist/levels/prose/remote-image-policy.d.ts +34 -0
- package/dist/levels/prose/remote-image-policy.js +153 -0
- package/dist/levels/prose/variant-root.d.ts +9 -0
- package/dist/levels/prose/variant-root.js +34 -0
- package/dist/levels/rich-content-types.d.ts +93 -0
- package/dist/levels/rich-content-types.js +4 -0
- package/dist/levels/server/DelimiterViolationReport.d.ts +7 -0
- package/dist/levels/server/DelimiterViolationReport.js +24 -0
- package/dist/levels/server/RichContentServer.d.ts +27 -0
- package/dist/levels/server/RichContentServer.js +97 -0
- package/dist/levels/standard/NestedRichContent.d.ts +7 -0
- package/dist/levels/standard/NestedRichContent.js +70 -0
- package/dist/levels/standard/StandardBlocks.d.ts +13 -0
- package/dist/levels/standard/StandardBlocks.js +239 -0
- package/dist/levels/standard/StandardKindRegion.d.ts +14 -0
- package/dist/levels/standard/StandardKindRegion.js +69 -0
- package/dist/levels/standard/standard-kind-region.d.ts +19 -0
- package/dist/levels/standard/standard-kind-region.js +21 -0
- package/dist/levels/standard/static-standard.d.ts +23 -0
- package/dist/levels/standard/static-standard.js +187 -0
- package/dist/levels/standard/stream-holdback.d.ts +2 -0
- package/dist/levels/standard/stream-holdback.js +77 -0
- package/dist/mermaid/MermaidFullscreen.d.ts +17 -0
- package/dist/mermaid/MermaidFullscreen.js +71 -0
- package/dist/mermaid/MermaidRenderer.d.ts +20 -0
- package/dist/mermaid/MermaidRenderer.js +267 -0
- package/dist/mermaid/MermaidView.d.ts +27 -0
- package/dist/mermaid/MermaidView.js +68 -0
- package/dist/mermaid/MermaidViewport.d.ts +75 -0
- package/dist/mermaid/MermaidViewport.js +286 -0
- package/dist/mermaid/adapters/er.d.ts +10 -0
- package/dist/mermaid/adapters/er.js +205 -0
- package/dist/mermaid/adapters/flowchart.d.ts +17 -0
- package/dist/mermaid/adapters/flowchart.js +634 -0
- package/dist/mermaid/adapters/journey.d.ts +9 -0
- package/dist/mermaid/adapters/journey.js +207 -0
- package/dist/mermaid/adapters/mindmap.d.ts +12 -0
- package/dist/mermaid/adapters/mindmap.js +252 -0
- package/dist/mermaid/adapters/pie.d.ts +7 -0
- package/dist/mermaid/adapters/pie.js +172 -0
- package/dist/mermaid/adapters/quadrant.d.ts +8 -0
- package/dist/mermaid/adapters/quadrant.js +231 -0
- package/dist/mermaid/adapters/register.d.ts +7 -0
- package/dist/mermaid/adapters/register.js +19 -0
- package/dist/mermaid/adapters/sequence.d.ts +8 -0
- package/dist/mermaid/adapters/sequence.js +251 -0
- package/dist/mermaid/adapters/state.d.ts +12 -0
- package/dist/mermaid/adapters/state.js +245 -0
- package/dist/mermaid/adapters/timeline.d.ts +8 -0
- package/dist/mermaid/adapters/timeline.js +245 -0
- package/dist/mermaid/catalog.d.ts +33 -0
- package/dist/mermaid/catalog.js +202 -0
- package/dist/mermaid/diagram-type.d.ts +39 -0
- package/dist/mermaid/diagram-type.js +89 -0
- package/dist/mermaid/export.d.ts +21 -0
- package/dist/mermaid/export.js +112 -0
- package/dist/mermaid/extract-fence.d.ts +15 -0
- package/dist/mermaid/extract-fence.js +22 -0
- package/dist/mermaid/lazy-draw.d.ts +40 -0
- package/dist/mermaid/lazy-draw.js +168 -0
- package/dist/mermaid/model/adapter.d.ts +28 -0
- package/dist/mermaid/model/adapter.js +16 -0
- package/dist/mermaid/model/ops.d.ts +282 -0
- package/dist/mermaid/model/ops.js +9 -0
- package/dist/mermaid/model/round-trip.d.ts +22 -0
- package/dist/mermaid/model/round-trip.js +45 -0
- package/dist/mermaid/model/types.d.ts +271 -0
- package/dist/mermaid/model/types.js +0 -0
- package/dist/mermaid/print-render.d.ts +9 -0
- package/dist/mermaid/print-render.js +39 -0
- package/dist/mermaid/runtime.d.ts +25 -0
- package/dist/mermaid/runtime.js +183 -0
- package/dist/mermaid/sanitize.d.ts +46 -0
- package/dist/mermaid/sanitize.js +234 -0
- package/dist/mermaid/types.d.ts +43 -0
- package/dist/mermaid/types.js +21 -0
- package/dist/mermaid/view/ViewModePane.d.ts +24 -0
- package/dist/mermaid/view/ViewModePane.js +9 -0
- package/dist/utils/client-lazy.d.ts +1 -1
- package/dist/utils/client-lazy.js +4 -1
- package/dist/utils/lifted/DiffView.d.ts +10 -0
- package/dist/utils/lifted/DiffView.js +26 -0
- package/dist/utils/lifted/IconButton.d.ts +24 -0
- package/dist/utils/lifted/IconButton.js +43 -0
- package/dist/utils/lifted/MatrxMiniLoader.d.ts +1 -0
- package/dist/utils/lifted/MatrxMiniLoader.js +8 -0
- package/dist/utils/lifted/ShimmerText.d.ts +5 -0
- package/dist/utils/lifted/ShimmerText.js +21 -0
- package/dist/utils/lifted/SuspenseLoader.d.ts +16 -0
- package/dist/utils/lifted/SuspenseLoader.js +42 -0
- package/dist/utils/lifted/Tooltip.d.ts +20 -0
- package/dist/utils/lifted/Tooltip.js +52 -0
- package/dist/utils/lifted/artifactId.d.ts +34 -0
- package/dist/utils/lifted/artifactId.js +15 -0
- package/dist/utils/lifted/canvasContent.d.ts +63 -0
- package/dist/utils/lifted/canvasContent.js +98 -0
- package/dist/utils/lifted/captureReactError.d.ts +24 -0
- package/dist/utils/lifted/captureReactError.js +28 -0
- package/dist/utils/lifted/chunk-load-recovery.d.ts +25 -0
- package/dist/utils/lifted/chunk-load-recovery.js +36 -0
- package/dist/utils/lifted/code-editor-agent-types.d.ts +6 -0
- package/dist/utils/lifted/code-editor-agent-types.js +0 -0
- package/dist/utils/lifted/code-editor-agents.d.ts +39 -0
- package/dist/utils/lifted/code-editor-agents.js +52 -0
- package/dist/utils/lifted/code-language-extension.d.ts +1 -0
- package/dist/utils/lifted/code-language-extension.js +60 -0
- package/dist/utils/lifted/custom-icons.d.ts +16 -0
- package/dist/utils/lifted/custom-icons.js +47 -0
- package/dist/utils/lifted/durability.d.ts +16 -0
- package/dist/utils/lifted/durability.js +45 -0
- package/dist/utils/lifted/errors.d.ts +30 -0
- package/dist/utils/lifted/errors.js +29 -0
- package/dist/utils/lifted/html-document.d.ts +1 -0
- package/dist/utils/lifted/html-document.js +12 -0
- package/dist/utils/lifted/languageOptions.d.ts +9 -0
- package/dist/utils/lifted/languageOptions.js +52 -0
- package/dist/utils/lifted/languages.d.ts +34 -0
- package/dist/utils/lifted/languages.js +175 -0
- package/dist/utils/lifted/loading-spinner.d.ts +18 -0
- package/dist/utils/lifted/loading-spinner.js +200 -0
- package/dist/utils/lifted/media-refs.d.ts +13 -0
- package/dist/utils/lifted/media-refs.js +27 -0
- package/dist/utils/lifted/scroll-root.d.ts +1 -0
- package/dist/utils/lifted/scroll-root.js +25 -0
- package/dist/utils/lifted/syntax-themes.d.ts +32 -0
- package/dist/utils/lifted/syntax-themes.js +100 -0
- package/dist/utils/lifted/url-utm.d.ts +24 -0
- package/dist/utils/lifted/url-utm.js +66 -0
- package/dist/utils/lifted/use-is-mounted.d.ts +24 -0
- package/dist/utils/lifted/use-is-mounted.js +21 -0
- package/dist/utils/lifted/useToastManager.d.ts +1 -0
- package/dist/utils/lifted/useToastManager.js +7 -0
- package/dist/utils/report-kind-at-raw-renderer.d.ts +19 -0
- package/dist/utils/report-kind-at-raw-renderer.js +32 -0
- package/package.json +48 -10
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
const DIAGRAM_NODE_SHAPES = [
|
|
2
|
+
"rounded",
|
|
3
|
+
"rectangle",
|
|
4
|
+
"pill",
|
|
5
|
+
"circle",
|
|
6
|
+
"diamond",
|
|
7
|
+
"hexagon"
|
|
8
|
+
];
|
|
9
|
+
const DIAGRAM_BORDER_STYLES = ["solid", "dashed", "dotted"];
|
|
10
|
+
const DIAGRAM_EDGE_MARKERS = ["none", "end", "start", "both"];
|
|
11
|
+
const DIAGRAM_BACKGROUNDS = ["dots", "lines", "cross"];
|
|
12
|
+
const DIAGRAM_COLOR_PRESETS = [
|
|
13
|
+
{
|
|
14
|
+
value: "gray",
|
|
15
|
+
label: "Gray",
|
|
16
|
+
hex: "#6b7280",
|
|
17
|
+
nodeClass: "bg-textured border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: "purple",
|
|
21
|
+
label: "Purple",
|
|
22
|
+
hex: "#8b5cf6",
|
|
23
|
+
nodeClass: "bg-purple-100 dark:bg-purple-950/30 border-purple-500 text-purple-700 dark:text-purple-300"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: "slate",
|
|
27
|
+
label: "Slate",
|
|
28
|
+
hex: "#64748b",
|
|
29
|
+
nodeClass: "bg-slate-100 dark:bg-slate-950/30 border-slate-500 text-slate-700 dark:text-slate-300"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: "blue",
|
|
33
|
+
label: "Blue",
|
|
34
|
+
hex: "#3b82f6",
|
|
35
|
+
nodeClass: "bg-blue-100 dark:bg-blue-950/30 border-blue-500 text-blue-700 dark:text-blue-300"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: "indigo",
|
|
39
|
+
label: "Indigo",
|
|
40
|
+
hex: "#6366f1",
|
|
41
|
+
nodeClass: "bg-indigo-100 dark:bg-indigo-950/30 border-indigo-500 text-indigo-700 dark:text-indigo-300"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
value: "violet",
|
|
45
|
+
label: "Violet",
|
|
46
|
+
hex: "#8b5cf6",
|
|
47
|
+
nodeClass: "bg-violet-100 dark:bg-violet-950/30 border-violet-500 text-violet-700 dark:text-violet-300"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: "pink",
|
|
51
|
+
label: "Pink",
|
|
52
|
+
hex: "#ec4899",
|
|
53
|
+
nodeClass: "bg-pink-100 dark:bg-pink-950/30 border-pink-500 text-pink-700 dark:text-pink-300"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
value: "red",
|
|
57
|
+
label: "Red",
|
|
58
|
+
hex: "#ef4444",
|
|
59
|
+
nodeClass: "bg-red-100 dark:bg-red-950/30 border-red-500 text-red-700 dark:text-red-300"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: "orange",
|
|
63
|
+
label: "Orange",
|
|
64
|
+
hex: "#f97316",
|
|
65
|
+
nodeClass: "bg-orange-100 dark:bg-orange-950/30 border-orange-500 text-orange-700 dark:text-orange-300"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
value: "amber",
|
|
69
|
+
label: "Amber",
|
|
70
|
+
hex: "#f59e0b",
|
|
71
|
+
nodeClass: "bg-amber-100 dark:bg-amber-950/30 border-amber-500 text-amber-700 dark:text-amber-300"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
value: "yellow",
|
|
75
|
+
label: "Yellow",
|
|
76
|
+
hex: "#eab308",
|
|
77
|
+
nodeClass: "bg-yellow-100 dark:bg-yellow-950/30 border-yellow-500 text-yellow-700 dark:text-yellow-300"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
value: "green",
|
|
81
|
+
label: "Green",
|
|
82
|
+
hex: "#10b981",
|
|
83
|
+
nodeClass: "bg-green-100 dark:bg-green-950/30 border-green-500 text-green-700 dark:text-green-300"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
value: "teal",
|
|
87
|
+
label: "Teal",
|
|
88
|
+
hex: "#14b8a6",
|
|
89
|
+
nodeClass: "bg-teal-100 dark:bg-teal-950/30 border-teal-500 text-teal-700 dark:text-teal-300"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
value: "cyan",
|
|
93
|
+
label: "Cyan",
|
|
94
|
+
hex: "#06b6d4",
|
|
95
|
+
nodeClass: "bg-cyan-100 dark:bg-cyan-950/30 border-cyan-500 text-cyan-700 dark:text-cyan-300"
|
|
96
|
+
}
|
|
97
|
+
];
|
|
98
|
+
const COLOR_BY_VALUE = new Map(
|
|
99
|
+
DIAGRAM_COLOR_PRESETS.map((preset) => [preset.value, preset])
|
|
100
|
+
);
|
|
101
|
+
function getDiagramColorHex(color) {
|
|
102
|
+
if (typeof color !== "string" || color === "" || color === "auto")
|
|
103
|
+
return "#64748b";
|
|
104
|
+
return COLOR_BY_VALUE.get(color)?.hex ?? color;
|
|
105
|
+
}
|
|
106
|
+
function getDiagramNodeColorClass(color) {
|
|
107
|
+
if (typeof color !== "string") return "";
|
|
108
|
+
return COLOR_BY_VALUE.get(color)?.nodeClass ?? "";
|
|
109
|
+
}
|
|
110
|
+
function isCustomDiagramColor(color) {
|
|
111
|
+
return typeof color === "string" && color !== "" && !COLOR_BY_VALUE.has(color);
|
|
112
|
+
}
|
|
113
|
+
const LEGACY_DIAGRAM_ICON_NAMES = {
|
|
114
|
+
none: "none",
|
|
115
|
+
square: "Square",
|
|
116
|
+
"circle-check": "CheckCircle2",
|
|
117
|
+
"circle-x": "XCircle",
|
|
118
|
+
settings: "Settings",
|
|
119
|
+
"git-branch": "GitBranch",
|
|
120
|
+
database: "Database",
|
|
121
|
+
users: "Users",
|
|
122
|
+
"user-check": "UserCheck",
|
|
123
|
+
crown: "Crown",
|
|
124
|
+
building: "Building",
|
|
125
|
+
briefcase: "Briefcase",
|
|
126
|
+
lightbulb: "Lightbulb",
|
|
127
|
+
target: "Target",
|
|
128
|
+
heart: "Heart",
|
|
129
|
+
globe: "Globe",
|
|
130
|
+
server: "Server",
|
|
131
|
+
cpu: "Cpu",
|
|
132
|
+
"hard-drive": "HardDrive",
|
|
133
|
+
clock: "Clock",
|
|
134
|
+
table: "Table",
|
|
135
|
+
code: "Code",
|
|
136
|
+
chart: "BarChart",
|
|
137
|
+
search: "Search",
|
|
138
|
+
mail: "Mail",
|
|
139
|
+
shield: "Shield",
|
|
140
|
+
palette: "Palette",
|
|
141
|
+
wrench: "Wrench",
|
|
142
|
+
package: "Package",
|
|
143
|
+
"shield-user": "ShieldUser",
|
|
144
|
+
calculator: "Calculator",
|
|
145
|
+
cog: "Cog",
|
|
146
|
+
megaphone: "Megaphone",
|
|
147
|
+
box: "Box",
|
|
148
|
+
"trending-up": "TrendingUp",
|
|
149
|
+
"user-plus": "UserPlus",
|
|
150
|
+
"pen-tool": "PenTool",
|
|
151
|
+
radio: "Radio",
|
|
152
|
+
layers: "Layers",
|
|
153
|
+
monitor: "Monitor",
|
|
154
|
+
phone: "Phone",
|
|
155
|
+
"clipboard-list": "ClipboardList",
|
|
156
|
+
camera: "Camera",
|
|
157
|
+
film: "Film",
|
|
158
|
+
zap: "Zap",
|
|
159
|
+
"pie-chart": "PieChart",
|
|
160
|
+
"graduation-cap": "GraduationCap",
|
|
161
|
+
award: "Award",
|
|
162
|
+
headphones: "Headphones",
|
|
163
|
+
truck: "Truck",
|
|
164
|
+
warehouse: "Warehouse",
|
|
165
|
+
factory: "Factory",
|
|
166
|
+
"dollar-sign": "DollarSign",
|
|
167
|
+
"file-text": "FileText",
|
|
168
|
+
lock: "Lock",
|
|
169
|
+
key: "Key",
|
|
170
|
+
cloud: "Cloud",
|
|
171
|
+
bell: "Bell",
|
|
172
|
+
microscope: "Microscope",
|
|
173
|
+
stethoscope: "Stethoscope",
|
|
174
|
+
hammer: "Hammer",
|
|
175
|
+
plane: "Plane",
|
|
176
|
+
newspaper: "Newspaper",
|
|
177
|
+
music: "Music",
|
|
178
|
+
"book-open": "BookOpen",
|
|
179
|
+
"shopping-cart": "ShoppingCart"
|
|
180
|
+
};
|
|
181
|
+
function normalizeDiagramIconName(iconName) {
|
|
182
|
+
const trimmed = iconName?.trim();
|
|
183
|
+
if (!trimmed) return "none";
|
|
184
|
+
return LEGACY_DIAGRAM_ICON_NAMES[trimmed] ?? trimmed;
|
|
185
|
+
}
|
|
186
|
+
const ORG_ICON_PATTERNS = [
|
|
187
|
+
{ keywords: ["ceo", "chief executive", "founder"], icon: "crown" },
|
|
188
|
+
{
|
|
189
|
+
keywords: ["president", "vp", "vice president"],
|
|
190
|
+
icon: "shield-user"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
keywords: ["cfo", "chief financial", "finance director"],
|
|
194
|
+
icon: "calculator"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
keywords: ["cto", "chief technology", "tech director"],
|
|
198
|
+
icon: "code"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
keywords: ["coo", "chief operating", "operations director"],
|
|
202
|
+
icon: "cog"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
keywords: ["cmo", "chief marketing", "marketing director"],
|
|
206
|
+
icon: "megaphone"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
keywords: ["cpo", "chief product", "product director"],
|
|
210
|
+
icon: "box"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
keywords: [
|
|
214
|
+
"ciso",
|
|
215
|
+
"chief information security",
|
|
216
|
+
"security director",
|
|
217
|
+
"security",
|
|
218
|
+
"infosec",
|
|
219
|
+
"cybersecurity"
|
|
220
|
+
],
|
|
221
|
+
icon: "shield"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
keywords: ["chro", "chief hr", "chief people"],
|
|
225
|
+
icon: "user-check"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
keywords: ["sales", "business development", "revenue", "account executive"],
|
|
229
|
+
icon: "trending-up"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
keywords: ["account manager", "client relations", "relationship manager"],
|
|
233
|
+
icon: "user-plus"
|
|
234
|
+
},
|
|
235
|
+
{ keywords: ["sales operations", "sales ops"], icon: "chart" },
|
|
236
|
+
{ keywords: ["marketing", "brand", "growth"], icon: "megaphone" },
|
|
237
|
+
{ keywords: ["content", "copywriter", "writer"], icon: "pen-tool" },
|
|
238
|
+
{ keywords: ["social media", "community"], icon: "globe" },
|
|
239
|
+
{
|
|
240
|
+
keywords: ["pr", "public relations", "communications"],
|
|
241
|
+
icon: "radio"
|
|
242
|
+
},
|
|
243
|
+
{ keywords: ["seo", "sem", "digital marketing"], icon: "search" },
|
|
244
|
+
{ keywords: ["email marketing", "campaign"], icon: "mail" },
|
|
245
|
+
{ keywords: ["product manager", "product owner"], icon: "lightbulb" },
|
|
246
|
+
{ keywords: ["product marketing"], icon: "target" },
|
|
247
|
+
{ keywords: ["product design"], icon: "layers" },
|
|
248
|
+
{
|
|
249
|
+
keywords: ["developer", "engineer", "programmer", "software"],
|
|
250
|
+
icon: "code"
|
|
251
|
+
},
|
|
252
|
+
{ keywords: ["frontend", "front-end", "front end"], icon: "monitor" },
|
|
253
|
+
{ keywords: ["backend", "back-end", "back end"], icon: "server" },
|
|
254
|
+
{ keywords: ["fullstack", "full-stack", "full stack"], icon: "layers" },
|
|
255
|
+
{ keywords: ["mobile", "ios", "android"], icon: "phone" },
|
|
256
|
+
{ keywords: ["devops", "site reliability", "sre"], icon: "cog" },
|
|
257
|
+
{ keywords: ["qa", "quality assurance", "test"], icon: "clipboard-list" },
|
|
258
|
+
{
|
|
259
|
+
keywords: ["architect", "principal engineer", "staff engineer"],
|
|
260
|
+
icon: "git-branch"
|
|
261
|
+
},
|
|
262
|
+
{ keywords: ["designer", "ui", "ux", "design"], icon: "palette" },
|
|
263
|
+
{ keywords: ["graphic", "visual design"], icon: "camera" },
|
|
264
|
+
{ keywords: ["motion", "animation"], icon: "film" },
|
|
265
|
+
{
|
|
266
|
+
keywords: ["data scientist", "machine learning", "ml", "ai"],
|
|
267
|
+
icon: "zap"
|
|
268
|
+
},
|
|
269
|
+
{ keywords: ["data analyst", "analyst", "analytics"], icon: "chart" },
|
|
270
|
+
{ keywords: ["data engineer", "database"], icon: "database" },
|
|
271
|
+
{ keywords: ["business intelligence", "bi"], icon: "pie-chart" },
|
|
272
|
+
{
|
|
273
|
+
keywords: ["hr", "human resources", "people", "talent"],
|
|
274
|
+
icon: "user-check"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
keywords: ["recruiter", "recruiting", "talent acquisition"],
|
|
278
|
+
icon: "user-plus"
|
|
279
|
+
},
|
|
280
|
+
{ keywords: ["learning", "training", "development"], icon: "graduation-cap" },
|
|
281
|
+
{ keywords: ["compensation", "benefits"], icon: "award" },
|
|
282
|
+
{ keywords: ["customer success", "csm"], icon: "heart" },
|
|
283
|
+
{
|
|
284
|
+
keywords: ["support", "customer service", "help desk"],
|
|
285
|
+
icon: "headphones"
|
|
286
|
+
},
|
|
287
|
+
{ keywords: ["technical support", "tech support"], icon: "wrench" },
|
|
288
|
+
{ keywords: ["operations", "ops"], icon: "settings" },
|
|
289
|
+
{ keywords: ["supply chain", "procurement"], icon: "truck" },
|
|
290
|
+
{ keywords: ["logistics", "shipping"], icon: "package" },
|
|
291
|
+
{ keywords: ["warehouse", "inventory"], icon: "warehouse" },
|
|
292
|
+
{ keywords: ["manufacturing", "production"], icon: "factory" },
|
|
293
|
+
{ keywords: ["finance", "financial"], icon: "dollar-sign" },
|
|
294
|
+
{ keywords: ["accounting", "accountant", "bookkeeping"], icon: "calculator" },
|
|
295
|
+
{ keywords: ["controller", "fp&a"], icon: "pie-chart" },
|
|
296
|
+
{ keywords: ["treasury", "payments"], icon: "briefcase" },
|
|
297
|
+
{
|
|
298
|
+
keywords: ["legal", "counsel", "attorney", "lawyer"],
|
|
299
|
+
icon: "briefcase"
|
|
300
|
+
},
|
|
301
|
+
{ keywords: ["compliance", "regulatory"], icon: "clipboard-list" },
|
|
302
|
+
{ keywords: ["contract", "agreements"], icon: "file-text" },
|
|
303
|
+
{ keywords: ["security", "infosec", "cybersecurity"], icon: "shield" },
|
|
304
|
+
{ keywords: ["security analyst", "security engineer"], icon: "lock" },
|
|
305
|
+
{ keywords: ["risk", "audit"], icon: "key" },
|
|
306
|
+
{ keywords: ["it", "information technology"], icon: "monitor" },
|
|
307
|
+
{ keywords: ["system", "infrastructure", "network"], icon: "server" },
|
|
308
|
+
{ keywords: ["cloud", "aws", "azure", "gcp"], icon: "cloud" },
|
|
309
|
+
{ keywords: ["facilities", "facility"], icon: "building" },
|
|
310
|
+
{
|
|
311
|
+
keywords: ["admin", "administrative", "office manager"],
|
|
312
|
+
icon: "clipboard-list"
|
|
313
|
+
},
|
|
314
|
+
{ keywords: ["reception", "receptionist"], icon: "bell" },
|
|
315
|
+
{ keywords: ["research", "scientist"], icon: "microscope" },
|
|
316
|
+
{ keywords: ["medical", "healthcare", "clinical"], icon: "stethoscope" },
|
|
317
|
+
{ keywords: ["construction", "builder"], icon: "hammer" },
|
|
318
|
+
{ keywords: ["travel", "tourism"], icon: "plane" },
|
|
319
|
+
{ keywords: ["editorial", "editor", "publishing"], icon: "newspaper" },
|
|
320
|
+
{ keywords: ["music", "audio", "sound"], icon: "music" },
|
|
321
|
+
{ keywords: ["education", "teacher", "instructor"], icon: "book-open" },
|
|
322
|
+
{ keywords: ["e-commerce", "ecommerce", "retail"], icon: "shopping-cart" }
|
|
323
|
+
];
|
|
324
|
+
function inferOrgChartRoleIconName(label, description, details) {
|
|
325
|
+
const searchText = [label, description, details].filter(Boolean).join(" ").toLowerCase();
|
|
326
|
+
return normalizeDiagramIconName(
|
|
327
|
+
ORG_ICON_PATTERNS.find(
|
|
328
|
+
(pattern) => pattern.keywords.some((keyword) => searchText.includes(keyword))
|
|
329
|
+
)?.icon ?? "users"
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
function inferDiagramNodeVisuals(input) {
|
|
333
|
+
if (input.isGroup) {
|
|
334
|
+
return {
|
|
335
|
+
color: "auto",
|
|
336
|
+
icon: "none",
|
|
337
|
+
shape: "rounded",
|
|
338
|
+
borderStyle: "dashed",
|
|
339
|
+
textAlign: "left"
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
const byType = {
|
|
343
|
+
start: { color: "green", icon: "circle-check" },
|
|
344
|
+
end: { color: "red", icon: "circle-x" },
|
|
345
|
+
decision: { color: "orange", icon: "git-branch" },
|
|
346
|
+
process: { color: "blue", icon: "settings" },
|
|
347
|
+
data: { color: "purple", icon: "database" },
|
|
348
|
+
user: { color: "indigo", icon: "users" },
|
|
349
|
+
system: { color: "gray", icon: "server" },
|
|
350
|
+
api: { color: "teal", icon: "globe" },
|
|
351
|
+
compute: { color: "yellow", icon: "cpu" },
|
|
352
|
+
storage: { color: "pink", icon: "hard-drive" },
|
|
353
|
+
event: { color: "cyan", icon: "clock" },
|
|
354
|
+
entity: { color: "violet", icon: "table" },
|
|
355
|
+
gateway: { color: "amber", icon: "git-branch" }
|
|
356
|
+
};
|
|
357
|
+
const inferred = byType[input.nodeType] ?? {
|
|
358
|
+
color: "gray",
|
|
359
|
+
icon: "square"
|
|
360
|
+
};
|
|
361
|
+
return {
|
|
362
|
+
color: inferred.color,
|
|
363
|
+
icon: normalizeDiagramIconName(
|
|
364
|
+
input.diagramType === "orgchart" ? inferOrgChartRoleIconName(
|
|
365
|
+
input.label,
|
|
366
|
+
input.description,
|
|
367
|
+
input.details
|
|
368
|
+
) : inferred.icon
|
|
369
|
+
),
|
|
370
|
+
// Existing generated diagrams have always rendered as rounded cards. The
|
|
371
|
+
// explicit default keeps that appearance while making alternatives editable.
|
|
372
|
+
shape: "rounded",
|
|
373
|
+
borderStyle: "solid",
|
|
374
|
+
textAlign: input.diagramType === "orgchart" ? "center" : "left"
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
const DEFAULT_DIAGRAM_RENDER_HINTS = {
|
|
378
|
+
showLegend: true,
|
|
379
|
+
showEdgeLabels: true,
|
|
380
|
+
compactNodes: false,
|
|
381
|
+
hideArrows: false,
|
|
382
|
+
background: "dots",
|
|
383
|
+
showMiniMap: false,
|
|
384
|
+
snapToGrid: false,
|
|
385
|
+
showControls: true
|
|
386
|
+
};
|
|
387
|
+
export {
|
|
388
|
+
DEFAULT_DIAGRAM_RENDER_HINTS,
|
|
389
|
+
DIAGRAM_BACKGROUNDS,
|
|
390
|
+
DIAGRAM_BORDER_STYLES,
|
|
391
|
+
DIAGRAM_COLOR_PRESETS,
|
|
392
|
+
DIAGRAM_EDGE_MARKERS,
|
|
393
|
+
DIAGRAM_NODE_SHAPES,
|
|
394
|
+
getDiagramColorHex,
|
|
395
|
+
getDiagramNodeColorClass,
|
|
396
|
+
inferDiagramNodeVisuals,
|
|
397
|
+
inferOrgChartRoleIconName,
|
|
398
|
+
isCustomDiagramColor,
|
|
399
|
+
normalizeDiagramIconName
|
|
400
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type Node, type Edge, Position } from "@xyflow/react";
|
|
2
|
+
export interface LayoutOptions {
|
|
3
|
+
direction?: "TB" | "LR" | "BT" | "RL";
|
|
4
|
+
nodeWidth?: number;
|
|
5
|
+
nodeHeight?: number;
|
|
6
|
+
rankSep?: number;
|
|
7
|
+
nodeSep?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Applies automatic layout to ReactFlow nodes and edges using Dagre
|
|
11
|
+
*/
|
|
12
|
+
export declare const getLayoutedElements: (nodes: Node[], edges: Edge[], options?: LayoutOptions) => {
|
|
13
|
+
nodes: {
|
|
14
|
+
id: string;
|
|
15
|
+
hidden?: boolean;
|
|
16
|
+
selected?: boolean;
|
|
17
|
+
dragging?: boolean;
|
|
18
|
+
draggable?: boolean;
|
|
19
|
+
selectable?: boolean;
|
|
20
|
+
connectable?: boolean;
|
|
21
|
+
deletable?: boolean;
|
|
22
|
+
dragHandle?: string;
|
|
23
|
+
width?: number;
|
|
24
|
+
height?: number;
|
|
25
|
+
initialWidth?: number;
|
|
26
|
+
initialHeight?: number;
|
|
27
|
+
parentId?: string;
|
|
28
|
+
zIndex?: number;
|
|
29
|
+
extent?: 'parent' | import("@xyflow/react").CoordinateExtent | null;
|
|
30
|
+
expandParent?: boolean;
|
|
31
|
+
ariaLabel?: string;
|
|
32
|
+
origin?: import("@xyflow/react").NodeOrigin;
|
|
33
|
+
handles?: import("@xyflow/react").NodeHandle[];
|
|
34
|
+
measured?: {
|
|
35
|
+
width?: number;
|
|
36
|
+
height?: number;
|
|
37
|
+
};
|
|
38
|
+
type?: string | undefined;
|
|
39
|
+
style?: import("react").CSSProperties;
|
|
40
|
+
className?: string;
|
|
41
|
+
resizing?: boolean;
|
|
42
|
+
focusable?: boolean;
|
|
43
|
+
ariaRole?: import("react").AriaRole;
|
|
44
|
+
domAttributes?: Omit<import("react").HTMLAttributes<HTMLDivElement>, 'id' | 'style' | 'className' | 'draggable' | 'role' | 'aria-label' | 'defaultValue' | 'dangerouslySetInnerHTML' | keyof import("react").DOMAttributes<HTMLDivElement>>;
|
|
45
|
+
targetPosition: Position;
|
|
46
|
+
sourcePosition: Position;
|
|
47
|
+
position: {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
};
|
|
51
|
+
data: {
|
|
52
|
+
[x: string]: unknown;
|
|
53
|
+
};
|
|
54
|
+
}[];
|
|
55
|
+
edges: Edge[];
|
|
56
|
+
};
|
|
57
|
+
export declare const getLayoutOptionsForDiagramType: (diagramType: string, nodeCount: number, preferredDirection?: "TB" | "LR" | "BT" | "RL") => LayoutOptions;
|
|
58
|
+
/**
|
|
59
|
+
* Radial layout — places highest-connected node at center, others in ring(s)
|
|
60
|
+
*/
|
|
61
|
+
export declare const getRadialLayout: (nodes: Node[], edges: Edge[], centerNodeId?: string) => {
|
|
62
|
+
nodes: Node[];
|
|
63
|
+
edges: Edge[];
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Compact grid layout for brainstorming maps.
|
|
67
|
+
*
|
|
68
|
+
* Only root nodes participate in the grid. Boxes inside a visual section keep
|
|
69
|
+
* their section-relative positions; flattening them into the root grid would
|
|
70
|
+
* silently break the section the user deliberately created.
|
|
71
|
+
*/
|
|
72
|
+
export declare const getGridLayout: (nodes: Node[], edges: Edge[]) => {
|
|
73
|
+
nodes: Node[];
|
|
74
|
+
edges: Edge[];
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Org chart layout — Dagre TB with clean edges
|
|
78
|
+
*/
|
|
79
|
+
export declare const getOrgChartLayout: (nodes: Node[], edges: Edge[], options?: LayoutOptions) => {
|
|
80
|
+
nodes: Node[];
|
|
81
|
+
edges: Edge[];
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Pedigree layout — generation-aware vertical spacing
|
|
85
|
+
* Nodes with the same `generation` value are placed on the same horizontal band.
|
|
86
|
+
*/
|
|
87
|
+
export declare const getPedigreeLayout: (nodes: Node[], edges: Edge[]) => {
|
|
88
|
+
nodes: Node[];
|
|
89
|
+
edges: Edge[];
|
|
90
|
+
};
|