flow-lib-creomnia 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/lib/assets/icons/ChoiceNodeIcon.svg +16 -0
- package/lib/assets/icons/LeftArrowIcon.svg +3 -0
- package/lib/assets/icons/ParallelIcon.svg +5 -0
- package/lib/assets/icons/RightArrowIcon.svg +3 -0
- package/lib/assets/icons/flowIcon.svg +7 -0
- package/lib/config/colors.d.ts +13 -0
- package/lib/config/colors.js +16 -0
- package/lib/config/index.d.ts +20 -0
- package/lib/config/index.js +28 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +24 -0
- package/lib/modules/common/components/HorizontalDrawer/index.d.ts +9 -0
- package/lib/modules/common/components/HorizontalDrawer/index.js +86 -0
- package/lib/modules/common/components/ZoomToolbar/index.d.ts +8 -0
- package/lib/modules/common/components/ZoomToolbar/index.js +15 -0
- package/lib/modules/common/components/ZoomToolbar/styled.d.ts +9 -0
- package/lib/modules/common/components/ZoomToolbar/styled.js +13 -0
- package/lib/modules/common/components/index.d.ts +2 -0
- package/lib/modules/common/components/index.js +10 -0
- package/lib/modules/common/contexts/ThemeContext/index.d.ts +24 -0
- package/lib/modules/common/contexts/ThemeContext/index.js +9 -0
- package/lib/modules/common/hooks/useDragNode.d.ts +10 -0
- package/lib/modules/common/hooks/useDragNode.js +27 -0
- package/lib/modules/common/hooks/useDropNode.d.ts +11 -0
- package/lib/modules/common/hooks/useDropNode.js +16 -0
- package/lib/modules/common/types/index.d.ts +69 -0
- package/lib/modules/common/types/index.js +2 -0
- package/lib/modules/connection/components/AddButton/index.d.ts +16 -0
- package/lib/modules/connection/components/AddButton/index.js +45 -0
- package/lib/modules/connection/components/AddButton/styled.d.ts +29 -0
- package/lib/modules/connection/components/AddButton/styled.js +41 -0
- package/lib/modules/connection/components/BaseConnection/index.d.ts +4 -0
- package/lib/modules/connection/components/BaseConnection/index.js +40 -0
- package/lib/modules/connection/components/BaseConnection/styled.d.ts +18 -0
- package/lib/modules/connection/components/BaseConnection/styled.js +28 -0
- package/lib/modules/connection/components/ConnectionWithButton/index.d.ts +12 -0
- package/lib/modules/connection/components/ConnectionWithButton/index.js +83 -0
- package/lib/modules/connection/components/ConnectionWithButton/styled.d.ts +44 -0
- package/lib/modules/connection/components/ConnectionWithButton/styled.js +55 -0
- package/lib/modules/connection/enums/index.d.ts +4 -0
- package/lib/modules/connection/enums/index.js +8 -0
- package/lib/modules/connection/index.d.ts +9 -0
- package/lib/modules/connection/index.js +11 -0
- package/lib/modules/connection/services/connectionParametersServices.d.ts +28 -0
- package/lib/modules/connection/services/connectionParametersServices.js +84 -0
- package/lib/modules/connection/services/connectionServices.d.ts +7 -0
- package/lib/modules/connection/services/connectionServices.js +82 -0
- package/lib/modules/connection/types/index.d.ts +41 -0
- package/lib/modules/connection/types/index.js +2 -0
- package/lib/modules/flow/components/FlowSandbox/index.d.ts +18 -0
- package/lib/modules/flow/components/FlowSandbox/index.js +63 -0
- package/lib/modules/flow/components/FlowSandbox/styled.d.ts +9 -0
- package/lib/modules/flow/components/FlowSandbox/styled.js +32 -0
- package/lib/modules/flow/components/NodesFlow/index.d.ts +4 -0
- package/lib/modules/flow/components/NodesFlow/index.js +36 -0
- package/lib/modules/flow/components/Space/index.d.ts +3 -0
- package/lib/modules/flow/components/Space/index.js +35 -0
- package/lib/modules/flow/components/Space/styled.d.ts +2 -0
- package/lib/modules/flow/components/Space/styled.js +13 -0
- package/lib/modules/flow/context/FlowPosition/index.d.ts +13 -0
- package/lib/modules/flow/context/FlowPosition/index.js +23 -0
- package/lib/modules/flow/types/index.d.ts +29 -0
- package/lib/modules/flow/types/index.js +2 -0
- package/lib/modules/node/components/BaseNode/index.d.ts +4 -0
- package/lib/modules/node/components/BaseNode/index.js +51 -0
- package/lib/modules/node/components/BaseNode/styled.d.ts +18 -0
- package/lib/modules/node/components/BaseNode/styled.js +98 -0
- package/lib/modules/node/components/ChoiseNode/index.d.ts +4 -0
- package/lib/modules/node/components/ChoiseNode/index.js +45 -0
- package/lib/modules/node/components/ChoiseNode/styled.d.ts +20 -0
- package/lib/modules/node/components/ChoiseNode/styled.js +39 -0
- package/lib/modules/node/components/DragWrapper/index.d.ts +8 -0
- package/lib/modules/node/components/DragWrapper/index.js +15 -0
- package/lib/modules/node/components/EndNode/index.d.ts +3 -0
- package/lib/modules/node/components/EndNode/index.js +8 -0
- package/lib/modules/node/components/EndNode/styled.d.ts +16 -0
- package/lib/modules/node/components/EndNode/styled.js +22 -0
- package/lib/modules/node/components/HubNode/index.d.ts +3 -0
- package/lib/modules/node/components/HubNode/index.js +8 -0
- package/lib/modules/node/components/HubNode/styled.d.ts +2 -0
- package/lib/modules/node/components/HubNode/styled.js +12 -0
- package/lib/modules/node/components/NodesMenu/index.d.ts +14 -0
- package/lib/modules/node/components/NodesMenu/index.js +28 -0
- package/lib/modules/node/components/NodesMenu/styled.d.ts +127 -0
- package/lib/modules/node/components/NodesMenu/styled.js +69 -0
- package/lib/modules/node/components/ParallelNode/index.d.ts +4 -0
- package/lib/modules/node/components/ParallelNode/index.js +22 -0
- package/lib/modules/node/components/ParallelNode/styled.d.ts +2 -0
- package/lib/modules/node/components/ParallelNode/styled.js +16 -0
- package/lib/modules/node/components/StartNode/index.d.ts +3 -0
- package/lib/modules/node/components/StartNode/index.js +8 -0
- package/lib/modules/node/components/StartNode/styled.d.ts +16 -0
- package/lib/modules/node/components/StartNode/styled.js +22 -0
- package/lib/modules/node/contexts/SettingsContext/index.d.ts +10 -0
- package/lib/modules/node/contexts/SettingsContext/index.js +47 -0
- package/lib/modules/node/contexts/SettingsContext/styled.d.ts +20 -0
- package/lib/modules/node/contexts/SettingsContext/styled.js +40 -0
- package/lib/modules/node/enums/index.d.ts +8 -0
- package/lib/modules/node/enums/index.js +12 -0
- package/lib/modules/node/index.d.ts +10 -0
- package/lib/modules/node/index.js +22 -0
- package/lib/modules/node/services/expandCoefficientServices.d.ts +24 -0
- package/lib/modules/node/services/expandCoefficientServices.js +47 -0
- package/lib/modules/node/services/nodeServices.d.ts +11 -0
- package/lib/modules/node/services/nodeServices.js +145 -0
- package/lib/modules/node/services/pointCalculationServices.d.ts +11 -0
- package/lib/modules/node/services/pointCalculationServices.js +22 -0
- package/lib/modules/node/types/index.d.ts +49 -0
- package/lib/modules/node/types/index.js +2 -0
- package/package.json +65 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NodeType } from '../types';
|
|
3
|
+
declare class ExpandCoefficientServices {
|
|
4
|
+
calculateNodeExpandCoefficient: (nodes: NodeType[]) => {
|
|
5
|
+
expandCoefficient: number;
|
|
6
|
+
id: string;
|
|
7
|
+
name?: string | undefined;
|
|
8
|
+
extensionName?: string | undefined;
|
|
9
|
+
description?: string | undefined;
|
|
10
|
+
icon?: JSX.Element | undefined;
|
|
11
|
+
type: import("../enums").NodeTypeEnum;
|
|
12
|
+
childrenIds?: string[] | undefined;
|
|
13
|
+
parentIds?: string[] | undefined;
|
|
14
|
+
settings?: import("../types").SettingsType | undefined;
|
|
15
|
+
startSectionNodeId?: string | undefined;
|
|
16
|
+
endSectionNodeId?: string | undefined;
|
|
17
|
+
blockedChildrenIds?: string[] | undefined;
|
|
18
|
+
leftChildrenId?: string | undefined;
|
|
19
|
+
rightChildrenId?: string | undefined;
|
|
20
|
+
childFlowId?: string | undefined;
|
|
21
|
+
}[];
|
|
22
|
+
}
|
|
23
|
+
export declare const expandCoefficientServices: ExpandCoefficientServices;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.expandCoefficientServices = void 0;
|
|
4
|
+
const config_1 = require("../../../config");
|
|
5
|
+
class ExpandCoefficientServices {
|
|
6
|
+
calculateNodeExpandCoefficient = (nodes) => {
|
|
7
|
+
const calculateNodeExpandCoefficientRecursion = ({ startNode, expandCoefficient, indexOfEncapsulation, }) => {
|
|
8
|
+
if (!startNode.childrenIds?.length ||
|
|
9
|
+
(startNode.startSectionNodeId && indexOfEncapsulation <= 0)) {
|
|
10
|
+
return expandCoefficient;
|
|
11
|
+
}
|
|
12
|
+
if (startNode.startSectionNodeId && indexOfEncapsulation > 0) {
|
|
13
|
+
const childrenNodes = nodes.filter((node) => startNode.childrenIds?.includes(node.id));
|
|
14
|
+
const nextExpandCoefficient = calculateNodeExpandCoefficientRecursion({
|
|
15
|
+
startNode: childrenNodes[0],
|
|
16
|
+
expandCoefficient: 0,
|
|
17
|
+
indexOfEncapsulation: indexOfEncapsulation - 1,
|
|
18
|
+
});
|
|
19
|
+
return Math.max(expandCoefficient, nextExpandCoefficient);
|
|
20
|
+
}
|
|
21
|
+
const childrenNodes = nodes.filter((node) => startNode.childrenIds?.includes(node.id));
|
|
22
|
+
const childrenNodesExpandCoefficient = childrenNodes.map((node) => {
|
|
23
|
+
const isExpandable = config_1.Config.NODES_WITH_DOUBLE_CONNECTION.includes(startNode.type);
|
|
24
|
+
const calculatedExpandCoefficient = isExpandable
|
|
25
|
+
? expandCoefficient + 1
|
|
26
|
+
: expandCoefficient;
|
|
27
|
+
return calculateNodeExpandCoefficientRecursion({
|
|
28
|
+
startNode: node,
|
|
29
|
+
expandCoefficient: calculatedExpandCoefficient,
|
|
30
|
+
indexOfEncapsulation: (startNode.childrenIds?.length || 0) > 1
|
|
31
|
+
? indexOfEncapsulation + 1
|
|
32
|
+
: indexOfEncapsulation,
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
return Math.max(...childrenNodesExpandCoefficient);
|
|
36
|
+
};
|
|
37
|
+
return nodes.map((node) => ({
|
|
38
|
+
...node,
|
|
39
|
+
expandCoefficient: calculateNodeExpandCoefficientRecursion({
|
|
40
|
+
startNode: node,
|
|
41
|
+
expandCoefficient: 0,
|
|
42
|
+
indexOfEncapsulation: 0,
|
|
43
|
+
}),
|
|
44
|
+
}));
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
exports.expandCoefficientServices = new ExpandCoefficientServices();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseDrawableNodeType, NodeType } from '../types';
|
|
2
|
+
import { NodeCalculationServices } from './pointCalculationServices';
|
|
3
|
+
declare class NodeServices extends NodeCalculationServices {
|
|
4
|
+
combineNodes: (currentNodes: NodeType[], nodes: NodeType[]) => BaseDrawableNodeType[];
|
|
5
|
+
createListOfStartNodesAndEndNodes: (nodes: NodeType[]) => {
|
|
6
|
+
startNodeList: NodeType[];
|
|
7
|
+
nodeListWithEndNode: NodeType[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare const nodeServices: NodeServices;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nodeServices = void 0;
|
|
4
|
+
const enums_1 = require("../enums");
|
|
5
|
+
const pointCalculationServices_1 = require("./pointCalculationServices");
|
|
6
|
+
class NodeServices extends pointCalculationServices_1.NodeCalculationServices {
|
|
7
|
+
combineNodes = (currentNodes, nodes) => {
|
|
8
|
+
const hubNodes = nodes.reduce((hubNodes, node) => {
|
|
9
|
+
if (node.startSectionNodeId) {
|
|
10
|
+
return {
|
|
11
|
+
...hubNodes,
|
|
12
|
+
[node.id]: {
|
|
13
|
+
awaitedIds: [],
|
|
14
|
+
expectedLength: node.parentIds?.length || 0,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return hubNodes;
|
|
19
|
+
}, {});
|
|
20
|
+
const combineNodesRecursion = ({ currentNodes, combinedNodes, hubNodes, iteration, }) => {
|
|
21
|
+
if (currentNodes.length === 0) {
|
|
22
|
+
return combinedNodes;
|
|
23
|
+
}
|
|
24
|
+
const nextNodes = currentNodes.reduce((nextNode, currentNode) => {
|
|
25
|
+
const childrenIds = currentNode.childrenIds || [];
|
|
26
|
+
const childNodes = childrenIds
|
|
27
|
+
.map((childId) => {
|
|
28
|
+
return nodes.find((node) => node.id === childId) || [];
|
|
29
|
+
})
|
|
30
|
+
.flat();
|
|
31
|
+
const blockedChildrenIds = currentNode.blockedChildrenIds || [];
|
|
32
|
+
const nextNodes = childNodes.filter((childNode) => {
|
|
33
|
+
return !blockedChildrenIds.includes(childNode.id);
|
|
34
|
+
});
|
|
35
|
+
return [...nextNode, ...nextNodes];
|
|
36
|
+
}, []);
|
|
37
|
+
const { childrenNodes, updatedHubNodes } = nextNodes.reduce(({ childrenNodes, updatedHubNodes, }, nextNode) => {
|
|
38
|
+
const hubNodeChildIds = Object.keys(updatedHubNodes).filter((hubNodeId) => nextNode.childrenIds?.includes(hubNodeId));
|
|
39
|
+
if (hubNodeChildIds.length > 0) {
|
|
40
|
+
const hubNodeList = hubNodeChildIds.map((hubNodeId) => {
|
|
41
|
+
return {
|
|
42
|
+
[hubNodeId]: {
|
|
43
|
+
awaitedIds: [
|
|
44
|
+
...updatedHubNodes[hubNodeId].awaitedIds,
|
|
45
|
+
nextNode.id,
|
|
46
|
+
],
|
|
47
|
+
expectedLength: updatedHubNodes[hubNodeId].expectedLength,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
const newUpdatedHubNodes = hubNodeList.reduce((newUpdatedHubNodes, hubNodeListItem) => {
|
|
52
|
+
return {
|
|
53
|
+
...newUpdatedHubNodes,
|
|
54
|
+
...hubNodeListItem,
|
|
55
|
+
};
|
|
56
|
+
}, updatedHubNodes);
|
|
57
|
+
const currentHubNodeRecord = Object.entries(newUpdatedHubNodes).find((hubNodeRecord) => hubNodeRecord[1].awaitedIds.includes(nextNode.id));
|
|
58
|
+
const [currentHubNodeId, currentHubNodeData] = currentHubNodeRecord;
|
|
59
|
+
const isFull = currentHubNodeData?.awaitedIds.length ===
|
|
60
|
+
currentHubNodeData?.expectedLength;
|
|
61
|
+
return {
|
|
62
|
+
childrenNodes: isFull
|
|
63
|
+
? [...childrenNodes, nextNode]
|
|
64
|
+
: [
|
|
65
|
+
...childrenNodes,
|
|
66
|
+
{ ...nextNode, blockedChildrenIds: [currentHubNodeId] },
|
|
67
|
+
],
|
|
68
|
+
updatedHubNodes: {
|
|
69
|
+
...updatedHubNodes,
|
|
70
|
+
[currentHubNodeId]: currentHubNodeData,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
childrenNodes: [...childrenNodes, nextNode],
|
|
76
|
+
updatedHubNodes,
|
|
77
|
+
};
|
|
78
|
+
}, {
|
|
79
|
+
childrenNodes: [],
|
|
80
|
+
updatedHubNodes: hubNodes,
|
|
81
|
+
});
|
|
82
|
+
const drawableNodes = currentNodes.map((node) => {
|
|
83
|
+
const startSectionNodeId = node.startSectionNodeId;
|
|
84
|
+
const parent = startSectionNodeId
|
|
85
|
+
? combinedNodes.find((node) => node.id === startSectionNodeId)
|
|
86
|
+
: combinedNodes.find((parentNode) => parentNode.nodeData?.childrenIds?.includes(node.id));
|
|
87
|
+
// TODO it works when node has 2 children but should be refactored
|
|
88
|
+
const isSecondBranch = parent?.nodeData?.rightChildrenId === node.id;
|
|
89
|
+
const renderPoint = this.calculatePoint({
|
|
90
|
+
layer: iteration,
|
|
91
|
+
currentNodeNumber: isSecondBranch ? 1 : 0,
|
|
92
|
+
parentPositionX: parent?.renderPoint?.x,
|
|
93
|
+
expandCoefficient: node.expandCoefficient || 0,
|
|
94
|
+
childrenInRow: parent?.nodeData?.childrenIds?.length || 0,
|
|
95
|
+
isHubNode: !!startSectionNodeId,
|
|
96
|
+
});
|
|
97
|
+
return {
|
|
98
|
+
id: node.id,
|
|
99
|
+
renderPoint,
|
|
100
|
+
nodeData: node,
|
|
101
|
+
type: node.type,
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
return combineNodesRecursion({
|
|
105
|
+
currentNodes: childrenNodes,
|
|
106
|
+
combinedNodes: [...combinedNodes, ...drawableNodes],
|
|
107
|
+
hubNodes: updatedHubNodes,
|
|
108
|
+
iteration: iteration + 1,
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
return combineNodesRecursion({
|
|
112
|
+
currentNodes,
|
|
113
|
+
combinedNodes: [],
|
|
114
|
+
hubNodes,
|
|
115
|
+
iteration: 0,
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
createListOfStartNodesAndEndNodes = (nodes) => {
|
|
119
|
+
const possibleFirstNode = nodes.find((node) => !node.parentIds?.length || node.parentIds?.length === 0);
|
|
120
|
+
const lastNodes = nodes.filter((node) => node.childrenIds?.length === 0);
|
|
121
|
+
const lastNodesIds = lastNodes.length
|
|
122
|
+
? lastNodes.map((node) => node.id)
|
|
123
|
+
: ['startNode'];
|
|
124
|
+
const startNodeList = [
|
|
125
|
+
{
|
|
126
|
+
id: 'startNode',
|
|
127
|
+
childrenIds: possibleFirstNode ? [possibleFirstNode.id] : ['endNode'],
|
|
128
|
+
parentIds: [],
|
|
129
|
+
type: enums_1.NodeTypeEnum.StartNode,
|
|
130
|
+
expandCoefficient: 0,
|
|
131
|
+
},
|
|
132
|
+
];
|
|
133
|
+
const nodeListWithEndNode = [
|
|
134
|
+
...nodes.map((node) => node.childrenIds?.length ? node : { ...node, childrenIds: ['endNode'] }),
|
|
135
|
+
{
|
|
136
|
+
id: 'endNode',
|
|
137
|
+
childrenIds: [],
|
|
138
|
+
parentIds: lastNodesIds,
|
|
139
|
+
type: enums_1.NodeTypeEnum.EndNode,
|
|
140
|
+
},
|
|
141
|
+
];
|
|
142
|
+
return { startNodeList, nodeListWithEndNode };
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
exports.nodeServices = new NodeServices();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PointType } from '../../common/types';
|
|
2
|
+
export declare class NodeCalculationServices {
|
|
3
|
+
protected calculatePoint: ({ layer, currentNodeNumber, parentPositionX, expandCoefficient, childrenInRow, isHubNode, }: {
|
|
4
|
+
layer: number;
|
|
5
|
+
currentNodeNumber: number;
|
|
6
|
+
parentPositionX?: number | undefined;
|
|
7
|
+
expandCoefficient: number;
|
|
8
|
+
childrenInRow: number;
|
|
9
|
+
isHubNode: boolean;
|
|
10
|
+
}) => PointType;
|
|
11
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NodeCalculationServices = void 0;
|
|
4
|
+
const config_1 = require("../../../config");
|
|
5
|
+
class NodeCalculationServices {
|
|
6
|
+
calculatePoint = ({ layer, currentNodeNumber, parentPositionX, expandCoefficient, childrenInRow, isHubNode, }) => {
|
|
7
|
+
const startPoint = parentPositionX
|
|
8
|
+
? parentPositionX
|
|
9
|
+
: window.screen.width / 2;
|
|
10
|
+
const expand = Math.pow(childrenInRow, expandCoefficient);
|
|
11
|
+
const shift = expand * config_1.Config.HORIZONTAL_SHIFT;
|
|
12
|
+
return {
|
|
13
|
+
x: isHubNode
|
|
14
|
+
? startPoint
|
|
15
|
+
: startPoint -
|
|
16
|
+
(shift * (childrenInRow - 1)) / 2 +
|
|
17
|
+
shift * currentNodeNumber,
|
|
18
|
+
y: config_1.Config.VERTICAL_SHIFT + layer * config_1.Config.VERTICAL_SHIFT,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
exports.NodeCalculationServices = NodeCalculationServices;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PointType, UpdateNodePosition } from '../../common/types';
|
|
3
|
+
import { NodeTypeEnum } from '../enums';
|
|
4
|
+
export type NodesFooterType = {
|
|
5
|
+
saveText?: string;
|
|
6
|
+
cancelText?: string;
|
|
7
|
+
deleteText?: string;
|
|
8
|
+
onSave?: (nodeId: string) => void;
|
|
9
|
+
onCancel?: (nodeId: string) => void;
|
|
10
|
+
onDelete?: (nodeId: string) => void;
|
|
11
|
+
};
|
|
12
|
+
export type SettingsType = {
|
|
13
|
+
settingsForm?: JSX.Element;
|
|
14
|
+
footer?: NodesFooterType;
|
|
15
|
+
customFooter?: JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
export type NodeType = {
|
|
18
|
+
id: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
extensionName?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
icon?: JSX.Element;
|
|
23
|
+
type: NodeTypeEnum;
|
|
24
|
+
childrenIds?: string[];
|
|
25
|
+
parentIds?: string[];
|
|
26
|
+
settings?: SettingsType;
|
|
27
|
+
expandCoefficient?: number;
|
|
28
|
+
startSectionNodeId?: string;
|
|
29
|
+
endSectionNodeId?: string;
|
|
30
|
+
blockedChildrenIds?: string[];
|
|
31
|
+
leftChildrenId?: string;
|
|
32
|
+
rightChildrenId?: string;
|
|
33
|
+
childFlowId?: string;
|
|
34
|
+
};
|
|
35
|
+
export type BaseDrawableNodeType = {
|
|
36
|
+
renderPoint: PointType;
|
|
37
|
+
nodeData?: NodeType;
|
|
38
|
+
id: string;
|
|
39
|
+
type: NodeTypeEnum;
|
|
40
|
+
isProcessed?: boolean;
|
|
41
|
+
isFailed?: boolean;
|
|
42
|
+
failedNodeColor?: string;
|
|
43
|
+
onRedirect?: (flowId: string) => void;
|
|
44
|
+
onUpdatePosition?: UpdateNodePosition;
|
|
45
|
+
};
|
|
46
|
+
export type SettingsContextValueType = {
|
|
47
|
+
node: NodeType | null;
|
|
48
|
+
setNode: (node: NodeType | null) => void;
|
|
49
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "flow-lib-creomnia",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"private": false,
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "jest --config jestconfig.json",
|
|
10
|
+
"clean": "rm -rf ./lib",
|
|
11
|
+
"copy-files": "cp -R src/assets lib/assets",
|
|
12
|
+
"build": "npm run clean && tsc && npm run copy-files",
|
|
13
|
+
"publish-package": "npm run build && npm publish"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [],
|
|
16
|
+
"author": "",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
20
|
+
"@types/jest": "^29.5.2",
|
|
21
|
+
"@types/react": "^18.2.12",
|
|
22
|
+
"@types/react-dom": "^18.2.5",
|
|
23
|
+
"@types/react-svg": "^5.0.0",
|
|
24
|
+
"jest": "^29.5.0",
|
|
25
|
+
"prettier": "^2.8.8",
|
|
26
|
+
"prop-types": "^15.8.1",
|
|
27
|
+
"react": "^18.2.0",
|
|
28
|
+
"react-dom": "^18.2.0",
|
|
29
|
+
"ts-jest": "^29.1.0",
|
|
30
|
+
"tslint": "^6.1.3",
|
|
31
|
+
"tslint-config-prettier": "^1.18.0",
|
|
32
|
+
"typescript": "^5.1.3"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"lib/**/*"
|
|
36
|
+
],
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@emotion/react": "^11.11.1",
|
|
39
|
+
"@emotion/styled": "^11.11.0",
|
|
40
|
+
"@mui/icons-material": "^5.11.16",
|
|
41
|
+
"@mui/material": "^5.13.5",
|
|
42
|
+
"@mui/styled-engine-sc": "^5.12.0",
|
|
43
|
+
"react": "^18.2.0",
|
|
44
|
+
"react-dom": "^18.2.0",
|
|
45
|
+
"react-svg": "^16.1.17",
|
|
46
|
+
"styled-components": "^5.3.11"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@emotion/react": "^11.11.1",
|
|
50
|
+
"@emotion/styled": "^11.11.0",
|
|
51
|
+
"@mui/icons-material": "^5.11.16",
|
|
52
|
+
"@mui/material": "^5.13.5",
|
|
53
|
+
"@mui/styled-engine-sc": "^5.12.0",
|
|
54
|
+
"@react-spring/rafz": "^9.7.3",
|
|
55
|
+
"@react-spring/web": "^9.7.3",
|
|
56
|
+
"react": "^18.2.0",
|
|
57
|
+
"react-dnd": "^16.0.1",
|
|
58
|
+
"react-dnd-html5-backend": "^16.0.1",
|
|
59
|
+
"react-dom": "^18.2.0",
|
|
60
|
+
"react-svg": "^16.1.17",
|
|
61
|
+
"react-zoom-pan-pinch": "^3.3.0",
|
|
62
|
+
"styled-components": "^5.3.11"
|
|
63
|
+
},
|
|
64
|
+
"readme": "ERROR: No README data found!"
|
|
65
|
+
}
|