@uipath/apollo-react 3.44.0 → 3.44.2-pr255.af80ea0
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/StageNode/CrossStageTaskDrag.stories.cjs +581 -0
- package/dist/canvas/components/StageNode/CrossStageTaskDrag.stories.d.ts +6 -0
- package/dist/canvas/components/StageNode/CrossStageTaskDrag.stories.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/CrossStageTaskDrag.stories.js +544 -0
- package/dist/canvas/components/StageNode/DropPlaceholder.cjs +106 -0
- package/dist/canvas/components/StageNode/DropPlaceholder.d.ts +10 -0
- package/dist/canvas/components/StageNode/DropPlaceholder.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/DropPlaceholder.js +72 -0
- package/dist/canvas/components/StageNode/StageNode.cjs +334 -389
- package/dist/canvas/components/StageNode/StageNode.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.js +336 -391
- package/dist/canvas/components/StageNode/StageNode.stories.cjs +1910 -1416
- package/dist/canvas/components/StageNode/StageNode.stories.d.ts +1 -1
- package/dist/canvas/components/StageNode/StageNode.stories.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.stories.js +1906 -1412
- 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 +26 -10
- package/dist/canvas/components/StageNode/StageNode.types.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.cjs +10 -5
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.d.ts +2 -1
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.js +6 -4
- package/dist/canvas/components/StageNode/TaskMenu.cjs +11 -43
- package/dist/canvas/components/StageNode/TaskMenu.d.ts +1 -6
- package/dist/canvas/components/StageNode/TaskMenu.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/TaskMenu.js +13 -35
- package/dist/canvas/components/StageNode/index.cjs +17 -3
- package/dist/canvas/components/StageNode/index.d.ts +4 -1
- package/dist/canvas/components/StageNode/index.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/index.js +3 -1
- package/dist/canvas/components/TaskNode/PlaceholderTaskNode.cjs +51 -0
- package/dist/canvas/components/TaskNode/PlaceholderTaskNode.d.ts +8 -0
- package/dist/canvas/components/TaskNode/PlaceholderTaskNode.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/PlaceholderTaskNode.js +17 -0
- package/dist/canvas/components/TaskNode/TaskNode.cjs +235 -0
- package/dist/canvas/components/TaskNode/TaskNode.d.ts +11 -0
- package/dist/canvas/components/TaskNode/TaskNode.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/TaskNode.js +198 -0
- package/dist/canvas/components/TaskNode/TaskNode.stories.cjs +558 -0
- package/dist/canvas/components/TaskNode/TaskNode.stories.d.ts +8 -0
- package/dist/canvas/components/TaskNode/TaskNode.stories.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/TaskNode.stories.js +515 -0
- package/dist/canvas/components/TaskNode/TaskNode.types.d.ts +40 -0
- package/dist/canvas/components/TaskNode/TaskNode.types.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/TaskNodeContext.cjs +86 -0
- package/dist/canvas/components/TaskNode/TaskNodeContext.d.ts +24 -0
- package/dist/canvas/components/TaskNode/TaskNodeContext.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/TaskNodeContext.js +40 -0
- package/dist/canvas/components/TaskNode/index.cjs +82 -0
- package/dist/canvas/components/TaskNode/index.d.ts +8 -0
- package/dist/canvas/components/TaskNode/index.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/index.js +6 -0
- package/dist/canvas/components/TaskNode/taskReorderUtils.cjs +206 -0
- package/dist/canvas/components/TaskNode/taskReorderUtils.d.ts +23 -0
- package/dist/canvas/components/TaskNode/taskReorderUtils.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/taskReorderUtils.js +154 -0
- package/dist/canvas/components/TaskNode/useTaskPositions.cjs +153 -0
- package/dist/canvas/components/TaskNode/useTaskPositions.d.ts +29 -0
- package/dist/canvas/components/TaskNode/useTaskPositions.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/useTaskPositions.js +110 -0
- package/dist/canvas/core/TaskTypeRegistry.cjs +132 -0
- package/dist/canvas/core/TaskTypeRegistry.d.ts +18 -0
- package/dist/canvas/core/TaskTypeRegistry.d.ts.map +1 -0
- package/dist/canvas/core/TaskTypeRegistry.js +98 -0
- package/dist/canvas/core/index.cjs +21 -3
- package/dist/canvas/core/index.d.ts +2 -0
- package/dist/canvas/core/index.d.ts.map +1 -1
- package/dist/canvas/core/index.js +2 -0
- package/dist/canvas/core/useTaskTypeRegistry.cjs +82 -0
- package/dist/canvas/core/useTaskTypeRegistry.d.ts +13 -0
- package/dist/canvas/core/useTaskTypeRegistry.d.ts.map +1 -0
- package/dist/canvas/core/useTaskTypeRegistry.js +33 -0
- package/dist/canvas/hooks/CrossStageDragContext.cjs +45 -0
- package/dist/canvas/hooks/CrossStageDragContext.d.ts +8 -0
- package/dist/canvas/hooks/CrossStageDragContext.d.ts.map +1 -0
- package/dist/canvas/hooks/CrossStageDragContext.js +8 -0
- package/dist/canvas/hooks/calculateTaskDropPosition.cjs +253 -0
- package/dist/canvas/hooks/calculateTaskDropPosition.d.ts +11 -0
- package/dist/canvas/hooks/calculateTaskDropPosition.d.ts.map +1 -0
- package/dist/canvas/hooks/calculateTaskDropPosition.js +216 -0
- package/dist/canvas/hooks/index.cjs +57 -30
- package/dist/canvas/hooks/index.d.ts +3 -0
- package/dist/canvas/hooks/index.d.ts.map +1 -1
- package/dist/canvas/hooks/index.js +3 -0
- package/dist/canvas/hooks/useCrossStageTaskDrag.cjs +346 -0
- package/dist/canvas/hooks/useCrossStageTaskDrag.d.ts +44 -0
- package/dist/canvas/hooks/useCrossStageTaskDrag.d.ts.map +1 -0
- package/dist/canvas/hooks/useCrossStageTaskDrag.js +312 -0
- package/dist/canvas/hooks/useTaskCopyPaste.cjs +155 -0
- package/dist/canvas/hooks/useTaskCopyPaste.d.ts +34 -0
- package/dist/canvas/hooks/useTaskCopyPaste.d.ts.map +1 -0
- package/dist/canvas/hooks/useTaskCopyPaste.js +121 -0
- package/dist/canvas/schema/index.cjs +12 -3
- package/dist/canvas/schema/index.d.ts +1 -0
- package/dist/canvas/schema/index.d.ts.map +1 -1
- package/dist/canvas/schema/index.js +1 -0
- package/dist/canvas/schema/task-definition/index.cjs +60 -0
- package/dist/canvas/schema/task-definition/index.d.ts +2 -0
- package/dist/canvas/schema/task-definition/index.d.ts.map +1 -0
- package/dist/canvas/schema/task-definition/index.js +1 -0
- package/dist/canvas/schema/task-definition/task-manifest.cjs +78 -0
- package/dist/canvas/schema/task-definition/task-manifest.d.ts +43 -0
- package/dist/canvas/schema/task-definition/task-manifest.d.ts.map +1 -0
- package/dist/canvas/schema/task-definition/task-manifest.js +29 -0
- package/dist/material/components/ap-sankey-diagram/ApSankeyDiagram.cjs +44 -21
- package/dist/material/components/ap-sankey-diagram/ApSankeyDiagram.d.ts.map +1 -1
- package/dist/material/components/ap-sankey-diagram/ApSankeyDiagram.js +44 -21
- package/package.json +3 -3
- package/dist/canvas/components/StageNode/DraggableTask.cjs +0 -271
- package/dist/canvas/components/StageNode/DraggableTask.d.ts +0 -4
- package/dist/canvas/components/StageNode/DraggableTask.d.ts.map +0 -1
- package/dist/canvas/components/StageNode/DraggableTask.js +0 -234
- package/dist/canvas/components/StageNode/DraggableTask.types.d.ts +0 -20
- package/dist/canvas/components/StageNode/DraggableTask.types.d.ts.map +0 -1
- package/dist/canvas/components/StageNode/StageNode.utils.cjs +0 -164
- package/dist/canvas/components/StageNode/StageNode.utils.d.ts +0 -19
- package/dist/canvas/components/StageNode/StageNode.utils.d.ts.map +0 -1
- package/dist/canvas/components/StageNode/StageNode.utils.js +0 -121
- /package/dist/canvas/components/{StageNode/DraggableTask.types.cjs → TaskNode/TaskNode.types.cjs} +0 -0
- /package/dist/canvas/components/{StageNode/DraggableTask.types.js → TaskNode/TaskNode.types.js} +0 -0
|
@@ -0,0 +1,558 @@
|
|
|
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 ('undefined' != 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
|
+
WithExecutionStatus: ()=>WithExecutionStatus,
|
|
28
|
+
Basic: ()=>Basic,
|
|
29
|
+
default: ()=>TaskNode_stories,
|
|
30
|
+
ParallelTasks: ()=>ParallelTasks
|
|
31
|
+
});
|
|
32
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
33
|
+
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
34
|
+
const external_react_namespaceObject = require("react");
|
|
35
|
+
const CrossStageDragContext_cjs_namespaceObject = require("../../hooks/CrossStageDragContext.cjs");
|
|
36
|
+
const useCrossStageTaskDrag_cjs_namespaceObject = require("../../hooks/useCrossStageTaskDrag.cjs");
|
|
37
|
+
const useTaskCopyPaste_cjs_namespaceObject = require("../../hooks/useTaskCopyPaste.cjs");
|
|
38
|
+
const external_types_cjs_namespaceObject = require("../../types.cjs");
|
|
39
|
+
const index_cjs_namespaceObject = require("../BaseCanvas/index.cjs");
|
|
40
|
+
const external_CanvasPositionControls_cjs_namespaceObject = require("../CanvasPositionControls.cjs");
|
|
41
|
+
const StageConnectionEdge_cjs_namespaceObject = require("../StageNode/StageConnectionEdge.cjs");
|
|
42
|
+
const StageEdge_cjs_namespaceObject = require("../StageNode/StageEdge.cjs");
|
|
43
|
+
const StageNode_cjs_namespaceObject = require("../StageNode/StageNode.cjs");
|
|
44
|
+
const external_TaskIcon_index_cjs_namespaceObject = require("../TaskIcon/index.cjs");
|
|
45
|
+
const external_PlaceholderTaskNode_cjs_namespaceObject = require("./PlaceholderTaskNode.cjs");
|
|
46
|
+
const external_TaskNode_cjs_namespaceObject = require("./TaskNode.cjs");
|
|
47
|
+
const external_taskReorderUtils_cjs_namespaceObject = require("./taskReorderUtils.cjs");
|
|
48
|
+
const external_useTaskPositions_cjs_namespaceObject = require("./useTaskPositions.cjs");
|
|
49
|
+
const meta = {
|
|
50
|
+
title: 'Canvas/StageNode/TaskNode',
|
|
51
|
+
parameters: {
|
|
52
|
+
layout: 'fullscreen'
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const TaskNode_stories = meta;
|
|
56
|
+
const StageNodeWrapper = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(StageNode_cjs_namespaceObject.StageNode, {
|
|
57
|
+
...props,
|
|
58
|
+
...props.data
|
|
59
|
+
});
|
|
60
|
+
const TaskNodeWrapper = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskNode_cjs_namespaceObject.TaskNode, {
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
function createTaskNodes(stageId, taskIds, tasks, stageWidth, onTaskClick, onTaskSelect) {
|
|
64
|
+
const positions = (0, external_useTaskPositions_cjs_namespaceObject.calculateTaskPositions)(taskIds, stageWidth, tasks);
|
|
65
|
+
const nodes = [];
|
|
66
|
+
taskIds.forEach((group, groupIndex)=>{
|
|
67
|
+
group.forEach((taskId, taskIndex)=>{
|
|
68
|
+
const taskInfo = tasks[taskId];
|
|
69
|
+
if (!taskInfo) return;
|
|
70
|
+
const position = positions.get(taskId);
|
|
71
|
+
if (!position) return;
|
|
72
|
+
nodes.push({
|
|
73
|
+
id: taskId,
|
|
74
|
+
type: 'task',
|
|
75
|
+
parentId: stageId,
|
|
76
|
+
extent: 'parent',
|
|
77
|
+
position: {
|
|
78
|
+
x: position.x,
|
|
79
|
+
y: position.y
|
|
80
|
+
},
|
|
81
|
+
width: position.width,
|
|
82
|
+
data: {
|
|
83
|
+
taskType: taskInfo.taskType,
|
|
84
|
+
label: taskInfo.label,
|
|
85
|
+
iconElement: taskInfo.icon,
|
|
86
|
+
groupIndex,
|
|
87
|
+
taskIndex,
|
|
88
|
+
execution: taskInfo.execution,
|
|
89
|
+
onTaskClick,
|
|
90
|
+
onTaskSelect,
|
|
91
|
+
width: position.width
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
return nodes;
|
|
97
|
+
}
|
|
98
|
+
const InteractiveCanvas = ({ initialTaskIds, tasks: initialTasks, stageWidth, stageLabel, showInstructions = true })=>{
|
|
99
|
+
const [taskIds, setTaskIds] = (0, external_react_namespaceObject.useState)(initialTaskIds);
|
|
100
|
+
const [tasks, setTasks] = (0, external_react_namespaceObject.useState)(initialTasks);
|
|
101
|
+
const [selectedTaskId, setSelectedTaskId] = (0, external_react_namespaceObject.useState)(null);
|
|
102
|
+
const [actionLog, setActionLog] = (0, external_react_namespaceObject.useState)('');
|
|
103
|
+
const displayTaskIds = (0, external_react_namespaceObject.useMemo)(()=>taskIds, [
|
|
104
|
+
taskIds
|
|
105
|
+
]);
|
|
106
|
+
const stageNode = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
107
|
+
id: 'stage-1',
|
|
108
|
+
type: 'stage',
|
|
109
|
+
position: {
|
|
110
|
+
x: 250,
|
|
111
|
+
y: 100
|
|
112
|
+
},
|
|
113
|
+
style: {
|
|
114
|
+
width: stageWidth
|
|
115
|
+
},
|
|
116
|
+
data: {
|
|
117
|
+
nodeType: 'case-management:Stage',
|
|
118
|
+
stageDetails: {
|
|
119
|
+
label: stageLabel,
|
|
120
|
+
taskIds: displayTaskIds
|
|
121
|
+
},
|
|
122
|
+
onTaskClick: (taskId)=>{
|
|
123
|
+
setSelectedTaskId(taskId);
|
|
124
|
+
setActionLog(`Selected: ${taskId}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}), [
|
|
128
|
+
displayTaskIds,
|
|
129
|
+
stageLabel,
|
|
130
|
+
stageWidth
|
|
131
|
+
]);
|
|
132
|
+
const handleTaskClick = (0, external_react_namespaceObject.useCallback)((taskId)=>{
|
|
133
|
+
setSelectedTaskId(taskId);
|
|
134
|
+
setActionLog(`Selected: ${taskId}`);
|
|
135
|
+
}, []);
|
|
136
|
+
const taskNodes = (0, external_react_namespaceObject.useMemo)(()=>createTaskNodes('stage-1', displayTaskIds, tasks, stageWidth, handleTaskClick, setSelectedTaskId), [
|
|
137
|
+
displayTaskIds,
|
|
138
|
+
tasks,
|
|
139
|
+
stageWidth,
|
|
140
|
+
handleTaskClick
|
|
141
|
+
]);
|
|
142
|
+
const allNodes = (0, external_react_namespaceObject.useMemo)(()=>[
|
|
143
|
+
stageNode,
|
|
144
|
+
...taskNodes
|
|
145
|
+
], [
|
|
146
|
+
stageNode,
|
|
147
|
+
taskNodes
|
|
148
|
+
]);
|
|
149
|
+
const [nodes, setNodes, onNodesChange] = (0, react_cjs_namespaceObject.useNodesState)(allNodes);
|
|
150
|
+
const [edges, , onEdgesChange] = (0, react_cjs_namespaceObject.useEdgesState)([]);
|
|
151
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
152
|
+
setNodes(allNodes);
|
|
153
|
+
}, [
|
|
154
|
+
allNodes,
|
|
155
|
+
setNodes
|
|
156
|
+
]);
|
|
157
|
+
const nodeTypes = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
158
|
+
stage: StageNodeWrapper,
|
|
159
|
+
task: TaskNodeWrapper,
|
|
160
|
+
placeholder: (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_PlaceholderTaskNode_cjs_namespaceObject.PlaceholderTaskNode, {
|
|
161
|
+
...props
|
|
162
|
+
})
|
|
163
|
+
}), []);
|
|
164
|
+
const edgeTypes = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
165
|
+
stage: StageEdge_cjs_namespaceObject.StageEdge
|
|
166
|
+
}), []);
|
|
167
|
+
const handleTaskReorder = (0, external_react_namespaceObject.useCallback)((params)=>{
|
|
168
|
+
const { taskId, position } = params;
|
|
169
|
+
const depthLabel = position.isParallel ? 'parallel' : 'sequential';
|
|
170
|
+
setActionLog(`Reordered ${taskId} to group ${position.groupIndex} (${depthLabel})`);
|
|
171
|
+
setTaskIds((prev)=>{
|
|
172
|
+
const depth = position.isParallel ? 1 : 0;
|
|
173
|
+
return (0, external_taskReorderUtils_cjs_namespaceObject.reorderTaskIds)(prev, taskId, position.groupIndex, position.taskIndex, depth);
|
|
174
|
+
});
|
|
175
|
+
}, []);
|
|
176
|
+
const handleTaskPaste = (0, external_react_namespaceObject.useCallback)((params)=>{
|
|
177
|
+
const { newTaskId, originalData } = params;
|
|
178
|
+
setActionLog(`Pasted as ${newTaskId}`);
|
|
179
|
+
setTasks((prev)=>({
|
|
180
|
+
...prev,
|
|
181
|
+
[newTaskId]: {
|
|
182
|
+
label: `${originalData.label} (Copy)`,
|
|
183
|
+
taskType: originalData.taskType,
|
|
184
|
+
icon: originalData.iconElement ?? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskIcon_index_cjs_namespaceObject.TaskIcon, {
|
|
185
|
+
type: external_TaskIcon_index_cjs_namespaceObject.TaskItemTypeValues.AgenticProcess,
|
|
186
|
+
size: "sm"
|
|
187
|
+
}),
|
|
188
|
+
execution: originalData.execution
|
|
189
|
+
}
|
|
190
|
+
}));
|
|
191
|
+
setTaskIds((prev)=>[
|
|
192
|
+
...prev,
|
|
193
|
+
[
|
|
194
|
+
newTaskId
|
|
195
|
+
]
|
|
196
|
+
]);
|
|
197
|
+
}, []);
|
|
198
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.ReactFlowProvider, {
|
|
199
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InteractiveCanvasInner, {
|
|
200
|
+
nodes: nodes,
|
|
201
|
+
edges: edges,
|
|
202
|
+
onNodesChange: onNodesChange,
|
|
203
|
+
onEdgesChange: onEdgesChange,
|
|
204
|
+
nodeTypes: nodeTypes,
|
|
205
|
+
edgeTypes: edgeTypes,
|
|
206
|
+
onTaskReorder: handleTaskReorder,
|
|
207
|
+
onTaskPaste: handleTaskPaste,
|
|
208
|
+
selectedTaskId: selectedTaskId,
|
|
209
|
+
targetTaskIds: taskIds,
|
|
210
|
+
actionLog: actionLog,
|
|
211
|
+
showInstructions: showInstructions
|
|
212
|
+
})
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
const InteractiveCanvasInner = ({ nodes, edges, onNodesChange, onEdgesChange, nodeTypes, edgeTypes, onTaskReorder, onTaskPaste, selectedTaskId, targetTaskIds, actionLog, showInstructions })=>{
|
|
216
|
+
const { dragState, handlers } = (0, useCrossStageTaskDrag_cjs_namespaceObject.useCrossStageTaskDrag)({
|
|
217
|
+
onTaskReorder
|
|
218
|
+
});
|
|
219
|
+
(0, useTaskCopyPaste_cjs_namespaceObject.useTaskCopyPaste)({
|
|
220
|
+
onTaskPaste
|
|
221
|
+
}, {
|
|
222
|
+
selectedTaskId,
|
|
223
|
+
targetStageId: 'stage-1',
|
|
224
|
+
targetTaskIds,
|
|
225
|
+
enabled: true
|
|
226
|
+
});
|
|
227
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(CrossStageDragContext_cjs_namespaceObject.CrossStageDragProvider, {
|
|
228
|
+
value: {
|
|
229
|
+
dragState
|
|
230
|
+
},
|
|
231
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.BaseCanvas, {
|
|
232
|
+
nodes: nodes,
|
|
233
|
+
edges: edges,
|
|
234
|
+
onNodesChange: onNodesChange,
|
|
235
|
+
onEdgesChange: onEdgesChange,
|
|
236
|
+
nodeTypes: nodeTypes,
|
|
237
|
+
edgeTypes: edgeTypes,
|
|
238
|
+
mode: "design",
|
|
239
|
+
connectionMode: react_cjs_namespaceObject.ConnectionMode.Strict,
|
|
240
|
+
defaultEdgeOptions: {
|
|
241
|
+
type: 'stage'
|
|
242
|
+
},
|
|
243
|
+
connectionLineComponent: StageConnectionEdge_cjs_namespaceObject.StageConnectionEdge,
|
|
244
|
+
elevateEdgesOnSelect: true,
|
|
245
|
+
onNodeDragStart: handlers.onNodeDragStart,
|
|
246
|
+
onNodeDrag: handlers.onNodeDrag,
|
|
247
|
+
onNodeDragStop: handlers.onNodeDragStop,
|
|
248
|
+
fitView: true,
|
|
249
|
+
children: [
|
|
250
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.Panel, {
|
|
251
|
+
position: "bottom-right",
|
|
252
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasPositionControls_cjs_namespaceObject.CanvasPositionControls, {
|
|
253
|
+
translations: external_types_cjs_namespaceObject.DefaultCanvasTranslations
|
|
254
|
+
})
|
|
255
|
+
}),
|
|
256
|
+
showInstructions && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.Panel, {
|
|
257
|
+
position: "bottom-left",
|
|
258
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
259
|
+
style: {
|
|
260
|
+
background: 'var(--uix-palette-surface-paper)',
|
|
261
|
+
padding: '8px 16px',
|
|
262
|
+
borderRadius: '4px',
|
|
263
|
+
boxShadow: '0 2px 4px rgba(0,0,0,0.1)',
|
|
264
|
+
maxWidth: '300px'
|
|
265
|
+
},
|
|
266
|
+
children: [
|
|
267
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("strong", {
|
|
268
|
+
children: "Instructions:"
|
|
269
|
+
}),
|
|
270
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("ul", {
|
|
271
|
+
style: {
|
|
272
|
+
margin: '8px 0',
|
|
273
|
+
paddingLeft: '16px',
|
|
274
|
+
fontSize: '12px'
|
|
275
|
+
},
|
|
276
|
+
children: [
|
|
277
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("li", {
|
|
278
|
+
children: "Click a task to select it"
|
|
279
|
+
}),
|
|
280
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("li", {
|
|
281
|
+
children: "Drag tasks to reorder"
|
|
282
|
+
}),
|
|
283
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("li", {
|
|
284
|
+
children: "Ctrl/Cmd+C to copy selected task"
|
|
285
|
+
}),
|
|
286
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("li", {
|
|
287
|
+
children: "Ctrl/Cmd+V to paste task"
|
|
288
|
+
})
|
|
289
|
+
]
|
|
290
|
+
})
|
|
291
|
+
]
|
|
292
|
+
})
|
|
293
|
+
}),
|
|
294
|
+
actionLog && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.Panel, {
|
|
295
|
+
position: "top-left",
|
|
296
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
297
|
+
style: {
|
|
298
|
+
background: 'var(--uix-palette-surface-paper)',
|
|
299
|
+
padding: '8px 16px',
|
|
300
|
+
borderRadius: '4px',
|
|
301
|
+
boxShadow: '0 2px 4px rgba(0,0,0,0.1)'
|
|
302
|
+
},
|
|
303
|
+
children: actionLog
|
|
304
|
+
})
|
|
305
|
+
}),
|
|
306
|
+
dragState.isDragging && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.Panel, {
|
|
307
|
+
position: "top-right",
|
|
308
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
309
|
+
style: {
|
|
310
|
+
background: 'var(--uix-palette-info-light)',
|
|
311
|
+
padding: '8px 16px',
|
|
312
|
+
borderRadius: '4px'
|
|
313
|
+
},
|
|
314
|
+
children: [
|
|
315
|
+
"Dragging ",
|
|
316
|
+
dragState.taskId,
|
|
317
|
+
dragState.dropPosition && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
318
|
+
style: {
|
|
319
|
+
fontSize: '12px'
|
|
320
|
+
},
|
|
321
|
+
children: [
|
|
322
|
+
"→ Group ",
|
|
323
|
+
dragState.dropPosition.groupIndex,
|
|
324
|
+
dragState.dropPosition.isParallel ? ' (Parallel)' : ' (Sequential)',
|
|
325
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
326
|
+
style: {
|
|
327
|
+
fontSize: '10px',
|
|
328
|
+
marginTop: '4px'
|
|
329
|
+
},
|
|
330
|
+
children: "Drag right to make parallel"
|
|
331
|
+
})
|
|
332
|
+
]
|
|
333
|
+
})
|
|
334
|
+
]
|
|
335
|
+
})
|
|
336
|
+
})
|
|
337
|
+
]
|
|
338
|
+
})
|
|
339
|
+
});
|
|
340
|
+
};
|
|
341
|
+
const Basic = {
|
|
342
|
+
render: ()=>{
|
|
343
|
+
const tasks = {
|
|
344
|
+
'task-1': {
|
|
345
|
+
label: 'Process Document',
|
|
346
|
+
taskType: 'uipath.case-management.process',
|
|
347
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskIcon_index_cjs_namespaceObject.TaskIcon, {
|
|
348
|
+
type: external_TaskIcon_index_cjs_namespaceObject.TaskItemTypeValues.AgenticProcess,
|
|
349
|
+
size: "sm"
|
|
350
|
+
})
|
|
351
|
+
},
|
|
352
|
+
'task-2': {
|
|
353
|
+
label: 'Run Human Action',
|
|
354
|
+
taskType: 'uipath.case-management.run-human-action',
|
|
355
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskIcon_index_cjs_namespaceObject.TaskIcon, {
|
|
356
|
+
type: external_TaskIcon_index_cjs_namespaceObject.TaskItemTypeValues.User,
|
|
357
|
+
size: "sm"
|
|
358
|
+
})
|
|
359
|
+
},
|
|
360
|
+
'task-3': {
|
|
361
|
+
label: 'Execute RPA',
|
|
362
|
+
taskType: 'uipath.case-management.rpa',
|
|
363
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskIcon_index_cjs_namespaceObject.TaskIcon, {
|
|
364
|
+
type: external_TaskIcon_index_cjs_namespaceObject.TaskItemTypeValues.Automation,
|
|
365
|
+
size: "sm"
|
|
366
|
+
})
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
370
|
+
style: {
|
|
371
|
+
width: '100vw',
|
|
372
|
+
height: '100vh'
|
|
373
|
+
},
|
|
374
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InteractiveCanvas, {
|
|
375
|
+
initialTaskIds: [
|
|
376
|
+
[
|
|
377
|
+
'task-1'
|
|
378
|
+
],
|
|
379
|
+
[
|
|
380
|
+
'task-2'
|
|
381
|
+
],
|
|
382
|
+
[
|
|
383
|
+
'task-3'
|
|
384
|
+
]
|
|
385
|
+
],
|
|
386
|
+
tasks: tasks,
|
|
387
|
+
stageWidth: 304,
|
|
388
|
+
stageLabel: "Processing Stage"
|
|
389
|
+
})
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
const WithExecutionStatus = {
|
|
394
|
+
render: ()=>{
|
|
395
|
+
const tasks = {
|
|
396
|
+
'task-1': {
|
|
397
|
+
label: 'Completed Task',
|
|
398
|
+
taskType: 'uipath.case-management.process',
|
|
399
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskIcon_index_cjs_namespaceObject.TaskIcon, {
|
|
400
|
+
type: external_TaskIcon_index_cjs_namespaceObject.TaskItemTypeValues.AgenticProcess,
|
|
401
|
+
size: "sm"
|
|
402
|
+
}),
|
|
403
|
+
execution: {
|
|
404
|
+
status: 'Completed',
|
|
405
|
+
duration: '2m 30s'
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
'task-2': {
|
|
409
|
+
label: 'In Progress Task',
|
|
410
|
+
taskType: 'uipath.case-management.run-human-action',
|
|
411
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskIcon_index_cjs_namespaceObject.TaskIcon, {
|
|
412
|
+
type: external_TaskIcon_index_cjs_namespaceObject.TaskItemTypeValues.User,
|
|
413
|
+
size: "sm"
|
|
414
|
+
}),
|
|
415
|
+
execution: {
|
|
416
|
+
status: 'InProgress',
|
|
417
|
+
duration: '1m 15s'
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
'task-3': {
|
|
421
|
+
label: 'Failed Task with Retries',
|
|
422
|
+
taskType: 'uipath.case-management.rpa',
|
|
423
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskIcon_index_cjs_namespaceObject.TaskIcon, {
|
|
424
|
+
type: external_TaskIcon_index_cjs_namespaceObject.TaskItemTypeValues.Automation,
|
|
425
|
+
size: "sm"
|
|
426
|
+
}),
|
|
427
|
+
execution: {
|
|
428
|
+
status: 'Failed',
|
|
429
|
+
duration: '0m 45s',
|
|
430
|
+
retryDuration: '0m 30s',
|
|
431
|
+
message: 'Connection timeout',
|
|
432
|
+
badge: 'Error',
|
|
433
|
+
badgeStatus: 'error',
|
|
434
|
+
retryCount: 2
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
'task-4': {
|
|
438
|
+
label: 'Pending Task',
|
|
439
|
+
taskType: 'uipath.case-management.action',
|
|
440
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskIcon_index_cjs_namespaceObject.TaskIcon, {
|
|
441
|
+
type: external_TaskIcon_index_cjs_namespaceObject.TaskItemTypeValues.Agent,
|
|
442
|
+
size: "sm"
|
|
443
|
+
}),
|
|
444
|
+
execution: {
|
|
445
|
+
status: 'NotExecuted'
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
450
|
+
style: {
|
|
451
|
+
width: '100vw',
|
|
452
|
+
height: '100vh'
|
|
453
|
+
},
|
|
454
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InteractiveCanvas, {
|
|
455
|
+
initialTaskIds: [
|
|
456
|
+
[
|
|
457
|
+
'task-1'
|
|
458
|
+
],
|
|
459
|
+
[
|
|
460
|
+
'task-2'
|
|
461
|
+
],
|
|
462
|
+
[
|
|
463
|
+
'task-3'
|
|
464
|
+
],
|
|
465
|
+
[
|
|
466
|
+
'task-4'
|
|
467
|
+
]
|
|
468
|
+
],
|
|
469
|
+
tasks: tasks,
|
|
470
|
+
stageWidth: 304,
|
|
471
|
+
stageLabel: "Stage with Execution"
|
|
472
|
+
})
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
const ParallelTasks = {
|
|
477
|
+
render: ()=>{
|
|
478
|
+
const tasks = {
|
|
479
|
+
'task-1': {
|
|
480
|
+
label: 'Pre-check',
|
|
481
|
+
taskType: 'uipath.case-management.action',
|
|
482
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskIcon_index_cjs_namespaceObject.TaskIcon, {
|
|
483
|
+
type: external_TaskIcon_index_cjs_namespaceObject.TaskItemTypeValues.AgenticProcess,
|
|
484
|
+
size: "sm"
|
|
485
|
+
})
|
|
486
|
+
},
|
|
487
|
+
'task-2': {
|
|
488
|
+
label: 'Address Verification',
|
|
489
|
+
taskType: 'uipath.case-management.process',
|
|
490
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskIcon_index_cjs_namespaceObject.TaskIcon, {
|
|
491
|
+
type: external_TaskIcon_index_cjs_namespaceObject.TaskItemTypeValues.User,
|
|
492
|
+
size: "sm"
|
|
493
|
+
})
|
|
494
|
+
},
|
|
495
|
+
'task-3': {
|
|
496
|
+
label: 'Property Verification',
|
|
497
|
+
taskType: 'uipath.case-management.process',
|
|
498
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskIcon_index_cjs_namespaceObject.TaskIcon, {
|
|
499
|
+
type: external_TaskIcon_index_cjs_namespaceObject.TaskItemTypeValues.User,
|
|
500
|
+
size: "sm"
|
|
501
|
+
})
|
|
502
|
+
},
|
|
503
|
+
'task-4': {
|
|
504
|
+
label: 'Background Check',
|
|
505
|
+
taskType: 'uipath.case-management.process',
|
|
506
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskIcon_index_cjs_namespaceObject.TaskIcon, {
|
|
507
|
+
type: external_TaskIcon_index_cjs_namespaceObject.TaskItemTypeValues.Automation,
|
|
508
|
+
size: "sm"
|
|
509
|
+
})
|
|
510
|
+
},
|
|
511
|
+
'task-5': {
|
|
512
|
+
label: 'Final Review',
|
|
513
|
+
taskType: 'uipath.case-management.agent',
|
|
514
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskIcon_index_cjs_namespaceObject.TaskIcon, {
|
|
515
|
+
type: external_TaskIcon_index_cjs_namespaceObject.TaskItemTypeValues.Agent,
|
|
516
|
+
size: "sm"
|
|
517
|
+
})
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
521
|
+
style: {
|
|
522
|
+
width: '100vw',
|
|
523
|
+
height: '100vh'
|
|
524
|
+
},
|
|
525
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InteractiveCanvas, {
|
|
526
|
+
initialTaskIds: [
|
|
527
|
+
[
|
|
528
|
+
'task-1'
|
|
529
|
+
],
|
|
530
|
+
[
|
|
531
|
+
'task-2',
|
|
532
|
+
'task-3',
|
|
533
|
+
'task-4'
|
|
534
|
+
],
|
|
535
|
+
[
|
|
536
|
+
'task-5'
|
|
537
|
+
]
|
|
538
|
+
],
|
|
539
|
+
tasks: tasks,
|
|
540
|
+
stageWidth: 304,
|
|
541
|
+
stageLabel: "Parallel Task Demo"
|
|
542
|
+
})
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
exports.Basic = __webpack_exports__.Basic;
|
|
547
|
+
exports.ParallelTasks = __webpack_exports__.ParallelTasks;
|
|
548
|
+
exports.WithExecutionStatus = __webpack_exports__.WithExecutionStatus;
|
|
549
|
+
exports["default"] = __webpack_exports__["default"];
|
|
550
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
551
|
+
"Basic",
|
|
552
|
+
"ParallelTasks",
|
|
553
|
+
"WithExecutionStatus",
|
|
554
|
+
"default"
|
|
555
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
556
|
+
Object.defineProperty(exports, '__esModule', {
|
|
557
|
+
value: true
|
|
558
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj<typeof meta>;
|
|
5
|
+
export declare const Basic: Story;
|
|
6
|
+
export declare const WithExecutionStatus: Story;
|
|
7
|
+
export declare const ParallelTasks: Story;
|
|
8
|
+
//# sourceMappingURL=TaskNode.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/TaskNode/TaskNode.stories.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA2BvD,QAAA,MAAM,IAAI,EAAE,IAKX,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAuVnC,eAAO,MAAM,KAAK,EAAE,KA+BnB,CAAC;AAMF,eAAO,MAAM,mBAAmB,EAAE,KAwDjC,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,KAyC3B,CAAC"}
|