@uipath/apollo-react 3.65.3 → 3.66.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.
@@ -1,14 +1,5 @@
1
1
  "use strict";
2
2
  var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.n = (module)=>{
5
- var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
- __webpack_require__.d(getter, {
7
- a: getter
8
- });
9
- return getter;
10
- };
11
- })();
12
3
  (()=>{
13
4
  __webpack_require__.d = (exports1, definition)=>{
14
5
  for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
@@ -42,8 +33,6 @@ const utilities_namespaceObject = require("@dnd-kit/utilities");
42
33
  const apollo_core_namespaceObject = require("@uipath/apollo-core");
43
34
  const index_cjs_namespaceObject = require("../../layouts/index.cjs");
44
35
  const external_material_index_cjs_namespaceObject = require("../../../material/index.cjs");
45
- const external_debounce_namespaceObject = require("debounce");
46
- var external_debounce_default = /*#__PURE__*/ __webpack_require__.n(external_debounce_namespaceObject);
47
36
  const external_react_namespaceObject = require("react");
48
37
  const external_icons_index_cjs_namespaceObject = require("../../icons/index.cjs");
49
38
  const external_ExecutionStatusIcon_index_cjs_namespaceObject = require("../ExecutionStatusIcon/index.cjs");
@@ -182,11 +171,10 @@ const TaskContent = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ ta
182
171
  ]
183
172
  })
184
173
  }));
185
- const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, contextMenuItems, onTaskClick, onMenuOpen, onTaskPlay, isDragDisabled, projectedDepth, zoom = 1 })=>{
174
+ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, contextMenuItems, onTaskClick, onMenuOpen, isDragDisabled, projectedDepth, zoom = 1 })=>{
186
175
  const [isMenuOpen, setIsMenuOpen] = (0, external_react_namespaceObject.useState)(false);
187
176
  const taskRef = (0, external_react_namespaceObject.useRef)(null);
188
177
  const menuRef = (0, external_react_namespaceObject.useRef)(null);
189
- const [playLoading, setPlayLoading] = (0, external_react_namespaceObject.useState)(false);
190
178
  const handleClick = (0, external_react_namespaceObject.useCallback)((e)=>{
191
179
  if (isMenuOpen) return;
192
180
  onTaskClick(e, task.id);
@@ -198,26 +186,6 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
198
186
  const handleMenuOpenChange = (0, external_react_namespaceObject.useCallback)((isOpen)=>{
199
187
  setIsMenuOpen(isOpen);
200
188
  }, []);
201
- const debouncedTaskPlay = (0, external_react_namespaceObject.useMemo)(()=>onTaskPlay ? external_debounce_default()(async (taskId)=>{
202
- setPlayLoading(true);
203
- try {
204
- await onTaskPlay(taskId);
205
- } catch {} finally{
206
- setPlayLoading(false);
207
- }
208
- }, 500, {
209
- immediate: true
210
- }) : void 0, [
211
- onTaskPlay
212
- ]);
213
- const handlePlayClick = (0, external_react_namespaceObject.useCallback)((e)=>{
214
- e.stopPropagation();
215
- e.preventDefault();
216
- debouncedTaskPlay?.(task.id);
217
- }, [
218
- debouncedTaskPlay,
219
- task.id
220
- ]);
221
189
  const handleContextMenu = (0, external_react_namespaceObject.useCallback)((e)=>{
222
190
  menuRef.current?.handleContextMenu(e);
223
191
  }, []);
@@ -274,30 +242,7 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
274
242
  task: task,
275
243
  taskExecution: taskExecution
276
244
  }),
277
- task.isAdhoc && onTaskPlay && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTooltip, {
278
- content: "Trigger task",
279
- placement: "top",
280
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApIconButton, {
281
- "data-testid": `stage-task-play-${task.id}`,
282
- onClick: handlePlayClick,
283
- onMouseDown: (e)=>e.stopPropagation(),
284
- className: "task-menu-icon-button",
285
- sx: {
286
- color: 'var(--uix-canvas-primary) !important',
287
- minWidth: 'unset !important',
288
- width: `${apollo_core_namespaceObject.Spacing.SpacingXl} !important`,
289
- height: `${apollo_core_namespaceObject.Spacing.SpacingXl} !important`,
290
- padding: '0 !important'
291
- },
292
- children: playLoading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApCircularProgress, {
293
- size: 20
294
- }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icons_index_cjs_namespaceObject.PlayIcon, {
295
- w: 20,
296
- h: 20
297
- })
298
- })
299
- }),
300
- task.isAdhoc && !onTaskPlay && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTooltip, {
245
+ task.hasEntryCondition && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTooltip, {
301
246
  content: "Entry condition",
302
247
  placement: "top",
303
248
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
@@ -1,4 +1,4 @@
1
1
  import type { DraggableTaskProps, TaskContentProps } from './DraggableTask.types';
2
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, onTaskPlay, isDragDisabled, projectedDepth, zoom, }: DraggableTaskProps) => 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
4
  //# sourceMappingURL=DraggableTask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DraggableTask.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/DraggableTask.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAgClF,eAAO,MAAM,WAAW,4EAA8C,gBAAgB,6CAwEpF,CAAC;AAqLH,eAAO,MAAM,aAAa,sLAvKvB,kBAAkB,6CAuKoC,CAAC"}
1
+ {"version":3,"file":"DraggableTask.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/DraggableTask.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAgClF,eAAO,MAAM,WAAW,4EAA8C,gBAAgB,6CAwEpF,CAAC;AAkIH,eAAO,MAAM,aAAa,0KArHvB,kBAAkB,6CAqHoC,CAAC"}
@@ -3,10 +3,9 @@ import { useSortable } from "@dnd-kit/sortable";
3
3
  import { CSS } from "@dnd-kit/utilities";
4
4
  import { FontVariantToken, Padding, Spacing } from "@uipath/apollo-core";
5
5
  import { Column, Row } from "../../layouts/index.js";
6
- import { ApBadge, ApCircularProgress, ApIconButton, ApTooltip, ApTypography, BadgeSize } from "../../../material/index.js";
7
- import debounce from "debounce";
6
+ import { ApBadge, ApIconButton, ApTooltip, ApTypography, BadgeSize } from "../../../material/index.js";
8
7
  import { memo, useCallback, useMemo, useRef, useState } from "react";
9
- import { EntryConditionIcon, PlayIcon } from "../../icons/index.js";
8
+ import { EntryConditionIcon } from "../../icons/index.js";
10
9
  import { ExecutionStatusIcon } from "../ExecutionStatusIcon/index.js";
11
10
  import { INDENTATION_WIDTH, StageTask, StageTaskDragPlaceholder, StageTaskDragPlaceholderWrapper, StageTaskIcon, StageTaskRetryDuration, StageTaskWrapper } from "./StageNode.styles.js";
12
11
  import { TaskMenu } from "./TaskMenu.js";
@@ -143,11 +142,10 @@ const TaskContent = /*#__PURE__*/ memo(({ task, taskExecution, isDragging })=>/*
143
142
  ]
144
143
  })
145
144
  }));
146
- const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, contextMenuItems, onTaskClick, onMenuOpen, onTaskPlay, isDragDisabled, projectedDepth, zoom = 1 })=>{
145
+ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, contextMenuItems, onTaskClick, onMenuOpen, isDragDisabled, projectedDepth, zoom = 1 })=>{
147
146
  const [isMenuOpen, setIsMenuOpen] = useState(false);
148
147
  const taskRef = useRef(null);
149
148
  const menuRef = useRef(null);
150
- const [playLoading, setPlayLoading] = useState(false);
151
149
  const handleClick = useCallback((e)=>{
152
150
  if (isMenuOpen) return;
153
151
  onTaskClick(e, task.id);
@@ -159,26 +157,6 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
159
157
  const handleMenuOpenChange = useCallback((isOpen)=>{
160
158
  setIsMenuOpen(isOpen);
161
159
  }, []);
162
- const debouncedTaskPlay = useMemo(()=>onTaskPlay ? debounce(async (taskId)=>{
163
- setPlayLoading(true);
164
- try {
165
- await onTaskPlay(taskId);
166
- } catch {} finally{
167
- setPlayLoading(false);
168
- }
169
- }, 500, {
170
- immediate: true
171
- }) : void 0, [
172
- onTaskPlay
173
- ]);
174
- const handlePlayClick = useCallback((e)=>{
175
- e.stopPropagation();
176
- e.preventDefault();
177
- debouncedTaskPlay?.(task.id);
178
- }, [
179
- debouncedTaskPlay,
180
- task.id
181
- ]);
182
160
  const handleContextMenu = useCallback((e)=>{
183
161
  menuRef.current?.handleContextMenu(e);
184
162
  }, []);
@@ -235,30 +213,7 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, c
235
213
  task: task,
236
214
  taskExecution: taskExecution
237
215
  }),
238
- task.isAdhoc && onTaskPlay && /*#__PURE__*/ jsx(ApTooltip, {
239
- content: "Trigger task",
240
- placement: "top",
241
- children: /*#__PURE__*/ jsx(ApIconButton, {
242
- "data-testid": `stage-task-play-${task.id}`,
243
- onClick: handlePlayClick,
244
- onMouseDown: (e)=>e.stopPropagation(),
245
- className: "task-menu-icon-button",
246
- sx: {
247
- color: 'var(--uix-canvas-primary) !important',
248
- minWidth: 'unset !important',
249
- width: `${Spacing.SpacingXl} !important`,
250
- height: `${Spacing.SpacingXl} !important`,
251
- padding: '0 !important'
252
- },
253
- children: playLoading ? /*#__PURE__*/ jsx(ApCircularProgress, {
254
- size: 20
255
- }) : /*#__PURE__*/ jsx(PlayIcon, {
256
- w: 20,
257
- h: 20
258
- })
259
- })
260
- }),
261
- task.isAdhoc && !onTaskPlay && /*#__PURE__*/ jsx(ApTooltip, {
216
+ task.hasEntryCondition && /*#__PURE__*/ jsx(ApTooltip, {
262
217
  content: "Entry condition",
263
218
  placement: "top",
264
219
  children: /*#__PURE__*/ jsx("span", {
@@ -1,5 +1,14 @@
1
1
  "use strict";
2
2
  var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
3
12
  (()=>{
4
13
  __webpack_require__.d = (exports1, definition)=>{
5
14
  for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
@@ -33,8 +42,11 @@ const apollo_core_namespaceObject = require("@uipath/apollo-core");
33
42
  const index_cjs_namespaceObject = require("../../layouts/index.cjs");
34
43
  const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
35
44
  const external_material_index_cjs_namespaceObject = require("../../../material/index.cjs");
45
+ const external_debounce_namespaceObject = require("debounce");
46
+ var external_debounce_default = /*#__PURE__*/ __webpack_require__.n(external_debounce_namespaceObject);
36
47
  const external_react_namespaceObject = require("react");
37
48
  const external_react_dom_namespaceObject = require("react-dom");
49
+ const external_icons_index_cjs_namespaceObject = require("../../icons/index.cjs");
38
50
  const ConnectedHandlesContext_cjs_namespaceObject = require("../BaseCanvas/ConnectedHandlesContext.cjs");
39
51
  const useButtonHandles_cjs_namespaceObject = require("../ButtonHandle/useButtonHandles.cjs");
40
52
  const external_ExecutionStatusIcon_index_cjs_namespaceObject = require("../ExecutionStatusIcon/index.cjs");
@@ -42,7 +54,6 @@ const external_FloatingCanvasPanel_index_cjs_namespaceObject = require("../Float
42
54
  const external_NodeContextMenu_index_cjs_namespaceObject = require("../NodeContextMenu/index.cjs");
43
55
  const hooks_index_cjs_namespaceObject = require("../NodePropertiesPanel/hooks/index.cjs");
44
56
  const external_Toolbox_index_cjs_namespaceObject = require("../Toolbox/index.cjs");
45
- const external_icons_index_cjs_namespaceObject = require("../../icons/index.cjs");
46
57
  const external_DraggableTask_cjs_namespaceObject = require("./DraggableTask.cjs");
47
58
  const external_StageNode_styles_cjs_namespaceObject = require("./StageNode.styles.cjs");
48
59
  const external_StageNode_types_cjs_namespaceObject = require("./StageNode.types.cjs");
@@ -70,12 +81,65 @@ const CHIP_ICONS = {
70
81
  size: apollo_core_namespaceObject.Icon.IconXs
71
82
  })
72
83
  };
84
+ const AdhocTaskPlayButton = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ taskId, onTaskPlay })=>{
85
+ const [playLoading, setPlayLoading] = (0, external_react_namespaceObject.useState)(false);
86
+ const debouncedTaskPlay = (0, external_react_namespaceObject.useMemo)(()=>external_debounce_default()(async (id)=>{
87
+ setPlayLoading(true);
88
+ try {
89
+ await onTaskPlay(id);
90
+ } catch {} finally{
91
+ setPlayLoading(false);
92
+ }
93
+ }, 500, {
94
+ immediate: true
95
+ }), [
96
+ onTaskPlay
97
+ ]);
98
+ const handlePlayClick = (0, external_react_namespaceObject.useCallback)((e)=>{
99
+ e.stopPropagation();
100
+ e.preventDefault();
101
+ debouncedTaskPlay(taskId);
102
+ }, [
103
+ debouncedTaskPlay,
104
+ taskId
105
+ ]);
106
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTooltip, {
107
+ content: "Trigger task",
108
+ placement: "top",
109
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApIconButton, {
110
+ "data-testid": `stage-task-play-${taskId}`,
111
+ onClick: handlePlayClick,
112
+ onMouseDown: (e)=>e.stopPropagation(),
113
+ onKeyDown: (e)=>e.stopPropagation(),
114
+ className: "task-menu-icon-button",
115
+ sx: {
116
+ color: 'var(--uix-canvas-primary) !important',
117
+ minWidth: 'unset !important',
118
+ width: `${apollo_core_namespaceObject.Spacing.SpacingL} !important`,
119
+ height: `${apollo_core_namespaceObject.Spacing.SpacingL} !important`,
120
+ padding: '0 !important'
121
+ },
122
+ children: playLoading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApCircularProgress, {
123
+ size: 20
124
+ }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icons_index_cjs_namespaceObject.PlayIcon, {
125
+ w: 20,
126
+ h: 20
127
+ })
128
+ })
129
+ });
130
+ });
73
131
  const StageNodeComponent = (props)=>{
74
132
  const { dragging, selected, id, width, execution, stageDetails, addTaskLabel = 'Add task', addTaskLoading = false, replaceTaskLabel = 'Replace task', taskOptions = [], menuItems, pendingReplaceTask, onStageClick, onTaskAdd, onAddTaskFromToolbox, onTaskToolboxSearch, onTaskClick, onTaskGroupModification, onStageTitleChange, onTaskReorder, onReplaceTaskFromToolbox, onTaskPlay, hideParallelOptions } = props;
75
133
  const taskWidth = width ? width - external_StageNode_styles_cjs_namespaceObject.STAGE_CONTENT_INSET : void 0;
76
- const tasks = (0, external_react_namespaceObject.useMemo)(()=>stageDetails?.tasks || [], [
134
+ const allTasks = (0, external_react_namespaceObject.useMemo)(()=>stageDetails?.tasks || [], [
77
135
  stageDetails?.tasks
78
136
  ]);
137
+ const tasks = (0, external_react_namespaceObject.useMemo)(()=>allTasks.filter((group)=>group.some((t)=>!t.isAdhoc)), [
138
+ allTasks
139
+ ]);
140
+ const adhocTasks = (0, external_react_namespaceObject.useMemo)(()=>allTasks.flat().filter((t)=>t.isAdhoc), [
141
+ allTasks
142
+ ]);
79
143
  const flatTasks = (0, external_react_namespaceObject.useMemo)(()=>tasks.flat(), [
80
144
  tasks
81
145
  ]);
@@ -114,14 +178,14 @@ const StageNodeComponent = (props)=>{
114
178
  const [isReplacingTask, setIsReplacingTask] = (0, external_react_namespaceObject.useState)(false);
115
179
  (0, external_react_namespaceObject.useEffect)(()=>{
116
180
  if (pendingReplaceTask) {
117
- const match = tasks.flatMap((group, gi)=>group.map((task, ti)=>({
181
+ const match = allTasks.flatMap((group, gi)=>group.map((task, ti)=>({
118
182
  task,
119
183
  groupIndex: gi,
120
184
  taskIndex: ti
121
185
  }))).find(({ task })=>task.id === selectedTaskId);
122
186
  if (match) {
123
187
  taskStateReference.current = {
124
- isParallel: (tasks[match.groupIndex]?.length ?? 0) > 1,
188
+ isParallel: (allTasks[match.groupIndex]?.length ?? 0) > 1,
125
189
  groupIndex: match.groupIndex,
126
190
  taskIndex: match.taskIndex
127
191
  };
@@ -131,7 +195,7 @@ const StageNodeComponent = (props)=>{
131
195
  }, [
132
196
  pendingReplaceTask,
133
197
  selectedTaskId,
134
- tasks
198
+ allTasks
135
199
  ]);
136
200
  const [activeDragId, setActiveDragId] = (0, external_react_namespaceObject.useState)(null);
137
201
  const [offsetLeft, setOffsetLeft] = (0, external_react_namespaceObject.useState)(0);
@@ -516,7 +580,7 @@ const StageNodeComponent = (props)=>{
516
580
  }),
517
581
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
518
582
  gap: apollo_core_namespaceObject.Spacing.SpacingMicro,
519
- align: isReadOnly ? 'start' : 'center',
583
+ align: "start",
520
584
  py: apollo_core_namespaceObject.Padding.PadS,
521
585
  children: [
522
586
  status && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTooltip, {
@@ -552,85 +616,7 @@ const StageNodeComponent = (props)=>{
552
616
  ]
553
617
  }),
554
618
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageContent, {
555
- children: tasks && 0 !== tasks.length ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.DndContext, {
556
- collisionDetection: core_namespaceObject.closestCenter,
557
- sensors: sensors,
558
- onDragStart: handleDragStart,
559
- onDragMove: handleDragMove,
560
- onDragOver: handleDragOver,
561
- onDragEnd: handleDragEnd,
562
- onDragCancel: handleDragCancel,
563
- children: [
564
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(sortable_namespaceObject.SortableContext, {
565
- items: taskIds,
566
- strategy: sortable_namespaceObject.verticalListSortingStrategy,
567
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskList, {
568
- className: "nodrag nopan",
569
- children: tasks.map((taskGroup, groupIndex)=>{
570
- const isParallel = taskGroup.length > 1;
571
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
572
- gap: apollo_core_namespaceObject.Spacing.SpacingS,
573
- children: [
574
- isParallel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageParallelBracket, {}),
575
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StageNode_styles_cjs_namespaceObject.StageTaskGroup, {
576
- isParallel: isParallel,
577
- children: [
578
- isParallel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageParallelLabel, {
579
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTypography, {
580
- variant: apollo_core_namespaceObject.FontVariantToken.fontSizeS,
581
- children: "Parallel"
582
- })
583
- }),
584
- taskGroup.map((task, taskIndex)=>{
585
- const taskExecution = execution?.taskStatus?.[task.id];
586
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DraggableTask_cjs_namespaceObject.DraggableTask, {
587
- task: task,
588
- taskExecution: taskExecution,
589
- isSelected: selectedTaskId === task.id,
590
- isParallel: isParallel,
591
- contextMenuItems: contextMenuItems(isParallel, groupIndex, taskIndex, tasks.length, taskGroup.length, (tasks[groupIndex - 1]?.length ?? 0) > 1, (tasks[groupIndex + 1]?.length ?? 0) > 1),
592
- onTaskClick: handleTaskClick,
593
- projectedDepth: task.id === activeDragId && projected ? projected.depth : void 0,
594
- onTaskPlay: onTaskPlay,
595
- isDragDisabled: !onTaskReorder,
596
- zoom: zoom,
597
- ...(onTaskGroupModification || onReplaceTaskFromToolbox) && {
598
- onMenuOpen: ()=>{
599
- taskStateReference.current = {
600
- isParallel,
601
- groupIndex,
602
- taskIndex
603
- };
604
- }
605
- }
606
- }, task.id);
607
- })
608
- ]
609
- })
610
- ]
611
- }, `group-${groupIndex}`);
612
- })
613
- })
614
- }),
615
- /*#__PURE__*/ (0, external_react_dom_namespaceObject.createPortal)(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(core_namespaceObject.DragOverlay, {
616
- children: activeTask ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
617
- style: dragOverlayStyle,
618
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTask, {
619
- selected: true,
620
- isParallel: isActiveTaskParallel,
621
- style: {
622
- cursor: 'grabbing',
623
- ...taskWidthStyle
624
- },
625
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DraggableTask_cjs_namespaceObject.TaskContent, {
626
- task: activeTask,
627
- isDragging: true
628
- })
629
- })
630
- }) : null
631
- }), document.body)
632
- ]
633
- }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Column, {
619
+ children: 0 === tasks.length && 0 === adhocTasks.length ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Column, {
634
620
  py: 2,
635
621
  children: (onTaskAdd || onAddTaskFromToolbox) && !isReadOnly ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApLink, {
636
622
  onClick: addTaskLoading ? void 0 : handleTaskAddClick,
@@ -645,6 +631,119 @@ const StageNodeComponent = (props)=>{
645
631
  color: "var(--uix-canvas-foreground-de-emp)",
646
632
  children: defaultContent
647
633
  })
634
+ }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
635
+ children: [
636
+ tasks.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.DndContext, {
637
+ collisionDetection: core_namespaceObject.closestCenter,
638
+ sensors: sensors,
639
+ onDragStart: handleDragStart,
640
+ onDragMove: handleDragMove,
641
+ onDragOver: handleDragOver,
642
+ onDragEnd: handleDragEnd,
643
+ onDragCancel: handleDragCancel,
644
+ children: [
645
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(sortable_namespaceObject.SortableContext, {
646
+ items: taskIds,
647
+ strategy: sortable_namespaceObject.verticalListSortingStrategy,
648
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskList, {
649
+ className: "nodrag nopan",
650
+ children: tasks.map((taskGroup, groupIndex)=>{
651
+ const isParallel = taskGroup.length > 1;
652
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
653
+ gap: apollo_core_namespaceObject.Spacing.SpacingS,
654
+ children: [
655
+ isParallel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageParallelBracket, {}),
656
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StageNode_styles_cjs_namespaceObject.StageTaskGroup, {
657
+ isParallel: isParallel,
658
+ children: [
659
+ isParallel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageParallelLabel, {
660
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTypography, {
661
+ variant: apollo_core_namespaceObject.FontVariantToken.fontSizeS,
662
+ children: "Parallel"
663
+ })
664
+ }),
665
+ taskGroup.map((task, taskIndex)=>{
666
+ const taskExecution = execution?.taskStatus?.[task.id];
667
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DraggableTask_cjs_namespaceObject.DraggableTask, {
668
+ task: task,
669
+ taskExecution: taskExecution,
670
+ isSelected: selectedTaskId === task.id,
671
+ isParallel: isParallel,
672
+ contextMenuItems: contextMenuItems(isParallel, groupIndex, taskIndex, tasks.length, taskGroup.length, (tasks[groupIndex - 1]?.length ?? 0) > 1, (tasks[groupIndex + 1]?.length ?? 0) > 1),
673
+ onTaskClick: handleTaskClick,
674
+ projectedDepth: task.id === activeDragId && projected ? projected.depth : void 0,
675
+ isDragDisabled: !onTaskReorder,
676
+ zoom: zoom,
677
+ ...(onTaskGroupModification || onReplaceTaskFromToolbox) && {
678
+ onMenuOpen: ()=>{
679
+ taskStateReference.current = {
680
+ isParallel,
681
+ groupIndex,
682
+ taskIndex
683
+ };
684
+ }
685
+ }
686
+ }, task.id);
687
+ })
688
+ ]
689
+ })
690
+ ]
691
+ }, `group-${groupIndex}`);
692
+ })
693
+ })
694
+ }),
695
+ /*#__PURE__*/ (0, external_react_dom_namespaceObject.createPortal)(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(core_namespaceObject.DragOverlay, {
696
+ children: activeTask ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
697
+ style: dragOverlayStyle,
698
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTask, {
699
+ selected: true,
700
+ isParallel: isActiveTaskParallel,
701
+ style: {
702
+ cursor: 'grabbing',
703
+ ...taskWidthStyle
704
+ },
705
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DraggableTask_cjs_namespaceObject.TaskContent, {
706
+ task: activeTask,
707
+ isDragging: true
708
+ })
709
+ })
710
+ }) : null
711
+ }), document.body)
712
+ ]
713
+ }),
714
+ adhocTasks.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StageNode_styles_cjs_namespaceObject.StageAdhocSection, {
715
+ children: [
716
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageAdhocHeaderSection, {
717
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTypography, {
718
+ variant: apollo_core_namespaceObject.FontVariantToken.fontSizeSBold,
719
+ color: "var(--uix-canvas-foreground-de-emp)",
720
+ children: "Adhoc tasks"
721
+ })
722
+ }),
723
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskList, {
724
+ children: adhocTasks.map((task)=>{
725
+ const taskExecution = execution?.taskStatus?.[task.id];
726
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StageNode_styles_cjs_namespaceObject.StageTask, {
727
+ "data-testid": `stage-task-${task.id}`,
728
+ selected: selectedTaskId === task.id,
729
+ status: taskExecution?.status,
730
+ onClick: (e)=>handleTaskClick(e, task.id),
731
+ children: [
732
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DraggableTask_cjs_namespaceObject.TaskContent, {
733
+ task: task,
734
+ taskExecution: taskExecution
735
+ }),
736
+ onTaskPlay && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(AdhocTaskPlayButton, {
737
+ taskId: task.id,
738
+ onTaskPlay: onTaskPlay
739
+ })
740
+ ]
741
+ }, task.id);
742
+ })
743
+ })
744
+ ]
745
+ })
746
+ ]
648
747
  })
649
748
  })
650
749
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"StageNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.tsx"],"names":[],"mappings":"AAyDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA4sBxD,eAAO,MAAM,SAAS,8CA1rBa,cAAc,6CA0rBA,CAAC"}
1
+ {"version":3,"file":"StageNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.tsx"],"names":[],"mappings":"AA4DA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA8yBxD,eAAO,MAAM,SAAS,8CApuBa,cAAc,6CAouBA,CAAC"}