@uipath/apollo-react 3.64.0-pr431.cb6b0b8 → 3.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/components/NodePropertiesPanel/hooks/index.cjs +1 -4
- package/dist/canvas/components/NodePropertiesPanel/hooks/index.d.ts +1 -1
- package/dist/canvas/components/NodePropertiesPanel/hooks/index.d.ts.map +1 -1
- package/dist/canvas/components/NodePropertiesPanel/hooks/index.js +2 -2
- package/dist/canvas/components/NodePropertiesPanel/hooks/useNodeSelection.cjs +6 -27
- package/dist/canvas/components/NodePropertiesPanel/hooks/useNodeSelection.d.ts +0 -3
- package/dist/canvas/components/NodePropertiesPanel/hooks/useNodeSelection.d.ts.map +1 -1
- package/dist/canvas/components/NodePropertiesPanel/hooks/useNodeSelection.js +5 -23
- package/dist/canvas/components/StageNode/DraggableTask.cjs +5 -14
- package/dist/canvas/components/StageNode/DraggableTask.d.ts +1 -1
- package/dist/canvas/components/StageNode/DraggableTask.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/DraggableTask.js +5 -14
- package/dist/canvas/components/StageNode/DraggableTask.types.d.ts +3 -3
- package/dist/canvas/components/StageNode/DraggableTask.types.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageEdge.cjs +11 -34
- package/dist/canvas/components/StageNode/StageEdge.d.ts +1 -2
- package/dist/canvas/components/StageNode/StageEdge.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageEdge.js +12 -35
- package/dist/canvas/components/StageNode/StageNode.cjs +51 -54
- package/dist/canvas/components/StageNode/StageNode.d.ts +1 -1
- package/dist/canvas/components/StageNode/StageNode.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.js +56 -59
- package/dist/canvas/components/StageNode/StageNode.stories.cjs +157 -116
- package/dist/canvas/components/StageNode/StageNode.stories.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.stories.js +153 -112
- package/dist/canvas/components/StageNode/StageNode.types.d.ts +2 -9
- package/dist/canvas/components/StageNode/StageNode.types.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.cjs +3 -2
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.d.ts +1 -1
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.js +3 -2
- package/dist/canvas/components/StageNode/TaskMenu.cjs +17 -13
- package/dist/canvas/components/StageNode/TaskMenu.d.ts +2 -1
- package/dist/canvas/components/StageNode/TaskMenu.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/TaskMenu.js +18 -14
- package/package.json +1 -1
- package/dist/canvas/components/CanvasPerformance.stories.cjs +0 -361
- package/dist/canvas/components/CanvasPerformance.stories.d.ts +0 -6
- package/dist/canvas/components/CanvasPerformance.stories.d.ts.map +0 -1
- package/dist/canvas/components/CanvasPerformance.stories.js +0 -324
- package/dist/canvas/components/StageNode/StageNode.stories.utils.cjs +0 -42
- package/dist/canvas/components/StageNode/StageNode.stories.utils.d.ts +0 -3
- package/dist/canvas/components/StageNode/StageNode.stories.utils.d.ts.map +0 -1
- package/dist/canvas/components/StageNode/StageNode.stories.utils.js +0 -8
- package/dist/canvas/components/StageNode/StageTaskDragOverlay.cjs +0 -68
- package/dist/canvas/components/StageNode/StageTaskDragOverlay.d.ts +0 -3
- package/dist/canvas/components/StageNode/StageTaskDragOverlay.d.ts.map +0 -1
- package/dist/canvas/components/StageNode/StageTaskDragOverlay.js +0 -34
|
@@ -24,7 +24,6 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
useSetNodeSelection: ()=>external_useNodeSelection_cjs_namespaceObject.useSetNodeSelection,
|
|
28
27
|
useNodeSelection: ()=>external_useNodeSelection_cjs_namespaceObject.useNodeSelection,
|
|
29
28
|
useNodeConfiguration: ()=>external_useNodeConfiguration_cjs_namespaceObject.useNodeConfiguration
|
|
30
29
|
});
|
|
@@ -32,11 +31,9 @@ const external_useNodeConfiguration_cjs_namespaceObject = require("./useNodeConf
|
|
|
32
31
|
const external_useNodeSelection_cjs_namespaceObject = require("./useNodeSelection.cjs");
|
|
33
32
|
exports.useNodeConfiguration = __webpack_exports__.useNodeConfiguration;
|
|
34
33
|
exports.useNodeSelection = __webpack_exports__.useNodeSelection;
|
|
35
|
-
exports.useSetNodeSelection = __webpack_exports__.useSetNodeSelection;
|
|
36
34
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
37
35
|
"useNodeConfiguration",
|
|
38
|
-
"useNodeSelection"
|
|
39
|
-
"useSetNodeSelection"
|
|
36
|
+
"useNodeSelection"
|
|
40
37
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
41
38
|
Object.defineProperty(exports, '__esModule', {
|
|
42
39
|
value: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/NodePropertiesPanel/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/NodePropertiesPanel/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { useNodeConfiguration } from "./useNodeConfiguration.js";
|
|
2
|
-
import { useNodeSelection
|
|
3
|
-
export { useNodeConfiguration, useNodeSelection
|
|
2
|
+
import { useNodeSelection } from "./useNodeSelection.js";
|
|
3
|
+
export { useNodeConfiguration, useNodeSelection };
|
|
@@ -24,21 +24,10 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
useNodeSelection: ()=>useNodeSelection
|
|
28
|
-
useSetNodeSelection: ()=>useSetNodeSelection
|
|
27
|
+
useNodeSelection: ()=>useNodeSelection
|
|
29
28
|
});
|
|
30
29
|
const react_cjs_namespaceObject = require("../../../xyflow/react.cjs");
|
|
31
30
|
const external_react_namespaceObject = require("react");
|
|
32
|
-
function applySelection(nodes, nodeId) {
|
|
33
|
-
return nodes.map((node)=>{
|
|
34
|
-
const shouldBeSelected = node.id === nodeId;
|
|
35
|
-
if (node.selected === shouldBeSelected) return node;
|
|
36
|
-
return {
|
|
37
|
-
...node,
|
|
38
|
-
selected: shouldBeSelected
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
31
|
function useNodeSelection(nodeId, maintainSelection = true) {
|
|
43
32
|
const nodes = (0, react_cjs_namespaceObject.useNodes)();
|
|
44
33
|
const { setNodes } = (0, react_cjs_namespaceObject.useReactFlow)();
|
|
@@ -51,7 +40,10 @@ function useNodeSelection(nodeId, maintainSelection = true) {
|
|
|
51
40
|
])
|
|
52
41
|
});
|
|
53
42
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
54
|
-
if (maintainSelection && selectedNodeId) setNodes((nds)=>
|
|
43
|
+
if (maintainSelection && selectedNodeId) setNodes((nds)=>nds.map((node)=>({
|
|
44
|
+
...node,
|
|
45
|
+
selected: node.id === selectedNodeId
|
|
46
|
+
})));
|
|
55
47
|
}, [
|
|
56
48
|
selectedNodeId,
|
|
57
49
|
maintainSelection,
|
|
@@ -64,22 +56,9 @@ function useNodeSelection(nodeId, maintainSelection = true) {
|
|
|
64
56
|
selectedNode
|
|
65
57
|
};
|
|
66
58
|
}
|
|
67
|
-
function useSetNodeSelection() {
|
|
68
|
-
const { setNodes } = (0, react_cjs_namespaceObject.useReactFlow)();
|
|
69
|
-
const setSelectedNodeId = (0, external_react_namespaceObject.useCallback)((nodeId)=>{
|
|
70
|
-
setNodes((nds)=>applySelection(nds, nodeId));
|
|
71
|
-
}, [
|
|
72
|
-
setNodes
|
|
73
|
-
]);
|
|
74
|
-
return {
|
|
75
|
-
setSelectedNodeId
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
59
|
exports.useNodeSelection = __webpack_exports__.useNodeSelection;
|
|
79
|
-
exports.useSetNodeSelection = __webpack_exports__.useSetNodeSelection;
|
|
80
60
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
81
|
-
"useNodeSelection"
|
|
82
|
-
"useSetNodeSelection"
|
|
61
|
+
"useNodeSelection"
|
|
83
62
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
84
63
|
Object.defineProperty(exports, '__esModule', {
|
|
85
64
|
value: true
|
|
@@ -4,7 +4,4 @@ export declare function useNodeSelection(nodeId?: string, maintainSelection?: bo
|
|
|
4
4
|
setSelectedNodeId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
5
5
|
selectedNode: ConfigurableNode | undefined;
|
|
6
6
|
};
|
|
7
|
-
export declare function useSetNodeSelection(): {
|
|
8
|
-
setSelectedNodeId: (nodeId: string) => void;
|
|
9
|
-
};
|
|
10
7
|
//# sourceMappingURL=useNodeSelection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNodeSelection.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/NodePropertiesPanel/hooks/useNodeSelection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNodeSelection.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/NodePropertiesPanel/hooks/useNodeSelection.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,iBAAiB,UAAO;;;;EAwCzE"}
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { useNodes, useOnSelectionChange, useReactFlow } from "../../../xyflow/react.js";
|
|
2
2
|
import { useCallback, useEffect, useState } from "react";
|
|
3
|
-
function applySelection(nodes, nodeId) {
|
|
4
|
-
return nodes.map((node)=>{
|
|
5
|
-
const shouldBeSelected = node.id === nodeId;
|
|
6
|
-
if (node.selected === shouldBeSelected) return node;
|
|
7
|
-
return {
|
|
8
|
-
...node,
|
|
9
|
-
selected: shouldBeSelected
|
|
10
|
-
};
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
3
|
function useNodeSelection(nodeId, maintainSelection = true) {
|
|
14
4
|
const nodes = useNodes();
|
|
15
5
|
const { setNodes } = useReactFlow();
|
|
@@ -22,7 +12,10 @@ function useNodeSelection(nodeId, maintainSelection = true) {
|
|
|
22
12
|
])
|
|
23
13
|
});
|
|
24
14
|
useEffect(()=>{
|
|
25
|
-
if (maintainSelection && selectedNodeId) setNodes((nds)=>
|
|
15
|
+
if (maintainSelection && selectedNodeId) setNodes((nds)=>nds.map((node)=>({
|
|
16
|
+
...node,
|
|
17
|
+
selected: node.id === selectedNodeId
|
|
18
|
+
})));
|
|
26
19
|
}, [
|
|
27
20
|
selectedNodeId,
|
|
28
21
|
maintainSelection,
|
|
@@ -35,15 +28,4 @@ function useNodeSelection(nodeId, maintainSelection = true) {
|
|
|
35
28
|
selectedNode
|
|
36
29
|
};
|
|
37
30
|
}
|
|
38
|
-
|
|
39
|
-
const { setNodes } = useReactFlow();
|
|
40
|
-
const setSelectedNodeId = useCallback((nodeId)=>{
|
|
41
|
-
setNodes((nds)=>applySelection(nds, nodeId));
|
|
42
|
-
}, [
|
|
43
|
-
setNodes
|
|
44
|
-
]);
|
|
45
|
-
return {
|
|
46
|
-
setSelectedNodeId
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export { useNodeSelection, useSetNodeSelection };
|
|
31
|
+
export { useNodeSelection };
|
|
@@ -41,7 +41,6 @@ const sortable_namespaceObject = require("@dnd-kit/sortable");
|
|
|
41
41
|
const utilities_namespaceObject = require("@dnd-kit/utilities");
|
|
42
42
|
const apollo_core_namespaceObject = require("@uipath/apollo-core");
|
|
43
43
|
const index_cjs_namespaceObject = require("../../layouts/index.cjs");
|
|
44
|
-
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
45
44
|
const external_material_index_cjs_namespaceObject = require("../../../material/index.cjs");
|
|
46
45
|
const external_debounce_namespaceObject = require("debounce");
|
|
47
46
|
var external_debounce_default = /*#__PURE__*/ __webpack_require__.n(external_debounce_namespaceObject);
|
|
@@ -183,9 +182,8 @@ const TaskContent = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ ta
|
|
|
183
182
|
]
|
|
184
183
|
})
|
|
185
184
|
}));
|
|
186
|
-
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel,
|
|
185
|
+
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, contextMenuItems, onTaskClick, onMenuOpen, onTaskPlay, isDragDisabled, projectedDepth, zoom = 1 })=>{
|
|
187
186
|
const [isMenuOpen, setIsMenuOpen] = (0, external_react_namespaceObject.useState)(false);
|
|
188
|
-
const zoom = (0, react_cjs_namespaceObject.useStore)((s)=>s.transform[2]);
|
|
189
187
|
const taskRef = (0, external_react_namespaceObject.useRef)(null);
|
|
190
188
|
const menuRef = (0, external_react_namespaceObject.useRef)(null);
|
|
191
189
|
const [playLoading, setPlayLoading] = (0, external_react_namespaceObject.useState)(false);
|
|
@@ -223,14 +221,6 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
223
221
|
const handleContextMenu = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
224
222
|
menuRef.current?.handleContextMenu(e);
|
|
225
223
|
}, []);
|
|
226
|
-
const handleGetContextMenuItems = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
227
|
-
if (!getContextMenuItems) return [];
|
|
228
|
-
return getContextMenuItems(groupIndex, taskIndex);
|
|
229
|
-
}, [
|
|
230
|
-
getContextMenuItems,
|
|
231
|
-
groupIndex,
|
|
232
|
-
taskIndex
|
|
233
|
-
]);
|
|
234
224
|
const { attributes, listeners, setNodeRef, transition, transform, isDragging } = (0, sortable_namespaceObject.useSortable)({
|
|
235
225
|
id: task.id,
|
|
236
226
|
disabled: isDragDisabled
|
|
@@ -276,7 +266,7 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
276
266
|
isParallel: isParallel,
|
|
277
267
|
isDragEnabled: !isDragDisabled,
|
|
278
268
|
onClick: handleClick,
|
|
279
|
-
...
|
|
269
|
+
...contextMenuItems.length > 0 && {
|
|
280
270
|
onContextMenu: handleContextMenu
|
|
281
271
|
},
|
|
282
272
|
children: [
|
|
@@ -323,11 +313,12 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
323
313
|
})
|
|
324
314
|
})
|
|
325
315
|
}),
|
|
326
|
-
|
|
316
|
+
contextMenuItems.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskMenu_cjs_namespaceObject.TaskMenu, {
|
|
327
317
|
ref: menuRef,
|
|
328
318
|
taskId: task.id,
|
|
329
|
-
|
|
319
|
+
contextMenuItems: contextMenuItems,
|
|
330
320
|
onMenuOpenChange: handleMenuOpenChange,
|
|
321
|
+
onMenuOpen: onMenuOpen,
|
|
331
322
|
taskRef: taskRef
|
|
332
323
|
})
|
|
333
324
|
]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DraggableTaskProps, TaskContentProps } from './DraggableTask.types';
|
|
2
2
|
export declare const TaskContent: import("react").MemoExoticComponent<({ task, taskExecution, isDragging }: TaskContentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
3
|
-
export declare const DraggableTask: import("react").MemoExoticComponent<({ task, taskExecution, isSelected, isParallel,
|
|
3
|
+
export declare const DraggableTask: import("react").MemoExoticComponent<({ task, taskExecution, isSelected, isParallel, contextMenuItems, onTaskClick, onMenuOpen, onTaskPlay, isDragDisabled, projectedDepth, zoom, }: DraggableTaskProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
4
|
//# sourceMappingURL=DraggableTask.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DraggableTask.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/DraggableTask.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DraggableTask.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/DraggableTask.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAgClF,eAAO,MAAM,WAAW,4EAA8C,gBAAgB,6CAwEpF,CAAC;AAqLH,eAAO,MAAM,aAAa,sLAvKvB,kBAAkB,6CAuKoC,CAAC"}
|
|
@@ -3,7 +3,6 @@ import { useSortable } from "@dnd-kit/sortable";
|
|
|
3
3
|
import { CSS } from "@dnd-kit/utilities";
|
|
4
4
|
import { FontVariantToken, Padding, Spacing } from "@uipath/apollo-core";
|
|
5
5
|
import { Column, Row } from "../../layouts/index.js";
|
|
6
|
-
import { useStore } from "../../xyflow/react.js";
|
|
7
6
|
import { ApBadge, ApCircularProgress, ApIconButton, ApTooltip, ApTypography, BadgeSize } from "../../../material/index.js";
|
|
8
7
|
import debounce from "debounce";
|
|
9
8
|
import { memo, useCallback, useMemo, useRef, useState } from "react";
|
|
@@ -144,9 +143,8 @@ const TaskContent = /*#__PURE__*/ memo(({ task, taskExecution, isDragging })=>/*
|
|
|
144
143
|
]
|
|
145
144
|
})
|
|
146
145
|
}));
|
|
147
|
-
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel,
|
|
146
|
+
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, contextMenuItems, onTaskClick, onMenuOpen, onTaskPlay, isDragDisabled, projectedDepth, zoom = 1 })=>{
|
|
148
147
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
149
|
-
const zoom = useStore((s)=>s.transform[2]);
|
|
150
148
|
const taskRef = useRef(null);
|
|
151
149
|
const menuRef = useRef(null);
|
|
152
150
|
const [playLoading, setPlayLoading] = useState(false);
|
|
@@ -184,14 +182,6 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
184
182
|
const handleContextMenu = useCallback((e)=>{
|
|
185
183
|
menuRef.current?.handleContextMenu(e);
|
|
186
184
|
}, []);
|
|
187
|
-
const handleGetContextMenuItems = useCallback(()=>{
|
|
188
|
-
if (!getContextMenuItems) return [];
|
|
189
|
-
return getContextMenuItems(groupIndex, taskIndex);
|
|
190
|
-
}, [
|
|
191
|
-
getContextMenuItems,
|
|
192
|
-
groupIndex,
|
|
193
|
-
taskIndex
|
|
194
|
-
]);
|
|
195
185
|
const { attributes, listeners, setNodeRef, transition, transform, isDragging } = useSortable({
|
|
196
186
|
id: task.id,
|
|
197
187
|
disabled: isDragDisabled
|
|
@@ -237,7 +227,7 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
237
227
|
isParallel: isParallel,
|
|
238
228
|
isDragEnabled: !isDragDisabled,
|
|
239
229
|
onClick: handleClick,
|
|
240
|
-
...
|
|
230
|
+
...contextMenuItems.length > 0 && {
|
|
241
231
|
onContextMenu: handleContextMenu
|
|
242
232
|
},
|
|
243
233
|
children: [
|
|
@@ -284,11 +274,12 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
284
274
|
})
|
|
285
275
|
})
|
|
286
276
|
}),
|
|
287
|
-
|
|
277
|
+
contextMenuItems.length > 0 && /*#__PURE__*/ jsx(TaskMenu, {
|
|
288
278
|
ref: menuRef,
|
|
289
279
|
taskId: task.id,
|
|
290
|
-
|
|
280
|
+
contextMenuItems: contextMenuItems,
|
|
291
281
|
onMenuOpenChange: handleMenuOpenChange,
|
|
282
|
+
onMenuOpen: onMenuOpen,
|
|
292
283
|
taskRef: taskRef
|
|
293
284
|
})
|
|
294
285
|
]
|
|
@@ -10,12 +10,12 @@ export interface DraggableTaskProps {
|
|
|
10
10
|
taskExecution?: StageTaskExecution;
|
|
11
11
|
isSelected: boolean;
|
|
12
12
|
isParallel: boolean;
|
|
13
|
-
|
|
14
|
-
taskIndex: number;
|
|
15
|
-
getContextMenuItems?: (groupIndex: number, taskIndex: number) => NodeMenuItem[];
|
|
13
|
+
contextMenuItems: NodeMenuItem[];
|
|
16
14
|
onTaskClick: (e: React.MouseEvent, taskId: string) => void;
|
|
15
|
+
onMenuOpen?: () => void;
|
|
17
16
|
onTaskPlay?: (taskId: string) => Promise<void>;
|
|
18
17
|
isDragDisabled?: boolean;
|
|
19
18
|
projectedDepth?: number;
|
|
19
|
+
zoom?: number;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=DraggableTask.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DraggableTask.types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/DraggableTask.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,
|
|
1
|
+
{"version":3,"file":"DraggableTask.types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/DraggableTask.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,YAAY,EAAE,CAAC;IACjC,WAAW,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -40,7 +40,6 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
40
40
|
const styled_namespaceObject = require("@emotion/styled");
|
|
41
41
|
var styled_default = /*#__PURE__*/ __webpack_require__.n(styled_namespaceObject);
|
|
42
42
|
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
43
|
-
const external_react_namespaceObject = require("react");
|
|
44
43
|
const StageEdgeLabel = styled_default().div`
|
|
45
44
|
position: absolute;
|
|
46
45
|
color: var(--uix-canvas-foreground);
|
|
@@ -58,9 +57,6 @@ const StageEdgeLabel = styled_default().div`
|
|
|
58
57
|
border-color: var(--uix-canvas-border-hover);
|
|
59
58
|
}
|
|
60
59
|
`;
|
|
61
|
-
function stageEdgeGeometryEquality(previous, next) {
|
|
62
|
-
return previous.sourceX === next.sourceX && previous.sourceY === next.sourceY && previous.targetX === next.targetX && previous.targetY === next.targetY;
|
|
63
|
-
}
|
|
64
60
|
function getArrowFromBezier(path, arrowSize) {
|
|
65
61
|
const pathEl = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
66
62
|
pathEl.setAttribute('d', path);
|
|
@@ -74,13 +70,19 @@ function getArrowFromBezier(path, arrowSize) {
|
|
|
74
70
|
angle
|
|
75
71
|
};
|
|
76
72
|
}
|
|
77
|
-
function
|
|
73
|
+
function StageEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, selected, style, stroke = 'var(--uix-canvas-foreground-emp)', strokeWidth = 2, arrowSize = 8, ...rest }) {
|
|
74
|
+
const sourceNode = (0, react_cjs_namespaceObject.useInternalNode)(rest.source);
|
|
75
|
+
const targetNode = (0, react_cjs_namespaceObject.useInternalNode)(rest.target);
|
|
76
|
+
const sourceNodeX = sourceNode ? sourceNode.position.x + (sourceNode.measured?.width ?? 0) : sourceX;
|
|
77
|
+
const sourceNodeY = sourceNode?.position.y ? sourceNode.position.y + 32 : sourceY;
|
|
78
|
+
const targetNodeX = targetNode?.position.x ?? targetX;
|
|
79
|
+
const targetNodeY = targetNode?.position.y ? targetNode.position.y + 32 : targetY;
|
|
78
80
|
const [pathData, labelX, labelY, _ex, _ey] = (0, react_cjs_namespaceObject.getSmoothStepPath)({
|
|
79
|
-
sourceX:
|
|
80
|
-
sourceY:
|
|
81
|
+
sourceX: sourceNodeX,
|
|
82
|
+
sourceY: sourceNodeY,
|
|
81
83
|
sourcePosition,
|
|
82
|
-
targetX:
|
|
83
|
-
targetY:
|
|
84
|
+
targetX: targetNodeX - 1,
|
|
85
|
+
targetY: targetNodeY,
|
|
84
86
|
targetPosition,
|
|
85
87
|
borderRadius: 40
|
|
86
88
|
});
|
|
@@ -139,31 +141,6 @@ function StageEdgeInner({ geometry, sourcePosition, targetPosition, selected, st
|
|
|
139
141
|
]
|
|
140
142
|
});
|
|
141
143
|
}
|
|
142
|
-
const StageEdgeInnerMemo = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(StageEdgeInner);
|
|
143
|
-
function StageEdgeComponent({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, selected, style, stroke, strokeWidth, arrowSize, ...rest }) {
|
|
144
|
-
const geometry = (0, react_cjs_namespaceObject.useStore)((state)=>{
|
|
145
|
-
const sourceNode = state.nodeLookup.get(rest.source);
|
|
146
|
-
const targetNode = state.nodeLookup.get(rest.target);
|
|
147
|
-
return {
|
|
148
|
-
sourceX: sourceNode ? sourceNode.position.x + (sourceNode.measured?.width ?? 0) : sourceX,
|
|
149
|
-
sourceY: sourceNode ? sourceNode.position.y + 32 : sourceY,
|
|
150
|
-
targetX: targetNode?.position.x ?? targetX,
|
|
151
|
-
targetY: targetNode ? targetNode.position.y + 32 : targetY
|
|
152
|
-
};
|
|
153
|
-
}, stageEdgeGeometryEquality);
|
|
154
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(StageEdgeInnerMemo, {
|
|
155
|
-
geometry: geometry,
|
|
156
|
-
sourcePosition: sourcePosition,
|
|
157
|
-
targetPosition: targetPosition,
|
|
158
|
-
selected: selected,
|
|
159
|
-
style: style,
|
|
160
|
-
stroke: stroke,
|
|
161
|
-
strokeWidth: strokeWidth,
|
|
162
|
-
arrowSize: arrowSize,
|
|
163
|
-
...rest
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
const StageEdge = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(StageEdgeComponent);
|
|
167
144
|
exports.StageEdge = __webpack_exports__.StageEdge;
|
|
168
145
|
exports.StageEdgeLabel = __webpack_exports__.StageEdgeLabel;
|
|
169
146
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
@@ -8,7 +8,6 @@ type Props = EdgeProps & {
|
|
|
8
8
|
strokeWidth?: number;
|
|
9
9
|
arrowSize?: number;
|
|
10
10
|
};
|
|
11
|
-
declare function
|
|
12
|
-
export declare const StageEdge: import("react").MemoExoticComponent<typeof StageEdgeComponent>;
|
|
11
|
+
export declare function StageEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, selected, style, stroke, strokeWidth, arrowSize, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export {};
|
|
14
13
|
//# sourceMappingURL=StageEdge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageEdge.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageEdge.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"StageEdge.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageEdge.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAO1E,eAAO,MAAM,cAAc;;;yGAgB1B,CAAC;AAEF,KAAK,KAAK,GAAG,SAAS,GAAG;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAkBF,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,QAAQ,EACR,KAAK,EACL,MAA2C,EAC3C,WAAe,EACf,SAAa,EACb,GAAG,IAAI,EACR,EAAE,KAAK,2CAiFP"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
|
-
import { EdgeLabelRenderer, getSmoothStepPath,
|
|
4
|
-
import { memo } from "react";
|
|
3
|
+
import { EdgeLabelRenderer, getSmoothStepPath, useInternalNode } from "../../xyflow/react.js";
|
|
5
4
|
const StageEdgeLabel = styled.div`
|
|
6
5
|
position: absolute;
|
|
7
6
|
color: var(--uix-canvas-foreground);
|
|
@@ -19,9 +18,6 @@ const StageEdgeLabel = styled.div`
|
|
|
19
18
|
border-color: var(--uix-canvas-border-hover);
|
|
20
19
|
}
|
|
21
20
|
`;
|
|
22
|
-
function stageEdgeGeometryEquality(previous, next) {
|
|
23
|
-
return previous.sourceX === next.sourceX && previous.sourceY === next.sourceY && previous.targetX === next.targetX && previous.targetY === next.targetY;
|
|
24
|
-
}
|
|
25
21
|
function getArrowFromBezier(path, arrowSize) {
|
|
26
22
|
const pathEl = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
27
23
|
pathEl.setAttribute('d', path);
|
|
@@ -35,13 +31,19 @@ function getArrowFromBezier(path, arrowSize) {
|
|
|
35
31
|
angle
|
|
36
32
|
};
|
|
37
33
|
}
|
|
38
|
-
function
|
|
34
|
+
function StageEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, selected, style, stroke = 'var(--uix-canvas-foreground-emp)', strokeWidth = 2, arrowSize = 8, ...rest }) {
|
|
35
|
+
const sourceNode = useInternalNode(rest.source);
|
|
36
|
+
const targetNode = useInternalNode(rest.target);
|
|
37
|
+
const sourceNodeX = sourceNode ? sourceNode.position.x + (sourceNode.measured?.width ?? 0) : sourceX;
|
|
38
|
+
const sourceNodeY = sourceNode?.position.y ? sourceNode.position.y + 32 : sourceY;
|
|
39
|
+
const targetNodeX = targetNode?.position.x ?? targetX;
|
|
40
|
+
const targetNodeY = targetNode?.position.y ? targetNode.position.y + 32 : targetY;
|
|
39
41
|
const [pathData, labelX, labelY, _ex, _ey] = getSmoothStepPath({
|
|
40
|
-
sourceX:
|
|
41
|
-
sourceY:
|
|
42
|
+
sourceX: sourceNodeX,
|
|
43
|
+
sourceY: sourceNodeY,
|
|
42
44
|
sourcePosition,
|
|
43
|
-
targetX:
|
|
44
|
-
targetY:
|
|
45
|
+
targetX: targetNodeX - 1,
|
|
46
|
+
targetY: targetNodeY,
|
|
45
47
|
targetPosition,
|
|
46
48
|
borderRadius: 40
|
|
47
49
|
});
|
|
@@ -100,29 +102,4 @@ function StageEdgeInner({ geometry, sourcePosition, targetPosition, selected, st
|
|
|
100
102
|
]
|
|
101
103
|
});
|
|
102
104
|
}
|
|
103
|
-
const StageEdgeInnerMemo = /*#__PURE__*/ memo(StageEdgeInner);
|
|
104
|
-
function StageEdgeComponent({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, selected, style, stroke, strokeWidth, arrowSize, ...rest }) {
|
|
105
|
-
const geometry = useStore((state)=>{
|
|
106
|
-
const sourceNode = state.nodeLookup.get(rest.source);
|
|
107
|
-
const targetNode = state.nodeLookup.get(rest.target);
|
|
108
|
-
return {
|
|
109
|
-
sourceX: sourceNode ? sourceNode.position.x + (sourceNode.measured?.width ?? 0) : sourceX,
|
|
110
|
-
sourceY: sourceNode ? sourceNode.position.y + 32 : sourceY,
|
|
111
|
-
targetX: targetNode?.position.x ?? targetX,
|
|
112
|
-
targetY: targetNode ? targetNode.position.y + 32 : targetY
|
|
113
|
-
};
|
|
114
|
-
}, stageEdgeGeometryEquality);
|
|
115
|
-
return /*#__PURE__*/ jsx(StageEdgeInnerMemo, {
|
|
116
|
-
geometry: geometry,
|
|
117
|
-
sourcePosition: sourcePosition,
|
|
118
|
-
targetPosition: targetPosition,
|
|
119
|
-
selected: selected,
|
|
120
|
-
style: style,
|
|
121
|
-
stroke: stroke,
|
|
122
|
-
strokeWidth: strokeWidth,
|
|
123
|
-
arrowSize: arrowSize,
|
|
124
|
-
...rest
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
const StageEdge = /*#__PURE__*/ memo(StageEdgeComponent);
|
|
128
105
|
export { StageEdge, StageEdgeLabel };
|