@uipath/apollo-react 3.62.0 → 3.63.0-pr431.329c320
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 +360 -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 +323 -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/DraggableTask.cjs +6 -4
- 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 +6 -4
- package/dist/canvas/components/StageNode/DraggableTask.types.d.ts +1 -2
- 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 +71 -38
- 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 +73 -40
- package/dist/canvas/components/StageNode/StageNode.stories.cjs +118 -135
- package/dist/canvas/components/StageNode/StageNode.stories.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.stories.js +115 -132
- package/dist/canvas/components/StageNode/StageNode.stories.utils.cjs +42 -0
- package/dist/canvas/components/StageNode/StageNode.stories.utils.d.ts +3 -0
- package/dist/canvas/components/StageNode/StageNode.stories.utils.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/StageNode.stories.utils.js +8 -0
- package/dist/canvas/components/StageNode/StageNode.types.d.ts +9 -1
- package/dist/canvas/components/StageNode/StageNode.types.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/TaskMenu.cjs +13 -15
- 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 +14 -16
- package/dist/canvas/components/TaskIcon/TaskIcon.styles.cjs +1 -1
- package/dist/canvas/components/TaskIcon/TaskIcon.styles.js +1 -1
- package/dist/canvas/icons/CaseManagementProject.cjs +9 -18
- package/dist/canvas/icons/CaseManagementProject.d.ts.map +1 -1
- package/dist/canvas/icons/CaseManagementProject.js +9 -18
- package/package.json +3 -3
|
@@ -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 };
|
|
@@ -41,6 +41,7 @@ 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");
|
|
44
45
|
const external_material_index_cjs_namespaceObject = require("../../../material/index.cjs");
|
|
45
46
|
const external_debounce_namespaceObject = require("debounce");
|
|
46
47
|
var external_debounce_default = /*#__PURE__*/ __webpack_require__.n(external_debounce_namespaceObject);
|
|
@@ -182,8 +183,9 @@ const TaskContent = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ ta
|
|
|
182
183
|
]
|
|
183
184
|
})
|
|
184
185
|
}));
|
|
185
|
-
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel,
|
|
186
|
+
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, getContextMenuItems, onTaskClick, onMenuOpen, onTaskPlay, isDragDisabled, projectedDepth })=>{
|
|
186
187
|
const [isMenuOpen, setIsMenuOpen] = (0, external_react_namespaceObject.useState)(false);
|
|
188
|
+
const zoom = (0, react_cjs_namespaceObject.useStore)((s)=>s.transform[2]);
|
|
187
189
|
const taskRef = (0, external_react_namespaceObject.useRef)(null);
|
|
188
190
|
const menuRef = (0, external_react_namespaceObject.useRef)(null);
|
|
189
191
|
const [playLoading, setPlayLoading] = (0, external_react_namespaceObject.useState)(false);
|
|
@@ -266,7 +268,7 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
|
|
|
266
268
|
isParallel: isParallel,
|
|
267
269
|
isDragEnabled: !isDragDisabled,
|
|
268
270
|
onClick: handleClick,
|
|
269
|
-
...
|
|
271
|
+
...getContextMenuItems && {
|
|
270
272
|
onContextMenu: handleContextMenu
|
|
271
273
|
},
|
|
272
274
|
children: [
|
|
@@ -313,10 +315,10 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
|
|
|
313
315
|
})
|
|
314
316
|
})
|
|
315
317
|
}),
|
|
316
|
-
|
|
318
|
+
getContextMenuItems && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskMenu_cjs_namespaceObject.TaskMenu, {
|
|
317
319
|
ref: menuRef,
|
|
318
320
|
taskId: task.id,
|
|
319
|
-
|
|
321
|
+
getContextMenuItems: getContextMenuItems,
|
|
320
322
|
onMenuOpenChange: handleMenuOpenChange,
|
|
321
323
|
onMenuOpen: onMenuOpen,
|
|
322
324
|
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, getContextMenuItems, onTaskClick, onMenuOpen, onTaskPlay, 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":"AAkBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAgClF,eAAO,MAAM,WAAW,4EAA8C,gBAAgB,6CAwEpF,CAAC;AAqLH,eAAO,MAAM,aAAa,mLAxKvB,kBAAkB,6CAwKoC,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, ApCircularProgress, ApIconButton, ApTooltip, ApTypography, BadgeSize } from "../../../material/index.js";
|
|
7
8
|
import debounce from "debounce";
|
|
8
9
|
import { memo, useCallback, useMemo, useRef, useState } from "react";
|
|
@@ -143,8 +144,9 @@ const TaskContent = /*#__PURE__*/ memo(({ task, taskExecution, isDragging })=>/*
|
|
|
143
144
|
]
|
|
144
145
|
})
|
|
145
146
|
}));
|
|
146
|
-
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel,
|
|
147
|
+
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, getContextMenuItems, onTaskClick, onMenuOpen, onTaskPlay, isDragDisabled, projectedDepth })=>{
|
|
147
148
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
149
|
+
const zoom = useStore((s)=>s.transform[2]);
|
|
148
150
|
const taskRef = useRef(null);
|
|
149
151
|
const menuRef = useRef(null);
|
|
150
152
|
const [playLoading, setPlayLoading] = useState(false);
|
|
@@ -227,7 +229,7 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
|
|
|
227
229
|
isParallel: isParallel,
|
|
228
230
|
isDragEnabled: !isDragDisabled,
|
|
229
231
|
onClick: handleClick,
|
|
230
|
-
...
|
|
232
|
+
...getContextMenuItems && {
|
|
231
233
|
onContextMenu: handleContextMenu
|
|
232
234
|
},
|
|
233
235
|
children: [
|
|
@@ -274,10 +276,10 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
|
|
|
274
276
|
})
|
|
275
277
|
})
|
|
276
278
|
}),
|
|
277
|
-
|
|
279
|
+
getContextMenuItems && /*#__PURE__*/ jsx(TaskMenu, {
|
|
278
280
|
ref: menuRef,
|
|
279
281
|
taskId: task.id,
|
|
280
|
-
|
|
282
|
+
getContextMenuItems: getContextMenuItems,
|
|
281
283
|
onMenuOpenChange: handleMenuOpenChange,
|
|
282
284
|
onMenuOpen: onMenuOpen,
|
|
283
285
|
taskRef: taskRef
|
|
@@ -10,12 +10,11 @@ export interface DraggableTaskProps {
|
|
|
10
10
|
taskExecution?: StageTaskExecution;
|
|
11
11
|
isSelected: boolean;
|
|
12
12
|
isParallel: boolean;
|
|
13
|
-
|
|
13
|
+
getContextMenuItems?: () => 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;
|
|
20
19
|
}
|
|
21
20
|
//# 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,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,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;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?.position.y ? sourceNode.position.y + 32 : sourceY,
|
|
150
|
+
targetX: targetNode?.position.x ?? targetX,
|
|
151
|
+
targetY: targetNode?.position.y ? 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 === [
|
|
@@ -8,6 +8,7 @@ type Props = EdgeProps & {
|
|
|
8
8
|
strokeWidth?: number;
|
|
9
9
|
arrowSize?: number;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
declare function StageEdgeComponent({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, selected, style, stroke, strokeWidth, arrowSize, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const StageEdge: import("react").MemoExoticComponent<typeof StageEdgeComponent>;
|
|
12
13
|
export {};
|
|
13
14
|
//# 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,EAAkB,MAAM,0CAA0C,CAAC;AAQ1F,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;AA4HF,iBAAS,kBAAkB,CAAC,EAC1B,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,QAAQ,EACR,KAAK,EACL,MAAM,EACN,WAAW,EACX,SAAS,EACT,GAAG,IAAI,EACR,EAAE,KAAK,2CA0BP;AAED,eAAO,MAAM,SAAS,gEAA2B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
|
-
import { EdgeLabelRenderer, getSmoothStepPath,
|
|
3
|
+
import { EdgeLabelRenderer, getSmoothStepPath, useStore } from "../../xyflow/react.js";
|
|
4
|
+
import { memo } from "react";
|
|
4
5
|
const StageEdgeLabel = styled.div`
|
|
5
6
|
position: absolute;
|
|
6
7
|
color: var(--uix-canvas-foreground);
|
|
@@ -18,6 +19,9 @@ const StageEdgeLabel = styled.div`
|
|
|
18
19
|
border-color: var(--uix-canvas-border-hover);
|
|
19
20
|
}
|
|
20
21
|
`;
|
|
22
|
+
function stageEdgeGeometryEquality(previous, next) {
|
|
23
|
+
return previous.sourceX === next.sourceX && previous.sourceY === next.sourceY && previous.targetX === next.targetX && previous.targetY === next.targetY;
|
|
24
|
+
}
|
|
21
25
|
function getArrowFromBezier(path, arrowSize) {
|
|
22
26
|
const pathEl = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
23
27
|
pathEl.setAttribute('d', path);
|
|
@@ -31,19 +35,13 @@ function getArrowFromBezier(path, arrowSize) {
|
|
|
31
35
|
angle
|
|
32
36
|
};
|
|
33
37
|
}
|
|
34
|
-
function
|
|
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;
|
|
38
|
+
function StageEdgeInner({ geometry, sourcePosition, targetPosition, selected, style, stroke = 'var(--uix-canvas-foreground-emp)', strokeWidth = 2, arrowSize = 8, ...rest }) {
|
|
41
39
|
const [pathData, labelX, labelY, _ex, _ey] = getSmoothStepPath({
|
|
42
|
-
sourceX:
|
|
43
|
-
sourceY:
|
|
40
|
+
sourceX: geometry.sourceX,
|
|
41
|
+
sourceY: geometry.sourceY,
|
|
44
42
|
sourcePosition,
|
|
45
|
-
targetX:
|
|
46
|
-
targetY:
|
|
43
|
+
targetX: geometry.targetX - 1,
|
|
44
|
+
targetY: geometry.targetY,
|
|
47
45
|
targetPosition,
|
|
48
46
|
borderRadius: 40
|
|
49
47
|
});
|
|
@@ -102,4 +100,29 @@ function StageEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetP
|
|
|
102
100
|
]
|
|
103
101
|
});
|
|
104
102
|
}
|
|
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?.position.y ? sourceNode.position.y + 32 : sourceY,
|
|
111
|
+
targetX: targetNode?.position.x ?? targetX,
|
|
112
|
+
targetY: targetNode?.position.y ? 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);
|
|
105
128
|
export { StageEdge, StageEdgeLabel };
|