mind-elixir 5.12.1 → 5.12.2-beta.1
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/MindElixir.css +1 -1
- package/dist/MindElixir.iife.js +4 -4
- package/dist/MindElixir.js +141 -133
- package/dist/MindElixirLite.css +1 -1
- package/dist/MindElixirLite.iife.js +4 -4
- package/dist/MindElixirLite.js +76 -68
- package/dist/example.js +1 -1
- package/dist/types/branchTests.d.ts +8 -0
- package/dist/types/dev.d.ts +1 -0
- package/dist/types/index.d.ts +2 -3
- package/dist/types/methods.d.ts +1 -1
- package/dist/types/types/index.d.ts +42 -24
- package/dist/types/utils/theme.d.ts +1 -1
- package/package.json +2 -2
package/dist/MindElixir.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const es = 0, ts = 1, ns = 2,
|
|
1
|
+
const es = 0, ts = 1, ns = 2, G = {
|
|
2
2
|
name: "Latte",
|
|
3
3
|
type: "light",
|
|
4
4
|
palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
|
|
@@ -53,24 +53,24 @@ const es = 0, ts = 1, ns = 2, fe = {
|
|
|
53
53
|
"--map-padding": "50px 80px"
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
function
|
|
56
|
+
function de(e) {
|
|
57
57
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
58
58
|
}
|
|
59
|
-
const
|
|
59
|
+
const oe = function(e, t) {
|
|
60
60
|
if (t.id === e)
|
|
61
61
|
return t;
|
|
62
62
|
if (t.children && t.children.length) {
|
|
63
63
|
for (let n = 0; n < t.children.length; n++) {
|
|
64
|
-
const o =
|
|
64
|
+
const o = oe(e, t.children[n]);
|
|
65
65
|
if (o) return o;
|
|
66
66
|
}
|
|
67
67
|
return null;
|
|
68
68
|
} else
|
|
69
69
|
return null;
|
|
70
|
-
},
|
|
70
|
+
}, B = (e, t) => {
|
|
71
71
|
if (e.parent = t, e.children)
|
|
72
72
|
for (let n = 0; n < e.children.length; n++)
|
|
73
|
-
|
|
73
|
+
B(e.children[n], e);
|
|
74
74
|
}, F = (e, t, n) => {
|
|
75
75
|
if (e.expanded = t, e.children)
|
|
76
76
|
if (n === void 0 || n > 0) {
|
|
@@ -84,11 +84,11 @@ const ne = function(e, t) {
|
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
86
|
function pe(e) {
|
|
87
|
-
if (e.id =
|
|
87
|
+
if (e.id = R(), e.children)
|
|
88
88
|
for (let t = 0; t < e.children.length; t++)
|
|
89
89
|
pe(e.children[t]);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function se(e, t, n, o) {
|
|
92
92
|
const s = n - e, i = o - t, c = Math.atan2(i, s) * 180 / Math.PI, r = 12, a = 30, d = (c + 180 - a) * Math.PI / 180, h = (c + 180 + a) * Math.PI / 180;
|
|
93
93
|
return {
|
|
94
94
|
x1: n + Math.cos(d) * r,
|
|
@@ -97,11 +97,11 @@ function oe(e, t, n, o) {
|
|
|
97
97
|
y2: o + Math.sin(h) * r
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function R() {
|
|
101
101
|
return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substring(2)).substring(2, 18);
|
|
102
102
|
}
|
|
103
103
|
const pt = function() {
|
|
104
|
-
const e =
|
|
104
|
+
const e = R();
|
|
105
105
|
return {
|
|
106
106
|
topic: this.newTopicName,
|
|
107
107
|
id: e
|
|
@@ -123,7 +123,7 @@ const M = (e, t) => {
|
|
|
123
123
|
}, k = (e, t) => {
|
|
124
124
|
for (const n in t)
|
|
125
125
|
e.setAttribute(n, t[n]);
|
|
126
|
-
},
|
|
126
|
+
}, ne = (e) => e ? e.tagName === "ME-TPC" : !1, me = (e) => e.filter((t) => t.nodeObj.parent).filter((t, n, o) => {
|
|
127
127
|
for (let s = 0; s < o.length; s++) {
|
|
128
128
|
if (t === o[s]) continue;
|
|
129
129
|
const { parent: i } = t.nodeObj;
|
|
@@ -150,11 +150,11 @@ const M = (e, t) => {
|
|
|
150
150
|
return Math.sqrt(n * n + o * o);
|
|
151
151
|
}, gt = function(e, t) {
|
|
152
152
|
if (!t)
|
|
153
|
-
return
|
|
153
|
+
return re(e), e;
|
|
154
154
|
let n = e.querySelector(".insert-preview");
|
|
155
155
|
const o = `insert-preview ${t} show`;
|
|
156
156
|
return n || (n = document.createElement("div"), e.appendChild(n)), n.className = o, e;
|
|
157
|
-
},
|
|
157
|
+
}, re = function(e) {
|
|
158
158
|
if (!e) return;
|
|
159
159
|
const t = e.querySelectorAll(".insert-preview");
|
|
160
160
|
for (const n of t || [])
|
|
@@ -228,7 +228,7 @@ function wt(e, t, n) {
|
|
|
228
228
|
const s = n.clientX - t.startX, i = n.clientY - t.startY, l = Math.sqrt(s * s + i * i);
|
|
229
229
|
if (!t.isDragging && l > vt && Je(e, t), !t.isDragging) return;
|
|
230
230
|
const c = e.container.getBoundingClientRect();
|
|
231
|
-
Ue(t.ghost, n.clientX - c.x, n.clientY - c.y), n.clientX < c.x + 50 ? t.edgeMoveController.move(1, 0) : n.clientX > c.x + c.width - 50 ? t.edgeMoveController.move(-1, 0) : n.clientY < c.y + 50 ? t.edgeMoveController.move(0, 1) : n.clientY > c.y + c.height - 50 ? t.edgeMoveController.move(0, -1) : t.edgeMoveController.stop(),
|
|
231
|
+
Ue(t.ghost, n.clientX - c.x, n.clientY - c.y), n.clientX < c.x + 50 ? t.edgeMoveController.move(1, 0) : n.clientX > c.x + c.width - 50 ? t.edgeMoveController.move(-1, 0) : n.clientY < c.y + 50 ? t.edgeMoveController.move(0, 1) : n.clientY > c.y + c.height - 50 ? t.edgeMoveController.move(0, -1) : t.edgeMoveController.stop(), re(t.meet);
|
|
232
232
|
const r = 12 * e.scaleVal, a = document.elementFromPoint(n.clientX, n.clientY - r);
|
|
233
233
|
if (Le(a, o)) {
|
|
234
234
|
t.meet = a;
|
|
@@ -251,7 +251,7 @@ function xt(e, t, n) {
|
|
|
251
251
|
t.edgeMoveController.stop();
|
|
252
252
|
for (const s of o)
|
|
253
253
|
s.parentElement.parentElement.style.opacity = "1";
|
|
254
|
-
t.ghost.style.display = "none", t.ghost.innerHTML = "", t.isDragging && t.meet && (
|
|
254
|
+
t.ghost.style.display = "none", t.ghost.innerHTML = "", t.isDragging && t.meet && (re(t.meet), t.insertType === "before" ? e.moveNodeBefore(o, t.meet) : t.insertType === "after" ? e.moveNodeAfter(o, t.meet) : t.insertType === "in" && e.moveNodeIn(o, t.meet)), e.dragged = null, t.isDragging = !1, t.insertType = null, t.meet = null, t.pointerId = null;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
function Ae(e, t) {
|
|
@@ -260,7 +260,7 @@ function Ae(e, t) {
|
|
|
260
260
|
t.edgeMoveController.stop();
|
|
261
261
|
for (const o of n)
|
|
262
262
|
o.parentElement.parentElement.style.opacity = "1";
|
|
263
|
-
t.meet &&
|
|
263
|
+
t.meet && re(t.meet), t.ghost.style.display = "none", t.ghost.innerHTML = "", e.dragged = null, t.isDragging = !1, t.insertType = null, t.meet = null, t.pointerId = null;
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
function Et(e) {
|
|
@@ -332,7 +332,7 @@ const H = {
|
|
|
332
332
|
} else e.link && (e.link = void 0);
|
|
333
333
|
if (t.icons && t.icons.length) {
|
|
334
334
|
const n = document.createElement("span");
|
|
335
|
-
n.className = "icons", n.innerHTML = t.icons.map((o) => `<span>${
|
|
335
|
+
n.className = "icons", n.innerHTML = t.icons.map((o) => `<span>${de(o)}</span>`).join(""), e.appendChild(n), e.icons = n;
|
|
336
336
|
} else e.icons && (e.icons = void 0);
|
|
337
337
|
if (t.tags && t.tags.length) {
|
|
338
338
|
const n = document.createElement("div");
|
|
@@ -405,32 +405,32 @@ const Lt = function(e) {
|
|
|
405
405
|
}, ve = function(e) {
|
|
406
406
|
const t = document.createElement("me-epd");
|
|
407
407
|
return t.expanded = e !== !1, t.className = e !== !1 ? "minus" : "", t;
|
|
408
|
-
},
|
|
408
|
+
}, V = (e) => {
|
|
409
409
|
const t = e.parent?.children, n = t?.indexOf(e) ?? 0;
|
|
410
410
|
return { siblings: t, index: n };
|
|
411
411
|
};
|
|
412
412
|
function Mt(e) {
|
|
413
|
-
const { siblings: t, index: n } =
|
|
413
|
+
const { siblings: t, index: n } = V(e);
|
|
414
414
|
if (t === void 0) return;
|
|
415
415
|
const o = t[n];
|
|
416
416
|
n === 0 ? (t[n] = t[t.length - 1], t[t.length - 1] = o) : (t[n] = t[n - 1], t[n - 1] = o);
|
|
417
417
|
}
|
|
418
418
|
function At(e) {
|
|
419
|
-
const { siblings: t, index: n } =
|
|
419
|
+
const { siblings: t, index: n } = V(e);
|
|
420
420
|
if (t === void 0) return;
|
|
421
421
|
const o = t[n];
|
|
422
422
|
n === t.length - 1 ? (t[n] = t[0], t[0] = o) : (t[n] = t[n + 1], t[n + 1] = o);
|
|
423
423
|
}
|
|
424
424
|
function et(e) {
|
|
425
|
-
const { siblings: t, index: n } =
|
|
425
|
+
const { siblings: t, index: n } = V(e);
|
|
426
426
|
return t === void 0 ? 0 : (t.splice(n, 1), t.length);
|
|
427
427
|
}
|
|
428
428
|
function Pt(e, t, n) {
|
|
429
|
-
const { siblings: o, index: s } =
|
|
429
|
+
const { siblings: o, index: s } = V(n);
|
|
430
430
|
o !== void 0 && (t === "before" ? o.splice(s, 0, e) : o.splice(s + 1, 0, e));
|
|
431
431
|
}
|
|
432
432
|
function Ot(e, t) {
|
|
433
|
-
const { siblings: n, index: o } =
|
|
433
|
+
const { siblings: n, index: o } = V(e);
|
|
434
434
|
n !== void 0 && (n[o] = t, t.children = [e]);
|
|
435
435
|
}
|
|
436
436
|
function Ht(e, t, n) {
|
|
@@ -438,7 +438,7 @@ function Ht(e, t, n) {
|
|
|
438
438
|
n.children ? n.children.push(t) : n.children = [t];
|
|
439
439
|
else {
|
|
440
440
|
t.direction !== void 0 && (t.direction = n.direction);
|
|
441
|
-
const { siblings: o, index: s } =
|
|
441
|
+
const { siblings: o, index: s } = V(n);
|
|
442
442
|
if (o === void 0) return;
|
|
443
443
|
e === "before" ? o.splice(s, 0, t) : o.splice(s + 1, 0, t);
|
|
444
444
|
}
|
|
@@ -455,7 +455,7 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
455
455
|
}, tt = function(e, t, n) {
|
|
456
456
|
const o = n.children[0].children[0], s = t.parentElement;
|
|
457
457
|
if (s.tagName === "ME-PARENT") {
|
|
458
|
-
if (
|
|
458
|
+
if (q(o), s.children[1])
|
|
459
459
|
s.nextSibling.appendChild(n);
|
|
460
460
|
else {
|
|
461
461
|
const i = e.createChildren([n]);
|
|
@@ -473,7 +473,7 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
473
473
|
}, nt = {
|
|
474
474
|
before: "beforebegin",
|
|
475
475
|
after: "afterend"
|
|
476
|
-
},
|
|
476
|
+
}, q = function(e) {
|
|
477
477
|
const n = e.parentElement.parentElement.lastElementChild;
|
|
478
478
|
n?.tagName === "svg" && n?.remove();
|
|
479
479
|
}, It = function(e, t) {
|
|
@@ -490,10 +490,10 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
490
490
|
const o = t.nodeObj;
|
|
491
491
|
o.expanded === !1 && (e.expandNode(t, !0), t = e.findEle(o.id));
|
|
492
492
|
const s = n || e.generateNewObj();
|
|
493
|
-
o.children ? o.children.push(s) : o.children = [s],
|
|
493
|
+
o.children ? o.children.push(s) : o.children = [s], B(e.nodeData);
|
|
494
494
|
const { grp: i, top: l } = e.createWrapper(s);
|
|
495
495
|
return tt(e, t, i), { newTop: l, newNodeObj: s };
|
|
496
|
-
},
|
|
496
|
+
}, Bt = function(e, t, n) {
|
|
497
497
|
const o = t || this.currentNode;
|
|
498
498
|
if (!o) return;
|
|
499
499
|
const s = o.nodeObj;
|
|
@@ -514,22 +514,22 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
514
514
|
const a = o.closest("me-main").className === H.LHS ? 0 : 1;
|
|
515
515
|
i.direction = a;
|
|
516
516
|
}
|
|
517
|
-
Pt(i, e, s),
|
|
517
|
+
Pt(i, e, s), B(this.nodeData);
|
|
518
518
|
const l = o.parentElement, { grp: c, top: r } = this.createWrapper(i);
|
|
519
519
|
l.parentElement.insertAdjacentElement(nt[e], c), this.linkDiv(c.offsetParent), n || this.editTopic(r.firstChild), this.bus.fire("operation", {
|
|
520
520
|
name: "insertSibling",
|
|
521
521
|
type: e,
|
|
522
522
|
obj: i
|
|
523
523
|
}), this.selectNode(r.firstChild, !0);
|
|
524
|
-
},
|
|
524
|
+
}, Rt = function(e, t) {
|
|
525
525
|
const n = e || this.currentNode;
|
|
526
526
|
if (!n) return;
|
|
527
|
-
|
|
527
|
+
q(n);
|
|
528
528
|
const o = n.nodeObj;
|
|
529
529
|
if (!o.parent)
|
|
530
530
|
return;
|
|
531
531
|
const s = t || this.generateNewObj();
|
|
532
|
-
Ot(o, s),
|
|
532
|
+
Ot(o, s), B(this.nodeData);
|
|
533
533
|
const i = n.parentElement.parentElement, { grp: l, top: c } = this.createWrapper(s, !0);
|
|
534
534
|
c.appendChild(ve(!0)), i.insertAdjacentElement("afterend", l);
|
|
535
535
|
const r = this.createChildren([i]);
|
|
@@ -581,7 +581,7 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
581
581
|
name: "moveUpNode",
|
|
582
582
|
obj: n
|
|
583
583
|
});
|
|
584
|
-
},
|
|
584
|
+
}, Vt = function(e) {
|
|
585
585
|
const t = e || this.currentNode;
|
|
586
586
|
if (!t) return;
|
|
587
587
|
const n = t.nodeObj;
|
|
@@ -591,7 +591,7 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
591
591
|
name: "moveDownNode",
|
|
592
592
|
obj: n
|
|
593
593
|
});
|
|
594
|
-
},
|
|
594
|
+
}, Kt = function(e) {
|
|
595
595
|
if (e = me(e), e.length === 0) return;
|
|
596
596
|
for (const n of e) {
|
|
597
597
|
const o = n.nodeObj, s = et(o);
|
|
@@ -609,11 +609,11 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
609
609
|
const i = [];
|
|
610
610
|
for (const c of e) {
|
|
611
611
|
const r = c.nodeObj;
|
|
612
|
-
if (Ht(t, r, s),
|
|
612
|
+
if (Ht(t, r, s), B(o.nodeData), t === "in") {
|
|
613
613
|
const a = c.parentElement;
|
|
614
614
|
tt(o, n, a.parentElement);
|
|
615
615
|
} else {
|
|
616
|
-
|
|
616
|
+
q(c);
|
|
617
617
|
const a = c.parentElement.parentNode;
|
|
618
618
|
i.includes(a.parentElement) || i.push(a.parentElement), n.parentElement.parentNode.insertAdjacentElement(nt[t], a);
|
|
619
619
|
}
|
|
@@ -644,16 +644,16 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
644
644
|
beginEdit: Ut,
|
|
645
645
|
copyNode: Yt,
|
|
646
646
|
copyNodes: Xt,
|
|
647
|
-
insertParent:
|
|
648
|
-
insertSibling:
|
|
649
|
-
moveDownNode:
|
|
647
|
+
insertParent: Rt,
|
|
648
|
+
insertSibling: Bt,
|
|
649
|
+
moveDownNode: Vt,
|
|
650
650
|
moveNodeAfter: qt,
|
|
651
651
|
moveNodeBefore: Gt,
|
|
652
652
|
moveNodeIn: zt,
|
|
653
653
|
moveUpNode: Ft,
|
|
654
|
-
removeNodes:
|
|
654
|
+
removeNodes: Kt,
|
|
655
655
|
reshapeNode: It,
|
|
656
|
-
rmSubline:
|
|
656
|
+
rmSubline: q,
|
|
657
657
|
setNodeTopic: Jt
|
|
658
658
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
659
659
|
function Zt(e) {
|
|
@@ -663,7 +663,8 @@ function Zt(e) {
|
|
|
663
663
|
summaries: e.summaries,
|
|
664
664
|
direction: e.direction,
|
|
665
665
|
theme: e.theme,
|
|
666
|
-
compact: e.compact
|
|
666
|
+
compact: e.compact,
|
|
667
|
+
meta: e.meta
|
|
667
668
|
};
|
|
668
669
|
}
|
|
669
670
|
const Qt = function(e, t = !1) {
|
|
@@ -753,7 +754,7 @@ const Qt = function(e, t = !1) {
|
|
|
753
754
|
x: o.left,
|
|
754
755
|
y: o.top
|
|
755
756
|
}, i = e.parentNode, l = i.children[1];
|
|
756
|
-
if (l.expanded = n.expanded, l.className = n.expanded ? "minus" : "",
|
|
757
|
+
if (l.expanded = n.expanded, l.className = n.expanded ? "minus" : "", q(e), n.expanded) {
|
|
757
758
|
const h = this.createChildren(
|
|
758
759
|
n.children.map((u) => this.createWrapper(u).grp)
|
|
759
760
|
);
|
|
@@ -778,7 +779,7 @@ const Qt = function(e, t = !1) {
|
|
|
778
779
|
}, c = s.x - l.x, r = s.y - l.y;
|
|
779
780
|
this.move(c, r);
|
|
780
781
|
}, xn = function(e) {
|
|
781
|
-
this.clearSelection(), e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.arrows = e.arrows || [], this.summaries = e.summaries || [], e.theme && this.changeTheme(e.theme)),
|
|
782
|
+
this.clearSelection(), e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.arrows = e.arrows || [], this.summaries = e.summaries || [], e.meta && (this.meta = e.meta), e.theme && this.changeTheme(e.theme)), B(this.nodeData), this.layout(), this.linkDiv();
|
|
782
783
|
}, En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
783
784
|
__proto__: null,
|
|
784
785
|
cancelFocus: gn,
|
|
@@ -1067,7 +1068,7 @@ function Pn(e) {
|
|
|
1067
1068
|
}, h = (f) => {
|
|
1068
1069
|
if (!e.editable) return;
|
|
1069
1070
|
const y = f.target;
|
|
1070
|
-
if (
|
|
1071
|
+
if (ne(y)) {
|
|
1071
1072
|
e.selectNode(y), e.beginEdit(y);
|
|
1072
1073
|
return;
|
|
1073
1074
|
}
|
|
@@ -1084,7 +1085,7 @@ function Pn(e) {
|
|
|
1084
1085
|
return;
|
|
1085
1086
|
}
|
|
1086
1087
|
if (t.handlePointerDown(f), t.mousedown && (e.ptState = i.Pan), f.button === 0 || f.pointerType === "touch")
|
|
1087
|
-
if (
|
|
1088
|
+
if (ne(y)) {
|
|
1088
1089
|
e.selection?.cancel();
|
|
1089
1090
|
const S = e.currentNodes || [];
|
|
1090
1091
|
if (f.ctrlKey || f.metaKey || e.mobileMultiSelect ? S.includes(y) ? o = y : ((e.currentArrow || e.currentSummary) && e.clearSelection(), e.selection?.select(y)) : S.includes(y) || e.selectNode(y), !e.editable) return;
|
|
@@ -1129,7 +1130,7 @@ function Pn(e) {
|
|
|
1129
1130
|
f.preventDefault(), f.button === 2 && e.editable && setTimeout(() => {
|
|
1130
1131
|
if (e.panHelper.moved || e.ptState !== i.Idle && e.ptState !== i.Pan) return;
|
|
1131
1132
|
const y = f.target;
|
|
1132
|
-
|
|
1133
|
+
ne(y) && !y.classList.contains("selected") && e.selectNode(y), e.bus.fire("showContextMenu", f);
|
|
1133
1134
|
}, 200);
|
|
1134
1135
|
}, m = (f) => {
|
|
1135
1136
|
if (f.stopPropagation(), f.preventDefault(), f.ctrlKey || f.metaKey) return Mn(e, f);
|
|
@@ -1177,11 +1178,11 @@ function On() {
|
|
|
1177
1178
|
}
|
|
1178
1179
|
};
|
|
1179
1180
|
}
|
|
1180
|
-
const A = "http://www.w3.org/2000/svg",
|
|
1181
|
+
const A = "http://www.w3.org/2000/svg", le = function(e) {
|
|
1181
1182
|
const t = e.clientWidth, n = e.clientHeight, o = e.dataset, s = Number(o.x), i = Number(o.y), l = o.anchor;
|
|
1182
1183
|
let c = s;
|
|
1183
1184
|
l === "middle" ? c = s - t / 2 : l === "end" && (c = s - t), e.style.left = `${c}px`, e.style.top = `${i - n / 2}px`, e.style.visibility = "visible";
|
|
1184
|
-
},
|
|
1185
|
+
}, he = function(e, t, n, o) {
|
|
1185
1186
|
const { anchor: s = "middle", color: i, dataType: l, svgId: c } = o, r = document.createElement("div");
|
|
1186
1187
|
r.className = "svg-label", r.style.color = i || "#666";
|
|
1187
1188
|
const a = "label-" + c;
|
|
@@ -1251,7 +1252,7 @@ const A = "http://www.w3.org/2000/svg", re = function(e) {
|
|
|
1251
1252
|
}), s.addEventListener("blur", () => {
|
|
1252
1253
|
if (!s) return;
|
|
1253
1254
|
const i = s.innerText?.trim() || "";
|
|
1254
|
-
i === "" ? n.label = o : n.label = i, t.style.opacity = "1", s.remove(), i !== o && (e.markdown ? t.innerHTML = e.markdown(n.label, n) : t.textContent = n.label,
|
|
1255
|
+
i === "" ? n.label = o : n.label = i, t.style.opacity = "1", s.remove(), i !== o && (e.markdown ? t.innerHTML = e.markdown(n.label, n) : t.textContent = n.label, le(t), "parent" in n ? e.bus.fire("operation", {
|
|
1255
1256
|
name: "finishEditSummary",
|
|
1256
1257
|
obj: n
|
|
1257
1258
|
}) : e.bus.fire("operation", {
|
|
@@ -1310,7 +1311,7 @@ function In(e, t) {
|
|
|
1310
1311
|
return x.innerText = y, x.className = "tips", x;
|
|
1311
1312
|
}, s = (y, x, S) => {
|
|
1312
1313
|
const C = document.createElement("li");
|
|
1313
|
-
return C.id = y, C.innerHTML = `<span>${
|
|
1314
|
+
return C.id = y, C.innerHTML = `<span>${de(x)}</span><span ${S ? 'class="key"' : ""}>${de(S)}</span>`, C;
|
|
1314
1315
|
}, i = t.locale, l = s("cm-add_child", i.addChild, "Tab"), c = s("cm-add_parent", i.addParent, "Ctrl + Enter"), r = s("cm-add_sibling", i.addSibling, "Enter"), a = s("cm-remove_child", i.removeNode, "Delete"), d = s("cm-fucus", i.focus, ""), h = s("cm-unfucus", i.cancelFocus, ""), u = s("cm-up", i.moveUp, "PgUp"), b = s("cm-down", i.moveDown, "Pgdn"), v = s("cm-link", i.link, ""), p = s("cm-link-bidirectional", i.linkBidirectional, ""), g = s("cm-summary", i.summary, ""), m = document.createElement("ul");
|
|
1315
1316
|
if (m.className = "menu-list", m.appendChild(l), m.appendChild(c), m.appendChild(r), m.appendChild(a), t.focus && (m.appendChild(d), m.appendChild(h)), m.appendChild(u), m.appendChild(b), m.appendChild(g), t.link && (m.appendChild(v), m.appendChild(p)), t && t.extend)
|
|
1316
1317
|
for (let y = 0; y < t.extend.length; y++) {
|
|
@@ -1324,7 +1325,7 @@ function In(e, t) {
|
|
|
1324
1325
|
let E = !0;
|
|
1325
1326
|
const N = (y) => {
|
|
1326
1327
|
const x = y.target;
|
|
1327
|
-
if (
|
|
1328
|
+
if (ne(x)) {
|
|
1328
1329
|
x.parentElement.tagName === "ME-ROOT" ? E = !0 : E = !1, E ? (d.className = "disabled", u.className = "disabled", b.className = "disabled", c.className = "disabled", r.className = "disabled", a.className = "disabled") : (d.className = "", u.className = "", b.className = "", c.className = "", r.className = "", a.className = ""), w.hidden = !1, m.style.top = "", m.style.bottom = "", m.style.left = "", m.style.right = "";
|
|
1329
1330
|
const S = m.offsetHeight, C = m.offsetWidth, T = m.getBoundingClientRect(), D = y.clientY - T.top, L = y.clientX - T.left;
|
|
1330
1331
|
S + D > window.innerHeight ? (m.style.top = "", m.style.bottom = "0px") : (m.style.bottom = "", m.style.top = D + 15 + "px"), C + L > window.innerWidth ? (m.style.left = "", m.style.right = "0px") : (m.style.right = "", m.style.left = L + 10 + "px");
|
|
@@ -1370,7 +1371,7 @@ function In(e, t) {
|
|
|
1370
1371
|
l.onclick = null, c.onclick = null, r.onclick = null, a.onclick = null, d.onclick = null, h.onclick = null, u.onclick = null, b.onclick = null, v.onclick = null, g.onclick = null, w.onclick = null, e.container.oncontextmenu = null;
|
|
1371
1372
|
};
|
|
1372
1373
|
}
|
|
1373
|
-
const
|
|
1374
|
+
const Bn = function(e) {
|
|
1374
1375
|
return ["createSummary", "removeSummary", "finishEditSummary"].includes(e.name) ? {
|
|
1375
1376
|
type: "summary",
|
|
1376
1377
|
value: e.obj.id
|
|
@@ -1385,7 +1386,7 @@ const Rn = function(e) {
|
|
|
1385
1386
|
value: [e.obj.id]
|
|
1386
1387
|
};
|
|
1387
1388
|
};
|
|
1388
|
-
function
|
|
1389
|
+
function Rn(e) {
|
|
1389
1390
|
let t = [], n = -1, o = e.getData(), s = [];
|
|
1390
1391
|
e.undo = function() {
|
|
1391
1392
|
if (n > -1) {
|
|
@@ -1418,7 +1419,7 @@ function Bn(e) {
|
|
|
1418
1419
|
prev: o,
|
|
1419
1420
|
operation: r.name,
|
|
1420
1421
|
currentSelected: s.map((h) => h.id),
|
|
1421
|
-
currentTarget:
|
|
1422
|
+
currentTarget: Bn(r),
|
|
1422
1423
|
next: a
|
|
1423
1424
|
};
|
|
1424
1425
|
t.push(d), o = a, n = t.length - 1;
|
|
@@ -1431,13 +1432,13 @@ function Bn(e) {
|
|
|
1431
1432
|
e.bus.removeListener("operation", i), e.bus.removeListener("selectNodes", c), e.container.removeEventListener("keydown", l);
|
|
1432
1433
|
};
|
|
1433
1434
|
}
|
|
1434
|
-
const Wn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169394918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" p-id="2022"></path></svg>', Yn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169375313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1775" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="currentColor" p-id="1776"></path></svg>', Xn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169667709" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3037" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="currentColor" p-id="3038"></path></svg>', Fn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169402629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2170" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" p-id="2171"></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" p-id="2172"></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" p-id="2173"></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" p-id="2174"></path></svg>',
|
|
1435
|
+
const Wn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169394918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" p-id="2022"></path></svg>', Yn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169375313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1775" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="currentColor" p-id="1776"></path></svg>', Xn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169667709" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3037" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="currentColor" p-id="3038"></path></svg>', Fn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169402629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2170" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" p-id="2171"></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" p-id="2172"></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" p-id="2173"></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" p-id="2174"></path></svg>', Vn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169573443" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2883" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="currentColor" p-id="2884"></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="currentColor" p-id="2885"></path></svg>', Kn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169419447" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2480" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" p-id="2481"></path></svg>', zn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169426515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2730" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" p-id="2731"></path></svg>', Gn = {
|
|
1435
1436
|
side: Wn,
|
|
1436
1437
|
left: Yn,
|
|
1437
1438
|
right: Xn,
|
|
1438
1439
|
full: Fn,
|
|
1439
|
-
living:
|
|
1440
|
-
zoomin:
|
|
1440
|
+
living: Vn,
|
|
1441
|
+
zoomin: Kn,
|
|
1441
1442
|
zoomout: zn
|
|
1442
1443
|
}, I = (e, t) => {
|
|
1443
1444
|
const n = document.createElement("span");
|
|
@@ -1512,7 +1513,7 @@ const Ie = (e, t = "px") => typeof e == "number" ? e + t : e, $ = ({ style: e },
|
|
|
1512
1513
|
for (const [o, s] of Object.entries(t))
|
|
1513
1514
|
s !== void 0 && (e[o] = Ie(s));
|
|
1514
1515
|
else n !== void 0 && (e[t] = Ie(n));
|
|
1515
|
-
},
|
|
1516
|
+
}, Be = (e = 0, t = 0, n = 0, o = 0) => {
|
|
1516
1517
|
const s = { x: e, y: t, width: n, height: o, top: t, left: e, right: e + n, bottom: t + o };
|
|
1517
1518
|
return { ...s, toJSON: () => JSON.stringify(s) };
|
|
1518
1519
|
}, Qn = (e) => {
|
|
@@ -1527,7 +1528,7 @@ const Ie = (e, t = "px") => typeof e == "number" ? e + t : e, $ = ({ style: e },
|
|
|
1527
1528
|
cancelAnimationFrame(n), o = !1;
|
|
1528
1529
|
}
|
|
1529
1530
|
};
|
|
1530
|
-
},
|
|
1531
|
+
}, Re = (e, t, n = "touch") => {
|
|
1531
1532
|
switch (n) {
|
|
1532
1533
|
case "center": {
|
|
1533
1534
|
const o = t.left + t.width / 2, s = t.top + t.height / 2;
|
|
@@ -1538,16 +1539,16 @@ const Ie = (e, t = "px") => typeof e == "number" ? e + t : e, $ = ({ style: e },
|
|
|
1538
1539
|
case "touch":
|
|
1539
1540
|
return e.right >= t.left && e.left <= t.right && e.bottom >= t.top && e.top <= t.bottom;
|
|
1540
1541
|
}
|
|
1541
|
-
}, eo = () => matchMedia("(hover: none), (pointer: coarse)").matches, to = () => "safari" in window,
|
|
1542
|
-
(t instanceof HTMLCollection || t instanceof NodeList) && (t = Array.from(t)), n =
|
|
1542
|
+
}, eo = () => matchMedia("(hover: none), (pointer: coarse)").matches, to = () => "safari" in window, fe = (e) => Array.isArray(e) ? e : [e], ct = (e) => (t, n, o, s = {}) => {
|
|
1543
|
+
(t instanceof HTMLCollection || t instanceof NodeList) && (t = Array.from(t)), n = fe(n), t = fe(t);
|
|
1543
1544
|
for (const i of t)
|
|
1544
1545
|
if (i)
|
|
1545
1546
|
for (const l of n)
|
|
1546
1547
|
i[e](l, o, { capture: !1, ...s });
|
|
1547
|
-
}, W = ct("addEventListener"), O = ct("removeEventListener"),
|
|
1548
|
+
}, W = ct("addEventListener"), O = ct("removeEventListener"), Z = (e) => {
|
|
1548
1549
|
const { clientX: t, clientY: n, target: o } = e.touches?.[0] ?? e;
|
|
1549
1550
|
return { x: t, y: n, target: o };
|
|
1550
|
-
}, Y = (e, t = document) =>
|
|
1551
|
+
}, Y = (e, t = document) => fe(e).map((n) => typeof n == "string" ? Array.from(t.querySelectorAll(n)) : n instanceof Element ? n : null).flat().filter(Boolean), no = (e, t) => t.some((n) => typeof n == "number" ? e.button === n : typeof n == "object" ? n.button !== e.button ? !1 : n.modifiers.every((o) => {
|
|
1551
1552
|
switch (o) {
|
|
1552
1553
|
case "alt":
|
|
1553
1554
|
return e.altKey;
|
|
@@ -1580,7 +1581,7 @@ class oo extends Zn {
|
|
|
1580
1581
|
_latestElement;
|
|
1581
1582
|
// Dynamically constructed area rect
|
|
1582
1583
|
_areaLocation = { y1: 0, x2: 0, y2: 0, x1: 0 };
|
|
1583
|
-
_areaRect =
|
|
1584
|
+
_areaRect = Be();
|
|
1584
1585
|
// If a single click is being performed, it's a single-click until the user dragged the mouse
|
|
1585
1586
|
_singleClick = !0;
|
|
1586
1587
|
_frame;
|
|
@@ -1653,11 +1654,11 @@ class oo extends Zn {
|
|
|
1653
1654
|
(t ? W : O)(n, "pointerdown", this._onTapStart);
|
|
1654
1655
|
}
|
|
1655
1656
|
_onTapStart(t, n = !1) {
|
|
1656
|
-
const { x: o, y: s, target: i } =
|
|
1657
|
+
const { x: o, y: s, target: i } = Z(t), { document: l, startAreas: c, boundaries: r, behaviour: a, features: d } = this._options, h = i.getBoundingClientRect();
|
|
1657
1658
|
if (!no(t, a.triggers))
|
|
1658
1659
|
return;
|
|
1659
1660
|
const u = Y(c, l), b = Y(r, l);
|
|
1660
|
-
this._targetElement = b.find((m) =>
|
|
1661
|
+
this._targetElement = b.find((m) => Re(m.getBoundingClientRect(), h));
|
|
1661
1662
|
const v = t.composedPath(), p = u.find((m) => v.includes(m));
|
|
1662
1663
|
if (this._targetBoundary = b.find((m) => v.includes(m)), !this._targetElement || !p || !this._targetBoundary || !n && this._emitEvent("beforestart", t) === !1)
|
|
1663
1664
|
return;
|
|
@@ -1669,7 +1670,7 @@ class oo extends Zn {
|
|
|
1669
1670
|
const {
|
|
1670
1671
|
singleTap: { intersect: n },
|
|
1671
1672
|
range: o
|
|
1672
|
-
} = this._options.features, s =
|
|
1673
|
+
} = this._options.features, s = Z(t);
|
|
1673
1674
|
let i;
|
|
1674
1675
|
if (n === "native")
|
|
1675
1676
|
i = s.target;
|
|
@@ -1705,7 +1706,7 @@ class oo extends Zn {
|
|
|
1705
1706
|
container: n,
|
|
1706
1707
|
document: o,
|
|
1707
1708
|
behaviour: { startThreshold: s }
|
|
1708
|
-
} = this._options, { x1: i, y1: l } = this._areaLocation, { x: c, y: r } =
|
|
1709
|
+
} = this._options, { x1: i, y1: l } = this._areaLocation, { x: c, y: r } = Z(t);
|
|
1709
1710
|
if (
|
|
1710
1711
|
// Single number for both coordinates
|
|
1711
1712
|
typeof s == "number" && j(c + r - (i + l)) >= s || // Different x and y threshold
|
|
@@ -1740,7 +1741,7 @@ class oo extends Zn {
|
|
|
1740
1741
|
}));
|
|
1741
1742
|
}
|
|
1742
1743
|
_onTapMove(t) {
|
|
1743
|
-
const { _scrollSpeed: n, _areaLocation: o, _options: s, _frame: i } = this, { speedDivider: l } = s.behaviour.scrolling, { x: c, y: r } =
|
|
1744
|
+
const { _scrollSpeed: n, _areaLocation: o, _options: s, _frame: i } = this, { speedDivider: l } = s.behaviour.scrolling, { x: c, y: r } = Z(t);
|
|
1744
1745
|
if (o.x2 = c, o.y2 = r, this._scrollAvailable && !this._scrollingActive && (n.y || n.x)) {
|
|
1745
1746
|
this._scrollingActive = !0;
|
|
1746
1747
|
const a = () => {
|
|
@@ -1784,7 +1785,7 @@ class oo extends Zn {
|
|
|
1784
1785
|
} = s;
|
|
1785
1786
|
r < i.left + d.x ? (t.x = -j(i.left - r + d.x), r = r < i.left ? i.left : r) : r > i.right - d.x ? (t.x = j(i.left + i.width - r - d.x), r = r > i.right ? i.right : r) : t.x = 0, a < i.top + d.y ? (t.y = -j(i.top - a + d.y), a = a < i.top ? i.top : a) : a > i.bottom - d.y ? (t.y = j(i.top + i.height - a - d.y), a = a > i.bottom ? i.bottom : a) : t.y = 0;
|
|
1786
1787
|
const h = Ye(l, r), u = Ye(c, a), b = We(l, r), v = We(c, a);
|
|
1787
|
-
this._areaRect =
|
|
1788
|
+
this._areaRect = Be(h, u, b - h, v - u);
|
|
1788
1789
|
}
|
|
1789
1790
|
_redrawSelectionArea() {
|
|
1790
1791
|
const { x: t, y: n, width: o, height: s } = this._areaRect, { style: i } = this._area;
|
|
@@ -1798,7 +1799,7 @@ class oo extends Zn {
|
|
|
1798
1799
|
const { _selectables: t, _options: n, _selection: o, _areaRect: s } = this, { stored: i, selected: l, touched: c } = o, { intersect: r, overlap: a } = n.behaviour, d = a === "invert", h = [], u = [], b = [];
|
|
1799
1800
|
for (let p = 0; p < t.length; p++) {
|
|
1800
1801
|
const g = t[p];
|
|
1801
|
-
if (
|
|
1802
|
+
if (Re(s, g.getBoundingClientRect(), r)) {
|
|
1802
1803
|
if (l.includes(g))
|
|
1803
1804
|
i.includes(g) && !c.includes(g) && c.push(g);
|
|
1804
1805
|
else if (d && i.includes(g)) {
|
|
@@ -2015,10 +2016,17 @@ function so(e) {
|
|
|
2015
2016
|
e.selection = n;
|
|
2016
2017
|
}
|
|
2017
2018
|
const io = function(e, t = !0) {
|
|
2018
|
-
this.theme =
|
|
2019
|
+
this.theme = {
|
|
2020
|
+
...this.theme || G,
|
|
2021
|
+
...e,
|
|
2022
|
+
cssVar: {
|
|
2023
|
+
...this.theme?.cssVar || G.cssVar,
|
|
2024
|
+
...e.cssVar || {}
|
|
2025
|
+
}
|
|
2026
|
+
}, this.theme.generateMainBranch !== void 0 && (this.generateMainBranch = this.theme.generateMainBranch), this.theme.generateSubBranch !== void 0 && (this.generateSubBranch = this.theme.generateSubBranch);
|
|
2019
2027
|
const o = {
|
|
2020
|
-
...(
|
|
2021
|
-
...
|
|
2028
|
+
...(this.theme.type === "dark" ? ue : G).cssVar,
|
|
2029
|
+
...this.theme.cssVar
|
|
2022
2030
|
};
|
|
2023
2031
|
this.compact && (o["--node-gap-x"] = "15px", o["--node-gap-y"] = "2px", o["--main-gap-x"] = "30px", o["--main-gap-y"] = "6px");
|
|
2024
2032
|
const s = Object.keys(o);
|
|
@@ -2064,7 +2072,7 @@ const io = function(e, t = !0) {
|
|
|
2064
2072
|
this.moved = !1, this.pointerdown = !1;
|
|
2065
2073
|
}
|
|
2066
2074
|
};
|
|
2067
|
-
},
|
|
2075
|
+
}, Ve = {
|
|
2068
2076
|
create: lo
|
|
2069
2077
|
}, at = "#4dc4ff";
|
|
2070
2078
|
function dt(e, t, n, o, s, i, l, c) {
|
|
@@ -2074,9 +2082,9 @@ function dt(e, t, n, o, s, i, l, c) {
|
|
|
2074
2082
|
};
|
|
2075
2083
|
}
|
|
2076
2084
|
function co(e, t, n) {
|
|
2077
|
-
e && (e.dataset.x = t.toString(), e.dataset.y = n.toString(),
|
|
2085
|
+
e && (e.dataset.x = t.toString(), e.dataset.y = n.toString(), le(e));
|
|
2078
2086
|
}
|
|
2079
|
-
function
|
|
2087
|
+
function Q(e, t, n, o, s) {
|
|
2080
2088
|
k(e, {
|
|
2081
2089
|
x1: t + "",
|
|
2082
2090
|
y1: n + "",
|
|
@@ -2084,7 +2092,7 @@ function Z(e, t, n, o, s) {
|
|
|
2084
2092
|
y2: s + ""
|
|
2085
2093
|
});
|
|
2086
2094
|
}
|
|
2087
|
-
function
|
|
2095
|
+
function Ke(e, t, n, o, s, i, l, c, r, a) {
|
|
2088
2096
|
const d = `M ${t} ${n} C ${o} ${s} ${i} ${l} ${c} ${r}`;
|
|
2089
2097
|
if (e.line.setAttribute("d", d), a.style) {
|
|
2090
2098
|
const p = a.style;
|
|
@@ -2092,7 +2100,7 @@ function Ve(e, t, n, o, s, i, l, c, r, a) {
|
|
|
2092
2100
|
}
|
|
2093
2101
|
const h = e.querySelectorAll('path[stroke="transparent"]');
|
|
2094
2102
|
h.length > 0 && h[0].setAttribute("d", d);
|
|
2095
|
-
const u =
|
|
2103
|
+
const u = se(i, l, c, r);
|
|
2096
2104
|
if (u) {
|
|
2097
2105
|
const p = `M ${u.x1} ${u.y1} L ${c} ${r} L ${u.x2} ${u.y2}`;
|
|
2098
2106
|
if (e.arrow1.setAttribute("d", p), h.length > 1 && h[1].setAttribute("d", p), a.style) {
|
|
@@ -2101,7 +2109,7 @@ function Ve(e, t, n, o, s, i, l, c, r, a) {
|
|
|
2101
2109
|
}
|
|
2102
2110
|
}
|
|
2103
2111
|
if (a.bidirectional) {
|
|
2104
|
-
const p =
|
|
2112
|
+
const p = se(o, s, t, n);
|
|
2105
2113
|
if (p) {
|
|
2106
2114
|
const g = `M ${p.x1} ${p.y1} L ${t} ${n} L ${p.x2} ${p.y2}`;
|
|
2107
2115
|
if (e.arrow2.setAttribute("d", g), h.length > 2 && h[2].setAttribute("d", g), a.style) {
|
|
@@ -2117,7 +2125,7 @@ function Ve(e, t, n, o, s, i, l, c, r, a) {
|
|
|
2117
2125
|
}
|
|
2118
2126
|
yo(e);
|
|
2119
2127
|
}
|
|
2120
|
-
function
|
|
2128
|
+
function ie(e, t, n) {
|
|
2121
2129
|
const { offsetLeft: o, offsetTop: s } = M(e.nodes, t), i = t.offsetWidth, l = t.offsetHeight, c = o + i / 2, r = s + l / 2, a = c + n.x, d = r + n.y;
|
|
2122
2130
|
return {
|
|
2123
2131
|
w: i,
|
|
@@ -2163,27 +2171,27 @@ const ao = function(e, t, n) {
|
|
|
2163
2171
|
const C = ao(e, t, n);
|
|
2164
2172
|
o.delta1 = C.delta1, o.delta2 = C.delta2;
|
|
2165
2173
|
}
|
|
2166
|
-
const i =
|
|
2174
|
+
const i = ie(e, t, o.delta1), l = ie(e, n, o.delta2), { x: c, y: r } = X(i), { ctrlX: a, ctrlY: d } = i, { ctrlX: h, ctrlY: u } = l, { x: b, y: v } = X(l), p = se(h, u, b, v);
|
|
2167
2175
|
if (!p) return;
|
|
2168
2176
|
const g = `M ${p.x1} ${p.y1} L ${b} ${v} L ${p.x2} ${p.y2}`;
|
|
2169
2177
|
let m = "";
|
|
2170
2178
|
if (o.bidirectional) {
|
|
2171
|
-
const C =
|
|
2179
|
+
const C = se(a, d, c, r);
|
|
2172
2180
|
if (!C) return;
|
|
2173
2181
|
m = `M ${C.x1} ${C.y1} L ${c} ${r} L ${C.x2} ${C.y2}`;
|
|
2174
2182
|
}
|
|
2175
2183
|
const w = Hn(`M ${c} ${r} C ${a} ${d} ${h} ${u} ${b} ${v}`, g, m, o.style), { x: E, y: N } = dt(c, r, a, d, h, u, b, v), f = o.style?.labelColor || "rgb(235, 95, 82)", y = "a-" + o.id;
|
|
2176
2184
|
w.id = y;
|
|
2177
|
-
const x = e.markdown ? e.markdown(o.label, o) : o.label, S =
|
|
2185
|
+
const x = e.markdown ? e.markdown(o.label, o) : o.label, S = he(x, E, N, {
|
|
2178
2186
|
anchor: "middle",
|
|
2179
2187
|
color: f,
|
|
2180
2188
|
dataType: "arrow",
|
|
2181
2189
|
svgId: y
|
|
2182
2190
|
});
|
|
2183
|
-
w.labelEl = S, w.arrowObj = o, w.dataset.linkid = o.id, e.labelContainer.appendChild(S), e.arrowSvg.appendChild(w),
|
|
2191
|
+
w.labelEl = S, w.arrowObj = o, w.dataset.linkid = o.id, e.labelContainer.appendChild(S), e.arrowSvg.appendChild(w), le(S), s || (e.arrows.push(o), e.currentArrow = w, ft(e, o, i, l));
|
|
2184
2192
|
}, ho = function(e, t, n = {}) {
|
|
2185
2193
|
const o = {
|
|
2186
|
-
id:
|
|
2194
|
+
id: R(),
|
|
2187
2195
|
label: "Custom Link",
|
|
2188
2196
|
from: e.nodeObj.id,
|
|
2189
2197
|
to: t.nodeObj.id,
|
|
@@ -2194,8 +2202,8 @@ const ao = function(e, t, n) {
|
|
|
2194
2202
|
obj: o
|
|
2195
2203
|
});
|
|
2196
2204
|
}, fo = function(e) {
|
|
2197
|
-
|
|
2198
|
-
const t = { ...e, id:
|
|
2205
|
+
ce(this);
|
|
2206
|
+
const t = { ...e, id: R() };
|
|
2199
2207
|
Se(this, this.findEle(t.from), this.findEle(t.to), t), this.bus.fire("operation", {
|
|
2200
2208
|
name: "createArrow",
|
|
2201
2209
|
obj: t
|
|
@@ -2203,7 +2211,7 @@ const ao = function(e, t, n) {
|
|
|
2203
2211
|
}, uo = function(e) {
|
|
2204
2212
|
let t;
|
|
2205
2213
|
if (e ? t = e : t = this.currentArrow, !t) return;
|
|
2206
|
-
|
|
2214
|
+
ce(this);
|
|
2207
2215
|
const n = t.arrowObj.id;
|
|
2208
2216
|
this.arrows = this.arrows.filter((o) => o.id !== n), t.labelEl?.remove(), t.remove(), this.bus.fire("operation", {
|
|
2209
2217
|
name: "removeArrow",
|
|
@@ -2213,11 +2221,11 @@ const ao = function(e, t, n) {
|
|
|
2213
2221
|
});
|
|
2214
2222
|
}, po = function(e) {
|
|
2215
2223
|
this.currentArrow = e;
|
|
2216
|
-
const t = e.arrowObj, n = this.findEle(t.from), o = this.findEle(t.to), s =
|
|
2224
|
+
const t = e.arrowObj, n = this.findEle(t.from), o = this.findEle(t.to), s = ie(this, n, t.delta1), i = ie(this, o, t.delta2);
|
|
2217
2225
|
this.editable ? ft(this, t, s, i) : ht(e, at), this.bus.fire("selectArrow", t);
|
|
2218
2226
|
}, go = function() {
|
|
2219
|
-
|
|
2220
|
-
},
|
|
2227
|
+
ce(this), this.currentArrow = null, this.bus.fire("unselectArrow");
|
|
2228
|
+
}, ae = function(e, t) {
|
|
2221
2229
|
const n = document.createElementNS(A, "path");
|
|
2222
2230
|
return k(n, {
|
|
2223
2231
|
d: e,
|
|
@@ -2230,11 +2238,11 @@ const ao = function(e, t, n) {
|
|
|
2230
2238
|
}, ht = function(e, t) {
|
|
2231
2239
|
const n = document.createElementNS(A, "g");
|
|
2232
2240
|
n.setAttribute("class", "arrow-highlight"), n.setAttribute("opacity", "0.45");
|
|
2233
|
-
const o =
|
|
2241
|
+
const o = ae(e.line.getAttribute("d"), t);
|
|
2234
2242
|
n.appendChild(o);
|
|
2235
|
-
const s =
|
|
2243
|
+
const s = ae(e.arrow1.getAttribute("d"), t);
|
|
2236
2244
|
if (n.appendChild(s), e.arrow2.getAttribute("d")) {
|
|
2237
|
-
const i =
|
|
2245
|
+
const i = ae(e.arrow2.getAttribute("d"), t);
|
|
2238
2246
|
n.appendChild(i);
|
|
2239
2247
|
}
|
|
2240
2248
|
e.insertBefore(n, e.firstChild);
|
|
@@ -2246,21 +2254,21 @@ const ao = function(e, t, n) {
|
|
|
2246
2254
|
if (!t) return;
|
|
2247
2255
|
const n = t.querySelectorAll("path");
|
|
2248
2256
|
n.length >= 1 && n[0].setAttribute("d", e.line.getAttribute("d")), n.length >= 2 && n[1].setAttribute("d", e.arrow1.getAttribute("d")), n.length >= 3 && e.arrow2.getAttribute("d") && n[2].setAttribute("d", e.arrow2.getAttribute("d"));
|
|
2249
|
-
},
|
|
2257
|
+
}, ce = function(e) {
|
|
2250
2258
|
e.helper1?.destroy(), e.helper2?.destroy(), e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none", e.currentArrow && mo(e.currentArrow);
|
|
2251
2259
|
}, ft = function(e, t, n, o) {
|
|
2252
2260
|
const { linkController: s, P2: i, P3: l, line1: c, line2: r, nodes: a, map: d, currentArrow: h, bus: u } = e;
|
|
2253
2261
|
if (!h) return;
|
|
2254
2262
|
s.style.display = "initial", i.style.display = "initial", l.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(l), ht(h, at);
|
|
2255
2263
|
let { x: b, y: v } = X(n), { ctrlX: p, ctrlY: g } = n, { ctrlX: m, ctrlY: w } = o, { x: E, y: N } = X(o);
|
|
2256
|
-
i.style.cssText = `top:${g}px;left:${p}px;`, l.style.cssText = `top:${w}px;left:${m}px;`,
|
|
2264
|
+
i.style.cssText = `top:${g}px;left:${p}px;`, l.style.cssText = `top:${w}px;left:${m}px;`, Q(c, b, v, p, g), Q(r, m, w, E, N), e.helper1 = Ve.create(i), e.helper2 = Ve.create(l), e.helper1.init(d, (f, y) => {
|
|
2257
2265
|
p = p + f / e.scaleVal, g = g + y / e.scaleVal;
|
|
2258
2266
|
const x = X({ ...n, ctrlX: p, ctrlY: g });
|
|
2259
|
-
b = x.x, v = x.y, i.style.top = g + "px", i.style.left = p + "px",
|
|
2267
|
+
b = x.x, v = x.y, i.style.top = g + "px", i.style.left = p + "px", Ke(h, b, v, p, g, m, w, E, N, t), Q(c, b, v, p, g), t.delta1.x = Math.round(p - n.cx), t.delta1.y = Math.round(g - n.cy), u.fire("updateArrowDelta", t);
|
|
2260
2268
|
}), e.helper2.init(d, (f, y) => {
|
|
2261
2269
|
m = m + f / e.scaleVal, w = w + y / e.scaleVal;
|
|
2262
2270
|
const x = X({ ...o, ctrlX: m, ctrlY: w });
|
|
2263
|
-
E = x.x, N = x.y, l.style.top = w + "px", l.style.left = m + "px",
|
|
2271
|
+
E = x.x, N = x.y, l.style.top = w + "px", l.style.left = m + "px", Ke(h, b, v, p, g, m, w, E, N, t), Q(r, m, w, E, N), t.delta2.x = Math.round(m - o.cx), t.delta2.y = Math.round(w - o.cy), u.fire("updateArrowDelta", t);
|
|
2264
2272
|
});
|
|
2265
2273
|
};
|
|
2266
2274
|
function bo() {
|
|
@@ -2275,10 +2283,10 @@ function bo() {
|
|
|
2275
2283
|
this.nodes.appendChild(this.arrowSvg);
|
|
2276
2284
|
}
|
|
2277
2285
|
function vo(e) {
|
|
2278
|
-
|
|
2286
|
+
ce(this), e && e.labelEl && rt(this, e.labelEl, e.arrowObj);
|
|
2279
2287
|
}
|
|
2280
2288
|
function wo() {
|
|
2281
|
-
this.arrows = this.arrows.filter((e) =>
|
|
2289
|
+
this.arrows = this.arrows.filter((e) => oe(e.from, this.nodeData) && oe(e.to, this.nodeData));
|
|
2282
2290
|
}
|
|
2283
2291
|
const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2284
2292
|
__proto__: null,
|
|
@@ -2346,27 +2354,27 @@ const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2346
2354
|
}, Ne = function(e, t) {
|
|
2347
2355
|
const { id: n, label: o, parent: s, start: i, end: l, style: c } = t, { nodes: r, theme: a, summarySvg: d } = e, u = e.findEle(s).nodeObj, b = No(e, t);
|
|
2348
2356
|
let v = 1 / 0, p = 0, g = 0, m = 0;
|
|
2349
|
-
for (let
|
|
2350
|
-
const Te = u.children?.[
|
|
2357
|
+
for (let K = i; K <= l; K++) {
|
|
2358
|
+
const Te = u.children?.[K];
|
|
2351
2359
|
if (!Te)
|
|
2352
2360
|
return e.removeSummary(n), null;
|
|
2353
|
-
const
|
|
2354
|
-
|
|
2361
|
+
const U = So(e.findEle(Te.id)), { offsetLeft: J, offsetTop: ke } = M(r, U), _e = i === l ? 10 : 20;
|
|
2362
|
+
K === i && (g = ke + _e), K === l && (m = ke + U.offsetHeight - _e), J < v && (v = J), U.offsetWidth + J > p && (p = U.offsetWidth + J);
|
|
2355
2363
|
}
|
|
2356
2364
|
let w, E;
|
|
2357
2365
|
const N = u.parent ? 10 : 0, f = g + N, y = m + N, x = (f + y) / 2, S = c?.stroke || a.cssVar["--color"], C = c?.labelColor || a.cssVar["--color"], T = "s-" + n, D = e.markdown ? e.markdown(o, t) : o;
|
|
2358
|
-
b === H.LHS ? (w = ze(`M ${v + 10} ${f} c -5 0 -10 5 -10 10 L ${v} ${y - 10} c 0 5 5 10 10 10 M ${v} ${x} h -10`, S), E =
|
|
2366
|
+
b === H.LHS ? (w = ze(`M ${v + 10} ${f} c -5 0 -10 5 -10 10 L ${v} ${y - 10} c 0 5 5 10 10 10 M ${v} ${x} h -10`, S), E = he(D, v - 20, x, { anchor: "end", color: C, dataType: "summary", svgId: T })) : (w = ze(`M ${p - 10} ${f} c 5 0 10 5 10 10 L ${p} ${y - 10} c 0 5 -5 10 -10 10 M ${p} ${x} h 10`, S), E = he(D, p + 20, x, { anchor: "start", color: C, dataType: "summary", svgId: T }));
|
|
2359
2367
|
const L = Co(T);
|
|
2360
|
-
return L.appendChild(w), e.labelContainer.appendChild(E),
|
|
2368
|
+
return L.appendChild(w), e.labelContainer.appendChild(E), le(E), L.summaryObj = t, L.labelEl = E, d.appendChild(L), L;
|
|
2361
2369
|
}, To = function(e = {}) {
|
|
2362
2370
|
if (!this.currentNodes) return;
|
|
2363
|
-
const { currentNodes: t, summaries: n, bus: o } = this, { parent: s, start: i, end: l } = Eo(t), c = { id:
|
|
2371
|
+
const { currentNodes: t, summaries: n, bus: o } = this, { parent: s, start: i, end: l } = Eo(t), c = { id: R(), parent: s, start: i, end: l, label: "summary", style: e.style }, r = Ne(this, c);
|
|
2364
2372
|
n.push(c), this.editSummary(r), o.fire("operation", {
|
|
2365
2373
|
name: "createSummary",
|
|
2366
2374
|
obj: c
|
|
2367
2375
|
});
|
|
2368
2376
|
}, ko = function(e) {
|
|
2369
|
-
const t =
|
|
2377
|
+
const t = R(), n = { ...e, id: t };
|
|
2370
2378
|
Ne(this, n), this.summaries.push(n), this.bus.fire("operation", {
|
|
2371
2379
|
name: "createSummary",
|
|
2372
2380
|
obj: n
|
|
@@ -2460,7 +2468,7 @@ function Io(e, t) {
|
|
|
2460
2468
|
"stroke-width": n.borderWidth
|
|
2461
2469
|
}), i;
|
|
2462
2470
|
}
|
|
2463
|
-
function
|
|
2471
|
+
function ee(e, t, n = !1) {
|
|
2464
2472
|
const o = getComputedStyle(t), { offsetLeft: s, offsetTop: i } = M(e.nodes, t), l = document.createElementNS(_, "rect");
|
|
2465
2473
|
k(l, {
|
|
2466
2474
|
x: s + "",
|
|
@@ -2478,7 +2486,7 @@ function Q(e, t, n = !1) {
|
|
|
2478
2486
|
let r;
|
|
2479
2487
|
return n ? r = jo(t, o, s, i) : r = $o(t, o, s, i), c.appendChild(r), c;
|
|
2480
2488
|
}
|
|
2481
|
-
function
|
|
2489
|
+
function Bo(e, t) {
|
|
2482
2490
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = M(e.nodes, t), i = document.createElementNS(_, "a"), l = document.createElementNS(_, "text");
|
|
2483
2491
|
return k(l, {
|
|
2484
2492
|
x: o + "",
|
|
@@ -2490,7 +2498,7 @@ function Ro(e, t) {
|
|
|
2490
2498
|
fill: `${n.color}`
|
|
2491
2499
|
}), l.innerHTML = t.textContent, i.appendChild(l), i.setAttribute("href", t.href), i;
|
|
2492
2500
|
}
|
|
2493
|
-
function
|
|
2501
|
+
function Ro(e, t) {
|
|
2494
2502
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = M(e.nodes, t), i = document.createElementNS(_, "image");
|
|
2495
2503
|
return k(i, {
|
|
2496
2504
|
x: o + "",
|
|
@@ -2500,8 +2508,8 @@ function Bo(e, t) {
|
|
|
2500
2508
|
href: t.src
|
|
2501
2509
|
}), i;
|
|
2502
2510
|
}
|
|
2503
|
-
const
|
|
2504
|
-
const n = e.nodes, o = n.offsetHeight +
|
|
2511
|
+
const te = 100, Wo = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">', Yo = (e, t = !1) => {
|
|
2512
|
+
const n = e.nodes, o = n.offsetHeight + te * 2, s = n.offsetWidth + te * 2, i = Oo(o + "px", s + "px"), l = document.createElementNS(_, "svg"), c = document.createElementNS(_, "rect");
|
|
2505
2513
|
k(c, {
|
|
2506
2514
|
x: "0",
|
|
2507
2515
|
y: "0",
|
|
@@ -2518,18 +2526,18 @@ const ee = 100, Wo = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC
|
|
|
2518
2526
|
a && l.appendChild(a);
|
|
2519
2527
|
const d = n.querySelector(".summary")?.cloneNode(!0);
|
|
2520
2528
|
return d && l.appendChild(d), n.querySelectorAll("me-tpc").forEach((h) => {
|
|
2521
|
-
h.nodeObj.dangerouslySetInnerHTML ? l.appendChild(
|
|
2529
|
+
h.nodeObj.dangerouslySetInnerHTML ? l.appendChild(ee(e, h, !t)) : (l.appendChild(Io(e, h)), l.appendChild(ee(e, h.text, !t)));
|
|
2522
2530
|
}), n.querySelectorAll(".tags > span").forEach((h) => {
|
|
2523
|
-
l.appendChild(
|
|
2531
|
+
l.appendChild(ee(e, h));
|
|
2524
2532
|
}), n.querySelectorAll(".icons > span").forEach((h) => {
|
|
2525
|
-
l.appendChild(
|
|
2533
|
+
l.appendChild(ee(e, h));
|
|
2526
2534
|
}), n.querySelectorAll(".hyper-link").forEach((h) => {
|
|
2527
|
-
l.appendChild(Ro(e, h));
|
|
2528
|
-
}), n.querySelectorAll("img").forEach((h) => {
|
|
2529
2535
|
l.appendChild(Bo(e, h));
|
|
2536
|
+
}), n.querySelectorAll("img").forEach((h) => {
|
|
2537
|
+
l.appendChild(Ro(e, h));
|
|
2530
2538
|
}), k(l, {
|
|
2531
|
-
x:
|
|
2532
|
-
y:
|
|
2539
|
+
x: te + "",
|
|
2540
|
+
y: te + "",
|
|
2533
2541
|
overflow: "visible"
|
|
2534
2542
|
}), i.appendChild(l), i;
|
|
2535
2543
|
}, Xo = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), Wo + e.outerHTML);
|
|
@@ -2543,10 +2551,10 @@ function Fo(e) {
|
|
|
2543
2551
|
}, o.readAsDataURL(e);
|
|
2544
2552
|
});
|
|
2545
2553
|
}
|
|
2546
|
-
const
|
|
2554
|
+
const Vo = function(e = !1, t) {
|
|
2547
2555
|
const n = Yo(this, e), o = Xo(n, t);
|
|
2548
2556
|
return new Blob([o], { type: "image/svg+xml" });
|
|
2549
|
-
},
|
|
2557
|
+
}, Ko = async function(e = !1, t) {
|
|
2550
2558
|
const n = this.exportSvg(e, t), o = await Fo(n);
|
|
2551
2559
|
return new Promise((s, i) => {
|
|
2552
2560
|
const l = new Image();
|
|
@@ -2557,8 +2565,8 @@ const Ko = function(e = !1, t) {
|
|
|
2557
2565
|
});
|
|
2558
2566
|
}, zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2559
2567
|
__proto__: null,
|
|
2560
|
-
exportPng:
|
|
2561
|
-
exportSvg:
|
|
2568
|
+
exportPng: Ko,
|
|
2569
|
+
exportSvg: Vo
|
|
2562
2570
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2563
2571
|
function Go(e, t) {
|
|
2564
2572
|
return async function(...n) {
|
|
@@ -2572,7 +2580,7 @@ for (let e = 0; e < Ge.length; e++) {
|
|
|
2572
2580
|
ut[t] = Go(ot[t], t);
|
|
2573
2581
|
}
|
|
2574
2582
|
const qo = {
|
|
2575
|
-
getObjById:
|
|
2583
|
+
getObjById: oe,
|
|
2576
2584
|
generateNewObj: pt,
|
|
2577
2585
|
layout: Ct,
|
|
2578
2586
|
linkDiv: $n,
|
|
@@ -2591,7 +2599,7 @@ const qo = {
|
|
|
2591
2599
|
...zo,
|
|
2592
2600
|
init(e) {
|
|
2593
2601
|
if (e = JSON.parse(JSON.stringify(e)), !e || !e.nodeData) return new Error("MindElixir: `data` is required");
|
|
2594
|
-
e.direction !== void 0 && (this.direction = e.direction), e.compact !== void 0 && (this.compact = e.compact), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData,
|
|
2602
|
+
e.direction !== void 0 && (this.direction = e.direction), e.compact !== void 0 && (this.compact = e.compact), this.changeTheme(e.theme || this.theme, !1), e.meta && (this.meta = e.meta), this.nodeData = e.nodeData, B(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && Jn(this), this.keypress && An(this, this.keypress), so(this), this.disposable.push(Et()), this.contextMenu && this.disposable.push(In(this, this.contextMenu)), this.allowUndo && this.disposable.push(Rn(this)), this.layout(), this.linkDiv(), this.toCenter();
|
|
2595
2603
|
},
|
|
2596
2604
|
destroy() {
|
|
2597
2605
|
this.disposable.forEach((e) => e()), this.el && (this.el.innerHTML = ""), this.el = void 0, this.nodeData = void 0, this.arrows = void 0, this.summaries = void 0, this.currentArrow = void 0, this.currentNodes = void 0, this.currentSummary = void 0, this.theme = void 0, this.direction = void 0, this.bus = void 0, this.container = void 0, this.map = void 0, this.lines = void 0, this.linkController = void 0, this.arrowSvg = void 0, this.P2 = void 0, this.P3 = void 0, this.line1 = void 0, this.line2 = void 0, this.nodes = void 0, this.selection?.destroy(), this.selection = void 0;
|
|
@@ -2621,7 +2629,7 @@ function Jo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction:
|
|
|
2621
2629
|
const m = Math.abs(h - b) / 300 * d;
|
|
2622
2630
|
return r === H.LHS ? (g = t, v = g + d, p = g - d, u = i + d, `M ${v} ${h} C ${g} ${h} ${g + m} ${b} ${p} ${b} H ${u}`) : (g = t + n, v = g - d, p = g + d, u = i + l - d, `M ${v} ${h} C ${g} ${h} ${g - m} ${b} ${p} ${b} H ${u}`);
|
|
2623
2631
|
}
|
|
2624
|
-
const Zo = "5.12.1";
|
|
2632
|
+
const Zo = "5.12.2-beta.1";
|
|
2625
2633
|
function Qo(e) {
|
|
2626
2634
|
return {
|
|
2627
2635
|
x: 0,
|
|
@@ -2681,7 +2689,7 @@ function P({
|
|
|
2681
2689
|
if (T === "[object HTMLDivElement]" ? C = e : T === "[object String]" && (C = document.querySelector(e)), !C) throw new Error("MindElixir: el is not a valid element");
|
|
2682
2690
|
C.style.position = "relative", C.innerHTML = "", this.el = C, this.disposable = [], this.before = r || {}, this.newTopicName = a || "New Node", this.contextMenu = o ?? !0, this.toolBar = s ?? !0, this.keypress = i ?? !0, this.mouseSelectionButton = l ?? 0, this.direction = t ?? 1, this.editable = n ?? !0, this.allowUndo = d ?? !0, this.scaleSensitivity = m ?? 0.1, this.scaleMax = w ?? 1.4, this.scaleMin = E ?? 0.2, this.generateMainBranch = h || Uo, this.generateSubBranch = u || Jo, this.overflowHidden = b ?? !1, this.compact = v ?? !1, this.alignment = g ?? "root", this.handleWheel = N ?? !0, this.markdown = f || void 0, this.imageProxy = y || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.mobileMultiSelect = S ?? !1, this.panHelper = Qo(this), this.bus = On(), this.container = document.createElement("div"), this.selectionContainer = c || this.container, this.container.className = "map-container";
|
|
2683
2691
|
const D = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2684
|
-
this.theme = p || (D.matches ? ue :
|
|
2692
|
+
this.theme = p || (D.matches ? ue : G);
|
|
2685
2693
|
const L = document.createElement("div");
|
|
2686
2694
|
L.className = "map-canvas", this.map = L, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = z("lines"), this.summarySvg = z("summary"), this.linkController = z("linkcontroller"), this.P2 = document.createElement("div"), this.P3 = document.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = je(), this.line2 = je(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.arrowSvg = z("topiclinks"), this.labelContainer = document.createElement("div"), this.labelContainer.className = "label-container", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(Pn(this)), x && (this.pasteHandler = x);
|
|
2687
2695
|
}
|
|
@@ -2695,13 +2703,13 @@ Object.defineProperty(P.prototype, "currentNode", {
|
|
|
2695
2703
|
P.LEFT = 0;
|
|
2696
2704
|
P.RIGHT = 1;
|
|
2697
2705
|
P.SIDE = 2;
|
|
2698
|
-
P.THEME =
|
|
2706
|
+
P.THEME = G;
|
|
2699
2707
|
P.DARK_THEME = ue;
|
|
2700
2708
|
P.version = Zo;
|
|
2701
2709
|
P.E = Ze;
|
|
2702
2710
|
P.new = (e) => ({
|
|
2703
2711
|
nodeData: {
|
|
2704
|
-
id:
|
|
2712
|
+
id: R(),
|
|
2705
2713
|
topic: e || "new topic",
|
|
2706
2714
|
children: []
|
|
2707
2715
|
}
|
|
@@ -2711,6 +2719,6 @@ export {
|
|
|
2711
2719
|
es as LEFT,
|
|
2712
2720
|
ts as RIGHT,
|
|
2713
2721
|
ns as SIDE,
|
|
2714
|
-
|
|
2722
|
+
G as THEME,
|
|
2715
2723
|
P as default
|
|
2716
2724
|
};
|