@m3ui-vue/m3ui-vue 1.3.7 → 1.3.8
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/API.md +40 -9
- package/dist/api.json +1 -1
- package/dist/components/MBadge.vue.d.ts +1 -1
- package/dist/components/MFlow.vue.d.ts +13 -0
- package/dist/components/MSlider.vue.d.ts +2 -2
- package/dist/components/MSplitter.vue.d.ts +1 -1
- package/dist/components/MTour.vue.d.ts +52 -2
- package/dist/composables/flowPaths.d.ts +11 -3
- package/dist/composables/useFlow.d.ts +4 -0
- package/dist/flow.d.ts +1 -1
- package/dist/flow.js +525 -433
- package/dist/flow.js.map +1 -1
- package/dist/{flowPaths-DzW-aiET.js → flowPaths-CcWOKY4Z.js} +5 -5
- package/dist/flowPaths-CcWOKY4Z.js.map +1 -0
- package/dist/gantt.js +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +232 -163
- package/dist/m3ui.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/__tests__/MFlow.test.ts +69 -0
- package/src/__tests__/MTour.test.ts +102 -0
- package/src/components/MFlow.vue +117 -17
- package/src/components/MTour.vue +145 -27
- package/src/composables/flowPaths.ts +16 -7
- package/src/composables/useFlow.ts +4 -0
- package/src/flow.ts +1 -1
- package/dist/flowPaths-DzW-aiET.js.map +0 -1
package/dist/flow.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as e } from "./useLocale-D2ucaY-l.js";
|
|
2
2
|
import { r as t, t as n, u as r } from "./MIconButton-DoNotQ9v.js";
|
|
3
|
-
import { a as i, c as a, d as o, i as s, l as c, n as l, o as u, r as d, s as f, t as p, u as m } from "./flowPaths-
|
|
3
|
+
import { a as i, c as a, d as o, i as s, l as c, n as l, o as u, r as d, s as f, t as p, u as m } from "./flowPaths-CcWOKY4Z.js";
|
|
4
4
|
import { Fragment as h, Transition as g, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createTextVNode as S, createVNode as C, defineComponent as w, inject as T, mergeProps as ee, nextTick as E, normalizeClass as D, normalizeStyle as O, onBeforeUnmount as te, onMounted as ne, openBlock as k, provide as re, reactive as ie, ref as A, renderList as ae, renderSlot as oe, shallowReactive as se, shallowRef as ce, toDisplayString as le, toRaw as ue, unref as j, useSlots as de, vShow as fe, watch as pe, withCtx as me, withDirectives as M, withModifiers as he } from "vue";
|
|
5
5
|
//#region src/composables/useFlow.ts
|
|
6
6
|
var ge = Symbol("m3-flow"), _e = Symbol("m3-flow-node");
|
|
@@ -218,23 +218,23 @@ var Se = [
|
|
|
218
218
|
"aria-hidden": "true"
|
|
219
219
|
}, null, 10, Se));
|
|
220
220
|
}
|
|
221
|
-
}), L = { class: "flex items-center gap-3 p-3" },
|
|
221
|
+
}), L = { class: "flex items-center gap-3 p-3" }, R = {
|
|
222
222
|
class: "material-symbols-outlined text-[24px]",
|
|
223
223
|
"aria-hidden": "true"
|
|
224
|
-
},
|
|
224
|
+
}, Ce = { class: "min-w-0 flex-1" }, we = {
|
|
225
225
|
key: 0,
|
|
226
226
|
class: "truncate text-title-small"
|
|
227
|
-
},
|
|
227
|
+
}, Te = {
|
|
228
228
|
key: 1,
|
|
229
229
|
class: "truncate text-body-small text-on-surface-variant"
|
|
230
|
-
},
|
|
230
|
+
}, Ee = {
|
|
231
231
|
key: 0,
|
|
232
232
|
class: "shrink-0",
|
|
233
233
|
"data-flow-nodrag": ""
|
|
234
|
-
},
|
|
234
|
+
}, De = {
|
|
235
235
|
key: 0,
|
|
236
236
|
class: "px-3 pb-3"
|
|
237
|
-
},
|
|
237
|
+
}, Oe = /* @__PURE__ */ w({
|
|
238
238
|
__name: "MFlowNode",
|
|
239
239
|
props: {
|
|
240
240
|
label: {},
|
|
@@ -276,11 +276,11 @@ var Se = [
|
|
|
276
276
|
oe(t.$slots, "icon", {}, () => [e.icon ? (k(), b("span", {
|
|
277
277
|
key: 0,
|
|
278
278
|
class: D(["flex size-10 shrink-0 items-center justify-center rounded-sm", c[e.color]])
|
|
279
|
-
}, [x("span",
|
|
280
|
-
x("div",
|
|
281
|
-
t.$slots.trailing ? (k(), b("div",
|
|
279
|
+
}, [x("span", R, le(e.icon), 1)], 2)) : y("", !0)]),
|
|
280
|
+
x("div", Ce, [e.label ? (k(), b("div", we, le(e.label), 1)) : y("", !0), e.subtitle ? (k(), b("div", Te, le(e.subtitle), 1)) : y("", !0)]),
|
|
281
|
+
t.$slots.trailing ? (k(), b("div", Ee, [oe(t.$slots, "trailing")])) : y("", !0)
|
|
282
282
|
]),
|
|
283
|
-
t.$slots.default ? (k(), b("div",
|
|
283
|
+
t.$slots.default ? (k(), b("div", De, [oe(t.$slots, "default")])) : y("", !0),
|
|
284
284
|
j(r) && (e.handles === "both" || e.handles === "target") ? (k(), v(I, {
|
|
285
285
|
key: 1,
|
|
286
286
|
type: "target",
|
|
@@ -293,22 +293,22 @@ var Se = [
|
|
|
293
293
|
}, null, 8, ["position"])) : y("", !0)
|
|
294
294
|
], 2));
|
|
295
295
|
}
|
|
296
|
-
}),
|
|
296
|
+
}), ke = [
|
|
297
297
|
"data-flow-node",
|
|
298
298
|
"data-selected",
|
|
299
299
|
"data-dragging",
|
|
300
300
|
"aria-roledescription",
|
|
301
301
|
"aria-label"
|
|
302
|
-
],
|
|
302
|
+
], Ae = {
|
|
303
303
|
key: 0,
|
|
304
304
|
class: "flex h-9 items-center gap-2 px-3 text-label-large text-on-surface-variant"
|
|
305
|
-
},
|
|
305
|
+
}, je = {
|
|
306
306
|
key: 0,
|
|
307
307
|
class: "material-symbols-outlined text-[18px]"
|
|
308
|
-
},
|
|
308
|
+
}, Me = { class: "truncate px-1" }, z = {
|
|
309
309
|
key: 0,
|
|
310
310
|
class: "absolute -top-1.5 -right-1.5 flex h-6 min-w-6 items-center justify-center rounded-full bg-tertiary px-1.5 text-label-small text-on-tertiary shadow-elevation-1"
|
|
311
|
-
},
|
|
311
|
+
}, Ne = /* @__PURE__ */ w({
|
|
312
312
|
__name: "_MFlowNodeShell",
|
|
313
313
|
props: {
|
|
314
314
|
node: {},
|
|
@@ -382,7 +382,7 @@ var Se = [
|
|
|
382
382
|
}, null, 8, ["fn", "scope"])) : u.value ? (k(), b("div", {
|
|
383
383
|
key: 1,
|
|
384
384
|
class: D(["size-full rounded-lg border bg-surface-container-low/70 transition-colors", c.value ? "border-primary" : "border-outline-variant"])
|
|
385
|
-
}, [d.value.label ? (k(), b("div",
|
|
385
|
+
}, [d.value.label ? (k(), b("div", Ae, [d.value.icon ? (k(), b("span", je, le(d.value.icon), 1)) : y("", !0), S(" " + le(d.value.label), 1)])) : y("", !0)], 2)) : s.value.type === "circle" ? (k(), b("div", {
|
|
386
386
|
key: 2,
|
|
387
387
|
class: "relative",
|
|
388
388
|
style: O({
|
|
@@ -394,13 +394,13 @@ var Se = [
|
|
|
394
394
|
g[h.value.color],
|
|
395
395
|
c.value ? "border-primary" : "border-transparent",
|
|
396
396
|
h.value.ring && w[h.value.ring]
|
|
397
|
-
]]) }, [x("span",
|
|
398
|
-
h.value.badge !== void 0 && h.value.badge !== null && h.value.badge !== "" ? (k(), b("span",
|
|
397
|
+
]]) }, [x("span", Me, le(d.value.label), 1)], 2),
|
|
398
|
+
h.value.badge !== void 0 && h.value.badge !== null && h.value.badge !== "" ? (k(), b("span", z, le(h.value.badge), 1)) : y("", !0),
|
|
399
399
|
C(I, {
|
|
400
400
|
type: "source",
|
|
401
401
|
position: "right"
|
|
402
402
|
})
|
|
403
|
-
], 4)) : (k(), v(
|
|
403
|
+
], 4)) : (k(), v(Oe, {
|
|
404
404
|
key: 3,
|
|
405
405
|
label: d.value.label ?? j(o),
|
|
406
406
|
subtitle: d.value.subtitle,
|
|
@@ -411,13 +411,13 @@ var Se = [
|
|
|
411
411
|
"subtitle",
|
|
412
412
|
"icon",
|
|
413
413
|
"handles"
|
|
414
|
-
]))], 46,
|
|
414
|
+
]))], 46, ke));
|
|
415
415
|
}
|
|
416
|
-
}),
|
|
416
|
+
}), Pe = [
|
|
417
417
|
"data-flow-edge",
|
|
418
418
|
"tabindex",
|
|
419
419
|
"aria-label"
|
|
420
|
-
],
|
|
420
|
+
], Fe = ["d"], Ie = ["d"], Le = ["d", "stroke-width"], Re = ["d"], ze = [
|
|
421
421
|
"data-flow-segment",
|
|
422
422
|
"x",
|
|
423
423
|
"y",
|
|
@@ -522,7 +522,7 @@ var Se = [
|
|
|
522
522
|
"stroke-width": "16",
|
|
523
523
|
style: { pointerEvents: "stroke" },
|
|
524
524
|
class: D(j(r).branching.value ? "cursor-crosshair" : c.value && "cursor-pointer")
|
|
525
|
-
}, null, 10,
|
|
525
|
+
}, null, 10, Fe),
|
|
526
526
|
s.value ? (k(), b("path", {
|
|
527
527
|
key: 0,
|
|
528
528
|
d: a.value.path,
|
|
@@ -582,7 +582,7 @@ var Se = [
|
|
|
582
582
|
class: "cursor-move fill-surface stroke-primary",
|
|
583
583
|
style: { pointerEvents: "all" }
|
|
584
584
|
}, null, 8, Be)), 64)) : y("", !0)
|
|
585
|
-
], 42,
|
|
585
|
+
], 42, Pe)) : y("", !0);
|
|
586
586
|
}
|
|
587
587
|
}), He = ["data-flow-edge"], Ue = { class: "flex items-center gap-1" }, We = ["data-flow-edge-delete", "aria-label"], Ge = /* @__PURE__ */ w({
|
|
588
588
|
__name: "_MFlowEdgeLabel",
|
|
@@ -721,6 +721,7 @@ var Se = [
|
|
|
721
721
|
type: Boolean,
|
|
722
722
|
default: !1
|
|
723
723
|
},
|
|
724
|
+
edgeSpacing: { default: 0 },
|
|
724
725
|
defaultEdgeOptions: {},
|
|
725
726
|
autoConnect: {
|
|
726
727
|
type: Boolean,
|
|
@@ -789,40 +790,40 @@ var Se = [
|
|
|
789
790
|
set: (e) => {
|
|
790
791
|
Se.value = e, C("update:locked", e);
|
|
791
792
|
}
|
|
792
|
-
}), L = _(() => new Map(N.value.map((e) => [e.id, e]))),
|
|
793
|
+
}), L = _(() => new Map(N.value.map((e) => [e.id, e]))), R = _(() => new Map(P.value.map((e) => [e.id, e]))), Ce = (e) => L.value.get(e), we = (e) => {
|
|
793
794
|
let t = L.value.get(e)?.parentId;
|
|
794
795
|
return t && L.value.has(t) ? t : void 0;
|
|
795
796
|
};
|
|
796
|
-
function
|
|
797
|
+
function Te(e) {
|
|
797
798
|
let t = [];
|
|
798
|
-
for (let n =
|
|
799
|
+
for (let n = we(e); n && t.length < 50; n = we(n)) t.push(n);
|
|
799
800
|
return t;
|
|
800
801
|
}
|
|
801
|
-
let
|
|
802
|
-
function
|
|
802
|
+
let Ee = (e) => Te(e).length;
|
|
803
|
+
function De(e) {
|
|
803
804
|
let t = L.value.get(e);
|
|
804
|
-
return !t || !!t.hidden ||
|
|
805
|
+
return !t || !!t.hidden || Te(e).some((e) => L.value.get(e)?.hidden);
|
|
805
806
|
}
|
|
806
|
-
let
|
|
807
|
+
let Oe = _(() => {
|
|
807
808
|
let e = /* @__PURE__ */ new Map();
|
|
808
809
|
for (let t of N.value) t.parentId && L.value.has(t.parentId) && (e.get(t.parentId) ?? e.set(t.parentId, []).get(t.parentId)).push(t.id);
|
|
809
810
|
return e;
|
|
810
811
|
});
|
|
811
|
-
function
|
|
812
|
-
let t = [], n = (e) => (
|
|
812
|
+
function ke(e) {
|
|
813
|
+
let t = [], n = (e) => (Oe.value.get(e) ?? []).forEach((e) => {
|
|
813
814
|
t.push(e), n(e);
|
|
814
815
|
});
|
|
815
816
|
return n(e), t;
|
|
816
817
|
}
|
|
817
|
-
let
|
|
818
|
-
function
|
|
818
|
+
let Ae = _(() => new Set(F.value.nodes)), je = _(() => new Set(F.value.edges)), Me = _(() => !!S.edgeBranching && Le.value && !I.value);
|
|
819
|
+
function z(e) {
|
|
819
820
|
let t = {
|
|
820
821
|
nodes: e.nodes ?? F.value.nodes,
|
|
821
822
|
edges: e.edges ?? F.value.edges
|
|
822
823
|
};
|
|
823
|
-
|
|
824
|
+
Pe(t.nodes, F.value.nodes) && Pe(t.edges, F.value.edges) || (F.value = t, C("update:selection", t));
|
|
824
825
|
}
|
|
825
|
-
let
|
|
826
|
+
let Pe = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), Fe = _(() => S.elementsSelectable && !I.value), Ie = _(() => S.nodesDraggable && !I.value), Le = _(() => S.nodesConnectable && !I.value), Re = ce([]), ze = ce([]), Be = null, He = () => ({
|
|
826
827
|
nodes: N.value,
|
|
827
828
|
edges: P.value
|
|
828
829
|
});
|
|
@@ -856,7 +857,7 @@ var Se = [
|
|
|
856
857
|
function pt(e) {
|
|
857
858
|
B(e, { history: !1 });
|
|
858
859
|
let t = new Set(e.nodes.map((e) => e.id)), n = new Set(e.edges.map((e) => e.id));
|
|
859
|
-
|
|
860
|
+
z({
|
|
860
861
|
nodes: F.value.nodes.filter((e) => t.has(e)),
|
|
861
862
|
edges: F.value.edges.filter((e) => n.has(e))
|
|
862
863
|
});
|
|
@@ -873,7 +874,7 @@ var Se = [
|
|
|
873
874
|
function xt() {
|
|
874
875
|
let e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(), n = S.animate && he.value && !yt && !r();
|
|
875
876
|
for (let r of N.value) {
|
|
876
|
-
e.add(r.id),
|
|
877
|
+
e.add(r.id), De(r.id) && t.add(r.id);
|
|
877
878
|
let i = bt.has(r.id) && !t.has(r.id), a = V.get(r.id), { x: o, y: s } = r.position;
|
|
878
879
|
if (!a) {
|
|
879
880
|
V.set(r.id, ie({
|
|
@@ -915,13 +916,13 @@ var Se = [
|
|
|
915
916
|
let i = V.get(e);
|
|
916
917
|
i && (i.x = r.x, i.y = r.y);
|
|
917
918
|
}
|
|
918
|
-
|
|
919
|
+
vn(t) && (n = !0), Br(t) && (n = !0), n && (U = requestAnimationFrame(Dt));
|
|
919
920
|
}
|
|
920
921
|
function W(e) {
|
|
921
922
|
let t = 0, n = 0, r = e;
|
|
922
923
|
for (let e = 0; r && e < 50; e++) {
|
|
923
924
|
let e = V.get(r), i = L.value.get(r);
|
|
924
|
-
t += e?.x ?? i?.position.x ?? 0, n += e?.y ?? i?.position.y ?? 0, r =
|
|
925
|
+
t += e?.x ?? i?.position.x ?? 0, n += e?.y ?? i?.position.y ?? 0, r = we(r);
|
|
925
926
|
}
|
|
926
927
|
return {
|
|
927
928
|
x: t,
|
|
@@ -943,8 +944,8 @@ var Se = [
|
|
|
943
944
|
let n = G.get(e);
|
|
944
945
|
if (n) return n;
|
|
945
946
|
let r = 200, i = 120;
|
|
946
|
-
for (let t of
|
|
947
|
-
if (
|
|
947
|
+
for (let t of Oe.value.get(e) ?? []) {
|
|
948
|
+
if (De(t)) continue;
|
|
948
949
|
let e = V.get(t), n = K(t);
|
|
949
950
|
r = Math.max(r, (e?.x ?? 0) + n.width + 24), i = Math.max(i, (e?.y ?? 0) + n.height + 24);
|
|
950
951
|
}
|
|
@@ -1000,10 +1001,10 @@ var Se = [
|
|
|
1000
1001
|
};
|
|
1001
1002
|
}
|
|
1002
1003
|
function It(e, t) {
|
|
1003
|
-
if (t) At.set(e, t), Mt(e),
|
|
1004
|
+
if (t) At.set(e, t), Mt(e), li?.observe(t);
|
|
1004
1005
|
else {
|
|
1005
1006
|
let t = At.get(e);
|
|
1006
|
-
t &&
|
|
1007
|
+
t && li?.unobserve(t), At.delete(e), Ot.delete(e), kt.delete(e);
|
|
1007
1008
|
}
|
|
1008
1009
|
}
|
|
1009
1010
|
let Lt = (e) => {
|
|
@@ -1104,9 +1105,9 @@ var Se = [
|
|
|
1104
1105
|
}
|
|
1105
1106
|
let Yt = (e) => L.value.get(e.source)?.type === "circle" || L.value.get(e.target)?.type === "circle", Xt = (e) => !Yt(e) && (q(e) === "smoothstep" || q(e) === "step");
|
|
1106
1107
|
function Zt(e) {
|
|
1107
|
-
if (
|
|
1108
|
+
if (rr.value?.id === e.id) return rr.value.route;
|
|
1108
1109
|
if (e.route) {
|
|
1109
|
-
if (
|
|
1110
|
+
if (un(e.source) && un(e.target)) {
|
|
1110
1111
|
let t = V.get(e.source), n = L.value.get(e.source);
|
|
1111
1112
|
if (t && n && (t.x !== n.position.x || t.y !== n.position.y)) return Qt(e, t.x - n.position.x, t.y - n.position.y);
|
|
1112
1113
|
}
|
|
@@ -1148,7 +1149,10 @@ var Se = [
|
|
|
1148
1149
|
...a,
|
|
1149
1150
|
route: o,
|
|
1150
1151
|
borderRadius: q(e) === "step" ? 0 : 8
|
|
1151
|
-
}) : Wt(q(e),
|
|
1152
|
+
}) : Wt(q(e), {
|
|
1153
|
+
...a,
|
|
1154
|
+
...rn.value.get(e.id)
|
|
1155
|
+
});
|
|
1152
1156
|
return {
|
|
1153
1157
|
...a,
|
|
1154
1158
|
...s,
|
|
@@ -1164,9 +1168,77 @@ var Se = [
|
|
|
1164
1168
|
return n ? m({
|
|
1165
1169
|
...t.ends,
|
|
1166
1170
|
route: n
|
|
1167
|
-
}) : o(
|
|
1171
|
+
}) : o({
|
|
1172
|
+
...t.ends,
|
|
1173
|
+
...rn.value.get(e.id)
|
|
1174
|
+
});
|
|
1175
|
+
}
|
|
1176
|
+
function nn(e) {
|
|
1177
|
+
let t = {
|
|
1178
|
+
left: -1,
|
|
1179
|
+
right: 1,
|
|
1180
|
+
top: -1,
|
|
1181
|
+
bottom: 1
|
|
1182
|
+
}, n = e.sourcePosition === "left" || e.sourcePosition === "right";
|
|
1183
|
+
if (n !== (e.targetPosition === "left" || e.targetPosition === "right")) return null;
|
|
1184
|
+
let r = t[e.sourcePosition], i = t[e.targetPosition], [a, o] = n ? [e.sourceX, e.targetX] : [e.sourceY, e.targetY];
|
|
1185
|
+
if (r !== -i || (o - a) * r < 40) return null;
|
|
1186
|
+
let s = a + r * 20, c = o + i * 20;
|
|
1187
|
+
return {
|
|
1188
|
+
vertical: n,
|
|
1189
|
+
c: (a + o) / 2,
|
|
1190
|
+
min: Math.min(s, c),
|
|
1191
|
+
max: Math.max(s, c)
|
|
1192
|
+
};
|
|
1168
1193
|
}
|
|
1169
|
-
let
|
|
1194
|
+
let rn = _(() => {
|
|
1195
|
+
let e = /* @__PURE__ */ new Map(), t = S.edgeSpacing;
|
|
1196
|
+
if (!t) return e;
|
|
1197
|
+
let n = [], r = [];
|
|
1198
|
+
for (let e of ln.value) {
|
|
1199
|
+
if (!Xt(e)) continue;
|
|
1200
|
+
let t = $t(e);
|
|
1201
|
+
if (!t) continue;
|
|
1202
|
+
let i = `${e.source}\u0000${e.sourceHandle ?? ""}`, a = Zt(e), s = a ? null : nn(t.ends), c = a ? m({
|
|
1203
|
+
...t.ends,
|
|
1204
|
+
route: a
|
|
1205
|
+
}) : o(t.ends);
|
|
1206
|
+
for (let t = 1; t < c.length; t++) {
|
|
1207
|
+
let [a, o] = c[t - 1], [l, u] = c[t], d = Math.abs(a - l) < .01;
|
|
1208
|
+
if (!d && Math.abs(o - u) >= .01) continue;
|
|
1209
|
+
let f = {
|
|
1210
|
+
src: i,
|
|
1211
|
+
vertical: d,
|
|
1212
|
+
c: d ? a : o,
|
|
1213
|
+
lo: d ? Math.min(o, u) : Math.min(a, l),
|
|
1214
|
+
hi: d ? Math.max(o, u) : Math.max(a, l)
|
|
1215
|
+
};
|
|
1216
|
+
s && s.vertical === d && Math.abs(s.c - f.c) < .01 ? r.push({
|
|
1217
|
+
...f,
|
|
1218
|
+
id: e.id,
|
|
1219
|
+
min: s.min,
|
|
1220
|
+
max: s.max
|
|
1221
|
+
}) : n.push(f);
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
let i = (e, r) => n.some((n) => n.vertical === e.vertical && n.src !== e.src && Math.abs(n.c - r) < t / 2 && Math.min(n.hi, e.hi) - Math.max(n.lo, e.lo) > .5);
|
|
1225
|
+
r.sort((e, t) => t.hi - t.lo - (e.hi - e.lo) || e.c - t.c);
|
|
1226
|
+
for (let a of r) {
|
|
1227
|
+
let r = a.c;
|
|
1228
|
+
for (let e = 0; e <= 16; e++) {
|
|
1229
|
+
let n = e === 0 ? 0 : Math.ceil(e / 2) * t * (e % 2 ? 1 : -1), o = a.c + n;
|
|
1230
|
+
if (!(o < a.min - .01 || o > a.max + .01) && !i(a, o)) {
|
|
1231
|
+
r = o;
|
|
1232
|
+
break;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
r !== a.c && e.set(a.id, a.vertical ? { centerX: r } : { centerY: r }), n.push({
|
|
1236
|
+
...a,
|
|
1237
|
+
c: r
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1240
|
+
return e;
|
|
1241
|
+
}), an = (e) => !I.value && Xt(e) && (e.reroutable ?? S.edgesReroutable), on = _(() => N.value.filter((e) => !De(e.id))), sn = _(() => on.value.filter((e) => e.type === "group").sort((e, t) => Ee(e.id) - Ee(t.id))), cn = _(() => on.value.filter((e) => e.type !== "group")), ln = _(() => P.value.filter((e) => !e.hidden && !De(e.source) && !De(e.target))), un = (e) => vt.value.has(e) || Te(e).some((e) => vt.value.has(e)), dn = (e) => (un(e) ? 1e3 : 0) + Ee(e) * 10 + (Ae.value.has(e) ? 3 : 0), fn = (e) => w[`node-${e.type ?? "default"}`], pn = (e) => w[`edge-${Gt(e)}`], mn = (e) => !I.value && (e.reconnectable ?? S.edgesReconnectable), J = A({
|
|
1170
1242
|
x: 0,
|
|
1171
1243
|
y: 0,
|
|
1172
1244
|
zoom: 1,
|
|
@@ -1175,19 +1247,19 @@ var Se = [
|
|
|
1175
1247
|
pe(() => S.viewport, (e) => {
|
|
1176
1248
|
!e || e.x === J.value.x && e.y === J.value.y && e.zoom === J.value.zoom || (Y = null, J.value = { ...e });
|
|
1177
1249
|
});
|
|
1178
|
-
let
|
|
1179
|
-
function
|
|
1250
|
+
let hn = (e) => Math.min(S.maxZoom, Math.max(S.minZoom, e));
|
|
1251
|
+
function gn(e) {
|
|
1180
1252
|
(e.x !== J.value.x || e.y !== J.value.y || e.zoom !== J.value.zoom) && (J.value = e, C("update:viewport", e));
|
|
1181
1253
|
}
|
|
1182
1254
|
let Y = null;
|
|
1183
|
-
function
|
|
1255
|
+
function _n(e, t = {}) {
|
|
1184
1256
|
let n = {
|
|
1185
1257
|
x: e.x ?? J.value.x,
|
|
1186
1258
|
y: e.y ?? J.value.y,
|
|
1187
|
-
zoom:
|
|
1259
|
+
zoom: hn(e.zoom ?? J.value.zoom)
|
|
1188
1260
|
};
|
|
1189
1261
|
if (t.animate === !1 || !he.value || r() || typeof requestAnimationFrame > "u") {
|
|
1190
|
-
Y = null,
|
|
1262
|
+
Y = null, gn(n);
|
|
1191
1263
|
return;
|
|
1192
1264
|
}
|
|
1193
1265
|
let i = Y;
|
|
@@ -1209,7 +1281,7 @@ var Se = [
|
|
|
1209
1281
|
}
|
|
1210
1282
|
}, Et();
|
|
1211
1283
|
}
|
|
1212
|
-
function
|
|
1284
|
+
function vn(e) {
|
|
1213
1285
|
let t = Y;
|
|
1214
1286
|
if (!t) return !1;
|
|
1215
1287
|
let n = !0;
|
|
@@ -1225,13 +1297,13 @@ var Se = [
|
|
|
1225
1297
|
let i = r === t.z ? 5e-4 : .1;
|
|
1226
1298
|
Math.abs(r.p - r.t) < i && Math.abs(r.v) < i * 10 ? (r.p = r.t, r.v = 0) : n = !1;
|
|
1227
1299
|
}
|
|
1228
|
-
return
|
|
1300
|
+
return gn({
|
|
1229
1301
|
x: t.x.p,
|
|
1230
1302
|
y: t.y.p,
|
|
1231
1303
|
zoom: t.z.p
|
|
1232
1304
|
}), n && (Y = null), !n;
|
|
1233
1305
|
}
|
|
1234
|
-
function
|
|
1306
|
+
function yn() {
|
|
1235
1307
|
return D.value?.getBoundingClientRect() ?? {
|
|
1236
1308
|
left: 0,
|
|
1237
1309
|
top: 0,
|
|
@@ -1239,45 +1311,45 @@ var Se = [
|
|
|
1239
1311
|
height: M.value.height
|
|
1240
1312
|
};
|
|
1241
1313
|
}
|
|
1242
|
-
function
|
|
1243
|
-
let t =
|
|
1314
|
+
function bn(e) {
|
|
1315
|
+
let t = yn();
|
|
1244
1316
|
return {
|
|
1245
1317
|
x: (e.x - t.left - J.value.x) / J.value.zoom,
|
|
1246
1318
|
y: (e.y - t.top - J.value.y) / J.value.zoom
|
|
1247
1319
|
};
|
|
1248
1320
|
}
|
|
1249
|
-
function
|
|
1250
|
-
let t =
|
|
1321
|
+
function xn(e) {
|
|
1322
|
+
let t = yn();
|
|
1251
1323
|
return {
|
|
1252
1324
|
x: e.x * J.value.zoom + J.value.x + t.left,
|
|
1253
1325
|
y: e.y * J.value.zoom + J.value.y + t.top
|
|
1254
1326
|
};
|
|
1255
1327
|
}
|
|
1256
|
-
function
|
|
1257
|
-
let i =
|
|
1328
|
+
function Sn(e, t, n, r = !1) {
|
|
1329
|
+
let i = hn(e), a = Y && r ? {
|
|
1258
1330
|
x: Y.x.t,
|
|
1259
1331
|
y: Y.y.t,
|
|
1260
1332
|
zoom: Y.z.t
|
|
1261
1333
|
} : J.value, o = (t - a.x) / a.zoom, s = (n - a.y) / a.zoom;
|
|
1262
|
-
|
|
1334
|
+
_n({
|
|
1263
1335
|
x: t - o * i,
|
|
1264
1336
|
y: n - s * i,
|
|
1265
1337
|
zoom: i
|
|
1266
1338
|
}, { animate: r });
|
|
1267
1339
|
}
|
|
1268
|
-
let
|
|
1269
|
-
function
|
|
1270
|
-
let r =
|
|
1271
|
-
|
|
1340
|
+
let Cn = () => Y?.z.t ?? J.value.zoom, wn = () => Sn(Cn() * 1.25, M.value.width / 2, M.value.height / 2, !0), Tn = () => Sn(Cn() / 1.25, M.value.width / 2, M.value.height / 2, !0), En = (e, t = {}) => Sn(e, M.value.width / 2, M.value.height / 2, t.animate ?? !0);
|
|
1341
|
+
function Dn(e, t, n = {}) {
|
|
1342
|
+
let r = hn(n.zoom ?? Cn());
|
|
1343
|
+
_n({
|
|
1272
1344
|
x: M.value.width / 2 - e * r,
|
|
1273
1345
|
y: M.value.height / 2 - t * r,
|
|
1274
1346
|
zoom: r
|
|
1275
1347
|
}, { animate: n.animate ?? !0 });
|
|
1276
1348
|
}
|
|
1277
|
-
function
|
|
1349
|
+
function On(e) {
|
|
1278
1350
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
1279
1351
|
for (let a of e) {
|
|
1280
|
-
if (
|
|
1352
|
+
if (De(a)) continue;
|
|
1281
1353
|
let e = W(a), o = K(a);
|
|
1282
1354
|
t = Math.min(t, e.x), n = Math.min(n, e.y), r = Math.max(r, e.x + o.width), i = Math.max(i, e.y + o.height);
|
|
1283
1355
|
}
|
|
@@ -1288,7 +1360,7 @@ var Se = [
|
|
|
1288
1360
|
height: i - n
|
|
1289
1361
|
} : null;
|
|
1290
1362
|
}
|
|
1291
|
-
function
|
|
1363
|
+
function kn(e = {}) {
|
|
1292
1364
|
let t = e.nodes ?? N.value.map((e) => e.id), n = /* @__PURE__ */ new Map();
|
|
1293
1365
|
for (let [e, t] of H) {
|
|
1294
1366
|
let r = V.get(e);
|
|
@@ -1297,46 +1369,46 @@ var Se = [
|
|
|
1297
1369
|
y: r.y
|
|
1298
1370
|
}), r.x = t.tx, r.y = t.ty);
|
|
1299
1371
|
}
|
|
1300
|
-
let r =
|
|
1372
|
+
let r = On(t);
|
|
1301
1373
|
for (let [e, t] of n) {
|
|
1302
1374
|
let n = V.get(e);
|
|
1303
1375
|
n.x = t.x, n.y = t.y;
|
|
1304
1376
|
}
|
|
1305
1377
|
if (!r || !M.value.width || !M.value.height) return;
|
|
1306
1378
|
let i = e.padding ?? .1, a = M.value.width * (1 - 2 * i), o = M.value.height * (1 - 2 * i), s = Math.min(e.maxZoom ?? 1.5, Math.max(e.minZoom ?? S.minZoom, Math.min(a / Math.max(1, r.width), o / Math.max(1, r.height))));
|
|
1307
|
-
|
|
1308
|
-
zoom:
|
|
1379
|
+
Dn(r.x + r.width / 2, r.y + r.height / 2, {
|
|
1380
|
+
zoom: hn(s),
|
|
1309
1381
|
animate: e.animate ?? !0
|
|
1310
1382
|
});
|
|
1311
1383
|
}
|
|
1312
|
-
let
|
|
1313
|
-
function
|
|
1314
|
-
B({ nodes: [...N.value, ...
|
|
1384
|
+
let An = (e) => Array.isArray(e) ? e : [e];
|
|
1385
|
+
function jn(e) {
|
|
1386
|
+
B({ nodes: [...N.value, ...An(e)] });
|
|
1315
1387
|
}
|
|
1316
|
-
function
|
|
1317
|
-
B({ edges: [...P.value, ...
|
|
1388
|
+
function Mn(e) {
|
|
1389
|
+
B({ edges: [...P.value, ...An(e)] });
|
|
1318
1390
|
}
|
|
1319
|
-
function
|
|
1391
|
+
function Nn(e) {
|
|
1320
1392
|
B({
|
|
1321
1393
|
nodes: e.nodes,
|
|
1322
1394
|
edges: e.edges
|
|
1323
1395
|
});
|
|
1324
1396
|
}
|
|
1325
|
-
function
|
|
1397
|
+
function Pn(e, t) {
|
|
1326
1398
|
B({ nodes: N.value.map((n) => n.id === e ? typeof t == "function" ? t(n) : {
|
|
1327
1399
|
...n,
|
|
1328
1400
|
...t
|
|
1329
1401
|
} : n) });
|
|
1330
1402
|
}
|
|
1331
|
-
function
|
|
1403
|
+
function Fn(e, t) {
|
|
1332
1404
|
B({ edges: P.value.map((n) => n.id === e ? typeof t == "function" ? t(n) : {
|
|
1333
1405
|
...n,
|
|
1334
1406
|
...t
|
|
1335
1407
|
} : n) });
|
|
1336
1408
|
}
|
|
1337
|
-
function
|
|
1409
|
+
function In(e) {
|
|
1338
1410
|
let t = /* @__PURE__ */ new Set();
|
|
1339
|
-
for (let n of e.nodes ?? []) L.value.has(n) && (t.add(n),
|
|
1411
|
+
for (let n of e.nodes ?? []) L.value.has(n) && (t.add(n), ke(n).forEach((e) => t.add(e)));
|
|
1340
1412
|
let n = new Set(e.edges ?? []), r = N.value.filter((e) => t.has(e.id)), i = P.value.filter((e) => n.has(e.id) || t.has(e.source) || t.has(e.target));
|
|
1341
1413
|
if (r.length || i.length) {
|
|
1342
1414
|
if (S.beforeDelete) {
|
|
@@ -1346,46 +1418,46 @@ var Se = [
|
|
|
1346
1418
|
});
|
|
1347
1419
|
if (e instanceof Promise) {
|
|
1348
1420
|
e.then((e) => {
|
|
1349
|
-
e &&
|
|
1421
|
+
e && Ln(t, new Set(i.map((e) => e.id)));
|
|
1350
1422
|
});
|
|
1351
1423
|
return;
|
|
1352
1424
|
}
|
|
1353
1425
|
if (!e) return;
|
|
1354
1426
|
}
|
|
1355
|
-
|
|
1427
|
+
Ln(t, new Set(i.map((e) => e.id)));
|
|
1356
1428
|
}
|
|
1357
1429
|
}
|
|
1358
|
-
function
|
|
1430
|
+
function Ln(e, t) {
|
|
1359
1431
|
let n = N.value.filter((t) => e.has(t.id)), r = P.value.filter((n) => t.has(n.id) || e.has(n.source) || e.has(n.target));
|
|
1360
1432
|
if (!n.length && !r.length) return;
|
|
1361
1433
|
let i = new Set(r);
|
|
1362
1434
|
B({
|
|
1363
1435
|
nodes: n.length ? N.value.filter((t) => !e.has(t.id)) : void 0,
|
|
1364
1436
|
edges: r.length ? P.value.filter((e) => !i.has(e)) : void 0
|
|
1365
|
-
}),
|
|
1437
|
+
}), z({
|
|
1366
1438
|
nodes: F.value.nodes.filter((t) => !e.has(t)),
|
|
1367
|
-
edges: F.value.edges.filter((e) => !i.has(
|
|
1439
|
+
edges: F.value.edges.filter((e) => !i.has(R.value.get(e)))
|
|
1368
1440
|
}), C("delete", {
|
|
1369
1441
|
nodes: n,
|
|
1370
1442
|
edges: r
|
|
1371
1443
|
}), ve(T.flowDeleted.replace("{count}", String(n.length + r.length)));
|
|
1372
1444
|
}
|
|
1373
|
-
function
|
|
1374
|
-
I.value ||
|
|
1445
|
+
function Rn() {
|
|
1446
|
+
I.value || In({
|
|
1375
1447
|
nodes: F.value.nodes.filter((e) => L.value.get(e)?.deletable !== !1),
|
|
1376
|
-
edges: F.value.edges.filter((e) =>
|
|
1448
|
+
edges: F.value.edges.filter((e) => R.value.get(e)?.deletable !== !1)
|
|
1377
1449
|
});
|
|
1378
1450
|
}
|
|
1379
|
-
function
|
|
1380
|
-
|
|
1381
|
-
nodes:
|
|
1382
|
-
edges:
|
|
1451
|
+
function zn() {
|
|
1452
|
+
Fe.value && z({
|
|
1453
|
+
nodes: on.value.filter((e) => e.selectable !== !1).map((e) => e.id),
|
|
1454
|
+
edges: ln.value.filter((e) => e.selectable !== !1).map((e) => e.id)
|
|
1383
1455
|
});
|
|
1384
1456
|
}
|
|
1385
|
-
function
|
|
1457
|
+
function Bn() {
|
|
1386
1458
|
let e = new Set(F.value.nodes);
|
|
1387
|
-
for (let t of [...e])
|
|
1388
|
-
e.size
|
|
1459
|
+
for (let t of [...e]) ke(t).forEach((t) => e.add(t));
|
|
1460
|
+
return e.size ? {
|
|
1389
1461
|
nodes: N.value.filter((t) => e.has(t.id)).map((t) => {
|
|
1390
1462
|
if (t.parentId && !e.has(t.parentId)) {
|
|
1391
1463
|
let { parentId: e, extent: n, ...r } = t;
|
|
@@ -1397,45 +1469,54 @@ var Se = [
|
|
|
1397
1469
|
return t;
|
|
1398
1470
|
}),
|
|
1399
1471
|
edges: P.value.filter((t) => e.has(t.source) && e.has(t.target))
|
|
1400
|
-
}
|
|
1472
|
+
} : null;
|
|
1401
1473
|
}
|
|
1402
|
-
function
|
|
1403
|
-
|
|
1474
|
+
function Vn() {
|
|
1475
|
+
let e = Bn();
|
|
1476
|
+
e && (ot = e, st = 0);
|
|
1477
|
+
}
|
|
1478
|
+
function Hn() {
|
|
1479
|
+
I.value || (Vn(), Rn());
|
|
1480
|
+
}
|
|
1481
|
+
function Un(e) {
|
|
1482
|
+
ot?.nodes.length && !I.value && (st++, Gn(ot, e, S.gridSize * 2 * st));
|
|
1404
1483
|
}
|
|
1405
|
-
function
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1484
|
+
function Wn() {
|
|
1485
|
+
let e = Bn();
|
|
1486
|
+
e && !I.value && Gn(e, void 0, S.gridSize * 2);
|
|
1487
|
+
}
|
|
1488
|
+
function Gn(e, t, n) {
|
|
1489
|
+
let r = e.nodes.filter((t) => !t.parentId || !e.nodes.some((e) => e.id === t.parentId)), i = Math.min(...r.map((e) => e.position.x)), a = Math.min(...r.map((e) => e.position.y)), o = S.gridSize, s = (e) => S.snapToGrid && o ? Math.round(e / o) * o : e, c = s(t ? t.x - i : n), l = s(t ? t.y - a : n), u = new Map(e.nodes.map((e) => [e.id, ye("node")])), d = new Set(r.map((e) => e.id)), f = e.nodes.map((e) => ({
|
|
1409
1490
|
...e,
|
|
1410
|
-
id:
|
|
1411
|
-
parentId: e.parentId ?
|
|
1412
|
-
position:
|
|
1413
|
-
x: e.position.x +
|
|
1414
|
-
y: e.position.y +
|
|
1491
|
+
id: u.get(e.id),
|
|
1492
|
+
parentId: e.parentId ? u.get(e.parentId) ?? e.parentId : void 0,
|
|
1493
|
+
position: d.has(e.id) ? {
|
|
1494
|
+
x: e.position.x + c,
|
|
1495
|
+
y: e.position.y + l
|
|
1415
1496
|
} : e.position
|
|
1416
|
-
})),
|
|
1497
|
+
})), p = e.edges.map((e) => ({
|
|
1417
1498
|
...e,
|
|
1418
1499
|
id: ye("edge"),
|
|
1419
|
-
source:
|
|
1420
|
-
target:
|
|
1500
|
+
source: u.get(e.source),
|
|
1501
|
+
target: u.get(e.target)
|
|
1421
1502
|
}));
|
|
1422
1503
|
yt = !0, B({
|
|
1423
|
-
nodes: [...N.value, ...
|
|
1424
|
-
edges:
|
|
1425
|
-
}),
|
|
1426
|
-
nodes:
|
|
1427
|
-
edges:
|
|
1504
|
+
nodes: [...N.value, ...f],
|
|
1505
|
+
edges: p.length ? [...P.value, ...p] : void 0
|
|
1506
|
+
}), z({
|
|
1507
|
+
nodes: f.map((e) => e.id),
|
|
1508
|
+
edges: p.map((e) => e.id)
|
|
1428
1509
|
});
|
|
1429
1510
|
}
|
|
1430
|
-
let
|
|
1431
|
-
async function
|
|
1511
|
+
let Kn = () => S.layoutOptions?.direction ?? (S.direction === "vertical" ? "TB" : "LR");
|
|
1512
|
+
async function qn(e, t, n = {}) {
|
|
1432
1513
|
let r = e ?? S.layout ?? "tree", i = r === "tree" ? be : r === "layered" ? xe : r, a = new Map(N.value.filter((e) => !e.parentId).map((e) => [e.id, K(e.id)])), o = {
|
|
1433
1514
|
...S.layoutOptions,
|
|
1434
1515
|
...t
|
|
1435
1516
|
}, s = await i(N.value, P.value, {
|
|
1436
1517
|
...o,
|
|
1437
1518
|
sizes: a,
|
|
1438
|
-
direction: o.direction ??
|
|
1519
|
+
direction: o.direction ?? Kn()
|
|
1439
1520
|
}), c = !1, l = N.value.map((e) => {
|
|
1440
1521
|
let t = s[e.id];
|
|
1441
1522
|
return !t || Math.abs(t.x - e.position.x) < .5 && Math.abs(t.y - e.position.y) < .5 ? e : (c = !0, {
|
|
@@ -1448,40 +1529,40 @@ var Se = [
|
|
|
1448
1529
|
});
|
|
1449
1530
|
c && B({ nodes: l }, { history: n.history });
|
|
1450
1531
|
}
|
|
1451
|
-
let
|
|
1532
|
+
let Jn = _(() => on.value.map((e) => e.id).join(",") + "|" + ln.value.map((e) => `${e.source}>${e.target}`).join(","));
|
|
1452
1533
|
pe([
|
|
1453
|
-
|
|
1534
|
+
Jn,
|
|
1454
1535
|
() => S.direction,
|
|
1455
1536
|
() => JSON.stringify(S.layoutOptions ?? {})
|
|
1456
1537
|
], () => {
|
|
1457
1538
|
S.layout && he.value && E(async () => {
|
|
1458
|
-
await
|
|
1539
|
+
await qn(null, void 0, { history: !1 }), S.fitView && kn();
|
|
1459
1540
|
});
|
|
1460
1541
|
});
|
|
1461
|
-
let
|
|
1542
|
+
let Yn = "input, textarea, select, button, a, label, [contenteditable], [data-flow-nodrag]", X = null, Xn = null, Z = /* @__PURE__ */ new Map(), Zn = null, Q = {
|
|
1462
1543
|
x: 0,
|
|
1463
1544
|
y: 0,
|
|
1464
1545
|
inside: !1
|
|
1465
|
-
},
|
|
1466
|
-
function
|
|
1467
|
-
window.addEventListener("pointermove",
|
|
1546
|
+
}, Qn = A(null), $ = ce(null), $n = A(null), er = _(() => !!$.value), tr = ce([]), nr = A(!1), rr = ce(null);
|
|
1547
|
+
function ir() {
|
|
1548
|
+
window.addEventListener("pointermove", hr), window.addEventListener("pointerup", _r), window.addEventListener("pointercancel", vr);
|
|
1468
1549
|
}
|
|
1469
|
-
function
|
|
1470
|
-
window.removeEventListener("pointermove",
|
|
1550
|
+
function ar() {
|
|
1551
|
+
window.removeEventListener("pointermove", hr), window.removeEventListener("pointerup", _r), window.removeEventListener("pointercancel", vr), lr();
|
|
1471
1552
|
}
|
|
1472
|
-
let
|
|
1473
|
-
function
|
|
1553
|
+
let or = [];
|
|
1554
|
+
function sr(e) {
|
|
1474
1555
|
e.cancelable && e.preventDefault();
|
|
1475
1556
|
}
|
|
1476
|
-
function
|
|
1477
|
-
|
|
1478
|
-
for (let e of
|
|
1557
|
+
function cr(e) {
|
|
1558
|
+
lr(), or = e && e !== window ? [e, window] : [window];
|
|
1559
|
+
for (let e of or) e.addEventListener("touchmove", sr, { passive: !1 });
|
|
1479
1560
|
}
|
|
1480
|
-
function
|
|
1481
|
-
for (let e of
|
|
1482
|
-
|
|
1561
|
+
function lr() {
|
|
1562
|
+
for (let e of or) e.removeEventListener("touchmove", sr);
|
|
1563
|
+
or = [];
|
|
1483
1564
|
}
|
|
1484
|
-
function
|
|
1565
|
+
function ur(e) {
|
|
1485
1566
|
let t = e.target;
|
|
1486
1567
|
if (me(t)) return;
|
|
1487
1568
|
if (e.pointerType === "touch") {
|
|
@@ -1489,46 +1570,48 @@ var Se = [
|
|
|
1489
1570
|
x: e.clientX,
|
|
1490
1571
|
y: e.clientY
|
|
1491
1572
|
}), Z.size === 2) {
|
|
1492
|
-
|
|
1573
|
+
yr(), Sr();
|
|
1493
1574
|
return;
|
|
1494
1575
|
}
|
|
1495
1576
|
if (Z.size > 2) return;
|
|
1496
1577
|
}
|
|
1497
1578
|
if (X || e.button === 2) return;
|
|
1498
|
-
|
|
1499
|
-
let n = t.closest(
|
|
1500
|
-
|
|
1501
|
-
let o = t.closest("[data-flow-edge
|
|
1502
|
-
if (
|
|
1503
|
-
|
|
1579
|
+
Xn = t;
|
|
1580
|
+
let n = t.closest(Yn), r = n?.closest("[data-flow-node]");
|
|
1581
|
+
(!n || !r || n === r) && D.value?.focus({ preventScroll: !0 });
|
|
1582
|
+
let i = t.closest("[data-flow-handle]"), a = t.closest("[data-flow-reconnect]"), o = t.closest("[data-flow-node]"), s = t.closest("[data-flow-edge]");
|
|
1583
|
+
if (e.button === 1) return fr(e);
|
|
1584
|
+
let c = t.closest("[data-flow-edge-delete]");
|
|
1585
|
+
if (c) {
|
|
1586
|
+
e.preventDefault(), In({ edges: [c.dataset.flowEdgeDelete] });
|
|
1504
1587
|
return;
|
|
1505
1588
|
}
|
|
1506
|
-
let
|
|
1507
|
-
if (
|
|
1508
|
-
let t =
|
|
1589
|
+
let l = t.closest("[data-flow-segment]");
|
|
1590
|
+
if (l && s) {
|
|
1591
|
+
let t = R.value.get(s.dataset.flowEdge), n = t && an(t) ? tn(t) : null;
|
|
1509
1592
|
if (t && n) {
|
|
1510
1593
|
e.preventDefault(), X = {
|
|
1511
1594
|
kind: "reroute",
|
|
1512
1595
|
id: e.pointerId,
|
|
1513
1596
|
edge: t,
|
|
1514
|
-
segment: Number(
|
|
1597
|
+
segment: Number(l.dataset.flowSegment),
|
|
1515
1598
|
corners: n,
|
|
1516
1599
|
sx: e.clientX,
|
|
1517
1600
|
sy: e.clientY,
|
|
1518
1601
|
moved: !1
|
|
1519
|
-
},
|
|
1602
|
+
}, ir(), e.pointerType === "touch" && cr(null);
|
|
1520
1603
|
return;
|
|
1521
1604
|
}
|
|
1522
1605
|
}
|
|
1523
|
-
if (
|
|
1524
|
-
let t =
|
|
1525
|
-
if (t &&
|
|
1606
|
+
if (a && s) {
|
|
1607
|
+
let t = R.value.get(s.dataset.flowEdge);
|
|
1608
|
+
if (t && mn(t)) return e.preventDefault(), qr(e, t, a.dataset.flowReconnect);
|
|
1526
1609
|
}
|
|
1527
|
-
if (
|
|
1528
|
-
if (e.preventDefault(), e.stopPropagation(),
|
|
1529
|
-
let t =
|
|
1530
|
-
if (
|
|
1531
|
-
|
|
1610
|
+
if (i && o && i.dataset.flowConnectable === "true" && Le.value) {
|
|
1611
|
+
if (e.preventDefault(), e.stopPropagation(), i.dataset.flowHandle === "target") {
|
|
1612
|
+
let t = o.dataset.flowNode, n = i.dataset.handleId || null, r = ln.value.filter((e) => e.target === t && (e.targetHandle ?? null) === n && mn(e)), a = r[r.length - 1];
|
|
1613
|
+
if (a) {
|
|
1614
|
+
qr(e, a, "target");
|
|
1532
1615
|
let n = X;
|
|
1533
1616
|
n?.kind === "connect" && (n.tap = {
|
|
1534
1617
|
x: e.clientX,
|
|
@@ -1539,11 +1622,11 @@ var Se = [
|
|
|
1539
1622
|
return;
|
|
1540
1623
|
}
|
|
1541
1624
|
}
|
|
1542
|
-
return
|
|
1625
|
+
return Vr(e, o.dataset.flowNode, i.dataset.handleId || null, i.dataset.flowHandle);
|
|
1543
1626
|
}
|
|
1544
|
-
if (
|
|
1545
|
-
if (
|
|
1546
|
-
let t = e.pointerType === "touch", n =
|
|
1627
|
+
if (o) return t.closest(Yn) && t.closest(Yn) !== o ? void 0 : mr(e, o.dataset.flowNode);
|
|
1628
|
+
if (s) {
|
|
1629
|
+
let t = e.pointerType === "touch", n = R.value.get(s.dataset.flowEdge), r = n && Me.value && (!t || je.value.has(n.id)) ? n : void 0;
|
|
1547
1630
|
r && e.preventDefault(), X = {
|
|
1548
1631
|
kind: "pan",
|
|
1549
1632
|
id: e.pointerId,
|
|
@@ -1555,14 +1638,14 @@ var Se = [
|
|
|
1555
1638
|
target: "pane",
|
|
1556
1639
|
touch: t,
|
|
1557
1640
|
branch: r
|
|
1558
|
-
},
|
|
1641
|
+
}, ir();
|
|
1559
1642
|
return;
|
|
1560
1643
|
}
|
|
1561
|
-
if ((e.shiftKey || S.selectionOnDrag && e.pointerType !== "touch" || !S.panOnDrag) &&
|
|
1562
|
-
|
|
1644
|
+
if ((e.shiftKey || S.selectionOnDrag && e.pointerType !== "touch" || !S.panOnDrag) && Fe.value) return pr(e);
|
|
1645
|
+
fr(e);
|
|
1563
1646
|
}
|
|
1564
|
-
let
|
|
1565
|
-
function
|
|
1647
|
+
let dr;
|
|
1648
|
+
function fr(e) {
|
|
1566
1649
|
let t = e.pointerType === "touch", n = {
|
|
1567
1650
|
kind: "pan",
|
|
1568
1651
|
id: e.pointerId,
|
|
@@ -1574,9 +1657,9 @@ var Se = [
|
|
|
1574
1657
|
target: "pane",
|
|
1575
1658
|
touch: t
|
|
1576
1659
|
};
|
|
1577
|
-
X = n, Y = null,
|
|
1660
|
+
X = n, Y = null, ir(), clearTimeout(dr), t && Fe.value && (dr = setTimeout(() => {
|
|
1578
1661
|
if (X !== n || n.moved) return;
|
|
1579
|
-
let e =
|
|
1662
|
+
let e = yn(), t = n.sx - e.left, r = n.sy - e.top;
|
|
1580
1663
|
X = {
|
|
1581
1664
|
kind: "marquee",
|
|
1582
1665
|
id: n.id,
|
|
@@ -1586,7 +1669,7 @@ var Se = [
|
|
|
1586
1669
|
y: r,
|
|
1587
1670
|
additive: [...F.value.nodes],
|
|
1588
1671
|
moved: !0
|
|
1589
|
-
},
|
|
1672
|
+
}, Qn.value = {
|
|
1590
1673
|
x: t,
|
|
1591
1674
|
y: r,
|
|
1592
1675
|
width: 0,
|
|
@@ -1594,8 +1677,8 @@ var Se = [
|
|
|
1594
1677
|
}, navigator.vibrate?.(10);
|
|
1595
1678
|
}, 450));
|
|
1596
1679
|
}
|
|
1597
|
-
function
|
|
1598
|
-
let t =
|
|
1680
|
+
function pr(e) {
|
|
1681
|
+
let t = yn();
|
|
1599
1682
|
X = {
|
|
1600
1683
|
kind: "marquee",
|
|
1601
1684
|
id: e.pointerId,
|
|
@@ -1605,17 +1688,17 @@ var Se = [
|
|
|
1605
1688
|
y: e.clientY - t.top,
|
|
1606
1689
|
additive: e.shiftKey ? [...F.value.nodes] : [],
|
|
1607
1690
|
moved: !1
|
|
1608
|
-
},
|
|
1691
|
+
}, ir();
|
|
1609
1692
|
}
|
|
1610
|
-
function
|
|
1693
|
+
function mr(e, t) {
|
|
1611
1694
|
let n = L.value.get(t);
|
|
1612
1695
|
if (!n) return;
|
|
1613
1696
|
let r = !1, i;
|
|
1614
|
-
if (
|
|
1697
|
+
if (Fe.value && n.selectable !== !1) {
|
|
1615
1698
|
if (e.shiftKey || e.metaKey || e.ctrlKey) {
|
|
1616
|
-
let e =
|
|
1617
|
-
if (
|
|
1618
|
-
} else
|
|
1699
|
+
let e = Ae.value.has(t);
|
|
1700
|
+
if (z({ nodes: e ? F.value.nodes.filter((e) => e !== t) : [...F.value.nodes, t] }), e) return;
|
|
1701
|
+
} else Ae.value.has(t) ? r = !0 : i = () => z({
|
|
1619
1702
|
nodes: [t],
|
|
1620
1703
|
edges: []
|
|
1621
1704
|
});
|
|
@@ -1633,32 +1716,32 @@ var Se = [
|
|
|
1633
1716
|
moved: !1,
|
|
1634
1717
|
reselect: r,
|
|
1635
1718
|
select: a ? i : void 0
|
|
1636
|
-
},
|
|
1719
|
+
}, ir();
|
|
1637
1720
|
}
|
|
1638
|
-
function
|
|
1721
|
+
function hr(e) {
|
|
1639
1722
|
if (Q.x = e.clientX, Q.y = e.clientY, e.pointerType === "touch" && Z.has(e.pointerId) && (Z.set(e.pointerId, {
|
|
1640
1723
|
x: e.clientX,
|
|
1641
1724
|
y: e.clientY
|
|
1642
|
-
}),
|
|
1725
|
+
}), Zn)) return wr();
|
|
1643
1726
|
let t = X;
|
|
1644
1727
|
if (t && t.kind !== "pinch" && t.id === e.pointerId) {
|
|
1645
1728
|
if (t.kind === "pan") {
|
|
1646
1729
|
let n = e.clientX - t.sx, r = e.clientY - t.sy;
|
|
1647
1730
|
if (!t.moved && Math.hypot(n, r) < (t.touch ? 6 : 4)) return;
|
|
1648
|
-
if (t.branch && !t.moved) return
|
|
1649
|
-
t.moved = !0, clearTimeout(
|
|
1731
|
+
if (t.branch && !t.moved) return Hr(t, t.branch, e);
|
|
1732
|
+
t.moved = !0, clearTimeout(dr), nr.value = !0, gn({
|
|
1650
1733
|
x: t.vx + n,
|
|
1651
1734
|
y: t.vy + r,
|
|
1652
1735
|
zoom: J.value.zoom
|
|
1653
1736
|
});
|
|
1654
1737
|
} else if (t.kind === "marquee") {
|
|
1655
|
-
let n =
|
|
1738
|
+
let n = yn();
|
|
1656
1739
|
if (t.x = e.clientX - n.left, t.y = e.clientY - n.top, !t.moved && Math.hypot(t.x - t.sx, t.y - t.sy) < 4) return;
|
|
1657
|
-
t.moved = !0,
|
|
1740
|
+
t.moved = !0, Or(t);
|
|
1658
1741
|
} else if (t.kind === "node") {
|
|
1659
1742
|
if (!t.active) {
|
|
1660
1743
|
if (Math.hypot(e.clientX - t.sx, e.clientY - t.sy) < (t.touch ? 6 : 4)) return;
|
|
1661
|
-
if (!Ie.value || !
|
|
1744
|
+
if (!Ie.value || !kr(t, e)) {
|
|
1662
1745
|
X = {
|
|
1663
1746
|
kind: "pan",
|
|
1664
1747
|
id: t.id,
|
|
@@ -1672,18 +1755,18 @@ var Se = [
|
|
|
1672
1755
|
return;
|
|
1673
1756
|
}
|
|
1674
1757
|
}
|
|
1675
|
-
t.moved = !0,
|
|
1676
|
-
} else if (t.kind === "connect") t.moved = !0,
|
|
1758
|
+
t.moved = !0, jr(t, e.clientX, e.clientY), Ir(t), C("node-drag", [...t.starts.keys()].map((e) => L.value.get(e)), e), Et();
|
|
1759
|
+
} else if (t.kind === "connect") t.moved = !0, Qr(t, e.clientX, e.clientY), Et();
|
|
1677
1760
|
else if (t.kind === "reroute") {
|
|
1678
1761
|
if (!t.moved && Math.hypot(e.clientX - t.sx, e.clientY - t.sy) < (e.pointerType === "touch" ? 6 : 4)) return;
|
|
1679
|
-
t.moved = !0,
|
|
1762
|
+
t.moved = !0, rr.value = {
|
|
1680
1763
|
id: t.edge.id,
|
|
1681
|
-
route:
|
|
1764
|
+
route: gr(t, e)
|
|
1682
1765
|
};
|
|
1683
1766
|
}
|
|
1684
1767
|
}
|
|
1685
1768
|
}
|
|
1686
|
-
function
|
|
1769
|
+
function gr(e, t) {
|
|
1687
1770
|
let n = e.corners.map((e) => [e[0], e[1]]), r = e.segment, i = n[r], a = n[r + 1], o = Math.abs(i[1] - a[1]) < .01, s = +!!o, l = S.gridSize || 20, u = (e) => S.snapToGrid ? Math.round(e / l) * l : Math.round(e), d = (o ? t.clientY - e.sy : t.clientX - e.sx) / J.value.zoom, f = u(i[s] + d), p = r === 0, m = r === n.length - 2, h = s === 1 ? 0 : 1, g = Math.sign(a[h] - i[h]) || 1, _ = Math.abs(a[h] - i[h]), v = Math.min(l, _ / 3), y = (e, t) => s === 1 ? [e[0], t] : [t, e[1]], b = (e, t) => h === 0 ? [e[0] + t, e[1]] : [e[0], e[1] + t], x = [];
|
|
1688
1771
|
if (p) {
|
|
1689
1772
|
let e = b(i, g * v);
|
|
@@ -1700,31 +1783,31 @@ var Se = [
|
|
|
1700
1783
|
], w = $t(e.edge);
|
|
1701
1784
|
return c(C, w?.s.position, w?.t.position);
|
|
1702
1785
|
}
|
|
1703
|
-
function
|
|
1704
|
-
if (Z.delete(e.pointerId),
|
|
1705
|
-
Z.size < 2 &&
|
|
1786
|
+
function _r(e) {
|
|
1787
|
+
if (Z.delete(e.pointerId), Zn) {
|
|
1788
|
+
Z.size < 2 && Cr();
|
|
1706
1789
|
return;
|
|
1707
1790
|
}
|
|
1708
1791
|
let t = X;
|
|
1709
1792
|
if (t && t.kind !== "pinch" && t.id === e.pointerId) {
|
|
1710
|
-
if (X = null, clearTimeout(
|
|
1711
|
-
else if (t.kind === "marquee")
|
|
1793
|
+
if (X = null, clearTimeout(dr), ar(), nr.value = !1, t.kind === "pan") t.moved || br(e);
|
|
1794
|
+
else if (t.kind === "marquee") Qn.value = null, t.moved || br(e);
|
|
1712
1795
|
else if (t.kind === "node") {
|
|
1713
|
-
if (t.active)
|
|
1796
|
+
if (t.active) zr(t, e);
|
|
1714
1797
|
else {
|
|
1715
|
-
t.select?.(), t.reselect && !e.shiftKey &&
|
|
1798
|
+
t.select?.(), t.reselect && !e.shiftKey && z({
|
|
1716
1799
|
nodes: [t.nodeId],
|
|
1717
1800
|
edges: []
|
|
1718
1801
|
});
|
|
1719
1802
|
let n = L.value.get(t.nodeId);
|
|
1720
1803
|
n && C("node-click", n, e);
|
|
1721
1804
|
}
|
|
1722
|
-
} else if (t.kind === "connect")
|
|
1805
|
+
} else if (t.kind === "connect") $r(t, e);
|
|
1723
1806
|
else if (t.kind === "reroute") {
|
|
1724
|
-
let e =
|
|
1725
|
-
if (
|
|
1726
|
-
let n =
|
|
1727
|
-
n && (
|
|
1807
|
+
let e = rr.value;
|
|
1808
|
+
if (rr.value = null, t.moved && e) {
|
|
1809
|
+
let n = R.value.get(t.edge.id);
|
|
1810
|
+
n && (Fn(n.id, { route: e.route }), C("reroute", {
|
|
1728
1811
|
...n,
|
|
1729
1812
|
route: e.route
|
|
1730
1813
|
}));
|
|
@@ -1732,61 +1815,61 @@ var Se = [
|
|
|
1732
1815
|
}
|
|
1733
1816
|
}
|
|
1734
1817
|
}
|
|
1735
|
-
function
|
|
1736
|
-
if (clearTimeout(
|
|
1737
|
-
Z.size < 2 &&
|
|
1818
|
+
function vr(e) {
|
|
1819
|
+
if (clearTimeout(dr), Z.delete(e.pointerId), Zn) {
|
|
1820
|
+
Z.size < 2 && Cr();
|
|
1738
1821
|
return;
|
|
1739
1822
|
}
|
|
1740
|
-
|
|
1823
|
+
yr();
|
|
1741
1824
|
}
|
|
1742
|
-
function
|
|
1825
|
+
function yr() {
|
|
1743
1826
|
let e = X;
|
|
1744
|
-
if (X = null,
|
|
1827
|
+
if (X = null, ar(), nr.value = !1, Qn.value = null, e?.kind === "node" && e.active) {
|
|
1745
1828
|
for (let [t, n] of e.starts) {
|
|
1746
1829
|
let e = H.get(t);
|
|
1747
1830
|
e && (e.tx = n.x, e.ty = n.y);
|
|
1748
1831
|
}
|
|
1749
|
-
vt.value = /* @__PURE__ */ new Set(), G.clear(),
|
|
1832
|
+
vt.value = /* @__PURE__ */ new Set(), G.clear(), tr.value = [], Pr.value = null, Fr = null, Et();
|
|
1750
1833
|
}
|
|
1751
|
-
e?.kind === "connect" && ($.value = null,
|
|
1834
|
+
e?.kind === "connect" && ($.value = null, $n.value = null), e?.kind === "reroute" && (rr.value = null);
|
|
1752
1835
|
}
|
|
1753
|
-
function
|
|
1754
|
-
let t = (
|
|
1836
|
+
function br(e) {
|
|
1837
|
+
let t = (Xn ?? e.target).closest("[data-flow-edge]"), n = t ? R.value.get(t.dataset.flowEdge) : void 0;
|
|
1755
1838
|
if (n) {
|
|
1756
|
-
|
|
1839
|
+
Fe.value && n.selectable !== !1 && (e.shiftKey ? z({ edges: je.value.has(n.id) ? F.value.edges.filter((e) => e !== n.id) : [...F.value.edges, n.id] }) : z({
|
|
1757
1840
|
nodes: [],
|
|
1758
1841
|
edges: [n.id]
|
|
1759
1842
|
})), C("edge-click", n, e);
|
|
1760
1843
|
return;
|
|
1761
1844
|
}
|
|
1762
|
-
e.shiftKey ||
|
|
1845
|
+
e.shiftKey || z(lt()), C("pane-click", bn({
|
|
1763
1846
|
x: e.clientX,
|
|
1764
1847
|
y: e.clientY
|
|
1765
1848
|
}), e);
|
|
1766
1849
|
}
|
|
1767
|
-
function
|
|
1768
|
-
let [e, t] = [...Z.values()], n =
|
|
1850
|
+
function xr() {
|
|
1851
|
+
let [e, t] = [...Z.values()], n = yn();
|
|
1769
1852
|
return {
|
|
1770
1853
|
dist: Math.hypot(e.x - t.x, e.y - t.y) || 1,
|
|
1771
1854
|
cx: (e.x + t.x) / 2 - n.left,
|
|
1772
1855
|
cy: (e.y + t.y) / 2 - n.top
|
|
1773
1856
|
};
|
|
1774
1857
|
}
|
|
1775
|
-
function
|
|
1776
|
-
clearTimeout(
|
|
1777
|
-
let e =
|
|
1778
|
-
Y = null, X = { kind: "pinch" },
|
|
1858
|
+
function Sr() {
|
|
1859
|
+
clearTimeout(dr);
|
|
1860
|
+
let e = xr();
|
|
1861
|
+
Y = null, X = { kind: "pinch" }, Zn = {
|
|
1779
1862
|
...e,
|
|
1780
1863
|
zoom: J.value.zoom,
|
|
1781
1864
|
fx: (e.cx - J.value.x) / J.value.zoom,
|
|
1782
1865
|
fy: (e.cy - J.value.y) / J.value.zoom
|
|
1783
|
-
},
|
|
1866
|
+
}, ir();
|
|
1784
1867
|
}
|
|
1785
|
-
function
|
|
1786
|
-
|
|
1868
|
+
function Cr() {
|
|
1869
|
+
Zn = null;
|
|
1787
1870
|
let e = [...Z][0];
|
|
1788
1871
|
if (!e) {
|
|
1789
|
-
X = null,
|
|
1872
|
+
X = null, ar();
|
|
1790
1873
|
return;
|
|
1791
1874
|
}
|
|
1792
1875
|
let [t, n] = e;
|
|
@@ -1802,33 +1885,33 @@ var Se = [
|
|
|
1802
1885
|
touch: !0
|
|
1803
1886
|
};
|
|
1804
1887
|
}
|
|
1805
|
-
function
|
|
1806
|
-
if (!
|
|
1807
|
-
let e =
|
|
1808
|
-
|
|
1809
|
-
x: e.cx -
|
|
1810
|
-
y: e.cy -
|
|
1888
|
+
function wr() {
|
|
1889
|
+
if (!Zn || Z.size < 2) return;
|
|
1890
|
+
let e = xr(), t = hn(Zn.zoom * e.dist / Zn.dist);
|
|
1891
|
+
gn({
|
|
1892
|
+
x: e.cx - Zn.fx * t,
|
|
1893
|
+
y: e.cy - Zn.fy * t,
|
|
1811
1894
|
zoom: t
|
|
1812
1895
|
});
|
|
1813
1896
|
}
|
|
1814
|
-
function
|
|
1897
|
+
function Tr(e) {
|
|
1815
1898
|
let t = e.target;
|
|
1816
1899
|
if (me(t) || t.closest("[data-flow-nowheel]")) return;
|
|
1817
1900
|
e.preventDefault();
|
|
1818
|
-
let n = e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? M.value.height : 1, r =
|
|
1901
|
+
let n = e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? M.value.height : 1, r = yn();
|
|
1819
1902
|
if (e.ctrlKey || e.metaKey || S.wheel === "zoom") {
|
|
1820
1903
|
let t = Math.max(-50, Math.min(50, e.deltaY * n));
|
|
1821
|
-
|
|
1904
|
+
Sn(J.value.zoom * Math.exp(-t * .01), e.clientX - r.left, e.clientY - r.top), Y = null;
|
|
1822
1905
|
return;
|
|
1823
1906
|
}
|
|
1824
1907
|
let i = (e.shiftKey && !e.deltaX ? e.deltaY : e.deltaX) * n, a = (e.shiftKey && !e.deltaX ? 0 : e.deltaY) * n;
|
|
1825
|
-
Y = null,
|
|
1908
|
+
Y = null, gn({
|
|
1826
1909
|
x: J.value.x - i,
|
|
1827
1910
|
y: J.value.y - a,
|
|
1828
1911
|
zoom: J.value.zoom
|
|
1829
1912
|
});
|
|
1830
1913
|
}
|
|
1831
|
-
function
|
|
1914
|
+
function Er(e) {
|
|
1832
1915
|
let t = e.target;
|
|
1833
1916
|
if (me(t)) return;
|
|
1834
1917
|
let n = t.closest("[data-flow-node]"), r = t.closest("[data-flow-edge]");
|
|
@@ -1836,49 +1919,49 @@ var Se = [
|
|
|
1836
1919
|
let t = L.value.get(n.dataset.flowNode);
|
|
1837
1920
|
t && C("node-dblclick", t, e);
|
|
1838
1921
|
} else if (r) {
|
|
1839
|
-
let t =
|
|
1922
|
+
let t = R.value.get(r.dataset.flowEdge);
|
|
1840
1923
|
t && C("edge-dblclick", t, e);
|
|
1841
|
-
} else if (C("pane-dblclick",
|
|
1924
|
+
} else if (C("pane-dblclick", bn({
|
|
1842
1925
|
x: e.clientX,
|
|
1843
1926
|
y: e.clientY
|
|
1844
1927
|
}), e), S.zoomOnDoubleClick) {
|
|
1845
|
-
let t =
|
|
1846
|
-
|
|
1928
|
+
let t = yn();
|
|
1929
|
+
Sn(Cn() * 2, e.clientX - t.left, e.clientY - t.top, !0);
|
|
1847
1930
|
}
|
|
1848
1931
|
}
|
|
1849
|
-
function
|
|
1932
|
+
function Dr(e) {
|
|
1850
1933
|
let t = e.target;
|
|
1851
1934
|
if (me(t)) return;
|
|
1852
1935
|
!S.nativeContextMenu && !t.closest("input, textarea, select, [contenteditable]") && e.preventDefault();
|
|
1853
|
-
let n = t.closest("[data-flow-node]"), r = t.closest("[data-flow-edge]"), i = n ? L.value.get(n.dataset.flowNode) : void 0, a = r ?
|
|
1854
|
-
i ? C("node-contextmenu", i, e) : a ? C("edge-contextmenu", a, e) : C("pane-contextmenu",
|
|
1936
|
+
let n = t.closest("[data-flow-node]"), r = t.closest("[data-flow-edge]"), i = n ? L.value.get(n.dataset.flowNode) : void 0, a = r ? R.value.get(r.dataset.flowEdge) : void 0;
|
|
1937
|
+
i ? C("node-contextmenu", i, e) : a ? C("edge-contextmenu", a, e) : C("pane-contextmenu", bn({
|
|
1855
1938
|
x: e.clientX,
|
|
1856
1939
|
y: e.clientY
|
|
1857
1940
|
}), e);
|
|
1858
1941
|
}
|
|
1859
|
-
function
|
|
1942
|
+
function Or(e) {
|
|
1860
1943
|
let t = Math.min(e.sx, e.x), n = Math.min(e.sy, e.y), r = Math.abs(e.x - e.sx), i = Math.abs(e.y - e.sy);
|
|
1861
|
-
|
|
1944
|
+
Qn.value = {
|
|
1862
1945
|
x: t,
|
|
1863
1946
|
y: n,
|
|
1864
1947
|
width: r,
|
|
1865
1948
|
height: i
|
|
1866
1949
|
};
|
|
1867
|
-
let a = J.value.zoom, o = (t - J.value.x) / a, s = (n - J.value.y) / a, c = o + r / a, l = s + i / a, u =
|
|
1950
|
+
let a = J.value.zoom, o = (t - J.value.x) / a, s = (n - J.value.y) / a, c = o + r / a, l = s + i / a, u = on.value.filter((e) => {
|
|
1868
1951
|
if (e.selectable === !1) return !1;
|
|
1869
1952
|
let t = W(e.id), n = K(e.id);
|
|
1870
1953
|
return t.x < c && t.x + n.width > o && t.y < l && t.y + n.height > s;
|
|
1871
1954
|
}).map((e) => e.id), d = [.../* @__PURE__ */ new Set([...e.additive, ...u])], f = new Set(d);
|
|
1872
|
-
|
|
1955
|
+
z({
|
|
1873
1956
|
nodes: d,
|
|
1874
|
-
edges:
|
|
1957
|
+
edges: ln.value.filter((e) => e.selectable !== !1 && f.has(e.source) && f.has(e.target)).map((e) => e.id)
|
|
1875
1958
|
});
|
|
1876
1959
|
}
|
|
1877
|
-
function
|
|
1960
|
+
function kr(e, t) {
|
|
1878
1961
|
e.select?.(), e.select = void 0;
|
|
1879
|
-
let n =
|
|
1962
|
+
let n = Ae.value.has(e.nodeId) ? F.value.nodes : [e.nodeId], r = n.filter((e) => {
|
|
1880
1963
|
let t = L.value.get(e);
|
|
1881
|
-
return t && t.draggable !== !1 && !
|
|
1964
|
+
return t && t.draggable !== !1 && !De(e) && !Te(e).some((e) => n.includes(e));
|
|
1882
1965
|
});
|
|
1883
1966
|
if (!r.includes(e.nodeId) && L.value.get(e.nodeId)?.draggable === !1 || !r.length) return !1;
|
|
1884
1967
|
for (let t of r) {
|
|
@@ -1889,12 +1972,12 @@ var Se = [
|
|
|
1889
1972
|
});
|
|
1890
1973
|
}
|
|
1891
1974
|
e.active = !0;
|
|
1892
|
-
for (let e of r) for (let t of
|
|
1975
|
+
for (let e of r) for (let t of Te(e)) G.has(t) || G.set(t, K(t));
|
|
1893
1976
|
return vt.value = new Set(r), document.body.style.userSelect = "none", C("node-drag-start", r.map((e) => L.value.get(e)), t), !0;
|
|
1894
1977
|
}
|
|
1895
|
-
function
|
|
1978
|
+
function Ar(e, t) {
|
|
1896
1979
|
if (!L.value.has(e) || I.value) return;
|
|
1897
|
-
X &&
|
|
1980
|
+
X && yr(), H.has(e) || xt(), Fe.value && z({
|
|
1898
1981
|
nodes: [e],
|
|
1899
1982
|
edges: []
|
|
1900
1983
|
});
|
|
@@ -1910,22 +1993,22 @@ var Se = [
|
|
|
1910
1993
|
moved: !0,
|
|
1911
1994
|
reselect: !1
|
|
1912
1995
|
};
|
|
1913
|
-
X = n, Q.x = t.clientX, Q.y = t.clientY,
|
|
1996
|
+
X = n, Q.x = t.clientX, Q.y = t.clientY, ir(), n.touch && cr(t.target), kr(n, t) || (X = null, ar());
|
|
1914
1997
|
}
|
|
1915
|
-
function
|
|
1998
|
+
function jr(e, t, n) {
|
|
1916
1999
|
let r = J.value.zoom, i = (t - e.sx) / r, a = (n - e.sy) / r, o = e.starts.get(e.nodeId) ?? [...e.starts.values()][0], s = e.starts.has(e.nodeId) ? e.nodeId : [...e.starts.keys()][0];
|
|
1917
2000
|
if (S.snapToGrid) {
|
|
1918
2001
|
let e = S.gridSize, t = L.value.get(s)?.gridOffset ?? {
|
|
1919
2002
|
x: 0,
|
|
1920
2003
|
y: 0
|
|
1921
2004
|
};
|
|
1922
|
-
i = Math.round((o.x + t.x + i) / e) * e - o.x - t.x, a = Math.round((o.y + t.y + a) / e) * e - o.y - t.y,
|
|
2005
|
+
i = Math.round((o.x + t.x + i) / e) * e - o.x - t.x, a = Math.round((o.y + t.y + a) / e) * e - o.y - t.y, tr.value = [];
|
|
1923
2006
|
} else if (S.guides && e.starts.size === 1) {
|
|
1924
|
-
let e =
|
|
2007
|
+
let e = Mr(s, o, i, a);
|
|
1925
2008
|
i = e.dx, a = e.dy;
|
|
1926
2009
|
}
|
|
1927
2010
|
for (let [t, n] of e.starts) {
|
|
1928
|
-
let e = n.x + i, r = n.y + a, o = L.value.get(t), s =
|
|
2011
|
+
let e = n.x + i, r = n.y + a, o = L.value.get(t), s = we(t);
|
|
1929
2012
|
if (o.extent === "parent" && s) {
|
|
1930
2013
|
let n = K(s), i = K(t);
|
|
1931
2014
|
e = Math.max(0, Math.min(n.width - i.width, e)), r = Math.max(0, Math.min(n.height - i.height, r));
|
|
@@ -1936,8 +2019,8 @@ var Se = [
|
|
|
1936
2019
|
l.x = e, l.y = r;
|
|
1937
2020
|
}
|
|
1938
2021
|
}
|
|
1939
|
-
function
|
|
1940
|
-
let i =
|
|
2022
|
+
function Mr(e, t, n, r) {
|
|
2023
|
+
let i = we(e) ? W(we(e)) : {
|
|
1941
2024
|
x: 0,
|
|
1942
2025
|
y: 0
|
|
1943
2026
|
}, a = K(e), o = i.x + t.x + n, s = i.y + t.y + r, c = [
|
|
@@ -1950,10 +2033,10 @@ var Se = [
|
|
|
1950
2033
|
s + a.height
|
|
1951
2034
|
], u = 6 / J.value.zoom, d = null, f = null, p = /* @__PURE__ */ new Set([
|
|
1952
2035
|
e,
|
|
1953
|
-
...
|
|
1954
|
-
...
|
|
2036
|
+
...ke(e),
|
|
2037
|
+
...Te(e)
|
|
1955
2038
|
]);
|
|
1956
|
-
for (let e of
|
|
2039
|
+
for (let e of on.value) {
|
|
1957
2040
|
if (p.has(e.id)) continue;
|
|
1958
2041
|
let t = W(e.id), n = K(e.id), r = [
|
|
1959
2042
|
t.x,
|
|
@@ -2001,29 +2084,29 @@ var Se = [
|
|
|
2001
2084
|
to: Math.max(e + a.width, f.box.x2)
|
|
2002
2085
|
});
|
|
2003
2086
|
}
|
|
2004
|
-
return
|
|
2087
|
+
return tr.value = m, {
|
|
2005
2088
|
dx: n,
|
|
2006
2089
|
dy: r
|
|
2007
2090
|
};
|
|
2008
2091
|
}
|
|
2009
|
-
function
|
|
2092
|
+
function Nr(e) {
|
|
2010
2093
|
let t, n = /* @__PURE__ */ new Set();
|
|
2011
2094
|
return typeof e == "string" ? (t = {
|
|
2012
2095
|
...W(e),
|
|
2013
2096
|
...K(e)
|
|
2014
|
-
}, n.add(e),
|
|
2097
|
+
}, n.add(e), ke(e).forEach((e) => n.add(e)), Te(e).forEach((e) => n.add(e))) : t = e, on.value.filter((e) => {
|
|
2015
2098
|
if (n.has(e.id) || e.type === "group") return !1;
|
|
2016
2099
|
let r = W(e.id), i = K(e.id);
|
|
2017
2100
|
return r.x < t.x + t.width && r.x + i.width > t.x && r.y < t.y + t.height && r.y + i.height > t.y;
|
|
2018
2101
|
});
|
|
2019
2102
|
}
|
|
2020
|
-
let
|
|
2021
|
-
function
|
|
2022
|
-
|
|
2023
|
-
let t =
|
|
2024
|
-
|
|
2103
|
+
let Pr = A(null), Fr = null;
|
|
2104
|
+
function Ir(e) {
|
|
2105
|
+
Fr = null;
|
|
2106
|
+
let t = Lr(e);
|
|
2107
|
+
Fr = t, Pr.value = t?.edge.id ?? null;
|
|
2025
2108
|
}
|
|
2026
|
-
function
|
|
2109
|
+
function Lr(e) {
|
|
2027
2110
|
if (!S.insertOnEdge || e.starts.size !== 1 || !Le.value) return null;
|
|
2028
2111
|
let t = [...e.starts.keys()][0], n = L.value.get(t);
|
|
2029
2112
|
if (!n || n.type === "group" || n.connectable === !1 || n.insertable === !1 || P.value.some((e) => e.source === t || e.target === t)) return null;
|
|
@@ -2034,7 +2117,7 @@ var Se = [
|
|
|
2034
2117
|
r = e?.id ?? null, i = t?.id ?? null;
|
|
2035
2118
|
}
|
|
2036
2119
|
let o = W(t), s = K(t), c = o.x + s.width / 2, u = o.y + s.height / 2, f = Math.max(8 / J.value.zoom, Math.min(s.width, s.height) / 2), p = null;
|
|
2037
|
-
for (let e of
|
|
2120
|
+
for (let e of ln.value) {
|
|
2038
2121
|
if (e.deletable === !1) continue;
|
|
2039
2122
|
let t = en(e);
|
|
2040
2123
|
if (!t) continue;
|
|
@@ -2056,13 +2139,13 @@ var Se = [
|
|
|
2056
2139
|
target: m.target,
|
|
2057
2140
|
targetHandle: m.targetHandle ?? null
|
|
2058
2141
|
};
|
|
2059
|
-
return !
|
|
2142
|
+
return !Xr(h) || !Xr(g) ? null : {
|
|
2060
2143
|
node: t,
|
|
2061
2144
|
edge: m,
|
|
2062
2145
|
connections: [h, g]
|
|
2063
2146
|
};
|
|
2064
2147
|
}
|
|
2065
|
-
function
|
|
2148
|
+
function Rr(e, t) {
|
|
2066
2149
|
let n = new Map(e.map((e) => [e.id, e])), r = n.get(t.edge.source), i = n.get(t.node), a = n.get(t.edge.target);
|
|
2067
2150
|
if (!r || !i || !a || r.parentId !== i.parentId || i.parentId !== a.parentId) return e;
|
|
2068
2151
|
let o = S.direction !== "vertical", s = o ? "x" : "y", c = (e) => o ? K(e).width : K(e).height, l = r.position[s] + c(r.id);
|
|
@@ -2093,10 +2176,10 @@ var Se = [
|
|
|
2093
2176
|
}
|
|
2094
2177
|
} : e);
|
|
2095
2178
|
}
|
|
2096
|
-
function
|
|
2179
|
+
function zr(e, t) {
|
|
2097
2180
|
document.body.style.userSelect = "";
|
|
2098
|
-
let n =
|
|
2099
|
-
|
|
2181
|
+
let n = Fr;
|
|
2182
|
+
Fr = null, Pr.value = null;
|
|
2100
2183
|
let r;
|
|
2101
2184
|
if (n && S.autoConnect) {
|
|
2102
2185
|
let { id: e, label: t, source: i, target: a, sourceHandle: o, targetHandle: s, ...c } = n.edge;
|
|
@@ -2106,23 +2189,23 @@ var Se = [
|
|
|
2106
2189
|
...e
|
|
2107
2190
|
}));
|
|
2108
2191
|
}
|
|
2109
|
-
|
|
2192
|
+
tr.value = [];
|
|
2110
2193
|
let i = [...e.starts.keys()].filter((t) => {
|
|
2111
2194
|
let n = H.get(t), r = e.starts.get(t);
|
|
2112
2195
|
return n.tx !== r.x || n.ty !== r.y;
|
|
2113
2196
|
}), a = /* @__PURE__ */ new Map();
|
|
2114
2197
|
if (S.dropIntoGroups) {
|
|
2115
|
-
let n =
|
|
2198
|
+
let n = bn({
|
|
2116
2199
|
x: t.clientX,
|
|
2117
2200
|
y: t.clientY
|
|
2118
2201
|
});
|
|
2119
2202
|
for (let t of e.starts.keys()) {
|
|
2120
2203
|
let e = L.value.get(t);
|
|
2121
2204
|
if (e.type === "group") continue;
|
|
2122
|
-
let r = /* @__PURE__ */ new Set([t, ...
|
|
2205
|
+
let r = /* @__PURE__ */ new Set([t, ...ke(t)]), i = sn.value.filter((e) => !r.has(e.id)).filter((e) => {
|
|
2123
2206
|
let t = W(e.id), r = K(e.id);
|
|
2124
2207
|
return n.x >= t.x && n.x <= t.x + r.width && n.y >= t.y && n.y <= t.y + r.height;
|
|
2125
|
-
}).sort((e, t) =>
|
|
2208
|
+
}).sort((e, t) => Ee(t.id) - Ee(e.id))[0];
|
|
2126
2209
|
(i?.id ?? void 0) !== (e.parentId ?? void 0) && a.set(t, i?.id);
|
|
2127
2210
|
}
|
|
2128
2211
|
}
|
|
@@ -2154,7 +2237,7 @@ var Se = [
|
|
|
2154
2237
|
position: r
|
|
2155
2238
|
};
|
|
2156
2239
|
return i ? o.parentId = i : delete o.parentId, o;
|
|
2157
|
-
}), s = r && n ?
|
|
2240
|
+
}), s = r && n ? Rr(o, n) : o, c = e.starts.get(e.nodeId), l = H.get(e.nodeId), u = r ? [...P.value.filter((e) => e !== n.edge), ...r] : void 0;
|
|
2158
2241
|
c && l && !a.size && (l.tx !== c.x || l.ty !== c.y) && P.value.some((e) => e.route && t.has(e.source) && t.has(e.target)) && (u = (u ?? P.value).map((e) => e.route && t.has(e.source) && t.has(e.target) ? {
|
|
2159
2242
|
...e,
|
|
2160
2243
|
route: Qt(e, l.tx - c.x, l.ty - c.y)
|
|
@@ -2163,7 +2246,7 @@ var Se = [
|
|
|
2163
2246
|
edges: u
|
|
2164
2247
|
});
|
|
2165
2248
|
let d = L.value.get(e.nodeId);
|
|
2166
|
-
d && ve(T.flowMoved.replace("{label}",
|
|
2249
|
+
d && ve(T.flowMoved.replace("{label}", ti(d)));
|
|
2167
2250
|
}
|
|
2168
2251
|
vt.value = /* @__PURE__ */ new Set(), G.clear();
|
|
2169
2252
|
let o = [...e.starts.keys()].map((e) => L.value.get(e)).filter(Boolean);
|
|
@@ -2173,23 +2256,23 @@ var Se = [
|
|
|
2173
2256
|
connections: n.connections
|
|
2174
2257
|
}), C("node-drag-stop", {
|
|
2175
2258
|
nodes: o,
|
|
2176
|
-
intersecting:
|
|
2259
|
+
intersecting: Nr(e.nodeId),
|
|
2177
2260
|
event: t
|
|
2178
2261
|
});
|
|
2179
2262
|
}
|
|
2180
|
-
function
|
|
2263
|
+
function Br(e) {
|
|
2181
2264
|
let t = X;
|
|
2182
2265
|
if (!t || t.kind !== "node" && t.kind !== "connect" || !t.moved) return !1;
|
|
2183
|
-
let n =
|
|
2266
|
+
let n = yn(), r = Q.x - n.left, i = Q.y - n.top, a = r < 40 ? 1 - r / 40 : r > n.width - 40 ? -(1 - (n.width - r) / 40) : 0, o = i < 40 ? 1 - i / 40 : i > n.height - 40 ? -(1 - (n.height - i) / 40) : 0;
|
|
2184
2267
|
if (!a && !o) return !1;
|
|
2185
2268
|
let s = Math.max(-1, Math.min(1, a)) * 600 * e, c = Math.max(-1, Math.min(1, o)) * 600 * e;
|
|
2186
|
-
return
|
|
2269
|
+
return gn({
|
|
2187
2270
|
x: J.value.x + s,
|
|
2188
2271
|
y: J.value.y + c,
|
|
2189
2272
|
zoom: J.value.zoom
|
|
2190
|
-
}), t.kind === "node" ? (t.sx += s, t.sy += c,
|
|
2273
|
+
}), t.kind === "node" ? (t.sx += s, t.sy += c, jr(t, Q.x, Q.y)) : Qr(t, Q.x, Q.y), !0;
|
|
2191
2274
|
}
|
|
2192
|
-
function
|
|
2275
|
+
function Vr(e, t, n, r) {
|
|
2193
2276
|
let i = Ht(t, r, n);
|
|
2194
2277
|
i && (X = {
|
|
2195
2278
|
kind: "connect",
|
|
@@ -2219,12 +2302,12 @@ var Se = [
|
|
|
2219
2302
|
nodeId: t,
|
|
2220
2303
|
handleId: n,
|
|
2221
2304
|
type: r
|
|
2222
|
-
}),
|
|
2305
|
+
}), ir());
|
|
2223
2306
|
}
|
|
2224
|
-
function
|
|
2307
|
+
function Hr(e, t, n) {
|
|
2225
2308
|
let r = Ht(t.source, "source", t.sourceHandle);
|
|
2226
2309
|
if (!r) return;
|
|
2227
|
-
let i = t.sourceHandle ?? null, { direction: a, segment: o, ...s } =
|
|
2310
|
+
let i = t.sourceHandle ?? null, { direction: a, segment: o, ...s } = Ur(t, bn({
|
|
2228
2311
|
x: e.sx,
|
|
2229
2312
|
y: e.sy
|
|
2230
2313
|
})), c = {
|
|
@@ -2257,9 +2340,9 @@ var Se = [
|
|
|
2257
2340
|
nodeId: t.source,
|
|
2258
2341
|
handleId: i,
|
|
2259
2342
|
type: "source"
|
|
2260
|
-
}),
|
|
2343
|
+
}), Qr(c, n.clientX, n.clientY), Et();
|
|
2261
2344
|
}
|
|
2262
|
-
function
|
|
2345
|
+
function Ur(e, t) {
|
|
2263
2346
|
let n = en(e);
|
|
2264
2347
|
if (!n) return {
|
|
2265
2348
|
...t,
|
|
@@ -2298,9 +2381,9 @@ var Se = [
|
|
|
2298
2381
|
segment: i.i
|
|
2299
2382
|
};
|
|
2300
2383
|
}
|
|
2301
|
-
function
|
|
2384
|
+
function Wr(e, t = {}) {
|
|
2302
2385
|
let n = t.radius ?? 8, r = null;
|
|
2303
|
-
for (let i of
|
|
2386
|
+
for (let i of ln.value) {
|
|
2304
2387
|
if (t.ignore?.(i)) continue;
|
|
2305
2388
|
let a = en(i);
|
|
2306
2389
|
if (!a) continue;
|
|
@@ -2311,30 +2394,30 @@ var Se = [
|
|
|
2311
2394
|
});
|
|
2312
2395
|
}
|
|
2313
2396
|
if (!r) return null;
|
|
2314
|
-
let { direction: i, segment: a, ...o } =
|
|
2397
|
+
let { direction: i, segment: a, ...o } = Ur(r.edge, e);
|
|
2315
2398
|
return {
|
|
2316
2399
|
edge: r.edge,
|
|
2317
2400
|
position: o,
|
|
2318
2401
|
direction: i,
|
|
2319
|
-
routes:
|
|
2402
|
+
routes: Gr(r.edge, o, a, i)
|
|
2320
2403
|
};
|
|
2321
2404
|
}
|
|
2322
|
-
function
|
|
2405
|
+
function Gr(e, t, n, r) {
|
|
2323
2406
|
let i = tn(e), a = $t(e);
|
|
2324
2407
|
if (!i || !a || !e.route) return;
|
|
2325
|
-
let o = [t.x, t.y], s =
|
|
2408
|
+
let o = [t.x, t.y], s = Kr[r];
|
|
2326
2409
|
return {
|
|
2327
2410
|
before: c([...i.slice(0, n + 1), o], a.s.position, s),
|
|
2328
2411
|
after: c([o, ...i.slice(n + 1)], r, a.t.position)
|
|
2329
2412
|
};
|
|
2330
2413
|
}
|
|
2331
|
-
let
|
|
2414
|
+
let Kr = {
|
|
2332
2415
|
top: "bottom",
|
|
2333
2416
|
bottom: "top",
|
|
2334
2417
|
left: "right",
|
|
2335
2418
|
right: "left"
|
|
2336
2419
|
};
|
|
2337
|
-
function
|
|
2420
|
+
function qr(e, t, n) {
|
|
2338
2421
|
let r = n === "target" ? {
|
|
2339
2422
|
nodeId: t.source,
|
|
2340
2423
|
handleId: t.sourceHandle ?? null,
|
|
@@ -2355,7 +2438,7 @@ var Se = [
|
|
|
2355
2438
|
},
|
|
2356
2439
|
moved: !1
|
|
2357
2440
|
};
|
|
2358
|
-
let a =
|
|
2441
|
+
let a = bn({
|
|
2359
2442
|
x: e.clientX,
|
|
2360
2443
|
y: e.clientY
|
|
2361
2444
|
});
|
|
@@ -2365,10 +2448,10 @@ var Se = [
|
|
|
2365
2448
|
toPosition: null,
|
|
2366
2449
|
type: r.type,
|
|
2367
2450
|
edgeType: q(t)
|
|
2368
|
-
}, Q.x = e.clientX, Q.y = e.clientY,
|
|
2451
|
+
}, Q.x = e.clientX, Q.y = e.clientY, ir();
|
|
2369
2452
|
}
|
|
2370
|
-
let
|
|
2371
|
-
function
|
|
2453
|
+
let Jr = (e, t) => `${e}:${t.id ?? ""}:${t.type}`;
|
|
2454
|
+
function Yr(e, t, n) {
|
|
2372
2455
|
return e.type === "source" ? {
|
|
2373
2456
|
source: e.nodeId,
|
|
2374
2457
|
sourceHandle: e.handleId,
|
|
@@ -2381,16 +2464,16 @@ var Se = [
|
|
|
2381
2464
|
targetHandle: e.handleId
|
|
2382
2465
|
};
|
|
2383
2466
|
}
|
|
2384
|
-
function
|
|
2467
|
+
function Xr(e, t) {
|
|
2385
2468
|
return e.source === e.target || P.value.some((n) => n !== t && n.source === e.source && n.target === e.target && (n.sourceHandle ?? null) === e.sourceHandle && (n.targetHandle ?? null) === e.targetHandle) ? !1 : !S.isValidConnection || S.isValidConnection(e);
|
|
2386
2469
|
}
|
|
2387
|
-
let
|
|
2388
|
-
function
|
|
2389
|
-
let r =
|
|
2470
|
+
let Zr = null;
|
|
2471
|
+
function Qr(e, t, n) {
|
|
2472
|
+
let r = bn({
|
|
2390
2473
|
x: t,
|
|
2391
2474
|
y: n
|
|
2392
2475
|
}), i = e.from.type === "source" ? "target" : "source", a = S.connectionRadius / J.value.zoom, o = null;
|
|
2393
|
-
for (let e of
|
|
2476
|
+
for (let e of on.value) {
|
|
2394
2477
|
if (e.connectable === !1) continue;
|
|
2395
2478
|
let t = W(e.id), n = K(e.id), s = r.x >= t.x && r.x <= t.x + n.width && r.y >= t.y && r.y <= t.y + n.height, c = (kt.get(e.id) ?? []).filter((e) => e.type === i && e.connectable);
|
|
2396
2479
|
if (c.length) for (let n of c) {
|
|
@@ -2419,13 +2502,13 @@ var Se = [
|
|
|
2419
2502
|
o && o.nodeId === e.from.nodeId && (o = null);
|
|
2420
2503
|
let s = $.value;
|
|
2421
2504
|
if (o) {
|
|
2422
|
-
let t =
|
|
2423
|
-
|
|
2505
|
+
let t = Xr(Yr(e.from, o.nodeId, o.h?.id ?? null), e.reconnect?.edge);
|
|
2506
|
+
Zr = {
|
|
2424
2507
|
nodeId: o.nodeId,
|
|
2425
2508
|
handleId: o.h?.id ?? null,
|
|
2426
2509
|
valid: t
|
|
2427
|
-
},
|
|
2428
|
-
key:
|
|
2510
|
+
}, $n.value = {
|
|
2511
|
+
key: Jr(o.nodeId, {
|
|
2429
2512
|
id: o.h?.id ?? null,
|
|
2430
2513
|
type: i
|
|
2431
2514
|
}),
|
|
@@ -2438,22 +2521,22 @@ var Se = [
|
|
|
2438
2521
|
} : r,
|
|
2439
2522
|
toPosition: t ? o.position : null
|
|
2440
2523
|
};
|
|
2441
|
-
} else
|
|
2524
|
+
} else Zr = null, $n.value = null, $.value = {
|
|
2442
2525
|
...s,
|
|
2443
2526
|
to: r,
|
|
2444
2527
|
toPosition: null
|
|
2445
2528
|
};
|
|
2446
2529
|
}
|
|
2447
|
-
function
|
|
2448
|
-
let n =
|
|
2449
|
-
|
|
2450
|
-
let r =
|
|
2530
|
+
function $r(e, t) {
|
|
2531
|
+
let n = Zr;
|
|
2532
|
+
Zr = null, $.value = null, $n.value = null;
|
|
2533
|
+
let r = bn({
|
|
2451
2534
|
x: t.clientX,
|
|
2452
2535
|
y: t.clientY
|
|
2453
2536
|
}), i = e.tap;
|
|
2454
2537
|
if (i && Math.hypot(t.clientX - i.x, t.clientY - i.y) < (i.touch ? 6 : 4)) {
|
|
2455
2538
|
let n = L.value.get(i.nodeId);
|
|
2456
|
-
n &&
|
|
2539
|
+
n && Fe.value && n.selectable !== !1 && z({
|
|
2457
2540
|
nodes: [n.id],
|
|
2458
2541
|
edges: []
|
|
2459
2542
|
}), n && C("node-click", n, t), C("connect-end", {
|
|
@@ -2463,20 +2546,20 @@ var Se = [
|
|
|
2463
2546
|
});
|
|
2464
2547
|
return;
|
|
2465
2548
|
}
|
|
2466
|
-
let a = n?.valid ?
|
|
2549
|
+
let a = n?.valid ? Yr(e.from, n.nodeId, n.handleId) : null;
|
|
2467
2550
|
if (e.reconnect) {
|
|
2468
2551
|
let t = e.reconnect.edge;
|
|
2469
2552
|
a ? (C("reconnect", {
|
|
2470
2553
|
edge: t,
|
|
2471
2554
|
connection: a
|
|
2472
|
-
}), S.autoConnect &&
|
|
2555
|
+
}), S.autoConnect && Fn(t.id, {
|
|
2473
2556
|
source: a.source,
|
|
2474
2557
|
target: a.target,
|
|
2475
2558
|
sourceHandle: a.sourceHandle,
|
|
2476
2559
|
targetHandle: a.targetHandle,
|
|
2477
2560
|
route: void 0,
|
|
2478
2561
|
[e.reconnect.end === "source" ? "sourcePosition" : "targetPosition"]: void 0
|
|
2479
|
-
})) : e.moved && !n && t.deletable !== !1 &&
|
|
2562
|
+
})) : e.moved && !n && t.deletable !== !1 && In({ edges: [t.id] });
|
|
2480
2563
|
return;
|
|
2481
2564
|
}
|
|
2482
2565
|
if (e.branch) {
|
|
@@ -2487,17 +2570,17 @@ var Se = [
|
|
|
2487
2570
|
position: t.at,
|
|
2488
2571
|
direction: t.direction,
|
|
2489
2572
|
end: r,
|
|
2490
|
-
routes:
|
|
2573
|
+
routes: Gr(t.edge, t.at, t.segment, t.direction)
|
|
2491
2574
|
}), S.edgeBranching === "junction") return;
|
|
2492
2575
|
}
|
|
2493
2576
|
if (a && (C("connect", a), S.autoConnect)) {
|
|
2494
|
-
|
|
2577
|
+
Mn({
|
|
2495
2578
|
...S.defaultEdgeOptions,
|
|
2496
2579
|
id: ye("edge"),
|
|
2497
2580
|
...a
|
|
2498
2581
|
});
|
|
2499
2582
|
let e = L.value.get(a.source), t = L.value.get(a.target);
|
|
2500
|
-
e && t && ve(T.flowConnected.replace("{source}",
|
|
2583
|
+
e && t && ve(T.flowConnected.replace("{source}", ti(e)).replace("{target}", ti(t)));
|
|
2501
2584
|
}
|
|
2502
2585
|
C("connect-end", {
|
|
2503
2586
|
connection: a,
|
|
@@ -2505,7 +2588,7 @@ var Se = [
|
|
|
2505
2588
|
from: e.from
|
|
2506
2589
|
});
|
|
2507
2590
|
}
|
|
2508
|
-
let
|
|
2591
|
+
let ei = _(() => {
|
|
2509
2592
|
let e = $.value;
|
|
2510
2593
|
if (!e) return "";
|
|
2511
2594
|
let t = e.type === "target", n = {
|
|
@@ -2529,16 +2612,16 @@ var Se = [
|
|
|
2529
2612
|
targetPosition: i
|
|
2530
2613
|
};
|
|
2531
2614
|
return Wt(e.edgeType, a).path;
|
|
2532
|
-
}),
|
|
2533
|
-
function
|
|
2615
|
+
}), ti = (e) => String(e.data?.label ?? e.id);
|
|
2616
|
+
function ni(e) {
|
|
2534
2617
|
return !!e?.closest?.("input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])");
|
|
2535
2618
|
}
|
|
2536
|
-
function
|
|
2537
|
-
if (
|
|
2619
|
+
function ri(e) {
|
|
2620
|
+
if (ni(e.target)) return;
|
|
2538
2621
|
let t = e.ctrlKey || e.metaKey, n = e.key.toLowerCase();
|
|
2539
2622
|
if (e.key === "Escape") {
|
|
2540
|
-
if (X)
|
|
2541
|
-
else if (F.value.nodes.length || F.value.edges.length)
|
|
2623
|
+
if (X) yr();
|
|
2624
|
+
else if (F.value.nodes.length || F.value.edges.length) z(lt());
|
|
2542
2625
|
else return;
|
|
2543
2626
|
e.preventDefault(), e.stopPropagation();
|
|
2544
2627
|
return;
|
|
@@ -2552,35 +2635,39 @@ var Se = [
|
|
|
2552
2635
|
return;
|
|
2553
2636
|
}
|
|
2554
2637
|
if (t && n === "a") {
|
|
2555
|
-
e.preventDefault(),
|
|
2638
|
+
e.preventDefault(), zn();
|
|
2556
2639
|
return;
|
|
2557
2640
|
}
|
|
2558
2641
|
if (t && n === "c") {
|
|
2559
|
-
|
|
2642
|
+
Vn();
|
|
2560
2643
|
return;
|
|
2561
2644
|
}
|
|
2562
2645
|
if (t && n === "x") {
|
|
2563
|
-
e.preventDefault(),
|
|
2646
|
+
e.preventDefault(), Hn();
|
|
2647
|
+
return;
|
|
2648
|
+
}
|
|
2649
|
+
if (t && n === "d") {
|
|
2650
|
+
e.preventDefault(), Wn();
|
|
2564
2651
|
return;
|
|
2565
2652
|
}
|
|
2566
2653
|
if (t && n === "v") {
|
|
2567
|
-
e.preventDefault(),
|
|
2654
|
+
e.preventDefault(), Un(Q.inside ? bn(Q) : void 0);
|
|
2568
2655
|
return;
|
|
2569
2656
|
}
|
|
2570
2657
|
if (S.deleteKeys?.includes(e.key)) {
|
|
2571
|
-
e.preventDefault(),
|
|
2658
|
+
e.preventDefault(), Rn();
|
|
2572
2659
|
return;
|
|
2573
2660
|
}
|
|
2574
2661
|
if (!t && (e.key === "+" || e.key === "=")) {
|
|
2575
|
-
e.preventDefault(),
|
|
2662
|
+
e.preventDefault(), wn();
|
|
2576
2663
|
return;
|
|
2577
2664
|
}
|
|
2578
2665
|
if (!t && (e.key === "-" || e.key === "_")) {
|
|
2579
|
-
e.preventDefault(),
|
|
2666
|
+
e.preventDefault(), Tn();
|
|
2580
2667
|
return;
|
|
2581
2668
|
}
|
|
2582
2669
|
if (e.key === "!" || e.shiftKey && e.code === "Digit1") {
|
|
2583
|
-
e.preventDefault(),
|
|
2670
|
+
e.preventDefault(), kn();
|
|
2584
2671
|
return;
|
|
2585
2672
|
}
|
|
2586
2673
|
let r = {
|
|
@@ -2591,7 +2678,7 @@ var Se = [
|
|
|
2591
2678
|
}[e.key];
|
|
2592
2679
|
if (r && F.value.nodes.length && Ie.value) {
|
|
2593
2680
|
e.preventDefault();
|
|
2594
|
-
let t = S.snapToGrid ? S.gridSize : e.shiftKey ? 50 : 10, n = F.value.nodes, i = new Set(n.filter((e) => L.value.get(e)?.draggable !== !1 && !
|
|
2681
|
+
let t = S.snapToGrid ? S.gridSize : e.shiftKey ? 50 : 10, n = F.value.nodes, i = new Set(n.filter((e) => L.value.get(e)?.draggable !== !1 && !Te(e).some((e) => n.includes(e))));
|
|
2595
2682
|
if (!i.size) return;
|
|
2596
2683
|
yt = !0, B({ nodes: N.value.map((e) => i.has(e.id) ? {
|
|
2597
2684
|
...e,
|
|
@@ -2601,26 +2688,26 @@ var Se = [
|
|
|
2601
2688
|
}
|
|
2602
2689
|
} : e) }, { coalesce: `move:${[...i].join(",")}` });
|
|
2603
2690
|
let a = L.value.get([...i][0]);
|
|
2604
|
-
a && ve(T.flowMoved.replace("{label}",
|
|
2605
|
-
} else r && !F.value.nodes.length && (e.preventDefault(),
|
|
2691
|
+
a && ve(T.flowMoved.replace("{label}", ti(a)));
|
|
2692
|
+
} else r && !F.value.nodes.length && (e.preventDefault(), gn({
|
|
2606
2693
|
x: J.value.x - r[0] * 40,
|
|
2607
2694
|
y: J.value.y - r[1] * 40,
|
|
2608
2695
|
zoom: J.value.zoom
|
|
2609
2696
|
}));
|
|
2610
2697
|
}
|
|
2611
|
-
function
|
|
2612
|
-
|
|
2698
|
+
function ii(e, t) {
|
|
2699
|
+
ni(e.target) || e.target.dataset.flowNode !== t || (e.key === "Enter" || e.key === " ") && Fe.value && (e.preventDefault(), e.shiftKey ? z({ nodes: Ae.value.has(t) ? F.value.nodes.filter((e) => e !== t) : [...F.value.nodes, t] }) : z({
|
|
2613
2700
|
nodes: [t],
|
|
2614
2701
|
edges: []
|
|
2615
2702
|
}));
|
|
2616
2703
|
}
|
|
2617
|
-
function
|
|
2618
|
-
(e.key === "Enter" || e.key === " ") &&
|
|
2704
|
+
function ai(e, t) {
|
|
2705
|
+
(e.key === "Enter" || e.key === " ") && Fe.value && (e.preventDefault(), z({
|
|
2619
2706
|
nodes: [],
|
|
2620
2707
|
edges: [t]
|
|
2621
2708
|
}));
|
|
2622
2709
|
}
|
|
2623
|
-
let
|
|
2710
|
+
let oi = `m3-flow-bg-${Math.random().toString(36).slice(2, 8)}`, si = _(() => {
|
|
2624
2711
|
let e = S.gridSize * J.value.zoom;
|
|
2625
2712
|
for (; e < 10;) e *= 2;
|
|
2626
2713
|
return {
|
|
@@ -2629,7 +2716,7 @@ var Se = [
|
|
|
2629
2716
|
y: (J.value.y % e + e) % e,
|
|
2630
2717
|
r: Math.max(.6, Math.min(1.4, J.value.zoom))
|
|
2631
2718
|
};
|
|
2632
|
-
}),
|
|
2719
|
+
}), ci = {
|
|
2633
2720
|
nodes: _(() => N.value),
|
|
2634
2721
|
edges: _(() => P.value),
|
|
2635
2722
|
viewport: J,
|
|
@@ -2638,63 +2725,68 @@ var Se = [
|
|
|
2638
2725
|
selection: _(() => F.value),
|
|
2639
2726
|
size: M,
|
|
2640
2727
|
locked: I,
|
|
2641
|
-
getNode:
|
|
2728
|
+
getNode: Ce,
|
|
2642
2729
|
getAbsolutePosition: W,
|
|
2643
2730
|
getSize: K,
|
|
2644
|
-
getIntersectingNodes:
|
|
2645
|
-
getEdgeAt:
|
|
2646
|
-
screenToFlow:
|
|
2647
|
-
flowToScreen:
|
|
2648
|
-
setViewport:
|
|
2649
|
-
fitView:
|
|
2650
|
-
setCenter:
|
|
2651
|
-
zoomIn:
|
|
2652
|
-
zoomOut:
|
|
2653
|
-
zoomTo:
|
|
2654
|
-
addNodes:
|
|
2655
|
-
change:
|
|
2656
|
-
addEdges:
|
|
2657
|
-
updateNode:
|
|
2658
|
-
updateEdge:
|
|
2659
|
-
remove:
|
|
2660
|
-
setSelection:
|
|
2661
|
-
layout: (e, t) =>
|
|
2731
|
+
getIntersectingNodes: Nr,
|
|
2732
|
+
getEdgeAt: Wr,
|
|
2733
|
+
screenToFlow: bn,
|
|
2734
|
+
flowToScreen: xn,
|
|
2735
|
+
setViewport: _n,
|
|
2736
|
+
fitView: kn,
|
|
2737
|
+
setCenter: Dn,
|
|
2738
|
+
zoomIn: wn,
|
|
2739
|
+
zoomOut: Tn,
|
|
2740
|
+
zoomTo: En,
|
|
2741
|
+
addNodes: jn,
|
|
2742
|
+
change: Nn,
|
|
2743
|
+
addEdges: Mn,
|
|
2744
|
+
updateNode: Pn,
|
|
2745
|
+
updateEdge: Fn,
|
|
2746
|
+
remove: In,
|
|
2747
|
+
setSelection: z,
|
|
2748
|
+
layout: (e, t) => qn(e, t),
|
|
2662
2749
|
undo: mt,
|
|
2663
2750
|
redo: ht,
|
|
2664
2751
|
canUndo: gt,
|
|
2665
2752
|
canRedo: _t,
|
|
2666
|
-
copy:
|
|
2667
|
-
cut:
|
|
2668
|
-
paste:
|
|
2669
|
-
|
|
2753
|
+
copy: Vn,
|
|
2754
|
+
cut: Hn,
|
|
2755
|
+
paste: Un,
|
|
2756
|
+
duplicate: Wn,
|
|
2757
|
+
getEdgePath: (e) => {
|
|
2758
|
+
let t = R.value.get(e);
|
|
2759
|
+
return (t && en(t)?.path) ?? null;
|
|
2760
|
+
},
|
|
2761
|
+
startDrag: Ar,
|
|
2670
2762
|
registerHandle: Ft,
|
|
2671
2763
|
measureNode: Pt,
|
|
2672
|
-
startConnection:
|
|
2673
|
-
connectionTarget:
|
|
2674
|
-
connecting:
|
|
2675
|
-
insertEdge:
|
|
2676
|
-
branching:
|
|
2764
|
+
startConnection: Vr,
|
|
2765
|
+
connectionTarget: $n,
|
|
2766
|
+
connecting: er,
|
|
2767
|
+
insertEdge: Pr,
|
|
2768
|
+
branching: Me,
|
|
2677
2769
|
nodesConnectable: Le,
|
|
2678
2770
|
direction: _(() => S.direction),
|
|
2679
2771
|
registerNodeEl: It,
|
|
2680
|
-
selectedNodes:
|
|
2681
|
-
selectedEdges:
|
|
2772
|
+
selectedNodes: Ae,
|
|
2773
|
+
selectedEdges: je,
|
|
2682
2774
|
dragging: vt,
|
|
2683
|
-
isLifted:
|
|
2684
|
-
zIndexOf:
|
|
2775
|
+
isLifted: un,
|
|
2776
|
+
zIndexOf: dn,
|
|
2685
2777
|
edgeGeometry: en,
|
|
2686
|
-
isReconnectable:
|
|
2687
|
-
isReroutable:
|
|
2778
|
+
isReconnectable: mn,
|
|
2779
|
+
isReroutable: an,
|
|
2688
2780
|
edgeCorners: tn,
|
|
2689
2781
|
sidePositions: Lt,
|
|
2690
|
-
onNodeKey:
|
|
2691
|
-
onEdgeKey:
|
|
2782
|
+
onNodeKey: ii,
|
|
2783
|
+
onEdgeKey: ai
|
|
2692
2784
|
};
|
|
2693
|
-
re(ge,
|
|
2694
|
-
let
|
|
2785
|
+
re(ge, ci);
|
|
2786
|
+
let li;
|
|
2695
2787
|
return ne(async () => {
|
|
2696
2788
|
let e = D.value;
|
|
2697
|
-
e.addEventListener("wheel",
|
|
2789
|
+
e.addEventListener("wheel", Tr, { passive: !1 });
|
|
2698
2790
|
let t = new ResizeObserver(() => {
|
|
2699
2791
|
M.value = {
|
|
2700
2792
|
width: e.clientWidth,
|
|
@@ -2704,55 +2796,55 @@ var Se = [
|
|
|
2704
2796
|
t.observe(e), te(() => t.disconnect()), M.value = {
|
|
2705
2797
|
width: e.clientWidth,
|
|
2706
2798
|
height: e.clientHeight
|
|
2707
|
-
},
|
|
2799
|
+
}, li = new ResizeObserver((e) => {
|
|
2708
2800
|
for (let t of e) {
|
|
2709
2801
|
let e = t.target.dataset.flowNode;
|
|
2710
2802
|
e && Mt(e);
|
|
2711
2803
|
}
|
|
2712
2804
|
});
|
|
2713
|
-
for (let [e, t] of At)
|
|
2714
|
-
await E(), S.layout && await
|
|
2805
|
+
for (let [e, t] of At) li.observe(t), Mt(e);
|
|
2806
|
+
await E(), S.layout && await qn(null, void 0, { history: !1 }), await E(), S.fitView && kn({ animate: !1 }), he.value = !0, C("init", ci);
|
|
2715
2807
|
}), te(() => {
|
|
2716
|
-
D.value?.removeEventListener("wheel",
|
|
2717
|
-
}), p(
|
|
2808
|
+
D.value?.removeEventListener("wheel", Tr), ar(), li?.disconnect(), U && cancelAnimationFrame(U), clearTimeout(dr), document.body.style.userSelect = "";
|
|
2809
|
+
}), p(ci), (e, t) => (k(), b("div", ee({
|
|
2718
2810
|
ref_key: "root",
|
|
2719
2811
|
ref: D
|
|
2720
2812
|
}, e.$attrs, {
|
|
2721
|
-
class: ["m3-flow overflow-hidden bg-surface outline-none select-none", [
|
|
2813
|
+
class: ["m3-flow overflow-hidden bg-surface outline-none select-none", [nr.value && "cursor-grabbing", I.value && "m3-flow-locked"]],
|
|
2722
2814
|
tabindex: "0",
|
|
2723
2815
|
role: "application",
|
|
2724
2816
|
"aria-label": n.label ?? j(T).flowCanvas,
|
|
2725
2817
|
"aria-roledescription": "flow",
|
|
2726
|
-
onPointerdown:
|
|
2818
|
+
onPointerdown: ur,
|
|
2727
2819
|
onPointerenter: t[0] ||= (e) => Q.inside = !0,
|
|
2728
2820
|
onPointerleave: t[1] ||= (e) => Q.inside = !1,
|
|
2729
|
-
onDblclick:
|
|
2730
|
-
onContextmenu:
|
|
2731
|
-
onKeydown:
|
|
2821
|
+
onDblclick: Er,
|
|
2822
|
+
onContextmenu: Dr,
|
|
2823
|
+
onKeydown: ri
|
|
2732
2824
|
}), [
|
|
2733
2825
|
n.background === "none" ? y("", !0) : (k(), b("svg", qe, [x("defs", null, [x("pattern", {
|
|
2734
|
-
id:
|
|
2735
|
-
x:
|
|
2736
|
-
y:
|
|
2737
|
-
width:
|
|
2738
|
-
height:
|
|
2826
|
+
id: oi,
|
|
2827
|
+
x: si.value.x,
|
|
2828
|
+
y: si.value.y,
|
|
2829
|
+
width: si.value.gap,
|
|
2830
|
+
height: si.value.gap,
|
|
2739
2831
|
patternUnits: "userSpaceOnUse"
|
|
2740
2832
|
}, [n.background === "dots" ? (k(), b("circle", {
|
|
2741
2833
|
key: 0,
|
|
2742
|
-
cx:
|
|
2743
|
-
cy:
|
|
2744
|
-
r:
|
|
2834
|
+
cx: si.value.r,
|
|
2835
|
+
cy: si.value.r,
|
|
2836
|
+
r: si.value.r,
|
|
2745
2837
|
class: "fill-outline-variant"
|
|
2746
2838
|
}, null, 8, Ye)) : (k(), b("path", {
|
|
2747
2839
|
key: 1,
|
|
2748
|
-
d: `M${
|
|
2840
|
+
d: `M${si.value.gap} 0 L0 0 0 ${si.value.gap}`,
|
|
2749
2841
|
fill: "none",
|
|
2750
2842
|
class: "stroke-outline-variant",
|
|
2751
2843
|
"stroke-width": "1"
|
|
2752
2844
|
}, null, 8, Xe))], 8, Je)]), x("rect", {
|
|
2753
2845
|
width: "100%",
|
|
2754
2846
|
height: "100%",
|
|
2755
|
-
fill: `url(#${
|
|
2847
|
+
fill: `url(#${oi})`
|
|
2756
2848
|
}, null, 8, Ze)])),
|
|
2757
2849
|
x("div", {
|
|
2758
2850
|
ref_key: "layer",
|
|
@@ -2763,33 +2855,33 @@ var Se = [
|
|
|
2763
2855
|
visibility: he.value ? void 0 : "hidden"
|
|
2764
2856
|
})
|
|
2765
2857
|
}, [
|
|
2766
|
-
(k(!0), b(h, null, ae(
|
|
2858
|
+
(k(!0), b(h, null, ae(sn.value, (e) => (k(), v(Ne, {
|
|
2767
2859
|
key: e.id,
|
|
2768
2860
|
node: e,
|
|
2769
|
-
render:
|
|
2861
|
+
render: fn(e)
|
|
2770
2862
|
}, null, 8, ["node", "render"]))), 128)),
|
|
2771
|
-
(k(), b("svg", Qe, [(k(!0), b(h, null, ae(
|
|
2863
|
+
(k(), b("svg", Qe, [(k(!0), b(h, null, ae(ln.value, (e) => (k(), v(Ve, {
|
|
2772
2864
|
key: e.id,
|
|
2773
2865
|
edge: e,
|
|
2774
|
-
render:
|
|
2866
|
+
render: pn(e)
|
|
2775
2867
|
}, null, 8, ["edge", "render"]))), 128)), $.value ? (k(), b("path", {
|
|
2776
2868
|
key: 0,
|
|
2777
2869
|
class: "m3-flow-connection-line fill-none stroke-primary",
|
|
2778
|
-
d:
|
|
2870
|
+
d: ei.value,
|
|
2779
2871
|
"stroke-width": "2",
|
|
2780
|
-
"stroke-dasharray":
|
|
2872
|
+
"stroke-dasharray": $n.value?.valid ? void 0 : "6 4"
|
|
2781
2873
|
}, null, 8, $e)) : y("", !0)])),
|
|
2782
|
-
x("div", et, [(k(!0), b(h, null, ae(
|
|
2874
|
+
x("div", et, [(k(!0), b(h, null, ae(ln.value, (t) => (k(), b(h, { key: t.id }, [t.label || e.$slots["edge-label"] || je.value.has(t.id) ? (k(), v(Ge, {
|
|
2783
2875
|
key: 0,
|
|
2784
2876
|
edge: t,
|
|
2785
2877
|
render: e.$slots["edge-label"]
|
|
2786
2878
|
}, null, 8, ["edge", "render"])) : y("", !0)], 64))), 128))]),
|
|
2787
|
-
(k(!0), b(h, null, ae(
|
|
2879
|
+
(k(!0), b(h, null, ae(cn.value, (e) => (k(), v(Ne, {
|
|
2788
2880
|
key: e.id,
|
|
2789
2881
|
node: e,
|
|
2790
|
-
render:
|
|
2882
|
+
render: fn(e)
|
|
2791
2883
|
}, null, 8, ["node", "render"]))), 128)),
|
|
2792
|
-
|
|
2884
|
+
tr.value.length ? (k(), b("svg", tt, [(k(!0), b(h, null, ae(tr.value, (e, t) => (k(), b("line", {
|
|
2793
2885
|
key: t,
|
|
2794
2886
|
class: "stroke-primary",
|
|
2795
2887
|
"stroke-width": "1",
|
|
@@ -2800,18 +2892,18 @@ var Se = [
|
|
|
2800
2892
|
y2: e.y ?? e.to
|
|
2801
2893
|
}, null, 8, nt))), 128))])) : y("", !0)
|
|
2802
2894
|
], 4),
|
|
2803
|
-
|
|
2895
|
+
Qn.value ? (k(), b("div", {
|
|
2804
2896
|
key: 1,
|
|
2805
2897
|
class: "m3-flow-marquee pointer-events-none absolute rounded-xs border border-primary bg-primary/8",
|
|
2806
2898
|
style: O({
|
|
2807
|
-
left: `${
|
|
2808
|
-
top: `${
|
|
2809
|
-
width: `${
|
|
2810
|
-
height: `${
|
|
2899
|
+
left: `${Qn.value.x}px`,
|
|
2900
|
+
top: `${Qn.value.y}px`,
|
|
2901
|
+
width: `${Qn.value.width}px`,
|
|
2902
|
+
height: `${Qn.value.height}px`
|
|
2811
2903
|
})
|
|
2812
2904
|
}, null, 4)) : y("", !0),
|
|
2813
2905
|
!N.value.length && e.$slots.empty ? (k(), b("div", rt, [x("div", it, [oe(e.$slots, "empty")])])) : y("", !0),
|
|
2814
|
-
oe(e.$slots, "default", { flow:
|
|
2906
|
+
oe(e.$slots, "default", { flow: ci }),
|
|
2815
2907
|
x("div", at, le(_e.value), 1)
|
|
2816
2908
|
], 16, Ke));
|
|
2817
2909
|
}
|
|
@@ -3840,6 +3932,6 @@ function Yt(e, t, n = {}) {
|
|
|
3840
3932
|
return r.join("\n") + "\n";
|
|
3841
3933
|
}
|
|
3842
3934
|
//#endregion
|
|
3843
|
-
export { ut as MFlow, B as MFlowControls, I as MFlowHandle, _t as MFlowMinimap,
|
|
3935
|
+
export { ut as MFlow, B as MFlowControls, I as MFlowHandle, _t as MFlowMinimap, Oe as MFlowNode, p as arrowPath, s as getBezierPath, i as getRoutedPath, u as getSmoothStepPath, f as getStepPath, a as getStraightPath, xe as layoutLayered, be as layoutTree, kt as parseDot, Gt as parseMermaid, c as pointsToRoute, m as routePoints, o as smoothStepPoints, Rt as toDot, Yt as toMermaid, ve as useFlow, ye as useFlowNode };
|
|
3844
3936
|
|
|
3845
3937
|
//# sourceMappingURL=flow.js.map
|