@uipath/apollo-react 4.13.0 → 4.13.1-pr556.57ef73e
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/canvas/components/AddNodePanel/AddNodeManager.cjs +26 -7
- package/dist/canvas/components/AddNodePanel/AddNodeManager.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/AddNodeManager.js +26 -7
- package/dist/canvas/components/AddNodePanel/index.cjs +2 -6
- package/dist/canvas/components/AddNodePanel/index.d.ts +0 -1
- package/dist/canvas/components/AddNodePanel/index.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/index.js +1 -2
- package/dist/canvas/components/AgentCanvas/agent-flow.manifest.d.ts +1 -0
- package/dist/canvas/components/AgentCanvas/agent-flow.manifest.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.cjs +25 -10
- package/dist/canvas/components/BaseNode/BaseNode.d.ts +2 -1
- package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.js +22 -10
- package/dist/canvas/components/ButtonHandle/ButtonHandle.cjs +115 -34
- package/dist/canvas/components/ButtonHandle/ButtonHandle.d.ts +4 -2
- package/dist/canvas/components/ButtonHandle/ButtonHandle.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandle.js +117 -36
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.cjs +65 -5
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.d.ts +4 -0
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.js +53 -5
- package/dist/canvas/components/ButtonHandle/HandleButton.cjs +9 -3
- package/dist/canvas/components/ButtonHandle/HandleButton.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/HandleButton.js +9 -3
- package/dist/canvas/components/ButtonHandle/HandleLabel.cjs +11 -4
- package/dist/canvas/components/ButtonHandle/HandleLabel.d.ts +4 -1
- package/dist/canvas/components/ButtonHandle/HandleLabel.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/HandleLabel.js +7 -3
- package/dist/canvas/components/ButtonHandle/SmartHandle.cjs +2 -2
- package/dist/canvas/components/ButtonHandle/SmartHandle.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/SmartHandle.js +2 -2
- package/dist/canvas/components/Edges/SequenceEdge.cjs +3 -2
- package/dist/canvas/components/Edges/SequenceEdge.d.ts +11 -2
- package/dist/canvas/components/Edges/SequenceEdge.d.ts.map +1 -1
- package/dist/canvas/components/Edges/SequenceEdge.js +4 -3
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.cjs +23 -15
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.d.ts +2 -0
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.d.ts.map +1 -1
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvas.js +24 -16
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvasWithControls.cjs +11 -8
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvasWithControls.d.ts.map +1 -1
- package/dist/canvas/components/HierarchicalCanvas/HierarchicalCanvasWithControls.js +11 -8
- package/dist/canvas/components/LoopNode/LoopCanvasNode.cjs +112 -0
- package/dist/canvas/components/LoopNode/LoopCanvasNode.d.ts +6 -0
- package/dist/canvas/components/LoopNode/LoopCanvasNode.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/LoopCanvasNode.js +78 -0
- package/dist/canvas/components/LoopNode/LoopNode.cjs +435 -0
- package/dist/canvas/components/LoopNode/LoopNode.constants.cjs +77 -0
- package/dist/canvas/components/LoopNode/LoopNode.constants.d.ts +12 -0
- package/dist/canvas/components/LoopNode/LoopNode.constants.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/LoopNode.constants.js +13 -0
- package/dist/canvas/components/LoopNode/LoopNode.d.ts +5 -0
- package/dist/canvas/components/LoopNode/LoopNode.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/LoopNode.helpers.cjs +137 -0
- package/dist/canvas/components/LoopNode/LoopNode.helpers.d.ts +26 -0
- package/dist/canvas/components/LoopNode/LoopNode.helpers.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/LoopNode.helpers.js +94 -0
- package/dist/canvas/components/LoopNode/LoopNode.js +401 -0
- package/dist/canvas/components/LoopNode/LoopNode.types.cjs +18 -0
- package/dist/canvas/components/LoopNode/LoopNode.types.d.ts +11 -0
- package/dist/canvas/components/LoopNode/LoopNode.types.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/LoopNode.types.js +0 -0
- package/dist/canvas/components/LoopNode/LoopNodePreview.cjs +61 -0
- package/dist/canvas/components/LoopNode/LoopNodePreview.d.ts +9 -0
- package/dist/canvas/components/LoopNode/LoopNodePreview.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/LoopNodePreview.js +27 -0
- package/dist/canvas/components/LoopNode/index.cjs +72 -0
- package/dist/canvas/components/LoopNode/index.d.ts +4 -0
- package/dist/canvas/components/LoopNode/index.d.ts.map +1 -0
- package/dist/canvas/components/LoopNode/index.js +3 -0
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.cjs +34 -25
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.d.ts +2 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/useEdgeToolbarState.js +35 -26
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.cjs +15 -5
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.d.ts +1 -1
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.js +15 -5
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.types.d.ts +1 -0
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.types.d.ts.map +1 -1
- package/dist/canvas/components/index.cjs +27 -20
- package/dist/canvas/components/index.d.ts +1 -0
- package/dist/canvas/components/index.d.ts.map +1 -1
- package/dist/canvas/components/index.js +1 -0
- package/dist/canvas/constants.cjs +8 -0
- package/dist/canvas/constants.d.ts +2 -0
- package/dist/canvas/constants.d.ts.map +1 -1
- package/dist/canvas/constants.js +3 -1
- package/dist/canvas/core/NodeTypeRegistry.cjs +39 -23
- package/dist/canvas/core/NodeTypeRegistry.d.ts +8 -4
- package/dist/canvas/core/NodeTypeRegistry.d.ts.map +1 -1
- package/dist/canvas/core/NodeTypeRegistry.js +39 -23
- package/dist/canvas/core/useNodeTypeRegistry.cjs +4 -3
- package/dist/canvas/core/useNodeTypeRegistry.d.ts +1 -1
- package/dist/canvas/core/useNodeTypeRegistry.d.ts.map +1 -1
- package/dist/canvas/core/useNodeTypeRegistry.js +4 -3
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.cjs +10 -3
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.d.ts.map +1 -1
- package/dist/canvas/hooks/useAddNodeOnConnectEnd.js +10 -3
- package/dist/canvas/hooks/usePreviewNode.cjs +4 -2
- package/dist/canvas/hooks/usePreviewNode.d.ts.map +1 -1
- package/dist/canvas/hooks/usePreviewNode.js +4 -2
- package/dist/canvas/schema/node-definition/handle.cjs +10 -2
- package/dist/canvas/schema/node-definition/handle.d.ts +9 -0
- package/dist/canvas/schema/node-definition/handle.d.ts.map +1 -1
- package/dist/canvas/schema/node-definition/handle.js +6 -1
- package/dist/canvas/schema/node-definition/index.cjs +4 -1
- package/dist/canvas/schema/node-definition/index.d.ts +3 -3
- package/dist/canvas/schema/node-definition/index.d.ts.map +1 -1
- package/dist/canvas/schema/node-definition/index.js +2 -2
- package/dist/canvas/schema/node-definition/node-manifest.d.ts +4 -0
- package/dist/canvas/schema/node-definition/node-manifest.d.ts.map +1 -1
- package/dist/canvas/storybook-utils/manifests/index.d.ts +1 -0
- package/dist/canvas/storybook-utils/manifests/index.d.ts.map +1 -1
- package/dist/canvas/storybook-utils/manifests/node-definitions.d.ts.map +1 -1
- package/dist/canvas/styles/reactflow-reset.css +8 -0
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/canvas/utils/{createPreviewNode.cjs → createPreviewGraph.cjs} +115 -41
- package/dist/canvas/utils/createPreviewGraph.d.ts +43 -0
- package/dist/canvas/utils/createPreviewGraph.d.ts.map +1 -0
- package/dist/canvas/utils/{createPreviewNode.js → createPreviewGraph.js} +95 -36
- package/dist/canvas/utils/index.cjs +10 -10
- package/dist/canvas/utils/index.d.ts +2 -2
- package/dist/canvas/utils/index.d.ts.map +1 -1
- package/dist/canvas/utils/index.js +2 -2
- package/package.json +1 -1
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.cjs +0 -41
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.d.ts +0 -3
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.d.ts.map +0 -1
- package/dist/canvas/components/AddNodePanel/createAddNodePreview.js +0 -7
- package/dist/canvas/utils/createPreviewNode.d.ts +0 -17
- package/dist/canvas/utils/createPreviewNode.d.ts.map +0 -1
|
@@ -24,13 +24,46 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
applyPreviewToReactFlow: ()=>applyPreviewToReactFlow,
|
|
28
27
|
removePreviewFromReactFlow: ()=>removePreviewFromReactFlow,
|
|
29
|
-
|
|
28
|
+
applyPreviewGraphToReactFlow: ()=>applyPreviewGraphToReactFlow,
|
|
29
|
+
PREVIEW_EDGE_STYLE: ()=>PREVIEW_EDGE_STYLE,
|
|
30
|
+
createPreviewGraph: ()=>createPreviewGraph,
|
|
31
|
+
reparentPreviewNodeToContainer: ()=>reparentPreviewNodeToContainer,
|
|
32
|
+
showPreviewGraph: ()=>showPreviewGraph,
|
|
33
|
+
getOppositePosition: ()=>getOppositePosition,
|
|
34
|
+
inferParentId: ()=>inferParentId
|
|
30
35
|
});
|
|
31
36
|
const react_cjs_namespaceObject = require("../xyflow/react.cjs");
|
|
32
37
|
const external_constants_cjs_namespaceObject = require("../constants.cjs");
|
|
33
38
|
const external_NodeUtils_cjs_namespaceObject = require("./NodeUtils.cjs");
|
|
39
|
+
const PREVIEW_EDGE_STYLE = {
|
|
40
|
+
strokeDasharray: '5,5',
|
|
41
|
+
opacity: 0.8,
|
|
42
|
+
stroke: 'var(--canvas-selection-indicator)',
|
|
43
|
+
strokeWidth: 2
|
|
44
|
+
};
|
|
45
|
+
function inferParentId(sourceId, targetId, nodes) {
|
|
46
|
+
const sourceNode = nodes.find((node)=>node.id === sourceId);
|
|
47
|
+
const targetNode = nodes.find((node)=>node.id === targetId);
|
|
48
|
+
if (!sourceNode || !targetNode) return;
|
|
49
|
+
if (sourceNode.parentId && sourceNode.parentId === targetNode.parentId) return sourceNode.parentId;
|
|
50
|
+
if (targetNode.parentId && targetNode.parentId === sourceNode.id) return sourceNode.id;
|
|
51
|
+
if (sourceNode.parentId && sourceNode.parentId === targetNode.id) return targetNode.id;
|
|
52
|
+
}
|
|
53
|
+
function reparentPreviewNodeToContainer(previewNode, containerId, reactFlowInstance) {
|
|
54
|
+
const containerNode = reactFlowInstance.getNode(containerId);
|
|
55
|
+
if (!containerNode) return null;
|
|
56
|
+
const containerAbsolutePosition = (0, external_NodeUtils_cjs_namespaceObject.getAbsolutePosition)(containerNode, reactFlowInstance.getNodes());
|
|
57
|
+
return {
|
|
58
|
+
...previewNode,
|
|
59
|
+
position: {
|
|
60
|
+
x: previewNode.position.x - containerAbsolutePosition.x,
|
|
61
|
+
y: previewNode.position.y - containerAbsolutePosition.y
|
|
62
|
+
},
|
|
63
|
+
parentId: containerId,
|
|
64
|
+
extent: 'parent'
|
|
65
|
+
};
|
|
66
|
+
}
|
|
34
67
|
function getOppositePosition(position) {
|
|
35
68
|
switch(position){
|
|
36
69
|
case react_cjs_namespaceObject.Position.Left:
|
|
@@ -74,6 +107,12 @@ function calculatePositionFromDrop(dropPosition, handlePosition, previewNodeSize
|
|
|
74
107
|
};
|
|
75
108
|
}
|
|
76
109
|
}
|
|
110
|
+
function calculateCenteredPosition(centerPosition, previewNodeSize) {
|
|
111
|
+
return {
|
|
112
|
+
x: centerPosition.x - previewNodeSize.width / 2,
|
|
113
|
+
y: centerPosition.y - previewNodeSize.height / 2
|
|
114
|
+
};
|
|
115
|
+
}
|
|
77
116
|
function computeSpreadOffset(handle, size) {
|
|
78
117
|
const index = handle?.index ?? null;
|
|
79
118
|
const count = handle?.count ?? 1;
|
|
@@ -136,10 +175,10 @@ function calculateAutoPosition(sourceNode, handlePosition, previewNodeSize, exis
|
|
|
136
175
|
};
|
|
137
176
|
return (0, external_NodeUtils_cjs_namespaceObject.getNonOverlappingPositionForDirection)(nodesWithAbsolutePositions, initialPosition, previewNodeSize, direction, offset, ignoredNodeTypes, overflowDirection);
|
|
138
177
|
}
|
|
139
|
-
function createPreviewNode(sourceNodeId, sourceHandleId, reactFlowInstance, position, data, sourceHandleType = 'source', previewNodeSize = {
|
|
178
|
+
function createPreviewNode({ sourceNodeId, sourceHandleId, reactFlowInstance, position, data, sourceHandleType = 'source', previewNodeSize = {
|
|
140
179
|
width: external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE,
|
|
141
180
|
height: external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE
|
|
142
|
-
}, handlePosition = react_cjs_namespaceObject.Position.Right, ignoredNodeTypes = []) {
|
|
181
|
+
}, handlePosition = react_cjs_namespaceObject.Position.Right, ignoredNodeTypes = [], positionMode = 'drop' }) {
|
|
143
182
|
const sourceNode = reactFlowInstance.getNode(sourceNodeId);
|
|
144
183
|
if (!sourceNode) {
|
|
145
184
|
console.warn(`Source node ${sourceNodeId} not found`);
|
|
@@ -149,49 +188,74 @@ function createPreviewNode(sourceNodeId, sourceHandleId, reactFlowInstance, posi
|
|
|
149
188
|
const existingNodes = reactFlowInstance.getNodes().filter((n)=>n.id !== external_constants_cjs_namespaceObject.PREVIEW_NODE_ID);
|
|
150
189
|
const internalNode = void 0 === position ? reactFlowInstance.getInternalNode(sourceNodeId) : void 0;
|
|
151
190
|
const handle = internalNode ? (0, external_NodeUtils_cjs_namespaceObject.resolveHandleContext)(internalNode, sourceHandleId, handlePosition) : void 0;
|
|
152
|
-
const
|
|
191
|
+
const previewPosition = position ? 'center' === positionMode ? calculateCenteredPosition(position, previewNodeSize) : calculatePositionFromDrop(position, handlePosition, previewNodeSize) : calculateAutoPosition(sourceNode, handlePosition, previewNodeSize, existingNodes, void 0, ignoredNodeTypes, handle);
|
|
153
192
|
const handleFacingSource = getOppositePosition(handlePosition);
|
|
154
|
-
const
|
|
193
|
+
const previewData = {
|
|
155
194
|
...data ?? {}
|
|
156
195
|
};
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
const
|
|
196
|
+
previewData.inputHandlePosition = treatPreviewAsSource ? handlePosition : handleFacingSource;
|
|
197
|
+
previewData.outputHandlePosition = treatPreviewAsSource ? handleFacingSource : handlePosition;
|
|
198
|
+
const node = {
|
|
160
199
|
id: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
161
200
|
type: 'preview',
|
|
162
|
-
position:
|
|
201
|
+
position: previewPosition,
|
|
163
202
|
...previewNodeSize,
|
|
164
203
|
selected: true,
|
|
165
|
-
data:
|
|
204
|
+
data: previewData
|
|
166
205
|
};
|
|
167
|
-
const
|
|
168
|
-
source: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
169
|
-
sourceHandle: 'output',
|
|
170
|
-
target: sourceNodeId,
|
|
171
|
-
targetHandle: sourceHandleId
|
|
172
|
-
} : {
|
|
173
|
-
source: sourceNodeId,
|
|
174
|
-
sourceHandle: sourceHandleId,
|
|
175
|
-
target: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
176
|
-
targetHandle: 'input'
|
|
177
|
-
};
|
|
178
|
-
const previewEdge = {
|
|
206
|
+
const edge = {
|
|
179
207
|
id: external_constants_cjs_namespaceObject.PREVIEW_EDGE_ID,
|
|
180
|
-
...
|
|
208
|
+
...treatPreviewAsSource ? {
|
|
209
|
+
source: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
210
|
+
sourceHandle: external_constants_cjs_namespaceObject.DEFAULT_SOURCE_HANDLE_ID,
|
|
211
|
+
target: sourceNodeId,
|
|
212
|
+
targetHandle: sourceHandleId
|
|
213
|
+
} : {
|
|
214
|
+
source: sourceNodeId,
|
|
215
|
+
sourceHandle: sourceHandleId,
|
|
216
|
+
target: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
217
|
+
targetHandle: external_constants_cjs_namespaceObject.DEFAULT_TARGET_HANDLE_ID
|
|
218
|
+
},
|
|
181
219
|
type: 'default',
|
|
182
|
-
style:
|
|
183
|
-
strokeDasharray: '5,5',
|
|
184
|
-
opacity: 0.8,
|
|
185
|
-
stroke: 'var(--canvas-selection-indicator)',
|
|
186
|
-
strokeWidth: 2
|
|
187
|
-
}
|
|
220
|
+
style: PREVIEW_EDGE_STYLE
|
|
188
221
|
};
|
|
189
222
|
return {
|
|
190
|
-
|
|
191
|
-
|
|
223
|
+
sourceNode,
|
|
224
|
+
node,
|
|
225
|
+
edge
|
|
192
226
|
};
|
|
193
227
|
}
|
|
194
|
-
function
|
|
228
|
+
function createPreviewGraph(options) {
|
|
229
|
+
const { reactFlowInstance, targetNodeId, targetHandleId, containerId, removedEdgeIds, trailingEdgeId, trailingEdgeStyle = PREVIEW_EDGE_STYLE } = options;
|
|
230
|
+
const preview = createPreviewNode(options);
|
|
231
|
+
if (!preview) return null;
|
|
232
|
+
const resolvedContainerId = containerId ?? preview.sourceNode.parentId;
|
|
233
|
+
const finalPreviewNode = resolvedContainerId ? reparentPreviewNodeToContainer(preview.node, resolvedContainerId, reactFlowInstance) : preview.node;
|
|
234
|
+
if (!finalPreviewNode) return null;
|
|
235
|
+
const edges = [
|
|
236
|
+
preview.edge
|
|
237
|
+
];
|
|
238
|
+
if (targetNodeId) edges.push({
|
|
239
|
+
id: trailingEdgeId ?? `${external_constants_cjs_namespaceObject.PREVIEW_NODE_ID}-${targetNodeId}`,
|
|
240
|
+
source: external_constants_cjs_namespaceObject.PREVIEW_NODE_ID,
|
|
241
|
+
sourceHandle: external_constants_cjs_namespaceObject.DEFAULT_SOURCE_HANDLE_ID,
|
|
242
|
+
target: targetNodeId,
|
|
243
|
+
targetHandle: targetHandleId,
|
|
244
|
+
type: 'default',
|
|
245
|
+
style: trailingEdgeStyle
|
|
246
|
+
});
|
|
247
|
+
return {
|
|
248
|
+
node: finalPreviewNode,
|
|
249
|
+
edges,
|
|
250
|
+
removedEdgeIds
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function showPreviewGraph(options) {
|
|
254
|
+
const preview = createPreviewGraph(options);
|
|
255
|
+
if (preview) applyPreviewGraphToReactFlow(preview, options.reactFlowInstance);
|
|
256
|
+
return preview;
|
|
257
|
+
}
|
|
258
|
+
function applyPreviewGraphToReactFlow(preview, reactFlowInstance) {
|
|
195
259
|
setTimeout(()=>{
|
|
196
260
|
reactFlowInstance.setNodes((nodes)=>[
|
|
197
261
|
...nodes.filter((n)=>n.id !== external_constants_cjs_namespaceObject.PREVIEW_NODE_ID).map((n)=>({
|
|
@@ -201,22 +265,32 @@ function applyPreviewToReactFlow(preview, reactFlowInstance) {
|
|
|
201
265
|
preview.node
|
|
202
266
|
]);
|
|
203
267
|
reactFlowInstance.setEdges((edges)=>[
|
|
204
|
-
...edges.filter((
|
|
205
|
-
preview.
|
|
268
|
+
...edges.filter((edge)=>edge.source !== external_constants_cjs_namespaceObject.PREVIEW_NODE_ID && edge.target !== external_constants_cjs_namespaceObject.PREVIEW_NODE_ID && !preview.removedEdgeIds?.includes(edge.id)),
|
|
269
|
+
...preview.edges
|
|
206
270
|
]);
|
|
207
271
|
}, 0);
|
|
208
272
|
}
|
|
209
273
|
function removePreviewFromReactFlow(reactFlowInstance) {
|
|
210
274
|
reactFlowInstance.setNodes((nodes)=>nodes.filter((n)=>n.id !== external_constants_cjs_namespaceObject.PREVIEW_NODE_ID));
|
|
211
|
-
reactFlowInstance.setEdges((edges)=>edges.filter((
|
|
275
|
+
reactFlowInstance.setEdges((edges)=>edges.filter((edge)=>edge.source !== external_constants_cjs_namespaceObject.PREVIEW_NODE_ID && edge.target !== external_constants_cjs_namespaceObject.PREVIEW_NODE_ID));
|
|
212
276
|
}
|
|
213
|
-
exports.
|
|
214
|
-
exports.
|
|
277
|
+
exports.PREVIEW_EDGE_STYLE = __webpack_exports__.PREVIEW_EDGE_STYLE;
|
|
278
|
+
exports.applyPreviewGraphToReactFlow = __webpack_exports__.applyPreviewGraphToReactFlow;
|
|
279
|
+
exports.createPreviewGraph = __webpack_exports__.createPreviewGraph;
|
|
280
|
+
exports.getOppositePosition = __webpack_exports__.getOppositePosition;
|
|
281
|
+
exports.inferParentId = __webpack_exports__.inferParentId;
|
|
215
282
|
exports.removePreviewFromReactFlow = __webpack_exports__.removePreviewFromReactFlow;
|
|
283
|
+
exports.reparentPreviewNodeToContainer = __webpack_exports__.reparentPreviewNodeToContainer;
|
|
284
|
+
exports.showPreviewGraph = __webpack_exports__.showPreviewGraph;
|
|
216
285
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
217
|
-
"
|
|
218
|
-
"
|
|
219
|
-
"
|
|
286
|
+
"PREVIEW_EDGE_STYLE",
|
|
287
|
+
"applyPreviewGraphToReactFlow",
|
|
288
|
+
"createPreviewGraph",
|
|
289
|
+
"getOppositePosition",
|
|
290
|
+
"inferParentId",
|
|
291
|
+
"removePreviewFromReactFlow",
|
|
292
|
+
"reparentPreviewNodeToContainer",
|
|
293
|
+
"showPreviewGraph"
|
|
220
294
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
221
295
|
Object.defineProperty(exports, '__esModule', {
|
|
222
296
|
value: true
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Edge, type Node, Position, type ReactFlowInstance } from '../xyflow/react.ts';
|
|
2
|
+
export interface PreviewGraph {
|
|
3
|
+
node: Node;
|
|
4
|
+
edges: Edge[];
|
|
5
|
+
removedEdgeIds?: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare const PREVIEW_EDGE_STYLE: Edge['style'];
|
|
8
|
+
export type PreviewNodePositionMode = 'drop' | 'center';
|
|
9
|
+
interface CreatePreviewNodeOptions {
|
|
10
|
+
sourceNodeId: string;
|
|
11
|
+
sourceHandleId: string;
|
|
12
|
+
reactFlowInstance: ReactFlowInstance;
|
|
13
|
+
position?: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
data?: Record<string, unknown>;
|
|
18
|
+
sourceHandleType?: 'source' | 'target';
|
|
19
|
+
previewNodeSize?: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
handlePosition?: Position;
|
|
24
|
+
ignoredNodeTypes?: string[];
|
|
25
|
+
positionMode?: PreviewNodePositionMode;
|
|
26
|
+
}
|
|
27
|
+
export interface CreatePreviewGraphOptions extends CreatePreviewNodeOptions {
|
|
28
|
+
targetNodeId?: string;
|
|
29
|
+
targetHandleId?: string | null;
|
|
30
|
+
containerId?: string;
|
|
31
|
+
removedEdgeIds?: string[];
|
|
32
|
+
trailingEdgeId?: string;
|
|
33
|
+
trailingEdgeStyle?: Edge['style'];
|
|
34
|
+
}
|
|
35
|
+
export declare function inferParentId(sourceId: string, targetId: string, nodes: Node[]): string | undefined;
|
|
36
|
+
export declare function reparentPreviewNodeToContainer(previewNode: Node, containerId: string, reactFlowInstance: ReactFlowInstance): Node | null;
|
|
37
|
+
export declare function getOppositePosition(position: Position): Position;
|
|
38
|
+
export declare function createPreviewGraph(options: CreatePreviewGraphOptions): PreviewGraph | null;
|
|
39
|
+
export declare function showPreviewGraph(options: CreatePreviewGraphOptions): PreviewGraph | null;
|
|
40
|
+
export declare function applyPreviewGraphToReactFlow(preview: PreviewGraph, reactFlowInstance: ReactFlowInstance): void;
|
|
41
|
+
export declare function removePreviewFromReactFlow(reactFlowInstance: ReactFlowInstance): void;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=createPreviewGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPreviewGraph.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/createPreviewGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EACT,KAAK,IAAI,EACT,QAAQ,EACR,KAAK,iBAAiB,EACvB,MAAM,0CAA0C,CAAC;AAgBlD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,eAAO,MAAM,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAK5C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAExD,UAAU,wBAAwB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,gBAAgB,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACvC,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC;AAED,MAAM,WAAW,yBAA0B,SAAQ,wBAAwB;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;CACnC;AAQD,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,IAAI,EAAE,GACZ,MAAM,GAAG,SAAS,CAkBpB;AAED,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,IAAI,EACjB,WAAW,EAAE,MAAM,EACnB,iBAAiB,EAAE,iBAAiB,GACnC,IAAI,GAAG,IAAI,CAoBb;AAMD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAahE;AAwRD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,YAAY,GAAG,IAAI,CAwC1F;AAOD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,yBAAyB,GAAG,YAAY,GAAG,IAAI,CAMxF;AAOD,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,YAAY,EACrB,iBAAiB,EAAE,iBAAiB,GACnC,IAAI,CAmBN;AAKD,wBAAgB,0BAA0B,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAKrF"}
|
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
import { Position } from "../xyflow/react.js";
|
|
2
|
-
import { DEFAULT_NODE_SIZE, GRID_SPACING, PREVIEW_EDGE_ID, PREVIEW_NODE_ID } from "../constants.js";
|
|
2
|
+
import { DEFAULT_NODE_SIZE, DEFAULT_SOURCE_HANDLE_ID, DEFAULT_TARGET_HANDLE_ID, GRID_SPACING, PREVIEW_EDGE_ID, PREVIEW_NODE_ID } from "../constants.js";
|
|
3
3
|
import { getAbsolutePosition, getNonOverlappingPositionForDirection, resolveHandleContext } from "./NodeUtils.js";
|
|
4
|
+
const PREVIEW_EDGE_STYLE = {
|
|
5
|
+
strokeDasharray: '5,5',
|
|
6
|
+
opacity: 0.8,
|
|
7
|
+
stroke: 'var(--canvas-selection-indicator)',
|
|
8
|
+
strokeWidth: 2
|
|
9
|
+
};
|
|
10
|
+
function inferParentId(sourceId, targetId, nodes) {
|
|
11
|
+
const sourceNode = nodes.find((node)=>node.id === sourceId);
|
|
12
|
+
const targetNode = nodes.find((node)=>node.id === targetId);
|
|
13
|
+
if (!sourceNode || !targetNode) return;
|
|
14
|
+
if (sourceNode.parentId && sourceNode.parentId === targetNode.parentId) return sourceNode.parentId;
|
|
15
|
+
if (targetNode.parentId && targetNode.parentId === sourceNode.id) return sourceNode.id;
|
|
16
|
+
if (sourceNode.parentId && sourceNode.parentId === targetNode.id) return targetNode.id;
|
|
17
|
+
}
|
|
18
|
+
function reparentPreviewNodeToContainer(previewNode, containerId, reactFlowInstance) {
|
|
19
|
+
const containerNode = reactFlowInstance.getNode(containerId);
|
|
20
|
+
if (!containerNode) return null;
|
|
21
|
+
const containerAbsolutePosition = getAbsolutePosition(containerNode, reactFlowInstance.getNodes());
|
|
22
|
+
return {
|
|
23
|
+
...previewNode,
|
|
24
|
+
position: {
|
|
25
|
+
x: previewNode.position.x - containerAbsolutePosition.x,
|
|
26
|
+
y: previewNode.position.y - containerAbsolutePosition.y
|
|
27
|
+
},
|
|
28
|
+
parentId: containerId,
|
|
29
|
+
extent: 'parent'
|
|
30
|
+
};
|
|
31
|
+
}
|
|
4
32
|
function getOppositePosition(position) {
|
|
5
33
|
switch(position){
|
|
6
34
|
case Position.Left:
|
|
@@ -44,6 +72,12 @@ function calculatePositionFromDrop(dropPosition, handlePosition, previewNodeSize
|
|
|
44
72
|
};
|
|
45
73
|
}
|
|
46
74
|
}
|
|
75
|
+
function calculateCenteredPosition(centerPosition, previewNodeSize) {
|
|
76
|
+
return {
|
|
77
|
+
x: centerPosition.x - previewNodeSize.width / 2,
|
|
78
|
+
y: centerPosition.y - previewNodeSize.height / 2
|
|
79
|
+
};
|
|
80
|
+
}
|
|
47
81
|
function computeSpreadOffset(handle, size) {
|
|
48
82
|
const index = handle?.index ?? null;
|
|
49
83
|
const count = handle?.count ?? 1;
|
|
@@ -106,10 +140,10 @@ function calculateAutoPosition(sourceNode, handlePosition, previewNodeSize, exis
|
|
|
106
140
|
};
|
|
107
141
|
return getNonOverlappingPositionForDirection(nodesWithAbsolutePositions, initialPosition, previewNodeSize, direction, offset, ignoredNodeTypes, overflowDirection);
|
|
108
142
|
}
|
|
109
|
-
function createPreviewNode(sourceNodeId, sourceHandleId, reactFlowInstance, position, data, sourceHandleType = 'source', previewNodeSize = {
|
|
143
|
+
function createPreviewNode({ sourceNodeId, sourceHandleId, reactFlowInstance, position, data, sourceHandleType = 'source', previewNodeSize = {
|
|
110
144
|
width: DEFAULT_NODE_SIZE,
|
|
111
145
|
height: DEFAULT_NODE_SIZE
|
|
112
|
-
}, handlePosition = Position.Right, ignoredNodeTypes = []) {
|
|
146
|
+
}, handlePosition = Position.Right, ignoredNodeTypes = [], positionMode = 'drop' }) {
|
|
113
147
|
const sourceNode = reactFlowInstance.getNode(sourceNodeId);
|
|
114
148
|
if (!sourceNode) {
|
|
115
149
|
console.warn(`Source node ${sourceNodeId} not found`);
|
|
@@ -119,49 +153,74 @@ function createPreviewNode(sourceNodeId, sourceHandleId, reactFlowInstance, posi
|
|
|
119
153
|
const existingNodes = reactFlowInstance.getNodes().filter((n)=>n.id !== PREVIEW_NODE_ID);
|
|
120
154
|
const internalNode = void 0 === position ? reactFlowInstance.getInternalNode(sourceNodeId) : void 0;
|
|
121
155
|
const handle = internalNode ? resolveHandleContext(internalNode, sourceHandleId, handlePosition) : void 0;
|
|
122
|
-
const
|
|
156
|
+
const previewPosition = position ? 'center' === positionMode ? calculateCenteredPosition(position, previewNodeSize) : calculatePositionFromDrop(position, handlePosition, previewNodeSize) : calculateAutoPosition(sourceNode, handlePosition, previewNodeSize, existingNodes, void 0, ignoredNodeTypes, handle);
|
|
123
157
|
const handleFacingSource = getOppositePosition(handlePosition);
|
|
124
|
-
const
|
|
158
|
+
const previewData = {
|
|
125
159
|
...data ?? {}
|
|
126
160
|
};
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const
|
|
161
|
+
previewData.inputHandlePosition = treatPreviewAsSource ? handlePosition : handleFacingSource;
|
|
162
|
+
previewData.outputHandlePosition = treatPreviewAsSource ? handleFacingSource : handlePosition;
|
|
163
|
+
const node = {
|
|
130
164
|
id: PREVIEW_NODE_ID,
|
|
131
165
|
type: 'preview',
|
|
132
|
-
position:
|
|
166
|
+
position: previewPosition,
|
|
133
167
|
...previewNodeSize,
|
|
134
168
|
selected: true,
|
|
135
|
-
data:
|
|
169
|
+
data: previewData
|
|
136
170
|
};
|
|
137
|
-
const
|
|
138
|
-
source: PREVIEW_NODE_ID,
|
|
139
|
-
sourceHandle: 'output',
|
|
140
|
-
target: sourceNodeId,
|
|
141
|
-
targetHandle: sourceHandleId
|
|
142
|
-
} : {
|
|
143
|
-
source: sourceNodeId,
|
|
144
|
-
sourceHandle: sourceHandleId,
|
|
145
|
-
target: PREVIEW_NODE_ID,
|
|
146
|
-
targetHandle: 'input'
|
|
147
|
-
};
|
|
148
|
-
const previewEdge = {
|
|
171
|
+
const edge = {
|
|
149
172
|
id: PREVIEW_EDGE_ID,
|
|
150
|
-
...
|
|
173
|
+
...treatPreviewAsSource ? {
|
|
174
|
+
source: PREVIEW_NODE_ID,
|
|
175
|
+
sourceHandle: DEFAULT_SOURCE_HANDLE_ID,
|
|
176
|
+
target: sourceNodeId,
|
|
177
|
+
targetHandle: sourceHandleId
|
|
178
|
+
} : {
|
|
179
|
+
source: sourceNodeId,
|
|
180
|
+
sourceHandle: sourceHandleId,
|
|
181
|
+
target: PREVIEW_NODE_ID,
|
|
182
|
+
targetHandle: DEFAULT_TARGET_HANDLE_ID
|
|
183
|
+
},
|
|
151
184
|
type: 'default',
|
|
152
|
-
style:
|
|
153
|
-
strokeDasharray: '5,5',
|
|
154
|
-
opacity: 0.8,
|
|
155
|
-
stroke: 'var(--canvas-selection-indicator)',
|
|
156
|
-
strokeWidth: 2
|
|
157
|
-
}
|
|
185
|
+
style: PREVIEW_EDGE_STYLE
|
|
158
186
|
};
|
|
159
187
|
return {
|
|
160
|
-
|
|
161
|
-
|
|
188
|
+
sourceNode,
|
|
189
|
+
node,
|
|
190
|
+
edge
|
|
162
191
|
};
|
|
163
192
|
}
|
|
164
|
-
function
|
|
193
|
+
function createPreviewGraph(options) {
|
|
194
|
+
const { reactFlowInstance, targetNodeId, targetHandleId, containerId, removedEdgeIds, trailingEdgeId, trailingEdgeStyle = PREVIEW_EDGE_STYLE } = options;
|
|
195
|
+
const preview = createPreviewNode(options);
|
|
196
|
+
if (!preview) return null;
|
|
197
|
+
const resolvedContainerId = containerId ?? preview.sourceNode.parentId;
|
|
198
|
+
const finalPreviewNode = resolvedContainerId ? reparentPreviewNodeToContainer(preview.node, resolvedContainerId, reactFlowInstance) : preview.node;
|
|
199
|
+
if (!finalPreviewNode) return null;
|
|
200
|
+
const edges = [
|
|
201
|
+
preview.edge
|
|
202
|
+
];
|
|
203
|
+
if (targetNodeId) edges.push({
|
|
204
|
+
id: trailingEdgeId ?? `${PREVIEW_NODE_ID}-${targetNodeId}`,
|
|
205
|
+
source: PREVIEW_NODE_ID,
|
|
206
|
+
sourceHandle: DEFAULT_SOURCE_HANDLE_ID,
|
|
207
|
+
target: targetNodeId,
|
|
208
|
+
targetHandle: targetHandleId,
|
|
209
|
+
type: 'default',
|
|
210
|
+
style: trailingEdgeStyle
|
|
211
|
+
});
|
|
212
|
+
return {
|
|
213
|
+
node: finalPreviewNode,
|
|
214
|
+
edges,
|
|
215
|
+
removedEdgeIds
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function showPreviewGraph(options) {
|
|
219
|
+
const preview = createPreviewGraph(options);
|
|
220
|
+
if (preview) applyPreviewGraphToReactFlow(preview, options.reactFlowInstance);
|
|
221
|
+
return preview;
|
|
222
|
+
}
|
|
223
|
+
function applyPreviewGraphToReactFlow(preview, reactFlowInstance) {
|
|
165
224
|
setTimeout(()=>{
|
|
166
225
|
reactFlowInstance.setNodes((nodes)=>[
|
|
167
226
|
...nodes.filter((n)=>n.id !== PREVIEW_NODE_ID).map((n)=>({
|
|
@@ -171,13 +230,13 @@ function applyPreviewToReactFlow(preview, reactFlowInstance) {
|
|
|
171
230
|
preview.node
|
|
172
231
|
]);
|
|
173
232
|
reactFlowInstance.setEdges((edges)=>[
|
|
174
|
-
...edges.filter((
|
|
175
|
-
preview.
|
|
233
|
+
...edges.filter((edge)=>edge.source !== PREVIEW_NODE_ID && edge.target !== PREVIEW_NODE_ID && !preview.removedEdgeIds?.includes(edge.id)),
|
|
234
|
+
...preview.edges
|
|
176
235
|
]);
|
|
177
236
|
}, 0);
|
|
178
237
|
}
|
|
179
238
|
function removePreviewFromReactFlow(reactFlowInstance) {
|
|
180
239
|
reactFlowInstance.setNodes((nodes)=>nodes.filter((n)=>n.id !== PREVIEW_NODE_ID));
|
|
181
|
-
reactFlowInstance.setEdges((edges)=>edges.filter((
|
|
240
|
+
reactFlowInstance.setEdges((edges)=>edges.filter((edge)=>edge.source !== PREVIEW_NODE_ID && edge.target !== PREVIEW_NODE_ID));
|
|
182
241
|
}
|
|
183
|
-
export {
|
|
242
|
+
export { PREVIEW_EDGE_STYLE, applyPreviewGraphToReactFlow, createPreviewGraph, getOppositePosition, inferParentId, removePreviewFromReactFlow, reparentPreviewNodeToContainer, showPreviewGraph };
|
|
@@ -36,8 +36,8 @@ var __webpack_modules__ = {
|
|
|
36
36
|
"./constraint-validator" (module) {
|
|
37
37
|
module.exports = require("./constraint-validator.cjs");
|
|
38
38
|
},
|
|
39
|
-
"./
|
|
40
|
-
module.exports = require("./
|
|
39
|
+
"./createPreviewGraph" (module) {
|
|
40
|
+
module.exports = require("./createPreviewGraph.cjs");
|
|
41
41
|
},
|
|
42
42
|
"./export-canvas" (module) {
|
|
43
43
|
module.exports = require("./export-canvas.cjs");
|
|
@@ -114,25 +114,25 @@ var __webpack_exports__ = {};
|
|
|
114
114
|
var __rspack_reexport = {};
|
|
115
115
|
for(const __rspack_import_key in _CssUtil__rspack_import_3)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_CssUtil__rspack_import_3[__rspack_import_key];
|
|
116
116
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
117
|
-
var
|
|
117
|
+
var _coded_agents_d3_layout__rspack_import_4 = __webpack_require__("./coded-agents/d3-layout");
|
|
118
118
|
var __rspack_reexport = {};
|
|
119
|
-
for(const __rspack_import_key in
|
|
119
|
+
for(const __rspack_import_key in _coded_agents_d3_layout__rspack_import_4)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_coded_agents_d3_layout__rspack_import_4[__rspack_import_key];
|
|
120
120
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
121
|
-
var
|
|
121
|
+
var _coded_agents_mermaid_parser__rspack_import_5 = __webpack_require__("./coded-agents/mermaid-parser");
|
|
122
122
|
var __rspack_reexport = {};
|
|
123
|
-
for(const __rspack_import_key in
|
|
123
|
+
for(const __rspack_import_key in _coded_agents_mermaid_parser__rspack_import_5)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_coded_agents_mermaid_parser__rspack_import_5[__rspack_import_key];
|
|
124
124
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
125
|
-
var
|
|
125
|
+
var _collapse__rspack_import_6 = __webpack_require__("./collapse");
|
|
126
126
|
var __rspack_reexport = {};
|
|
127
|
-
for(const __rspack_import_key in
|
|
127
|
+
for(const __rspack_import_key in _collapse__rspack_import_6)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_collapse__rspack_import_6[__rspack_import_key];
|
|
128
128
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
129
129
|
var _constraint_validator__rspack_import_7 = __webpack_require__("./constraint-validator");
|
|
130
130
|
var __rspack_reexport = {};
|
|
131
131
|
for(const __rspack_import_key in _constraint_validator__rspack_import_7)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_constraint_validator__rspack_import_7[__rspack_import_key];
|
|
132
132
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
133
|
-
var
|
|
133
|
+
var _createPreviewGraph__rspack_import_8 = __webpack_require__("./createPreviewGraph");
|
|
134
134
|
var __rspack_reexport = {};
|
|
135
|
-
for(const __rspack_import_key in
|
|
135
|
+
for(const __rspack_import_key in _createPreviewGraph__rspack_import_8)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_createPreviewGraph__rspack_import_8[__rspack_import_key];
|
|
136
136
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
137
137
|
var _export_canvas__rspack_import_9 = __webpack_require__("./export-canvas");
|
|
138
138
|
var __rspack_reexport = {};
|
|
@@ -2,11 +2,11 @@ export * from './ArrayUtil';
|
|
|
2
2
|
export * from './auto-layout';
|
|
3
3
|
export * from './CanvasEventBus';
|
|
4
4
|
export * from './CssUtil';
|
|
5
|
-
export * from './collapse';
|
|
6
5
|
export * from './coded-agents/d3-layout';
|
|
7
6
|
export * from './coded-agents/mermaid-parser';
|
|
7
|
+
export * from './collapse';
|
|
8
8
|
export * from './constraint-validator';
|
|
9
|
-
export * from './
|
|
9
|
+
export * from './createPreviewGraph';
|
|
10
10
|
export * from './export-canvas';
|
|
11
11
|
export * from './GroupModificationUtils';
|
|
12
12
|
export * from './icon-registry';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
@@ -2,11 +2,11 @@ export * from "./ArrayUtil.js";
|
|
|
2
2
|
export * from "./auto-layout.js";
|
|
3
3
|
export * from "./CanvasEventBus.js";
|
|
4
4
|
export * from "./CssUtil.js";
|
|
5
|
-
export * from "./collapse.js";
|
|
6
5
|
export * from "./coded-agents/d3-layout.js";
|
|
7
6
|
export * from "./coded-agents/mermaid-parser.js";
|
|
7
|
+
export * from "./collapse.js";
|
|
8
8
|
export * from "./constraint-validator.js";
|
|
9
|
-
export * from "./
|
|
9
|
+
export * from "./createPreviewGraph.js";
|
|
10
10
|
export * from "./export-canvas.js";
|
|
11
11
|
export * from "./GroupModificationUtils.js";
|
|
12
12
|
export * from "./icon-registry.js";
|
package/package.json
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
createAddNodePreview: ()=>createAddNodePreview
|
|
28
|
-
});
|
|
29
|
-
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
30
|
-
const createPreviewNode_cjs_namespaceObject = require("../../utils/createPreviewNode.cjs");
|
|
31
|
-
function createAddNodePreview(sourceNodeId, sourceHandleId, reactFlowInstance, handlePosition = react_cjs_namespaceObject.Position.Right, sourceHandleType = 'source', ignoredNodeTypes = []) {
|
|
32
|
-
const preview = (0, createPreviewNode_cjs_namespaceObject.createPreviewNode)(sourceNodeId, sourceHandleId, reactFlowInstance, void 0, void 0, sourceHandleType, void 0, handlePosition, ignoredNodeTypes);
|
|
33
|
-
if (preview) (0, createPreviewNode_cjs_namespaceObject.applyPreviewToReactFlow)(preview, reactFlowInstance);
|
|
34
|
-
}
|
|
35
|
-
exports.createAddNodePreview = __webpack_exports__.createAddNodePreview;
|
|
36
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
37
|
-
"createAddNodePreview"
|
|
38
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
39
|
-
Object.defineProperty(exports, '__esModule', {
|
|
40
|
-
value: true
|
|
41
|
-
});
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Position, type ReactFlowInstance } from '../../xyflow/react.ts';
|
|
2
|
-
export declare function createAddNodePreview(sourceNodeId: string, sourceHandleId: string, reactFlowInstance: ReactFlowInstance, handlePosition?: Position, sourceHandleType?: 'source' | 'target', ignoredNodeTypes?: string[]): void;
|
|
3
|
-
//# sourceMappingURL=createAddNodePreview.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createAddNodePreview.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AddNodePanel/createAddNodePreview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAa5F,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,GAAE,QAAyB,EACzC,gBAAgB,GAAE,QAAQ,GAAG,QAAmB,EAChD,gBAAgB,GAAE,MAAM,EAAO,GAC9B,IAAI,CAiBN"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Position } from "../../xyflow/react.js";
|
|
2
|
-
import { applyPreviewToReactFlow, createPreviewNode } from "../../utils/createPreviewNode.js";
|
|
3
|
-
function createAddNodePreview(sourceNodeId, sourceHandleId, reactFlowInstance, handlePosition = Position.Right, sourceHandleType = 'source', ignoredNodeTypes = []) {
|
|
4
|
-
const preview = createPreviewNode(sourceNodeId, sourceHandleId, reactFlowInstance, void 0, void 0, sourceHandleType, void 0, handlePosition, ignoredNodeTypes);
|
|
5
|
-
if (preview) applyPreviewToReactFlow(preview, reactFlowInstance);
|
|
6
|
-
}
|
|
7
|
-
export { createAddNodePreview };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Edge, type Node, Position, type ReactFlowInstance } from '../xyflow/react.ts';
|
|
2
|
-
export declare function createPreviewNode(sourceNodeId: string, sourceHandleId: string, reactFlowInstance: ReactFlowInstance, position?: {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
}, data?: Record<string, any>, sourceHandleType?: 'source' | 'target', previewNodeSize?: {
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
}, handlePosition?: Position, ignoredNodeTypes?: string[]): {
|
|
9
|
-
node: Node;
|
|
10
|
-
edge: Edge;
|
|
11
|
-
} | null;
|
|
12
|
-
export declare function applyPreviewToReactFlow(preview: {
|
|
13
|
-
node: Node;
|
|
14
|
-
edge: Edge;
|
|
15
|
-
}, reactFlowInstance: ReactFlowInstance): void;
|
|
16
|
-
export declare function removePreviewFromReactFlow(reactFlowInstance: ReactFlowInstance): void;
|
|
17
|
-
//# sourceMappingURL=createPreviewNode.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createPreviewNode.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/createPreviewNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EACT,KAAK,IAAI,EACT,QAAQ,EACR,KAAK,iBAAiB,EACvB,MAAM,0CAA0C,CAAC;AAiMlD,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,CAAC,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACnC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,gBAAgB,GAAE,QAAQ,GAAG,QAAmB,EAChD,eAAe,GAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAG/C,EACD,cAAc,GAAE,QAAyB,EACzC,gBAAgB,GAAE,MAAM,EAAO,GAC9B;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GAAG,IAAI,CA2FnC;AAMD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EACnC,iBAAiB,EAAE,iBAAiB,GACnC,IAAI,CAcN;AAKD,wBAAgB,0BAA0B,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAGrF"}
|