@principal-ai/subsystems-react 0.17.0
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/README.md +93 -0
- package/dist/components/ConfigurationSelector.d.ts +35 -0
- package/dist/components/ConfigurationSelector.d.ts.map +1 -0
- package/dist/components/ConfigurationSelector.js +63 -0
- package/dist/components/ConfigurationSelector.js.map +1 -0
- package/dist/components/GraphRenderer.d.ts +295 -0
- package/dist/components/GraphRenderer.d.ts.map +1 -0
- package/dist/components/GraphRenderer.js +2008 -0
- package/dist/components/GraphRenderer.js.map +1 -0
- package/dist/components/MultiCanvasRenderer.d.ts +75 -0
- package/dist/components/MultiCanvasRenderer.d.ts.map +1 -0
- package/dist/components/MultiCanvasRenderer.js +203 -0
- package/dist/components/MultiCanvasRenderer.js.map +1 -0
- package/dist/components/NodeTooltip.d.ts +24 -0
- package/dist/components/NodeTooltip.d.ts.map +1 -0
- package/dist/components/NodeTooltip.js +160 -0
- package/dist/components/NodeTooltip.js.map +1 -0
- package/dist/components/SelectionSidebar.d.ts +18 -0
- package/dist/components/SelectionSidebar.d.ts.map +1 -0
- package/dist/components/SelectionSidebar.js +190 -0
- package/dist/components/SelectionSidebar.js.map +1 -0
- package/dist/components/SequenceDiagramRenderer.d.ts +77 -0
- package/dist/components/SequenceDiagramRenderer.d.ts.map +1 -0
- package/dist/components/SequenceDiagramRenderer.js +604 -0
- package/dist/components/SequenceDiagramRenderer.js.map +1 -0
- package/dist/components/WorkflowSequenceDiagram.d.ts +63 -0
- package/dist/components/WorkflowSequenceDiagram.d.ts.map +1 -0
- package/dist/components/WorkflowSequenceDiagram.js +147 -0
- package/dist/components/WorkflowSequenceDiagram.js.map +1 -0
- package/dist/components/dashboard/DashboardRenderer.d.ts +10 -0
- package/dist/components/dashboard/DashboardRenderer.d.ts.map +1 -0
- package/dist/components/dashboard/DashboardRenderer.js +179 -0
- package/dist/components/dashboard/DashboardRenderer.js.map +1 -0
- package/dist/components/dashboard/MetricPanel.d.ts +10 -0
- package/dist/components/dashboard/MetricPanel.d.ts.map +1 -0
- package/dist/components/dashboard/MetricPanel.js +103 -0
- package/dist/components/dashboard/MetricPanel.js.map +1 -0
- package/dist/components/dashboard/MockDataProvider.d.ts +30 -0
- package/dist/components/dashboard/MockDataProvider.d.ts.map +1 -0
- package/dist/components/dashboard/MockDataProvider.js +270 -0
- package/dist/components/dashboard/MockDataProvider.js.map +1 -0
- package/dist/components/dashboard/components/BarChart.d.ts +10 -0
- package/dist/components/dashboard/components/BarChart.d.ts.map +1 -0
- package/dist/components/dashboard/components/BarChart.js +167 -0
- package/dist/components/dashboard/components/BarChart.js.map +1 -0
- package/dist/components/dashboard/components/LineChart.d.ts +10 -0
- package/dist/components/dashboard/components/LineChart.d.ts.map +1 -0
- package/dist/components/dashboard/components/LineChart.js +141 -0
- package/dist/components/dashboard/components/LineChart.js.map +1 -0
- package/dist/components/dashboard/components/MetricCard.d.ts +9 -0
- package/dist/components/dashboard/components/MetricCard.d.ts.map +1 -0
- package/dist/components/dashboard/components/MetricCard.js +163 -0
- package/dist/components/dashboard/components/MetricCard.js.map +1 -0
- package/dist/components/dashboard/components/SourceLink.d.ts +9 -0
- package/dist/components/dashboard/components/SourceLink.d.ts.map +1 -0
- package/dist/components/dashboard/components/SourceLink.js +39 -0
- package/dist/components/dashboard/components/SourceLink.js.map +1 -0
- package/dist/components/dashboard/components/TimeRangeSelector.d.ts +9 -0
- package/dist/components/dashboard/components/TimeRangeSelector.d.ts.map +1 -0
- package/dist/components/dashboard/components/TimeRangeSelector.js +167 -0
- package/dist/components/dashboard/components/TimeRangeSelector.js.map +1 -0
- package/dist/components/dashboard/components/index.d.ts +6 -0
- package/dist/components/dashboard/components/index.d.ts.map +1 -0
- package/dist/components/dashboard/components/index.js +6 -0
- package/dist/components/dashboard/components/index.js.map +1 -0
- package/dist/components/dashboard/index.d.ts +6 -0
- package/dist/components/dashboard/index.d.ts.map +1 -0
- package/dist/components/dashboard/index.js +8 -0
- package/dist/components/dashboard/index.js.map +1 -0
- package/dist/components/dashboard/types.d.ts +74 -0
- package/dist/components/dashboard/types.d.ts.map +1 -0
- package/dist/components/dashboard/types.js +8 -0
- package/dist/components/dashboard/types.js.map +1 -0
- package/dist/components/session-events/SessionEventFeed.d.ts +34 -0
- package/dist/components/session-events/SessionEventFeed.d.ts.map +1 -0
- package/dist/components/session-events/SessionEventFeed.js +1196 -0
- package/dist/components/session-events/SessionEventFeed.js.map +1 -0
- package/dist/components/session-events/index.d.ts +7 -0
- package/dist/components/session-events/index.d.ts.map +1 -0
- package/dist/components/session-events/index.js +6 -0
- package/dist/components/session-events/index.js.map +1 -0
- package/dist/components/state-view/PipelineView.d.ts +14 -0
- package/dist/components/state-view/PipelineView.d.ts.map +1 -0
- package/dist/components/state-view/PipelineView.js +195 -0
- package/dist/components/state-view/PipelineView.js.map +1 -0
- package/dist/components/state-view/index.d.ts +14 -0
- package/dist/components/state-view/index.d.ts.map +1 -0
- package/dist/components/state-view/index.js +12 -0
- package/dist/components/state-view/index.js.map +1 -0
- package/dist/components/state-view/types.d.ts +188 -0
- package/dist/components/state-view/types.d.ts.map +1 -0
- package/dist/components/state-view/types.js +10 -0
- package/dist/components/state-view/types.js.map +1 -0
- package/dist/components/state-view/useStateView.d.ts +32 -0
- package/dist/components/state-view/useStateView.d.ts.map +1 -0
- package/dist/components/state-view/useStateView.js +129 -0
- package/dist/components/state-view/useStateView.js.map +1 -0
- package/dist/contexts/GraphEditContext.d.ts +20 -0
- package/dist/contexts/GraphEditContext.d.ts.map +1 -0
- package/dist/contexts/GraphEditContext.js +8 -0
- package/dist/contexts/GraphEditContext.js.map +1 -0
- package/dist/contexts/TooltipPortalContext.d.ts +8 -0
- package/dist/contexts/TooltipPortalContext.d.ts.map +1 -0
- package/dist/contexts/TooltipPortalContext.js +8 -0
- package/dist/contexts/TooltipPortalContext.js.map +1 -0
- package/dist/edges/CustomEdge.d.ts +24 -0
- package/dist/edges/CustomEdge.d.ts.map +1 -0
- package/dist/edges/CustomEdge.js +222 -0
- package/dist/edges/CustomEdge.js.map +1 -0
- package/dist/edges/GenericEdge.d.ts +18 -0
- package/dist/edges/GenericEdge.d.ts.map +1 -0
- package/dist/edges/GenericEdge.js +10 -0
- package/dist/edges/GenericEdge.js.map +1 -0
- package/dist/graphify/anchor.d.ts +28 -0
- package/dist/graphify/anchor.d.ts.map +1 -0
- package/dist/graphify/anchor.js +132 -0
- package/dist/graphify/anchor.js.map +1 -0
- package/dist/graphify/consolidated.d.ts +210 -0
- package/dist/graphify/consolidated.d.ts.map +1 -0
- package/dist/graphify/consolidated.js +11 -0
- package/dist/graphify/consolidated.js.map +1 -0
- package/dist/graphify/ids.d.ts +19 -0
- package/dist/graphify/ids.d.ts.map +1 -0
- package/dist/graphify/ids.js +46 -0
- package/dist/graphify/ids.js.map +1 -0
- package/dist/graphify/index.d.ts +18 -0
- package/dist/graphify/index.d.ts.map +1 -0
- package/dist/graphify/index.js +12 -0
- package/dist/graphify/index.js.map +1 -0
- package/dist/graphify/kind.d.ts +23 -0
- package/dist/graphify/kind.d.ts.map +1 -0
- package/dist/graphify/kind.js +77 -0
- package/dist/graphify/kind.js.map +1 -0
- package/dist/graphify/resolve.d.ts +48 -0
- package/dist/graphify/resolve.d.ts.map +1 -0
- package/dist/graphify/resolve.js +83 -0
- package/dist/graphify/resolve.js.map +1 -0
- package/dist/graphify/signature.d.ts +87 -0
- package/dist/graphify/signature.d.ts.map +1 -0
- package/dist/graphify/signature.js +276 -0
- package/dist/graphify/signature.js.map +1 -0
- package/dist/graphify/types.d.ts +141 -0
- package/dist/graphify/types.d.ts.map +1 -0
- package/dist/graphify/types.js +8 -0
- package/dist/graphify/types.js.map +1 -0
- package/dist/hooks/useElkLayout.d.ts +66 -0
- package/dist/hooks/useElkLayout.d.ts.map +1 -0
- package/dist/hooks/useElkLayout.js +136 -0
- package/dist/hooks/useElkLayout.js.map +1 -0
- package/dist/hooks/usePathBasedEvents.d.ts +42 -0
- package/dist/hooks/usePathBasedEvents.d.ts.map +1 -0
- package/dist/hooks/usePathBasedEvents.js +119 -0
- package/dist/hooks/usePathBasedEvents.js.map +1 -0
- package/dist/hooks/useSequenceLayout.d.ts +186 -0
- package/dist/hooks/useSequenceLayout.d.ts.map +1 -0
- package/dist/hooks/useSequenceLayout.js +327 -0
- package/dist/hooks/useSequenceLayout.js.map +1 -0
- package/dist/hooks/useUndoRedo.d.ts +80 -0
- package/dist/hooks/useUndoRedo.d.ts.map +1 -0
- package/dist/hooks/useUndoRedo.js +70 -0
- package/dist/hooks/useUndoRedo.js.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/CustomNode.d.ts +28 -0
- package/dist/nodes/CustomNode.d.ts.map +1 -0
- package/dist/nodes/CustomNode.js +820 -0
- package/dist/nodes/CustomNode.js.map +1 -0
- package/dist/nodes/GenericNode.d.ts +20 -0
- package/dist/nodes/GenericNode.d.ts.map +1 -0
- package/dist/nodes/GenericNode.js +20 -0
- package/dist/nodes/GenericNode.js.map +1 -0
- package/dist/nodes/otel/OtelBoundaryNode.d.ts +55 -0
- package/dist/nodes/otel/OtelBoundaryNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelBoundaryNode.js +81 -0
- package/dist/nodes/otel/OtelBoundaryNode.js.map +1 -0
- package/dist/nodes/otel/OtelEventNode.d.ts +59 -0
- package/dist/nodes/otel/OtelEventNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelEventNode.js +82 -0
- package/dist/nodes/otel/OtelEventNode.js.map +1 -0
- package/dist/nodes/otel/OtelResourceNode.d.ts +53 -0
- package/dist/nodes/otel/OtelResourceNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelResourceNode.js +105 -0
- package/dist/nodes/otel/OtelResourceNode.js.map +1 -0
- package/dist/nodes/otel/OtelScopeNode.d.ts +53 -0
- package/dist/nodes/otel/OtelScopeNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelScopeNode.js +81 -0
- package/dist/nodes/otel/OtelScopeNode.js.map +1 -0
- package/dist/nodes/otel/OtelSpanConventionNode.d.ts +61 -0
- package/dist/nodes/otel/OtelSpanConventionNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelSpanConventionNode.js +131 -0
- package/dist/nodes/otel/OtelSpanConventionNode.js.map +1 -0
- package/dist/nodes/otel/index.d.ts +17 -0
- package/dist/nodes/otel/index.d.ts.map +1 -0
- package/dist/nodes/otel/index.js +13 -0
- package/dist/nodes/otel/index.js.map +1 -0
- package/dist/nodes/otel/shared/NodeBadges.d.ts +10 -0
- package/dist/nodes/otel/shared/NodeBadges.d.ts.map +1 -0
- package/dist/nodes/otel/shared/NodeBadges.js +178 -0
- package/dist/nodes/otel/shared/NodeBadges.js.map +1 -0
- package/dist/nodes/otel/shared/NodeContent.d.ts +10 -0
- package/dist/nodes/otel/shared/NodeContent.d.ts.map +1 -0
- package/dist/nodes/otel/shared/NodeContent.js +96 -0
- package/dist/nodes/otel/shared/NodeContent.js.map +1 -0
- package/dist/nodes/otel/shared/index.d.ts +8 -0
- package/dist/nodes/otel/shared/index.d.ts.map +1 -0
- package/dist/nodes/otel/shared/index.js +8 -0
- package/dist/nodes/otel/shared/index.js.map +1 -0
- package/dist/nodes/otel/shared/types.d.ts +129 -0
- package/dist/nodes/otel/shared/types.d.ts.map +1 -0
- package/dist/nodes/otel/shared/types.js +5 -0
- package/dist/nodes/otel/shared/types.js.map +1 -0
- package/dist/nodes/otel/shared/useNodeBehavior.d.ts +42 -0
- package/dist/nodes/otel/shared/useNodeBehavior.d.ts.map +1 -0
- package/dist/nodes/otel/shared/useNodeBehavior.js +61 -0
- package/dist/nodes/otel/shared/useNodeBehavior.js.map +1 -0
- package/dist/pierre/PierreFileView.d.ts +17 -0
- package/dist/pierre/PierreFileView.d.ts.map +1 -0
- package/dist/pierre/PierreFileView.js +46 -0
- package/dist/pierre/PierreFileView.js.map +1 -0
- package/dist/pierre/PierreSnippetView.d.ts +28 -0
- package/dist/pierre/PierreSnippetView.d.ts.map +1 -0
- package/dist/pierre/PierreSnippetView.js +105 -0
- package/dist/pierre/PierreSnippetView.js.map +1 -0
- package/dist/pierre/PierreThroughlineCodeView.d.ts +22 -0
- package/dist/pierre/PierreThroughlineCodeView.d.ts.map +1 -0
- package/dist/pierre/PierreThroughlineCodeView.js +206 -0
- package/dist/pierre/PierreThroughlineCodeView.js.map +1 -0
- package/dist/pierre/constructColors.d.ts +24 -0
- package/dist/pierre/constructColors.d.ts.map +1 -0
- package/dist/pierre/constructColors.js +91 -0
- package/dist/pierre/constructColors.js.map +1 -0
- package/dist/pierre/index.d.ts +12 -0
- package/dist/pierre/index.d.ts.map +1 -0
- package/dist/pierre/index.js +7 -0
- package/dist/pierre/index.js.map +1 -0
- package/dist/pierre/pierreBackground.d.ts +15 -0
- package/dist/pierre/pierreBackground.d.ts.map +1 -0
- package/dist/pierre/pierreBackground.js +31 -0
- package/dist/pierre/pierreBackground.js.map +1 -0
- package/dist/pierre/pierreFileLang.d.ts +27 -0
- package/dist/pierre/pierreFileLang.d.ts.map +1 -0
- package/dist/pierre/pierreFileLang.js +52 -0
- package/dist/pierre/pierreFileLang.js.map +1 -0
- package/dist/pierre/pierreSyntaxTheme.d.ts +11 -0
- package/dist/pierre/pierreSyntaxTheme.d.ts.map +1 -0
- package/dist/pierre/pierreSyntaxTheme.js +20 -0
- package/dist/pierre/pierreSyntaxTheme.js.map +1 -0
- package/dist/pierre/scrollAnchor.d.ts +5 -0
- package/dist/pierre/scrollAnchor.d.ts.map +1 -0
- package/dist/pierre/scrollAnchor.js +9 -0
- package/dist/pierre/scrollAnchor.js.map +1 -0
- package/dist/pierre/sliceSnippet.d.ts +10 -0
- package/dist/pierre/sliceSnippet.d.ts.map +1 -0
- package/dist/pierre/sliceSnippet.js +16 -0
- package/dist/pierre/sliceSnippet.js.map +1 -0
- package/dist/pierre/syntaxTokens.d.ts +11 -0
- package/dist/pierre/syntaxTokens.d.ts.map +1 -0
- package/dist/pierre/syntaxTokens.js +51 -0
- package/dist/pierre/syntaxTokens.js.map +1 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts +8 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +1 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js +116 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +1 -0
- package/dist/subsystem/ComponentDeclaration.d.ts +87 -0
- package/dist/subsystem/ComponentDeclaration.d.ts.map +1 -0
- package/dist/subsystem/ComponentDeclaration.js +374 -0
- package/dist/subsystem/ComponentDeclaration.js.map +1 -0
- package/dist/subsystem/FileDrawer.d.ts +17 -0
- package/dist/subsystem/FileDrawer.d.ts.map +1 -0
- package/dist/subsystem/FileDrawer.js +72 -0
- package/dist/subsystem/FileDrawer.js.map +1 -0
- package/dist/subsystem/GraphLayoutCover.d.ts +20 -0
- package/dist/subsystem/GraphLayoutCover.d.ts.map +1 -0
- package/dist/subsystem/GraphLayoutCover.js +42 -0
- package/dist/subsystem/GraphLayoutCover.js.map +1 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts +96 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -0
- package/dist/subsystem/SubsystemComponentGraph.js +1059 -0
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -0
- package/dist/subsystem/SubsystemFileTree.d.ts +24 -0
- package/dist/subsystem/SubsystemFileTree.d.ts.map +1 -0
- package/dist/subsystem/SubsystemFileTree.js +150 -0
- package/dist/subsystem/SubsystemFileTree.js.map +1 -0
- package/dist/subsystem/declarationRef.d.ts +39 -0
- package/dist/subsystem/declarationRef.d.ts.map +1 -0
- package/dist/subsystem/declarationRef.js +32 -0
- package/dist/subsystem/declarationRef.js.map +1 -0
- package/dist/subsystem/formatDeclaration.d.ts +11 -0
- package/dist/subsystem/formatDeclaration.d.ts.map +1 -0
- package/dist/subsystem/formatDeclaration.js +146 -0
- package/dist/subsystem/formatDeclaration.js.map +1 -0
- package/dist/subsystem/model.d.ts +353 -0
- package/dist/subsystem/model.d.ts.map +1 -0
- package/dist/subsystem/model.js +503 -0
- package/dist/subsystem/model.js.map +1 -0
- package/dist/subsystem/nodes.d.ts +69 -0
- package/dist/subsystem/nodes.d.ts.map +1 -0
- package/dist/subsystem/nodes.js +289 -0
- package/dist/subsystem/nodes.js.map +1 -0
- package/dist/subsystem/paths.d.ts +63 -0
- package/dist/subsystem/paths.d.ts.map +1 -0
- package/dist/subsystem/paths.js +86 -0
- package/dist/subsystem/paths.js.map +1 -0
- package/dist/subsystem/tokenizeComponent.d.ts +20 -0
- package/dist/subsystem/tokenizeComponent.d.ts.map +1 -0
- package/dist/subsystem/tokenizeComponent.js +56 -0
- package/dist/subsystem/tokenizeComponent.js.map +1 -0
- package/dist/subsystem/tokenizeFormatted.d.ts +12 -0
- package/dist/subsystem/tokenizeFormatted.d.ts.map +1 -0
- package/dist/subsystem/tokenizeFormatted.js +13 -0
- package/dist/subsystem/tokenizeFormatted.js.map +1 -0
- package/dist/utils/animationMapping.d.ts +53 -0
- package/dist/utils/animationMapping.d.ts.map +1 -0
- package/dist/utils/animationMapping.js +126 -0
- package/dist/utils/animationMapping.js.map +1 -0
- package/dist/utils/canvasBounds.d.ts +50 -0
- package/dist/utils/canvasBounds.d.ts.map +1 -0
- package/dist/utils/canvasBounds.js +88 -0
- package/dist/utils/canvasBounds.js.map +1 -0
- package/dist/utils/elkLayout.d.ts +137 -0
- package/dist/utils/elkLayout.d.ts.map +1 -0
- package/dist/utils/elkLayout.js +596 -0
- package/dist/utils/elkLayout.js.map +1 -0
- package/dist/utils/graphConverter.d.ts +18 -0
- package/dist/utils/graphConverter.d.ts.map +1 -0
- package/dist/utils/graphConverter.js +114 -0
- package/dist/utils/graphConverter.js.map +1 -0
- package/dist/utils/iconResolver.d.ts +29 -0
- package/dist/utils/iconResolver.d.ts.map +1 -0
- package/dist/utils/iconResolver.js +30 -0
- package/dist/utils/iconResolver.js.map +1 -0
- package/dist/utils/orientationUtils.d.ts +19 -0
- package/dist/utils/orientationUtils.d.ts.map +1 -0
- package/dist/utils/orientationUtils.js +62 -0
- package/dist/utils/orientationUtils.js.map +1 -0
- package/package.json +80 -0
- package/src/components/ConfigurationSelector.tsx +133 -0
- package/src/components/GraphRenderer.tsx +3195 -0
- package/src/components/MultiCanvasRenderer.tsx +295 -0
- package/src/components/NodeTooltip.tsx +279 -0
- package/src/components/PendingChanges.test.tsx +375 -0
- package/src/components/SelectionSidebar.tsx +352 -0
- package/src/components/SequenceDiagramRenderer.tsx +1156 -0
- package/src/components/WorkflowSequenceDiagram.tsx +270 -0
- package/src/components/dashboard/DashboardRenderer.tsx +317 -0
- package/src/components/dashboard/MetricPanel.tsx +254 -0
- package/src/components/dashboard/MockDataProvider.ts +330 -0
- package/src/components/dashboard/components/BarChart.tsx +299 -0
- package/src/components/dashboard/components/LineChart.tsx +279 -0
- package/src/components/dashboard/components/MetricCard.tsx +270 -0
- package/src/components/dashboard/components/SourceLink.tsx +63 -0
- package/src/components/dashboard/components/TimeRangeSelector.tsx +280 -0
- package/src/components/dashboard/components/index.ts +5 -0
- package/src/components/dashboard/index.ts +47 -0
- package/src/components/dashboard/types.ts +126 -0
- package/src/components/session-events/SessionEventFeed.tsx +1797 -0
- package/src/components/session-events/index.ts +13 -0
- package/src/components/state-view/PipelineView.tsx +347 -0
- package/src/components/state-view/index.ts +14 -0
- package/src/components/state-view/types.ts +261 -0
- package/src/components/state-view/useStateView.ts +205 -0
- package/src/contexts/GraphEditContext.tsx +27 -0
- package/src/contexts/TooltipPortalContext.ts +8 -0
- package/src/edges/CustomEdge.tsx +402 -0
- package/src/edges/GenericEdge.tsx +36 -0
- package/src/graphify/anchor.test.ts +124 -0
- package/src/graphify/anchor.ts +160 -0
- package/src/graphify/consolidated.ts +246 -0
- package/src/graphify/ids.ts +48 -0
- package/src/graphify/index.ts +72 -0
- package/src/graphify/kind.test.ts +108 -0
- package/src/graphify/kind.ts +120 -0
- package/src/graphify/resolve.test.ts +89 -0
- package/src/graphify/resolve.ts +115 -0
- package/src/graphify/signature.test.ts +278 -0
- package/src/graphify/signature.ts +354 -0
- package/src/graphify/types.ts +164 -0
- package/src/hooks/useElkLayout.test.ts +134 -0
- package/src/hooks/useElkLayout.ts +191 -0
- package/src/hooks/usePathBasedEvents.ts +192 -0
- package/src/hooks/useSequenceLayout.ts +543 -0
- package/src/hooks/useUndoRedo.ts +144 -0
- package/src/index.ts +341 -0
- package/src/nodes/CustomNode.tsx +1231 -0
- package/src/nodes/GenericNode.tsx +55 -0
- package/src/nodes/otel/OtelBoundaryNode.tsx +224 -0
- package/src/nodes/otel/OtelEventNode.tsx +225 -0
- package/src/nodes/otel/OtelResourceNode.tsx +251 -0
- package/src/nodes/otel/OtelScopeNode.tsx +221 -0
- package/src/nodes/otel/OtelSpanConventionNode.tsx +295 -0
- package/src/nodes/otel/index.ts +23 -0
- package/src/nodes/otel/shared/NodeBadges.tsx +295 -0
- package/src/nodes/otel/shared/NodeContent.tsx +204 -0
- package/src/nodes/otel/shared/index.ts +8 -0
- package/src/nodes/otel/shared/types.ts +138 -0
- package/src/nodes/otel/shared/useNodeBehavior.ts +114 -0
- package/src/pierre/PierreFileView.tsx +81 -0
- package/src/pierre/PierreSnippetView.tsx +184 -0
- package/src/pierre/PierreThroughlineCodeView.tsx +304 -0
- package/src/pierre/constructColors.test.ts +52 -0
- package/src/pierre/constructColors.ts +112 -0
- package/src/pierre/index.ts +18 -0
- package/src/pierre/pierreBackground.ts +33 -0
- package/src/pierre/pierreFileLang.test.ts +26 -0
- package/src/pierre/pierreFileLang.ts +55 -0
- package/src/pierre/pierreSyntaxTheme.ts +23 -0
- package/src/pierre/scrollAnchor.test.ts +13 -0
- package/src/pierre/scrollAnchor.ts +11 -0
- package/src/pierre/sliceSnippet.test.ts +21 -0
- package/src/pierre/sliceSnippet.ts +31 -0
- package/src/pierre/syntaxTokens.test.ts +35 -0
- package/src/pierre/syntaxTokens.ts +60 -0
- package/src/stories/Audit/BoundaryNodes.stories.tsx +385 -0
- package/src/stories/Audit/CanvasEdgeTypes.stories.tsx +1448 -0
- package/src/stories/Audit/CanvasNodeTypes.stories.tsx +1049 -0
- package/src/stories/Audit/ColorPriority.stories.tsx +895 -0
- package/src/stories/Audit/DiamondBadges.stories.tsx +629 -0
- package/src/stories/Audit/NodeDimensionsTesting.stories.tsx +724 -0
- package/src/stories/Audit/NodeFieldsAudit.stories.tsx +996 -0
- package/src/stories/Audit/NodeFontSizeTesting.stories.tsx +715 -0
- package/src/stories/Audit/NodeShapes.stories.tsx +1208 -0
- package/src/stories/Audit/WideNodesTesting.stories.tsx +1045 -0
- package/src/stories/Components/DashboardRenderer.stories.tsx +263 -0
- package/src/stories/Components/GraphRenderer.stories.tsx +3236 -0
- package/src/stories/Components/MultiCanvasRenderer.stories.tsx +370 -0
- package/src/stories/Components/SequenceDiagram.stories.tsx +255 -0
- package/src/stories/Components/StateView.stories.tsx +417 -0
- package/src/stories/Components/TraceViewer.stories.tsx +442 -0
- package/src/stories/Components/WorkflowSequenceDiagram.stories.tsx +802 -0
- package/src/stories/Features/AnimationWorkshop.stories.tsx +727 -0
- package/src/stories/Features/ChangeTypeVisual.stories.tsx +67 -0
- package/src/stories/Features/EventDrivenAnimations.stories.tsx +513 -0
- package/src/stories/Features/MultiConfig.stories.tsx +539 -0
- package/src/stories/Introduction.mdx +34 -0
- package/src/stories/Layout/ElkEdgeRouting.stories.tsx +539 -0
- package/src/stories/Layout/GraphOrientation.stories.tsx +500 -0
- package/src/stories/Layout/MultiDirectionalConnections.stories.tsx +352 -0
- package/src/stories/Nodes/NodeDefinitionComparison.stories.tsx +560 -0
- package/src/stories/Nodes/NodeNameFallbacks.stories.tsx +491 -0
- package/src/stories/Nodes/NumericColors.stories.tsx +440 -0
- package/src/stories/OTEL/EventNameDisplay.stories.tsx +694 -0
- package/src/stories/OTEL/EventNameFallback.stories.tsx +578 -0
- package/src/stories/OTEL/OtelComponents.stories.tsx +422 -0
- package/src/stories/OTEL/OtelNodeTypesPrototype.stories.tsx +806 -0
- package/src/stories/OTEL/RawEventCards.stories.tsx +57 -0
- package/src/stories/OTEL/SpanBadges.stories.tsx +840 -0
- package/src/stories/OTEL/ValidationEventsCanvas.stories.tsx +209 -0
- package/src/stories/Pierre/CodeView.stories.tsx +219 -0
- package/src/stories/RealWorld/BacklogMdCanvases.stories.tsx +721 -0
- package/src/stories/RealWorld/FileCitySequence.stories.tsx +516 -0
- package/src/stories/RealWorld/RealCanvasFiles.stories.tsx +336 -0
- package/src/stories/Subsystem/ComponentDeclarationAudit.stories.tsx +321 -0
- package/src/stories/Subsystem/ComponentGraph/Appearance.stories.tsx +365 -0
- package/src/stories/Subsystem/ComponentGraph/Basics.stories.tsx +137 -0
- package/src/stories/Subsystem/ComponentGraph/Captures.stories.tsx +238 -0
- package/src/stories/Subsystem/ComponentGraph/DetailPanel.stories.tsx +315 -0
- package/src/stories/Subsystem/ComponentGraph/Flows.stories.tsx +239 -0
- package/src/stories/Subsystem/ComponentGraph/FrameworkStereotype.stories.tsx +216 -0
- package/src/stories/Subsystem/ComponentGraph/GraphTitle.stories.tsx +70 -0
- package/src/stories/Subsystem/ComponentGraph/Processes.stories.tsx +68 -0
- package/src/stories/Subsystem/ComponentGraph/Scenarios.stories.tsx +959 -0
- package/src/stories/Subsystem/ComponentGraph/Spotlights.stories.tsx +681 -0
- package/src/stories/Subsystem/ComponentGraph/fixtures.ts +129 -0
- package/src/stories/__traces__/test-run.canvas.json +241 -0
- package/src/stories/data/activity-feed-analytics.dashboard.json +300 -0
- package/src/stories/data/file-city-images-transformed.otel.canvas.json +295 -0
- package/src/stories/data/file-city-workflows.json +269 -0
- package/src/stories/data/graph-converter-test-execution.json +443 -0
- package/src/stories/data/graph-converter-test.workflow.json +105 -0
- package/src/stories/data/graph-converter-validated-execution.json +58 -0
- package/src/stories/data/opencode-session-raw-events.json +273396 -0
- package/src/subsystem/ComponentDeclaration.tsx +643 -0
- package/src/subsystem/FileDrawer.tsx +106 -0
- package/src/subsystem/GraphLayoutCover.tsx +69 -0
- package/src/subsystem/SubsystemComponentGraph.tsx +1644 -0
- package/src/subsystem/SubsystemFileTree.tsx +190 -0
- package/src/subsystem/declarationRef.test.ts +33 -0
- package/src/subsystem/declarationRef.ts +63 -0
- package/src/subsystem/formatDeclaration.ts +174 -0
- package/src/subsystem/model.test.ts +244 -0
- package/src/subsystem/model.ts +850 -0
- package/src/subsystem/nodes.test.ts +56 -0
- package/src/subsystem/nodes.tsx +443 -0
- package/src/subsystem/paths.test.ts +123 -0
- package/src/subsystem/paths.ts +127 -0
- package/src/subsystem/tokenizeComponent.ts +70 -0
- package/src/subsystem/tokenizeFormatted.ts +19 -0
- package/src/utils/animationMapping.ts +166 -0
- package/src/utils/canvasBounds.ts +146 -0
- package/src/utils/elkLayout.test.ts +240 -0
- package/src/utils/elkLayout.ts +779 -0
- package/src/utils/graphConverter.ts +148 -0
- package/src/utils/iconResolver.tsx +53 -0
- package/src/utils/orientationUtils.ts +73 -0
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { MultiCanvasRenderer } from '../../components/MultiCanvasRenderer';
|
|
4
|
+
import type { MultiCanvasLayout } from '../../components/MultiCanvasRenderer';
|
|
5
|
+
import type { ExtendedCanvas } from '@principal-ai/subsystems-core';
|
|
6
|
+
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Components/MultiCanvasRenderer',
|
|
10
|
+
component: MultiCanvasRenderer,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'fullscreen',
|
|
13
|
+
},
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
decorators: [
|
|
16
|
+
(Story) => (
|
|
17
|
+
<ThemeProvider theme={defaultEditorTheme}>
|
|
18
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
19
|
+
<Story />
|
|
20
|
+
</div>
|
|
21
|
+
</ThemeProvider>
|
|
22
|
+
),
|
|
23
|
+
],
|
|
24
|
+
} satisfies Meta<typeof MultiCanvasRenderer>;
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
28
|
+
|
|
29
|
+
// ============================================================================
|
|
30
|
+
// Sample Canvases
|
|
31
|
+
// ============================================================================
|
|
32
|
+
|
|
33
|
+
const authFlowCanvas: ExtendedCanvas = {
|
|
34
|
+
nodes: [
|
|
35
|
+
{
|
|
36
|
+
id: 'login',
|
|
37
|
+
type: 'text',
|
|
38
|
+
x: 0,
|
|
39
|
+
y: 0,
|
|
40
|
+
width: 120,
|
|
41
|
+
height: 60,
|
|
42
|
+
text: 'Login',
|
|
43
|
+
color: '#4A90E2',
|
|
44
|
+
pv: { nodeType: 'process', shape: 'rectangle', icon: 'User' },
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: 'validate',
|
|
48
|
+
type: 'text',
|
|
49
|
+
x: 170,
|
|
50
|
+
y: 0,
|
|
51
|
+
width: 120,
|
|
52
|
+
height: 60,
|
|
53
|
+
text: 'Validate',
|
|
54
|
+
color: '#F5A623',
|
|
55
|
+
pv: { nodeType: 'process', shape: 'rectangle', icon: 'Shield' },
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'session',
|
|
59
|
+
type: 'text',
|
|
60
|
+
x: 340,
|
|
61
|
+
y: 0,
|
|
62
|
+
width: 120,
|
|
63
|
+
height: 60,
|
|
64
|
+
text: 'Session',
|
|
65
|
+
color: '#7ED321',
|
|
66
|
+
pv: { nodeType: 'data', shape: 'rectangle', icon: 'Key' },
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
edges: [
|
|
70
|
+
{ id: 'e1', fromNode: 'login', toNode: 'validate', pv: { edgeType: 'flow' } },
|
|
71
|
+
{ id: 'e2', fromNode: 'validate', toNode: 'session', pv: { edgeType: 'flow' } },
|
|
72
|
+
],
|
|
73
|
+
pv: {
|
|
74
|
+
version: '1.0.0',
|
|
75
|
+
name: 'Authentication Flow',
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const dataProcessingCanvas: ExtendedCanvas = {
|
|
80
|
+
nodes: [
|
|
81
|
+
{
|
|
82
|
+
id: 'input',
|
|
83
|
+
type: 'text',
|
|
84
|
+
x: 0,
|
|
85
|
+
y: 0,
|
|
86
|
+
width: 100,
|
|
87
|
+
height: 100,
|
|
88
|
+
text: 'Input',
|
|
89
|
+
color: '#7B68EE',
|
|
90
|
+
pv: { nodeType: 'data', shape: 'circle', icon: 'Download' },
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'transform',
|
|
94
|
+
type: 'text',
|
|
95
|
+
x: 150,
|
|
96
|
+
y: 15,
|
|
97
|
+
width: 140,
|
|
98
|
+
height: 70,
|
|
99
|
+
text: 'Transform',
|
|
100
|
+
color: '#4A90E2',
|
|
101
|
+
pv: { nodeType: 'process', shape: 'rectangle', icon: 'Settings' },
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 'output',
|
|
105
|
+
type: 'text',
|
|
106
|
+
x: 340,
|
|
107
|
+
y: 0,
|
|
108
|
+
width: 100,
|
|
109
|
+
height: 100,
|
|
110
|
+
text: 'Output',
|
|
111
|
+
color: '#7B68EE',
|
|
112
|
+
pv: { nodeType: 'data', shape: 'circle', icon: 'Upload' },
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
edges: [
|
|
116
|
+
{ id: 'e1', fromNode: 'input', toNode: 'transform', pv: { edgeType: 'dataflow' } },
|
|
117
|
+
{ id: 'e2', fromNode: 'transform', toNode: 'output', pv: { edgeType: 'dataflow' } },
|
|
118
|
+
],
|
|
119
|
+
pv: {
|
|
120
|
+
version: '1.0.0',
|
|
121
|
+
name: 'Data Processing Pipeline',
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const notificationCanvas: ExtendedCanvas = {
|
|
126
|
+
nodes: [
|
|
127
|
+
{
|
|
128
|
+
id: 'event',
|
|
129
|
+
type: 'text',
|
|
130
|
+
x: 0,
|
|
131
|
+
y: 30,
|
|
132
|
+
width: 100,
|
|
133
|
+
height: 60,
|
|
134
|
+
text: 'Event',
|
|
135
|
+
color: '#F5A623',
|
|
136
|
+
pv: { nodeType: 'trigger', shape: 'rectangle', icon: 'Zap' },
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: 'router',
|
|
140
|
+
type: 'text',
|
|
141
|
+
x: 150,
|
|
142
|
+
y: 0,
|
|
143
|
+
width: 100,
|
|
144
|
+
height: 100,
|
|
145
|
+
text: 'Router',
|
|
146
|
+
color: '#4A90E2',
|
|
147
|
+
pv: { nodeType: 'process', shape: 'diamond', icon: 'GitBranch' },
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: 'email',
|
|
151
|
+
type: 'text',
|
|
152
|
+
x: 300,
|
|
153
|
+
y: -30,
|
|
154
|
+
width: 100,
|
|
155
|
+
height: 50,
|
|
156
|
+
text: 'Email',
|
|
157
|
+
color: '#7ED321',
|
|
158
|
+
pv: { nodeType: 'action', shape: 'rectangle', icon: 'Mail' },
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'sms',
|
|
162
|
+
type: 'text',
|
|
163
|
+
x: 300,
|
|
164
|
+
y: 40,
|
|
165
|
+
width: 100,
|
|
166
|
+
height: 50,
|
|
167
|
+
text: 'SMS',
|
|
168
|
+
color: '#7ED321',
|
|
169
|
+
pv: { nodeType: 'action', shape: 'rectangle', icon: 'MessageSquare' },
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
id: 'push',
|
|
173
|
+
type: 'text',
|
|
174
|
+
x: 300,
|
|
175
|
+
y: 110,
|
|
176
|
+
width: 100,
|
|
177
|
+
height: 50,
|
|
178
|
+
text: 'Push',
|
|
179
|
+
color: '#7ED321',
|
|
180
|
+
pv: { nodeType: 'action', shape: 'rectangle', icon: 'Bell' },
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
edges: [
|
|
184
|
+
{ id: 'e1', fromNode: 'event', toNode: 'router', pv: { edgeType: 'flow' } },
|
|
185
|
+
{ id: 'e2', fromNode: 'router', toNode: 'email', pv: { edgeType: 'flow' } },
|
|
186
|
+
{ id: 'e3', fromNode: 'router', toNode: 'sms', pv: { edgeType: 'flow' } },
|
|
187
|
+
{ id: 'e4', fromNode: 'router', toNode: 'push', pv: { edgeType: 'flow' } },
|
|
188
|
+
],
|
|
189
|
+
pv: {
|
|
190
|
+
version: '1.0.0',
|
|
191
|
+
name: 'Notification System',
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
const monitoringCanvas: ExtendedCanvas = {
|
|
196
|
+
nodes: [
|
|
197
|
+
{
|
|
198
|
+
id: 'metrics',
|
|
199
|
+
type: 'text',
|
|
200
|
+
x: 0,
|
|
201
|
+
y: 0,
|
|
202
|
+
width: 100,
|
|
203
|
+
height: 60,
|
|
204
|
+
text: 'Metrics',
|
|
205
|
+
color: '#4A90E2',
|
|
206
|
+
pv: { nodeType: 'data', shape: 'rectangle', icon: 'BarChart2' },
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
id: 'alert',
|
|
210
|
+
type: 'text',
|
|
211
|
+
x: 150,
|
|
212
|
+
y: 0,
|
|
213
|
+
width: 100,
|
|
214
|
+
height: 60,
|
|
215
|
+
text: 'Alert',
|
|
216
|
+
color: '#D0021B',
|
|
217
|
+
pv: { nodeType: 'process', shape: 'rectangle', icon: 'AlertTriangle' },
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
edges: [
|
|
221
|
+
{ id: 'e1', fromNode: 'metrics', toNode: 'alert', pv: { edgeType: 'flow' } },
|
|
222
|
+
],
|
|
223
|
+
pv: {
|
|
224
|
+
version: '1.0.0',
|
|
225
|
+
name: 'Monitoring',
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
// ============================================================================
|
|
230
|
+
// Stories
|
|
231
|
+
// ============================================================================
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Two canvases side by side on the same graph
|
|
235
|
+
*/
|
|
236
|
+
const twoCanvasLayout: MultiCanvasLayout = {
|
|
237
|
+
placements: [
|
|
238
|
+
{ canvasId: 'auth', canvas: authFlowCanvas, position: { x: 0, y: 0 } },
|
|
239
|
+
{ canvasId: 'data', canvas: dataProcessingCanvas, position: { x: 600, y: 0 } },
|
|
240
|
+
],
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
export const TwoCanvasesSideBySide: Story = {
|
|
244
|
+
args: {
|
|
245
|
+
layout: twoCanvasLayout,
|
|
246
|
+
showControls: true,
|
|
247
|
+
showBackground: true,
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Four canvases arranged in a 2x2 grid pattern
|
|
253
|
+
*/
|
|
254
|
+
const fourCanvasLayout: MultiCanvasLayout = {
|
|
255
|
+
placements: [
|
|
256
|
+
{ canvasId: 'auth', canvas: authFlowCanvas, position: { x: 0, y: 0 } },
|
|
257
|
+
{ canvasId: 'data', canvas: dataProcessingCanvas, position: { x: 600, y: 0 } },
|
|
258
|
+
{ canvasId: 'notify', canvas: notificationCanvas, position: { x: 0, y: 200 } },
|
|
259
|
+
{ canvasId: 'monitor', canvas: monitoringCanvas, position: { x: 600, y: 200 } },
|
|
260
|
+
],
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export const FourCanvasesGrid: Story = {
|
|
264
|
+
args: {
|
|
265
|
+
layout: fourCanvasLayout,
|
|
266
|
+
showControls: true,
|
|
267
|
+
showBackground: true,
|
|
268
|
+
},
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Canvases stacked vertically
|
|
273
|
+
*/
|
|
274
|
+
const verticalLayout: MultiCanvasLayout = {
|
|
275
|
+
placements: [
|
|
276
|
+
{ canvasId: 'auth', canvas: authFlowCanvas, position: { x: 0, y: 0 } },
|
|
277
|
+
{ canvasId: 'data', canvas: dataProcessingCanvas, position: { x: 0, y: 150 } },
|
|
278
|
+
{ canvasId: 'notify', canvas: notificationCanvas, position: { x: 0, y: 300 } },
|
|
279
|
+
],
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
export const VerticalStack: Story = {
|
|
283
|
+
args: {
|
|
284
|
+
layout: verticalLayout,
|
|
285
|
+
showControls: true,
|
|
286
|
+
showBackground: true,
|
|
287
|
+
},
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Single canvas (baseline comparison)
|
|
292
|
+
*/
|
|
293
|
+
const singleCanvasLayout: MultiCanvasLayout = {
|
|
294
|
+
placements: [
|
|
295
|
+
{ canvasId: 'notify', canvas: notificationCanvas, position: { x: 0, y: 0 } },
|
|
296
|
+
],
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
export const SingleCanvas: Story = {
|
|
300
|
+
args: {
|
|
301
|
+
layout: singleCanvasLayout,
|
|
302
|
+
showControls: true,
|
|
303
|
+
showBackground: true,
|
|
304
|
+
},
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* With minimap enabled to navigate the combined view
|
|
309
|
+
*/
|
|
310
|
+
export const WithMinimap: Story = {
|
|
311
|
+
args: {
|
|
312
|
+
layout: fourCanvasLayout,
|
|
313
|
+
showControls: true,
|
|
314
|
+
showMinimap: true,
|
|
315
|
+
showBackground: true,
|
|
316
|
+
},
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Without group borders - just the nodes merged together
|
|
321
|
+
*/
|
|
322
|
+
export const WithoutGroups: Story = {
|
|
323
|
+
args: {
|
|
324
|
+
layout: fourCanvasLayout,
|
|
325
|
+
showControls: true,
|
|
326
|
+
showBackground: true,
|
|
327
|
+
showGroups: false,
|
|
328
|
+
},
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Draggable groups - drag the group borders to rearrange canvases
|
|
333
|
+
*/
|
|
334
|
+
export const DraggableGroups: Story = {
|
|
335
|
+
render: () => {
|
|
336
|
+
const [layout, setLayout] = React.useState<MultiCanvasLayout>(fourCanvasLayout);
|
|
337
|
+
|
|
338
|
+
const handleLayoutChange = React.useCallback((newLayout: MultiCanvasLayout) => {
|
|
339
|
+
console.log('Layout changed:', newLayout.placements.map(p => ({
|
|
340
|
+
canvasId: p.canvasId,
|
|
341
|
+
position: p.position,
|
|
342
|
+
})));
|
|
343
|
+
setLayout(newLayout);
|
|
344
|
+
}, []);
|
|
345
|
+
|
|
346
|
+
return (
|
|
347
|
+
<div style={{ width: '100%', height: '100%' }}>
|
|
348
|
+
<div style={{
|
|
349
|
+
position: 'absolute',
|
|
350
|
+
top: 10,
|
|
351
|
+
left: 10,
|
|
352
|
+
zIndex: 100,
|
|
353
|
+
background: 'rgba(0,0,0,0.7)',
|
|
354
|
+
color: 'white',
|
|
355
|
+
padding: '8px 12px',
|
|
356
|
+
borderRadius: 4,
|
|
357
|
+
fontSize: 12,
|
|
358
|
+
}}>
|
|
359
|
+
Drag the group borders to move entire canvases
|
|
360
|
+
</div>
|
|
361
|
+
<MultiCanvasRenderer
|
|
362
|
+
layout={layout}
|
|
363
|
+
onLayoutChange={handleLayoutChange}
|
|
364
|
+
showControls
|
|
365
|
+
showBackground
|
|
366
|
+
/>
|
|
367
|
+
</div>
|
|
368
|
+
);
|
|
369
|
+
},
|
|
370
|
+
};
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { SequenceDiagramRenderer } from '../../components/SequenceDiagramRenderer';
|
|
4
|
+
import type { SequenceEvent, SequenceEdge } from '../../hooks/useSequenceLayout';
|
|
5
|
+
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Components/SequenceDiagram',
|
|
9
|
+
component: SequenceDiagramRenderer,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'fullscreen',
|
|
12
|
+
},
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
decorators: [
|
|
15
|
+
(Story) => (
|
|
16
|
+
<ThemeProvider theme={defaultEditorTheme}>
|
|
17
|
+
<div style={{ padding: 20, height: '100vh', boxSizing: 'border-box' }}>
|
|
18
|
+
<Story />
|
|
19
|
+
</div>
|
|
20
|
+
</ThemeProvider>
|
|
21
|
+
),
|
|
22
|
+
],
|
|
23
|
+
} satisfies Meta<typeof SequenceDiagramRenderer>;
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// Sample Data
|
|
30
|
+
// ============================================================================
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Simple authentication flow across two namespaces
|
|
34
|
+
*/
|
|
35
|
+
const simpleAuthFlow: { events: SequenceEvent[]; edges: SequenceEdge[] } = {
|
|
36
|
+
events: [
|
|
37
|
+
{ id: '1', name: 'auth.validation.started', label: 'Validation Started' },
|
|
38
|
+
{ id: '2', name: 'database.query.findUser', label: 'Find User' },
|
|
39
|
+
{ id: '3', name: 'auth.validation.completed', label: 'Validation Completed' },
|
|
40
|
+
{ id: '4', name: 'auth.token.generated', label: 'Token Generated' },
|
|
41
|
+
],
|
|
42
|
+
edges: [
|
|
43
|
+
{ id: 'e1', fromEvent: '1', toEvent: '2' },
|
|
44
|
+
{ id: 'e2', fromEvent: '2', toEvent: '3' },
|
|
45
|
+
{ id: 'e3', fromEvent: '3', toEvent: '4' },
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* More complex flow with multiple actors
|
|
51
|
+
*/
|
|
52
|
+
const complexOrderFlow: { events: SequenceEvent[]; edges: SequenceEdge[] } = {
|
|
53
|
+
events: [
|
|
54
|
+
{ id: '1', name: 'api.request.received', label: 'Request Received' },
|
|
55
|
+
{ id: '2', name: 'auth.session.validate', label: 'Validate Session' },
|
|
56
|
+
{ id: '3', name: 'order.validation.started', label: 'Validate Order' },
|
|
57
|
+
{ id: '4', name: 'inventory.check.availability', label: 'Check Stock' },
|
|
58
|
+
{ id: '5', name: 'order.validation.completed', label: 'Order Valid' },
|
|
59
|
+
{ id: '6', name: 'payment.charge.initiated', label: 'Initiate Charge' },
|
|
60
|
+
{ id: '7', name: 'payment.charge.completed', label: 'Charge Complete' },
|
|
61
|
+
{ id: '8', name: 'order.fulfillment.started', label: 'Start Fulfillment' },
|
|
62
|
+
{ id: '9', name: 'inventory.reserve.items', label: 'Reserve Items' },
|
|
63
|
+
{ id: '10', name: 'notification.email.sent', label: 'Confirmation Email' },
|
|
64
|
+
{ id: '11', name: 'api.response.sent', label: 'Response Sent' },
|
|
65
|
+
],
|
|
66
|
+
edges: [
|
|
67
|
+
{ id: 'e1', fromEvent: '1', toEvent: '2' },
|
|
68
|
+
{ id: 'e2', fromEvent: '2', toEvent: '3' },
|
|
69
|
+
{ id: 'e3', fromEvent: '3', toEvent: '4' },
|
|
70
|
+
{ id: 'e4', fromEvent: '4', toEvent: '5' },
|
|
71
|
+
{ id: 'e5', fromEvent: '5', toEvent: '6' },
|
|
72
|
+
{ id: 'e6', fromEvent: '6', toEvent: '7' },
|
|
73
|
+
{ id: 'e7', fromEvent: '7', toEvent: '8' },
|
|
74
|
+
{ id: 'e8', fromEvent: '8', toEvent: '9' },
|
|
75
|
+
{ id: 'e9', fromEvent: '9', toEvent: '10' },
|
|
76
|
+
{ id: 'e10', fromEvent: '10', toEvent: '11' },
|
|
77
|
+
],
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Flow with hierarchical namespaces (sub-namespaces)
|
|
82
|
+
*/
|
|
83
|
+
const hierarchicalFlow: { events: SequenceEvent[]; edges: SequenceEdge[] } = {
|
|
84
|
+
events: [
|
|
85
|
+
{ id: '1', name: 'auth.login.started', label: 'Login Started' },
|
|
86
|
+
{ id: '2', name: 'auth.login.validation.credentials', label: 'Check Credentials' },
|
|
87
|
+
{ id: '3', name: 'auth.login.validation.mfa', label: 'Check MFA' },
|
|
88
|
+
{ id: '4', name: 'auth.login.session.create', label: 'Create Session' },
|
|
89
|
+
{ id: '5', name: 'auth.login.completed', label: 'Login Completed' },
|
|
90
|
+
],
|
|
91
|
+
edges: [
|
|
92
|
+
{ id: 'e1', fromEvent: '1', toEvent: '2' },
|
|
93
|
+
{ id: 'e2', fromEvent: '2', toEvent: '3' },
|
|
94
|
+
{ id: 'e3', fromEvent: '3', toEvent: '4' },
|
|
95
|
+
{ id: 'e4', fromEvent: '4', toEvent: '5' },
|
|
96
|
+
],
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Flow with same-namespace sequential events
|
|
101
|
+
*/
|
|
102
|
+
const sameNamespaceFlow: { events: SequenceEvent[]; edges: SequenceEdge[] } = {
|
|
103
|
+
events: [
|
|
104
|
+
{ id: '1', name: 'processor.step1', label: 'Step 1' },
|
|
105
|
+
{ id: '2', name: 'processor.step2', label: 'Step 2' },
|
|
106
|
+
{ id: '3', name: 'processor.step3', label: 'Step 3' },
|
|
107
|
+
{ id: '4', name: 'external.callback', label: 'External Callback' },
|
|
108
|
+
{ id: '5', name: 'processor.step4', label: 'Step 4' },
|
|
109
|
+
],
|
|
110
|
+
edges: [
|
|
111
|
+
{ id: 'e1', fromEvent: '1', toEvent: '2' },
|
|
112
|
+
{ id: 'e2', fromEvent: '2', toEvent: '3' },
|
|
113
|
+
{ id: 'e3', fromEvent: '3', toEvent: '4' },
|
|
114
|
+
{ id: 'e4', fromEvent: '4', toEvent: '5' },
|
|
115
|
+
],
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// ============================================================================
|
|
119
|
+
// Stories
|
|
120
|
+
// ============================================================================
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Basic two-namespace flow showing authentication
|
|
124
|
+
*/
|
|
125
|
+
export const SimpleFlow: Story = {
|
|
126
|
+
args: {
|
|
127
|
+
events: simpleAuthFlow.events,
|
|
128
|
+
edges: simpleAuthFlow.edges,
|
|
129
|
+
height: 500,
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Complex multi-actor e-commerce order flow
|
|
135
|
+
*/
|
|
136
|
+
export const ComplexFlow: Story = {
|
|
137
|
+
args: {
|
|
138
|
+
events: complexOrderFlow.events,
|
|
139
|
+
edges: complexOrderFlow.edges,
|
|
140
|
+
height: 700,
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Flow with hierarchical namespaces. By default, lanes group at the first
|
|
146
|
+
* dotted segment — drill in via `openedNamespaces` (see `WithDrillDown`).
|
|
147
|
+
*/
|
|
148
|
+
export const HierarchicalNamespaces: Story = {
|
|
149
|
+
args: {
|
|
150
|
+
events: hierarchicalFlow.events,
|
|
151
|
+
edges: hierarchicalFlow.edges,
|
|
152
|
+
height: 500,
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Flow testing same-namespace edge rendering
|
|
158
|
+
*/
|
|
159
|
+
export const SameNamespaceEdges: Story = {
|
|
160
|
+
args: {
|
|
161
|
+
events: sameNamespaceFlow.events,
|
|
162
|
+
edges: sameNamespaceFlow.edges,
|
|
163
|
+
height: 500,
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Interactive drill-down. Click ▶ on a lane header to split it into
|
|
169
|
+
* its sub-namespaces; click ‹ on a child lane to step back out.
|
|
170
|
+
*/
|
|
171
|
+
export const WithDrillDown: Story = {
|
|
172
|
+
render: () => {
|
|
173
|
+
const [opened, setOpened] = useState<string[]>([]);
|
|
174
|
+
|
|
175
|
+
const handleToggle = (namespace: string) => {
|
|
176
|
+
setOpened((prev) =>
|
|
177
|
+
prev.includes(namespace)
|
|
178
|
+
? prev.filter((n) => n !== namespace)
|
|
179
|
+
: [...prev, namespace]
|
|
180
|
+
);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
return (
|
|
184
|
+
<div>
|
|
185
|
+
<div style={{ marginBottom: 16 }}>
|
|
186
|
+
<strong>Opened namespaces:</strong>{' '}
|
|
187
|
+
{opened.length ? opened.join(', ') : 'none'}
|
|
188
|
+
<br />
|
|
189
|
+
<small>▶ on a lane header drills in. ‹ on a child lane steps back out.</small>
|
|
190
|
+
</div>
|
|
191
|
+
<SequenceDiagramRenderer
|
|
192
|
+
events={hierarchicalFlow.events}
|
|
193
|
+
edges={hierarchicalFlow.edges}
|
|
194
|
+
height={500}
|
|
195
|
+
layoutOptions={{ openedNamespaces: opened }}
|
|
196
|
+
onToggleNamespace={handleToggle}
|
|
197
|
+
/>
|
|
198
|
+
</div>
|
|
199
|
+
);
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Custom layout options - wider lanes and more spacing
|
|
205
|
+
*/
|
|
206
|
+
export const CustomLayout: Story = {
|
|
207
|
+
args: {
|
|
208
|
+
events: simpleAuthFlow.events,
|
|
209
|
+
edges: simpleAuthFlow.edges,
|
|
210
|
+
height: 500,
|
|
211
|
+
layoutOptions: {
|
|
212
|
+
laneWidth: 250,
|
|
213
|
+
laneGap: 80,
|
|
214
|
+
eventSpacing: 100,
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Compact layout for smaller diagrams
|
|
221
|
+
*/
|
|
222
|
+
export const CompactLayout: Story = {
|
|
223
|
+
args: {
|
|
224
|
+
events: simpleAuthFlow.events,
|
|
225
|
+
edges: simpleAuthFlow.edges,
|
|
226
|
+
height: 400,
|
|
227
|
+
layoutOptions: {
|
|
228
|
+
laneWidth: 150,
|
|
229
|
+
laneGap: 30,
|
|
230
|
+
eventSpacing: 50,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Empty state
|
|
237
|
+
*/
|
|
238
|
+
export const EmptyDiagram: Story = {
|
|
239
|
+
args: {
|
|
240
|
+
events: [],
|
|
241
|
+
edges: [],
|
|
242
|
+
height: 300,
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Single event (edge case)
|
|
248
|
+
*/
|
|
249
|
+
export const SingleEvent: Story = {
|
|
250
|
+
args: {
|
|
251
|
+
events: [{ id: '1', name: 'system.startup', label: 'System Startup' }],
|
|
252
|
+
edges: [],
|
|
253
|
+
height: 300,
|
|
254
|
+
},
|
|
255
|
+
};
|