mind-elixir 5.12.2-beta.1 → 5.12.2-beta.3
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 +340 -346
- package/dist/MindElixirLite.iife.js +4 -4
- package/dist/MindElixirLite.js +252 -258
- package/package.json +1 -1
package/dist/MindElixir.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const es = 0, ts = 1, ns = 2,
|
|
1
|
+
const es = 0, ts = 1, ns = 2, ne = {
|
|
2
2
|
name: "Latte",
|
|
3
3
|
type: "light",
|
|
4
4
|
palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
|
|
@@ -67,10 +67,10 @@ const oe = function(e, t) {
|
|
|
67
67
|
return null;
|
|
68
68
|
} else
|
|
69
69
|
return null;
|
|
70
|
-
},
|
|
70
|
+
}, R = (e, t) => {
|
|
71
71
|
if (e.parent = t, e.children)
|
|
72
72
|
for (let n = 0; n < e.children.length; n++)
|
|
73
|
-
|
|
73
|
+
R(e.children[n], e);
|
|
74
74
|
}, F = (e, t, n) => {
|
|
75
75
|
if (e.expanded = t, e.children)
|
|
76
76
|
if (n === void 0 || n > 0) {
|
|
@@ -84,7 +84,7 @@ const oe = function(e, t) {
|
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
86
|
function pe(e) {
|
|
87
|
-
if (e.id =
|
|
87
|
+
if (e.id = B(), e.children)
|
|
88
88
|
for (let t = 0; t < e.children.length; t++)
|
|
89
89
|
pe(e.children[t]);
|
|
90
90
|
}
|
|
@@ -97,11 +97,11 @@ function se(e, t, n, o) {
|
|
|
97
97
|
y2: o + Math.sin(h) * r
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function B() {
|
|
101
101
|
return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substring(2)).substring(2, 18);
|
|
102
102
|
}
|
|
103
|
-
const
|
|
104
|
-
const e =
|
|
103
|
+
const mt = function() {
|
|
104
|
+
const e = B();
|
|
105
105
|
return {
|
|
106
106
|
topic: this.newTopicName,
|
|
107
107
|
id: e
|
|
@@ -123,7 +123,7 @@ const M = (e, t) => {
|
|
|
123
123
|
}, k = (e, t) => {
|
|
124
124
|
for (const n in t)
|
|
125
125
|
e.setAttribute(n, t[n]);
|
|
126
|
-
},
|
|
126
|
+
}, te = (e) => e ? e.tagName === "ME-TPC" : !1, me = (e) => e.filter((t) => t.nodeObj.parent).filter((t, n, o) => {
|
|
127
127
|
for (let s = 0; s < o.length; s++) {
|
|
128
128
|
if (t === o[s]) continue;
|
|
129
129
|
const { parent: i } = t.nodeObj;
|
|
@@ -148,7 +148,7 @@ const M = (e, t) => {
|
|
|
148
148
|
}, De = (e, t) => {
|
|
149
149
|
const n = e.x - t.x, o = e.y - t.y;
|
|
150
150
|
return Math.sqrt(n * n + o * o);
|
|
151
|
-
},
|
|
151
|
+
}, yt = function(e, t) {
|
|
152
152
|
if (!t)
|
|
153
153
|
return re(e), e;
|
|
154
154
|
let n = e.querySelector(".insert-preview");
|
|
@@ -165,11 +165,11 @@ const M = (e, t) => {
|
|
|
165
165
|
if (!(e && e.tagName === "ME-TPC" && e !== n && !o && e.nodeObj.parent)) return !1;
|
|
166
166
|
}
|
|
167
167
|
return !0;
|
|
168
|
-
},
|
|
168
|
+
}, bt = function(e) {
|
|
169
169
|
const t = document.createElement("div");
|
|
170
170
|
return t.className = "mind-elixir-ghost", e.container.appendChild(t), t;
|
|
171
171
|
};
|
|
172
|
-
class
|
|
172
|
+
class vt {
|
|
173
173
|
mind;
|
|
174
174
|
isMoving = !1;
|
|
175
175
|
interval = null;
|
|
@@ -186,19 +186,19 @@ class yt {
|
|
|
186
186
|
this.isMoving = !1, this.interval && (clearInterval(this.interval), this.interval = null);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function wt(e) {
|
|
190
190
|
return {
|
|
191
191
|
isDragging: !1,
|
|
192
192
|
insertType: null,
|
|
193
193
|
meet: null,
|
|
194
|
-
ghost:
|
|
195
|
-
edgeMoveController: new
|
|
194
|
+
ghost: bt(e),
|
|
195
|
+
edgeMoveController: new vt(e),
|
|
196
196
|
startX: 0,
|
|
197
197
|
startY: 0,
|
|
198
198
|
pointerId: null
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
|
-
const
|
|
201
|
+
const xt = 5;
|
|
202
202
|
function Me(e, t, n, o = !1) {
|
|
203
203
|
if (e.spacePressed) return !1;
|
|
204
204
|
const s = n.target;
|
|
@@ -222,11 +222,11 @@ function Je(e, t) {
|
|
|
222
222
|
s.parentElement.parentElement.style.opacity = "0.5";
|
|
223
223
|
e.panHelper.clear();
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Et(e, t, n) {
|
|
226
226
|
const { dragged: o } = e;
|
|
227
227
|
if (!o || t.pointerId !== n.pointerId) return;
|
|
228
228
|
const s = n.clientX - t.startX, i = n.clientY - t.startY, l = Math.sqrt(s * s + i * i);
|
|
229
|
-
if (!t.isDragging && l >
|
|
229
|
+
if (!t.isDragging && l > xt && Je(e, t), !t.isDragging) return;
|
|
230
230
|
const c = e.container.getBoundingClientRect();
|
|
231
231
|
Ue(t.ghost, n.clientX - c.x, n.clientY - c.y), n.clientX < c.x + 50 ? t.edgeMoveController.move(1, 0) : n.clientX > c.x + c.width - 50 ? t.edgeMoveController.move(-1, 0) : n.clientY < c.y + 50 ? t.edgeMoveController.move(0, 1) : n.clientY > c.y + c.height - 50 ? t.edgeMoveController.move(0, -1) : t.edgeMoveController.stop(), re(t.meet);
|
|
232
232
|
const r = 12 * e.scaleVal, a = document.elementFromPoint(n.clientX, n.clientY - r);
|
|
@@ -243,9 +243,9 @@ function wt(e, t, n) {
|
|
|
243
243
|
} else
|
|
244
244
|
t.insertType = null, t.meet = null;
|
|
245
245
|
}
|
|
246
|
-
t.meet &&
|
|
246
|
+
t.meet && yt(t.meet, t.insertType);
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function Ct(e, t, n) {
|
|
249
249
|
const { dragged: o } = e;
|
|
250
250
|
if (!(!o || t.pointerId !== n.pointerId)) {
|
|
251
251
|
t.edgeMoveController.stop();
|
|
@@ -263,14 +263,14 @@ function Ae(e, t) {
|
|
|
263
263
|
t.meet && re(t.meet), t.ghost.style.display = "none", t.ghost.innerHTML = "", e.dragged = null, t.isDragging = !1, t.insertType = null, t.meet = null, t.pointerId = null;
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function St(e) {
|
|
267
267
|
return () => {
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
270
|
const H = {
|
|
271
271
|
LHS: "lhs",
|
|
272
272
|
RHS: "rhs"
|
|
273
|
-
},
|
|
273
|
+
}, Nt = function() {
|
|
274
274
|
this.nodes.innerHTML = "";
|
|
275
275
|
const e = this.createTopic(this.nodeData);
|
|
276
276
|
be.call(this, e, this.nodeData), e.draggable = !1;
|
|
@@ -283,8 +283,8 @@ const H = {
|
|
|
283
283
|
i.direction === 0 ? o += 1 : i.direction === 1 ? s += 1 : o <= s ? (i.direction = 0, o += 1) : (i.direction = 1, s += 1);
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
|
-
|
|
287
|
-
},
|
|
286
|
+
Tt(this, n, t);
|
|
287
|
+
}, Tt = function(e, t, n) {
|
|
288
288
|
const o = document.createElement("me-main");
|
|
289
289
|
o.className = H.LHS;
|
|
290
290
|
const s = document.createElement("me-main");
|
|
@@ -294,7 +294,7 @@ const H = {
|
|
|
294
294
|
e.direction === 2 ? l.direction === 0 ? o.appendChild(c) : s.appendChild(c) : e.direction === 0 ? o.appendChild(c) : s.appendChild(c);
|
|
295
295
|
}
|
|
296
296
|
e.nodes.appendChild(o), e.nodes.appendChild(n), e.nodes.appendChild(s), e.nodes.appendChild(e.lines), e.nodes.appendChild(e.labelContainer);
|
|
297
|
-
},
|
|
297
|
+
}, kt = function(e, t) {
|
|
298
298
|
const n = document.createElement("me-children");
|
|
299
299
|
for (let o = 0; o < t.length; o++) {
|
|
300
300
|
const s = t[o], { grp: i } = e.createWrapper(s);
|
|
@@ -341,23 +341,23 @@ const H = {
|
|
|
341
341
|
typeof o == "string" ? s.textContent = o : (s.textContent = o.text, o.className && (s.className = o.className), o.style && Object.assign(s.style, o.style)), n.appendChild(s);
|
|
342
342
|
}), e.appendChild(n), e.tags = n;
|
|
343
343
|
} else e.tags && (e.tags = void 0);
|
|
344
|
-
},
|
|
344
|
+
}, _t = function(e, t) {
|
|
345
345
|
const n = document.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(e);
|
|
346
346
|
if (n.appendChild(o), !t && e.children && e.children.length > 0) {
|
|
347
347
|
const i = ve(e.expanded);
|
|
348
348
|
if (o.appendChild(i), e.expanded !== !1) {
|
|
349
|
-
const l =
|
|
349
|
+
const l = kt(this, e.children);
|
|
350
350
|
n.appendChild(l);
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
return { grp: n, top: o, tpc: s };
|
|
354
|
-
},
|
|
354
|
+
}, Dt = function(e) {
|
|
355
355
|
const t = document.createElement("me-parent"), n = this.createTopic(e);
|
|
356
356
|
return be.call(this, n, e), t.appendChild(n), { p: t, tpc: n };
|
|
357
|
-
},
|
|
357
|
+
}, Lt = function(e) {
|
|
358
358
|
const t = document.createElement("me-children");
|
|
359
359
|
return t.append(...e), t;
|
|
360
|
-
},
|
|
360
|
+
}, Mt = function(e) {
|
|
361
361
|
const t = document.createElement("me-tpc");
|
|
362
362
|
return t.nodeObj = e, t.dataset.nodeid = "me" + e.id, t;
|
|
363
363
|
};
|
|
@@ -367,7 +367,7 @@ function Qe(e) {
|
|
|
367
367
|
const n = window.getSelection();
|
|
368
368
|
n && (n.removeAllRanges(), n.addRange(t));
|
|
369
369
|
}
|
|
370
|
-
const
|
|
370
|
+
const At = function(e) {
|
|
371
371
|
if (!e) return;
|
|
372
372
|
const t = document.createElement("div"), n = e.nodeObj, o = n.topic, { offsetLeft: s, offsetTop: i } = M(this.nodes, e);
|
|
373
373
|
this.nodes.appendChild(t), t.id = "input-box", t.textContent = o, t.contentEditable = "plaintext-only", t.spellcheck = !1;
|
|
@@ -409,13 +409,13 @@ const Lt = function(e) {
|
|
|
409
409
|
const t = e.parent?.children, n = t?.indexOf(e) ?? 0;
|
|
410
410
|
return { siblings: t, index: n };
|
|
411
411
|
};
|
|
412
|
-
function
|
|
412
|
+
function Pt(e) {
|
|
413
413
|
const { siblings: t, index: n } = V(e);
|
|
414
414
|
if (t === void 0) return;
|
|
415
415
|
const o = t[n];
|
|
416
416
|
n === 0 ? (t[n] = t[t.length - 1], t[t.length - 1] = o) : (t[n] = t[n - 1], t[n - 1] = o);
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function Ot(e) {
|
|
419
419
|
const { siblings: t, index: n } = V(e);
|
|
420
420
|
if (t === void 0) return;
|
|
421
421
|
const o = t[n];
|
|
@@ -425,15 +425,15 @@ function et(e) {
|
|
|
425
425
|
const { siblings: t, index: n } = V(e);
|
|
426
426
|
return t === void 0 ? 0 : (t.splice(n, 1), t.length);
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function Ht(e, t, n) {
|
|
429
429
|
const { siblings: o, index: s } = V(n);
|
|
430
430
|
o !== void 0 && (t === "before" ? o.splice(s, 0, e) : o.splice(s + 1, 0, e));
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function $t(e, t) {
|
|
433
433
|
const { siblings: n, index: o } = V(e);
|
|
434
434
|
n !== void 0 && (n[o] = t, t.children = [e]);
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function jt(e, t, n) {
|
|
437
437
|
if (et(t), n.parent?.parent || (t.direction = n.direction), e === "in")
|
|
438
438
|
n.children ? n.children.push(t) : n.children = [t];
|
|
439
439
|
else {
|
|
@@ -443,7 +443,7 @@ function Ht(e, t, n) {
|
|
|
443
443
|
e === "before" ? o.splice(s, 0, t) : o.splice(s + 1, 0, t);
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
const
|
|
446
|
+
const It = function({ map: e, direction: t }, n) {
|
|
447
447
|
if (t === 0)
|
|
448
448
|
return 0;
|
|
449
449
|
if (t === 1)
|
|
@@ -455,15 +455,15 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
455
455
|
}, tt = function(e, t, n) {
|
|
456
456
|
const o = n.children[0].children[0], s = t.parentElement;
|
|
457
457
|
if (s.tagName === "ME-PARENT") {
|
|
458
|
-
if (
|
|
458
|
+
if (G(o), s.children[1])
|
|
459
459
|
s.nextSibling.appendChild(n);
|
|
460
460
|
else {
|
|
461
461
|
const i = e.createChildren([n]);
|
|
462
462
|
s.appendChild(ve(!0)), s.insertAdjacentElement("afterend", i);
|
|
463
463
|
}
|
|
464
464
|
e.linkDiv(n.offsetParent);
|
|
465
|
-
} else s.tagName === "ME-ROOT" && (
|
|
466
|
-
},
|
|
465
|
+
} else s.tagName === "ME-ROOT" && (It(e, o.nodeObj) === 0 ? e.container.querySelector(".lhs")?.appendChild(n) : e.container.querySelector(".rhs")?.appendChild(n), e.linkDiv());
|
|
466
|
+
}, Rt = function(e, t) {
|
|
467
467
|
const n = e.parentNode;
|
|
468
468
|
if (t === 0) {
|
|
469
469
|
const o = n.parentNode.parentNode;
|
|
@@ -473,10 +473,10 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
473
473
|
}, nt = {
|
|
474
474
|
before: "beforebegin",
|
|
475
475
|
after: "afterend"
|
|
476
|
-
},
|
|
476
|
+
}, G = function(e) {
|
|
477
477
|
const n = e.parentElement.parentElement.lastElementChild;
|
|
478
478
|
n?.tagName === "svg" && n?.remove();
|
|
479
|
-
},
|
|
479
|
+
}, Bt = function(e, t) {
|
|
480
480
|
const n = e.nodeObj, o = ge(n);
|
|
481
481
|
o.style && t.style && (t.style = Object.assign(o.style, t.style));
|
|
482
482
|
const s = Object.assign(n, t);
|
|
@@ -490,10 +490,10 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
490
490
|
const o = t.nodeObj;
|
|
491
491
|
o.expanded === !1 && (e.expandNode(t, !0), t = e.findEle(o.id));
|
|
492
492
|
const s = n || e.generateNewObj();
|
|
493
|
-
o.children ? o.children.push(s) : o.children = [s],
|
|
493
|
+
o.children ? o.children.push(s) : o.children = [s], R(e.nodeData);
|
|
494
494
|
const { grp: i, top: l } = e.createWrapper(s);
|
|
495
495
|
return tt(e, t, i), { newTop: l, newNodeObj: s };
|
|
496
|
-
},
|
|
496
|
+
}, Wt = function(e, t, n) {
|
|
497
497
|
const o = t || this.currentNode;
|
|
498
498
|
if (!o) return;
|
|
499
499
|
const s = o.nodeObj;
|
|
@@ -514,22 +514,22 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
514
514
|
const a = o.closest("me-main").className === H.LHS ? 0 : 1;
|
|
515
515
|
i.direction = a;
|
|
516
516
|
}
|
|
517
|
-
|
|
517
|
+
Ht(i, e, s), R(this.nodeData);
|
|
518
518
|
const l = o.parentElement, { grp: c, top: r } = this.createWrapper(i);
|
|
519
519
|
l.parentElement.insertAdjacentElement(nt[e], c), this.linkDiv(c.offsetParent), n || this.editTopic(r.firstChild), this.bus.fire("operation", {
|
|
520
520
|
name: "insertSibling",
|
|
521
521
|
type: e,
|
|
522
522
|
obj: i
|
|
523
523
|
}), this.selectNode(r.firstChild, !0);
|
|
524
|
-
},
|
|
524
|
+
}, Yt = function(e, t) {
|
|
525
525
|
const n = e || this.currentNode;
|
|
526
526
|
if (!n) return;
|
|
527
|
-
|
|
527
|
+
G(n);
|
|
528
528
|
const o = n.nodeObj;
|
|
529
529
|
if (!o.parent)
|
|
530
530
|
return;
|
|
531
531
|
const s = t || this.generateNewObj();
|
|
532
|
-
|
|
532
|
+
$t(o, s), R(this.nodeData);
|
|
533
533
|
const i = n.parentElement.parentElement, { grp: l, top: c } = this.createWrapper(s, !0);
|
|
534
534
|
c.appendChild(ve(!0)), i.insertAdjacentElement("afterend", l);
|
|
535
535
|
const r = this.createChildren([i]);
|
|
@@ -537,7 +537,7 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
537
537
|
name: "insertParent",
|
|
538
538
|
obj: s
|
|
539
539
|
});
|
|
540
|
-
},
|
|
540
|
+
}, Xt = function(e, t) {
|
|
541
541
|
const n = e || this.currentNode;
|
|
542
542
|
if (!n) return;
|
|
543
543
|
const o = we(this, n, t);
|
|
@@ -547,7 +547,7 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
547
547
|
name: "addChild",
|
|
548
548
|
obj: i
|
|
549
549
|
}), t || this.editTopic(s.firstChild), this.selectNode(s.firstChild, !0);
|
|
550
|
-
},
|
|
550
|
+
}, Ft = function(e, t) {
|
|
551
551
|
const n = ge(e.nodeObj);
|
|
552
552
|
pe(n);
|
|
553
553
|
const o = we(this, t, n);
|
|
@@ -557,7 +557,7 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
557
557
|
name: "copyNode",
|
|
558
558
|
obj: s
|
|
559
559
|
});
|
|
560
|
-
},
|
|
560
|
+
}, Vt = function(e, t) {
|
|
561
561
|
const n = [];
|
|
562
562
|
for (let o = 0; o < e.length; o++) {
|
|
563
563
|
const s = e[o], i = ge(s.nodeObj);
|
|
@@ -571,31 +571,31 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
571
571
|
name: "copyNodes",
|
|
572
572
|
objs: n
|
|
573
573
|
});
|
|
574
|
-
},
|
|
574
|
+
}, Kt = function(e) {
|
|
575
575
|
const t = e || this.currentNode;
|
|
576
576
|
if (!t) return;
|
|
577
577
|
const n = t.nodeObj;
|
|
578
|
-
|
|
578
|
+
Pt(n);
|
|
579
579
|
const o = t.parentNode.parentNode;
|
|
580
580
|
o.parentNode.insertBefore(o, o.previousSibling), this.linkDiv(), this.bus.fire("operation", {
|
|
581
581
|
name: "moveUpNode",
|
|
582
582
|
obj: n
|
|
583
583
|
});
|
|
584
|
-
},
|
|
584
|
+
}, zt = function(e) {
|
|
585
585
|
const t = e || this.currentNode;
|
|
586
586
|
if (!t) return;
|
|
587
587
|
const n = t.nodeObj;
|
|
588
|
-
|
|
588
|
+
Ot(n);
|
|
589
589
|
const o = t.parentNode.parentNode;
|
|
590
590
|
o.nextSibling ? o.nextSibling.insertAdjacentElement("afterend", o) : o.parentNode.prepend(o), this.linkDiv(), this.bus.fire("operation", {
|
|
591
591
|
name: "moveDownNode",
|
|
592
592
|
obj: n
|
|
593
593
|
});
|
|
594
|
-
},
|
|
594
|
+
}, Gt = function(e) {
|
|
595
595
|
if (e = me(e), e.length === 0) return;
|
|
596
596
|
for (const n of e) {
|
|
597
597
|
const o = n.nodeObj, s = et(o);
|
|
598
|
-
|
|
598
|
+
Rt(n, s);
|
|
599
599
|
}
|
|
600
600
|
const t = e[e.length - 1];
|
|
601
601
|
this.selectNode(this.findEle(t.nodeObj.parent.id)), this.linkDiv(), this.bus.fire("operation", {
|
|
@@ -609,11 +609,11 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
609
609
|
const i = [];
|
|
610
610
|
for (const c of e) {
|
|
611
611
|
const r = c.nodeObj;
|
|
612
|
-
if (
|
|
612
|
+
if (jt(t, r, s), R(o.nodeData), t === "in") {
|
|
613
613
|
const a = c.parentElement;
|
|
614
614
|
tt(o, n, a.parentElement);
|
|
615
615
|
} else {
|
|
616
|
-
|
|
616
|
+
G(c);
|
|
617
617
|
const a = c.parentElement.parentNode;
|
|
618
618
|
i.includes(a.parentElement) || i.push(a.parentElement), n.parentElement.parentNode.insertAdjacentElement(nt[t], a);
|
|
619
619
|
}
|
|
@@ -627,36 +627,36 @@ const $t = function({ map: e, direction: t }, n) {
|
|
|
627
627
|
objs: e.map((c) => c.nodeObj),
|
|
628
628
|
toObj: s
|
|
629
629
|
});
|
|
630
|
-
},
|
|
630
|
+
}, qt = function(e, t) {
|
|
631
631
|
xe(e, "in", t, this);
|
|
632
|
-
},
|
|
632
|
+
}, Ut = function(e, t) {
|
|
633
633
|
xe(e, "before", t, this);
|
|
634
|
-
},
|
|
634
|
+
}, Jt = function(e, t) {
|
|
635
635
|
xe(e, "after", t, this);
|
|
636
|
-
},
|
|
636
|
+
}, Zt = function(e) {
|
|
637
637
|
const t = e || this.currentNode;
|
|
638
638
|
t && (t.nodeObj.dangerouslySetInnerHTML || this.editTopic(t));
|
|
639
|
-
},
|
|
639
|
+
}, Qt = function(e, t) {
|
|
640
640
|
e.text.textContent = t, e.nodeObj.topic = t, this.linkDiv();
|
|
641
641
|
}, ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
642
642
|
__proto__: null,
|
|
643
|
-
addChild:
|
|
644
|
-
beginEdit:
|
|
645
|
-
copyNode:
|
|
646
|
-
copyNodes:
|
|
647
|
-
insertParent:
|
|
648
|
-
insertSibling:
|
|
649
|
-
moveDownNode:
|
|
650
|
-
moveNodeAfter:
|
|
651
|
-
moveNodeBefore:
|
|
652
|
-
moveNodeIn:
|
|
653
|
-
moveUpNode:
|
|
654
|
-
removeNodes:
|
|
655
|
-
reshapeNode:
|
|
656
|
-
rmSubline:
|
|
657
|
-
setNodeTopic:
|
|
643
|
+
addChild: Xt,
|
|
644
|
+
beginEdit: Zt,
|
|
645
|
+
copyNode: Ft,
|
|
646
|
+
copyNodes: Vt,
|
|
647
|
+
insertParent: Yt,
|
|
648
|
+
insertSibling: Wt,
|
|
649
|
+
moveDownNode: zt,
|
|
650
|
+
moveNodeAfter: Jt,
|
|
651
|
+
moveNodeBefore: Ut,
|
|
652
|
+
moveNodeIn: qt,
|
|
653
|
+
moveUpNode: Kt,
|
|
654
|
+
removeNodes: Gt,
|
|
655
|
+
reshapeNode: Bt,
|
|
656
|
+
rmSubline: G,
|
|
657
|
+
setNodeTopic: Qt
|
|
658
658
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
659
|
-
function
|
|
659
|
+
function en(e) {
|
|
660
660
|
return {
|
|
661
661
|
nodeData: e.isFocusMode ? e.nodeDataBackup : e.nodeData,
|
|
662
662
|
arrows: e.arrows,
|
|
@@ -667,44 +667,44 @@ function Zt(e) {
|
|
|
667
667
|
meta: e.meta
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
|
-
const
|
|
670
|
+
const tn = function(e, t = !1) {
|
|
671
671
|
const n = this.container, o = e.getBoundingClientRect(), s = n.getBoundingClientRect();
|
|
672
672
|
if (t || o.top > s.bottom - 50 || o.bottom < s.top + 50 || o.left > s.right - 50 || o.right < s.left + 50) {
|
|
673
673
|
const l = o.left + o.width / 2, c = o.top + o.height / 2, r = s.left + s.width / 2, a = s.top + s.height / 2, d = l - r, h = c - a;
|
|
674
674
|
this.move(-d, -h, !0);
|
|
675
675
|
}
|
|
676
|
-
},
|
|
676
|
+
}, nn = function(e, t, n) {
|
|
677
677
|
this.clearSelection(), this.scrollIntoView(e), this.selection?.select(e), t && this.bus.fire("selectNewNode", e.nodeObj);
|
|
678
|
-
},
|
|
678
|
+
}, on = function(e) {
|
|
679
679
|
this.selection?.select(e);
|
|
680
|
-
},
|
|
680
|
+
}, sn = function(e) {
|
|
681
681
|
this.selection?.deselect(e);
|
|
682
|
-
},
|
|
682
|
+
}, rn = function() {
|
|
683
683
|
this.unselectNodes(this.currentNodes), this.unselectSummary(), this.unselectArrow();
|
|
684
684
|
}, Ee = function(e) {
|
|
685
685
|
return JSON.stringify(e, (t, n) => {
|
|
686
686
|
if (!(t === "parent" && typeof n != "string"))
|
|
687
687
|
return n;
|
|
688
688
|
});
|
|
689
|
-
},
|
|
690
|
-
const e =
|
|
689
|
+
}, ln = function() {
|
|
690
|
+
const e = en(this);
|
|
691
691
|
return Ee(e);
|
|
692
|
-
},
|
|
692
|
+
}, cn = function() {
|
|
693
693
|
return JSON.parse(this.getDataString());
|
|
694
|
-
},
|
|
694
|
+
}, an = function() {
|
|
695
695
|
this.editable = !0;
|
|
696
|
-
},
|
|
696
|
+
}, dn = function() {
|
|
697
697
|
this.editable = !1;
|
|
698
|
-
},
|
|
698
|
+
}, hn = function(e, t = { x: 0, y: 0 }) {
|
|
699
699
|
if (e < this.scaleMin && e < this.scaleVal || e > this.scaleMax && e > this.scaleVal) return;
|
|
700
700
|
const n = this.container.getBoundingClientRect(), o = t.x ? t.x - n.left - n.width / 2 : 0, s = t.y ? t.y - n.top - n.height / 2 : 0, { dx: i, dy: l } = Ce(this), c = this.map.style.transform, { x: r, y: a } = ye(c), d = r - i, h = a - l, u = this.scaleVal, b = (-o + d) * (1 - e / u), v = (-s + h) * (1 - e / u);
|
|
701
701
|
this.map.style.transform = `translate3d(${r - b}px, ${a - v}px, 0) scale(${e})`, this.scaleVal = e, this.bus.fire("scale", e);
|
|
702
|
-
},
|
|
702
|
+
}, fn = function() {
|
|
703
703
|
const e = this.nodes.offsetHeight / this.container.offsetHeight, t = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(e, t));
|
|
704
704
|
this.scaleVal = n;
|
|
705
705
|
const { dx: o, dy: s } = Ce(this, !0);
|
|
706
706
|
this.map.style.transform = `translate3d(${o}px, ${s}px, 0) scale(${n})`, this.bus.fire("scale", n);
|
|
707
|
-
},
|
|
707
|
+
}, un = function(e, t, n = !1) {
|
|
708
708
|
const { map: o, scaleVal: s, bus: i, container: l, nodes: c } = this;
|
|
709
709
|
if (n && o.style.transition === "transform 0.3s")
|
|
710
710
|
return;
|
|
@@ -732,29 +732,29 @@ const Qt = function(e, t = !1) {
|
|
|
732
732
|
i = n.offsetWidth / 2 - a - d / 2, l = n.offsetHeight / 2 - r - h / 2, o.style.transformOrigin = `${a + d / 2}px 50%`;
|
|
733
733
|
}
|
|
734
734
|
return { dx: i, dy: l };
|
|
735
|
-
},
|
|
735
|
+
}, pn = function() {
|
|
736
736
|
const { map: e, container: t } = this, { dx: n, dy: o } = Ce(this);
|
|
737
737
|
t.scrollTop = 0, t.scrollLeft = 0, e.style.transform = `translate3d(${n}px, ${o}px, 0) scale(${this.scaleVal})`;
|
|
738
|
-
},
|
|
738
|
+
}, gn = function(e) {
|
|
739
739
|
e(this);
|
|
740
|
-
},
|
|
740
|
+
}, mn = function(e) {
|
|
741
741
|
e.nodeObj.parent && (this.clearSelection(), this.tempDirection === null && (this.tempDirection = this.direction), this.isFocusMode || (this.nodeDataBackup = this.nodeData, this.isFocusMode = !0), this.nodeData = e.nodeObj, this.initRight(), this.toCenter());
|
|
742
|
-
},
|
|
742
|
+
}, yn = function() {
|
|
743
743
|
this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
|
|
744
|
-
},
|
|
744
|
+
}, bn = function() {
|
|
745
745
|
this.direction = 0, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
746
|
-
},
|
|
746
|
+
}, vn = function() {
|
|
747
747
|
this.direction = 1, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
748
|
-
},
|
|
748
|
+
}, wn = function() {
|
|
749
749
|
this.direction = 2, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
750
|
-
},
|
|
750
|
+
}, xn = function(e, t) {
|
|
751
751
|
const n = e.nodeObj;
|
|
752
752
|
typeof t == "boolean" ? n.expanded = t : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
|
|
753
753
|
const o = e.getBoundingClientRect(), s = {
|
|
754
754
|
x: o.left,
|
|
755
755
|
y: o.top
|
|
756
756
|
}, i = e.parentNode, l = i.children[1];
|
|
757
|
-
if (l.expanded = n.expanded, l.className = n.expanded ? "minus" : "",
|
|
757
|
+
if (l.expanded = n.expanded, l.className = n.expanded ? "minus" : "", G(e), n.expanded) {
|
|
758
758
|
const h = this.createChildren(
|
|
759
759
|
n.children.map((u) => this.createWrapper(u).grp)
|
|
760
760
|
);
|
|
@@ -767,7 +767,7 @@ const Qt = function(e, t = !1) {
|
|
|
767
767
|
y: c.top
|
|
768
768
|
}, a = s.x - r.x, d = s.y - r.y;
|
|
769
769
|
this.move(a, d), this.bus.fire("expandNode", n);
|
|
770
|
-
},
|
|
770
|
+
}, En = function(e, t) {
|
|
771
771
|
const n = e.nodeObj, o = e.getBoundingClientRect(), s = {
|
|
772
772
|
x: o.left,
|
|
773
773
|
y: o.top
|
|
@@ -778,50 +778,50 @@ const Qt = function(e, t = !1) {
|
|
|
778
778
|
y: i.top
|
|
779
779
|
}, c = s.x - l.x, r = s.y - l.y;
|
|
780
780
|
this.move(c, r);
|
|
781
|
-
},
|
|
782
|
-
this.clearSelection(), e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.arrows = e.arrows || [], this.summaries = e.summaries || [], e.meta && (this.meta = e.meta), e.theme && this.changeTheme(e.theme)),
|
|
783
|
-
},
|
|
781
|
+
}, Cn = function(e) {
|
|
782
|
+
this.clearSelection(), e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.arrows = e.arrows || [], this.summaries = e.summaries || [], e.meta && (this.meta = e.meta), e.theme && this.changeTheme(e.theme)), R(this.nodeData), this.layout(), this.linkDiv();
|
|
783
|
+
}, Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
784
784
|
__proto__: null,
|
|
785
|
-
cancelFocus:
|
|
786
|
-
clearSelection:
|
|
787
|
-
disableEdit:
|
|
788
|
-
enableEdit:
|
|
789
|
-
expandNode:
|
|
790
|
-
expandNodeAll:
|
|
791
|
-
focusNode:
|
|
792
|
-
getData:
|
|
793
|
-
getDataString:
|
|
794
|
-
initLeft:
|
|
795
|
-
initRight:
|
|
796
|
-
initSide:
|
|
797
|
-
install:
|
|
798
|
-
move:
|
|
799
|
-
refresh:
|
|
800
|
-
scale:
|
|
801
|
-
scaleFit:
|
|
802
|
-
scrollIntoView:
|
|
803
|
-
selectNode:
|
|
804
|
-
selectNodes:
|
|
785
|
+
cancelFocus: yn,
|
|
786
|
+
clearSelection: rn,
|
|
787
|
+
disableEdit: dn,
|
|
788
|
+
enableEdit: an,
|
|
789
|
+
expandNode: xn,
|
|
790
|
+
expandNodeAll: En,
|
|
791
|
+
focusNode: mn,
|
|
792
|
+
getData: cn,
|
|
793
|
+
getDataString: ln,
|
|
794
|
+
initLeft: bn,
|
|
795
|
+
initRight: vn,
|
|
796
|
+
initSide: wn,
|
|
797
|
+
install: gn,
|
|
798
|
+
move: un,
|
|
799
|
+
refresh: Cn,
|
|
800
|
+
scale: hn,
|
|
801
|
+
scaleFit: fn,
|
|
802
|
+
scrollIntoView: tn,
|
|
803
|
+
selectNode: nn,
|
|
804
|
+
selectNodes: on,
|
|
805
805
|
stringifyData: Ee,
|
|
806
|
-
toCenter:
|
|
807
|
-
unselectNodes:
|
|
808
|
-
}, Symbol.toStringTag, { value: "Module" })), Pe = "MIND-ELIXIR-WAIT-COPY",
|
|
809
|
-
const i = -
|
|
806
|
+
toCenter: pn,
|
|
807
|
+
unselectNodes: sn
|
|
808
|
+
}, Symbol.toStringTag, { value: "Module" })), Pe = "MIND-ELIXIR-WAIT-COPY", Nn = 40, Tn = 10, kn = ({ deltaMode: e, deltaY: t, viewportHeight: n }) => e === WheelEvent.DOM_DELTA_LINE ? t * Nn : e === WheelEvent.DOM_DELTA_PAGE ? t * n : t, _n = ({ deltaMode: e, deltaY: t, scaleSensitivity: n, viewportHeight: o }) => {
|
|
809
|
+
const i = -kn({ deltaMode: e, deltaY: t, viewportHeight: o }) / Tn * n;
|
|
810
810
|
return Math.max(-n, Math.min(n, i));
|
|
811
811
|
}, st = (e, t, n) => {
|
|
812
812
|
t !== 0 && e.scale(e.scaleVal + t, n);
|
|
813
|
-
},
|
|
813
|
+
}, Dn = (e, t) => {
|
|
814
814
|
const n = e.map.querySelectorAll(`.${t}>me-wrapper>me-parent>me-tpc`);
|
|
815
815
|
n.length !== 0 && e.selectNode(n[Math.ceil(n.length / 2) - 1]);
|
|
816
|
-
},
|
|
816
|
+
}, Ln = (e) => {
|
|
817
817
|
e.selectNode(e.map.querySelector("me-root>me-tpc"));
|
|
818
|
-
},
|
|
818
|
+
}, Mn = function(e, t) {
|
|
819
819
|
const n = t.parentElement.parentElement.parentElement.previousSibling;
|
|
820
820
|
if (n) {
|
|
821
821
|
const o = n.firstChild;
|
|
822
822
|
e.selectNode(o);
|
|
823
823
|
}
|
|
824
|
-
},
|
|
824
|
+
}, An = function(e, t) {
|
|
825
825
|
const n = t.parentElement.nextSibling;
|
|
826
826
|
if (n && n.firstChild) {
|
|
827
827
|
const o = n.firstChild.firstChild.firstChild;
|
|
@@ -831,7 +831,7 @@ const Qt = function(e, t = !1) {
|
|
|
831
831
|
const n = e.currentNode || e.currentNodes?.[0];
|
|
832
832
|
if (!n) return;
|
|
833
833
|
const o = n.nodeObj, s = n.offsetParent.offsetParent.parentElement;
|
|
834
|
-
o.parent ? s.className === t ?
|
|
834
|
+
o.parent ? s.className === t ? An(e, n) : o.parent?.parent ? Mn(e, n) : Ln(e) : Dn(e, t);
|
|
835
835
|
}, He = function(e, t) {
|
|
836
836
|
const n = e.currentNode;
|
|
837
837
|
if (!n || !n.nodeObj.parent) return;
|
|
@@ -840,8 +840,8 @@ const Qt = function(e, t = !1) {
|
|
|
840
840
|
}, $e = function(e, t, n) {
|
|
841
841
|
const o = t === "in" ? e.scaleSensitivity : -e.scaleSensitivity;
|
|
842
842
|
st(e, o, n);
|
|
843
|
-
},
|
|
844
|
-
const n =
|
|
843
|
+
}, Pn = (e, t) => {
|
|
844
|
+
const n = _n({
|
|
845
845
|
deltaMode: t.deltaMode,
|
|
846
846
|
deltaY: t.deltaY,
|
|
847
847
|
scaleSensitivity: e.scaleSensitivity,
|
|
@@ -849,7 +849,7 @@ const Qt = function(e, t = !1) {
|
|
|
849
849
|
});
|
|
850
850
|
st(e, n, { x: t.clientX, y: t.clientY });
|
|
851
851
|
};
|
|
852
|
-
function
|
|
852
|
+
function On(e, t) {
|
|
853
853
|
t = t === !0 ? {} : t;
|
|
854
854
|
const n = () => {
|
|
855
855
|
e.currentArrow ? e.removeArrow() : e.currentSummary ? e.removeSummary(e.currentSummary.summaryObj.id) : e.currentNodes && e.removeNodes(e.currentNodes);
|
|
@@ -961,7 +961,7 @@ function An(e, t) {
|
|
|
961
961
|
e.pasteHandler && e.pasteHandler(r);
|
|
962
962
|
});
|
|
963
963
|
}
|
|
964
|
-
function
|
|
964
|
+
function Hn(e) {
|
|
965
965
|
const { panHelper: t, container: n } = e;
|
|
966
966
|
let o = null;
|
|
967
967
|
e.spacePressed = !1;
|
|
@@ -1021,7 +1021,7 @@ function Pn(e) {
|
|
|
1021
1021
|
clear() {
|
|
1022
1022
|
this.activePointers.clear(), this.lastDistance = null;
|
|
1023
1023
|
}
|
|
1024
|
-
}, c =
|
|
1024
|
+
}, c = wt(e), r = {
|
|
1025
1025
|
timer: null,
|
|
1026
1026
|
startPos: null,
|
|
1027
1027
|
pointerId: null,
|
|
@@ -1068,7 +1068,7 @@ function Pn(e) {
|
|
|
1068
1068
|
}, h = (f) => {
|
|
1069
1069
|
if (!e.editable) return;
|
|
1070
1070
|
const y = f.target;
|
|
1071
|
-
if (
|
|
1071
|
+
if (te(y)) {
|
|
1072
1072
|
e.selectNode(y), e.beginEdit(y);
|
|
1073
1073
|
return;
|
|
1074
1074
|
}
|
|
@@ -1085,7 +1085,7 @@ function Pn(e) {
|
|
|
1085
1085
|
return;
|
|
1086
1086
|
}
|
|
1087
1087
|
if (t.handlePointerDown(f), t.mousedown && (e.ptState = i.Pan), f.button === 0 || f.pointerType === "touch")
|
|
1088
|
-
if (
|
|
1088
|
+
if (te(y)) {
|
|
1089
1089
|
e.selection?.cancel();
|
|
1090
1090
|
const S = e.currentNodes || [];
|
|
1091
1091
|
if (f.ctrlKey || f.metaKey || e.mobileMultiSelect ? S.includes(y) ? o = y : ((e.currentArrow || e.currentSummary) && e.clearSelection(), e.selection?.select(y)) : S.includes(y) || e.selectNode(y), !e.editable) return;
|
|
@@ -1103,7 +1103,7 @@ function Pn(e) {
|
|
|
1103
1103
|
r.handleMove(f), r.timer === null && (e.ptState = i.Idle);
|
|
1104
1104
|
break;
|
|
1105
1105
|
case i.Drag:
|
|
1106
|
-
|
|
1106
|
+
Et(e, c, f);
|
|
1107
1107
|
break;
|
|
1108
1108
|
case i.Pan:
|
|
1109
1109
|
t.handlePointerMove(f);
|
|
@@ -1117,7 +1117,7 @@ function Pn(e) {
|
|
|
1117
1117
|
r.clear();
|
|
1118
1118
|
break;
|
|
1119
1119
|
case i.Drag:
|
|
1120
|
-
|
|
1120
|
+
Ct(e, c, f);
|
|
1121
1121
|
break;
|
|
1122
1122
|
case i.Pan:
|
|
1123
1123
|
t.handlePointerUp(f);
|
|
@@ -1130,10 +1130,10 @@ function Pn(e) {
|
|
|
1130
1130
|
f.preventDefault(), f.button === 2 && e.editable && setTimeout(() => {
|
|
1131
1131
|
if (e.panHelper.moved || e.ptState !== i.Idle && e.ptState !== i.Pan) return;
|
|
1132
1132
|
const y = f.target;
|
|
1133
|
-
|
|
1133
|
+
te(y) && !y.classList.contains("selected") && e.selectNode(y), e.bus.fire("showContextMenu", f);
|
|
1134
1134
|
}, 200);
|
|
1135
1135
|
}, m = (f) => {
|
|
1136
|
-
if (f.stopPropagation(), f.preventDefault(), f.ctrlKey || f.metaKey) return
|
|
1136
|
+
if (f.stopPropagation(), f.preventDefault(), f.ctrlKey || f.metaKey) return Pn(e, f);
|
|
1137
1137
|
if (f.shiftKey) return e.move(-f.deltaY, 0);
|
|
1138
1138
|
e.move(-f.deltaX, -f.deltaY);
|
|
1139
1139
|
}, w = (f) => {
|
|
@@ -1154,7 +1154,7 @@ function Pn(e) {
|
|
|
1154
1154
|
{ dom: n, evt: "keyup", func: E }
|
|
1155
1155
|
]);
|
|
1156
1156
|
}
|
|
1157
|
-
function
|
|
1157
|
+
function $n() {
|
|
1158
1158
|
return {
|
|
1159
1159
|
handlers: {},
|
|
1160
1160
|
addListener: function(e, t) {
|
|
@@ -1201,7 +1201,7 @@ const A = "http://www.w3.org/2000/svg", le = function(e) {
|
|
|
1201
1201
|
}, je = function() {
|
|
1202
1202
|
const e = document.createElementNS(A, "line");
|
|
1203
1203
|
return e.setAttribute("stroke", "#4dc4ff"), e.setAttribute("fill", "none"), e.setAttribute("stroke-width", "2"), e.setAttribute("opacity", "0.45"), e;
|
|
1204
|
-
},
|
|
1204
|
+
}, jn = function(e, t, n, o) {
|
|
1205
1205
|
const s = document.createElementNS(A, "g");
|
|
1206
1206
|
return [
|
|
1207
1207
|
{
|
|
@@ -1260,7 +1260,7 @@ const A = "http://www.w3.org/2000/svg", le = function(e) {
|
|
|
1260
1260
|
obj: n
|
|
1261
1261
|
}));
|
|
1262
1262
|
});
|
|
1263
|
-
},
|
|
1263
|
+
}, In = function(e) {
|
|
1264
1264
|
const t = this.map.querySelector("me-root"), n = t.offsetTop, o = t.offsetLeft, s = t.offsetWidth, i = t.offsetHeight, l = this.map.querySelectorAll("me-main > me-wrapper");
|
|
1265
1265
|
this.lines.innerHTML = "";
|
|
1266
1266
|
for (let c = 0; c < l.length; c++) {
|
|
@@ -1285,7 +1285,7 @@ const A = "http://www.w3.org/2000/svg", le = function(e) {
|
|
|
1285
1285
|
continue;
|
|
1286
1286
|
lt(e, t, E, b, s);
|
|
1287
1287
|
}
|
|
1288
|
-
},
|
|
1288
|
+
}, Rn = {
|
|
1289
1289
|
addChild: "Add child",
|
|
1290
1290
|
addParent: "Add parent",
|
|
1291
1291
|
addSibling: "Add sibling",
|
|
@@ -1299,11 +1299,11 @@ const A = "http://www.w3.org/2000/svg", le = function(e) {
|
|
|
1299
1299
|
clickTips: "Please click the target node",
|
|
1300
1300
|
summary: "Summary"
|
|
1301
1301
|
};
|
|
1302
|
-
function
|
|
1302
|
+
function Bn(e, t) {
|
|
1303
1303
|
const n = {
|
|
1304
1304
|
focus: !0,
|
|
1305
1305
|
link: !0,
|
|
1306
|
-
locale:
|
|
1306
|
+
locale: Rn
|
|
1307
1307
|
};
|
|
1308
1308
|
t = t === !0 ? n : Object.assign(n, t);
|
|
1309
1309
|
const o = (y) => {
|
|
@@ -1325,7 +1325,7 @@ function In(e, t) {
|
|
|
1325
1325
|
let E = !0;
|
|
1326
1326
|
const N = (y) => {
|
|
1327
1327
|
const x = y.target;
|
|
1328
|
-
if (
|
|
1328
|
+
if (te(x)) {
|
|
1329
1329
|
x.parentElement.tagName === "ME-ROOT" ? E = !0 : E = !1, E ? (d.className = "disabled", u.className = "disabled", b.className = "disabled", c.className = "disabled", r.className = "disabled", a.className = "disabled") : (d.className = "", u.className = "", b.className = "", c.className = "", r.className = "", a.className = ""), w.hidden = !1, m.style.top = "", m.style.bottom = "", m.style.left = "", m.style.right = "";
|
|
1330
1330
|
const S = m.offsetHeight, C = m.offsetWidth, T = m.getBoundingClientRect(), D = y.clientY - T.top, L = y.clientX - T.left;
|
|
1331
1331
|
S + D > window.innerHeight ? (m.style.top = "", m.style.bottom = "0px") : (m.style.bottom = "", m.style.top = D + 15 + "px"), C + L > window.innerWidth ? (m.style.left = "", m.style.right = "0px") : (m.style.right = "", m.style.left = L + 10 + "px");
|
|
@@ -1371,7 +1371,7 @@ function In(e, t) {
|
|
|
1371
1371
|
l.onclick = null, c.onclick = null, r.onclick = null, a.onclick = null, d.onclick = null, h.onclick = null, u.onclick = null, b.onclick = null, v.onclick = null, g.onclick = null, w.onclick = null, e.container.oncontextmenu = null;
|
|
1372
1372
|
};
|
|
1373
1373
|
}
|
|
1374
|
-
const
|
|
1374
|
+
const Wn = function(e) {
|
|
1375
1375
|
return ["createSummary", "removeSummary", "finishEditSummary"].includes(e.name) ? {
|
|
1376
1376
|
type: "summary",
|
|
1377
1377
|
value: e.obj.id
|
|
@@ -1386,7 +1386,7 @@ const Bn = function(e) {
|
|
|
1386
1386
|
value: [e.obj.id]
|
|
1387
1387
|
};
|
|
1388
1388
|
};
|
|
1389
|
-
function
|
|
1389
|
+
function Yn(e) {
|
|
1390
1390
|
let t = [], n = -1, o = e.getData(), s = [];
|
|
1391
1391
|
e.undo = function() {
|
|
1392
1392
|
if (n > -1) {
|
|
@@ -1419,7 +1419,7 @@ function Rn(e) {
|
|
|
1419
1419
|
prev: o,
|
|
1420
1420
|
operation: r.name,
|
|
1421
1421
|
currentSelected: s.map((h) => h.id),
|
|
1422
|
-
currentTarget:
|
|
1422
|
+
currentTarget: Wn(r),
|
|
1423
1423
|
next: a
|
|
1424
1424
|
};
|
|
1425
1425
|
t.push(d), o = a, n = t.length - 1;
|
|
@@ -1432,19 +1432,19 @@ function Rn(e) {
|
|
|
1432
1432
|
e.bus.removeListener("operation", i), e.bus.removeListener("selectNodes", c), e.container.removeEventListener("keydown", l);
|
|
1433
1433
|
};
|
|
1434
1434
|
}
|
|
1435
|
-
const
|
|
1436
|
-
side:
|
|
1437
|
-
left:
|
|
1438
|
-
right:
|
|
1439
|
-
full:
|
|
1440
|
-
living:
|
|
1441
|
-
zoomin:
|
|
1442
|
-
zoomout:
|
|
1435
|
+
const Xn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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>', Fn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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>', Vn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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>', Kn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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>', zn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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>', Gn = '<?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>', qn = '<?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>', Un = {
|
|
1436
|
+
side: Xn,
|
|
1437
|
+
left: Fn,
|
|
1438
|
+
right: Vn,
|
|
1439
|
+
full: Kn,
|
|
1440
|
+
living: zn,
|
|
1441
|
+
zoomin: Gn,
|
|
1442
|
+
zoomout: qn
|
|
1443
1443
|
}, I = (e, t) => {
|
|
1444
1444
|
const n = document.createElement("span");
|
|
1445
|
-
return n.id = e, n.innerHTML =
|
|
1445
|
+
return n.id = e, n.innerHTML = Un[t], n;
|
|
1446
1446
|
};
|
|
1447
|
-
function
|
|
1447
|
+
function Jn(e) {
|
|
1448
1448
|
const t = document.createElement("div"), n = I("fullscreen", "full"), o = I("toCenter", "living"), s = I("zoomout", "zoomout"), i = I("zoomin", "zoomin");
|
|
1449
1449
|
t.appendChild(n), t.appendChild(o), t.appendChild(s), t.appendChild(i), t.className = "mind-elixir-toolbar rb";
|
|
1450
1450
|
let l = null;
|
|
@@ -1472,7 +1472,7 @@ function qn(e) {
|
|
|
1472
1472
|
e.scale(e.scaleVal + e.scaleSensitivity);
|
|
1473
1473
|
}, t;
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function Zn(e) {
|
|
1476
1476
|
const t = document.createElement("div"), n = I("tbltl", "left"), o = I("tbltr", "right"), s = I("tblts", "side");
|
|
1477
1477
|
return t.appendChild(n), t.appendChild(o), t.appendChild(s), t.className = "mind-elixir-toolbar lt", n.onclick = () => {
|
|
1478
1478
|
e.initLeft();
|
|
@@ -1482,10 +1482,10 @@ function Un(e) {
|
|
|
1482
1482
|
e.initSide();
|
|
1483
1483
|
}, t;
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1486
|
-
e.container.append(
|
|
1485
|
+
function Qn(e) {
|
|
1486
|
+
e.container.append(Jn(e)), e.container.append(Zn(e));
|
|
1487
1487
|
}
|
|
1488
|
-
class
|
|
1488
|
+
class eo {
|
|
1489
1489
|
_listeners = /* @__PURE__ */ new Map();
|
|
1490
1490
|
addEventListener(t, n) {
|
|
1491
1491
|
const o = this._listeners.get(t) ?? /* @__PURE__ */ new Set();
|
|
@@ -1513,10 +1513,10 @@ const Ie = (e, t = "px") => typeof e == "number" ? e + t : e, $ = ({ style: e },
|
|
|
1513
1513
|
for (const [o, s] of Object.entries(t))
|
|
1514
1514
|
s !== void 0 && (e[o] = Ie(s));
|
|
1515
1515
|
else n !== void 0 && (e[t] = Ie(n));
|
|
1516
|
-
},
|
|
1516
|
+
}, Re = (e = 0, t = 0, n = 0, o = 0) => {
|
|
1517
1517
|
const s = { x: e, y: t, width: n, height: o, top: t, left: e, right: e + n, bottom: t + o };
|
|
1518
1518
|
return { ...s, toJSON: () => JSON.stringify(s) };
|
|
1519
|
-
},
|
|
1519
|
+
}, to = (e) => {
|
|
1520
1520
|
let t, n = -1, o = !1;
|
|
1521
1521
|
return {
|
|
1522
1522
|
next: (...s) => {
|
|
@@ -1528,7 +1528,7 @@ const Ie = (e, t = "px") => typeof e == "number" ? e + t : e, $ = ({ style: e },
|
|
|
1528
1528
|
cancelAnimationFrame(n), o = !1;
|
|
1529
1529
|
}
|
|
1530
1530
|
};
|
|
1531
|
-
},
|
|
1531
|
+
}, Be = (e, t, n = "touch") => {
|
|
1532
1532
|
switch (n) {
|
|
1533
1533
|
case "center": {
|
|
1534
1534
|
const o = t.left + t.width / 2, s = t.top + t.height / 2;
|
|
@@ -1539,16 +1539,16 @@ const Ie = (e, t = "px") => typeof e == "number" ? e + t : e, $ = ({ style: e },
|
|
|
1539
1539
|
case "touch":
|
|
1540
1540
|
return e.right >= t.left && e.left <= t.right && e.bottom >= t.top && e.top <= t.bottom;
|
|
1541
1541
|
}
|
|
1542
|
-
},
|
|
1542
|
+
}, no = () => matchMedia("(hover: none), (pointer: coarse)").matches, oo = () => "safari" in window, fe = (e) => Array.isArray(e) ? e : [e], ct = (e) => (t, n, o, s = {}) => {
|
|
1543
1543
|
(t instanceof HTMLCollection || t instanceof NodeList) && (t = Array.from(t)), n = fe(n), t = fe(t);
|
|
1544
1544
|
for (const i of t)
|
|
1545
1545
|
if (i)
|
|
1546
1546
|
for (const l of n)
|
|
1547
1547
|
i[e](l, o, { capture: !1, ...s });
|
|
1548
|
-
}, W = ct("addEventListener"), O = ct("removeEventListener"),
|
|
1548
|
+
}, W = ct("addEventListener"), O = ct("removeEventListener"), J = (e) => {
|
|
1549
1549
|
const { clientX: t, clientY: n, target: o } = e.touches?.[0] ?? e;
|
|
1550
1550
|
return { x: t, y: n, target: o };
|
|
1551
|
-
}, Y = (e, t = document) => fe(e).map((n) => typeof n == "string" ? Array.from(t.querySelectorAll(n)) : n instanceof Element ? n : null).flat().filter(Boolean),
|
|
1551
|
+
}, Y = (e, t = document) => fe(e).map((n) => typeof n == "string" ? Array.from(t.querySelectorAll(n)) : n instanceof Element ? n : null).flat().filter(Boolean), so = (e, t) => t.some((n) => typeof n == "number" ? e.button === n : typeof n == "object" ? n.button !== e.button ? !1 : n.modifiers.every((o) => {
|
|
1552
1552
|
switch (o) {
|
|
1553
1553
|
case "alt":
|
|
1554
1554
|
return e.altKey;
|
|
@@ -1563,7 +1563,7 @@ const Ie = (e, t = "px") => typeof e == "number" ? e + t : e, $ = ({ style: e },
|
|
|
1563
1563
|
touched: [],
|
|
1564
1564
|
changed: { added: [], removed: [] }
|
|
1565
1565
|
});
|
|
1566
|
-
class
|
|
1566
|
+
class io extends eo {
|
|
1567
1567
|
static version = "mind-elixir-fork";
|
|
1568
1568
|
// Options
|
|
1569
1569
|
_options;
|
|
@@ -1581,7 +1581,7 @@ class oo extends Zn {
|
|
|
1581
1581
|
_latestElement;
|
|
1582
1582
|
// Dynamically constructed area rect
|
|
1583
1583
|
_areaLocation = { y1: 0, x2: 0, y2: 0, x1: 0 };
|
|
1584
|
-
_areaRect =
|
|
1584
|
+
_areaRect = Re();
|
|
1585
1585
|
// If a single click is being performed, it's a single-click until the user dragged the mouse
|
|
1586
1586
|
_singleClick = !0;
|
|
1587
1587
|
_frame;
|
|
@@ -1645,7 +1645,7 @@ class oo extends Zn {
|
|
|
1645
1645
|
// https://stackoverflow.com/a/38268846
|
|
1646
1646
|
pointerEvents: "none",
|
|
1647
1647
|
zIndex: "1"
|
|
1648
|
-
}), this._frame =
|
|
1648
|
+
}), this._frame = to((i) => {
|
|
1649
1649
|
this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move", i), this._redrawSelectionArea();
|
|
1650
1650
|
}), this.enable();
|
|
1651
1651
|
}
|
|
@@ -1654,11 +1654,11 @@ class oo extends Zn {
|
|
|
1654
1654
|
(t ? W : O)(n, "pointerdown", this._onTapStart);
|
|
1655
1655
|
}
|
|
1656
1656
|
_onTapStart(t, n = !1) {
|
|
1657
|
-
const { x: o, y: s, target: i } =
|
|
1658
|
-
if (!
|
|
1657
|
+
const { x: o, y: s, target: i } = J(t), { document: l, startAreas: c, boundaries: r, behaviour: a, features: d } = this._options, h = i.getBoundingClientRect();
|
|
1658
|
+
if (!so(t, a.triggers))
|
|
1659
1659
|
return;
|
|
1660
1660
|
const u = Y(c, l), b = Y(r, l);
|
|
1661
|
-
this._targetElement = b.find((m) =>
|
|
1661
|
+
this._targetElement = b.find((m) => Be(m.getBoundingClientRect(), h));
|
|
1662
1662
|
const v = t.composedPath(), p = u.find((m) => v.includes(m));
|
|
1663
1663
|
if (this._targetBoundary = b.find((m) => v.includes(m)), !this._targetElement || !p || !this._targetBoundary || !n && this._emitEvent("beforestart", t) === !1)
|
|
1664
1664
|
return;
|
|
@@ -1670,7 +1670,7 @@ class oo extends Zn {
|
|
|
1670
1670
|
const {
|
|
1671
1671
|
singleTap: { intersect: n },
|
|
1672
1672
|
range: o
|
|
1673
|
-
} = this._options.features, s =
|
|
1673
|
+
} = this._options.features, s = J(t);
|
|
1674
1674
|
let i;
|
|
1675
1675
|
if (n === "native")
|
|
1676
1676
|
i = s.target;
|
|
@@ -1706,7 +1706,7 @@ class oo extends Zn {
|
|
|
1706
1706
|
container: n,
|
|
1707
1707
|
document: o,
|
|
1708
1708
|
behaviour: { startThreshold: s }
|
|
1709
|
-
} = this._options, { x1: i, y1: l } = this._areaLocation, { x: c, y: r } =
|
|
1709
|
+
} = this._options, { x1: i, y1: l } = this._areaLocation, { x: c, y: r } = J(t);
|
|
1710
1710
|
if (
|
|
1711
1711
|
// Single number for both coordinates
|
|
1712
1712
|
typeof s == "number" && j(c + r - (i + l)) >= s || // Different x and y threshold
|
|
@@ -1741,7 +1741,7 @@ class oo extends Zn {
|
|
|
1741
1741
|
}));
|
|
1742
1742
|
}
|
|
1743
1743
|
_onTapMove(t) {
|
|
1744
|
-
const { _scrollSpeed: n, _areaLocation: o, _options: s, _frame: i } = this, { speedDivider: l } = s.behaviour.scrolling, { x: c, y: r } =
|
|
1744
|
+
const { _scrollSpeed: n, _areaLocation: o, _options: s, _frame: i } = this, { speedDivider: l } = s.behaviour.scrolling, { x: c, y: r } = J(t);
|
|
1745
1745
|
if (o.x2 = c, o.y2 = r, this._scrollAvailable && !this._scrollingActive && (n.y || n.x)) {
|
|
1746
1746
|
this._scrollingActive = !0;
|
|
1747
1747
|
const a = () => {
|
|
@@ -1763,7 +1763,7 @@ class oo extends Zn {
|
|
|
1763
1763
|
}
|
|
1764
1764
|
_handleMoveEvent(t) {
|
|
1765
1765
|
const { features: n } = this._options;
|
|
1766
|
-
(n.touch &&
|
|
1766
|
+
(n.touch && no() || this._scrollAvailable && oo()) && t.preventDefault();
|
|
1767
1767
|
}
|
|
1768
1768
|
_onScroll() {
|
|
1769
1769
|
const {
|
|
@@ -1785,7 +1785,7 @@ class oo extends Zn {
|
|
|
1785
1785
|
} = s;
|
|
1786
1786
|
r < i.left + d.x ? (t.x = -j(i.left - r + d.x), r = r < i.left ? i.left : r) : r > i.right - d.x ? (t.x = j(i.left + i.width - r - d.x), r = r > i.right ? i.right : r) : t.x = 0, a < i.top + d.y ? (t.y = -j(i.top - a + d.y), a = a < i.top ? i.top : a) : a > i.bottom - d.y ? (t.y = j(i.top + i.height - a - d.y), a = a > i.bottom ? i.bottom : a) : t.y = 0;
|
|
1787
1787
|
const h = Ye(l, r), u = Ye(c, a), b = We(l, r), v = We(c, a);
|
|
1788
|
-
this._areaRect =
|
|
1788
|
+
this._areaRect = Re(h, u, b - h, v - u);
|
|
1789
1789
|
}
|
|
1790
1790
|
_redrawSelectionArea() {
|
|
1791
1791
|
const { x: t, y: n, width: o, height: s } = this._areaRect, { style: i } = this._area;
|
|
@@ -1799,7 +1799,7 @@ class oo extends Zn {
|
|
|
1799
1799
|
const { _selectables: t, _options: n, _selection: o, _areaRect: s } = this, { stored: i, selected: l, touched: c } = o, { intersect: r, overlap: a } = n.behaviour, d = a === "invert", h = [], u = [], b = [];
|
|
1800
1800
|
for (let p = 0; p < t.length; p++) {
|
|
1801
1801
|
const g = t[p];
|
|
1802
|
-
if (
|
|
1802
|
+
if (Be(s, g.getBoundingClientRect(), r)) {
|
|
1803
1803
|
if (l.includes(g))
|
|
1804
1804
|
i.includes(g) && !c.includes(g) && c.push(g);
|
|
1805
1805
|
else if (d && i.includes(g)) {
|
|
@@ -1951,8 +1951,8 @@ class oo extends Zn {
|
|
|
1951
1951
|
this._selection.stored = s.filter((c) => !l.includes(c)), this._selection.selected = o.filter((c) => !l.includes(c)), this._selection.changed.added = [], this._selection.changed.removed.push(...l.filter((c) => !i.removed.includes(c))), this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null));
|
|
1952
1952
|
}
|
|
1953
1953
|
}
|
|
1954
|
-
function
|
|
1955
|
-
const t = e.mouseSelectionButton === 2 ? [2] : [0], n = new
|
|
1954
|
+
function ro(e) {
|
|
1955
|
+
const t = e.mouseSelectionButton === 2 ? [2] : [0], n = new io({
|
|
1956
1956
|
selectables: [".map-container me-tpc"],
|
|
1957
1957
|
boundaries: [e.container],
|
|
1958
1958
|
container: e.selectionContainer,
|
|
@@ -2015,29 +2015,41 @@ function so(e) {
|
|
|
2015
2015
|
);
|
|
2016
2016
|
e.selection = n;
|
|
2017
2017
|
}
|
|
2018
|
-
|
|
2018
|
+
function at({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, containerHeight: a }) {
|
|
2019
|
+
let d = t + n / 2;
|
|
2020
|
+
const h = e + o / 2;
|
|
2021
|
+
let u;
|
|
2022
|
+
r === H.LHS ? u = i + l : u = i;
|
|
2023
|
+
const b = s + c / 2, p = (1 - Math.abs(b - h) / a) * 0.25 * (n / 2);
|
|
2024
|
+
return r === H.LHS ? d = d - n / 10 - p : d = d + n / 10 + p, `M ${d} ${h} Q ${d} ${b} ${u} ${b}`;
|
|
2025
|
+
}
|
|
2026
|
+
function dt({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, isFirst: a }) {
|
|
2027
|
+
const d = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
|
|
2028
|
+
let h = 0, u = 0;
|
|
2029
|
+
a ? h = e + o / 2 : h = e + o;
|
|
2030
|
+
const b = s + c;
|
|
2031
|
+
let v = 0, p = 0, g = 0;
|
|
2032
|
+
const m = Math.abs(h - b) / 300 * d;
|
|
2033
|
+
return r === H.LHS ? (g = t, v = g + d, p = g - d, u = i + d, `M ${v} ${h} C ${g} ${h} ${g + m} ${b} ${p} ${b} H ${u}`) : (g = t + n, v = g - d, p = g + d, u = i + l - d, `M ${v} ${h} C ${g} ${h} ${g - m} ${b} ${p} ${b} H ${u}`);
|
|
2034
|
+
}
|
|
2035
|
+
const lo = function(e, t = !0) {
|
|
2036
|
+
const n = this.theme || ne, s = (e.type || n.type) === "dark" ? ue : ne;
|
|
2019
2037
|
this.theme = {
|
|
2020
|
-
...
|
|
2038
|
+
...n,
|
|
2021
2039
|
...e,
|
|
2022
|
-
cssVar: {
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
};
|
|
2031
|
-
this.compact && (o["--node-gap-x"] = "15px", o["--node-gap-y"] = "2px", o["--main-gap-x"] = "30px", o["--main-gap-y"] = "6px");
|
|
2032
|
-
const s = Object.keys(o);
|
|
2033
|
-
for (let i = 0; i < s.length; i++) {
|
|
2034
|
-
const l = s[i];
|
|
2035
|
-
this.container.style.setProperty(l, o[l]);
|
|
2040
|
+
cssVar: e.cssVar ? { ...n.cssVar, ...e.cssVar } : { ...s.cssVar }
|
|
2041
|
+
}, this.generateMainBranch = this.theme.generateMainBranch || at, this.generateSubBranch = this.theme.generateSubBranch || dt;
|
|
2042
|
+
const i = { ...this.theme.cssVar };
|
|
2043
|
+
this.compact && (i["--node-gap-x"] = "15px", i["--node-gap-y"] = "2px", i["--main-gap-x"] = "30px", i["--main-gap-y"] = "6px");
|
|
2044
|
+
const l = Object.keys(i);
|
|
2045
|
+
for (let c = 0; c < l.length; c++) {
|
|
2046
|
+
const r = l[c];
|
|
2047
|
+
this.container.style.setProperty(r, i[r]);
|
|
2036
2048
|
}
|
|
2037
2049
|
t && this.refresh();
|
|
2038
|
-
},
|
|
2050
|
+
}, co = function(e) {
|
|
2039
2051
|
this.compact = e, this.theme && this.changeTheme(this.theme);
|
|
2040
|
-
},
|
|
2052
|
+
}, ao = function(e) {
|
|
2041
2053
|
return {
|
|
2042
2054
|
dom: e,
|
|
2043
2055
|
moved: !1,
|
|
@@ -2073,18 +2085,18 @@ const io = function(e, t = !0) {
|
|
|
2073
2085
|
}
|
|
2074
2086
|
};
|
|
2075
2087
|
}, Ve = {
|
|
2076
|
-
create:
|
|
2077
|
-
},
|
|
2078
|
-
function
|
|
2088
|
+
create: ao
|
|
2089
|
+
}, ht = "#4dc4ff";
|
|
2090
|
+
function ft(e, t, n, o, s, i, l, c) {
|
|
2079
2091
|
return {
|
|
2080
2092
|
x: e / 8 + n * 3 / 8 + s * 3 / 8 + l / 8,
|
|
2081
2093
|
y: t / 8 + o * 3 / 8 + i * 3 / 8 + c / 8
|
|
2082
2094
|
};
|
|
2083
2095
|
}
|
|
2084
|
-
function
|
|
2096
|
+
function ho(e, t, n) {
|
|
2085
2097
|
e && (e.dataset.x = t.toString(), e.dataset.y = n.toString(), le(e));
|
|
2086
2098
|
}
|
|
2087
|
-
function
|
|
2099
|
+
function Z(e, t, n, o, s) {
|
|
2088
2100
|
k(e, {
|
|
2089
2101
|
x1: t + "",
|
|
2090
2102
|
y1: n + "",
|
|
@@ -2118,12 +2130,12 @@ function Ke(e, t, n, o, s, i, l, c, r, a) {
|
|
|
2118
2130
|
}
|
|
2119
2131
|
}
|
|
2120
2132
|
}
|
|
2121
|
-
const { x: b, y: v } =
|
|
2122
|
-
if (e.labelEl &&
|
|
2133
|
+
const { x: b, y: v } = ft(t, n, o, s, i, l, c, r);
|
|
2134
|
+
if (e.labelEl && ho(e.labelEl, b, v), a.style?.labelColor) {
|
|
2123
2135
|
const p = e.labelEl;
|
|
2124
2136
|
p && (p.style.color = a.style.labelColor);
|
|
2125
2137
|
}
|
|
2126
|
-
|
|
2138
|
+
vo(e);
|
|
2127
2139
|
}
|
|
2128
2140
|
function ie(e, t, n) {
|
|
2129
2141
|
const { offsetLeft: o, offsetTop: s } = M(e.nodes, t), i = t.offsetWidth, l = t.offsetHeight, c = o + i / 2, r = s + l / 2, a = c + n.x, d = r + n.y;
|
|
@@ -2144,7 +2156,7 @@ function X(e) {
|
|
|
2144
2156
|
y: n
|
|
2145
2157
|
};
|
|
2146
2158
|
}
|
|
2147
|
-
const
|
|
2159
|
+
const fo = function(e, t, n) {
|
|
2148
2160
|
const o = M(e.nodes, t), s = M(e.nodes, n), i = o.offsetLeft + t.offsetWidth / 2, l = o.offsetTop + t.offsetHeight / 2, c = s.offsetLeft + n.offsetWidth / 2, r = s.offsetTop + n.offsetHeight / 2, a = c - i, d = r - l, h = Math.sqrt(a * a + d * d), u = Math.max(50, Math.min(200, h * 0.3)), b = Math.abs(a), v = Math.abs(d);
|
|
2149
2161
|
let p, g;
|
|
2150
2162
|
if (h < 150) {
|
|
@@ -2168,7 +2180,7 @@ const ao = function(e, t, n) {
|
|
|
2168
2180
|
if (!t || !n)
|
|
2169
2181
|
return;
|
|
2170
2182
|
if (!o.delta1 || !o.delta2) {
|
|
2171
|
-
const C =
|
|
2183
|
+
const C = fo(e, t, n);
|
|
2172
2184
|
o.delta1 = C.delta1, o.delta2 = C.delta2;
|
|
2173
2185
|
}
|
|
2174
2186
|
const i = ie(e, t, o.delta1), l = ie(e, n, o.delta2), { x: c, y: r } = X(i), { ctrlX: a, ctrlY: d } = i, { ctrlX: h, ctrlY: u } = l, { x: b, y: v } = X(l), p = se(h, u, b, v);
|
|
@@ -2180,7 +2192,7 @@ const ao = function(e, t, n) {
|
|
|
2180
2192
|
if (!C) return;
|
|
2181
2193
|
m = `M ${C.x1} ${C.y1} L ${c} ${r} L ${C.x2} ${C.y2}`;
|
|
2182
2194
|
}
|
|
2183
|
-
const w =
|
|
2195
|
+
const w = jn(`M ${c} ${r} C ${a} ${d} ${h} ${u} ${b} ${v}`, g, m, o.style), { x: E, y: N } = ft(c, r, a, d, h, u, b, v), f = o.style?.labelColor || "rgb(235, 95, 82)", y = "a-" + o.id;
|
|
2184
2196
|
w.id = y;
|
|
2185
2197
|
const x = e.markdown ? e.markdown(o.label, o) : o.label, S = he(x, E, N, {
|
|
2186
2198
|
anchor: "middle",
|
|
@@ -2188,10 +2200,10 @@ const ao = function(e, t, n) {
|
|
|
2188
2200
|
dataType: "arrow",
|
|
2189
2201
|
svgId: y
|
|
2190
2202
|
});
|
|
2191
|
-
w.labelEl = S, w.arrowObj = o, w.dataset.linkid = o.id, e.labelContainer.appendChild(S), e.arrowSvg.appendChild(w), le(S), s || (e.arrows.push(o), e.currentArrow = w,
|
|
2192
|
-
},
|
|
2203
|
+
w.labelEl = S, w.arrowObj = o, w.dataset.linkid = o.id, e.labelContainer.appendChild(S), e.arrowSvg.appendChild(w), le(S), s || (e.arrows.push(o), e.currentArrow = w, pt(e, o, i, l));
|
|
2204
|
+
}, uo = function(e, t, n = {}) {
|
|
2193
2205
|
const o = {
|
|
2194
|
-
id:
|
|
2206
|
+
id: B(),
|
|
2195
2207
|
label: "Custom Link",
|
|
2196
2208
|
from: e.nodeObj.id,
|
|
2197
2209
|
to: t.nodeObj.id,
|
|
@@ -2201,14 +2213,14 @@ const ao = function(e, t, n) {
|
|
|
2201
2213
|
name: "createArrow",
|
|
2202
2214
|
obj: o
|
|
2203
2215
|
});
|
|
2204
|
-
},
|
|
2216
|
+
}, po = function(e) {
|
|
2205
2217
|
ce(this);
|
|
2206
|
-
const t = { ...e, id:
|
|
2218
|
+
const t = { ...e, id: B() };
|
|
2207
2219
|
Se(this, this.findEle(t.from), this.findEle(t.to), t), this.bus.fire("operation", {
|
|
2208
2220
|
name: "createArrow",
|
|
2209
2221
|
obj: t
|
|
2210
2222
|
});
|
|
2211
|
-
},
|
|
2223
|
+
}, go = function(e) {
|
|
2212
2224
|
let t;
|
|
2213
2225
|
if (e ? t = e : t = this.currentArrow, !t) return;
|
|
2214
2226
|
ce(this);
|
|
@@ -2219,11 +2231,11 @@ const ao = function(e, t, n) {
|
|
|
2219
2231
|
id: n
|
|
2220
2232
|
}
|
|
2221
2233
|
});
|
|
2222
|
-
},
|
|
2234
|
+
}, mo = function(e) {
|
|
2223
2235
|
this.currentArrow = e;
|
|
2224
2236
|
const t = e.arrowObj, n = this.findEle(t.from), o = this.findEle(t.to), s = ie(this, n, t.delta1), i = ie(this, o, t.delta2);
|
|
2225
|
-
this.editable ?
|
|
2226
|
-
},
|
|
2237
|
+
this.editable ? pt(this, t, s, i) : ut(e, ht), this.bus.fire("selectArrow", t);
|
|
2238
|
+
}, yo = function() {
|
|
2227
2239
|
ce(this), this.currentArrow = null, this.bus.fire("unselectArrow");
|
|
2228
2240
|
}, ae = function(e, t) {
|
|
2229
2241
|
const n = document.createElementNS(A, "path");
|
|
@@ -2235,7 +2247,7 @@ const ao = function(e, t, n) {
|
|
|
2235
2247
|
"stroke-linecap": "round",
|
|
2236
2248
|
"stroke-linejoin": "round"
|
|
2237
2249
|
}), n;
|
|
2238
|
-
},
|
|
2250
|
+
}, ut = function(e, t) {
|
|
2239
2251
|
const n = document.createElementNS(A, "g");
|
|
2240
2252
|
n.setAttribute("class", "arrow-highlight"), n.setAttribute("opacity", "0.45");
|
|
2241
2253
|
const o = ae(e.line.getAttribute("d"), t);
|
|
@@ -2246,32 +2258,32 @@ const ao = function(e, t, n) {
|
|
|
2246
2258
|
n.appendChild(i);
|
|
2247
2259
|
}
|
|
2248
2260
|
e.insertBefore(n, e.firstChild);
|
|
2249
|
-
},
|
|
2261
|
+
}, bo = function(e) {
|
|
2250
2262
|
const t = e.querySelector(".arrow-highlight");
|
|
2251
2263
|
t && t.remove();
|
|
2252
|
-
},
|
|
2264
|
+
}, vo = function(e) {
|
|
2253
2265
|
const t = e.querySelector(".arrow-highlight");
|
|
2254
2266
|
if (!t) return;
|
|
2255
2267
|
const n = t.querySelectorAll("path");
|
|
2256
2268
|
n.length >= 1 && n[0].setAttribute("d", e.line.getAttribute("d")), n.length >= 2 && n[1].setAttribute("d", e.arrow1.getAttribute("d")), n.length >= 3 && e.arrow2.getAttribute("d") && n[2].setAttribute("d", e.arrow2.getAttribute("d"));
|
|
2257
2269
|
}, ce = function(e) {
|
|
2258
|
-
e.helper1?.destroy(), e.helper2?.destroy(), e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none", e.currentArrow &&
|
|
2259
|
-
},
|
|
2270
|
+
e.helper1?.destroy(), e.helper2?.destroy(), e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none", e.currentArrow && bo(e.currentArrow);
|
|
2271
|
+
}, pt = function(e, t, n, o) {
|
|
2260
2272
|
const { linkController: s, P2: i, P3: l, line1: c, line2: r, nodes: a, map: d, currentArrow: h, bus: u } = e;
|
|
2261
2273
|
if (!h) return;
|
|
2262
|
-
s.style.display = "initial", i.style.display = "initial", l.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(l),
|
|
2274
|
+
s.style.display = "initial", i.style.display = "initial", l.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(l), ut(h, ht);
|
|
2263
2275
|
let { x: b, y: v } = X(n), { ctrlX: p, ctrlY: g } = n, { ctrlX: m, ctrlY: w } = o, { x: E, y: N } = X(o);
|
|
2264
|
-
i.style.cssText = `top:${g}px;left:${p}px;`, l.style.cssText = `top:${w}px;left:${m}px;`,
|
|
2276
|
+
i.style.cssText = `top:${g}px;left:${p}px;`, l.style.cssText = `top:${w}px;left:${m}px;`, Z(c, b, v, p, g), Z(r, m, w, E, N), e.helper1 = Ve.create(i), e.helper2 = Ve.create(l), e.helper1.init(d, (f, y) => {
|
|
2265
2277
|
p = p + f / e.scaleVal, g = g + y / e.scaleVal;
|
|
2266
2278
|
const x = X({ ...n, ctrlX: p, ctrlY: g });
|
|
2267
|
-
b = x.x, v = x.y, i.style.top = g + "px", i.style.left = p + "px", Ke(h, b, v, p, g, m, w, E, N, t),
|
|
2279
|
+
b = x.x, v = x.y, i.style.top = g + "px", i.style.left = p + "px", Ke(h, b, v, p, g, m, w, E, N, t), Z(c, b, v, p, g), t.delta1.x = Math.round(p - n.cx), t.delta1.y = Math.round(g - n.cy), u.fire("updateArrowDelta", t);
|
|
2268
2280
|
}), e.helper2.init(d, (f, y) => {
|
|
2269
2281
|
m = m + f / e.scaleVal, w = w + y / e.scaleVal;
|
|
2270
2282
|
const x = X({ ...o, ctrlX: m, ctrlY: w });
|
|
2271
|
-
E = x.x, N = x.y, l.style.top = w + "px", l.style.left = m + "px", Ke(h, b, v, p, g, m, w, E, N, t),
|
|
2283
|
+
E = x.x, N = x.y, l.style.top = w + "px", l.style.left = m + "px", Ke(h, b, v, p, g, m, w, E, N, t), Z(r, m, w, E, N), t.delta2.x = Math.round(m - o.cx), t.delta2.y = Math.round(w - o.cy), u.fire("updateArrowDelta", t);
|
|
2272
2284
|
});
|
|
2273
2285
|
};
|
|
2274
|
-
function
|
|
2286
|
+
function wo() {
|
|
2275
2287
|
this.arrowSvg.innerHTML = "", this.labelContainer.querySelectorAll('.svg-label[data-type="arrow"]').forEach((t) => t.remove());
|
|
2276
2288
|
for (let t = 0; t < this.arrows.length; t++) {
|
|
2277
2289
|
const n = this.arrows[t];
|
|
@@ -2282,23 +2294,23 @@ function bo() {
|
|
|
2282
2294
|
}
|
|
2283
2295
|
this.nodes.appendChild(this.arrowSvg);
|
|
2284
2296
|
}
|
|
2285
|
-
function
|
|
2297
|
+
function xo(e) {
|
|
2286
2298
|
ce(this), e && e.labelEl && rt(this, e.labelEl, e.arrowObj);
|
|
2287
2299
|
}
|
|
2288
|
-
function
|
|
2300
|
+
function Eo() {
|
|
2289
2301
|
this.arrows = this.arrows.filter((e) => oe(e.from, this.nodeData) && oe(e.to, this.nodeData));
|
|
2290
2302
|
}
|
|
2291
|
-
const
|
|
2303
|
+
const Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2292
2304
|
__proto__: null,
|
|
2293
|
-
createArrow:
|
|
2294
|
-
createArrowFrom:
|
|
2295
|
-
editArrowLabel:
|
|
2296
|
-
removeArrow:
|
|
2297
|
-
renderArrow:
|
|
2298
|
-
selectArrow:
|
|
2299
|
-
tidyArrow:
|
|
2300
|
-
unselectArrow:
|
|
2301
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2305
|
+
createArrow: uo,
|
|
2306
|
+
createArrowFrom: po,
|
|
2307
|
+
editArrowLabel: xo,
|
|
2308
|
+
removeArrow: go,
|
|
2309
|
+
renderArrow: wo,
|
|
2310
|
+
selectArrow: mo,
|
|
2311
|
+
tidyArrow: Eo,
|
|
2312
|
+
unselectArrow: yo
|
|
2313
|
+
}, Symbol.toStringTag, { value: "Module" })), So = function(e) {
|
|
2302
2314
|
if (e.length === 0) throw new Error("No selected node.");
|
|
2303
2315
|
if (e.length === 1) {
|
|
2304
2316
|
const r = e[0].nodeObj, a = e[0].nodeObj.parent;
|
|
@@ -2335,7 +2347,7 @@ const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2335
2347
|
start: i,
|
|
2336
2348
|
end: l
|
|
2337
2349
|
};
|
|
2338
|
-
},
|
|
2350
|
+
}, No = function(e) {
|
|
2339
2351
|
const t = document.createElementNS(A, "g");
|
|
2340
2352
|
return t.setAttribute("id", e), t;
|
|
2341
2353
|
}, ze = function(e, t) {
|
|
@@ -2347,69 +2359,69 @@ const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2347
2359
|
"stroke-linecap": "round",
|
|
2348
2360
|
"stroke-width": "2"
|
|
2349
2361
|
}), n;
|
|
2350
|
-
},
|
|
2362
|
+
}, To = (e) => e.parentElement.parentElement, ko = function(e, { parent: t, start: n }) {
|
|
2351
2363
|
const o = e.findEle(t), s = o.nodeObj;
|
|
2352
2364
|
let i;
|
|
2353
2365
|
return s.parent ? i = o.closest("me-main").className : i = e.findEle(s.children[n].id).closest("me-main").className, i;
|
|
2354
2366
|
}, Ne = function(e, t) {
|
|
2355
|
-
const { id: n, label: o, parent: s, start: i, end: l, style: c } = t, { nodes: r, theme: a, summarySvg: d } = e, u = e.findEle(s).nodeObj, b =
|
|
2367
|
+
const { id: n, label: o, parent: s, start: i, end: l, style: c } = t, { nodes: r, theme: a, summarySvg: d } = e, u = e.findEle(s).nodeObj, b = ko(e, t);
|
|
2356
2368
|
let v = 1 / 0, p = 0, g = 0, m = 0;
|
|
2357
2369
|
for (let K = i; K <= l; K++) {
|
|
2358
2370
|
const Te = u.children?.[K];
|
|
2359
2371
|
if (!Te)
|
|
2360
2372
|
return e.removeSummary(n), null;
|
|
2361
|
-
const
|
|
2362
|
-
K === i && (g = ke + _e), K === l && (m = ke +
|
|
2373
|
+
const q = To(e.findEle(Te.id)), { offsetLeft: U, offsetTop: ke } = M(r, q), _e = i === l ? 10 : 20;
|
|
2374
|
+
K === i && (g = ke + _e), K === l && (m = ke + q.offsetHeight - _e), U < v && (v = U), q.offsetWidth + U > p && (p = q.offsetWidth + U);
|
|
2363
2375
|
}
|
|
2364
2376
|
let w, E;
|
|
2365
2377
|
const N = u.parent ? 10 : 0, f = g + N, y = m + N, x = (f + y) / 2, S = c?.stroke || a.cssVar["--color"], C = c?.labelColor || a.cssVar["--color"], T = "s-" + n, D = e.markdown ? e.markdown(o, t) : o;
|
|
2366
2378
|
b === H.LHS ? (w = ze(`M ${v + 10} ${f} c -5 0 -10 5 -10 10 L ${v} ${y - 10} c 0 5 5 10 10 10 M ${v} ${x} h -10`, S), E = he(D, v - 20, x, { anchor: "end", color: C, dataType: "summary", svgId: T })) : (w = ze(`M ${p - 10} ${f} c 5 0 10 5 10 10 L ${p} ${y - 10} c 0 5 -5 10 -10 10 M ${p} ${x} h 10`, S), E = he(D, p + 20, x, { anchor: "start", color: C, dataType: "summary", svgId: T }));
|
|
2367
|
-
const L =
|
|
2379
|
+
const L = No(T);
|
|
2368
2380
|
return L.appendChild(w), e.labelContainer.appendChild(E), le(E), L.summaryObj = t, L.labelEl = E, d.appendChild(L), L;
|
|
2369
|
-
},
|
|
2381
|
+
}, _o = function(e = {}) {
|
|
2370
2382
|
if (!this.currentNodes) return;
|
|
2371
|
-
const { currentNodes: t, summaries: n, bus: o } = this, { parent: s, start: i, end: l } =
|
|
2383
|
+
const { currentNodes: t, summaries: n, bus: o } = this, { parent: s, start: i, end: l } = So(t), c = { id: B(), parent: s, start: i, end: l, label: "summary", style: e.style }, r = Ne(this, c);
|
|
2372
2384
|
n.push(c), this.editSummary(r), o.fire("operation", {
|
|
2373
2385
|
name: "createSummary",
|
|
2374
2386
|
obj: c
|
|
2375
2387
|
});
|
|
2376
|
-
},
|
|
2377
|
-
const t =
|
|
2388
|
+
}, Do = function(e) {
|
|
2389
|
+
const t = B(), n = { ...e, id: t };
|
|
2378
2390
|
Ne(this, n), this.summaries.push(n), this.bus.fire("operation", {
|
|
2379
2391
|
name: "createSummary",
|
|
2380
2392
|
obj: n
|
|
2381
2393
|
});
|
|
2382
|
-
},
|
|
2394
|
+
}, Lo = function(e) {
|
|
2383
2395
|
const t = this.summaries.findIndex((n) => n.id === e);
|
|
2384
2396
|
t > -1 && (this.summaries.splice(t, 1), this.nodes.querySelector("#s-" + e)?.remove(), this.nodes.querySelector("#label-s-" + e)?.remove()), this.bus.fire("operation", {
|
|
2385
2397
|
name: "removeSummary",
|
|
2386
2398
|
obj: { id: e }
|
|
2387
2399
|
});
|
|
2388
|
-
},
|
|
2400
|
+
}, Mo = function(e) {
|
|
2389
2401
|
const t = e.labelEl;
|
|
2390
2402
|
t && t.classList.add("selected"), this.currentSummary = e, this.bus.fire("selectSummary", e.summaryObj);
|
|
2391
|
-
},
|
|
2403
|
+
}, Ao = function() {
|
|
2392
2404
|
this.currentSummary?.labelEl?.classList.remove("selected"), this.currentSummary = null, this.bus.fire("unselectSummary");
|
|
2393
|
-
},
|
|
2405
|
+
}, Po = function() {
|
|
2394
2406
|
this.summarySvg.innerHTML = "", this.summaries.forEach((e) => {
|
|
2395
2407
|
try {
|
|
2396
2408
|
Ne(this, e);
|
|
2397
2409
|
} catch {
|
|
2398
2410
|
}
|
|
2399
2411
|
}), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
|
|
2400
|
-
},
|
|
2412
|
+
}, Oo = function(e) {
|
|
2401
2413
|
e && e.labelEl && rt(this, e.labelEl, e.summaryObj);
|
|
2402
|
-
},
|
|
2414
|
+
}, Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2403
2415
|
__proto__: null,
|
|
2404
|
-
createSummary:
|
|
2405
|
-
createSummaryFrom:
|
|
2406
|
-
editSummary:
|
|
2407
|
-
removeSummary:
|
|
2408
|
-
renderSummary:
|
|
2409
|
-
selectSummary:
|
|
2410
|
-
unselectSummary:
|
|
2416
|
+
createSummary: _o,
|
|
2417
|
+
createSummaryFrom: Do,
|
|
2418
|
+
editSummary: Oo,
|
|
2419
|
+
removeSummary: Lo,
|
|
2420
|
+
renderSummary: Po,
|
|
2421
|
+
selectSummary: Mo,
|
|
2422
|
+
unselectSummary: Ao
|
|
2411
2423
|
}, Symbol.toStringTag, { value: "Module" })), _ = "http://www.w3.org/2000/svg";
|
|
2412
|
-
function
|
|
2424
|
+
function $o(e, t) {
|
|
2413
2425
|
const n = document.createElementNS(_, "svg");
|
|
2414
2426
|
return k(n, {
|
|
2415
2427
|
version: "1.1",
|
|
@@ -2418,10 +2430,10 @@ function Oo(e, t) {
|
|
|
2418
2430
|
width: t
|
|
2419
2431
|
}), n;
|
|
2420
2432
|
}
|
|
2421
|
-
function
|
|
2433
|
+
function jo(e, t) {
|
|
2422
2434
|
return (parseInt(e) - parseInt(t)) / 2;
|
|
2423
2435
|
}
|
|
2424
|
-
function
|
|
2436
|
+
function Io(e, t, n, o) {
|
|
2425
2437
|
const s = document.createElementNS(_, "g");
|
|
2426
2438
|
let i = "";
|
|
2427
2439
|
return e.text ? i = e.text.textContent : i = e.childNodes[0].textContent, i.split(`
|
|
@@ -2429,7 +2441,7 @@ function $o(e, t, n, o) {
|
|
|
2429
2441
|
const a = document.createElementNS(_, "text");
|
|
2430
2442
|
k(a, {
|
|
2431
2443
|
x: n + parseInt(t.paddingLeft) + "",
|
|
2432
|
-
y: o + parseInt(t.paddingTop) +
|
|
2444
|
+
y: o + parseInt(t.paddingTop) + jo(t.lineHeight, t.fontSize) * (r + 1) + parseFloat(t.fontSize) * (r + 1) + "",
|
|
2433
2445
|
"text-anchor": "start",
|
|
2434
2446
|
"font-family": t.fontFamily,
|
|
2435
2447
|
"font-size": `${t.fontSize}`,
|
|
@@ -2438,7 +2450,7 @@ function $o(e, t, n, o) {
|
|
|
2438
2450
|
}), a.innerHTML = c, s.appendChild(a);
|
|
2439
2451
|
}), s;
|
|
2440
2452
|
}
|
|
2441
|
-
function
|
|
2453
|
+
function Ro(e, t, n, o) {
|
|
2442
2454
|
let s = "";
|
|
2443
2455
|
e.nodeObj?.dangerouslySetInnerHTML ? s = e.nodeObj.dangerouslySetInnerHTML : e.text ? s = e.text.textContent : s = e.childNodes[0].textContent;
|
|
2444
2456
|
const i = document.createElementNS(_, "foreignObject");
|
|
@@ -2454,7 +2466,7 @@ function jo(e, t, n, o) {
|
|
|
2454
2466
|
style: `font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`
|
|
2455
2467
|
}), l.innerHTML = s, i.appendChild(l), i;
|
|
2456
2468
|
}
|
|
2457
|
-
function
|
|
2469
|
+
function Bo(e, t) {
|
|
2458
2470
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = M(e.nodes, t), i = document.createElementNS(_, "rect");
|
|
2459
2471
|
return k(i, {
|
|
2460
2472
|
x: o + "",
|
|
@@ -2468,7 +2480,7 @@ function Io(e, t) {
|
|
|
2468
2480
|
"stroke-width": n.borderWidth
|
|
2469
2481
|
}), i;
|
|
2470
2482
|
}
|
|
2471
|
-
function
|
|
2483
|
+
function Q(e, t, n = !1) {
|
|
2472
2484
|
const o = getComputedStyle(t), { offsetLeft: s, offsetTop: i } = M(e.nodes, t), l = document.createElementNS(_, "rect");
|
|
2473
2485
|
k(l, {
|
|
2474
2486
|
x: s + "",
|
|
@@ -2484,9 +2496,9 @@ function ee(e, t, n = !1) {
|
|
|
2484
2496
|
const c = document.createElementNS(_, "g");
|
|
2485
2497
|
c.appendChild(l);
|
|
2486
2498
|
let r;
|
|
2487
|
-
return n ? r =
|
|
2499
|
+
return n ? r = Ro(t, o, s, i) : r = Io(t, o, s, i), c.appendChild(r), c;
|
|
2488
2500
|
}
|
|
2489
|
-
function
|
|
2501
|
+
function Wo(e, t) {
|
|
2490
2502
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = M(e.nodes, t), i = document.createElementNS(_, "a"), l = document.createElementNS(_, "text");
|
|
2491
2503
|
return k(l, {
|
|
2492
2504
|
x: o + "",
|
|
@@ -2498,7 +2510,7 @@ function Bo(e, t) {
|
|
|
2498
2510
|
fill: `${n.color}`
|
|
2499
2511
|
}), l.innerHTML = t.textContent, i.appendChild(l), i.setAttribute("href", t.href), i;
|
|
2500
2512
|
}
|
|
2501
|
-
function
|
|
2513
|
+
function Yo(e, t) {
|
|
2502
2514
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = M(e.nodes, t), i = document.createElementNS(_, "image");
|
|
2503
2515
|
return k(i, {
|
|
2504
2516
|
x: o + "",
|
|
@@ -2508,8 +2520,8 @@ function Ro(e, t) {
|
|
|
2508
2520
|
href: t.src
|
|
2509
2521
|
}), i;
|
|
2510
2522
|
}
|
|
2511
|
-
const
|
|
2512
|
-
const n = e.nodes, o = n.offsetHeight +
|
|
2523
|
+
const ee = 100, Xo = '<?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">', Fo = (e, t = !1) => {
|
|
2524
|
+
const n = e.nodes, o = n.offsetHeight + ee * 2, s = n.offsetWidth + ee * 2, i = $o(o + "px", s + "px"), l = document.createElementNS(_, "svg"), c = document.createElementNS(_, "rect");
|
|
2513
2525
|
k(c, {
|
|
2514
2526
|
x: "0",
|
|
2515
2527
|
y: "0",
|
|
@@ -2526,22 +2538,22 @@ const te = 100, Wo = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC
|
|
|
2526
2538
|
a && l.appendChild(a);
|
|
2527
2539
|
const d = n.querySelector(".summary")?.cloneNode(!0);
|
|
2528
2540
|
return d && l.appendChild(d), n.querySelectorAll("me-tpc").forEach((h) => {
|
|
2529
|
-
h.nodeObj.dangerouslySetInnerHTML ? l.appendChild(
|
|
2541
|
+
h.nodeObj.dangerouslySetInnerHTML ? l.appendChild(Q(e, h, !t)) : (l.appendChild(Bo(e, h)), l.appendChild(Q(e, h.text, !t)));
|
|
2530
2542
|
}), n.querySelectorAll(".tags > span").forEach((h) => {
|
|
2531
|
-
l.appendChild(
|
|
2543
|
+
l.appendChild(Q(e, h));
|
|
2532
2544
|
}), n.querySelectorAll(".icons > span").forEach((h) => {
|
|
2533
|
-
l.appendChild(
|
|
2545
|
+
l.appendChild(Q(e, h));
|
|
2534
2546
|
}), n.querySelectorAll(".hyper-link").forEach((h) => {
|
|
2535
|
-
l.appendChild(
|
|
2547
|
+
l.appendChild(Wo(e, h));
|
|
2536
2548
|
}), n.querySelectorAll("img").forEach((h) => {
|
|
2537
|
-
l.appendChild(
|
|
2549
|
+
l.appendChild(Yo(e, h));
|
|
2538
2550
|
}), k(l, {
|
|
2539
|
-
x:
|
|
2540
|
-
y:
|
|
2551
|
+
x: ee + "",
|
|
2552
|
+
y: ee + "",
|
|
2541
2553
|
overflow: "visible"
|
|
2542
2554
|
}), i.appendChild(l), i;
|
|
2543
|
-
},
|
|
2544
|
-
function
|
|
2555
|
+
}, Vo = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), Xo + e.outerHTML);
|
|
2556
|
+
function Ko(e) {
|
|
2545
2557
|
return new Promise((t, n) => {
|
|
2546
2558
|
const o = new FileReader();
|
|
2547
2559
|
o.onload = (s) => {
|
|
@@ -2551,11 +2563,11 @@ function Fo(e) {
|
|
|
2551
2563
|
}, o.readAsDataURL(e);
|
|
2552
2564
|
});
|
|
2553
2565
|
}
|
|
2554
|
-
const
|
|
2555
|
-
const n =
|
|
2566
|
+
const zo = function(e = !1, t) {
|
|
2567
|
+
const n = Fo(this, e), o = Vo(n, t);
|
|
2556
2568
|
return new Blob([o], { type: "image/svg+xml" });
|
|
2557
|
-
},
|
|
2558
|
-
const n = this.exportSvg(e, t), o = await
|
|
2569
|
+
}, Go = async function(e = !1, t) {
|
|
2570
|
+
const n = this.exportSvg(e, t), o = await Ko(n);
|
|
2559
2571
|
return new Promise((s, i) => {
|
|
2560
2572
|
const l = new Image();
|
|
2561
2573
|
l.setAttribute("crossOrigin", "anonymous"), l.onload = () => {
|
|
@@ -2563,43 +2575,43 @@ const Vo = function(e = !1, t) {
|
|
|
2563
2575
|
c.width = l.width, c.height = l.height, c.getContext("2d").drawImage(l, 0, 0), c.toBlob(s, "image/png", 1);
|
|
2564
2576
|
}, l.src = o, l.onerror = i;
|
|
2565
2577
|
});
|
|
2566
|
-
},
|
|
2578
|
+
}, qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2567
2579
|
__proto__: null,
|
|
2568
|
-
exportPng:
|
|
2569
|
-
exportSvg:
|
|
2580
|
+
exportPng: Go,
|
|
2581
|
+
exportSvg: zo
|
|
2570
2582
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2571
|
-
function
|
|
2583
|
+
function Uo(e, t) {
|
|
2572
2584
|
return async function(...n) {
|
|
2573
2585
|
const o = this.before[t];
|
|
2574
2586
|
o && !await o.apply(this, n) || e.apply(this, n);
|
|
2575
2587
|
};
|
|
2576
2588
|
}
|
|
2577
|
-
const Ge = Object.keys(ot),
|
|
2589
|
+
const Ge = Object.keys(ot), gt = {};
|
|
2578
2590
|
for (let e = 0; e < Ge.length; e++) {
|
|
2579
2591
|
const t = Ge[e];
|
|
2580
|
-
|
|
2592
|
+
gt[t] = Uo(ot[t], t);
|
|
2581
2593
|
}
|
|
2582
|
-
const
|
|
2594
|
+
const Jo = {
|
|
2583
2595
|
getObjById: oe,
|
|
2584
|
-
generateNewObj:
|
|
2585
|
-
layout:
|
|
2586
|
-
linkDiv:
|
|
2587
|
-
editTopic:
|
|
2588
|
-
createWrapper:
|
|
2589
|
-
createParent:
|
|
2590
|
-
createChildren:
|
|
2591
|
-
createTopic:
|
|
2596
|
+
generateNewObj: mt,
|
|
2597
|
+
layout: Nt,
|
|
2598
|
+
linkDiv: In,
|
|
2599
|
+
editTopic: At,
|
|
2600
|
+
createWrapper: _t,
|
|
2601
|
+
createParent: Dt,
|
|
2602
|
+
createChildren: Lt,
|
|
2603
|
+
createTopic: Mt,
|
|
2592
2604
|
findEle: Ze,
|
|
2593
|
-
changeTheme:
|
|
2594
|
-
changeCompact:
|
|
2595
|
-
...
|
|
2596
|
-
...
|
|
2597
|
-
...
|
|
2598
|
-
...
|
|
2599
|
-
...
|
|
2605
|
+
changeTheme: lo,
|
|
2606
|
+
changeCompact: co,
|
|
2607
|
+
...Sn,
|
|
2608
|
+
...gt,
|
|
2609
|
+
...Co,
|
|
2610
|
+
...Ho,
|
|
2611
|
+
...qo,
|
|
2600
2612
|
init(e) {
|
|
2601
2613
|
if (e = JSON.parse(JSON.stringify(e)), !e || !e.nodeData) return new Error("MindElixir: `data` is required");
|
|
2602
|
-
e.direction !== void 0 && (this.direction = e.direction), e.compact !== void 0 && (this.compact = e.compact), this.changeTheme(e.theme || this.theme, !1), e.meta && (this.meta = e.meta), this.nodeData = e.nodeData,
|
|
2614
|
+
e.direction !== void 0 && (this.direction = e.direction), e.compact !== void 0 && (this.compact = e.compact), this.changeTheme(e.theme || this.theme, !1), e.meta && (this.meta = e.meta), this.nodeData = e.nodeData, R(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && Qn(this), this.keypress && On(this, this.keypress), ro(this), this.disposable.push(St()), this.contextMenu && this.disposable.push(Bn(this, this.contextMenu)), this.allowUndo && this.disposable.push(Yn(this)), this.layout(), this.linkDiv(), this.toCenter();
|
|
2603
2615
|
},
|
|
2604
2616
|
destroy() {
|
|
2605
2617
|
this.disposable.forEach((e) => e()), this.el && (this.el.innerHTML = ""), this.el = void 0, this.nodeData = void 0, this.arrows = void 0, this.summaries = void 0, this.currentArrow = void 0, this.currentNodes = void 0, this.currentSummary = void 0, this.theme = void 0, this.direction = void 0, this.bus = void 0, this.container = void 0, this.map = void 0, this.lines = void 0, this.linkController = void 0, this.arrowSvg = void 0, this.P2 = void 0, this.P3 = void 0, this.line1 = void 0, this.line2 = void 0, this.nodes = void 0, this.selection?.destroy(), this.selection = void 0;
|
|
@@ -2611,25 +2623,7 @@ const qo = {
|
|
|
2611
2623
|
enableMobileMultiSelect(e) {
|
|
2612
2624
|
this.mobileMultiSelect = e;
|
|
2613
2625
|
}
|
|
2614
|
-
};
|
|
2615
|
-
function Uo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, containerHeight: a }) {
|
|
2616
|
-
let d = t + n / 2;
|
|
2617
|
-
const h = e + o / 2;
|
|
2618
|
-
let u;
|
|
2619
|
-
r === H.LHS ? u = i + l : u = i;
|
|
2620
|
-
const b = s + c / 2, p = (1 - Math.abs(b - h) / a) * 0.25 * (n / 2);
|
|
2621
|
-
return r === H.LHS ? d = d - n / 10 - p : d = d + n / 10 + p, `M ${d} ${h} Q ${d} ${b} ${u} ${b}`;
|
|
2622
|
-
}
|
|
2623
|
-
function Jo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, isFirst: a }) {
|
|
2624
|
-
const d = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
|
|
2625
|
-
let h = 0, u = 0;
|
|
2626
|
-
a ? h = e + o / 2 : h = e + o;
|
|
2627
|
-
const b = s + c;
|
|
2628
|
-
let v = 0, p = 0, g = 0;
|
|
2629
|
-
const m = Math.abs(h - b) / 300 * d;
|
|
2630
|
-
return r === H.LHS ? (g = t, v = g + d, p = g - d, u = i + d, `M ${v} ${h} C ${g} ${h} ${g + m} ${b} ${p} ${b} H ${u}`) : (g = t + n, v = g - d, p = g + d, u = i + l - d, `M ${v} ${h} C ${g} ${h} ${g - m} ${b} ${p} ${b} H ${u}`);
|
|
2631
|
-
}
|
|
2632
|
-
const Zo = "5.12.2-beta.1";
|
|
2626
|
+
}, Zo = "5.12.2-beta.3";
|
|
2633
2627
|
function Qo(e) {
|
|
2634
2628
|
return {
|
|
2635
2629
|
x: 0,
|
|
@@ -2687,13 +2681,13 @@ function P({
|
|
|
2687
2681
|
let C = null;
|
|
2688
2682
|
const T = Object.prototype.toString.call(e);
|
|
2689
2683
|
if (T === "[object HTMLDivElement]" ? C = e : T === "[object String]" && (C = document.querySelector(e)), !C) throw new Error("MindElixir: el is not a valid element");
|
|
2690
|
-
C.style.position = "relative", C.innerHTML = "", this.el = C, this.disposable = [], this.before = r || {}, this.newTopicName = a || "New Node", this.contextMenu = o ?? !0, this.toolBar = s ?? !0, this.keypress = i ?? !0, this.mouseSelectionButton = l ?? 0, this.direction = t ?? 1, this.editable = n ?? !0, this.allowUndo = d ?? !0, this.scaleSensitivity = m ?? 0.1, this.scaleMax = w ?? 1.4, this.scaleMin = E ?? 0.2, this.generateMainBranch = h ||
|
|
2684
|
+
C.style.position = "relative", C.innerHTML = "", this.el = C, this.disposable = [], this.before = r || {}, this.newTopicName = a || "New Node", this.contextMenu = o ?? !0, this.toolBar = s ?? !0, this.keypress = i ?? !0, this.mouseSelectionButton = l ?? 0, this.direction = t ?? 1, this.editable = n ?? !0, this.allowUndo = d ?? !0, this.scaleSensitivity = m ?? 0.1, this.scaleMax = w ?? 1.4, this.scaleMin = E ?? 0.2, this.generateMainBranch = h || at, this.generateSubBranch = u || dt, this.overflowHidden = b ?? !1, this.compact = v ?? !1, this.alignment = g ?? "root", this.handleWheel = N ?? !0, this.markdown = f || void 0, this.imageProxy = y || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.mobileMultiSelect = S ?? !1, this.panHelper = Qo(this), this.bus = $n(), this.container = document.createElement("div"), this.selectionContainer = c || this.container, this.container.className = "map-container";
|
|
2691
2685
|
const D = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2692
|
-
this.theme = p || (D.matches ? ue :
|
|
2686
|
+
this.theme = p || (D.matches ? ue : ne);
|
|
2693
2687
|
const L = document.createElement("div");
|
|
2694
|
-
L.className = "map-canvas", this.map = L, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = z("lines"), this.summarySvg = z("summary"), this.linkController = z("linkcontroller"), this.P2 = document.createElement("div"), this.P3 = document.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = je(), this.line2 = je(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.arrowSvg = z("topiclinks"), this.labelContainer = document.createElement("div"), this.labelContainer.className = "label-container", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(
|
|
2688
|
+
L.className = "map-canvas", this.map = L, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = z("lines"), this.summarySvg = z("summary"), this.linkController = z("linkcontroller"), this.P2 = document.createElement("div"), this.P3 = document.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = je(), this.line2 = je(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.arrowSvg = z("topiclinks"), this.labelContainer = document.createElement("div"), this.labelContainer.className = "label-container", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(Hn(this)), x && (this.pasteHandler = x);
|
|
2695
2689
|
}
|
|
2696
|
-
P.prototype =
|
|
2690
|
+
P.prototype = Jo;
|
|
2697
2691
|
Object.defineProperty(P.prototype, "currentNode", {
|
|
2698
2692
|
get() {
|
|
2699
2693
|
return this.currentNodes[this.currentNodes.length - 1];
|
|
@@ -2703,13 +2697,13 @@ Object.defineProperty(P.prototype, "currentNode", {
|
|
|
2703
2697
|
P.LEFT = 0;
|
|
2704
2698
|
P.RIGHT = 1;
|
|
2705
2699
|
P.SIDE = 2;
|
|
2706
|
-
P.THEME =
|
|
2700
|
+
P.THEME = ne;
|
|
2707
2701
|
P.DARK_THEME = ue;
|
|
2708
2702
|
P.version = Zo;
|
|
2709
2703
|
P.E = Ze;
|
|
2710
2704
|
P.new = (e) => ({
|
|
2711
2705
|
nodeData: {
|
|
2712
|
-
id:
|
|
2706
|
+
id: B(),
|
|
2713
2707
|
topic: e || "new topic",
|
|
2714
2708
|
children: []
|
|
2715
2709
|
}
|
|
@@ -2719,6 +2713,6 @@ export {
|
|
|
2719
2713
|
es as LEFT,
|
|
2720
2714
|
ts as RIGHT,
|
|
2721
2715
|
ns as SIDE,
|
|
2722
|
-
|
|
2716
|
+
ne as THEME,
|
|
2723
2717
|
P as default
|
|
2724
2718
|
};
|