@principal-ai/principal-view-react 0.8.1 → 0.8.3
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/components/ConfigurationSelector.d.ts +1 -1
- package/dist/components/ConfigurationSelector.d.ts.map +1 -1
- package/dist/components/EdgeInfoPanel.d.ts +1 -1
- package/dist/components/EdgeInfoPanel.d.ts.map +1 -1
- package/dist/components/EdgeInfoPanel.js +77 -86
- package/dist/components/EdgeInfoPanel.js.map +1 -1
- package/dist/components/GraphRenderer.d.ts +8 -1
- package/dist/components/GraphRenderer.d.ts.map +1 -1
- package/dist/components/GraphRenderer.js +38 -31
- package/dist/components/GraphRenderer.js.map +1 -1
- package/dist/components/NodeInfoPanel.d.ts +1 -1
- package/dist/components/NodeInfoPanel.d.ts.map +1 -1
- package/dist/components/NodeInfoPanel.js +88 -67
- package/dist/components/NodeInfoPanel.js.map +1 -1
- package/dist/components/NodeTooltip.d.ts +1 -0
- package/dist/components/NodeTooltip.d.ts.map +1 -1
- package/dist/components/NodeTooltip.js +12 -2
- package/dist/components/NodeTooltip.js.map +1 -1
- package/dist/components/SelectionSidebar.d.ts +1 -1
- package/dist/components/SelectionSidebar.d.ts.map +1 -1
- package/dist/edges/CustomEdge.d.ts +1 -1
- package/dist/edges/CustomEdge.d.ts.map +1 -1
- package/dist/edges/GenericEdge.d.ts +1 -1
- package/dist/edges/GenericEdge.d.ts.map +1 -1
- package/dist/hooks/usePathBasedEvents.d.ts +1 -1
- package/dist/hooks/usePathBasedEvents.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/nodes/CustomNode.d.ts +1 -1
- package/dist/nodes/CustomNode.d.ts.map +1 -1
- package/dist/nodes/CustomNode.js +5 -4
- package/dist/nodes/CustomNode.js.map +1 -1
- package/dist/nodes/GenericNode.d.ts +1 -1
- package/dist/nodes/GenericNode.d.ts.map +1 -1
- package/dist/utils/animationMapping.d.ts +1 -1
- package/dist/utils/animationMapping.d.ts.map +1 -1
- package/dist/utils/graphConverter.d.ts +1 -1
- package/dist/utils/graphConverter.d.ts.map +1 -1
- package/dist/utils/orientationUtils.d.ts +1 -1
- package/dist/utils/orientationUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/ConfigurationSelector.tsx +1 -1
- package/src/components/EdgeInfoPanel.tsx +161 -167
- package/src/components/GraphRenderer.test.tsx +1 -1
- package/src/components/GraphRenderer.tsx +48 -28
- package/src/components/NodeInfoPanel.tsx +178 -139
- package/src/components/NodeTooltip.tsx +28 -0
- package/src/components/PendingChanges.test.tsx +1 -1
- package/src/components/SelectionSidebar.tsx +1 -1
- package/src/edges/CustomEdge.tsx +1 -1
- package/src/edges/GenericEdge.tsx +1 -1
- package/src/hooks/usePathBasedEvents.ts +1 -1
- package/src/index.ts +1 -1
- package/src/nodes/CustomNode.tsx +6 -2
- package/src/nodes/GenericNode.tsx +1 -1
- package/src/stories/AnimationWorkshop.stories.tsx +1 -1
- package/src/stories/CanvasEdgeTypes.stories.tsx +1 -1
- package/src/stories/CanvasNodeTypes.stories.tsx +1 -1
- package/src/stories/ColorPriority.stories.tsx +1 -1
- package/src/stories/EventDrivenAnimations.stories.tsx +1 -1
- package/src/stories/GraphOrientation.stories.tsx +2 -2
- package/src/stories/GraphRenderer.stories.tsx +253 -1
- package/src/stories/MultiConfig.stories.tsx +1 -1
- package/src/stories/MultiDirectionalConnections.stories.tsx +1 -1
- package/src/stories/NodeFieldsAudit.stories.tsx +1 -1
- package/src/stories/NodeShapes.stories.tsx +1 -1
- package/src/stories/OtelComponents.stories.tsx +1 -1
- package/src/stories/TraceViewer.stories.tsx +1 -1
- package/src/stories/data/graph-converter-test-execution.json +245 -27
- package/src/utils/animationMapping.ts +1 -1
- package/src/utils/graphConverter.ts +1 -1
- package/src/utils/orientationUtils.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ConfigurationFile } from '@principal-ai/principal-view-core
|
|
2
|
+
import type { ConfigurationFile } from '@principal-ai/principal-view-core';
|
|
3
3
|
export interface ConfigurationSelectorProps {
|
|
4
4
|
/** Available configurations */
|
|
5
5
|
configurations: ConfigurationFile[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurationSelector.d.ts","sourceRoot":"","sources":["../../src/components/ConfigurationSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ConfigurationSelector.d.ts","sourceRoot":"","sources":["../../src/components/ConfigurationSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,MAAM,WAAW,0BAA0B;IACzC,+BAA+B;IAC/B,cAAc,EAAE,iBAAiB,EAAE,CAAC;IAEpC,4CAA4C;IAC5C,cAAc,EAAE,MAAM,CAAC;IAEvB,0CAA0C;IAC1C,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAE7C,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B,kCAAkC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,8BAA8B;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAsGtE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { EdgeState, EdgeTypeDefinition } from '@principal-ai/principal-view-core
|
|
2
|
+
import type { EdgeState, EdgeTypeDefinition } from '@principal-ai/principal-view-core';
|
|
3
3
|
export interface EdgeInfoPanelProps {
|
|
4
4
|
edge: EdgeState;
|
|
5
5
|
typeDefinition: EdgeTypeDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EdgeInfoPanel.d.ts","sourceRoot":"","sources":["../../src/components/EdgeInfoPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"EdgeInfoPanel.d.ts","sourceRoot":"","sources":["../../src/components/EdgeInfoPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAGvF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,SAAS,CAAC;IAChB,cAAc,EAAE,kBAAkB,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,4FAA4F;IAC5F,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5E;AAOD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAiOtD,CAAC"}
|
|
@@ -9,107 +9,98 @@ export const EdgeInfoPanel = ({ edge, typeDefinition, sourceNodeId, targetNodeId
|
|
|
9
9
|
const edgeColor = typeDefinition.color || theme.colors.primary;
|
|
10
10
|
return (_jsxs("div", { style: {
|
|
11
11
|
position: 'absolute',
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
bottom: 0,
|
|
13
|
+
left: 0,
|
|
14
|
+
right: 0,
|
|
14
15
|
backgroundColor: theme.colors.background,
|
|
15
16
|
color: theme.colors.text,
|
|
16
|
-
|
|
17
|
-
boxShadow: '0 4px 12px rgba(0,0,0,0.15)',
|
|
18
|
-
padding: '16px',
|
|
19
|
-
minWidth: '250px',
|
|
20
|
-
maxWidth: '350px',
|
|
17
|
+
borderTop: `2px solid ${edgeColor}`,
|
|
18
|
+
boxShadow: '0 -4px 12px rgba(0,0,0,0.15)',
|
|
19
|
+
padding: '16px 24px',
|
|
21
20
|
zIndex: 1000,
|
|
22
|
-
|
|
21
|
+
maxHeight: '40%',
|
|
22
|
+
overflowY: 'auto',
|
|
23
23
|
}, children: [_jsxs("div", { style: {
|
|
24
24
|
display: 'flex',
|
|
25
25
|
justifyContent: 'space-between',
|
|
26
|
-
alignItems: '
|
|
27
|
-
marginBottom: '
|
|
28
|
-
|
|
29
|
-
borderBottom: `2px solid ${edgeColor}`,
|
|
30
|
-
}, children: [_jsx("div", { style: { fontWeight: theme.fontWeights.bold, fontSize: theme.fontSizes[1], fontFamily: theme.fonts.body, color: edgeColor }, children: "Edge Information" }), _jsx("button", { onClick: onClose, style: {
|
|
26
|
+
alignItems: 'flex-start',
|
|
27
|
+
marginBottom: '16px',
|
|
28
|
+
}, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '12px', flex: 1 }, children: [_jsx("div", { style: { fontWeight: theme.fontWeights.bold, fontSize: theme.fontSizes[2], fontFamily: theme.fonts.body, color: edgeColor }, children: "Edge Information" }), _jsx("div", { style: { fontSize: theme.fontSizes[0], fontFamily: theme.fonts.body, color: theme.colors.textMuted }, children: edge.type })] }), _jsx("button", { onClick: onClose, style: {
|
|
31
29
|
border: 'none',
|
|
32
30
|
background: 'none',
|
|
33
31
|
cursor: 'pointer',
|
|
34
32
|
fontSize: theme.fontSizes[3],
|
|
35
33
|
fontFamily: theme.fonts.body,
|
|
36
34
|
color: theme.colors.textSecondary,
|
|
37
|
-
padding: '
|
|
38
|
-
width: '
|
|
39
|
-
height: '
|
|
35
|
+
padding: '4px',
|
|
36
|
+
width: '28px',
|
|
37
|
+
height: '28px',
|
|
40
38
|
display: 'flex',
|
|
41
39
|
alignItems: 'center',
|
|
42
40
|
justifyContent: 'center',
|
|
43
|
-
}, children: "\u00D7" })] }), _jsxs("div", { style: { marginBottom: '12px' }, children: [_jsx("div", { style: { fontSize: theme.fontSizes[0], fontFamily: theme.fonts.body, color: theme.colors.textSecondary, marginBottom: '4px' }, children: "Type" }), _jsx("div", { style: {
|
|
44
|
-
fontSize: theme.fontSizes[0],
|
|
45
|
-
fontFamily: theme.fonts.body,
|
|
46
|
-
padding: '4px 8px',
|
|
47
|
-
backgroundColor: edgeColor,
|
|
48
|
-
color: theme.colors.background,
|
|
49
41
|
borderRadius: '4px',
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}, children: "Delete Edge" }))] }));
|
|
42
|
+
transition: 'background-color 0.15s',
|
|
43
|
+
}, onMouseEnter: (e) => {
|
|
44
|
+
e.currentTarget.style.backgroundColor = theme.colors.muted;
|
|
45
|
+
}, onMouseLeave: (e) => {
|
|
46
|
+
e.currentTarget.style.backgroundColor = 'transparent';
|
|
47
|
+
}, children: "\u00D7" })] }), _jsxs("div", { style: { display: 'flex', gap: '32px', alignItems: 'flex-start' }, children: [_jsxs("div", { style: { flex: 1 }, children: [_jsxs("div", { style: { marginBottom: '12px' }, children: [_jsx("div", { style: { fontSize: theme.fontSizes[0], fontFamily: theme.fonts.body, color: theme.colors.textSecondary, marginBottom: '4px' }, children: "Connection" }), _jsxs("div", { style: { fontSize: theme.fontSizes[0], fontFamily: theme.fonts.body }, children: [_jsx("span", { style: {
|
|
48
|
+
fontFamily: theme.fonts.monospace,
|
|
49
|
+
backgroundColor: theme.colors.muted,
|
|
50
|
+
padding: '2px 6px',
|
|
51
|
+
borderRadius: '3px',
|
|
52
|
+
}, children: sourceNodeId }), _jsx("span", { style: { margin: '0 8px', color: theme.colors.textMuted }, children: "\u2192" }), _jsx("span", { style: {
|
|
53
|
+
fontFamily: theme.fonts.monospace,
|
|
54
|
+
backgroundColor: theme.colors.muted,
|
|
55
|
+
padding: '2px 6px',
|
|
56
|
+
borderRadius: '3px',
|
|
57
|
+
}, children: targetNodeId })] })] }), _jsxs("div", { style: {
|
|
58
|
+
fontSize: theme.fontSizes[0],
|
|
59
|
+
fontFamily: theme.fonts.body,
|
|
60
|
+
color: theme.colors.textMuted,
|
|
61
|
+
}, children: ["ID: ", edge.id] })] }), _jsxs("div", { style: { flex: 1 }, children: [_jsx("div", { style: { fontSize: theme.fontSizes[0], fontFamily: theme.fonts.body, color: theme.colors.textSecondary, marginBottom: '8px' }, children: "Connection Sides" }), _jsxs("div", { style: { display: 'flex', gap: '12px' }, children: [_jsxs("div", { style: { flex: 1 }, children: [_jsx("div", { style: { fontSize: theme.fontSizes[0], fontFamily: theme.fonts.body, color: theme.colors.textMuted, marginBottom: '4px' }, children: "From Side" }), _jsx("select", { value: edge.data?.fromSide || 'right', onChange: (e) => {
|
|
62
|
+
if (onUpdateSides) {
|
|
63
|
+
onUpdateSides(edge.id, e.target.value, edge.data?.toSide || 'left');
|
|
64
|
+
}
|
|
65
|
+
}, disabled: !onUpdateSides, style: {
|
|
66
|
+
width: '100%',
|
|
67
|
+
padding: '6px 8px',
|
|
68
|
+
fontSize: theme.fontSizes[0],
|
|
69
|
+
fontFamily: theme.fonts.body,
|
|
70
|
+
borderRadius: '4px',
|
|
71
|
+
border: `1px solid ${theme.colors.border}`,
|
|
72
|
+
backgroundColor: theme.colors.background,
|
|
73
|
+
color: theme.colors.text,
|
|
74
|
+
cursor: onUpdateSides ? 'pointer' : 'not-allowed',
|
|
75
|
+
opacity: onUpdateSides ? 1 : 0.6,
|
|
76
|
+
}, children: SIDE_OPTIONS.map((side) => (_jsx("option", { value: side, children: side }, side))) })] }), _jsxs("div", { style: { flex: 1 }, children: [_jsx("div", { style: { fontSize: theme.fontSizes[0], fontFamily: theme.fonts.body, color: theme.colors.textMuted, marginBottom: '4px' }, children: "To Side" }), _jsx("select", { value: edge.data?.toSide || 'left', onChange: (e) => {
|
|
77
|
+
if (onUpdateSides) {
|
|
78
|
+
onUpdateSides(edge.id, edge.data?.fromSide || 'right', e.target.value);
|
|
79
|
+
}
|
|
80
|
+
}, disabled: !onUpdateSides, style: {
|
|
81
|
+
width: '100%',
|
|
82
|
+
padding: '6px 8px',
|
|
83
|
+
fontSize: theme.fontSizes[0],
|
|
84
|
+
fontFamily: theme.fonts.body,
|
|
85
|
+
borderRadius: '4px',
|
|
86
|
+
border: `1px solid ${theme.colors.border}`,
|
|
87
|
+
backgroundColor: theme.colors.background,
|
|
88
|
+
color: theme.colors.text,
|
|
89
|
+
cursor: onUpdateSides ? 'pointer' : 'not-allowed',
|
|
90
|
+
opacity: onUpdateSides ? 1 : 0.6,
|
|
91
|
+
}, children: SIDE_OPTIONS.map((side) => (_jsx("option", { value: side, children: side }, side))) })] })] })] }), onDelete && (_jsx("div", { style: { display: 'flex', alignItems: 'flex-end' }, children: _jsx("button", { onClick: () => {
|
|
92
|
+
onDelete(edge.id);
|
|
93
|
+
onClose();
|
|
94
|
+
}, style: {
|
|
95
|
+
padding: '8px 16px',
|
|
96
|
+
backgroundColor: theme.colors.error,
|
|
97
|
+
color: theme.colors.background,
|
|
98
|
+
border: 'none',
|
|
99
|
+
borderRadius: '4px',
|
|
100
|
+
cursor: 'pointer',
|
|
101
|
+
fontSize: theme.fontSizes[0],
|
|
102
|
+
fontFamily: theme.fonts.body,
|
|
103
|
+
fontWeight: theme.fontWeights.bold,
|
|
104
|
+
}, children: "Delete Edge" }) }))] })] }));
|
|
114
105
|
};
|
|
115
106
|
//# sourceMappingURL=EdgeInfoPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EdgeInfoPanel.js","sourceRoot":"","sources":["../../src/components/EdgeInfoPanel.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAczD;;GAEG;AACH,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAEjE,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAC1D,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,aAAa,GACd,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;IAE/D,OAAO,CACL,eACE,KAAK,EAAE;YACL,QA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AU;oDACxC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;oDACxB,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa;oDACjD,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;iDACjC,YAEA,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC1B,iBAAmB,KAAK,EAAE,IAAI,YAC3B,IAAI,IADM,IAAI,CAER,CACV,CAAC,GACK,IACL,IACF,IACF,EAGL,QAAQ,IAAI,CACX,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,YACrD,iBACE,OAAO,EAAE,GAAG,EAAE;gCACZ,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gCAClB,OAAO,EAAE,CAAC;4BACZ,CAAC,EACD,KAAK,EAAE;gCACL,OAAO,EAAE,UAAU;gCACnB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK;gCACnC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU;gCAC9B,MAAM,EAAE,MAAM;gCACd,YAAY,EAAE,KAAK;gCACnB,MAAM,EAAE,SAAS;gCACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;gCAC5B,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI;gCAC5B,UAAU,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI;6BACnC,4BAGM,GACL,CACP,IACG,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import '@xyflow/react/dist/style.css';
|
|
3
|
-
import type { Violation, GraphEvent, ExtendedCanvas, ComponentLibrary } from '@principal-ai/principal-view-core
|
|
3
|
+
import type { Violation, GraphEvent, ExtendedCanvas, ComponentLibrary } from '@principal-ai/principal-view-core';
|
|
4
4
|
/** Position change event for tracking node movements */
|
|
5
5
|
export interface NodePositionChange {
|
|
6
6
|
nodeId: string;
|
|
@@ -143,6 +143,13 @@ interface GraphRendererBaseProps {
|
|
|
143
143
|
* Receives the node ID and the click event. If provided, overrides default node selection behavior.
|
|
144
144
|
*/
|
|
145
145
|
onNodeClick?: (nodeId: string, event: React.MouseEvent) => void;
|
|
146
|
+
/**
|
|
147
|
+
* Whether to show the node detail panel when nodes are clicked.
|
|
148
|
+
* Defaults to undefined (auto), which shows panel only when onNodeClick is not provided.
|
|
149
|
+
* Set to true to force showing panel even with custom onNodeClick handler.
|
|
150
|
+
* Set to false to hide panel completely.
|
|
151
|
+
*/
|
|
152
|
+
showNodeDetailPanel?: boolean;
|
|
146
153
|
}
|
|
147
154
|
/** GraphRenderer props - canvas format only */
|
|
148
155
|
export interface GraphRendererProps extends GraphRendererBaseProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphRenderer.d.ts","sourceRoot":"","sources":["../../src/components/GraphRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAmBf,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAIV,SAAS,EACT,UAAU,EAIV,cAAc,EACd,gBAAgB,EAEjB,MAAM,
|
|
1
|
+
{"version":3,"file":"GraphRenderer.d.ts","sourceRoot":"","sources":["../../src/components/GraphRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAmBf,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAIV,SAAS,EACT,UAAU,EAIV,cAAc,EACd,gBAAgB,EAEjB,MAAM,mCAAmC,CAAC;AAe3C,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;C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AAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAEzD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAEhE;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAE/B;AAED,+CAA+C;AAC/C,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB;IAChE,+BAA+B;IAC/B,MAAM,EAAE,cAAc,CAAC;IAEvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAohDD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa,gGA6JxB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useMemo, useState, useEffect, useCallback, useRef, useImperativeHandle, forwardRef, } from 'react';
|
|
3
3
|
import { ReactFlow, Background, BackgroundVariant, Controls, MiniMap, ReactFlowProvider, useReactFlow, useUpdateNodeInternals, useViewport, applyNodeChanges, applyEdgeChanges, } from '@xyflow/react';
|
|
4
4
|
import '@xyflow/react/dist/style.css';
|
|
5
|
-
import { CanvasConverter } from '@principal-ai/principal-view-core
|
|
5
|
+
import { CanvasConverter } from '@principal-ai/principal-view-core';
|
|
6
6
|
import { useTheme } from '@principal-ade/industry-theme';
|
|
7
7
|
import { CustomNode } from '../nodes/CustomNode';
|
|
8
8
|
import { CustomEdge } from '../edges/CustomEdge';
|
|
@@ -51,7 +51,7 @@ const CenterIndicator = ({ color }) => {
|
|
|
51
51
|
/**
|
|
52
52
|
* Inner component that uses ReactFlow hooks
|
|
53
53
|
*/
|
|
54
|
-
const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges, violations = [], configName: _configName, showMinimap = false, showControls = true, showBackground = true, backgroundVariant = 'dots', backgroundGap, showCenterIndicator = false, showTooltips = true, fitViewDuration = 200, highlightedNodeId, activeNodeIds, events = [], onEventProcessed, editable = false, onPendingChangesChange, onEditStateChange, editStateRef, onSourceClick, onNodeClick: onNodeClickProp, }) => {
|
|
54
|
+
const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges, violations = [], configName: _configName, showMinimap = false, showControls = true, showBackground = true, backgroundVariant = 'dots', backgroundGap, showCenterIndicator = false, showTooltips = true, fitViewDuration = 200, highlightedNodeId, activeNodeIds, events = [], onEventProcessed, editable = false, onPendingChangesChange, onEditStateChange, editStateRef, onSourceClick, onNodeClick: onNodeClickProp, showNodeDetailPanel, }) => {
|
|
55
55
|
const { fitView } = useReactFlow();
|
|
56
56
|
const updateNodeInternals = useUpdateNodeInternals();
|
|
57
57
|
const { theme } = useTheme();
|
|
@@ -196,40 +196,47 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
|
|
|
196
196
|
}, [editable, selectedEdgeIds]);
|
|
197
197
|
// Handle node click (toggle selection, supports Shift for multi-select)
|
|
198
198
|
const onNodeClick = useCallback((event, node) => {
|
|
199
|
-
//
|
|
199
|
+
// Determine if we should show the panel based on showNodeDetailPanel prop
|
|
200
|
+
const shouldManagePanel = showNodeDetailPanel !== false && (showNodeDetailPanel === true || !onNodeClickProp);
|
|
201
|
+
// If custom node click handler is provided, call it
|
|
200
202
|
if (onNodeClickProp) {
|
|
201
203
|
onNodeClickProp(node.id, event);
|
|
202
|
-
return
|
|
204
|
+
// If showNodeDetailPanel is not explicitly true, return early (old behavior)
|
|
205
|
+
if (showNodeDetailPanel !== true) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
203
208
|
}
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
next.
|
|
209
|
+
if (shouldManagePanel) {
|
|
210
|
+
if (event.shiftKey && editable) {
|
|
211
|
+
// Shift+click: toggle node in selection
|
|
212
|
+
setSelectedNodeIds((prev) => {
|
|
213
|
+
const next = new Set(prev);
|
|
214
|
+
if (next.has(node.id)) {
|
|
215
|
+
next.delete(node.id);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
next.add(node.id);
|
|
219
|
+
}
|
|
220
|
+
return next;
|
|
221
|
+
});
|
|
222
|
+
setShowNodePanel(true);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
// Regular click: single select (replace selection)
|
|
226
|
+
const shouldDeselect = selectedNodeIds.size === 1 && selectedNodeIds.has(node.id);
|
|
227
|
+
if (shouldDeselect) {
|
|
228
|
+
setSelectedNodeIds(new Set());
|
|
229
|
+
setShowNodePanel(false);
|
|
210
230
|
}
|
|
211
231
|
else {
|
|
212
|
-
|
|
232
|
+
setSelectedNodeIds(new Set([node.id]));
|
|
233
|
+
setShowNodePanel(true);
|
|
213
234
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
setShowNodePanel(true);
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
// Regular click: single select (replace selection)
|
|
220
|
-
const shouldDeselect = selectedNodeIds.size === 1 && selectedNodeIds.has(node.id);
|
|
221
|
-
if (shouldDeselect) {
|
|
222
|
-
setSelectedNodeIds(new Set());
|
|
223
|
-
setShowNodePanel(false);
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
setSelectedNodeIds(new Set([node.id]));
|
|
227
|
-
setShowNodePanel(true);
|
|
235
|
+
setSelectedEdgeIds(new Set());
|
|
236
|
+
setShowEdgePanel(false);
|
|
228
237
|
}
|
|
229
|
-
setSelectedEdgeIds(new Set());
|
|
230
|
-
setShowEdgePanel(false);
|
|
231
238
|
}
|
|
232
|
-
}, [editable, selectedNodeIds, onNodeClickProp]);
|
|
239
|
+
}, [editable, selectedNodeIds, onNodeClickProp, showNodeDetailPanel]);
|
|
233
240
|
// Handle close edge info panel
|
|
234
241
|
const onCloseEdgeInfoPanel = useCallback(() => {
|
|
235
242
|
setSelectedEdgeIds(new Set());
|
|
@@ -903,7 +910,7 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
|
|
|
903
910
|
: BackgroundVariant.Cross })), showControls && _jsx(Controls, { showZoom: true, showFitView: true, showInteractive: true }), showMinimap && (_jsx(MiniMap, { nodeColor: (node) => {
|
|
904
911
|
const nodeData = node.data;
|
|
905
912
|
return nodeData?.typeDefinition?.color || theme.colors.secondary;
|
|
906
|
-
}, nodeBorderRadius: 2, pannable: true, zoomable: true })), showCenterIndicator && _jsx(CenterIndicator, { color: theme.colors.textMuted })] }, `${baseNodesKey}-${baseEdgesKey}`), selectedNodeIds.size >= 2 && showNodePanel && (_jsx(SelectionSidebar, { selectedNodeIds: selectedNodeIds, nodes: nodes, nodeTypeDefinitions: configuration.nodeTypes, onClose: onCloseNodeInfoPanel })), selectedEdgeIds.size === 1 && selectedEdge && selectedEdgeTypeDefinition && showEdgePanel && (_jsx(EdgeInfoPanel, { edge: selectedEdge, typeDefinition: selectedEdgeTypeDefinition, sourceNodeId: selectedEdge.from, targetNodeId: selectedEdge.to, onClose: onCloseEdgeInfoPanel, onDelete: editable ? handleEdgeDelete : undefined, onUpdateSides: editable ? handleUpdateEdgeSides : undefined })), selectedNodeIds.size === 1 && selectedNode && selectedNodeTypeDefinition && showNodePanel && (_jsx(NodeInfoPanel, { node: selectedNode, typeDefinition: selectedNodeTypeDefinition, availableNodeTypes: configuration.nodeTypes, onClose: onCloseNodeInfoPanel, onDelete: editable ? handleNodeDelete : undefined, onUpdate: editable ? handleNodeUpdate : undefined, onSourceClick: onSourceClick })), pendingConnection && (_jsxs("div", { style: {
|
|
913
|
+
}, nodeBorderRadius: 2, pannable: true, zoomable: true })), showCenterIndicator && _jsx(CenterIndicator, { color: theme.colors.textMuted })] }, `${baseNodesKey}-${baseEdgesKey}`), selectedNodeIds.size >= 2 && showNodePanel && showNodeDetailPanel !== false && (_jsx(SelectionSidebar, { selectedNodeIds: selectedNodeIds, nodes: nodes, nodeTypeDefinitions: configuration.nodeTypes, onClose: onCloseNodeInfoPanel })), selectedEdgeIds.size === 1 && selectedEdge && selectedEdgeTypeDefinition && showEdgePanel && (_jsx(EdgeInfoPanel, { edge: selectedEdge, typeDefinition: selectedEdgeTypeDefinition, sourceNodeId: selectedEdge.from, targetNodeId: selectedEdge.to, onClose: onCloseEdgeInfoPanel, onDelete: editable ? handleEdgeDelete : undefined, onUpdateSides: editable ? handleUpdateEdgeSides : undefined })), selectedNodeIds.size === 1 && selectedNode && selectedNodeTypeDefinition && showNodePanel && showNodeDetailPanel !== false && (_jsx(NodeInfoPanel, { node: selectedNode, typeDefinition: selectedNodeTypeDefinition, availableNodeTypes: configuration.nodeTypes, onClose: onCloseNodeInfoPanel, onDelete: editable ? handleNodeDelete : undefined, onUpdate: editable ? handleNodeUpdate : undefined, onSourceClick: onSourceClick })), pendingConnection && (_jsxs("div", { style: {
|
|
907
914
|
position: 'absolute',
|
|
908
915
|
top: '50%',
|
|
909
916
|
left: '50%',
|
|
@@ -1176,8 +1183,8 @@ export const GraphRenderer = forwardRef((props, ref) => {
|
|
|
1176
1183
|
}
|
|
1177
1184
|
const { configuration, nodes, edges } = canvasData;
|
|
1178
1185
|
// Extract only the props that inner component needs
|
|
1179
|
-
const { violations, configName, showMinimap, showControls, showBackground, backgroundVariant, backgroundGap, showCenterIndicator, showTooltips, fitViewDuration, highlightedNodeId, activeNodeIds, events, onEventProcessed, editable, onPendingChangesChange, onSourceClick, onNodeClick, } = props;
|
|
1180
|
-
return (_jsx("div", { className: className, style: { width, height, position: 'relative' }, children: _jsx(ReactFlowProvider, { children: _jsx(GraphRendererInner, { configuration: configuration, nodes: nodes, edges: edges, violations: violations, configName: configName, showMinimap: showMinimap, showControls: showControls, showBackground: showBackground, backgroundVariant: backgroundVariant, backgroundGap: backgroundGap, showCenterIndicator: showCenterIndicator, showTooltips: showTooltips, fitViewDuration: fitViewDuration, highlightedNodeId: highlightedNodeId, activeNodeIds: activeNodeIds, events: events, onEventProcessed: onEventProcessed, editable: editable, onPendingChangesChange: onPendingChangesChange, editStateRef: editStateRef, onSourceClick: onSourceClick, onNodeClick: onNodeClick }) }) }));
|
|
1186
|
+
const { violations, configName, showMinimap, showControls, showBackground, backgroundVariant, backgroundGap, showCenterIndicator, showTooltips, fitViewDuration, highlightedNodeId, activeNodeIds, events, onEventProcessed, editable, onPendingChangesChange, onSourceClick, onNodeClick, showNodeDetailPanel, } = props;
|
|
1187
|
+
return (_jsx("div", { className: className, style: { width, height, position: 'relative' }, children: _jsx(ReactFlowProvider, { children: _jsx(GraphRendererInner, { configuration: configuration, nodes: nodes, edges: edges, violations: violations, configName: configName, showMinimap: showMinimap, showControls: showControls, showBackground: showBackground, backgroundVariant: backgroundVariant, backgroundGap: backgroundGap, showCenterIndicator: showCenterIndicator, showTooltips: showTooltips, fitViewDuration: fitViewDuration, highlightedNodeId: highlightedNodeId, activeNodeIds: activeNodeIds, events: events, onEventProcessed: onEventProcessed, editable: editable, onPendingChangesChange: onPendingChangesChange, editStateRef: editStateRef, onSourceClick: onSourceClick, onNodeClick: onNodeClick, showNodeDetailPanel: showNodeDetailPanel }) }) }));
|
|
1181
1188
|
});
|
|
1182
1189
|
GraphRenderer.displayName = 'GraphRenderer';
|
|
1183
1190
|
//# sourceMappingURL=GraphRenderer.js.map
|