@uipath/apollo-react 4.45.1 → 4.46.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/components/Edges/CanvasEdge.cjs +197 -0
- package/dist/canvas/components/Edges/CanvasEdge.d.ts +3 -0
- package/dist/canvas/components/Edges/CanvasEdge.d.ts.map +1 -0
- package/dist/canvas/components/Edges/CanvasEdge.js +163 -0
- package/dist/canvas/components/Edges/SequenceEdge.cjs +18 -200
- package/dist/canvas/components/Edges/SequenceEdge.d.ts +2 -2
- package/dist/canvas/components/Edges/SequenceEdge.d.ts.map +1 -1
- package/dist/canvas/components/Edges/SequenceEdge.js +19 -201
- package/dist/canvas/components/Edges/index.cjs +32 -3
- package/dist/canvas/components/Edges/index.d.ts +4 -0
- package/dist/canvas/components/Edges/index.d.ts.map +1 -1
- package/dist/canvas/components/Edges/index.js +3 -0
- package/dist/canvas/components/Edges/shared/areEdgePropsEqual.cjs +54 -0
- package/dist/canvas/components/Edges/shared/areEdgePropsEqual.d.ts +3 -0
- package/dist/canvas/components/Edges/shared/areEdgePropsEqual.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/areEdgePropsEqual.js +20 -0
- package/dist/canvas/components/Edges/shared/constants.cjs +107 -0
- package/dist/canvas/components/Edges/shared/constants.d.ts +33 -0
- package/dist/canvas/components/Edges/shared/constants.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/constants.js +55 -0
- package/dist/canvas/components/Edges/shared/geometry.cjs +489 -0
- package/dist/canvas/components/Edges/shared/geometry.d.ts +20 -0
- package/dist/canvas/components/Edges/shared/geometry.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/geometry.js +416 -0
- package/dist/canvas/components/Edges/shared/hooks/index.cjs +48 -0
- package/dist/canvas/components/Edges/shared/hooks/index.d.ts +5 -0
- package/dist/canvas/components/Edges/shared/hooks/index.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/hooks/index.js +5 -0
- package/dist/canvas/components/Edges/shared/hooks/useEdgeGeometry.cjs +103 -0
- package/dist/canvas/components/Edges/shared/hooks/useEdgeGeometry.d.ts +30 -0
- package/dist/canvas/components/Edges/shared/hooks/useEdgeGeometry.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/hooks/useEdgeGeometry.js +69 -0
- package/dist/canvas/components/Edges/shared/hooks/useEdgeWaypointWriter.cjs +69 -0
- package/dist/canvas/components/Edges/shared/hooks/useEdgeWaypointWriter.d.ts +3 -0
- package/dist/canvas/components/Edges/shared/hooks/useEdgeWaypointWriter.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/hooks/useEdgeWaypointWriter.js +35 -0
- package/dist/canvas/components/Edges/shared/hooks/useExecutionEdge.cjs +57 -0
- package/dist/canvas/components/Edges/shared/hooks/useExecutionEdge.d.ts +13 -0
- package/dist/canvas/components/Edges/shared/hooks/useExecutionEdge.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/hooks/useExecutionEdge.js +23 -0
- package/dist/canvas/components/Edges/shared/hooks/useNodeDragRebalance.cjs +98 -0
- package/dist/canvas/components/Edges/shared/hooks/useNodeDragRebalance.d.ts +18 -0
- package/dist/canvas/components/Edges/shared/hooks/useNodeDragRebalance.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/hooks/useNodeDragRebalance.js +64 -0
- package/dist/canvas/components/Edges/shared/hooks/useWaypointEditor.cjs +184 -0
- package/dist/canvas/components/Edges/shared/hooks/useWaypointEditor.d.ts +23 -0
- package/dist/canvas/components/Edges/shared/hooks/useWaypointEditor.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/hooks/useWaypointEditor.js +150 -0
- package/dist/canvas/components/Edges/shared/primitives/EdgeArrow.cjs +57 -0
- package/dist/canvas/components/Edges/shared/primitives/EdgeArrow.d.ts +10 -0
- package/dist/canvas/components/Edges/shared/primitives/EdgeArrow.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/primitives/EdgeArrow.js +23 -0
- package/dist/canvas/components/Edges/shared/primitives/EdgeLabel.cjs +66 -0
- package/dist/canvas/components/Edges/shared/primitives/EdgeLabel.d.ts +8 -0
- package/dist/canvas/components/Edges/shared/primitives/EdgeLabel.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/primitives/EdgeLabel.js +32 -0
- package/dist/canvas/components/Edges/shared/primitives/EdgePath.cjs +84 -0
- package/dist/canvas/components/Edges/shared/primitives/EdgePath.d.ts +16 -0
- package/dist/canvas/components/Edges/shared/primitives/EdgePath.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/primitives/EdgePath.js +50 -0
- package/dist/canvas/components/Edges/shared/primitives/SegmentDragHandle.cjs +117 -0
- package/dist/canvas/components/Edges/shared/primitives/SegmentDragHandle.d.ts +9 -0
- package/dist/canvas/components/Edges/shared/primitives/SegmentDragHandle.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/primitives/SegmentDragHandle.js +83 -0
- package/dist/canvas/components/Edges/shared/primitives/WaypointHandle.cjs +75 -0
- package/dist/canvas/components/Edges/shared/primitives/WaypointHandle.d.ts +10 -0
- package/dist/canvas/components/Edges/shared/primitives/WaypointHandle.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/primitives/WaypointHandle.js +41 -0
- package/dist/canvas/components/Edges/shared/primitives/index.cjs +52 -0
- package/dist/canvas/components/Edges/shared/primitives/index.d.ts +11 -0
- package/dist/canvas/components/Edges/shared/primitives/index.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/primitives/index.js +6 -0
- package/dist/canvas/components/Edges/shared/resolveEdgeColor.cjs +46 -0
- package/dist/canvas/components/Edges/shared/resolveEdgeColor.d.ts +11 -0
- package/dist/canvas/components/Edges/shared/resolveEdgeColor.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/resolveEdgeColor.js +12 -0
- package/dist/canvas/components/Edges/shared/routing/defaultEdgeRouter.cjs +51 -0
- package/dist/canvas/components/Edges/shared/routing/defaultEdgeRouter.d.ts +3 -0
- package/dist/canvas/components/Edges/shared/routing/defaultEdgeRouter.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/routing/defaultEdgeRouter.js +17 -0
- package/dist/canvas/components/Edges/shared/routing/index.cjs +43 -0
- package/dist/canvas/components/Edges/shared/routing/index.d.ts +4 -0
- package/dist/canvas/components/Edges/shared/routing/index.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/routing/index.js +3 -0
- package/dist/canvas/components/Edges/shared/routing/types.cjs +18 -0
- package/dist/canvas/components/Edges/shared/routing/types.d.ts +33 -0
- package/dist/canvas/components/Edges/shared/routing/types.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/routing/types.js +0 -0
- package/dist/canvas/components/Edges/shared/routing/useGraphRouter.cjs +175 -0
- package/dist/canvas/components/Edges/shared/routing/useGraphRouter.d.ts +5 -0
- package/dist/canvas/components/Edges/shared/routing/useGraphRouter.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/routing/useGraphRouter.js +138 -0
- package/dist/canvas/components/Edges/shared/types.cjs +18 -0
- package/dist/canvas/components/Edges/shared/types.d.ts +36 -0
- package/dist/canvas/components/Edges/shared/types.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/types.js +0 -0
- package/dist/canvas/components/Edges/shared/waypoints.cjs +216 -0
- package/dist/canvas/components/Edges/shared/waypoints.d.ts +17 -0
- package/dist/canvas/components/Edges/shared/waypoints.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/waypoints.js +158 -0
- package/dist/canvas/hooks/useEdgePath.cjs +6 -22
- package/dist/canvas/hooks/useEdgePath.d.ts +1 -1
- package/dist/canvas/hooks/useEdgePath.d.ts.map +1 -1
- package/dist/canvas/hooks/useEdgePath.js +5 -21
- package/package.json +1 -1
|
@@ -0,0 +1,175 @@
|
|
|
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 ("u" > 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
|
+
useGraphRouter: ()=>useGraphRouter,
|
|
28
|
+
defaultIsRoutable: ()=>defaultIsRoutable
|
|
29
|
+
});
|
|
30
|
+
const react_cjs_namespaceObject = require("../../../../xyflow/react.cjs");
|
|
31
|
+
const external_react_namespaceObject = require("react");
|
|
32
|
+
const container_cjs_namespaceObject = require("../../../../utils/container.cjs");
|
|
33
|
+
const external_waypoints_cjs_namespaceObject = require("../waypoints.cjs");
|
|
34
|
+
function defaultIsRoutable(edge) {
|
|
35
|
+
const data = edge.data;
|
|
36
|
+
return data?.routing === 'waypoint' && !data.waypoints?.length;
|
|
37
|
+
}
|
|
38
|
+
function useGraphRouter(router, isRoutable = defaultIsRoutable) {
|
|
39
|
+
const { getNodes, getEdges, setEdges } = (0, react_cjs_namespaceObject.useReactFlow)();
|
|
40
|
+
const signature = (0, react_cjs_namespaceObject.useStore)((0, external_react_namespaceObject.useCallback)((state)=>routeSignature(state, isRoutable), [
|
|
41
|
+
isRoutable
|
|
42
|
+
]));
|
|
43
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
44
|
+
if (!signature) return;
|
|
45
|
+
let cancelled = false;
|
|
46
|
+
const apply = (routes)=>{
|
|
47
|
+
if (cancelled) return;
|
|
48
|
+
const byId = new Map(routes.map((r)=>[
|
|
49
|
+
r.edgeId,
|
|
50
|
+
r
|
|
51
|
+
]));
|
|
52
|
+
setEdges((current)=>{
|
|
53
|
+
let next = null;
|
|
54
|
+
for(let i = 0; i < current.length; i++){
|
|
55
|
+
const edge = current[i];
|
|
56
|
+
const reconciled = reconcileEdge(edge, byId, isRoutable);
|
|
57
|
+
if (reconciled !== edge) {
|
|
58
|
+
next ??= [
|
|
59
|
+
...current
|
|
60
|
+
];
|
|
61
|
+
next[i] = reconciled;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return next ?? current;
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
const edges = getEdges();
|
|
68
|
+
if (!edges.some(isRoutable)) {
|
|
69
|
+
const hasStale = edges.some((edge)=>edge.data?.routedWaypoints !== void 0);
|
|
70
|
+
if (hasStale) apply([]);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const request = buildRequest(getNodes(), edges, isRoutable);
|
|
74
|
+
if (0 === request.edges.length) return void apply([]);
|
|
75
|
+
const result = router.route(request);
|
|
76
|
+
if (result instanceof Promise) result.then(apply).catch((err)=>{
|
|
77
|
+
if (cancelled) return;
|
|
78
|
+
console.error('[useGraphRouter] router.route() rejected:', err);
|
|
79
|
+
});
|
|
80
|
+
else apply(result);
|
|
81
|
+
return ()=>{
|
|
82
|
+
cancelled = true;
|
|
83
|
+
};
|
|
84
|
+
}, [
|
|
85
|
+
signature,
|
|
86
|
+
router,
|
|
87
|
+
isRoutable,
|
|
88
|
+
getNodes,
|
|
89
|
+
getEdges,
|
|
90
|
+
setEdges
|
|
91
|
+
]);
|
|
92
|
+
}
|
|
93
|
+
function reconcileEdge(edge, routesById, isRoutable) {
|
|
94
|
+
const data = edge.data;
|
|
95
|
+
if (!isRoutable(edge)) {
|
|
96
|
+
if (data?.routedWaypoints === void 0) return edge;
|
|
97
|
+
const { routedWaypoints: _removed, ...rest } = data;
|
|
98
|
+
return {
|
|
99
|
+
...edge,
|
|
100
|
+
data: rest
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const route = routesById.get(edge.id);
|
|
104
|
+
if (!route) return edge;
|
|
105
|
+
const prev = data?.routedWaypoints ?? [];
|
|
106
|
+
if ((0, external_waypoints_cjs_namespaceObject.waypointsPositionallyEqual)(prev, route.waypoints)) return edge;
|
|
107
|
+
return {
|
|
108
|
+
...edge,
|
|
109
|
+
data: {
|
|
110
|
+
...edge.data,
|
|
111
|
+
routedWaypoints: route.waypoints
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function routeSignature(state, isRoutable) {
|
|
116
|
+
let sig = '';
|
|
117
|
+
for (const node of state.nodes){
|
|
118
|
+
const { width, height } = (0, container_cjs_namespaceObject.getNodeDimensions)(node);
|
|
119
|
+
sig += `${node.id}:${node.position.x},${node.position.y},${width},${height}|`;
|
|
120
|
+
}
|
|
121
|
+
for (const edge of state.edges)sig += `${edge.id}:${edge.source}/${edge.sourceHandle ?? ''}>${edge.target}/${edge.targetHandle ?? ''}:${isRoutable(edge) ? 'r' : 'm'}|`;
|
|
122
|
+
return sig;
|
|
123
|
+
}
|
|
124
|
+
function buildRequest(nodes, edges, isRoutable) {
|
|
125
|
+
const routeNodes = nodes.map((n)=>{
|
|
126
|
+
const { width, height } = (0, container_cjs_namespaceObject.getNodeDimensions)(n);
|
|
127
|
+
return {
|
|
128
|
+
id: n.id,
|
|
129
|
+
x: n.position.x,
|
|
130
|
+
y: n.position.y,
|
|
131
|
+
width,
|
|
132
|
+
height
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
const nodeMap = new Map(routeNodes.map((n)=>[
|
|
136
|
+
n.id,
|
|
137
|
+
n
|
|
138
|
+
]));
|
|
139
|
+
const routeEdges = [];
|
|
140
|
+
for (const edge of edges){
|
|
141
|
+
if (!isRoutable(edge)) continue;
|
|
142
|
+
const source = nodeMap.get(edge.source);
|
|
143
|
+
const target = nodeMap.get(edge.target);
|
|
144
|
+
if (source && target) routeEdges.push({
|
|
145
|
+
edgeId: edge.id,
|
|
146
|
+
source: {
|
|
147
|
+
nodeId: edge.source,
|
|
148
|
+
handleId: edge.sourceHandle ?? null,
|
|
149
|
+
x: source.x + source.width,
|
|
150
|
+
y: source.y + source.height / 2,
|
|
151
|
+
position: react_cjs_namespaceObject.Position.Right
|
|
152
|
+
},
|
|
153
|
+
target: {
|
|
154
|
+
nodeId: edge.target,
|
|
155
|
+
handleId: edge.targetHandle ?? null,
|
|
156
|
+
x: target.x,
|
|
157
|
+
y: target.y + target.height / 2,
|
|
158
|
+
position: react_cjs_namespaceObject.Position.Left
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
nodes: routeNodes,
|
|
164
|
+
edges: routeEdges
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
exports.defaultIsRoutable = __webpack_exports__.defaultIsRoutable;
|
|
168
|
+
exports.useGraphRouter = __webpack_exports__.useGraphRouter;
|
|
169
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
170
|
+
"defaultIsRoutable",
|
|
171
|
+
"useGraphRouter"
|
|
172
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
173
|
+
Object.defineProperty(exports, '__esModule', {
|
|
174
|
+
value: true
|
|
175
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Edge } from '../../../../xyflow/react.ts';
|
|
2
|
+
import type { EdgeRouter } from './types';
|
|
3
|
+
export declare function defaultIsRoutable(edge: Edge): boolean;
|
|
4
|
+
export declare function useGraphRouter(router: EdgeRouter, isRoutable?: (edge: Edge) => boolean): void;
|
|
5
|
+
//# sourceMappingURL=useGraphRouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGraphRouter.d.ts","sourceRoot":"","sources":["../../../../../../src/canvas/components/Edges/shared/routing/useGraphRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EAMV,MAAM,0CAA0C,CAAC;AAKlD,OAAO,KAAK,EACV,UAAU,EAKX,MAAM,SAAS,CAAC;AAoBjB,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAGrD;AA+BD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,EAClB,UAAU,GAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAA2B,GACtD,IAAI,CAmEN"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { Position, useReactFlow, useStore } from "../../../../xyflow/react.js";
|
|
2
|
+
import { useCallback, useEffect } from "react";
|
|
3
|
+
import { getNodeDimensions } from "../../../../utils/container.js";
|
|
4
|
+
import { waypointsPositionallyEqual } from "../waypoints.js";
|
|
5
|
+
function defaultIsRoutable(edge) {
|
|
6
|
+
const data = edge.data;
|
|
7
|
+
return data?.routing === 'waypoint' && !data.waypoints?.length;
|
|
8
|
+
}
|
|
9
|
+
function useGraphRouter(router, isRoutable = defaultIsRoutable) {
|
|
10
|
+
const { getNodes, getEdges, setEdges } = useReactFlow();
|
|
11
|
+
const signature = useStore(useCallback((state)=>routeSignature(state, isRoutable), [
|
|
12
|
+
isRoutable
|
|
13
|
+
]));
|
|
14
|
+
useEffect(()=>{
|
|
15
|
+
if (!signature) return;
|
|
16
|
+
let cancelled = false;
|
|
17
|
+
const apply = (routes)=>{
|
|
18
|
+
if (cancelled) return;
|
|
19
|
+
const byId = new Map(routes.map((r)=>[
|
|
20
|
+
r.edgeId,
|
|
21
|
+
r
|
|
22
|
+
]));
|
|
23
|
+
setEdges((current)=>{
|
|
24
|
+
let next = null;
|
|
25
|
+
for(let i = 0; i < current.length; i++){
|
|
26
|
+
const edge = current[i];
|
|
27
|
+
const reconciled = reconcileEdge(edge, byId, isRoutable);
|
|
28
|
+
if (reconciled !== edge) {
|
|
29
|
+
next ??= [
|
|
30
|
+
...current
|
|
31
|
+
];
|
|
32
|
+
next[i] = reconciled;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return next ?? current;
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const edges = getEdges();
|
|
39
|
+
if (!edges.some(isRoutable)) {
|
|
40
|
+
const hasStale = edges.some((edge)=>edge.data?.routedWaypoints !== void 0);
|
|
41
|
+
if (hasStale) apply([]);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const request = buildRequest(getNodes(), edges, isRoutable);
|
|
45
|
+
if (0 === request.edges.length) return void apply([]);
|
|
46
|
+
const result = router.route(request);
|
|
47
|
+
if (result instanceof Promise) result.then(apply).catch((err)=>{
|
|
48
|
+
if (cancelled) return;
|
|
49
|
+
console.error('[useGraphRouter] router.route() rejected:', err);
|
|
50
|
+
});
|
|
51
|
+
else apply(result);
|
|
52
|
+
return ()=>{
|
|
53
|
+
cancelled = true;
|
|
54
|
+
};
|
|
55
|
+
}, [
|
|
56
|
+
signature,
|
|
57
|
+
router,
|
|
58
|
+
isRoutable,
|
|
59
|
+
getNodes,
|
|
60
|
+
getEdges,
|
|
61
|
+
setEdges
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
function reconcileEdge(edge, routesById, isRoutable) {
|
|
65
|
+
const data = edge.data;
|
|
66
|
+
if (!isRoutable(edge)) {
|
|
67
|
+
if (data?.routedWaypoints === void 0) return edge;
|
|
68
|
+
const { routedWaypoints: _removed, ...rest } = data;
|
|
69
|
+
return {
|
|
70
|
+
...edge,
|
|
71
|
+
data: rest
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const route = routesById.get(edge.id);
|
|
75
|
+
if (!route) return edge;
|
|
76
|
+
const prev = data?.routedWaypoints ?? [];
|
|
77
|
+
if (waypointsPositionallyEqual(prev, route.waypoints)) return edge;
|
|
78
|
+
return {
|
|
79
|
+
...edge,
|
|
80
|
+
data: {
|
|
81
|
+
...edge.data,
|
|
82
|
+
routedWaypoints: route.waypoints
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function routeSignature(state, isRoutable) {
|
|
87
|
+
let sig = '';
|
|
88
|
+
for (const node of state.nodes){
|
|
89
|
+
const { width, height } = getNodeDimensions(node);
|
|
90
|
+
sig += `${node.id}:${node.position.x},${node.position.y},${width},${height}|`;
|
|
91
|
+
}
|
|
92
|
+
for (const edge of state.edges)sig += `${edge.id}:${edge.source}/${edge.sourceHandle ?? ''}>${edge.target}/${edge.targetHandle ?? ''}:${isRoutable(edge) ? 'r' : 'm'}|`;
|
|
93
|
+
return sig;
|
|
94
|
+
}
|
|
95
|
+
function buildRequest(nodes, edges, isRoutable) {
|
|
96
|
+
const routeNodes = nodes.map((n)=>{
|
|
97
|
+
const { width, height } = getNodeDimensions(n);
|
|
98
|
+
return {
|
|
99
|
+
id: n.id,
|
|
100
|
+
x: n.position.x,
|
|
101
|
+
y: n.position.y,
|
|
102
|
+
width,
|
|
103
|
+
height
|
|
104
|
+
};
|
|
105
|
+
});
|
|
106
|
+
const nodeMap = new Map(routeNodes.map((n)=>[
|
|
107
|
+
n.id,
|
|
108
|
+
n
|
|
109
|
+
]));
|
|
110
|
+
const routeEdges = [];
|
|
111
|
+
for (const edge of edges){
|
|
112
|
+
if (!isRoutable(edge)) continue;
|
|
113
|
+
const source = nodeMap.get(edge.source);
|
|
114
|
+
const target = nodeMap.get(edge.target);
|
|
115
|
+
if (source && target) routeEdges.push({
|
|
116
|
+
edgeId: edge.id,
|
|
117
|
+
source: {
|
|
118
|
+
nodeId: edge.source,
|
|
119
|
+
handleId: edge.sourceHandle ?? null,
|
|
120
|
+
x: source.x + source.width,
|
|
121
|
+
y: source.y + source.height / 2,
|
|
122
|
+
position: Position.Right
|
|
123
|
+
},
|
|
124
|
+
target: {
|
|
125
|
+
nodeId: edge.target,
|
|
126
|
+
handleId: edge.targetHandle ?? null,
|
|
127
|
+
x: target.x,
|
|
128
|
+
y: target.y + target.height / 2,
|
|
129
|
+
position: Position.Left
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
nodes: routeNodes,
|
|
135
|
+
edges: routeEdges
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
export { defaultIsRoutable, useGraphRouter };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Edge, EdgeProps, XYPosition } from '../../../xyflow/react.ts';
|
|
2
|
+
export type Point = XYPosition;
|
|
3
|
+
export type Waypoint = Point & {
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
export type PathVertex = Point & {
|
|
7
|
+
waypointIndex: number;
|
|
8
|
+
};
|
|
9
|
+
export type SegmentOrientation = 'horizontal' | 'vertical';
|
|
10
|
+
export type Segment = {
|
|
11
|
+
id: string;
|
|
12
|
+
start: Point;
|
|
13
|
+
end: Point;
|
|
14
|
+
orientation: SegmentOrientation;
|
|
15
|
+
waypointIndexBefore: number;
|
|
16
|
+
waypointIndexAfter: number;
|
|
17
|
+
};
|
|
18
|
+
export type EdgeStrokeStyle = 'solid' | 'dashed';
|
|
19
|
+
export type EdgeRouting = 'waypoint' | 'handle';
|
|
20
|
+
export type CanvasEdgeData = {
|
|
21
|
+
strokeStyle?: EdgeStrokeStyle;
|
|
22
|
+
hideArrowHead?: boolean;
|
|
23
|
+
label?: string | null;
|
|
24
|
+
isInvalid?: boolean;
|
|
25
|
+
isDiffAdded?: boolean;
|
|
26
|
+
isDiffRemoved?: boolean;
|
|
27
|
+
routing?: EdgeRouting;
|
|
28
|
+
enableEditing?: boolean;
|
|
29
|
+
enableExecution?: boolean;
|
|
30
|
+
enableToolbar?: boolean;
|
|
31
|
+
waypoints?: Waypoint[];
|
|
32
|
+
routedWaypoints?: Waypoint[];
|
|
33
|
+
onWaypointsChange?: (next: Waypoint[]) => void;
|
|
34
|
+
};
|
|
35
|
+
export type CanvasEdgeProps = EdgeProps<Edge<CanvasEdgeData>>;
|
|
36
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Edges/shared/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAE5F,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC;AAE/B,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAQF,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG;IAC/B,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE3D,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,KAAK,CAAC;IACX,WAAW,EAAE,kBAAkB,CAAC;IAEhC,mBAAmB,EAAE,MAAM,CAAC;IAE5B,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,QAAQ,CAAC;AAajD,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;AAWhD,MAAM,MAAM,cAAc,GAAG;IAE3B,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,OAAO,CAAC,EAAE,WAAW,CAAC;IAGtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IAQvB,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;IAS7B,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1,216 @@
|
|
|
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 ("u" > 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
|
+
moveWaypoint: ()=>moveWaypoint,
|
|
28
|
+
removeWaypoint: ()=>removeWaypoint,
|
|
29
|
+
materializePathWaypoints: ()=>materializePathWaypoints,
|
|
30
|
+
waypointsEqual: ()=>waypointsEqual,
|
|
31
|
+
rebalanceWaypoints: ()=>rebalanceWaypoints,
|
|
32
|
+
insertWaypoint: ()=>insertWaypoint,
|
|
33
|
+
waypointsPositionallyEqual: ()=>waypointsPositionallyEqual,
|
|
34
|
+
moveSegmentByDelta: ()=>moveSegmentByDelta,
|
|
35
|
+
generateWaypointId: ()=>generateWaypointId
|
|
36
|
+
});
|
|
37
|
+
const NodeUtils_cjs_namespaceObject = require("../../../utils/NodeUtils.cjs");
|
|
38
|
+
const external_constants_cjs_namespaceObject = require("./constants.cjs");
|
|
39
|
+
const external_geometry_cjs_namespaceObject = require("./geometry.cjs");
|
|
40
|
+
function materializePathWaypoints(vertices, stored) {
|
|
41
|
+
return vertices.slice(1, -1).map((vertex)=>{
|
|
42
|
+
const existing = vertex.waypointIndex >= 0 ? stored[vertex.waypointIndex] : void 0;
|
|
43
|
+
return existing ?? {
|
|
44
|
+
id: generateWaypointId(),
|
|
45
|
+
x: vertex.x,
|
|
46
|
+
y: vertex.y
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function generateWaypointId() {
|
|
51
|
+
return `wp-${crypto.randomUUID()}`;
|
|
52
|
+
}
|
|
53
|
+
function waypointsEqual(a, b) {
|
|
54
|
+
if (a === b) return true;
|
|
55
|
+
if (a.length !== b.length) return false;
|
|
56
|
+
for(let i = 0; i < a.length; i++){
|
|
57
|
+
const wa = a[i];
|
|
58
|
+
const wb = b[i];
|
|
59
|
+
if (wa.x !== wb.x || wa.y !== wb.y || wa.id !== wb.id) return false;
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
function waypointsPositionallyEqual(a, b) {
|
|
64
|
+
if (a === b) return true;
|
|
65
|
+
if (a.length !== b.length) return false;
|
|
66
|
+
for(let i = 0; i < a.length; i++)if (a[i].x !== b[i].x || a[i].y !== b[i].y) return false;
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
function insertWaypoint(vertices, stored, segmentIndex, position) {
|
|
70
|
+
const newWaypoint = {
|
|
71
|
+
id: generateWaypointId(),
|
|
72
|
+
...(0, external_geometry_cjs_namespaceObject.snapPointToGrid)(position)
|
|
73
|
+
};
|
|
74
|
+
const materialized = materializePathWaypoints(vertices, stored);
|
|
75
|
+
materialized.splice(Math.max(0, segmentIndex), 0, newWaypoint);
|
|
76
|
+
return materialized;
|
|
77
|
+
}
|
|
78
|
+
function removeWaypoint(waypoints, index) {
|
|
79
|
+
return waypoints.filter((_, i)=>i !== index);
|
|
80
|
+
}
|
|
81
|
+
const REBALANCE_EPSILON = 0.5;
|
|
82
|
+
function rebalanceWaypoints(waypoints, source, target) {
|
|
83
|
+
if (0 === waypoints.length) return waypoints;
|
|
84
|
+
const sourceDelta = waypoints_delta(source);
|
|
85
|
+
const targetDelta = waypoints_delta(target);
|
|
86
|
+
if (isMoved(sourceDelta) && deltasEqual(sourceDelta, targetDelta)) return waypoints.map((w)=>({
|
|
87
|
+
id: w.id,
|
|
88
|
+
x: w.x + sourceDelta.x,
|
|
89
|
+
y: w.y + sourceDelta.y
|
|
90
|
+
}));
|
|
91
|
+
const next = waypoints.map((w)=>({
|
|
92
|
+
...w
|
|
93
|
+
}));
|
|
94
|
+
if (1 === next.length) {
|
|
95
|
+
const sourceMoved = isMoved(sourceDelta);
|
|
96
|
+
const targetMoved = isMoved(targetDelta);
|
|
97
|
+
if (sourceMoved && !targetMoved) shiftAdjacentWaypoint(next[0], source);
|
|
98
|
+
else if (targetMoved && !sourceMoved) shiftAdjacentWaypoint(next[0], target);
|
|
99
|
+
return next;
|
|
100
|
+
}
|
|
101
|
+
shiftAdjacentWaypoint(next[0], source);
|
|
102
|
+
shiftAdjacentWaypoint(next[next.length - 1], target);
|
|
103
|
+
return next;
|
|
104
|
+
}
|
|
105
|
+
function waypoints_delta(endpoint) {
|
|
106
|
+
return {
|
|
107
|
+
x: endpoint.to.x - endpoint.from.x,
|
|
108
|
+
y: endpoint.to.y - endpoint.from.y
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function isMoved(d) {
|
|
112
|
+
return Math.abs(d.x) >= REBALANCE_EPSILON || Math.abs(d.y) >= REBALANCE_EPSILON;
|
|
113
|
+
}
|
|
114
|
+
function deltasEqual(a, b) {
|
|
115
|
+
return Math.abs(a.x - b.x) < REBALANCE_EPSILON && Math.abs(a.y - b.y) < REBALANCE_EPSILON;
|
|
116
|
+
}
|
|
117
|
+
function shiftAdjacentWaypoint(waypoint, endpoint) {
|
|
118
|
+
if ((0, external_geometry_cjs_namespaceObject.isHorizontalPosition)(endpoint.position)) waypoint.y += endpoint.to.y - endpoint.from.y;
|
|
119
|
+
else waypoint.x += endpoint.to.x - endpoint.from.x;
|
|
120
|
+
}
|
|
121
|
+
function moveWaypoint(waypoints, index, newPosition) {
|
|
122
|
+
const snapped = (0, external_geometry_cjs_namespaceObject.snapPointToGrid)(newPosition);
|
|
123
|
+
return waypoints.map((wp, i)=>i === index ? {
|
|
124
|
+
...wp,
|
|
125
|
+
...snapped
|
|
126
|
+
} : wp);
|
|
127
|
+
}
|
|
128
|
+
function moveSegmentByDelta(initialWaypoints, initialSegment, delta, initialPathPoints) {
|
|
129
|
+
const moveAxis = 'horizontal' === initialSegment.orientation ? 'y' : 'x';
|
|
130
|
+
const moveValue = 'y' === moveAxis ? delta.y : delta.x;
|
|
131
|
+
const working = initialWaypoints.map((wp)=>({
|
|
132
|
+
...wp
|
|
133
|
+
}));
|
|
134
|
+
const isConnectedToSource = initialSegment.waypointIndexBefore < 0;
|
|
135
|
+
const isConnectedToTarget = initialSegment.waypointIndexAfter >= working.length;
|
|
136
|
+
let insertedAtStart = false;
|
|
137
|
+
const stubOffset = external_constants_cjs_namespaceObject.EDGE_CONSTANTS.STUB_OFFSET;
|
|
138
|
+
const orientation = initialSegment.orientation;
|
|
139
|
+
const segmentStart = initialSegment.start;
|
|
140
|
+
const segmentEnd = initialSegment.end;
|
|
141
|
+
const pathSource = initialPathPoints[0];
|
|
142
|
+
const pathTarget = initialPathPoints[initialPathPoints.length - 1];
|
|
143
|
+
const movedCoordinate = 'horizontal' === orientation ? (0, NodeUtils_cjs_namespaceObject.snapToGrid)(segmentStart.y + moveValue) : (0, NodeUtils_cjs_namespaceObject.snapToGrid)(segmentStart.x + moveValue);
|
|
144
|
+
if (isConnectedToSource) {
|
|
145
|
+
const stubCoord = (0, NodeUtils_cjs_namespaceObject.snapToGrid)(('horizontal' === orientation ? segmentStart.x : segmentStart.y) + stubOffset);
|
|
146
|
+
const [anchorStub, movedStub] = makeStubPair(segmentStart, orientation, stubCoord, movedCoordinate);
|
|
147
|
+
working.unshift(anchorStub, movedStub);
|
|
148
|
+
insertedAtStart = true;
|
|
149
|
+
}
|
|
150
|
+
if (isConnectedToTarget) {
|
|
151
|
+
const stubCoord = (0, NodeUtils_cjs_namespaceObject.snapToGrid)(('horizontal' === orientation ? segmentEnd.x : segmentEnd.y) - stubOffset);
|
|
152
|
+
const [anchorStub, movedStub] = makeStubPair(segmentEnd, orientation, stubCoord, movedCoordinate);
|
|
153
|
+
working.push(movedStub, anchorStub);
|
|
154
|
+
}
|
|
155
|
+
const indexOffset = insertedAtStart ? 2 : 0;
|
|
156
|
+
if (!isConnectedToSource && initialSegment.waypointIndexBefore >= 0) {
|
|
157
|
+
const idx = initialSegment.waypointIndexBefore + indexOffset;
|
|
158
|
+
const wp = working[idx];
|
|
159
|
+
if (wp) wp[moveAxis] = movedCoordinate;
|
|
160
|
+
}
|
|
161
|
+
if (!isConnectedToTarget && initialSegment.waypointIndexAfter < initialWaypoints.length) {
|
|
162
|
+
const idx = initialSegment.waypointIndexAfter + indexOffset;
|
|
163
|
+
const wp = working[idx];
|
|
164
|
+
if (wp) wp[moveAxis] = movedCoordinate;
|
|
165
|
+
}
|
|
166
|
+
return (0, external_geometry_cjs_namespaceObject.consolidateWaypoints)(working, pathSource, pathTarget);
|
|
167
|
+
}
|
|
168
|
+
function makeStubPair(anchor, orientation, stubCoord, movedCoordinate) {
|
|
169
|
+
if ('horizontal' === orientation) return [
|
|
170
|
+
{
|
|
171
|
+
id: generateWaypointId(),
|
|
172
|
+
x: stubCoord,
|
|
173
|
+
y: anchor.y
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
id: generateWaypointId(),
|
|
177
|
+
x: stubCoord,
|
|
178
|
+
y: movedCoordinate
|
|
179
|
+
}
|
|
180
|
+
];
|
|
181
|
+
return [
|
|
182
|
+
{
|
|
183
|
+
id: generateWaypointId(),
|
|
184
|
+
x: anchor.x,
|
|
185
|
+
y: stubCoord
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: generateWaypointId(),
|
|
189
|
+
x: movedCoordinate,
|
|
190
|
+
y: stubCoord
|
|
191
|
+
}
|
|
192
|
+
];
|
|
193
|
+
}
|
|
194
|
+
exports.generateWaypointId = __webpack_exports__.generateWaypointId;
|
|
195
|
+
exports.insertWaypoint = __webpack_exports__.insertWaypoint;
|
|
196
|
+
exports.materializePathWaypoints = __webpack_exports__.materializePathWaypoints;
|
|
197
|
+
exports.moveSegmentByDelta = __webpack_exports__.moveSegmentByDelta;
|
|
198
|
+
exports.moveWaypoint = __webpack_exports__.moveWaypoint;
|
|
199
|
+
exports.rebalanceWaypoints = __webpack_exports__.rebalanceWaypoints;
|
|
200
|
+
exports.removeWaypoint = __webpack_exports__.removeWaypoint;
|
|
201
|
+
exports.waypointsEqual = __webpack_exports__.waypointsEqual;
|
|
202
|
+
exports.waypointsPositionallyEqual = __webpack_exports__.waypointsPositionallyEqual;
|
|
203
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
204
|
+
"generateWaypointId",
|
|
205
|
+
"insertWaypoint",
|
|
206
|
+
"materializePathWaypoints",
|
|
207
|
+
"moveSegmentByDelta",
|
|
208
|
+
"moveWaypoint",
|
|
209
|
+
"rebalanceWaypoints",
|
|
210
|
+
"removeWaypoint",
|
|
211
|
+
"waypointsEqual",
|
|
212
|
+
"waypointsPositionallyEqual"
|
|
213
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
214
|
+
Object.defineProperty(exports, '__esModule', {
|
|
215
|
+
value: true
|
|
216
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Position } from '../../../xyflow/react.ts';
|
|
2
|
+
import type { PathVertex, Point, Segment, Waypoint } from './types';
|
|
3
|
+
export declare function materializePathWaypoints(vertices: PathVertex[], stored: Waypoint[]): Waypoint[];
|
|
4
|
+
export declare function generateWaypointId(): string;
|
|
5
|
+
export declare function waypointsEqual(a: Waypoint[], b: Waypoint[]): boolean;
|
|
6
|
+
export declare function waypointsPositionallyEqual(a: Waypoint[], b: Waypoint[]): boolean;
|
|
7
|
+
export declare function insertWaypoint(vertices: PathVertex[], stored: Waypoint[], segmentIndex: number, position: Point): Waypoint[];
|
|
8
|
+
export declare function removeWaypoint(waypoints: Waypoint[], index: number): Waypoint[];
|
|
9
|
+
export type RebalanceEndpoint = {
|
|
10
|
+
position: Position;
|
|
11
|
+
from: Point;
|
|
12
|
+
to: Point;
|
|
13
|
+
};
|
|
14
|
+
export declare function rebalanceWaypoints(waypoints: Waypoint[], source: RebalanceEndpoint, target: RebalanceEndpoint): Waypoint[];
|
|
15
|
+
export declare function moveWaypoint(waypoints: Waypoint[], index: number, newPosition: Point): Waypoint[];
|
|
16
|
+
export declare function moveSegmentByDelta(initialWaypoints: Waypoint[], initialSegment: Segment, delta: Point, initialPathPoints: Point[]): Waypoint[];
|
|
17
|
+
//# sourceMappingURL=waypoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waypoints.d.ts","sourceRoot":"","sources":["../../../../../src/canvas/components/Edges/shared/waypoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAIzE,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAUpE,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAK/F;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAOD,wBAAgB,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,OAAO,CASpE;AAOD,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,OAAO,CAOhF;AASD,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,UAAU,EAAE,EACtB,MAAM,EAAE,QAAQ,EAAE,EAClB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,KAAK,GACd,QAAQ,EAAE,CASZ;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,EAAE,CAE/E;AAID,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,KAAK,CAAC;IACZ,EAAE,EAAE,KAAK,CAAC;CACX,CAAC;AAqBF,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,QAAQ,EAAE,EACrB,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,iBAAiB,GACxB,QAAQ,EAAE,CA2BZ;AAwBD,wBAAgB,YAAY,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,GAAG,QAAQ,EAAE,CAGjG;AAUD,wBAAgB,kBAAkB,CAChC,gBAAgB,EAAE,QAAQ,EAAE,EAC5B,cAAc,EAAE,OAAO,EACvB,KAAK,EAAE,KAAK,EACZ,iBAAiB,EAAE,KAAK,EAAE,GACzB,QAAQ,EAAE,CAiEZ"}
|