mind-elixir 4.2.4 → 4.2.5
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 +66 -66
- package/dist/MindElixirLite.iife.js +4 -4
- package/dist/MindElixirLite.js +42 -42
- package/package.json +1 -1
package/dist/MindElixir.js
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
s.readyState == "complete" && (s.onreadystatechange = null, h());
|
|
30
30
|
});
|
|
31
31
|
})(window);
|
|
32
|
-
const T = 0, R = 1, ce = 2, D = 30,
|
|
32
|
+
const T = 0, R = 1, ce = 2, D = 30, ue = {
|
|
33
33
|
name: "Latte",
|
|
34
34
|
palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
|
|
35
35
|
cssVar: {
|
|
@@ -74,10 +74,10 @@ const se = function(e, t) {
|
|
|
74
74
|
for (let n = 0; n < e.children.length; n++)
|
|
75
75
|
$(e.children[n], e);
|
|
76
76
|
};
|
|
77
|
-
function
|
|
77
|
+
function fe(e) {
|
|
78
78
|
if (e.id = G(), e.children)
|
|
79
79
|
for (let t = 0; t < e.children.length; t++)
|
|
80
|
-
|
|
80
|
+
fe(e.children[t]);
|
|
81
81
|
}
|
|
82
82
|
const nt = (e, t) => {
|
|
83
83
|
let n = Date.now();
|
|
@@ -107,7 +107,7 @@ const ot = function() {
|
|
|
107
107
|
id: e
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
|
-
function
|
|
110
|
+
function pe(e) {
|
|
111
111
|
return JSON.parse(
|
|
112
112
|
JSON.stringify(e, (n, o) => {
|
|
113
113
|
if (n !== "parent")
|
|
@@ -222,7 +222,7 @@ const it = {
|
|
|
222
222
|
}, ie = document, rt = function() {
|
|
223
223
|
this.nodes.innerHTML = "";
|
|
224
224
|
const e = this.createTopic(this.nodeData);
|
|
225
|
-
|
|
225
|
+
me(e, this.nodeData), e.draggable = !1;
|
|
226
226
|
const t = ie.createElement("me-root");
|
|
227
227
|
t.appendChild(e);
|
|
228
228
|
const n = this.nodeData.children || [];
|
|
@@ -255,7 +255,7 @@ const it = {
|
|
|
255
255
|
if (!o)
|
|
256
256
|
throw new Error(`FindEle: Node ${e} not found, maybe it's collapsed.`);
|
|
257
257
|
return o;
|
|
258
|
-
},
|
|
258
|
+
}, me = function(e, t) {
|
|
259
259
|
if (e.innerHTML = "", t.style && (e.style.color = t.style.color || "", e.style.background = t.style.background || "", e.style.fontSize = t.style.fontSize + "px", e.style.fontWeight = t.style.fontWeight || "normal"), t.dangerouslySetInnerHTML) {
|
|
260
260
|
e.innerHTML = t.dangerouslySetInnerHTML;
|
|
261
261
|
return;
|
|
@@ -290,7 +290,7 @@ const it = {
|
|
|
290
290
|
}, at = function(e, t) {
|
|
291
291
|
const n = _.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(e);
|
|
292
292
|
if (n.appendChild(o), !t && e.children && e.children.length > 0) {
|
|
293
|
-
const i =
|
|
293
|
+
const i = ge(e.expanded);
|
|
294
294
|
if (o.appendChild(i), e.expanded !== !1) {
|
|
295
295
|
const r = lt(this, e.children);
|
|
296
296
|
n.appendChild(r);
|
|
@@ -299,7 +299,7 @@ const it = {
|
|
|
299
299
|
return { grp: n, top: o, tpc: s };
|
|
300
300
|
}, dt = function(e) {
|
|
301
301
|
const t = _.createElement("me-parent"), n = this.createTopic(e);
|
|
302
|
-
return
|
|
302
|
+
return me(n, e), t.appendChild(n), { p: t, tpc: n };
|
|
303
303
|
}, ht = function(e) {
|
|
304
304
|
const t = _.createElement("me-children");
|
|
305
305
|
return t.append(...e), t;
|
|
@@ -347,7 +347,7 @@ const ft = function(e) {
|
|
|
347
347
|
origin: n
|
|
348
348
|
}));
|
|
349
349
|
});
|
|
350
|
-
},
|
|
350
|
+
}, ge = function(e) {
|
|
351
351
|
const t = _.createElement("me-epd");
|
|
352
352
|
return t.expanded = e !== !1, t.className = e !== !1 ? "minus" : "", t;
|
|
353
353
|
}, K = document, V = "http://www.w3.org/2000/svg", ze = function(e, t, n) {
|
|
@@ -361,7 +361,7 @@ const ft = function(e) {
|
|
|
361
361
|
}, X = function(e) {
|
|
362
362
|
const t = K.createElementNS(V, "svg");
|
|
363
363
|
return t.setAttribute("class", e), t.setAttribute("overflow", "visible"), t;
|
|
364
|
-
},
|
|
364
|
+
}, xe = function() {
|
|
365
365
|
const e = K.createElementNS(V, "line");
|
|
366
366
|
return e.setAttribute("stroke", "#bbb"), e.setAttribute("fill", "none"), e.setAttribute("stroke-width", "2"), e;
|
|
367
367
|
}, pt = function(e, t) {
|
|
@@ -431,7 +431,7 @@ const ft = function(e) {
|
|
|
431
431
|
continue;
|
|
432
432
|
Fe(e, t, b, g, s);
|
|
433
433
|
}
|
|
434
|
-
},
|
|
434
|
+
}, we = {
|
|
435
435
|
addChild: "插入子节点",
|
|
436
436
|
addParent: "插入父节点",
|
|
437
437
|
addSibling: "插入同级节点",
|
|
@@ -443,9 +443,9 @@ const ft = function(e) {
|
|
|
443
443
|
link: "连接",
|
|
444
444
|
clickTips: "请点击目标节点",
|
|
445
445
|
summary: "摘要"
|
|
446
|
-
},
|
|
447
|
-
cn:
|
|
448
|
-
zh_CN:
|
|
446
|
+
}, Ee = {
|
|
447
|
+
cn: we,
|
|
448
|
+
zh_CN: we,
|
|
449
449
|
zh_TW: {
|
|
450
450
|
addChild: "插入子節點",
|
|
451
451
|
addParent: "插入父節點",
|
|
@@ -571,7 +571,7 @@ function gt(e, t) {
|
|
|
571
571
|
}, o = (b, x, w) => {
|
|
572
572
|
const S = document.createElement("li");
|
|
573
573
|
return S.id = b, S.innerHTML = `<span>${oe(x)}</span><span ${w ? 'class="key"' : ""}>${oe(w)}</span>`, S;
|
|
574
|
-
}, s =
|
|
574
|
+
}, s = Ee[e.locale] ? e.locale : "en", i = Ee[s], r = o("cm-add_child", i.addChild, "Tab"), c = o("cm-add_parent", i.addParent, "Ctrl + Enter"), l = o("cm-add_sibling", i.addSibling, "Enter"), h = o("cm-remove_child", i.removeNode, "Delete"), d = o("cm-fucus", i.focus, ""), a = o("cm-unfucus", i.cancelFocus, ""), f = o("cm-up", i.moveUp, "PgUp"), g = o("cm-down", i.moveDown, "Pgdn"), p = o("cm-link", i.link, ""), m = o("cm-summary", i.summary, ""), u = document.createElement("ul");
|
|
575
575
|
if (u.className = "menu-list", u.appendChild(r), u.appendChild(c), u.appendChild(l), u.appendChild(h), (!t || t.focus) && (u.appendChild(d), u.appendChild(a)), u.appendChild(f), u.appendChild(g), u.appendChild(m), (!t || t.link) && u.appendChild(p), t && t.extend)
|
|
576
576
|
for (let b = 0; b < t.extend.length; b++) {
|
|
577
577
|
const x = t.extend[b], w = o(x.name, x.name, x.key || "");
|
|
@@ -649,14 +649,14 @@ const vt = (e) => {
|
|
|
649
649
|
const o = n.firstChild.firstChild.firstChild;
|
|
650
650
|
e.selectNode(o);
|
|
651
651
|
}
|
|
652
|
-
},
|
|
652
|
+
}, Ne = function(e, t) {
|
|
653
653
|
var i, r;
|
|
654
654
|
const n = e.currentNode || ((i = e.currentNodes) == null ? void 0 : i[0]);
|
|
655
655
|
if (!n)
|
|
656
656
|
return;
|
|
657
657
|
const o = n.nodeObj, s = n.offsetParent.offsetParent.parentElement;
|
|
658
658
|
o.parent ? s.className === t ? wt(e, n) : (r = o.parent) != null && r.parent ? xt(e, n) : bt(e) : t === "lhs" ? vt(e) : yt(e);
|
|
659
|
-
},
|
|
659
|
+
}, Ce = function(e, t) {
|
|
660
660
|
var r;
|
|
661
661
|
const n = e.currentNode || ((r = e.currentNodes) == null ? void 0 : r[0]);
|
|
662
662
|
if (!n || !n.nodeObj.parent)
|
|
@@ -698,21 +698,21 @@ function Et(e) {
|
|
|
698
698
|
else {
|
|
699
699
|
if (o.metaKey || o.ctrlKey)
|
|
700
700
|
return e.initSide();
|
|
701
|
-
|
|
701
|
+
Ce(e, "previous");
|
|
702
702
|
}
|
|
703
703
|
},
|
|
704
704
|
ArrowDown: (o) => {
|
|
705
|
-
o.altKey ? e.moveDownNode() :
|
|
705
|
+
o.altKey ? e.moveDownNode() : Ce(e, "next");
|
|
706
706
|
},
|
|
707
707
|
ArrowLeft: (o) => {
|
|
708
708
|
if (o.metaKey || o.ctrlKey)
|
|
709
709
|
return e.initLeft();
|
|
710
|
-
|
|
710
|
+
Ne(e, "lhs");
|
|
711
711
|
},
|
|
712
712
|
ArrowRight: (o) => {
|
|
713
713
|
if (o.metaKey || o.ctrlKey)
|
|
714
714
|
return e.initRight();
|
|
715
|
-
|
|
715
|
+
Ne(e, "rhs");
|
|
716
716
|
},
|
|
717
717
|
PageUp: () => e.moveUpNode(),
|
|
718
718
|
PageDown: () => {
|
|
@@ -764,7 +764,7 @@ const de = document, Nt = function(e, t) {
|
|
|
764
764
|
const t = e.querySelectorAll(".insert-preview");
|
|
765
765
|
for (const n of t || [])
|
|
766
766
|
n.remove();
|
|
767
|
-
},
|
|
767
|
+
}, Se = function(e, t) {
|
|
768
768
|
for (const n of t) {
|
|
769
769
|
const o = n.parentElement.parentElement.contains(e);
|
|
770
770
|
if (!(e && e.tagName === "ME-TPC" && e !== n && !o && e.nodeObj.parent))
|
|
@@ -803,13 +803,13 @@ function St(e) {
|
|
|
803
803
|
return;
|
|
804
804
|
he(o);
|
|
805
805
|
const c = de.elementFromPoint(r.clientX, r.clientY - i);
|
|
806
|
-
if (
|
|
806
|
+
if (Se(c, t)) {
|
|
807
807
|
o = c;
|
|
808
808
|
const l = c.getBoundingClientRect().y;
|
|
809
809
|
r.clientY > l + c.clientHeight ? n = "after" : n = "in";
|
|
810
810
|
} else {
|
|
811
811
|
const l = de.elementFromPoint(r.clientX, r.clientY + i);
|
|
812
|
-
if (
|
|
812
|
+
if (Se(l, t)) {
|
|
813
813
|
o = l;
|
|
814
814
|
const h = l.getBoundingClientRect().y;
|
|
815
815
|
r.clientY < h ? n = "before" : n = "in";
|
|
@@ -919,13 +919,13 @@ class Dt {
|
|
|
919
919
|
this._listeners.clear();
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
|
-
const
|
|
922
|
+
const _e = (e, t = "px") => typeof e == "number" ? e + t : e;
|
|
923
923
|
function j({ style: e }, t, n) {
|
|
924
924
|
if (typeof t == "object")
|
|
925
925
|
for (const [o, s] of Object.entries(t))
|
|
926
|
-
s !== void 0 && (e[o] =
|
|
926
|
+
s !== void 0 && (e[o] = _e(s));
|
|
927
927
|
else
|
|
928
|
-
n !== void 0 && (e[t] =
|
|
928
|
+
n !== void 0 && (e[t] = _e(n));
|
|
929
929
|
}
|
|
930
930
|
const qe = (e) => (t, n, o, s = {}) => {
|
|
931
931
|
t instanceof HTMLCollection || t instanceof NodeList ? t = Array.from(t) : Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
|
|
@@ -939,7 +939,7 @@ const qe = (e) => (t, n, o, s = {}) => {
|
|
|
939
939
|
const { clientX: n, clientY: o, target: s } = ((t = e.touches) == null ? void 0 : t[0]) ?? e;
|
|
940
940
|
return { x: n, y: o, target: s };
|
|
941
941
|
};
|
|
942
|
-
function
|
|
942
|
+
function Me(e, t, n = "touch") {
|
|
943
943
|
switch (n) {
|
|
944
944
|
case "center": {
|
|
945
945
|
const o = t.left + t.width / 2, s = t.top + t.height / 2;
|
|
@@ -993,7 +993,7 @@ function Ht(e, t) {
|
|
|
993
993
|
}
|
|
994
994
|
return !1;
|
|
995
995
|
}
|
|
996
|
-
const { abs: z, max:
|
|
996
|
+
const { abs: z, max: ke, min: Te, ceil: Le } = Math, Ae = (e = []) => ({
|
|
997
997
|
stored: e,
|
|
998
998
|
selected: [],
|
|
999
999
|
touched: [],
|
|
@@ -1002,7 +1002,7 @@ const { abs: z, max: Me, min: ke, ceil: Te } = Math, Le = (e = []) => ({
|
|
|
1002
1002
|
class Ie extends Dt {
|
|
1003
1003
|
constructor(t) {
|
|
1004
1004
|
var n, o, s, i, r;
|
|
1005
|
-
super(), E(this, "_options"), E(this, "_selection",
|
|
1005
|
+
super(), E(this, "_options"), E(this, "_selection", Ae()), E(this, "_area"), E(this, "_clippingElement"), E(this, "_targetElement"), E(this, "_targetBoundary"), E(this, "_targetBoundaryScrolled", !0), E(this, "_targetRect"), E(this, "_selectables", []), E(this, "_latestElement"), E(this, "_areaLocation", { y1: 0, x2: 0, y2: 0, x1: 0 }), E(this, "_areaRect", new DOMRect()), E(this, "_singleClick", !0), E(this, "_frame"), E(this, "_scrollAvailable", !0), E(this, "_scrollingActive", !1), E(this, "_scrollSpeed", { x: 0, y: 0 }), E(this, "_scrollDelta", { x: 0, y: 0 }), E(this, "disable", this._toggleStartEvents.bind(this, !1)), E(this, "enable", this._toggleStartEvents), this._options = {
|
|
1006
1006
|
selectionAreaClass: "selection-area",
|
|
1007
1007
|
selectionContainerClass: void 0,
|
|
1008
1008
|
selectables: [],
|
|
@@ -1069,7 +1069,7 @@ class Ie extends Dt {
|
|
|
1069
1069
|
return;
|
|
1070
1070
|
const f = q(c, r), g = q(l, r);
|
|
1071
1071
|
this._targetElement = g.find(
|
|
1072
|
-
(v) =>
|
|
1072
|
+
(v) => Me(v.getBoundingClientRect(), a)
|
|
1073
1073
|
);
|
|
1074
1074
|
const p = t.composedPath(), m = f.find((v) => p.includes(v));
|
|
1075
1075
|
if (this._targetBoundary = g.find((v) => p.includes(v)), !this._targetElement || !m || !this._targetBoundary || !n && this._emitEvent("beforestart", t) === !1)
|
|
@@ -1154,7 +1154,7 @@ class Ie extends Dt {
|
|
|
1154
1154
|
return;
|
|
1155
1155
|
}
|
|
1156
1156
|
const { scrollTop: a, scrollLeft: f } = c;
|
|
1157
|
-
n.y && (c.scrollTop +=
|
|
1157
|
+
n.y && (c.scrollTop += Le(n.y / r), o.y1 -= c.scrollTop - a), n.x && (c.scrollLeft += Le(n.x / r), o.x1 -= c.scrollLeft - f), i.next(t), requestAnimationFrame(d);
|
|
1158
1158
|
};
|
|
1159
1159
|
requestAnimationFrame(d);
|
|
1160
1160
|
} else
|
|
@@ -1181,7 +1181,7 @@ class Ie extends Dt {
|
|
|
1181
1181
|
let { x2: p, y2: m } = n;
|
|
1182
1182
|
const { behaviour: { scrolling: { startScrollMargins: u } } } = s;
|
|
1183
1183
|
p < a.left + u.x ? (t.x = l ? -z(a.left - p + u.x) : 0, p = p < a.left ? a.left : p) : p > a.right - u.x ? (t.x = h - l - d ? z(a.left + a.width - p - u.x) : 0, p = p > a.right ? a.right : p) : t.x = 0, m < a.top + u.y ? (t.y = i ? -z(a.top - m + u.y) : 0, m = m < a.top ? a.top : m) : m > a.bottom - u.y ? (t.y = r - i - c ? z(a.top + a.height - m - u.y) : 0, m = m > a.bottom ? a.bottom : m) : t.y = 0;
|
|
1184
|
-
const v =
|
|
1184
|
+
const v = Te(f, p), y = Te(g, m), b = ke(f, p), x = ke(g, m);
|
|
1185
1185
|
this._areaRect = new DOMRect(v, y, b - v, x - y);
|
|
1186
1186
|
}
|
|
1187
1187
|
_redrawSelectionArea() {
|
|
@@ -1197,7 +1197,7 @@ class Ie extends Dt {
|
|
|
1197
1197
|
const { _selectables: t, _options: n, _selection: o, _areaRect: s } = this, { stored: i, selected: r, touched: c } = o, { intersect: l, overlap: h } = n.behaviour, d = h === "invert", a = [], f = [], g = [];
|
|
1198
1198
|
for (let m = 0; m < t.length; m++) {
|
|
1199
1199
|
const u = t[m];
|
|
1200
|
-
if (
|
|
1200
|
+
if (Me(s, u.getBoundingClientRect(), l)) {
|
|
1201
1201
|
if (r.includes(u))
|
|
1202
1202
|
i.includes(u) && !c.includes(u) && c.push(u);
|
|
1203
1203
|
else if (d && i.includes(u)) {
|
|
@@ -1279,7 +1279,7 @@ class Ie extends Dt {
|
|
|
1279
1279
|
i.added = [], i.removed.push(
|
|
1280
1280
|
...o,
|
|
1281
1281
|
...t ? s : []
|
|
1282
|
-
), n || (this._emitEvent("move", null), this._emitEvent("stop", null)), this._selection =
|
|
1282
|
+
), n || (this._emitEvent("move", null), this._emitEvent("stop", null)), this._selection = Ae(t ? [] : s);
|
|
1283
1283
|
}
|
|
1284
1284
|
/**
|
|
1285
1285
|
* @returns {Array} Selected elements
|
|
@@ -1378,7 +1378,7 @@ function Bt(e) {
|
|
|
1378
1378
|
e.selection = n;
|
|
1379
1379
|
}
|
|
1380
1380
|
const zt = function(e, t = !0) {
|
|
1381
|
-
this.theme = e;
|
|
1381
|
+
e.cssVar = { ...ue.cssVar, ...e.cssVar }, this.theme = e;
|
|
1382
1382
|
const n = this.theme.cssVar, o = Object.keys(n);
|
|
1383
1383
|
for (let s = 0; s < o.length; s++) {
|
|
1384
1384
|
const i = o[s];
|
|
@@ -1404,7 +1404,7 @@ function Ft(e) {
|
|
|
1404
1404
|
const o = t[n];
|
|
1405
1405
|
n === t.length - 1 ? (t[n] = t[0], t[0] = o) : (t[n] = t[n + 1], t[n + 1] = o);
|
|
1406
1406
|
}
|
|
1407
|
-
function
|
|
1407
|
+
function ve(e) {
|
|
1408
1408
|
const { siblings: t, index: n } = W(e);
|
|
1409
1409
|
return t === void 0 ? 0 : (t.splice(n, 1), t.length);
|
|
1410
1410
|
}
|
|
@@ -1417,7 +1417,7 @@ function It(e, t) {
|
|
|
1417
1417
|
n !== void 0 && (n[o] = t, t.children = [e]);
|
|
1418
1418
|
}
|
|
1419
1419
|
function Ke(e, t, n) {
|
|
1420
|
-
if (
|
|
1420
|
+
if (ve(t), e === "in")
|
|
1421
1421
|
n.children ? n.children.push(t) : n.children = [t];
|
|
1422
1422
|
else {
|
|
1423
1423
|
t.direction !== void 0 && (t.direction = n.direction);
|
|
@@ -1445,7 +1445,7 @@ const Kt = function(e, t) {
|
|
|
1445
1445
|
s.nextSibling.appendChild(n);
|
|
1446
1446
|
else {
|
|
1447
1447
|
const c = e.createChildren([n]);
|
|
1448
|
-
s.appendChild(
|
|
1448
|
+
s.appendChild(ge(!0)), s.insertAdjacentElement("afterend", c);
|
|
1449
1449
|
}
|
|
1450
1450
|
e.linkDiv(n.offsetParent);
|
|
1451
1451
|
} else
|
|
@@ -1464,15 +1464,15 @@ const Kt = function(e, t) {
|
|
|
1464
1464
|
const n = e.parentElement.parentElement.lastElementChild;
|
|
1465
1465
|
(n == null ? void 0 : n.tagName) === "svg" && (n == null || n.remove());
|
|
1466
1466
|
}, Vt = function(e, t) {
|
|
1467
|
-
const n = e.nodeObj, o =
|
|
1467
|
+
const n = e.nodeObj, o = pe(n);
|
|
1468
1468
|
o.style && t.style && (t.style = Object.assign(o.style, t.style));
|
|
1469
1469
|
const s = Object.assign(n, t);
|
|
1470
|
-
|
|
1470
|
+
me(e, s), this.linkDiv(), this.bus.fire("operation", {
|
|
1471
1471
|
name: "reshapeNode",
|
|
1472
1472
|
obj: s,
|
|
1473
1473
|
origin: o
|
|
1474
1474
|
});
|
|
1475
|
-
},
|
|
1475
|
+
}, ye = function(e, t, n) {
|
|
1476
1476
|
if (!t)
|
|
1477
1477
|
return null;
|
|
1478
1478
|
const o = t.nodeObj;
|
|
@@ -1515,7 +1515,7 @@ const Kt = function(e, t) {
|
|
|
1515
1515
|
const s = t || this.generateNewObj();
|
|
1516
1516
|
It(o, s), $(this.nodeData);
|
|
1517
1517
|
const i = n.parentElement.parentElement, { grp: r, top: c } = this.createWrapper(s, !0);
|
|
1518
|
-
c.appendChild(
|
|
1518
|
+
c.appendChild(ge(!0)), i.insertAdjacentElement("afterend", r);
|
|
1519
1519
|
const l = this.createChildren([i]);
|
|
1520
1520
|
c.insertAdjacentElement("afterend", l), this.linkDiv(), t || this.editTopic(c.firstChild), this.selectNode(c.firstChild, !0), this.bus.fire("operation", {
|
|
1521
1521
|
name: "insertParent",
|
|
@@ -1525,7 +1525,7 @@ const Kt = function(e, t) {
|
|
|
1525
1525
|
const n = e || this.currentNode;
|
|
1526
1526
|
if (!n)
|
|
1527
1527
|
return;
|
|
1528
|
-
const o =
|
|
1528
|
+
const o = ye(this, n, t);
|
|
1529
1529
|
if (!o)
|
|
1530
1530
|
return;
|
|
1531
1531
|
const { newTop: s, newNodeObj: i } = o;
|
|
@@ -1534,9 +1534,9 @@ const Kt = function(e, t) {
|
|
|
1534
1534
|
obj: i
|
|
1535
1535
|
}), t || this.editTopic(s.firstChild), this.selectNode(s.firstChild, !0);
|
|
1536
1536
|
}, Xt = function(e, t) {
|
|
1537
|
-
const n =
|
|
1538
|
-
|
|
1539
|
-
const o =
|
|
1537
|
+
const n = pe(e.nodeObj);
|
|
1538
|
+
fe(n);
|
|
1539
|
+
const o = ye(this, t, n);
|
|
1540
1540
|
if (!o)
|
|
1541
1541
|
return;
|
|
1542
1542
|
const { newNodeObj: s } = o;
|
|
@@ -1548,9 +1548,9 @@ const Kt = function(e, t) {
|
|
|
1548
1548
|
e = le(e);
|
|
1549
1549
|
const n = [];
|
|
1550
1550
|
for (let o = 0; o < e.length; o++) {
|
|
1551
|
-
const s = e[o], i =
|
|
1552
|
-
|
|
1553
|
-
const r =
|
|
1551
|
+
const s = e[o], i = pe(s.nodeObj);
|
|
1552
|
+
fe(i);
|
|
1553
|
+
const r = ye(this, t, i);
|
|
1554
1554
|
if (!r)
|
|
1555
1555
|
return;
|
|
1556
1556
|
const { newNodeObj: c } = r;
|
|
@@ -1590,7 +1590,7 @@ const Kt = function(e, t) {
|
|
|
1590
1590
|
const n = t.nodeObj;
|
|
1591
1591
|
if (!n.parent)
|
|
1592
1592
|
throw new Error("Can not remove root node");
|
|
1593
|
-
const o = n.parent.children, s = o.findIndex((c) => c === n), i =
|
|
1593
|
+
const o = n.parent.children, s = o.findIndex((c) => c === n), i = ve(n);
|
|
1594
1594
|
if (We(t, i), o.length !== 0) {
|
|
1595
1595
|
const c = o[s] || o[s - 1];
|
|
1596
1596
|
this.selectNode(C(c.id));
|
|
@@ -1608,7 +1608,7 @@ const Kt = function(e, t) {
|
|
|
1608
1608
|
const n = t.nodeObj;
|
|
1609
1609
|
if (!n.parent)
|
|
1610
1610
|
continue;
|
|
1611
|
-
const o =
|
|
1611
|
+
const o = ve(n);
|
|
1612
1612
|
We(t, o);
|
|
1613
1613
|
}
|
|
1614
1614
|
this.linkDiv(), this.bus.fire("operation", {
|
|
@@ -1812,7 +1812,7 @@ const cn = function(e, t, n) {
|
|
|
1812
1812
|
this.moved = !1, this.mousedown = !1;
|
|
1813
1813
|
}
|
|
1814
1814
|
};
|
|
1815
|
-
},
|
|
1815
|
+
}, je = {
|
|
1816
1816
|
create: Tn
|
|
1817
1817
|
};
|
|
1818
1818
|
function re(e, t, n) {
|
|
@@ -1904,7 +1904,7 @@ const Ln = function(e, t, n, o) {
|
|
|
1904
1904
|
y1: h + "",
|
|
1905
1905
|
x2: d + "",
|
|
1906
1906
|
y2: a + ""
|
|
1907
|
-
}), e.helper1 && (e.helper1.destory(e.map), (f = e.helper2) == null || f.destory(e.map)), e.helper1 =
|
|
1907
|
+
}), e.helper1 && (e.helper1.destory(e.map), (f = e.helper2) == null || f.destory(e.map)), e.helper1 = je.create(e.P2), e.helper2 = je.create(e.P3), e.helper1.init(e.map, (g, p) => {
|
|
1908
1908
|
var y;
|
|
1909
1909
|
r = r + g / e.scaleVal, c = c + p / e.scaleVal;
|
|
1910
1910
|
const m = I({ ...n, ctrlX: r, ctrlY: c });
|
|
@@ -2018,7 +2018,7 @@ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2018
2018
|
}, Rn = function(e) {
|
|
2019
2019
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
2020
2020
|
return t.setAttribute("id", e), t;
|
|
2021
|
-
},
|
|
2021
|
+
}, De = function(e, t) {
|
|
2022
2022
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2023
2023
|
return N(n, {
|
|
2024
2024
|
d: e,
|
|
@@ -2027,7 +2027,7 @@ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2027
2027
|
"stroke-linecap": "round",
|
|
2028
2028
|
"stroke-width": "2"
|
|
2029
2029
|
}), n;
|
|
2030
|
-
},
|
|
2030
|
+
}, $e = function(e, t, n, o, s) {
|
|
2031
2031
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
2032
2032
|
return N(i, {
|
|
2033
2033
|
"text-anchor": o,
|
|
@@ -2048,12 +2048,12 @@ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2048
2048
|
const U = (S = h.children) == null ? void 0 : S[P];
|
|
2049
2049
|
if (!U)
|
|
2050
2050
|
return e.removeSummary(n), null;
|
|
2051
|
-
const H = Fn(U.id), { offsetLeft: Z, offsetTop:
|
|
2052
|
-
P === i && (g =
|
|
2051
|
+
const H = Fn(U.id), { offsetLeft: Z, offsetTop: be } = O(c, H);
|
|
2052
|
+
P === i && (g = be + 20), P === r && (p = be + H.offsetHeight - 20), Z < a && (a = Z), H.offsetWidth + Z > f && (f = H.offsetWidth + Z);
|
|
2053
2053
|
}
|
|
2054
2054
|
let m, u;
|
|
2055
2055
|
const v = g + 10, y = p + 10, b = (v + y) / 2, x = e.theme.cssVar["--color"];
|
|
2056
|
-
d === "lhs" ? (m =
|
|
2056
|
+
d === "lhs" ? (m = De(`M ${a + 10} ${v} c -5 0 -10 5 -10 10 L ${a} ${y - 10} c 0 5 5 10 10 10 M ${a} ${b} h -10`, x), u = $e(o, a - 20, b + 6, "end", x)) : (m = De(`M ${f - 10} ${v} c 5 0 10 5 10 10 L ${f} ${y - 10} c 0 5 -5 10 -10 10 M ${f} ${b} h 10`, x), u = $e(o, f + 20, b + 6, "start", x));
|
|
2057
2057
|
const w = Rn("s-" + n);
|
|
2058
2058
|
return w.appendChild(m), w.appendChild(u), w.summaryObj = t, e.summarySvg.appendChild(w), w;
|
|
2059
2059
|
}, In = function() {
|
|
@@ -2281,9 +2281,9 @@ function ho(e, t) {
|
|
|
2281
2281
|
o && !await o.apply(this, n) || e.apply(this, n);
|
|
2282
2282
|
};
|
|
2283
2283
|
}
|
|
2284
|
-
const
|
|
2285
|
-
for (let e = 0; e <
|
|
2286
|
-
const t =
|
|
2284
|
+
const Oe = Object.keys(Xe), tt = {};
|
|
2285
|
+
for (let e = 0; e < Oe.length; e++) {
|
|
2286
|
+
const t = Oe[e];
|
|
2287
2287
|
tt[t] = ho(Xe[t], t);
|
|
2288
2288
|
}
|
|
2289
2289
|
const uo = {
|
|
@@ -2329,7 +2329,7 @@ function po({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction:
|
|
|
2329
2329
|
const u = Math.abs(d - f) / 300 * D;
|
|
2330
2330
|
return l === "lhs" ? (m = t, g = m + D, p = m - D, a = i + D, `M ${g} ${d} C ${m} ${d} ${m + u} ${f} ${p} ${f} H ${a}`) : (m = t + n, g = m - D, p = m + D, a = i + r - D, `M ${g} ${d} C ${m} ${d} ${m - u} ${f} ${p} ${f} H ${a}`);
|
|
2331
2331
|
}
|
|
2332
|
-
const mo = "4.2.
|
|
2332
|
+
const mo = "4.2.5", Y = document;
|
|
2333
2333
|
function A({
|
|
2334
2334
|
el: e,
|
|
2335
2335
|
direction: t,
|
|
@@ -2356,15 +2356,15 @@ function A({
|
|
|
2356
2356
|
throw new Error("MindElixir: el is not a valid element");
|
|
2357
2357
|
y.className += " mind-elixir", y.innerHTML = "", y.style.setProperty("--gap", D + "px"), this.mindElixirBox = y, this.disposable = [], this.before = a || {}, this.locale = n || "en", this.contextMenuOption = r, this.contextMenu = i === void 0 ? !0 : i, this.toolBar = c === void 0 ? !0 : c, this.keypress = l === void 0 ? !0 : l, this.mouseSelectionButton = h || 0, this.direction = typeof t == "number" ? t : 1, this.draggable = o === void 0 ? !0 : o, this.newTopicName = f || "new node", this.editable = s === void 0 ? !0 : s, this.allowUndo = g === void 0 ? !1 : g, this.currentNode = null, this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.generateMainBranch = p || fo, this.generateSubBranch = m || po, this.overflowHidden = u || !1, this.bus = it.create(), this.container = Y.createElement("div"), this.selectionContainer = d || this.container, this.container.className = "map-container";
|
|
2358
2358
|
const x = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2359
|
-
this.theme = v || (x.matches ? Pe :
|
|
2359
|
+
this.theme = v || (x.matches ? Pe : ue);
|
|
2360
2360
|
const w = Y.createElement("div");
|
|
2361
|
-
w.className = "map-canvas", this.map = w, this.map.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.mindElixirBox.appendChild(this.container), this.nodes = Y.createElement("me-nodes"), this.nodes.className = "main-node-container", this.lines = X("lines"), this.summarySvg = X("summary"), this.linkController = X("linkcontroller"), this.P2 = Y.createElement("div"), this.P3 = Y.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 =
|
|
2361
|
+
w.className = "map-canvas", this.map = w, this.map.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.mindElixirBox.appendChild(this.container), this.nodes = Y.createElement("me-nodes"), this.nodes.className = "main-node-container", this.lines = X("lines"), this.summarySvg = X("summary"), this.linkController = X("linkcontroller"), this.P2 = Y.createElement("div"), this.P3 = Y.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = xe(), this.line2 = xe(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = X("topiclinks"), this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : st(this);
|
|
2362
2362
|
}
|
|
2363
2363
|
A.prototype = uo;
|
|
2364
2364
|
A.LEFT = T;
|
|
2365
2365
|
A.RIGHT = R;
|
|
2366
2366
|
A.SIDE = ce;
|
|
2367
|
-
A.THEME =
|
|
2367
|
+
A.THEME = ue;
|
|
2368
2368
|
A.DARK_THEME = Pe;
|
|
2369
2369
|
A.version = mo;
|
|
2370
2370
|
A.E = C;
|