@principal-ai/principal-view-react 0.16.56 → 0.16.57
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/dist/graphify/consolidated.d.ts +16 -1
- package/dist/graphify/consolidated.d.ts.map +1 -1
- package/dist/graphify/index.d.ts +1 -1
- package/dist/graphify/index.d.ts.map +1 -1
- package/dist/graphify/index.js.map +1 -1
- package/dist/graphify/kind.d.ts +1 -1
- package/dist/graphify/kind.d.ts.map +1 -1
- package/dist/graphify/kind.js +7 -1
- package/dist/graphify/kind.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- 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/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 +2 -2
- package/dist/subsystem/ComponentDeclaration.d.ts.map +1 -1
- package/dist/subsystem/ComponentDeclaration.js +12 -11
- package/dist/subsystem/ComponentDeclaration.js.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +22 -1
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/dist/subsystem/formatDeclaration.d.ts.map +1 -1
- package/dist/subsystem/formatDeclaration.js +49 -10
- package/dist/subsystem/formatDeclaration.js.map +1 -1
- package/dist/subsystem/model.d.ts +55 -12
- package/dist/subsystem/model.d.ts.map +1 -1
- package/dist/subsystem/model.js +54 -24
- package/dist/subsystem/model.js.map +1 -1
- package/dist/subsystem/nodes.d.ts +4 -1
- package/dist/subsystem/nodes.d.ts.map +1 -1
- package/dist/subsystem/nodes.js +70 -21
- package/dist/subsystem/nodes.js.map +1 -1
- package/dist/subsystem/tokenizeComponent.js +1 -1
- package/dist/subsystem/tokenizeComponent.js.map +1 -1
- package/package.json +1 -1
- package/src/graphify/consolidated.ts +18 -1
- package/src/graphify/index.ts +1 -0
- package/src/graphify/kind.ts +7 -1
- package/src/index.ts +3 -2
- package/src/pierre/constructColors.test.ts +52 -0
- package/src/pierre/constructColors.ts +112 -0
- package/src/stories/{BoundaryNodes.stories.tsx → Audit/BoundaryNodes.stories.tsx} +1 -1
- package/src/stories/{CanvasEdgeTypes.stories.tsx → Audit/CanvasEdgeTypes.stories.tsx} +1 -1
- package/src/stories/{CanvasNodeTypes.stories.tsx → Audit/CanvasNodeTypes.stories.tsx} +1 -1
- package/src/stories/{ColorPriority.stories.tsx → Audit/ColorPriority.stories.tsx} +1 -1
- package/src/stories/{DiamondBadges.stories.tsx → Audit/DiamondBadges.stories.tsx} +1 -1
- package/src/stories/{NodeDimensionsTesting.stories.tsx → Audit/NodeDimensionsTesting.stories.tsx} +2 -2
- package/src/stories/{NodeFieldsAudit.stories.tsx → Audit/NodeFieldsAudit.stories.tsx} +1 -1
- package/src/stories/{NodeFontSizeTesting.stories.tsx → Audit/NodeFontSizeTesting.stories.tsx} +2 -2
- package/src/stories/{NodeShapes.stories.tsx → Audit/NodeShapes.stories.tsx} +1 -1
- package/src/stories/{WideNodesTesting.stories.tsx → Audit/WideNodesTesting.stories.tsx} +2 -2
- package/src/stories/{dashboard → Components}/DashboardRenderer.stories.tsx +2 -2
- package/src/stories/{GraphRenderer.stories.tsx → Components/GraphRenderer.stories.tsx} +2 -2
- package/src/stories/{MultiCanvasRenderer.stories.tsx → Components/MultiCanvasRenderer.stories.tsx} +2 -2
- package/src/stories/{SequenceDiagram.stories.tsx → Components/SequenceDiagram.stories.tsx} +2 -2
- package/src/stories/{StateView.stories.tsx → Components/StateView.stories.tsx} +2 -2
- package/src/stories/{TraceViewer.stories.tsx → Components/TraceViewer.stories.tsx} +3 -3
- package/src/stories/{WorkflowSequenceDiagram.stories.tsx → Components/WorkflowSequenceDiagram.stories.tsx} +1 -1
- package/src/stories/{AnimationWorkshop.stories.tsx → Features/AnimationWorkshop.stories.tsx} +5 -5
- package/src/stories/{ChangeTypeVisual.stories.tsx → Features/ChangeTypeVisual.stories.tsx} +2 -2
- package/src/stories/{EventDrivenAnimations.stories.tsx → Features/EventDrivenAnimations.stories.tsx} +2 -2
- package/src/stories/{MultiConfig.stories.tsx → Features/MultiConfig.stories.tsx} +2 -2
- package/src/stories/{ElkEdgeRouting.stories.tsx → Layout/ElkEdgeRouting.stories.tsx} +2 -2
- package/src/stories/{GraphOrientation.stories.tsx → Layout/GraphOrientation.stories.tsx} +3 -3
- package/src/stories/{MultiDirectionalConnections.stories.tsx → Layout/MultiDirectionalConnections.stories.tsx} +2 -2
- package/src/stories/{NodeDefinitionComparison.stories.tsx → Nodes/NodeDefinitionComparison.stories.tsx} +2 -2
- package/src/stories/{NodeNameFallbacks.stories.tsx → Nodes/NodeNameFallbacks.stories.tsx} +2 -2
- package/src/stories/{NumericColors.stories.tsx → Nodes/NumericColors.stories.tsx} +2 -2
- package/src/stories/{EventNameDisplay.stories.tsx → OTEL/EventNameDisplay.stories.tsx} +2 -2
- package/src/stories/{EventNameFallback.stories.tsx → OTEL/EventNameFallback.stories.tsx} +2 -2
- package/src/stories/{OtelComponents.stories.tsx → OTEL/OtelComponents.stories.tsx} +3 -3
- package/src/stories/{OtelNodeTypesPrototype.stories.tsx → OTEL/OtelNodeTypesPrototype.stories.tsx} +2 -2
- package/src/stories/{RawEventCards.stories.tsx → OTEL/RawEventCards.stories.tsx} +3 -3
- package/src/stories/{SpanBadges.stories.tsx → OTEL/SpanBadges.stories.tsx} +1 -1
- package/src/stories/{ValidationEventsCanvas.stories.tsx → OTEL/ValidationEventsCanvas.stories.tsx} +3 -3
- package/src/stories/{BacklogMdCanvases.stories.tsx → RealWorld/BacklogMdCanvases.stories.tsx} +2 -2
- package/src/stories/{FileCitySequence.stories.tsx → RealWorld/FileCitySequence.stories.tsx} +4 -4
- package/src/stories/{RealCanvasFiles.stories.tsx → RealWorld/RealCanvasFiles.stories.tsx} +7 -7
- package/src/stories/{ComponentDeclarationAudit.stories.tsx → Subsystem/ComponentDeclarationAudit.stories.tsx} +19 -20
- 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/Scenarios.stories.tsx +959 -0
- package/src/stories/Subsystem/ComponentGraph/Spotlights.stories.tsx +646 -0
- package/src/stories/Subsystem/ComponentGraph/fixtures.ts +129 -0
- package/src/subsystem/ComponentDeclaration.tsx +13 -13
- package/src/subsystem/SubsystemComponentGraph.tsx +25 -5
- package/src/subsystem/formatDeclaration.ts +57 -11
- package/src/subsystem/model.test.ts +38 -6
- package/src/subsystem/model.ts +108 -31
- package/src/subsystem/nodes.tsx +103 -27
- package/src/subsystem/tokenizeComponent.ts +1 -1
- package/src/stories/SubsystemComponentGraph.stories.tsx +0 -1225
- /package/src/stories/{dashboard/sample-dashboards → data}/activity-feed-analytics.dashboard.json +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
|
|
17
|
+
import type { SubsystemComponentConstruct } from '../subsystem/model';
|
|
18
|
+
import type { PierreSyntaxThemeName } from './pierreSyntaxTheme';
|
|
19
|
+
import pierreDark from '@pierre/theme/pierre-dark';
|
|
20
|
+
import pierreLight from '@pierre/theme/pierre-light';
|
|
21
|
+
|
|
22
|
+
interface PierreThemeInput {
|
|
23
|
+
type: 'dark' | 'light';
|
|
24
|
+
colors: Record<string, string>;
|
|
25
|
+
tokenColors: Array<{ scope: string | string[]; settings: { foreground?: string } }>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const THEMES: Record<PierreSyntaxThemeName, PierreThemeInput> = {
|
|
29
|
+
'pierre-dark': pierreDark as unknown as PierreThemeInput,
|
|
30
|
+
'pierre-light': pierreLight as unknown as PierreThemeInput,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** First rule whose scope list contains the exact scope. */
|
|
34
|
+
function scopeColor(theme: PierreThemeInput, scope: string): string | undefined {
|
|
35
|
+
for (const rule of theme.tokenColors) {
|
|
36
|
+
const scopes = Array.isArray(rule.scope) ? rule.scope : [rule.scope];
|
|
37
|
+
if (scopes.includes(scope)) return rule.settings.foreground;
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function hexToRgb(hex: string): [number, number, number] {
|
|
43
|
+
const h = hex.replace('#', '');
|
|
44
|
+
const full = h.length === 3 ? h.split('').map((c) => c + c).join('') : h;
|
|
45
|
+
const n = parseInt(full.slice(0, 6), 16);
|
|
46
|
+
return [(n >> 16) & 255, (n >> 8) & 255, n & 255];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function rgbToHex([r, g, b]: [number, number, number]): string {
|
|
50
|
+
const to = (v: number) => Math.max(0, Math.min(255, Math.round(v))).toString(16).padStart(2, '0');
|
|
51
|
+
return `#${to(r)}${to(g)}${to(b)}`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Linear blend of two hex colors; amount 0 = base, 1 = other. */
|
|
55
|
+
function mix(hex: string, other: string, amount: number): string {
|
|
56
|
+
const base = hexToRgb(hex);
|
|
57
|
+
const target = hexToRgb(other);
|
|
58
|
+
return rgbToHex([
|
|
59
|
+
base[0] + (target[0] - base[0]) * amount,
|
|
60
|
+
base[1] + (target[1] - base[1]) * amount,
|
|
61
|
+
base[2] + (target[2] - base[2]) * amount,
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function constructColorsFromPierreTheme(
|
|
66
|
+
themeName: PierreSyntaxThemeName,
|
|
67
|
+
): Record<SubsystemComponentConstruct, string> {
|
|
68
|
+
const theme = THEMES[themeName];
|
|
69
|
+
// A scope the theme doesn't declare resolves to the theme's own foreground —
|
|
70
|
+
// still all-Pierre, never a hand-picked value.
|
|
71
|
+
const editorFg = theme.colors['editor.foreground'] ?? '#fafafa';
|
|
72
|
+
const pick = (scope: string) => scopeColor(theme, scope) ?? editorFg;
|
|
73
|
+
const towardBackground = theme.type === 'dark' ? lighten : darken;
|
|
74
|
+
|
|
75
|
+
const classColor = pick('entity.name.class');
|
|
76
|
+
const functionColor = pick('entity.name.function');
|
|
77
|
+
const typeColor = pick('support.type');
|
|
78
|
+
const moduleColor = pick('entity.name.namespace');
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
class: classColor,
|
|
82
|
+
// interface/type are the type-name scope, shaded to separate them from
|
|
83
|
+
// class (whose declaration name shares the same hue in syntax themes)
|
|
84
|
+
interface: towardBackground(typeColor, 0.14),
|
|
85
|
+
type_alias: towardBackground(typeColor, 0.28),
|
|
86
|
+
function: functionColor,
|
|
87
|
+
method: towardBackground(functionColor, 0.14),
|
|
88
|
+
// enum members are constants — the generic constant hue
|
|
89
|
+
enum: pick('constant'),
|
|
90
|
+
// module and store share the constant hue — the module holds the store,
|
|
91
|
+
// and the store IS the retained value, so the store keeps the pure
|
|
92
|
+
// `variable.other.constant` color and the module takes the shade
|
|
93
|
+
module: towardBackground(moduleColor, 0.18),
|
|
94
|
+
store: pick('variable.other.constant'),
|
|
95
|
+
external: pick('comment'),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function lighten(hex: string, amount: number): string {
|
|
100
|
+
return mix(hex, '#ffffff', amount);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function darken(hex: string, amount: number): string {
|
|
104
|
+
return mix(hex, '#000000', amount);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The dark-theme instantiation, for consumers without a mode context (the
|
|
109
|
+
* bun-side excalidraw exporter). React components derive per mode instead.
|
|
110
|
+
*/
|
|
111
|
+
export const CONSTRUCT_COLOR: Record<SubsystemComponentConstruct, string> =
|
|
112
|
+
constructColorsFromPierreTheme('pierre-dark');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas, DerivedEdge } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas, GraphEvent, ComponentLibrary } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
package/src/stories/{NodeDimensionsTesting.stories.tsx → Audit/NodeDimensionsTesting.stories.tsx}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas, ExtendedCanvasNode } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
|
7
7
|
const meta = {
|
|
8
|
-
title: '
|
|
8
|
+
title: 'Audit/NodeDimensionsTesting',
|
|
9
9
|
component: GraphRenderer,
|
|
10
10
|
parameters: {
|
|
11
11
|
layout: 'fullscreen',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
package/src/stories/{NodeFontSizeTesting.stories.tsx → Audit/NodeFontSizeTesting.stories.tsx}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
import type { Theme } from '@principal-ade/industry-theme';
|
|
7
7
|
|
|
8
8
|
const meta = {
|
|
9
|
-
title: '
|
|
9
|
+
title: 'Audit/NodeFontSizeTesting',
|
|
10
10
|
component: GraphRenderer,
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: 'fullscreen',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
import type { Theme } from '@principal-ade/industry-theme';
|
|
7
7
|
|
|
8
8
|
const meta = {
|
|
9
|
-
title: '
|
|
9
|
+
title: 'Audit/WideNodesTesting',
|
|
10
10
|
component: GraphRenderer,
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: 'fullscreen',
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
8
8
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
9
9
|
import { DashboardRenderer } from '../../components/dashboard';
|
|
10
|
-
import activityFeedDashboard from '
|
|
10
|
+
import activityFeedDashboard from '../data/activity-feed-analytics.dashboard.json';
|
|
11
11
|
import type { DashboardDefinition } from '../../components/dashboard';
|
|
12
12
|
|
|
13
13
|
const meta: Meta<typeof DashboardRenderer> = {
|
|
14
|
-
title: '
|
|
14
|
+
title: 'Components/DashboardRenderer',
|
|
15
15
|
component: DashboardRenderer,
|
|
16
16
|
parameters: {
|
|
17
17
|
layout: 'fullscreen',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
import '@xyflow/react/dist/style.css';
|
|
4
|
-
import { GraphRenderer } from '
|
|
5
|
-
import type { GraphRendererHandle, PendingChanges } from '
|
|
4
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
5
|
+
import type { GraphRendererHandle, PendingChanges } from '../../components/GraphRenderer';
|
|
6
6
|
import type { ExtendedCanvas, PVEventSchema } from '@principal-ai/principal-view-core';
|
|
7
7
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
8
8
|
|
package/src/stories/{MultiCanvasRenderer.stories.tsx → Components/MultiCanvasRenderer.stories.tsx}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { MultiCanvasRenderer } from '
|
|
4
|
-
import type { MultiCanvasLayout } from '
|
|
3
|
+
import { MultiCanvasRenderer } from '../../components/MultiCanvasRenderer';
|
|
4
|
+
import type { MultiCanvasLayout } from '../../components/MultiCanvasRenderer';
|
|
5
5
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
6
6
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { SequenceDiagramRenderer } from '
|
|
4
|
-
import type { SequenceEvent, SequenceEdge } from '
|
|
3
|
+
import { SequenceDiagramRenderer } from '../../components/SequenceDiagramRenderer';
|
|
4
|
+
import type { SequenceEvent, SequenceEdge } from '../../hooks/useSequenceLayout';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
|
7
7
|
const meta = {
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
type PipelineEvent,
|
|
6
6
|
type EventSource,
|
|
7
7
|
type PipelineEventType,
|
|
8
|
-
} from '
|
|
8
|
+
} from '../../components/state-view';
|
|
9
9
|
|
|
10
10
|
const meta = {
|
|
11
|
-
title: '
|
|
11
|
+
title: 'Components/StateView',
|
|
12
12
|
component: PipelineView,
|
|
13
13
|
parameters: {
|
|
14
14
|
layout: 'centered',
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
|
7
7
|
// Import captured trace canvas data
|
|
8
|
-
import testRunTrace from '
|
|
8
|
+
import testRunTrace from '../__traces__/test-run.canvas.json';
|
|
9
9
|
|
|
10
10
|
const meta = {
|
|
11
|
-
title: '
|
|
11
|
+
title: 'Components/TraceViewer',
|
|
12
12
|
component: GraphRenderer,
|
|
13
13
|
parameters: {
|
|
14
14
|
layout: 'fullscreen',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { WorkflowSequenceDiagram } from '
|
|
3
|
+
import { WorkflowSequenceDiagram } from '../../components/WorkflowSequenceDiagram';
|
|
4
4
|
import type { WorkflowScenario, Canvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
package/src/stories/{AnimationWorkshop.stories.tsx → Features/AnimationWorkshop.stories.tsx}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { ReactFlow, ReactFlowProvider, Background, Controls } from '@xyflow/react';
|
|
3
3
|
import '@xyflow/react/dist/style.css';
|
|
4
|
-
import { CustomNode } from '
|
|
5
|
-
import { CustomEdge } from '
|
|
6
|
-
import type { CustomNodeData } from '
|
|
7
|
-
import type { CustomEdgeData } from '
|
|
4
|
+
import { CustomNode } from '../../nodes/CustomNode';
|
|
5
|
+
import { CustomEdge } from '../../edges/CustomEdge';
|
|
6
|
+
import type { CustomNodeData } from '../../nodes/CustomNode';
|
|
7
|
+
import type { CustomEdgeData } from '../../edges/CustomEdge';
|
|
8
8
|
import type { NodeTypeDefinition, EdgeTypeDefinition } from '@principal-ai/principal-view-core';
|
|
9
9
|
import React from 'react';
|
|
10
10
|
|
|
11
11
|
const meta = {
|
|
12
|
-
title: '
|
|
12
|
+
title: 'Features/AnimationWorkshop',
|
|
13
13
|
component: ReactFlow,
|
|
14
14
|
parameters: {
|
|
15
15
|
layout: 'fullscreen',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
import { ThemeProvider, slateTheme } from '@principal-ade/industry-theme';
|
|
4
|
-
import { ChangeTypeVisual } from '
|
|
4
|
+
import { ChangeTypeVisual } from '../../../../trail-viewer/src/mainview/components/ChangeTypeVisual';
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
|
-
title: '
|
|
7
|
+
title: 'Features/ChangeTypeVisual',
|
|
8
8
|
component: ChangeTypeVisual,
|
|
9
9
|
decorators: [
|
|
10
10
|
(Story) => (
|
package/src/stories/{EventDrivenAnimations.stories.tsx → Features/EventDrivenAnimations.stories.tsx}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { GraphRenderer } from '
|
|
2
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
3
3
|
import type { GraphEvent, ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
4
4
|
import { useState, useEffect } from 'react';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
7
7
|
|
|
8
8
|
const meta = {
|
|
9
|
-
title: '
|
|
9
|
+
title: 'Features/EventDrivenAnimations',
|
|
10
10
|
component: GraphRenderer,
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: 'fullscreen',
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof GraphRenderer> = {
|
|
9
|
-
title: '
|
|
9
|
+
title: 'Features/MultiConfig',
|
|
10
10
|
component: GraphRenderer,
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: 'fullscreen',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
|
7
7
|
const meta = {
|
|
8
|
-
title: 'Layout/
|
|
8
|
+
title: 'Layout/ElkEdgeRouting',
|
|
9
9
|
component: GraphRenderer,
|
|
10
10
|
parameters: {
|
|
11
11
|
layout: 'centered',
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { useState, useMemo } from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
|
-
import { swapGraphOrientation } from '
|
|
6
|
+
import { swapGraphOrientation } from '../../utils/orientationUtils';
|
|
7
7
|
import { CanvasConverter } from '@principal-ai/principal-view-core';
|
|
8
8
|
|
|
9
9
|
const meta = {
|
|
10
|
-
title: '
|
|
10
|
+
title: 'Layout/GraphOrientation',
|
|
11
11
|
component: GraphRenderer,
|
|
12
12
|
parameters: {
|
|
13
13
|
layout: 'centered',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { GraphRenderer } from '
|
|
2
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
3
3
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
4
4
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
|
-
title: '
|
|
7
|
+
title: 'Layout/MultiDirectionalConnections',
|
|
8
8
|
component: GraphRenderer,
|
|
9
9
|
parameters: {
|
|
10
10
|
layout: 'fullscreen',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
|
7
7
|
const meta = {
|
|
8
|
-
title: '
|
|
8
|
+
title: 'Nodes/NodeDefinitionComparison',
|
|
9
9
|
component: GraphRenderer,
|
|
10
10
|
parameters: {
|
|
11
11
|
layout: 'fullscreen',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas, ExtendedCanvasNode } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
|
7
7
|
const meta = {
|
|
8
|
-
title: '
|
|
8
|
+
title: 'Nodes/NodeNameFallbacks',
|
|
9
9
|
component: GraphRenderer,
|
|
10
10
|
parameters: {
|
|
11
11
|
layout: 'fullscreen',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
|
7
7
|
const meta = {
|
|
8
|
-
title: '
|
|
8
|
+
title: 'Nodes/NumericColors',
|
|
9
9
|
component: GraphRenderer,
|
|
10
10
|
parameters: {
|
|
11
11
|
layout: 'centered',
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
import type { Theme } from '@principal-ade/industry-theme';
|
|
7
7
|
|
|
8
8
|
const meta = {
|
|
9
|
-
title: '
|
|
9
|
+
title: 'OTEL/EventNameDisplay',
|
|
10
10
|
component: GraphRenderer,
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: 'fullscreen',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
|
-
title: '
|
|
7
|
+
title: 'OTEL/EventNameFallback',
|
|
8
8
|
component: GraphRenderer,
|
|
9
9
|
parameters: {
|
|
10
10
|
layout: 'fullscreen',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
4
|
-
import { GraphRenderer } from '
|
|
5
|
-
import { NodeTooltip } from '
|
|
4
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
5
|
+
import { NodeTooltip } from '../../components/NodeTooltip';
|
|
6
6
|
|
|
7
7
|
// OTEL Log Association canvas data
|
|
8
8
|
const otelCanvas = {
|
|
@@ -165,7 +165,7 @@ Routes incoming OTEL logs to canvas nodes based on matching criteria.
|
|
|
165
165
|
};
|
|
166
166
|
|
|
167
167
|
const meta: Meta = {
|
|
168
|
-
title: 'OTEL/
|
|
168
|
+
title: 'OTEL/OtelComponents',
|
|
169
169
|
parameters: {
|
|
170
170
|
layout: 'fullscreen',
|
|
171
171
|
},
|
package/src/stories/{OtelNodeTypesPrototype.stories.tsx → OTEL/OtelNodeTypesPrototype.stories.tsx}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
4
|
-
import { GraphRenderer } from '
|
|
4
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
5
5
|
import type { ExtendedCanvas, ComponentLibrary } from '@principal-ai/principal-view-core';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -399,7 +399,7 @@ function buildDescription(node: NewFormatNode): string {
|
|
|
399
399
|
// =============================================================================
|
|
400
400
|
|
|
401
401
|
const meta: Meta = {
|
|
402
|
-
title: 'OTEL/
|
|
402
|
+
title: 'OTEL/OtelNodeTypesPrototype',
|
|
403
403
|
parameters: {
|
|
404
404
|
layout: 'fullscreen',
|
|
405
405
|
},
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
SessionEventFeed,
|
|
7
7
|
SessionEventFeedGrouped,
|
|
8
8
|
type SessionEventFeedRow,
|
|
9
|
-
} from '
|
|
10
|
-
import rawSession from '
|
|
9
|
+
} from '../../components/session-events';
|
|
10
|
+
import rawSession from '../data/opencode-session-raw-events.json';
|
|
11
11
|
|
|
12
12
|
const meta = {
|
|
13
|
-
title: '
|
|
13
|
+
title: 'OTEL/RawEventCards',
|
|
14
14
|
parameters: {
|
|
15
15
|
layout: 'fullscreen',
|
|
16
16
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { GraphRenderer } from '
|
|
3
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas, WorkflowChip } from '@principal-ai/principal-view-core';
|
|
5
5
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
6
|
|
package/src/stories/{ValidationEventsCanvas.stories.tsx → OTEL/ValidationEventsCanvas.stories.tsx}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
import '@xyflow/react/dist/style.css';
|
|
4
|
-
import { GraphRenderer } from '
|
|
4
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
5
5
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
6
6
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
7
7
|
|
|
8
8
|
// Import the CLI events canvas
|
|
9
|
-
import validationEventsCanvasUrl from '
|
|
9
|
+
import validationEventsCanvasUrl from '../../../../../.principal-views/principal-view-cli.events.canvas?url';
|
|
10
10
|
|
|
11
11
|
// Helper to load canvas from URL
|
|
12
12
|
async function loadCanvas(url: string): Promise<ExtendedCanvas> {
|
|
@@ -41,7 +41,7 @@ function CanvasLoader({ url, children }: { url: string; children: (canvas: Exten
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const meta = {
|
|
44
|
-
title: '
|
|
44
|
+
title: 'OTEL/ValidationEventsCanvas',
|
|
45
45
|
component: GraphRenderer,
|
|
46
46
|
parameters: {
|
|
47
47
|
layout: 'fullscreen',
|
package/src/stories/{BacklogMdCanvases.stories.tsx → RealWorld/BacklogMdCanvases.stories.tsx}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
import '@xyflow/react/dist/style.css';
|
|
4
|
-
import { GraphRenderer } from '
|
|
4
|
+
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
5
5
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
6
6
|
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
7
7
|
|
|
@@ -67,7 +67,7 @@ function CanvasLoader({
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
const meta = {
|
|
70
|
-
title: '
|
|
70
|
+
title: 'RealWorld/BacklogMdCanvases',
|
|
71
71
|
component: GraphRenderer,
|
|
72
72
|
parameters: {
|
|
73
73
|
layout: 'fullscreen',
|