mind-elixir 5.12.2-beta.3 → 5.12.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.css +1 -1
- package/dist/MindElixir.iife.js +4 -4
- package/dist/MindElixir.js +83 -82
- package/dist/MindElixirLite.css +1 -1
- package/dist/MindElixirLite.iife.js +4 -4
- package/dist/MindElixirLite.js +105 -104
- package/dist/types/index.d.ts +1 -1
- package/dist/types/methods.d.ts +1 -1
- package/dist/types/utils/theme.d.ts +1 -1
- package/package.json +1 -1
package/dist/MindElixirLite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const Wn = 0, Yn = 1, Rn = 2,
|
|
1
|
+
const Wn = 0, Yn = 1, Rn = 2, tt = {
|
|
2
2
|
name: "Latte",
|
|
3
3
|
type: "light",
|
|
4
4
|
palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
|
|
@@ -12,6 +12,8 @@ const Wn = 0, Yn = 1, Rn = 2, G = {
|
|
|
12
12
|
"--root-color": "#ffffff",
|
|
13
13
|
"--root-bgcolor": "#4c4f69",
|
|
14
14
|
"--root-border-color": "rgba(0, 0, 0, 0)",
|
|
15
|
+
"--main-border": "",
|
|
16
|
+
// you can customize, it will fallback to 2px solid main-color
|
|
15
17
|
"--main-color": "#444446",
|
|
16
18
|
"--main-bgcolor": "#ffffff",
|
|
17
19
|
"--main-bgcolor-transparent": "rgba(255, 255, 255, 0.8)",
|
|
@@ -39,6 +41,7 @@ const Wn = 0, Yn = 1, Rn = 2, G = {
|
|
|
39
41
|
"--root-color": "#ffffff",
|
|
40
42
|
"--root-bgcolor": "#2d3748",
|
|
41
43
|
"--root-border-color": "rgba(255, 255, 255, 0.1)",
|
|
44
|
+
"--main-border": "",
|
|
42
45
|
"--main-color": "#ffffff",
|
|
43
46
|
"--main-bgcolor": "#4c4f69",
|
|
44
47
|
"--main-bgcolor-transparent": "rgba(76, 79, 105, 0.8)",
|
|
@@ -56,12 +59,12 @@ const Wn = 0, Yn = 1, Rn = 2, G = {
|
|
|
56
59
|
function It(t) {
|
|
57
60
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
58
61
|
}
|
|
59
|
-
const
|
|
62
|
+
const G = function(t, e) {
|
|
60
63
|
if (e.id === t)
|
|
61
64
|
return e;
|
|
62
65
|
if (e.children && e.children.length) {
|
|
63
66
|
for (let n = 0; n < e.children.length; n++) {
|
|
64
|
-
const o =
|
|
67
|
+
const o = G(t, e.children[n]);
|
|
65
68
|
if (o) return o;
|
|
66
69
|
}
|
|
67
70
|
return null;
|
|
@@ -76,7 +79,7 @@ const _ = function(t, e) {
|
|
|
76
79
|
wt(o, e);
|
|
77
80
|
});
|
|
78
81
|
};
|
|
79
|
-
function
|
|
82
|
+
function _(t, e, n, o) {
|
|
80
83
|
const s = n - t, i = o - e, c = Math.atan2(i, s) * 180 / Math.PI, l = 12, a = 30, f = (c + 180 - a) * Math.PI / 180, d = (c + 180 + a) * Math.PI / 180;
|
|
81
84
|
return {
|
|
82
85
|
x1: n + Math.cos(f) * l,
|
|
@@ -102,10 +105,10 @@ const Ot = function() {
|
|
|
102
105
|
}, D = (t, e) => {
|
|
103
106
|
for (const n in e)
|
|
104
107
|
t.setAttribute(n, e[n]);
|
|
105
|
-
},
|
|
108
|
+
}, J = (t) => t ? t.tagName === "ME-TPC" : !1, ot = (t) => {
|
|
106
109
|
const e = /translate3d\(([^,]+),\s*([^,]+)/, n = t.match(e);
|
|
107
110
|
return n ? { x: parseFloat(n[1]), y: parseFloat(n[2]) } : { x: 0, y: 0 };
|
|
108
|
-
},
|
|
111
|
+
}, bt = function(t) {
|
|
109
112
|
for (let e = 0; e < t.length; e++) {
|
|
110
113
|
const { dom: n, evt: o, func: s } = t[e];
|
|
111
114
|
n.addEventListener(o, s);
|
|
@@ -121,11 +124,11 @@ const Ot = function() {
|
|
|
121
124
|
return Math.sqrt(n * n + o * o);
|
|
122
125
|
}, Bt = function(t, e) {
|
|
123
126
|
if (!e)
|
|
124
|
-
return
|
|
127
|
+
return j(t), t;
|
|
125
128
|
let n = t.querySelector(".insert-preview");
|
|
126
129
|
const o = `insert-preview ${e} show`;
|
|
127
130
|
return n || (n = document.createElement("div"), t.appendChild(n)), n.className = o, t;
|
|
128
|
-
},
|
|
131
|
+
}, j = function(t) {
|
|
129
132
|
if (!t) return;
|
|
130
133
|
const e = t.querySelectorAll(".insert-preview");
|
|
131
134
|
for (const n of e || [])
|
|
@@ -177,11 +180,11 @@ function ft(t, e, n, o = !1) {
|
|
|
177
180
|
if (e.startX = n.clientX, e.startY = n.clientY, e.pointerId = n.pointerId, t.dragged = t.currentNodes, o) {
|
|
178
181
|
xt(t, e);
|
|
179
182
|
const i = t.container.getBoundingClientRect();
|
|
180
|
-
|
|
183
|
+
vt(e.ghost, n.clientX - i.x, n.clientY - i.y);
|
|
181
184
|
}
|
|
182
185
|
return !0;
|
|
183
186
|
}
|
|
184
|
-
function
|
|
187
|
+
function vt(t, e, n) {
|
|
185
188
|
t.style.transform = `translate(${e - 10}px, ${n - 10}px)`, t.style.display = "block";
|
|
186
189
|
}
|
|
187
190
|
function xt(t, e) {
|
|
@@ -199,7 +202,7 @@ function Vt(t, e, n) {
|
|
|
199
202
|
const s = n.clientX - e.startX, i = n.clientY - e.startY, r = Math.sqrt(s * s + i * i);
|
|
200
203
|
if (!e.isDragging && r > Xt && xt(t, e), !e.isDragging) return;
|
|
201
204
|
const c = t.container.getBoundingClientRect();
|
|
202
|
-
|
|
205
|
+
vt(e.ghost, n.clientX - c.x, n.clientY - c.y), n.clientX < c.x + 50 ? e.edgeMoveController.move(1, 0) : n.clientX > c.x + c.width - 50 ? e.edgeMoveController.move(-1, 0) : n.clientY < c.y + 50 ? e.edgeMoveController.move(0, 1) : n.clientY > c.y + c.height - 50 ? e.edgeMoveController.move(0, -1) : e.edgeMoveController.stop(), j(e.meet);
|
|
203
206
|
const l = 12 * t.scaleVal, a = document.elementFromPoint(n.clientX, n.clientY - l);
|
|
204
207
|
if (dt(a, o)) {
|
|
205
208
|
e.meet = a;
|
|
@@ -222,7 +225,7 @@ function zt(t, e, n) {
|
|
|
222
225
|
e.edgeMoveController.stop();
|
|
223
226
|
for (const s of o)
|
|
224
227
|
s.parentElement.parentElement.style.opacity = "1";
|
|
225
|
-
e.ghost.style.display = "none", e.ghost.innerHTML = "", e.isDragging && e.meet && (
|
|
228
|
+
e.ghost.style.display = "none", e.ghost.innerHTML = "", e.isDragging && e.meet && (j(e.meet), e.insertType === "before" ? t.moveNodeBefore(o, e.meet) : e.insertType === "after" ? t.moveNodeAfter(o, e.meet) : e.insertType === "in" && t.moveNodeIn(o, e.meet)), t.dragged = null, e.isDragging = !1, e.insertType = null, e.meet = null, e.pointerId = null;
|
|
226
229
|
}
|
|
227
230
|
}
|
|
228
231
|
function ut(t, e) {
|
|
@@ -231,7 +234,7 @@ function ut(t, e) {
|
|
|
231
234
|
e.edgeMoveController.stop();
|
|
232
235
|
for (const o of n)
|
|
233
236
|
o.parentElement.parentElement.style.opacity = "1";
|
|
234
|
-
e.meet &&
|
|
237
|
+
e.meet && j(e.meet), e.ghost.style.display = "none", e.ghost.innerHTML = "", t.dragged = null, e.isDragging = !1, e.insertType = null, e.meet = null, e.pointerId = null;
|
|
235
238
|
}
|
|
236
239
|
}
|
|
237
240
|
const O = {
|
|
@@ -465,9 +468,9 @@ const ee = function(t, e = !1) {
|
|
|
465
468
|
this.direction = 0, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
466
469
|
}, we = function() {
|
|
467
470
|
this.direction = 1, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
468
|
-
},
|
|
471
|
+
}, be = function() {
|
|
469
472
|
this.direction = 2, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
470
|
-
},
|
|
473
|
+
}, ve = function(t, e) {
|
|
471
474
|
const n = t.nodeObj;
|
|
472
475
|
typeof e == "boolean" ? n.expanded = e : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
|
|
473
476
|
const o = t.getBoundingClientRect(), s = {
|
|
@@ -506,14 +509,14 @@ const ee = function(t, e = !1) {
|
|
|
506
509
|
clearSelection: ie,
|
|
507
510
|
disableEdit: ae,
|
|
508
511
|
enableEdit: le,
|
|
509
|
-
expandNode:
|
|
512
|
+
expandNode: ve,
|
|
510
513
|
expandNodeAll: xe,
|
|
511
514
|
focusNode: ge,
|
|
512
515
|
getData: ce,
|
|
513
516
|
getDataString: re,
|
|
514
517
|
initLeft: ye,
|
|
515
518
|
initRight: we,
|
|
516
|
-
initSide:
|
|
519
|
+
initSide: be,
|
|
517
520
|
install: pe,
|
|
518
521
|
move: fe,
|
|
519
522
|
refresh: Ce,
|
|
@@ -646,7 +649,7 @@ function ke(t) {
|
|
|
646
649
|
}, d = (h) => {
|
|
647
650
|
if (!t.editable) return;
|
|
648
651
|
const m = h.target;
|
|
649
|
-
if (
|
|
652
|
+
if (J(m)) {
|
|
650
653
|
t.selectNode(m), t.beginEdit(m);
|
|
651
654
|
return;
|
|
652
655
|
}
|
|
@@ -663,7 +666,7 @@ function ke(t) {
|
|
|
663
666
|
return;
|
|
664
667
|
}
|
|
665
668
|
if (e.handlePointerDown(h), e.mousedown && (t.ptState = i.Pan), h.button === 0 || h.pointerType === "touch")
|
|
666
|
-
if (
|
|
669
|
+
if (J(m)) {
|
|
667
670
|
t.selection?.cancel();
|
|
668
671
|
const E = t.currentNodes || [];
|
|
669
672
|
if (h.ctrlKey || h.metaKey || t.mobileMultiSelect ? E.includes(m) ? o = m : ((t.currentArrow || t.currentSummary) && t.clearSelection(), t.selection?.select(m)) : E.includes(m) || t.selectNode(m), !t.editable) return;
|
|
@@ -708,27 +711,27 @@ function ke(t) {
|
|
|
708
711
|
h.preventDefault(), h.button === 2 && t.editable && setTimeout(() => {
|
|
709
712
|
if (t.panHelper.moved || t.ptState !== i.Idle && t.ptState !== i.Pan) return;
|
|
710
713
|
const m = h.target;
|
|
711
|
-
|
|
714
|
+
J(m) && !m.classList.contains("selected") && t.selectNode(m), t.bus.fire("showContextMenu", h);
|
|
712
715
|
}, 200);
|
|
713
|
-
},
|
|
716
|
+
}, v = (h) => {
|
|
714
717
|
if (h.stopPropagation(), h.preventDefault(), h.ctrlKey || h.metaKey) return Pe(t, h);
|
|
715
718
|
if (h.shiftKey) return t.move(-h.deltaY, 0);
|
|
716
719
|
t.move(-h.deltaX, -h.deltaY);
|
|
717
|
-
},
|
|
720
|
+
}, b = (h) => {
|
|
718
721
|
h.code === "Space" && (t.spacePressed = !0, t.container.classList.add("space-pressed"));
|
|
719
722
|
}, C = (h) => {
|
|
720
723
|
h.code === "Space" && (t.spacePressed = !1, t.container.classList.remove("space-pressed"));
|
|
721
724
|
};
|
|
722
|
-
return
|
|
725
|
+
return bt([
|
|
723
726
|
{ dom: n, evt: "pointerdown", func: p },
|
|
724
727
|
{ dom: n, evt: "pointermove", func: w },
|
|
725
728
|
{ dom: n, evt: "pointerup", func: y },
|
|
726
729
|
{ dom: n, evt: "pointercancel", func: u },
|
|
727
730
|
{ dom: n, evt: "click", func: f },
|
|
728
731
|
{ dom: n, evt: "contextmenu", func: g },
|
|
729
|
-
{ dom: n, evt: "wheel", func: typeof t.handleWheel == "function" ? t.handleWheel :
|
|
732
|
+
{ dom: n, evt: "wheel", func: typeof t.handleWheel == "function" ? t.handleWheel : v },
|
|
730
733
|
{ dom: n, evt: "blur", func: u },
|
|
731
|
-
{ dom: n, evt: "keydown", func:
|
|
734
|
+
{ dom: n, evt: "keydown", func: b },
|
|
732
735
|
{ dom: n, evt: "keyup", func: C }
|
|
733
736
|
]);
|
|
734
737
|
}
|
|
@@ -756,11 +759,11 @@ function Ne() {
|
|
|
756
759
|
}
|
|
757
760
|
};
|
|
758
761
|
}
|
|
759
|
-
const k = "http://www.w3.org/2000/svg",
|
|
762
|
+
const k = "http://www.w3.org/2000/svg", U = function(t) {
|
|
760
763
|
const e = t.clientWidth, n = t.clientHeight, o = t.dataset, s = Number(o.x), i = Number(o.y), r = o.anchor;
|
|
761
764
|
let c = s;
|
|
762
765
|
r === "middle" ? c = s - e / 2 : r === "end" && (c = s - e), t.style.left = `${c}px`, t.style.top = `${i - n / 2}px`, t.style.visibility = "visible";
|
|
763
|
-
},
|
|
766
|
+
}, Q = function(t, e, n, o) {
|
|
764
767
|
const { anchor: s = "middle", color: i, dataType: r, svgId: c } = o, l = document.createElement("div");
|
|
765
768
|
l.className = "svg-label", l.style.color = i || "#666";
|
|
766
769
|
const a = "label-" + c;
|
|
@@ -830,7 +833,7 @@ const k = "http://www.w3.org/2000/svg", K = function(t) {
|
|
|
830
833
|
}), s.addEventListener("blur", () => {
|
|
831
834
|
if (!s) return;
|
|
832
835
|
const i = s.innerText?.trim() || "";
|
|
833
|
-
i === "" ? n.label = o : n.label = i, e.style.opacity = "1", s.remove(), i !== o && (t.markdown ? e.innerHTML = t.markdown(n.label, n) : e.textContent = n.label,
|
|
836
|
+
i === "" ? n.label = o : n.label = i, e.style.opacity = "1", s.remove(), i !== o && (t.markdown ? e.innerHTML = t.markdown(n.label, n) : e.textContent = n.label, U(e), "parent" in n ? t.bus.fire("operation", {
|
|
834
837
|
name: "finishEditSummary",
|
|
835
838
|
obj: n
|
|
836
839
|
}) : t.bus.fire("operation", {
|
|
@@ -842,11 +845,11 @@ const k = "http://www.w3.org/2000/svg", K = function(t) {
|
|
|
842
845
|
const e = this.map.querySelector("me-root"), n = e.offsetTop, o = e.offsetLeft, s = e.offsetWidth, i = e.offsetHeight, r = this.map.querySelectorAll("me-main > me-wrapper");
|
|
843
846
|
this.lines.innerHTML = "";
|
|
844
847
|
for (let c = 0; c < r.length; c++) {
|
|
845
|
-
const l = r[c], a = l.querySelector("me-tpc"), { offsetLeft: f, offsetTop: d } = P(this.nodes, a), p = a.offsetWidth, w = a.offsetHeight, y = l.parentNode.className, u = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: d, cL: f, cW: p, cH: w, direction: y, containerHeight: this.nodes.offsetHeight }), g = this.theme.palette,
|
|
846
|
-
if (a.style.borderColor =
|
|
848
|
+
const l = r[c], a = l.querySelector("me-tpc"), { offsetLeft: f, offsetTop: d } = P(this.nodes, a), p = a.offsetWidth, w = a.offsetHeight, y = l.parentNode.className, u = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: d, cL: f, cW: p, cH: w, direction: y, containerHeight: this.nodes.offsetHeight }), g = this.theme.palette, v = a.nodeObj.branchColor || g[c % g.length];
|
|
849
|
+
if (a.style.borderColor = v, this.lines.appendChild(Dt(u, v, "3")), t && t !== l)
|
|
847
850
|
continue;
|
|
848
|
-
const
|
|
849
|
-
C.tagName === "svg" && C.remove(), l.appendChild(
|
|
851
|
+
const b = W("subLines"), C = l.lastChild;
|
|
852
|
+
C.tagName === "svg" && C.remove(), l.appendChild(b), Mt(this, b, v, l, y, !0);
|
|
850
853
|
}
|
|
851
854
|
this.labelContainer.innerHTML = "", this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
|
|
852
855
|
}, Mt = function(t, e, n, o, s, i) {
|
|
@@ -854,7 +857,7 @@ const k = "http://www.w3.org/2000/svg", K = function(t) {
|
|
|
854
857
|
if (c.length === 0) return;
|
|
855
858
|
const l = r.offsetTop, a = r.offsetLeft, f = r.offsetWidth, d = r.offsetHeight;
|
|
856
859
|
for (let p = 0; p < c.length; p++) {
|
|
857
|
-
const w = c[p], y = w.firstChild, u = y.offsetTop, g = y.offsetLeft,
|
|
860
|
+
const w = c[p], y = w.firstChild, u = y.offsetTop, g = y.offsetLeft, v = y.offsetWidth, b = y.offsetHeight, C = y.firstChild.nodeObj.branchColor || n, T = t.generateSubBranch({ pT: l, pL: a, pW: f, pH: d, cT: u, cL: g, cW: v, cH: b, direction: s, isFirst: i });
|
|
858
861
|
e.appendChild(Dt(T, C, "2"));
|
|
859
862
|
const h = y.children[1];
|
|
860
863
|
if (h) {
|
|
@@ -930,22 +933,20 @@ function kt({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction:
|
|
|
930
933
|
a ? d = t + o / 2 : d = t + o;
|
|
931
934
|
const w = s + c;
|
|
932
935
|
let y = 0, u = 0, g = 0;
|
|
933
|
-
const
|
|
934
|
-
return l === O.LHS ? (g = e, y = g + f, u = g - f, p = i + f, `M ${y} ${d} C ${g} ${d} ${g +
|
|
936
|
+
const v = Math.abs(d - w) / 300 * f;
|
|
937
|
+
return l === O.LHS ? (g = e, y = g + f, u = g - f, p = i + f, `M ${y} ${d} C ${g} ${d} ${g + v} ${w} ${u} ${w} H ${p}`) : (g = e + n, y = g - f, u = g + f, p = i + r - f, `M ${y} ${d} C ${g} ${d} ${g - v} ${w} ${u} ${w} H ${p}`);
|
|
935
938
|
}
|
|
936
939
|
const Ge = function(t, e = !0) {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
...
|
|
940
|
-
...
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
const l = r[c];
|
|
948
|
-
this.container.style.setProperty(l, i[l]);
|
|
940
|
+
this.theme = t, this.generateMainBranch = this.theme.generateMainBranch || Pt, this.generateSubBranch = this.theme.generateSubBranch || kt;
|
|
941
|
+
const o = {
|
|
942
|
+
...(this.theme.type === "dark" ? et : tt).cssVar,
|
|
943
|
+
...this.theme.cssVar
|
|
944
|
+
};
|
|
945
|
+
this.compact && (o["--node-gap-x"] = "15px", o["--node-gap-y"] = "2px", o["--main-gap-x"] = "30px", o["--main-gap-y"] = "6px");
|
|
946
|
+
const s = Object.keys(o);
|
|
947
|
+
for (let i = 0; i < s.length; i++) {
|
|
948
|
+
const r = s[i];
|
|
949
|
+
this.container.style.setProperty(r, o[r]);
|
|
949
950
|
}
|
|
950
951
|
e && this.refresh();
|
|
951
952
|
}, _e = function(t) {
|
|
@@ -973,7 +974,7 @@ const Ge = function(t, e = !0) {
|
|
|
973
974
|
},
|
|
974
975
|
cb: null,
|
|
975
976
|
init(e, n) {
|
|
976
|
-
this.cb = n, this.handleClear = this.handleClear.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.handlePointerDown = this.handlePointerDown.bind(this), this.destroy =
|
|
977
|
+
this.cb = n, this.handleClear = this.handleClear.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.handlePointerDown = this.handlePointerDown.bind(this), this.destroy = bt([
|
|
977
978
|
{ dom: e, evt: "pointermove", func: this.handlePointerMove },
|
|
978
979
|
{ dom: e, evt: "pointerleave", func: this.handleClear },
|
|
979
980
|
{ dom: e, evt: "pointerup", func: this.handleClear },
|
|
@@ -995,7 +996,7 @@ function At(t, e, n, o, s, i, r, c) {
|
|
|
995
996
|
};
|
|
996
997
|
}
|
|
997
998
|
function je(t, e, n) {
|
|
998
|
-
t && (t.dataset.x = e.toString(), t.dataset.y = n.toString(),
|
|
999
|
+
t && (t.dataset.x = e.toString(), t.dataset.y = n.toString(), U(t));
|
|
999
1000
|
}
|
|
1000
1001
|
function V(t, e, n, o, s) {
|
|
1001
1002
|
D(t, {
|
|
@@ -1013,7 +1014,7 @@ function mt(t, e, n, o, s, i, r, c, l, a) {
|
|
|
1013
1014
|
}
|
|
1014
1015
|
const d = t.querySelectorAll('path[stroke="transparent"]');
|
|
1015
1016
|
d.length > 0 && d[0].setAttribute("d", f);
|
|
1016
|
-
const p =
|
|
1017
|
+
const p = _(i, r, c, l);
|
|
1017
1018
|
if (p) {
|
|
1018
1019
|
const u = `M ${p.x1} ${p.y1} L ${c} ${l} L ${p.x2} ${p.y2}`;
|
|
1019
1020
|
if (t.arrow1.setAttribute("d", u), d.length > 1 && d[1].setAttribute("d", u), a.style) {
|
|
@@ -1022,12 +1023,12 @@ function mt(t, e, n, o, s, i, r, c, l, a) {
|
|
|
1022
1023
|
}
|
|
1023
1024
|
}
|
|
1024
1025
|
if (a.bidirectional) {
|
|
1025
|
-
const u =
|
|
1026
|
+
const u = _(o, s, e, n);
|
|
1026
1027
|
if (u) {
|
|
1027
1028
|
const g = `M ${u.x1} ${u.y1} L ${e} ${n} L ${u.x2} ${u.y2}`;
|
|
1028
1029
|
if (t.arrow2.setAttribute("d", g), d.length > 2 && d[2].setAttribute("d", g), a.style) {
|
|
1029
|
-
const
|
|
1030
|
-
|
|
1030
|
+
const v = a.style;
|
|
1031
|
+
v.stroke && t.arrow2.setAttribute("stroke", v.stroke), v.strokeWidth && t.arrow2.setAttribute("stroke-width", String(v.strokeWidth)), v.strokeLinecap && t.arrow2.setAttribute("stroke-linecap", v.strokeLinecap), v.opacity !== void 0 && t.arrow2.setAttribute("opacity", String(v.opacity));
|
|
1031
1032
|
}
|
|
1032
1033
|
}
|
|
1033
1034
|
}
|
|
@@ -1038,7 +1039,7 @@ function mt(t, e, n, o, s, i, r, c, l, a) {
|
|
|
1038
1039
|
}
|
|
1039
1040
|
nn(t);
|
|
1040
1041
|
}
|
|
1041
|
-
function
|
|
1042
|
+
function q(t, e, n) {
|
|
1042
1043
|
const { offsetLeft: o, offsetTop: s } = P(t.nodes, e), i = e.offsetWidth, r = e.offsetHeight, c = o + i / 2, l = s + r / 2, a = c + n.x, f = l + n.y;
|
|
1043
1044
|
return {
|
|
1044
1045
|
w: i,
|
|
@@ -1061,16 +1062,16 @@ const Ue = function(t, e, n) {
|
|
|
1061
1062
|
const o = P(t.nodes, e), s = P(t.nodes, n), i = o.offsetLeft + e.offsetWidth / 2, r = o.offsetTop + e.offsetHeight / 2, c = s.offsetLeft + n.offsetWidth / 2, l = s.offsetTop + n.offsetHeight / 2, a = c - i, f = l - r, d = Math.sqrt(a * a + f * f), p = Math.max(50, Math.min(200, d * 0.3)), w = Math.abs(a), y = Math.abs(f);
|
|
1062
1063
|
let u, g;
|
|
1063
1064
|
if (d < 150) {
|
|
1064
|
-
const
|
|
1065
|
-
u = { x: 200 *
|
|
1065
|
+
const b = e.closest("me-main").className === "lhs" ? -1 : 1;
|
|
1066
|
+
u = { x: 200 * b, y: 0 }, g = { x: 200 * b, y: 0 };
|
|
1066
1067
|
} else if (w > y * 1.5) {
|
|
1067
|
-
const
|
|
1068
|
-
u = { x:
|
|
1068
|
+
const b = a > 0 ? e.offsetWidth / 2 : -e.offsetWidth / 2, C = a > 0 ? -n.offsetWidth / 2 : n.offsetWidth / 2;
|
|
1069
|
+
u = { x: b + (a > 0 ? p : -p), y: 0 }, g = { x: C + (a > 0 ? -p : p), y: 0 };
|
|
1069
1070
|
} else if (y > w * 1.5) {
|
|
1070
|
-
const
|
|
1071
|
-
u = { x: 0, y:
|
|
1071
|
+
const b = f > 0 ? e.offsetHeight / 2 : -e.offsetHeight / 2, C = f > 0 ? -n.offsetHeight / 2 : n.offsetHeight / 2;
|
|
1072
|
+
u = { x: 0, y: b + (f > 0 ? p : -p) }, g = { x: 0, y: C + (f > 0 ? -p : p) };
|
|
1072
1073
|
} else {
|
|
1073
|
-
const
|
|
1074
|
+
const b = Math.atan2(f, a), C = e.offsetWidth / 2 * Math.cos(b), T = e.offsetHeight / 2 * Math.sin(b), h = -(n.offsetWidth / 2) * Math.cos(b), m = -(n.offsetHeight / 2) * Math.sin(b), x = p * 0.7 * (a > 0 ? 1 : -1), E = p * 0.7 * (f > 0 ? 1 : -1);
|
|
1074
1075
|
u = { x: C + x, y: T + E }, g = { x: h - x, y: m - E };
|
|
1075
1076
|
}
|
|
1076
1077
|
return {
|
|
@@ -1084,24 +1085,24 @@ const Ue = function(t, e, n) {
|
|
|
1084
1085
|
const S = Ue(t, e, n);
|
|
1085
1086
|
o.delta1 = S.delta1, o.delta2 = S.delta2;
|
|
1086
1087
|
}
|
|
1087
|
-
const i =
|
|
1088
|
+
const i = q(t, e, o.delta1), r = q(t, n, o.delta2), { x: c, y: l } = I(i), { ctrlX: a, ctrlY: f } = i, { ctrlX: d, ctrlY: p } = r, { x: w, y } = I(r), u = _(d, p, w, y);
|
|
1088
1089
|
if (!u) return;
|
|
1089
1090
|
const g = `M ${u.x1} ${u.y1} L ${w} ${y} L ${u.x2} ${u.y2}`;
|
|
1090
|
-
let
|
|
1091
|
+
let v = "";
|
|
1091
1092
|
if (o.bidirectional) {
|
|
1092
|
-
const S =
|
|
1093
|
+
const S = _(a, f, c, l);
|
|
1093
1094
|
if (!S) return;
|
|
1094
|
-
|
|
1095
|
+
v = `M ${S.x1} ${S.y1} L ${c} ${l} L ${S.x2} ${S.y2}`;
|
|
1095
1096
|
}
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1098
|
-
const x = t.markdown ? t.markdown(o.label, o) : o.label, E =
|
|
1097
|
+
const b = Ae(`M ${c} ${l} C ${a} ${f} ${d} ${p} ${w} ${y}`, g, v, o.style), { x: C, y: T } = At(c, l, a, f, d, p, w, y), h = o.style?.labelColor || "rgb(235, 95, 82)", m = "a-" + o.id;
|
|
1098
|
+
b.id = m;
|
|
1099
|
+
const x = t.markdown ? t.markdown(o.label, o) : o.label, E = Q(x, C, T, {
|
|
1099
1100
|
anchor: "middle",
|
|
1100
1101
|
color: h,
|
|
1101
1102
|
dataType: "arrow",
|
|
1102
1103
|
svgId: m
|
|
1103
1104
|
});
|
|
1104
|
-
|
|
1105
|
+
b.labelEl = E, b.arrowObj = o, b.dataset.linkid = o.id, t.labelContainer.appendChild(E), t.arrowSvg.appendChild(b), U(E), s || (t.arrows.push(o), t.currentArrow = b, Ht(t, o, i, r));
|
|
1105
1106
|
}, Ke = function(t, e, n = {}) {
|
|
1106
1107
|
const o = {
|
|
1107
1108
|
id: Y(),
|
|
@@ -1115,7 +1116,7 @@ const Ue = function(t, e, n) {
|
|
|
1115
1116
|
obj: o
|
|
1116
1117
|
});
|
|
1117
1118
|
}, Je = function(t) {
|
|
1118
|
-
|
|
1119
|
+
K(this);
|
|
1119
1120
|
const e = { ...t, id: Y() };
|
|
1120
1121
|
it(this, this.findEle(e.from), this.findEle(e.to), e), this.bus.fire("operation", {
|
|
1121
1122
|
name: "createArrow",
|
|
@@ -1124,7 +1125,7 @@ const Ue = function(t, e, n) {
|
|
|
1124
1125
|
}, Ze = function(t) {
|
|
1125
1126
|
let e;
|
|
1126
1127
|
if (t ? e = t : e = this.currentArrow, !e) return;
|
|
1127
|
-
|
|
1128
|
+
K(this);
|
|
1128
1129
|
const n = e.arrowObj.id;
|
|
1129
1130
|
this.arrows = this.arrows.filter((o) => o.id !== n), e.labelEl?.remove(), e.remove(), this.bus.fire("operation", {
|
|
1130
1131
|
name: "removeArrow",
|
|
@@ -1134,11 +1135,11 @@ const Ue = function(t, e, n) {
|
|
|
1134
1135
|
});
|
|
1135
1136
|
}, Qe = function(t) {
|
|
1136
1137
|
this.currentArrow = t;
|
|
1137
|
-
const e = t.arrowObj, n = this.findEle(e.from), o = this.findEle(e.to), s =
|
|
1138
|
+
const e = t.arrowObj, n = this.findEle(e.from), o = this.findEle(e.to), s = q(this, n, e.delta1), i = q(this, o, e.delta2);
|
|
1138
1139
|
this.editable ? Ht(this, e, s, i) : $t(t, Nt), this.bus.fire("selectArrow", e);
|
|
1139
1140
|
}, tn = function() {
|
|
1140
|
-
|
|
1141
|
-
},
|
|
1141
|
+
K(this), this.currentArrow = null, this.bus.fire("unselectArrow");
|
|
1142
|
+
}, Z = function(t, e) {
|
|
1142
1143
|
const n = document.createElementNS(k, "path");
|
|
1143
1144
|
return D(n, {
|
|
1144
1145
|
d: t,
|
|
@@ -1151,11 +1152,11 @@ const Ue = function(t, e, n) {
|
|
|
1151
1152
|
}, $t = function(t, e) {
|
|
1152
1153
|
const n = document.createElementNS(k, "g");
|
|
1153
1154
|
n.setAttribute("class", "arrow-highlight"), n.setAttribute("opacity", "0.45");
|
|
1154
|
-
const o =
|
|
1155
|
+
const o = Z(t.line.getAttribute("d"), e);
|
|
1155
1156
|
n.appendChild(o);
|
|
1156
|
-
const s =
|
|
1157
|
+
const s = Z(t.arrow1.getAttribute("d"), e);
|
|
1157
1158
|
if (n.appendChild(s), t.arrow2.getAttribute("d")) {
|
|
1158
|
-
const i =
|
|
1159
|
+
const i = Z(t.arrow2.getAttribute("d"), e);
|
|
1159
1160
|
n.appendChild(i);
|
|
1160
1161
|
}
|
|
1161
1162
|
t.insertBefore(n, t.firstChild);
|
|
@@ -1167,21 +1168,21 @@ const Ue = function(t, e, n) {
|
|
|
1167
1168
|
if (!e) return;
|
|
1168
1169
|
const n = e.querySelectorAll("path");
|
|
1169
1170
|
n.length >= 1 && n[0].setAttribute("d", t.line.getAttribute("d")), n.length >= 2 && n[1].setAttribute("d", t.arrow1.getAttribute("d")), n.length >= 3 && t.arrow2.getAttribute("d") && n[2].setAttribute("d", t.arrow2.getAttribute("d"));
|
|
1170
|
-
},
|
|
1171
|
+
}, K = function(t) {
|
|
1171
1172
|
t.helper1?.destroy(), t.helper2?.destroy(), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none", t.currentArrow && en(t.currentArrow);
|
|
1172
1173
|
}, Ht = function(t, e, n, o) {
|
|
1173
1174
|
const { linkController: s, P2: i, P3: r, line1: c, line2: l, nodes: a, map: f, currentArrow: d, bus: p } = t;
|
|
1174
1175
|
if (!d) return;
|
|
1175
1176
|
s.style.display = "initial", i.style.display = "initial", r.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(r), $t(d, Nt);
|
|
1176
|
-
let { x: w, y } = I(n), { ctrlX: u, ctrlY: g } = n, { ctrlX:
|
|
1177
|
-
i.style.cssText = `top:${g}px;left:${u}px;`, r.style.cssText = `top:${
|
|
1177
|
+
let { x: w, y } = I(n), { ctrlX: u, ctrlY: g } = n, { ctrlX: v, ctrlY: b } = o, { x: C, y: T } = I(o);
|
|
1178
|
+
i.style.cssText = `top:${g}px;left:${u}px;`, r.style.cssText = `top:${b}px;left:${v}px;`, V(c, w, y, u, g), V(l, v, b, C, T), t.helper1 = gt.create(i), t.helper2 = gt.create(r), t.helper1.init(f, (h, m) => {
|
|
1178
1179
|
u = u + h / t.scaleVal, g = g + m / t.scaleVal;
|
|
1179
1180
|
const x = I({ ...n, ctrlX: u, ctrlY: g });
|
|
1180
|
-
w = x.x, y = x.y, i.style.top = g + "px", i.style.left = u + "px", mt(d, w, y, u, g,
|
|
1181
|
+
w = x.x, y = x.y, i.style.top = g + "px", i.style.left = u + "px", mt(d, w, y, u, g, v, b, C, T, e), V(c, w, y, u, g), e.delta1.x = Math.round(u - n.cx), e.delta1.y = Math.round(g - n.cy), p.fire("updateArrowDelta", e);
|
|
1181
1182
|
}), t.helper2.init(f, (h, m) => {
|
|
1182
|
-
|
|
1183
|
-
const x = I({ ...o, ctrlX:
|
|
1184
|
-
C = x.x, T = x.y, r.style.top =
|
|
1183
|
+
v = v + h / t.scaleVal, b = b + m / t.scaleVal;
|
|
1184
|
+
const x = I({ ...o, ctrlX: v, ctrlY: b });
|
|
1185
|
+
C = x.x, T = x.y, r.style.top = b + "px", r.style.left = v + "px", mt(d, w, y, u, g, v, b, C, T, e), V(l, v, b, C, T), e.delta2.x = Math.round(v - o.cx), e.delta2.y = Math.round(b - o.cy), p.fire("updateArrowDelta", e);
|
|
1185
1186
|
});
|
|
1186
1187
|
};
|
|
1187
1188
|
function on() {
|
|
@@ -1196,10 +1197,10 @@ function on() {
|
|
|
1196
1197
|
this.nodes.appendChild(this.arrowSvg);
|
|
1197
1198
|
}
|
|
1198
1199
|
function sn(t) {
|
|
1199
|
-
|
|
1200
|
+
K(this), t && t.labelEl && Lt(this, t.labelEl, t.arrowObj);
|
|
1200
1201
|
}
|
|
1201
1202
|
function rn() {
|
|
1202
|
-
this.arrows = this.arrows.filter((t) =>
|
|
1203
|
+
this.arrows = this.arrows.filter((t) => G(t.from, this.nodeData) && G(t.to, this.nodeData));
|
|
1203
1204
|
}
|
|
1204
1205
|
const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1205
1206
|
__proto__: null,
|
|
@@ -1266,19 +1267,19 @@ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1266
1267
|
return s.parent ? i = o.closest("me-main").className : i = t.findEle(s.children[n].id).closest("me-main").className, i;
|
|
1267
1268
|
}, rt = function(t, e) {
|
|
1268
1269
|
const { id: n, label: o, parent: s, start: i, end: r, style: c } = e, { nodes: l, theme: a, summarySvg: f } = t, p = t.findEle(s).nodeObj, w = dn(t, e);
|
|
1269
|
-
let y = 1 / 0, u = 0, g = 0,
|
|
1270
|
+
let y = 1 / 0, u = 0, g = 0, v = 0;
|
|
1270
1271
|
for (let B = i; B <= r; B++) {
|
|
1271
1272
|
const ct = p.children?.[B];
|
|
1272
1273
|
if (!ct)
|
|
1273
1274
|
return t.removeSummary(n), null;
|
|
1274
1275
|
const R = hn(t.findEle(ct.id)), { offsetLeft: X, offsetTop: lt } = P(l, R), at = i === r ? 10 : 20;
|
|
1275
|
-
B === i && (g = lt + at), B === r && (
|
|
1276
|
+
B === i && (g = lt + at), B === r && (v = lt + R.offsetHeight - at), X < y && (y = X), R.offsetWidth + X > u && (u = R.offsetWidth + X);
|
|
1276
1277
|
}
|
|
1277
|
-
let
|
|
1278
|
-
const T = p.parent ? 10 : 0, h = g + T, m =
|
|
1279
|
-
w === O.LHS ? (
|
|
1278
|
+
let b, C;
|
|
1279
|
+
const T = p.parent ? 10 : 0, h = g + T, m = v + T, x = (h + m) / 2, E = c?.stroke || a.cssVar["--color"], S = c?.labelColor || a.cssVar["--color"], M = "s-" + n, N = t.markdown ? t.markdown(o, e) : o;
|
|
1280
|
+
w === O.LHS ? (b = yt(`M ${y + 10} ${h} c -5 0 -10 5 -10 10 L ${y} ${m - 10} c 0 5 5 10 10 10 M ${y} ${x} h -10`, E), C = Q(N, y - 20, x, { anchor: "end", color: S, dataType: "summary", svgId: M })) : (b = yt(`M ${u - 10} ${h} c 5 0 10 5 10 10 L ${u} ${m - 10} c 0 5 -5 10 -10 10 M ${u} ${x} h 10`, E), C = Q(N, u + 20, x, { anchor: "start", color: S, dataType: "summary", svgId: M }));
|
|
1280
1281
|
const $ = an(M);
|
|
1281
|
-
return $.appendChild(
|
|
1282
|
+
return $.appendChild(b), t.labelContainer.appendChild(C), U(C), $.summaryObj = e, $.labelEl = C, f.appendChild($), $;
|
|
1282
1283
|
}, fn = function(t = {}) {
|
|
1283
1284
|
if (!this.currentNodes) return;
|
|
1284
1285
|
const { currentNodes: e, summaries: n, bus: o } = this, { parent: s, start: i, end: r } = ln(e), c = { id: Y(), parent: s, start: i, end: r, label: "summary", style: t.style }, l = rt(this, c);
|
|
@@ -1312,7 +1313,7 @@ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1312
1313
|
}), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
|
|
1313
1314
|
}, wn = function(t) {
|
|
1314
1315
|
t && t.labelEl && Lt(this, t.labelEl, t.summaryObj);
|
|
1315
|
-
},
|
|
1316
|
+
}, bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1316
1317
|
__proto__: null,
|
|
1317
1318
|
createSummary: fn,
|
|
1318
1319
|
createSummaryFrom: un,
|
|
@@ -1322,7 +1323,7 @@ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1322
1323
|
selectSummary: gn,
|
|
1323
1324
|
unselectSummary: mn
|
|
1324
1325
|
}, Symbol.toStringTag, { value: "Module" })), L = "http://www.w3.org/2000/svg";
|
|
1325
|
-
function
|
|
1326
|
+
function vn(t, e) {
|
|
1326
1327
|
const n = document.createElementNS(L, "svg");
|
|
1327
1328
|
return D(n, {
|
|
1328
1329
|
version: "1.1",
|
|
@@ -1422,7 +1423,7 @@ function Dn(t, e) {
|
|
|
1422
1423
|
}), i;
|
|
1423
1424
|
}
|
|
1424
1425
|
const F = 100, Ln = '<?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">', Mn = (t, e = !1) => {
|
|
1425
|
-
const n = t.nodes, o = n.offsetHeight + F * 2, s = n.offsetWidth + F * 2, i =
|
|
1426
|
+
const n = t.nodes, o = n.offsetHeight + F * 2, s = n.offsetWidth + F * 2, i = vn(o + "px", s + "px"), r = document.createElementNS(L, "svg"), c = document.createElementNS(L, "rect");
|
|
1426
1427
|
D(c, {
|
|
1427
1428
|
x: "0",
|
|
1428
1429
|
y: "0",
|
|
@@ -1481,7 +1482,7 @@ const Nn = function(t = !1, e) {
|
|
|
1481
1482
|
exportPng: An,
|
|
1482
1483
|
exportSvg: Nn
|
|
1483
1484
|
}, Symbol.toStringTag, { value: "Module" })), Hn = {}, In = {
|
|
1484
|
-
getObjById:
|
|
1485
|
+
getObjById: G,
|
|
1485
1486
|
generateNewObj: Ot,
|
|
1486
1487
|
layout: Ft,
|
|
1487
1488
|
linkDiv: $e,
|
|
@@ -1496,7 +1497,7 @@ const Nn = function(t = !1, e) {
|
|
|
1496
1497
|
...Se,
|
|
1497
1498
|
...Hn,
|
|
1498
1499
|
...cn,
|
|
1499
|
-
...
|
|
1500
|
+
...bn,
|
|
1500
1501
|
...$n,
|
|
1501
1502
|
init(t) {
|
|
1502
1503
|
if (t = JSON.parse(JSON.stringify(t)), !t || !t.nodeData) return new Error("MindElixir: `data` is required");
|
|
@@ -1512,7 +1513,7 @@ const Nn = function(t = !1, e) {
|
|
|
1512
1513
|
enableMobileMultiSelect(t) {
|
|
1513
1514
|
this.mobileMultiSelect = t;
|
|
1514
1515
|
}
|
|
1515
|
-
}, On = "5.12.2
|
|
1516
|
+
}, On = "5.12.2";
|
|
1516
1517
|
function Bn(t) {
|
|
1517
1518
|
return {
|
|
1518
1519
|
x: 0,
|
|
@@ -1558,8 +1559,8 @@ function A({
|
|
|
1558
1559
|
compact: y,
|
|
1559
1560
|
theme: u,
|
|
1560
1561
|
alignment: g,
|
|
1561
|
-
scaleSensitivity:
|
|
1562
|
-
scaleMax:
|
|
1562
|
+
scaleSensitivity: v,
|
|
1563
|
+
scaleMax: b,
|
|
1563
1564
|
scaleMin: C,
|
|
1564
1565
|
handleWheel: T,
|
|
1565
1566
|
markdown: h,
|
|
@@ -1570,9 +1571,9 @@ function A({
|
|
|
1570
1571
|
let S = null;
|
|
1571
1572
|
const M = Object.prototype.toString.call(t);
|
|
1572
1573
|
if (M === "[object HTMLDivElement]" ? S = t : M === "[object String]" && (S = document.querySelector(t)), !S) throw new Error("MindElixir: el is not a valid element");
|
|
1573
|
-
S.style.position = "relative", S.innerHTML = "", this.el = S, this.disposable = [], this.before = l || {}, this.newTopicName = a || "New Node", this.contextMenu = o ?? !0, this.toolBar = s ?? !0, this.keypress = i ?? !0, this.mouseSelectionButton = r ?? 0, this.direction = e ?? 1, this.editable = n ?? !0, this.allowUndo = f ?? !0, this.scaleSensitivity =
|
|
1574
|
+
S.style.position = "relative", S.innerHTML = "", this.el = S, this.disposable = [], this.before = l || {}, this.newTopicName = a || "New Node", this.contextMenu = o ?? !0, this.toolBar = s ?? !0, this.keypress = i ?? !0, this.mouseSelectionButton = r ?? 0, this.direction = e ?? 1, this.editable = n ?? !0, this.allowUndo = f ?? !0, this.scaleSensitivity = v ?? 0.1, this.scaleMax = b ?? 1.4, this.scaleMin = C ?? 0.2, this.generateMainBranch = d || Pt, this.generateSubBranch = p || kt, this.overflowHidden = w ?? !1, this.compact = y ?? !1, this.alignment = g ?? "root", this.handleWheel = T ?? !0, this.markdown = h || void 0, this.imageProxy = m || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.mobileMultiSelect = E ?? !1, this.panHelper = Bn(this), this.bus = Ne(), this.container = document.createElement("div"), this.selectionContainer = c || this.container, this.container.className = "map-container";
|
|
1574
1575
|
const N = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1575
|
-
this.theme = u || (N.matches ? et :
|
|
1576
|
+
this.theme = u || (N.matches ? et : tt);
|
|
1576
1577
|
const $ = document.createElement("div");
|
|
1577
1578
|
$.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 = W("lines"), this.summarySvg = W("summary"), this.linkController = W("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 = pt(), this.line2 = pt(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.arrowSvg = W("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(ke(this)), x && (this.pasteHandler = x);
|
|
1578
1579
|
}
|
|
@@ -1586,7 +1587,7 @@ Object.defineProperty(A.prototype, "currentNode", {
|
|
|
1586
1587
|
A.LEFT = 0;
|
|
1587
1588
|
A.RIGHT = 1;
|
|
1588
1589
|
A.SIDE = 2;
|
|
1589
|
-
A.THEME =
|
|
1590
|
+
A.THEME = tt;
|
|
1590
1591
|
A.DARK_THEME = et;
|
|
1591
1592
|
A.version = On;
|
|
1592
1593
|
A.E = Ct;
|
|
@@ -1595,6 +1596,6 @@ export {
|
|
|
1595
1596
|
Wn as LEFT,
|
|
1596
1597
|
Yn as RIGHT,
|
|
1597
1598
|
Rn as SIDE,
|
|
1598
|
-
|
|
1599
|
+
tt as THEME,
|
|
1599
1600
|
A as default
|
|
1600
1601
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ declare namespace MindElixir {
|
|
|
84
84
|
createChildren: (this: MindElixirInstance, wrappers: import("./docs").Wrapper[]) => import("./docs").Children;
|
|
85
85
|
createTopic: (this: MindElixirInstance, nodeObj: import("./docs").NodeObj) => Topic;
|
|
86
86
|
findEle: (this: MindElixirInstance, id: string, el?: HTMLElement) => Topic;
|
|
87
|
-
changeTheme: (this: MindElixirInstance, theme:
|
|
87
|
+
changeTheme: (this: MindElixirInstance, theme: import("./docs").Theme, shouldRefresh?: boolean) => void;
|
|
88
88
|
changeCompact: (this: MindElixirInstance, compact: boolean) => void;
|
|
89
89
|
};
|
|
90
90
|
export var LEFT: number;
|
package/dist/types/methods.d.ts
CHANGED
|
@@ -93,7 +93,7 @@ declare const methods: {
|
|
|
93
93
|
createChildren: (this: MindElixirInstance, wrappers: import("./docs").Wrapper[]) => import("./docs").Children;
|
|
94
94
|
createTopic: (this: MindElixirInstance, nodeObj: import("./types").NodeObj) => import("./docs").Topic;
|
|
95
95
|
findEle: (this: MindElixirInstance, id: string, el?: HTMLElement) => import("./docs").Topic;
|
|
96
|
-
changeTheme: (this: MindElixirInstance, theme:
|
|
96
|
+
changeTheme: (this: MindElixirInstance, theme: import("./types").Theme, shouldRefresh?: boolean) => void;
|
|
97
97
|
changeCompact: (this: MindElixirInstance, compact: boolean) => void;
|
|
98
98
|
};
|
|
99
99
|
export default methods;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { MindElixirInstance } from '../types/index';
|
|
2
2
|
import type { Theme } from '../types/index';
|
|
3
|
-
export declare const changeTheme: (this: MindElixirInstance, theme:
|
|
3
|
+
export declare const changeTheme: (this: MindElixirInstance, theme: Theme, shouldRefresh?: boolean) => void;
|
|
4
4
|
export declare const changeCompact: (this: MindElixirInstance, compact: boolean) => void;
|