@uipath/apollo-react 6.17.0 → 6.17.2
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.
|
@@ -80,6 +80,11 @@ function getDirection(position) {
|
|
|
80
80
|
function isHorizontalPosition(position) {
|
|
81
81
|
return 0 !== getDirection(position).dx;
|
|
82
82
|
}
|
|
83
|
+
function getCollinearAxis(sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition) {
|
|
84
|
+
if (isHorizontalPosition(sourcePosition) && isHorizontalPosition(targetPosition)) return Math.abs(sourceY - targetY) <= TOL ? 'horizontal' : null;
|
|
85
|
+
if (!isHorizontalPosition(sourcePosition) && !isHorizontalPosition(targetPosition)) return Math.abs(sourceX - targetX) <= TOL ? 'vertical' : null;
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
83
88
|
function calculateAutoWaypoints(sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition) {
|
|
84
89
|
const sourceOffset = external_constants_cjs_namespaceObject.ARROW_OFFSETS[sourcePosition];
|
|
85
90
|
const targetOffset = external_constants_cjs_namespaceObject.ARROW_OFFSETS[targetPosition];
|
|
@@ -89,10 +94,11 @@ function calculateAutoWaypoints(sourceX, sourceY, sourcePosition, targetX, targe
|
|
|
89
94
|
const endY = targetY + targetOffset.y;
|
|
90
95
|
const isSourceHorizontal = isHorizontalPosition(sourcePosition);
|
|
91
96
|
const isTargetHorizontal = isHorizontalPosition(targetPosition);
|
|
97
|
+
const collinearAxis = getCollinearAxis(startX, startY, sourcePosition, endX, endY, targetPosition);
|
|
92
98
|
const waypoints = [];
|
|
93
99
|
if (isSourceHorizontal && isTargetHorizontal) {
|
|
94
100
|
const midX = (0, NodeUtils_cjs_namespaceObject.snapToGrid)((startX + endX) / 2);
|
|
95
|
-
if (
|
|
101
|
+
if ('horizontal' !== collinearAxis) {
|
|
96
102
|
waypoints.push({
|
|
97
103
|
x: midX,
|
|
98
104
|
y: startY
|
|
@@ -112,7 +118,7 @@ function calculateAutoWaypoints(sourceX, sourceY, sourcePosition, targetX, targe
|
|
|
112
118
|
});
|
|
113
119
|
else {
|
|
114
120
|
const midY = (0, NodeUtils_cjs_namespaceObject.snapToGrid)((startY + endY) / 2);
|
|
115
|
-
if (
|
|
121
|
+
if ('vertical' !== collinearAxis) {
|
|
116
122
|
waypoints.push({
|
|
117
123
|
x: startX,
|
|
118
124
|
y: midY
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Edges/shared/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAGzE,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxF,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAEnD;AAmBD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEhE;
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Edges/shared/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAGzE,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxF,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAEnD;AAmBD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEhE;AA6BD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,QAAQ,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,QAA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KAAK,EAAE,GAAG,KAAK,CAkCzD"}
|
|
@@ -39,6 +39,11 @@ function getDirection(position) {
|
|
|
39
39
|
function isHorizontalPosition(position) {
|
|
40
40
|
return 0 !== getDirection(position).dx;
|
|
41
41
|
}
|
|
42
|
+
function getCollinearAxis(sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition) {
|
|
43
|
+
if (isHorizontalPosition(sourcePosition) && isHorizontalPosition(targetPosition)) return Math.abs(sourceY - targetY) <= TOL ? 'horizontal' : null;
|
|
44
|
+
if (!isHorizontalPosition(sourcePosition) && !isHorizontalPosition(targetPosition)) return Math.abs(sourceX - targetX) <= TOL ? 'vertical' : null;
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
42
47
|
function calculateAutoWaypoints(sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition) {
|
|
43
48
|
const sourceOffset = ARROW_OFFSETS[sourcePosition];
|
|
44
49
|
const targetOffset = ARROW_OFFSETS[targetPosition];
|
|
@@ -48,10 +53,11 @@ function calculateAutoWaypoints(sourceX, sourceY, sourcePosition, targetX, targe
|
|
|
48
53
|
const endY = targetY + targetOffset.y;
|
|
49
54
|
const isSourceHorizontal = isHorizontalPosition(sourcePosition);
|
|
50
55
|
const isTargetHorizontal = isHorizontalPosition(targetPosition);
|
|
56
|
+
const collinearAxis = getCollinearAxis(startX, startY, sourcePosition, endX, endY, targetPosition);
|
|
51
57
|
const waypoints = [];
|
|
52
58
|
if (isSourceHorizontal && isTargetHorizontal) {
|
|
53
59
|
const midX = snapToGrid((startX + endX) / 2);
|
|
54
|
-
if (
|
|
60
|
+
if ('horizontal' !== collinearAxis) {
|
|
55
61
|
waypoints.push({
|
|
56
62
|
x: midX,
|
|
57
63
|
y: startY
|
|
@@ -71,7 +77,7 @@ function calculateAutoWaypoints(sourceX, sourceY, sourcePosition, targetX, targe
|
|
|
71
77
|
});
|
|
72
78
|
else {
|
|
73
79
|
const midY = snapToGrid((startY + endY) / 2);
|
|
74
|
-
if (
|
|
80
|
+
if ('vertical' !== collinearAxis) {
|
|
75
81
|
waypoints.push({
|
|
76
82
|
x: startX,
|
|
77
83
|
y: midY
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/apollo-react",
|
|
3
|
-
"version": "6.17.
|
|
3
|
+
"version": "6.17.2",
|
|
4
4
|
"description": "Apollo Design System - React component library with Material UI theming",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
"lodash": "^4.18.1",
|
|
202
202
|
"lucide-react": "^0.577.0",
|
|
203
203
|
"luxon": "^3.7.1",
|
|
204
|
-
"mermaid": "^11.
|
|
204
|
+
"mermaid": "^11.16.1",
|
|
205
205
|
"motion": "^12.23.12",
|
|
206
206
|
"react-dropzone": "^14.3.8",
|
|
207
207
|
"react-focus-lock": "^2.13.7",
|