@uipath/apollo-react 3.63.0-pr431.b5c8666 → 3.63.0-pr439.3bc6dce
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 +5 -30
- 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 +4 -26
- package/dist/canvas/components/StageNode/DraggableTask.cjs +7 -9
- 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 +7 -9
- package/dist/canvas/components/StageNode/DraggableTask.types.d.ts +2 -1
- package/dist/canvas/components/StageNode/DraggableTask.types.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.cjs +11 -12
- package/dist/canvas/components/StageNode/StageNode.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.js +13 -14
- package/dist/canvas/components/StageNode/StageNode.stories.cjs +152 -114
- package/dist/canvas/components/StageNode/StageNode.stories.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.stories.js +153 -115
- package/dist/canvas/components/StageNode/TaskMenu.cjs +12 -12
- package/dist/canvas/components/StageNode/TaskMenu.d.ts +1 -1
- package/dist/canvas/components/StageNode/TaskMenu.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/TaskMenu.js +13 -13
- package/dist/canvas/components/Toolbox/Toolbox.cjs +3 -3
- package/dist/canvas/components/Toolbox/Toolbox.d.ts +3 -1
- package/dist/canvas/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/Toolbox.js +3 -3
- package/package.json +1 -1
|
@@ -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,8 +24,7 @@ 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");
|
|
@@ -41,14 +40,10 @@ function useNodeSelection(nodeId, maintainSelection = true) {
|
|
|
41
40
|
])
|
|
42
41
|
});
|
|
43
42
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
44
|
-
if (maintainSelection && selectedNodeId) setNodes((nds)=>nds.map((node)=>{
|
|
45
|
-
const shouldBeSelected = node.id === selectedNodeId;
|
|
46
|
-
if (node.selected === shouldBeSelected) return node;
|
|
47
|
-
return {
|
|
43
|
+
if (maintainSelection && selectedNodeId) setNodes((nds)=>nds.map((node)=>({
|
|
48
44
|
...node,
|
|
49
|
-
selected:
|
|
50
|
-
};
|
|
51
|
-
}));
|
|
45
|
+
selected: node.id === selectedNodeId
|
|
46
|
+
})));
|
|
52
47
|
}, [
|
|
53
48
|
selectedNodeId,
|
|
54
49
|
maintainSelection,
|
|
@@ -61,29 +56,9 @@ function useNodeSelection(nodeId, maintainSelection = true) {
|
|
|
61
56
|
selectedNode
|
|
62
57
|
};
|
|
63
58
|
}
|
|
64
|
-
function useSetNodeSelection() {
|
|
65
|
-
const { setNodes } = (0, react_cjs_namespaceObject.useReactFlow)();
|
|
66
|
-
const setSelectedNodeId = (0, external_react_namespaceObject.useCallback)((nodeId)=>{
|
|
67
|
-
setNodes((nds)=>nds.map((node)=>{
|
|
68
|
-
const shouldBeSelected = node.id === nodeId;
|
|
69
|
-
if (node.selected === shouldBeSelected) return node;
|
|
70
|
-
return {
|
|
71
|
-
...node,
|
|
72
|
-
selected: shouldBeSelected
|
|
73
|
-
};
|
|
74
|
-
}));
|
|
75
|
-
}, [
|
|
76
|
-
setNodes
|
|
77
|
-
]);
|
|
78
|
-
return {
|
|
79
|
-
setSelectedNodeId
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
59
|
exports.useNodeSelection = __webpack_exports__.useNodeSelection;
|
|
83
|
-
exports.useSetNodeSelection = __webpack_exports__.useSetNodeSelection;
|
|
84
60
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
85
|
-
"useNodeSelection"
|
|
86
|
-
"useSetNodeSelection"
|
|
61
|
+
"useNodeSelection"
|
|
87
62
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
88
63
|
Object.defineProperty(exports, '__esModule', {
|
|
89
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":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,iBAAiB,UAAO;;;;
|
|
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"}
|
|
@@ -12,14 +12,10 @@ function useNodeSelection(nodeId, maintainSelection = true) {
|
|
|
12
12
|
])
|
|
13
13
|
});
|
|
14
14
|
useEffect(()=>{
|
|
15
|
-
if (maintainSelection && selectedNodeId) setNodes((nds)=>nds.map((node)=>{
|
|
16
|
-
const shouldBeSelected = node.id === selectedNodeId;
|
|
17
|
-
if (node.selected === shouldBeSelected) return node;
|
|
18
|
-
return {
|
|
15
|
+
if (maintainSelection && selectedNodeId) setNodes((nds)=>nds.map((node)=>({
|
|
19
16
|
...node,
|
|
20
|
-
selected:
|
|
21
|
-
};
|
|
22
|
-
}));
|
|
17
|
+
selected: node.id === selectedNodeId
|
|
18
|
+
})));
|
|
23
19
|
}, [
|
|
24
20
|
selectedNodeId,
|
|
25
21
|
maintainSelection,
|
|
@@ -32,22 +28,4 @@ function useNodeSelection(nodeId, maintainSelection = true) {
|
|
|
32
28
|
selectedNode
|
|
33
29
|
};
|
|
34
30
|
}
|
|
35
|
-
|
|
36
|
-
const { setNodes } = useReactFlow();
|
|
37
|
-
const setSelectedNodeId = useCallback((nodeId)=>{
|
|
38
|
-
setNodes((nds)=>nds.map((node)=>{
|
|
39
|
-
const shouldBeSelected = node.id === nodeId;
|
|
40
|
-
if (node.selected === shouldBeSelected) return node;
|
|
41
|
-
return {
|
|
42
|
-
...node,
|
|
43
|
-
selected: shouldBeSelected
|
|
44
|
-
};
|
|
45
|
-
}));
|
|
46
|
-
}, [
|
|
47
|
-
setNodes
|
|
48
|
-
]);
|
|
49
|
-
return {
|
|
50
|
-
setSelectedNodeId
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
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 storeApi = (0, react_cjs_namespaceObject.useStoreApi)();
|
|
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);
|
|
@@ -230,8 +228,8 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
230
228
|
const style = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
231
229
|
const scaledTransform = transform ? {
|
|
232
230
|
...transform,
|
|
233
|
-
x: transform.x /
|
|
234
|
-
y: transform.y /
|
|
231
|
+
x: transform.x / zoom,
|
|
232
|
+
y: transform.y / zoom
|
|
235
233
|
} : null;
|
|
236
234
|
let marginLeft;
|
|
237
235
|
if (isDragging && void 0 !== projectedDepth) if (1 !== projectedDepth || isParallel) {
|
|
@@ -244,7 +242,7 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
244
242
|
};
|
|
245
243
|
}, [
|
|
246
244
|
transform,
|
|
247
|
-
|
|
245
|
+
zoom,
|
|
248
246
|
transition,
|
|
249
247
|
isDragging,
|
|
250
248
|
projectedDepth,
|
|
@@ -268,7 +266,7 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
268
266
|
isParallel: isParallel,
|
|
269
267
|
isDragEnabled: !isDragDisabled,
|
|
270
268
|
onClick: handleClick,
|
|
271
|
-
...
|
|
269
|
+
...contextMenuItems.length > 0 && {
|
|
272
270
|
onContextMenu: handleContextMenu
|
|
273
271
|
},
|
|
274
272
|
children: [
|
|
@@ -315,10 +313,10 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
315
313
|
})
|
|
316
314
|
})
|
|
317
315
|
}),
|
|
318
|
-
|
|
316
|
+
contextMenuItems.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskMenu_cjs_namespaceObject.TaskMenu, {
|
|
319
317
|
ref: menuRef,
|
|
320
318
|
taskId: task.id,
|
|
321
|
-
|
|
319
|
+
contextMenuItems: contextMenuItems,
|
|
322
320
|
onMenuOpenChange: handleMenuOpenChange,
|
|
323
321
|
onMenuOpen: onMenuOpen,
|
|
324
322
|
taskRef: taskRef
|
|
@@ -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 { useStoreApi } 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 storeApi = useStoreApi();
|
|
150
148
|
const taskRef = useRef(null);
|
|
151
149
|
const menuRef = useRef(null);
|
|
152
150
|
const [playLoading, setPlayLoading] = useState(false);
|
|
@@ -191,8 +189,8 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
191
189
|
const style = useMemo(()=>{
|
|
192
190
|
const scaledTransform = transform ? {
|
|
193
191
|
...transform,
|
|
194
|
-
x: transform.x /
|
|
195
|
-
y: transform.y /
|
|
192
|
+
x: transform.x / zoom,
|
|
193
|
+
y: transform.y / zoom
|
|
196
194
|
} : null;
|
|
197
195
|
let marginLeft;
|
|
198
196
|
if (isDragging && void 0 !== projectedDepth) if (1 !== projectedDepth || isParallel) {
|
|
@@ -205,7 +203,7 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
205
203
|
};
|
|
206
204
|
}, [
|
|
207
205
|
transform,
|
|
208
|
-
|
|
206
|
+
zoom,
|
|
209
207
|
transition,
|
|
210
208
|
isDragging,
|
|
211
209
|
projectedDepth,
|
|
@@ -229,7 +227,7 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
229
227
|
isParallel: isParallel,
|
|
230
228
|
isDragEnabled: !isDragDisabled,
|
|
231
229
|
onClick: handleClick,
|
|
232
|
-
...
|
|
230
|
+
...contextMenuItems.length > 0 && {
|
|
233
231
|
onContextMenu: handleContextMenu
|
|
234
232
|
},
|
|
235
233
|
children: [
|
|
@@ -276,10 +274,10 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
276
274
|
})
|
|
277
275
|
})
|
|
278
276
|
}),
|
|
279
|
-
|
|
277
|
+
contextMenuItems.length > 0 && /*#__PURE__*/ jsx(TaskMenu, {
|
|
280
278
|
ref: menuRef,
|
|
281
279
|
taskId: task.id,
|
|
282
|
-
|
|
280
|
+
contextMenuItems: contextMenuItems,
|
|
283
281
|
onMenuOpenChange: handleMenuOpenChange,
|
|
284
282
|
onMenuOpen: onMenuOpen,
|
|
285
283
|
taskRef: taskRef
|
|
@@ -10,11 +10,12 @@ export interface DraggableTaskProps {
|
|
|
10
10
|
taskExecution?: StageTaskExecution;
|
|
11
11
|
isSelected: boolean;
|
|
12
12
|
isParallel: boolean;
|
|
13
|
-
|
|
13
|
+
contextMenuItems: NodeMenuItem[];
|
|
14
14
|
onTaskClick: (e: React.MouseEvent, taskId: string) => void;
|
|
15
15
|
onMenuOpen?: () => void;
|
|
16
16
|
onTaskPlay?: (taskId: string) => Promise<void>;
|
|
17
17
|
isDragDisabled?: boolean;
|
|
18
18
|
projectedDepth?: number;
|
|
19
|
+
zoom?: number;
|
|
19
20
|
}
|
|
20
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"}
|
|
@@ -85,7 +85,6 @@ const StageNodeComponent = (props)=>{
|
|
|
85
85
|
taskIndex: -1
|
|
86
86
|
});
|
|
87
87
|
const isConnecting = (0, react_cjs_namespaceObject.useStore)((state)=>!!state.connectionClickStartHandle);
|
|
88
|
-
const storeApi = (0, react_cjs_namespaceObject.useStoreApi)();
|
|
89
88
|
const connectedHandleIds = (0, ConnectedHandlesContext_cjs_namespaceObject.useConnectedHandles)(id);
|
|
90
89
|
const [isAddingTask, setIsAddingTask] = (0, external_react_namespaceObject.useState)(false);
|
|
91
90
|
const [isReplacingTask, setIsReplacingTask] = (0, external_react_namespaceObject.useState)(false);
|
|
@@ -125,6 +124,7 @@ const StageNodeComponent = (props)=>{
|
|
|
125
124
|
tasks,
|
|
126
125
|
activeDragId
|
|
127
126
|
]);
|
|
127
|
+
const { zoom } = (0, react_cjs_namespaceObject.useViewport)();
|
|
128
128
|
const projected = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
129
129
|
if (!activeDragId || !overId) return null;
|
|
130
130
|
return (0, external_StageNode_utils_cjs_namespaceObject.getProjection)(tasks, activeDragId, overId, offsetLeft);
|
|
@@ -207,8 +207,7 @@ const StageNodeComponent = (props)=>{
|
|
|
207
207
|
handleStageTitleClickToSave,
|
|
208
208
|
isStageTitleEditing
|
|
209
209
|
]);
|
|
210
|
-
const
|
|
211
|
-
const buildContextMenuItems = (0, external_react_namespaceObject.useCallback)((isParallel, groupIndex, taskIndex)=>{
|
|
210
|
+
const contextMenuItems = (0, external_react_namespaceObject.useCallback)((isParallel, groupIndex, taskIndex, tasksLength, taskGroupLength, isAboveParallel, isBelowParallel)=>{
|
|
212
211
|
const items = [];
|
|
213
212
|
if (onReplaceTaskFromToolbox) {
|
|
214
213
|
items.push((0, external_StageNodeTaskUtilities_cjs_namespaceObject.getMenuItem)('replace-task', 'Replace task', ()=>{
|
|
@@ -219,8 +218,7 @@ const StageNodeComponent = (props)=>{
|
|
|
219
218
|
items.push((0, external_StageNodeTaskUtilities_cjs_namespaceObject.getDivider)());
|
|
220
219
|
}
|
|
221
220
|
if (onTaskGroupModification) {
|
|
222
|
-
const
|
|
223
|
-
const reGroupOptions = (0, external_StageNodeTaskUtilities_cjs_namespaceObject.getContextMenuItems)(isParallel, groupIndex, tasks.length, taskIndex, taskGroup.length, (tasks[groupIndex - 1]?.length ?? 0) > 1, (tasks[groupIndex + 1]?.length ?? 0) > 1, reGroupTaskFunction);
|
|
221
|
+
const reGroupOptions = (0, external_StageNodeTaskUtilities_cjs_namespaceObject.getContextMenuItems)(isParallel, groupIndex, tasksLength, taskIndex, taskGroupLength, isAboveParallel, isBelowParallel, reGroupTaskFunction);
|
|
224
222
|
return [
|
|
225
223
|
...items,
|
|
226
224
|
...reGroupOptions
|
|
@@ -234,7 +232,7 @@ const StageNodeComponent = (props)=>{
|
|
|
234
232
|
reGroupTaskFunction,
|
|
235
233
|
tasks
|
|
236
234
|
]);
|
|
237
|
-
const { setSelectedNodeId } = (0, hooks_index_cjs_namespaceObject.
|
|
235
|
+
const { setSelectedNodeId } = (0, hooks_index_cjs_namespaceObject.useNodeSelection)();
|
|
238
236
|
const handleStageClick = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
239
237
|
onStageClick?.();
|
|
240
238
|
}, [
|
|
@@ -357,9 +355,9 @@ const StageNodeComponent = (props)=>{
|
|
|
357
355
|
setActiveDragId(event.active.id);
|
|
358
356
|
}, []);
|
|
359
357
|
const handleDragMove = (0, external_react_namespaceObject.useCallback)((event)=>{
|
|
360
|
-
setOffsetLeft(event.delta.x /
|
|
358
|
+
setOffsetLeft(event.delta.x / zoom);
|
|
361
359
|
}, [
|
|
362
|
-
|
|
360
|
+
zoom
|
|
363
361
|
]);
|
|
364
362
|
const handleDragOver = (0, external_react_namespaceObject.useCallback)((event)=>{
|
|
365
363
|
setOverId(event.over?.id ?? null);
|
|
@@ -396,10 +394,10 @@ const StageNodeComponent = (props)=>{
|
|
|
396
394
|
taskWidth
|
|
397
395
|
]);
|
|
398
396
|
const dragOverlayStyle = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
399
|
-
transform: `scale(${
|
|
397
|
+
transform: `scale(${zoom})`,
|
|
400
398
|
transformOrigin: 'top left'
|
|
401
399
|
}), [
|
|
402
|
-
|
|
400
|
+
zoom
|
|
403
401
|
]);
|
|
404
402
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
405
403
|
"data-testid": `stage-${id}`,
|
|
@@ -540,12 +538,13 @@ const StageNodeComponent = (props)=>{
|
|
|
540
538
|
taskExecution: taskExecution,
|
|
541
539
|
isSelected: selectedTaskId === task.id,
|
|
542
540
|
isParallel: isParallel,
|
|
541
|
+
contextMenuItems: contextMenuItems(isParallel, groupIndex, taskIndex, tasks.length, taskGroup.length, (tasks[groupIndex - 1]?.length ?? 0) > 1, (tasks[groupIndex + 1]?.length ?? 0) > 1),
|
|
543
542
|
onTaskClick: handleTaskClick,
|
|
544
543
|
projectedDepth: task.id === activeDragId && projected ? projected.depth : void 0,
|
|
545
544
|
onTaskPlay: onTaskPlay,
|
|
546
545
|
isDragDisabled: !onTaskReorder,
|
|
547
|
-
|
|
548
|
-
|
|
546
|
+
zoom: zoom,
|
|
547
|
+
...(onTaskGroupModification || onReplaceTaskFromToolbox) && {
|
|
549
548
|
onMenuOpen: ()=>{
|
|
550
549
|
taskStateReference.current = {
|
|
551
550
|
isParallel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.tsx"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"StageNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.tsx"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA2pBxD,eAAO,MAAM,SAAS,8CAjpBa,cAAc,6CAipBA,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { DndContext, DragOverlay, KeyboardSensor, PointerSensor, closestCenter,
|
|
|
3
3
|
import { SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
4
4
|
import { FontVariantToken, Padding, Spacing } from "@uipath/apollo-core";
|
|
5
5
|
import { Column, Row } from "../../layouts/index.js";
|
|
6
|
-
import { Position, useStore,
|
|
6
|
+
import { Position, useStore, useViewport } from "../../xyflow/react.js";
|
|
7
7
|
import { ApIcon, ApIconButton, ApLink, ApTooltip, ApTypography } from "../../../material/index.js";
|
|
8
8
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { createPortal } from "react-dom";
|
|
@@ -12,7 +12,7 @@ import { useButtonHandles } from "../ButtonHandle/useButtonHandles.js";
|
|
|
12
12
|
import { ExecutionStatusIcon } from "../ExecutionStatusIcon/index.js";
|
|
13
13
|
import { FloatingCanvasPanel } from "../FloatingCanvasPanel/index.js";
|
|
14
14
|
import { NodeContextMenu } from "../NodeContextMenu/index.js";
|
|
15
|
-
import {
|
|
15
|
+
import { useNodeSelection } from "../NodePropertiesPanel/hooks/index.js";
|
|
16
16
|
import { Toolbox } from "../Toolbox/index.js";
|
|
17
17
|
import { DraggableTask, TaskContent } from "./DraggableTask.js";
|
|
18
18
|
import { INDENTATION_WIDTH, STAGE_CONTENT_INSET, StageContainer, StageContent, StageHeader, StageParallelBracket, StageParallelLabel, StageTask, StageTaskGroup, StageTaskList, StageTitleContainer, StageTitleInput } from "./StageNode.styles.js";
|
|
@@ -57,7 +57,6 @@ const StageNodeComponent = (props)=>{
|
|
|
57
57
|
taskIndex: -1
|
|
58
58
|
});
|
|
59
59
|
const isConnecting = useStore((state)=>!!state.connectionClickStartHandle);
|
|
60
|
-
const storeApi = useStoreApi();
|
|
61
60
|
const connectedHandleIds = useConnectedHandles(id);
|
|
62
61
|
const [isAddingTask, setIsAddingTask] = useState(false);
|
|
63
62
|
const [isReplacingTask, setIsReplacingTask] = useState(false);
|
|
@@ -97,6 +96,7 @@ const StageNodeComponent = (props)=>{
|
|
|
97
96
|
tasks,
|
|
98
97
|
activeDragId
|
|
99
98
|
]);
|
|
99
|
+
const { zoom } = useViewport();
|
|
100
100
|
const projected = useMemo(()=>{
|
|
101
101
|
if (!activeDragId || !overId) return null;
|
|
102
102
|
return getProjection(tasks, activeDragId, overId, offsetLeft);
|
|
@@ -179,8 +179,7 @@ const StageNodeComponent = (props)=>{
|
|
|
179
179
|
handleStageTitleClickToSave,
|
|
180
180
|
isStageTitleEditing
|
|
181
181
|
]);
|
|
182
|
-
const
|
|
183
|
-
const buildContextMenuItems = useCallback((isParallel, groupIndex, taskIndex)=>{
|
|
182
|
+
const contextMenuItems = useCallback((isParallel, groupIndex, taskIndex, tasksLength, taskGroupLength, isAboveParallel, isBelowParallel)=>{
|
|
184
183
|
const items = [];
|
|
185
184
|
if (onReplaceTaskFromToolbox) {
|
|
186
185
|
items.push(getMenuItem('replace-task', 'Replace task', ()=>{
|
|
@@ -191,8 +190,7 @@ const StageNodeComponent = (props)=>{
|
|
|
191
190
|
items.push(getDivider());
|
|
192
191
|
}
|
|
193
192
|
if (onTaskGroupModification) {
|
|
194
|
-
const
|
|
195
|
-
const reGroupOptions = getContextMenuItems(isParallel, groupIndex, tasks.length, taskIndex, taskGroup.length, (tasks[groupIndex - 1]?.length ?? 0) > 1, (tasks[groupIndex + 1]?.length ?? 0) > 1, reGroupTaskFunction);
|
|
193
|
+
const reGroupOptions = getContextMenuItems(isParallel, groupIndex, tasksLength, taskIndex, taskGroupLength, isAboveParallel, isBelowParallel, reGroupTaskFunction);
|
|
196
194
|
return [
|
|
197
195
|
...items,
|
|
198
196
|
...reGroupOptions
|
|
@@ -206,7 +204,7 @@ const StageNodeComponent = (props)=>{
|
|
|
206
204
|
reGroupTaskFunction,
|
|
207
205
|
tasks
|
|
208
206
|
]);
|
|
209
|
-
const { setSelectedNodeId } =
|
|
207
|
+
const { setSelectedNodeId } = useNodeSelection();
|
|
210
208
|
const handleStageClick = useCallback(()=>{
|
|
211
209
|
onStageClick?.();
|
|
212
210
|
}, [
|
|
@@ -329,9 +327,9 @@ const StageNodeComponent = (props)=>{
|
|
|
329
327
|
setActiveDragId(event.active.id);
|
|
330
328
|
}, []);
|
|
331
329
|
const handleDragMove = useCallback((event)=>{
|
|
332
|
-
setOffsetLeft(event.delta.x /
|
|
330
|
+
setOffsetLeft(event.delta.x / zoom);
|
|
333
331
|
}, [
|
|
334
|
-
|
|
332
|
+
zoom
|
|
335
333
|
]);
|
|
336
334
|
const handleDragOver = useCallback((event)=>{
|
|
337
335
|
setOverId(event.over?.id ?? null);
|
|
@@ -368,10 +366,10 @@ const StageNodeComponent = (props)=>{
|
|
|
368
366
|
taskWidth
|
|
369
367
|
]);
|
|
370
368
|
const dragOverlayStyle = useMemo(()=>({
|
|
371
|
-
transform: `scale(${
|
|
369
|
+
transform: `scale(${zoom})`,
|
|
372
370
|
transformOrigin: 'top left'
|
|
373
371
|
}), [
|
|
374
|
-
|
|
372
|
+
zoom
|
|
375
373
|
]);
|
|
376
374
|
return /*#__PURE__*/ jsxs("div", {
|
|
377
375
|
"data-testid": `stage-${id}`,
|
|
@@ -512,12 +510,13 @@ const StageNodeComponent = (props)=>{
|
|
|
512
510
|
taskExecution: taskExecution,
|
|
513
511
|
isSelected: selectedTaskId === task.id,
|
|
514
512
|
isParallel: isParallel,
|
|
513
|
+
contextMenuItems: contextMenuItems(isParallel, groupIndex, taskIndex, tasks.length, taskGroup.length, (tasks[groupIndex - 1]?.length ?? 0) > 1, (tasks[groupIndex + 1]?.length ?? 0) > 1),
|
|
515
514
|
onTaskClick: handleTaskClick,
|
|
516
515
|
projectedDepth: task.id === activeDragId && projected ? projected.depth : void 0,
|
|
517
516
|
onTaskPlay: onTaskPlay,
|
|
518
517
|
isDragDisabled: !onTaskReorder,
|
|
519
|
-
|
|
520
|
-
|
|
518
|
+
zoom: zoom,
|
|
519
|
+
...(onTaskGroupModification || onReplaceTaskFromToolbox) && {
|
|
521
520
|
onMenuOpen: ()=>{
|
|
522
521
|
taskStateReference.current = {
|
|
523
522
|
isParallel,
|