@uipath/apollo-react 4.10.0 → 4.12.0
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/AddNodePanel/AddNodePreview.cjs +12 -2
- package/dist/canvas/components/AddNodePanel/AddNodePreview.d.ts.map +1 -1
- package/dist/canvas/components/AddNodePanel/AddNodePreview.js +13 -3
- package/dist/canvas/components/BaseCanvas/CanvasThemeContext.cjs +4 -2
- package/dist/canvas/components/BaseCanvas/CanvasThemeContext.d.ts.map +1 -1
- package/dist/canvas/components/BaseCanvas/CanvasThemeContext.js +4 -2
- package/dist/canvas/components/BaseNode/BaseNode.cjs +7 -7
- package/dist/canvas/components/BaseNode/BaseNode.js +7 -7
- package/dist/canvas/components/BaseNode/BaseNodeContainer.cjs +1 -1
- package/dist/canvas/components/BaseNode/BaseNodeContainer.js +1 -1
- package/dist/canvas/components/ButtonHandle/CanvasInlineButton.cjs +56 -0
- package/dist/canvas/components/ButtonHandle/CanvasInlineButton.d.ts +8 -0
- package/dist/canvas/components/ButtonHandle/CanvasInlineButton.d.ts.map +1 -0
- package/dist/canvas/components/ButtonHandle/CanvasInlineButton.js +22 -0
- package/dist/canvas/components/ButtonHandle/HandleButton.cjs +3 -11
- package/dist/canvas/components/ButtonHandle/HandleButton.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/HandleButton.js +3 -11
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.cjs +16 -38
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.d.ts.map +1 -1
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.js +16 -28
- package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.cjs +1 -1
- package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.js +1 -1
- package/dist/canvas/components/StageNode/DraggableTask.cjs +3 -17
- package/dist/canvas/components/StageNode/DraggableTask.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/DraggableTask.js +3 -17
- package/dist/canvas/components/StageNode/EventDrivenTask.cjs +80 -0
- package/dist/canvas/components/StageNode/EventDrivenTask.d.ts +13 -0
- package/dist/canvas/components/StageNode/EventDrivenTask.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/EventDrivenTask.js +46 -0
- package/dist/canvas/components/StageNode/StageNode.cjs +29 -581
- package/dist/canvas/components/StageNode/StageNode.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.js +28 -580
- package/dist/canvas/components/StageNode/StageNode.styles.cjs +12 -12
- package/dist/canvas/components/StageNode/StageNode.styles.d.ts +3 -3
- package/dist/canvas/components/StageNode/StageNode.styles.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.styles.js +4 -4
- package/dist/canvas/components/StageNode/StageNode.types.d.ts +11 -0
- package/dist/canvas/components/StageNode/StageNode.types.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeAdhocTaskGroups.cjs +98 -0
- package/dist/canvas/components/StageNode/StageNodeAdhocTaskGroups.d.ts +13 -0
- package/dist/canvas/components/StageNode/StageNodeAdhocTaskGroups.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/StageNodeAdhocTaskGroups.js +64 -0
- package/dist/canvas/components/StageNode/StageNodeAllTaskGroups.cjs +129 -0
- package/dist/canvas/components/StageNode/StageNodeAllTaskGroups.d.ts +12 -0
- package/dist/canvas/components/StageNode/StageNodeAllTaskGroups.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/StageNodeAllTaskGroups.js +95 -0
- package/dist/canvas/components/StageNode/StageNodeEventDrivenTaskGroups.cjs +97 -0
- package/dist/canvas/components/StageNode/StageNodeEventDrivenTaskGroups.d.ts +13 -0
- package/dist/canvas/components/StageNode/StageNodeEventDrivenTaskGroups.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/StageNodeEventDrivenTaskGroups.js +63 -0
- package/dist/canvas/components/StageNode/StageNodeHandles.cjs +119 -0
- package/dist/canvas/components/StageNode/StageNodeHandles.d.ts +8 -0
- package/dist/canvas/components/StageNode/StageNodeHandles.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/StageNodeHandles.js +85 -0
- package/dist/canvas/components/StageNode/StageNodeHeader.cjs +245 -0
- package/dist/canvas/components/StageNode/StageNodeHeader.d.ts +9 -0
- package/dist/canvas/components/StageNode/StageNodeHeader.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/StageNodeHeader.js +211 -0
- package/dist/canvas/components/StageNode/StageNodeSequentialTaskGroups.cjs +176 -0
- package/dist/canvas/components/StageNode/StageNodeSequentialTaskGroups.d.ts +16 -0
- package/dist/canvas/components/StageNode/StageNodeSequentialTaskGroups.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/StageNodeSequentialTaskGroups.js +142 -0
- package/dist/canvas/components/StageNode/StageTaskEntryConditionIcon.cjs +57 -0
- package/dist/canvas/components/StageNode/StageTaskEntryConditionIcon.d.ts +5 -0
- package/dist/canvas/components/StageNode/StageTaskEntryConditionIcon.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/StageTaskEntryConditionIcon.js +23 -0
- package/dist/canvas/components/StageNode/hooks/useStageTaskDragHandler.cjs +117 -0
- package/dist/canvas/components/StageNode/hooks/useStageTaskDragHandler.d.ts +18 -0
- package/dist/canvas/components/StageNode/hooks/useStageTaskDragHandler.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/hooks/useStageTaskDragHandler.js +83 -0
- package/dist/canvas/components/StageNode/hooks/useStageTasksByGroups.cjs +87 -0
- package/dist/canvas/components/StageNode/hooks/useStageTasksByGroups.d.ts +22 -0
- package/dist/canvas/components/StageNode/hooks/useStageTasksByGroups.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/hooks/useStageTasksByGroups.js +53 -0
- package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.cjs +13 -17
- package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.js +14 -18
- package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.types.d.ts +1 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.types.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.cjs +149 -106
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.js +151 -108
- package/dist/canvas/components/Toolbar/NodeToolbar/useToolbarState.cjs +1 -1
- package/dist/canvas/components/Toolbar/NodeToolbar/useToolbarState.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/NodeToolbar/useToolbarState.js +1 -1
- package/dist/canvas/components/Toolbar/shared/ToolbarButton.cjs +7 -7
- package/dist/canvas/components/Toolbar/shared/ToolbarButton.js +7 -7
- package/dist/canvas/components/Toolbar/shared/ToolbarIconButton.cjs +64 -0
- package/dist/canvas/components/Toolbar/shared/ToolbarIconButton.d.ts +8 -0
- package/dist/canvas/components/Toolbar/shared/ToolbarIconButton.d.ts.map +1 -0
- package/dist/canvas/components/Toolbar/shared/ToolbarIconButton.js +30 -0
- package/dist/canvas/components/Toolbar/shared/index.cjs +4 -4
- package/dist/canvas/components/Toolbar/shared/index.d.ts +1 -1
- package/dist/canvas/components/Toolbar/shared/index.d.ts.map +1 -1
- package/dist/canvas/components/Toolbar/shared/index.js +1 -1
- package/dist/canvas/constants.cjs +1 -1
- package/dist/canvas/constants.d.ts +1 -1
- package/dist/canvas/constants.js +1 -1
- package/dist/canvas/storybook-utils/decorators.d.ts.map +1 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/canvas/styles/variables.css +16 -0
- package/package.json +2 -2
- package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.styles.cjs +0 -70
- package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.styles.d.ts +0 -8
- package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.styles.d.ts.map +0 -1
- package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.styles.js +0 -23
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.styles.cjs +0 -236
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.styles.d.ts +0 -26
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.styles.d.ts.map +0 -1
- package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.styles.js +0 -180
- package/dist/canvas/components/Toolbar/shared/ToolbarButton.styles.cjs +0 -78
- package/dist/canvas/components/Toolbar/shared/ToolbarButton.styles.d.ts +0 -9
- package/dist/canvas/components/Toolbar/shared/ToolbarButton.styles.d.ts.map +0 -1
- package/dist/canvas/components/Toolbar/shared/ToolbarButton.styles.js +0 -34
|
@@ -27,104 +27,33 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
StageNode: ()=>StageNode
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const core_namespaceObject = require("@dnd-kit/core");
|
|
31
|
-
const sortable_namespaceObject = require("@dnd-kit/sortable");
|
|
32
|
-
const apollo_core_namespaceObject = require("@uipath/apollo-core");
|
|
33
|
-
const index_cjs_namespaceObject = require("../../layouts/index.cjs");
|
|
34
|
-
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
|
|
35
|
-
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
36
30
|
const external_react_namespaceObject = require("react");
|
|
37
|
-
const
|
|
38
|
-
const GroupModificationUtils_cjs_namespaceObject = require("../../utils/GroupModificationUtils.cjs");
|
|
39
|
-
const icon_registry_cjs_namespaceObject = require("../../utils/icon-registry.cjs");
|
|
40
|
-
const ConnectedHandlesContext_cjs_namespaceObject = require("../BaseCanvas/ConnectedHandlesContext.cjs");
|
|
41
|
-
const useButtonHandles_cjs_namespaceObject = require("../ButtonHandle/useButtonHandles.cjs");
|
|
42
|
-
const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
|
|
43
|
-
const external_ExecutionStatusIcon_index_cjs_namespaceObject = require("../ExecutionStatusIcon/index.cjs");
|
|
44
|
-
const external_FloatingCanvasPanel_index_cjs_namespaceObject = require("../FloatingCanvasPanel/index.cjs");
|
|
31
|
+
const index_cjs_namespaceObject = require("../FloatingCanvasPanel/index.cjs");
|
|
45
32
|
const external_NodeContextMenu_index_cjs_namespaceObject = require("../NodeContextMenu/index.cjs");
|
|
46
33
|
const hooks_index_cjs_namespaceObject = require("../NodePropertiesPanel/hooks/index.cjs");
|
|
47
34
|
const external_Toolbox_index_cjs_namespaceObject = require("../Toolbox/index.cjs");
|
|
48
|
-
const external_AdhocTask_cjs_namespaceObject = require("./AdhocTask.cjs");
|
|
49
|
-
const external_DraggableTask_cjs_namespaceObject = require("./DraggableTask.cjs");
|
|
50
35
|
const external_StageNode_styles_cjs_namespaceObject = require("./StageNode.styles.cjs");
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const external_StageTaskDragOverlay_cjs_namespaceObject = require("./StageTaskDragOverlay.cjs");
|
|
55
|
-
const CHIP_ICONS = {
|
|
56
|
-
[external_StageNode_types_cjs_namespaceObject.StageHeaderChipType.Entry]: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icons_index_cjs_namespaceObject.EntryConditionIcon, {
|
|
57
|
-
w: apollo_core_namespaceObject.Icon.IconXs,
|
|
58
|
-
h: apollo_core_namespaceObject.Icon.IconXs
|
|
59
|
-
}),
|
|
60
|
-
[external_StageNode_types_cjs_namespaceObject.StageHeaderChipType.Exit]: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icons_index_cjs_namespaceObject.ExitConditionIcon, {
|
|
61
|
-
w: apollo_core_namespaceObject.Icon.IconXs,
|
|
62
|
-
h: apollo_core_namespaceObject.Icon.IconXs
|
|
63
|
-
}),
|
|
64
|
-
[external_StageNode_types_cjs_namespaceObject.StageHeaderChipType.ReturnToOrigin]: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icons_index_cjs_namespaceObject.ReturnToOriginIcon, {
|
|
65
|
-
w: apollo_core_namespaceObject.Icon.IconXs,
|
|
66
|
-
h: apollo_core_namespaceObject.Icon.IconXs
|
|
67
|
-
}),
|
|
68
|
-
[external_StageNode_types_cjs_namespaceObject.StageHeaderChipType.CaseExit]: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
|
|
69
|
-
icon: "x",
|
|
70
|
-
size: 16
|
|
71
|
-
}),
|
|
72
|
-
[external_StageNode_types_cjs_namespaceObject.StageHeaderChipType.CaseCompletion]: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
|
|
73
|
-
icon: "check",
|
|
74
|
-
size: 16
|
|
75
|
-
})
|
|
76
|
-
};
|
|
36
|
+
const external_StageNodeAllTaskGroups_cjs_namespaceObject = require("./StageNodeAllTaskGroups.cjs");
|
|
37
|
+
const external_StageNodeHandles_cjs_namespaceObject = require("./StageNodeHandles.cjs");
|
|
38
|
+
const external_StageNodeHeader_cjs_namespaceObject = require("./StageNodeHeader.cjs");
|
|
77
39
|
const StageNodeInner = (props)=>{
|
|
78
|
-
const { dragging, selected, id, width, execution, stageDetails, addTaskLabel = 'Add task', replaceTaskLabel = 'Replace task', taskOptions = [], menuItems, pendingReplaceTask, onStageClick, onTaskAdd, onAddTaskFromToolbox, onTaskToolboxSearch,
|
|
40
|
+
const { dragging, selected, id, width, execution, stageDetails, addTaskLabel = 'Add task', replaceTaskLabel = 'Replace task', taskOptions = [], menuItems, pendingReplaceTask, onStageClick, onTaskAdd, onAddTaskFromToolbox, onTaskToolboxSearch, onReplaceTaskFromToolbox } = props;
|
|
79
41
|
const taskWidth = width ? width - external_StageNode_styles_cjs_namespaceObject.STAGE_CONTENT_INSET : void 0;
|
|
80
42
|
const allTasks = (0, external_react_namespaceObject.useMemo)(()=>stageDetails?.tasks || [], [
|
|
81
43
|
stageDetails?.tasks
|
|
82
44
|
]);
|
|
83
|
-
const tasks = (0, external_react_namespaceObject.useMemo)(()=>allTasks.filter((group)=>group.some((t)=>!t.isAdhoc)), [
|
|
84
|
-
allTasks
|
|
85
|
-
]);
|
|
86
|
-
const adhocGroups = (0, external_react_namespaceObject.useMemo)(()=>allTasks.filter((group)=>group.every((t)=>t.isAdhoc)), [
|
|
87
|
-
allTasks
|
|
88
|
-
]);
|
|
89
|
-
const adhocTasks = (0, external_react_namespaceObject.useMemo)(()=>allTasks.flatMap((group, groupIndex)=>group.map((task, taskIndex)=>({
|
|
90
|
-
task,
|
|
91
|
-
groupIndex,
|
|
92
|
-
taskIndex
|
|
93
|
-
})).filter(({ task })=>task.isAdhoc)), [
|
|
94
|
-
allTasks
|
|
95
|
-
]);
|
|
96
|
-
const flatTasks = (0, external_react_namespaceObject.useMemo)(()=>tasks.flat(), [
|
|
97
|
-
tasks
|
|
98
|
-
]);
|
|
99
|
-
const taskIds = (0, external_react_namespaceObject.useMemo)(()=>flatTasks.map((task)=>task.id), [
|
|
100
|
-
flatTasks
|
|
101
|
-
]);
|
|
102
45
|
const isException = stageDetails?.isException;
|
|
103
46
|
const isReadOnly = !!stageDetails?.isReadOnly;
|
|
104
|
-
const icon = stageDetails?.icon;
|
|
105
47
|
const selectedTaskId = stageDetails?.selectedTaskId;
|
|
106
|
-
const defaultContent = stageDetails?.defaultContent || (isReadOnly ? 'No tasks' : 'Add first task');
|
|
107
48
|
const status = execution?.stageStatus?.status;
|
|
108
|
-
const statusLabel = execution?.stageStatus?.label;
|
|
109
|
-
const stageDuration = execution?.stageStatus?.duration;
|
|
110
|
-
const isStageTitleEditable = !!onStageTitleChange && !isReadOnly;
|
|
111
49
|
const [isHovered, setIsHovered] = (0, external_react_namespaceObject.useState)(false);
|
|
112
|
-
const
|
|
113
|
-
(0, external_react_namespaceObject.
|
|
114
|
-
setLabel(props.stageDetails.label);
|
|
115
|
-
}, [
|
|
116
|
-
props.stageDetails.label
|
|
117
|
-
]);
|
|
118
|
-
const [isStageTitleEditing, setIsStageTitleEditing] = (0, external_react_namespaceObject.useState)(false);
|
|
119
|
-
const stageTitleRef = (0, external_react_namespaceObject.useRef)(null);
|
|
50
|
+
const handleMouseEnter = (0, external_react_namespaceObject.useCallback)(()=>setIsHovered(true), []);
|
|
51
|
+
const handleMouseLeave = (0, external_react_namespaceObject.useCallback)(()=>setIsHovered(false), []);
|
|
120
52
|
const taskStateReference = (0, external_react_namespaceObject.useRef)({
|
|
121
53
|
isParallel: false,
|
|
122
54
|
groupIndex: -1,
|
|
123
55
|
taskIndex: -1
|
|
124
56
|
});
|
|
125
|
-
const isConnecting = (0, react_cjs_namespaceObject.useStore)((state)=>!!state.connectionClickStartHandle);
|
|
126
|
-
const storeApi = (0, react_cjs_namespaceObject.useStoreApi)();
|
|
127
|
-
const connectedHandleIds = (0, ConnectedHandlesContext_cjs_namespaceObject.useConnectedHandles)(id);
|
|
128
57
|
const [isAddingTask, setIsAddingTask] = (0, external_react_namespaceObject.useState)(false);
|
|
129
58
|
const [isReplacingTask, setIsReplacingTask] = (0, external_react_namespaceObject.useState)(false);
|
|
130
59
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
@@ -148,30 +77,6 @@ const StageNodeInner = (props)=>{
|
|
|
148
77
|
selectedTaskId,
|
|
149
78
|
allTasks
|
|
150
79
|
]);
|
|
151
|
-
const [activeDragId, setActiveDragId] = (0, external_react_namespaceObject.useState)(null);
|
|
152
|
-
const [offsetLeft, setOffsetLeft] = (0, external_react_namespaceObject.useState)(0);
|
|
153
|
-
const [overId, setOverId] = (0, external_react_namespaceObject.useState)(null);
|
|
154
|
-
const activeTask = (0, external_react_namespaceObject.useMemo)(()=>flatTasks.find((t)=>t.id === activeDragId), [
|
|
155
|
-
flatTasks,
|
|
156
|
-
activeDragId
|
|
157
|
-
]);
|
|
158
|
-
const isActiveTaskParallel = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
159
|
-
if (!activeDragId) return false;
|
|
160
|
-
const group = tasks.find((g)=>g.some((t)=>t.id === activeDragId));
|
|
161
|
-
return group ? group.length > 1 : false;
|
|
162
|
-
}, [
|
|
163
|
-
tasks,
|
|
164
|
-
activeDragId
|
|
165
|
-
]);
|
|
166
|
-
const projected = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
167
|
-
if (!activeDragId || !overId) return null;
|
|
168
|
-
return (0, external_StageNode_utils_cjs_namespaceObject.getProjection)(tasks, activeDragId, overId, offsetLeft);
|
|
169
|
-
}, [
|
|
170
|
-
tasks,
|
|
171
|
-
activeDragId,
|
|
172
|
-
overId,
|
|
173
|
-
offsetLeft
|
|
174
|
-
]);
|
|
175
80
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
176
81
|
if (false === selected) {
|
|
177
82
|
setIsAddingTask(false);
|
|
@@ -180,158 +85,18 @@ const StageNodeInner = (props)=>{
|
|
|
180
85
|
}, [
|
|
181
86
|
selected
|
|
182
87
|
]);
|
|
183
|
-
const hasConnections = connectedHandleIds.size > 0;
|
|
184
|
-
const shouldShowHandles = (0, external_react_namespaceObject.useMemo)(()=>!isReadOnly && (selected || isHovered || isConnecting || hasConnections), [
|
|
185
|
-
hasConnections,
|
|
186
|
-
isConnecting,
|
|
187
|
-
selected,
|
|
188
|
-
isHovered,
|
|
189
|
-
isReadOnly
|
|
190
|
-
]);
|
|
191
|
-
const handleMouseEnter = (0, external_react_namespaceObject.useCallback)(()=>setIsHovered(true), []);
|
|
192
|
-
const handleMouseLeave = (0, external_react_namespaceObject.useCallback)(()=>setIsHovered(false), []);
|
|
193
88
|
const shouldShowMenu = (0, external_react_namespaceObject.useMemo)(()=>menuItems && menuItems.length > 0 && (selected || isHovered) && !isReadOnly, [
|
|
194
89
|
menuItems,
|
|
195
90
|
selected,
|
|
196
91
|
isHovered,
|
|
197
92
|
isReadOnly
|
|
198
93
|
]);
|
|
199
|
-
const handleStageTitleChange = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
200
|
-
setIsStageTitleEditing(true);
|
|
201
|
-
setLabel(e.target.value);
|
|
202
|
-
}, []);
|
|
203
|
-
const handleStageTitleClickToSave = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
204
|
-
if (isStageTitleEditing && !stageTitleRef.current?.contains(e.target)) {
|
|
205
|
-
setIsStageTitleEditing(false);
|
|
206
|
-
if (onStageTitleChange) {
|
|
207
|
-
if ('' === label.trim()) setLabel('Untitled Stage');
|
|
208
|
-
onStageTitleChange(label);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}, [
|
|
212
|
-
isStageTitleEditing,
|
|
213
|
-
onStageTitleChange,
|
|
214
|
-
label
|
|
215
|
-
]);
|
|
216
|
-
const handleStageTitleBlurToSave = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
217
|
-
if (isStageTitleEditing) {
|
|
218
|
-
setIsStageTitleEditing(false);
|
|
219
|
-
if (onStageTitleChange) {
|
|
220
|
-
if ('' === label.trim()) setLabel('Untitled Stage');
|
|
221
|
-
onStageTitleChange(label);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}, [
|
|
225
|
-
isStageTitleEditing,
|
|
226
|
-
onStageTitleChange,
|
|
227
|
-
label
|
|
228
|
-
]);
|
|
229
|
-
const handleStageTitleKeyDown = (0, external_react_namespaceObject.useCallback)((e)=>{
|
|
230
|
-
if ('Enter' === e.key) {
|
|
231
|
-
setIsStageTitleEditing(false);
|
|
232
|
-
if (onStageTitleChange) onStageTitleChange(label);
|
|
233
|
-
}
|
|
234
|
-
if ('Escape' !== e.key) e.stopPropagation();
|
|
235
|
-
}, [
|
|
236
|
-
onStageTitleChange,
|
|
237
|
-
label
|
|
238
|
-
]);
|
|
239
|
-
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
240
|
-
if (isStageTitleEditing) document.addEventListener('click', handleStageTitleClickToSave);
|
|
241
|
-
return ()=>{
|
|
242
|
-
document.removeEventListener('click', handleStageTitleClickToSave);
|
|
243
|
-
};
|
|
244
|
-
}, [
|
|
245
|
-
handleStageTitleClickToSave,
|
|
246
|
-
isStageTitleEditing
|
|
247
|
-
]);
|
|
248
|
-
const hasContextMenu = !!(onReplaceTaskFromToolbox || onTaskGroupModification);
|
|
249
|
-
const handleTaskRegroup = (0, external_react_namespaceObject.useCallback)((groupModificationType, groupIndex, taskIndex)=>{
|
|
250
|
-
if (onTaskReorder && (groupModificationType === GroupModificationUtils_cjs_namespaceObject.GroupModificationType.TASK_GROUP_UP || groupModificationType === GroupModificationUtils_cjs_namespaceObject.GroupModificationType.TASK_GROUP_DOWN)) {
|
|
251
|
-
const mover = groupModificationType === GroupModificationUtils_cjs_namespaceObject.GroupModificationType.TASK_GROUP_UP ? GroupModificationUtils_cjs_namespaceObject.moveGroupUp : GroupModificationUtils_cjs_namespaceObject.moveGroupDown;
|
|
252
|
-
const reordered = mover(tasks, groupIndex, taskIndex);
|
|
253
|
-
onTaskReorder([
|
|
254
|
-
...reordered,
|
|
255
|
-
...adhocGroups
|
|
256
|
-
]);
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
onTaskGroupModification?.(groupModificationType, groupIndex, taskIndex);
|
|
260
|
-
}, [
|
|
261
|
-
onTaskReorder,
|
|
262
|
-
onTaskGroupModification,
|
|
263
|
-
tasks,
|
|
264
|
-
adhocGroups
|
|
265
|
-
]);
|
|
266
|
-
const buildContextMenuItems = (0, external_react_namespaceObject.useCallback)((groupIndex, taskIndex)=>{
|
|
267
|
-
const taskGroup = tasks[groupIndex] ?? [];
|
|
268
|
-
const isParallel = taskGroup.length > 1;
|
|
269
|
-
const items = [];
|
|
270
|
-
if (onReplaceTaskFromToolbox) {
|
|
271
|
-
items.push((0, external_StageNodeTaskUtilities_cjs_namespaceObject.getMenuItem)('replace-task', 'Replace task', ()=>{
|
|
272
|
-
taskStateReference.current = {
|
|
273
|
-
isParallel,
|
|
274
|
-
groupIndex,
|
|
275
|
-
taskIndex
|
|
276
|
-
};
|
|
277
|
-
const taskId = taskGroup[taskIndex]?.id;
|
|
278
|
-
if (taskId) onTaskClick?.(taskId);
|
|
279
|
-
setIsReplacingTask(true);
|
|
280
|
-
}));
|
|
281
|
-
items.push((0, external_StageNodeTaskUtilities_cjs_namespaceObject.getDivider)());
|
|
282
|
-
}
|
|
283
|
-
if (onTaskGroupModification) {
|
|
284
|
-
const reGroupOptions = (0, external_StageNodeTaskUtilities_cjs_namespaceObject.getContextMenuItems)(isParallel, groupIndex, tasks.length, taskIndex, taskGroup.length, (tasks[groupIndex - 1]?.length ?? 0) > 1, (tasks[groupIndex + 1]?.length ?? 0) > 1, handleTaskRegroup, hideParallelOptions);
|
|
285
|
-
return [
|
|
286
|
-
...items,
|
|
287
|
-
...reGroupOptions
|
|
288
|
-
];
|
|
289
|
-
}
|
|
290
|
-
return items;
|
|
291
|
-
}, [
|
|
292
|
-
onReplaceTaskFromToolbox,
|
|
293
|
-
onTaskClick,
|
|
294
|
-
onTaskGroupModification,
|
|
295
|
-
tasks,
|
|
296
|
-
hideParallelOptions,
|
|
297
|
-
handleTaskRegroup
|
|
298
|
-
]);
|
|
299
|
-
const getAdhocContextMenuItems = (0, external_react_namespaceObject.useCallback)((groupIndex, taskIndex, taskId)=>{
|
|
300
|
-
const items = [];
|
|
301
|
-
if (onReplaceTaskFromToolbox) items.push((0, external_StageNodeTaskUtilities_cjs_namespaceObject.getMenuItem)('replace-task', 'Replace task', ()=>{
|
|
302
|
-
taskStateReference.current = {
|
|
303
|
-
isParallel: false,
|
|
304
|
-
groupIndex,
|
|
305
|
-
taskIndex
|
|
306
|
-
};
|
|
307
|
-
onTaskClick?.(taskId);
|
|
308
|
-
setIsReplacingTask(true);
|
|
309
|
-
}));
|
|
310
|
-
if (onTaskGroupModification) {
|
|
311
|
-
if (items.length > 0) items.push((0, external_StageNodeTaskUtilities_cjs_namespaceObject.getDivider)());
|
|
312
|
-
items.push((0, external_StageNodeTaskUtilities_cjs_namespaceObject.getMenuItem)('remove-task', 'Delete task', ()=>onTaskGroupModification(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.REMOVE_TASK, groupIndex, taskIndex)));
|
|
313
|
-
}
|
|
314
|
-
return items;
|
|
315
|
-
}, [
|
|
316
|
-
onReplaceTaskFromToolbox,
|
|
317
|
-
onTaskClick,
|
|
318
|
-
onTaskGroupModification
|
|
319
|
-
]);
|
|
320
94
|
const { setSelectedNodeId } = (0, hooks_index_cjs_namespaceObject.useSetNodeSelection)();
|
|
321
95
|
const handleStageClick = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
322
96
|
onStageClick?.();
|
|
323
97
|
}, [
|
|
324
98
|
onStageClick
|
|
325
99
|
]);
|
|
326
|
-
const handleTaskClick = (0, external_react_namespaceObject.useCallback)((e, taskElementId)=>{
|
|
327
|
-
e.stopPropagation();
|
|
328
|
-
onTaskClick?.(taskElementId);
|
|
329
|
-
setSelectedNodeId(id);
|
|
330
|
-
}, [
|
|
331
|
-
onTaskClick,
|
|
332
|
-
setSelectedNodeId,
|
|
333
|
-
id
|
|
334
|
-
]);
|
|
335
100
|
const handleTaskAddClick = (0, external_react_namespaceObject.useCallback)((event)=>{
|
|
336
101
|
event.stopPropagation();
|
|
337
102
|
if (onTaskAdd) onTaskAdd();
|
|
@@ -358,124 +123,6 @@ const StageNodeInner = (props)=>{
|
|
|
358
123
|
}, [
|
|
359
124
|
onReplaceTaskFromToolbox
|
|
360
125
|
]);
|
|
361
|
-
const handleConfigurations = (0, external_react_namespaceObject.useMemo)(()=>isException ? [] : [
|
|
362
|
-
{
|
|
363
|
-
position: react_cjs_namespaceObject.Position.Left,
|
|
364
|
-
handles: [
|
|
365
|
-
{
|
|
366
|
-
id: `${id}____target____left`,
|
|
367
|
-
type: 'target',
|
|
368
|
-
handleType: 'input'
|
|
369
|
-
}
|
|
370
|
-
],
|
|
371
|
-
visible: selected || isHovered || isConnecting,
|
|
372
|
-
customPositionAndOffsets: {
|
|
373
|
-
top: 0,
|
|
374
|
-
height: 64
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
position: react_cjs_namespaceObject.Position.Right,
|
|
379
|
-
handles: [
|
|
380
|
-
{
|
|
381
|
-
id: `${id}____source____right`,
|
|
382
|
-
type: 'source',
|
|
383
|
-
handleType: 'output'
|
|
384
|
-
}
|
|
385
|
-
],
|
|
386
|
-
visible: selected || isHovered || isConnecting,
|
|
387
|
-
customPositionAndOffsets: {
|
|
388
|
-
top: 0,
|
|
389
|
-
height: 64
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
position: react_cjs_namespaceObject.Position.Bottom,
|
|
394
|
-
handles: [
|
|
395
|
-
{
|
|
396
|
-
id: `${id}____target____bottom`,
|
|
397
|
-
type: 'target',
|
|
398
|
-
handleType: 'input'
|
|
399
|
-
}
|
|
400
|
-
],
|
|
401
|
-
visible: selected || isHovered || isConnecting
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
position: react_cjs_namespaceObject.Position.Bottom,
|
|
405
|
-
handles: [
|
|
406
|
-
{
|
|
407
|
-
id: `${id}____source____bottom`,
|
|
408
|
-
type: 'source',
|
|
409
|
-
handleType: 'output'
|
|
410
|
-
}
|
|
411
|
-
],
|
|
412
|
-
visible: selected || isHovered || isConnecting
|
|
413
|
-
}
|
|
414
|
-
], [
|
|
415
|
-
isException,
|
|
416
|
-
id,
|
|
417
|
-
selected,
|
|
418
|
-
isHovered,
|
|
419
|
-
isConnecting
|
|
420
|
-
]);
|
|
421
|
-
const handleElements = (0, useButtonHandles_cjs_namespaceObject.useButtonHandles)({
|
|
422
|
-
handleConfigurations,
|
|
423
|
-
shouldShowHandles,
|
|
424
|
-
nodeId: id,
|
|
425
|
-
selected
|
|
426
|
-
});
|
|
427
|
-
const sensors = (0, core_namespaceObject.useSensors)((0, core_namespaceObject.useSensor)(core_namespaceObject.PointerSensor, {
|
|
428
|
-
activationConstraint: {
|
|
429
|
-
distance: 3
|
|
430
|
-
}
|
|
431
|
-
}), (0, core_namespaceObject.useSensor)(core_namespaceObject.KeyboardSensor, {
|
|
432
|
-
coordinateGetter: sortable_namespaceObject.sortableKeyboardCoordinates
|
|
433
|
-
}));
|
|
434
|
-
const resetState = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
435
|
-
setActiveDragId(null);
|
|
436
|
-
setOffsetLeft(0);
|
|
437
|
-
setOverId(null);
|
|
438
|
-
}, []);
|
|
439
|
-
const handleDragStart = (0, external_react_namespaceObject.useCallback)((event)=>{
|
|
440
|
-
setActiveDragId(event.active.id);
|
|
441
|
-
}, []);
|
|
442
|
-
const handleDragMove = (0, external_react_namespaceObject.useCallback)((event)=>{
|
|
443
|
-
setOffsetLeft(event.delta.x / storeApi.getState().transform[2]);
|
|
444
|
-
}, [
|
|
445
|
-
storeApi
|
|
446
|
-
]);
|
|
447
|
-
const handleDragOver = (0, external_react_namespaceObject.useCallback)((event)=>{
|
|
448
|
-
setOverId(event.over?.id ?? null);
|
|
449
|
-
}, []);
|
|
450
|
-
const handleDragEnd = (0, external_react_namespaceObject.useCallback)((event)=>{
|
|
451
|
-
const { active, over } = event;
|
|
452
|
-
const currentOffsetLeft = offsetLeft;
|
|
453
|
-
resetState();
|
|
454
|
-
if (!over || !onTaskReorder) return;
|
|
455
|
-
const projection = (0, external_StageNode_utils_cjs_namespaceObject.getProjection)(tasks, active.id, over.id, currentOffsetLeft);
|
|
456
|
-
if (!projection) return;
|
|
457
|
-
if (active.id === over.id) {
|
|
458
|
-
const flattened = (0, external_StageNode_utils_cjs_namespaceObject.flattenTasks)(tasks);
|
|
459
|
-
const activeTask = flattened.find((t)=>t.id === active.id);
|
|
460
|
-
if (activeTask && activeTask.depth === projection.depth) return;
|
|
461
|
-
}
|
|
462
|
-
const newTasks = (0, external_StageNode_utils_cjs_namespaceObject.reorderTasks)(tasks, active.id, over.id, projection.depth);
|
|
463
|
-
onTaskReorder([
|
|
464
|
-
...newTasks,
|
|
465
|
-
...adhocGroups
|
|
466
|
-
]);
|
|
467
|
-
}, [
|
|
468
|
-
tasks,
|
|
469
|
-
onTaskReorder,
|
|
470
|
-
offsetLeft,
|
|
471
|
-
resetState,
|
|
472
|
-
adhocGroups
|
|
473
|
-
]);
|
|
474
|
-
const handleDragCancel = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
475
|
-
resetState();
|
|
476
|
-
}, [
|
|
477
|
-
resetState
|
|
478
|
-
]);
|
|
479
126
|
const taskWidthStyle = (0, external_react_namespaceObject.useMemo)(()=>taskWidth ? {
|
|
480
127
|
'--stage-task-width': `${taskWidth}px`,
|
|
481
128
|
'--stage-task-width-parallel': `${taskWidth - external_StageNode_styles_cjs_namespaceObject.INDENTATION_WIDTH}px`
|
|
@@ -497,230 +144,25 @@ const StageNodeInner = (props)=>{
|
|
|
497
144
|
width: width,
|
|
498
145
|
style: taskWidthStyle,
|
|
499
146
|
children: [
|
|
500
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.
|
|
147
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNodeHeader_cjs_namespaceObject.StageNodeHeader, {
|
|
148
|
+
props: props,
|
|
149
|
+
isReadOnly: isReadOnly,
|
|
501
150
|
isException: isException,
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
|
|
505
|
-
gap: apollo_core_namespaceObject.Spacing.SpacingMicro,
|
|
506
|
-
align: "center",
|
|
507
|
-
flex: 1,
|
|
508
|
-
minW: 0,
|
|
509
|
-
children: [
|
|
510
|
-
icon,
|
|
511
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {
|
|
512
|
-
py: 2,
|
|
513
|
-
flex: 1,
|
|
514
|
-
minW: 0,
|
|
515
|
-
children: [
|
|
516
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
517
|
-
className: (0, apollo_wind_namespaceObject.cn)('text-sm', !isStageTitleEditing && 'font-bold'),
|
|
518
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
|
|
519
|
-
content: label,
|
|
520
|
-
placement: "top",
|
|
521
|
-
delay: true,
|
|
522
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTitleContainer, {
|
|
523
|
-
isEditing: isStageTitleEditing,
|
|
524
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTitleInput, {
|
|
525
|
-
name: "Stage Title",
|
|
526
|
-
isStageTitleEditable: isStageTitleEditable,
|
|
527
|
-
value: label,
|
|
528
|
-
ref: stageTitleRef,
|
|
529
|
-
isEditing: isStageTitleEditing,
|
|
530
|
-
...onStageTitleChange && {
|
|
531
|
-
onFocus: ()=>setIsStageTitleEditing(true),
|
|
532
|
-
onInput: handleStageTitleChange,
|
|
533
|
-
onKeyDown: handleStageTitleKeyDown,
|
|
534
|
-
onBlur: handleStageTitleBlurToSave
|
|
535
|
-
},
|
|
536
|
-
readOnly: !isStageTitleEditable
|
|
537
|
-
})
|
|
538
|
-
})
|
|
539
|
-
})
|
|
540
|
-
}),
|
|
541
|
-
stageDuration && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
542
|
-
className: "text-xs text-foreground-muted",
|
|
543
|
-
children: stageDuration
|
|
544
|
-
}),
|
|
545
|
-
stageDetails.headerChips && stageDetails.headerChips.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageHeaderChipsRow, {
|
|
546
|
-
children: stageDetails.headerChips.map((chip)=>{
|
|
547
|
-
const button = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StageNode_styles_cjs_namespaceObject.StageChip, {
|
|
548
|
-
type: "button",
|
|
549
|
-
"aria-label": 'string' == typeof chip.tooltip ? chip.tooltip : chip.type,
|
|
550
|
-
onClick: (e)=>{
|
|
551
|
-
e.stopPropagation();
|
|
552
|
-
chip.onClick?.();
|
|
553
|
-
},
|
|
554
|
-
children: [
|
|
555
|
-
CHIP_ICONS[chip.type],
|
|
556
|
-
void 0 !== chip.count && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
557
|
-
className: "text-xs",
|
|
558
|
-
children: chip.count
|
|
559
|
-
})
|
|
560
|
-
]
|
|
561
|
-
}, chip.type);
|
|
562
|
-
if (chip.tooltip) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
|
|
563
|
-
placement: "bottom",
|
|
564
|
-
content: chip.tooltip,
|
|
565
|
-
children: button
|
|
566
|
-
}, chip.type);
|
|
567
|
-
return button;
|
|
568
|
-
})
|
|
569
|
-
})
|
|
570
|
-
]
|
|
571
|
-
})
|
|
572
|
-
]
|
|
573
|
-
}),
|
|
574
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
|
|
575
|
-
gap: apollo_core_namespaceObject.Spacing.SpacingMicro,
|
|
576
|
-
align: "start",
|
|
577
|
-
py: apollo_core_namespaceObject.Padding.PadS,
|
|
578
|
-
children: [
|
|
579
|
-
status && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
|
|
580
|
-
content: statusLabel,
|
|
581
|
-
placement: "top",
|
|
582
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
583
|
-
variant: "ghost",
|
|
584
|
-
size: "icon",
|
|
585
|
-
className: "h-6 w-6",
|
|
586
|
-
"aria-label": statusLabel,
|
|
587
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ExecutionStatusIcon_index_cjs_namespaceObject.ExecutionStatusIcon, {
|
|
588
|
-
status: status,
|
|
589
|
-
size: 20
|
|
590
|
-
})
|
|
591
|
-
})
|
|
592
|
-
}),
|
|
593
|
-
(onTaskAdd || onAddTaskFromToolbox) && !isReadOnly && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
|
|
594
|
-
content: addTaskLabel,
|
|
595
|
-
placement: "top",
|
|
596
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
597
|
-
variant: "ghost",
|
|
598
|
-
size: "icon",
|
|
599
|
-
className: "h-6 w-6",
|
|
600
|
-
onClick: handleTaskAddClick,
|
|
601
|
-
"aria-label": addTaskLabel,
|
|
602
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
|
|
603
|
-
icon: "plus",
|
|
604
|
-
size: 20
|
|
605
|
-
})
|
|
606
|
-
})
|
|
607
|
-
})
|
|
608
|
-
]
|
|
609
|
-
})
|
|
610
|
-
]
|
|
151
|
+
status: status,
|
|
152
|
+
handleTaskAddClick: handleTaskAddClick
|
|
611
153
|
}),
|
|
612
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
},
|
|
621
|
-
children: defaultContent
|
|
622
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
623
|
-
className: "text-xs text-foreground-muted",
|
|
624
|
-
children: defaultContent
|
|
625
|
-
})
|
|
626
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
627
|
-
children: [
|
|
628
|
-
tasks.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.DndContext, {
|
|
629
|
-
collisionDetection: core_namespaceObject.closestCenter,
|
|
630
|
-
sensors: sensors,
|
|
631
|
-
onDragStart: handleDragStart,
|
|
632
|
-
onDragMove: handleDragMove,
|
|
633
|
-
onDragOver: handleDragOver,
|
|
634
|
-
onDragEnd: handleDragEnd,
|
|
635
|
-
onDragCancel: handleDragCancel,
|
|
636
|
-
children: [
|
|
637
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(sortable_namespaceObject.SortableContext, {
|
|
638
|
-
items: taskIds,
|
|
639
|
-
strategy: sortable_namespaceObject.verticalListSortingStrategy,
|
|
640
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskList, {
|
|
641
|
-
className: "nodrag nopan",
|
|
642
|
-
children: tasks.map((taskGroup, groupIndex)=>{
|
|
643
|
-
const isParallel = taskGroup.length > 1;
|
|
644
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
|
|
645
|
-
gap: apollo_core_namespaceObject.Spacing.SpacingS,
|
|
646
|
-
children: [
|
|
647
|
-
isParallel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageParallelBracket, {}),
|
|
648
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StageNode_styles_cjs_namespaceObject.StageTaskGroup, {
|
|
649
|
-
isParallel: isParallel,
|
|
650
|
-
children: [
|
|
651
|
-
isParallel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageParallelLabel, {
|
|
652
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
653
|
-
className: "text-xs",
|
|
654
|
-
children: "Parallel"
|
|
655
|
-
})
|
|
656
|
-
}),
|
|
657
|
-
taskGroup.map((task, taskIndex)=>{
|
|
658
|
-
const taskExecution = execution?.taskStatus?.[task.id];
|
|
659
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DraggableTask_cjs_namespaceObject.DraggableTask, {
|
|
660
|
-
task: task,
|
|
661
|
-
taskExecution: taskExecution,
|
|
662
|
-
isSelected: selectedTaskId === task.id,
|
|
663
|
-
isParallel: isParallel,
|
|
664
|
-
groupIndex: groupIndex,
|
|
665
|
-
taskIndex: taskIndex,
|
|
666
|
-
onTaskClick: handleTaskClick,
|
|
667
|
-
projectedDepth: task.id === activeDragId && projected ? projected.depth : void 0,
|
|
668
|
-
isDragDisabled: !onTaskReorder || isReadOnly,
|
|
669
|
-
isTaskLoading: loadingTaskIds?.has(task.id),
|
|
670
|
-
...hasContextMenu && !isReadOnly && {
|
|
671
|
-
getContextMenuItems: buildContextMenuItems
|
|
672
|
-
}
|
|
673
|
-
}, task.id);
|
|
674
|
-
})
|
|
675
|
-
]
|
|
676
|
-
})
|
|
677
|
-
]
|
|
678
|
-
}, `group-${groupIndex}`);
|
|
679
|
-
})
|
|
680
|
-
})
|
|
681
|
-
}),
|
|
682
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageTaskDragOverlay_cjs_namespaceObject.StageTaskDragOverlay, {
|
|
683
|
-
activeTask: activeTask,
|
|
684
|
-
isActiveTaskParallel: isActiveTaskParallel,
|
|
685
|
-
taskWidthStyle: taskWidthStyle
|
|
686
|
-
})
|
|
687
|
-
]
|
|
688
|
-
}),
|
|
689
|
-
adhocTasks.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StageNode_styles_cjs_namespaceObject.StageAdhocSection, {
|
|
690
|
-
style: {
|
|
691
|
-
marginTop: tasks.length > 0 ? apollo_core_namespaceObject.Spacing.SpacingS : '0px'
|
|
692
|
-
},
|
|
693
|
-
children: [
|
|
694
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageAdhocHeaderSection, {
|
|
695
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
696
|
-
className: "text-xs font-bold text-foreground-muted",
|
|
697
|
-
children: "Ad hoc tasks"
|
|
698
|
-
})
|
|
699
|
-
}),
|
|
700
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskList, {
|
|
701
|
-
children: adhocTasks.map(({ task, groupIndex, taskIndex })=>{
|
|
702
|
-
const taskExecution = execution?.taskStatus?.[task.id];
|
|
703
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_AdhocTask_cjs_namespaceObject.AdhocTaskItem, {
|
|
704
|
-
task: task,
|
|
705
|
-
taskExecution: taskExecution,
|
|
706
|
-
isSelected: selectedTaskId === task.id,
|
|
707
|
-
onTaskClick: handleTaskClick,
|
|
708
|
-
onTaskPlay: onTaskPlay,
|
|
709
|
-
isTaskLoading: loadingTaskIds?.has(task.id),
|
|
710
|
-
...(onTaskGroupModification || onReplaceTaskFromToolbox) && !isReadOnly && {
|
|
711
|
-
getContextMenuItems: ()=>getAdhocContextMenuItems(groupIndex, taskIndex, task.id)
|
|
712
|
-
}
|
|
713
|
-
}, task.id);
|
|
714
|
-
})
|
|
715
|
-
})
|
|
716
|
-
]
|
|
717
|
-
})
|
|
718
|
-
]
|
|
719
|
-
})
|
|
154
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNodeAllTaskGroups_cjs_namespaceObject.StageNodeAllTaskGroups, {
|
|
155
|
+
props: props,
|
|
156
|
+
isReadOnly: isReadOnly,
|
|
157
|
+
taskWidthStyle: taskWidthStyle,
|
|
158
|
+
taskStateReference: taskStateReference,
|
|
159
|
+
setSelectedNodeId: setSelectedNodeId,
|
|
160
|
+
handleTaskAddClick: handleTaskAddClick,
|
|
161
|
+
setIsReplacingTask: setIsReplacingTask
|
|
720
162
|
})
|
|
721
163
|
]
|
|
722
164
|
}),
|
|
723
|
-
onAddTaskFromToolbox && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
165
|
+
onAddTaskFromToolbox && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.FloatingCanvasPanel, {
|
|
724
166
|
open: isAddingTask,
|
|
725
167
|
nodeId: id,
|
|
726
168
|
offset: 15,
|
|
@@ -732,7 +174,7 @@ const StageNodeInner = (props)=>{
|
|
|
732
174
|
onSearch: onTaskToolboxSearch
|
|
733
175
|
})
|
|
734
176
|
}),
|
|
735
|
-
onReplaceTaskFromToolbox && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
177
|
+
onReplaceTaskFromToolbox && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.FloatingCanvasPanel, {
|
|
736
178
|
open: isReplacingTask,
|
|
737
179
|
nodeId: id,
|
|
738
180
|
offset: 15,
|
|
@@ -748,7 +190,13 @@ const StageNodeInner = (props)=>{
|
|
|
748
190
|
menuItems: menuItems,
|
|
749
191
|
isVisible: shouldShowMenu
|
|
750
192
|
}),
|
|
751
|
-
|
|
193
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNodeHandles_cjs_namespaceObject.StageNodeHandles, {
|
|
194
|
+
id: id,
|
|
195
|
+
isReadOnly: isReadOnly,
|
|
196
|
+
selected: selected,
|
|
197
|
+
isHovered: isHovered,
|
|
198
|
+
isException: isException
|
|
199
|
+
})
|
|
752
200
|
]
|
|
753
201
|
});
|
|
754
202
|
};
|