@uipath/apollo-react 3.68.2 → 3.68.3-pr431.8e3b0c3
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 +361 -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 +324 -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 +90 -122
- 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 +97 -119
- package/dist/canvas/components/StageNode/StageNode.stories.cjs +123 -158
- package/dist/canvas/components/StageNode/StageNode.stories.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.stories.js +119 -154
- 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.styles.cjs +1 -1
- package/dist/canvas/components/StageNode/StageNode.styles.js +1 -1
- 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/StageTaskDragOverlay.cjs +68 -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 +34 -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
|
@@ -10,7 +10,54 @@ import { TaskIcon, TaskItemTypeValues } from "../TaskIcon/index.js";
|
|
|
10
10
|
import { StageConnectionEdge } from "./StageConnectionEdge.js";
|
|
11
11
|
import { StageEdge } from "./StageEdge.js";
|
|
12
12
|
import { StageNode } from "./StageNode.js";
|
|
13
|
+
import { StageNodeWrapper } from "./StageNode.stories.utils.js";
|
|
13
14
|
import { StageHeaderChipType } from "./StageNode.types.js";
|
|
15
|
+
const DefaultCanvasDecorator = ({ initialNodes, initialEdges = [] })=>{
|
|
16
|
+
const [nodes, _setNodes, onNodesChange] = useNodesState(initialNodes);
|
|
17
|
+
const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
|
|
18
|
+
const onConnect = useCallback((connection)=>{
|
|
19
|
+
setEdges((eds)=>addEdge(connection, eds));
|
|
20
|
+
}, [
|
|
21
|
+
setEdges
|
|
22
|
+
]);
|
|
23
|
+
const nodeTypes = useMemo(()=>({
|
|
24
|
+
stage: StageNodeWrapper
|
|
25
|
+
}), []);
|
|
26
|
+
const edgeTypes = useMemo(()=>({
|
|
27
|
+
stage: StageEdge
|
|
28
|
+
}), []);
|
|
29
|
+
const defaultEdgeOptions = useMemo(()=>({
|
|
30
|
+
type: 'stage'
|
|
31
|
+
}), []);
|
|
32
|
+
return /*#__PURE__*/ jsx("div", {
|
|
33
|
+
style: {
|
|
34
|
+
width: '100vw',
|
|
35
|
+
height: '100vh'
|
|
36
|
+
},
|
|
37
|
+
children: /*#__PURE__*/ jsx(ReactFlowProvider, {
|
|
38
|
+
children: /*#__PURE__*/ jsx(BaseCanvas, {
|
|
39
|
+
nodes: nodes,
|
|
40
|
+
edges: edges,
|
|
41
|
+
onNodesChange: onNodesChange,
|
|
42
|
+
onEdgesChange: onEdgesChange,
|
|
43
|
+
onConnect: onConnect,
|
|
44
|
+
nodeTypes: nodeTypes,
|
|
45
|
+
edgeTypes: edgeTypes,
|
|
46
|
+
mode: "design",
|
|
47
|
+
connectionMode: ConnectionMode.Strict,
|
|
48
|
+
defaultEdgeOptions: defaultEdgeOptions,
|
|
49
|
+
connectionLineComponent: StageConnectionEdge,
|
|
50
|
+
elevateEdgesOnSelect: true,
|
|
51
|
+
children: /*#__PURE__*/ jsx(Panel, {
|
|
52
|
+
position: "bottom-right",
|
|
53
|
+
children: /*#__PURE__*/ jsx(CanvasPositionControls, {
|
|
54
|
+
translations: DefaultCanvasTranslations
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
};
|
|
14
61
|
const meta = {
|
|
15
62
|
title: 'Canvas/StageNode',
|
|
16
63
|
component: StageNode,
|
|
@@ -20,10 +67,6 @@ const meta = {
|
|
|
20
67
|
decorators: [
|
|
21
68
|
(Story, context)=>{
|
|
22
69
|
if (context.parameters?.useCustomRender) return /*#__PURE__*/ jsx(Story, {});
|
|
23
|
-
const StageNodeWrapper = (props)=>/*#__PURE__*/ jsx(StageNode, {
|
|
24
|
-
...props,
|
|
25
|
-
...props.data
|
|
26
|
-
});
|
|
27
70
|
const initialNodes = context.parameters?.nodes || [
|
|
28
71
|
{
|
|
29
72
|
id: '1',
|
|
@@ -43,51 +86,9 @@ const meta = {
|
|
|
43
86
|
}
|
|
44
87
|
];
|
|
45
88
|
const initialEdges = context.parameters?.edges || [];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
setEdges((eds)=>addEdge(connection, eds));
|
|
50
|
-
}, [
|
|
51
|
-
setEdges
|
|
52
|
-
]);
|
|
53
|
-
const nodeTypes = useMemo(()=>({
|
|
54
|
-
stage: StageNodeWrapper
|
|
55
|
-
}), [
|
|
56
|
-
StageNodeWrapper
|
|
57
|
-
]);
|
|
58
|
-
const edgeTypes = useMemo(()=>({
|
|
59
|
-
stage: StageEdge
|
|
60
|
-
}), []);
|
|
61
|
-
const defaultEdgeOptions = useMemo(()=>({
|
|
62
|
-
type: 'stage'
|
|
63
|
-
}), []);
|
|
64
|
-
return /*#__PURE__*/ jsx("div", {
|
|
65
|
-
style: {
|
|
66
|
-
width: '100vw',
|
|
67
|
-
height: '100vh'
|
|
68
|
-
},
|
|
69
|
-
children: /*#__PURE__*/ jsx(ReactFlowProvider, {
|
|
70
|
-
children: /*#__PURE__*/ jsx(BaseCanvas, {
|
|
71
|
-
nodes: nodes,
|
|
72
|
-
edges: edges,
|
|
73
|
-
onNodesChange: onNodesChange,
|
|
74
|
-
onEdgesChange: onEdgesChange,
|
|
75
|
-
onConnect: onConnect,
|
|
76
|
-
nodeTypes: nodeTypes,
|
|
77
|
-
edgeTypes: edgeTypes,
|
|
78
|
-
mode: "design",
|
|
79
|
-
connectionMode: ConnectionMode.Strict,
|
|
80
|
-
defaultEdgeOptions: defaultEdgeOptions,
|
|
81
|
-
connectionLineComponent: StageConnectionEdge,
|
|
82
|
-
elevateEdgesOnSelect: true,
|
|
83
|
-
children: /*#__PURE__*/ jsx(Panel, {
|
|
84
|
-
position: "bottom-right",
|
|
85
|
-
children: /*#__PURE__*/ jsx(CanvasPositionControls, {
|
|
86
|
-
translations: DefaultCanvasTranslations
|
|
87
|
-
})
|
|
88
|
-
})
|
|
89
|
-
})
|
|
90
|
-
})
|
|
89
|
+
return /*#__PURE__*/ jsx(DefaultCanvasDecorator, {
|
|
90
|
+
initialNodes: initialNodes,
|
|
91
|
+
initialEdges: initialEdges
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
94
|
],
|
|
@@ -163,7 +164,7 @@ const DocumentIcon = ()=>/*#__PURE__*/ jsxs("svg", {
|
|
|
163
164
|
strokeWidth: "1.5",
|
|
164
165
|
children: [
|
|
165
166
|
/*#__PURE__*/ jsx("path", {
|
|
166
|
-
d: "M14 2H6C4.9 2 4 2.9 4
|
|
167
|
+
d: "M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2Z"
|
|
167
168
|
}),
|
|
168
169
|
/*#__PURE__*/ jsx("path", {
|
|
169
170
|
d: "M14 2V8H20"
|
|
@@ -1274,17 +1275,9 @@ const initialTasks = [
|
|
|
1274
1275
|
]
|
|
1275
1276
|
];
|
|
1276
1277
|
const DraggableTaskReorderingStory = ()=>{
|
|
1277
|
-
const StageNodeWrapper = useMemo(()=>function(props) {
|
|
1278
|
-
return /*#__PURE__*/ jsx(StageNode, {
|
|
1279
|
-
...props,
|
|
1280
|
-
...props.data
|
|
1281
|
-
});
|
|
1282
|
-
}, []);
|
|
1283
1278
|
const nodeTypes = useMemo(()=>({
|
|
1284
1279
|
stage: StageNodeWrapper
|
|
1285
|
-
}), [
|
|
1286
|
-
StageNodeWrapper
|
|
1287
|
-
]);
|
|
1280
|
+
}), []);
|
|
1288
1281
|
const edgeTypes = useMemo(()=>({
|
|
1289
1282
|
stage: StageEdge
|
|
1290
1283
|
}), []);
|
|
@@ -1453,17 +1446,9 @@ const availableTaskOptions = [
|
|
|
1453
1446
|
}
|
|
1454
1447
|
];
|
|
1455
1448
|
const AddAndReplaceTasksStory = ()=>{
|
|
1456
|
-
const StageNodeWrapper = useMemo(()=>function(props) {
|
|
1457
|
-
return /*#__PURE__*/ jsx(StageNode, {
|
|
1458
|
-
...props,
|
|
1459
|
-
...props.data
|
|
1460
|
-
});
|
|
1461
|
-
}, []);
|
|
1462
1449
|
const nodeTypes = useMemo(()=>({
|
|
1463
1450
|
stage: StageNodeWrapper
|
|
1464
|
-
}), [
|
|
1465
|
-
StageNodeWrapper
|
|
1466
|
-
]);
|
|
1451
|
+
}), []);
|
|
1467
1452
|
const edgeTypes = useMemo(()=>({
|
|
1468
1453
|
stage: StageEdge
|
|
1469
1454
|
}), []);
|
|
@@ -1704,20 +1689,25 @@ const AddAndReplaceTasks = {
|
|
|
1704
1689
|
args: {}
|
|
1705
1690
|
};
|
|
1706
1691
|
const InlineTitleEditStory = ()=>{
|
|
1707
|
-
const StageNodeWrapper = useMemo(()=>function(props) {
|
|
1708
|
-
return /*#__PURE__*/ jsx(StageNode, {
|
|
1709
|
-
...props,
|
|
1710
|
-
...props.data
|
|
1711
|
-
});
|
|
1712
|
-
}, []);
|
|
1713
1692
|
const nodeTypes = useMemo(()=>({
|
|
1714
1693
|
stage: StageNodeWrapper
|
|
1715
|
-
}), [
|
|
1716
|
-
StageNodeWrapper
|
|
1717
|
-
]);
|
|
1694
|
+
}), []);
|
|
1718
1695
|
const edgeTypes = useMemo(()=>({
|
|
1719
1696
|
stage: StageEdge
|
|
1720
1697
|
}), []);
|
|
1698
|
+
const setNodesRef = useRef(null);
|
|
1699
|
+
const createTitleChangeHandler = useCallback((nodeId)=>(newTitle)=>{
|
|
1700
|
+
setNodesRef.current((nds)=>nds.map((node)=>node.id === nodeId ? {
|
|
1701
|
+
...node,
|
|
1702
|
+
data: {
|
|
1703
|
+
...node.data,
|
|
1704
|
+
stageDetails: {
|
|
1705
|
+
...node.data.stageDetails,
|
|
1706
|
+
label: newTitle
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
} : node));
|
|
1710
|
+
}, []);
|
|
1721
1711
|
const initialNodes = useMemo(()=>[
|
|
1722
1712
|
{
|
|
1723
1713
|
id: 'editable-stage',
|
|
@@ -1749,7 +1739,8 @@ const InlineTitleEditStory = ()=>{
|
|
|
1749
1739
|
},
|
|
1750
1740
|
onTaskAdd: ()=>{
|
|
1751
1741
|
window.alert('Add task functionality - this would open a dialog to add a new task');
|
|
1752
|
-
}
|
|
1742
|
+
},
|
|
1743
|
+
onStageTitleChange: createTitleChangeHandler('editable-stage')
|
|
1753
1744
|
}
|
|
1754
1745
|
},
|
|
1755
1746
|
{
|
|
@@ -1775,36 +1766,16 @@ const InlineTitleEditStory = ()=>{
|
|
|
1775
1766
|
},
|
|
1776
1767
|
onTaskAdd: ()=>{
|
|
1777
1768
|
window.alert('Add task functionality - this would open a dialog to add a new task');
|
|
1778
|
-
}
|
|
1769
|
+
},
|
|
1770
|
+
onStageTitleChange: createTitleChangeHandler('long-title-stage')
|
|
1779
1771
|
}
|
|
1780
1772
|
}
|
|
1781
|
-
], [
|
|
1782
|
-
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
|
|
1783
|
-
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
|
1784
|
-
const createTitleChangeHandler = useCallback((nodeId)=>(newTitle)=>{
|
|
1785
|
-
setNodes((nds)=>nds.map((node)=>node.id === nodeId ? {
|
|
1786
|
-
...node,
|
|
1787
|
-
data: {
|
|
1788
|
-
...node.data,
|
|
1789
|
-
stageDetails: {
|
|
1790
|
-
...node.data.stageDetails,
|
|
1791
|
-
label: newTitle
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1794
|
-
} : node));
|
|
1795
|
-
}, [
|
|
1796
|
-
setNodes
|
|
1797
|
-
]);
|
|
1798
|
-
const nodesWithHandlers = useMemo(()=>nodes.map((node)=>({
|
|
1799
|
-
...node,
|
|
1800
|
-
data: {
|
|
1801
|
-
...node.data,
|
|
1802
|
-
onStageTitleChange: createTitleChangeHandler(node.id)
|
|
1803
|
-
}
|
|
1804
|
-
})), [
|
|
1805
|
-
nodes,
|
|
1773
|
+
], [
|
|
1806
1774
|
createTitleChangeHandler
|
|
1807
1775
|
]);
|
|
1776
|
+
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
|
|
1777
|
+
setNodesRef.current = setNodes;
|
|
1778
|
+
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
|
1808
1779
|
const onConnect = useCallback((connection)=>setEdges((eds)=>addEdge(connection, eds)), [
|
|
1809
1780
|
setEdges
|
|
1810
1781
|
]);
|
|
@@ -1815,7 +1786,7 @@ const InlineTitleEditStory = ()=>{
|
|
|
1815
1786
|
},
|
|
1816
1787
|
children: /*#__PURE__*/ jsx(ReactFlowProvider, {
|
|
1817
1788
|
children: /*#__PURE__*/ jsx(BaseCanvas, {
|
|
1818
|
-
nodes:
|
|
1789
|
+
nodes: nodes,
|
|
1819
1790
|
edges: edges,
|
|
1820
1791
|
onNodesChange: onNodesChange,
|
|
1821
1792
|
onEdgesChange: onEdgesChange,
|
|
@@ -1906,20 +1877,33 @@ const loadedTaskOptionsWithChildren = [
|
|
|
1906
1877
|
}
|
|
1907
1878
|
];
|
|
1908
1879
|
const AddTaskLoadingStory = ()=>{
|
|
1909
|
-
const StageNodeWrapper = useMemo(()=>function(props) {
|
|
1910
|
-
return /*#__PURE__*/ jsx(StageNode, {
|
|
1911
|
-
...props,
|
|
1912
|
-
...props.data
|
|
1913
|
-
});
|
|
1914
|
-
}, []);
|
|
1915
1880
|
const nodeTypes = useMemo(()=>({
|
|
1916
1881
|
stage: StageNodeWrapper
|
|
1917
|
-
}), [
|
|
1918
|
-
StageNodeWrapper
|
|
1919
|
-
]);
|
|
1882
|
+
}), []);
|
|
1920
1883
|
const edgeTypes = useMemo(()=>({
|
|
1921
1884
|
stage: StageEdge
|
|
1922
1885
|
}), []);
|
|
1886
|
+
const setNodesRef = useRef(null);
|
|
1887
|
+
const timeoutRef = useRef(void 0);
|
|
1888
|
+
const handleAddTaskFromToolbox = useCallback((nodeId, _taskItem)=>{
|
|
1889
|
+
clearTimeout(timeoutRef.current);
|
|
1890
|
+
setNodesRef.current((nds)=>nds.map((n)=>n.id === nodeId ? {
|
|
1891
|
+
...n,
|
|
1892
|
+
data: {
|
|
1893
|
+
...n.data,
|
|
1894
|
+
addTaskLoading: true
|
|
1895
|
+
}
|
|
1896
|
+
} : n));
|
|
1897
|
+
timeoutRef.current = setTimeout(()=>{
|
|
1898
|
+
setNodesRef.current((nds)=>nds.map((n)=>n.id === nodeId ? {
|
|
1899
|
+
...n,
|
|
1900
|
+
data: {
|
|
1901
|
+
...n.data,
|
|
1902
|
+
addTaskLoading: false
|
|
1903
|
+
}
|
|
1904
|
+
} : n));
|
|
1905
|
+
}, 2000);
|
|
1906
|
+
}, []);
|
|
1923
1907
|
const initialNodes = useMemo(()=>[
|
|
1924
1908
|
{
|
|
1925
1909
|
id: 'loading-stage-empty',
|
|
@@ -1935,7 +1919,10 @@ const AddTaskLoadingStory = ()=>{
|
|
|
1935
1919
|
tasks: []
|
|
1936
1920
|
},
|
|
1937
1921
|
addTaskLoading: true,
|
|
1938
|
-
taskOptions: []
|
|
1922
|
+
taskOptions: [],
|
|
1923
|
+
onAddTaskFromToolbox: (taskItem)=>{
|
|
1924
|
+
handleAddTaskFromToolbox('loading-stage-empty', taskItem);
|
|
1925
|
+
}
|
|
1939
1926
|
}
|
|
1940
1927
|
},
|
|
1941
1928
|
{
|
|
@@ -1960,11 +1947,17 @@ const AddTaskLoadingStory = ()=>{
|
|
|
1960
1947
|
]
|
|
1961
1948
|
},
|
|
1962
1949
|
addTaskLoading: false,
|
|
1963
|
-
taskOptions: loadedTaskOptionsWithChildren
|
|
1950
|
+
taskOptions: loadedTaskOptionsWithChildren,
|
|
1951
|
+
onAddTaskFromToolbox: (taskItem)=>{
|
|
1952
|
+
handleAddTaskFromToolbox('loading-stage-children', taskItem);
|
|
1953
|
+
}
|
|
1964
1954
|
}
|
|
1965
1955
|
}
|
|
1966
|
-
], [
|
|
1967
|
-
|
|
1956
|
+
], [
|
|
1957
|
+
handleAddTaskFromToolbox
|
|
1958
|
+
]);
|
|
1959
|
+
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
|
|
1960
|
+
setNodesRef.current = setNodes;
|
|
1968
1961
|
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
|
1969
1962
|
useEffect(()=>{
|
|
1970
1963
|
const timeout = setTimeout(()=>{
|
|
@@ -1981,41 +1974,7 @@ const AddTaskLoadingStory = ()=>{
|
|
|
1981
1974
|
}, [
|
|
1982
1975
|
setNodes
|
|
1983
1976
|
]);
|
|
1984
|
-
const timeoutRef = useRef(void 0);
|
|
1985
1977
|
useEffect(()=>()=>clearTimeout(timeoutRef.current), []);
|
|
1986
|
-
const handleAddTaskFromToolbox = useCallback((nodeId, _taskItem)=>{
|
|
1987
|
-
clearTimeout(timeoutRef.current);
|
|
1988
|
-
setNodes((nds)=>nds.map((n)=>n.id === nodeId ? {
|
|
1989
|
-
...n,
|
|
1990
|
-
data: {
|
|
1991
|
-
...n.data,
|
|
1992
|
-
addTaskLoading: true
|
|
1993
|
-
}
|
|
1994
|
-
} : n));
|
|
1995
|
-
timeoutRef.current = setTimeout(()=>{
|
|
1996
|
-
setNodes((nds)=>nds.map((n)=>n.id === nodeId ? {
|
|
1997
|
-
...n,
|
|
1998
|
-
data: {
|
|
1999
|
-
...n.data,
|
|
2000
|
-
addTaskLoading: false
|
|
2001
|
-
}
|
|
2002
|
-
} : n));
|
|
2003
|
-
}, 2000);
|
|
2004
|
-
}, [
|
|
2005
|
-
setNodes
|
|
2006
|
-
]);
|
|
2007
|
-
const nodesWithHandler = useMemo(()=>nodesState.map((node)=>({
|
|
2008
|
-
...node,
|
|
2009
|
-
data: {
|
|
2010
|
-
...node.data,
|
|
2011
|
-
onAddTaskFromToolbox: (taskItem)=>{
|
|
2012
|
-
handleAddTaskFromToolbox(node.id, taskItem);
|
|
2013
|
-
}
|
|
2014
|
-
}
|
|
2015
|
-
})), [
|
|
2016
|
-
nodesState,
|
|
2017
|
-
handleAddTaskFromToolbox
|
|
2018
|
-
]);
|
|
2019
1978
|
const onConnect = useCallback((connection)=>setEdges((eds)=>addEdge(connection, eds)), [
|
|
2020
1979
|
setEdges
|
|
2021
1980
|
]);
|
|
@@ -2026,7 +1985,7 @@ const AddTaskLoadingStory = ()=>{
|
|
|
2026
1985
|
},
|
|
2027
1986
|
children: /*#__PURE__*/ jsx(ReactFlowProvider, {
|
|
2028
1987
|
children: /*#__PURE__*/ jsx(BaseCanvas, {
|
|
2029
|
-
nodes:
|
|
1988
|
+
nodes: nodes,
|
|
2030
1989
|
edges: edges,
|
|
2031
1990
|
onNodesChange: onNodesChange,
|
|
2032
1991
|
onEdgesChange: onEdgesChange,
|
|
@@ -2116,7 +2075,7 @@ const AdhocTasks = {
|
|
|
2116
2075
|
width: 304,
|
|
2117
2076
|
data: {
|
|
2118
2077
|
stageDetails: {
|
|
2119
|
-
label: 'Without onTaskPlay',
|
|
2078
|
+
label: 'Without onTaskPlay and Menu',
|
|
2120
2079
|
tasks: [
|
|
2121
2080
|
[
|
|
2122
2081
|
{
|
|
@@ -2146,6 +2105,12 @@ const AdhocTasks = {
|
|
|
2146
2105
|
},
|
|
2147
2106
|
onTaskClick: (taskId)=>{
|
|
2148
2107
|
window.alert(`Task clicked: ${taskId}`);
|
|
2108
|
+
},
|
|
2109
|
+
onTaskGroupModification: (type, groupIndex, taskIndex)=>{
|
|
2110
|
+
console.log(`Task group modification: ${type}, group: ${groupIndex}, task: ${taskIndex}`);
|
|
2111
|
+
},
|
|
2112
|
+
onReplaceTaskFromToolbox: (task, groupIndex, taskIndex)=>{
|
|
2113
|
+
console.log(`Replace task at group: ${groupIndex}, task: ${taskIndex}`, task);
|
|
2149
2114
|
}
|
|
2150
2115
|
}
|
|
2151
2116
|
},
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
StageNodeWrapper: ()=>StageNodeWrapper
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
const external_StageNode_cjs_namespaceObject = require("./StageNode.cjs");
|
|
32
|
+
const StageNodeWrapper = /*#__PURE__*/ (0, external_react_namespaceObject.memo)((props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_cjs_namespaceObject.StageNode, {
|
|
33
|
+
...props,
|
|
34
|
+
...props.data
|
|
35
|
+
}));
|
|
36
|
+
exports.StageNodeWrapper = __webpack_exports__.StageNodeWrapper;
|
|
37
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
38
|
+
"StageNodeWrapper"
|
|
39
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
40
|
+
Object.defineProperty(exports, '__esModule', {
|
|
41
|
+
value: true
|
|
42
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StageNode.stories.utils.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.stories.utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAK1E,eAAO,MAAM,gBAAgB,8CAAgB,SAAS,6CAEpD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from "react";
|
|
3
|
+
import { StageNode } from "./StageNode.js";
|
|
4
|
+
const StageNodeWrapper = /*#__PURE__*/ memo((props)=>/*#__PURE__*/ jsx(StageNode, {
|
|
5
|
+
...props,
|
|
6
|
+
...props.data
|
|
7
|
+
}));
|
|
8
|
+
export { StageNodeWrapper };
|
|
@@ -134,7 +134,7 @@ const StageTitleInput = styled_default().input`
|
|
|
134
134
|
border-radius: 2px;
|
|
135
135
|
width: 100%;
|
|
136
136
|
min-width: 100px;
|
|
137
|
-
padding: ${
|
|
137
|
+
padding: ${apollo_core_namespaceObject.Padding.PadS} 0px;
|
|
138
138
|
|
|
139
139
|
&:focus {
|
|
140
140
|
outline: none;
|
|
@@ -35,7 +35,7 @@ export interface StageHeaderChip {
|
|
|
35
35
|
tooltip?: React.ReactNode;
|
|
36
36
|
onClick?: () => void;
|
|
37
37
|
}
|
|
38
|
-
export interface
|
|
38
|
+
export interface StageNodeBaseProps {
|
|
39
39
|
dragging: boolean;
|
|
40
40
|
selected: boolean;
|
|
41
41
|
id: string;
|
|
@@ -79,6 +79,9 @@ export interface StageNodeProps extends NodeProps {
|
|
|
79
79
|
onTaskPlay?: (taskId: string) => Promise<void>;
|
|
80
80
|
hideParallelOptions?: boolean;
|
|
81
81
|
}
|
|
82
|
+
export interface StageNodeProps extends NodeProps, StageNodeBaseProps {
|
|
83
|
+
}
|
|
84
|
+
export type StageNodeInnerProps = StageNodeBaseProps & Pick<NodeProps, 'width'>;
|
|
82
85
|
export interface StageTaskExecution {
|
|
83
86
|
status?: StageTaskStatus;
|
|
84
87
|
message?: string;
|
|
@@ -89,5 +92,10 @@ export interface StageTaskExecution {
|
|
|
89
92
|
badgeStatus?: 'warning' | 'info' | 'error';
|
|
90
93
|
retryCount?: number;
|
|
91
94
|
}
|
|
95
|
+
export interface StageTaskDragOverlayProps {
|
|
96
|
+
activeTask: StageTaskItem | undefined;
|
|
97
|
+
isActiveTaskParallel: boolean;
|
|
98
|
+
taskWidthStyle: React.CSSProperties | undefined;
|
|
99
|
+
}
|
|
92
100
|
export {};
|
|
93
101
|
//# sourceMappingURL=StageNode.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageNode.types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEjE,aAAK,mBAAmB;IACtB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,aAAa,kBAAkB;IAC/B,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,OAAO,YAAY;CACpB;AAED,MAAM,MAAM,WAAW,GAAG,GAAG,mBAAmB,EAAE,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,GAAG,mBAAmB,EAAE,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,oBAAY,mBAAmB;IAC7B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,cAAc,mBAAmB;IACjC,QAAQ,aAAa;IACrB,cAAc,mBAAmB;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"StageNode.types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
StageTaskDragOverlay: ()=>StageTaskDragOverlay
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const core_namespaceObject = require("@dnd-kit/core");
|
|
31
|
+
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
32
|
+
const external_react_namespaceObject = require("react");
|
|
33
|
+
const external_react_dom_namespaceObject = require("react-dom");
|
|
34
|
+
const external_DraggableTask_cjs_namespaceObject = require("./DraggableTask.cjs");
|
|
35
|
+
const external_StageNode_styles_cjs_namespaceObject = require("./StageNode.styles.cjs");
|
|
36
|
+
const StageTaskDragOverlay = ({ activeTask, isActiveTaskParallel, taskWidthStyle })=>{
|
|
37
|
+
const { zoom } = (0, react_cjs_namespaceObject.useViewport)();
|
|
38
|
+
const dragOverlayStyle = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
39
|
+
transform: `scale(${zoom})`,
|
|
40
|
+
transformOrigin: 'top left'
|
|
41
|
+
}), [
|
|
42
|
+
zoom
|
|
43
|
+
]);
|
|
44
|
+
return /*#__PURE__*/ (0, external_react_dom_namespaceObject.createPortal)(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(core_namespaceObject.DragOverlay, {
|
|
45
|
+
children: activeTask ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
46
|
+
style: dragOverlayStyle,
|
|
47
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTask, {
|
|
48
|
+
selected: true,
|
|
49
|
+
isParallel: isActiveTaskParallel,
|
|
50
|
+
style: {
|
|
51
|
+
cursor: 'grabbing',
|
|
52
|
+
...taskWidthStyle
|
|
53
|
+
},
|
|
54
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DraggableTask_cjs_namespaceObject.TaskContent, {
|
|
55
|
+
task: activeTask,
|
|
56
|
+
isDragging: true
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
}) : null
|
|
60
|
+
}), document.body);
|
|
61
|
+
};
|
|
62
|
+
exports.StageTaskDragOverlay = __webpack_exports__.StageTaskDragOverlay;
|
|
63
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
64
|
+
"StageTaskDragOverlay"
|
|
65
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
66
|
+
Object.defineProperty(exports, '__esModule', {
|
|
67
|
+
value: true
|
|
68
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { StageTaskDragOverlayProps } from './StageNode.types';
|
|
2
|
+
export declare const StageTaskDragOverlay: ({ activeTask, isActiveTaskParallel, taskWidthStyle, }: StageTaskDragOverlayProps) => import("react").ReactPortal;
|
|
3
|
+
//# sourceMappingURL=StageTaskDragOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StageTaskDragOverlay.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageTaskDragOverlay.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,eAAO,MAAM,oBAAoB,GAAI,uDAIlC,yBAAyB,gCA0B3B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DragOverlay } from "@dnd-kit/core";
|
|
3
|
+
import { useViewport } from "../../xyflow/react.js";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { createPortal } from "react-dom";
|
|
6
|
+
import { TaskContent } from "./DraggableTask.js";
|
|
7
|
+
import { StageTask } from "./StageNode.styles.js";
|
|
8
|
+
const StageTaskDragOverlay = ({ activeTask, isActiveTaskParallel, taskWidthStyle })=>{
|
|
9
|
+
const { zoom } = useViewport();
|
|
10
|
+
const dragOverlayStyle = useMemo(()=>({
|
|
11
|
+
transform: `scale(${zoom})`,
|
|
12
|
+
transformOrigin: 'top left'
|
|
13
|
+
}), [
|
|
14
|
+
zoom
|
|
15
|
+
]);
|
|
16
|
+
return /*#__PURE__*/ createPortal(/*#__PURE__*/ jsx(DragOverlay, {
|
|
17
|
+
children: activeTask ? /*#__PURE__*/ jsx("div", {
|
|
18
|
+
style: dragOverlayStyle,
|
|
19
|
+
children: /*#__PURE__*/ jsx(StageTask, {
|
|
20
|
+
selected: true,
|
|
21
|
+
isParallel: isActiveTaskParallel,
|
|
22
|
+
style: {
|
|
23
|
+
cursor: 'grabbing',
|
|
24
|
+
...taskWidthStyle
|
|
25
|
+
},
|
|
26
|
+
children: /*#__PURE__*/ jsx(TaskContent, {
|
|
27
|
+
task: activeTask,
|
|
28
|
+
isDragging: true
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
}) : null
|
|
32
|
+
}), document.body);
|
|
33
|
+
};
|
|
34
|
+
export { StageTaskDragOverlay };
|