@uipath/apollo-react 6.20.1 → 6.21.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 +1 -1
- package/dist/canvas/components/Edges/CanvasEdge.d.ts.map +1 -1
- package/dist/canvas/components/Edges/CanvasEdge.js +1 -1
- package/dist/canvas/components/Edges/index.cjs +52 -8
- package/dist/canvas/components/Edges/index.d.ts +5 -2
- package/dist/canvas/components/Edges/index.d.ts.map +1 -1
- package/dist/canvas/components/Edges/index.js +4 -2
- package/dist/canvas/components/Edges/shared/geometry.d.ts.map +1 -1
- package/dist/canvas/components/Edges/shared/routing/anchors.cjs +98 -0
- package/dist/canvas/components/Edges/shared/routing/anchors.d.ts +10 -0
- package/dist/canvas/components/Edges/shared/routing/anchors.d.ts.map +1 -0
- package/dist/canvas/components/Edges/shared/routing/anchors.js +61 -0
- package/dist/canvas/components/Edges/shared/routing/index.cjs +8 -1
- package/dist/canvas/components/Edges/shared/routing/index.d.ts +2 -0
- package/dist/canvas/components/Edges/shared/routing/index.d.ts.map +1 -1
- package/dist/canvas/components/Edges/shared/routing/index.js +2 -1
- package/dist/canvas/components/Edges/shared/routing/useGraphRouter.cjs +16 -37
- package/dist/canvas/components/Edges/shared/routing/useGraphRouter.d.ts.map +1 -1
- package/dist/canvas/components/Edges/shared/routing/useGraphRouter.js +17 -38
- package/dist/canvas/components/Edges/shared/types.d.ts +1 -0
- package/dist/canvas/components/Edges/shared/types.d.ts.map +1 -1
- package/dist/canvas/schema/node-instance/edge.cjs +19 -2
- package/dist/canvas/schema/node-instance/edge.d.ts +59 -0
- package/dist/canvas/schema/node-instance/edge.d.ts.map +1 -1
- package/dist/canvas/schema/node-instance/edge.js +12 -1
- package/dist/canvas/schema/node-instance/index.cjs +11 -5
- package/dist/canvas/schema/node-instance/index.d.ts +2 -2
- package/dist/canvas/schema/node-instance/index.d.ts.map +1 -1
- package/dist/canvas/schema/node-instance/index.js +2 -2
- package/package.json +1 -1
|
@@ -109,7 +109,7 @@ const CanvasEdge_CanvasEdge = /*#__PURE__*/ (0, external_react_namespaceObject.m
|
|
|
109
109
|
targetY,
|
|
110
110
|
targetPosition,
|
|
111
111
|
waypoints: effectiveWaypoints,
|
|
112
|
-
autoRouted: 0 === waypoints.length,
|
|
112
|
+
autoRouted: data?.autoRouted ?? 0 === waypoints.length,
|
|
113
113
|
enableSegments: editingEnabled,
|
|
114
114
|
hideArrowHead,
|
|
115
115
|
enableLineJumps: !!data?.enableLineJumps
|
|
@@ -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;
|
|
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;AAetD,eAAO,MAAM,UAAU,uDAoOF,CAAC"}
|
|
@@ -81,7 +81,7 @@ const CanvasEdge_CanvasEdge = /*#__PURE__*/ memo(function({ id, selected, animat
|
|
|
81
81
|
targetY,
|
|
82
82
|
targetPosition,
|
|
83
83
|
waypoints: effectiveWaypoints,
|
|
84
|
-
autoRouted: 0 === waypoints.length,
|
|
84
|
+
autoRouted: data?.autoRouted ?? 0 === waypoints.length,
|
|
85
85
|
enableSegments: editingEnabled,
|
|
86
86
|
hideArrowHead,
|
|
87
87
|
enableLineJumps: !!data?.enableLineJumps
|
|
@@ -9,8 +9,14 @@ var __webpack_modules__ = {
|
|
|
9
9
|
"./shared/crossings" (module) {
|
|
10
10
|
module.exports = require("./shared/crossings/index.cjs");
|
|
11
11
|
},
|
|
12
|
+
"./shared/geometry" (module) {
|
|
13
|
+
module.exports = require("./shared/geometry.cjs");
|
|
14
|
+
},
|
|
12
15
|
"./shared/routing" (module) {
|
|
13
16
|
module.exports = require("./shared/routing/index.cjs");
|
|
17
|
+
},
|
|
18
|
+
"./shared/waypoints" (module) {
|
|
19
|
+
module.exports = require("./shared/waypoints.cjs");
|
|
14
20
|
}
|
|
15
21
|
};
|
|
16
22
|
var __webpack_module_cache__ = {};
|
|
@@ -59,36 +65,74 @@ var __webpack_exports__ = {};
|
|
|
59
65
|
__webpack_require__.d(__webpack_exports__, {
|
|
60
66
|
CanvasEdge: ()=>_CanvasEdge__rspack_import_0.CanvasEdge,
|
|
61
67
|
EdgeCrossingsProvider: ()=>_shared_crossings__rspack_import_2.EdgeCrossingsProvider,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
calculateAutoWaypoints: ()=>_shared_geometry__rspack_import_3.calculateAutoWaypoints,
|
|
69
|
+
defaultEdgeRouter: ()=>_shared_routing__rspack_import_4.defaultEdgeRouter,
|
|
70
|
+
defaultIsRoutable: ()=>_shared_routing__rspack_import_4.defaultIsRoutable,
|
|
71
|
+
generateWaypointId: ()=>_shared_waypoints__rspack_import_5.generateWaypointId,
|
|
72
|
+
moveWaypoint: ()=>_shared_waypoints__rspack_import_5.moveWaypoint,
|
|
73
|
+
rebalanceWaypoints: ()=>_shared_waypoints__rspack_import_5.rebalanceWaypoints,
|
|
74
|
+
resolveRouteAnchors: ()=>_shared_routing__rspack_import_4.resolveRouteAnchors,
|
|
75
|
+
snapPointToGrid: ()=>_shared_geometry__rspack_import_3.snapPointToGrid,
|
|
76
|
+
toRouteNode: ()=>_shared_routing__rspack_import_4.toRouteNode,
|
|
77
|
+
useGraphRouter: ()=>_shared_routing__rspack_import_4.useGraphRouter,
|
|
78
|
+
waypointsEqual: ()=>_shared_waypoints__rspack_import_5.waypointsEqual,
|
|
79
|
+
waypointsPositionallyEqual: ()=>_shared_waypoints__rspack_import_5.waypointsPositionallyEqual
|
|
65
80
|
});
|
|
66
81
|
var _CanvasEdge__rspack_import_0 = __webpack_require__("./CanvasEdge");
|
|
67
82
|
var _SequenceEdge__rspack_import_1 = __webpack_require__("./SequenceEdge");
|
|
68
83
|
var __rspack_reexport = {};
|
|
69
84
|
for(const __rspack_import_key in _SequenceEdge__rspack_import_1)if ([
|
|
85
|
+
"snapPointToGrid",
|
|
86
|
+
"defaultIsRoutable",
|
|
87
|
+
"calculateAutoWaypoints",
|
|
88
|
+
"CanvasEdge",
|
|
89
|
+
"EdgeCrossingsProvider",
|
|
90
|
+
"toRouteNode",
|
|
91
|
+
"rebalanceWaypoints",
|
|
92
|
+
"waypointsEqual",
|
|
70
93
|
"defaultEdgeRouter",
|
|
71
94
|
"useGraphRouter",
|
|
95
|
+
"waypointsPositionallyEqual",
|
|
96
|
+
"moveWaypoint",
|
|
72
97
|
"default",
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"defaultIsRoutable"
|
|
98
|
+
"generateWaypointId",
|
|
99
|
+
"resolveRouteAnchors"
|
|
76
100
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_SequenceEdge__rspack_import_1[__rspack_import_key];
|
|
77
101
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
78
102
|
var _shared_crossings__rspack_import_2 = __webpack_require__("./shared/crossings");
|
|
79
|
-
var
|
|
103
|
+
var _shared_geometry__rspack_import_3 = __webpack_require__("./shared/geometry");
|
|
104
|
+
var _shared_routing__rspack_import_4 = __webpack_require__("./shared/routing");
|
|
105
|
+
var _shared_waypoints__rspack_import_5 = __webpack_require__("./shared/waypoints");
|
|
80
106
|
})();
|
|
81
107
|
exports.CanvasEdge = __webpack_exports__.CanvasEdge;
|
|
82
108
|
exports.EdgeCrossingsProvider = __webpack_exports__.EdgeCrossingsProvider;
|
|
109
|
+
exports.calculateAutoWaypoints = __webpack_exports__.calculateAutoWaypoints;
|
|
83
110
|
exports.defaultEdgeRouter = __webpack_exports__.defaultEdgeRouter;
|
|
84
111
|
exports.defaultIsRoutable = __webpack_exports__.defaultIsRoutable;
|
|
112
|
+
exports.generateWaypointId = __webpack_exports__.generateWaypointId;
|
|
113
|
+
exports.moveWaypoint = __webpack_exports__.moveWaypoint;
|
|
114
|
+
exports.rebalanceWaypoints = __webpack_exports__.rebalanceWaypoints;
|
|
115
|
+
exports.resolveRouteAnchors = __webpack_exports__.resolveRouteAnchors;
|
|
116
|
+
exports.snapPointToGrid = __webpack_exports__.snapPointToGrid;
|
|
117
|
+
exports.toRouteNode = __webpack_exports__.toRouteNode;
|
|
85
118
|
exports.useGraphRouter = __webpack_exports__.useGraphRouter;
|
|
119
|
+
exports.waypointsEqual = __webpack_exports__.waypointsEqual;
|
|
120
|
+
exports.waypointsPositionallyEqual = __webpack_exports__.waypointsPositionallyEqual;
|
|
86
121
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
87
122
|
"CanvasEdge",
|
|
88
123
|
"EdgeCrossingsProvider",
|
|
124
|
+
"calculateAutoWaypoints",
|
|
89
125
|
"defaultEdgeRouter",
|
|
90
126
|
"defaultIsRoutable",
|
|
91
|
-
"
|
|
127
|
+
"generateWaypointId",
|
|
128
|
+
"moveWaypoint",
|
|
129
|
+
"rebalanceWaypoints",
|
|
130
|
+
"resolveRouteAnchors",
|
|
131
|
+
"snapPointToGrid",
|
|
132
|
+
"toRouteNode",
|
|
133
|
+
"useGraphRouter",
|
|
134
|
+
"waypointsEqual",
|
|
135
|
+
"waypointsPositionallyEqual"
|
|
92
136
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
93
137
|
Object.defineProperty(exports, '__esModule', {
|
|
94
138
|
value: true
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export { CanvasEdge } from './CanvasEdge';
|
|
2
2
|
export * from './SequenceEdge';
|
|
3
3
|
export { EdgeCrossingsProvider } from './shared/crossings';
|
|
4
|
-
export
|
|
5
|
-
export {
|
|
4
|
+
export { calculateAutoWaypoints, snapPointToGrid } from './shared/geometry';
|
|
5
|
+
export type { EdgeRouter, RouteAnchor, RouteAnchorPair, RoutedEdge, RouteEdgeRequest, RouteNodeLookup, RouteNodeRequest, RouteRequest, } from './shared/routing';
|
|
6
|
+
export { defaultEdgeRouter, defaultIsRoutable, resolveRouteAnchors, toRouteNode, useGraphRouter, } from './shared/routing';
|
|
6
7
|
export type { CanvasEdgeData, CanvasEdgeProps, EdgeRouting, EdgeStrokeStyle, PathJump, Point, Segment, SegmentOrientation, Waypoint, } from './shared/types';
|
|
8
|
+
export type { RebalanceEndpoint } from './shared/waypoints';
|
|
9
|
+
export { generateWaypointId, moveWaypoint, rebalanceWaypoints, waypointsEqual, waypointsPositionallyEqual, } from './shared/waypoints';
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Edges/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/Edges/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC5E,YAAY,EACV,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,eAAe,EACf,QAAQ,EACR,KAAK,EACL,OAAO,EACP,kBAAkB,EAClB,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { CanvasEdge } from "./CanvasEdge.js";
|
|
2
2
|
import { EdgeCrossingsProvider } from "./shared/crossings/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { calculateAutoWaypoints, snapPointToGrid } from "./shared/geometry.js";
|
|
4
|
+
import { defaultEdgeRouter, defaultIsRoutable, resolveRouteAnchors, toRouteNode, useGraphRouter } from "./shared/routing/index.js";
|
|
5
|
+
import { generateWaypointId, moveWaypoint, rebalanceWaypoints, waypointsEqual, waypointsPositionallyEqual } from "./shared/waypoints.js";
|
|
4
6
|
export * from "./SequenceEdge.js";
|
|
5
|
-
export { CanvasEdge, EdgeCrossingsProvider, defaultEdgeRouter, defaultIsRoutable, useGraphRouter };
|
|
7
|
+
export { CanvasEdge, EdgeCrossingsProvider, calculateAutoWaypoints, defaultEdgeRouter, defaultIsRoutable, generateWaypointId, moveWaypoint, rebalanceWaypoints, resolveRouteAnchors, snapPointToGrid, toRouteNode, useGraphRouter, waypointsEqual, waypointsPositionallyEqual };
|
|
@@ -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,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ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K,EAChB,OAAO,EAAE,KAAK,EACd,WAAW,GAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAqB,GAC/C,CAAC,EAAE,CAsFL;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,kBAAkB,CAElF;AAKD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,KAAK,CAAA;CAAE,GAAG,OAAO,CAIrF;AAUD,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,CAgBnE;AAkBD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,KAAK,EAAE,EACf,YAAY,GAAE,MAAsB,EACpC,KAAK,GAAE,SAAS,QAAQ,EAAO,GAC9B,MAAM,CA8BR;AA8ED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,KAAK,CAK1D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAIzD;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE/D;AAOD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAkCzD"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
toRouteNode: ()=>toRouteNode,
|
|
28
|
+
resolveRouteAnchors: ()=>resolveRouteAnchors
|
|
29
|
+
});
|
|
30
|
+
const react_cjs_namespaceObject = require("../../../../xyflow/react.cjs");
|
|
31
|
+
const system_cjs_namespaceObject = require("../../../../xyflow/system.cjs");
|
|
32
|
+
const container_cjs_namespaceObject = require("../../../../utils/container.cjs");
|
|
33
|
+
function toRouteNode(node) {
|
|
34
|
+
const { width, height } = (0, container_cjs_namespaceObject.getNodeDimensions)(node);
|
|
35
|
+
const { x, y } = node.internals.positionAbsolute;
|
|
36
|
+
return {
|
|
37
|
+
id: node.id,
|
|
38
|
+
x,
|
|
39
|
+
y,
|
|
40
|
+
width,
|
|
41
|
+
height
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function resolveRouteAnchors(nodeLookup, edge, connectionMode) {
|
|
45
|
+
const sourceNode = nodeLookup.get(edge.source);
|
|
46
|
+
const targetNode = nodeLookup.get(edge.target);
|
|
47
|
+
if (!sourceNode || !targetNode) return null;
|
|
48
|
+
const sourceHandle = edge.sourceHandle ?? null;
|
|
49
|
+
const targetHandle = edge.targetHandle ?? null;
|
|
50
|
+
const position = (0, system_cjs_namespaceObject.getEdgePosition)({
|
|
51
|
+
id: edge.id,
|
|
52
|
+
sourceNode,
|
|
53
|
+
sourceHandle,
|
|
54
|
+
targetNode,
|
|
55
|
+
targetHandle,
|
|
56
|
+
connectionMode
|
|
57
|
+
});
|
|
58
|
+
if (!position) return {
|
|
59
|
+
source: approximateAnchor(sourceNode, sourceHandle, react_cjs_namespaceObject.Position.Right),
|
|
60
|
+
target: approximateAnchor(targetNode, targetHandle, react_cjs_namespaceObject.Position.Left)
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
source: {
|
|
64
|
+
nodeId: sourceNode.id,
|
|
65
|
+
handleId: sourceHandle,
|
|
66
|
+
x: position.sourceX,
|
|
67
|
+
y: position.sourceY,
|
|
68
|
+
position: position.sourcePosition
|
|
69
|
+
},
|
|
70
|
+
target: {
|
|
71
|
+
nodeId: targetNode.id,
|
|
72
|
+
handleId: targetHandle,
|
|
73
|
+
x: position.targetX,
|
|
74
|
+
y: position.targetY,
|
|
75
|
+
position: position.targetPosition
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function approximateAnchor(node, handleId, face) {
|
|
80
|
+
const { width, height } = (0, container_cjs_namespaceObject.getNodeDimensions)(node);
|
|
81
|
+
const { x, y } = node.internals.positionAbsolute;
|
|
82
|
+
return {
|
|
83
|
+
nodeId: node.id,
|
|
84
|
+
handleId,
|
|
85
|
+
x: face === react_cjs_namespaceObject.Position.Right ? x + width : x,
|
|
86
|
+
y: y + height / 2,
|
|
87
|
+
position: face
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
exports.resolveRouteAnchors = __webpack_exports__.resolveRouteAnchors;
|
|
91
|
+
exports.toRouteNode = __webpack_exports__.toRouteNode;
|
|
92
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
93
|
+
"resolveRouteAnchors",
|
|
94
|
+
"toRouteNode"
|
|
95
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
96
|
+
Object.defineProperty(exports, '__esModule', {
|
|
97
|
+
value: true
|
|
98
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ConnectionMode, type Edge, type InternalNode, type ReactFlowState } from '../../../../xyflow/react.ts';
|
|
2
|
+
import type { RouteAnchor, RouteNodeRequest } from './types';
|
|
3
|
+
export type RouteNodeLookup = ReactFlowState['nodeLookup'];
|
|
4
|
+
export type RouteAnchorPair = {
|
|
5
|
+
source: RouteAnchor;
|
|
6
|
+
target: RouteAnchor;
|
|
7
|
+
};
|
|
8
|
+
export declare function toRouteNode(node: InternalNode): RouteNodeRequest;
|
|
9
|
+
export declare function resolveRouteAnchors(nodeLookup: RouteNodeLookup, edge: Edge, connectionMode: ConnectionMode): RouteAnchorPair | null;
|
|
10
|
+
//# sourceMappingURL=anchors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchors.d.ts","sourceRoot":"","sources":["../../../../../../src/canvas/components/Edges/shared/routing/anchors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,IAAI,EACT,KAAK,YAAY,EAEjB,KAAK,cAAc,EACpB,MAAM,0CAA0C,CAAC;AAGlD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE7D,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,YAAY,CAAC,CAAC;AAE3D,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AAUF,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,gBAAgB,CAIhE;AAcD,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,eAAe,EAC3B,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,cAAc,GAC7B,eAAe,GAAG,IAAI,CAwCxB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Position } from "../../../../xyflow/react.js";
|
|
2
|
+
import { getEdgePosition } from "../../../../xyflow/system.js";
|
|
3
|
+
import { getNodeDimensions } from "../../../../utils/container.js";
|
|
4
|
+
function toRouteNode(node) {
|
|
5
|
+
const { width, height } = getNodeDimensions(node);
|
|
6
|
+
const { x, y } = node.internals.positionAbsolute;
|
|
7
|
+
return {
|
|
8
|
+
id: node.id,
|
|
9
|
+
x,
|
|
10
|
+
y,
|
|
11
|
+
width,
|
|
12
|
+
height
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function resolveRouteAnchors(nodeLookup, edge, connectionMode) {
|
|
16
|
+
const sourceNode = nodeLookup.get(edge.source);
|
|
17
|
+
const targetNode = nodeLookup.get(edge.target);
|
|
18
|
+
if (!sourceNode || !targetNode) return null;
|
|
19
|
+
const sourceHandle = edge.sourceHandle ?? null;
|
|
20
|
+
const targetHandle = edge.targetHandle ?? null;
|
|
21
|
+
const position = getEdgePosition({
|
|
22
|
+
id: edge.id,
|
|
23
|
+
sourceNode,
|
|
24
|
+
sourceHandle,
|
|
25
|
+
targetNode,
|
|
26
|
+
targetHandle,
|
|
27
|
+
connectionMode
|
|
28
|
+
});
|
|
29
|
+
if (!position) return {
|
|
30
|
+
source: approximateAnchor(sourceNode, sourceHandle, Position.Right),
|
|
31
|
+
target: approximateAnchor(targetNode, targetHandle, Position.Left)
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
source: {
|
|
35
|
+
nodeId: sourceNode.id,
|
|
36
|
+
handleId: sourceHandle,
|
|
37
|
+
x: position.sourceX,
|
|
38
|
+
y: position.sourceY,
|
|
39
|
+
position: position.sourcePosition
|
|
40
|
+
},
|
|
41
|
+
target: {
|
|
42
|
+
nodeId: targetNode.id,
|
|
43
|
+
handleId: targetHandle,
|
|
44
|
+
x: position.targetX,
|
|
45
|
+
y: position.targetY,
|
|
46
|
+
position: position.targetPosition
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function approximateAnchor(node, handleId, face) {
|
|
51
|
+
const { width, height } = getNodeDimensions(node);
|
|
52
|
+
const { x, y } = node.internals.positionAbsolute;
|
|
53
|
+
return {
|
|
54
|
+
nodeId: node.id,
|
|
55
|
+
handleId,
|
|
56
|
+
x: face === Position.Right ? x + width : x,
|
|
57
|
+
y: y + height / 2,
|
|
58
|
+
position: face
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export { resolveRouteAnchors, toRouteNode };
|
|
@@ -24,18 +24,25 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
defaultIsRoutable: ()=>external_useGraphRouter_cjs_namespaceObject.defaultIsRoutable,
|
|
27
28
|
defaultEdgeRouter: ()=>external_defaultEdgeRouter_cjs_namespaceObject.defaultEdgeRouter,
|
|
28
29
|
useGraphRouter: ()=>external_useGraphRouter_cjs_namespaceObject.useGraphRouter,
|
|
29
|
-
|
|
30
|
+
toRouteNode: ()=>external_anchors_cjs_namespaceObject.toRouteNode,
|
|
31
|
+
resolveRouteAnchors: ()=>external_anchors_cjs_namespaceObject.resolveRouteAnchors
|
|
30
32
|
});
|
|
33
|
+
const external_anchors_cjs_namespaceObject = require("./anchors.cjs");
|
|
31
34
|
const external_defaultEdgeRouter_cjs_namespaceObject = require("./defaultEdgeRouter.cjs");
|
|
32
35
|
const external_useGraphRouter_cjs_namespaceObject = require("./useGraphRouter.cjs");
|
|
33
36
|
exports.defaultEdgeRouter = __webpack_exports__.defaultEdgeRouter;
|
|
34
37
|
exports.defaultIsRoutable = __webpack_exports__.defaultIsRoutable;
|
|
38
|
+
exports.resolveRouteAnchors = __webpack_exports__.resolveRouteAnchors;
|
|
39
|
+
exports.toRouteNode = __webpack_exports__.toRouteNode;
|
|
35
40
|
exports.useGraphRouter = __webpack_exports__.useGraphRouter;
|
|
36
41
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
37
42
|
"defaultEdgeRouter",
|
|
38
43
|
"defaultIsRoutable",
|
|
44
|
+
"resolveRouteAnchors",
|
|
45
|
+
"toRouteNode",
|
|
39
46
|
"useGraphRouter"
|
|
40
47
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
41
48
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export type { RouteAnchorPair, RouteNodeLookup } from './anchors';
|
|
2
|
+
export { resolveRouteAnchors, toRouteNode } from './anchors';
|
|
1
3
|
export { defaultEdgeRouter } from './defaultEdgeRouter';
|
|
2
4
|
export type { EdgeRouter, RouteAnchor, RoutedEdge, RouteEdgeRequest, RouteNodeRequest, RouteRequest, } from './types';
|
|
3
5
|
export { defaultIsRoutable, useGraphRouter } from './useGraphRouter';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/canvas/components/Edges/shared/routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/canvas/components/Edges/shared/routing/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { resolveRouteAnchors, toRouteNode } from "./anchors.js";
|
|
1
2
|
import { defaultEdgeRouter } from "./defaultEdgeRouter.js";
|
|
2
3
|
import { defaultIsRoutable, useGraphRouter } from "./useGraphRouter.js";
|
|
3
|
-
export { defaultEdgeRouter, defaultIsRoutable, useGraphRouter };
|
|
4
|
+
export { defaultEdgeRouter, defaultIsRoutable, resolveRouteAnchors, toRouteNode, useGraphRouter };
|
|
@@ -31,12 +31,14 @@ const react_cjs_namespaceObject = require("../../../../xyflow/react.cjs");
|
|
|
31
31
|
const external_react_namespaceObject = require("react");
|
|
32
32
|
const container_cjs_namespaceObject = require("../../../../utils/container.cjs");
|
|
33
33
|
const external_waypoints_cjs_namespaceObject = require("../waypoints.cjs");
|
|
34
|
+
const external_anchors_cjs_namespaceObject = require("./anchors.cjs");
|
|
34
35
|
function defaultIsRoutable(edge) {
|
|
35
36
|
const data = edge.data;
|
|
36
37
|
return data?.routing === 'waypoint' && !data.waypoints?.length;
|
|
37
38
|
}
|
|
38
39
|
function useGraphRouter(router, isRoutable = defaultIsRoutable) {
|
|
39
|
-
const {
|
|
40
|
+
const { getEdges, setEdges } = (0, react_cjs_namespaceObject.useReactFlow)();
|
|
41
|
+
const store = (0, react_cjs_namespaceObject.useStoreApi)();
|
|
40
42
|
const signature = (0, react_cjs_namespaceObject.useStore)((0, external_react_namespaceObject.useCallback)((state)=>routeSignature(state, isRoutable), [
|
|
41
43
|
isRoutable
|
|
42
44
|
]));
|
|
@@ -70,7 +72,8 @@ function useGraphRouter(router, isRoutable = defaultIsRoutable) {
|
|
|
70
72
|
if (hasStale) apply([]);
|
|
71
73
|
return;
|
|
72
74
|
}
|
|
73
|
-
const
|
|
75
|
+
const { nodeLookup, connectionMode } = store.getState();
|
|
76
|
+
const request = buildRequest(nodeLookup, edges, isRoutable, connectionMode);
|
|
74
77
|
if (0 === request.edges.length) return void apply([]);
|
|
75
78
|
const result = router.route(request);
|
|
76
79
|
if (result instanceof Promise) result.then(apply).catch((err)=>{
|
|
@@ -85,7 +88,7 @@ function useGraphRouter(router, isRoutable = defaultIsRoutable) {
|
|
|
85
88
|
signature,
|
|
86
89
|
router,
|
|
87
90
|
isRoutable,
|
|
88
|
-
|
|
91
|
+
store,
|
|
89
92
|
getEdges,
|
|
90
93
|
setEdges
|
|
91
94
|
]);
|
|
@@ -114,49 +117,25 @@ function reconcileEdge(edge, routesById, isRoutable) {
|
|
|
114
117
|
}
|
|
115
118
|
function routeSignature(state, isRoutable) {
|
|
116
119
|
let sig = '';
|
|
117
|
-
for (const node of state.
|
|
120
|
+
for (const node of state.nodeLookup.values()){
|
|
118
121
|
const { width, height } = (0, container_cjs_namespaceObject.getNodeDimensions)(node);
|
|
119
|
-
|
|
122
|
+
const { x, y } = node.internals.positionAbsolute;
|
|
123
|
+
const bounds = node.internals.handleBounds;
|
|
124
|
+
sig += `${node.id}:${x},${y},${width},${height},${bounds?.source?.length ?? -1},${bounds?.target?.length ?? -1}|`;
|
|
120
125
|
}
|
|
121
126
|
for (const edge of state.edges)sig += `${edge.id}:${edge.source}/${edge.sourceHandle ?? ''}>${edge.target}/${edge.targetHandle ?? ''}:${isRoutable(edge) ? 'r' : 'm'}|`;
|
|
122
127
|
return sig;
|
|
123
128
|
}
|
|
124
|
-
function buildRequest(
|
|
125
|
-
const routeNodes =
|
|
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
|
-
]));
|
|
129
|
+
function buildRequest(nodeLookup, edges, isRoutable, connectionMode) {
|
|
130
|
+
const routeNodes = Array.from(nodeLookup.values(), external_anchors_cjs_namespaceObject.toRouteNode);
|
|
139
131
|
const routeEdges = [];
|
|
140
132
|
for (const edge of edges){
|
|
141
133
|
if (!isRoutable(edge)) continue;
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
if (source && target) routeEdges.push({
|
|
134
|
+
const anchors = (0, external_anchors_cjs_namespaceObject.resolveRouteAnchors)(nodeLookup, edge, connectionMode);
|
|
135
|
+
if (anchors) routeEdges.push({
|
|
145
136
|
edgeId: edge.id,
|
|
146
|
-
source:
|
|
147
|
-
|
|
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
|
-
}
|
|
137
|
+
source: anchors.source,
|
|
138
|
+
target: anchors.target
|
|
160
139
|
});
|
|
161
140
|
}
|
|
162
141
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGraphRouter.d.ts","sourceRoot":"","sources":["../../../../../../src/canvas/components/Edges/shared/routing/useGraphRouter.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useGraphRouter.d.ts","sourceRoot":"","sources":["../../../../../../src/canvas/components/Edges/shared/routing/useGraphRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,IAAI,EAKV,MAAM,0CAA0C,CAAC;AAMlD,OAAO,KAAK,EAAE,UAAU,EAA8C,MAAM,SAAS,CAAC;AAoBtF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAGrD;AAiCD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,EAClB,UAAU,GAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAA2B,GACtD,IAAI,CAqEN"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useReactFlow, useStore, useStoreApi } from "../../../../xyflow/react.js";
|
|
2
2
|
import { useCallback, useEffect } from "react";
|
|
3
3
|
import { getNodeDimensions } from "../../../../utils/container.js";
|
|
4
4
|
import { waypointsPositionallyEqual } from "../waypoints.js";
|
|
5
|
+
import { resolveRouteAnchors, toRouteNode } from "./anchors.js";
|
|
5
6
|
function defaultIsRoutable(edge) {
|
|
6
7
|
const data = edge.data;
|
|
7
8
|
return data?.routing === 'waypoint' && !data.waypoints?.length;
|
|
8
9
|
}
|
|
9
10
|
function useGraphRouter(router, isRoutable = defaultIsRoutable) {
|
|
10
|
-
const {
|
|
11
|
+
const { getEdges, setEdges } = useReactFlow();
|
|
12
|
+
const store = useStoreApi();
|
|
11
13
|
const signature = useStore(useCallback((state)=>routeSignature(state, isRoutable), [
|
|
12
14
|
isRoutable
|
|
13
15
|
]));
|
|
@@ -41,7 +43,8 @@ function useGraphRouter(router, isRoutable = defaultIsRoutable) {
|
|
|
41
43
|
if (hasStale) apply([]);
|
|
42
44
|
return;
|
|
43
45
|
}
|
|
44
|
-
const
|
|
46
|
+
const { nodeLookup, connectionMode } = store.getState();
|
|
47
|
+
const request = buildRequest(nodeLookup, edges, isRoutable, connectionMode);
|
|
45
48
|
if (0 === request.edges.length) return void apply([]);
|
|
46
49
|
const result = router.route(request);
|
|
47
50
|
if (result instanceof Promise) result.then(apply).catch((err)=>{
|
|
@@ -56,7 +59,7 @@ function useGraphRouter(router, isRoutable = defaultIsRoutable) {
|
|
|
56
59
|
signature,
|
|
57
60
|
router,
|
|
58
61
|
isRoutable,
|
|
59
|
-
|
|
62
|
+
store,
|
|
60
63
|
getEdges,
|
|
61
64
|
setEdges
|
|
62
65
|
]);
|
|
@@ -85,49 +88,25 @@ function reconcileEdge(edge, routesById, isRoutable) {
|
|
|
85
88
|
}
|
|
86
89
|
function routeSignature(state, isRoutable) {
|
|
87
90
|
let sig = '';
|
|
88
|
-
for (const node of state.
|
|
91
|
+
for (const node of state.nodeLookup.values()){
|
|
89
92
|
const { width, height } = getNodeDimensions(node);
|
|
90
|
-
|
|
93
|
+
const { x, y } = node.internals.positionAbsolute;
|
|
94
|
+
const bounds = node.internals.handleBounds;
|
|
95
|
+
sig += `${node.id}:${x},${y},${width},${height},${bounds?.source?.length ?? -1},${bounds?.target?.length ?? -1}|`;
|
|
91
96
|
}
|
|
92
97
|
for (const edge of state.edges)sig += `${edge.id}:${edge.source}/${edge.sourceHandle ?? ''}>${edge.target}/${edge.targetHandle ?? ''}:${isRoutable(edge) ? 'r' : 'm'}|`;
|
|
93
98
|
return sig;
|
|
94
99
|
}
|
|
95
|
-
function buildRequest(
|
|
96
|
-
const routeNodes =
|
|
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
|
-
]));
|
|
100
|
+
function buildRequest(nodeLookup, edges, isRoutable, connectionMode) {
|
|
101
|
+
const routeNodes = Array.from(nodeLookup.values(), toRouteNode);
|
|
110
102
|
const routeEdges = [];
|
|
111
103
|
for (const edge of edges){
|
|
112
104
|
if (!isRoutable(edge)) continue;
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
if (source && target) routeEdges.push({
|
|
105
|
+
const anchors = resolveRouteAnchors(nodeLookup, edge, connectionMode);
|
|
106
|
+
if (anchors) routeEdges.push({
|
|
116
107
|
edgeId: edge.id,
|
|
117
|
-
source:
|
|
118
|
-
|
|
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
|
-
}
|
|
108
|
+
source: anchors.source,
|
|
109
|
+
target: anchors.target
|
|
131
110
|
});
|
|
132
111
|
}
|
|
133
112
|
return {
|
|
@@ -35,6 +35,7 @@ export type CanvasEdgeData = {
|
|
|
35
35
|
enableLineJumps?: boolean;
|
|
36
36
|
waypoints?: Waypoint[];
|
|
37
37
|
routedWaypoints?: Waypoint[];
|
|
38
|
+
autoRouted?: boolean;
|
|
38
39
|
onWaypointsChange?: (next: Waypoint[]) => void;
|
|
39
40
|
};
|
|
40
41
|
export type CanvasEdgeProps = EdgeProps<Edge<CanvasEdgeData>>;
|
|
@@ -1 +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;AAOF,MAAM,MAAM,QAAQ,GAAG;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;CACd,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;IAC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webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
edgeSchema: ()=>edgeSchema
|
|
27
|
+
edgeSchema: ()=>edgeSchema,
|
|
28
|
+
edgeUiSchema: ()=>edgeUiSchema,
|
|
29
|
+
waypointSchema: ()=>waypointSchema
|
|
28
30
|
});
|
|
29
31
|
const external_zod_namespaceObject = require("zod");
|
|
30
32
|
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
33
|
+
const waypointSchema = external_zod_namespaceObject.z.object({
|
|
34
|
+
id: external_zod_namespaceObject.z.string().min(1),
|
|
35
|
+
x: external_zod_namespaceObject.z.number(),
|
|
36
|
+
y: external_zod_namespaceObject.z.number()
|
|
37
|
+
});
|
|
38
|
+
const edgeUiSchema = external_zod_namespaceObject.z.object({
|
|
39
|
+
waypoints: external_zod_namespaceObject.z.array(waypointSchema).optional(),
|
|
40
|
+
routedWaypoints: external_zod_namespaceObject.z.array(waypointSchema).optional(),
|
|
41
|
+
autoRouted: external_zod_namespaceObject.z.boolean().optional()
|
|
42
|
+
}).catchall(external_zod_namespaceObject.z.unknown());
|
|
31
43
|
const edgeSchema = external_zod_namespaceObject.z.object({
|
|
32
44
|
id: external_base_cjs_namespaceObject.idSchema,
|
|
33
45
|
sourceNodeId: external_base_cjs_namespaceObject.idSchema,
|
|
34
46
|
sourcePort: external_zod_namespaceObject.z.string().min(1),
|
|
35
47
|
targetNodeId: external_base_cjs_namespaceObject.idSchema,
|
|
36
48
|
targetPort: external_zod_namespaceObject.z.string().min(1),
|
|
49
|
+
ui: edgeUiSchema.nullish().transform((value)=>value ?? void 0).optional(),
|
|
37
50
|
data: external_zod_namespaceObject.z.object({
|
|
38
51
|
label: external_zod_namespaceObject.z.string().optional()
|
|
39
52
|
}).passthrough().optional()
|
|
40
53
|
});
|
|
41
54
|
exports.edgeSchema = __webpack_exports__.edgeSchema;
|
|
55
|
+
exports.edgeUiSchema = __webpack_exports__.edgeUiSchema;
|
|
56
|
+
exports.waypointSchema = __webpack_exports__.waypointSchema;
|
|
42
57
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
43
|
-
"edgeSchema"
|
|
58
|
+
"edgeSchema",
|
|
59
|
+
"edgeUiSchema",
|
|
60
|
+
"waypointSchema"
|
|
44
61
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
45
62
|
Object.defineProperty(exports, '__esModule', {
|
|
46
63
|
value: true
|
|
@@ -1,13 +1,72 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const waypointSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
x: z.ZodNumber;
|
|
5
|
+
y: z.ZodNumber;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const edgeUiSchema: z.ZodObject<{
|
|
8
|
+
waypoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
x: z.ZodNumber;
|
|
11
|
+
y: z.ZodNumber;
|
|
12
|
+
}, z.core.$strip>>>;
|
|
13
|
+
routedWaypoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
x: z.ZodNumber;
|
|
16
|
+
y: z.ZodNumber;
|
|
17
|
+
}, z.core.$strip>>>;
|
|
18
|
+
autoRouted: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
2
20
|
export declare const edgeSchema: z.ZodObject<{
|
|
3
21
|
id: z.ZodString;
|
|
4
22
|
sourceNodeId: z.ZodString;
|
|
5
23
|
sourcePort: z.ZodString;
|
|
6
24
|
targetNodeId: z.ZodString;
|
|
7
25
|
targetPort: z.ZodString;
|
|
26
|
+
ui: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
27
|
+
waypoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
x: z.ZodNumber;
|
|
30
|
+
y: z.ZodNumber;
|
|
31
|
+
}, z.core.$strip>>>;
|
|
32
|
+
routedWaypoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
x: z.ZodNumber;
|
|
35
|
+
y: z.ZodNumber;
|
|
36
|
+
}, z.core.$strip>>>;
|
|
37
|
+
autoRouted: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
}, z.core.$catchall<z.ZodUnknown>>>>, z.ZodTransform<{
|
|
39
|
+
[x: string]: unknown;
|
|
40
|
+
waypoints?: {
|
|
41
|
+
id: string;
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
}[] | undefined;
|
|
45
|
+
routedWaypoints?: {
|
|
46
|
+
id: string;
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
}[] | undefined;
|
|
50
|
+
autoRouted?: boolean | undefined;
|
|
51
|
+
} | undefined, {
|
|
52
|
+
[x: string]: unknown;
|
|
53
|
+
waypoints?: {
|
|
54
|
+
id: string;
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
}[] | undefined;
|
|
58
|
+
routedWaypoints?: {
|
|
59
|
+
id: string;
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
}[] | undefined;
|
|
63
|
+
autoRouted?: boolean | undefined;
|
|
64
|
+
} | null | undefined>>>;
|
|
8
65
|
data: z.ZodOptional<z.ZodObject<{
|
|
9
66
|
label: z.ZodOptional<z.ZodString>;
|
|
10
67
|
}, z.core.$loose>>;
|
|
11
68
|
}, z.core.$strip>;
|
|
69
|
+
export type WaypointInstance = z.infer<typeof waypointSchema>;
|
|
70
|
+
export type EdgeInstanceUiConfig = z.infer<typeof edgeUiSchema>;
|
|
12
71
|
export type EdgeInstance = z.infer<typeof edgeSchema>;
|
|
13
72
|
//# sourceMappingURL=edge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge.d.ts","sourceRoot":"","sources":["../../../../src/canvas/schema/node-instance/edge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"edge.d.ts","sourceRoot":"","sources":["../../../../src/canvas/schema/node-instance/edge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,cAAc;;;;iBAIzB,CAAC;AAkBH,eAAO,MAAM,YAAY;;;;;;;;;;;;kCAaD,CAAC;AAKzB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2BrB,CAAC;AAGH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAEhE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { idSchema } from "./base.js";
|
|
3
|
+
const waypointSchema = z.object({
|
|
4
|
+
id: z.string().min(1),
|
|
5
|
+
x: z.number(),
|
|
6
|
+
y: z.number()
|
|
7
|
+
});
|
|
8
|
+
const edgeUiSchema = z.object({
|
|
9
|
+
waypoints: z.array(waypointSchema).optional(),
|
|
10
|
+
routedWaypoints: z.array(waypointSchema).optional(),
|
|
11
|
+
autoRouted: z.boolean().optional()
|
|
12
|
+
}).catchall(z.unknown());
|
|
3
13
|
const edgeSchema = z.object({
|
|
4
14
|
id: idSchema,
|
|
5
15
|
sourceNodeId: idSchema,
|
|
6
16
|
sourcePort: z.string().min(1),
|
|
7
17
|
targetNodeId: idSchema,
|
|
8
18
|
targetPort: z.string().min(1),
|
|
19
|
+
ui: edgeUiSchema.nullish().transform((value)=>value ?? void 0).optional(),
|
|
9
20
|
data: z.object({
|
|
10
21
|
label: z.string().optional()
|
|
11
22
|
}).passthrough().optional()
|
|
12
23
|
});
|
|
13
|
-
export { edgeSchema };
|
|
24
|
+
export { edgeSchema, edgeUiSchema, waypointSchema };
|
|
@@ -24,32 +24,38 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
|
|
27
|
+
versionSchema: ()=>external_base_cjs_namespaceObject.versionSchema,
|
|
28
28
|
displayConfigSchema: ()=>external_base_cjs_namespaceObject.displayConfigSchema,
|
|
29
29
|
edgeSchema: ()=>external_edge_cjs_namespaceObject.edgeSchema,
|
|
30
|
-
|
|
31
|
-
nodeSchema: ()=>external_node_cjs_namespaceObject.nodeSchema,
|
|
30
|
+
edgeUiSchema: ()=>external_edge_cjs_namespaceObject.edgeUiSchema,
|
|
32
31
|
uiSchema: ()=>external_node_cjs_namespaceObject.uiSchema,
|
|
33
|
-
|
|
32
|
+
waypointSchema: ()=>external_edge_cjs_namespaceObject.waypointSchema,
|
|
33
|
+
typeVersionKeySchema: ()=>external_base_cjs_namespaceObject.typeVersionKeySchema,
|
|
34
|
+
nodeSchema: ()=>external_node_cjs_namespaceObject.nodeSchema,
|
|
35
|
+
idSchema: ()=>external_base_cjs_namespaceObject.idSchema
|
|
34
36
|
});
|
|
35
37
|
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
36
38
|
const external_edge_cjs_namespaceObject = require("./edge.cjs");
|
|
37
39
|
const external_node_cjs_namespaceObject = require("./node.cjs");
|
|
38
40
|
exports.displayConfigSchema = __webpack_exports__.displayConfigSchema;
|
|
39
41
|
exports.edgeSchema = __webpack_exports__.edgeSchema;
|
|
42
|
+
exports.edgeUiSchema = __webpack_exports__.edgeUiSchema;
|
|
40
43
|
exports.idSchema = __webpack_exports__.idSchema;
|
|
41
44
|
exports.nodeSchema = __webpack_exports__.nodeSchema;
|
|
42
45
|
exports.typeVersionKeySchema = __webpack_exports__.typeVersionKeySchema;
|
|
43
46
|
exports.uiSchema = __webpack_exports__.uiSchema;
|
|
44
47
|
exports.versionSchema = __webpack_exports__.versionSchema;
|
|
48
|
+
exports.waypointSchema = __webpack_exports__.waypointSchema;
|
|
45
49
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
46
50
|
"displayConfigSchema",
|
|
47
51
|
"edgeSchema",
|
|
52
|
+
"edgeUiSchema",
|
|
48
53
|
"idSchema",
|
|
49
54
|
"nodeSchema",
|
|
50
55
|
"typeVersionKeySchema",
|
|
51
56
|
"uiSchema",
|
|
52
|
-
"versionSchema"
|
|
57
|
+
"versionSchema",
|
|
58
|
+
"waypointSchema"
|
|
53
59
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
54
60
|
Object.defineProperty(exports, '__esModule', {
|
|
55
61
|
value: true
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { InstanceDisplayConfig, InstanceId, InstanceTypeVersionKey, InstanceVersion, } from './base';
|
|
2
2
|
export { displayConfigSchema, idSchema, typeVersionKeySchema, versionSchema } from './base';
|
|
3
|
-
export type { EdgeInstance } from './edge';
|
|
4
|
-
export { edgeSchema } from './edge';
|
|
3
|
+
export type { EdgeInstance, EdgeInstanceUiConfig, WaypointInstance } from './edge';
|
|
4
|
+
export { edgeSchema, edgeUiSchema, waypointSchema } from './edge';
|
|
5
5
|
export type { InstanceUiConfig, NodeInstance } from './node';
|
|
6
6
|
export { nodeSchema, uiSchema } from './node';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/schema/node-instance/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,qBAAqB,EACrB,UAAU,EACV,sBAAsB,EACtB,eAAe,GAChB,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5F,YAAY,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/schema/node-instance/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,qBAAqB,EACrB,UAAU,EACV,sBAAsB,EACtB,eAAe,GAChB,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5F,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAClE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { displayConfigSchema, idSchema, typeVersionKeySchema, versionSchema } from "./base.js";
|
|
2
|
-
import { edgeSchema } from "./edge.js";
|
|
2
|
+
import { edgeSchema, edgeUiSchema, waypointSchema } from "./edge.js";
|
|
3
3
|
import { nodeSchema, uiSchema } from "./node.js";
|
|
4
|
-
export { displayConfigSchema, edgeSchema, idSchema, nodeSchema, typeVersionKeySchema, uiSchema, versionSchema };
|
|
4
|
+
export { displayConfigSchema, edgeSchema, edgeUiSchema, idSchema, nodeSchema, typeVersionKeySchema, uiSchema, versionSchema, waypointSchema };
|