@uipath/apollo-react 6.22.3 → 6.23.1

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.
Files changed (76) hide show
  1. package/README.md +2 -1
  2. package/dist/canvas/components/JsonTree/JsonTree.cjs +1 -1
  3. package/dist/canvas/components/JsonTree/JsonTree.js +1 -1
  4. package/dist/canvas/components/JsonTree/JsonTreeRow.cjs +16 -11
  5. package/dist/canvas/components/JsonTree/JsonTreeRow.d.ts.map +1 -1
  6. package/dist/canvas/components/JsonTree/JsonTreeRow.js +16 -11
  7. package/dist/canvas/components/JsonTree/NodeKey.cjs +1 -1
  8. package/dist/canvas/components/JsonTree/NodeKey.d.ts.map +1 -1
  9. package/dist/canvas/components/JsonTree/NodeKey.js +1 -1
  10. package/dist/canvas/components/JsonTree/ScalarValueCell.cjs +2 -2
  11. package/dist/canvas/components/JsonTree/ScalarValueCell.d.ts.map +1 -1
  12. package/dist/canvas/components/JsonTree/ScalarValueCell.js +2 -2
  13. package/dist/canvas/components/JsonTree/buildJsonTree.cjs +2 -2
  14. package/dist/canvas/components/JsonTree/buildJsonTree.d.ts +3 -1
  15. package/dist/canvas/components/JsonTree/buildJsonTree.d.ts.map +1 -1
  16. package/dist/canvas/components/JsonTree/buildJsonTree.js +2 -2
  17. package/dist/canvas/components/NodeIOView/PanelTitleBar.cjs +5 -7
  18. package/dist/canvas/components/NodeIOView/PanelTitleBar.d.ts.map +1 -1
  19. package/dist/canvas/components/NodeIOView/PanelTitleBar.js +5 -7
  20. package/dist/canvas/components/StageNode/StageNode.styles.cjs +7 -0
  21. package/dist/canvas/components/StageNode/StageNode.styles.d.ts.map +1 -1
  22. package/dist/canvas/components/StageNode/StageNode.styles.js +7 -0
  23. package/dist/canvas/components/StageNode/StageNode.types.d.ts +0 -5
  24. package/dist/canvas/components/StageNode/StageNode.types.d.ts.map +1 -1
  25. package/dist/canvas/components/StageNode/hooks/useStageTaskDragHandler.cjs +28 -53
  26. package/dist/canvas/components/StageNode/hooks/useStageTaskDragHandler.d.ts +7 -10
  27. package/dist/canvas/components/StageNode/hooks/useStageTaskDragHandler.d.ts.map +1 -1
  28. package/dist/canvas/components/StageNode/hooks/useStageTaskDragHandler.js +29 -54
  29. package/dist/canvas/components/StageNode/hooks/useStageTasksByGroups.cjs +12 -39
  30. package/dist/canvas/components/StageNode/hooks/useStageTasksByGroups.d.ts +0 -15
  31. package/dist/canvas/components/StageNode/hooks/useStageTasksByGroups.d.ts.map +1 -1
  32. package/dist/canvas/components/StageNode/hooks/useStageTasksByGroups.js +12 -39
  33. package/dist/canvas/components/StageNode/tasks/DraggableTask.cjs +4 -47
  34. package/dist/canvas/components/StageNode/tasks/DraggableTask.d.ts +1 -1
  35. package/dist/canvas/components/StageNode/tasks/DraggableTask.d.ts.map +1 -1
  36. package/dist/canvas/components/StageNode/tasks/DraggableTask.js +6 -49
  37. package/dist/canvas/components/StageNode/tasks/DraggableTask.types.d.ts +0 -1
  38. package/dist/canvas/components/StageNode/tasks/DraggableTask.types.d.ts.map +1 -1
  39. package/dist/canvas/components/StageNode/tasks/SortableTaskRow.cjs +75 -0
  40. package/dist/canvas/components/StageNode/tasks/SortableTaskRow.d.ts +7 -0
  41. package/dist/canvas/components/StageNode/tasks/SortableTaskRow.d.ts.map +1 -0
  42. package/dist/canvas/components/StageNode/tasks/SortableTaskRow.js +41 -0
  43. package/dist/canvas/components/StageNode/tasks/StageNodeAdhocTaskGroups.cjs +77 -25
  44. package/dist/canvas/components/StageNode/tasks/StageNodeAdhocTaskGroups.d.ts +6 -3
  45. package/dist/canvas/components/StageNode/tasks/StageNodeAdhocTaskGroups.d.ts.map +1 -1
  46. package/dist/canvas/components/StageNode/tasks/StageNodeAdhocTaskGroups.js +78 -26
  47. package/dist/canvas/components/StageNode/tasks/StageNodeAllTaskGroups.cjs +29 -4
  48. package/dist/canvas/components/StageNode/tasks/StageNodeAllTaskGroups.d.ts.map +1 -1
  49. package/dist/canvas/components/StageNode/tasks/StageNodeAllTaskGroups.js +29 -4
  50. package/dist/canvas/components/StageNode/tasks/StageNodeEventDrivenTaskGroups.cjs +76 -24
  51. package/dist/canvas/components/StageNode/tasks/StageNodeEventDrivenTaskGroups.d.ts +6 -3
  52. package/dist/canvas/components/StageNode/tasks/StageNodeEventDrivenTaskGroups.d.ts.map +1 -1
  53. package/dist/canvas/components/StageNode/tasks/StageNodeEventDrivenTaskGroups.js +77 -25
  54. package/dist/canvas/components/StageNode/tasks/StageNodeSequentialTaskGroups.cjs +53 -54
  55. package/dist/canvas/components/StageNode/tasks/StageNodeSequentialTaskGroups.d.ts +2 -3
  56. package/dist/canvas/components/StageNode/tasks/StageNodeSequentialTaskGroups.d.ts.map +1 -1
  57. package/dist/canvas/components/StageNode/tasks/StageNodeSequentialTaskGroups.js +53 -54
  58. package/dist/canvas/components/StageNode/tasks/TaskContent.cjs +1 -0
  59. package/dist/canvas/components/StageNode/tasks/TaskContent.d.ts.map +1 -1
  60. package/dist/canvas/components/StageNode/tasks/TaskContent.js +1 -0
  61. package/dist/canvas/controls/NodeOutputModeSelect/NodeOutputModeSelect.cjs +6 -18
  62. package/dist/canvas/controls/NodeOutputModeSelect/NodeOutputModeSelect.d.ts.map +1 -1
  63. package/dist/canvas/controls/NodeOutputModeSelect/NodeOutputModeSelect.js +8 -20
  64. package/dist/canvas/locales/en.cjs +1 -1
  65. package/dist/canvas/locales/en.d.ts.map +1 -1
  66. package/dist/canvas/locales/en.js +1 -1
  67. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  68. package/dist/canvas/utils/nodePropsEqual.cjs +1 -1
  69. package/dist/canvas/utils/nodePropsEqual.js +1 -1
  70. package/dist/core/index.cjs +5 -5
  71. package/dist/core/index.d.ts +1 -1
  72. package/dist/core/index.d.ts.map +1 -1
  73. package/dist/core/index.js +1 -1
  74. package/dist/core/tokens/jss/palette.cjs +1697 -3442
  75. package/dist/core/tokens/jss/palette.js +1688 -1
  76. package/package.json +4 -3
@@ -1,81 +1,56 @@
1
1
  import { useStoreApi } from "@xyflow/react";
2
- import { useCallback, useMemo, useState } from "react";
2
+ import { useCallback, useMemo, useRef, useState } from "react";
3
3
  import { flattenTasks, getProjection, reorderTasks } from "../StageNode.utils.js";
4
- const useStageTaskDragHandler = ({ sequentialTaskGroups, sequentialTasks, onTaskReorder })=>{
4
+ const useStageTaskDragHandler = ({ taskGroups, onTaskReorder, allowRegrouping = true })=>{
5
5
  const storeApi = useStoreApi();
6
+ const offsetLeft = useRef(0);
6
7
  const [activeDragId, setActiveDragId] = useState(null);
7
- const [offsetLeft, setOffsetLeft] = useState(0);
8
- const [overId, setOverId] = useState(null);
9
- const activeSequentialTask = useMemo(()=>sequentialTasks.find(({ task })=>task.id === activeDragId), [
10
- sequentialTasks,
8
+ const activeTask = useMemo(()=>taskGroups.flat().find((task)=>task.id === activeDragId), [
9
+ taskGroups,
11
10
  activeDragId
12
11
  ]);
13
- const isActiveTaskParallel = useMemo(()=>{
14
- if (!activeDragId) return false;
15
- const group = sequentialTaskGroups.find((g)=>g.some((t)=>t.id === activeDragId));
16
- return group ? group.length > 1 : false;
17
- }, [
18
- sequentialTaskGroups,
12
+ const isActiveTaskParallel = useMemo(()=>(taskGroups.find((group)=>group.some((t)=>t.id === activeDragId))?.length ?? 0) > 1, [
13
+ taskGroups,
19
14
  activeDragId
20
15
  ]);
21
- const projected = useMemo(()=>{
22
- if (!activeDragId || !overId) return null;
23
- return getProjection(sequentialTaskGroups, activeDragId, overId, offsetLeft);
24
- }, [
25
- sequentialTaskGroups,
26
- activeDragId,
27
- overId,
28
- offsetLeft
29
- ]);
30
- const resetState = useCallback(()=>{
31
- setActiveDragId(null);
32
- setOffsetLeft(0);
33
- setOverId(null);
34
- }, []);
35
- const handleDragStart = useCallback((event)=>{
36
- setActiveDragId(event.active.id);
37
- }, []);
16
+ const handleDragStart = useCallback((event)=>setActiveDragId(String(event.active.id)), []);
38
17
  const handleDragMove = useCallback((event)=>{
39
- setOffsetLeft(event.delta.x / storeApi.getState().transform[2]);
18
+ offsetLeft.current = event.delta.x / storeApi.getState().transform[2];
40
19
  }, [
41
20
  storeApi
42
21
  ]);
43
- const handleDragOver = useCallback((event)=>{
44
- setOverId(event.over?.id ?? null);
45
- }, []);
46
22
  const handleDragEnd = useCallback((event)=>{
47
23
  const { active, over } = event;
48
- const currentOffsetLeft = offsetLeft;
49
- resetState();
24
+ const currentOffsetLeft = offsetLeft.current;
25
+ offsetLeft.current = 0;
26
+ setActiveDragId(null);
50
27
  if (!over) return;
51
- const projection = getProjection(sequentialTaskGroups, active.id, over.id, currentOffsetLeft);
52
- if (!projection) return;
28
+ let depth = 0;
29
+ if (allowRegrouping) {
30
+ const projection = getProjection(taskGroups, active.id, over.id, currentOffsetLeft);
31
+ if (!projection) return;
32
+ depth = projection.depth;
33
+ }
53
34
  if (active.id === over.id) {
54
- const flattened = flattenTasks(sequentialTaskGroups);
55
- const activeTask = flattened.find((t)=>t.id === active.id);
56
- if (activeTask && activeTask.depth === projection.depth) return;
35
+ const flattened = flattenTasks(taskGroups);
36
+ const draggedTask = flattened.find((t)=>t.id === active.id);
37
+ if (draggedTask && draggedTask.depth === depth) return;
57
38
  }
58
- const newTasks = reorderTasks(sequentialTaskGroups, active.id, over.id, projection.depth);
59
- onTaskReorder(newTasks);
39
+ onTaskReorder(reorderTasks(taskGroups, active.id, over.id, depth));
60
40
  }, [
61
- sequentialTaskGroups,
41
+ taskGroups,
62
42
  onTaskReorder,
63
- offsetLeft,
64
- resetState
43
+ allowRegrouping
65
44
  ]);
66
45
  const handleDragCancel = useCallback(()=>{
67
- resetState();
68
- }, [
69
- resetState
70
- ]);
46
+ offsetLeft.current = 0;
47
+ setActiveDragId(null);
48
+ }, []);
71
49
  return {
72
- activeDragId,
73
- activeSequentialTask,
50
+ activeTask,
74
51
  isActiveTaskParallel,
75
- projected,
76
- handleDragMove,
77
- handleDragOver,
78
52
  handleDragStart,
53
+ handleDragMove,
79
54
  handleDragEnd,
80
55
  handleDragCancel
81
56
  };
@@ -27,55 +27,28 @@ __webpack_require__.d(__webpack_exports__, {
27
27
  useStageTasksByGroups: ()=>useStageTasksByGroups
28
28
  });
29
29
  const external_react_namespaceObject = require("react");
30
+ const typeOf = (task)=>{
31
+ if (null != task.taskGroupType) return task.taskGroupType;
32
+ return task.isAdhoc ? 'adhoc' : 'sequential';
33
+ };
30
34
  const useStageTasksByGroups = (allTasks)=>{
31
- const sequentialTaskGroups = (0, external_react_namespaceObject.useMemo)(()=>allTasks.filter((group)=>group.some((t)=>{
32
- if (null != t.taskGroupType) return 'sequential' === t.taskGroupType;
33
- if (null != t.isAdhoc) return !t.isAdhoc;
34
- return true;
35
- })), [
35
+ const sequentialTaskGroups = (0, external_react_namespaceObject.useMemo)(()=>allTasks.map((group)=>group.filter((task)=>'sequential' === typeOf(task))).filter((group)=>group.length > 0), [
36
36
  allTasks
37
37
  ]);
38
- const sequentialTasks = (0, external_react_namespaceObject.useMemo)(()=>sequentialTaskGroups.flatMap((group, groupIndex)=>group.map((task, taskIndex)=>({
39
- task,
40
- groupIndex,
41
- taskIndex
42
- }))), [
43
- sequentialTaskGroups
44
- ]);
45
- const adhocTaskGroups = (0, external_react_namespaceObject.useMemo)(()=>allTasks.filter((group)=>group.every((t)=>{
46
- if (null != t.taskGroupType) return 'adhoc' === t.taskGroupType;
47
- if (null != t.isAdhoc) return t.isAdhoc;
48
- return false;
49
- })), [
38
+ const adhocTaskGroups = (0, external_react_namespaceObject.useMemo)(()=>allTasks.flat().filter((task)=>'adhoc' === typeOf(task)).map((task)=>[
39
+ task
40
+ ]), [
50
41
  allTasks
51
42
  ]);
52
- const adhocTasks = (0, external_react_namespaceObject.useMemo)(()=>adhocTaskGroups.flatMap((group, groupIndex)=>group.map((task, taskIndex)=>({
53
- task,
54
- groupIndex,
55
- taskIndex
56
- }))), [
57
- adhocTaskGroups
58
- ]);
59
- const eventDrivenTaskGroups = (0, external_react_namespaceObject.useMemo)(()=>allTasks.filter((group)=>group.every((t)=>{
60
- if (null != t.taskGroupType) return 'event-driven' === t.taskGroupType;
61
- return false;
62
- })), [
43
+ const eventDrivenTaskGroups = (0, external_react_namespaceObject.useMemo)(()=>allTasks.flat().filter((task)=>'event-driven' === typeOf(task)).map((task)=>[
44
+ task
45
+ ]), [
63
46
  allTasks
64
47
  ]);
65
- const eventDrivenTasks = (0, external_react_namespaceObject.useMemo)(()=>eventDrivenTaskGroups.flatMap((group, groupIndex)=>group.map((task, taskIndex)=>({
66
- task,
67
- groupIndex,
68
- taskIndex
69
- }))), [
70
- eventDrivenTaskGroups
71
- ]);
72
48
  return {
73
49
  sequentialTaskGroups,
74
- sequentialTasks,
75
50
  adhocTaskGroups,
76
- adhocTasks,
77
- eventDrivenTaskGroups,
78
- eventDrivenTasks
51
+ eventDrivenTaskGroups
79
52
  };
80
53
  };
81
54
  exports.useStageTasksByGroups = __webpack_exports__.useStageTasksByGroups;
@@ -1,22 +1,7 @@
1
1
  import type { StageTaskItem } from '../StageNode.types';
2
2
  export declare const useStageTasksByGroups: (allTasks: StageTaskItem[][]) => {
3
3
  sequentialTaskGroups: StageTaskItem[][];
4
- sequentialTasks: {
5
- task: StageTaskItem;
6
- groupIndex: number;
7
- taskIndex: number;
8
- }[];
9
4
  adhocTaskGroups: StageTaskItem[][];
10
- adhocTasks: {
11
- task: StageTaskItem;
12
- groupIndex: number;
13
- taskIndex: number;
14
- }[];
15
5
  eventDrivenTaskGroups: StageTaskItem[][];
16
- eventDrivenTasks: {
17
- task: StageTaskItem;
18
- groupIndex: number;
19
- taskIndex: number;
20
- }[];
21
6
  };
22
7
  //# sourceMappingURL=useStageTasksByGroups.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useStageTasksByGroups.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/StageNode/hooks/useStageTasksByGroups.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,eAAO,MAAM,qBAAqB,GAAI,UAAU,aAAa,EAAE,EAAE;;;;;;;;;;;;;;;;;;;CA2EhE,CAAC"}
1
+ {"version":3,"file":"useStageTasksByGroups.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/StageNode/hooks/useStageTasksByGroups.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAaxD,eAAO,MAAM,qBAAqB,GAAI,UAAU,aAAa,EAAE,EAAE;;;;CAiChE,CAAC"}
@@ -1,53 +1,26 @@
1
1
  import { useMemo } from "react";
2
+ const typeOf = (task)=>{
3
+ if (null != task.taskGroupType) return task.taskGroupType;
4
+ return task.isAdhoc ? 'adhoc' : 'sequential';
5
+ };
2
6
  const useStageTasksByGroups = (allTasks)=>{
3
- const sequentialTaskGroups = useMemo(()=>allTasks.filter((group)=>group.some((t)=>{
4
- if (null != t.taskGroupType) return 'sequential' === t.taskGroupType;
5
- if (null != t.isAdhoc) return !t.isAdhoc;
6
- return true;
7
- })), [
7
+ const sequentialTaskGroups = useMemo(()=>allTasks.map((group)=>group.filter((task)=>'sequential' === typeOf(task))).filter((group)=>group.length > 0), [
8
8
  allTasks
9
9
  ]);
10
- const sequentialTasks = useMemo(()=>sequentialTaskGroups.flatMap((group, groupIndex)=>group.map((task, taskIndex)=>({
11
- task,
12
- groupIndex,
13
- taskIndex
14
- }))), [
15
- sequentialTaskGroups
16
- ]);
17
- const adhocTaskGroups = useMemo(()=>allTasks.filter((group)=>group.every((t)=>{
18
- if (null != t.taskGroupType) return 'adhoc' === t.taskGroupType;
19
- if (null != t.isAdhoc) return t.isAdhoc;
20
- return false;
21
- })), [
10
+ const adhocTaskGroups = useMemo(()=>allTasks.flat().filter((task)=>'adhoc' === typeOf(task)).map((task)=>[
11
+ task
12
+ ]), [
22
13
  allTasks
23
14
  ]);
24
- const adhocTasks = useMemo(()=>adhocTaskGroups.flatMap((group, groupIndex)=>group.map((task, taskIndex)=>({
25
- task,
26
- groupIndex,
27
- taskIndex
28
- }))), [
29
- adhocTaskGroups
30
- ]);
31
- const eventDrivenTaskGroups = useMemo(()=>allTasks.filter((group)=>group.every((t)=>{
32
- if (null != t.taskGroupType) return 'event-driven' === t.taskGroupType;
33
- return false;
34
- })), [
15
+ const eventDrivenTaskGroups = useMemo(()=>allTasks.flat().filter((task)=>'event-driven' === typeOf(task)).map((task)=>[
16
+ task
17
+ ]), [
35
18
  allTasks
36
19
  ]);
37
- const eventDrivenTasks = useMemo(()=>eventDrivenTaskGroups.flatMap((group, groupIndex)=>group.map((task, taskIndex)=>({
38
- task,
39
- groupIndex,
40
- taskIndex
41
- }))), [
42
- eventDrivenTaskGroups
43
- ]);
44
20
  return {
45
21
  sequentialTaskGroups,
46
- sequentialTasks,
47
22
  adhocTaskGroups,
48
- adhocTasks,
49
- eventDrivenTaskGroups,
50
- eventDrivenTasks
23
+ eventDrivenTaskGroups
51
24
  };
52
25
  };
53
26
  export { useStageTasksByGroups };
@@ -27,16 +27,14 @@ __webpack_require__.d(__webpack_exports__, {
27
27
  DraggableTask: ()=>DraggableTask
28
28
  });
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
- const sortable_namespaceObject = require("@dnd-kit/sortable");
31
- const utilities_namespaceObject = require("@dnd-kit/utilities");
32
- const react_cjs_namespaceObject = require("../../../xyflow/react.cjs");
33
30
  const external_react_namespaceObject = require("react");
34
31
  const external_StageNode_styles_cjs_namespaceObject = require("../StageNode.styles.cjs");
32
+ const external_SortableTaskRow_cjs_namespaceObject = require("./SortableTaskRow.cjs");
35
33
  const external_TaskBreakpointDot_cjs_namespaceObject = require("./TaskBreakpointDot.cjs");
36
34
  const external_TaskContent_cjs_namespaceObject = require("./TaskContent.cjs");
37
35
  const external_TaskMenu_cjs_namespaceObject = require("./TaskMenu.cjs");
38
36
  const external_TaskMockedChip_cjs_namespaceObject = require("./TaskMockedChip.cjs");
39
- const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, getContextMenuItems, onTaskClick, isDragDisabled, projectedDepth, isTaskLoading, isReadOnly, onToggleBreakpoint })=>{
37
+ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, getContextMenuItems, onTaskClick, isDragDisabled, isTaskLoading, isReadOnly, onToggleBreakpoint })=>{
40
38
  const taskRef = (0, external_react_namespaceObject.useRef)(null);
41
39
  const menuRef = (0, external_react_namespaceObject.useRef)(null);
42
40
  const handleClick = (0, external_react_namespaceObject.useCallback)((e)=>{
@@ -48,44 +46,6 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
48
46
  const handleContextMenu = (0, external_react_namespaceObject.useCallback)((e)=>{
49
47
  menuRef.current?.handleContextMenu(e);
50
48
  }, []);
51
- const { attributes, listeners, setNodeRef, transition, transform, isDragging } = (0, sortable_namespaceObject.useSortable)({
52
- id: task.id,
53
- disabled: isDragDisabled
54
- });
55
- const zoom = (0, react_cjs_namespaceObject.useStore)((s)=>transform ? s.transform[2] : 1);
56
- const style = (0, external_react_namespaceObject.useMemo)(()=>{
57
- const scaledTransform = transform ? {
58
- ...transform,
59
- x: transform.x / zoom,
60
- y: transform.y / zoom
61
- } : null;
62
- let marginLeft;
63
- if (isDragging && void 0 !== projectedDepth) if (1 !== projectedDepth || isParallel) {
64
- if (0 === projectedDepth && isParallel) marginLeft = `-${external_StageNode_styles_cjs_namespaceObject.INDENTATION_WIDTH}px`;
65
- } else marginLeft = `${external_StageNode_styles_cjs_namespaceObject.INDENTATION_WIDTH}px`;
66
- return {
67
- transition,
68
- transform: utilities_namespaceObject.CSS.Transform.toString(scaledTransform),
69
- marginLeft
70
- };
71
- }, [
72
- transform,
73
- zoom,
74
- transition,
75
- isDragging,
76
- projectedDepth,
77
- isParallel
78
- ]);
79
- if (isDragging) {
80
- const isTargetParallel = 1 === projectedDepth;
81
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskDragPlaceholderWrapper, {
82
- ref: setNodeRef,
83
- style: style,
84
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskDragPlaceholder, {
85
- isTargetParallel: isTargetParallel
86
- })
87
- });
88
- }
89
49
  const taskElement = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StageNode_styles_cjs_namespaceObject.StageItemPill, {
90
50
  ref: taskRef,
91
51
  "data-testid": `stage-task-card-${task.id}`,
@@ -123,12 +83,9 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
123
83
  ]
124
84
  });
125
85
  if (isDragDisabled) return taskElement;
126
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskWrapper, {
127
- ref: setNodeRef,
128
- style: style,
86
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_SortableTaskRow_cjs_namespaceObject.SortableTaskRow, {
87
+ taskId: task.id,
129
88
  isParallel: isParallel,
130
- ...attributes,
131
- ...listeners,
132
89
  children: taskElement
133
90
  });
134
91
  };
@@ -1,3 +1,3 @@
1
1
  import type { DraggableTaskProps } from './DraggableTask.types';
2
- export declare const DraggableTask: import("react").MemoExoticComponent<({ task, taskExecution, isSelected, isParallel, getContextMenuItems, onTaskClick, isDragDisabled, projectedDepth, isTaskLoading, isReadOnly, onToggleBreakpoint, }: DraggableTaskProps) => import("react/jsx-runtime").JSX.Element>;
2
+ export declare const DraggableTask: import("react").MemoExoticComponent<({ task, taskExecution, isSelected, isParallel, getContextMenuItems, onTaskClick, isDragDisabled, isTaskLoading, isReadOnly, onToggleBreakpoint, }: DraggableTaskProps) => import("react/jsx-runtime").JSX.Element>;
3
3
  //# sourceMappingURL=DraggableTask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DraggableTask.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/StageNode/tasks/DraggableTask.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAgIhE,eAAO,MAAM,aAAa,0MA9GvB,kBAAkB,6CA8GoC,CAAC"}
1
+ {"version":3,"file":"DraggableTask.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/StageNode/tasks/DraggableTask.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAiFhE,eAAO,MAAM,aAAa,0LA/DvB,kBAAkB,6CA+DoC,CAAC"}
@@ -1,14 +1,12 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useSortable } from "@dnd-kit/sortable";
3
- import { CSS } from "@dnd-kit/utilities";
4
- import { useStore } from "../../../xyflow/react.js";
5
- import { memo, useCallback, useMemo, useRef } from "react";
6
- import { INDENTATION_WIDTH, StageItemPill, StageTaskDragPlaceholder, StageTaskDragPlaceholderWrapper, StageTaskWrapper } from "../StageNode.styles.js";
2
+ import { memo, useCallback, useRef } from "react";
3
+ import { StageItemPill } from "../StageNode.styles.js";
4
+ import { SortableTaskRow } from "./SortableTaskRow.js";
7
5
  import { TaskBreakpointDot } from "./TaskBreakpointDot.js";
8
6
  import { TaskContent } from "./TaskContent.js";
9
7
  import { TaskMenu } from "./TaskMenu.js";
10
8
  import { TaskMockedChip } from "./TaskMockedChip.js";
11
- const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, getContextMenuItems, onTaskClick, isDragDisabled, projectedDepth, isTaskLoading, isReadOnly, onToggleBreakpoint })=>{
9
+ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, getContextMenuItems, onTaskClick, isDragDisabled, isTaskLoading, isReadOnly, onToggleBreakpoint })=>{
12
10
  const taskRef = useRef(null);
13
11
  const menuRef = useRef(null);
14
12
  const handleClick = useCallback((e)=>{
@@ -20,44 +18,6 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
20
18
  const handleContextMenu = useCallback((e)=>{
21
19
  menuRef.current?.handleContextMenu(e);
22
20
  }, []);
23
- const { attributes, listeners, setNodeRef, transition, transform, isDragging } = useSortable({
24
- id: task.id,
25
- disabled: isDragDisabled
26
- });
27
- const zoom = useStore((s)=>transform ? s.transform[2] : 1);
28
- const style = useMemo(()=>{
29
- const scaledTransform = transform ? {
30
- ...transform,
31
- x: transform.x / zoom,
32
- y: transform.y / zoom
33
- } : null;
34
- let marginLeft;
35
- if (isDragging && void 0 !== projectedDepth) if (1 !== projectedDepth || isParallel) {
36
- if (0 === projectedDepth && isParallel) marginLeft = `-${INDENTATION_WIDTH}px`;
37
- } else marginLeft = `${INDENTATION_WIDTH}px`;
38
- return {
39
- transition,
40
- transform: CSS.Transform.toString(scaledTransform),
41
- marginLeft
42
- };
43
- }, [
44
- transform,
45
- zoom,
46
- transition,
47
- isDragging,
48
- projectedDepth,
49
- isParallel
50
- ]);
51
- if (isDragging) {
52
- const isTargetParallel = 1 === projectedDepth;
53
- return /*#__PURE__*/ jsx(StageTaskDragPlaceholderWrapper, {
54
- ref: setNodeRef,
55
- style: style,
56
- children: /*#__PURE__*/ jsx(StageTaskDragPlaceholder, {
57
- isTargetParallel: isTargetParallel
58
- })
59
- });
60
- }
61
21
  const taskElement = /*#__PURE__*/ jsxs(StageItemPill, {
62
22
  ref: taskRef,
63
23
  "data-testid": `stage-task-card-${task.id}`,
@@ -95,12 +55,9 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
95
55
  ]
96
56
  });
97
57
  if (isDragDisabled) return taskElement;
98
- return /*#__PURE__*/ jsx(StageTaskWrapper, {
99
- ref: setNodeRef,
100
- style: style,
58
+ return /*#__PURE__*/ jsx(SortableTaskRow, {
59
+ taskId: task.id,
101
60
  isParallel: isParallel,
102
- ...attributes,
103
- ...listeners,
104
61
  children: taskElement
105
62
  });
106
63
  };
@@ -9,7 +9,6 @@ export interface DraggableTaskProps {
9
9
  onTaskClick: (e: React.MouseEvent, taskId: string) => void;
10
10
  onTaskPlay?: (taskId: string) => Promise<void>;
11
11
  isDragDisabled?: boolean;
12
- projectedDepth?: number;
13
12
  isTaskLoading?: boolean;
14
13
  isReadOnly?: boolean;
15
14
  onToggleBreakpoint?: (taskId: string) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"DraggableTask.types.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/StageNode/tasks/DraggableTask.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE5E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IAGpB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,YAAY,EAAE,CAAC;IAC9D,WAAW,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C"}
1
+ {"version":3,"file":"DraggableTask.types.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/StageNode/tasks/DraggableTask.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE5E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IAGpB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,YAAY,EAAE,CAAC;IAC9D,WAAW,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ SortableTaskRow: ()=>SortableTaskRow
28
+ });
29
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
+ const sortable_namespaceObject = require("@dnd-kit/sortable");
31
+ const utilities_namespaceObject = require("@dnd-kit/utilities");
32
+ const react_cjs_namespaceObject = require("../../../xyflow/react.cjs");
33
+ const external_react_namespaceObject = require("react");
34
+ const external_StageNode_styles_cjs_namespaceObject = require("../StageNode.styles.cjs");
35
+ const SortableTaskRowComponent = ({ taskId, isParallel, children })=>{
36
+ const { attributes, listeners, setNodeRef, transition, transform, isDragging } = (0, sortable_namespaceObject.useSortable)({
37
+ id: taskId
38
+ });
39
+ const zoom = (0, react_cjs_namespaceObject.useStore)((s)=>transform ? s.transform[2] : 1);
40
+ const style = (0, external_react_namespaceObject.useMemo)(()=>({
41
+ transition,
42
+ transform: utilities_namespaceObject.CSS.Transform.toString(transform ? {
43
+ ...transform,
44
+ x: transform.x / zoom,
45
+ y: transform.y / zoom
46
+ } : null)
47
+ }), [
48
+ transform,
49
+ zoom,
50
+ transition
51
+ ]);
52
+ if (isDragging) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskDragPlaceholderWrapper, {
53
+ ref: setNodeRef,
54
+ style: style,
55
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskDragPlaceholder, {
56
+ isTargetParallel: isParallel
57
+ })
58
+ });
59
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskWrapper, {
60
+ ref: setNodeRef,
61
+ style: style,
62
+ isParallel: isParallel,
63
+ ...attributes,
64
+ ...listeners,
65
+ children: children
66
+ });
67
+ };
68
+ const SortableTaskRow = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(SortableTaskRowComponent);
69
+ exports.SortableTaskRow = __webpack_exports__.SortableTaskRow;
70
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
71
+ "SortableTaskRow"
72
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
73
+ Object.defineProperty(exports, '__esModule', {
74
+ value: true
75
+ });
@@ -0,0 +1,7 @@
1
+ import { type ReactNode } from 'react';
2
+ export declare const SortableTaskRow: import("react").MemoExoticComponent<({ taskId, isParallel, children, }: {
3
+ taskId: string;
4
+ isParallel?: boolean;
5
+ children: ReactNode;
6
+ }) => import("react/jsx-runtime").JSX.Element>;
7
+ //# sourceMappingURL=SortableTaskRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SortableTaskRow.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/StageNode/tasks/SortableTaskRow.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA4B,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAyD1E,eAAO,MAAM,eAAe,0EA5CzB;IACD,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB,6CAwC4D,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useSortable } from "@dnd-kit/sortable";
3
+ import { CSS } from "@dnd-kit/utilities";
4
+ import { useStore } from "../../../xyflow/react.js";
5
+ import { memo, useMemo } from "react";
6
+ import { StageTaskDragPlaceholder, StageTaskDragPlaceholderWrapper, StageTaskWrapper } from "../StageNode.styles.js";
7
+ const SortableTaskRowComponent = ({ taskId, isParallel, children })=>{
8
+ const { attributes, listeners, setNodeRef, transition, transform, isDragging } = useSortable({
9
+ id: taskId
10
+ });
11
+ const zoom = useStore((s)=>transform ? s.transform[2] : 1);
12
+ const style = useMemo(()=>({
13
+ transition,
14
+ transform: CSS.Transform.toString(transform ? {
15
+ ...transform,
16
+ x: transform.x / zoom,
17
+ y: transform.y / zoom
18
+ } : null)
19
+ }), [
20
+ transform,
21
+ zoom,
22
+ transition
23
+ ]);
24
+ if (isDragging) return /*#__PURE__*/ jsx(StageTaskDragPlaceholderWrapper, {
25
+ ref: setNodeRef,
26
+ style: style,
27
+ children: /*#__PURE__*/ jsx(StageTaskDragPlaceholder, {
28
+ isTargetParallel: isParallel
29
+ })
30
+ });
31
+ return /*#__PURE__*/ jsx(StageTaskWrapper, {
32
+ ref: setNodeRef,
33
+ style: style,
34
+ isParallel: isParallel,
35
+ ...attributes,
36
+ ...listeners,
37
+ children: children
38
+ });
39
+ };
40
+ const SortableTaskRow = /*#__PURE__*/ memo(SortableTaskRowComponent);
41
+ export { SortableTaskRow };