@likec4/diagram 1.2.0 → 1.2.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/LikeC4Diagram.props.d.ts +4 -4
- package/dist/hooks/useUpdateEffect.d.ts +1 -1
- package/dist/icons/Clipboard.d.ts +1 -1
- package/dist/icons/Link.d.ts +1 -1
- package/dist/icons/ZoomIn.d.ts +1 -1
- package/dist/index.mjs +100 -189
- package/dist/state/DiagramContext.d.ts +830 -830
- package/dist/state/diagramStore.d.ts +736 -736
- package/dist/state/useDiagramStore.d.ts +648 -648
- package/dist/xyflow/XYFlow.d.ts +1 -1
- package/dist/xyflow/XYFlowBackground.d.ts +1 -1
- package/dist/xyflow/XYFlowEvents.d.ts +4 -4
- package/dist/xyflow/XYFlowInner.d.ts +1 -1
- package/dist/xyflow/diagram-to-xyflow.d.ts +1 -1
- package/dist/xyflow/edges/RelationshipEdge.d.ts +6 -6
- package/dist/xyflow/edges/utils.d.ts +2 -2
- package/dist/xyflow/hooks/useLayoutConstraints.d.ts +1 -1
- package/dist/xyflow/hooks/useXYFlow.d.ts +72 -72
- package/dist/xyflow/nodes/compound/CompoundNode.d.ts +1 -1
- package/dist/xyflow/nodes/element/ElementNode.d.ts +1 -1
- package/dist/xyflow/types.d.ts +10 -10
- package/package.json +7 -8
- package/src/xyflow/XYFlowEvents.tsx +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) =>
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
|
|
4
4
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
5
5
|
import { createContext, memo, useState, forwardRef, useCallback, useMemo, useEffect, useRef, useContext, useLayoutEffect, useId } from "react";
|
|
6
6
|
import { createWithEqualityFn, useStoreWithEqualityFn } from "zustand/traditional";
|
|
@@ -18,8 +18,7 @@ import { motion, AnimatePresence } from "framer-motion";
|
|
|
18
18
|
import { useLocalStorage } from "@mantine/hooks";
|
|
19
19
|
import { IconPlayerPlayFilled, IconPlayerSkipBackFilled, IconPlayerStopFilled, IconPlayerSkipForwardFilled } from "@tabler/icons-react";
|
|
20
20
|
function cc(names) {
|
|
21
|
-
if (typeof names == "string" || typeof names == "number")
|
|
22
|
-
return "" + names;
|
|
21
|
+
if (typeof names == "string" || typeof names == "number") return "" + names;
|
|
23
22
|
let out = "";
|
|
24
23
|
if (Array.isArray(names))
|
|
25
24
|
for (let i = 0, tmp; i < names.length; i++)
|
|
@@ -33,8 +32,7 @@ var noop$1 = { value: () => {
|
|
|
33
32
|
} };
|
|
34
33
|
function dispatch() {
|
|
35
34
|
for (var i = 0, n = arguments.length, _ = {}, t2; i < n; ++i) {
|
|
36
|
-
if (!(t2 = arguments[i] + "") || t2 in _ || /[\s.]/.test(t2))
|
|
37
|
-
throw new Error("illegal type: " + t2);
|
|
35
|
+
if (!(t2 = arguments[i] + "") || t2 in _ || /[\s.]/.test(t2)) throw new Error("illegal type: " + t2);
|
|
38
36
|
_[t2] = [];
|
|
39
37
|
}
|
|
40
38
|
return new Dispatch(_);
|
|
@@ -45,8 +43,7 @@ function Dispatch(_) {
|
|
|
45
43
|
function parseTypenames$1(typenames, types) {
|
|
46
44
|
return typenames.trim().split(/^|\s+/).map(function(t2) {
|
|
47
45
|
var name = "", i = t2.indexOf(".");
|
|
48
|
-
if (i >= 0 && (name = t2.slice(i + 1), t2 = t2.slice(0, i)), t2 && !types.hasOwnProperty(t2))
|
|
49
|
-
throw new Error("unknown type: " + t2);
|
|
46
|
+
if (i >= 0 && (name = t2.slice(i + 1), t2 = t2.slice(0, i)), t2 && !types.hasOwnProperty(t2)) throw new Error("unknown type: " + t2);
|
|
50
47
|
return { type: t2, name };
|
|
51
48
|
});
|
|
52
49
|
}
|
|
@@ -55,41 +52,28 @@ Dispatch.prototype = dispatch.prototype = {
|
|
|
55
52
|
on: function(typename, callback) {
|
|
56
53
|
var _ = this._, T = parseTypenames$1(typename + "", _), t2, i = -1, n = T.length;
|
|
57
54
|
if (arguments.length < 2) {
|
|
58
|
-
for (; ++i < n; )
|
|
59
|
-
if ((t2 = (typename = T[i]).type) && (t2 = get$2(_[t2], typename.name)))
|
|
60
|
-
return t2;
|
|
55
|
+
for (; ++i < n; ) if ((t2 = (typename = T[i]).type) && (t2 = get$2(_[t2], typename.name))) return t2;
|
|
61
56
|
return;
|
|
62
57
|
}
|
|
63
|
-
if (callback != null && typeof callback != "function")
|
|
64
|
-
throw new Error("invalid callback: " + callback);
|
|
58
|
+
if (callback != null && typeof callback != "function") throw new Error("invalid callback: " + callback);
|
|
65
59
|
for (; ++i < n; )
|
|
66
|
-
if (t2 = (typename = T[i]).type)
|
|
67
|
-
|
|
68
|
-
else if (callback == null)
|
|
69
|
-
for (t2 in _)
|
|
70
|
-
_[t2] = set$1(_[t2], typename.name, null);
|
|
60
|
+
if (t2 = (typename = T[i]).type) _[t2] = set$1(_[t2], typename.name, callback);
|
|
61
|
+
else if (callback == null) for (t2 in _) _[t2] = set$1(_[t2], typename.name, null);
|
|
71
62
|
return this;
|
|
72
63
|
},
|
|
73
64
|
copy: function() {
|
|
74
65
|
var copy = {}, _ = this._;
|
|
75
|
-
for (var t2 in _)
|
|
76
|
-
copy[t2] = _[t2].slice();
|
|
66
|
+
for (var t2 in _) copy[t2] = _[t2].slice();
|
|
77
67
|
return new Dispatch(copy);
|
|
78
68
|
},
|
|
79
69
|
call: function(type, that) {
|
|
80
|
-
if ((n = arguments.length - 2) > 0)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (!this._.hasOwnProperty(type))
|
|
84
|
-
throw new Error("unknown type: " + type);
|
|
85
|
-
for (t2 = this._[type], i = 0, n = t2.length; i < n; ++i)
|
|
86
|
-
t2[i].value.apply(that, args);
|
|
70
|
+
if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t2; i < n; ++i) args[i] = arguments[i + 2];
|
|
71
|
+
if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
|
|
72
|
+
for (t2 = this._[type], i = 0, n = t2.length; i < n; ++i) t2[i].value.apply(that, args);
|
|
87
73
|
},
|
|
88
74
|
apply: function(type, that, args) {
|
|
89
|
-
if (!this._.hasOwnProperty(type))
|
|
90
|
-
|
|
91
|
-
for (var t2 = this._[type], i = 0, n = t2.length; i < n; ++i)
|
|
92
|
-
t2[i].value.apply(that, args);
|
|
75
|
+
if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
|
|
76
|
+
for (var t2 = this._[type], i = 0, n = t2.length; i < n; ++i) t2[i].value.apply(that, args);
|
|
93
77
|
}
|
|
94
78
|
};
|
|
95
79
|
function get$2(type, name) {
|
|
@@ -258,8 +242,7 @@ function datum(node) {
|
|
|
258
242
|
return node.__data__;
|
|
259
243
|
}
|
|
260
244
|
function selection_data(value, key) {
|
|
261
|
-
if (!arguments.length)
|
|
262
|
-
return Array.from(this, datum);
|
|
245
|
+
if (!arguments.length) return Array.from(this, datum);
|
|
263
246
|
var bind = key ? bindKey : bindIndex, parents = this._parents, groups = this._groups;
|
|
264
247
|
typeof value != "function" && (value = constant$3(value));
|
|
265
248
|
for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {
|
|
@@ -267,8 +250,7 @@ function selection_data(value, key) {
|
|
|
267
250
|
bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
|
|
268
251
|
for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0)
|
|
269
252
|
if (previous = enterGroup[i0]) {
|
|
270
|
-
for (i0 >= i1 && (i1 = i0 + 1); !(next = updateGroup[i1]) && ++i1 < dataLength; )
|
|
271
|
-
;
|
|
253
|
+
for (i0 >= i1 && (i1 = i0 + 1); !(next = updateGroup[i1]) && ++i1 < dataLength; ) ;
|
|
272
254
|
previous._next = next || null;
|
|
273
255
|
}
|
|
274
256
|
}
|
|
@@ -324,15 +306,13 @@ function selection_node() {
|
|
|
324
306
|
for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j)
|
|
325
307
|
for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {
|
|
326
308
|
var node = group[i];
|
|
327
|
-
if (node)
|
|
328
|
-
return node;
|
|
309
|
+
if (node) return node;
|
|
329
310
|
}
|
|
330
311
|
return null;
|
|
331
312
|
}
|
|
332
313
|
function selection_size() {
|
|
333
314
|
let size = 0;
|
|
334
|
-
for (const node of this)
|
|
335
|
-
++size;
|
|
315
|
+
for (const node of this) ++size;
|
|
336
316
|
return size;
|
|
337
317
|
}
|
|
338
318
|
function selection_empty() {
|
|
@@ -451,12 +431,10 @@ ClassList.prototype = {
|
|
|
451
431
|
}
|
|
452
432
|
};
|
|
453
433
|
function classedAdd(node, names) {
|
|
454
|
-
for (var list = classList(node), i = -1, n = names.length; ++i < n; )
|
|
455
|
-
list.add(names[i]);
|
|
434
|
+
for (var list = classList(node), i = -1, n = names.length; ++i < n; ) list.add(names[i]);
|
|
456
435
|
}
|
|
457
436
|
function classedRemove(node, names) {
|
|
458
|
-
for (var list = classList(node), i = -1, n = names.length; ++i < n; )
|
|
459
|
-
list.remove(names[i]);
|
|
437
|
+
for (var list = classList(node), i = -1, n = names.length; ++i < n; ) list.remove(names[i]);
|
|
460
438
|
}
|
|
461
439
|
function classedTrue(names) {
|
|
462
440
|
return function() {
|
|
@@ -476,9 +454,7 @@ function classedFunction(names, value) {
|
|
|
476
454
|
function selection_classed(name, value) {
|
|
477
455
|
var names = classArray(name + "");
|
|
478
456
|
if (arguments.length < 2) {
|
|
479
|
-
for (var list = classList(this.node()), i = -1, n = names.length; ++i < n; )
|
|
480
|
-
if (!list.contains(names[i]))
|
|
481
|
-
return !1;
|
|
457
|
+
for (var list = classList(this.node()), i = -1, n = names.length; ++i < n; ) if (!list.contains(names[i])) return !1;
|
|
482
458
|
return !0;
|
|
483
459
|
}
|
|
484
460
|
return this.each((typeof value == "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value));
|
|
@@ -611,8 +587,7 @@ function selection_on(typename, value, options) {
|
|
|
611
587
|
}
|
|
612
588
|
return;
|
|
613
589
|
}
|
|
614
|
-
for (on = value ? onAdd : onRemove, i = 0; i < n; ++i)
|
|
615
|
-
this.each(on(typenames[i], value, options));
|
|
590
|
+
for (on = value ? onAdd : onRemove, i = 0; i < n; ++i) this.each(on(typenames[i], value, options));
|
|
616
591
|
return this;
|
|
617
592
|
}
|
|
618
593
|
function dispatchEvent(node, type, params) {
|
|
@@ -690,8 +665,7 @@ function select(selector2) {
|
|
|
690
665
|
}
|
|
691
666
|
function sourceEvent(event) {
|
|
692
667
|
let sourceEvent2;
|
|
693
|
-
for (; sourceEvent2 = event.sourceEvent; )
|
|
694
|
-
event = sourceEvent2;
|
|
668
|
+
for (; sourceEvent2 = event.sourceEvent; ) event = sourceEvent2;
|
|
695
669
|
return event;
|
|
696
670
|
}
|
|
697
671
|
function pointer(event, node) {
|
|
@@ -872,8 +846,7 @@ function define(constructor, factory, prototype) {
|
|
|
872
846
|
}
|
|
873
847
|
function extend(parent, definition) {
|
|
874
848
|
var prototype = Object.create(parent.prototype);
|
|
875
|
-
for (var key in definition)
|
|
876
|
-
prototype[key] = definition[key];
|
|
849
|
+
for (var key in definition) prototype[key] = definition[key];
|
|
877
850
|
return prototype;
|
|
878
851
|
}
|
|
879
852
|
function Color() {
|
|
@@ -1120,12 +1093,9 @@ function hsla(h, s, l, a) {
|
|
|
1120
1093
|
return a <= 0 ? h = s = l = NaN : l <= 0 || l >= 1 ? h = s = NaN : s <= 0 && (h = NaN), new Hsl(h, s, l, a);
|
|
1121
1094
|
}
|
|
1122
1095
|
function hslConvert(o) {
|
|
1123
|
-
if (o instanceof Hsl)
|
|
1124
|
-
|
|
1125
|
-
if (o instanceof
|
|
1126
|
-
return new Hsl();
|
|
1127
|
-
if (o instanceof Hsl)
|
|
1128
|
-
return o;
|
|
1096
|
+
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
|
|
1097
|
+
if (o instanceof Color || (o = color(o)), !o) return new Hsl();
|
|
1098
|
+
if (o instanceof Hsl) return o;
|
|
1129
1099
|
o = o.rgb();
|
|
1130
1100
|
var r2 = o.r / 255, g = o.g / 255, b = o.b / 255, min2 = Math.min(r2, g, b), max2 = Math.max(r2, g, b), h = NaN, s = max2 - min2, l = (max2 + min2) / 2;
|
|
1131
1101
|
return s ? (r2 === max2 ? h = (g - b) / s + (g < b) * 6 : g === max2 ? h = (b - r2) / s + 2 : h = (r2 - g) / s + 4, s /= l < 0.5 ? max2 + min2 : 2 - max2 - min2, h *= 60) : s = l > 0 && l < 1 ? 0 : h, new Hsl(h, s, l, o.opacity);
|
|
@@ -1223,8 +1193,7 @@ function interpolateString(a, b) {
|
|
|
1223
1193
|
for (a = a + "", b = b + ""; (am = reA.exec(a)) && (bm = reB.exec(b)); )
|
|
1224
1194
|
(bs = bm.index) > bi && (bs = b.slice(bi, bs), s[i] ? s[i] += bs : s[++i] = bs), (am = am[0]) === (bm = bm[0]) ? s[i] ? s[i] += bm : s[++i] = bm : (s[++i] = null, q.push({ i, x: interpolateNumber(am, bm) })), bi = reB.lastIndex;
|
|
1225
1195
|
return bi < b.length && (bs = b.slice(bi), s[i] ? s[i] += bs : s[++i] = bs), s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t2) {
|
|
1226
|
-
for (var i2 = 0, o; i2 < b; ++i2)
|
|
1227
|
-
s[(o = q[i2]).i] = o.x(t2);
|
|
1196
|
+
for (var i2 = 0, o; i2 < b; ++i2) s[(o = q[i2]).i] = o.x(t2);
|
|
1228
1197
|
return s.join("");
|
|
1229
1198
|
});
|
|
1230
1199
|
}
|
|
@@ -1263,8 +1232,7 @@ function interpolateTransform(parse, pxComma, pxParen, degParen) {
|
|
|
1263
1232
|
if (xa !== xb || ya !== yb) {
|
|
1264
1233
|
var i = s.push("translate(", null, pxComma, null, pxParen);
|
|
1265
1234
|
q.push({ i: i - 4, x: interpolateNumber(xa, xb) }, { i: i - 2, x: interpolateNumber(ya, yb) });
|
|
1266
|
-
} else
|
|
1267
|
-
(xb || yb) && s.push("translate(" + xb + pxComma + yb + pxParen);
|
|
1235
|
+
} else (xb || yb) && s.push("translate(" + xb + pxComma + yb + pxParen);
|
|
1268
1236
|
}
|
|
1269
1237
|
function rotate(a, b, s, q) {
|
|
1270
1238
|
a !== b ? (a - b > 180 ? b += 360 : b - a > 180 && (a += 360), q.push({ i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b) })) : b && s.push(pop(s) + "rotate(" + b + degParen);
|
|
@@ -1276,14 +1244,12 @@ function interpolateTransform(parse, pxComma, pxParen, degParen) {
|
|
|
1276
1244
|
if (xa !== xb || ya !== yb) {
|
|
1277
1245
|
var i = s.push(pop(s) + "scale(", null, ",", null, ")");
|
|
1278
1246
|
q.push({ i: i - 4, x: interpolateNumber(xa, xb) }, { i: i - 2, x: interpolateNumber(ya, yb) });
|
|
1279
|
-
} else
|
|
1280
|
-
(xb !== 1 || yb !== 1) && s.push(pop(s) + "scale(" + xb + "," + yb + ")");
|
|
1247
|
+
} else (xb !== 1 || yb !== 1) && s.push(pop(s) + "scale(" + xb + "," + yb + ")");
|
|
1281
1248
|
}
|
|
1282
1249
|
return function(a, b) {
|
|
1283
1250
|
var s = [], q = [];
|
|
1284
1251
|
return a = parse(a), b = parse(b), translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q), rotate(a.rotate, b.rotate, s, q), skewX(a.skewX, b.skewX, s, q), scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q), a = b = null, function(t2) {
|
|
1285
|
-
for (var i = -1, n = q.length, o; ++i < n; )
|
|
1286
|
-
s[(o = q[i]).i] = o.x(t2);
|
|
1252
|
+
for (var i = -1, n = q.length, o; ++i < n; ) s[(o = q[i]).i] = o.x(t2);
|
|
1287
1253
|
return s.join("");
|
|
1288
1254
|
};
|
|
1289
1255
|
};
|
|
@@ -1342,8 +1308,7 @@ function Timer() {
|
|
|
1342
1308
|
Timer.prototype = timer.prototype = {
|
|
1343
1309
|
constructor: Timer,
|
|
1344
1310
|
restart: function(callback, delay, time) {
|
|
1345
|
-
if (typeof callback != "function")
|
|
1346
|
-
throw new TypeError("callback is not a function");
|
|
1311
|
+
if (typeof callback != "function") throw new TypeError("callback is not a function");
|
|
1347
1312
|
time = (time == null ? now() : +time) + (delay == null ? 0 : +delay), !this._next && taskTail !== this && (taskTail ? taskTail._next = this : taskHead = this, taskTail = this), this._call = callback, this._time = time, sleep();
|
|
1348
1313
|
},
|
|
1349
1314
|
stop: function() {
|
|
@@ -1393,10 +1358,8 @@ function timeout(callback, delay, time) {
|
|
|
1393
1358
|
var emptyOn = dispatch("start", "end", "cancel", "interrupt"), emptyTween = [], CREATED = 0, SCHEDULED = 1, STARTING = 2, STARTED = 3, RUNNING = 4, ENDING = 5, ENDED = 6;
|
|
1394
1359
|
function schedule(node, name, id2, index2, group, timing) {
|
|
1395
1360
|
var schedules = node.__transition;
|
|
1396
|
-
if (!schedules)
|
|
1397
|
-
|
|
1398
|
-
else if (id2 in schedules)
|
|
1399
|
-
return;
|
|
1361
|
+
if (!schedules) node.__transition = {};
|
|
1362
|
+
else if (id2 in schedules) return;
|
|
1400
1363
|
create(node, id2, {
|
|
1401
1364
|
name,
|
|
1402
1365
|
index: index2,
|
|
@@ -1415,20 +1378,17 @@ function schedule(node, name, id2, index2, group, timing) {
|
|
|
1415
1378
|
}
|
|
1416
1379
|
function init(node, id2) {
|
|
1417
1380
|
var schedule2 = get$1(node, id2);
|
|
1418
|
-
if (schedule2.state > CREATED)
|
|
1419
|
-
throw new Error("too late; already scheduled");
|
|
1381
|
+
if (schedule2.state > CREATED) throw new Error("too late; already scheduled");
|
|
1420
1382
|
return schedule2;
|
|
1421
1383
|
}
|
|
1422
1384
|
function set(node, id2) {
|
|
1423
1385
|
var schedule2 = get$1(node, id2);
|
|
1424
|
-
if (schedule2.state > STARTED)
|
|
1425
|
-
throw new Error("too late; already running");
|
|
1386
|
+
if (schedule2.state > STARTED) throw new Error("too late; already running");
|
|
1426
1387
|
return schedule2;
|
|
1427
1388
|
}
|
|
1428
1389
|
function get$1(node, id2) {
|
|
1429
1390
|
var schedule2 = node.__transition;
|
|
1430
|
-
if (!schedule2 || !(schedule2 = schedule2[id2]))
|
|
1431
|
-
throw new Error("transition not found");
|
|
1391
|
+
if (!schedule2 || !(schedule2 = schedule2[id2])) throw new Error("transition not found");
|
|
1432
1392
|
return schedule2;
|
|
1433
1393
|
}
|
|
1434
1394
|
function create(node, id2, self) {
|
|
@@ -1439,12 +1399,10 @@ function create(node, id2, self) {
|
|
|
1439
1399
|
}
|
|
1440
1400
|
function start2(elapsed) {
|
|
1441
1401
|
var i, j, n, o;
|
|
1442
|
-
if (self.state !== SCHEDULED)
|
|
1443
|
-
return stop();
|
|
1402
|
+
if (self.state !== SCHEDULED) return stop();
|
|
1444
1403
|
for (i in schedules)
|
|
1445
1404
|
if (o = schedules[i], o.name === self.name) {
|
|
1446
|
-
if (o.state === STARTED)
|
|
1447
|
-
return timeout(start2);
|
|
1405
|
+
if (o.state === STARTED) return timeout(start2);
|
|
1448
1406
|
o.state === RUNNING ? (o.state = ENDED, o.timer.stop(), o.on.call("interrupt", node, node.__data__, o.index, o.group), delete schedules[i]) : +i < id2 && (o.state = ENDED, o.timer.stop(), o.on.call("cancel", node, node.__data__, o.index, o.group), delete schedules[i]);
|
|
1449
1407
|
}
|
|
1450
1408
|
if (timeout(function() {
|
|
@@ -1462,8 +1420,7 @@ function create(node, id2, self) {
|
|
|
1462
1420
|
}
|
|
1463
1421
|
function stop() {
|
|
1464
1422
|
self.state = ENDED, self.timer.stop(), delete schedules[id2];
|
|
1465
|
-
for (var i in schedules)
|
|
1466
|
-
return;
|
|
1423
|
+
for (var i in schedules) return;
|
|
1467
1424
|
delete node.__transition;
|
|
1468
1425
|
}
|
|
1469
1426
|
}
|
|
@@ -1503,8 +1460,7 @@ function tweenRemove(id2, name) {
|
|
|
1503
1460
|
}
|
|
1504
1461
|
function tweenFunction(id2, name, value) {
|
|
1505
1462
|
var tween0, tween1;
|
|
1506
|
-
if (typeof value != "function")
|
|
1507
|
-
throw new Error();
|
|
1463
|
+
if (typeof value != "function") throw new Error();
|
|
1508
1464
|
return function() {
|
|
1509
1465
|
var schedule2 = set(this, id2), tween = schedule2.tween;
|
|
1510
1466
|
if (tween !== tween0) {
|
|
@@ -1612,12 +1568,9 @@ function attrTween(name, value) {
|
|
|
1612
1568
|
}
|
|
1613
1569
|
function transition_attrTween(name, value) {
|
|
1614
1570
|
var key = "attr." + name;
|
|
1615
|
-
if (arguments.length < 2)
|
|
1616
|
-
|
|
1617
|
-
if (value
|
|
1618
|
-
return this.tween(key, null);
|
|
1619
|
-
if (typeof value != "function")
|
|
1620
|
-
throw new Error();
|
|
1571
|
+
if (arguments.length < 2) return (key = this.tween(key)) && key._value;
|
|
1572
|
+
if (value == null) return this.tween(key, null);
|
|
1573
|
+
if (typeof value != "function") throw new Error();
|
|
1621
1574
|
var fullname = namespace(name);
|
|
1622
1575
|
return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
|
|
1623
1576
|
}
|
|
@@ -1650,8 +1603,7 @@ function transition_duration(value) {
|
|
|
1650
1603
|
return arguments.length ? this.each((typeof value == "function" ? durationFunction : durationConstant)(id2, value)) : get$1(this.node(), id2).duration;
|
|
1651
1604
|
}
|
|
1652
1605
|
function easeConstant(id2, value) {
|
|
1653
|
-
if (typeof value != "function")
|
|
1654
|
-
throw new Error();
|
|
1606
|
+
if (typeof value != "function") throw new Error();
|
|
1655
1607
|
return function() {
|
|
1656
1608
|
set(this, id2).ease = value;
|
|
1657
1609
|
};
|
|
@@ -1663,14 +1615,12 @@ function transition_ease(value) {
|
|
|
1663
1615
|
function easeVarying(id2, value) {
|
|
1664
1616
|
return function() {
|
|
1665
1617
|
var v = value.apply(this, arguments);
|
|
1666
|
-
if (typeof v != "function")
|
|
1667
|
-
throw new Error();
|
|
1618
|
+
if (typeof v != "function") throw new Error();
|
|
1668
1619
|
set(this, id2).ease = v;
|
|
1669
1620
|
};
|
|
1670
1621
|
}
|
|
1671
1622
|
function transition_easeVarying(value) {
|
|
1672
|
-
if (typeof value != "function")
|
|
1673
|
-
throw new Error();
|
|
1623
|
+
if (typeof value != "function") throw new Error();
|
|
1674
1624
|
return this.each(easeVarying(this._id, value));
|
|
1675
1625
|
}
|
|
1676
1626
|
function transition_filter(match) {
|
|
@@ -1681,8 +1631,7 @@ function transition_filter(match) {
|
|
|
1681
1631
|
return new Transition(subgroups, this._parents, this._name, this._id);
|
|
1682
1632
|
}
|
|
1683
1633
|
function transition_merge(transition) {
|
|
1684
|
-
if (transition._id !== this._id)
|
|
1685
|
-
throw new Error();
|
|
1634
|
+
if (transition._id !== this._id) throw new Error();
|
|
1686
1635
|
for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j)
|
|
1687
1636
|
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i)
|
|
1688
1637
|
(node = group0[i] || group1[i]) && (merge[i] = node);
|
|
@@ -1710,9 +1659,7 @@ function transition_on(name, listener) {
|
|
|
1710
1659
|
function removeFunction(id2) {
|
|
1711
1660
|
return function() {
|
|
1712
1661
|
var parent = this.parentNode;
|
|
1713
|
-
for (var i in this.__transition)
|
|
1714
|
-
if (+i !== id2)
|
|
1715
|
-
return;
|
|
1662
|
+
for (var i in this.__transition) if (+i !== id2) return;
|
|
1716
1663
|
parent && parent.removeChild(this);
|
|
1717
1664
|
};
|
|
1718
1665
|
}
|
|
@@ -1795,12 +1742,9 @@ function styleTween(name, value, priority) {
|
|
|
1795
1742
|
}
|
|
1796
1743
|
function transition_styleTween(name, value, priority) {
|
|
1797
1744
|
var key = "style." + (name += "");
|
|
1798
|
-
if (arguments.length < 2)
|
|
1799
|
-
|
|
1800
|
-
if (value
|
|
1801
|
-
return this.tween(key, null);
|
|
1802
|
-
if (typeof value != "function")
|
|
1803
|
-
throw new Error();
|
|
1745
|
+
if (arguments.length < 2) return (key = this.tween(key)) && key._value;
|
|
1746
|
+
if (value == null) return this.tween(key, null);
|
|
1747
|
+
if (typeof value != "function") throw new Error();
|
|
1804
1748
|
return this.tween(key, styleTween(name, value, priority ?? ""));
|
|
1805
1749
|
}
|
|
1806
1750
|
function textConstant(value) {
|
|
@@ -1832,12 +1776,9 @@ function textTween(value) {
|
|
|
1832
1776
|
}
|
|
1833
1777
|
function transition_textTween(value) {
|
|
1834
1778
|
var key = "text";
|
|
1835
|
-
if (arguments.length < 1)
|
|
1836
|
-
|
|
1837
|
-
if (value
|
|
1838
|
-
return this.tween(key, null);
|
|
1839
|
-
if (typeof value != "function")
|
|
1840
|
-
throw new Error();
|
|
1779
|
+
if (arguments.length < 1) return (key = this.tween(key)) && key._value;
|
|
1780
|
+
if (value == null) return this.tween(key, null);
|
|
1781
|
+
if (typeof value != "function") throw new Error();
|
|
1841
1782
|
return this.tween(key, textTween(value));
|
|
1842
1783
|
}
|
|
1843
1784
|
function transition_transition() {
|
|
@@ -1989,9 +1930,7 @@ Transform.prototype = {
|
|
|
1989
1930
|
var identity = new Transform(1, 0, 0);
|
|
1990
1931
|
transform.prototype = Transform.prototype;
|
|
1991
1932
|
function transform(node) {
|
|
1992
|
-
for (; !node.__zoom; )
|
|
1993
|
-
if (!(node = node.parentNode))
|
|
1994
|
-
return identity;
|
|
1933
|
+
for (; !node.__zoom; ) if (!(node = node.parentNode)) return identity;
|
|
1995
1934
|
return node.__zoom;
|
|
1996
1935
|
}
|
|
1997
1936
|
function nopropagation(event) {
|
|
@@ -2077,8 +2016,7 @@ function zoom() {
|
|
|
2077
2016
|
}).tween("zoom", function() {
|
|
2078
2017
|
var that = this, args = arguments, g = gesture(that, args).event(event), e = extent.apply(that, args), p = point == null ? centroid(e) : typeof point == "function" ? point.apply(that, args) : point, w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]), a = that.__zoom, b = typeof transform2 == "function" ? transform2.apply(that, args) : transform2, i = interpolate2(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));
|
|
2079
2018
|
return function(t2) {
|
|
2080
|
-
if (t2 === 1)
|
|
2081
|
-
t2 = b;
|
|
2019
|
+
if (t2 === 1) t2 = b;
|
|
2082
2020
|
else {
|
|
2083
2021
|
var l = i(t2), k = w / l[2];
|
|
2084
2022
|
t2 = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k);
|
|
@@ -2123,14 +2061,12 @@ function zoom() {
|
|
|
2123
2061
|
}
|
|
2124
2062
|
};
|
|
2125
2063
|
function wheeled(event, ...args) {
|
|
2126
|
-
if (!filter2.apply(this, arguments))
|
|
2127
|
-
return;
|
|
2064
|
+
if (!filter2.apply(this, arguments)) return;
|
|
2128
2065
|
var g = gesture(this, args).event(event), t2 = this.__zoom, k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t2.k * Math.pow(2, wheelDelta2.apply(this, arguments)))), p = pointer(event);
|
|
2129
2066
|
if (g.wheel)
|
|
2130
2067
|
(g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) && (g.mouse[1] = t2.invert(g.mouse[0] = p)), clearTimeout(g.wheel);
|
|
2131
2068
|
else {
|
|
2132
|
-
if (t2.k === k)
|
|
2133
|
-
return;
|
|
2069
|
+
if (t2.k === k) return;
|
|
2134
2070
|
g.mouse = [p, t2.invert(p)], interrupt(this), g.start();
|
|
2135
2071
|
}
|
|
2136
2072
|
noevent(event), g.wheel = setTimeout(wheelidled, wheelDelay), g.zoom("mouse", constrain(translate(scale(t2, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));
|
|
@@ -2139,8 +2075,7 @@ function zoom() {
|
|
|
2139
2075
|
}
|
|
2140
2076
|
}
|
|
2141
2077
|
function mousedowned(event, ...args) {
|
|
2142
|
-
if (touchending || !filter2.apply(this, arguments))
|
|
2143
|
-
return;
|
|
2078
|
+
if (touchending || !filter2.apply(this, arguments)) return;
|
|
2144
2079
|
var currentTarget = event.currentTarget, g = gesture(this, args, !0).event(event), v = select(event.view).on("mousemove.zoom", mousemoved, !0).on("mouseup.zoom", mouseupped, !0), p = pointer(event, currentTarget), x0 = event.clientX, y0 = event.clientY;
|
|
2145
2080
|
dragDisable(event.view), nopropagation(event), g.mouse = [p, this.__zoom.invert(p)], interrupt(this), g.start();
|
|
2146
2081
|
function mousemoved(event2) {
|
|
@@ -2178,10 +2113,8 @@ function zoom() {
|
|
|
2178
2113
|
if (t2 = g.that.__zoom, g.touch1) {
|
|
2179
2114
|
var p0 = g.touch0[0], l0 = g.touch0[1], p1 = g.touch1[0], l1 = g.touch1[1], dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp, dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
|
|
2180
2115
|
t2 = scale(t2, Math.sqrt(dp / dl)), p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2], l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
|
|
2181
|
-
} else if (g.touch0)
|
|
2182
|
-
|
|
2183
|
-
else
|
|
2184
|
-
return;
|
|
2116
|
+
} else if (g.touch0) p = g.touch0[0], l = g.touch0[1];
|
|
2117
|
+
else return;
|
|
2185
2118
|
g.zoom("touch", constrain(translate(t2, p, l), g.extent, translateExtent));
|
|
2186
2119
|
}
|
|
2187
2120
|
}
|
|
@@ -2192,8 +2125,7 @@ function zoom() {
|
|
|
2192
2125
|
touchending = null;
|
|
2193
2126
|
}, touchDelay), i = 0; i < n; ++i)
|
|
2194
2127
|
t2 = touches[i], g.touch0 && g.touch0[2] === t2.identifier ? delete g.touch0 : g.touch1 && g.touch1[2] === t2.identifier && delete g.touch1;
|
|
2195
|
-
if (g.touch1 && !g.touch0 && (g.touch0 = g.touch1, delete g.touch1), g.touch0)
|
|
2196
|
-
g.touch0[1] = this.__zoom.invert(g.touch0[0]);
|
|
2128
|
+
if (g.touch1 && !g.touch0 && (g.touch0 = g.touch1, delete g.touch1), g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);
|
|
2197
2129
|
else if (g.end(), g.taps === 2 && (t2 = pointer(t2, this), Math.hypot(touchfirst[0] - t2[0], touchfirst[1] - t2[1]) < tapDistance)) {
|
|
2198
2130
|
var p = select(this).on("dblclick.zoom");
|
|
2199
2131
|
p && p.apply(this, arguments);
|
|
@@ -2351,11 +2283,10 @@ function calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin =
|
|
|
2351
2283
|
];
|
|
2352
2284
|
}
|
|
2353
2285
|
}
|
|
2354
|
-
else
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
]);
|
|
2286
|
+
else parentNode && isCoordinateExtent(node.extent) && (currentExtent = [
|
|
2287
|
+
[node.extent[0][0] + parentX, node.extent[0][1] + parentY],
|
|
2288
|
+
[node.extent[1][0] + parentX, node.extent[1][1] + parentY]
|
|
2289
|
+
]);
|
|
2359
2290
|
const positionAbsolute = isCoordinateExtent(currentExtent) ? clampPosition(nextPosition, currentExtent) : nextPosition;
|
|
2360
2291
|
return {
|
|
2361
2292
|
position: {
|
|
@@ -4740,13 +4671,12 @@ function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave
|
|
|
4740
4671
|
unselect,
|
|
4741
4672
|
nodeRef
|
|
4742
4673
|
});
|
|
4743
|
-
} else
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
}));
|
|
4674
|
+
} else isDraggable && node.selected && Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key) && (store.setState({
|
|
4675
|
+
ariaLiveMessage: `Moved selected node ${event.key.replace("Arrow", "").toLowerCase()}. New position, x: ${~~clampedPosition.x}, y: ${~~clampedPosition.y}`
|
|
4676
|
+
}), moveSelectedNodes({
|
|
4677
|
+
direction: arrowKeyDiffs[event.key],
|
|
4678
|
+
factor: event.shiftKey ? 4 : 1
|
|
4679
|
+
}));
|
|
4750
4680
|
};
|
|
4751
4681
|
return jsx("div", { className: cc([
|
|
4752
4682
|
"react-flow__node",
|
|
@@ -5840,21 +5770,15 @@ function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle
|
|
|
5840
5770
|
memo(ResizeControl);
|
|
5841
5771
|
function r(e) {
|
|
5842
5772
|
var t2, f, n = "";
|
|
5843
|
-
if (typeof e == "string" || typeof e == "number")
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
for (t2 = 0; t2 < o; t2++)
|
|
5849
|
-
e[t2] && (f = r(e[t2])) && (n && (n += " "), n += f);
|
|
5850
|
-
} else
|
|
5851
|
-
for (f in e)
|
|
5852
|
-
e[f] && (n && (n += " "), n += f);
|
|
5773
|
+
if (typeof e == "string" || typeof e == "number") n += e;
|
|
5774
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
5775
|
+
var o = e.length;
|
|
5776
|
+
for (t2 = 0; t2 < o; t2++) e[t2] && (f = r(e[t2])) && (n && (n += " "), n += f);
|
|
5777
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
5853
5778
|
return n;
|
|
5854
5779
|
}
|
|
5855
5780
|
function clsx() {
|
|
5856
|
-
for (var e, t2, f = 0, n = "", o = arguments.length; f < o; f++)
|
|
5857
|
-
(e = arguments[f]) && (t2 = r(e)) && (n && (n += " "), n += t2);
|
|
5781
|
+
for (var e, t2, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t2 = r(e)) && (n && (n += " "), n += t2);
|
|
5858
5782
|
return n;
|
|
5859
5783
|
}
|
|
5860
5784
|
var rootClassName = "likec4-diagram-root", keepAspectRatioContainer = "_2h8g8h0", cssReactFlow = "_2h8g8h1", cssDisablePan = "_2h8g8h2", cssTransparentBg = "_2h8g8h3", cssNoControls = "_2h8g8h4";
|
|
@@ -7533,8 +7457,7 @@ function DiagramContextProvider({ children: children2, view, ...props }) {
|
|
|
7533
7457
|
[xyflow]
|
|
7534
7458
|
), useUpdateEffect(
|
|
7535
7459
|
() => {
|
|
7536
|
-
if (!store.current)
|
|
7537
|
-
return;
|
|
7460
|
+
if (!store.current) return;
|
|
7538
7461
|
const state = store.current.getState();
|
|
7539
7462
|
state.view !== view && state.updateView(view), hasSubObject(state, props) || store.current.setState(props, !1, "update incoming props");
|
|
7540
7463
|
},
|
|
@@ -7787,13 +7710,11 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
7787
7710
|
};
|
|
7788
7711
|
},
|
|
7789
7712
|
shapeintersections: function(s1, bbox1, s2, bbox2, curveIntersectionThreshold) {
|
|
7790
|
-
if (!utils.bboxoverlap(bbox1, bbox2))
|
|
7791
|
-
return [];
|
|
7713
|
+
if (!utils.bboxoverlap(bbox1, bbox2)) return [];
|
|
7792
7714
|
const intersections = [], a1 = [s1.startcap, s1.forward, s1.back, s1.endcap], a2 = [s2.startcap, s2.forward, s2.back, s2.endcap];
|
|
7793
7715
|
return a1.forEach(function(l1) {
|
|
7794
7716
|
l1.virtual || a2.forEach(function(l2) {
|
|
7795
|
-
if (l2.virtual)
|
|
7796
|
-
return;
|
|
7717
|
+
if (l2.virtual) return;
|
|
7797
7718
|
const iss = l1.intersects(l2, curveIntersectionThreshold);
|
|
7798
7719
|
iss.length > 0 && (iss.c1 = l1, iss.c2 = l2, iss.s1 = s1, iss.s2 = s2, intersections.push(iss));
|
|
7799
7720
|
});
|
|
@@ -7818,8 +7739,7 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
7818
7739
|
}, shape;
|
|
7819
7740
|
},
|
|
7820
7741
|
getminmax: function(curve2, d, list) {
|
|
7821
|
-
if (!list)
|
|
7822
|
-
return { min: 0, max: 0 };
|
|
7742
|
+
if (!list) return { min: 0, max: 0 };
|
|
7823
7743
|
let min2 = nMax, max2 = nMin, t2, c;
|
|
7824
7744
|
list.indexOf(0) === -1 && (list = [0].concat(list)), list.indexOf(1) === -1 && list.push(1);
|
|
7825
7745
|
for (let i = 0, len = list.length; i < len; i++)
|
|
@@ -7902,23 +7822,19 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
7902
7822
|
return { k, r: r2, dk, adk };
|
|
7903
7823
|
},
|
|
7904
7824
|
inflections: function(points) {
|
|
7905
|
-
if (points.length < 4)
|
|
7906
|
-
return [];
|
|
7825
|
+
if (points.length < 4) return [];
|
|
7907
7826
|
const p = utils.align(points, { p1: points[0], p2: points.slice(-1)[0] }), a = p[2].x * p[1].y, b = p[3].x * p[1].y, c = p[1].x * p[2].y, d = p[3].x * p[2].y, v1 = 18 * (-3 * a + 2 * b + 3 * c - d), v2 = 18 * (3 * a - b - 3 * c), v3 = 18 * (c - a);
|
|
7908
7827
|
if (utils.approximately(v1, 0)) {
|
|
7909
7828
|
if (!utils.approximately(v2, 0)) {
|
|
7910
7829
|
let t2 = -v3 / v2;
|
|
7911
|
-
if (0 <= t2 && t2 <= 1)
|
|
7912
|
-
return [t2];
|
|
7830
|
+
if (0 <= t2 && t2 <= 1) return [t2];
|
|
7913
7831
|
}
|
|
7914
7832
|
return [];
|
|
7915
7833
|
}
|
|
7916
7834
|
const d2 = 2 * v1;
|
|
7917
|
-
if (utils.approximately(d2, 0))
|
|
7918
|
-
return [];
|
|
7835
|
+
if (utils.approximately(d2, 0)) return [];
|
|
7919
7836
|
const trm = v2 * v2 - 4 * v1 * v3;
|
|
7920
|
-
if (trm < 0)
|
|
7921
|
-
return [];
|
|
7837
|
+
if (trm < 0) return [];
|
|
7922
7838
|
const sq = Math.sqrt(trm);
|
|
7923
7839
|
return [(sq - v2) / d2, -(v2 + sq) / d2].filter(function(r2) {
|
|
7924
7840
|
return 0 <= r2 && r2 <= 1;
|
|
@@ -7927,8 +7843,7 @@ const pi$1 = Math.PI, tau = 2 * pi$1, quart = pi$1 / 2, epsilon = 1e-6, nMax = N
|
|
|
7927
7843
|
bboxoverlap: function(b1, b2) {
|
|
7928
7844
|
const dims = ["x", "y"], len = dims.length;
|
|
7929
7845
|
for (let i = 0, dim, l, t2, d; i < len; i++)
|
|
7930
|
-
if (dim = dims[i], l = b1[dim].mid, t2 = b2[dim].mid, d = (b1[dim].size + b2[dim].size) / 2, abs$1(l - t2) >= d)
|
|
7931
|
-
return !1;
|
|
7846
|
+
if (dim = dims[i], l = b1[dim].mid, t2 = b2[dim].mid, d = (b1[dim].size + b2[dim].size) / 2, abs$1(l - t2) >= d) return !1;
|
|
7932
7847
|
return !0;
|
|
7933
7848
|
},
|
|
7934
7849
|
expandbox: function(bbox, _bbox) {
|
|
@@ -8079,8 +7994,7 @@ class Bezier {
|
|
|
8079
7994
|
return utils.pointsToString(this.points);
|
|
8080
7995
|
}
|
|
8081
7996
|
toSVG() {
|
|
8082
|
-
if (this._3d)
|
|
8083
|
-
return !1;
|
|
7997
|
+
if (this._3d) return !1;
|
|
8084
7998
|
const p = this.points, x = p[0].x, y = p[0].y, s = ["M", x, y, this.order === 2 ? "Q" : "C"];
|
|
8085
7999
|
for (let i = 1, last2 = p.length; i < last2; i++)
|
|
8086
8000
|
s.push(p[i].x), s.push(p[i].y);
|
|
@@ -8293,8 +8207,7 @@ class Bezier {
|
|
|
8293
8207
|
simple() {
|
|
8294
8208
|
if (this.order === 3) {
|
|
8295
8209
|
const a1 = utils.angle(this.points[0], this.points[3], this.points[1]), a2 = utils.angle(this.points[0], this.points[3], this.points[2]);
|
|
8296
|
-
if (a1 > 0 && a2 < 0 || a1 < 0 && a2 > 0)
|
|
8297
|
-
return !1;
|
|
8210
|
+
if (a1 > 0 && a2 < 0 || a1 < 0 && a2 > 0) return !1;
|
|
8298
8211
|
}
|
|
8299
8212
|
const n1 = this.normal(0), n2 = this.normal(1);
|
|
8300
8213
|
let s = n1.x * n2.x + n1.y * n2.y;
|
|
@@ -8359,8 +8272,7 @@ class Bezier {
|
|
|
8359
8272
|
};
|
|
8360
8273
|
}
|
|
8361
8274
|
}), new Bezier(np)) : ([0, 1].forEach((t2) => {
|
|
8362
|
-
if (order === 2 && t2)
|
|
8363
|
-
return;
|
|
8275
|
+
if (order === 2 && t2) return;
|
|
8364
8276
|
const p = np[t2 * order], d2 = this.derivative(t2), p2 = { x: p.x + d2.x, y: p.y + d2.y };
|
|
8365
8277
|
np[t2 + 1] = utils.lli4(p, p2, o, points[t2 + 1]);
|
|
8366
8278
|
}), new Bezier(np));
|
|
@@ -8686,12 +8598,11 @@ function SelectEdgesOnNodeFocus() {
|
|
|
8686
8598
|
});
|
|
8687
8599
|
const anotherNode = nodeLookup.get(edge.source === focusedNodeId ? edge.target : edge.source);
|
|
8688
8600
|
anotherNode && fitViewNodes.add(anotherNode);
|
|
8689
|
-
} else
|
|
8690
|
-
edge.
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
});
|
|
8601
|
+
} else edge.selected && edgeChanges.push({
|
|
8602
|
+
id: edge.id,
|
|
8603
|
+
type: "select",
|
|
8604
|
+
selected: !1
|
|
8605
|
+
});
|
|
8695
8606
|
for (const [, node] of nodeLookup)
|
|
8696
8607
|
node.selected && node.id !== focusedNodeId && nodeChanges.push({
|
|
8697
8608
|
id: node.id,
|
|
@@ -9685,23 +9596,23 @@ function useXYFlowEvents() {
|
|
|
9685
9596
|
const viewportChanged = !!event;
|
|
9686
9597
|
viewportChanged !== diagramApi.getState().viewportChanged && diagramApi.setState({ viewportChanged }, !1, `viewport-changed: ${viewportChanged}`);
|
|
9687
9598
|
},
|
|
9688
|
-
onNodeMouseEnter: (
|
|
9599
|
+
onNodeMouseEnter: (_event, xynode) => {
|
|
9689
9600
|
hoveredNodeFromOnEdgeEnterRef.current = "";
|
|
9690
9601
|
const { hoveredNodeId, setHoveredNode } = diagramApi.getState();
|
|
9691
9602
|
hoveredNodeId !== xynode.id && setHoveredNode(xynode.id);
|
|
9692
9603
|
},
|
|
9693
|
-
onNodeMouseLeave: (
|
|
9604
|
+
onNodeMouseLeave: (_event, xynode) => {
|
|
9694
9605
|
const { hoveredNodeId, setHoveredNode } = diagramApi.getState();
|
|
9695
9606
|
hoveredNodeId === xynode.id && setHoveredNode(null);
|
|
9696
9607
|
},
|
|
9697
|
-
onEdgeMouseEnter: (
|
|
9608
|
+
onEdgeMouseEnter: (_event, { id: id2, source, target }) => {
|
|
9698
9609
|
const { hoveredNodeId, focusedNodeId, setHoveredEdge, setHoveredNode } = diagramApi.getState();
|
|
9699
9610
|
if (setHoveredEdge(id2), (focusedNodeId === source || focusedNodeId === target) && focusedNodeId !== hoveredNodeId) {
|
|
9700
9611
|
const next = hoveredNodeFromOnEdgeEnterRef.current = source === focusedNodeId ? target : source;
|
|
9701
9612
|
setHoveredNode(next);
|
|
9702
9613
|
}
|
|
9703
9614
|
},
|
|
9704
|
-
onEdgeMouseLeave: (
|
|
9615
|
+
onEdgeMouseLeave: (_event, xyedge) => {
|
|
9705
9616
|
const { hoveredEdgeId, setHoveredEdge, hoveredNodeId, setHoveredNode } = diagramApi.getState();
|
|
9706
9617
|
hoveredEdgeId === xyedge.id && setHoveredEdge(null), hoveredNodeId === hoveredNodeFromOnEdgeEnterRef.current && (hoveredNodeFromOnEdgeEnterRef.current = "", setHoveredNode(null));
|
|
9707
9618
|
}
|