@uipath/apollo-react 3.63.1 → 3.64.0-pr431.cb6b0b8
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/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 +100 -47
- 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 +106 -53
- package/dist/canvas/components/StageNode/StageNode.stories.cjs +321 -158
- package/dist/canvas/components/StageNode/StageNode.stories.d.ts +1 -0
- package/dist/canvas/components/StageNode/StageNode.stories.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.stories.js +314 -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 +35 -2
- package/dist/canvas/components/StageNode/StageNode.styles.d.ts +8 -0
- package/dist/canvas/components/StageNode/StageNode.styles.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.styles.js +28 -1
- package/dist/canvas/components/StageNode/StageNode.types.cjs +26 -1
- package/dist/canvas/components/StageNode/StageNode.types.d.ts +23 -1
- package/dist/canvas/components/StageNode/StageNode.types.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.types.js +9 -0
- 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/icons/ExitConditionIcon.cjs +49 -0
- package/dist/canvas/icons/ExitConditionIcon.d.ts +5 -0
- package/dist/canvas/icons/ExitConditionIcon.d.ts.map +1 -0
- package/dist/canvas/icons/ExitConditionIcon.js +15 -0
- package/dist/canvas/icons/ReturnToOriginIcon.cjs +50 -0
- package/dist/canvas/icons/ReturnToOriginIcon.d.ts +5 -0
- package/dist/canvas/icons/ReturnToOriginIcon.d.ts.map +1 -0
- package/dist/canvas/icons/ReturnToOriginIcon.js +16 -0
- package/dist/canvas/icons/index.cjs +8 -0
- package/dist/canvas/icons/index.d.ts +2 -0
- package/dist/canvas/icons/index.d.ts.map +1 -1
- package/dist/canvas/icons/index.js +3 -1
- package/package.json +2 -2
|
@@ -10,6 +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";
|
|
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
|
+
};
|
|
13
61
|
const meta = {
|
|
14
62
|
title: 'Canvas/StageNode',
|
|
15
63
|
component: StageNode,
|
|
@@ -19,10 +67,6 @@ const meta = {
|
|
|
19
67
|
decorators: [
|
|
20
68
|
(Story, context)=>{
|
|
21
69
|
if (context.parameters?.useCustomRender) return /*#__PURE__*/ jsx(Story, {});
|
|
22
|
-
const StageNodeWrapper = (props)=>/*#__PURE__*/ jsx(StageNode, {
|
|
23
|
-
...props,
|
|
24
|
-
...props.data
|
|
25
|
-
});
|
|
26
70
|
const initialNodes = context.parameters?.nodes || [
|
|
27
71
|
{
|
|
28
72
|
id: '1',
|
|
@@ -42,51 +86,9 @@ const meta = {
|
|
|
42
86
|
}
|
|
43
87
|
];
|
|
44
88
|
const initialEdges = context.parameters?.edges || [];
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
setEdges((eds)=>addEdge(connection, eds));
|
|
49
|
-
}, [
|
|
50
|
-
setEdges
|
|
51
|
-
]);
|
|
52
|
-
const nodeTypes = useMemo(()=>({
|
|
53
|
-
stage: StageNodeWrapper
|
|
54
|
-
}), [
|
|
55
|
-
StageNodeWrapper
|
|
56
|
-
]);
|
|
57
|
-
const edgeTypes = useMemo(()=>({
|
|
58
|
-
stage: StageEdge
|
|
59
|
-
}), []);
|
|
60
|
-
const defaultEdgeOptions = useMemo(()=>({
|
|
61
|
-
type: 'stage'
|
|
62
|
-
}), []);
|
|
63
|
-
return /*#__PURE__*/ jsx("div", {
|
|
64
|
-
style: {
|
|
65
|
-
width: '100vw',
|
|
66
|
-
height: '100vh'
|
|
67
|
-
},
|
|
68
|
-
children: /*#__PURE__*/ jsx(ReactFlowProvider, {
|
|
69
|
-
children: /*#__PURE__*/ jsx(BaseCanvas, {
|
|
70
|
-
nodes: nodes,
|
|
71
|
-
edges: edges,
|
|
72
|
-
onNodesChange: onNodesChange,
|
|
73
|
-
onEdgesChange: onEdgesChange,
|
|
74
|
-
onConnect: onConnect,
|
|
75
|
-
nodeTypes: nodeTypes,
|
|
76
|
-
edgeTypes: edgeTypes,
|
|
77
|
-
mode: "design",
|
|
78
|
-
connectionMode: ConnectionMode.Strict,
|
|
79
|
-
defaultEdgeOptions: defaultEdgeOptions,
|
|
80
|
-
connectionLineComponent: StageConnectionEdge,
|
|
81
|
-
elevateEdgesOnSelect: true,
|
|
82
|
-
children: /*#__PURE__*/ jsx(Panel, {
|
|
83
|
-
position: "bottom-right",
|
|
84
|
-
children: /*#__PURE__*/ jsx(CanvasPositionControls, {
|
|
85
|
-
translations: DefaultCanvasTranslations
|
|
86
|
-
})
|
|
87
|
-
})
|
|
88
|
-
})
|
|
89
|
-
})
|
|
89
|
+
return /*#__PURE__*/ jsx(DefaultCanvasDecorator, {
|
|
90
|
+
initialNodes: initialNodes,
|
|
91
|
+
initialEdges: initialEdges
|
|
90
92
|
});
|
|
91
93
|
}
|
|
92
94
|
],
|
|
@@ -162,7 +164,7 @@ const DocumentIcon = ()=>/*#__PURE__*/ jsxs("svg", {
|
|
|
162
164
|
strokeWidth: "1.5",
|
|
163
165
|
children: [
|
|
164
166
|
/*#__PURE__*/ jsx("path", {
|
|
165
|
-
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"
|
|
166
168
|
}),
|
|
167
169
|
/*#__PURE__*/ jsx("path", {
|
|
168
170
|
d: "M14 2V8H20"
|
|
@@ -1273,17 +1275,9 @@ const initialTasks = [
|
|
|
1273
1275
|
]
|
|
1274
1276
|
];
|
|
1275
1277
|
const DraggableTaskReorderingStory = ()=>{
|
|
1276
|
-
const StageNodeWrapper = useMemo(()=>function(props) {
|
|
1277
|
-
return /*#__PURE__*/ jsx(StageNode, {
|
|
1278
|
-
...props,
|
|
1279
|
-
...props.data
|
|
1280
|
-
});
|
|
1281
|
-
}, []);
|
|
1282
1278
|
const nodeTypes = useMemo(()=>({
|
|
1283
1279
|
stage: StageNodeWrapper
|
|
1284
|
-
}), [
|
|
1285
|
-
StageNodeWrapper
|
|
1286
|
-
]);
|
|
1280
|
+
}), []);
|
|
1287
1281
|
const edgeTypes = useMemo(()=>({
|
|
1288
1282
|
stage: StageEdge
|
|
1289
1283
|
}), []);
|
|
@@ -1452,17 +1446,9 @@ const availableTaskOptions = [
|
|
|
1452
1446
|
}
|
|
1453
1447
|
];
|
|
1454
1448
|
const AddAndReplaceTasksStory = ()=>{
|
|
1455
|
-
const StageNodeWrapper = useMemo(()=>function(props) {
|
|
1456
|
-
return /*#__PURE__*/ jsx(StageNode, {
|
|
1457
|
-
...props,
|
|
1458
|
-
...props.data
|
|
1459
|
-
});
|
|
1460
|
-
}, []);
|
|
1461
1449
|
const nodeTypes = useMemo(()=>({
|
|
1462
1450
|
stage: StageNodeWrapper
|
|
1463
|
-
}), [
|
|
1464
|
-
StageNodeWrapper
|
|
1465
|
-
]);
|
|
1451
|
+
}), []);
|
|
1466
1452
|
const edgeTypes = useMemo(()=>({
|
|
1467
1453
|
stage: StageEdge
|
|
1468
1454
|
}), []);
|
|
@@ -1703,20 +1689,25 @@ const AddAndReplaceTasks = {
|
|
|
1703
1689
|
args: {}
|
|
1704
1690
|
};
|
|
1705
1691
|
const InlineTitleEditStory = ()=>{
|
|
1706
|
-
const StageNodeWrapper = useMemo(()=>function(props) {
|
|
1707
|
-
return /*#__PURE__*/ jsx(StageNode, {
|
|
1708
|
-
...props,
|
|
1709
|
-
...props.data
|
|
1710
|
-
});
|
|
1711
|
-
}, []);
|
|
1712
1692
|
const nodeTypes = useMemo(()=>({
|
|
1713
1693
|
stage: StageNodeWrapper
|
|
1714
|
-
}), [
|
|
1715
|
-
StageNodeWrapper
|
|
1716
|
-
]);
|
|
1694
|
+
}), []);
|
|
1717
1695
|
const edgeTypes = useMemo(()=>({
|
|
1718
1696
|
stage: StageEdge
|
|
1719
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
|
+
}, []);
|
|
1720
1711
|
const initialNodes = useMemo(()=>[
|
|
1721
1712
|
{
|
|
1722
1713
|
id: 'editable-stage',
|
|
@@ -1748,7 +1739,8 @@ const InlineTitleEditStory = ()=>{
|
|
|
1748
1739
|
},
|
|
1749
1740
|
onTaskAdd: ()=>{
|
|
1750
1741
|
window.alert('Add task functionality - this would open a dialog to add a new task');
|
|
1751
|
-
}
|
|
1742
|
+
},
|
|
1743
|
+
onStageTitleChange: createTitleChangeHandler('editable-stage')
|
|
1752
1744
|
}
|
|
1753
1745
|
},
|
|
1754
1746
|
{
|
|
@@ -1774,36 +1766,16 @@ const InlineTitleEditStory = ()=>{
|
|
|
1774
1766
|
},
|
|
1775
1767
|
onTaskAdd: ()=>{
|
|
1776
1768
|
window.alert('Add task functionality - this would open a dialog to add a new task');
|
|
1777
|
-
}
|
|
1769
|
+
},
|
|
1770
|
+
onStageTitleChange: createTitleChangeHandler('long-title-stage')
|
|
1778
1771
|
}
|
|
1779
1772
|
}
|
|
1780
|
-
], [
|
|
1781
|
-
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
|
|
1782
|
-
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
|
1783
|
-
const createTitleChangeHandler = useCallback((nodeId)=>(newTitle)=>{
|
|
1784
|
-
setNodes((nds)=>nds.map((node)=>node.id === nodeId ? {
|
|
1785
|
-
...node,
|
|
1786
|
-
data: {
|
|
1787
|
-
...node.data,
|
|
1788
|
-
stageDetails: {
|
|
1789
|
-
...node.data.stageDetails,
|
|
1790
|
-
label: newTitle
|
|
1791
|
-
}
|
|
1792
|
-
}
|
|
1793
|
-
} : node));
|
|
1794
|
-
}, [
|
|
1795
|
-
setNodes
|
|
1796
|
-
]);
|
|
1797
|
-
const nodesWithHandlers = useMemo(()=>nodes.map((node)=>({
|
|
1798
|
-
...node,
|
|
1799
|
-
data: {
|
|
1800
|
-
...node.data,
|
|
1801
|
-
onStageTitleChange: createTitleChangeHandler(node.id)
|
|
1802
|
-
}
|
|
1803
|
-
})), [
|
|
1804
|
-
nodes,
|
|
1773
|
+
], [
|
|
1805
1774
|
createTitleChangeHandler
|
|
1806
1775
|
]);
|
|
1776
|
+
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
|
|
1777
|
+
setNodesRef.current = setNodes;
|
|
1778
|
+
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
|
1807
1779
|
const onConnect = useCallback((connection)=>setEdges((eds)=>addEdge(connection, eds)), [
|
|
1808
1780
|
setEdges
|
|
1809
1781
|
]);
|
|
@@ -1814,7 +1786,7 @@ const InlineTitleEditStory = ()=>{
|
|
|
1814
1786
|
},
|
|
1815
1787
|
children: /*#__PURE__*/ jsx(ReactFlowProvider, {
|
|
1816
1788
|
children: /*#__PURE__*/ jsx(BaseCanvas, {
|
|
1817
|
-
nodes:
|
|
1789
|
+
nodes: nodes,
|
|
1818
1790
|
edges: edges,
|
|
1819
1791
|
onNodesChange: onNodesChange,
|
|
1820
1792
|
onEdgesChange: onEdgesChange,
|
|
@@ -1905,20 +1877,33 @@ const loadedTaskOptionsWithChildren = [
|
|
|
1905
1877
|
}
|
|
1906
1878
|
];
|
|
1907
1879
|
const AddTaskLoadingStory = ()=>{
|
|
1908
|
-
const StageNodeWrapper = useMemo(()=>function(props) {
|
|
1909
|
-
return /*#__PURE__*/ jsx(StageNode, {
|
|
1910
|
-
...props,
|
|
1911
|
-
...props.data
|
|
1912
|
-
});
|
|
1913
|
-
}, []);
|
|
1914
1880
|
const nodeTypes = useMemo(()=>({
|
|
1915
1881
|
stage: StageNodeWrapper
|
|
1916
|
-
}), [
|
|
1917
|
-
StageNodeWrapper
|
|
1918
|
-
]);
|
|
1882
|
+
}), []);
|
|
1919
1883
|
const edgeTypes = useMemo(()=>({
|
|
1920
1884
|
stage: StageEdge
|
|
1921
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
|
+
}, []);
|
|
1922
1907
|
const initialNodes = useMemo(()=>[
|
|
1923
1908
|
{
|
|
1924
1909
|
id: 'loading-stage-empty',
|
|
@@ -1934,7 +1919,10 @@ const AddTaskLoadingStory = ()=>{
|
|
|
1934
1919
|
tasks: []
|
|
1935
1920
|
},
|
|
1936
1921
|
addTaskLoading: true,
|
|
1937
|
-
taskOptions: []
|
|
1922
|
+
taskOptions: [],
|
|
1923
|
+
onAddTaskFromToolbox: (taskItem)=>{
|
|
1924
|
+
handleAddTaskFromToolbox('loading-stage-empty', taskItem);
|
|
1925
|
+
}
|
|
1938
1926
|
}
|
|
1939
1927
|
},
|
|
1940
1928
|
{
|
|
@@ -1959,11 +1947,17 @@ const AddTaskLoadingStory = ()=>{
|
|
|
1959
1947
|
]
|
|
1960
1948
|
},
|
|
1961
1949
|
addTaskLoading: false,
|
|
1962
|
-
taskOptions: loadedTaskOptionsWithChildren
|
|
1950
|
+
taskOptions: loadedTaskOptionsWithChildren,
|
|
1951
|
+
onAddTaskFromToolbox: (taskItem)=>{
|
|
1952
|
+
handleAddTaskFromToolbox('loading-stage-children', taskItem);
|
|
1953
|
+
}
|
|
1963
1954
|
}
|
|
1964
1955
|
}
|
|
1965
|
-
], [
|
|
1966
|
-
|
|
1956
|
+
], [
|
|
1957
|
+
handleAddTaskFromToolbox
|
|
1958
|
+
]);
|
|
1959
|
+
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
|
|
1960
|
+
setNodesRef.current = setNodes;
|
|
1967
1961
|
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
|
1968
1962
|
useEffect(()=>{
|
|
1969
1963
|
const timeout = setTimeout(()=>{
|
|
@@ -1980,41 +1974,7 @@ const AddTaskLoadingStory = ()=>{
|
|
|
1980
1974
|
}, [
|
|
1981
1975
|
setNodes
|
|
1982
1976
|
]);
|
|
1983
|
-
const timeoutRef = useRef(void 0);
|
|
1984
1977
|
useEffect(()=>()=>clearTimeout(timeoutRef.current), []);
|
|
1985
|
-
const handleAddTaskFromToolbox = useCallback((nodeId, _taskItem)=>{
|
|
1986
|
-
clearTimeout(timeoutRef.current);
|
|
1987
|
-
setNodes((nds)=>nds.map((n)=>n.id === nodeId ? {
|
|
1988
|
-
...n,
|
|
1989
|
-
data: {
|
|
1990
|
-
...n.data,
|
|
1991
|
-
addTaskLoading: true
|
|
1992
|
-
}
|
|
1993
|
-
} : n));
|
|
1994
|
-
timeoutRef.current = setTimeout(()=>{
|
|
1995
|
-
setNodes((nds)=>nds.map((n)=>n.id === nodeId ? {
|
|
1996
|
-
...n,
|
|
1997
|
-
data: {
|
|
1998
|
-
...n.data,
|
|
1999
|
-
addTaskLoading: false
|
|
2000
|
-
}
|
|
2001
|
-
} : n));
|
|
2002
|
-
}, 2000);
|
|
2003
|
-
}, [
|
|
2004
|
-
setNodes
|
|
2005
|
-
]);
|
|
2006
|
-
const nodesWithHandler = useMemo(()=>nodesState.map((node)=>({
|
|
2007
|
-
...node,
|
|
2008
|
-
data: {
|
|
2009
|
-
...node.data,
|
|
2010
|
-
onAddTaskFromToolbox: (taskItem)=>{
|
|
2011
|
-
handleAddTaskFromToolbox(node.id, taskItem);
|
|
2012
|
-
}
|
|
2013
|
-
}
|
|
2014
|
-
})), [
|
|
2015
|
-
nodesState,
|
|
2016
|
-
handleAddTaskFromToolbox
|
|
2017
|
-
]);
|
|
2018
1978
|
const onConnect = useCallback((connection)=>setEdges((eds)=>addEdge(connection, eds)), [
|
|
2019
1979
|
setEdges
|
|
2020
1980
|
]);
|
|
@@ -2025,7 +1985,7 @@ const AddTaskLoadingStory = ()=>{
|
|
|
2025
1985
|
},
|
|
2026
1986
|
children: /*#__PURE__*/ jsx(ReactFlowProvider, {
|
|
2027
1987
|
children: /*#__PURE__*/ jsx(BaseCanvas, {
|
|
2028
|
-
nodes:
|
|
1988
|
+
nodes: nodes,
|
|
2029
1989
|
edges: edges,
|
|
2030
1990
|
onNodesChange: onNodesChange,
|
|
2031
1991
|
onEdgesChange: onEdgesChange,
|
|
@@ -2199,4 +2159,204 @@ const AdhocTasks = {
|
|
|
2199
2159
|
},
|
|
2200
2160
|
args: {}
|
|
2201
2161
|
};
|
|
2202
|
-
|
|
2162
|
+
const WithRulesTags = {
|
|
2163
|
+
name: 'With Rules & Tags',
|
|
2164
|
+
parameters: {
|
|
2165
|
+
nodes: [
|
|
2166
|
+
{
|
|
2167
|
+
id: '1',
|
|
2168
|
+
type: 'stage',
|
|
2169
|
+
position: {
|
|
2170
|
+
x: 48,
|
|
2171
|
+
y: 96
|
|
2172
|
+
},
|
|
2173
|
+
width: 304,
|
|
2174
|
+
data: {
|
|
2175
|
+
stageDetails: {
|
|
2176
|
+
label: 'Application',
|
|
2177
|
+
tasks: [
|
|
2178
|
+
[
|
|
2179
|
+
{
|
|
2180
|
+
id: 't1',
|
|
2181
|
+
label: 'Verify applicant identity',
|
|
2182
|
+
icon: /*#__PURE__*/ jsx(VerificationIcon, {})
|
|
2183
|
+
}
|
|
2184
|
+
],
|
|
2185
|
+
[
|
|
2186
|
+
{
|
|
2187
|
+
id: 't2',
|
|
2188
|
+
label: 'Pull credit report',
|
|
2189
|
+
icon: /*#__PURE__*/ jsx(DocumentIcon, {})
|
|
2190
|
+
}
|
|
2191
|
+
]
|
|
2192
|
+
],
|
|
2193
|
+
headerChips: [
|
|
2194
|
+
{
|
|
2195
|
+
type: StageHeaderChipType.Entry,
|
|
2196
|
+
count: 1,
|
|
2197
|
+
tooltip: 'Entry rules',
|
|
2198
|
+
onClick: ()=>window.alert('Open entry rules panel')
|
|
2199
|
+
},
|
|
2200
|
+
{
|
|
2201
|
+
type: StageHeaderChipType.Exit,
|
|
2202
|
+
count: 3,
|
|
2203
|
+
tooltip: 'Exit rules',
|
|
2204
|
+
onClick: ()=>window.alert('Open exit rules panel')
|
|
2205
|
+
}
|
|
2206
|
+
]
|
|
2207
|
+
},
|
|
2208
|
+
onTaskClick: (taskId)=>window.alert(`Task clicked: ${taskId}`),
|
|
2209
|
+
onTaskAdd: ()=>window.alert('Add task')
|
|
2210
|
+
}
|
|
2211
|
+
},
|
|
2212
|
+
{
|
|
2213
|
+
id: '2',
|
|
2214
|
+
type: 'stage',
|
|
2215
|
+
position: {
|
|
2216
|
+
x: 400,
|
|
2217
|
+
y: 96
|
|
2218
|
+
},
|
|
2219
|
+
width: 304,
|
|
2220
|
+
data: {
|
|
2221
|
+
stageDetails: {
|
|
2222
|
+
label: 'Pending with customer',
|
|
2223
|
+
tasks: [
|
|
2224
|
+
[
|
|
2225
|
+
{
|
|
2226
|
+
id: 't3',
|
|
2227
|
+
label: 'Request documents',
|
|
2228
|
+
icon: /*#__PURE__*/ jsx(DocumentIcon, {})
|
|
2229
|
+
}
|
|
2230
|
+
],
|
|
2231
|
+
[
|
|
2232
|
+
{
|
|
2233
|
+
id: 't4',
|
|
2234
|
+
label: 'Send reminder or request',
|
|
2235
|
+
icon: /*#__PURE__*/ jsx(ProcessIcon, {})
|
|
2236
|
+
}
|
|
2237
|
+
]
|
|
2238
|
+
],
|
|
2239
|
+
headerChips: [
|
|
2240
|
+
{
|
|
2241
|
+
type: StageHeaderChipType.Entry,
|
|
2242
|
+
count: 2,
|
|
2243
|
+
tooltip: 'Entry rules',
|
|
2244
|
+
onClick: ()=>window.alert('Open entry rules panel')
|
|
2245
|
+
},
|
|
2246
|
+
{
|
|
2247
|
+
type: StageHeaderChipType.Exit,
|
|
2248
|
+
count: 1,
|
|
2249
|
+
tooltip: 'Exit rules',
|
|
2250
|
+
onClick: ()=>window.alert('Open exit rules panel')
|
|
2251
|
+
},
|
|
2252
|
+
{
|
|
2253
|
+
type: StageHeaderChipType.ReturnToOrigin,
|
|
2254
|
+
tooltip: 'Return to origin conditions',
|
|
2255
|
+
onClick: ()=>window.alert('Open return to origin panel')
|
|
2256
|
+
}
|
|
2257
|
+
]
|
|
2258
|
+
},
|
|
2259
|
+
onTaskClick: (taskId)=>window.alert(`Task clicked: ${taskId}`),
|
|
2260
|
+
onTaskAdd: ()=>window.alert('Add task')
|
|
2261
|
+
}
|
|
2262
|
+
},
|
|
2263
|
+
{
|
|
2264
|
+
id: '3',
|
|
2265
|
+
type: 'stage',
|
|
2266
|
+
position: {
|
|
2267
|
+
x: 752,
|
|
2268
|
+
y: 96
|
|
2269
|
+
},
|
|
2270
|
+
width: 304,
|
|
2271
|
+
data: {
|
|
2272
|
+
stageDetails: {
|
|
2273
|
+
label: 'Withdrawn',
|
|
2274
|
+
tasks: [
|
|
2275
|
+
[
|
|
2276
|
+
{
|
|
2277
|
+
id: 't5',
|
|
2278
|
+
label: 'Process withdrawal',
|
|
2279
|
+
icon: /*#__PURE__*/ jsx(ProcessIcon, {})
|
|
2280
|
+
}
|
|
2281
|
+
]
|
|
2282
|
+
],
|
|
2283
|
+
headerChips: [
|
|
2284
|
+
{
|
|
2285
|
+
type: StageHeaderChipType.Entry,
|
|
2286
|
+
count: 2,
|
|
2287
|
+
tooltip: 'Entry rules',
|
|
2288
|
+
onClick: ()=>window.alert('Open entry rules panel')
|
|
2289
|
+
},
|
|
2290
|
+
{
|
|
2291
|
+
type: StageHeaderChipType.Exit,
|
|
2292
|
+
count: 1,
|
|
2293
|
+
tooltip: 'Exit rules',
|
|
2294
|
+
onClick: ()=>window.alert('Open exit rules panel')
|
|
2295
|
+
},
|
|
2296
|
+
{
|
|
2297
|
+
type: StageHeaderChipType.CaseExit,
|
|
2298
|
+
tooltip: 'Case exit',
|
|
2299
|
+
onClick: ()=>window.alert('Open case exit panel')
|
|
2300
|
+
}
|
|
2301
|
+
]
|
|
2302
|
+
},
|
|
2303
|
+
onTaskClick: (taskId)=>window.alert(`Task clicked: ${taskId}`),
|
|
2304
|
+
onTaskAdd: ()=>window.alert('Add task')
|
|
2305
|
+
}
|
|
2306
|
+
},
|
|
2307
|
+
{
|
|
2308
|
+
id: '4',
|
|
2309
|
+
type: 'stage',
|
|
2310
|
+
position: {
|
|
2311
|
+
x: 1104,
|
|
2312
|
+
y: 96
|
|
2313
|
+
},
|
|
2314
|
+
width: 304,
|
|
2315
|
+
data: {
|
|
2316
|
+
stageDetails: {
|
|
2317
|
+
label: 'Closing',
|
|
2318
|
+
tasks: [
|
|
2319
|
+
[
|
|
2320
|
+
{
|
|
2321
|
+
id: 't6',
|
|
2322
|
+
label: 'Prepare closing docs',
|
|
2323
|
+
icon: /*#__PURE__*/ jsx(DocumentIcon, {})
|
|
2324
|
+
}
|
|
2325
|
+
],
|
|
2326
|
+
[
|
|
2327
|
+
{
|
|
2328
|
+
id: 't7',
|
|
2329
|
+
label: 'eSign envelope',
|
|
2330
|
+
icon: /*#__PURE__*/ jsx(ProcessIcon, {})
|
|
2331
|
+
}
|
|
2332
|
+
]
|
|
2333
|
+
],
|
|
2334
|
+
headerChips: [
|
|
2335
|
+
{
|
|
2336
|
+
type: StageHeaderChipType.Entry,
|
|
2337
|
+
count: 1,
|
|
2338
|
+
tooltip: 'Entry rules',
|
|
2339
|
+
onClick: ()=>window.alert('Open entry rules panel')
|
|
2340
|
+
},
|
|
2341
|
+
{
|
|
2342
|
+
type: StageHeaderChipType.Exit,
|
|
2343
|
+
count: 3,
|
|
2344
|
+
tooltip: 'Exit rules',
|
|
2345
|
+
onClick: ()=>window.alert('Open exit rules panel')
|
|
2346
|
+
},
|
|
2347
|
+
{
|
|
2348
|
+
type: StageHeaderChipType.CaseCompletion,
|
|
2349
|
+
tooltip: 'Case completion',
|
|
2350
|
+
onClick: ()=>window.alert('Open case completion panel')
|
|
2351
|
+
}
|
|
2352
|
+
]
|
|
2353
|
+
},
|
|
2354
|
+
onTaskClick: (taskId)=>window.alert(`Task clicked: ${taskId}`),
|
|
2355
|
+
onTaskAdd: ()=>window.alert('Add task')
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
]
|
|
2359
|
+
},
|
|
2360
|
+
args: {}
|
|
2361
|
+
};
|
|
2362
|
+
export { AddAndReplaceTasks, AddTaskLoading, AdhocTasks, Default, DraggableTaskReordering, EditableStageTitle, ExecutionStatus, InteractiveTaskManagement, LoanProcessingWorkflow, WithRulesTags, WithTaskIcons, StageNode_stories as default };
|
|
@@ -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 };
|