@uipath/apollo-react 3.68.2 → 3.68.3-pr431.42f9a1c
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/CanvasPerformance.stories.cjs +349 -0
- package/dist/canvas/components/CanvasPerformance.stories.d.ts +6 -0
- package/dist/canvas/components/CanvasPerformance.stories.d.ts.map +1 -0
- package/dist/canvas/components/CanvasPerformance.stories.js +312 -0
- package/dist/canvas/components/NodePropertiesPanel/hooks/index.cjs +4 -1
- 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 +27 -6
- package/dist/canvas/components/NodePropertiesPanel/hooks/useNodeSelection.d.ts +3 -0
- package/dist/canvas/components/NodePropertiesPanel/hooks/useNodeSelection.d.ts.map +1 -1
- package/dist/canvas/components/NodePropertiesPanel/hooks/useNodeSelection.js +23 -5
- package/dist/canvas/components/StageNode/AdhocTask.cjs +148 -0
- package/dist/canvas/components/StageNode/AdhocTask.d.ts +13 -0
- package/dist/canvas/components/StageNode/AdhocTask.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/AdhocTask.js +104 -0
- package/dist/canvas/components/StageNode/DraggableTask.cjs +14 -5
- 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 +14 -5
- 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 +34 -11
- package/dist/canvas/components/StageNode/StageEdge.d.ts +2 -1
- package/dist/canvas/components/StageNode/StageEdge.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageEdge.js +35 -12
- package/dist/canvas/components/StageNode/StageNode.cjs +65 -122
- package/dist/canvas/components/StageNode/StageNode.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.js +72 -119
- package/dist/canvas/components/StageNode/StageNode.stories.cjs +134 -180
- package/dist/canvas/components/StageNode/StageNode.stories.d.ts +2 -2
- package/dist/canvas/components/StageNode/StageNode.stories.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.stories.js +130 -176
- package/dist/canvas/components/StageNode/StageNode.stories.utils.cjs +45 -0
- package/dist/canvas/components/StageNode/StageNode.stories.utils.d.ts +8 -0
- package/dist/canvas/components/StageNode/StageNode.stories.utils.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/StageNode.stories.utils.js +11 -0
- package/dist/canvas/components/StageNode/StageNode.styles.cjs +1 -1
- package/dist/canvas/components/StageNode/StageNode.styles.js +1 -1
- package/dist/canvas/components/StageNode/StageNode.types.d.ts +9 -4
- package/dist/canvas/components/StageNode/StageNode.types.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageTaskDragOverlay.cjs +69 -0
- package/dist/canvas/components/StageNode/StageTaskDragOverlay.d.ts +3 -0
- package/dist/canvas/components/StageNode/StageTaskDragOverlay.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/StageTaskDragOverlay.js +35 -0
- package/dist/canvas/components/StageNode/TaskMenu.cjs +13 -17
- package/dist/canvas/components/StageNode/TaskMenu.d.ts +1 -2
- package/dist/canvas/components/StageNode/TaskMenu.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/TaskMenu.js +14 -18
- package/dist/canvas/components/StageNode/index.d.ts +1 -1
- package/dist/canvas/components/StageNode/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -24,6 +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
|
+
useSetNodeSelection: ()=>external_useNodeSelection_cjs_namespaceObject.useSetNodeSelection,
|
|
27
28
|
useNodeSelection: ()=>external_useNodeSelection_cjs_namespaceObject.useNodeSelection,
|
|
28
29
|
useNodeConfiguration: ()=>external_useNodeConfiguration_cjs_namespaceObject.useNodeConfiguration
|
|
29
30
|
});
|
|
@@ -31,9 +32,11 @@ const external_useNodeConfiguration_cjs_namespaceObject = require("./useNodeConf
|
|
|
31
32
|
const external_useNodeSelection_cjs_namespaceObject = require("./useNodeSelection.cjs");
|
|
32
33
|
exports.useNodeConfiguration = __webpack_exports__.useNodeConfiguration;
|
|
33
34
|
exports.useNodeSelection = __webpack_exports__.useNodeSelection;
|
|
35
|
+
exports.useSetNodeSelection = __webpack_exports__.useSetNodeSelection;
|
|
34
36
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
35
37
|
"useNodeConfiguration",
|
|
36
|
-
"useNodeSelection"
|
|
38
|
+
"useNodeSelection",
|
|
39
|
+
"useSetNodeSelection"
|
|
37
40
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
38
41
|
Object.defineProperty(exports, '__esModule', {
|
|
39
42
|
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,MAAM,oBAAoB,CAAC"}
|
|
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,mBAAmB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { useNodeConfiguration } from "./useNodeConfiguration.js";
|
|
2
|
-
import { useNodeSelection } from "./useNodeSelection.js";
|
|
3
|
-
export { useNodeConfiguration, useNodeSelection };
|
|
2
|
+
import { useNodeSelection, useSetNodeSelection } from "./useNodeSelection.js";
|
|
3
|
+
export { useNodeConfiguration, useNodeSelection, useSetNodeSelection };
|
|
@@ -24,10 +24,21 @@ 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
|
|
27
|
+
useNodeSelection: ()=>useNodeSelection,
|
|
28
|
+
useSetNodeSelection: ()=>useSetNodeSelection
|
|
28
29
|
});
|
|
29
30
|
const react_cjs_namespaceObject = require("../../../xyflow/react.cjs");
|
|
30
31
|
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
|
+
}
|
|
31
42
|
function useNodeSelection(nodeId, maintainSelection = true) {
|
|
32
43
|
const nodes = (0, react_cjs_namespaceObject.useNodes)();
|
|
33
44
|
const { setNodes } = (0, react_cjs_namespaceObject.useReactFlow)();
|
|
@@ -40,10 +51,7 @@ function useNodeSelection(nodeId, maintainSelection = true) {
|
|
|
40
51
|
])
|
|
41
52
|
});
|
|
42
53
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
43
|
-
if (maintainSelection && selectedNodeId) setNodes((nds)=>nds
|
|
44
|
-
...node,
|
|
45
|
-
selected: node.id === selectedNodeId
|
|
46
|
-
})));
|
|
54
|
+
if (maintainSelection && selectedNodeId) setNodes((nds)=>applySelection(nds, selectedNodeId));
|
|
47
55
|
}, [
|
|
48
56
|
selectedNodeId,
|
|
49
57
|
maintainSelection,
|
|
@@ -56,9 +64,22 @@ function useNodeSelection(nodeId, maintainSelection = true) {
|
|
|
56
64
|
selectedNode
|
|
57
65
|
};
|
|
58
66
|
}
|
|
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
|
+
}
|
|
59
78
|
exports.useNodeSelection = __webpack_exports__.useNodeSelection;
|
|
79
|
+
exports.useSetNodeSelection = __webpack_exports__.useSetNodeSelection;
|
|
60
80
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
61
|
-
"useNodeSelection"
|
|
81
|
+
"useNodeSelection",
|
|
82
|
+
"useSetNodeSelection"
|
|
62
83
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
63
84
|
Object.defineProperty(exports, '__esModule', {
|
|
64
85
|
value: true
|
|
@@ -4,4 +4,7 @@ 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
|
+
};
|
|
7
10
|
//# 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":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAUrE,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,iBAAiB,UAAO;;;;EAmCzE;AAOD,wBAAgB,mBAAmB;gCAItB,MAAM;EAOlB"}
|
|
@@ -1,5 +1,15 @@
|
|
|
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
|
+
}
|
|
3
13
|
function useNodeSelection(nodeId, maintainSelection = true) {
|
|
4
14
|
const nodes = useNodes();
|
|
5
15
|
const { setNodes } = useReactFlow();
|
|
@@ -12,10 +22,7 @@ function useNodeSelection(nodeId, maintainSelection = true) {
|
|
|
12
22
|
])
|
|
13
23
|
});
|
|
14
24
|
useEffect(()=>{
|
|
15
|
-
if (maintainSelection && selectedNodeId) setNodes((nds)=>nds
|
|
16
|
-
...node,
|
|
17
|
-
selected: node.id === selectedNodeId
|
|
18
|
-
})));
|
|
25
|
+
if (maintainSelection && selectedNodeId) setNodes((nds)=>applySelection(nds, selectedNodeId));
|
|
19
26
|
}, [
|
|
20
27
|
selectedNodeId,
|
|
21
28
|
maintainSelection,
|
|
@@ -28,4 +35,15 @@ function useNodeSelection(nodeId, maintainSelection = true) {
|
|
|
28
35
|
selectedNode
|
|
29
36
|
};
|
|
30
37
|
}
|
|
31
|
-
|
|
38
|
+
function useSetNodeSelection() {
|
|
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 };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
AdhocTaskItem: ()=>AdhocTaskItem
|
|
37
|
+
});
|
|
38
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
|
+
const apollo_core_namespaceObject = require("@uipath/apollo-core");
|
|
40
|
+
const index_cjs_namespaceObject = require("../../../material/index.cjs");
|
|
41
|
+
const external_debounce_namespaceObject = require("debounce");
|
|
42
|
+
var external_debounce_default = /*#__PURE__*/ __webpack_require__.n(external_debounce_namespaceObject);
|
|
43
|
+
const external_react_namespaceObject = require("react");
|
|
44
|
+
const external_icons_index_cjs_namespaceObject = require("../../icons/index.cjs");
|
|
45
|
+
const external_DraggableTask_cjs_namespaceObject = require("./DraggableTask.cjs");
|
|
46
|
+
const external_StageNode_styles_cjs_namespaceObject = require("./StageNode.styles.cjs");
|
|
47
|
+
const external_TaskMenu_cjs_namespaceObject = require("./TaskMenu.cjs");
|
|
48
|
+
const AdhocTaskPlayButton = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ taskId, onTaskPlay })=>{
|
|
49
|
+
const [playLoading, setPlayLoading] = (0, external_react_namespaceObject.useState)(false);
|
|
50
|
+
const debouncedTaskPlay = (0, external_react_namespaceObject.useMemo)(()=>external_debounce_default()(async (id)=>{
|
|
51
|
+
setPlayLoading(true);
|
|
52
|
+
try {
|
|
53
|
+
await onTaskPlay(id);
|
|
54
|
+
} catch {} finally{
|
|
55
|
+
setPlayLoading(false);
|
|
56
|
+
}
|
|
57
|
+
}, 500, {
|
|
58
|
+
immediate: true
|
|
59
|
+
}), [
|
|
60
|
+
onTaskPlay
|
|
61
|
+
]);
|
|
62
|
+
const handlePlayClick = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
63
|
+
e.stopPropagation();
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
debouncedTaskPlay(taskId);
|
|
66
|
+
}, [
|
|
67
|
+
debouncedTaskPlay,
|
|
68
|
+
taskId
|
|
69
|
+
]);
|
|
70
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ApTooltip, {
|
|
71
|
+
content: "Trigger task",
|
|
72
|
+
placement: "top",
|
|
73
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ApIconButton, {
|
|
74
|
+
"data-testid": `stage-task-play-${taskId}`,
|
|
75
|
+
onClick: handlePlayClick,
|
|
76
|
+
onMouseDown: (e)=>e.stopPropagation(),
|
|
77
|
+
onKeyDown: (e)=>e.stopPropagation(),
|
|
78
|
+
className: "task-menu-icon-button",
|
|
79
|
+
sx: {
|
|
80
|
+
color: 'var(--uix-canvas-primary) !important',
|
|
81
|
+
minWidth: 'unset !important',
|
|
82
|
+
width: `${apollo_core_namespaceObject.Spacing.SpacingL} !important`,
|
|
83
|
+
height: `${apollo_core_namespaceObject.Spacing.SpacingL} !important`,
|
|
84
|
+
padding: '0 !important'
|
|
85
|
+
},
|
|
86
|
+
children: playLoading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ApCircularProgress, {
|
|
87
|
+
size: 20
|
|
88
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icons_index_cjs_namespaceObject.PlayIcon, {
|
|
89
|
+
w: 20,
|
|
90
|
+
h: 20
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
const AdhocTaskItemComponent = ({ task, taskExecution, isSelected, getContextMenuItems, onTaskClick, onTaskPlay })=>{
|
|
96
|
+
const [isMenuOpen, setIsMenuOpen] = (0, external_react_namespaceObject.useState)(false);
|
|
97
|
+
const taskRef = (0, external_react_namespaceObject.useRef)(null);
|
|
98
|
+
const menuRef = (0, external_react_namespaceObject.useRef)(null);
|
|
99
|
+
const handleClick = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
100
|
+
if (isMenuOpen) return;
|
|
101
|
+
onTaskClick(e, task.id);
|
|
102
|
+
}, [
|
|
103
|
+
isMenuOpen,
|
|
104
|
+
onTaskClick,
|
|
105
|
+
task.id
|
|
106
|
+
]);
|
|
107
|
+
const handleMenuOpenChange = (0, external_react_namespaceObject.useCallback)((isOpen)=>{
|
|
108
|
+
setIsMenuOpen(isOpen);
|
|
109
|
+
}, []);
|
|
110
|
+
const handleContextMenu = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
111
|
+
menuRef.current?.handleContextMenu(e);
|
|
112
|
+
}, []);
|
|
113
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StageNode_styles_cjs_namespaceObject.StageTask, {
|
|
114
|
+
ref: taskRef,
|
|
115
|
+
"data-testid": `stage-task-${task.id}`,
|
|
116
|
+
selected: isSelected,
|
|
117
|
+
status: taskExecution?.status,
|
|
118
|
+
onClick: handleClick,
|
|
119
|
+
...getContextMenuItems && {
|
|
120
|
+
onContextMenu: handleContextMenu
|
|
121
|
+
},
|
|
122
|
+
children: [
|
|
123
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DraggableTask_cjs_namespaceObject.TaskContent, {
|
|
124
|
+
task: task,
|
|
125
|
+
taskExecution: taskExecution
|
|
126
|
+
}),
|
|
127
|
+
onTaskPlay && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(AdhocTaskPlayButton, {
|
|
128
|
+
taskId: task.id,
|
|
129
|
+
onTaskPlay: onTaskPlay
|
|
130
|
+
}),
|
|
131
|
+
getContextMenuItems && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskMenu_cjs_namespaceObject.TaskMenu, {
|
|
132
|
+
ref: menuRef,
|
|
133
|
+
taskId: task.id,
|
|
134
|
+
getContextMenuItems: getContextMenuItems,
|
|
135
|
+
onMenuOpenChange: handleMenuOpenChange,
|
|
136
|
+
taskRef: taskRef
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
const AdhocTaskItem = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(AdhocTaskItemComponent);
|
|
142
|
+
exports.AdhocTaskItem = __webpack_exports__.AdhocTaskItem;
|
|
143
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
144
|
+
"AdhocTaskItem"
|
|
145
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
146
|
+
Object.defineProperty(exports, '__esModule', {
|
|
147
|
+
value: true
|
|
148
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NodeMenuItem } from '../NodeContextMenu';
|
|
2
|
+
import type { StageTaskExecution, StageTaskItem } from './StageNode.types';
|
|
3
|
+
interface AdhocTaskItemProps {
|
|
4
|
+
task: StageTaskItem;
|
|
5
|
+
taskExecution?: StageTaskExecution;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
getContextMenuItems?: () => NodeMenuItem[];
|
|
8
|
+
onTaskClick: (e: React.MouseEvent, taskId: string) => void;
|
|
9
|
+
onTaskPlay?: (taskId: string) => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const AdhocTaskItem: import("react").MemoExoticComponent<({ task, taskExecution, isSelected, getContextMenuItems, onTaskClick, onTaskPlay, }: AdhocTaskItemProps) => import("react/jsx-runtime").JSX.Element>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=AdhocTask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdhocTask.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/AdhocTask.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AA0D3E,UAAU,kBAAkB;IAC1B,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,YAAY,EAAE,CAAC;IAC3C,WAAW,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAsDD,eAAO,MAAM,aAAa,2HA7CvB,kBAAkB,6CA6CoC,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Spacing } from "@uipath/apollo-core";
|
|
3
|
+
import { ApCircularProgress, ApIconButton, ApTooltip } from "../../../material/index.js";
|
|
4
|
+
import debounce from "debounce";
|
|
5
|
+
import { memo, useCallback, useMemo, useRef, useState } from "react";
|
|
6
|
+
import { PlayIcon } from "../../icons/index.js";
|
|
7
|
+
import { TaskContent } from "./DraggableTask.js";
|
|
8
|
+
import { StageTask } from "./StageNode.styles.js";
|
|
9
|
+
import { TaskMenu } from "./TaskMenu.js";
|
|
10
|
+
const AdhocTaskPlayButton = /*#__PURE__*/ memo(({ taskId, onTaskPlay })=>{
|
|
11
|
+
const [playLoading, setPlayLoading] = useState(false);
|
|
12
|
+
const debouncedTaskPlay = useMemo(()=>debounce(async (id)=>{
|
|
13
|
+
setPlayLoading(true);
|
|
14
|
+
try {
|
|
15
|
+
await onTaskPlay(id);
|
|
16
|
+
} catch {} finally{
|
|
17
|
+
setPlayLoading(false);
|
|
18
|
+
}
|
|
19
|
+
}, 500, {
|
|
20
|
+
immediate: true
|
|
21
|
+
}), [
|
|
22
|
+
onTaskPlay
|
|
23
|
+
]);
|
|
24
|
+
const handlePlayClick = useCallback((e)=>{
|
|
25
|
+
e.stopPropagation();
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
debouncedTaskPlay(taskId);
|
|
28
|
+
}, [
|
|
29
|
+
debouncedTaskPlay,
|
|
30
|
+
taskId
|
|
31
|
+
]);
|
|
32
|
+
return /*#__PURE__*/ jsx(ApTooltip, {
|
|
33
|
+
content: "Trigger task",
|
|
34
|
+
placement: "top",
|
|
35
|
+
children: /*#__PURE__*/ jsx(ApIconButton, {
|
|
36
|
+
"data-testid": `stage-task-play-${taskId}`,
|
|
37
|
+
onClick: handlePlayClick,
|
|
38
|
+
onMouseDown: (e)=>e.stopPropagation(),
|
|
39
|
+
onKeyDown: (e)=>e.stopPropagation(),
|
|
40
|
+
className: "task-menu-icon-button",
|
|
41
|
+
sx: {
|
|
42
|
+
color: 'var(--uix-canvas-primary) !important',
|
|
43
|
+
minWidth: 'unset !important',
|
|
44
|
+
width: `${Spacing.SpacingL} !important`,
|
|
45
|
+
height: `${Spacing.SpacingL} !important`,
|
|
46
|
+
padding: '0 !important'
|
|
47
|
+
},
|
|
48
|
+
children: playLoading ? /*#__PURE__*/ jsx(ApCircularProgress, {
|
|
49
|
+
size: 20
|
|
50
|
+
}) : /*#__PURE__*/ jsx(PlayIcon, {
|
|
51
|
+
w: 20,
|
|
52
|
+
h: 20
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
const AdhocTaskItemComponent = ({ task, taskExecution, isSelected, getContextMenuItems, onTaskClick, onTaskPlay })=>{
|
|
58
|
+
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
59
|
+
const taskRef = useRef(null);
|
|
60
|
+
const menuRef = useRef(null);
|
|
61
|
+
const handleClick = useCallback((e)=>{
|
|
62
|
+
if (isMenuOpen) return;
|
|
63
|
+
onTaskClick(e, task.id);
|
|
64
|
+
}, [
|
|
65
|
+
isMenuOpen,
|
|
66
|
+
onTaskClick,
|
|
67
|
+
task.id
|
|
68
|
+
]);
|
|
69
|
+
const handleMenuOpenChange = useCallback((isOpen)=>{
|
|
70
|
+
setIsMenuOpen(isOpen);
|
|
71
|
+
}, []);
|
|
72
|
+
const handleContextMenu = useCallback((e)=>{
|
|
73
|
+
menuRef.current?.handleContextMenu(e);
|
|
74
|
+
}, []);
|
|
75
|
+
return /*#__PURE__*/ jsxs(StageTask, {
|
|
76
|
+
ref: taskRef,
|
|
77
|
+
"data-testid": `stage-task-${task.id}`,
|
|
78
|
+
selected: isSelected,
|
|
79
|
+
status: taskExecution?.status,
|
|
80
|
+
onClick: handleClick,
|
|
81
|
+
...getContextMenuItems && {
|
|
82
|
+
onContextMenu: handleContextMenu
|
|
83
|
+
},
|
|
84
|
+
children: [
|
|
85
|
+
/*#__PURE__*/ jsx(TaskContent, {
|
|
86
|
+
task: task,
|
|
87
|
+
taskExecution: taskExecution
|
|
88
|
+
}),
|
|
89
|
+
onTaskPlay && /*#__PURE__*/ jsx(AdhocTaskPlayButton, {
|
|
90
|
+
taskId: task.id,
|
|
91
|
+
onTaskPlay: onTaskPlay
|
|
92
|
+
}),
|
|
93
|
+
getContextMenuItems && /*#__PURE__*/ jsx(TaskMenu, {
|
|
94
|
+
ref: menuRef,
|
|
95
|
+
taskId: task.id,
|
|
96
|
+
getContextMenuItems: getContextMenuItems,
|
|
97
|
+
onMenuOpenChange: handleMenuOpenChange,
|
|
98
|
+
taskRef: taskRef
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
const AdhocTaskItem = /*#__PURE__*/ memo(AdhocTaskItemComponent);
|
|
104
|
+
export { AdhocTaskItem };
|
|
@@ -32,6 +32,7 @@ const sortable_namespaceObject = require("@dnd-kit/sortable");
|
|
|
32
32
|
const utilities_namespaceObject = require("@dnd-kit/utilities");
|
|
33
33
|
const apollo_core_namespaceObject = require("@uipath/apollo-core");
|
|
34
34
|
const index_cjs_namespaceObject = require("../../layouts/index.cjs");
|
|
35
|
+
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
35
36
|
const external_material_index_cjs_namespaceObject = require("../../../material/index.cjs");
|
|
36
37
|
const external_react_namespaceObject = require("react");
|
|
37
38
|
const external_icons_index_cjs_namespaceObject = require("../../icons/index.cjs");
|
|
@@ -171,8 +172,9 @@ const TaskContent = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ ta
|
|
|
171
172
|
]
|
|
172
173
|
})
|
|
173
174
|
}));
|
|
174
|
-
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel,
|
|
175
|
+
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, groupIndex, taskIndex, getContextMenuItems, onTaskClick, isDragDisabled, projectedDepth })=>{
|
|
175
176
|
const [isMenuOpen, setIsMenuOpen] = (0, external_react_namespaceObject.useState)(false);
|
|
177
|
+
const zoom = (0, react_cjs_namespaceObject.useStore)((s)=>s.transform[2]);
|
|
176
178
|
const taskRef = (0, external_react_namespaceObject.useRef)(null);
|
|
177
179
|
const menuRef = (0, external_react_namespaceObject.useRef)(null);
|
|
178
180
|
const handleClick = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
@@ -189,6 +191,14 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
|
|
|
189
191
|
const handleContextMenu = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
190
192
|
menuRef.current?.handleContextMenu(e);
|
|
191
193
|
}, []);
|
|
194
|
+
const handleGetContextMenuItems = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
195
|
+
if (!getContextMenuItems) return [];
|
|
196
|
+
return getContextMenuItems(groupIndex, taskIndex);
|
|
197
|
+
}, [
|
|
198
|
+
getContextMenuItems,
|
|
199
|
+
groupIndex,
|
|
200
|
+
taskIndex
|
|
201
|
+
]);
|
|
192
202
|
const { attributes, listeners, setNodeRef, transition, transform, isDragging } = (0, sortable_namespaceObject.useSortable)({
|
|
193
203
|
id: task.id,
|
|
194
204
|
disabled: isDragDisabled
|
|
@@ -234,7 +244,7 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
|
|
|
234
244
|
isParallel: isParallel,
|
|
235
245
|
isDragEnabled: !isDragDisabled,
|
|
236
246
|
onClick: handleClick,
|
|
237
|
-
...
|
|
247
|
+
...getContextMenuItems && {
|
|
238
248
|
onContextMenu: handleContextMenu
|
|
239
249
|
},
|
|
240
250
|
children: [
|
|
@@ -258,12 +268,11 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
|
|
|
258
268
|
})
|
|
259
269
|
})
|
|
260
270
|
}),
|
|
261
|
-
|
|
271
|
+
getContextMenuItems && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskMenu_cjs_namespaceObject.TaskMenu, {
|
|
262
272
|
ref: menuRef,
|
|
263
273
|
taskId: task.id,
|
|
264
|
-
|
|
274
|
+
getContextMenuItems: handleGetContextMenuItems,
|
|
265
275
|
onMenuOpenChange: handleMenuOpenChange,
|
|
266
|
-
onMenuOpen: onMenuOpen,
|
|
267
276
|
taskRef: taskRef
|
|
268
277
|
})
|
|
269
278
|
]
|
|
@@ -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, groupIndex, taskIndex, getContextMenuItems, onTaskClick, isDragDisabled, projectedDepth, }: 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":"AAgBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAgClF,eAAO,MAAM,WAAW,4EAA8C,gBAAgB,6CAwEpF,CAAC;AAyIH,eAAO,MAAM,aAAa,kLA5HvB,kBAAkB,6CA4HoC,CAAC"}
|
|
@@ -3,6 +3,7 @@ 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";
|
|
6
7
|
import { ApBadge, ApIconButton, ApTooltip, ApTypography, BadgeSize } from "../../../material/index.js";
|
|
7
8
|
import { memo, useCallback, useMemo, useRef, useState } from "react";
|
|
8
9
|
import { EntryConditionIcon } from "../../icons/index.js";
|
|
@@ -142,8 +143,9 @@ const TaskContent = /*#__PURE__*/ memo(({ task, taskExecution, isDragging })=>/*
|
|
|
142
143
|
]
|
|
143
144
|
})
|
|
144
145
|
}));
|
|
145
|
-
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel,
|
|
146
|
+
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, groupIndex, taskIndex, getContextMenuItems, onTaskClick, isDragDisabled, projectedDepth })=>{
|
|
146
147
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
148
|
+
const zoom = useStore((s)=>s.transform[2]);
|
|
147
149
|
const taskRef = useRef(null);
|
|
148
150
|
const menuRef = useRef(null);
|
|
149
151
|
const handleClick = useCallback((e)=>{
|
|
@@ -160,6 +162,14 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
|
|
|
160
162
|
const handleContextMenu = useCallback((e)=>{
|
|
161
163
|
menuRef.current?.handleContextMenu(e);
|
|
162
164
|
}, []);
|
|
165
|
+
const handleGetContextMenuItems = useCallback(()=>{
|
|
166
|
+
if (!getContextMenuItems) return [];
|
|
167
|
+
return getContextMenuItems(groupIndex, taskIndex);
|
|
168
|
+
}, [
|
|
169
|
+
getContextMenuItems,
|
|
170
|
+
groupIndex,
|
|
171
|
+
taskIndex
|
|
172
|
+
]);
|
|
163
173
|
const { attributes, listeners, setNodeRef, transition, transform, isDragging } = useSortable({
|
|
164
174
|
id: task.id,
|
|
165
175
|
disabled: isDragDisabled
|
|
@@ -205,7 +215,7 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
|
|
|
205
215
|
isParallel: isParallel,
|
|
206
216
|
isDragEnabled: !isDragDisabled,
|
|
207
217
|
onClick: handleClick,
|
|
208
|
-
...
|
|
218
|
+
...getContextMenuItems && {
|
|
209
219
|
onContextMenu: handleContextMenu
|
|
210
220
|
},
|
|
211
221
|
children: [
|
|
@@ -229,12 +239,11 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
|
|
|
229
239
|
})
|
|
230
240
|
})
|
|
231
241
|
}),
|
|
232
|
-
|
|
242
|
+
getContextMenuItems && /*#__PURE__*/ jsx(TaskMenu, {
|
|
233
243
|
ref: menuRef,
|
|
234
244
|
taskId: task.id,
|
|
235
|
-
|
|
245
|
+
getContextMenuItems: handleGetContextMenuItems,
|
|
236
246
|
onMenuOpenChange: handleMenuOpenChange,
|
|
237
|
-
onMenuOpen: onMenuOpen,
|
|
238
247
|
taskRef: taskRef
|
|
239
248
|
})
|
|
240
249
|
]
|
|
@@ -10,12 +10,12 @@ export interface DraggableTaskProps {
|
|
|
10
10
|
taskExecution?: StageTaskExecution;
|
|
11
11
|
isSelected: boolean;
|
|
12
12
|
isParallel: boolean;
|
|
13
|
-
|
|
13
|
+
groupIndex: number;
|
|
14
|
+
taskIndex: number;
|
|
15
|
+
getContextMenuItems?: (groupIndex: number, taskIndex: number) => NodeMenuItem[];
|
|
14
16
|
onTaskClick: (e: React.MouseEvent, taskId: string) => void;
|
|
15
|
-
onMenuOpen?: () => void;
|
|
16
17
|
onTaskPlay?: (taskId: string) => Promise<void>;
|
|
17
18
|
isDragDisabled?: boolean;
|
|
18
19
|
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,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,YAAY,EAAE,CAAC;IAChF,WAAW,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,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;CACzB"}
|
|
@@ -40,6 +40,7 @@ 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");
|
|
43
44
|
const StageEdgeLabel = styled_default().div`
|
|
44
45
|
position: absolute;
|
|
45
46
|
color: var(--uix-canvas-foreground);
|
|
@@ -57,6 +58,9 @@ const StageEdgeLabel = styled_default().div`
|
|
|
57
58
|
border-color: var(--uix-canvas-border-hover);
|
|
58
59
|
}
|
|
59
60
|
`;
|
|
61
|
+
function stageEdgeGeometryEquality(previous, next) {
|
|
62
|
+
return previous.sourceX === next.sourceX && previous.sourceY === next.sourceY && previous.targetX === next.targetX && previous.targetY === next.targetY;
|
|
63
|
+
}
|
|
60
64
|
function getArrowFromBezier(path, arrowSize) {
|
|
61
65
|
const pathEl = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
62
66
|
pathEl.setAttribute('d', path);
|
|
@@ -70,19 +74,13 @@ function getArrowFromBezier(path, arrowSize) {
|
|
|
70
74
|
angle
|
|
71
75
|
};
|
|
72
76
|
}
|
|
73
|
-
function
|
|
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;
|
|
77
|
+
function StageEdgeInner({ geometry, sourcePosition, targetPosition, selected, style, stroke = 'var(--uix-canvas-foreground-emp)', strokeWidth = 2, arrowSize = 8, ...rest }) {
|
|
80
78
|
const [pathData, labelX, labelY, _ex, _ey] = (0, react_cjs_namespaceObject.getSmoothStepPath)({
|
|
81
|
-
sourceX:
|
|
82
|
-
sourceY:
|
|
79
|
+
sourceX: geometry.sourceX,
|
|
80
|
+
sourceY: geometry.sourceY,
|
|
83
81
|
sourcePosition,
|
|
84
|
-
targetX:
|
|
85
|
-
targetY:
|
|
82
|
+
targetX: geometry.targetX - 1,
|
|
83
|
+
targetY: geometry.targetY,
|
|
86
84
|
targetPosition,
|
|
87
85
|
borderRadius: 40
|
|
88
86
|
});
|
|
@@ -141,6 +139,31 @@ function StageEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetP
|
|
|
141
139
|
]
|
|
142
140
|
});
|
|
143
141
|
}
|
|
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);
|
|
144
167
|
exports.StageEdge = __webpack_exports__.StageEdge;
|
|
145
168
|
exports.StageEdgeLabel = __webpack_exports__.StageEdgeLabel;
|
|
146
169
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|