@uipath/apollo-react 3.47.2 → 3.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/core/CategoryTree.cjs +4 -4
- package/dist/canvas/core/CategoryTree.js +4 -4
- package/dist/canvas/storybook-utils/manifests/node-definitions.cjs +2 -2
- package/dist/canvas/storybook-utils/manifests/node-definitions.js +2 -2
- package/dist/canvas/utils/createPreviewNode.cjs +16 -17
- package/dist/canvas/utils/createPreviewNode.d.ts.map +1 -1
- package/dist/canvas/utils/createPreviewNode.js +16 -17
- package/package.json +1 -1
|
@@ -38,13 +38,13 @@ class CategoryTree {
|
|
|
38
38
|
}
|
|
39
39
|
static buildMap(tree) {
|
|
40
40
|
const newCategoryMap = new Map();
|
|
41
|
-
const
|
|
42
|
-
for (const tNode of
|
|
41
|
+
const addCategoriesToMap = (categories)=>{
|
|
42
|
+
for (const tNode of categories){
|
|
43
43
|
newCategoryMap.set(tNode.id, tNode);
|
|
44
|
-
|
|
44
|
+
addCategoriesToMap(tNode.nestedCategories);
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
addCategoriesToMap(tree);
|
|
48
48
|
return newCategoryMap;
|
|
49
49
|
}
|
|
50
50
|
static fromPrebuilt(rootCategories, rootNodes) {
|
|
@@ -10,13 +10,13 @@ class CategoryTree {
|
|
|
10
10
|
}
|
|
11
11
|
static buildMap(tree) {
|
|
12
12
|
const newCategoryMap = new Map();
|
|
13
|
-
const
|
|
14
|
-
for (const tNode of
|
|
13
|
+
const addCategoriesToMap = (categories)=>{
|
|
14
|
+
for (const tNode of categories){
|
|
15
15
|
newCategoryMap.set(tNode.id, tNode);
|
|
16
|
-
|
|
16
|
+
addCategoriesToMap(tNode.nestedCategories);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
addCategoriesToMap(tree);
|
|
20
20
|
return newCategoryMap;
|
|
21
21
|
}
|
|
22
22
|
static fromPrebuilt(rootCategories, rootNodes) {
|
|
@@ -637,7 +637,7 @@ const allNodeManifests = [
|
|
|
637
637
|
},
|
|
638
638
|
handleConfiguration: [
|
|
639
639
|
{
|
|
640
|
-
position: '
|
|
640
|
+
position: 'bottom',
|
|
641
641
|
handles: [
|
|
642
642
|
{
|
|
643
643
|
id: 'input',
|
|
@@ -674,7 +674,7 @@ const allNodeManifests = [
|
|
|
674
674
|
},
|
|
675
675
|
handleConfiguration: [
|
|
676
676
|
{
|
|
677
|
-
position: '
|
|
677
|
+
position: 'bottom',
|
|
678
678
|
handles: [
|
|
679
679
|
{
|
|
680
680
|
id: 'input',
|
|
@@ -609,7 +609,7 @@ const allNodeManifests = [
|
|
|
609
609
|
},
|
|
610
610
|
handleConfiguration: [
|
|
611
611
|
{
|
|
612
|
-
position: '
|
|
612
|
+
position: 'bottom',
|
|
613
613
|
handles: [
|
|
614
614
|
{
|
|
615
615
|
id: 'input',
|
|
@@ -646,7 +646,7 @@ const allNodeManifests = [
|
|
|
646
646
|
},
|
|
647
647
|
handleConfiguration: [
|
|
648
648
|
{
|
|
649
|
-
position: '
|
|
649
|
+
position: 'bottom',
|
|
650
650
|
handles: [
|
|
651
651
|
{
|
|
652
652
|
id: 'input',
|
|
@@ -74,6 +74,14 @@ function calculatePositionFromDrop(dropPosition, handlePosition, previewNodeSize
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
function computeSpreadOffset(handle, size) {
|
|
78
|
+
const index = handle?.index ?? null;
|
|
79
|
+
const count = handle?.count ?? 1;
|
|
80
|
+
if (null === index || count <= 1) return 0;
|
|
81
|
+
if (index < Math.floor(count / 2)) return -size;
|
|
82
|
+
if (index >= Math.ceil(count / 2)) return size;
|
|
83
|
+
return 0;
|
|
84
|
+
}
|
|
77
85
|
function calculateAutoPosition(sourceNode, handlePosition, previewNodeSize, existingNodes, offset = 5 * external_constants_cjs_namespaceObject.GRID_SPACING, ignoredNodeTypes = [], handle) {
|
|
78
86
|
const sourceAbsolutePosition = sourceNode.parentId ? (0, external_NodeUtils_cjs_namespaceObject.getAbsolutePosition)(sourceNode, existingNodes) : sourceNode.position;
|
|
79
87
|
const sourceWidth = sourceNode.measured?.width ?? 0;
|
|
@@ -95,31 +103,22 @@ function calculateAutoPosition(sourceNode, handlePosition, previewNodeSize, exis
|
|
|
95
103
|
direction = 'left';
|
|
96
104
|
break;
|
|
97
105
|
case react_cjs_namespaceObject.Position.Right:
|
|
98
|
-
{
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
else if (handleIndex >= Math.ceil(handleCount / 2)) yOffset = previewNodeSize.height;
|
|
105
|
-
}
|
|
106
|
-
initialPosition = {
|
|
107
|
-
x: sourceAbsolutePosition.x + sourceWidth + offset,
|
|
108
|
-
y: anchorY - previewNodeSize.height / 2 + yOffset
|
|
109
|
-
};
|
|
110
|
-
direction = 'right';
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
106
|
+
initialPosition = {
|
|
107
|
+
x: sourceAbsolutePosition.x + sourceWidth + offset,
|
|
108
|
+
y: anchorY - previewNodeSize.height / 2 + computeSpreadOffset(handle, previewNodeSize.height)
|
|
109
|
+
};
|
|
110
|
+
direction = 'right';
|
|
111
|
+
break;
|
|
113
112
|
case react_cjs_namespaceObject.Position.Top:
|
|
114
113
|
initialPosition = {
|
|
115
|
-
x: anchorX - previewNodeSize.width / 2,
|
|
114
|
+
x: anchorX - previewNodeSize.width / 2 + computeSpreadOffset(handle, previewNodeSize.width / 2),
|
|
116
115
|
y: sourceAbsolutePosition.y - previewNodeSize.height - offset
|
|
117
116
|
};
|
|
118
117
|
direction = 'top';
|
|
119
118
|
break;
|
|
120
119
|
case react_cjs_namespaceObject.Position.Bottom:
|
|
121
120
|
initialPosition = {
|
|
122
|
-
x: anchorX - previewNodeSize.width / 2,
|
|
121
|
+
x: anchorX - previewNodeSize.width / 2 + computeSpreadOffset(handle, previewNodeSize.width / 2),
|
|
123
122
|
y: sourceAbsolutePosition.y + sourceHeight + offset
|
|
124
123
|
};
|
|
125
124
|
direction = 'bottom';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPreviewNode.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/createPreviewNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EACT,KAAK,IAAI,EACT,QAAQ,EACR,KAAK,iBAAiB,EACvB,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"createPreviewNode.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/createPreviewNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EACT,KAAK,IAAI,EACT,QAAQ,EACR,KAAK,iBAAiB,EACvB,MAAM,0CAA0C,CAAC;AA+KlD,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,CAAC,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACnC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,gBAAgB,GAAE,QAAQ,GAAG,QAAmB,EAChD,eAAe,GAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAG/C,EACD,cAAc,GAAE,QAAyB,EACzC,gBAAgB,GAAE,MAAM,EAAO,GAC9B;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GAAG,IAAI,CA2FnC;AAMD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EACnC,iBAAiB,EAAE,iBAAiB,GACnC,IAAI,CAcN;AAKD,wBAAgB,0BAA0B,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAGrF"}
|
|
@@ -44,6 +44,14 @@ function calculatePositionFromDrop(dropPosition, handlePosition, previewNodeSize
|
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
+
function computeSpreadOffset(handle, size) {
|
|
48
|
+
const index = handle?.index ?? null;
|
|
49
|
+
const count = handle?.count ?? 1;
|
|
50
|
+
if (null === index || count <= 1) return 0;
|
|
51
|
+
if (index < Math.floor(count / 2)) return -size;
|
|
52
|
+
if (index >= Math.ceil(count / 2)) return size;
|
|
53
|
+
return 0;
|
|
54
|
+
}
|
|
47
55
|
function calculateAutoPosition(sourceNode, handlePosition, previewNodeSize, existingNodes, offset = 5 * GRID_SPACING, ignoredNodeTypes = [], handle) {
|
|
48
56
|
const sourceAbsolutePosition = sourceNode.parentId ? getAbsolutePosition(sourceNode, existingNodes) : sourceNode.position;
|
|
49
57
|
const sourceWidth = sourceNode.measured?.width ?? 0;
|
|
@@ -65,31 +73,22 @@ function calculateAutoPosition(sourceNode, handlePosition, previewNodeSize, exis
|
|
|
65
73
|
direction = 'left';
|
|
66
74
|
break;
|
|
67
75
|
case Position.Right:
|
|
68
|
-
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
else if (handleIndex >= Math.ceil(handleCount / 2)) yOffset = previewNodeSize.height;
|
|
75
|
-
}
|
|
76
|
-
initialPosition = {
|
|
77
|
-
x: sourceAbsolutePosition.x + sourceWidth + offset,
|
|
78
|
-
y: anchorY - previewNodeSize.height / 2 + yOffset
|
|
79
|
-
};
|
|
80
|
-
direction = 'right';
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
76
|
+
initialPosition = {
|
|
77
|
+
x: sourceAbsolutePosition.x + sourceWidth + offset,
|
|
78
|
+
y: anchorY - previewNodeSize.height / 2 + computeSpreadOffset(handle, previewNodeSize.height)
|
|
79
|
+
};
|
|
80
|
+
direction = 'right';
|
|
81
|
+
break;
|
|
83
82
|
case Position.Top:
|
|
84
83
|
initialPosition = {
|
|
85
|
-
x: anchorX - previewNodeSize.width / 2,
|
|
84
|
+
x: anchorX - previewNodeSize.width / 2 + computeSpreadOffset(handle, previewNodeSize.width / 2),
|
|
86
85
|
y: sourceAbsolutePosition.y - previewNodeSize.height - offset
|
|
87
86
|
};
|
|
88
87
|
direction = 'top';
|
|
89
88
|
break;
|
|
90
89
|
case Position.Bottom:
|
|
91
90
|
initialPosition = {
|
|
92
|
-
x: anchorX - previewNodeSize.width / 2,
|
|
91
|
+
x: anchorX - previewNodeSize.width / 2 + computeSpreadOffset(handle, previewNodeSize.width / 2),
|
|
93
92
|
y: sourceAbsolutePosition.y + sourceHeight + offset
|
|
94
93
|
};
|
|
95
94
|
direction = 'bottom';
|