@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
|
@@ -1,271 +0,0 @@
|
|
|
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
|
-
TaskContent: ()=>TaskContent,
|
|
28
|
-
DraggableTask: ()=>DraggableTask
|
|
29
|
-
});
|
|
30
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
-
const sortable_namespaceObject = require("@dnd-kit/sortable");
|
|
32
|
-
const utilities_namespaceObject = require("@dnd-kit/utilities");
|
|
33
|
-
const apollo_core_namespaceObject = require("@uipath/apollo-core");
|
|
34
|
-
const index_cjs_namespaceObject = require("../../layouts/index.cjs");
|
|
35
|
-
const external_material_index_cjs_namespaceObject = require("../../../material/index.cjs");
|
|
36
|
-
const external_react_namespaceObject = require("react");
|
|
37
|
-
const external_ExecutionStatusIcon_index_cjs_namespaceObject = require("../ExecutionStatusIcon/index.cjs");
|
|
38
|
-
const external_StageNode_styles_cjs_namespaceObject = require("./StageNode.styles.cjs");
|
|
39
|
-
const external_TaskMenu_cjs_namespaceObject = require("./TaskMenu.cjs");
|
|
40
|
-
const ProcessNodeIcon = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("svg", {
|
|
41
|
-
viewBox: "0 0 24 24",
|
|
42
|
-
fill: "none",
|
|
43
|
-
stroke: "currentColor",
|
|
44
|
-
strokeWidth: "1.5",
|
|
45
|
-
children: [
|
|
46
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("rect", {
|
|
47
|
-
x: "3",
|
|
48
|
-
y: "3",
|
|
49
|
-
width: "7",
|
|
50
|
-
height: "7",
|
|
51
|
-
rx: "1"
|
|
52
|
-
}),
|
|
53
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("rect", {
|
|
54
|
-
x: "14",
|
|
55
|
-
y: "3",
|
|
56
|
-
width: "7",
|
|
57
|
-
height: "7",
|
|
58
|
-
rx: "1"
|
|
59
|
-
}),
|
|
60
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("rect", {
|
|
61
|
-
x: "3",
|
|
62
|
-
y: "14",
|
|
63
|
-
width: "7",
|
|
64
|
-
height: "7",
|
|
65
|
-
rx: "1"
|
|
66
|
-
}),
|
|
67
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("rect", {
|
|
68
|
-
x: "14",
|
|
69
|
-
y: "14",
|
|
70
|
-
width: "7",
|
|
71
|
-
height: "7",
|
|
72
|
-
rx: "1"
|
|
73
|
-
})
|
|
74
|
-
]
|
|
75
|
-
});
|
|
76
|
-
const generateBadgeText = (taskExecution)=>{
|
|
77
|
-
if (!taskExecution.badge) return;
|
|
78
|
-
if (taskExecution.retryCount && taskExecution.retryCount > 1) return `${taskExecution.badge} x${taskExecution.retryCount}`;
|
|
79
|
-
return taskExecution.badge;
|
|
80
|
-
};
|
|
81
|
-
const TaskContent = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ task, taskExecution, isDragging })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
|
|
82
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {
|
|
83
|
-
flex: 1,
|
|
84
|
-
style: {
|
|
85
|
-
overflow: 'hidden',
|
|
86
|
-
textOverflow: 'ellipsis',
|
|
87
|
-
whiteSpace: 'nowrap'
|
|
88
|
-
},
|
|
89
|
-
gap: apollo_core_namespaceObject.Padding.PadXs,
|
|
90
|
-
children: [
|
|
91
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
|
|
92
|
-
align: "center",
|
|
93
|
-
justify: "space-between",
|
|
94
|
-
children: [
|
|
95
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
|
|
96
|
-
gap: apollo_core_namespaceObject.Spacing.SpacingXs,
|
|
97
|
-
align: "center",
|
|
98
|
-
style: {
|
|
99
|
-
overflow: 'hidden',
|
|
100
|
-
textOverflow: 'ellipsis',
|
|
101
|
-
whiteSpace: 'nowrap'
|
|
102
|
-
},
|
|
103
|
-
children: [
|
|
104
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskIcon, {
|
|
105
|
-
children: task.icon ?? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ProcessNodeIcon, {})
|
|
106
|
-
}),
|
|
107
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTooltip, {
|
|
108
|
-
content: task.label,
|
|
109
|
-
placement: "top",
|
|
110
|
-
smartTooltip: true,
|
|
111
|
-
...isDragging && {
|
|
112
|
-
isOpen: false
|
|
113
|
-
},
|
|
114
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTypography, {
|
|
115
|
-
variant: apollo_core_namespaceObject.FontVariantToken.fontSizeM,
|
|
116
|
-
color: "var(--uix-canvas-foreground)",
|
|
117
|
-
style: {
|
|
118
|
-
overflow: 'hidden',
|
|
119
|
-
textOverflow: 'ellipsis',
|
|
120
|
-
whiteSpace: 'nowrap'
|
|
121
|
-
},
|
|
122
|
-
children: task.label
|
|
123
|
-
})
|
|
124
|
-
})
|
|
125
|
-
]
|
|
126
|
-
}),
|
|
127
|
-
taskExecution?.status && (taskExecution.message ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTooltip, {
|
|
128
|
-
content: taskExecution.message,
|
|
129
|
-
placement: "top",
|
|
130
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ExecutionStatusIcon_index_cjs_namespaceObject.ExecutionStatusIcon, {
|
|
131
|
-
status: taskExecution.status
|
|
132
|
-
})
|
|
133
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ExecutionStatusIcon_index_cjs_namespaceObject.ExecutionStatusIcon, {
|
|
134
|
-
status: taskExecution.status
|
|
135
|
-
}))
|
|
136
|
-
]
|
|
137
|
-
}),
|
|
138
|
-
taskExecution && (taskExecution.duration || taskExecution.retryDuration || taskExecution.badge) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
|
|
139
|
-
align: "center",
|
|
140
|
-
justify: "space-between",
|
|
141
|
-
children: [
|
|
142
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
|
|
143
|
-
gap: '2px',
|
|
144
|
-
children: [
|
|
145
|
-
taskExecution?.duration && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTypography, {
|
|
146
|
-
variant: apollo_core_namespaceObject.FontVariantToken.fontSizeS,
|
|
147
|
-
color: "var(--uix-canvas-foreground-de-emp)",
|
|
148
|
-
children: taskExecution.duration
|
|
149
|
-
}),
|
|
150
|
-
taskExecution?.retryDuration && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskRetryDuration, {
|
|
151
|
-
status: taskExecution.badgeStatus ?? 'warning',
|
|
152
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTypography, {
|
|
153
|
-
variant: apollo_core_namespaceObject.FontVariantToken.fontSizeS,
|
|
154
|
-
color: "inherit",
|
|
155
|
-
children: `(+${taskExecution.retryDuration})`
|
|
156
|
-
})
|
|
157
|
-
})
|
|
158
|
-
]
|
|
159
|
-
}),
|
|
160
|
-
taskExecution?.badge && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApBadge, {
|
|
161
|
-
size: external_material_index_cjs_namespaceObject.BadgeSize.SMALL,
|
|
162
|
-
status: taskExecution.badgeStatus,
|
|
163
|
-
label: generateBadgeText(taskExecution) ?? ''
|
|
164
|
-
})
|
|
165
|
-
]
|
|
166
|
-
})
|
|
167
|
-
]
|
|
168
|
-
})
|
|
169
|
-
}));
|
|
170
|
-
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, contextMenuItems, onTaskClick, onMenuOpen, isDragDisabled, projectedDepth, zoom = 1 })=>{
|
|
171
|
-
const [isMenuOpen, setIsMenuOpen] = (0, external_react_namespaceObject.useState)(false);
|
|
172
|
-
const taskRef = (0, external_react_namespaceObject.useRef)(null);
|
|
173
|
-
const menuRef = (0, external_react_namespaceObject.useRef)(null);
|
|
174
|
-
const handleClick = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
175
|
-
if (isMenuOpen) return;
|
|
176
|
-
onTaskClick(e, task.id);
|
|
177
|
-
}, [
|
|
178
|
-
isMenuOpen,
|
|
179
|
-
onTaskClick,
|
|
180
|
-
task.id
|
|
181
|
-
]);
|
|
182
|
-
const handleMenuOpenChange = (0, external_react_namespaceObject.useCallback)((isOpen)=>{
|
|
183
|
-
setIsMenuOpen(isOpen);
|
|
184
|
-
}, []);
|
|
185
|
-
const handleContextMenu = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
186
|
-
menuRef.current?.handleContextMenu(e);
|
|
187
|
-
}, []);
|
|
188
|
-
const { attributes, listeners, setNodeRef, transition, transform, isDragging } = (0, sortable_namespaceObject.useSortable)({
|
|
189
|
-
id: task.id,
|
|
190
|
-
disabled: isDragDisabled
|
|
191
|
-
});
|
|
192
|
-
const style = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
193
|
-
const scaledTransform = transform ? {
|
|
194
|
-
...transform,
|
|
195
|
-
x: transform.x / zoom,
|
|
196
|
-
y: transform.y / zoom
|
|
197
|
-
} : null;
|
|
198
|
-
let marginLeft;
|
|
199
|
-
if (isDragging && void 0 !== projectedDepth) if (1 !== projectedDepth || isParallel) {
|
|
200
|
-
if (0 === projectedDepth && isParallel) marginLeft = `-${external_StageNode_styles_cjs_namespaceObject.INDENTATION_WIDTH}px`;
|
|
201
|
-
} else marginLeft = `${external_StageNode_styles_cjs_namespaceObject.INDENTATION_WIDTH}px`;
|
|
202
|
-
return {
|
|
203
|
-
transition,
|
|
204
|
-
transform: utilities_namespaceObject.CSS.Transform.toString(scaledTransform),
|
|
205
|
-
marginLeft
|
|
206
|
-
};
|
|
207
|
-
}, [
|
|
208
|
-
transform,
|
|
209
|
-
zoom,
|
|
210
|
-
transition,
|
|
211
|
-
isDragging,
|
|
212
|
-
projectedDepth,
|
|
213
|
-
isParallel
|
|
214
|
-
]);
|
|
215
|
-
if (isDragging) {
|
|
216
|
-
const isTargetParallel = 1 === projectedDepth;
|
|
217
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskDragPlaceholderWrapper, {
|
|
218
|
-
ref: setNodeRef,
|
|
219
|
-
style: style,
|
|
220
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskDragPlaceholder, {
|
|
221
|
-
isTargetParallel: isTargetParallel
|
|
222
|
-
})
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
const taskElement = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StageNode_styles_cjs_namespaceObject.StageTask, {
|
|
226
|
-
ref: taskRef,
|
|
227
|
-
"data-testid": `stage-task-${task.id}`,
|
|
228
|
-
selected: isSelected,
|
|
229
|
-
status: taskExecution?.status,
|
|
230
|
-
isParallel: isParallel,
|
|
231
|
-
isDragEnabled: !isDragDisabled,
|
|
232
|
-
isMenuOpen: isMenuOpen,
|
|
233
|
-
onClick: handleClick,
|
|
234
|
-
...contextMenuItems.length > 0 && {
|
|
235
|
-
onContextMenu: handleContextMenu
|
|
236
|
-
},
|
|
237
|
-
children: [
|
|
238
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TaskContent, {
|
|
239
|
-
task: task,
|
|
240
|
-
taskExecution: taskExecution
|
|
241
|
-
}),
|
|
242
|
-
contextMenuItems.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_TaskMenu_cjs_namespaceObject.TaskMenu, {
|
|
243
|
-
ref: menuRef,
|
|
244
|
-
taskId: task.id,
|
|
245
|
-
contextMenuItems: contextMenuItems,
|
|
246
|
-
onMenuOpenChange: handleMenuOpenChange,
|
|
247
|
-
onMenuOpen: onMenuOpen,
|
|
248
|
-
taskRef: taskRef
|
|
249
|
-
})
|
|
250
|
-
]
|
|
251
|
-
});
|
|
252
|
-
if (isDragDisabled) return taskElement;
|
|
253
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskWrapper, {
|
|
254
|
-
ref: setNodeRef,
|
|
255
|
-
style: style,
|
|
256
|
-
isParallel: isParallel,
|
|
257
|
-
...attributes,
|
|
258
|
-
...listeners,
|
|
259
|
-
children: taskElement
|
|
260
|
-
});
|
|
261
|
-
};
|
|
262
|
-
const DraggableTask = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(DraggableTaskComponent);
|
|
263
|
-
exports.DraggableTask = __webpack_exports__.DraggableTask;
|
|
264
|
-
exports.TaskContent = __webpack_exports__.TaskContent;
|
|
265
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
266
|
-
"DraggableTask",
|
|
267
|
-
"TaskContent"
|
|
268
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
269
|
-
Object.defineProperty(exports, '__esModule', {
|
|
270
|
-
value: true
|
|
271
|
-
});
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DraggableTaskProps, TaskContentProps } from './DraggableTask.types';
|
|
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, contextMenuItems, onTaskClick, onMenuOpen, isDragDisabled, projectedDepth, zoom, }: DraggableTaskProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
|
-
//# sourceMappingURL=DraggableTask.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DraggableTask.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/DraggableTask.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAgClF,eAAO,MAAM,WAAW,4EAA8C,gBAAgB,6CAsEpF,CAAC;AAqHH,eAAO,MAAM,aAAa,0KAxGvB,kBAAkB,6CAwGoC,CAAC"}
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useSortable } from "@dnd-kit/sortable";
|
|
3
|
-
import { CSS } from "@dnd-kit/utilities";
|
|
4
|
-
import { FontVariantToken, Padding, Spacing } from "@uipath/apollo-core";
|
|
5
|
-
import { Column, Row } from "../../layouts/index.js";
|
|
6
|
-
import { ApBadge, ApTooltip, ApTypography, BadgeSize } from "../../../material/index.js";
|
|
7
|
-
import { memo, useCallback, useMemo, useRef, useState } from "react";
|
|
8
|
-
import { ExecutionStatusIcon } from "../ExecutionStatusIcon/index.js";
|
|
9
|
-
import { INDENTATION_WIDTH, StageTask, StageTaskDragPlaceholder, StageTaskDragPlaceholderWrapper, StageTaskIcon, StageTaskRetryDuration, StageTaskWrapper } from "./StageNode.styles.js";
|
|
10
|
-
import { TaskMenu } from "./TaskMenu.js";
|
|
11
|
-
const ProcessNodeIcon = ()=>/*#__PURE__*/ jsxs("svg", {
|
|
12
|
-
viewBox: "0 0 24 24",
|
|
13
|
-
fill: "none",
|
|
14
|
-
stroke: "currentColor",
|
|
15
|
-
strokeWidth: "1.5",
|
|
16
|
-
children: [
|
|
17
|
-
/*#__PURE__*/ jsx("rect", {
|
|
18
|
-
x: "3",
|
|
19
|
-
y: "3",
|
|
20
|
-
width: "7",
|
|
21
|
-
height: "7",
|
|
22
|
-
rx: "1"
|
|
23
|
-
}),
|
|
24
|
-
/*#__PURE__*/ jsx("rect", {
|
|
25
|
-
x: "14",
|
|
26
|
-
y: "3",
|
|
27
|
-
width: "7",
|
|
28
|
-
height: "7",
|
|
29
|
-
rx: "1"
|
|
30
|
-
}),
|
|
31
|
-
/*#__PURE__*/ jsx("rect", {
|
|
32
|
-
x: "3",
|
|
33
|
-
y: "14",
|
|
34
|
-
width: "7",
|
|
35
|
-
height: "7",
|
|
36
|
-
rx: "1"
|
|
37
|
-
}),
|
|
38
|
-
/*#__PURE__*/ jsx("rect", {
|
|
39
|
-
x: "14",
|
|
40
|
-
y: "14",
|
|
41
|
-
width: "7",
|
|
42
|
-
height: "7",
|
|
43
|
-
rx: "1"
|
|
44
|
-
})
|
|
45
|
-
]
|
|
46
|
-
});
|
|
47
|
-
const generateBadgeText = (taskExecution)=>{
|
|
48
|
-
if (!taskExecution.badge) return;
|
|
49
|
-
if (taskExecution.retryCount && taskExecution.retryCount > 1) return `${taskExecution.badge} x${taskExecution.retryCount}`;
|
|
50
|
-
return taskExecution.badge;
|
|
51
|
-
};
|
|
52
|
-
const TaskContent = /*#__PURE__*/ memo(({ task, taskExecution, isDragging })=>/*#__PURE__*/ jsx(Fragment, {
|
|
53
|
-
children: /*#__PURE__*/ jsxs(Column, {
|
|
54
|
-
flex: 1,
|
|
55
|
-
style: {
|
|
56
|
-
overflow: 'hidden',
|
|
57
|
-
textOverflow: 'ellipsis',
|
|
58
|
-
whiteSpace: 'nowrap'
|
|
59
|
-
},
|
|
60
|
-
gap: Padding.PadXs,
|
|
61
|
-
children: [
|
|
62
|
-
/*#__PURE__*/ jsxs(Row, {
|
|
63
|
-
align: "center",
|
|
64
|
-
justify: "space-between",
|
|
65
|
-
children: [
|
|
66
|
-
/*#__PURE__*/ jsxs(Row, {
|
|
67
|
-
gap: Spacing.SpacingXs,
|
|
68
|
-
align: "center",
|
|
69
|
-
style: {
|
|
70
|
-
overflow: 'hidden',
|
|
71
|
-
textOverflow: 'ellipsis',
|
|
72
|
-
whiteSpace: 'nowrap'
|
|
73
|
-
},
|
|
74
|
-
children: [
|
|
75
|
-
/*#__PURE__*/ jsx(StageTaskIcon, {
|
|
76
|
-
children: task.icon ?? /*#__PURE__*/ jsx(ProcessNodeIcon, {})
|
|
77
|
-
}),
|
|
78
|
-
/*#__PURE__*/ jsx(ApTooltip, {
|
|
79
|
-
content: task.label,
|
|
80
|
-
placement: "top",
|
|
81
|
-
smartTooltip: true,
|
|
82
|
-
...isDragging && {
|
|
83
|
-
isOpen: false
|
|
84
|
-
},
|
|
85
|
-
children: /*#__PURE__*/ jsx(ApTypography, {
|
|
86
|
-
variant: FontVariantToken.fontSizeM,
|
|
87
|
-
color: "var(--uix-canvas-foreground)",
|
|
88
|
-
style: {
|
|
89
|
-
overflow: 'hidden',
|
|
90
|
-
textOverflow: 'ellipsis',
|
|
91
|
-
whiteSpace: 'nowrap'
|
|
92
|
-
},
|
|
93
|
-
children: task.label
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
]
|
|
97
|
-
}),
|
|
98
|
-
taskExecution?.status && (taskExecution.message ? /*#__PURE__*/ jsx(ApTooltip, {
|
|
99
|
-
content: taskExecution.message,
|
|
100
|
-
placement: "top",
|
|
101
|
-
children: /*#__PURE__*/ jsx(ExecutionStatusIcon, {
|
|
102
|
-
status: taskExecution.status
|
|
103
|
-
})
|
|
104
|
-
}) : /*#__PURE__*/ jsx(ExecutionStatusIcon, {
|
|
105
|
-
status: taskExecution.status
|
|
106
|
-
}))
|
|
107
|
-
]
|
|
108
|
-
}),
|
|
109
|
-
taskExecution && (taskExecution.duration || taskExecution.retryDuration || taskExecution.badge) && /*#__PURE__*/ jsxs(Row, {
|
|
110
|
-
align: "center",
|
|
111
|
-
justify: "space-between",
|
|
112
|
-
children: [
|
|
113
|
-
/*#__PURE__*/ jsxs(Row, {
|
|
114
|
-
gap: '2px',
|
|
115
|
-
children: [
|
|
116
|
-
taskExecution?.duration && /*#__PURE__*/ jsx(ApTypography, {
|
|
117
|
-
variant: FontVariantToken.fontSizeS,
|
|
118
|
-
color: "var(--uix-canvas-foreground-de-emp)",
|
|
119
|
-
children: taskExecution.duration
|
|
120
|
-
}),
|
|
121
|
-
taskExecution?.retryDuration && /*#__PURE__*/ jsx(StageTaskRetryDuration, {
|
|
122
|
-
status: taskExecution.badgeStatus ?? 'warning',
|
|
123
|
-
children: /*#__PURE__*/ jsx(ApTypography, {
|
|
124
|
-
variant: FontVariantToken.fontSizeS,
|
|
125
|
-
color: "inherit",
|
|
126
|
-
children: `(+${taskExecution.retryDuration})`
|
|
127
|
-
})
|
|
128
|
-
})
|
|
129
|
-
]
|
|
130
|
-
}),
|
|
131
|
-
taskExecution?.badge && /*#__PURE__*/ jsx(ApBadge, {
|
|
132
|
-
size: BadgeSize.SMALL,
|
|
133
|
-
status: taskExecution.badgeStatus,
|
|
134
|
-
label: generateBadgeText(taskExecution) ?? ''
|
|
135
|
-
})
|
|
136
|
-
]
|
|
137
|
-
})
|
|
138
|
-
]
|
|
139
|
-
})
|
|
140
|
-
}));
|
|
141
|
-
const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, contextMenuItems, onTaskClick, onMenuOpen, isDragDisabled, projectedDepth, zoom = 1 })=>{
|
|
142
|
-
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
143
|
-
const taskRef = useRef(null);
|
|
144
|
-
const menuRef = useRef(null);
|
|
145
|
-
const handleClick = useCallback((e)=>{
|
|
146
|
-
if (isMenuOpen) return;
|
|
147
|
-
onTaskClick(e, task.id);
|
|
148
|
-
}, [
|
|
149
|
-
isMenuOpen,
|
|
150
|
-
onTaskClick,
|
|
151
|
-
task.id
|
|
152
|
-
]);
|
|
153
|
-
const handleMenuOpenChange = useCallback((isOpen)=>{
|
|
154
|
-
setIsMenuOpen(isOpen);
|
|
155
|
-
}, []);
|
|
156
|
-
const handleContextMenu = useCallback((e)=>{
|
|
157
|
-
menuRef.current?.handleContextMenu(e);
|
|
158
|
-
}, []);
|
|
159
|
-
const { attributes, listeners, setNodeRef, transition, transform, isDragging } = useSortable({
|
|
160
|
-
id: task.id,
|
|
161
|
-
disabled: isDragDisabled
|
|
162
|
-
});
|
|
163
|
-
const style = useMemo(()=>{
|
|
164
|
-
const scaledTransform = transform ? {
|
|
165
|
-
...transform,
|
|
166
|
-
x: transform.x / zoom,
|
|
167
|
-
y: transform.y / zoom
|
|
168
|
-
} : null;
|
|
169
|
-
let marginLeft;
|
|
170
|
-
if (isDragging && void 0 !== projectedDepth) if (1 !== projectedDepth || isParallel) {
|
|
171
|
-
if (0 === projectedDepth && isParallel) marginLeft = `-${INDENTATION_WIDTH}px`;
|
|
172
|
-
} else marginLeft = `${INDENTATION_WIDTH}px`;
|
|
173
|
-
return {
|
|
174
|
-
transition,
|
|
175
|
-
transform: CSS.Transform.toString(scaledTransform),
|
|
176
|
-
marginLeft
|
|
177
|
-
};
|
|
178
|
-
}, [
|
|
179
|
-
transform,
|
|
180
|
-
zoom,
|
|
181
|
-
transition,
|
|
182
|
-
isDragging,
|
|
183
|
-
projectedDepth,
|
|
184
|
-
isParallel
|
|
185
|
-
]);
|
|
186
|
-
if (isDragging) {
|
|
187
|
-
const isTargetParallel = 1 === projectedDepth;
|
|
188
|
-
return /*#__PURE__*/ jsx(StageTaskDragPlaceholderWrapper, {
|
|
189
|
-
ref: setNodeRef,
|
|
190
|
-
style: style,
|
|
191
|
-
children: /*#__PURE__*/ jsx(StageTaskDragPlaceholder, {
|
|
192
|
-
isTargetParallel: isTargetParallel
|
|
193
|
-
})
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
const taskElement = /*#__PURE__*/ jsxs(StageTask, {
|
|
197
|
-
ref: taskRef,
|
|
198
|
-
"data-testid": `stage-task-${task.id}`,
|
|
199
|
-
selected: isSelected,
|
|
200
|
-
status: taskExecution?.status,
|
|
201
|
-
isParallel: isParallel,
|
|
202
|
-
isDragEnabled: !isDragDisabled,
|
|
203
|
-
isMenuOpen: isMenuOpen,
|
|
204
|
-
onClick: handleClick,
|
|
205
|
-
...contextMenuItems.length > 0 && {
|
|
206
|
-
onContextMenu: handleContextMenu
|
|
207
|
-
},
|
|
208
|
-
children: [
|
|
209
|
-
/*#__PURE__*/ jsx(TaskContent, {
|
|
210
|
-
task: task,
|
|
211
|
-
taskExecution: taskExecution
|
|
212
|
-
}),
|
|
213
|
-
contextMenuItems.length > 0 && /*#__PURE__*/ jsx(TaskMenu, {
|
|
214
|
-
ref: menuRef,
|
|
215
|
-
taskId: task.id,
|
|
216
|
-
contextMenuItems: contextMenuItems,
|
|
217
|
-
onMenuOpenChange: handleMenuOpenChange,
|
|
218
|
-
onMenuOpen: onMenuOpen,
|
|
219
|
-
taskRef: taskRef
|
|
220
|
-
})
|
|
221
|
-
]
|
|
222
|
-
});
|
|
223
|
-
if (isDragDisabled) return taskElement;
|
|
224
|
-
return /*#__PURE__*/ jsx(StageTaskWrapper, {
|
|
225
|
-
ref: setNodeRef,
|
|
226
|
-
style: style,
|
|
227
|
-
isParallel: isParallel,
|
|
228
|
-
...attributes,
|
|
229
|
-
...listeners,
|
|
230
|
-
children: taskElement
|
|
231
|
-
});
|
|
232
|
-
};
|
|
233
|
-
const DraggableTask = /*#__PURE__*/ memo(DraggableTaskComponent);
|
|
234
|
-
export { DraggableTask, TaskContent };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { NodeMenuItem } from '../NodeContextMenu';
|
|
2
|
-
import type { StageTaskExecution, StageTaskItem } from './StageNode.types';
|
|
3
|
-
export interface TaskContentProps {
|
|
4
|
-
task: StageTaskItem;
|
|
5
|
-
taskExecution?: StageTaskExecution;
|
|
6
|
-
isDragging?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface DraggableTaskProps {
|
|
9
|
-
task: StageTaskItem;
|
|
10
|
-
taskExecution?: StageTaskExecution;
|
|
11
|
-
isSelected: boolean;
|
|
12
|
-
isParallel: boolean;
|
|
13
|
-
contextMenuItems: NodeMenuItem[];
|
|
14
|
-
onTaskClick: (e: React.MouseEvent, taskId: string) => void;
|
|
15
|
-
onMenuOpen?: () => void;
|
|
16
|
-
isDragDisabled?: boolean;
|
|
17
|
-
projectedDepth?: number;
|
|
18
|
-
zoom?: number;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=DraggableTask.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,gBAAgB,EAAE,YAAY,EAAE,CAAC;IACjC,WAAW,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|