@flowuent-org/diagramming-core 1.0.8 → 1.1.1
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/apps/diagramming/src/AutomationDiagramData.ts +22 -0
- package/apps/diagramming/src/components/AddNodeView.tsx +252 -252
- package/apps/diagramming/src/main.tsx +463 -463
- package/apps/diagramming/src/node-data.ts +664 -664
- package/apps/diagramming/src/stencil-items.ts +31 -31
- package/apps/diagramming/src/vite-env.d.ts +1 -1
- package/package.json +1 -1
- package/packages/diagrams/NODE_DATA_UPDATE_API.md +430 -430
- package/packages/diagrams/README.md +7 -463
- package/packages/diagrams/UNDO_REDO_API.md +306 -306
- package/packages/diagrams/package.json +27 -27
- package/packages/diagrams/project.json +42 -42
- package/packages/diagrams/rollup.config.js +26 -26
- package/packages/diagrams/src/DiagramFlow.tsx +7 -7
- package/packages/diagrams/src/index.ts +116 -116
- package/packages/diagrams/src/index.ts.bak +99 -99
- package/packages/diagrams/src/lib/atoms/CardEditableTitle.tsx +76 -76
- package/packages/diagrams/src/lib/atoms/ExpressionInput.tsx +437 -437
- package/packages/diagrams/src/lib/components/DiagramPanel.tsx +331 -331
- package/packages/diagrams/src/lib/components/automation/AISuggestionsModal.tsx +269 -0
- package/packages/diagrams/src/lib/components/automation/AISuggestionsPanel.tsx +227 -0
- package/packages/diagrams/src/lib/components/automation/AutomationAISuggestionNode.tsx +178 -115
- package/packages/diagrams/src/lib/components/automation/AutomationApiNode.tsx +133 -27
- package/packages/diagrams/src/lib/components/automation/AutomationEndNode.tsx +134 -28
- package/packages/diagrams/src/lib/components/automation/AutomationFormattingNode.tsx +132 -27
- package/packages/diagrams/src/lib/components/automation/AutomationNoteNode.tsx +124 -17
- package/packages/diagrams/src/lib/components/automation/AutomationSheetsNode.tsx +122 -15
- package/packages/diagrams/src/lib/components/automation/index.ts +3 -0
- package/packages/diagrams/src/lib/contexts/onWorkflowNodeDelete.ts +65 -65
- package/packages/diagrams/src/lib/organisms/CustomEdge/useCreateBendPoint.tsx +121 -121
- package/packages/diagrams/src/lib/organisms/WorkFlowNode/NodeActionButtons.tsx +45 -45
- package/packages/diagrams/src/lib/templates/node-forms/CallForm.tsx +370 -370
- package/packages/diagrams/src/lib/templates/systemFlow/components/FloatingEdge.tsx +219 -219
- package/packages/diagrams/src/lib/types/card-node.ts +68 -68
- package/packages/diagrams/src/lib/types/node-types.ts +29 -29
- package/packages/diagrams/src/lib/utils/AutomationExecutionEngine.ts +1179 -1179
- package/packages/diagrams/tsconfig.lib.json +25 -25
- package/tsconfig.base.json +29 -30
- package/TRANSLATION_FIX_SUMMARY.md +0 -118
- package/packages/diagrams/I18N_SETUP.md +0 -126
|
@@ -1,219 +1,219 @@
|
|
|
1
|
-
import React, { useCallback, useMemo, useRef, memo } from 'react';
|
|
2
|
-
import { EdgeProps, useReactFlow, Node, Edge } from '@xyflow/react';
|
|
3
|
-
import { getEdgeParams } from '../../../utils/nodeutils';
|
|
4
|
-
import { SystemFlowEdgeData } from '../../../types/system-flow-types';
|
|
5
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
6
|
-
|
|
7
|
-
const FloatingEdge = ({
|
|
8
|
-
id,
|
|
9
|
-
source,
|
|
10
|
-
target,
|
|
11
|
-
data,
|
|
12
|
-
style = {},
|
|
13
|
-
}: EdgeProps) => {
|
|
14
|
-
const { getNodes, setNodes, setEdges, screenToFlowPosition } = useReactFlow();
|
|
15
|
-
const nodes = getNodes();
|
|
16
|
-
const pathRef = useRef<SVGPathElement>(null);
|
|
17
|
-
|
|
18
|
-
// Double click handler to create a bendpoint
|
|
19
|
-
const onEdgeDoubleClick = useCallback(
|
|
20
|
-
(evt: React.MouseEvent<SVGPathElement, MouseEvent>) => {
|
|
21
|
-
evt.preventDefault();
|
|
22
|
-
evt.stopPropagation();
|
|
23
|
-
if (!pathRef.current) return;
|
|
24
|
-
|
|
25
|
-
const flowPosition = screenToFlowPosition({
|
|
26
|
-
x: evt.clientX,
|
|
27
|
-
y: evt.clientY,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const bendpointId = `bendpoint-${uuidv4()}`;
|
|
31
|
-
const newNode = {
|
|
32
|
-
id: bendpointId,
|
|
33
|
-
type: 'bendpoint',
|
|
34
|
-
position: flowPosition,
|
|
35
|
-
data: {},
|
|
36
|
-
measured: { width: 5, height: 5 },
|
|
37
|
-
width: 5,
|
|
38
|
-
height: 5,
|
|
39
|
-
draggable: true,
|
|
40
|
-
deletable: true,
|
|
41
|
-
selectable: true,
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const newEdge = {
|
|
45
|
-
id: `edge-${uuidv4()}`,
|
|
46
|
-
source: bendpointId,
|
|
47
|
-
target,
|
|
48
|
-
type: 'floatingEdge',
|
|
49
|
-
data: {
|
|
50
|
-
...data,
|
|
51
|
-
// Ensure bendpoint edges don't have arrows by default
|
|
52
|
-
arrowHeadLeft: 'none',
|
|
53
|
-
arrowHeadRight: 'none'
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const updatedEdge = {
|
|
58
|
-
id,
|
|
59
|
-
source,
|
|
60
|
-
target: bendpointId,
|
|
61
|
-
type: 'floatingEdge',
|
|
62
|
-
data: {
|
|
63
|
-
...data,
|
|
64
|
-
// Ensure bendpoint edges don't have arrows by default
|
|
65
|
-
arrowHeadLeft: 'none',
|
|
66
|
-
arrowHeadRight: 'none'
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
setNodes((nds) => [...nds, newNode]);
|
|
71
|
-
setEdges((eds) => {
|
|
72
|
-
const filteredEdges = eds.filter((e) => e.id !== id);
|
|
73
|
-
return [...filteredEdges, updatedEdge, newEdge];
|
|
74
|
-
});
|
|
75
|
-
},
|
|
76
|
-
[id, source, target, data, setNodes, setEdges, screenToFlowPosition]
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
// Memoize node lookup for source and target
|
|
80
|
-
const [sourceNodeRaw, targetNodeRaw] = useMemo(() => [
|
|
81
|
-
nodes.find((n: Node) => n.id === source),
|
|
82
|
-
nodes.find((n: Node) => n.id === target)
|
|
83
|
-
], [nodes, source, target]);
|
|
84
|
-
|
|
85
|
-
if (!sourceNodeRaw || !targetNodeRaw) return null;
|
|
86
|
-
|
|
87
|
-
// Get absolute position of a node, including parent offsets
|
|
88
|
-
const getAbsolutePosition = useCallback((node: Node): { x: number, y: number } => {
|
|
89
|
-
return node.position;
|
|
90
|
-
}, []);
|
|
91
|
-
|
|
92
|
-
// Normalize bendpoint node size for edge calculation
|
|
93
|
-
const shrinkForEdgeCalc = useCallback((node: Node) => {
|
|
94
|
-
if (!node) return node;
|
|
95
|
-
if (node.type === 'bendpoint') {
|
|
96
|
-
return {
|
|
97
|
-
...node,
|
|
98
|
-
width: 5,
|
|
99
|
-
height: 5,
|
|
100
|
-
measured: { width: 5, height: 5 },
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
return node;
|
|
104
|
-
}, []);
|
|
105
|
-
|
|
106
|
-
// Memoize absolute positions and safe node objects
|
|
107
|
-
const { sourceNode, targetNode, safeNodes } = useMemo(() => {
|
|
108
|
-
const sourceAbs = getAbsolutePosition(sourceNodeRaw);
|
|
109
|
-
const targetAbs = getAbsolutePosition(targetNodeRaw);
|
|
110
|
-
return {
|
|
111
|
-
sourceNode: {
|
|
112
|
-
...sourceNodeRaw,
|
|
113
|
-
position: sourceAbs,
|
|
114
|
-
width: sourceNodeRaw.width || 120,
|
|
115
|
-
height: sourceNodeRaw.height || 40,
|
|
116
|
-
},
|
|
117
|
-
targetNode: {
|
|
118
|
-
...targetNodeRaw,
|
|
119
|
-
position: targetAbs,
|
|
120
|
-
width: targetNodeRaw.width || 120,
|
|
121
|
-
height: targetNodeRaw.height || 40,
|
|
122
|
-
},
|
|
123
|
-
safeNodes: nodes.map((n) => {
|
|
124
|
-
const normalizedNode = shrinkForEdgeCalc(n);
|
|
125
|
-
return {
|
|
126
|
-
...normalizedNode,
|
|
127
|
-
width: normalizedNode.width || 120,
|
|
128
|
-
height: normalizedNode.height || 40,
|
|
129
|
-
};
|
|
130
|
-
}),
|
|
131
|
-
};
|
|
132
|
-
}, [getAbsolutePosition, sourceNodeRaw, targetNodeRaw, nodes]);
|
|
133
|
-
|
|
134
|
-
// Edge params for floating positioning
|
|
135
|
-
const {
|
|
136
|
-
sourceX,
|
|
137
|
-
sourceY,
|
|
138
|
-
targetX,
|
|
139
|
-
targetY,
|
|
140
|
-
sourcePosition,
|
|
141
|
-
targetPosition,
|
|
142
|
-
} = useMemo(() => getEdgeParams(
|
|
143
|
-
sourceNode,
|
|
144
|
-
targetNode,
|
|
145
|
-
undefined,
|
|
146
|
-
2,
|
|
147
|
-
'system-flow',
|
|
148
|
-
safeNodes
|
|
149
|
-
), [sourceNode, targetNode, safeNodes]);
|
|
150
|
-
|
|
151
|
-
// Calculate straight line edge path connecting directly to nodes
|
|
152
|
-
const edgePath = useMemo(() => {
|
|
153
|
-
// Use the exact edge connection points without any offset
|
|
154
|
-
// The sourceX, sourceY, targetX, targetY are already calculated to be on the node edges
|
|
155
|
-
return `M ${sourceX} ${sourceY} L ${targetX} ${targetY}`;
|
|
156
|
-
}, [sourceX, sourceY, targetX, targetY]);
|
|
157
|
-
|
|
158
|
-
// Marker IDs for arrowheads
|
|
159
|
-
const markerStartId = `${id}-floating-marker-start`;
|
|
160
|
-
const markerEndId = `${id}-floating-marker-end`;
|
|
161
|
-
const edgeData = data as SystemFlowEdgeData;
|
|
162
|
-
|
|
163
|
-
// For bendpoint edges, don't show arrows by default unless explicitly set
|
|
164
|
-
const isBendpointEdge = sourceNodeRaw?.type === 'bendpoint' || targetNodeRaw?.type === 'bendpoint';
|
|
165
|
-
const showStart = edgeData?.arrowHeadLeft === 'v';
|
|
166
|
-
const showEnd = isBendpointEdge ? false : (edgeData?.arrowHeadRight === 'v');
|
|
167
|
-
|
|
168
|
-
const edgeColor = edgeData?.color || "#666";
|
|
169
|
-
|
|
170
|
-
return (
|
|
171
|
-
<>
|
|
172
|
-
<defs>
|
|
173
|
-
{showStart && (
|
|
174
|
-
<marker
|
|
175
|
-
id={markerStartId}
|
|
176
|
-
markerWidth="8"
|
|
177
|
-
markerHeight="8"
|
|
178
|
-
refX="7"
|
|
179
|
-
refY="4"
|
|
180
|
-
orient="auto"
|
|
181
|
-
markerUnits="strokeWidth"
|
|
182
|
-
>
|
|
183
|
-
<path d="M8,0 L0,4 L8,8" fill="none" stroke={edgeColor} strokeWidth="1" />
|
|
184
|
-
</marker>
|
|
185
|
-
)}
|
|
186
|
-
{showEnd && (
|
|
187
|
-
<marker
|
|
188
|
-
id={markerEndId}
|
|
189
|
-
markerWidth="8"
|
|
190
|
-
markerHeight="8"
|
|
191
|
-
refX="7"
|
|
192
|
-
refY="4"
|
|
193
|
-
orient="auto"
|
|
194
|
-
markerUnits="strokeWidth"
|
|
195
|
-
>
|
|
196
|
-
<path d="M0,0 L8,4 L0,8" fill="none" stroke={edgeColor} strokeWidth="1" />
|
|
197
|
-
</marker>
|
|
198
|
-
)}
|
|
199
|
-
</defs>
|
|
200
|
-
<path
|
|
201
|
-
ref={pathRef}
|
|
202
|
-
id={id}
|
|
203
|
-
style={{
|
|
204
|
-
...(style as React.CSSProperties),
|
|
205
|
-
strokeWidth: 2,
|
|
206
|
-
stroke: edgeColor,
|
|
207
|
-
fill: "none",
|
|
208
|
-
}}
|
|
209
|
-
className="react-flow__edge-path"
|
|
210
|
-
d={edgePath}
|
|
211
|
-
markerStart={showStart ? `url(#${markerStartId})` : undefined}
|
|
212
|
-
markerEnd={showEnd ? `url(#${markerEndId})` : undefined}
|
|
213
|
-
onDoubleClick={onEdgeDoubleClick}
|
|
214
|
-
/>
|
|
215
|
-
</>
|
|
216
|
-
);
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
export default memo(FloatingEdge);
|
|
1
|
+
import React, { useCallback, useMemo, useRef, memo } from 'react';
|
|
2
|
+
import { EdgeProps, useReactFlow, Node, Edge } from '@xyflow/react';
|
|
3
|
+
import { getEdgeParams } from '../../../utils/nodeutils';
|
|
4
|
+
import { SystemFlowEdgeData } from '../../../types/system-flow-types';
|
|
5
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
6
|
+
|
|
7
|
+
const FloatingEdge = ({
|
|
8
|
+
id,
|
|
9
|
+
source,
|
|
10
|
+
target,
|
|
11
|
+
data,
|
|
12
|
+
style = {},
|
|
13
|
+
}: EdgeProps) => {
|
|
14
|
+
const { getNodes, setNodes, setEdges, screenToFlowPosition } = useReactFlow();
|
|
15
|
+
const nodes = getNodes();
|
|
16
|
+
const pathRef = useRef<SVGPathElement>(null);
|
|
17
|
+
|
|
18
|
+
// Double click handler to create a bendpoint
|
|
19
|
+
const onEdgeDoubleClick = useCallback(
|
|
20
|
+
(evt: React.MouseEvent<SVGPathElement, MouseEvent>) => {
|
|
21
|
+
evt.preventDefault();
|
|
22
|
+
evt.stopPropagation();
|
|
23
|
+
if (!pathRef.current) return;
|
|
24
|
+
|
|
25
|
+
const flowPosition = screenToFlowPosition({
|
|
26
|
+
x: evt.clientX,
|
|
27
|
+
y: evt.clientY,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const bendpointId = `bendpoint-${uuidv4()}`;
|
|
31
|
+
const newNode = {
|
|
32
|
+
id: bendpointId,
|
|
33
|
+
type: 'bendpoint',
|
|
34
|
+
position: flowPosition,
|
|
35
|
+
data: {},
|
|
36
|
+
measured: { width: 5, height: 5 },
|
|
37
|
+
width: 5,
|
|
38
|
+
height: 5,
|
|
39
|
+
draggable: true,
|
|
40
|
+
deletable: true,
|
|
41
|
+
selectable: true,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const newEdge = {
|
|
45
|
+
id: `edge-${uuidv4()}`,
|
|
46
|
+
source: bendpointId,
|
|
47
|
+
target,
|
|
48
|
+
type: 'floatingEdge',
|
|
49
|
+
data: {
|
|
50
|
+
...data,
|
|
51
|
+
// Ensure bendpoint edges don't have arrows by default
|
|
52
|
+
arrowHeadLeft: 'none',
|
|
53
|
+
arrowHeadRight: 'none'
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const updatedEdge = {
|
|
58
|
+
id,
|
|
59
|
+
source,
|
|
60
|
+
target: bendpointId,
|
|
61
|
+
type: 'floatingEdge',
|
|
62
|
+
data: {
|
|
63
|
+
...data,
|
|
64
|
+
// Ensure bendpoint edges don't have arrows by default
|
|
65
|
+
arrowHeadLeft: 'none',
|
|
66
|
+
arrowHeadRight: 'none'
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
setNodes((nds) => [...nds, newNode]);
|
|
71
|
+
setEdges((eds) => {
|
|
72
|
+
const filteredEdges = eds.filter((e) => e.id !== id);
|
|
73
|
+
return [...filteredEdges, updatedEdge, newEdge];
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
[id, source, target, data, setNodes, setEdges, screenToFlowPosition]
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
// Memoize node lookup for source and target
|
|
80
|
+
const [sourceNodeRaw, targetNodeRaw] = useMemo(() => [
|
|
81
|
+
nodes.find((n: Node) => n.id === source),
|
|
82
|
+
nodes.find((n: Node) => n.id === target)
|
|
83
|
+
], [nodes, source, target]);
|
|
84
|
+
|
|
85
|
+
if (!sourceNodeRaw || !targetNodeRaw) return null;
|
|
86
|
+
|
|
87
|
+
// Get absolute position of a node, including parent offsets
|
|
88
|
+
const getAbsolutePosition = useCallback((node: Node): { x: number, y: number } => {
|
|
89
|
+
return node.position;
|
|
90
|
+
}, []);
|
|
91
|
+
|
|
92
|
+
// Normalize bendpoint node size for edge calculation
|
|
93
|
+
const shrinkForEdgeCalc = useCallback((node: Node) => {
|
|
94
|
+
if (!node) return node;
|
|
95
|
+
if (node.type === 'bendpoint') {
|
|
96
|
+
return {
|
|
97
|
+
...node,
|
|
98
|
+
width: 5,
|
|
99
|
+
height: 5,
|
|
100
|
+
measured: { width: 5, height: 5 },
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
return node;
|
|
104
|
+
}, []);
|
|
105
|
+
|
|
106
|
+
// Memoize absolute positions and safe node objects
|
|
107
|
+
const { sourceNode, targetNode, safeNodes } = useMemo(() => {
|
|
108
|
+
const sourceAbs = getAbsolutePosition(sourceNodeRaw);
|
|
109
|
+
const targetAbs = getAbsolutePosition(targetNodeRaw);
|
|
110
|
+
return {
|
|
111
|
+
sourceNode: {
|
|
112
|
+
...sourceNodeRaw,
|
|
113
|
+
position: sourceAbs,
|
|
114
|
+
width: sourceNodeRaw.width || 120,
|
|
115
|
+
height: sourceNodeRaw.height || 40,
|
|
116
|
+
},
|
|
117
|
+
targetNode: {
|
|
118
|
+
...targetNodeRaw,
|
|
119
|
+
position: targetAbs,
|
|
120
|
+
width: targetNodeRaw.width || 120,
|
|
121
|
+
height: targetNodeRaw.height || 40,
|
|
122
|
+
},
|
|
123
|
+
safeNodes: nodes.map((n) => {
|
|
124
|
+
const normalizedNode = shrinkForEdgeCalc(n);
|
|
125
|
+
return {
|
|
126
|
+
...normalizedNode,
|
|
127
|
+
width: normalizedNode.width || 120,
|
|
128
|
+
height: normalizedNode.height || 40,
|
|
129
|
+
};
|
|
130
|
+
}),
|
|
131
|
+
};
|
|
132
|
+
}, [getAbsolutePosition, sourceNodeRaw, targetNodeRaw, nodes]);
|
|
133
|
+
|
|
134
|
+
// Edge params for floating positioning
|
|
135
|
+
const {
|
|
136
|
+
sourceX,
|
|
137
|
+
sourceY,
|
|
138
|
+
targetX,
|
|
139
|
+
targetY,
|
|
140
|
+
sourcePosition,
|
|
141
|
+
targetPosition,
|
|
142
|
+
} = useMemo(() => getEdgeParams(
|
|
143
|
+
sourceNode,
|
|
144
|
+
targetNode,
|
|
145
|
+
undefined,
|
|
146
|
+
2,
|
|
147
|
+
'system-flow',
|
|
148
|
+
safeNodes
|
|
149
|
+
), [sourceNode, targetNode, safeNodes]);
|
|
150
|
+
|
|
151
|
+
// Calculate straight line edge path connecting directly to nodes
|
|
152
|
+
const edgePath = useMemo(() => {
|
|
153
|
+
// Use the exact edge connection points without any offset
|
|
154
|
+
// The sourceX, sourceY, targetX, targetY are already calculated to be on the node edges
|
|
155
|
+
return `M ${sourceX} ${sourceY} L ${targetX} ${targetY}`;
|
|
156
|
+
}, [sourceX, sourceY, targetX, targetY]);
|
|
157
|
+
|
|
158
|
+
// Marker IDs for arrowheads
|
|
159
|
+
const markerStartId = `${id}-floating-marker-start`;
|
|
160
|
+
const markerEndId = `${id}-floating-marker-end`;
|
|
161
|
+
const edgeData = data as SystemFlowEdgeData;
|
|
162
|
+
|
|
163
|
+
// For bendpoint edges, don't show arrows by default unless explicitly set
|
|
164
|
+
const isBendpointEdge = sourceNodeRaw?.type === 'bendpoint' || targetNodeRaw?.type === 'bendpoint';
|
|
165
|
+
const showStart = edgeData?.arrowHeadLeft === 'v';
|
|
166
|
+
const showEnd = isBendpointEdge ? false : (edgeData?.arrowHeadRight === 'v');
|
|
167
|
+
|
|
168
|
+
const edgeColor = edgeData?.color || "#666";
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<>
|
|
172
|
+
<defs>
|
|
173
|
+
{showStart && (
|
|
174
|
+
<marker
|
|
175
|
+
id={markerStartId}
|
|
176
|
+
markerWidth="8"
|
|
177
|
+
markerHeight="8"
|
|
178
|
+
refX="7"
|
|
179
|
+
refY="4"
|
|
180
|
+
orient="auto"
|
|
181
|
+
markerUnits="strokeWidth"
|
|
182
|
+
>
|
|
183
|
+
<path d="M8,0 L0,4 L8,8" fill="none" stroke={edgeColor} strokeWidth="1" />
|
|
184
|
+
</marker>
|
|
185
|
+
)}
|
|
186
|
+
{showEnd && (
|
|
187
|
+
<marker
|
|
188
|
+
id={markerEndId}
|
|
189
|
+
markerWidth="8"
|
|
190
|
+
markerHeight="8"
|
|
191
|
+
refX="7"
|
|
192
|
+
refY="4"
|
|
193
|
+
orient="auto"
|
|
194
|
+
markerUnits="strokeWidth"
|
|
195
|
+
>
|
|
196
|
+
<path d="M0,0 L8,4 L0,8" fill="none" stroke={edgeColor} strokeWidth="1" />
|
|
197
|
+
</marker>
|
|
198
|
+
)}
|
|
199
|
+
</defs>
|
|
200
|
+
<path
|
|
201
|
+
ref={pathRef}
|
|
202
|
+
id={id}
|
|
203
|
+
style={{
|
|
204
|
+
...(style as React.CSSProperties),
|
|
205
|
+
strokeWidth: 2,
|
|
206
|
+
stroke: edgeColor,
|
|
207
|
+
fill: "none",
|
|
208
|
+
}}
|
|
209
|
+
className="react-flow__edge-path"
|
|
210
|
+
d={edgePath}
|
|
211
|
+
markerStart={showStart ? `url(#${markerStartId})` : undefined}
|
|
212
|
+
markerEnd={showEnd ? `url(#${markerEndId})` : undefined}
|
|
213
|
+
onDoubleClick={onEdgeDoubleClick}
|
|
214
|
+
/>
|
|
215
|
+
</>
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
export default memo(FloatingEdge);
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { Node } from '@xyflow/react';
|
|
2
|
-
import { blockTypes } from '../organisms/Card/card.params';
|
|
3
|
-
import { colorMap } from './colors';
|
|
4
|
-
import { RuleGroup } from './condition-builder';
|
|
5
|
-
import { NodeForm } from './workflow-node-data-types';
|
|
6
|
-
|
|
7
|
-
export type NodeDirection = 'bottom' | 'right' | 'left' | 'middle' | 'top';
|
|
8
|
-
export type NodeVariant =
|
|
9
|
-
| 'parallel'
|
|
10
|
-
| 'branch'
|
|
11
|
-
| 'group'
|
|
12
|
-
| 'return'
|
|
13
|
-
| 'loop'
|
|
14
|
-
| 'switch'
|
|
15
|
-
| 'try'
|
|
16
|
-
| 'catch'
|
|
17
|
-
| 'tryCatch'
|
|
18
|
-
| 'forLoop'
|
|
19
|
-
| 'emptyNode'
|
|
20
|
-
| 'entity'
|
|
21
|
-
| 'call'
|
|
22
|
-
| 'function'
|
|
23
|
-
| 'let'
|
|
24
|
-
| 'set';
|
|
25
|
-
|
|
26
|
-
export interface ICardNodeData {
|
|
27
|
-
isBlock?: boolean;
|
|
28
|
-
nodeId: string;
|
|
29
|
-
blocks?: IBlock[];
|
|
30
|
-
title?: string;
|
|
31
|
-
color?: keyof typeof colorMap;
|
|
32
|
-
sideHandles?: boolean;
|
|
33
|
-
img?: string;
|
|
34
|
-
caseCount?: number;
|
|
35
|
-
falseCase?: string;
|
|
36
|
-
trueCase?: string;
|
|
37
|
-
label?: string;
|
|
38
|
-
variant?: NodeVariant;
|
|
39
|
-
branchIndex?: number | 'default';
|
|
40
|
-
parallelColIndex?: number;
|
|
41
|
-
parallelChildrenCount?: number;
|
|
42
|
-
isRoot?: boolean;
|
|
43
|
-
finalNodeId?: string;
|
|
44
|
-
type?: NodeVariant;
|
|
45
|
-
formData?: NodeForm;
|
|
46
|
-
conditions?: RuleGroup;
|
|
47
|
-
isPinned?: boolean;
|
|
48
|
-
isHidden?: boolean; // Add visibility flag for expandable functionality
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface IBlock {
|
|
52
|
-
id: string;
|
|
53
|
-
color: keyof typeof colorMap;
|
|
54
|
-
title: string;
|
|
55
|
-
type?: IBlockType;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export type IBlockType = keyof typeof blockTypes;
|
|
59
|
-
|
|
60
|
-
export type ICardNode = Node & {
|
|
61
|
-
type: 'entity' | 'workflow' | 'bendPoint';
|
|
62
|
-
draggable?: boolean;
|
|
63
|
-
width?: number;
|
|
64
|
-
height?: number;
|
|
65
|
-
parentId?: string | null;
|
|
66
|
-
subParentId?: string | null;
|
|
67
|
-
data: ICardNodeData;
|
|
68
|
-
};
|
|
1
|
+
import { Node } from '@xyflow/react';
|
|
2
|
+
import { blockTypes } from '../organisms/Card/card.params';
|
|
3
|
+
import { colorMap } from './colors';
|
|
4
|
+
import { RuleGroup } from './condition-builder';
|
|
5
|
+
import { NodeForm } from './workflow-node-data-types';
|
|
6
|
+
|
|
7
|
+
export type NodeDirection = 'bottom' | 'right' | 'left' | 'middle' | 'top';
|
|
8
|
+
export type NodeVariant =
|
|
9
|
+
| 'parallel'
|
|
10
|
+
| 'branch'
|
|
11
|
+
| 'group'
|
|
12
|
+
| 'return'
|
|
13
|
+
| 'loop'
|
|
14
|
+
| 'switch'
|
|
15
|
+
| 'try'
|
|
16
|
+
| 'catch'
|
|
17
|
+
| 'tryCatch'
|
|
18
|
+
| 'forLoop'
|
|
19
|
+
| 'emptyNode'
|
|
20
|
+
| 'entity'
|
|
21
|
+
| 'call'
|
|
22
|
+
| 'function'
|
|
23
|
+
| 'let'
|
|
24
|
+
| 'set';
|
|
25
|
+
|
|
26
|
+
export interface ICardNodeData {
|
|
27
|
+
isBlock?: boolean;
|
|
28
|
+
nodeId: string;
|
|
29
|
+
blocks?: IBlock[];
|
|
30
|
+
title?: string;
|
|
31
|
+
color?: keyof typeof colorMap;
|
|
32
|
+
sideHandles?: boolean;
|
|
33
|
+
img?: string;
|
|
34
|
+
caseCount?: number;
|
|
35
|
+
falseCase?: string;
|
|
36
|
+
trueCase?: string;
|
|
37
|
+
label?: string;
|
|
38
|
+
variant?: NodeVariant;
|
|
39
|
+
branchIndex?: number | 'default';
|
|
40
|
+
parallelColIndex?: number;
|
|
41
|
+
parallelChildrenCount?: number;
|
|
42
|
+
isRoot?: boolean;
|
|
43
|
+
finalNodeId?: string;
|
|
44
|
+
type?: NodeVariant;
|
|
45
|
+
formData?: NodeForm;
|
|
46
|
+
conditions?: RuleGroup;
|
|
47
|
+
isPinned?: boolean;
|
|
48
|
+
isHidden?: boolean; // Add visibility flag for expandable functionality
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface IBlock {
|
|
52
|
+
id: string;
|
|
53
|
+
color: keyof typeof colorMap;
|
|
54
|
+
title: string;
|
|
55
|
+
type?: IBlockType;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type IBlockType = keyof typeof blockTypes;
|
|
59
|
+
|
|
60
|
+
export type ICardNode = Node & {
|
|
61
|
+
type: 'entity' | 'workflow' | 'bendPoint';
|
|
62
|
+
draggable?: boolean;
|
|
63
|
+
width?: number;
|
|
64
|
+
height?: number;
|
|
65
|
+
parentId?: string | null;
|
|
66
|
+
subParentId?: string | null;
|
|
67
|
+
data: ICardNodeData;
|
|
68
|
+
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { EntityNode } from '../organisms/Card/EntityNode';
|
|
2
|
-
import BendpointNode from '../atoms/BendpointNode';
|
|
3
|
-
import WorkflowNode from '../organisms/WorkflowNode';
|
|
4
|
-
import CollabObjectNode from '../templates/collaborationDiagram/nodes/CollabObjectNode';
|
|
5
|
-
import ActorNode from '../atoms/ActorNode';
|
|
6
|
-
import {
|
|
7
|
-
AutomationStartNode,
|
|
8
|
-
AutomationApiNode,
|
|
9
|
-
AutomationFormattingNode,
|
|
10
|
-
AutomationSheetsNode,
|
|
11
|
-
AutomationEndNode,
|
|
12
|
-
AutomationNoteNode,
|
|
13
|
-
AutomationAISuggestionNode,
|
|
14
|
-
} from '../components/automation';
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
entity: EntityNode,
|
|
18
|
-
bendPoint: BendpointNode,
|
|
19
|
-
workflow: WorkflowNode,
|
|
20
|
-
collabObject: CollabObjectNode,
|
|
21
|
-
actor: ActorNode,
|
|
22
|
-
AutomationStartNode,
|
|
23
|
-
AutomationApiNode,
|
|
24
|
-
AutomationFormattingNode,
|
|
25
|
-
AutomationSheetsNode,
|
|
26
|
-
AutomationEndNode,
|
|
27
|
-
AutomationNoteNode,
|
|
28
|
-
AutomationAISuggestionNode,
|
|
29
|
-
};
|
|
1
|
+
import { EntityNode } from '../organisms/Card/EntityNode';
|
|
2
|
+
import BendpointNode from '../atoms/BendpointNode';
|
|
3
|
+
import WorkflowNode from '../organisms/WorkflowNode';
|
|
4
|
+
import CollabObjectNode from '../templates/collaborationDiagram/nodes/CollabObjectNode';
|
|
5
|
+
import ActorNode from '../atoms/ActorNode';
|
|
6
|
+
import {
|
|
7
|
+
AutomationStartNode,
|
|
8
|
+
AutomationApiNode,
|
|
9
|
+
AutomationFormattingNode,
|
|
10
|
+
AutomationSheetsNode,
|
|
11
|
+
AutomationEndNode,
|
|
12
|
+
AutomationNoteNode,
|
|
13
|
+
AutomationAISuggestionNode,
|
|
14
|
+
} from '../components/automation';
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
entity: EntityNode,
|
|
18
|
+
bendPoint: BendpointNode,
|
|
19
|
+
workflow: WorkflowNode,
|
|
20
|
+
collabObject: CollabObjectNode,
|
|
21
|
+
actor: ActorNode,
|
|
22
|
+
AutomationStartNode,
|
|
23
|
+
AutomationApiNode,
|
|
24
|
+
AutomationFormattingNode,
|
|
25
|
+
AutomationSheetsNode,
|
|
26
|
+
AutomationEndNode,
|
|
27
|
+
AutomationNoteNode,
|
|
28
|
+
AutomationAISuggestionNode,
|
|
29
|
+
};
|