@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 @@
|
|
|
1
|
+
{"version":3,"file":"PierreThroughlineCodeView.d.ts","sourceRoot":"","sources":["../../src/pierre/PierreThroughlineCodeView.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;AAoBH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAS/D,MAAM,WAAW,8BAA8B;IAC7C,WAAW,EAAE,oBAAoB,CAAC;IAClC,2EAA2E;IAC3E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAWD,wBAAgB,yBAAyB,CAAC,EACxC,WAAW,EACX,SAAS,EACT,QAAQ,EACR,YAAgB,EAChB,UAAU,GACX,EAAE,8BAA8B,+BAiPhC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* PierreThroughlineCodeView — multi-file step snippets via `@pierre/diffs` CodeView.
|
|
4
|
+
*
|
|
5
|
+
* Renders one sliced window per throughline step in a single virtualized
|
|
6
|
+
* scroll; when `stepIndex` changes, scrolls that step's site line into view
|
|
7
|
+
* and highlights it via CodeView `selectedLines` (same mechanism as
|
|
8
|
+
* `PierreSnippetView`).
|
|
9
|
+
*/
|
|
10
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
11
|
+
import { CodeView, } from '@pierre/diffs/react';
|
|
12
|
+
import { useTheme } from '@principal-ade/industry-theme';
|
|
13
|
+
import { buildPierreOptions, PIERRE_FILE_STYLE } from './pierreBackground';
|
|
14
|
+
import { pierreCodeViewFileName, pierreLangForPath, } from './pierreFileLang';
|
|
15
|
+
import { resolvePierreSyntaxThemeName } from './pierreSyntaxTheme';
|
|
16
|
+
import { sliceSnippetWindow } from './sliceSnippet';
|
|
17
|
+
function stepItemId(throughlineId, index) {
|
|
18
|
+
return `${throughlineId}:${index}`;
|
|
19
|
+
}
|
|
20
|
+
export function PierreThroughlineCodeView({ throughline, stepIndex, readFile, contextLines = 8, background, }) {
|
|
21
|
+
const { theme, mode } = useTheme();
|
|
22
|
+
const viewRef = useRef(null);
|
|
23
|
+
const [load, setLoad] = useState({ status: 'loading' });
|
|
24
|
+
const pathsKey = useMemo(() => {
|
|
25
|
+
const paths = [...new Set(throughline.steps.map((s) => s.file))];
|
|
26
|
+
paths.sort();
|
|
27
|
+
return paths.join('\0');
|
|
28
|
+
}, [throughline.steps]);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
let cancelled = false;
|
|
31
|
+
setLoad({ status: 'loading' });
|
|
32
|
+
const paths = [...new Set(throughline.steps.map((s) => s.file))];
|
|
33
|
+
void Promise.all(paths.map(async (path) => {
|
|
34
|
+
const contents = await readFile(path);
|
|
35
|
+
return [path, contents];
|
|
36
|
+
}))
|
|
37
|
+
.then((entries) => {
|
|
38
|
+
if (cancelled)
|
|
39
|
+
return;
|
|
40
|
+
setLoad({ status: 'ready', byPath: new Map(entries) });
|
|
41
|
+
})
|
|
42
|
+
.catch((err) => {
|
|
43
|
+
if (cancelled)
|
|
44
|
+
return;
|
|
45
|
+
setLoad({
|
|
46
|
+
status: 'error',
|
|
47
|
+
message: err instanceof Error ? err.message : 'Failed to read files',
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
return () => {
|
|
51
|
+
cancelled = true;
|
|
52
|
+
};
|
|
53
|
+
}, [throughline.id, pathsKey, readFile]);
|
|
54
|
+
const slices = useMemo(() => {
|
|
55
|
+
if (load.status !== 'ready')
|
|
56
|
+
return [];
|
|
57
|
+
return throughline.steps.map((step) => {
|
|
58
|
+
const contents = load.byPath.get(step.file) ?? '';
|
|
59
|
+
return sliceSnippetWindow(contents, step.line, step.line, contextLines, step.line);
|
|
60
|
+
});
|
|
61
|
+
}, [load, throughline.steps, contextLines]);
|
|
62
|
+
const items = useMemo(() => {
|
|
63
|
+
if (load.status !== 'ready' || slices.length === 0)
|
|
64
|
+
return [];
|
|
65
|
+
return throughline.steps.map((step, index) => {
|
|
66
|
+
const slice = slices[index];
|
|
67
|
+
const focus = slice.focusOffset;
|
|
68
|
+
const annotations = step.annotation != null && step.annotation.length > 0 && focus != null
|
|
69
|
+
? [
|
|
70
|
+
{
|
|
71
|
+
lineNumber: focus,
|
|
72
|
+
metadata: { text: step.annotation },
|
|
73
|
+
},
|
|
74
|
+
]
|
|
75
|
+
: undefined;
|
|
76
|
+
return {
|
|
77
|
+
id: stepItemId(throughline.id, index),
|
|
78
|
+
type: 'file',
|
|
79
|
+
version: 1,
|
|
80
|
+
annotations,
|
|
81
|
+
file: {
|
|
82
|
+
// Unique per-step name: many throughline steps share one path
|
|
83
|
+
// (e.g. seven sites in main.cpp), and identical `name`s have
|
|
84
|
+
// correlated with WebKit renderer traps in CodeView.
|
|
85
|
+
name: pierreCodeViewFileName(step.file, index),
|
|
86
|
+
contents: slice.contents,
|
|
87
|
+
// C-family → plain text: cpp Shiki still traps WebKit even with
|
|
88
|
+
// unique names (reproduced on 0.16.67).
|
|
89
|
+
lang: pierreLangForPath(step.file),
|
|
90
|
+
cacheKey: `${throughline.id}:${index}:${step.file}:${step.line}:${slice.sliceStart}-${slice.sliceEnd}`,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
}, [load, slices, throughline.id, throughline.steps]);
|
|
95
|
+
/** Highlight the focused step's site line (1-based within its sliced window). */
|
|
96
|
+
const selectedLines = useMemo(() => {
|
|
97
|
+
if (stepIndex == null || stepIndex < 0 || stepIndex >= slices.length) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
const focus = slices[stepIndex]?.focusOffset;
|
|
101
|
+
if (focus == null)
|
|
102
|
+
return null;
|
|
103
|
+
return {
|
|
104
|
+
id: stepItemId(throughline.id, stepIndex),
|
|
105
|
+
range: { start: focus, end: focus },
|
|
106
|
+
};
|
|
107
|
+
}, [stepIndex, slices, throughline.id]);
|
|
108
|
+
const renderHeaderPrefix = useMemo(() => {
|
|
109
|
+
return (item) => {
|
|
110
|
+
const index = Number.parseInt(item.id.split(':').pop() ?? '', 10);
|
|
111
|
+
const step = throughline.steps[index];
|
|
112
|
+
if (!step)
|
|
113
|
+
return null;
|
|
114
|
+
const label = step.symbol != null && step.symbol.length > 0
|
|
115
|
+
? step.symbol
|
|
116
|
+
: `step ${index + 1}`;
|
|
117
|
+
return (_jsxs("span", { style: {
|
|
118
|
+
fontFamily: theme.fonts.monospace,
|
|
119
|
+
fontSize: theme.fontSizes[0],
|
|
120
|
+
color: theme.colors.textSecondary,
|
|
121
|
+
marginRight: 8,
|
|
122
|
+
}, children: [index + 1, ". ", label] }));
|
|
123
|
+
};
|
|
124
|
+
}, [throughline.steps, theme]);
|
|
125
|
+
const renderHeaderMetadata = useMemo(() => {
|
|
126
|
+
return (item) => {
|
|
127
|
+
const index = Number.parseInt(item.id.split(':').pop() ?? '', 10);
|
|
128
|
+
const step = throughline.steps[index];
|
|
129
|
+
if (!step)
|
|
130
|
+
return null;
|
|
131
|
+
return (_jsxs("span", { style: {
|
|
132
|
+
fontFamily: theme.fonts.monospace,
|
|
133
|
+
fontSize: theme.fontSizes[0],
|
|
134
|
+
color: theme.colors.textSecondary,
|
|
135
|
+
marginLeft: 8,
|
|
136
|
+
}, children: ["L", step.line] }));
|
|
137
|
+
};
|
|
138
|
+
}, [throughline.steps, theme]);
|
|
139
|
+
const renderAnnotation = useMemo(() => {
|
|
140
|
+
return (annotation, item) => {
|
|
141
|
+
const index = Number.parseInt(item.id.split(':').pop() ?? '', 10);
|
|
142
|
+
const step = throughline.steps[index];
|
|
143
|
+
const text = annotation.metadata?.text;
|
|
144
|
+
if (!text || !step)
|
|
145
|
+
return null;
|
|
146
|
+
return (_jsx("span", { style: {
|
|
147
|
+
display: 'inline-block',
|
|
148
|
+
fontFamily: theme.fonts.monospace,
|
|
149
|
+
fontSize: theme.fontSizes[0],
|
|
150
|
+
color: theme.colors.textSecondary,
|
|
151
|
+
fontStyle: 'italic',
|
|
152
|
+
opacity: 0.9,
|
|
153
|
+
}, children: text }));
|
|
154
|
+
};
|
|
155
|
+
}, [throughline.steps, theme]);
|
|
156
|
+
const options = useMemo(() => {
|
|
157
|
+
return {
|
|
158
|
+
theme: {
|
|
159
|
+
dark: resolvePierreSyntaxThemeName('dark'),
|
|
160
|
+
light: resolvePierreSyntaxThemeName('light'),
|
|
161
|
+
},
|
|
162
|
+
stickyHeaders: true,
|
|
163
|
+
disableFileHeader: false,
|
|
164
|
+
layout: { paddingTop: 8, paddingBottom: 16, gap: 12 },
|
|
165
|
+
...(background ? buildPierreOptions(background) : {}),
|
|
166
|
+
...(mode === 'light' || mode === 'dark' ? { themeType: mode } : {}),
|
|
167
|
+
};
|
|
168
|
+
}, [background, mode]);
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
if (load.status !== 'ready' || stepIndex == null)
|
|
171
|
+
return;
|
|
172
|
+
if (stepIndex < 0 || stepIndex >= throughline.steps.length)
|
|
173
|
+
return;
|
|
174
|
+
const focus = slices[stepIndex]?.focusOffset;
|
|
175
|
+
if (focus == null)
|
|
176
|
+
return;
|
|
177
|
+
// Defer until CodeView has laid out items.
|
|
178
|
+
const id = stepItemId(throughline.id, stepIndex);
|
|
179
|
+
const t = window.setTimeout(() => {
|
|
180
|
+
viewRef.current?.scrollTo({
|
|
181
|
+
type: 'line',
|
|
182
|
+
id,
|
|
183
|
+
lineNumber: focus,
|
|
184
|
+
align: 'center',
|
|
185
|
+
});
|
|
186
|
+
}, 50);
|
|
187
|
+
return () => window.clearTimeout(t);
|
|
188
|
+
}, [
|
|
189
|
+
load.status,
|
|
190
|
+
stepIndex,
|
|
191
|
+
throughline.id,
|
|
192
|
+
throughline.steps.length,
|
|
193
|
+
slices,
|
|
194
|
+
items.length,
|
|
195
|
+
]);
|
|
196
|
+
if (load.status === 'error') {
|
|
197
|
+
return (_jsx("div", { style: { padding: 16, color: theme.colors.error ?? '#e5534b' }, children: load.message }));
|
|
198
|
+
}
|
|
199
|
+
if (load.status === 'loading' || items.length === 0) {
|
|
200
|
+
return (_jsx("div", { style: { padding: 16, color: theme.colors.textSecondary }, children: "Loading\u2026" }));
|
|
201
|
+
}
|
|
202
|
+
// Pierre's CodeView prop / item unions blow past TS's complexity limit.
|
|
203
|
+
const CodeViewLoose = CodeView;
|
|
204
|
+
return (_jsx(CodeViewLoose, { ref: viewRef, items: items, options: options, selectedLines: selectedLines, renderHeaderPrefix: renderHeaderPrefix, renderHeaderMetadata: renderHeaderMetadata, renderAnnotation: renderAnnotation, style: { ...PIERRE_FILE_STYLE, height: '100%', overflow: 'auto' } }));
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=PierreThroughlineCode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of truth for node coloring: the same palette the declaration
|
|
5
|
+
* panel and Pierre file views render with. The themes are static JSON objects
|
|
6
|
+
* (VS Code/Shiki `tokenColors` scope rules), so extraction is a synchronous
|
|
7
|
+
* scope lookup — no Shiki call, no React context. Dark/light (and any future
|
|
8
|
+
* variant) resolves by mode at render time.
|
|
9
|
+
*
|
|
10
|
+
* Syntax themes deliberately reuse one hue across related scopes (class and
|
|
11
|
+
* type share `entity.name.class`); the node taxonomy needs distinguishable
|
|
12
|
+
* colors, so colliding constructs take a shade of the scope color — derived
|
|
13
|
+
* from the theme itself, toward white in dark themes and toward black in
|
|
14
|
+
* light themes.
|
|
15
|
+
*/
|
|
16
|
+
import type { SubsystemComponentConstruct } from '../subsystem/model';
|
|
17
|
+
import type { PierreSyntaxThemeName } from './pierreSyntaxTheme';
|
|
18
|
+
export declare function constructColorsFromPierreTheme(themeName: PierreSyntaxThemeName): Record<SubsystemComponentConstruct, string>;
|
|
19
|
+
/**
|
|
20
|
+
* The dark-theme instantiation, for consumers without a mode context (the
|
|
21
|
+
* bun-side excalidraw exporter). React components derive per mode instead.
|
|
22
|
+
*/
|
|
23
|
+
export declare const CONSTRUCT_COLOR: Record<SubsystemComponentConstruct, string>;
|
|
24
|
+
//# sourceMappingURL=constructColors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constructColors.d.ts","sourceRoot":"","sources":["../../src/pierre/constructColors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AA+CjE,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,qBAAqB,GAC/B,MAAM,CAAC,2BAA2B,EAAE,MAAM,CAAC,CA8B7C;AAUD;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,2BAA2B,EAAE,MAAM,CACzB,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Construct colors derived from the Pierre syntax themes.
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for node coloring: the same palette the declaration
|
|
5
|
+
* panel and Pierre file views render with. The themes are static JSON objects
|
|
6
|
+
* (VS Code/Shiki `tokenColors` scope rules), so extraction is a synchronous
|
|
7
|
+
* scope lookup — no Shiki call, no React context. Dark/light (and any future
|
|
8
|
+
* variant) resolves by mode at render time.
|
|
9
|
+
*
|
|
10
|
+
* Syntax themes deliberately reuse one hue across related scopes (class and
|
|
11
|
+
* type share `entity.name.class`); the node taxonomy needs distinguishable
|
|
12
|
+
* colors, so colliding constructs take a shade of the scope color — derived
|
|
13
|
+
* from the theme itself, toward white in dark themes and toward black in
|
|
14
|
+
* light themes.
|
|
15
|
+
*/
|
|
16
|
+
import pierreDark from '@pierre/theme/pierre-dark';
|
|
17
|
+
import pierreLight from '@pierre/theme/pierre-light';
|
|
18
|
+
const THEMES = {
|
|
19
|
+
'pierre-dark': pierreDark,
|
|
20
|
+
'pierre-light': pierreLight,
|
|
21
|
+
};
|
|
22
|
+
/** First rule whose scope list contains the exact scope. */
|
|
23
|
+
function scopeColor(theme, scope) {
|
|
24
|
+
for (const rule of theme.tokenColors) {
|
|
25
|
+
const scopes = Array.isArray(rule.scope) ? rule.scope : [rule.scope];
|
|
26
|
+
if (scopes.includes(scope))
|
|
27
|
+
return rule.settings.foreground;
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
function hexToRgb(hex) {
|
|
32
|
+
const h = hex.replace('#', '');
|
|
33
|
+
const full = h.length === 3 ? h.split('').map((c) => c + c).join('') : h;
|
|
34
|
+
const n = parseInt(full.slice(0, 6), 16);
|
|
35
|
+
return [(n >> 16) & 255, (n >> 8) & 255, n & 255];
|
|
36
|
+
}
|
|
37
|
+
function rgbToHex([r, g, b]) {
|
|
38
|
+
const to = (v) => Math.max(0, Math.min(255, Math.round(v))).toString(16).padStart(2, '0');
|
|
39
|
+
return `#${to(r)}${to(g)}${to(b)}`;
|
|
40
|
+
}
|
|
41
|
+
/** Linear blend of two hex colors; amount 0 = base, 1 = other. */
|
|
42
|
+
function mix(hex, other, amount) {
|
|
43
|
+
const base = hexToRgb(hex);
|
|
44
|
+
const target = hexToRgb(other);
|
|
45
|
+
return rgbToHex([
|
|
46
|
+
base[0] + (target[0] - base[0]) * amount,
|
|
47
|
+
base[1] + (target[1] - base[1]) * amount,
|
|
48
|
+
base[2] + (target[2] - base[2]) * amount,
|
|
49
|
+
]);
|
|
50
|
+
}
|
|
51
|
+
export function constructColorsFromPierreTheme(themeName) {
|
|
52
|
+
const theme = THEMES[themeName];
|
|
53
|
+
// A scope the theme doesn't declare resolves to the theme's own foreground —
|
|
54
|
+
// still all-Pierre, never a hand-picked value.
|
|
55
|
+
const editorFg = theme.colors['editor.foreground'] ?? '#fafafa';
|
|
56
|
+
const pick = (scope) => scopeColor(theme, scope) ?? editorFg;
|
|
57
|
+
const towardBackground = theme.type === 'dark' ? lighten : darken;
|
|
58
|
+
const classColor = pick('entity.name.class');
|
|
59
|
+
const functionColor = pick('entity.name.function');
|
|
60
|
+
const typeColor = pick('support.type');
|
|
61
|
+
const moduleColor = pick('entity.name.namespace');
|
|
62
|
+
return {
|
|
63
|
+
class: classColor,
|
|
64
|
+
// interface/type are the type-name scope, shaded to separate them from
|
|
65
|
+
// class (whose declaration name shares the same hue in syntax themes)
|
|
66
|
+
interface: towardBackground(typeColor, 0.14),
|
|
67
|
+
type_alias: towardBackground(typeColor, 0.28),
|
|
68
|
+
function: functionColor,
|
|
69
|
+
method: towardBackground(functionColor, 0.14),
|
|
70
|
+
// enum members are constants — the generic constant hue
|
|
71
|
+
enum: pick('constant'),
|
|
72
|
+
// module and store share the constant hue — the module holds the store,
|
|
73
|
+
// and the store IS the retained value, so the store keeps the pure
|
|
74
|
+
// `variable.other.constant` color and the module takes the shade
|
|
75
|
+
module: towardBackground(moduleColor, 0.18),
|
|
76
|
+
store: pick('variable.other.constant'),
|
|
77
|
+
external: pick('comment'),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function lighten(hex, amount) {
|
|
81
|
+
return mix(hex, '#ffffff', amount);
|
|
82
|
+
}
|
|
83
|
+
function darken(hex, amount) {
|
|
84
|
+
return mix(hex, '#000000', amount);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The dark-theme instantiation, for consumers without a mode context (the
|
|
88
|
+
* bun-side excalidraw exporter). React components derive per mode instead.
|
|
89
|
+
*/
|
|
90
|
+
export const CONSTRUCT_COLOR = constructColorsFromPierreTheme('pierre-dark');
|
|
91
|
+
//# sourceMappingURL=constructColors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constructColors.js","sourceRoot":"","sources":["../../src/pierre/constructColors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAQrD,MAAM,MAAM,GAAoD;IAC9D,aAAa,EAAE,UAAyC;IACxD,cAAc,EAAE,WAA0C;CAC3D,CAAC;AAEF,4DAA4D;AAC5D,SAAS,UAAU,CAAC,KAAuB,EAAE,KAAa;IACxD,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,WAAW,EAAE;QACpC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrE,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;KAC7D;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW;IAC3B,MAAM,CAAC,GAAG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gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC;QAC7C,wDAAwD;QACxD,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC;QACtB,wEAAwE;QACxE,mEAAmE;QACnE,iEAAiE;QACjE,MAAM,EAAE,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC;QAC3C,KAAK,EAAE,IAAI,CAAC,yBAAyB,CAAC;QACtC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC;KAC1B,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,GAAW,EAAE,MAAc;IAC1C,OAAO,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,MAAM,CAAC,GAAW,EAAE,MAAc;IACzC,OAAO,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAC1B,8BAA8B,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { PierreFileView } from './PierreFileView';
|
|
2
|
+
export type { PierreFileViewProps } from './PierreFileView';
|
|
3
|
+
export { PierreSnippetView } from './PierreSnippetView';
|
|
4
|
+
export type { PierreSnippetViewProps } from './PierreSnippetView';
|
|
5
|
+
export { PierreThroughlineCodeView } from './PierreThroughlineCodeView';
|
|
6
|
+
export type { PierreThroughlineCodeViewProps } from './PierreThroughlineCodeView';
|
|
7
|
+
export { sliceSnippetWindow } from './sliceSnippet';
|
|
8
|
+
export type { SnippetSlice } from './sliceSnippet';
|
|
9
|
+
export { isPierreCFamilyPath, pierreCodeViewFileName, pierreLangForPath, } from './pierreFileLang';
|
|
10
|
+
export { PIERRE_DEFAULT_SYNTAX_THEMES, resolvePierreSyntaxThemeName, } from './pierreSyntaxTheme';
|
|
11
|
+
export type { PierreSyntaxThemeName } from './pierreSyntaxTheme';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pierre/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { PierreFileView } from './PierreFileView';
|
|
2
|
+
export { PierreSnippetView } from './PierreSnippetView';
|
|
3
|
+
export { PierreThroughlineCodeView } from './PierreThroughlineCodeView';
|
|
4
|
+
export { sliceSnippetWindow } from './sliceSnippet';
|
|
5
|
+
export { isPierreCFamilyPath, pierreCodeViewFileName, pierreLangForPath, } from './pierreFileLang';
|
|
6
|
+
export { PIERRE_DEFAULT_SYNTAX_THEMES, resolvePierreSyntaxThemeName, } from './pierreSyntaxTheme';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pierre/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Shared Pierre / @pierre/diffs option helpers for file + snippet views. */
|
|
2
|
+
export declare const PIERRE_FILE_STYLE: {
|
|
3
|
+
readonly display: "block";
|
|
4
|
+
};
|
|
5
|
+
export declare const PIERRE_BASE_OPTIONS: {
|
|
6
|
+
readonly disableFileHeader: true;
|
|
7
|
+
};
|
|
8
|
+
export declare function buildBackgroundCSS(background: string): string;
|
|
9
|
+
export declare function buildPierreOptions(background?: string): {
|
|
10
|
+
readonly disableFileHeader: true;
|
|
11
|
+
} | {
|
|
12
|
+
unsafeCSS: string;
|
|
13
|
+
disableFileHeader: true;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=pierreBackground.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pierreBackground.d.ts","sourceRoot":"","sources":["../../src/pierre/pierreBackground.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,eAAO,MAAM,iBAAiB;;CAAgC,CAAC;AAE/D,eAAO,MAAM,mBAAmB;;CAEtB,CAAC;AAEX,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAgB7D;AAED,wBAAgB,kBAAkB,CAAC,UAAU,CAAC,EAAE,MAAM;;;;;EAMrD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Shared Pierre / @pierre/diffs option helpers for file + snippet views. */
|
|
2
|
+
export const PIERRE_FILE_STYLE = { display: 'block' };
|
|
3
|
+
export const PIERRE_BASE_OPTIONS = {
|
|
4
|
+
disableFileHeader: true,
|
|
5
|
+
};
|
|
6
|
+
export function buildBackgroundCSS(background) {
|
|
7
|
+
return `
|
|
8
|
+
:host {
|
|
9
|
+
background: ${background} !important;
|
|
10
|
+
}
|
|
11
|
+
pre, code,
|
|
12
|
+
[data-gutter], [data-content],
|
|
13
|
+
[data-line], [data-column-number],
|
|
14
|
+
[data-gutter-buffer], [data-line-annotation], [data-no-newline],
|
|
15
|
+
[data-separator], [data-separator-wrapper] {
|
|
16
|
+
background: ${background} !important;
|
|
17
|
+
}
|
|
18
|
+
[data-line] span {
|
|
19
|
+
background: ${background} !important;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
23
|
+
export function buildPierreOptions(background) {
|
|
24
|
+
if (!background)
|
|
25
|
+
return PIERRE_BASE_OPTIONS;
|
|
26
|
+
return {
|
|
27
|
+
...PIERRE_BASE_OPTIONS,
|
|
28
|
+
unsafeCSS: buildBackgroundCSS(background),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=pierreBackground.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pierreBackground.js","sourceRoot":"","sources":["../../src/pierre/pierreBackground.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,OAAO,EAAE,OAAO,EAAW,CAAC;AAE/D,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,iBAAiB,EAAE,IAAI;CACf,CAAC;AAEX,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACnD,OAAO;;kBAES,UAAU;;;;;;;kBAOV,UAAU;;;kBAGV,UAAU;;CAE3B,CAAC;AACF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,UAAmB;IACpD,IAAI,CAAC,UAAU;QAAE,OAAO,mBAAmB,CAAC;IAC5C,OAAO;QACL,GAAG,mBAAmB;QACtB,SAAS,EAAE,kBAAkB,CAAC,UAAU,CAAC;KAC1C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
/** True when Pierre would (or we would) treat this path as C-family source. */
|
|
14
|
+
export declare function isPierreCFamilyPath(path: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Explicit `lang` for a Pierre `FileContents` object.
|
|
17
|
+
*
|
|
18
|
+
* - C-family → `'text'` (WebKit-safe; no cpp/obj-c++ Shiki grammar)
|
|
19
|
+
* - everything else → `undefined` (Pierre infers from the filename)
|
|
20
|
+
*/
|
|
21
|
+
export declare function pierreLangForPath(path: string): 'text' | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Unique CodeView `file.name` that still carries a real extension for
|
|
24
|
+
* inference, so distinct slices of the same path never share a display name.
|
|
25
|
+
*/
|
|
26
|
+
export declare function pierreCodeViewFileName(path: string, index: number): string;
|
|
27
|
+
//# sourceMappingURL=pierreFileLang.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pierreFileLang.d.ts","sourceRoot":"","sources":["../../src/pierre/pierreFileLang.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAqBH,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAElE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG1E"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
const C_FAMILY_EXT = new Set([
|
|
14
|
+
'c',
|
|
15
|
+
'h',
|
|
16
|
+
'cc',
|
|
17
|
+
'cpp',
|
|
18
|
+
'cxx',
|
|
19
|
+
'hpp',
|
|
20
|
+
'hh',
|
|
21
|
+
'mm',
|
|
22
|
+
'm',
|
|
23
|
+
]);
|
|
24
|
+
function extensionOf(path) {
|
|
25
|
+
const base = path.split(/[/\\]/).pop() ?? path;
|
|
26
|
+
const dot = base.lastIndexOf('.');
|
|
27
|
+
if (dot < 0)
|
|
28
|
+
return '';
|
|
29
|
+
return base.slice(dot + 1).toLowerCase();
|
|
30
|
+
}
|
|
31
|
+
/** True when Pierre would (or we would) treat this path as C-family source. */
|
|
32
|
+
export function isPierreCFamilyPath(path) {
|
|
33
|
+
return C_FAMILY_EXT.has(extensionOf(path));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Explicit `lang` for a Pierre `FileContents` object.
|
|
37
|
+
*
|
|
38
|
+
* - C-family → `'text'` (WebKit-safe; no cpp/obj-c++ Shiki grammar)
|
|
39
|
+
* - everything else → `undefined` (Pierre infers from the filename)
|
|
40
|
+
*/
|
|
41
|
+
export function pierreLangForPath(path) {
|
|
42
|
+
return isPierreCFamilyPath(path) ? 'text' : undefined;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Unique CodeView `file.name` that still carries a real extension for
|
|
46
|
+
* inference, so distinct slices of the same path never share a display name.
|
|
47
|
+
*/
|
|
48
|
+
export function pierreCodeViewFileName(path, index) {
|
|
49
|
+
const base = path.split(/[/\\]/).pop() ?? path;
|
|
50
|
+
return `${String(index + 1).padStart(2, '0')}-${base}`;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=pierreFileLang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pierreFileLang.js","sourceRoot":"","sources":["../../src/pierre/pierreFileLang.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,GAAG;IACH,GAAG;IACH,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,GAAG;CACJ,CAAC,CAAC;AAEH,SAAS,WAAW,CAAC,IAAY;IAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC;IAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,GAAG,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IACvB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAC3C,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACxD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAY,EAAE,KAAa;IAChE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC;IAC/C,OAAO,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pierre syntax theme names — aligned with @pierre/diffs DEFAULT_THEMES.
|
|
3
|
+
*/
|
|
4
|
+
export type PierreSyntaxThemeName = 'pierre-dark' | 'pierre-light';
|
|
5
|
+
export declare const PIERRE_DEFAULT_SYNTAX_THEMES: {
|
|
6
|
+
readonly dark: "pierre-dark";
|
|
7
|
+
readonly light: "pierre-light";
|
|
8
|
+
};
|
|
9
|
+
/** Pick pierre-dark / pierre-light to match Pierre file views and industry-theme mode. */
|
|
10
|
+
export declare function resolvePierreSyntaxThemeName(mode?: string): PierreSyntaxThemeName;
|
|
11
|
+
//# sourceMappingURL=pierreSyntaxTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pierreSyntaxTheme.d.ts","sourceRoot":"","sources":["../../src/pierre/pierreSyntaxTheme.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG,cAAc,CAAC;AAEnE,eAAO,MAAM,4BAA4B;;;CAG2B,CAAC;AAErE,0FAA0F;AAC1F,wBAAgB,4BAA4B,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,qBAAqB,CAUjF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pierre syntax theme names — aligned with @pierre/diffs DEFAULT_THEMES.
|
|
3
|
+
*/
|
|
4
|
+
export const PIERRE_DEFAULT_SYNTAX_THEMES = {
|
|
5
|
+
dark: 'pierre-dark',
|
|
6
|
+
light: 'pierre-light',
|
|
7
|
+
};
|
|
8
|
+
/** Pick pierre-dark / pierre-light to match Pierre file views and industry-theme mode. */
|
|
9
|
+
export function resolvePierreSyntaxThemeName(mode) {
|
|
10
|
+
if (mode === 'light')
|
|
11
|
+
return PIERRE_DEFAULT_SYNTAX_THEMES.light;
|
|
12
|
+
if (mode === 'dark')
|
|
13
|
+
return PIERRE_DEFAULT_SYNTAX_THEMES.dark;
|
|
14
|
+
if (typeof window !== 'undefined' &&
|
|
15
|
+
window.matchMedia('(prefers-color-scheme: light)').matches) {
|
|
16
|
+
return PIERRE_DEFAULT_SYNTAX_THEMES.light;
|
|
17
|
+
}
|
|
18
|
+
return PIERRE_DEFAULT_SYNTAX_THEMES.dark;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=pierreSyntaxTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pierreSyntaxTheme.js","sourceRoot":"","sources":["../../src/pierre/pierreSyntaxTheme.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,cAAc;CAC6C,CAAC;AAErE,0FAA0F;AAC1F,MAAM,UAAU,4BAA4B,CAAC,IAAa;IACxD,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,4BAA4B,CAAC,KAAK,CAAC;IAChE,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,4BAA4B,CAAC,IAAI,CAAC;IAC9D,IACE,OAAO,MAAM,KAAK,WAAW;QAC7B,MAAM,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC,OAAO,EAC1D;QACA,OAAO,4BAA4B,CAAC,KAAK,CAAC;KAC3C;IACD,OAAO,4BAA4B,CAAC,IAAI,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Lines to keep visible above the focus line when scrolling. */
|
|
2
|
+
export declare const SCROLL_LEADING_LINES = 4;
|
|
3
|
+
/** 1-based line in the sliced snippet to align near the top of the viewport. */
|
|
4
|
+
export declare function scrollAnchorLine(focusOffset: number, leadingLines?: number): number;
|
|
5
|
+
//# sourceMappingURL=scrollAnchor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollAnchor.d.ts","sourceRoot":"","sources":["../../src/pierre/scrollAnchor.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,gFAAgF;AAChF,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,YAAY,SAAuB,GAClC,MAAM,CAGR"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Lines to keep visible above the focus line when scrolling. */
|
|
2
|
+
export const SCROLL_LEADING_LINES = 4;
|
|
3
|
+
/** 1-based line in the sliced snippet to align near the top of the viewport. */
|
|
4
|
+
export function scrollAnchorLine(focusOffset, leadingLines = SCROLL_LEADING_LINES) {
|
|
5
|
+
if (focusOffset <= 1)
|
|
6
|
+
return 1;
|
|
7
|
+
return Math.max(1, focusOffset - leadingLines);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=scrollAnchor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollAnchor.js","sourceRoot":"","sources":["../../src/pierre/scrollAnchor.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC,gFAAgF;AAChF,MAAM,UAAU,gBAAgB,CAC9B,WAAmB,EACnB,YAAY,GAAG,oBAAoB;IAEnC,IAAI,WAAW,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,YAAY,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Slice a file's line range with surrounding context for snippet rendering. */
|
|
2
|
+
export interface SnippetSlice {
|
|
3
|
+
contents: string;
|
|
4
|
+
sliceStart: number;
|
|
5
|
+
sliceEnd: number;
|
|
6
|
+
/** 1-based line index within `contents` to highlight, or null. */
|
|
7
|
+
focusOffset: number | null;
|
|
8
|
+
}
|
|
9
|
+
export declare function sliceSnippetWindow(contents: string, startLine: number, endLine: number, contextLines: number, focusLine?: number | null): SnippetSlice;
|
|
10
|
+
//# sourceMappingURL=sliceSnippet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliceSnippet.d.ts","sourceRoot":"","sources":["../../src/pierre/sliceSnippet.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,YAAY,CAcd"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Slice a file's line range with surrounding context for snippet rendering. */
|
|
2
|
+
export function sliceSnippetWindow(contents, startLine, endLine, contextLines, focusLine) {
|
|
3
|
+
const allLines = contents.split('\n');
|
|
4
|
+
const total = allLines.length;
|
|
5
|
+
const safeStart = Math.max(1, Math.min(startLine, total));
|
|
6
|
+
const safeEnd = Math.max(safeStart, Math.min(endLine, total));
|
|
7
|
+
const sliceStart = Math.max(1, safeStart - contextLines);
|
|
8
|
+
const sliceEnd = Math.min(total, safeEnd + contextLines);
|
|
9
|
+
return {
|
|
10
|
+
contents: allLines.slice(sliceStart - 1, sliceEnd).join('\n'),
|
|
11
|
+
sliceStart,
|
|
12
|
+
sliceEnd,
|
|
13
|
+
focusOffset: focusLine == null ? null : Math.max(1, focusLine - sliceStart + 1),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=sliceSnippet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliceSnippet.js","sourceRoot":"","sources":["../../src/pierre/sliceSnippet.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAUhF,MAAM,UAAU,kBAAkB,CAChC,QAAgB,EAChB,SAAiB,EACjB,OAAe,EACf,YAAoB,EACpB,SAAyB;IAEzB,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAC9D,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAAC,CAAC;IACzD,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC7D,UAAU;QACV,QAAQ;QACR,WAAW,EACT,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,CAAC,CAAC;KACrE,CAAC;AACJ,CAAC"}
|