@uipath/apollo-react 3.44.0 → 3.44.2-pr255.af80ea0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/components/StageNode/CrossStageTaskDrag.stories.cjs +581 -0
- package/dist/canvas/components/StageNode/CrossStageTaskDrag.stories.d.ts +6 -0
- package/dist/canvas/components/StageNode/CrossStageTaskDrag.stories.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/CrossStageTaskDrag.stories.js +544 -0
- package/dist/canvas/components/StageNode/DropPlaceholder.cjs +106 -0
- package/dist/canvas/components/StageNode/DropPlaceholder.d.ts +10 -0
- package/dist/canvas/components/StageNode/DropPlaceholder.d.ts.map +1 -0
- package/dist/canvas/components/StageNode/DropPlaceholder.js +72 -0
- package/dist/canvas/components/StageNode/StageNode.cjs +334 -389
- package/dist/canvas/components/StageNode/StageNode.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.js +336 -391
- package/dist/canvas/components/StageNode/StageNode.stories.cjs +1910 -1416
- package/dist/canvas/components/StageNode/StageNode.stories.d.ts +1 -1
- package/dist/canvas/components/StageNode/StageNode.stories.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.stories.js +1906 -1412
- package/dist/canvas/components/StageNode/StageNode.styles.cjs +1 -1
- package/dist/canvas/components/StageNode/StageNode.styles.js +1 -1
- package/dist/canvas/components/StageNode/StageNode.types.d.ts +26 -10
- package/dist/canvas/components/StageNode/StageNode.types.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.cjs +10 -5
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.d.ts +2 -1
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.js +6 -4
- package/dist/canvas/components/StageNode/TaskMenu.cjs +11 -43
- package/dist/canvas/components/StageNode/TaskMenu.d.ts +1 -6
- package/dist/canvas/components/StageNode/TaskMenu.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/TaskMenu.js +13 -35
- package/dist/canvas/components/StageNode/index.cjs +17 -3
- package/dist/canvas/components/StageNode/index.d.ts +4 -1
- package/dist/canvas/components/StageNode/index.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/index.js +3 -1
- package/dist/canvas/components/TaskNode/PlaceholderTaskNode.cjs +51 -0
- package/dist/canvas/components/TaskNode/PlaceholderTaskNode.d.ts +8 -0
- package/dist/canvas/components/TaskNode/PlaceholderTaskNode.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/PlaceholderTaskNode.js +17 -0
- package/dist/canvas/components/TaskNode/TaskNode.cjs +235 -0
- package/dist/canvas/components/TaskNode/TaskNode.d.ts +11 -0
- package/dist/canvas/components/TaskNode/TaskNode.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/TaskNode.js +198 -0
- package/dist/canvas/components/TaskNode/TaskNode.stories.cjs +558 -0
- package/dist/canvas/components/TaskNode/TaskNode.stories.d.ts +8 -0
- package/dist/canvas/components/TaskNode/TaskNode.stories.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/TaskNode.stories.js +515 -0
- package/dist/canvas/components/TaskNode/TaskNode.types.d.ts +40 -0
- package/dist/canvas/components/TaskNode/TaskNode.types.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/TaskNodeContext.cjs +86 -0
- package/dist/canvas/components/TaskNode/TaskNodeContext.d.ts +24 -0
- package/dist/canvas/components/TaskNode/TaskNodeContext.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/TaskNodeContext.js +40 -0
- package/dist/canvas/components/TaskNode/index.cjs +82 -0
- package/dist/canvas/components/TaskNode/index.d.ts +8 -0
- package/dist/canvas/components/TaskNode/index.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/index.js +6 -0
- package/dist/canvas/components/TaskNode/taskReorderUtils.cjs +206 -0
- package/dist/canvas/components/TaskNode/taskReorderUtils.d.ts +23 -0
- package/dist/canvas/components/TaskNode/taskReorderUtils.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/taskReorderUtils.js +154 -0
- package/dist/canvas/components/TaskNode/useTaskPositions.cjs +153 -0
- package/dist/canvas/components/TaskNode/useTaskPositions.d.ts +29 -0
- package/dist/canvas/components/TaskNode/useTaskPositions.d.ts.map +1 -0
- package/dist/canvas/components/TaskNode/useTaskPositions.js +110 -0
- package/dist/canvas/core/TaskTypeRegistry.cjs +132 -0
- package/dist/canvas/core/TaskTypeRegistry.d.ts +18 -0
- package/dist/canvas/core/TaskTypeRegistry.d.ts.map +1 -0
- package/dist/canvas/core/TaskTypeRegistry.js +98 -0
- package/dist/canvas/core/index.cjs +21 -3
- package/dist/canvas/core/index.d.ts +2 -0
- package/dist/canvas/core/index.d.ts.map +1 -1
- package/dist/canvas/core/index.js +2 -0
- package/dist/canvas/core/useTaskTypeRegistry.cjs +82 -0
- package/dist/canvas/core/useTaskTypeRegistry.d.ts +13 -0
- package/dist/canvas/core/useTaskTypeRegistry.d.ts.map +1 -0
- package/dist/canvas/core/useTaskTypeRegistry.js +33 -0
- package/dist/canvas/hooks/CrossStageDragContext.cjs +45 -0
- package/dist/canvas/hooks/CrossStageDragContext.d.ts +8 -0
- package/dist/canvas/hooks/CrossStageDragContext.d.ts.map +1 -0
- package/dist/canvas/hooks/CrossStageDragContext.js +8 -0
- package/dist/canvas/hooks/calculateTaskDropPosition.cjs +253 -0
- package/dist/canvas/hooks/calculateTaskDropPosition.d.ts +11 -0
- package/dist/canvas/hooks/calculateTaskDropPosition.d.ts.map +1 -0
- package/dist/canvas/hooks/calculateTaskDropPosition.js +216 -0
- package/dist/canvas/hooks/index.cjs +57 -30
- package/dist/canvas/hooks/index.d.ts +3 -0
- package/dist/canvas/hooks/index.d.ts.map +1 -1
- package/dist/canvas/hooks/index.js +3 -0
- package/dist/canvas/hooks/useCrossStageTaskDrag.cjs +346 -0
- package/dist/canvas/hooks/useCrossStageTaskDrag.d.ts +44 -0
- package/dist/canvas/hooks/useCrossStageTaskDrag.d.ts.map +1 -0
- package/dist/canvas/hooks/useCrossStageTaskDrag.js +312 -0
- package/dist/canvas/hooks/useTaskCopyPaste.cjs +155 -0
- package/dist/canvas/hooks/useTaskCopyPaste.d.ts +34 -0
- package/dist/canvas/hooks/useTaskCopyPaste.d.ts.map +1 -0
- package/dist/canvas/hooks/useTaskCopyPaste.js +121 -0
- package/dist/canvas/schema/index.cjs +12 -3
- package/dist/canvas/schema/index.d.ts +1 -0
- package/dist/canvas/schema/index.d.ts.map +1 -1
- package/dist/canvas/schema/index.js +1 -0
- package/dist/canvas/schema/task-definition/index.cjs +60 -0
- package/dist/canvas/schema/task-definition/index.d.ts +2 -0
- package/dist/canvas/schema/task-definition/index.d.ts.map +1 -0
- package/dist/canvas/schema/task-definition/index.js +1 -0
- package/dist/canvas/schema/task-definition/task-manifest.cjs +78 -0
- package/dist/canvas/schema/task-definition/task-manifest.d.ts +43 -0
- package/dist/canvas/schema/task-definition/task-manifest.d.ts.map +1 -0
- package/dist/canvas/schema/task-definition/task-manifest.js +29 -0
- package/dist/material/components/ap-sankey-diagram/ApSankeyDiagram.cjs +44 -21
- package/dist/material/components/ap-sankey-diagram/ApSankeyDiagram.d.ts.map +1 -1
- package/dist/material/components/ap-sankey-diagram/ApSankeyDiagram.js +44 -21
- package/package.json +3 -3
- package/dist/canvas/components/StageNode/DraggableTask.cjs +0 -271
- package/dist/canvas/components/StageNode/DraggableTask.d.ts +0 -4
- package/dist/canvas/components/StageNode/DraggableTask.d.ts.map +0 -1
- package/dist/canvas/components/StageNode/DraggableTask.js +0 -234
- package/dist/canvas/components/StageNode/DraggableTask.types.d.ts +0 -20
- package/dist/canvas/components/StageNode/DraggableTask.types.d.ts.map +0 -1
- package/dist/canvas/components/StageNode/StageNode.utils.cjs +0 -164
- package/dist/canvas/components/StageNode/StageNode.utils.d.ts +0 -19
- package/dist/canvas/components/StageNode/StageNode.utils.d.ts.map +0 -1
- package/dist/canvas/components/StageNode/StageNode.utils.js +0 -121
- /package/dist/canvas/components/{StageNode/DraggableTask.types.cjs → TaskNode/TaskNode.types.cjs} +0 -0
- /package/dist/canvas/components/{StageNode/DraggableTask.types.js → TaskNode/TaskNode.types.js} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
const TaskNodeContext = /*#__PURE__*/ createContext(null);
|
|
4
|
+
function TaskNodeProvider({ children, value }) {
|
|
5
|
+
return /*#__PURE__*/ jsx(TaskNodeContext.Provider, {
|
|
6
|
+
value: value,
|
|
7
|
+
children: children
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function useTaskNodeContext() {
|
|
11
|
+
const context = useContext(TaskNodeContext);
|
|
12
|
+
if (!context) throw new Error('useTaskNodeContext must be used within a TaskNodeProvider');
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
function useIsTaskParallel(taskId) {
|
|
16
|
+
const context = useContext(TaskNodeContext);
|
|
17
|
+
if (!context) return false;
|
|
18
|
+
for (const group of context.taskIds)if (group.includes(taskId)) return group.length > 1;
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
function useTaskGroupInfo(taskId) {
|
|
22
|
+
const context = useContext(TaskNodeContext);
|
|
23
|
+
if (!context) return null;
|
|
24
|
+
for(let groupIndex = 0; groupIndex < context.taskIds.length; groupIndex++){
|
|
25
|
+
const group = context.taskIds[groupIndex];
|
|
26
|
+
if (!group) continue;
|
|
27
|
+
const taskIndex = group.indexOf(taskId);
|
|
28
|
+
if (-1 !== taskIndex) return {
|
|
29
|
+
groupIndex,
|
|
30
|
+
taskIndex,
|
|
31
|
+
isParallel: group.length > 1,
|
|
32
|
+
groupSize: group.length
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
function useOptionalTaskNodeContext() {
|
|
38
|
+
return useContext(TaskNodeContext);
|
|
39
|
+
}
|
|
40
|
+
export { TaskNodeProvider, useIsTaskParallel, useOptionalTaskNodeContext, useTaskGroupInfo, useTaskNodeContext };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
calculateTaskPositions: ()=>external_useTaskPositions_cjs_namespaceObject.calculateTaskPositions,
|
|
28
|
+
useTaskGroupInfo: ()=>external_TaskNodeContext_cjs_namespaceObject.useTaskGroupInfo,
|
|
29
|
+
useTaskPositions: ()=>external_useTaskPositions_cjs_namespaceObject.useTaskPositions,
|
|
30
|
+
PlaceholderTaskNode: ()=>external_PlaceholderTaskNode_cjs_namespaceObject.PlaceholderTaskNode,
|
|
31
|
+
useIsTaskParallel: ()=>external_TaskNodeContext_cjs_namespaceObject.useIsTaskParallel,
|
|
32
|
+
flattenTaskIds: ()=>external_taskReorderUtils_cjs_namespaceObject.flattenTaskIds,
|
|
33
|
+
useTaskNodeContext: ()=>external_TaskNodeContext_cjs_namespaceObject.useTaskNodeContext,
|
|
34
|
+
TaskNodeProvider: ()=>external_TaskNodeContext_cjs_namespaceObject.TaskNodeProvider,
|
|
35
|
+
useOptionalTaskNodeContext: ()=>external_TaskNodeContext_cjs_namespaceObject.useOptionalTaskNodeContext,
|
|
36
|
+
TaskNodeContent: ()=>external_TaskNode_cjs_namespaceObject.TaskNodeContent,
|
|
37
|
+
DEFAULT_TASK_POSITION_CONFIG: ()=>external_useTaskPositions_cjs_namespaceObject.DEFAULT_TASK_POSITION_CONFIG,
|
|
38
|
+
TaskNode: ()=>external_TaskNode_cjs_namespaceObject.TaskNode,
|
|
39
|
+
reorderTaskIds: ()=>external_taskReorderUtils_cjs_namespaceObject.reorderTaskIds,
|
|
40
|
+
buildTaskIdGroups: ()=>external_taskReorderUtils_cjs_namespaceObject.buildTaskIdGroups,
|
|
41
|
+
calculateStageContentHeight: ()=>external_useTaskPositions_cjs_namespaceObject.calculateStageContentHeight
|
|
42
|
+
});
|
|
43
|
+
const external_TaskNode_cjs_namespaceObject = require("./TaskNode.cjs");
|
|
44
|
+
const external_PlaceholderTaskNode_cjs_namespaceObject = require("./PlaceholderTaskNode.cjs");
|
|
45
|
+
const external_useTaskPositions_cjs_namespaceObject = require("./useTaskPositions.cjs");
|
|
46
|
+
const external_TaskNodeContext_cjs_namespaceObject = require("./TaskNodeContext.cjs");
|
|
47
|
+
const external_taskReorderUtils_cjs_namespaceObject = require("./taskReorderUtils.cjs");
|
|
48
|
+
exports.DEFAULT_TASK_POSITION_CONFIG = __webpack_exports__.DEFAULT_TASK_POSITION_CONFIG;
|
|
49
|
+
exports.PlaceholderTaskNode = __webpack_exports__.PlaceholderTaskNode;
|
|
50
|
+
exports.TaskNode = __webpack_exports__.TaskNode;
|
|
51
|
+
exports.TaskNodeContent = __webpack_exports__.TaskNodeContent;
|
|
52
|
+
exports.TaskNodeProvider = __webpack_exports__.TaskNodeProvider;
|
|
53
|
+
exports.buildTaskIdGroups = __webpack_exports__.buildTaskIdGroups;
|
|
54
|
+
exports.calculateStageContentHeight = __webpack_exports__.calculateStageContentHeight;
|
|
55
|
+
exports.calculateTaskPositions = __webpack_exports__.calculateTaskPositions;
|
|
56
|
+
exports.flattenTaskIds = __webpack_exports__.flattenTaskIds;
|
|
57
|
+
exports.reorderTaskIds = __webpack_exports__.reorderTaskIds;
|
|
58
|
+
exports.useIsTaskParallel = __webpack_exports__.useIsTaskParallel;
|
|
59
|
+
exports.useOptionalTaskNodeContext = __webpack_exports__.useOptionalTaskNodeContext;
|
|
60
|
+
exports.useTaskGroupInfo = __webpack_exports__.useTaskGroupInfo;
|
|
61
|
+
exports.useTaskNodeContext = __webpack_exports__.useTaskNodeContext;
|
|
62
|
+
exports.useTaskPositions = __webpack_exports__.useTaskPositions;
|
|
63
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
64
|
+
"DEFAULT_TASK_POSITION_CONFIG",
|
|
65
|
+
"PlaceholderTaskNode",
|
|
66
|
+
"TaskNode",
|
|
67
|
+
"TaskNodeContent",
|
|
68
|
+
"TaskNodeProvider",
|
|
69
|
+
"buildTaskIdGroups",
|
|
70
|
+
"calculateStageContentHeight",
|
|
71
|
+
"calculateTaskPositions",
|
|
72
|
+
"flattenTaskIds",
|
|
73
|
+
"reorderTaskIds",
|
|
74
|
+
"useIsTaskParallel",
|
|
75
|
+
"useOptionalTaskNodeContext",
|
|
76
|
+
"useTaskGroupInfo",
|
|
77
|
+
"useTaskNodeContext",
|
|
78
|
+
"useTaskPositions"
|
|
79
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
80
|
+
Object.defineProperty(exports, '__esModule', {
|
|
81
|
+
value: true
|
|
82
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { TaskNode, TaskNodeContent } from './TaskNode';
|
|
2
|
+
export { PlaceholderTaskNode } from './PlaceholderTaskNode';
|
|
3
|
+
export { calculateTaskPositions, calculateStageContentHeight, useTaskPositions, DEFAULT_TASK_POSITION_CONFIG, } from './useTaskPositions';
|
|
4
|
+
export { TaskNodeProvider, useTaskNodeContext, useOptionalTaskNodeContext, useIsTaskParallel, useTaskGroupInfo, } from './TaskNodeContext';
|
|
5
|
+
export type { TaskType, TaskNodeData, TaskNode as TaskNodeType, TaskNodeProps, TaskPosition, TaskPositionConfig, } from './TaskNode.types';
|
|
6
|
+
export type { TaskNodeContextValue, TaskNodeProviderProps } from './TaskNodeContext';
|
|
7
|
+
export { flattenTaskIds, buildTaskIdGroups, reorderTaskIds } from './taskReorderUtils';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/TaskNode/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,QAAQ,IAAI,YAAY,EACxB,aAAa,EACb,YAAY,EACZ,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TaskNode, TaskNodeContent } from "./TaskNode.js";
|
|
2
|
+
import { PlaceholderTaskNode } from "./PlaceholderTaskNode.js";
|
|
3
|
+
import { DEFAULT_TASK_POSITION_CONFIG, calculateStageContentHeight, calculateTaskPositions, useTaskPositions } from "./useTaskPositions.js";
|
|
4
|
+
import { TaskNodeProvider, useIsTaskParallel, useOptionalTaskNodeContext, useTaskGroupInfo, useTaskNodeContext } from "./TaskNodeContext.js";
|
|
5
|
+
import { buildTaskIdGroups, flattenTaskIds, reorderTaskIds } from "./taskReorderUtils.js";
|
|
6
|
+
export { DEFAULT_TASK_POSITION_CONFIG, PlaceholderTaskNode, TaskNode, TaskNodeContent, TaskNodeProvider, buildTaskIdGroups, calculateStageContentHeight, calculateTaskPositions, flattenTaskIds, reorderTaskIds, useIsTaskParallel, useOptionalTaskNodeContext, useTaskGroupInfo, useTaskNodeContext, useTaskPositions };
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
buildTaskIdGroups: ()=>buildTaskIdGroups,
|
|
28
|
+
flattenTaskIds: ()=>flattenTaskIds,
|
|
29
|
+
insertTaskAtPosition: ()=>insertTaskAtPosition,
|
|
30
|
+
moveTaskBetweenStages: ()=>moveTaskBetweenStages,
|
|
31
|
+
moveTaskWithinStage: ()=>moveTaskWithinStage,
|
|
32
|
+
removeTaskFromTaskIds: ()=>removeTaskFromTaskIds,
|
|
33
|
+
reorderTaskIds: ()=>reorderTaskIds
|
|
34
|
+
});
|
|
35
|
+
function flattenTaskIds(taskIds) {
|
|
36
|
+
const flattened = [];
|
|
37
|
+
for (const [groupIndex, group] of taskIds.entries()){
|
|
38
|
+
if (!group) continue;
|
|
39
|
+
const depth = group.length > 1 ? 1 : 0;
|
|
40
|
+
for (const [taskIndex, id] of group.entries())if (id) flattened.push({
|
|
41
|
+
id,
|
|
42
|
+
groupIndex,
|
|
43
|
+
taskIndex,
|
|
44
|
+
depth
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return flattened;
|
|
48
|
+
}
|
|
49
|
+
function buildTaskIdGroups(flattenedTaskIds) {
|
|
50
|
+
const groups = [];
|
|
51
|
+
let currentGroup = [];
|
|
52
|
+
let previousDepth = null;
|
|
53
|
+
let previousGroupIndex = null;
|
|
54
|
+
for (const item of flattenedTaskIds){
|
|
55
|
+
if (null === previousDepth) currentGroup.push(item.id);
|
|
56
|
+
else if (1 === item.depth && 1 === previousDepth && item.groupIndex === previousGroupIndex) currentGroup.push(item.id);
|
|
57
|
+
else {
|
|
58
|
+
if (currentGroup.length > 0) groups.push(currentGroup);
|
|
59
|
+
currentGroup = [
|
|
60
|
+
item.id
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
previousDepth = item.depth;
|
|
64
|
+
previousGroupIndex = item.groupIndex;
|
|
65
|
+
}
|
|
66
|
+
if (currentGroup.length > 0) groups.push(currentGroup);
|
|
67
|
+
return groups;
|
|
68
|
+
}
|
|
69
|
+
function reorderTaskIds(taskIds, activeId, targetGroupIndex, targetTaskIndex, projectedDepth) {
|
|
70
|
+
const flattened = flattenTaskIds(taskIds);
|
|
71
|
+
const activeIndex = flattened.findIndex((t)=>t.id === activeId);
|
|
72
|
+
if (-1 === activeIndex) return taskIds;
|
|
73
|
+
const filteredFlattened = flattened.filter((t)=>t.id !== activeId);
|
|
74
|
+
const filteredTaskIds = taskIds.map((group)=>group.filter((id)=>id !== activeId)).filter((group)=>group.length > 0);
|
|
75
|
+
const filteredWithIndices = flattenTaskIds(filteredTaskIds);
|
|
76
|
+
let targetFilteredIndex = filteredWithIndices.length;
|
|
77
|
+
for(let i = 0; i < filteredWithIndices.length; i++){
|
|
78
|
+
const item = filteredWithIndices[i];
|
|
79
|
+
if (item) {
|
|
80
|
+
if (item.groupIndex === targetGroupIndex && item.taskIndex === targetTaskIndex) {
|
|
81
|
+
targetFilteredIndex = i;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
if (item.groupIndex > targetGroupIndex) {
|
|
85
|
+
targetFilteredIndex = i;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const activeItem = flattened[activeIndex];
|
|
91
|
+
if (!activeItem) return taskIds;
|
|
92
|
+
let newGroupIndex = targetGroupIndex;
|
|
93
|
+
let newDepth = projectedDepth;
|
|
94
|
+
if (1 === projectedDepth) {
|
|
95
|
+
const prevItem = filteredFlattened[targetFilteredIndex - 1];
|
|
96
|
+
if (prevItem) {
|
|
97
|
+
const prevOriginal = filteredWithIndices[targetFilteredIndex - 1];
|
|
98
|
+
const prevGroupLength = prevOriginal ? filteredTaskIds[prevOriginal.groupIndex]?.length : 0;
|
|
99
|
+
if (prevOriginal && prevGroupLength && prevGroupLength > 0) {
|
|
100
|
+
for (const originalGroup of taskIds)if (originalGroup.includes(prevItem.id) && originalGroup.length > 1) {
|
|
101
|
+
newGroupIndex = prevOriginal.groupIndex;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const result = [
|
|
108
|
+
...filteredFlattened
|
|
109
|
+
];
|
|
110
|
+
result.splice(targetFilteredIndex, 0, {
|
|
111
|
+
...activeItem,
|
|
112
|
+
depth: newDepth,
|
|
113
|
+
groupIndex: newGroupIndex
|
|
114
|
+
});
|
|
115
|
+
return buildTaskIdGroupsFromReorder(result, projectedDepth, targetFilteredIndex);
|
|
116
|
+
}
|
|
117
|
+
function buildTaskIdGroupsFromReorder(flattenedTaskIds, movedItemDepth, movedItemIndex) {
|
|
118
|
+
const groups = [];
|
|
119
|
+
let currentGroup = [];
|
|
120
|
+
for(let i = 0; i < flattenedTaskIds.length; i++){
|
|
121
|
+
const item = flattenedTaskIds[i];
|
|
122
|
+
if (!item) continue;
|
|
123
|
+
const isMovedItem = i === movedItemIndex;
|
|
124
|
+
const prevItem = flattenedTaskIds[i - 1];
|
|
125
|
+
if (0 === currentGroup.length) currentGroup.push(item.id);
|
|
126
|
+
else if (isMovedItem && 1 === movedItemDepth) currentGroup.push(item.id);
|
|
127
|
+
else if (isMovedItem && 0 === movedItemDepth) {
|
|
128
|
+
if (currentGroup.length > 0) groups.push(currentGroup);
|
|
129
|
+
currentGroup = [
|
|
130
|
+
item.id
|
|
131
|
+
];
|
|
132
|
+
} else if (1 !== item.depth || prevItem?.depth !== 1 || isMovedItem) {
|
|
133
|
+
groups.push(currentGroup);
|
|
134
|
+
currentGroup = [
|
|
135
|
+
item.id
|
|
136
|
+
];
|
|
137
|
+
} else if (item.groupIndex === prevItem.groupIndex) currentGroup.push(item.id);
|
|
138
|
+
else {
|
|
139
|
+
groups.push(currentGroup);
|
|
140
|
+
currentGroup = [
|
|
141
|
+
item.id
|
|
142
|
+
];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (currentGroup.length > 0) groups.push(currentGroup);
|
|
146
|
+
return groups;
|
|
147
|
+
}
|
|
148
|
+
function removeTaskFromTaskIds(taskIds, taskId) {
|
|
149
|
+
return taskIds.map((group)=>group.filter((id)=>id !== taskId)).filter((group)=>group.length > 0);
|
|
150
|
+
}
|
|
151
|
+
function insertTaskAtPosition(taskIds, taskId, position) {
|
|
152
|
+
const { groupIndex, taskIndex, isParallel } = position;
|
|
153
|
+
const newTaskIds = taskIds.map((group)=>[
|
|
154
|
+
...group
|
|
155
|
+
]);
|
|
156
|
+
if (groupIndex >= newTaskIds.length) if (isParallel && newTaskIds.length > 0) {
|
|
157
|
+
const lastGroup = newTaskIds[newTaskIds.length - 1];
|
|
158
|
+
if (lastGroup && lastGroup.length > 0) lastGroup.push(taskId);
|
|
159
|
+
else newTaskIds.push([
|
|
160
|
+
taskId
|
|
161
|
+
]);
|
|
162
|
+
} else newTaskIds.push([
|
|
163
|
+
taskId
|
|
164
|
+
]);
|
|
165
|
+
else if (isParallel) {
|
|
166
|
+
const targetGroup = newTaskIds[groupIndex];
|
|
167
|
+
if (targetGroup) targetGroup.splice(taskIndex, 0, taskId);
|
|
168
|
+
else newTaskIds.splice(groupIndex, 0, [
|
|
169
|
+
taskId
|
|
170
|
+
]);
|
|
171
|
+
} else newTaskIds.splice(groupIndex, 0, [
|
|
172
|
+
taskId
|
|
173
|
+
]);
|
|
174
|
+
return newTaskIds;
|
|
175
|
+
}
|
|
176
|
+
function moveTaskWithinStage(taskIds, taskId, position) {
|
|
177
|
+
const withoutTask = removeTaskFromTaskIds(taskIds, taskId);
|
|
178
|
+
return insertTaskAtPosition(withoutTask, taskId, position);
|
|
179
|
+
}
|
|
180
|
+
function moveTaskBetweenStages(sourceTaskIds, targetTaskIds, taskId, position) {
|
|
181
|
+
const newSourceTaskIds = removeTaskFromTaskIds(sourceTaskIds, taskId);
|
|
182
|
+
const newTargetTaskIds = insertTaskAtPosition(targetTaskIds, taskId, position);
|
|
183
|
+
return {
|
|
184
|
+
sourceTaskIds: newSourceTaskIds,
|
|
185
|
+
targetTaskIds: newTargetTaskIds
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
exports.buildTaskIdGroups = __webpack_exports__.buildTaskIdGroups;
|
|
189
|
+
exports.flattenTaskIds = __webpack_exports__.flattenTaskIds;
|
|
190
|
+
exports.insertTaskAtPosition = __webpack_exports__.insertTaskAtPosition;
|
|
191
|
+
exports.moveTaskBetweenStages = __webpack_exports__.moveTaskBetweenStages;
|
|
192
|
+
exports.moveTaskWithinStage = __webpack_exports__.moveTaskWithinStage;
|
|
193
|
+
exports.removeTaskFromTaskIds = __webpack_exports__.removeTaskFromTaskIds;
|
|
194
|
+
exports.reorderTaskIds = __webpack_exports__.reorderTaskIds;
|
|
195
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
196
|
+
"buildTaskIdGroups",
|
|
197
|
+
"flattenTaskIds",
|
|
198
|
+
"insertTaskAtPosition",
|
|
199
|
+
"moveTaskBetweenStages",
|
|
200
|
+
"moveTaskWithinStage",
|
|
201
|
+
"removeTaskFromTaskIds",
|
|
202
|
+
"reorderTaskIds"
|
|
203
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
204
|
+
Object.defineProperty(exports, '__esModule', {
|
|
205
|
+
value: true
|
|
206
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface TaskInsertPosition {
|
|
2
|
+
groupIndex: number;
|
|
3
|
+
taskIndex: number;
|
|
4
|
+
isParallel: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface FlattenedTaskId {
|
|
7
|
+
id: string;
|
|
8
|
+
groupIndex: number;
|
|
9
|
+
taskIndex: number;
|
|
10
|
+
depth: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function flattenTaskIds(taskIds: string[][]): FlattenedTaskId[];
|
|
13
|
+
export declare function buildTaskIdGroups(flattenedTaskIds: FlattenedTaskId[]): string[][];
|
|
14
|
+
export declare function reorderTaskIds(taskIds: string[][], activeId: string, targetGroupIndex: number, targetTaskIndex: number, projectedDepth: number): string[][];
|
|
15
|
+
export declare function removeTaskFromTaskIds(taskIds: string[][], taskId: string): string[][];
|
|
16
|
+
export declare function insertTaskAtPosition(taskIds: string[][], taskId: string, position: TaskInsertPosition): string[][];
|
|
17
|
+
export declare function moveTaskWithinStage(taskIds: string[][], taskId: string, position: TaskInsertPosition): string[][];
|
|
18
|
+
export declare function moveTaskBetweenStages(sourceTaskIds: string[][], targetTaskIds: string[][], taskId: string, position: TaskInsertPosition): {
|
|
19
|
+
sourceTaskIds: string[][];
|
|
20
|
+
targetTaskIds: string[][];
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=taskReorderUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskReorderUtils.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/TaskNode/taskReorderUtils.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,eAAe;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAKD,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,eAAe,EAAE,CAmBrE;AAKD,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,eAAe,EAAE,GAAG,MAAM,EAAE,EAAE,CA4BjF;AAcD,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EAAE,EAAE,EACnB,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,MAAM,GACrB,MAAM,EAAE,EAAE,CAyEZ;AA+DD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,CAIrF;AAWD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EAAE,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,kBAAkB,GAC3B,MAAM,EAAE,EAAE,CAgCZ;AAWD,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EAAE,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,kBAAkB,GAC3B,MAAM,EAAE,EAAE,CAKZ;AAYD,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,MAAM,EAAE,EAAE,EACzB,aAAa,EAAE,MAAM,EAAE,EAAE,EACzB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,kBAAkB,GAC3B;IAAE,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,CAQ1D"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
function flattenTaskIds(taskIds) {
|
|
2
|
+
const flattened = [];
|
|
3
|
+
for (const [groupIndex, group] of taskIds.entries()){
|
|
4
|
+
if (!group) continue;
|
|
5
|
+
const depth = group.length > 1 ? 1 : 0;
|
|
6
|
+
for (const [taskIndex, id] of group.entries())if (id) flattened.push({
|
|
7
|
+
id,
|
|
8
|
+
groupIndex,
|
|
9
|
+
taskIndex,
|
|
10
|
+
depth
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return flattened;
|
|
14
|
+
}
|
|
15
|
+
function buildTaskIdGroups(flattenedTaskIds) {
|
|
16
|
+
const groups = [];
|
|
17
|
+
let currentGroup = [];
|
|
18
|
+
let previousDepth = null;
|
|
19
|
+
let previousGroupIndex = null;
|
|
20
|
+
for (const item of flattenedTaskIds){
|
|
21
|
+
if (null === previousDepth) currentGroup.push(item.id);
|
|
22
|
+
else if (1 === item.depth && 1 === previousDepth && item.groupIndex === previousGroupIndex) currentGroup.push(item.id);
|
|
23
|
+
else {
|
|
24
|
+
if (currentGroup.length > 0) groups.push(currentGroup);
|
|
25
|
+
currentGroup = [
|
|
26
|
+
item.id
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
previousDepth = item.depth;
|
|
30
|
+
previousGroupIndex = item.groupIndex;
|
|
31
|
+
}
|
|
32
|
+
if (currentGroup.length > 0) groups.push(currentGroup);
|
|
33
|
+
return groups;
|
|
34
|
+
}
|
|
35
|
+
function reorderTaskIds(taskIds, activeId, targetGroupIndex, targetTaskIndex, projectedDepth) {
|
|
36
|
+
const flattened = flattenTaskIds(taskIds);
|
|
37
|
+
const activeIndex = flattened.findIndex((t)=>t.id === activeId);
|
|
38
|
+
if (-1 === activeIndex) return taskIds;
|
|
39
|
+
const filteredFlattened = flattened.filter((t)=>t.id !== activeId);
|
|
40
|
+
const filteredTaskIds = taskIds.map((group)=>group.filter((id)=>id !== activeId)).filter((group)=>group.length > 0);
|
|
41
|
+
const filteredWithIndices = flattenTaskIds(filteredTaskIds);
|
|
42
|
+
let targetFilteredIndex = filteredWithIndices.length;
|
|
43
|
+
for(let i = 0; i < filteredWithIndices.length; i++){
|
|
44
|
+
const item = filteredWithIndices[i];
|
|
45
|
+
if (item) {
|
|
46
|
+
if (item.groupIndex === targetGroupIndex && item.taskIndex === targetTaskIndex) {
|
|
47
|
+
targetFilteredIndex = i;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
if (item.groupIndex > targetGroupIndex) {
|
|
51
|
+
targetFilteredIndex = i;
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const activeItem = flattened[activeIndex];
|
|
57
|
+
if (!activeItem) return taskIds;
|
|
58
|
+
let newGroupIndex = targetGroupIndex;
|
|
59
|
+
let newDepth = projectedDepth;
|
|
60
|
+
if (1 === projectedDepth) {
|
|
61
|
+
const prevItem = filteredFlattened[targetFilteredIndex - 1];
|
|
62
|
+
if (prevItem) {
|
|
63
|
+
const prevOriginal = filteredWithIndices[targetFilteredIndex - 1];
|
|
64
|
+
const prevGroupLength = prevOriginal ? filteredTaskIds[prevOriginal.groupIndex]?.length : 0;
|
|
65
|
+
if (prevOriginal && prevGroupLength && prevGroupLength > 0) {
|
|
66
|
+
for (const originalGroup of taskIds)if (originalGroup.includes(prevItem.id) && originalGroup.length > 1) {
|
|
67
|
+
newGroupIndex = prevOriginal.groupIndex;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const result = [
|
|
74
|
+
...filteredFlattened
|
|
75
|
+
];
|
|
76
|
+
result.splice(targetFilteredIndex, 0, {
|
|
77
|
+
...activeItem,
|
|
78
|
+
depth: newDepth,
|
|
79
|
+
groupIndex: newGroupIndex
|
|
80
|
+
});
|
|
81
|
+
return buildTaskIdGroupsFromReorder(result, projectedDepth, targetFilteredIndex);
|
|
82
|
+
}
|
|
83
|
+
function buildTaskIdGroupsFromReorder(flattenedTaskIds, movedItemDepth, movedItemIndex) {
|
|
84
|
+
const groups = [];
|
|
85
|
+
let currentGroup = [];
|
|
86
|
+
for(let i = 0; i < flattenedTaskIds.length; i++){
|
|
87
|
+
const item = flattenedTaskIds[i];
|
|
88
|
+
if (!item) continue;
|
|
89
|
+
const isMovedItem = i === movedItemIndex;
|
|
90
|
+
const prevItem = flattenedTaskIds[i - 1];
|
|
91
|
+
if (0 === currentGroup.length) currentGroup.push(item.id);
|
|
92
|
+
else if (isMovedItem && 1 === movedItemDepth) currentGroup.push(item.id);
|
|
93
|
+
else if (isMovedItem && 0 === movedItemDepth) {
|
|
94
|
+
if (currentGroup.length > 0) groups.push(currentGroup);
|
|
95
|
+
currentGroup = [
|
|
96
|
+
item.id
|
|
97
|
+
];
|
|
98
|
+
} else if (1 !== item.depth || prevItem?.depth !== 1 || isMovedItem) {
|
|
99
|
+
groups.push(currentGroup);
|
|
100
|
+
currentGroup = [
|
|
101
|
+
item.id
|
|
102
|
+
];
|
|
103
|
+
} else if (item.groupIndex === prevItem.groupIndex) currentGroup.push(item.id);
|
|
104
|
+
else {
|
|
105
|
+
groups.push(currentGroup);
|
|
106
|
+
currentGroup = [
|
|
107
|
+
item.id
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (currentGroup.length > 0) groups.push(currentGroup);
|
|
112
|
+
return groups;
|
|
113
|
+
}
|
|
114
|
+
function removeTaskFromTaskIds(taskIds, taskId) {
|
|
115
|
+
return taskIds.map((group)=>group.filter((id)=>id !== taskId)).filter((group)=>group.length > 0);
|
|
116
|
+
}
|
|
117
|
+
function insertTaskAtPosition(taskIds, taskId, position) {
|
|
118
|
+
const { groupIndex, taskIndex, isParallel } = position;
|
|
119
|
+
const newTaskIds = taskIds.map((group)=>[
|
|
120
|
+
...group
|
|
121
|
+
]);
|
|
122
|
+
if (groupIndex >= newTaskIds.length) if (isParallel && newTaskIds.length > 0) {
|
|
123
|
+
const lastGroup = newTaskIds[newTaskIds.length - 1];
|
|
124
|
+
if (lastGroup && lastGroup.length > 0) lastGroup.push(taskId);
|
|
125
|
+
else newTaskIds.push([
|
|
126
|
+
taskId
|
|
127
|
+
]);
|
|
128
|
+
} else newTaskIds.push([
|
|
129
|
+
taskId
|
|
130
|
+
]);
|
|
131
|
+
else if (isParallel) {
|
|
132
|
+
const targetGroup = newTaskIds[groupIndex];
|
|
133
|
+
if (targetGroup) targetGroup.splice(taskIndex, 0, taskId);
|
|
134
|
+
else newTaskIds.splice(groupIndex, 0, [
|
|
135
|
+
taskId
|
|
136
|
+
]);
|
|
137
|
+
} else newTaskIds.splice(groupIndex, 0, [
|
|
138
|
+
taskId
|
|
139
|
+
]);
|
|
140
|
+
return newTaskIds;
|
|
141
|
+
}
|
|
142
|
+
function moveTaskWithinStage(taskIds, taskId, position) {
|
|
143
|
+
const withoutTask = removeTaskFromTaskIds(taskIds, taskId);
|
|
144
|
+
return insertTaskAtPosition(withoutTask, taskId, position);
|
|
145
|
+
}
|
|
146
|
+
function moveTaskBetweenStages(sourceTaskIds, targetTaskIds, taskId, position) {
|
|
147
|
+
const newSourceTaskIds = removeTaskFromTaskIds(sourceTaskIds, taskId);
|
|
148
|
+
const newTargetTaskIds = insertTaskAtPosition(targetTaskIds, taskId, position);
|
|
149
|
+
return {
|
|
150
|
+
sourceTaskIds: newSourceTaskIds,
|
|
151
|
+
targetTaskIds: newTargetTaskIds
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
export { buildTaskIdGroups, flattenTaskIds, insertTaskAtPosition, moveTaskBetweenStages, moveTaskWithinStage, removeTaskFromTaskIds, reorderTaskIds };
|