mind-elixir 5.9.1 → 5.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MindElixir.iife.js +4 -4
- package/dist/MindElixir.js +174 -178
- package/dist/MindElixirLite.iife.js +3 -3
- package/dist/MindElixirLite.js +3 -3
- package/package.json +1 -1
- package/readme.md +2 -6
package/dist/MindElixir.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Jo = 0, Zo = 1, Qo = 2, be = {
|
|
2
2
|
name: "Latte",
|
|
3
3
|
type: "light",
|
|
4
4
|
palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
|
|
@@ -148,7 +148,7 @@ const j = (e, t) => {
|
|
|
148
148
|
}, Pe = (e, t) => {
|
|
149
149
|
const n = e.x - t.x, o = e.y - t.y;
|
|
150
150
|
return Math.sqrt(n * n + o * o);
|
|
151
|
-
},
|
|
151
|
+
}, B = {
|
|
152
152
|
LHS: "lhs",
|
|
153
153
|
RHS: "rhs"
|
|
154
154
|
}, mt = function() {
|
|
@@ -167,9 +167,9 @@ const j = (e, t) => {
|
|
|
167
167
|
yt(this, n, t);
|
|
168
168
|
}, yt = function(e, t, n) {
|
|
169
169
|
const o = document.createElement("me-main");
|
|
170
|
-
o.className =
|
|
170
|
+
o.className = B.LHS;
|
|
171
171
|
const s = document.createElement("me-main");
|
|
172
|
-
s.className =
|
|
172
|
+
s.className = B.RHS;
|
|
173
173
|
for (let i = 0; i < t.length; i++) {
|
|
174
174
|
const l = t[i], { grp: c } = e.createWrapper(l);
|
|
175
175
|
e.direction === 2 ? l.direction === 0 ? o.appendChild(c) : s.appendChild(c) : e.direction === 0 ? o.appendChild(c) : s.appendChild(c);
|
|
@@ -276,7 +276,7 @@ const Et = function(e) {
|
|
|
276
276
|
}), t.addEventListener("blur", () => {
|
|
277
277
|
if (!t) return;
|
|
278
278
|
t.remove();
|
|
279
|
-
const c = t.
|
|
279
|
+
const c = t.innerText?.trim() || "";
|
|
280
280
|
c === o || c === "" || (n.topic = c, this.markdown ? e.text.innerHTML = this.markdown(n.topic, n) : e.text.textContent = c, this.linkDiv(), this.bus.fire("operation", {
|
|
281
281
|
name: "finishEdit",
|
|
282
282
|
obj: n,
|
|
@@ -392,7 +392,7 @@ const Lt = function({ map: e, direction: t }, n) {
|
|
|
392
392
|
}
|
|
393
393
|
const i = n || this.generateNewObj();
|
|
394
394
|
if (!s.parent?.parent) {
|
|
395
|
-
const a = o.closest("me-main").className ===
|
|
395
|
+
const a = o.closest("me-main").className === B.LHS ? 0 : 1;
|
|
396
396
|
i.direction = a;
|
|
397
397
|
}
|
|
398
398
|
kt(i, e, s), G(this.nodeData);
|
|
@@ -462,7 +462,7 @@ const Lt = function({ map: e, direction: t }, n) {
|
|
|
462
462
|
name: "moveUpNode",
|
|
463
463
|
obj: n
|
|
464
464
|
});
|
|
465
|
-
},
|
|
465
|
+
}, It = function(e) {
|
|
466
466
|
const t = e || this.currentNode;
|
|
467
467
|
if (!t) return;
|
|
468
468
|
const n = t.nodeObj;
|
|
@@ -472,9 +472,8 @@ const Lt = function({ map: e, direction: t }, n) {
|
|
|
472
472
|
name: "moveDownNode",
|
|
473
473
|
obj: n
|
|
474
474
|
});
|
|
475
|
-
},
|
|
476
|
-
if (e.length === 0) return;
|
|
477
|
-
e = Ee(e);
|
|
475
|
+
}, Rt = function(e) {
|
|
476
|
+
if (e = Ee(e), e.length === 0) return;
|
|
478
477
|
for (const n of e) {
|
|
479
478
|
const o = n.nodeObj, s = nt(o);
|
|
480
479
|
At(n, s);
|
|
@@ -528,12 +527,12 @@ const Lt = function({ map: e, direction: t }, n) {
|
|
|
528
527
|
copyNodes: jt,
|
|
529
528
|
insertParent: Pt,
|
|
530
529
|
insertSibling: Mt,
|
|
531
|
-
moveDownNode:
|
|
530
|
+
moveDownNode: It,
|
|
532
531
|
moveNodeAfter: Yt,
|
|
533
532
|
moveNodeBefore: Ft,
|
|
534
533
|
moveNodeIn: Bt,
|
|
535
534
|
moveUpNode: Ht,
|
|
536
|
-
removeNodes:
|
|
535
|
+
removeNodes: Rt,
|
|
537
536
|
reshapeNode: Dt,
|
|
538
537
|
rmSubline: ee,
|
|
539
538
|
setNodeTopic: Xt
|
|
@@ -688,21 +687,18 @@ const Gt = function(e) {
|
|
|
688
687
|
stringifyData: Le,
|
|
689
688
|
toCenter: sn,
|
|
690
689
|
unselectNodes: Kt
|
|
691
|
-
}, Symbol.toStringTag, { value: "Module" })), Oe = "MIND-ELIXIR-WAIT-COPY", yn = (e) => {
|
|
692
|
-
const
|
|
693
|
-
e.selectNode(
|
|
690
|
+
}, Symbol.toStringTag, { value: "Module" })), Oe = "MIND-ELIXIR-WAIT-COPY", yn = (e, t) => {
|
|
691
|
+
const n = e.map.querySelectorAll(`.${t}>me-wrapper>me-parent>me-tpc`);
|
|
692
|
+
n.length !== 0 && e.selectNode(n[Math.ceil(n.length / 2) - 1]);
|
|
694
693
|
}, vn = (e) => {
|
|
695
|
-
const t = e.map.querySelectorAll(".rhs>me-wrapper>me-parent>me-tpc");
|
|
696
|
-
e.selectNode(t[Math.ceil(t.length / 2) - 1]);
|
|
697
|
-
}, bn = (e) => {
|
|
698
694
|
e.selectNode(e.map.querySelector("me-root>me-tpc"));
|
|
699
|
-
},
|
|
695
|
+
}, bn = function(e, t) {
|
|
700
696
|
const n = t.parentElement.parentElement.parentElement.previousSibling;
|
|
701
697
|
if (n) {
|
|
702
698
|
const o = n.firstChild;
|
|
703
699
|
e.selectNode(o);
|
|
704
700
|
}
|
|
705
|
-
},
|
|
701
|
+
}, wn = function(e, t) {
|
|
706
702
|
const n = t.parentElement.nextSibling;
|
|
707
703
|
if (n && n.firstChild) {
|
|
708
704
|
const o = n.firstChild.firstChild.firstChild;
|
|
@@ -712,7 +708,7 @@ const Gt = function(e) {
|
|
|
712
708
|
const n = e.currentNode || e.currentNodes?.[0];
|
|
713
709
|
if (!n) return;
|
|
714
710
|
const o = n.nodeObj, s = n.offsetParent.offsetParent.parentElement;
|
|
715
|
-
o.parent ? s.className === t ?
|
|
711
|
+
o.parent ? s.className === t ? wn(e, n) : o.parent?.parent ? bn(e, n) : vn(e) : yn(e, t);
|
|
716
712
|
}, je = function(e, t) {
|
|
717
713
|
const n = e.currentNode;
|
|
718
714
|
if (!n || !n.nodeObj.parent) return;
|
|
@@ -728,7 +724,7 @@ const Gt = function(e) {
|
|
|
728
724
|
e.scale(o - s, n);
|
|
729
725
|
}
|
|
730
726
|
};
|
|
731
|
-
function
|
|
727
|
+
function xn(e, t) {
|
|
732
728
|
t = t === !0 ? {} : t;
|
|
733
729
|
const n = () => {
|
|
734
730
|
e.currentArrow ? e.removeArrow() : e.currentSummary ? e.removeSummary(e.currentSummary.summaryObj.id) : e.currentNodes && e.removeNodes(e.currentNodes);
|
|
@@ -774,12 +770,12 @@ function Cn(e, t) {
|
|
|
774
770
|
ArrowLeft: (r) => {
|
|
775
771
|
if (r.metaKey || r.ctrlKey)
|
|
776
772
|
return e.initLeft();
|
|
777
|
-
$e(e,
|
|
773
|
+
$e(e, B.LHS);
|
|
778
774
|
},
|
|
779
775
|
ArrowRight: (r) => {
|
|
780
776
|
if (r.metaKey || r.ctrlKey)
|
|
781
777
|
return e.initRight();
|
|
782
|
-
$e(e,
|
|
778
|
+
$e(e, B.RHS);
|
|
783
779
|
},
|
|
784
780
|
PageUp: () => e.moveUpNode(),
|
|
785
781
|
PageDown: () => {
|
|
@@ -840,7 +836,7 @@ function Cn(e, t) {
|
|
|
840
836
|
e.pasteHandler && e.pasteHandler(r);
|
|
841
837
|
});
|
|
842
838
|
}
|
|
843
|
-
const
|
|
839
|
+
const Cn = function(e, t) {
|
|
844
840
|
if (!t)
|
|
845
841
|
return he(e), e;
|
|
846
842
|
let n = e.querySelector(".insert-preview");
|
|
@@ -857,11 +853,11 @@ const En = function(e, t) {
|
|
|
857
853
|
if (!(e && e.tagName === "ME-TPC" && e !== n && !o && e.nodeObj.parent)) return !1;
|
|
858
854
|
}
|
|
859
855
|
return !0;
|
|
860
|
-
},
|
|
856
|
+
}, En = function(e) {
|
|
861
857
|
const t = document.createElement("div");
|
|
862
858
|
return t.className = "mind-elixir-ghost", e.container.appendChild(t), t;
|
|
863
859
|
};
|
|
864
|
-
class
|
|
860
|
+
class Sn {
|
|
865
861
|
mind;
|
|
866
862
|
isMoving = !1;
|
|
867
863
|
interval = null;
|
|
@@ -878,20 +874,20 @@ class Nn {
|
|
|
878
874
|
this.isMoving = !1, this.interval && (clearInterval(this.interval), this.interval = null);
|
|
879
875
|
}
|
|
880
876
|
}
|
|
881
|
-
function
|
|
877
|
+
function Nn(e) {
|
|
882
878
|
return {
|
|
883
879
|
isDragging: !1,
|
|
884
880
|
insertType: null,
|
|
885
881
|
meet: null,
|
|
886
|
-
ghost:
|
|
887
|
-
edgeMoveController: new
|
|
882
|
+
ghost: En(e),
|
|
883
|
+
edgeMoveController: new Sn(e),
|
|
888
884
|
startX: 0,
|
|
889
885
|
startY: 0,
|
|
890
886
|
pointerId: null
|
|
891
887
|
};
|
|
892
888
|
}
|
|
893
|
-
const
|
|
894
|
-
function
|
|
889
|
+
const kn = 5;
|
|
890
|
+
function Ie(e, t, n, o = !1) {
|
|
895
891
|
if (e.spacePressed) return !1;
|
|
896
892
|
const s = n.target;
|
|
897
893
|
if (s?.tagName !== "ME-TPC" || !s.nodeObj.parent) return !1;
|
|
@@ -911,11 +907,11 @@ function lt(e, t) {
|
|
|
911
907
|
s.parentElement.parentElement.style.opacity = "0.5";
|
|
912
908
|
e.dragMoveHelper.clear();
|
|
913
909
|
}
|
|
914
|
-
function
|
|
910
|
+
function Tn(e, t, n) {
|
|
915
911
|
const { dragged: o } = e;
|
|
916
912
|
if (!o || t.pointerId !== n.pointerId) return;
|
|
917
913
|
const s = n.clientX - t.startX, i = n.clientY - t.startY, l = Math.sqrt(s * s + i * i);
|
|
918
|
-
if (!t.isDragging && l >
|
|
914
|
+
if (!t.isDragging && l > kn && lt(e, t), !t.isDragging) return;
|
|
919
915
|
const c = e.container.getBoundingClientRect();
|
|
920
916
|
rt(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(), he(t.meet);
|
|
921
917
|
const r = 12 * e.scaleVal, a = document.elementFromPoint(n.clientX, n.clientY - r);
|
|
@@ -932,9 +928,9 @@ function _n(e, t, n) {
|
|
|
932
928
|
} else
|
|
933
929
|
t.insertType = null, t.meet = null;
|
|
934
930
|
}
|
|
935
|
-
t.meet &&
|
|
931
|
+
t.meet && Cn(t.meet, t.insertType);
|
|
936
932
|
}
|
|
937
|
-
function
|
|
933
|
+
function _n(e, t, n) {
|
|
938
934
|
const { dragged: o } = e;
|
|
939
935
|
if (!(!o || t.pointerId !== n.pointerId)) {
|
|
940
936
|
t.edgeMoveController.stop();
|
|
@@ -952,16 +948,16 @@ function pe(e, t) {
|
|
|
952
948
|
t.meet && he(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;
|
|
953
949
|
}
|
|
954
950
|
}
|
|
955
|
-
function
|
|
951
|
+
function Ln(e) {
|
|
956
952
|
return () => {
|
|
957
953
|
};
|
|
958
954
|
}
|
|
959
|
-
function
|
|
955
|
+
function An(e) {
|
|
960
956
|
const { dragMoveHelper: t } = e;
|
|
961
957
|
let n = 0;
|
|
962
958
|
e.spacePressed = !1;
|
|
963
959
|
let o = null;
|
|
964
|
-
const s = /* @__PURE__ */ new Map(), i = e.editable ?
|
|
960
|
+
const s = /* @__PURE__ */ new Map(), i = e.editable ? Nn(e) : null;
|
|
965
961
|
let l = null, c = null, r = null, a = null;
|
|
966
962
|
const d = 500, h = 10, u = () => {
|
|
967
963
|
l !== null && (clearTimeout(l), l = null, c = null, r = null, a = null);
|
|
@@ -1038,9 +1034,9 @@ function Dn(e) {
|
|
|
1038
1034
|
(i.isDragging || i.pointerId !== null) && pe(e, i);
|
|
1039
1035
|
else if (f.pointerType === "touch" && s.size === 1)
|
|
1040
1036
|
(re(w) || w.closest("me-tpc")) && (c = { x: f.clientX, y: f.clientY }, r = w, a = f.pointerId, l = window.setTimeout(() => {
|
|
1041
|
-
|
|
1037
|
+
Ie(e, i, f, !0) && (r && r.setPointerCapture(f.pointerId), rt(i.ghost, f.clientX, f.clientY)), l = null, c = null, r = null, a = null;
|
|
1042
1038
|
}, d));
|
|
1043
|
-
else if (f.pointerType === "mouse" &&
|
|
1039
|
+
else if (f.pointerType === "mouse" && Ie(e, i, f, !1)) {
|
|
1044
1040
|
w.setPointerCapture(f.pointerId);
|
|
1045
1041
|
return;
|
|
1046
1042
|
}
|
|
@@ -1070,7 +1066,7 @@ function Dn(e) {
|
|
|
1070
1066
|
return;
|
|
1071
1067
|
}
|
|
1072
1068
|
}
|
|
1073
|
-
if (!(i && i.pointerId !== null && (
|
|
1069
|
+
if (!(i && i.pointerId !== null && (Tn(e, i, f), i.isDragging))) {
|
|
1074
1070
|
if (f.target.contentEditable !== "plaintext-only" || e.spacePressed && t.mousedown) {
|
|
1075
1071
|
const w = f.clientX - t.x, k = f.clientY - t.y;
|
|
1076
1072
|
t.onMove(w, k);
|
|
@@ -1080,7 +1076,7 @@ function Dn(e) {
|
|
|
1080
1076
|
}, E = (f) => {
|
|
1081
1077
|
if (f.pointerType === "touch" && (s.delete(f.pointerId), s.size < 2 && (o = null), u()), i && i.pointerId !== null) {
|
|
1082
1078
|
const w = i.isDragging;
|
|
1083
|
-
if (
|
|
1079
|
+
if (_n(e, i, f), y(f.target, f.pointerId), w)
|
|
1084
1080
|
return;
|
|
1085
1081
|
}
|
|
1086
1082
|
t.mousedown && (y(f.target, f.pointerId), t.clear());
|
|
@@ -1112,7 +1108,7 @@ function Dn(e) {
|
|
|
1112
1108
|
{ dom: _, evt: "keyup", func: x }
|
|
1113
1109
|
]);
|
|
1114
1110
|
}
|
|
1115
|
-
function
|
|
1111
|
+
function Dn() {
|
|
1116
1112
|
return {
|
|
1117
1113
|
handlers: {},
|
|
1118
1114
|
addListener: function(e, t) {
|
|
@@ -1156,10 +1152,10 @@ const H = "http://www.w3.org/2000/svg", fe = function(e) {
|
|
|
1156
1152
|
}, Q = function(e) {
|
|
1157
1153
|
const t = document.createElementNS(H, "svg");
|
|
1158
1154
|
return t.setAttribute("class", e), t.setAttribute("overflow", "visible"), t;
|
|
1159
|
-
},
|
|
1155
|
+
}, Re = function() {
|
|
1160
1156
|
const e = document.createElementNS(H, "line");
|
|
1161
1157
|
return e.setAttribute("stroke", "#4dc4ff"), e.setAttribute("fill", "none"), e.setAttribute("stroke-width", "2"), e.setAttribute("opacity", "0.45"), e;
|
|
1162
|
-
},
|
|
1158
|
+
}, Mn = function(e, t, n, o) {
|
|
1163
1159
|
const s = document.createElementNS(H, "g");
|
|
1164
1160
|
return [
|
|
1165
1161
|
{
|
|
@@ -1207,7 +1203,7 @@ const H = "http://www.w3.org/2000/svg", fe = function(e) {
|
|
|
1207
1203
|
}
|
|
1208
1204
|
}), s.addEventListener("blur", () => {
|
|
1209
1205
|
if (!s) return;
|
|
1210
|
-
const i = s.
|
|
1206
|
+
const i = s.innerText?.trim() || "";
|
|
1211
1207
|
i === "" ? n.label = o : n.label = i, s.remove(), i !== o && (e.markdown ? t.innerHTML = e.markdown(n.label, n) : t.textContent = n.label, fe(t), "parent" in n ? e.bus.fire("operation", {
|
|
1212
1208
|
name: "finishEditSummary",
|
|
1213
1209
|
obj: n
|
|
@@ -1216,7 +1212,7 @@ const H = "http://www.w3.org/2000/svg", fe = function(e) {
|
|
|
1216
1212
|
obj: n
|
|
1217
1213
|
}));
|
|
1218
1214
|
});
|
|
1219
|
-
},
|
|
1215
|
+
}, Pn = function(e) {
|
|
1220
1216
|
const t = this.map.querySelector("me-root"), n = t.offsetTop, o = t.offsetLeft, s = t.offsetWidth, i = t.offsetHeight, l = this.map.querySelectorAll("me-main > me-wrapper");
|
|
1221
1217
|
this.lines.innerHTML = "";
|
|
1222
1218
|
for (let c = 0; c < l.length; c++) {
|
|
@@ -1398,7 +1394,7 @@ const H = "http://www.w3.org/2000/svg", fe = function(e) {
|
|
|
1398
1394
|
summary: "Rezumat"
|
|
1399
1395
|
}
|
|
1400
1396
|
};
|
|
1401
|
-
function
|
|
1397
|
+
function On(e, t) {
|
|
1402
1398
|
t = t === !0 ? {
|
|
1403
1399
|
focus: !0,
|
|
1404
1400
|
link: !0
|
|
@@ -1424,8 +1420,8 @@ function $n(e, t) {
|
|
|
1424
1420
|
const C = E.target;
|
|
1425
1421
|
if (re(C)) {
|
|
1426
1422
|
C.parentElement.tagName === "ME-ROOT" ? x = !0 : x = !1, x ? (d.className = "disabled", u.className = "disabled", y.className = "disabled", c.className = "disabled", r.className = "disabled", a.className = "disabled") : (d.className = "", u.className = "", y.className = "", c.className = "", r.className = "", a.className = ""), b.hidden = !1, m.style.top = "", m.style.bottom = "", m.style.left = "", m.style.right = "";
|
|
1427
|
-
const S = m.offsetHeight, N = m.offsetWidth, D = m.getBoundingClientRect(), _ = E.clientY - D.top,
|
|
1428
|
-
S + _ > window.innerHeight ? (m.style.top = "", m.style.bottom = "0px") : (m.style.bottom = "", m.style.top = _ + 15 + "px"), N +
|
|
1423
|
+
const S = m.offsetHeight, N = m.offsetWidth, D = m.getBoundingClientRect(), _ = E.clientY - D.top, R = E.clientX - D.left;
|
|
1424
|
+
S + _ > window.innerHeight ? (m.style.top = "", m.style.bottom = "0px") : (m.style.bottom = "", m.style.top = _ + 15 + "px"), N + R > window.innerWidth ? (m.style.left = "", m.style.right = "0px") : (m.style.right = "", m.style.left = R + 10 + "px");
|
|
1429
1425
|
}
|
|
1430
1426
|
};
|
|
1431
1427
|
e.bus.addListener("showContextMenu", L), b.onclick = (E) => {
|
|
@@ -1468,7 +1464,7 @@ function $n(e, t) {
|
|
|
1468
1464
|
l.onclick = null, c.onclick = null, r.onclick = null, a.onclick = null, d.onclick = null, h.onclick = null, u.onclick = null, y.onclick = null, v.onclick = null, g.onclick = null, b.onclick = null, e.container.oncontextmenu = null;
|
|
1469
1465
|
};
|
|
1470
1466
|
}
|
|
1471
|
-
const
|
|
1467
|
+
const $n = function(e) {
|
|
1472
1468
|
return ["createSummary", "removeSummary", "finishEditSummary"].includes(e.name) ? {
|
|
1473
1469
|
type: "summary",
|
|
1474
1470
|
value: e.obj.id
|
|
@@ -1483,7 +1479,7 @@ const jn = function(e) {
|
|
|
1483
1479
|
value: [e.obj.id]
|
|
1484
1480
|
};
|
|
1485
1481
|
};
|
|
1486
|
-
function
|
|
1482
|
+
function jn(e) {
|
|
1487
1483
|
let t = [], n = -1, o = e.getData(), s = [];
|
|
1488
1484
|
e.undo = function() {
|
|
1489
1485
|
if (n > -1) {
|
|
@@ -1514,7 +1510,7 @@ function Hn(e) {
|
|
|
1514
1510
|
prev: o,
|
|
1515
1511
|
operation: r.name,
|
|
1516
1512
|
currentSelected: s.map((h) => h.id),
|
|
1517
|
-
currentTarget:
|
|
1513
|
+
currentTarget: $n(r),
|
|
1518
1514
|
next: a
|
|
1519
1515
|
};
|
|
1520
1516
|
t.push(d), o = a, n = t.length - 1;
|
|
@@ -1527,19 +1523,19 @@ function Hn(e) {
|
|
|
1527
1523
|
e.bus.removeListener("operation", i), e.bus.removeListener("selectNodes", c), e.container.removeEventListener("keydown", l);
|
|
1528
1524
|
};
|
|
1529
1525
|
}
|
|
1530
|
-
const
|
|
1531
|
-
side:
|
|
1526
|
+
const Hn = '<?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>', In = '<?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>', Rn = '<?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>', Bn = '<?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>', 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="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>', 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="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>', 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="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>', Xn = {
|
|
1527
|
+
side: Hn,
|
|
1532
1528
|
left: In,
|
|
1533
|
-
right:
|
|
1534
|
-
full:
|
|
1535
|
-
living:
|
|
1536
|
-
zoomin:
|
|
1537
|
-
zoomout:
|
|
1529
|
+
right: Rn,
|
|
1530
|
+
full: Bn,
|
|
1531
|
+
living: Fn,
|
|
1532
|
+
zoomin: Yn,
|
|
1533
|
+
zoomout: Wn
|
|
1538
1534
|
}, z = (e, t) => {
|
|
1539
1535
|
const n = document.createElement("span");
|
|
1540
|
-
return n.id = e, n.innerHTML =
|
|
1536
|
+
return n.id = e, n.innerHTML = Xn[t], n;
|
|
1541
1537
|
};
|
|
1542
|
-
function
|
|
1538
|
+
function zn(e) {
|
|
1543
1539
|
const t = document.createElement("div"), n = z("fullscreen", "full"), o = z("toCenter", "living"), s = z("zoomout", "zoomout"), i = z("zoomin", "zoomin");
|
|
1544
1540
|
t.appendChild(n), t.appendChild(o), t.appendChild(s), t.appendChild(i), t.className = "mind-elixir-toolbar rb";
|
|
1545
1541
|
let l = null;
|
|
@@ -1567,7 +1563,7 @@ function Gn(e) {
|
|
|
1567
1563
|
e.scale(e.scaleVal + e.scaleSensitivity);
|
|
1568
1564
|
}, t;
|
|
1569
1565
|
}
|
|
1570
|
-
function
|
|
1566
|
+
function Gn(e) {
|
|
1571
1567
|
const t = document.createElement("div"), n = z("tbltl", "left"), o = z("tbltr", "right"), s = z("tblts", "side");
|
|
1572
1568
|
return t.appendChild(n), t.appendChild(o), t.appendChild(s), t.className = "mind-elixir-toolbar lt", n.onclick = () => {
|
|
1573
1569
|
e.initLeft();
|
|
@@ -1577,10 +1573,10 @@ function Vn(e) {
|
|
|
1577
1573
|
e.initSide();
|
|
1578
1574
|
}, t;
|
|
1579
1575
|
}
|
|
1580
|
-
function
|
|
1581
|
-
e.container.append(
|
|
1576
|
+
function Vn(e) {
|
|
1577
|
+
e.container.append(zn(e)), e.container.append(Gn(e));
|
|
1582
1578
|
}
|
|
1583
|
-
class
|
|
1579
|
+
class qn {
|
|
1584
1580
|
_listeners = /* @__PURE__ */ new Map();
|
|
1585
1581
|
addEventListener(t, n) {
|
|
1586
1582
|
const o = this._listeners.get(t) ?? /* @__PURE__ */ new Set();
|
|
@@ -1611,7 +1607,7 @@ const Ye = (e, t = "px") => typeof e == "number" ? e + t : e, F = ({ style: e },
|
|
|
1611
1607
|
}, We = (e = 0, t = 0, n = 0, o = 0) => {
|
|
1612
1608
|
const s = { x: e, y: t, width: n, height: o, top: t, left: e, right: e + n, bottom: t + o };
|
|
1613
1609
|
return { ...s, toJSON: () => JSON.stringify(s) };
|
|
1614
|
-
},
|
|
1610
|
+
}, Kn = (e) => {
|
|
1615
1611
|
let t, n = -1, o = !1;
|
|
1616
1612
|
return {
|
|
1617
1613
|
next: (...s) => {
|
|
@@ -1634,7 +1630,7 @@ const Ye = (e, t = "px") => typeof e == "number" ? e + t : e, F = ({ style: e },
|
|
|
1634
1630
|
case "touch":
|
|
1635
1631
|
return e.right >= t.left && e.left <= t.right && e.bottom >= t.top && e.top <= t.bottom;
|
|
1636
1632
|
}
|
|
1637
|
-
},
|
|
1633
|
+
}, Un = () => matchMedia("(hover: none), (pointer: coarse)").matches, Jn = () => "safari" in window, ve = (e) => Array.isArray(e) ? e : [e], ht = (e) => (t, n, o, s = {}) => {
|
|
1638
1634
|
(t instanceof HTMLCollection || t instanceof NodeList) && (t = Array.from(t)), n = ve(n), t = ve(t);
|
|
1639
1635
|
for (const i of t)
|
|
1640
1636
|
if (i)
|
|
@@ -1643,7 +1639,7 @@ const Ye = (e, t = "px") => typeof e == "number" ? e + t : e, F = ({ style: e },
|
|
|
1643
1639
|
}, Y = ht("addEventListener"), $ = ht("removeEventListener"), ne = (e) => {
|
|
1644
1640
|
const { clientX: t, clientY: n, target: o } = e.touches?.[0] ?? e;
|
|
1645
1641
|
return { x: t, y: n, target: o };
|
|
1646
|
-
}, q = (e, t = document) => ve(e).map((n) => typeof n == "string" ? Array.from(t.querySelectorAll(n)) : n instanceof Element ? n : null).flat().filter(Boolean),
|
|
1642
|
+
}, q = (e, t = document) => ve(e).map((n) => typeof n == "string" ? Array.from(t.querySelectorAll(n)) : n instanceof Element ? n : null).flat().filter(Boolean), Zn = (e, t) => t.some((n) => typeof n == "number" ? e.button === n : typeof n == "object" ? n.button !== e.button ? !1 : n.modifiers.every((o) => {
|
|
1647
1643
|
switch (o) {
|
|
1648
1644
|
case "alt":
|
|
1649
1645
|
return e.altKey;
|
|
@@ -1658,7 +1654,7 @@ const Ye = (e, t = "px") => typeof e == "number" ? e + t : e, F = ({ style: e },
|
|
|
1658
1654
|
touched: [],
|
|
1659
1655
|
changed: { added: [], removed: [] }
|
|
1660
1656
|
});
|
|
1661
|
-
class
|
|
1657
|
+
class Qn extends qn {
|
|
1662
1658
|
static version = "mind-elixir-fork";
|
|
1663
1659
|
// Options
|
|
1664
1660
|
_options;
|
|
@@ -1743,7 +1739,7 @@ class eo extends Kn {
|
|
|
1743
1739
|
// https://stackoverflow.com/a/38268846
|
|
1744
1740
|
pointerEvents: "none",
|
|
1745
1741
|
zIndex: "1"
|
|
1746
|
-
}), this._frame =
|
|
1742
|
+
}), this._frame = Kn((i) => {
|
|
1747
1743
|
this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move", i), this._redrawSelectionArea();
|
|
1748
1744
|
}), this.enable();
|
|
1749
1745
|
}
|
|
@@ -1753,7 +1749,7 @@ class eo extends Kn {
|
|
|
1753
1749
|
}
|
|
1754
1750
|
_onTapStart(t, n = !1) {
|
|
1755
1751
|
const { x: o, y: s, target: i } = ne(t), { document: l, startAreas: c, boundaries: r, features: a, behaviour: d } = this._options, h = i.getBoundingClientRect();
|
|
1756
|
-
if (t instanceof MouseEvent && !
|
|
1752
|
+
if (t instanceof MouseEvent && !Zn(t, d.triggers))
|
|
1757
1753
|
return;
|
|
1758
1754
|
const u = q(c, l), y = q(r, l);
|
|
1759
1755
|
this._targetElement = y.find((m) => Xe(m.getBoundingClientRect(), h));
|
|
@@ -1863,7 +1859,7 @@ class eo extends Kn {
|
|
|
1863
1859
|
}
|
|
1864
1860
|
_handleMoveEvent(t) {
|
|
1865
1861
|
const { features: n } = this._options;
|
|
1866
|
-
(n.touch &&
|
|
1862
|
+
(n.touch && Un() || this._scrollAvailable && Jn()) && t.preventDefault();
|
|
1867
1863
|
}
|
|
1868
1864
|
_onScroll() {
|
|
1869
1865
|
const {
|
|
@@ -2064,8 +2060,8 @@ class eo extends Kn {
|
|
|
2064
2060
|
this._selection.stored = s.filter((c) => !l.includes(c)), this._selection.selected = o.filter((c) => !l.includes(c)), this._selection.changed.added = [], this._selection.changed.removed.push(...l.filter((c) => !i.removed.includes(c))), this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null));
|
|
2065
2061
|
}
|
|
2066
2062
|
}
|
|
2067
|
-
function
|
|
2068
|
-
const t = e.mouseSelectionButton === 2 ? [2] : [0], n = new
|
|
2063
|
+
function eo(e) {
|
|
2064
|
+
const t = e.mouseSelectionButton === 2 ? [2] : [0], n = new Qn({
|
|
2069
2065
|
selectables: [".map-container me-tpc"],
|
|
2070
2066
|
boundaries: [e.container],
|
|
2071
2067
|
container: e.selectionContainer,
|
|
@@ -2124,7 +2120,7 @@ function to(e) {
|
|
|
2124
2120
|
);
|
|
2125
2121
|
e.selection = n;
|
|
2126
2122
|
}
|
|
2127
|
-
const
|
|
2123
|
+
const to = function(e, t = !0) {
|
|
2128
2124
|
this.theme = e;
|
|
2129
2125
|
const o = {
|
|
2130
2126
|
...(e.type === "dark" ? we : be).cssVar,
|
|
@@ -2135,7 +2131,7 @@ const no = function(e, t = !0) {
|
|
|
2135
2131
|
this.container.style.setProperty(l, o[l]);
|
|
2136
2132
|
}
|
|
2137
2133
|
t && this.refresh();
|
|
2138
|
-
},
|
|
2134
|
+
}, no = function(e) {
|
|
2139
2135
|
return {
|
|
2140
2136
|
dom: e,
|
|
2141
2137
|
moved: !1,
|
|
@@ -2171,15 +2167,15 @@ const no = function(e, t = !0) {
|
|
|
2171
2167
|
}
|
|
2172
2168
|
};
|
|
2173
2169
|
}, Ke = {
|
|
2174
|
-
create:
|
|
2175
|
-
},
|
|
2170
|
+
create: no
|
|
2171
|
+
}, oo = "#4dc4ff";
|
|
2176
2172
|
function ft(e, t, n, o, s, i, l, c) {
|
|
2177
2173
|
return {
|
|
2178
2174
|
x: e / 8 + n * 3 / 8 + s * 3 / 8 + l / 8,
|
|
2179
2175
|
y: t / 8 + o * 3 / 8 + i * 3 / 8 + c / 8
|
|
2180
2176
|
};
|
|
2181
2177
|
}
|
|
2182
|
-
function
|
|
2178
|
+
function so(e, t, n) {
|
|
2183
2179
|
e && (e.dataset.x = t.toString(), e.dataset.y = n.toString(), fe(e));
|
|
2184
2180
|
}
|
|
2185
2181
|
function oe(e, t, n, o, s) {
|
|
@@ -2217,11 +2213,11 @@ function Ue(e, t, n, o, s, i, l, c, r, a) {
|
|
|
2217
2213
|
}
|
|
2218
2214
|
}
|
|
2219
2215
|
const { x: y, y: v } = ft(t, n, o, s, i, l, c, r);
|
|
2220
|
-
if (e.labelEl &&
|
|
2216
|
+
if (e.labelEl && so(e.labelEl, y, v), a.style?.labelColor) {
|
|
2221
2217
|
const p = e.labelEl;
|
|
2222
2218
|
p && (p.style.color = a.style.labelColor);
|
|
2223
2219
|
}
|
|
2224
|
-
|
|
2220
|
+
po(e);
|
|
2225
2221
|
}
|
|
2226
2222
|
function de(e, t, n) {
|
|
2227
2223
|
const { offsetLeft: o, offsetTop: s } = j(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;
|
|
@@ -2242,7 +2238,7 @@ function K(e) {
|
|
|
2242
2238
|
y: n
|
|
2243
2239
|
};
|
|
2244
2240
|
}
|
|
2245
|
-
const
|
|
2241
|
+
const io = function(e, t, n) {
|
|
2246
2242
|
const o = j(e.nodes, t), s = j(e.nodes, n), i = o.offsetLeft + t.offsetWidth / 2, l = o.offsetTop + t.offsetHeight / 2, c = s.offsetLeft + n.offsetWidth / 2, r = s.offsetTop + n.offsetHeight / 2, a = c - i, d = r - l, h = Math.sqrt(a * a + d * d), u = Math.max(50, Math.min(200, h * 0.3)), y = Math.abs(a), v = Math.abs(d);
|
|
2247
2243
|
let p, g;
|
|
2248
2244
|
if (h < 150) {
|
|
@@ -2263,7 +2259,7 @@ const ro = function(e, t, n) {
|
|
|
2263
2259
|
if (!t || !n)
|
|
2264
2260
|
return;
|
|
2265
2261
|
if (!o.delta1 || !o.delta2) {
|
|
2266
|
-
const N =
|
|
2262
|
+
const N = io(e, t, n);
|
|
2267
2263
|
o.delta1 = N.delta1, o.delta2 = N.delta2;
|
|
2268
2264
|
}
|
|
2269
2265
|
const i = de(e, t, o.delta1), l = de(e, n, o.delta2), { x: c, y: r } = K(i), { ctrlX: a, ctrlY: d } = i, { ctrlX: h, ctrlY: u } = l, { x: y, y: v } = K(l), p = ce(h, u, y, v);
|
|
@@ -2275,7 +2271,7 @@ const ro = function(e, t, n) {
|
|
|
2275
2271
|
if (!N) return;
|
|
2276
2272
|
m = `M ${N.x1} ${N.y1} L ${c} ${r} L ${N.x2} ${N.y2}`;
|
|
2277
2273
|
}
|
|
2278
|
-
const b =
|
|
2274
|
+
const b = Mn(`M ${c} ${r} C ${a} ${d} ${h} ${u} ${y} ${v}`, g, m, o.style), { x, y: L } = ft(c, r, a, d, h, u, y, v), T = o.style?.labelColor || "rgb(235, 95, 82)", E = "arrow-" + o.id;
|
|
2279
2275
|
b.id = E;
|
|
2280
2276
|
const C = e.markdown ? e.markdown(o.label, o) : o.label, S = ye(C, x, L, {
|
|
2281
2277
|
anchor: "middle",
|
|
@@ -2284,7 +2280,7 @@ const ro = function(e, t, n) {
|
|
|
2284
2280
|
svgId: E
|
|
2285
2281
|
});
|
|
2286
2282
|
b.labelEl = S, b.arrowObj = o, b.dataset.linkid = o.id, e.labelContainer.appendChild(S), e.linkSvgGroup.appendChild(b), fe(S), s || (e.arrows.push(o), e.currentArrow = b, ut(e, o, i, l));
|
|
2287
|
-
},
|
|
2283
|
+
}, ro = function(e, t, n = {}) {
|
|
2288
2284
|
const o = {
|
|
2289
2285
|
id: V(),
|
|
2290
2286
|
label: "Custom Link",
|
|
@@ -2296,14 +2292,14 @@ const ro = function(e, t, n) {
|
|
|
2296
2292
|
name: "createArrow",
|
|
2297
2293
|
obj: o
|
|
2298
2294
|
});
|
|
2299
|
-
},
|
|
2295
|
+
}, lo = function(e) {
|
|
2300
2296
|
ue(this);
|
|
2301
2297
|
const t = { ...e, id: V() };
|
|
2302
2298
|
De(this, this.findEle(t.from), this.findEle(t.to), t), this.bus.fire("operation", {
|
|
2303
2299
|
name: "createArrow",
|
|
2304
2300
|
obj: t
|
|
2305
2301
|
});
|
|
2306
|
-
},
|
|
2302
|
+
}, co = function(e) {
|
|
2307
2303
|
let t;
|
|
2308
2304
|
if (e ? t = e : t = this.currentArrow, !t) return;
|
|
2309
2305
|
ue(this);
|
|
@@ -2314,11 +2310,11 @@ const ro = function(e, t, n) {
|
|
|
2314
2310
|
id: n
|
|
2315
2311
|
}
|
|
2316
2312
|
});
|
|
2317
|
-
},
|
|
2313
|
+
}, ao = function(e) {
|
|
2318
2314
|
this.currentArrow = e;
|
|
2319
2315
|
const t = e.arrowObj, n = this.findEle(t.from), o = this.findEle(t.to), s = de(this, n, t.delta1), i = de(this, o, t.delta2);
|
|
2320
2316
|
ut(this, t, s, i);
|
|
2321
|
-
},
|
|
2317
|
+
}, ho = function() {
|
|
2322
2318
|
ue(this), this.currentArrow = null;
|
|
2323
2319
|
}, ge = function(e, t) {
|
|
2324
2320
|
const n = document.createElementNS(H, "path");
|
|
@@ -2330,7 +2326,7 @@ const ro = function(e, t, n) {
|
|
|
2330
2326
|
"stroke-linecap": "round",
|
|
2331
2327
|
"stroke-linejoin": "round"
|
|
2332
2328
|
}), n;
|
|
2333
|
-
},
|
|
2329
|
+
}, fo = function(e, t) {
|
|
2334
2330
|
const n = document.createElementNS(H, "g");
|
|
2335
2331
|
n.setAttribute("class", "arrow-highlight"), n.setAttribute("opacity", "0.45");
|
|
2336
2332
|
const o = ge(e.line.getAttribute("d"), t);
|
|
@@ -2341,20 +2337,20 @@ const ro = function(e, t, n) {
|
|
|
2341
2337
|
n.appendChild(i);
|
|
2342
2338
|
}
|
|
2343
2339
|
e.insertBefore(n, e.firstChild);
|
|
2344
|
-
},
|
|
2340
|
+
}, uo = function(e) {
|
|
2345
2341
|
const t = e.querySelector(".arrow-highlight");
|
|
2346
2342
|
t && t.remove();
|
|
2347
|
-
},
|
|
2343
|
+
}, po = function(e) {
|
|
2348
2344
|
const t = e.querySelector(".arrow-highlight");
|
|
2349
2345
|
if (!t) return;
|
|
2350
2346
|
const n = t.querySelectorAll("path");
|
|
2351
2347
|
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"));
|
|
2352
2348
|
}, ue = function(e) {
|
|
2353
|
-
e.helper1?.destroy(), e.helper2?.destroy(), e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none", e.currentArrow &&
|
|
2349
|
+
e.helper1?.destroy(), e.helper2?.destroy(), e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none", e.currentArrow && uo(e.currentArrow);
|
|
2354
2350
|
}, ut = function(e, t, n, o) {
|
|
2355
2351
|
const { linkController: s, P2: i, P3: l, line1: c, line2: r, nodes: a, map: d, currentArrow: h, bus: u } = e;
|
|
2356
2352
|
if (!h) return;
|
|
2357
|
-
s.style.display = "initial", i.style.display = "initial", l.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(l),
|
|
2353
|
+
s.style.display = "initial", i.style.display = "initial", l.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(l), fo(h, oo);
|
|
2358
2354
|
let { x: y, y: v } = K(n), { ctrlX: p, ctrlY: g } = n, { ctrlX: m, ctrlY: b } = o, { x, y: L } = K(o);
|
|
2359
2355
|
i.style.cssText = `top:${g}px;left:${p}px;`, l.style.cssText = `top:${b}px;left:${m}px;`, oe(c, y, v, p, g), oe(r, m, b, x, L), e.helper1 = Ke.create(i), e.helper2 = Ke.create(l), e.helper1.init(d, (T, E) => {
|
|
2360
2356
|
p = p + T / e.scaleVal, g = g + E / e.scaleVal;
|
|
@@ -2366,7 +2362,7 @@ const ro = function(e, t, n) {
|
|
|
2366
2362
|
x = C.x, L = C.y, l.style.top = b + "px", l.style.left = m + "px", Ue(h, y, v, p, g, m, b, x, L, t), oe(r, m, b, x, L), t.delta2.x = m - o.cx, t.delta2.y = b - o.cy, u.fire("updateArrowDelta", t);
|
|
2367
2363
|
});
|
|
2368
2364
|
};
|
|
2369
|
-
function
|
|
2365
|
+
function go() {
|
|
2370
2366
|
this.linkSvgGroup.innerHTML = "", this.labelContainer.querySelectorAll('.svg-label[data-type="arrow"]').forEach((t) => t.remove());
|
|
2371
2367
|
for (let t = 0; t < this.arrows.length; t++) {
|
|
2372
2368
|
const n = this.arrows[t];
|
|
@@ -2377,23 +2373,23 @@ function mo() {
|
|
|
2377
2373
|
}
|
|
2378
2374
|
this.nodes.appendChild(this.linkSvgGroup);
|
|
2379
2375
|
}
|
|
2380
|
-
function
|
|
2376
|
+
function mo(e) {
|
|
2381
2377
|
ue(this), e && e.labelEl && at(this, e.labelEl, e.arrowObj);
|
|
2382
2378
|
}
|
|
2383
|
-
function
|
|
2379
|
+
function yo() {
|
|
2384
2380
|
this.arrows = this.arrows.filter((e) => le(e.from, this.nodeData) && le(e.to, this.nodeData));
|
|
2385
2381
|
}
|
|
2386
|
-
const
|
|
2382
|
+
const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2387
2383
|
__proto__: null,
|
|
2388
|
-
createArrow:
|
|
2389
|
-
createArrowFrom:
|
|
2390
|
-
editArrowLabel:
|
|
2391
|
-
removeArrow:
|
|
2392
|
-
renderArrow:
|
|
2393
|
-
selectArrow:
|
|
2394
|
-
tidyArrow:
|
|
2395
|
-
unselectArrow:
|
|
2396
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2384
|
+
createArrow: ro,
|
|
2385
|
+
createArrowFrom: lo,
|
|
2386
|
+
editArrowLabel: mo,
|
|
2387
|
+
removeArrow: co,
|
|
2388
|
+
renderArrow: go,
|
|
2389
|
+
selectArrow: ao,
|
|
2390
|
+
tidyArrow: yo,
|
|
2391
|
+
unselectArrow: ho
|
|
2392
|
+
}, Symbol.toStringTag, { value: "Module" })), bo = function(e) {
|
|
2397
2393
|
if (e.length === 0) throw new Error("No selected node.");
|
|
2398
2394
|
if (e.length === 1) {
|
|
2399
2395
|
const r = e[0].nodeObj, a = e[0].nodeObj.parent;
|
|
@@ -2430,7 +2426,7 @@ const bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2430
2426
|
start: i,
|
|
2431
2427
|
end: l
|
|
2432
2428
|
};
|
|
2433
|
-
},
|
|
2429
|
+
}, wo = function(e) {
|
|
2434
2430
|
const t = document.createElementNS(H, "g");
|
|
2435
2431
|
return t.setAttribute("id", e), t;
|
|
2436
2432
|
}, Je = function(e, t) {
|
|
@@ -2442,69 +2438,69 @@ const bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2442
2438
|
"stroke-linecap": "round",
|
|
2443
2439
|
"stroke-width": "2"
|
|
2444
2440
|
}), n;
|
|
2445
|
-
},
|
|
2441
|
+
}, xo = (e) => e.parentElement.parentElement, Co = function(e, { parent: t, start: n }) {
|
|
2446
2442
|
const o = e.findEle(t), s = o.nodeObj;
|
|
2447
2443
|
let i;
|
|
2448
2444
|
return s.parent ? i = o.closest("me-main").className : i = e.findEle(s.children[n].id).closest("me-main").className, i;
|
|
2449
2445
|
}, Me = function(e, t) {
|
|
2450
|
-
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, y =
|
|
2446
|
+
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, y = Co(e, t);
|
|
2451
2447
|
let v = 1 / 0, p = 0, g = 0, m = 0;
|
|
2452
2448
|
for (let f = i; f <= l; f++) {
|
|
2453
2449
|
const w = u.children?.[f];
|
|
2454
2450
|
if (!w)
|
|
2455
2451
|
return e.removeSummary(n), null;
|
|
2456
|
-
const k =
|
|
2452
|
+
const k = xo(e.findEle(w.id)), { offsetLeft: O, offsetTop: W } = j(r, k), M = i === l ? 10 : 20;
|
|
2457
2453
|
f === i && (g = W + M), f === l && (m = W + k.offsetHeight - M), O < v && (v = O), k.offsetWidth + O > p && (p = k.offsetWidth + O);
|
|
2458
2454
|
}
|
|
2459
2455
|
let b, x;
|
|
2460
2456
|
const L = u.parent ? 10 : 0, T = g + L, E = m + L, C = (T + E) / 2, S = c?.stroke || a.cssVar["--color"], N = c?.labelColor || a.cssVar["--color"], D = "s-" + n, _ = e.markdown ? e.markdown(o, t) : o;
|
|
2461
|
-
y ===
|
|
2462
|
-
const
|
|
2463
|
-
return
|
|
2464
|
-
},
|
|
2457
|
+
y === B.LHS ? (b = Je(`M ${v + 10} ${T} c -5 0 -10 5 -10 10 L ${v} ${E - 10} c 0 5 5 10 10 10 M ${v} ${C} h -10`, S), x = ye(_, v - 20, C, { anchor: "end", color: N, dataType: "summary", svgId: D })) : (b = Je(`M ${p - 10} ${T} c 5 0 10 5 10 10 L ${p} ${E - 10} c 0 5 -5 10 -10 10 M ${p} ${C} h 10`, S), x = ye(_, p + 20, C, { anchor: "start", color: N, dataType: "summary", svgId: D }));
|
|
2458
|
+
const R = wo(D);
|
|
2459
|
+
return R.appendChild(b), e.labelContainer.appendChild(x), fe(x), R.summaryObj = t, R.labelEl = x, d.appendChild(R), R;
|
|
2460
|
+
}, Eo = function(e = {}) {
|
|
2465
2461
|
if (!this.currentNodes) return;
|
|
2466
|
-
const { currentNodes: t, summaries: n, bus: o } = this, { parent: s, start: i, end: l } =
|
|
2462
|
+
const { currentNodes: t, summaries: n, bus: o } = this, { parent: s, start: i, end: l } = bo(t), c = { id: V(), parent: s, start: i, end: l, label: "summary", style: e.style }, r = Me(this, c);
|
|
2467
2463
|
n.push(c), this.editSummary(r), o.fire("operation", {
|
|
2468
2464
|
name: "createSummary",
|
|
2469
2465
|
obj: c
|
|
2470
2466
|
});
|
|
2471
|
-
},
|
|
2467
|
+
}, So = function(e) {
|
|
2472
2468
|
const t = V(), n = { ...e, id: t };
|
|
2473
2469
|
Me(this, n), this.summaries.push(n), this.bus.fire("operation", {
|
|
2474
2470
|
name: "createSummary",
|
|
2475
2471
|
obj: n
|
|
2476
2472
|
});
|
|
2477
|
-
},
|
|
2473
|
+
}, No = function(e) {
|
|
2478
2474
|
const t = this.summaries.findIndex((n) => n.id === e);
|
|
2479
2475
|
t > -1 && (this.summaries.splice(t, 1), this.nodes.querySelector("#s-" + e)?.remove(), this.nodes.querySelector("#label-s-" + e)?.remove()), this.bus.fire("operation", {
|
|
2480
2476
|
name: "removeSummary",
|
|
2481
2477
|
obj: { id: e }
|
|
2482
2478
|
});
|
|
2483
|
-
},
|
|
2479
|
+
}, ko = function(e) {
|
|
2484
2480
|
const t = e.labelEl;
|
|
2485
2481
|
t && t.classList.add("selected"), this.currentSummary = e;
|
|
2486
|
-
},
|
|
2482
|
+
}, To = function() {
|
|
2487
2483
|
this.currentSummary?.labelEl?.classList.remove("selected"), this.currentSummary = null;
|
|
2488
|
-
},
|
|
2484
|
+
}, _o = function() {
|
|
2489
2485
|
this.summarySvg.innerHTML = "", this.summaries.forEach((e) => {
|
|
2490
2486
|
try {
|
|
2491
2487
|
Me(this, e);
|
|
2492
2488
|
} catch {
|
|
2493
2489
|
}
|
|
2494
2490
|
}), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
|
|
2495
|
-
},
|
|
2491
|
+
}, Lo = function(e) {
|
|
2496
2492
|
e && e.labelEl && at(this, e.labelEl, e.summaryObj);
|
|
2497
|
-
},
|
|
2493
|
+
}, Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2498
2494
|
__proto__: null,
|
|
2499
|
-
createSummary:
|
|
2500
|
-
createSummaryFrom:
|
|
2501
|
-
editSummary:
|
|
2502
|
-
removeSummary:
|
|
2503
|
-
renderSummary:
|
|
2504
|
-
selectSummary:
|
|
2505
|
-
unselectSummary:
|
|
2495
|
+
createSummary: Eo,
|
|
2496
|
+
createSummaryFrom: So,
|
|
2497
|
+
editSummary: Lo,
|
|
2498
|
+
removeSummary: No,
|
|
2499
|
+
renderSummary: _o,
|
|
2500
|
+
selectSummary: ko,
|
|
2501
|
+
unselectSummary: To
|
|
2506
2502
|
}, Symbol.toStringTag, { value: "Module" })), P = "http://www.w3.org/2000/svg";
|
|
2507
|
-
function
|
|
2503
|
+
function Do(e, t) {
|
|
2508
2504
|
const n = document.createElementNS(P, "svg");
|
|
2509
2505
|
return A(n, {
|
|
2510
2506
|
version: "1.1",
|
|
@@ -2513,10 +2509,10 @@ function Mo(e, t) {
|
|
|
2513
2509
|
width: t
|
|
2514
2510
|
}), n;
|
|
2515
2511
|
}
|
|
2516
|
-
function
|
|
2512
|
+
function Mo(e, t) {
|
|
2517
2513
|
return (parseInt(e) - parseInt(t)) / 2;
|
|
2518
2514
|
}
|
|
2519
|
-
function
|
|
2515
|
+
function Po(e, t, n, o) {
|
|
2520
2516
|
const s = document.createElementNS(P, "g");
|
|
2521
2517
|
let i = "";
|
|
2522
2518
|
return e.text ? i = e.text.textContent : i = e.childNodes[0].textContent, i.split(`
|
|
@@ -2524,7 +2520,7 @@ function Oo(e, t, n, o) {
|
|
|
2524
2520
|
const a = document.createElementNS(P, "text");
|
|
2525
2521
|
A(a, {
|
|
2526
2522
|
x: n + parseInt(t.paddingLeft) + "",
|
|
2527
|
-
y: o + parseInt(t.paddingTop) +
|
|
2523
|
+
y: o + parseInt(t.paddingTop) + Mo(t.lineHeight, t.fontSize) * (r + 1) + parseFloat(t.fontSize) * (r + 1) + "",
|
|
2528
2524
|
"text-anchor": "start",
|
|
2529
2525
|
"font-family": t.fontFamily,
|
|
2530
2526
|
"font-size": `${t.fontSize}`,
|
|
@@ -2533,7 +2529,7 @@ function Oo(e, t, n, o) {
|
|
|
2533
2529
|
}), a.innerHTML = c, s.appendChild(a);
|
|
2534
2530
|
}), s;
|
|
2535
2531
|
}
|
|
2536
|
-
function
|
|
2532
|
+
function Oo(e, t, n, o) {
|
|
2537
2533
|
let s = "";
|
|
2538
2534
|
e.nodeObj?.dangerouslySetInnerHTML ? s = e.nodeObj.dangerouslySetInnerHTML : e.text ? s = e.text.textContent : s = e.childNodes[0].textContent;
|
|
2539
2535
|
const i = document.createElementNS(P, "foreignObject");
|
|
@@ -2549,7 +2545,7 @@ function $o(e, t, n, o) {
|
|
|
2549
2545
|
style: `font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`
|
|
2550
2546
|
}), l.innerHTML = s, i.appendChild(l), i;
|
|
2551
2547
|
}
|
|
2552
|
-
function
|
|
2548
|
+
function $o(e, t) {
|
|
2553
2549
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = j(e.nodes, t), i = document.createElementNS(P, "rect");
|
|
2554
2550
|
return A(i, {
|
|
2555
2551
|
x: o + "",
|
|
@@ -2579,9 +2575,9 @@ function se(e, t, n = !1) {
|
|
|
2579
2575
|
const c = document.createElementNS(P, "g");
|
|
2580
2576
|
c.appendChild(l);
|
|
2581
2577
|
let r;
|
|
2582
|
-
return n ? r =
|
|
2578
|
+
return n ? r = Oo(t, o, s, i) : r = Po(t, o, s, i), c.appendChild(r), c;
|
|
2583
2579
|
}
|
|
2584
|
-
function
|
|
2580
|
+
function jo(e, t) {
|
|
2585
2581
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = j(e.nodes, t), i = document.createElementNS(P, "a"), l = document.createElementNS(P, "text");
|
|
2586
2582
|
return A(l, {
|
|
2587
2583
|
x: o + "",
|
|
@@ -2593,7 +2589,7 @@ function Ho(e, t) {
|
|
|
2593
2589
|
fill: `${n.color}`
|
|
2594
2590
|
}), l.innerHTML = t.textContent, i.appendChild(l), i.setAttribute("href", t.href), i;
|
|
2595
2591
|
}
|
|
2596
|
-
function
|
|
2592
|
+
function Ho(e, t) {
|
|
2597
2593
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = j(e.nodes, t), i = document.createElementNS(P, "image");
|
|
2598
2594
|
return A(i, {
|
|
2599
2595
|
x: o + "",
|
|
@@ -2603,8 +2599,8 @@ function Ro(e, t) {
|
|
|
2603
2599
|
href: t.src
|
|
2604
2600
|
}), i;
|
|
2605
2601
|
}
|
|
2606
|
-
const ie = 100, Io = '<?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">',
|
|
2607
|
-
const n = e.nodes, o = n.offsetHeight + ie * 2, s = n.offsetWidth + ie * 2, i =
|
|
2602
|
+
const ie = 100, Io = '<?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">', Ro = (e, t = !1) => {
|
|
2603
|
+
const n = e.nodes, o = n.offsetHeight + ie * 2, s = n.offsetWidth + ie * 2, i = Do(o + "px", s + "px"), l = document.createElementNS(P, "svg"), c = document.createElementNS(P, "rect");
|
|
2608
2604
|
A(c, {
|
|
2609
2605
|
x: "0",
|
|
2610
2606
|
y: "0",
|
|
@@ -2621,22 +2617,22 @@ const ie = 100, Io = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC
|
|
|
2621
2617
|
a && l.appendChild(a);
|
|
2622
2618
|
const d = n.querySelector(".summary")?.cloneNode(!0);
|
|
2623
2619
|
return d && l.appendChild(d), n.querySelectorAll("me-tpc").forEach((h) => {
|
|
2624
|
-
h.nodeObj.dangerouslySetInnerHTML ? l.appendChild(se(e, h, !t)) : (l.appendChild(
|
|
2620
|
+
h.nodeObj.dangerouslySetInnerHTML ? l.appendChild(se(e, h, !t)) : (l.appendChild($o(e, h)), l.appendChild(se(e, h.text, !t)));
|
|
2625
2621
|
}), n.querySelectorAll(".tags > span").forEach((h) => {
|
|
2626
2622
|
l.appendChild(se(e, h));
|
|
2627
2623
|
}), n.querySelectorAll(".icons > span").forEach((h) => {
|
|
2628
2624
|
l.appendChild(se(e, h));
|
|
2629
2625
|
}), n.querySelectorAll(".hyper-link").forEach((h) => {
|
|
2630
|
-
l.appendChild(
|
|
2626
|
+
l.appendChild(jo(e, h));
|
|
2631
2627
|
}), n.querySelectorAll("img").forEach((h) => {
|
|
2632
|
-
l.appendChild(
|
|
2628
|
+
l.appendChild(Ho(e, h));
|
|
2633
2629
|
}), A(l, {
|
|
2634
2630
|
x: ie + "",
|
|
2635
2631
|
y: ie + "",
|
|
2636
2632
|
overflow: "visible"
|
|
2637
2633
|
}), i.appendChild(l), i;
|
|
2638
|
-
},
|
|
2639
|
-
function
|
|
2634
|
+
}, Bo = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), Io + e.outerHTML);
|
|
2635
|
+
function Fo(e) {
|
|
2640
2636
|
return new Promise((t, n) => {
|
|
2641
2637
|
const o = new FileReader();
|
|
2642
2638
|
o.onload = (s) => {
|
|
@@ -2646,11 +2642,11 @@ function Yo(e) {
|
|
|
2646
2642
|
}, o.readAsDataURL(e);
|
|
2647
2643
|
});
|
|
2648
2644
|
}
|
|
2649
|
-
const
|
|
2650
|
-
const n =
|
|
2645
|
+
const Yo = function(e = !1, t) {
|
|
2646
|
+
const n = Ro(this, e), o = Bo(n, t);
|
|
2651
2647
|
return new Blob([o], { type: "image/svg+xml" });
|
|
2652
|
-
},
|
|
2653
|
-
const n = this.exportSvg(e, t), o = await
|
|
2648
|
+
}, Wo = async function(e = !1, t) {
|
|
2649
|
+
const n = this.exportSvg(e, t), o = await Fo(n);
|
|
2654
2650
|
return new Promise((s, i) => {
|
|
2655
2651
|
const l = new Image();
|
|
2656
2652
|
l.setAttribute("crossOrigin", "anonymous"), l.onload = () => {
|
|
@@ -2658,12 +2654,12 @@ const Wo = function(e = !1, t) {
|
|
|
2658
2654
|
c.width = l.width, c.height = l.height, c.getContext("2d").drawImage(l, 0, 0), c.toBlob(s, "image/png", 1);
|
|
2659
2655
|
}, l.src = o, l.onerror = i;
|
|
2660
2656
|
});
|
|
2661
|
-
},
|
|
2657
|
+
}, Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2662
2658
|
__proto__: null,
|
|
2663
|
-
exportPng:
|
|
2664
|
-
exportSvg:
|
|
2659
|
+
exportPng: Wo,
|
|
2660
|
+
exportSvg: Yo
|
|
2665
2661
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2666
|
-
function
|
|
2662
|
+
function zo(e, t) {
|
|
2667
2663
|
return async function(...n) {
|
|
2668
2664
|
const o = this.before[t];
|
|
2669
2665
|
o && !await o.apply(this, n) || e.apply(this, n);
|
|
@@ -2672,52 +2668,52 @@ function Go(e, t) {
|
|
|
2672
2668
|
const Ze = Object.keys(it), pt = {};
|
|
2673
2669
|
for (let e = 0; e < Ze.length; e++) {
|
|
2674
2670
|
const t = Ze[e];
|
|
2675
|
-
pt[t] =
|
|
2671
|
+
pt[t] = zo(it[t], t);
|
|
2676
2672
|
}
|
|
2677
|
-
const
|
|
2673
|
+
const Go = {
|
|
2678
2674
|
getObjById: le,
|
|
2679
2675
|
generateNewObj: gt,
|
|
2680
2676
|
layout: mt,
|
|
2681
|
-
linkDiv:
|
|
2677
|
+
linkDiv: Pn,
|
|
2682
2678
|
editTopic: Et,
|
|
2683
2679
|
createWrapper: bt,
|
|
2684
2680
|
createParent: wt,
|
|
2685
2681
|
createChildren: xt,
|
|
2686
2682
|
createTopic: Ct,
|
|
2687
2683
|
findEle: et,
|
|
2688
|
-
changeTheme:
|
|
2684
|
+
changeTheme: to,
|
|
2689
2685
|
...mn,
|
|
2690
2686
|
...pt,
|
|
2691
|
-
...
|
|
2692
|
-
...
|
|
2693
|
-
...
|
|
2687
|
+
...vo,
|
|
2688
|
+
...Ao,
|
|
2689
|
+
...Xo,
|
|
2694
2690
|
init(e) {
|
|
2695
2691
|
if (e = JSON.parse(JSON.stringify(e)), !e || !e.nodeData) return new Error("MindElixir: `data` is required");
|
|
2696
|
-
e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, G(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar &&
|
|
2692
|
+
e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, G(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && Vn(this), this.keypress && xn(this, this.keypress), this.editable && (eo(this), this.disposable.push(Ln())), this.contextMenu && this.disposable.push(On(this, this.contextMenu)), this.allowUndo && this.disposable.push(jn(this)), this.layout(), this.linkDiv(), this.toCenter();
|
|
2697
2693
|
},
|
|
2698
2694
|
destroy() {
|
|
2699
2695
|
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.linkSvgGroup = 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;
|
|
2700
2696
|
}
|
|
2701
2697
|
};
|
|
2702
|
-
function
|
|
2698
|
+
function Vo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, containerHeight: a }) {
|
|
2703
2699
|
let d = t + n / 2;
|
|
2704
2700
|
const h = e + o / 2;
|
|
2705
2701
|
let u;
|
|
2706
|
-
r ===
|
|
2702
|
+
r === B.LHS ? u = i + l : u = i;
|
|
2707
2703
|
const y = s + c / 2, p = (1 - Math.abs(y - h) / a) * 0.25 * (n / 2);
|
|
2708
|
-
return r ===
|
|
2704
|
+
return r === B.LHS ? d = d - n / 10 - p : d = d + n / 10 + p, `M ${d} ${h} Q ${d} ${y} ${u} ${y}`;
|
|
2709
2705
|
}
|
|
2710
|
-
function
|
|
2706
|
+
function qo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, isFirst: a }) {
|
|
2711
2707
|
const d = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
|
|
2712
2708
|
let h = 0, u = 0;
|
|
2713
2709
|
a ? h = e + o / 2 : h = e + o;
|
|
2714
2710
|
const y = s + c;
|
|
2715
2711
|
let v = 0, p = 0, g = 0;
|
|
2716
2712
|
const m = Math.abs(h - y) / 300 * d;
|
|
2717
|
-
return r ===
|
|
2713
|
+
return r === B.LHS ? (g = t, v = g + d, p = g - d, u = i + d, `M ${v} ${h} C ${g} ${h} ${g + m} ${y} ${p} ${y} H ${u}`) : (g = t + n, v = g - d, p = g + d, u = i + l - d, `M ${v} ${h} C ${g} ${h} ${g - m} ${y} ${p} ${y} H ${u}`);
|
|
2718
2714
|
}
|
|
2719
|
-
const
|
|
2720
|
-
function
|
|
2715
|
+
const Ko = "5.9.2";
|
|
2716
|
+
function Uo(e) {
|
|
2721
2717
|
return {
|
|
2722
2718
|
x: 0,
|
|
2723
2719
|
y: 0,
|
|
@@ -2761,13 +2757,13 @@ function I({
|
|
|
2761
2757
|
let S = null;
|
|
2762
2758
|
const N = Object.prototype.toString.call(e);
|
|
2763
2759
|
if (N === "[object HTMLDivElement]" ? S = e : N === "[object String]" && (S = document.querySelector(e)), !S) throw new Error("MindElixir: el is not a valid element");
|
|
2764
|
-
S.style.position = "relative", S.innerHTML = "", this.el = S, this.disposable = [], this.before = a || {}, this.locale = n || "en", this.newTopicName = d || "New Node", this.contextMenu = s ?? !0, this.toolBar = i ?? !0, this.keypress = l ?? !0, this.mouseSelectionButton = c ?? 0, this.direction = t ?? 1, this.editable = o ?? !0, this.allowUndo = h ?? !0, this.scaleSensitivity = m ?? 0.1, this.scaleMax = b ?? 1.4, this.scaleMin = x ?? 0.2, this.generateMainBranch = u ||
|
|
2760
|
+
S.style.position = "relative", S.innerHTML = "", this.el = S, this.disposable = [], this.before = a || {}, this.locale = n || "en", this.newTopicName = d || "New Node", this.contextMenu = s ?? !0, this.toolBar = i ?? !0, this.keypress = l ?? !0, this.mouseSelectionButton = c ?? 0, this.direction = t ?? 1, this.editable = o ?? !0, this.allowUndo = h ?? !0, this.scaleSensitivity = m ?? 0.1, this.scaleMax = b ?? 1.4, this.scaleMin = x ?? 0.2, this.generateMainBranch = u || Vo, this.generateSubBranch = y || qo, this.overflowHidden = v ?? !1, this.alignment = g ?? "root", this.handleWheel = L ?? !0, this.markdown = T || void 0, this.imageProxy = E || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = Uo(this), this.bus = Dn(), this.container = document.createElement("div"), this.selectionContainer = r || this.container, this.container.className = "map-container";
|
|
2765
2761
|
const D = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2766
2762
|
this.theme = p || (D.matches ? we : be);
|
|
2767
2763
|
const _ = document.createElement("div");
|
|
2768
|
-
_.className = "map-canvas", this.map = _, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = Q("lines"), this.summarySvg = Q("summary"), this.linkController = Q("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 =
|
|
2764
|
+
_.className = "map-canvas", this.map = _, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = Q("lines"), this.summarySvg = Q("summary"), this.linkController = Q("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 = Re(), this.line2 = Re(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = Q("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(An(this)), C && (this.pasteHandler = C);
|
|
2769
2765
|
}
|
|
2770
|
-
I.prototype =
|
|
2766
|
+
I.prototype = Go;
|
|
2771
2767
|
Object.defineProperty(I.prototype, "currentNode", {
|
|
2772
2768
|
get() {
|
|
2773
2769
|
return this.currentNodes[this.currentNodes.length - 1];
|
|
@@ -2779,7 +2775,7 @@ I.RIGHT = 1;
|
|
|
2779
2775
|
I.SIDE = 2;
|
|
2780
2776
|
I.THEME = be;
|
|
2781
2777
|
I.DARK_THEME = we;
|
|
2782
|
-
I.version =
|
|
2778
|
+
I.version = Ko;
|
|
2783
2779
|
I.E = et;
|
|
2784
2780
|
I.new = (e) => ({
|
|
2785
2781
|
nodeData: {
|
|
@@ -2790,9 +2786,9 @@ I.new = (e) => ({
|
|
|
2790
2786
|
});
|
|
2791
2787
|
export {
|
|
2792
2788
|
we as DARK_THEME,
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2789
|
+
Jo as LEFT,
|
|
2790
|
+
Zo as RIGHT,
|
|
2791
|
+
Qo as SIDE,
|
|
2796
2792
|
be as THEME,
|
|
2797
2793
|
I as default
|
|
2798
2794
|
};
|