@uipath/apollo-react 5.0.0 → 5.0.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.
- package/dist/canvas/components/BaseNode/NodeLabel.cjs +1 -1
- package/dist/canvas/components/BaseNode/NodeLabel.js +1 -1
- package/dist/canvas/components/Edges/CanvasEdge.cjs +1 -0
- package/dist/canvas/components/Edges/CanvasEdge.d.ts.map +1 -1
- package/dist/canvas/components/Edges/CanvasEdge.js +1 -0
- package/dist/canvas/components/Edges/shared/geometry.cjs +23 -9
- package/dist/canvas/components/Edges/shared/geometry.d.ts +1 -1
- package/dist/canvas/components/Edges/shared/geometry.d.ts.map +1 -1
- package/dist/canvas/components/Edges/shared/geometry.js +23 -9
- package/dist/canvas/components/Edges/shared/hooks/useEdgeGeometry.cjs +4 -3
- package/dist/canvas/components/Edges/shared/hooks/useEdgeGeometry.d.ts +1 -0
- package/dist/canvas/components/Edges/shared/hooks/useEdgeGeometry.d.ts.map +1 -1
- package/dist/canvas/components/Edges/shared/hooks/useEdgeGeometry.js +4 -3
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/package.json +2 -2
|
@@ -75,7 +75,7 @@ const SubHeader = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((
|
|
|
75
75
|
ref: ref,
|
|
76
76
|
"data-testid": dataTestId,
|
|
77
77
|
onDoubleClick: onDoubleClick,
|
|
78
|
-
className: (0, CssUtil_cjs_namespaceObject.cx)('text-center text-xs leading-[18px] text-foreground-muted wrap-break-word overflow-hidden', 'rectangle' === shape ? 'w-full text-left line-clamp-2' : 'line-clamp-5', className),
|
|
78
|
+
className: (0, CssUtil_cjs_namespaceObject.cx)('text-center text-xs leading-[18px] text-foreground-muted wrap-break-word overflow-hidden whitespace-pre-line', 'rectangle' === shape ? 'w-full text-left line-clamp-2' : 'line-clamp-5', className),
|
|
79
79
|
style: style,
|
|
80
80
|
children: children
|
|
81
81
|
}));
|
|
@@ -46,7 +46,7 @@ const SubHeader = /*#__PURE__*/ forwardRef(({ shape, onDoubleClick, children, cl
|
|
|
46
46
|
ref: ref,
|
|
47
47
|
"data-testid": dataTestId,
|
|
48
48
|
onDoubleClick: onDoubleClick,
|
|
49
|
-
className: cx('text-center text-xs leading-[18px] text-foreground-muted wrap-break-word overflow-hidden', 'rectangle' === shape ? 'w-full text-left line-clamp-2' : 'line-clamp-5', className),
|
|
49
|
+
className: cx('text-center text-xs leading-[18px] text-foreground-muted wrap-break-word overflow-hidden whitespace-pre-line', 'rectangle' === shape ? 'w-full text-left line-clamp-2' : 'line-clamp-5', className),
|
|
50
50
|
style: style,
|
|
51
51
|
children: children
|
|
52
52
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasEdge.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Edges/CanvasEdge.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAWtD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"CanvasEdge.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Edges/CanvasEdge.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAWtD,eAAO,MAAM,UAAU,uDAkMF,CAAC"}
|
|
@@ -187,7 +187,20 @@ function connectorElbow(from, to, incoming) {
|
|
|
187
187
|
y: from.y
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function clearNodeFace(waypoints, anchor, position) {
|
|
191
|
+
const dir = getDirection(position);
|
|
192
|
+
const axis = 0 !== dir.dx ? 'x' : 'y';
|
|
193
|
+
const sign = 0 !== dir.dx ? dir.dx : dir.dy;
|
|
194
|
+
const nearest = waypoints.reduce((acc, w)=>sign > 0 ? Math.min(acc, w[axis]) : Math.max(acc, w[axis]), sign > 0 ? 1 / 0 : -1 / 0);
|
|
195
|
+
const gap = (nearest - anchor[axis]) * sign;
|
|
196
|
+
if (gap >= external_constants_cjs_namespaceObject.EDGE_CONSTANTS.STUB_OFFSET) return waypoints;
|
|
197
|
+
const shift = (external_constants_cjs_namespaceObject.EDGE_CONSTANTS.STUB_OFFSET - gap) * sign;
|
|
198
|
+
return waypoints.map((w)=>Math.abs(w[axis] - nearest) < TOL ? {
|
|
199
|
+
...w,
|
|
200
|
+
[axis]: w[axis] + shift
|
|
201
|
+
} : w);
|
|
202
|
+
}
|
|
203
|
+
function buildPathVertices(sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, waypoints = [], autoRouted = false) {
|
|
191
204
|
const sourceOffset = external_constants_cjs_namespaceObject.ARROW_OFFSETS[sourcePosition];
|
|
192
205
|
const targetOffset = external_constants_cjs_namespaceObject.ARROW_OFFSETS[targetPosition];
|
|
193
206
|
const start = {
|
|
@@ -213,27 +226,28 @@ function buildPathVertices(sourceX, sourceY, sourcePosition, targetX, targetY, t
|
|
|
213
226
|
}
|
|
214
227
|
const startVertex = derived(start);
|
|
215
228
|
const endVertex = derived(end);
|
|
229
|
+
const routed = autoRouted ? clearNodeFace(clearNodeFace(waypoints, start, sourcePosition), end, targetPosition) : waypoints;
|
|
216
230
|
const path = [
|
|
217
231
|
startVertex
|
|
218
232
|
];
|
|
219
|
-
for (const elbow of routeAnchorToPoint(start, sourcePosition,
|
|
233
|
+
for (const elbow of routeAnchorToPoint(start, sourcePosition, routed[0]))path.push(derived(elbow));
|
|
220
234
|
path.push({
|
|
221
|
-
x:
|
|
222
|
-
y:
|
|
235
|
+
x: routed[0].x,
|
|
236
|
+
y: routed[0].y,
|
|
223
237
|
waypointIndex: 0
|
|
224
238
|
});
|
|
225
|
-
for(let i = 1; i <
|
|
239
|
+
for(let i = 1; i < routed.length; i++){
|
|
226
240
|
const from = path[path.length - 1];
|
|
227
241
|
const incoming = path.length >= 2 ? getSegmentOrientation(path[path.length - 2], from) : null;
|
|
228
|
-
const elbow = connectorElbow(from,
|
|
242
|
+
const elbow = connectorElbow(from, routed[i], incoming);
|
|
229
243
|
if (elbow) path.push(derived(elbow));
|
|
230
244
|
path.push({
|
|
231
|
-
x:
|
|
232
|
-
y:
|
|
245
|
+
x: routed[i].x,
|
|
246
|
+
y: routed[i].y,
|
|
233
247
|
waypointIndex: i
|
|
234
248
|
});
|
|
235
249
|
}
|
|
236
|
-
const targetStub = routeAnchorToPoint(end, targetPosition,
|
|
250
|
+
const targetStub = routeAnchorToPoint(end, targetPosition, routed[routed.length - 1]);
|
|
237
251
|
for(let j = targetStub.length - 1; j >= 0; j--)path.push(derived(targetStub[j]));
|
|
238
252
|
const interior = consolidateWaypoints(path.slice(1), start, end, (v)=>v.waypointIndex >= 0);
|
|
239
253
|
return [
|
|
@@ -4,7 +4,7 @@ export declare function snapPointToGrid(point: Point): Point;
|
|
|
4
4
|
export declare function isHorizontalPosition(position: Position): boolean;
|
|
5
5
|
export declare function calculateAutoWaypoints(sourceX: number, sourceY: number, sourcePosition: Position, targetX: number, targetY: number, targetPosition: Position): Point[];
|
|
6
6
|
export declare function routeAnchorToPoint(anchor: Point, anchorPosition: Position, point: Point): Point[];
|
|
7
|
-
export declare function buildPathVertices(sourceX: number, sourceY: number, sourcePosition: Position, targetX: number, targetY: number, targetPosition: Position, waypoints?: Waypoint[]): PathVertex[];
|
|
7
|
+
export declare function buildPathVertices(sourceX: number, sourceY: number, sourcePosition: Position, targetX: number, targetY: number, targetPosition: Position, waypoints?: Waypoint[], autoRouted?: boolean): PathVertex[];
|
|
8
8
|
export declare function consolidateWaypoints<T extends Point>(points: T[], pathStart: Point, pathEnd: Point, isProtected?: (point: T) => boolean): T[];
|
|
9
9
|
export declare function getSegmentOrientation(start: Point, end: Point): SegmentOrientation;
|
|
10
10
|
export declare function isSegmentPerpendicular(segment: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Edges/shared/geometry.ts"],"names":[],"mappings":"AA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ectorElbow(from, to, incoming) {
|
|
|
146
146
|
y: from.y
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function clearNodeFace(waypoints, anchor, position) {
|
|
150
|
+
const dir = getDirection(position);
|
|
151
|
+
const axis = 0 !== dir.dx ? 'x' : 'y';
|
|
152
|
+
const sign = 0 !== dir.dx ? dir.dx : dir.dy;
|
|
153
|
+
const nearest = waypoints.reduce((acc, w)=>sign > 0 ? Math.min(acc, w[axis]) : Math.max(acc, w[axis]), sign > 0 ? 1 / 0 : -1 / 0);
|
|
154
|
+
const gap = (nearest - anchor[axis]) * sign;
|
|
155
|
+
if (gap >= EDGE_CONSTANTS.STUB_OFFSET) return waypoints;
|
|
156
|
+
const shift = (EDGE_CONSTANTS.STUB_OFFSET - gap) * sign;
|
|
157
|
+
return waypoints.map((w)=>Math.abs(w[axis] - nearest) < TOL ? {
|
|
158
|
+
...w,
|
|
159
|
+
[axis]: w[axis] + shift
|
|
160
|
+
} : w);
|
|
161
|
+
}
|
|
162
|
+
function buildPathVertices(sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, waypoints = [], autoRouted = false) {
|
|
150
163
|
const sourceOffset = ARROW_OFFSETS[sourcePosition];
|
|
151
164
|
const targetOffset = ARROW_OFFSETS[targetPosition];
|
|
152
165
|
const start = {
|
|
@@ -172,27 +185,28 @@ function buildPathVertices(sourceX, sourceY, sourcePosition, targetX, targetY, t
|
|
|
172
185
|
}
|
|
173
186
|
const startVertex = derived(start);
|
|
174
187
|
const endVertex = derived(end);
|
|
188
|
+
const routed = autoRouted ? clearNodeFace(clearNodeFace(waypoints, start, sourcePosition), end, targetPosition) : waypoints;
|
|
175
189
|
const path = [
|
|
176
190
|
startVertex
|
|
177
191
|
];
|
|
178
|
-
for (const elbow of routeAnchorToPoint(start, sourcePosition,
|
|
192
|
+
for (const elbow of routeAnchorToPoint(start, sourcePosition, routed[0]))path.push(derived(elbow));
|
|
179
193
|
path.push({
|
|
180
|
-
x:
|
|
181
|
-
y:
|
|
194
|
+
x: routed[0].x,
|
|
195
|
+
y: routed[0].y,
|
|
182
196
|
waypointIndex: 0
|
|
183
197
|
});
|
|
184
|
-
for(let i = 1; i <
|
|
198
|
+
for(let i = 1; i < routed.length; i++){
|
|
185
199
|
const from = path[path.length - 1];
|
|
186
200
|
const incoming = path.length >= 2 ? getSegmentOrientation(path[path.length - 2], from) : null;
|
|
187
|
-
const elbow = connectorElbow(from,
|
|
201
|
+
const elbow = connectorElbow(from, routed[i], incoming);
|
|
188
202
|
if (elbow) path.push(derived(elbow));
|
|
189
203
|
path.push({
|
|
190
|
-
x:
|
|
191
|
-
y:
|
|
204
|
+
x: routed[i].x,
|
|
205
|
+
y: routed[i].y,
|
|
192
206
|
waypointIndex: i
|
|
193
207
|
});
|
|
194
208
|
}
|
|
195
|
-
const targetStub = routeAnchorToPoint(end, targetPosition,
|
|
209
|
+
const targetStub = routeAnchorToPoint(end, targetPosition, routed[routed.length - 1]);
|
|
196
210
|
for(let j = targetStub.length - 1; j >= 0; j--)path.push(derived(targetStub[j]));
|
|
197
211
|
const interior = consolidateWaypoints(path.slice(1), start, end, (v)=>v.waypointIndex >= 0);
|
|
198
212
|
return [
|
|
@@ -33,11 +33,11 @@ const external_geometry_cjs_namespaceObject = require("../geometry.cjs");
|
|
|
33
33
|
const EMPTY_VERTICES = [];
|
|
34
34
|
const EMPTY_SEGMENTS = [];
|
|
35
35
|
function useEdgeGeometry(args) {
|
|
36
|
-
const { routing, sourceNodeId, targetNodeId, sourceHandleId, targetHandleId, sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, waypoints, enableSegments = true, hideArrowHead = false } = args;
|
|
36
|
+
const { routing, sourceNodeId, targetNodeId, sourceHandleId, targetHandleId, sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, waypoints, autoRouted = false, enableSegments = true, hideArrowHead = false } = args;
|
|
37
37
|
const arrowOffset = external_constants_cjs_namespaceObject.ARROW_OFFSETS[targetPosition];
|
|
38
38
|
const isWaypoint = 'waypoint' === routing;
|
|
39
39
|
const isHandle = 'handle' === routing;
|
|
40
|
-
const pathPoints = (0, external_react_namespaceObject.useMemo)(()=>isWaypoint ? (0, external_geometry_cjs_namespaceObject.buildPathVertices)(sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, waypoints) : EMPTY_VERTICES, [
|
|
40
|
+
const pathPoints = (0, external_react_namespaceObject.useMemo)(()=>isWaypoint ? (0, external_geometry_cjs_namespaceObject.buildPathVertices)(sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, waypoints, autoRouted) : EMPTY_VERTICES, [
|
|
41
41
|
isWaypoint,
|
|
42
42
|
sourceX,
|
|
43
43
|
sourceY,
|
|
@@ -45,7 +45,8 @@ function useEdgeGeometry(args) {
|
|
|
45
45
|
targetX,
|
|
46
46
|
targetY,
|
|
47
47
|
targetPosition,
|
|
48
|
-
waypoints
|
|
48
|
+
waypoints,
|
|
49
|
+
autoRouted
|
|
49
50
|
]);
|
|
50
51
|
const segments = (0, external_react_namespaceObject.useMemo)(()=>enableSegments ? (0, external_geometry_cjs_namespaceObject.extractSegments)(pathPoints) : EMPTY_SEGMENTS, [
|
|
51
52
|
enableSegments,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEdgeGeometry.d.ts","sourceRoot":"","sources":["../../../../../../src/canvas/components/Edges/shared/hooks/useEdgeGeometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAUzE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAKlF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,WAAW,CAAC;IAErB,YAAY,EAAE,MAAM,CAAC;IAErB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,cAAc,C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CAAC;IAElB,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,KAAK,CAAC;KACf,CAAC;CACH,CAAC;AAUF,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,YAAY,CAiGvE"}
|
|
@@ -5,11 +5,11 @@ import { buildPathVertices, createRoundedPath, extractSegments, getPathArcMidpoi
|
|
|
5
5
|
const EMPTY_VERTICES = [];
|
|
6
6
|
const EMPTY_SEGMENTS = [];
|
|
7
7
|
function useEdgeGeometry(args) {
|
|
8
|
-
const { routing, sourceNodeId, targetNodeId, sourceHandleId, targetHandleId, sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, waypoints, enableSegments = true, hideArrowHead = false } = args;
|
|
8
|
+
const { routing, sourceNodeId, targetNodeId, sourceHandleId, targetHandleId, sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, waypoints, autoRouted = false, enableSegments = true, hideArrowHead = false } = args;
|
|
9
9
|
const arrowOffset = ARROW_OFFSETS[targetPosition];
|
|
10
10
|
const isWaypoint = 'waypoint' === routing;
|
|
11
11
|
const isHandle = 'handle' === routing;
|
|
12
|
-
const pathPoints = useMemo(()=>isWaypoint ? buildPathVertices(sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, waypoints) : EMPTY_VERTICES, [
|
|
12
|
+
const pathPoints = useMemo(()=>isWaypoint ? buildPathVertices(sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, waypoints, autoRouted) : EMPTY_VERTICES, [
|
|
13
13
|
isWaypoint,
|
|
14
14
|
sourceX,
|
|
15
15
|
sourceY,
|
|
@@ -17,7 +17,8 @@ function useEdgeGeometry(args) {
|
|
|
17
17
|
targetX,
|
|
18
18
|
targetY,
|
|
19
19
|
targetPosition,
|
|
20
|
-
waypoints
|
|
20
|
+
waypoints,
|
|
21
|
+
autoRouted
|
|
21
22
|
]);
|
|
22
23
|
const segments = useMemo(()=>enableSegments ? extractSegments(pathPoints) : EMPTY_SEGMENTS, [
|
|
23
24
|
enableSegments,
|