@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,26 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
import {
|
|
3
|
+
isPierreCFamilyPath,
|
|
4
|
+
pierreCodeViewFileName,
|
|
5
|
+
pierreLangForPath,
|
|
6
|
+
} from './pierreFileLang';
|
|
7
|
+
|
|
8
|
+
describe('pierreFileLang', () => {
|
|
9
|
+
test('marks C-family extensions', () => {
|
|
10
|
+
expect(isPierreCFamilyPath('src/main.cpp')).toBe(true);
|
|
11
|
+
expect(isPierreCFamilyPath('src/graph.h')).toBe(true);
|
|
12
|
+
expect(isPierreCFamilyPath('foo.mm')).toBe(true);
|
|
13
|
+
expect(isPierreCFamilyPath('src/main.ts')).toBe(false);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('forces plain text for C-family (WebKit-safe)', () => {
|
|
17
|
+
expect(pierreLangForPath('src/main.cpp')).toBe('text');
|
|
18
|
+
expect(pierreLangForPath('src/ingest_crawl.h')).toBe('text');
|
|
19
|
+
expect(pierreLangForPath('src/foo.ts')).toBeUndefined();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('uniquifies CodeView names while keeping the extension', () => {
|
|
23
|
+
expect(pierreCodeViewFileName('src/main.cpp', 0)).toBe('01-main.cpp');
|
|
24
|
+
expect(pierreCodeViewFileName('src/main.cpp', 6)).toBe('07-main.cpp');
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language overrides for `@pierre/diffs` file rendering.
|
|
3
|
+
*
|
|
4
|
+
* Pierre's default extension map sends `.h` → `objective-cpp`. Loading
|
|
5
|
+
* C-family Shiki grammars (`cpp` / `objective-cpp`) in CodeView has trapped
|
|
6
|
+
* WebKit (`JSString::getIndex` / EXC_BREAKPOINT) — even with unique per-step
|
|
7
|
+
* `file.name`s — so we force plain text for those paths until Pierre/WebKit
|
|
8
|
+
* is safe with them.
|
|
9
|
+
*
|
|
10
|
+
* Distinct throughline slices of the same path still need unique `file.name`s
|
|
11
|
+
* (see `pierreCodeViewFileName`).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const C_FAMILY_EXT = new Set([
|
|
15
|
+
'c',
|
|
16
|
+
'h',
|
|
17
|
+
'cc',
|
|
18
|
+
'cpp',
|
|
19
|
+
'cxx',
|
|
20
|
+
'hpp',
|
|
21
|
+
'hh',
|
|
22
|
+
'mm',
|
|
23
|
+
'm',
|
|
24
|
+
]);
|
|
25
|
+
|
|
26
|
+
function extensionOf(path: string): string {
|
|
27
|
+
const base = path.split(/[/\\]/).pop() ?? path;
|
|
28
|
+
const dot = base.lastIndexOf('.');
|
|
29
|
+
if (dot < 0) return '';
|
|
30
|
+
return base.slice(dot + 1).toLowerCase();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** True when Pierre would (or we would) treat this path as C-family source. */
|
|
34
|
+
export function isPierreCFamilyPath(path: string): boolean {
|
|
35
|
+
return C_FAMILY_EXT.has(extensionOf(path));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Explicit `lang` for a Pierre `FileContents` object.
|
|
40
|
+
*
|
|
41
|
+
* - C-family → `'text'` (WebKit-safe; no cpp/obj-c++ Shiki grammar)
|
|
42
|
+
* - everything else → `undefined` (Pierre infers from the filename)
|
|
43
|
+
*/
|
|
44
|
+
export function pierreLangForPath(path: string): 'text' | undefined {
|
|
45
|
+
return isPierreCFamilyPath(path) ? 'text' : undefined;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Unique CodeView `file.name` that still carries a real extension for
|
|
50
|
+
* inference, so distinct slices of the same path never share a display name.
|
|
51
|
+
*/
|
|
52
|
+
export function pierreCodeViewFileName(path: string, index: number): string {
|
|
53
|
+
const base = path.split(/[/\\]/).pop() ?? path;
|
|
54
|
+
return `${String(index + 1).padStart(2, '0')}-${base}`;
|
|
55
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pierre syntax theme names — aligned with @pierre/diffs DEFAULT_THEMES.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type PierreSyntaxThemeName = 'pierre-dark' | 'pierre-light';
|
|
6
|
+
|
|
7
|
+
export const PIERRE_DEFAULT_SYNTAX_THEMES = {
|
|
8
|
+
dark: 'pierre-dark',
|
|
9
|
+
light: 'pierre-light',
|
|
10
|
+
} as const satisfies Record<'dark' | 'light', PierreSyntaxThemeName>;
|
|
11
|
+
|
|
12
|
+
/** Pick pierre-dark / pierre-light to match Pierre file views and industry-theme mode. */
|
|
13
|
+
export function resolvePierreSyntaxThemeName(mode?: string): PierreSyntaxThemeName {
|
|
14
|
+
if (mode === 'light') return PIERRE_DEFAULT_SYNTAX_THEMES.light;
|
|
15
|
+
if (mode === 'dark') return PIERRE_DEFAULT_SYNTAX_THEMES.dark;
|
|
16
|
+
if (
|
|
17
|
+
typeof window !== 'undefined' &&
|
|
18
|
+
window.matchMedia('(prefers-color-scheme: light)').matches
|
|
19
|
+
) {
|
|
20
|
+
return PIERRE_DEFAULT_SYNTAX_THEMES.light;
|
|
21
|
+
}
|
|
22
|
+
return PIERRE_DEFAULT_SYNTAX_THEMES.dark;
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
import { scrollAnchorLine } from './scrollAnchor';
|
|
3
|
+
|
|
4
|
+
describe('scrollAnchorLine', () => {
|
|
5
|
+
test('first line stays at top', () => {
|
|
6
|
+
expect(scrollAnchorLine(1)).toBe(1);
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
test('focus line keeps a few lines of leading context', () => {
|
|
10
|
+
expect(scrollAnchorLine(10, 4)).toBe(6);
|
|
11
|
+
expect(scrollAnchorLine(3, 4)).toBe(1);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Lines to keep visible above the focus line when scrolling. */
|
|
2
|
+
export const SCROLL_LEADING_LINES = 4;
|
|
3
|
+
|
|
4
|
+
/** 1-based line in the sliced snippet to align near the top of the viewport. */
|
|
5
|
+
export function scrollAnchorLine(
|
|
6
|
+
focusOffset: number,
|
|
7
|
+
leadingLines = SCROLL_LEADING_LINES,
|
|
8
|
+
): number {
|
|
9
|
+
if (focusOffset <= 1) return 1;
|
|
10
|
+
return Math.max(1, focusOffset - leadingLines);
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
import { sliceSnippetWindow } from './sliceSnippet';
|
|
3
|
+
|
|
4
|
+
describe('sliceSnippetWindow', () => {
|
|
5
|
+
const content = ['line1', 'line2', 'line3', 'line4', 'line5'].join('\n');
|
|
6
|
+
|
|
7
|
+
test('slices with context and focus offset', () => {
|
|
8
|
+
const s = sliceSnippetWindow(content, 3, 3, 1, 3);
|
|
9
|
+
expect(s.sliceStart).toBe(2);
|
|
10
|
+
expect(s.sliceEnd).toBe(4);
|
|
11
|
+
expect(s.contents).toBe(['line2', 'line3', 'line4'].join('\n'));
|
|
12
|
+
expect(s.focusOffset).toBe(2);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('clamps out-of-range lines', () => {
|
|
16
|
+
const s = sliceSnippetWindow(content, 99, 99, 0, 99);
|
|
17
|
+
expect(s.sliceStart).toBe(5);
|
|
18
|
+
expect(s.sliceEnd).toBe(5);
|
|
19
|
+
expect(s.focusOffset).toBe(95);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Slice a file's line range with surrounding context for snippet rendering. */
|
|
2
|
+
|
|
3
|
+
export interface SnippetSlice {
|
|
4
|
+
contents: string;
|
|
5
|
+
sliceStart: number;
|
|
6
|
+
sliceEnd: number;
|
|
7
|
+
/** 1-based line index within `contents` to highlight, or null. */
|
|
8
|
+
focusOffset: number | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function sliceSnippetWindow(
|
|
12
|
+
contents: string,
|
|
13
|
+
startLine: number,
|
|
14
|
+
endLine: number,
|
|
15
|
+
contextLines: number,
|
|
16
|
+
focusLine?: number | null,
|
|
17
|
+
): SnippetSlice {
|
|
18
|
+
const allLines = contents.split('\n');
|
|
19
|
+
const total = allLines.length;
|
|
20
|
+
const safeStart = Math.max(1, Math.min(startLine, total));
|
|
21
|
+
const safeEnd = Math.max(safeStart, Math.min(endLine, total));
|
|
22
|
+
const sliceStart = Math.max(1, safeStart - contextLines);
|
|
23
|
+
const sliceEnd = Math.min(total, safeEnd + contextLines);
|
|
24
|
+
return {
|
|
25
|
+
contents: allLines.slice(sliceStart - 1, sliceEnd).join('\n'),
|
|
26
|
+
sliceStart,
|
|
27
|
+
sliceEnd,
|
|
28
|
+
focusOffset:
|
|
29
|
+
focusLine == null ? null : Math.max(1, focusLine - sliceStart + 1),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
import { tokenizeWithPierreSyntax } from './syntaxTokens';
|
|
3
|
+
|
|
4
|
+
describe('tokenizeWithPierreSyntax', () => {
|
|
5
|
+
test('assigns Pierre dark keyword and type colors', async () => {
|
|
6
|
+
const tokens = await tokenizeWithPierreSyntax(
|
|
7
|
+
'export class Foo extends Bar {}',
|
|
8
|
+
'pierre-dark',
|
|
9
|
+
);
|
|
10
|
+
const joined = tokens.filter((t) => t.kind !== 'newline').map((t) => t.text).join('');
|
|
11
|
+
expect(joined).toBe('export class Foo extends Bar {}');
|
|
12
|
+
|
|
13
|
+
const exportTok = tokens.find((t) => t.text === 'export');
|
|
14
|
+
const classTok = tokens.find((t) => t.text === 'class');
|
|
15
|
+
const fooTok = tokens.find((t) => t.text === 'Foo');
|
|
16
|
+
const barTok = tokens.find((t) => t.text === 'Bar');
|
|
17
|
+
|
|
18
|
+
expect(exportTok?.color).toBe('#ff678d');
|
|
19
|
+
expect(classTok?.color).toBe('#d568ea');
|
|
20
|
+
expect(fooTok?.color).toBe('#d568ea');
|
|
21
|
+
expect(barTok?.color).toBe('#d568ea');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('light theme resolves different palette than dark', async () => {
|
|
25
|
+
const [dark, light] = await Promise.all([
|
|
26
|
+
tokenizeWithPierreSyntax('const x = 1', 'pierre-dark'),
|
|
27
|
+
tokenizeWithPierreSyntax('const x = 1', 'pierre-light'),
|
|
28
|
+
]);
|
|
29
|
+
const darkConst = dark.find((t) => t.text === 'const');
|
|
30
|
+
const lightConst = light.find((t) => t.text === 'const');
|
|
31
|
+
expect(darkConst?.color).toBeTruthy();
|
|
32
|
+
expect(lightConst?.color).toBeTruthy();
|
|
33
|
+
expect(darkConst?.color).not.toBe(lightConst?.color);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tokenize TypeScript with Shiki + Pierre themes — same stack as @pierre/diffs.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { createHighlighter, type Highlighter, type ThemeInput } from 'shiki';
|
|
6
|
+
import pierreDark from '@pierre/theme/pierre-dark';
|
|
7
|
+
import pierreLight from '@pierre/theme/pierre-light';
|
|
8
|
+
import type { SubsystemDeclToken } from '../subsystem/model';
|
|
9
|
+
import type { PierreSyntaxThemeName } from './pierreSyntaxTheme';
|
|
10
|
+
|
|
11
|
+
let highlighterPromise: Promise<Highlighter> | null = null;
|
|
12
|
+
|
|
13
|
+
async function getPierreHighlighter(): Promise<Highlighter> {
|
|
14
|
+
if (!highlighterPromise) {
|
|
15
|
+
highlighterPromise = createHighlighter({
|
|
16
|
+
themes: [
|
|
17
|
+
pierreDark as unknown as ThemeInput,
|
|
18
|
+
pierreLight as unknown as ThemeInput,
|
|
19
|
+
],
|
|
20
|
+
langs: ['typescript'],
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return highlighterPromise;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function normalizeColor(color?: string): string | undefined {
|
|
27
|
+
return color?.toLowerCase();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Tokenize formatted TypeScript using Pierre's Shiki themes.
|
|
32
|
+
* Each token carries the resolved foreground color Pierre would render.
|
|
33
|
+
*/
|
|
34
|
+
export async function tokenizeWithPierreSyntax(
|
|
35
|
+
code: string,
|
|
36
|
+
themeName: PierreSyntaxThemeName,
|
|
37
|
+
): Promise<SubsystemDeclToken[]> {
|
|
38
|
+
const highlighter = await getPierreHighlighter();
|
|
39
|
+
const { tokens } = highlighter.codeToTokens(code, {
|
|
40
|
+
lang: 'typescript',
|
|
41
|
+
theme: themeName,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const result: SubsystemDeclToken[] = [];
|
|
45
|
+
for (let lineIndex = 0; lineIndex < tokens.length; lineIndex++) {
|
|
46
|
+
const line = tokens[lineIndex];
|
|
47
|
+
for (const token of line) {
|
|
48
|
+
if (!token.content) continue;
|
|
49
|
+
result.push({
|
|
50
|
+
text: token.content,
|
|
51
|
+
kind: 'punctuation',
|
|
52
|
+
color: normalizeColor(token.color),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (lineIndex < tokens.length - 1) {
|
|
56
|
+
result.push({ text: '', kind: 'newline' });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
|
+
import type { ExtendedCanvas } from '@principal-ai/subsystems-core';
|
|
5
|
+
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Audit/BoundaryNodes',
|
|
9
|
+
component: GraphRenderer,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'centered',
|
|
12
|
+
},
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
decorators: [
|
|
15
|
+
(Story) => (
|
|
16
|
+
<ThemeProvider theme={defaultEditorTheme}>
|
|
17
|
+
<Story />
|
|
18
|
+
</ThemeProvider>
|
|
19
|
+
),
|
|
20
|
+
],
|
|
21
|
+
} satisfies Meta<typeof GraphRenderer>;
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof meta>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Canvas showing boundary node visual treatment
|
|
28
|
+
*/
|
|
29
|
+
const boundaryNodesCanvas: ExtendedCanvas = {
|
|
30
|
+
nodes: [
|
|
31
|
+
// Regular node for comparison
|
|
32
|
+
{
|
|
33
|
+
id: 'regular-node',
|
|
34
|
+
type: 'text',
|
|
35
|
+
x: 100,
|
|
36
|
+
y: 100,
|
|
37
|
+
width: 160,
|
|
38
|
+
height: 80,
|
|
39
|
+
text: '# Regular Node\nSharp corners',
|
|
40
|
+
color: 6, // purple
|
|
41
|
+
pv: {
|
|
42
|
+
nodeType: 'event',
|
|
43
|
+
name: 'Regular Node',
|
|
44
|
+
description: 'A standard event node with sharp corners',
|
|
45
|
+
sources: ['src/events/regular.ts'],
|
|
46
|
+
event: {
|
|
47
|
+
name: 'app.regular-event',
|
|
48
|
+
description: 'Regular event',
|
|
49
|
+
attributes: {},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
// Outbound boundary node
|
|
54
|
+
{
|
|
55
|
+
id: 'outbound-boundary',
|
|
56
|
+
type: 'text',
|
|
57
|
+
x: 350,
|
|
58
|
+
y: 100,
|
|
59
|
+
width: 180,
|
|
60
|
+
height: 80,
|
|
61
|
+
text: '# Host Callback\nPersists layout',
|
|
62
|
+
color: 5, // cyan
|
|
63
|
+
pv: {
|
|
64
|
+
nodeType: 'boundary',
|
|
65
|
+
name: 'onBatchLayoutInitialized',
|
|
66
|
+
description: 'Calls host to persist batch layout data',
|
|
67
|
+
boundary: {
|
|
68
|
+
direction: 'outbound',
|
|
69
|
+
node: {
|
|
70
|
+
'pv.event.name': 'host.batch-layout-initialized',
|
|
71
|
+
'pv.event.namespace': 'collection-host',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
// Inbound boundary node
|
|
77
|
+
{
|
|
78
|
+
id: 'inbound-boundary',
|
|
79
|
+
type: 'text',
|
|
80
|
+
x: 620,
|
|
81
|
+
y: 100,
|
|
82
|
+
width: 180,
|
|
83
|
+
height: 80,
|
|
84
|
+
text: '# Webhook\nRepository created',
|
|
85
|
+
color: 5, // cyan
|
|
86
|
+
pv: {
|
|
87
|
+
nodeType: 'boundary',
|
|
88
|
+
name: 'onRepositoryCreated',
|
|
89
|
+
description: 'Called by GitHub when a repository is created',
|
|
90
|
+
boundary: {
|
|
91
|
+
direction: 'inbound',
|
|
92
|
+
node: {
|
|
93
|
+
'pv.event.name': 'webhook.repository-created',
|
|
94
|
+
'pv.event.namespace': 'github',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
edges: [],
|
|
101
|
+
pv: {
|
|
102
|
+
version: '1.0.0',
|
|
103
|
+
name: 'Boundary Nodes Demo',
|
|
104
|
+
description: 'Demonstrates boundary node visual treatment',
|
|
105
|
+
edgeTypes: {},
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const BoundaryVsRegular: Story = {
|
|
110
|
+
args: {
|
|
111
|
+
canvas: boundaryNodesCanvas,
|
|
112
|
+
width: 900,
|
|
113
|
+
height: 300,
|
|
114
|
+
},
|
|
115
|
+
parameters: {
|
|
116
|
+
docs: {
|
|
117
|
+
description: {
|
|
118
|
+
story: `
|
|
119
|
+
**Boundary Node Visual Treatment**
|
|
120
|
+
|
|
121
|
+
Boundary nodes represent interaction points where control crosses system edges.
|
|
122
|
+
They have distinct visual treatment:
|
|
123
|
+
|
|
124
|
+
- **Rounded corners** (8px border-radius) to visually distinguish from regular nodes
|
|
125
|
+
- **Direction badge** in top-right corner:
|
|
126
|
+
- ↗ (arrow up-right) for **outbound** boundaries - this system calls external
|
|
127
|
+
- ↙ (arrow down-left) for **inbound** boundaries - external calls this system
|
|
128
|
+
- **Cyan badge color** (#06b6d4) to match boundary theme
|
|
129
|
+
- **No sources badge** since boundary nodes don't have local source files
|
|
130
|
+
|
|
131
|
+
Compare with the regular node on the left which has:
|
|
132
|
+
- Sharp corners (0 border-radius)
|
|
133
|
+
- Green "S" sources badge (when sources are defined)
|
|
134
|
+
`,
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Canvas showing boundary nodes in a workflow context
|
|
142
|
+
*/
|
|
143
|
+
const workflowWithBoundariesCanvas: ExtendedCanvas = {
|
|
144
|
+
nodes: [
|
|
145
|
+
// Internal event
|
|
146
|
+
{
|
|
147
|
+
id: 'batch-save',
|
|
148
|
+
type: 'text',
|
|
149
|
+
x: 100,
|
|
150
|
+
y: 150,
|
|
151
|
+
width: 160,
|
|
152
|
+
height: 70,
|
|
153
|
+
text: '# Batch Save\nSaves regions',
|
|
154
|
+
color: 4, // green
|
|
155
|
+
pv: {
|
|
156
|
+
nodeType: 'event',
|
|
157
|
+
name: 'batch-save',
|
|
158
|
+
event: {
|
|
159
|
+
name: 'collection-map.batch-save',
|
|
160
|
+
description: 'Saved regions to local state',
|
|
161
|
+
attributes: {},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
// Outbound to host
|
|
166
|
+
{
|
|
167
|
+
id: 'host-persist',
|
|
168
|
+
type: 'text',
|
|
169
|
+
x: 350,
|
|
170
|
+
y: 150,
|
|
171
|
+
width: 180,
|
|
172
|
+
height: 70,
|
|
173
|
+
text: '# Host: Persist\nSaves to backend',
|
|
174
|
+
color: 5, // cyan
|
|
175
|
+
pv: {
|
|
176
|
+
nodeType: 'boundary',
|
|
177
|
+
name: 'onBatchLayoutInitialized',
|
|
178
|
+
boundary: {
|
|
179
|
+
direction: 'outbound',
|
|
180
|
+
node: {
|
|
181
|
+
'pv.event.name': 'host.batch-layout-initialized',
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
// Another internal event
|
|
187
|
+
{
|
|
188
|
+
id: 'layout-complete',
|
|
189
|
+
type: 'text',
|
|
190
|
+
x: 620,
|
|
191
|
+
y: 150,
|
|
192
|
+
width: 160,
|
|
193
|
+
height: 70,
|
|
194
|
+
text: '# Layout Complete\nUI updated',
|
|
195
|
+
color: 4, // green
|
|
196
|
+
pv: {
|
|
197
|
+
nodeType: 'event',
|
|
198
|
+
name: 'layout-complete',
|
|
199
|
+
event: {
|
|
200
|
+
name: 'collection-map.layout-complete',
|
|
201
|
+
description: 'Layout computation finished',
|
|
202
|
+
attributes: {},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
edges: [
|
|
208
|
+
{
|
|
209
|
+
id: 'e1',
|
|
210
|
+
fromNode: 'batch-save',
|
|
211
|
+
toNode: 'host-persist',
|
|
212
|
+
fromSide: 'right',
|
|
213
|
+
toSide: 'left',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: 'e2',
|
|
217
|
+
fromNode: 'host-persist',
|
|
218
|
+
toNode: 'layout-complete',
|
|
219
|
+
fromSide: 'right',
|
|
220
|
+
toSide: 'left',
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
pv: {
|
|
224
|
+
version: '1.0.0',
|
|
225
|
+
name: 'Workflow with Boundaries',
|
|
226
|
+
description: 'Shows boundary nodes in workflow context',
|
|
227
|
+
edgeTypes: {
|
|
228
|
+
default: {
|
|
229
|
+
style: 'solid',
|
|
230
|
+
color: '#888',
|
|
231
|
+
directed: true,
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
export const WorkflowContext: Story = {
|
|
238
|
+
args: {
|
|
239
|
+
canvas: workflowWithBoundariesCanvas,
|
|
240
|
+
width: 900,
|
|
241
|
+
height: 350,
|
|
242
|
+
},
|
|
243
|
+
parameters: {
|
|
244
|
+
docs: {
|
|
245
|
+
description: {
|
|
246
|
+
story: `
|
|
247
|
+
**Boundary Nodes in Workflow Context**
|
|
248
|
+
|
|
249
|
+
This shows how boundary nodes appear in a typical workflow:
|
|
250
|
+
|
|
251
|
+
1. **Internal Event** (green, sharp corners) - Code we own and instrument
|
|
252
|
+
2. **Boundary Node** (cyan, rounded corners) - Calls external system
|
|
253
|
+
3. **Internal Event** (green, sharp corners) - Continues after external call
|
|
254
|
+
|
|
255
|
+
The boundary node visually breaks the flow to indicate control leaving the system.
|
|
256
|
+
The ↗ badge indicates this is an outbound call (we call them, they don't call us).
|
|
257
|
+
`,
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Canvas showing different boundary directions
|
|
265
|
+
*/
|
|
266
|
+
const boundaryDirectionsCanvas: ExtendedCanvas = {
|
|
267
|
+
nodes: [
|
|
268
|
+
// Outbound examples
|
|
269
|
+
{
|
|
270
|
+
id: 'outbound-1',
|
|
271
|
+
type: 'text',
|
|
272
|
+
x: 100,
|
|
273
|
+
y: 100,
|
|
274
|
+
width: 180,
|
|
275
|
+
height: 70,
|
|
276
|
+
text: '# Host Callback\nonBatchLayout',
|
|
277
|
+
color: 5,
|
|
278
|
+
pv: {
|
|
279
|
+
nodeType: 'boundary',
|
|
280
|
+
name: 'onBatchLayout',
|
|
281
|
+
boundary: {
|
|
282
|
+
direction: 'outbound',
|
|
283
|
+
node: { 'pv.event.name': 'host.batch-layout' },
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
id: 'outbound-2',
|
|
289
|
+
type: 'text',
|
|
290
|
+
x: 350,
|
|
291
|
+
y: 100,
|
|
292
|
+
width: 180,
|
|
293
|
+
height: 70,
|
|
294
|
+
text: '# API Call\nPOST /payments',
|
|
295
|
+
color: 5,
|
|
296
|
+
pv: {
|
|
297
|
+
nodeType: 'boundary',
|
|
298
|
+
name: 'createPayment',
|
|
299
|
+
boundary: {
|
|
300
|
+
direction: 'outbound',
|
|
301
|
+
node: { 'pv.event.name': 'stripe.payment-created' },
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
// Inbound examples
|
|
306
|
+
{
|
|
307
|
+
id: 'inbound-1',
|
|
308
|
+
type: 'text',
|
|
309
|
+
x: 100,
|
|
310
|
+
y: 250,
|
|
311
|
+
width: 180,
|
|
312
|
+
height: 70,
|
|
313
|
+
text: '# Webhook\nrepo.created',
|
|
314
|
+
color: 5,
|
|
315
|
+
pv: {
|
|
316
|
+
nodeType: 'boundary',
|
|
317
|
+
name: 'onRepoCreated',
|
|
318
|
+
boundary: {
|
|
319
|
+
direction: 'inbound',
|
|
320
|
+
node: { 'pv.event.name': 'github.repo-created' },
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
id: 'inbound-2',
|
|
326
|
+
type: 'text',
|
|
327
|
+
x: 350,
|
|
328
|
+
y: 250,
|
|
329
|
+
width: 180,
|
|
330
|
+
height: 70,
|
|
331
|
+
text: '# Message\norder.placed',
|
|
332
|
+
color: 5,
|
|
333
|
+
pv: {
|
|
334
|
+
nodeType: 'boundary',
|
|
335
|
+
name: 'onOrderPlaced',
|
|
336
|
+
boundary: {
|
|
337
|
+
direction: 'inbound',
|
|
338
|
+
node: { 'pv.event.name': 'queue.order-placed' },
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
],
|
|
343
|
+
edges: [],
|
|
344
|
+
pv: {
|
|
345
|
+
version: '1.0.0',
|
|
346
|
+
name: 'Boundary Directions',
|
|
347
|
+
description: 'Outbound vs Inbound boundary nodes',
|
|
348
|
+
edgeTypes: {},
|
|
349
|
+
nodeTypes: {
|
|
350
|
+
boundary: {
|
|
351
|
+
description: 'External system boundary',
|
|
352
|
+
color: '#06b6d4',
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
export const DirectionComparison: Story = {
|
|
359
|
+
args: {
|
|
360
|
+
canvas: boundaryDirectionsCanvas,
|
|
361
|
+
width: 650,
|
|
362
|
+
height: 400,
|
|
363
|
+
},
|
|
364
|
+
parameters: {
|
|
365
|
+
docs: {
|
|
366
|
+
description: {
|
|
367
|
+
story: `
|
|
368
|
+
**Outbound vs Inbound Boundaries**
|
|
369
|
+
|
|
370
|
+
**Top row - Outbound (↗)**
|
|
371
|
+
- Host callbacks we invoke
|
|
372
|
+
- API calls we make
|
|
373
|
+
- Messages we publish
|
|
374
|
+
|
|
375
|
+
**Bottom row - Inbound (↙)**
|
|
376
|
+
- Webhooks that call us
|
|
377
|
+
- Queue messages we consume
|
|
378
|
+
- Events we subscribe to
|
|
379
|
+
|
|
380
|
+
The direction badge makes it immediately clear which way control flows across the boundary.
|
|
381
|
+
`,
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
};
|