mind-elixir 5.14.0-beta.0 → 5.14.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MindElixir.iife.js +4 -4
- package/dist/MindElixir.js +152 -160
- package/dist/MindElixirLite.iife.js +4 -4
- package/dist/MindElixirLite.js +211 -219
- package/package.json +1 -1
package/dist/MindElixirLite.js
CHANGED
|
@@ -80,12 +80,12 @@ const j = function(t, e) {
|
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
82
|
function _(t, e, n, o) {
|
|
83
|
-
const s = n - t, i = o - e, c = Math.atan2(i, s) * 180 / Math.PI,
|
|
83
|
+
const s = n - t, i = o - e, c = Math.atan2(i, s) * 180 / Math.PI, a = 12, d = 30, f = (c + 180 - d) * Math.PI / 180, l = (c + 180 + d) * Math.PI / 180;
|
|
84
84
|
return {
|
|
85
|
-
x1: n + Math.cos(f) *
|
|
86
|
-
y1: o + Math.sin(f) *
|
|
87
|
-
x2: n + Math.cos(
|
|
88
|
-
y2: o + Math.sin(
|
|
85
|
+
x1: n + Math.cos(f) * a,
|
|
86
|
+
y1: o + Math.sin(f) * a,
|
|
87
|
+
x2: n + Math.cos(l) * a,
|
|
88
|
+
y2: o + Math.sin(l) * a
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
function X() {
|
|
@@ -212,17 +212,17 @@ function Ft(t, e, n) {
|
|
|
212
212
|
if (!e.isDragging && r > zt && wt(t, e), !e.isDragging) return;
|
|
213
213
|
const c = t.container.getBoundingClientRect();
|
|
214
214
|
xt(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(), q(e.meet);
|
|
215
|
-
const
|
|
216
|
-
if (ft(
|
|
217
|
-
e.meet =
|
|
218
|
-
const f =
|
|
219
|
-
n.clientY >
|
|
215
|
+
const a = 12 * t.scaleVal, d = document.elementFromPoint(n.clientX, n.clientY - a);
|
|
216
|
+
if (ft(d, o)) {
|
|
217
|
+
e.meet = d;
|
|
218
|
+
const f = d.getBoundingClientRect(), l = f.y;
|
|
219
|
+
n.clientY > l + f.height ? e.insertType = "after" : e.insertType = "in";
|
|
220
220
|
} else {
|
|
221
|
-
const f = document.elementFromPoint(n.clientX, n.clientY +
|
|
221
|
+
const f = document.elementFromPoint(n.clientX, n.clientY + a);
|
|
222
222
|
if (ft(f, o)) {
|
|
223
223
|
e.meet = f;
|
|
224
|
-
const
|
|
225
|
-
n.clientY <
|
|
224
|
+
const u = f.getBoundingClientRect().y;
|
|
225
|
+
n.clientY < u ? e.insertType = "before" : e.insertType = "in";
|
|
226
226
|
} else
|
|
227
227
|
e.insertType = null, e.meet = null;
|
|
228
228
|
}
|
|
@@ -366,11 +366,11 @@ const Qt = function(t) {
|
|
|
366
366
|
obj: t.nodeObj
|
|
367
367
|
}), e.addEventListener("keydown", (c) => {
|
|
368
368
|
if (c.stopPropagation(), c.isComposing) return;
|
|
369
|
-
const
|
|
370
|
-
if (
|
|
369
|
+
const a = c.key;
|
|
370
|
+
if (a === "Enter" || a === "Tab") {
|
|
371
371
|
if (c.shiftKey) return;
|
|
372
372
|
c.preventDefault(), e.blur(), this.container.focus();
|
|
373
|
-
} else
|
|
373
|
+
} else a === "Escape" && (c.preventDefault(), e.textContent = o, e.blur(), this.container.focus());
|
|
374
374
|
}), e.addEventListener("blur", () => {
|
|
375
375
|
if (!e) return;
|
|
376
376
|
t.style.opacity = "1", e.remove();
|
|
@@ -402,8 +402,8 @@ function ne(t) {
|
|
|
402
402
|
const oe = function(t, e = !1) {
|
|
403
403
|
const n = this.container, o = t.getBoundingClientRect(), s = n.getBoundingClientRect();
|
|
404
404
|
if (e || o.top > s.bottom - 50 || o.bottom < s.top + 50 || o.left > s.right - 50 || o.right < s.left + 50) {
|
|
405
|
-
const r = o.left + o.width / 2, c = o.top + o.height / 2,
|
|
406
|
-
this.move(-f, -
|
|
405
|
+
const r = o.left + o.width / 2, c = o.top + o.height / 2, a = s.left + s.width / 2, d = s.top + s.height / 2, f = r - a, l = c - d;
|
|
406
|
+
this.move(-f, -l, !0);
|
|
407
407
|
}
|
|
408
408
|
}, se = function(t, e, n) {
|
|
409
409
|
this.clearSelection(), this.scrollIntoView(t), this.selection?.select(t), e && this.bus.fire("selectNewNode", t.nodeObj);
|
|
@@ -429,8 +429,8 @@ const oe = function(t, e = !1) {
|
|
|
429
429
|
this.editable = !1;
|
|
430
430
|
}, fe = function(t, e = { x: 0, y: 0 }) {
|
|
431
431
|
if (t < this.scaleMin && t < this.scaleVal || t > this.scaleMax && t > this.scaleVal) return;
|
|
432
|
-
const n = this.container.getBoundingClientRect(), o = e.x ? e.x - n.left - n.width / 2 : 0, s = e.y ? e.y - n.top - n.height / 2 : 0, { dx: i, dy: r } = it(this), c = this.map.style.transform, { x:
|
|
433
|
-
this.map.style.transform = `translate3d(${
|
|
432
|
+
const n = this.container.getBoundingClientRect(), o = e.x ? e.x - n.left - n.width / 2 : 0, s = e.y ? e.y - n.top - n.height / 2 : 0, { dx: i, dy: r } = it(this), c = this.map.style.transform, { x: a, y: d } = st(c), f = a - i, l = d - r, u = this.scaleVal, g = (-o + f) * (1 - t / u), y = (-s + l) * (1 - t / u);
|
|
433
|
+
this.map.style.transform = `translate3d(${a - g}px, ${d - y}px, 0) scale(${t})`, this.scaleVal = t, this.bus.fire("scale", t);
|
|
434
434
|
}, ue = function() {
|
|
435
435
|
const t = this.nodes.offsetHeight / this.container.offsetHeight, e = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(t, e));
|
|
436
436
|
this.scaleVal = n;
|
|
@@ -440,28 +440,28 @@ const oe = function(t, e = !1) {
|
|
|
440
440
|
const { map: o, scaleVal: s, bus: i, container: r, nodes: c } = this;
|
|
441
441
|
if (n && o.style.transition === "transform 0.3s")
|
|
442
442
|
return;
|
|
443
|
-
const
|
|
444
|
-
let { x:
|
|
445
|
-
const
|
|
446
|
-
if (
|
|
447
|
-
const
|
|
448
|
-
(
|
|
443
|
+
const a = o.style.transform;
|
|
444
|
+
let { x: d, y: f } = st(a);
|
|
445
|
+
const l = r.getBoundingClientRect(), u = c.getBoundingClientRect(), g = u.left < l.right && u.right > l.left, y = u.top < l.bottom && u.bottom > l.top;
|
|
446
|
+
if (g) {
|
|
447
|
+
const p = u.left + t, b = u.right + t;
|
|
448
|
+
(p >= l.right || b <= l.left) && (t = 0);
|
|
449
449
|
}
|
|
450
450
|
if (y) {
|
|
451
|
-
const
|
|
452
|
-
(
|
|
451
|
+
const p = u.top + e, b = u.bottom + e;
|
|
452
|
+
(p >= l.bottom || b <= l.top) && (e = 0);
|
|
453
453
|
}
|
|
454
|
-
|
|
454
|
+
d += t, f += e, n && (o.style.transition = "transform 0.3s", setTimeout(() => {
|
|
455
455
|
o.style.transition = "none";
|
|
456
|
-
}, 300)), o.style.transform = `translate3d(${
|
|
456
|
+
}, 300)), o.style.transform = `translate3d(${d}px, ${f}px, 0) scale(${s})`, i.fire("move", { dx: t, dy: e });
|
|
457
457
|
}, it = (t, e = !1) => {
|
|
458
458
|
const { container: n, map: o, nodes: s } = t;
|
|
459
459
|
let i, r;
|
|
460
460
|
if (t.alignment === "nodes" || e)
|
|
461
461
|
i = (n.offsetWidth - s.offsetWidth) / 2, r = (n.offsetHeight - s.offsetHeight) / 2, o.style.transformOrigin = "50% 50%";
|
|
462
462
|
else {
|
|
463
|
-
const c = o.querySelector("me-root"),
|
|
464
|
-
i = n.offsetWidth / 2 -
|
|
463
|
+
const c = o.querySelector("me-root"), a = c.offsetTop, d = c.offsetLeft, f = c.offsetWidth, l = c.offsetHeight;
|
|
464
|
+
i = n.offsetWidth / 2 - d - f / 2, r = n.offsetHeight / 2 - a - l / 2, o.style.transformOrigin = `${d + f / 2}px 50%`;
|
|
465
465
|
}
|
|
466
466
|
return { dx: i, dy: r };
|
|
467
467
|
}, ge = function() {
|
|
@@ -487,18 +487,18 @@ const oe = function(t, e = !1) {
|
|
|
487
487
|
y: o.top
|
|
488
488
|
}, i = t.parentNode, r = i.children[1];
|
|
489
489
|
if (r.expanded = n.expanded, r.className = n.expanded ? "minus" : "", ee(t), n.expanded) {
|
|
490
|
-
const
|
|
491
|
-
n.children.map((
|
|
490
|
+
const l = this.createChildren(
|
|
491
|
+
n.children.map((u) => this.createWrapper(u).grp)
|
|
492
492
|
);
|
|
493
|
-
i.parentNode.appendChild(
|
|
493
|
+
i.parentNode.appendChild(l);
|
|
494
494
|
} else
|
|
495
495
|
i.parentNode.children[1].remove();
|
|
496
496
|
this.linkDiv(t.closest("me-main > me-wrapper"));
|
|
497
|
-
const c = t.getBoundingClientRect(),
|
|
497
|
+
const c = t.getBoundingClientRect(), a = {
|
|
498
498
|
x: c.left,
|
|
499
499
|
y: c.top
|
|
500
|
-
},
|
|
501
|
-
this.move(
|
|
500
|
+
}, d = s.x - a.x, f = s.y - a.y;
|
|
501
|
+
this.move(d, f), this.bus.fire("expandNode", n);
|
|
502
502
|
}, Se = function(t, e) {
|
|
503
503
|
const n = t.nodeObj, o = t.getBoundingClientRect(), s = {
|
|
504
504
|
x: o.left,
|
|
@@ -508,8 +508,8 @@ const oe = function(t, e = !1) {
|
|
|
508
508
|
const i = this.findEle(n.id).getBoundingClientRect(), r = {
|
|
509
509
|
x: i.left,
|
|
510
510
|
y: i.top
|
|
511
|
-
}, c = s.x - r.x,
|
|
512
|
-
this.move(c,
|
|
511
|
+
}, c = s.x - r.x, a = s.y - r.y;
|
|
512
|
+
this.move(c, a);
|
|
513
513
|
}, Ee = function(t) {
|
|
514
514
|
this.clearSelection(), t && (t = JSON.parse(JSON.stringify(t)), this.nodeData = t.nodeData, this.arrows = t.arrows || [], this.summaries = t.summaries || [], t.meta && (this.meta = t.meta), t.theme && this.changeTheme(t.theme)), ot(this.nodeData), this.layout(), this.linkDiv();
|
|
515
515
|
}, Te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -611,7 +611,7 @@ function Ne(t) {
|
|
|
611
611
|
clear() {
|
|
612
612
|
this.activePointers.clear(), this.lastDistance = null;
|
|
613
613
|
}
|
|
614
|
-
}, c = Vt(t),
|
|
614
|
+
}, c = Vt(t), a = {
|
|
615
615
|
timer: null,
|
|
616
616
|
startPos: null,
|
|
617
617
|
pointerId: null,
|
|
@@ -631,7 +631,7 @@ function Ne(t) {
|
|
|
631
631
|
Math.sqrt(m * m + w * w) > this.MOVE_THRESHOLD && this.clear();
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
},
|
|
634
|
+
}, d = (h, m) => {
|
|
635
635
|
if (h.closest("#input-box")) return !1;
|
|
636
636
|
const w = h.closest(".svg-label"), E = h.closest(".topiclinks, .summary"), S = w ? { type: w.dataset.type, element: document.getElementById(w.dataset.svgId) } : E ? { type: E.classList.contains("topiclinks") ? "arrow" : "summary", element: h.closest("g") } : null;
|
|
637
637
|
if (!S?.type || !S?.element) return !1;
|
|
@@ -655,17 +655,17 @@ function Ne(t) {
|
|
|
655
655
|
return;
|
|
656
656
|
const m = h.target;
|
|
657
657
|
m.tagName === "ME-EPD" && (h.ctrlKey || h.metaKey ? t.expandNodeAll(m.previousSibling) : t.expandNode(m.previousSibling));
|
|
658
|
-
},
|
|
658
|
+
}, l = (h) => {
|
|
659
659
|
if (!t.editable) return;
|
|
660
660
|
const m = h.target;
|
|
661
661
|
if (J(m)) {
|
|
662
662
|
t.selectNode(m), t.beginEdit(m);
|
|
663
663
|
return;
|
|
664
664
|
}
|
|
665
|
-
|
|
666
|
-
},
|
|
665
|
+
d(m, !0);
|
|
666
|
+
}, u = (h) => {
|
|
667
667
|
if (h.pointerType === "touch" && r.handlePointerDown(h)) {
|
|
668
|
-
t.ptState = i.Pinch,
|
|
668
|
+
t.ptState = i.Pinch, a.clear(), e.clear(), (c.isDragging || c.pointerId !== null) && pt(t, c);
|
|
669
669
|
return;
|
|
670
670
|
}
|
|
671
671
|
if (t.ptState === i.Pinch) return;
|
|
@@ -679,18 +679,18 @@ function Ne(t) {
|
|
|
679
679
|
t.selection?.cancel();
|
|
680
680
|
const E = t.currentNodes || [];
|
|
681
681
|
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;
|
|
682
|
-
h.pointerType === "touch" ? (t.ptState = i.DragWait,
|
|
682
|
+
h.pointerType === "touch" ? (t.ptState = i.DragWait, a.start(h, (M) => {
|
|
683
683
|
ut(t, c, M, !0) && (t.ptState = i.Drag, m.setPointerCapture(M.pointerId));
|
|
684
684
|
})) : ut(t, c, h, !1) && (t.ptState = i.Drag, m.setPointerCapture(h.pointerId));
|
|
685
685
|
} else
|
|
686
|
-
|
|
687
|
-
},
|
|
686
|
+
d(m, !1);
|
|
687
|
+
}, g = (h) => {
|
|
688
688
|
switch (t.ptState) {
|
|
689
689
|
case i.Pinch:
|
|
690
690
|
r.handlePointerMove(h);
|
|
691
691
|
break;
|
|
692
692
|
case i.DragWait:
|
|
693
|
-
|
|
693
|
+
a.handleMove(h), a.timer === null && (t.ptState = i.Idle);
|
|
694
694
|
break;
|
|
695
695
|
case i.Drag:
|
|
696
696
|
Ft(t, c, h);
|
|
@@ -704,7 +704,7 @@ function Ne(t) {
|
|
|
704
704
|
const m = c.isDragging, w = e.moved;
|
|
705
705
|
switch (t.ptState) {
|
|
706
706
|
case i.DragWait:
|
|
707
|
-
|
|
707
|
+
a.clear();
|
|
708
708
|
break;
|
|
709
709
|
case i.Drag:
|
|
710
710
|
Gt(t, c, h);
|
|
@@ -713,10 +713,10 @@ function Ne(t) {
|
|
|
713
713
|
e.handlePointerUp(h);
|
|
714
714
|
break;
|
|
715
715
|
}
|
|
716
|
-
s.detect(h,
|
|
717
|
-
},
|
|
718
|
-
r.clear(),
|
|
719
|
-
},
|
|
716
|
+
s.detect(h, l), (t.ptState !== i.Pinch || r.activePointers.size < 2) && (t.ptState = i.Idle), o && (!m && !w && t.selection?.deselect(o), o = null);
|
|
717
|
+
}, p = () => {
|
|
718
|
+
r.clear(), a.clear(), e.clear(), s.clear(), (c.isDragging || c.pointerId !== null) && pt(t, c), t.ptState = i.Idle, o = null;
|
|
719
|
+
}, b = (h) => {
|
|
720
720
|
h.preventDefault(), h.button === 2 && t.editable && setTimeout(() => {
|
|
721
721
|
if (t.panHelper.moved || t.ptState !== i.Idle && t.ptState !== i.Pan) return;
|
|
722
722
|
const m = h.target;
|
|
@@ -732,14 +732,14 @@ function Ne(t) {
|
|
|
732
732
|
h.code === "Space" && (t.spacePressed = !1, t.container.classList.remove("space-pressed"));
|
|
733
733
|
};
|
|
734
734
|
return vt([
|
|
735
|
-
{ dom: n, evt: "pointerdown", func:
|
|
736
|
-
{ dom: n, evt: "pointermove", func:
|
|
735
|
+
{ dom: n, evt: "pointerdown", func: u },
|
|
736
|
+
{ dom: n, evt: "pointermove", func: g },
|
|
737
737
|
{ dom: n, evt: "pointerup", func: y },
|
|
738
|
-
{ dom: n, evt: "pointercancel", func:
|
|
738
|
+
{ dom: n, evt: "pointercancel", func: p },
|
|
739
739
|
{ dom: n, evt: "click", func: f },
|
|
740
|
-
{ dom: n, evt: "contextmenu", func:
|
|
740
|
+
{ dom: n, evt: "contextmenu", func: b },
|
|
741
741
|
{ dom: n, evt: "wheel", func: typeof t.handleWheel == "function" ? t.handleWheel : x },
|
|
742
|
-
{ dom: n, evt: "blur", func:
|
|
742
|
+
{ dom: n, evt: "blur", func: p },
|
|
743
743
|
{ dom: n, evt: "keydown", func: v },
|
|
744
744
|
{ dom: n, evt: "keyup", func: C }
|
|
745
745
|
]);
|
|
@@ -773,10 +773,10 @@ const k = "http://www.w3.org/2000/svg", U = function(t) {
|
|
|
773
773
|
let c = s;
|
|
774
774
|
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";
|
|
775
775
|
}, Q = function(t, e, n, o) {
|
|
776
|
-
const { anchor: s = "middle", color: i, dataType: r, svgId: c } = o,
|
|
777
|
-
|
|
778
|
-
const
|
|
779
|
-
return
|
|
776
|
+
const { anchor: s = "middle", color: i, dataType: r, svgId: c } = o, a = document.createElement("div");
|
|
777
|
+
a.className = "svg-label", a.style.color = i || "#666";
|
|
778
|
+
const d = "label-" + c;
|
|
779
|
+
return a.id = d, a.innerHTML = t, a.dataset.type = r, a.dataset.svgId = c, a.dataset.x = e.toString(), a.dataset.y = n.toString(), a.dataset.anchor = s, a;
|
|
780
780
|
}, Dt = function(t, e, n) {
|
|
781
781
|
const o = document.createElementNS(k, "path");
|
|
782
782
|
return D(o, {
|
|
@@ -807,21 +807,21 @@ const k = "http://www.w3.org/2000/svg", U = function(t) {
|
|
|
807
807
|
d: n
|
|
808
808
|
}
|
|
809
809
|
].forEach((r, c) => {
|
|
810
|
-
const
|
|
811
|
-
d:
|
|
810
|
+
const a = r.d, d = document.createElementNS(k, "path"), f = {
|
|
811
|
+
d: a,
|
|
812
812
|
stroke: o?.stroke || "rgb(227, 125, 116)",
|
|
813
813
|
fill: "none",
|
|
814
814
|
"stroke-linecap": o?.strokeLinecap || "cap",
|
|
815
815
|
"stroke-width": String(o?.strokeWidth || "2")
|
|
816
816
|
};
|
|
817
|
-
o?.opacity !== void 0 && (f.opacity = String(o.opacity)), D(
|
|
818
|
-
const
|
|
819
|
-
D(
|
|
820
|
-
d:
|
|
817
|
+
o?.opacity !== void 0 && (f.opacity = String(o.opacity)), D(d, f), c === 0 && d.setAttribute("stroke-dasharray", o?.strokeDasharray || "8,2");
|
|
818
|
+
const l = document.createElementNS(k, "path");
|
|
819
|
+
D(l, {
|
|
820
|
+
d: a,
|
|
821
821
|
stroke: "transparent",
|
|
822
822
|
fill: "none",
|
|
823
823
|
"stroke-width": "15"
|
|
824
|
-
}), s.appendChild(
|
|
824
|
+
}), s.appendChild(l), s.appendChild(d), s[r.name] = d;
|
|
825
825
|
}), s;
|
|
826
826
|
}, Lt = function(t, e, n) {
|
|
827
827
|
if (!e) return;
|
|
@@ -854,26 +854,26 @@ const k = "http://www.w3.org/2000/svg", U = function(t) {
|
|
|
854
854
|
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");
|
|
855
855
|
this.lines.innerHTML = "";
|
|
856
856
|
for (let c = 0; c < r.length; c++) {
|
|
857
|
-
const
|
|
858
|
-
if (
|
|
857
|
+
const a = r[c], d = a.querySelector("me-tpc"), { offsetLeft: f, offsetTop: l } = P(this.nodes, d), u = d.offsetWidth, g = d.offsetHeight, y = a.parentNode.className, p = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: l, cL: f, cW: u, cH: g, direction: y, containerHeight: this.nodes.offsetHeight }), b = this.theme.palette, x = d.nodeObj.branchColor || b[c % b.length];
|
|
858
|
+
if (d.style.borderColor = x, this.lines.appendChild(Dt(p, x, "3")), t && t !== a)
|
|
859
859
|
continue;
|
|
860
|
-
const v = R("subLines"), C =
|
|
861
|
-
C.tagName === "svg" && C.remove(),
|
|
860
|
+
const v = R("subLines"), C = a.lastChild;
|
|
861
|
+
C.tagName === "svg" && C.remove(), a.appendChild(v), Mt(this, v, x, a, y, !0);
|
|
862
862
|
}
|
|
863
863
|
this.labelContainer.innerHTML = "", this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
|
|
864
864
|
}, Mt = function(t, e, n, o, s, i) {
|
|
865
865
|
const r = o.firstChild, c = o.children[1].children;
|
|
866
866
|
if (c.length === 0) return;
|
|
867
|
-
const
|
|
868
|
-
for (let
|
|
869
|
-
const
|
|
867
|
+
const a = r.offsetTop, d = r.offsetLeft, f = r.offsetWidth, l = r.offsetHeight;
|
|
868
|
+
for (let u = 0; u < c.length; u++) {
|
|
869
|
+
const g = c[u], y = g.firstChild, p = y.offsetTop, b = y.offsetLeft, x = y.offsetWidth, v = y.offsetHeight, C = y.firstChild.nodeObj.branchColor || n, T = t.generateSubBranch({ pT: a, pL: d, pW: f, pH: l, cT: p, cL: b, cW: x, cH: v, direction: s, isFirst: i });
|
|
870
870
|
e.appendChild(Dt(T, C, "2"));
|
|
871
871
|
const h = y.children[1];
|
|
872
872
|
if (h) {
|
|
873
873
|
if (!h.expanded) continue;
|
|
874
874
|
} else
|
|
875
875
|
continue;
|
|
876
|
-
Mt(t, e, C,
|
|
876
|
+
Mt(t, e, C, g, s);
|
|
877
877
|
}
|
|
878
878
|
}, Oe = '<?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>', Be = '<?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>', Ye = '<?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>', We = '<?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>', Re = '<?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>', Xe = '<?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>', Ve = '<?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>', ze = {
|
|
879
879
|
side: Oe,
|
|
@@ -892,20 +892,20 @@ function Fe(t) {
|
|
|
892
892
|
e.appendChild(n), e.appendChild(o), e.appendChild(s), e.appendChild(i), e.className = "mind-elixir-toolbar rb";
|
|
893
893
|
let r = null;
|
|
894
894
|
const c = () => {
|
|
895
|
-
const
|
|
895
|
+
const d = t.container.getBoundingClientRect(), f = st(t.map.style.transform), l = d.width / 2, u = d.height / 2, g = (l - f.x) / t.scaleVal, y = (u - f.y) / t.scaleVal;
|
|
896
896
|
r = {
|
|
897
|
-
containerRect:
|
|
897
|
+
containerRect: d,
|
|
898
898
|
currentTransform: f,
|
|
899
|
-
mapCenterX:
|
|
899
|
+
mapCenterX: g,
|
|
900
900
|
mapCenterY: y
|
|
901
901
|
};
|
|
902
|
-
},
|
|
902
|
+
}, a = () => {
|
|
903
903
|
if (r) {
|
|
904
|
-
const
|
|
905
|
-
t.move(y,
|
|
904
|
+
const d = t.container.getBoundingClientRect(), f = d.width / 2, l = d.height / 2, u = f - r.mapCenterX * t.scaleVal, g = l - r.mapCenterY * t.scaleVal, y = u - r.currentTransform.x, p = g - r.currentTransform.y;
|
|
905
|
+
t.move(y, p);
|
|
906
906
|
}
|
|
907
907
|
};
|
|
908
|
-
return t.el.addEventListener("fullscreenchange",
|
|
908
|
+
return t.el.addEventListener("fullscreenchange", a), n.onclick = () => {
|
|
909
909
|
c(), document.fullscreenElement !== t.el ? t.el.requestFullscreen() : document.exitFullscreen();
|
|
910
910
|
}, o.onclick = () => {
|
|
911
911
|
t.toCenter();
|
|
@@ -928,22 +928,22 @@ function Ge(t) {
|
|
|
928
928
|
function je(t) {
|
|
929
929
|
t.container.append(Fe(t)), t.container.append(Ge(t));
|
|
930
930
|
}
|
|
931
|
-
function Pt({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction:
|
|
931
|
+
function Pt({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: a, containerHeight: d }) {
|
|
932
932
|
let f = e + n / 2;
|
|
933
|
-
const
|
|
934
|
-
let
|
|
935
|
-
|
|
936
|
-
const
|
|
937
|
-
return
|
|
933
|
+
const l = t + o / 2;
|
|
934
|
+
let u;
|
|
935
|
+
a === B.LHS ? u = i + r : u = i;
|
|
936
|
+
const g = s + c / 2, p = (1 - Math.abs(g - l) / d) * 0.25 * (n / 2);
|
|
937
|
+
return a === B.LHS ? f = f - n / 10 - p : f = f + n / 10 + p, `M ${f} ${l} Q ${f} ${g} ${u} ${g}`;
|
|
938
938
|
}
|
|
939
|
-
function kt({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction:
|
|
939
|
+
function kt({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: a, isFirst: d }) {
|
|
940
940
|
const f = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
|
|
941
|
-
let
|
|
942
|
-
|
|
943
|
-
const
|
|
944
|
-
let y = 0,
|
|
945
|
-
const x = Math.abs(
|
|
946
|
-
return
|
|
941
|
+
let l = 0, u = 0;
|
|
942
|
+
d ? l = t + o / 2 : l = t + o;
|
|
943
|
+
const g = s + c;
|
|
944
|
+
let y = 0, p = 0, b = 0;
|
|
945
|
+
const x = Math.abs(l - g) / 300 * f;
|
|
946
|
+
return a === B.LHS ? (b = e, y = b + f, p = b - f, u = i + f, `M ${y} ${l} C ${b} ${l} ${b + x} ${g} ${p} ${g} H ${u}`) : (b = e + n, y = b - f, p = b + f, u = i + r - f, `M ${y} ${l} C ${b} ${l} ${b - x} ${g} ${p} ${g} H ${u}`);
|
|
947
947
|
}
|
|
948
948
|
const _e = function(t, e = !0) {
|
|
949
949
|
this.theme = t, this.generateMainBranch = this.theme.generateMainBranch || Pt, this.generateSubBranch = this.theme.generateSubBranch || kt;
|
|
@@ -1015,48 +1015,40 @@ function O(t, e, n, o, s) {
|
|
|
1015
1015
|
y2: s + ""
|
|
1016
1016
|
});
|
|
1017
1017
|
}
|
|
1018
|
-
function tt(t, e, n, o, s, i, r, c,
|
|
1019
|
-
const f = `M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1018
|
+
function tt(t, e, n, o, s, i, r, c, a, d) {
|
|
1019
|
+
const f = `M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${a}`;
|
|
1020
|
+
t.line.setAttribute("d", f);
|
|
1021
|
+
const l = d.style || {};
|
|
1022
|
+
t.line.setAttribute("stroke", l.stroke || "rgb(227, 125, 116)"), t.line.setAttribute("stroke-width", String(l.strokeWidth || "2")), t.line.setAttribute("stroke-dasharray", l.strokeDasharray || "8,2"), t.line.setAttribute("stroke-linecap", l.strokeLinecap || "cap"), l.opacity !== void 0 && l.opacity !== null && l.opacity !== "" ? t.line.setAttribute("opacity", String(l.opacity)) : t.line.removeAttribute("opacity");
|
|
1023
|
+
const u = t.querySelectorAll('path[stroke="transparent"]');
|
|
1024
|
+
u.length > 0 && u[0].setAttribute("d", f);
|
|
1025
|
+
const g = _(i, r, c, a);
|
|
1026
|
+
if (g) {
|
|
1027
|
+
const x = `M ${g.x1} ${g.y1} L ${c} ${a} L ${g.x2} ${g.y2}`;
|
|
1028
|
+
t.arrow1.setAttribute("d", x), u.length > 1 && u[1].setAttribute("d", x), t.arrow1.setAttribute("stroke", l.stroke || "rgb(227, 125, 116)"), t.arrow1.setAttribute("stroke-width", String(l.strokeWidth || "2")), t.arrow1.setAttribute("stroke-linecap", l.strokeLinecap || "cap"), l.opacity !== void 0 && l.opacity !== null && l.opacity !== "" ? t.arrow1.setAttribute("opacity", String(l.opacity)) : t.arrow1.removeAttribute("opacity");
|
|
1023
1029
|
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
if (t.arrow1.setAttribute("d", u), d.length > 1 && d[1].setAttribute("d", u), a.style) {
|
|
1030
|
-
const g = a.style;
|
|
1031
|
-
g.stroke && t.arrow1.setAttribute("stroke", g.stroke), g.strokeWidth && t.arrow1.setAttribute("stroke-width", String(g.strokeWidth)), g.strokeLinecap && t.arrow1.setAttribute("stroke-linecap", g.strokeLinecap), g.opacity !== void 0 && t.arrow1.setAttribute("opacity", String(g.opacity));
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
if (a.bidirectional) {
|
|
1035
|
-
const u = _(o, s, e, n);
|
|
1036
|
-
if (u) {
|
|
1037
|
-
const g = `M ${u.x1} ${u.y1} L ${e} ${n} L ${u.x2} ${u.y2}`;
|
|
1038
|
-
if (t.arrow2.setAttribute("d", g), d.length > 2 && d[2].setAttribute("d", g), a.style) {
|
|
1039
|
-
const x = a.style;
|
|
1040
|
-
x.stroke && t.arrow2.setAttribute("stroke", x.stroke), x.strokeWidth && t.arrow2.setAttribute("stroke-width", String(x.strokeWidth)), x.strokeLinecap && t.arrow2.setAttribute("stroke-linecap", x.strokeLinecap), x.opacity !== void 0 && t.arrow2.setAttribute("opacity", String(x.opacity));
|
|
1041
|
-
}
|
|
1030
|
+
if (d.bidirectional) {
|
|
1031
|
+
const x = _(o, s, e, n);
|
|
1032
|
+
if (x) {
|
|
1033
|
+
const v = `M ${x.x1} ${x.y1} L ${e} ${n} L ${x.x2} ${x.y2}`;
|
|
1034
|
+
t.arrow2.setAttribute("d", v), u.length > 2 && u[2].setAttribute("d", v);
|
|
1042
1035
|
}
|
|
1043
1036
|
} else
|
|
1044
|
-
t.arrow2.setAttribute("d", ""),
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
on(t);
|
|
1037
|
+
t.arrow2.setAttribute("d", ""), u.length > 2 && u[2].setAttribute("d", "");
|
|
1038
|
+
t.arrow2.setAttribute("stroke", l.stroke || "rgb(227, 125, 116)"), t.arrow2.setAttribute("stroke-width", String(l.strokeWidth || "2")), t.arrow2.setAttribute("stroke-linecap", l.strokeLinecap || "cap"), l.opacity !== void 0 && l.opacity !== null && l.opacity !== "" ? t.arrow2.setAttribute("opacity", String(l.opacity)) : t.arrow2.removeAttribute("opacity");
|
|
1039
|
+
const { x: y, y: p } = Nt(e, n, o, s, i, r, c, a);
|
|
1040
|
+
t.labelEl && Ke(t.labelEl, y, p);
|
|
1041
|
+
const b = t.labelEl;
|
|
1042
|
+
b && (b.style.color = l.labelColor || "rgb(235, 95, 82)"), on(t);
|
|
1051
1043
|
}
|
|
1052
1044
|
function Y(t, e, n) {
|
|
1053
|
-
const { offsetLeft: o, offsetTop: s } = P(t.nodes, e), i = e.offsetWidth, r = e.offsetHeight, c = o + i / 2,
|
|
1045
|
+
const { offsetLeft: o, offsetTop: s } = P(t.nodes, e), i = e.offsetWidth, r = e.offsetHeight, c = o + i / 2, a = s + r / 2, d = c + n.x, f = a + n.y;
|
|
1054
1046
|
return {
|
|
1055
1047
|
w: i,
|
|
1056
1048
|
h: r,
|
|
1057
1049
|
cx: c,
|
|
1058
|
-
cy:
|
|
1059
|
-
ctrlX:
|
|
1050
|
+
cy: a,
|
|
1051
|
+
ctrlX: d,
|
|
1060
1052
|
ctrlY: f
|
|
1061
1053
|
};
|
|
1062
1054
|
}
|
|
@@ -1069,24 +1061,24 @@ function H(t) {
|
|
|
1069
1061
|
};
|
|
1070
1062
|
}
|
|
1071
1063
|
const $t = function(t, e, n) {
|
|
1072
|
-
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,
|
|
1073
|
-
let
|
|
1074
|
-
if (
|
|
1064
|
+
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, a = s.offsetTop + n.offsetHeight / 2, d = c - i, f = a - r, l = Math.sqrt(d * d + f * f), u = Math.max(50, Math.min(200, l * 0.3)), g = Math.abs(d), y = Math.abs(f);
|
|
1065
|
+
let p, b;
|
|
1066
|
+
if (l < 150) {
|
|
1075
1067
|
const v = e.closest("me-main").className === "lhs" ? -1 : 1;
|
|
1076
|
-
|
|
1077
|
-
} else if (
|
|
1078
|
-
const v =
|
|
1079
|
-
|
|
1080
|
-
} else if (y >
|
|
1068
|
+
p = { x: 200 * v, y: 0 }, b = { x: 200 * v, y: 0 };
|
|
1069
|
+
} else if (g > y * 1.5) {
|
|
1070
|
+
const v = d > 0 ? e.offsetWidth / 2 : -e.offsetWidth / 2, C = d > 0 ? -n.offsetWidth / 2 : n.offsetWidth / 2;
|
|
1071
|
+
p = { x: v + (d > 0 ? u : -u), y: 0 }, b = { x: C + (d > 0 ? -u : u), y: 0 };
|
|
1072
|
+
} else if (y > g * 1.5) {
|
|
1081
1073
|
const v = f > 0 ? e.offsetHeight / 2 : -e.offsetHeight / 2, C = f > 0 ? -n.offsetHeight / 2 : n.offsetHeight / 2;
|
|
1082
|
-
|
|
1074
|
+
p = { x: 0, y: v + (f > 0 ? u : -u) }, b = { x: 0, y: C + (f > 0 ? -u : u) };
|
|
1083
1075
|
} else {
|
|
1084
|
-
const v = Math.atan2(f,
|
|
1085
|
-
|
|
1076
|
+
const v = Math.atan2(f, d), C = e.offsetWidth / 2 * Math.cos(v), T = e.offsetHeight / 2 * Math.sin(v), h = -(n.offsetWidth / 2) * Math.cos(v), m = -(n.offsetHeight / 2) * Math.sin(v), w = u * 0.7 * (d > 0 ? 1 : -1), E = u * 0.7 * (f > 0 ? 1 : -1);
|
|
1077
|
+
p = { x: C + w, y: T + E }, b = { x: h - w, y: m - E };
|
|
1086
1078
|
}
|
|
1087
1079
|
return {
|
|
1088
|
-
delta1: { x: Math.round(
|
|
1089
|
-
delta2: { x: Math.round(
|
|
1080
|
+
delta1: { x: Math.round(p.x), y: Math.round(p.y) },
|
|
1081
|
+
delta2: { x: Math.round(b.x), y: Math.round(b.y) }
|
|
1090
1082
|
};
|
|
1091
1083
|
}, rt = function(t, e, n, o, s) {
|
|
1092
1084
|
if (!e || !n)
|
|
@@ -1095,16 +1087,16 @@ const $t = function(t, e, n) {
|
|
|
1095
1087
|
const S = $t(t, e, n);
|
|
1096
1088
|
o.delta1 = S.delta1, o.delta2 = S.delta2;
|
|
1097
1089
|
}
|
|
1098
|
-
const i = Y(t, e, o.delta1), r = Y(t, n, o.delta2), { x: c, y:
|
|
1099
|
-
if (!
|
|
1100
|
-
const
|
|
1090
|
+
const i = Y(t, e, o.delta1), r = Y(t, n, o.delta2), { x: c, y: a } = H(i), { ctrlX: d, ctrlY: f } = i, { ctrlX: l, ctrlY: u } = r, { x: g, y } = H(r), p = _(l, u, g, y);
|
|
1091
|
+
if (!p) return;
|
|
1092
|
+
const b = `M ${p.x1} ${p.y1} L ${g} ${y} L ${p.x2} ${p.y2}`;
|
|
1101
1093
|
let x = "";
|
|
1102
1094
|
if (o.bidirectional) {
|
|
1103
|
-
const S = _(
|
|
1095
|
+
const S = _(d, f, c, a);
|
|
1104
1096
|
if (!S) return;
|
|
1105
|
-
x = `M ${S.x1} ${S.y1} L ${c} ${
|
|
1097
|
+
x = `M ${S.x1} ${S.y1} L ${c} ${a} L ${S.x2} ${S.y2}`;
|
|
1106
1098
|
}
|
|
1107
|
-
const v = He(`M ${c} ${
|
|
1099
|
+
const v = He(`M ${c} ${a} C ${d} ${f} ${l} ${u} ${g} ${y}`, b, x, o.style), { x: C, y: T } = Nt(c, a, d, f, l, u, g, y), h = o.style?.labelColor || "rgb(235, 95, 82)", m = "a-" + o.id;
|
|
1108
1100
|
v.id = m;
|
|
1109
1101
|
const w = t.markdown ? t.markdown(o.label, o) : o.label, E = Q(w, C, T, {
|
|
1110
1102
|
anchor: "middle",
|
|
@@ -1181,18 +1173,18 @@ const $t = function(t, e, n) {
|
|
|
1181
1173
|
}, K = function(t) {
|
|
1182
1174
|
t.helper1?.destroy(), t.helper2?.destroy(), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none", t.currentArrow && nn(t.currentArrow);
|
|
1183
1175
|
}, It = function(t, e, n, o) {
|
|
1184
|
-
const { linkController: s, P2: i, P3: r, line1: c, line2:
|
|
1185
|
-
if (!
|
|
1186
|
-
s.style.display = "initial", i.style.display = "initial", r.style.display = "initial",
|
|
1187
|
-
let { x:
|
|
1188
|
-
i.style.cssText = `top:${
|
|
1189
|
-
|
|
1190
|
-
const w = H({ ...n, ctrlX:
|
|
1191
|
-
|
|
1176
|
+
const { linkController: s, P2: i, P3: r, line1: c, line2: a, nodes: d, map: f, currentArrow: l, bus: u } = t;
|
|
1177
|
+
if (!l) return;
|
|
1178
|
+
s.style.display = "initial", i.style.display = "initial", r.style.display = "initial", d.appendChild(s), d.appendChild(i), d.appendChild(r), Ht(l, At);
|
|
1179
|
+
let { x: g, y } = H(n), { ctrlX: p, ctrlY: b } = n, { ctrlX: x, ctrlY: v } = o, { x: C, y: T } = H(o);
|
|
1180
|
+
i.style.cssText = `top:${b}px;left:${p}px;`, r.style.cssText = `top:${v}px;left:${x}px;`, O(c, g, y, p, b), O(a, x, v, C, T), t.helper1 = mt.create(i), t.helper2 = mt.create(r), t.helper1.init(f, (h, m) => {
|
|
1181
|
+
p = p + h / t.scaleVal, b = b + m / t.scaleVal;
|
|
1182
|
+
const w = H({ ...n, ctrlX: p, ctrlY: b });
|
|
1183
|
+
g = w.x, y = w.y, i.style.top = b + "px", i.style.left = p + "px", tt(l, g, y, p, b, x, v, C, T, e), O(c, g, y, p, b), e.delta1.x = Math.round(p - n.cx), e.delta1.y = Math.round(b - n.cy), u.fire("updateArrowDelta", e);
|
|
1192
1184
|
}), t.helper2.init(f, (h, m) => {
|
|
1193
1185
|
x = x + h / t.scaleVal, v = v + m / t.scaleVal;
|
|
1194
1186
|
const w = H({ ...o, ctrlX: x, ctrlY: v });
|
|
1195
|
-
C = w.x, T = w.y, r.style.top = v + "px", r.style.left = x + "px", tt(
|
|
1187
|
+
C = w.x, T = w.y, r.style.top = v + "px", r.style.left = x + "px", tt(l, g, y, p, b, x, v, C, T, e), O(a, x, v, C, T), e.delta2.x = Math.round(x - o.cx), e.delta2.y = Math.round(v - o.cy), u.fire("updateArrowDelta", e);
|
|
1196
1188
|
});
|
|
1197
1189
|
};
|
|
1198
1190
|
function sn() {
|
|
@@ -1224,11 +1216,11 @@ const ln = function(t, e) {
|
|
|
1224
1216
|
const s = this.findEle(t.from), i = this.findEle(t.to);
|
|
1225
1217
|
if (s && i) {
|
|
1226
1218
|
if (!t.delta1 || !t.delta2) {
|
|
1227
|
-
const
|
|
1228
|
-
t.delta1 = t.delta1 ||
|
|
1219
|
+
const b = $t(this, s, i);
|
|
1220
|
+
t.delta1 = t.delta1 || b.delta1, t.delta2 = t.delta2 || b.delta2;
|
|
1229
1221
|
}
|
|
1230
|
-
const r = Y(this, s, t.delta1), c = Y(this, i, t.delta2), { x:
|
|
1231
|
-
tt(o,
|
|
1222
|
+
const r = Y(this, s, t.delta1), c = Y(this, i, t.delta2), { x: a, y: d } = H(r), { ctrlX: f, ctrlY: l } = r, { ctrlX: u, ctrlY: g } = c, { x: y, y: p } = H(c);
|
|
1223
|
+
tt(o, a, d, f, l, u, g, y, p, t), this.currentArrow?.arrowObj?.id === t.id && (this.P2.style.cssText = `top:${l}px;left:${f}px;`, this.P3.style.cssText = `top:${g}px;left:${u}px;`, O(this.line1, a, d, f, l), O(this.line2, u, g, y, p));
|
|
1232
1224
|
}
|
|
1233
1225
|
}
|
|
1234
1226
|
this.bus.fire("operation", {
|
|
@@ -1250,34 +1242,34 @@ const ln = function(t, e) {
|
|
|
1250
1242
|
}, Symbol.toStringTag, { value: "Module" })), hn = function(t) {
|
|
1251
1243
|
if (t.length === 0) throw new Error("No selected node.");
|
|
1252
1244
|
if (t.length === 1) {
|
|
1253
|
-
const
|
|
1254
|
-
if (!
|
|
1255
|
-
const f =
|
|
1245
|
+
const a = t[0].nodeObj, d = t[0].nodeObj.parent;
|
|
1246
|
+
if (!d) throw new Error("Can not select root node.");
|
|
1247
|
+
const f = d.children.findIndex((l) => a === l);
|
|
1256
1248
|
return {
|
|
1257
|
-
parent:
|
|
1249
|
+
parent: d.id,
|
|
1258
1250
|
start: f,
|
|
1259
1251
|
end: f
|
|
1260
1252
|
};
|
|
1261
1253
|
}
|
|
1262
1254
|
let e = 0;
|
|
1263
|
-
const n = t.map((
|
|
1264
|
-
let
|
|
1255
|
+
const n = t.map((a) => {
|
|
1256
|
+
let d = a.nodeObj;
|
|
1265
1257
|
const f = [];
|
|
1266
|
-
for (;
|
|
1267
|
-
const
|
|
1268
|
-
|
|
1258
|
+
for (; d.parent; ) {
|
|
1259
|
+
const l = d.parent, g = l.children?.indexOf(d);
|
|
1260
|
+
d = l, f.unshift({ node: d, index: g });
|
|
1269
1261
|
}
|
|
1270
1262
|
return f.length > e && (e = f.length), f;
|
|
1271
1263
|
});
|
|
1272
1264
|
let o = 0;
|
|
1273
1265
|
t: for (; o < e; o++) {
|
|
1274
|
-
const
|
|
1275
|
-
for (let
|
|
1276
|
-
if (n[
|
|
1266
|
+
const a = n[0][o]?.node;
|
|
1267
|
+
for (let d = 1; d < n.length; d++)
|
|
1268
|
+
if (n[d][o]?.node !== a)
|
|
1277
1269
|
break t;
|
|
1278
1270
|
}
|
|
1279
1271
|
if (!o) throw new Error("Can not select root node.");
|
|
1280
|
-
const s = n.map((
|
|
1272
|
+
const s = n.map((a) => a[o - 1].index).sort(), i = s[0] || 0, r = s[s.length - 1] || 0, c = n[0][o - 1].node;
|
|
1281
1273
|
if (!c.parent) throw new Error("Please select nodes in the same main topic.");
|
|
1282
1274
|
return {
|
|
1283
1275
|
parent: c.id,
|
|
@@ -1301,24 +1293,24 @@ const ln = function(t, e) {
|
|
|
1301
1293
|
let i;
|
|
1302
1294
|
return s.parent ? i = o.closest("me-main").className : i = t.findEle(s.children[n].id).closest("me-main").className, i;
|
|
1303
1295
|
}, ct = function(t, e) {
|
|
1304
|
-
const { id: n, label: o, parent: s, start: i, end: r, style: c } = e, { nodes:
|
|
1305
|
-
let y = 1 / 0,
|
|
1296
|
+
const { id: n, label: o, parent: s, start: i, end: r, style: c } = e, { nodes: a, theme: d, summarySvg: f } = t, u = t.findEle(s).nodeObj, g = un(t, e);
|
|
1297
|
+
let y = 1 / 0, p = 0, b = 0, x = 0;
|
|
1306
1298
|
for (let W = i; W <= r; W++) {
|
|
1307
|
-
const lt =
|
|
1299
|
+
const lt = u.children?.[W];
|
|
1308
1300
|
if (!lt)
|
|
1309
1301
|
return t.removeSummary(n), null;
|
|
1310
|
-
const V = fn(t.findEle(lt.id)), { offsetLeft: z, offsetTop: at } = P(
|
|
1311
|
-
W === i && (
|
|
1302
|
+
const V = fn(t.findEle(lt.id)), { offsetLeft: z, offsetTop: at } = P(a, V), ht = i === r ? 10 : 20;
|
|
1303
|
+
W === i && (b = at + ht), W === r && (x = at + V.offsetHeight - ht), z < y && (y = z), V.offsetWidth + z > p && (p = V.offsetWidth + z);
|
|
1312
1304
|
}
|
|
1313
1305
|
let v, C;
|
|
1314
|
-
const T =
|
|
1315
|
-
|
|
1306
|
+
const T = u.parent ? 10 : 0, h = b + T, m = x + T, w = (h + m) / 2, E = c?.stroke || d.cssVar["--color"], S = c?.labelColor || d.cssVar["--color"], M = "s-" + n, A = t.markdown ? t.markdown(o, e) : o;
|
|
1307
|
+
g === B.LHS ? (v = 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} ${w} h -10`, E), C = Q(A, y - 20, w, { anchor: "end", color: S, dataType: "summary", svgId: M })) : (v = yt(`M ${p - 10} ${h} c 5 0 10 5 10 10 L ${p} ${m - 10} c 0 5 -5 10 -10 10 M ${p} ${w} h 10`, E), C = Q(A, p + 20, w, { anchor: "start", color: S, dataType: "summary", svgId: M }));
|
|
1316
1308
|
const $ = dn(M);
|
|
1317
1309
|
return $.appendChild(v), t.labelContainer.appendChild(C), U(C), $.summaryObj = e, $.labelEl = C, f.appendChild($), $;
|
|
1318
1310
|
}, pn = function(t = {}) {
|
|
1319
1311
|
if (!this.currentNodes) return;
|
|
1320
|
-
const { currentNodes: e, summaries: n, bus: o } = this, { parent: s, start: i, end: r } = hn(e), c = { id: X(), parent: s, start: i, end: r, label: "summary", style: t.style },
|
|
1321
|
-
n.push(c), this.editSummary(
|
|
1312
|
+
const { currentNodes: e, summaries: n, bus: o } = this, { parent: s, start: i, end: r } = hn(e), c = { id: X(), parent: s, start: i, end: r, label: "summary", style: t.style }, a = ct(this, c);
|
|
1313
|
+
n.push(c), this.editSummary(a), o.fire("operation", {
|
|
1322
1314
|
name: "createSummary",
|
|
1323
1315
|
obj: c
|
|
1324
1316
|
});
|
|
@@ -1374,17 +1366,17 @@ function En(t, e, n, o) {
|
|
|
1374
1366
|
const s = document.createElementNS(L, "g");
|
|
1375
1367
|
let i = "";
|
|
1376
1368
|
return t.text ? i = t.text.textContent : i = t.childNodes[0].textContent, i.split(`
|
|
1377
|
-
`).forEach((c,
|
|
1378
|
-
const
|
|
1379
|
-
D(
|
|
1369
|
+
`).forEach((c, a) => {
|
|
1370
|
+
const d = document.createElementNS(L, "text");
|
|
1371
|
+
D(d, {
|
|
1380
1372
|
x: n + parseInt(e.paddingLeft) + "",
|
|
1381
|
-
y: o + parseInt(e.paddingTop) + Sn(e.lineHeight, e.fontSize) * (
|
|
1373
|
+
y: o + parseInt(e.paddingTop) + Sn(e.lineHeight, e.fontSize) * (a + 1) + parseFloat(e.fontSize) * (a + 1) + "",
|
|
1382
1374
|
"text-anchor": "start",
|
|
1383
1375
|
"font-family": e.fontFamily,
|
|
1384
1376
|
"font-size": `${e.fontSize}`,
|
|
1385
1377
|
"font-weight": `${e.fontWeight}`,
|
|
1386
1378
|
fill: `${e.color}`
|
|
1387
|
-
}),
|
|
1379
|
+
}), d.innerHTML = c, s.appendChild(d);
|
|
1388
1380
|
}), s;
|
|
1389
1381
|
}
|
|
1390
1382
|
function Tn(t, e, n, o) {
|
|
@@ -1432,8 +1424,8 @@ function F(t, e, n = !1) {
|
|
|
1432
1424
|
});
|
|
1433
1425
|
const c = document.createElementNS(L, "g");
|
|
1434
1426
|
c.appendChild(r);
|
|
1435
|
-
let
|
|
1436
|
-
return n ?
|
|
1427
|
+
let a;
|
|
1428
|
+
return n ? a = Tn(e, o, s, i) : a = En(e, o, s, i), c.appendChild(a), c;
|
|
1437
1429
|
}
|
|
1438
1430
|
function Ln(t, e) {
|
|
1439
1431
|
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = P(t.nodes, e), i = document.createElementNS(L, "a"), r = document.createElementNS(L, "text");
|
|
@@ -1465,25 +1457,25 @@ const G = 100, Pn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "
|
|
|
1465
1457
|
width: `${s}`,
|
|
1466
1458
|
height: `${o}`,
|
|
1467
1459
|
fill: t.theme.cssVar["--bgcolor"]
|
|
1468
|
-
}), i.appendChild(c), n.querySelectorAll(".subLines").forEach((
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1460
|
+
}), i.appendChild(c), n.querySelectorAll(".subLines").forEach((l) => {
|
|
1461
|
+
const u = l.cloneNode(!0), { offsetLeft: g, offsetTop: y } = P(n, l.parentElement);
|
|
1462
|
+
u.setAttribute("x", `${g}`), u.setAttribute("y", `${y}`), r.appendChild(u);
|
|
1471
1463
|
});
|
|
1472
|
-
const
|
|
1473
|
-
l && r.appendChild(l);
|
|
1474
|
-
const a = n.querySelector(".topiclinks")?.cloneNode(!0);
|
|
1464
|
+
const a = n.querySelector(".lines")?.cloneNode(!0);
|
|
1475
1465
|
a && r.appendChild(a);
|
|
1466
|
+
const d = n.querySelector(".topiclinks")?.cloneNode(!0);
|
|
1467
|
+
d && r.appendChild(d);
|
|
1476
1468
|
const f = n.querySelector(".summary")?.cloneNode(!0);
|
|
1477
|
-
return f && r.appendChild(f), n.querySelectorAll("me-tpc").forEach((
|
|
1478
|
-
|
|
1479
|
-
}), n.querySelectorAll(".tags > span").forEach((
|
|
1480
|
-
r.appendChild(F(t,
|
|
1481
|
-
}), n.querySelectorAll(".icons > span").forEach((
|
|
1482
|
-
r.appendChild(F(t,
|
|
1483
|
-
}), n.querySelectorAll(".hyper-link").forEach((
|
|
1484
|
-
r.appendChild(Ln(t,
|
|
1485
|
-
}), n.querySelectorAll("img").forEach((
|
|
1486
|
-
r.appendChild(Mn(t,
|
|
1469
|
+
return f && r.appendChild(f), n.querySelectorAll("me-tpc").forEach((l) => {
|
|
1470
|
+
l.nodeObj.dangerouslySetInnerHTML ? r.appendChild(F(t, l, !e)) : (r.appendChild(Dn(t, l)), r.appendChild(F(t, l.text, !e)));
|
|
1471
|
+
}), n.querySelectorAll(".tags > span").forEach((l) => {
|
|
1472
|
+
r.appendChild(F(t, l));
|
|
1473
|
+
}), n.querySelectorAll(".icons > span").forEach((l) => {
|
|
1474
|
+
r.appendChild(F(t, l));
|
|
1475
|
+
}), n.querySelectorAll(".hyper-link").forEach((l) => {
|
|
1476
|
+
r.appendChild(Ln(t, l));
|
|
1477
|
+
}), n.querySelectorAll("img").forEach((l) => {
|
|
1478
|
+
r.appendChild(Mn(t, l));
|
|
1487
1479
|
}), D(r, {
|
|
1488
1480
|
x: G + "",
|
|
1489
1481
|
y: G + "",
|
|
@@ -1548,7 +1540,7 @@ const $n = function(t = !1, e) {
|
|
|
1548
1540
|
enableMobileMultiSelect(t) {
|
|
1549
1541
|
this.mobileMultiSelect = t;
|
|
1550
1542
|
}
|
|
1551
|
-
}, Yn = "5.14.0-beta.
|
|
1543
|
+
}, Yn = "5.14.0-beta.1";
|
|
1552
1544
|
function Wn(t) {
|
|
1553
1545
|
return {
|
|
1554
1546
|
x: 0,
|
|
@@ -1585,15 +1577,15 @@ function N({
|
|
|
1585
1577
|
keypress: i,
|
|
1586
1578
|
mouseSelectionButton: r,
|
|
1587
1579
|
selectionContainer: c,
|
|
1588
|
-
before:
|
|
1589
|
-
newTopicName:
|
|
1580
|
+
before: a,
|
|
1581
|
+
newTopicName: d,
|
|
1590
1582
|
allowUndo: f,
|
|
1591
|
-
generateMainBranch:
|
|
1592
|
-
generateSubBranch:
|
|
1593
|
-
overflowHidden:
|
|
1583
|
+
generateMainBranch: l,
|
|
1584
|
+
generateSubBranch: u,
|
|
1585
|
+
overflowHidden: g,
|
|
1594
1586
|
compact: y,
|
|
1595
|
-
theme:
|
|
1596
|
-
alignment:
|
|
1587
|
+
theme: p,
|
|
1588
|
+
alignment: b,
|
|
1597
1589
|
scaleSensitivity: x,
|
|
1598
1590
|
scaleMax: v,
|
|
1599
1591
|
scaleMin: C,
|
|
@@ -1606,9 +1598,9 @@ function N({
|
|
|
1606
1598
|
let S = null;
|
|
1607
1599
|
const M = Object.prototype.toString.call(t);
|
|
1608
1600
|
if (M === "[object HTMLDivElement]" ? S = t : M === "[object String]" && (S = document.querySelector(t)), !S) throw new Error("MindElixir: el is not a valid element");
|
|
1609
|
-
S.style.position = "relative", S.innerHTML = "", this.el = S, this.disposable = [], this.before =
|
|
1601
|
+
S.style.position = "relative", S.innerHTML = "", this.el = S, this.disposable = [], this.before = a || {}, this.newTopicName = d || "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 = x ?? 0.1, this.scaleMax = v ?? 1.4, this.scaleMin = C ?? 0.2, this.generateMainBranch = l || Pt, this.generateSubBranch = u || kt, this.overflowHidden = g ?? !1, this.compact = y ?? !1, this.alignment = b ?? "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 = Wn(this), this.bus = $e(), this.container = document.createElement("div"), this.selectionContainer = c || this.container, this.container.className = "map-container";
|
|
1610
1602
|
const A = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1611
|
-
this.theme =
|
|
1603
|
+
this.theme = p || (A.matches ? nt : et);
|
|
1612
1604
|
const $ = document.createElement("div");
|
|
1613
1605
|
$.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 = R("lines"), this.summarySvg = R("summary"), this.linkController = R("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 = gt(), this.line2 = gt(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.arrowSvg = R("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(Ne(this)), w && (this.pasteHandler = w);
|
|
1614
1606
|
}
|