mind-elixir 5.1.0 → 5.1.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 +431 -420
- package/dist/MindElixirLite.iife.js +4 -4
- package/dist/MindElixirLite.js +261 -250
- package/dist/example.iife.js +1 -1
- package/dist/example.js +1 -0
- package/dist/style.css +1 -1
- package/dist/types/types/index.d.ts +1 -0
- package/package.json +2 -2
package/dist/MindElixir.js
CHANGED
|
@@ -21,6 +21,7 @@ const me = {
|
|
|
21
21
|
"--color": "#777777",
|
|
22
22
|
"--bgcolor": "#f6f6f6",
|
|
23
23
|
"--selected": "#4dc4ff",
|
|
24
|
+
"--accent-color": "#e64553",
|
|
24
25
|
"--panel-color": "#444446",
|
|
25
26
|
"--panel-bgcolor": "#ffffff",
|
|
26
27
|
"--panel-border-color": "#eaeaea",
|
|
@@ -46,6 +47,7 @@ const me = {
|
|
|
46
47
|
"--color": "#cccccc",
|
|
47
48
|
"--bgcolor": "#252526",
|
|
48
49
|
"--selected": "#4dc4ff",
|
|
50
|
+
"--accent-color": "#789AFA",
|
|
49
51
|
"--panel-color": "#ffffff",
|
|
50
52
|
"--panel-bgcolor": "#2d3748",
|
|
51
53
|
"--panel-border-color": "#696969",
|
|
@@ -94,12 +96,12 @@ function oe(e, t, n, o) {
|
|
|
94
96
|
if (isNaN(r))
|
|
95
97
|
return;
|
|
96
98
|
s < 0 && i > 0 && (r = 180 - r), s < 0 && i < 0 && (r = 180 + r), s > 0 && i < 0 && (r = 360 - r);
|
|
97
|
-
const
|
|
99
|
+
const c = 12, l = 30, a = r + l, f = r - l;
|
|
98
100
|
return {
|
|
99
|
-
x1: n + Math.cos(Math.PI *
|
|
100
|
-
y1: o - Math.sin(Math.PI *
|
|
101
|
-
x2: n + Math.cos(Math.PI * f / 180) *
|
|
102
|
-
y2: o - Math.sin(Math.PI * f / 180) *
|
|
101
|
+
x1: n + Math.cos(Math.PI * a / 180) * c,
|
|
102
|
+
y1: o - Math.sin(Math.PI * a / 180) * c,
|
|
103
|
+
x2: n + Math.cos(Math.PI * f / 180) * c,
|
|
104
|
+
y2: o - Math.sin(Math.PI * f / 180) * c
|
|
103
105
|
};
|
|
104
106
|
}
|
|
105
107
|
function K() {
|
|
@@ -128,7 +130,7 @@ const B = (e, t) => {
|
|
|
128
130
|
}, N = (e, t) => {
|
|
129
131
|
for (const n in t)
|
|
130
132
|
e.setAttribute(n, t[n]);
|
|
131
|
-
}, he = (e) => e ? e.tagName === "ME-TPC" : !1,
|
|
133
|
+
}, he = (e) => e ? e.tagName === "ME-TPC" : !1, ce = (e) => e.filter((t) => t.nodeObj.parent).filter((t, n, o) => {
|
|
132
134
|
for (let i = 0; i < o.length; i++) {
|
|
133
135
|
if (t === o[i])
|
|
134
136
|
continue;
|
|
@@ -202,21 +204,21 @@ function wt(e, t) {
|
|
|
202
204
|
e.currentArrow ? e.removeArrow() : e.currentSummary ? e.removeSummary(e.currentSummary.summaryObj.id) : e.currentNodes && e.removeNodes(e.currentNodes);
|
|
203
205
|
};
|
|
204
206
|
let o = !1, i = null;
|
|
205
|
-
const s = (
|
|
206
|
-
const
|
|
207
|
-
if (
|
|
208
|
-
for (const
|
|
209
|
-
q(
|
|
210
|
-
if (
|
|
211
|
-
for (const
|
|
212
|
-
q(
|
|
213
|
-
if (["1", "2", "3", "4", "5", "6", "7", "8", "9"].includes(
|
|
214
|
-
for (const
|
|
215
|
-
q(
|
|
207
|
+
const s = (c) => {
|
|
208
|
+
const l = e.nodeData;
|
|
209
|
+
if (c.key === "0")
|
|
210
|
+
for (const a of l.children)
|
|
211
|
+
q(a, !1);
|
|
212
|
+
if (c.key === "=")
|
|
213
|
+
for (const a of l.children)
|
|
214
|
+
q(a, !0);
|
|
215
|
+
if (["1", "2", "3", "4", "5", "6", "7", "8", "9"].includes(c.key))
|
|
216
|
+
for (const a of l.children)
|
|
217
|
+
q(a, !0, Number(c.key) - 1);
|
|
216
218
|
e.refresh(), e.toCenter(), o = !1, i && (clearTimeout(i), i = null, e.container.removeEventListener("keydown", s));
|
|
217
219
|
}, r = {
|
|
218
|
-
Enter: (
|
|
219
|
-
|
|
220
|
+
Enter: (c) => {
|
|
221
|
+
c.shiftKey ? e.insertSibling("before") : c.ctrlKey || c.metaKey ? e.insertParent() : e.insertSibling("after");
|
|
220
222
|
},
|
|
221
223
|
Tab: () => {
|
|
222
224
|
e.addChild();
|
|
@@ -227,25 +229,25 @@ function wt(e, t) {
|
|
|
227
229
|
F2: () => {
|
|
228
230
|
e.beginEdit();
|
|
229
231
|
},
|
|
230
|
-
ArrowUp: (
|
|
231
|
-
if (
|
|
232
|
+
ArrowUp: (c) => {
|
|
233
|
+
if (c.altKey)
|
|
232
234
|
e.moveUpNode();
|
|
233
235
|
else {
|
|
234
|
-
if (
|
|
236
|
+
if (c.metaKey || c.ctrlKey)
|
|
235
237
|
return e.initSide();
|
|
236
238
|
Ae(e, "previous");
|
|
237
239
|
}
|
|
238
240
|
},
|
|
239
|
-
ArrowDown: (
|
|
240
|
-
|
|
241
|
+
ArrowDown: (c) => {
|
|
242
|
+
c.altKey ? e.moveDownNode() : Ae(e, "next");
|
|
241
243
|
},
|
|
242
|
-
ArrowLeft: (
|
|
243
|
-
if (
|
|
244
|
+
ArrowLeft: (c) => {
|
|
245
|
+
if (c.metaKey || c.ctrlKey)
|
|
244
246
|
return e.initLeft();
|
|
245
247
|
Le(e, M.LHS);
|
|
246
248
|
},
|
|
247
|
-
ArrowRight: (
|
|
248
|
-
if (
|
|
249
|
+
ArrowRight: (c) => {
|
|
250
|
+
if (c.metaKey || c.ctrlKey)
|
|
249
251
|
return e.initRight();
|
|
250
252
|
Le(e, M.RHS);
|
|
251
253
|
},
|
|
@@ -253,30 +255,30 @@ function wt(e, t) {
|
|
|
253
255
|
PageDown: () => {
|
|
254
256
|
e.moveDownNode();
|
|
255
257
|
},
|
|
256
|
-
c: (
|
|
257
|
-
(
|
|
258
|
+
c: (c) => {
|
|
259
|
+
(c.metaKey || c.ctrlKey) && (e.waitCopy = e.currentNodes);
|
|
258
260
|
},
|
|
259
|
-
x: (
|
|
260
|
-
(
|
|
261
|
+
x: (c) => {
|
|
262
|
+
(c.metaKey || c.ctrlKey) && (e.waitCopy = e.currentNodes, n());
|
|
261
263
|
},
|
|
262
|
-
v: (
|
|
263
|
-
!e.waitCopy || !e.currentNode || (
|
|
264
|
+
v: (c) => {
|
|
265
|
+
!e.waitCopy || !e.currentNode || (c.metaKey || c.ctrlKey) && (e.waitCopy.length === 1 ? e.copyNode(e.waitCopy[0], e.currentNode) : e.copyNodes(e.waitCopy, e.currentNode));
|
|
264
266
|
},
|
|
265
|
-
"=": (
|
|
266
|
-
(
|
|
267
|
+
"=": (c) => {
|
|
268
|
+
(c.metaKey || c.ctrlKey) && ie(e, "in");
|
|
267
269
|
},
|
|
268
|
-
"-": (
|
|
269
|
-
(
|
|
270
|
+
"-": (c) => {
|
|
271
|
+
(c.metaKey || c.ctrlKey) && ie(e, "out");
|
|
270
272
|
},
|
|
271
|
-
0: (
|
|
272
|
-
if (
|
|
273
|
+
0: (c) => {
|
|
274
|
+
if (c.metaKey || c.ctrlKey) {
|
|
273
275
|
if (o)
|
|
274
276
|
return;
|
|
275
277
|
e.scale(1);
|
|
276
278
|
}
|
|
277
279
|
},
|
|
278
|
-
k: (
|
|
279
|
-
(
|
|
280
|
+
k: (c) => {
|
|
281
|
+
(c.metaKey || c.ctrlKey) && (o = !0, i && (clearTimeout(i), e.container.removeEventListener("keydown", s)), i = window.setTimeout(() => {
|
|
280
282
|
o = !1, i = null;
|
|
281
283
|
}, 2e3), e.container.addEventListener("keydown", s));
|
|
282
284
|
},
|
|
@@ -284,23 +286,23 @@ function wt(e, t) {
|
|
|
284
286
|
Backspace: n,
|
|
285
287
|
...t
|
|
286
288
|
};
|
|
287
|
-
e.container.onkeydown = (
|
|
288
|
-
if (
|
|
289
|
+
e.container.onkeydown = (c) => {
|
|
290
|
+
if (c.preventDefault(), !e.editable)
|
|
289
291
|
return;
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
+
const l = r[c.key];
|
|
293
|
+
l && l(c);
|
|
292
294
|
};
|
|
293
295
|
}
|
|
294
296
|
function xt(e) {
|
|
295
297
|
const { dragMoveHelper: t } = e, n = (u) => {
|
|
296
|
-
var
|
|
298
|
+
var g, m, b;
|
|
297
299
|
if (u.button !== 0)
|
|
298
300
|
return;
|
|
299
|
-
if ((
|
|
301
|
+
if ((g = e.helper1) != null && g.moved) {
|
|
300
302
|
e.helper1.clear();
|
|
301
303
|
return;
|
|
302
304
|
}
|
|
303
|
-
if ((
|
|
305
|
+
if ((m = e.helper2) != null && m.moved) {
|
|
304
306
|
e.helper2.clear();
|
|
305
307
|
return;
|
|
306
308
|
}
|
|
@@ -308,69 +310,69 @@ function xt(e) {
|
|
|
308
310
|
t.clear();
|
|
309
311
|
return;
|
|
310
312
|
}
|
|
311
|
-
const
|
|
312
|
-
if (
|
|
313
|
-
u.ctrlKey || u.metaKey ? e.expandNodeAll(
|
|
314
|
-
else if (
|
|
315
|
-
e.selectNode(
|
|
313
|
+
const h = u.target;
|
|
314
|
+
if (h.tagName === "ME-EPD")
|
|
315
|
+
u.ctrlKey || u.metaKey ? e.expandNodeAll(h.previousSibling) : e.expandNode(h.previousSibling);
|
|
316
|
+
else if (h.tagName === "ME-TPC" && e.currentNodes.length > 1)
|
|
317
|
+
e.selectNode(h);
|
|
316
318
|
else if (!e.editable)
|
|
317
319
|
return;
|
|
318
|
-
const p = (b =
|
|
319
|
-
p.getAttribute("class") === "topiclinks" ? e.selectArrow(
|
|
320
|
+
const p = (b = h.parentElement) == null ? void 0 : b.parentElement;
|
|
321
|
+
p.getAttribute("class") === "topiclinks" ? e.selectArrow(h.parentElement) : p.getAttribute("class") === "summary" && e.selectSummary(h.parentElement);
|
|
320
322
|
}, o = (u) => {
|
|
321
|
-
var
|
|
323
|
+
var g;
|
|
322
324
|
if (!e.editable)
|
|
323
325
|
return;
|
|
324
|
-
const
|
|
325
|
-
he(
|
|
326
|
-
const p = (
|
|
327
|
-
p.getAttribute("class") === "topiclinks" ? e.editArrowLabel(
|
|
326
|
+
const h = u.target;
|
|
327
|
+
he(h) && e.beginEdit(h);
|
|
328
|
+
const p = (g = h.parentElement) == null ? void 0 : g.parentElement;
|
|
329
|
+
p.getAttribute("class") === "topiclinks" ? e.editArrowLabel(h.parentElement) : p.getAttribute("class") === "summary" && e.editSummary(h.parentElement);
|
|
328
330
|
};
|
|
329
331
|
let i = 0;
|
|
330
332
|
const s = (u) => {
|
|
331
333
|
if (u.pointerType === "mouse")
|
|
332
334
|
return;
|
|
333
|
-
const
|
|
334
|
-
p < 300 && p > 0 && o(u), i =
|
|
335
|
+
const h = (/* @__PURE__ */ new Date()).getTime(), p = h - i;
|
|
336
|
+
p < 300 && p > 0 && o(u), i = h;
|
|
335
337
|
}, r = (u) => {
|
|
336
338
|
t.moved = !1;
|
|
337
|
-
const
|
|
338
|
-
if (u.button !==
|
|
339
|
+
const h = e.mouseSelectionButton === 0 ? 2 : 0;
|
|
340
|
+
if (u.button !== h && u.pointerType === "mouse")
|
|
339
341
|
return;
|
|
340
342
|
t.x = u.clientX, t.y = u.clientY;
|
|
341
343
|
const p = u.target;
|
|
342
344
|
p.className !== "circle" && p.contentEditable !== "plaintext-only" && (t.mousedown = !0, p.setPointerCapture(u.pointerId));
|
|
343
|
-
},
|
|
345
|
+
}, c = (u) => {
|
|
344
346
|
if (u.target.contentEditable !== "plaintext-only") {
|
|
345
|
-
const
|
|
346
|
-
t.onMove(
|
|
347
|
+
const h = u.clientX - t.x, p = u.clientY - t.y;
|
|
348
|
+
t.onMove(h, p);
|
|
347
349
|
}
|
|
348
350
|
t.x = u.clientX, t.y = u.clientY;
|
|
349
|
-
},
|
|
350
|
-
const
|
|
351
|
-
if (u.button !==
|
|
351
|
+
}, l = (u) => {
|
|
352
|
+
const h = e.mouseSelectionButton === 0 ? 2 : 0;
|
|
353
|
+
if (u.button !== h && u.pointerType === "mouse")
|
|
352
354
|
return;
|
|
353
355
|
const p = u.target;
|
|
354
356
|
p.hasPointerCapture && p.hasPointerCapture(u.pointerId) && p.releasePointerCapture(u.pointerId), t.clear();
|
|
355
|
-
},
|
|
357
|
+
}, a = (u) => {
|
|
356
358
|
if (u.preventDefault(), u.button !== 2 || !e.editable)
|
|
357
359
|
return;
|
|
358
|
-
const
|
|
359
|
-
he(
|
|
360
|
+
const h = u.target;
|
|
361
|
+
he(h) && !h.classList.contains("selected") && e.selectNode(h), setTimeout(() => {
|
|
360
362
|
e.dragMoveHelper.moved || e.bus.fire("showContextMenu", u);
|
|
361
363
|
}, 200);
|
|
362
364
|
}, f = (u) => {
|
|
363
365
|
u.stopPropagation(), u.preventDefault(), u.ctrlKey || u.metaKey ? u.deltaY < 0 ? ie(e, "in", e.dragMoveHelper) : e.scaleVal - e.scaleSensitivity > 0 && ie(e, "out", e.dragMoveHelper) : u.shiftKey ? e.move(-u.deltaY, 0) : e.move(-u.deltaX, -u.deltaY);
|
|
364
|
-
}, { container:
|
|
366
|
+
}, { container: d } = e;
|
|
365
367
|
return we([
|
|
366
|
-
{ dom:
|
|
367
|
-
{ dom:
|
|
368
|
-
{ dom:
|
|
369
|
-
{ dom:
|
|
370
|
-
{ dom:
|
|
371
|
-
{ dom:
|
|
372
|
-
{ dom:
|
|
373
|
-
{ dom:
|
|
368
|
+
{ dom: d, evt: "pointerdown", func: r },
|
|
369
|
+
{ dom: d, evt: "pointermove", func: c },
|
|
370
|
+
{ dom: d, evt: "pointerup", func: l },
|
|
371
|
+
{ dom: d, evt: "pointerup", func: s },
|
|
372
|
+
{ dom: d, evt: "click", func: n },
|
|
373
|
+
{ dom: d, evt: "dblclick", func: o },
|
|
374
|
+
{ dom: d, evt: "contextmenu", func: a },
|
|
375
|
+
{ dom: d, evt: "wheel", func: typeof e.handleWheel == "function" ? e.handleWheel : f }
|
|
374
376
|
]);
|
|
375
377
|
}
|
|
376
378
|
function Et() {
|
|
@@ -418,8 +420,8 @@ const se = document, Ct = function() {
|
|
|
418
420
|
const i = se.createElement("me-main");
|
|
419
421
|
i.className = M.RHS;
|
|
420
422
|
for (let s = 0; s < t.length; s++) {
|
|
421
|
-
const r = t[s], { grp:
|
|
422
|
-
e.direction === 2 ? r.direction === 0 ? o.appendChild(
|
|
423
|
+
const r = t[s], { grp: c } = e.createWrapper(r);
|
|
424
|
+
e.direction === 2 ? r.direction === 0 ? o.appendChild(c) : i.appendChild(c) : e.direction === 0 ? o.appendChild(c) : i.appendChild(c);
|
|
423
425
|
}
|
|
424
426
|
e.nodes.appendChild(o), e.nodes.appendChild(n), e.nodes.appendChild(i), e.nodes.appendChild(e.lines);
|
|
425
427
|
}, Nt = function(e, t) {
|
|
@@ -569,8 +571,8 @@ const At = function(e) {
|
|
|
569
571
|
if (s === "")
|
|
570
572
|
n.topic = o;
|
|
571
573
|
else if (n.topic = s, this.markdown && xe(s)) {
|
|
572
|
-
const
|
|
573
|
-
e.text.innerHTML =
|
|
574
|
+
const c = Ve(s, this.markdown).trim();
|
|
575
|
+
e.text.innerHTML = c;
|
|
574
576
|
} else
|
|
575
577
|
e.text.textContent = s;
|
|
576
578
|
t.remove(), s !== o && (this.linkDiv(), this.bus.fire("operation", {
|
|
@@ -583,13 +585,13 @@ const At = function(e) {
|
|
|
583
585
|
const t = _.createElement("me-epd");
|
|
584
586
|
return t.expanded = e !== !1, t.className = e !== !1 ? "minus" : "", t;
|
|
585
587
|
}, I = document, L = "http://www.w3.org/2000/svg", ue = function(e, t, n, o = {}) {
|
|
586
|
-
const { anchor: i = "middle", color: s, dataType: r } = o,
|
|
587
|
-
return N(
|
|
588
|
+
const { anchor: i = "middle", color: s, dataType: r } = o, c = document.createElementNS(L, "text");
|
|
589
|
+
return N(c, {
|
|
588
590
|
"text-anchor": i,
|
|
589
591
|
x: t + "",
|
|
590
592
|
y: n + "",
|
|
591
593
|
fill: s || (i === "middle" ? "rgb(235, 95, 82)" : "#666")
|
|
592
|
-
}), r && (
|
|
594
|
+
}), r && (c.dataset.type = r), c.innerHTML = e, c;
|
|
593
595
|
}, Je = function(e, t, n) {
|
|
594
596
|
const o = I.createElementNS(L, "path");
|
|
595
597
|
return N(o, {
|
|
@@ -619,22 +621,22 @@ const At = function(e) {
|
|
|
619
621
|
name: "arrow2",
|
|
620
622
|
d: n
|
|
621
623
|
}
|
|
622
|
-
].forEach((r,
|
|
623
|
-
const
|
|
624
|
-
d:
|
|
624
|
+
].forEach((r, c) => {
|
|
625
|
+
const l = r.d, a = I.createElementNS(L, "path"), f = {
|
|
626
|
+
d: l,
|
|
625
627
|
stroke: (o == null ? void 0 : o.stroke) || "rgb(235, 95, 82)",
|
|
626
628
|
fill: "none",
|
|
627
629
|
"stroke-linecap": (o == null ? void 0 : o.strokeLinecap) || "cap",
|
|
628
630
|
"stroke-width": String((o == null ? void 0 : o.strokeWidth) || "2")
|
|
629
631
|
};
|
|
630
|
-
(o == null ? void 0 : o.opacity) !== void 0 && (f.opacity = String(o.opacity)), N(
|
|
631
|
-
const
|
|
632
|
-
N(
|
|
633
|
-
d:
|
|
632
|
+
(o == null ? void 0 : o.opacity) !== void 0 && (f.opacity = String(o.opacity)), N(a, f), c === 0 && a.setAttribute("stroke-dasharray", (o == null ? void 0 : o.strokeDasharray) || "8,2");
|
|
633
|
+
const d = I.createElementNS(L, "path");
|
|
634
|
+
N(d, {
|
|
635
|
+
d: l,
|
|
634
636
|
stroke: "transparent",
|
|
635
637
|
fill: "none",
|
|
636
638
|
"stroke-width": "15"
|
|
637
|
-
}), i.appendChild(
|
|
639
|
+
}), i.appendChild(d), i.appendChild(a), i[r.name] = a;
|
|
638
640
|
}), i;
|
|
639
641
|
}, Ze = function(e, t, n) {
|
|
640
642
|
if (!t)
|
|
@@ -653,17 +655,17 @@ const At = function(e) {
|
|
|
653
655
|
margin: -2px -4px;
|
|
654
656
|
`, Xe(o), e.scrollIntoView(o), o.addEventListener("keydown", (r) => {
|
|
655
657
|
r.stopPropagation();
|
|
656
|
-
const
|
|
657
|
-
if (
|
|
658
|
+
const c = r.key;
|
|
659
|
+
if (c === "Enter" || c === "Tab") {
|
|
658
660
|
if (r.shiftKey)
|
|
659
661
|
return;
|
|
660
662
|
r.preventDefault(), o.blur(), e.container.focus();
|
|
661
663
|
}
|
|
662
664
|
}), o.addEventListener("blur", () => {
|
|
663
|
-
var
|
|
665
|
+
var c;
|
|
664
666
|
if (!o)
|
|
665
667
|
return;
|
|
666
|
-
const r = ((
|
|
668
|
+
const r = ((c = o.textContent) == null ? void 0 : c.trim()) || "";
|
|
667
669
|
r === "" ? n.label = i : n.label = r, o.remove(), r !== i && (t.innerHTML = n.label, e.linkDiv(), "parent" in n ? e.bus.fire("operation", {
|
|
668
670
|
name: "finishEditSummary",
|
|
669
671
|
obj: n
|
|
@@ -675,23 +677,23 @@ const At = function(e) {
|
|
|
675
677
|
}, Dt = function(e) {
|
|
676
678
|
const t = this.map.querySelector("me-root"), n = t.offsetTop, o = t.offsetLeft, i = t.offsetWidth, s = t.offsetHeight, r = this.map.querySelectorAll("me-main > me-wrapper");
|
|
677
679
|
this.lines.innerHTML = "";
|
|
678
|
-
for (let
|
|
679
|
-
const
|
|
680
|
-
if (
|
|
680
|
+
for (let c = 0; c < r.length; c++) {
|
|
681
|
+
const l = r[c], a = l.querySelector("me-tpc"), { offsetLeft: f, offsetTop: d } = B(this.nodes, a), v = a.offsetWidth, u = a.offsetHeight, h = l.parentNode.className, p = this.generateMainBranch({ pT: n, pL: o, pW: i, pH: s, cT: d, cL: f, cW: v, cH: u, direction: h, containerHeight: this.nodes.offsetHeight }), g = this.theme.palette, m = a.nodeObj.branchColor || g[c % g.length];
|
|
682
|
+
if (a.style.borderColor = m, this.lines.appendChild(Je(p, m, "3")), e && e !== l)
|
|
681
683
|
continue;
|
|
682
|
-
const b = X("subLines"), w =
|
|
683
|
-
w.tagName === "svg" && w.remove(),
|
|
684
|
+
const b = X("subLines"), w = l.lastChild;
|
|
685
|
+
w.tagName === "svg" && w.remove(), l.appendChild(b), Qe(this, b, m, l, h, !0);
|
|
684
686
|
}
|
|
685
687
|
this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
|
|
686
688
|
}, Qe = function(e, t, n, o, i, s) {
|
|
687
|
-
const r = o.firstChild,
|
|
688
|
-
if (
|
|
689
|
+
const r = o.firstChild, c = o.children[1].children;
|
|
690
|
+
if (c.length === 0)
|
|
689
691
|
return;
|
|
690
|
-
const
|
|
691
|
-
for (let
|
|
692
|
-
const u =
|
|
692
|
+
const l = r.offsetTop, a = r.offsetLeft, f = r.offsetWidth, d = r.offsetHeight;
|
|
693
|
+
for (let v = 0; v < c.length; v++) {
|
|
694
|
+
const u = c[v], h = u.firstChild, p = h.offsetTop, g = h.offsetLeft, m = h.offsetWidth, b = h.offsetHeight, w = h.firstChild.nodeObj.branchColor || n, C = e.generateSubBranch({ pT: l, pL: a, pW: f, pH: d, cT: p, cL: g, cW: m, cH: b, direction: i, isFirst: s });
|
|
693
695
|
t.appendChild(Je(C, w, "2"));
|
|
694
|
-
const k =
|
|
696
|
+
const k = h.children[1];
|
|
695
697
|
if (k) {
|
|
696
698
|
if (!k.expanded)
|
|
697
699
|
continue;
|
|
@@ -853,40 +855,40 @@ function Pt(e, t) {
|
|
|
853
855
|
}, o = (x, y, E) => {
|
|
854
856
|
const S = document.createElement("li");
|
|
855
857
|
return S.id = x, S.innerHTML = `<span>${de(y)}</span><span ${E ? 'class="key"' : ""}>${de(E)}</span>`, S;
|
|
856
|
-
}, i = $e[e.locale] ? e.locale : "en", s = $e[i], r = o("cm-add_child", s.addChild, "Tab"),
|
|
857
|
-
if (
|
|
858
|
+
}, i = $e[e.locale] ? e.locale : "en", s = $e[i], r = o("cm-add_child", s.addChild, "Tab"), c = o("cm-add_parent", s.addParent, "Ctrl + Enter"), l = o("cm-add_sibling", s.addSibling, "Enter"), a = o("cm-remove_child", s.removeNode, "Delete"), f = o("cm-fucus", s.focus, ""), d = o("cm-unfucus", s.cancelFocus, ""), v = o("cm-up", s.moveUp, "PgUp"), u = o("cm-down", s.moveDown, "Pgdn"), h = o("cm-link", s.link, ""), p = o("cm-link-bidirectional", s.linkBidirectional, ""), g = o("cm-summary", s.summary, ""), m = document.createElement("ul");
|
|
859
|
+
if (m.className = "menu-list", m.appendChild(r), m.appendChild(c), m.appendChild(l), m.appendChild(a), t.focus && (m.appendChild(f), m.appendChild(d)), m.appendChild(v), m.appendChild(u), m.appendChild(g), t.link && (m.appendChild(h), m.appendChild(p)), t && t.extend)
|
|
858
860
|
for (let x = 0; x < t.extend.length; x++) {
|
|
859
861
|
const y = t.extend[x], E = o(y.name, y.name, y.key || "");
|
|
860
|
-
|
|
862
|
+
m.appendChild(E), E.onclick = (S) => {
|
|
861
863
|
y.onclick(S);
|
|
862
864
|
};
|
|
863
865
|
}
|
|
864
866
|
const b = document.createElement("div");
|
|
865
|
-
b.className = "context-menu", b.appendChild(
|
|
867
|
+
b.className = "context-menu", b.appendChild(m), b.hidden = !0, e.container.append(b);
|
|
866
868
|
let w = !0;
|
|
867
869
|
const C = (x) => {
|
|
868
870
|
const y = x.target;
|
|
869
871
|
if (he(y)) {
|
|
870
|
-
y.parentElement.tagName === "ME-ROOT" ? w = !0 : w = !1, w ? (f.className = "disabled",
|
|
871
|
-
const E =
|
|
872
|
-
S + P > window.innerHeight ? (
|
|
872
|
+
y.parentElement.tagName === "ME-ROOT" ? w = !0 : w = !1, w ? (f.className = "disabled", v.className = "disabled", u.className = "disabled", c.className = "disabled", l.className = "disabled", a.className = "disabled") : (f.className = "", v.className = "", u.className = "", c.className = "", l.className = "", a.className = ""), b.hidden = !1, m.style.top = "", m.style.bottom = "", m.style.left = "", m.style.right = "";
|
|
873
|
+
const E = m.getBoundingClientRect(), S = m.offsetHeight, D = m.offsetWidth, P = x.clientY - E.top, R = x.clientX - E.left;
|
|
874
|
+
S + P > window.innerHeight ? (m.style.top = "", m.style.bottom = "0px") : (m.style.bottom = "", m.style.top = P + 15 + "px"), D + R > window.innerWidth ? (m.style.left = "", m.style.right = "0px") : (m.style.right = "", m.style.left = R + 10 + "px");
|
|
873
875
|
}
|
|
874
876
|
};
|
|
875
877
|
e.bus.addListener("showContextMenu", C), b.onclick = (x) => {
|
|
876
878
|
x.target === b && (b.hidden = !0);
|
|
877
879
|
}, r.onclick = () => {
|
|
878
880
|
e.addChild(), b.hidden = !0;
|
|
879
|
-
}, l.onclick = () => {
|
|
880
|
-
e.insertParent(), b.hidden = !0;
|
|
881
881
|
}, c.onclick = () => {
|
|
882
|
+
e.insertParent(), b.hidden = !0;
|
|
883
|
+
}, l.onclick = () => {
|
|
882
884
|
w || (e.insertSibling("after"), b.hidden = !0);
|
|
883
|
-
},
|
|
885
|
+
}, a.onclick = () => {
|
|
884
886
|
w || (e.removeNodes(e.currentNodes || []), b.hidden = !0);
|
|
885
887
|
}, f.onclick = () => {
|
|
886
888
|
w || (e.focusNode(e.currentNode), b.hidden = !0);
|
|
887
|
-
},
|
|
889
|
+
}, d.onclick = () => {
|
|
888
890
|
e.cancelFocus(), b.hidden = !0;
|
|
889
|
-
},
|
|
891
|
+
}, v.onclick = () => {
|
|
890
892
|
w || (e.moveUpNode(), b.hidden = !0);
|
|
891
893
|
}, u.onclick = () => {
|
|
892
894
|
w || (e.moveDownNode(), b.hidden = !0);
|
|
@@ -906,10 +908,10 @@ function Pt(e, t) {
|
|
|
906
908
|
}
|
|
907
909
|
);
|
|
908
910
|
};
|
|
909
|
-
return
|
|
911
|
+
return h.onclick = () => k(), p.onclick = () => k({ bidirectional: !0 }), g.onclick = () => {
|
|
910
912
|
b.hidden = !0, e.createSummary(), e.unselectNodes(e.currentNodes);
|
|
911
913
|
}, () => {
|
|
912
|
-
r.onclick = null,
|
|
914
|
+
r.onclick = null, c.onclick = null, l.onclick = null, a.onclick = null, f.onclick = null, d.onclick = null, v.onclick = null, u.onclick = null, h.onclick = null, g.onclick = null, b.onclick = null, e.container.oncontextmenu = null;
|
|
913
915
|
};
|
|
914
916
|
}
|
|
915
917
|
const fe = document, $t = function(e, t) {
|
|
@@ -954,45 +956,45 @@ class jt {
|
|
|
954
956
|
}
|
|
955
957
|
function Ht(e) {
|
|
956
958
|
let t = null, n = null;
|
|
957
|
-
const o = Ot(e), i = new jt(e), s = (
|
|
959
|
+
const o = Ot(e), i = new jt(e), s = (a) => {
|
|
958
960
|
e.selection.cancel();
|
|
959
|
-
const f =
|
|
961
|
+
const f = a.target;
|
|
960
962
|
if ((f == null ? void 0 : f.tagName) !== "ME-TPC") {
|
|
961
|
-
|
|
963
|
+
a.preventDefault();
|
|
962
964
|
return;
|
|
963
965
|
}
|
|
964
|
-
let
|
|
965
|
-
|
|
966
|
-
for (const
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
}, r = (
|
|
966
|
+
let d = e.currentNodes;
|
|
967
|
+
d != null && d.includes(f) || (e.selectNode(f), d = e.currentNodes), e.dragged = d, d.length > 1 ? o.innerHTML = d.length + "" : o.innerHTML = f.innerHTML;
|
|
968
|
+
for (const v of d)
|
|
969
|
+
v.parentElement.parentElement.style.opacity = "0.5";
|
|
970
|
+
a.dataTransfer.setDragImage(o, 0, 0), a.dataTransfer.dropEffect = "move", e.dragMoveHelper.clear();
|
|
971
|
+
}, r = (a) => {
|
|
970
972
|
const { dragged: f } = e;
|
|
971
973
|
if (!f)
|
|
972
974
|
return;
|
|
973
975
|
i.stop();
|
|
974
|
-
for (const
|
|
975
|
-
|
|
976
|
-
const
|
|
977
|
-
|
|
978
|
-
},
|
|
979
|
-
|
|
980
|
-
const f = 12 * e.scaleVal, { dragged:
|
|
981
|
-
if (!
|
|
976
|
+
for (const v of f)
|
|
977
|
+
v.parentElement.parentElement.style.opacity = "1";
|
|
978
|
+
const d = a.target;
|
|
979
|
+
d.style.opacity = "", n && (pe(n), t === "before" ? e.moveNodeBefore(f, n) : t === "after" ? e.moveNodeAfter(f, n) : t === "in" && e.moveNodeIn(f, n), e.dragged = null, o.innerHTML = "");
|
|
980
|
+
}, c = (a) => {
|
|
981
|
+
a.preventDefault();
|
|
982
|
+
const f = 12 * e.scaleVal, { dragged: d } = e;
|
|
983
|
+
if (!d)
|
|
982
984
|
return;
|
|
983
|
-
const
|
|
984
|
-
|
|
985
|
-
const u = fe.elementFromPoint(
|
|
986
|
-
if (Oe(u,
|
|
985
|
+
const v = e.container.getBoundingClientRect();
|
|
986
|
+
a.clientX < v.x + 50 ? i.move(1, 0) : a.clientX > v.x + v.width - 50 ? i.move(-1, 0) : a.clientY < v.y + 50 ? i.move(0, 1) : a.clientY > v.y + v.height - 50 ? i.move(0, -1) : i.stop(), pe(n);
|
|
987
|
+
const u = fe.elementFromPoint(a.clientX, a.clientY - f);
|
|
988
|
+
if (Oe(u, d)) {
|
|
987
989
|
n = u;
|
|
988
|
-
const
|
|
989
|
-
|
|
990
|
+
const h = u.getBoundingClientRect(), p = h.y;
|
|
991
|
+
a.clientY > p + h.height ? t = "after" : t = "in";
|
|
990
992
|
} else {
|
|
991
|
-
const
|
|
992
|
-
if (Oe(
|
|
993
|
-
n =
|
|
994
|
-
const
|
|
995
|
-
|
|
993
|
+
const h = fe.elementFromPoint(a.clientX, a.clientY + f), p = h.getBoundingClientRect();
|
|
994
|
+
if (Oe(h, d)) {
|
|
995
|
+
n = h;
|
|
996
|
+
const g = p.y;
|
|
997
|
+
a.clientY < g ? t = "before" : t = "in";
|
|
996
998
|
} else
|
|
997
999
|
t = n = null;
|
|
998
1000
|
}
|
|
@@ -1001,7 +1003,7 @@ function Ht(e) {
|
|
|
1001
1003
|
return we([
|
|
1002
1004
|
{ dom: e.map, evt: "dragstart", func: s },
|
|
1003
1005
|
{ dom: e.map, evt: "dragend", func: r },
|
|
1004
|
-
{ dom: e.map, evt: "dragover", func:
|
|
1006
|
+
{ dom: e.map, evt: "dragover", func: c }
|
|
1005
1007
|
]);
|
|
1006
1008
|
}
|
|
1007
1009
|
const Bt = function(e) {
|
|
@@ -1023,10 +1025,10 @@ function Rt(e) {
|
|
|
1023
1025
|
let t = [], n = -1, o = e.getData(), i = [];
|
|
1024
1026
|
e.undo = function() {
|
|
1025
1027
|
if (n > -1) {
|
|
1026
|
-
const
|
|
1027
|
-
o =
|
|
1028
|
+
const l = t[n];
|
|
1029
|
+
o = l.prev, e.refresh(l.prev);
|
|
1028
1030
|
try {
|
|
1029
|
-
|
|
1031
|
+
l.currentTarget.type === "nodes" && (l.operation === "removeNodes" ? e.selectNodes(l.currentTarget.value.map((a) => this.findEle(a))) : e.selectNodes(l.currentSelected.map((a) => this.findEle(a))));
|
|
1030
1032
|
} catch {
|
|
1031
1033
|
} finally {
|
|
1032
1034
|
n--;
|
|
@@ -1035,33 +1037,33 @@ function Rt(e) {
|
|
|
1035
1037
|
}, e.redo = function() {
|
|
1036
1038
|
if (n < t.length - 1) {
|
|
1037
1039
|
n++;
|
|
1038
|
-
const
|
|
1039
|
-
o =
|
|
1040
|
+
const l = t[n];
|
|
1041
|
+
o = l.next, e.refresh(l.next);
|
|
1040
1042
|
try {
|
|
1041
|
-
|
|
1043
|
+
l.currentTarget.type === "nodes" && (l.operation === "removeNodes" ? e.selectNodes(l.currentSelected.map((a) => this.findEle(a))) : e.selectNodes(l.currentTarget.value.map((a) => this.findEle(a))));
|
|
1042
1044
|
} catch {
|
|
1043
1045
|
}
|
|
1044
1046
|
}
|
|
1045
1047
|
};
|
|
1046
|
-
const s = function(
|
|
1047
|
-
if (
|
|
1048
|
+
const s = function(l) {
|
|
1049
|
+
if (l.name === "beginEdit")
|
|
1048
1050
|
return;
|
|
1049
1051
|
t = t.slice(0, n + 1);
|
|
1050
|
-
const
|
|
1052
|
+
const a = e.getData(), f = {
|
|
1051
1053
|
prev: o,
|
|
1052
|
-
operation:
|
|
1053
|
-
currentSelected: i.map((
|
|
1054
|
-
currentTarget: Bt(
|
|
1055
|
-
next:
|
|
1054
|
+
operation: l.name,
|
|
1055
|
+
currentSelected: i.map((d) => d.id),
|
|
1056
|
+
currentTarget: Bt(l),
|
|
1057
|
+
next: a
|
|
1056
1058
|
};
|
|
1057
|
-
t.push(f), o =
|
|
1058
|
-
}, r = function(
|
|
1059
|
-
(
|
|
1060
|
-
},
|
|
1061
|
-
i = e.currentNodes.map((
|
|
1059
|
+
t.push(f), o = a, n = t.length - 1;
|
|
1060
|
+
}, r = function(l) {
|
|
1061
|
+
(l.metaKey || l.ctrlKey) && (l.shiftKey && l.key === "Z" || l.key === "y") ? e.redo() : (l.metaKey || l.ctrlKey) && l.key === "z" && e.undo();
|
|
1062
|
+
}, c = function(l) {
|
|
1063
|
+
i = e.currentNodes.map((a) => a.nodeObj);
|
|
1062
1064
|
};
|
|
1063
|
-
return e.bus.addListener("operation", s), e.bus.addListener("selectNodes",
|
|
1064
|
-
e.bus.removeListener("operation", s), e.bus.removeListener("selectNodes",
|
|
1065
|
+
return e.bus.addListener("operation", s), e.bus.addListener("selectNodes", c), e.container.addEventListener("keydown", r), () => {
|
|
1066
|
+
e.bus.removeListener("operation", s), e.bus.removeListener("selectNodes", c), e.container.removeEventListener("keydown", r);
|
|
1065
1067
|
};
|
|
1066
1068
|
}
|
|
1067
1069
|
const Ft = '<?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>', Wt = '<?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>', It = '<?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>', Kt = '<?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>', Yt = '<?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>', Gt = '<?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>', qt = '<?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>';
|
|
@@ -1226,8 +1228,8 @@ const je = (e, t = "px") => typeof e == "number" ? e + t : e, O = ({ style: e },
|
|
|
1226
1228
|
};
|
|
1227
1229
|
for (const f of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))
|
|
1228
1230
|
typeof this[f] == "function" && (this[f] = this[f].bind(this));
|
|
1229
|
-
const { document:
|
|
1230
|
-
this._area =
|
|
1231
|
+
const { document: c, selectionAreaClass: l, selectionContainerClass: a } = this._options;
|
|
1232
|
+
this._area = c.createElement("div"), this._clippingElement = c.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(l), a && this._clippingElement.classList.add(a), O(this._area, {
|
|
1231
1233
|
willChange: "top, left, bottom, right, width, height",
|
|
1232
1234
|
top: 0,
|
|
1233
1235
|
left: 0,
|
|
@@ -1248,19 +1250,19 @@ const je = (e, t = "px") => typeof e == "number" ? e + t : e, O = ({ style: e },
|
|
|
1248
1250
|
i(n, "mousedown", this._onTapStart), o.touch && i(n, "touchstart", this._onTapStart, { passive: !1 });
|
|
1249
1251
|
}
|
|
1250
1252
|
_onTapStart(t, n = !1) {
|
|
1251
|
-
const { x: o, y: i, target: s } = Z(t), { document: r, startAreas:
|
|
1253
|
+
const { x: o, y: i, target: s } = Z(t), { document: r, startAreas: c, boundaries: l, features: a, behaviour: f } = this._options, d = s.getBoundingClientRect();
|
|
1252
1254
|
if (t instanceof MouseEvent && !tn(t, f.triggers))
|
|
1253
1255
|
return;
|
|
1254
|
-
const
|
|
1256
|
+
const v = Y(c, r), u = Y(l, r);
|
|
1255
1257
|
this._targetElement = u.find(
|
|
1256
|
-
(
|
|
1258
|
+
(m) => Be(m.getBoundingClientRect(), d)
|
|
1257
1259
|
);
|
|
1258
|
-
const
|
|
1259
|
-
if (this._targetBoundary = u.find((
|
|
1260
|
+
const h = t.composedPath(), p = v.find((m) => h.includes(m));
|
|
1261
|
+
if (this._targetBoundary = u.find((m) => h.includes(m)), !this._targetElement || !p || !this._targetBoundary || !n && this._emitEvent("beforestart", t) === !1)
|
|
1260
1262
|
return;
|
|
1261
1263
|
this._areaLocation = { x1: o, y1: i, x2: 0, y2: 0 };
|
|
1262
|
-
const
|
|
1263
|
-
this._scrollDelta = { x:
|
|
1264
|
+
const g = r.scrollingElement ?? r.body;
|
|
1265
|
+
this._scrollDelta = { x: g.scrollLeft, y: g.scrollTop }, this._singleClick = !0, this.clearSelection(!1, !0), j(r, ["touchmove", "mousemove"], this._delayedTapMove, { passive: !1 }), j(r, ["mouseup", "touchcancel", "touchend"], this._onTapStop), j(r, "scroll", this._onScroll), a.deselectOnBlur && (this._targetBoundaryScrolled = !1, j(this._targetBoundary, "scroll", this._onStartAreaScroll));
|
|
1264
1266
|
}
|
|
1265
1267
|
_onSingleTap(t) {
|
|
1266
1268
|
const { singleTap: { intersect: n }, range: o } = this._options.features, i = Z(t);
|
|
@@ -1269,10 +1271,10 @@ const je = (e, t = "px") => typeof e == "number" ? e + t : e, O = ({ style: e },
|
|
|
1269
1271
|
s = i.target;
|
|
1270
1272
|
else if (n === "touch") {
|
|
1271
1273
|
this.resolveSelectables();
|
|
1272
|
-
const { x:
|
|
1273
|
-
s = this._selectables.find((
|
|
1274
|
-
const { right: f, left:
|
|
1275
|
-
return
|
|
1274
|
+
const { x: c, y: l } = i;
|
|
1275
|
+
s = this._selectables.find((a) => {
|
|
1276
|
+
const { right: f, left: d, top: v, bottom: u } = a.getBoundingClientRect();
|
|
1277
|
+
return c < f && c > d && l < u && l > v;
|
|
1276
1278
|
});
|
|
1277
1279
|
}
|
|
1278
1280
|
if (!s)
|
|
@@ -1286,25 +1288,25 @@ const je = (e, t = "px") => typeof e == "number" ? e + t : e, O = ({ style: e },
|
|
|
1286
1288
|
}
|
|
1287
1289
|
const { stored: r } = this._selection;
|
|
1288
1290
|
if (this._emitEvent("start", t), t.shiftKey && o && this._latestElement) {
|
|
1289
|
-
const
|
|
1290
|
-
(
|
|
1291
|
-
),
|
|
1292
|
-
this.select(f), this._latestElement =
|
|
1291
|
+
const c = this._latestElement, [l, a] = c.compareDocumentPosition(s) & 4 ? [s, c] : [c, s], f = [...this._selectables.filter(
|
|
1292
|
+
(d) => d.compareDocumentPosition(l) & 4 && d.compareDocumentPosition(a) & 2
|
|
1293
|
+
), l, a];
|
|
1294
|
+
this.select(f), this._latestElement = c;
|
|
1293
1295
|
} else
|
|
1294
|
-
r.includes(s) && (r.length === 1 || t.ctrlKey || r.every((
|
|
1296
|
+
r.includes(s) && (r.length === 1 || t.ctrlKey || r.every((c) => this._selection.stored.includes(c))) ? this.deselect(s) : (this.select(s), this._latestElement = s);
|
|
1295
1297
|
}
|
|
1296
1298
|
_delayedTapMove(t) {
|
|
1297
|
-
const { container: n, document: o, behaviour: { startThreshold: i } } = this._options, { x1: s, y1: r } = this._areaLocation, { x:
|
|
1299
|
+
const { container: n, document: o, behaviour: { startThreshold: i } } = this._options, { x1: s, y1: r } = this._areaLocation, { x: c, y: l } = Z(t);
|
|
1298
1300
|
if (
|
|
1299
1301
|
// Single number for both coordinates
|
|
1300
|
-
typeof i == "number" && F(
|
|
1301
|
-
typeof i == "object" && F(
|
|
1302
|
+
typeof i == "number" && F(c + l - (s + r)) >= i || // Different x and y threshold
|
|
1303
|
+
typeof i == "object" && F(c - s) >= i.x || F(l - r) >= i.y
|
|
1302
1304
|
) {
|
|
1303
1305
|
if (A(o, ["mousemove", "touchmove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag", t) === !1) {
|
|
1304
1306
|
A(o, ["mouseup", "touchcancel", "touchend"], this._onTapStop);
|
|
1305
1307
|
return;
|
|
1306
1308
|
}
|
|
1307
|
-
j(o, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }), O(this._area, "display", "block"), Y(n, o)[0].appendChild(this._clippingElement), this.resolveSelectables(), this._singleClick = !1, this._targetRect = this._targetElement.getBoundingClientRect(), this._scrollAvailable = this._targetElement.scrollHeight !== this._targetElement.clientHeight || this._targetElement.scrollWidth !== this._targetElement.clientWidth, this._scrollAvailable && (j(this._targetElement, "wheel", this._wheelScroll, { passive: !1 }), j(this._options.document, "keydown", this._keyboardScroll, { passive: !1 }), this._selectables = this._selectables.filter((
|
|
1309
|
+
j(o, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }), O(this._area, "display", "block"), Y(n, o)[0].appendChild(this._clippingElement), this.resolveSelectables(), this._singleClick = !1, this._targetRect = this._targetElement.getBoundingClientRect(), this._scrollAvailable = this._targetElement.scrollHeight !== this._targetElement.clientHeight || this._targetElement.scrollWidth !== this._targetElement.clientWidth, this._scrollAvailable && (j(this._targetElement, "wheel", this._wheelScroll, { passive: !1 }), j(this._options.document, "keydown", this._keyboardScroll, { passive: !1 }), this._selectables = this._selectables.filter((a) => this._targetElement.contains(a))), this._setupSelectionArea(), this._emitEvent("start", t), this._onTapMove(t);
|
|
1308
1310
|
}
|
|
1309
1311
|
this._handleMoveEvent(t);
|
|
1310
1312
|
}
|
|
@@ -1329,16 +1331,16 @@ const je = (e, t = "px") => typeof e == "number" ? e + t : e, O = ({ style: e },
|
|
|
1329
1331
|
}));
|
|
1330
1332
|
}
|
|
1331
1333
|
_onTapMove(t) {
|
|
1332
|
-
const { _scrollSpeed: n, _areaLocation: o, _options: i, _frame: s } = this, { speedDivider: r } = i.behaviour.scrolling,
|
|
1333
|
-
if (o.x2 =
|
|
1334
|
+
const { _scrollSpeed: n, _areaLocation: o, _options: i, _frame: s } = this, { speedDivider: r } = i.behaviour.scrolling, c = this._targetElement, { x: l, y: a } = Z(t);
|
|
1335
|
+
if (o.x2 = l, o.y2 = a, this._lastMousePosition.x = l, this._lastMousePosition.y = a, this._scrollAvailable && !this._scrollingActive && (n.y || n.x)) {
|
|
1334
1336
|
this._scrollingActive = !0;
|
|
1335
1337
|
const f = () => {
|
|
1336
1338
|
if (!n.x && !n.y) {
|
|
1337
1339
|
this._scrollingActive = !1;
|
|
1338
1340
|
return;
|
|
1339
1341
|
}
|
|
1340
|
-
const { scrollTop:
|
|
1341
|
-
n.y && (
|
|
1342
|
+
const { scrollTop: d, scrollLeft: v } = c;
|
|
1343
|
+
n.y && (c.scrollTop += We(n.y / r), o.y1 -= c.scrollTop - d), n.x && (c.scrollLeft += We(n.x / r), o.x1 -= c.scrollLeft - v), s.next(t), requestAnimationFrame(f);
|
|
1342
1344
|
};
|
|
1343
1345
|
requestAnimationFrame(f);
|
|
1344
1346
|
} else
|
|
@@ -1370,12 +1372,12 @@ const je = (e, t = "px") => typeof e == "number" ? e + t : e, O = ({ style: e },
|
|
|
1370
1372
|
});
|
|
1371
1373
|
}
|
|
1372
1374
|
_recalculateSelectionAreaRect() {
|
|
1373
|
-
const { _scrollSpeed: t, _areaLocation: n, _targetElement: o, _options: i } = this, { scrollTop: s, scrollHeight: r, clientHeight:
|
|
1374
|
-
let { x2:
|
|
1375
|
-
const { behaviour: { scrolling: { startScrollMargins:
|
|
1376
|
-
|
|
1377
|
-
const
|
|
1378
|
-
this._areaRect = He(
|
|
1375
|
+
const { _scrollSpeed: t, _areaLocation: n, _targetElement: o, _options: i } = this, { scrollTop: s, scrollHeight: r, clientHeight: c, scrollLeft: l, scrollWidth: a, clientWidth: f } = o, d = this._targetRect, { x1: v, y1: u } = n;
|
|
1376
|
+
let { x2: h, y2: p } = n;
|
|
1377
|
+
const { behaviour: { scrolling: { startScrollMargins: g } } } = i;
|
|
1378
|
+
h < d.left + g.x ? (t.x = l ? -F(d.left - h + g.x) : 0, h = h < d.left ? d.left : h) : h > d.right - g.x ? (t.x = a - l - f ? F(d.left + d.width - h - g.x) : 0, h = h > d.right ? d.right : h) : t.x = 0, p < d.top + g.y ? (t.y = s ? -F(d.top - p + g.y) : 0, p = p < d.top ? d.top : p) : p > d.bottom - g.y ? (t.y = r - s - c ? F(d.top + d.height - p - g.y) : 0, p = p > d.bottom ? d.bottom : p) : t.y = 0;
|
|
1379
|
+
const m = Fe(v, h), b = Fe(u, p), w = Re(v, h), C = Re(u, p);
|
|
1380
|
+
this._areaRect = He(m, b, w - m, C - b);
|
|
1379
1381
|
}
|
|
1380
1382
|
_redrawSelectionArea() {
|
|
1381
1383
|
const { x: t, y: n, width: o, height: i } = this._areaRect, { style: s } = this._area;
|
|
@@ -1387,29 +1389,29 @@ const je = (e, t = "px") => typeof e == "number" ? e + t : e, O = ({ style: e },
|
|
|
1387
1389
|
A(this._targetElement, "scroll", this._onStartAreaScroll), A(i, ["mousemove", "touchmove"], this._delayedTapMove), A(i, ["touchmove", "mousemove"], this._onTapMove), A(i, ["mouseup", "touchcancel", "touchend"], this._onTapStop), A(i, "scroll", this._onScroll), this._keepSelection(), t && r && s.singleTap.allow ? this._onSingleTap(t) : !r && !n && (this._updateElementSelection(), this._emitEvent("stop", t)), this._scrollSpeed.x = 0, this._scrollSpeed.y = 0, A(this._targetElement, "wheel", this._wheelScroll, { passive: !0 }), A(this._options.document, "keydown", this._keyboardScroll, { passive: !0 }), this._clippingElement.remove(), (o = this._frame) == null || o.cancel(), O(this._area, "display", "none");
|
|
1388
1390
|
}
|
|
1389
1391
|
_updateElementSelection() {
|
|
1390
|
-
const { _selectables: t, _options: n, _selection: o, _areaRect: i } = this, { stored: s, selected: r, touched:
|
|
1392
|
+
const { _selectables: t, _options: n, _selection: o, _areaRect: i } = this, { stored: s, selected: r, touched: c } = o, { intersect: l, overlap: a } = n.behaviour, f = a === "invert", d = [], v = [], u = [];
|
|
1391
1393
|
for (let p = 0; p < t.length; p++) {
|
|
1392
|
-
const
|
|
1393
|
-
if (Be(i,
|
|
1394
|
-
if (r.includes(
|
|
1395
|
-
s.includes(
|
|
1396
|
-
else if (f && s.includes(
|
|
1397
|
-
u.push(
|
|
1394
|
+
const g = t[p];
|
|
1395
|
+
if (Be(i, g.getBoundingClientRect(), l)) {
|
|
1396
|
+
if (r.includes(g))
|
|
1397
|
+
s.includes(g) && !c.includes(g) && c.push(g);
|
|
1398
|
+
else if (f && s.includes(g)) {
|
|
1399
|
+
u.push(g);
|
|
1398
1400
|
continue;
|
|
1399
1401
|
} else
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
+
v.push(g);
|
|
1403
|
+
d.push(g);
|
|
1402
1404
|
}
|
|
1403
1405
|
}
|
|
1404
|
-
f &&
|
|
1405
|
-
const
|
|
1406
|
+
f && v.push(...s.filter((p) => !r.includes(p)));
|
|
1407
|
+
const h = a === "keep";
|
|
1406
1408
|
for (let p = 0; p < r.length; p++) {
|
|
1407
|
-
const
|
|
1408
|
-
!
|
|
1409
|
+
const g = r[p];
|
|
1410
|
+
!d.includes(g) && !// Check if the user wants to keep previously selected elements, e.g.,
|
|
1409
1411
|
// not make them part of the current selection as soon as they're touched.
|
|
1410
|
-
(
|
|
1412
|
+
(h && s.includes(g)) && u.push(g);
|
|
1411
1413
|
}
|
|
1412
|
-
o.selected =
|
|
1414
|
+
o.selected = d, o.changed = { added: v, removed: u }, this._latestElement = void 0;
|
|
1413
1415
|
}
|
|
1414
1416
|
_emitEvent(t, n) {
|
|
1415
1417
|
return this.emit(t, {
|
|
@@ -1419,20 +1421,20 @@ const je = (e, t = "px") => typeof e == "number" ? e + t : e, O = ({ style: e },
|
|
|
1419
1421
|
});
|
|
1420
1422
|
}
|
|
1421
1423
|
_keepSelection() {
|
|
1422
|
-
const { _options: t, _selection: n } = this, { selected: o, changed: i, touched: s, stored: r } = n,
|
|
1424
|
+
const { _options: t, _selection: n } = this, { selected: o, changed: i, touched: s, stored: r } = n, c = o.filter((l) => !r.includes(l));
|
|
1423
1425
|
switch (t.behaviour.overlap) {
|
|
1424
1426
|
case "drop": {
|
|
1425
1427
|
n.stored = [
|
|
1426
|
-
...
|
|
1427
|
-
...r.filter((
|
|
1428
|
+
...c,
|
|
1429
|
+
...r.filter((l) => !s.includes(l))
|
|
1428
1430
|
// Elements not touched
|
|
1429
1431
|
];
|
|
1430
1432
|
break;
|
|
1431
1433
|
}
|
|
1432
1434
|
case "invert": {
|
|
1433
1435
|
n.stored = [
|
|
1434
|
-
...
|
|
1435
|
-
...r.filter((
|
|
1436
|
+
...c,
|
|
1437
|
+
...r.filter((l) => !i.removed.includes(l))
|
|
1436
1438
|
// Elements not removed from selection
|
|
1437
1439
|
];
|
|
1438
1440
|
break;
|
|
@@ -1440,7 +1442,7 @@ const je = (e, t = "px") => typeof e == "number" ? e + t : e, O = ({ style: e },
|
|
|
1440
1442
|
case "keep": {
|
|
1441
1443
|
n.stored = [
|
|
1442
1444
|
...r,
|
|
1443
|
-
...o.filter((
|
|
1445
|
+
...o.filter((l) => !r.includes(l))
|
|
1444
1446
|
// Newly added
|
|
1445
1447
|
];
|
|
1446
1448
|
break;
|
|
@@ -1525,7 +1527,7 @@ const je = (e, t = "px") => typeof e == "number" ? e + t : e, O = ({ style: e },
|
|
|
1525
1527
|
*/
|
|
1526
1528
|
select(t, n = !1) {
|
|
1527
1529
|
const { changed: o, selected: i, stored: s } = this._selection, r = Y(t, this._options.document).filter(
|
|
1528
|
-
(
|
|
1530
|
+
(c) => !i.includes(c) && !s.includes(c)
|
|
1529
1531
|
);
|
|
1530
1532
|
return s.push(...r), i.push(...r), o.added.push(...r), o.removed = [], this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)), r;
|
|
1531
1533
|
}
|
|
@@ -1536,10 +1538,10 @@ const je = (e, t = "px") => typeof e == "number" ? e + t : e, O = ({ style: e },
|
|
|
1536
1538
|
*/
|
|
1537
1539
|
deselect(t, n = !1) {
|
|
1538
1540
|
const { selected: o, stored: i, changed: s } = this._selection, r = Y(t, this._options.document).filter(
|
|
1539
|
-
(
|
|
1541
|
+
(c) => o.includes(c) || i.includes(c)
|
|
1540
1542
|
);
|
|
1541
|
-
this._selection.stored = i.filter((
|
|
1542
|
-
...r.filter((
|
|
1543
|
+
this._selection.stored = i.filter((c) => !r.includes(c)), this._selection.selected = o.filter((c) => !r.includes(c)), this._selection.changed.added = [], this._selection.changed.removed.push(
|
|
1544
|
+
...r.filter((c) => !s.removed.includes(c))
|
|
1543
1545
|
), this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null));
|
|
1544
1546
|
}
|
|
1545
1547
|
};
|
|
@@ -1632,7 +1634,7 @@ function rn(e) {
|
|
|
1632
1634
|
const o = t[n];
|
|
1633
1635
|
n === 0 ? (t[n] = t[t.length - 1], t[t.length - 1] = o) : (t[n] = t[n - 1], t[n - 1] = o);
|
|
1634
1636
|
}
|
|
1635
|
-
function
|
|
1637
|
+
function cn(e) {
|
|
1636
1638
|
const { siblings: t, index: n } = z(e);
|
|
1637
1639
|
if (t === void 0)
|
|
1638
1640
|
return;
|
|
@@ -1643,7 +1645,7 @@ function nt(e) {
|
|
|
1643
1645
|
const { siblings: t, index: n } = z(e);
|
|
1644
1646
|
return t === void 0 ? 0 : (t.splice(n, 1), t.length);
|
|
1645
1647
|
}
|
|
1646
|
-
function
|
|
1648
|
+
function ln(e, t, n) {
|
|
1647
1649
|
const { siblings: o, index: i } = z(n);
|
|
1648
1650
|
o !== void 0 && (t === "before" ? o.splice(i, 0, e) : o.splice(i + 1, 0, e));
|
|
1649
1651
|
}
|
|
@@ -1680,8 +1682,8 @@ const dn = function({ map: e, direction: t }, n) {
|
|
|
1680
1682
|
if (J(o), i.children[1])
|
|
1681
1683
|
i.nextSibling.appendChild(n);
|
|
1682
1684
|
else {
|
|
1683
|
-
const
|
|
1684
|
-
i.appendChild(Ce(!0)), i.insertAdjacentElement("afterend",
|
|
1685
|
+
const c = e.createChildren([n]);
|
|
1686
|
+
i.appendChild(Ce(!0)), i.insertAdjacentElement("afterend", c);
|
|
1685
1687
|
}
|
|
1686
1688
|
e.linkDiv(n.offsetParent);
|
|
1687
1689
|
} else
|
|
@@ -1718,13 +1720,13 @@ const dn = function({ map: e, direction: t }, n) {
|
|
|
1718
1720
|
const { grp: s, top: r } = e.createWrapper(i);
|
|
1719
1721
|
return it(e, t, s), { newTop: r, newNodeObj: i };
|
|
1720
1722
|
}, fn = function(e, t, n) {
|
|
1721
|
-
var
|
|
1723
|
+
var a, f, d, v;
|
|
1722
1724
|
const o = t || this.currentNode;
|
|
1723
1725
|
if (!o)
|
|
1724
1726
|
return;
|
|
1725
1727
|
const i = o.nodeObj;
|
|
1726
1728
|
if (i.parent) {
|
|
1727
|
-
if (!((
|
|
1729
|
+
if (!((a = i.parent) != null && a.parent) && ((d = (f = i.parent) == null ? void 0 : f.children) == null ? void 0 : d.length) === 1 && this.direction === 2) {
|
|
1728
1730
|
this.addChild(this.findEle(i.parent.id), n);
|
|
1729
1731
|
return;
|
|
1730
1732
|
}
|
|
@@ -1733,17 +1735,17 @@ const dn = function({ map: e, direction: t }, n) {
|
|
|
1733
1735
|
return;
|
|
1734
1736
|
}
|
|
1735
1737
|
const s = n || this.generateNewObj();
|
|
1736
|
-
if (!((
|
|
1738
|
+
if (!((v = i.parent) != null && v.parent)) {
|
|
1737
1739
|
const u = o.closest("me-main").className === M.LHS ? 0 : 1;
|
|
1738
1740
|
s.direction = u;
|
|
1739
1741
|
}
|
|
1740
|
-
|
|
1741
|
-
const r = o.parentElement, { grp:
|
|
1742
|
-
r.parentElement.insertAdjacentElement(st[e],
|
|
1742
|
+
ln(s, e, i), H(this.nodeData);
|
|
1743
|
+
const r = o.parentElement, { grp: c, top: l } = this.createWrapper(s);
|
|
1744
|
+
r.parentElement.insertAdjacentElement(st[e], c), this.linkDiv(c.offsetParent), n || this.editTopic(l.firstChild), this.bus.fire("operation", {
|
|
1743
1745
|
name: "insertSibling",
|
|
1744
1746
|
type: e,
|
|
1745
1747
|
obj: s
|
|
1746
|
-
}), this.selectNode(
|
|
1748
|
+
}), this.selectNode(l.firstChild, !0);
|
|
1747
1749
|
}, pn = function(e, t) {
|
|
1748
1750
|
const n = e || this.currentNode;
|
|
1749
1751
|
if (!n)
|
|
@@ -1754,10 +1756,10 @@ const dn = function({ map: e, direction: t }, n) {
|
|
|
1754
1756
|
return;
|
|
1755
1757
|
const i = t || this.generateNewObj();
|
|
1756
1758
|
an(o, i), H(this.nodeData);
|
|
1757
|
-
const s = n.parentElement.parentElement, { grp: r, top:
|
|
1758
|
-
|
|
1759
|
-
const
|
|
1760
|
-
|
|
1759
|
+
const s = n.parentElement.parentElement, { grp: r, top: c } = this.createWrapper(i, !0);
|
|
1760
|
+
c.appendChild(Ce(!0)), s.insertAdjacentElement("afterend", r);
|
|
1761
|
+
const l = this.createChildren([s]);
|
|
1762
|
+
c.insertAdjacentElement("afterend", l), this.linkDiv(), t || this.editTopic(c.firstChild), this.selectNode(c.firstChild, !0), this.bus.fire("operation", {
|
|
1761
1763
|
name: "insertParent",
|
|
1762
1764
|
obj: i
|
|
1763
1765
|
});
|
|
@@ -1785,7 +1787,7 @@ const dn = function({ map: e, direction: t }, n) {
|
|
|
1785
1787
|
obj: i
|
|
1786
1788
|
});
|
|
1787
1789
|
}, vn = function(e, t) {
|
|
1788
|
-
e =
|
|
1790
|
+
e = ce(e);
|
|
1789
1791
|
const n = [];
|
|
1790
1792
|
for (let o = 0; o < e.length; o++) {
|
|
1791
1793
|
const i = e[o], s = ye(i.nodeObj);
|
|
@@ -1793,8 +1795,8 @@ const dn = function({ map: e, direction: t }, n) {
|
|
|
1793
1795
|
const r = Se(this, t, s);
|
|
1794
1796
|
if (!r)
|
|
1795
1797
|
return;
|
|
1796
|
-
const { newNodeObj:
|
|
1797
|
-
n.push(
|
|
1798
|
+
const { newNodeObj: c } = r;
|
|
1799
|
+
n.push(c);
|
|
1798
1800
|
}
|
|
1799
1801
|
this.unselectNodes(this.currentNodes), this.selectNodes(n.map((o) => this.findEle(o.id))), this.bus.fire("operation", {
|
|
1800
1802
|
name: "copyNodes",
|
|
@@ -1816,7 +1818,7 @@ const dn = function({ map: e, direction: t }, n) {
|
|
|
1816
1818
|
if (!t)
|
|
1817
1819
|
return;
|
|
1818
1820
|
const n = t.nodeObj;
|
|
1819
|
-
|
|
1821
|
+
cn(n);
|
|
1820
1822
|
const o = t.parentNode.parentNode;
|
|
1821
1823
|
o.nextSibling ? o.nextSibling.insertAdjacentElement("afterend", o) : o.parentNode.prepend(o), this.linkDiv(), this.bus.fire("operation", {
|
|
1822
1824
|
name: "moveDownNode",
|
|
@@ -1825,7 +1827,7 @@ const dn = function({ map: e, direction: t }, n) {
|
|
|
1825
1827
|
}, wn = function(e) {
|
|
1826
1828
|
if (e.length === 0)
|
|
1827
1829
|
return;
|
|
1828
|
-
e =
|
|
1830
|
+
e = ce(e);
|
|
1829
1831
|
for (const n of e) {
|
|
1830
1832
|
const o = n.nodeObj, i = nt(o);
|
|
1831
1833
|
hn(n, i);
|
|
@@ -1836,7 +1838,7 @@ const dn = function({ map: e, direction: t }, n) {
|
|
|
1836
1838
|
objs: e.map((n) => n.nodeObj)
|
|
1837
1839
|
});
|
|
1838
1840
|
}, xn = function(e, t) {
|
|
1839
|
-
e =
|
|
1841
|
+
e = ce(e);
|
|
1840
1842
|
const n = t.nodeObj;
|
|
1841
1843
|
n.expanded === !1 && (this.expandNode(t, !0), t = this.findEle(n.id));
|
|
1842
1844
|
for (const o of e) {
|
|
@@ -1851,13 +1853,13 @@ const dn = function({ map: e, direction: t }, n) {
|
|
|
1851
1853
|
toObj: n
|
|
1852
1854
|
});
|
|
1853
1855
|
}, rt = (e, t, n, o) => {
|
|
1854
|
-
e =
|
|
1856
|
+
e = ce(e), t === "after" && (e = e.reverse());
|
|
1855
1857
|
const i = n.nodeObj, s = [];
|
|
1856
1858
|
for (const r of e) {
|
|
1857
|
-
const
|
|
1858
|
-
ot(t,
|
|
1859
|
-
const
|
|
1860
|
-
s.includes(
|
|
1859
|
+
const c = r.nodeObj;
|
|
1860
|
+
ot(t, c, i), H(o.nodeData), J(r);
|
|
1861
|
+
const l = r.parentElement.parentNode;
|
|
1862
|
+
s.includes(l.parentElement) || s.push(l.parentElement), n.parentElement.parentNode.insertAdjacentElement(st[t], l);
|
|
1861
1863
|
}
|
|
1862
1864
|
for (const r of s)
|
|
1863
1865
|
r.childElementCount === 0 && r.tagName !== "ME-MAIN" && (r.previousSibling.children[1].remove(), r.remove());
|
|
@@ -1875,7 +1877,7 @@ const dn = function({ map: e, direction: t }, n) {
|
|
|
1875
1877
|
t && (t.nodeObj.dangerouslySetInnerHTML || this.editTopic(t));
|
|
1876
1878
|
}, Nn = function(e, t) {
|
|
1877
1879
|
e.text.textContent = t, e.nodeObj.topic = t, this.linkDiv();
|
|
1878
|
-
},
|
|
1880
|
+
}, ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1879
1881
|
__proto__: null,
|
|
1880
1882
|
addChild: gn,
|
|
1881
1883
|
beginEdit: Sn,
|
|
@@ -1905,8 +1907,8 @@ function kn(e) {
|
|
|
1905
1907
|
const _n = function(e) {
|
|
1906
1908
|
const t = this.container, n = e.getBoundingClientRect(), o = t.getBoundingClientRect();
|
|
1907
1909
|
if (n.top > o.bottom || n.bottom < o.top || n.left > o.right || n.right < o.left) {
|
|
1908
|
-
const s = n.left + n.width / 2, r = n.top + n.height / 2,
|
|
1909
|
-
this.move(-
|
|
1910
|
+
const s = n.left + n.width / 2, r = n.top + n.height / 2, c = o.left + o.width / 2, l = o.top + o.height / 2, a = s - c, f = r - l;
|
|
1911
|
+
this.move(-a, -f, !0);
|
|
1910
1912
|
}
|
|
1911
1913
|
}, Tn = function(e, t, n) {
|
|
1912
1914
|
this.clearSelection(), this.scrollIntoView(e), this.selection.select(e), t && this.bus.fire("selectNewNode", e.nodeObj);
|
|
@@ -1931,23 +1933,23 @@ const _n = function(e) {
|
|
|
1931
1933
|
}, jn = function(e, t = { x: 0, y: 0 }) {
|
|
1932
1934
|
if (e < this.scaleMin || e > this.scaleMax)
|
|
1933
1935
|
return;
|
|
1934
|
-
const n = this.container.getBoundingClientRect(), o = t.x ? t.x - n.left - n.width / 2 : 0, i = t.y ? t.y - n.top - n.height / 2 : 0, { dx: s, dy: r } =
|
|
1935
|
-
this.map.style.transform = `translate(${
|
|
1936
|
+
const n = this.container.getBoundingClientRect(), o = t.x ? t.x - n.left - n.width / 2 : 0, i = t.y ? t.y - n.top - n.height / 2 : 0, { dx: s, dy: r } = lt(this), c = this.map.style.transform, { x: l, y: a } = ze(c), f = l - s, d = a - r, v = this.scaleVal, u = (-o + f) * (1 - e / v), h = (-i + d) * (1 - e / v);
|
|
1937
|
+
this.map.style.transform = `translate(${l - u}px, ${a - h}px) scale(${e})`, this.scaleVal = e, this.bus.fire("scale", e);
|
|
1936
1938
|
}, Hn = function() {
|
|
1937
1939
|
const e = this.nodes.offsetHeight / this.container.offsetHeight, t = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(e, t));
|
|
1938
1940
|
this.scaleVal = n, this.map.style.transform = "scale(" + n + ")", this.bus.fire("scale", n);
|
|
1939
1941
|
}, Bn = function(e, t, n = !1) {
|
|
1940
1942
|
const { map: o, scaleVal: i, bus: s } = this, r = o.style.transform;
|
|
1941
|
-
let { x:
|
|
1942
|
-
|
|
1943
|
+
let { x: c, y: l } = ze(r);
|
|
1944
|
+
c += e, l += t, n && (o.style.transition = "transform 0.3s", setTimeout(() => {
|
|
1943
1945
|
o.style.transition = "none";
|
|
1944
|
-
}, 300)), o.style.transform = `translate(${
|
|
1945
|
-
},
|
|
1946
|
-
const { container: t, map: n, nodes: o } = e, i = n.querySelector("me-root"), s = i.offsetTop, r = i.offsetLeft,
|
|
1947
|
-
let
|
|
1948
|
-
return e.alignment === "root" ? (
|
|
1946
|
+
}, 300)), o.style.transform = `translate(${c}px, ${l}px) scale(${i})`, s.fire("move", { dx: e, dy: t });
|
|
1947
|
+
}, lt = (e) => {
|
|
1948
|
+
const { container: t, map: n, nodes: o } = e, i = n.querySelector("me-root"), s = i.offsetTop, r = i.offsetLeft, c = i.offsetWidth, l = i.offsetHeight;
|
|
1949
|
+
let a, f;
|
|
1950
|
+
return e.alignment === "root" ? (a = t.offsetWidth / 2 - r - c / 2, f = t.offsetHeight / 2 - s - l / 2, n.style.transformOrigin = `${r + c / 2}px 50%`) : (a = (t.offsetWidth - o.offsetWidth) / 2, f = (t.offsetHeight - o.offsetHeight) / 2, n.style.transformOrigin = "50% 50%"), { dx: a, dy: f };
|
|
1949
1951
|
}, Rn = function() {
|
|
1950
|
-
const { map: e } = this, { dx: t, dy: n } =
|
|
1952
|
+
const { map: e } = this, { dx: t, dy: n } = lt(this);
|
|
1951
1953
|
e.style.transform = `translate(${t}px, ${n}px) scale(${this.scaleVal})`;
|
|
1952
1954
|
}, Fn = function(e) {
|
|
1953
1955
|
e(this);
|
|
@@ -1971,18 +1973,18 @@ const _n = function(e) {
|
|
|
1971
1973
|
y: o.top
|
|
1972
1974
|
}, s = e.parentNode, r = s.children[1];
|
|
1973
1975
|
if (r.expanded = n.expanded, r.className = n.expanded ? "minus" : "", J(e), n.expanded) {
|
|
1974
|
-
const
|
|
1975
|
-
n.children.map((
|
|
1976
|
+
const d = this.createChildren(
|
|
1977
|
+
n.children.map((v) => this.createWrapper(v).grp)
|
|
1976
1978
|
);
|
|
1977
|
-
s.parentNode.appendChild(
|
|
1979
|
+
s.parentNode.appendChild(d);
|
|
1978
1980
|
} else
|
|
1979
1981
|
s.parentNode.children[1].remove();
|
|
1980
1982
|
this.linkDiv(e.closest("me-main > me-wrapper"));
|
|
1981
|
-
const
|
|
1982
|
-
x:
|
|
1983
|
-
y:
|
|
1984
|
-
},
|
|
1985
|
-
this.move(
|
|
1983
|
+
const c = e.getBoundingClientRect(), l = {
|
|
1984
|
+
x: c.left,
|
|
1985
|
+
y: c.top
|
|
1986
|
+
}, a = i.x - l.x, f = i.y - l.y;
|
|
1987
|
+
this.move(a, f), this.bus.fire("expandNode", n);
|
|
1986
1988
|
}, Vn = function(e, t) {
|
|
1987
1989
|
const n = e.nodeObj, o = e.getBoundingClientRect(), i = {
|
|
1988
1990
|
x: o.left,
|
|
@@ -1992,8 +1994,8 @@ const _n = function(e) {
|
|
|
1992
1994
|
const s = this.findEle(n.id).getBoundingClientRect(), r = {
|
|
1993
1995
|
x: s.left,
|
|
1994
1996
|
y: s.top
|
|
1995
|
-
},
|
|
1996
|
-
this.move(
|
|
1997
|
+
}, c = i.x - r.x, l = i.y - r.y;
|
|
1998
|
+
this.move(c, l);
|
|
1997
1999
|
}, Un = function(e) {
|
|
1998
2000
|
this.clearSelection(), e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.arrows = e.arrows || [], this.summaries = e.summaries || [], e.theme && this.changeTheme(e.theme)), H(this.nodeData), this.layout(), this.linkDiv();
|
|
1999
2001
|
}, Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -2059,10 +2061,10 @@ const _n = function(e) {
|
|
|
2059
2061
|
}, Ke = {
|
|
2060
2062
|
create: Jn
|
|
2061
2063
|
}, Zn = "#4dc4ff";
|
|
2062
|
-
function at(e, t, n, o, i, s, r,
|
|
2064
|
+
function at(e, t, n, o, i, s, r, c) {
|
|
2063
2065
|
return {
|
|
2064
2066
|
x: e / 8 + n * 3 / 8 + i * 3 / 8 + r / 8,
|
|
2065
|
-
y: t / 8 + o * 3 / 8 + s * 3 / 8 +
|
|
2067
|
+
y: t / 8 + o * 3 / 8 + s * 3 / 8 + c / 8
|
|
2066
2068
|
};
|
|
2067
2069
|
}
|
|
2068
2070
|
function Qn(e, t, n) {
|
|
@@ -2079,35 +2081,44 @@ function Q(e, t, n, o, i) {
|
|
|
2079
2081
|
y2: i + ""
|
|
2080
2082
|
});
|
|
2081
2083
|
}
|
|
2082
|
-
function Ye(e, t, n, o, i, s, r,
|
|
2083
|
-
var
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
p.stroke && e.arrow2.setAttribute("stroke", p.stroke), p.strokeWidth && e.arrow2.setAttribute("stroke-width", String(p.strokeWidth)), p.strokeLinecap && e.arrow2.setAttribute("stroke-linecap", p.strokeLinecap), p.opacity !== void 0 && e.arrow2.setAttribute("opacity", String(p.opacity));
|
|
2084
|
+
function Ye(e, t, n, o, i, s, r, c, l, a) {
|
|
2085
|
+
var p;
|
|
2086
|
+
const f = `M ${t} ${n} C ${o} ${i} ${s} ${r} ${c} ${l}`;
|
|
2087
|
+
if (e.line.setAttribute("d", f), a.style) {
|
|
2088
|
+
const g = a.style;
|
|
2089
|
+
g.stroke && e.line.setAttribute("stroke", g.stroke), g.strokeWidth && e.line.setAttribute("stroke-width", String(g.strokeWidth)), g.strokeDasharray && e.line.setAttribute("stroke-dasharray", g.strokeDasharray), g.strokeLinecap && e.line.setAttribute("stroke-linecap", g.strokeLinecap), g.opacity !== void 0 && e.line.setAttribute("opacity", String(g.opacity));
|
|
2090
|
+
}
|
|
2091
|
+
const d = e.querySelectorAll('path[stroke="transparent"]');
|
|
2092
|
+
d.length > 0 && d[0].setAttribute("d", f);
|
|
2093
|
+
const v = oe(s, r, c, l);
|
|
2094
|
+
if (v) {
|
|
2095
|
+
const g = `M ${v.x1} ${v.y1} L ${c} ${l} L ${v.x2} ${v.y2}`;
|
|
2096
|
+
if (e.arrow1.setAttribute("d", g), d.length > 1 && d[1].setAttribute("d", g), a.style) {
|
|
2097
|
+
const m = a.style;
|
|
2098
|
+
m.stroke && e.arrow1.setAttribute("stroke", m.stroke), m.strokeWidth && e.arrow1.setAttribute("stroke-width", String(m.strokeWidth)), m.strokeLinecap && e.arrow1.setAttribute("stroke-linecap", m.strokeLinecap), m.opacity !== void 0 && e.arrow1.setAttribute("opacity", String(m.opacity));
|
|
2098
2099
|
}
|
|
2099
2100
|
}
|
|
2100
|
-
|
|
2101
|
-
|
|
2101
|
+
if (a.bidirectional) {
|
|
2102
|
+
const g = oe(o, i, t, n);
|
|
2103
|
+
if (g) {
|
|
2104
|
+
const m = `M ${g.x1} ${g.y1} L ${t} ${n} L ${g.x2} ${g.y2}`;
|
|
2105
|
+
if (e.arrow2.setAttribute("d", m), d.length > 2 && d[2].setAttribute("d", m), a.style) {
|
|
2106
|
+
const b = a.style;
|
|
2107
|
+
b.stroke && e.arrow2.setAttribute("stroke", b.stroke), b.strokeWidth && e.arrow2.setAttribute("stroke-width", String(b.strokeWidth)), b.strokeLinecap && e.arrow2.setAttribute("stroke-linecap", b.strokeLinecap), b.opacity !== void 0 && e.arrow2.setAttribute("opacity", String(b.opacity));
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
const { x: u, y: h } = at(t, n, o, i, s, r, c, l);
|
|
2112
|
+
Qn(e.label, u, h), (p = a.style) != null && p.labelColor && e.label.setAttribute("fill", a.style.labelColor), co(e);
|
|
2102
2113
|
}
|
|
2103
2114
|
function re(e, t, n) {
|
|
2104
|
-
const { offsetLeft: o, offsetTop: i } = B(e.nodes, t), s = t.offsetWidth, r = t.offsetHeight,
|
|
2115
|
+
const { offsetLeft: o, offsetTop: i } = B(e.nodes, t), s = t.offsetWidth, r = t.offsetHeight, c = o + s / 2, l = i + r / 2, a = c + n.x, f = l + n.y;
|
|
2105
2116
|
return {
|
|
2106
2117
|
w: s,
|
|
2107
2118
|
h: r,
|
|
2108
|
-
cx:
|
|
2109
|
-
cy:
|
|
2110
|
-
ctrlX:
|
|
2119
|
+
cx: c,
|
|
2120
|
+
cy: l,
|
|
2121
|
+
ctrlX: a,
|
|
2111
2122
|
ctrlY: f
|
|
2112
2123
|
};
|
|
2113
2124
|
}
|
|
@@ -2123,18 +2134,18 @@ const Ne = function(e, t, n, o, i) {
|
|
|
2123
2134
|
var y;
|
|
2124
2135
|
if (!t || !n)
|
|
2125
2136
|
return;
|
|
2126
|
-
const s = re(e, t, o.delta1), r = re(e, n, o.delta2), { x:
|
|
2137
|
+
const s = re(e, t, o.delta1), r = re(e, n, o.delta2), { x: c, y: l } = G(s), { ctrlX: a, ctrlY: f } = s, { ctrlX: d, ctrlY: v } = r, { x: u, y: h } = G(r), p = oe(d, v, u, h);
|
|
2127
2138
|
if (!p)
|
|
2128
2139
|
return;
|
|
2129
|
-
const
|
|
2130
|
-
let
|
|
2140
|
+
const g = `M ${p.x1} ${p.y1} L ${u} ${h} L ${p.x2} ${p.y2}`;
|
|
2141
|
+
let m = "";
|
|
2131
2142
|
if (o.bidirectional) {
|
|
2132
|
-
const E = oe(
|
|
2143
|
+
const E = oe(a, f, c, l);
|
|
2133
2144
|
if (!E)
|
|
2134
2145
|
return;
|
|
2135
|
-
|
|
2146
|
+
m = `M ${E.x1} ${E.y1} L ${c} ${l} L ${E.x2} ${E.y2}`;
|
|
2136
2147
|
}
|
|
2137
|
-
const b = Mt(`M ${
|
|
2148
|
+
const b = Mt(`M ${c} ${l} C ${a} ${f} ${d} ${v} ${u} ${h}`, g, m, o.style), { x: w, y: C } = at(c, l, a, f, d, v, u, h), k = (y = o.style) == null ? void 0 : y.labelColor, x = ue(o.label, w, C, {
|
|
2138
2149
|
anchor: "middle",
|
|
2139
2150
|
color: k,
|
|
2140
2151
|
dataType: "custom-link"
|
|
@@ -2161,7 +2172,7 @@ const Ne = function(e, t, n, o, i) {
|
|
|
2161
2172
|
obj: o
|
|
2162
2173
|
});
|
|
2163
2174
|
}, to = function(e) {
|
|
2164
|
-
|
|
2175
|
+
le(this);
|
|
2165
2176
|
const t = { ...e, id: K() };
|
|
2166
2177
|
Ne(this, this.findEle(t.from), this.findEle(t.to), t), this.bus.fire("operation", {
|
|
2167
2178
|
name: "createArrow",
|
|
@@ -2171,7 +2182,7 @@ const Ne = function(e, t, n, o, i) {
|
|
|
2171
2182
|
let t;
|
|
2172
2183
|
if (e ? t = e : t = this.currentArrow, !t)
|
|
2173
2184
|
return;
|
|
2174
|
-
|
|
2185
|
+
le(this);
|
|
2175
2186
|
const n = t.arrowObj.id;
|
|
2176
2187
|
this.arrows = this.arrows.filter((o) => o.id !== n), t.remove(), this.bus.fire("operation", {
|
|
2177
2188
|
name: "removeArrow",
|
|
@@ -2184,7 +2195,7 @@ const Ne = function(e, t, n, o, i) {
|
|
|
2184
2195
|
const t = e.arrowObj, n = this.findEle(t.from), o = this.findEle(t.to), i = re(this, n, t.delta1), s = re(this, o, t.delta2);
|
|
2185
2196
|
dt(this, t, i, s);
|
|
2186
2197
|
}, io = function() {
|
|
2187
|
-
|
|
2198
|
+
le(this), this.currentArrow = null;
|
|
2188
2199
|
}, ae = function(e, t) {
|
|
2189
2200
|
const n = document.createElementNS(L, "path");
|
|
2190
2201
|
return N(n, {
|
|
@@ -2209,32 +2220,32 @@ const Ne = function(e, t, n, o, i) {
|
|
|
2209
2220
|
}, ro = function(e) {
|
|
2210
2221
|
const t = e.querySelector(".arrow-highlight");
|
|
2211
2222
|
t && t.remove();
|
|
2212
|
-
},
|
|
2223
|
+
}, co = function(e) {
|
|
2213
2224
|
const t = e.querySelector(".arrow-highlight");
|
|
2214
2225
|
if (!t)
|
|
2215
2226
|
return;
|
|
2216
2227
|
const n = t.querySelectorAll("path");
|
|
2217
2228
|
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"));
|
|
2218
|
-
},
|
|
2229
|
+
}, le = function(e) {
|
|
2219
2230
|
var t, n;
|
|
2220
2231
|
(t = e.helper1) == null || t.destroy(), (n = e.helper2) == null || n.destroy(), e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none", e.currentArrow && ro(e.currentArrow);
|
|
2221
2232
|
}, dt = function(e, t, n, o) {
|
|
2222
|
-
const { linkController: i, P2: s, P3: r, line1:
|
|
2223
|
-
if (!
|
|
2233
|
+
const { linkController: i, P2: s, P3: r, line1: c, line2: l, nodes: a, map: f, currentArrow: d, bus: v } = e;
|
|
2234
|
+
if (!d)
|
|
2224
2235
|
return;
|
|
2225
|
-
i.style.display = "initial", s.style.display = "initial", r.style.display = "initial",
|
|
2226
|
-
let { x: u, y:
|
|
2227
|
-
s.style.cssText = `top:${
|
|
2228
|
-
p = p + k / e.scaleVal,
|
|
2229
|
-
const y = G({ ...n, ctrlX: p, ctrlY:
|
|
2230
|
-
u = y.x,
|
|
2236
|
+
i.style.display = "initial", s.style.display = "initial", r.style.display = "initial", a.appendChild(i), a.appendChild(s), a.appendChild(r), so(d, Zn);
|
|
2237
|
+
let { x: u, y: h } = G(n), { ctrlX: p, ctrlY: g } = n, { ctrlX: m, ctrlY: b } = o, { x: w, y: C } = G(o);
|
|
2238
|
+
s.style.cssText = `top:${g}px;left:${p}px;`, r.style.cssText = `top:${b}px;left:${m}px;`, Q(c, u, h, p, g), Q(l, m, b, w, C), e.helper1 = Ke.create(s), e.helper2 = Ke.create(r), e.helper1.init(f, (k, x) => {
|
|
2239
|
+
p = p + k / e.scaleVal, g = g + x / e.scaleVal;
|
|
2240
|
+
const y = G({ ...n, ctrlX: p, ctrlY: g });
|
|
2241
|
+
u = y.x, h = y.y, s.style.top = g + "px", s.style.left = p + "px", Ye(d, u, h, p, g, m, b, w, C, t), Q(c, u, h, p, g), t.delta1.x = p - n.cx, t.delta1.y = g - n.cy, v.fire("updateArrowDelta", t);
|
|
2231
2242
|
}), e.helper2.init(f, (k, x) => {
|
|
2232
|
-
|
|
2233
|
-
const y = G({ ...o, ctrlX:
|
|
2234
|
-
w = y.x, C = y.y, r.style.top = b + "px", r.style.left =
|
|
2243
|
+
m = m + k / e.scaleVal, b = b + x / e.scaleVal;
|
|
2244
|
+
const y = G({ ...o, ctrlX: m, ctrlY: b });
|
|
2245
|
+
w = y.x, C = y.y, r.style.top = b + "px", r.style.left = m + "px", Ye(d, u, h, p, g, m, b, w, C, t), Q(l, m, b, w, C), t.delta2.x = m - o.cx, t.delta2.y = b - o.cy, v.fire("updateArrowDelta", t);
|
|
2235
2246
|
});
|
|
2236
2247
|
};
|
|
2237
|
-
function
|
|
2248
|
+
function lo() {
|
|
2238
2249
|
this.linkSvgGroup.innerHTML = "";
|
|
2239
2250
|
for (let e = 0; e < this.arrows.length; e++) {
|
|
2240
2251
|
const t = this.arrows[e];
|
|
@@ -2246,7 +2257,7 @@ function co() {
|
|
|
2246
2257
|
this.nodes.appendChild(this.linkSvgGroup);
|
|
2247
2258
|
}
|
|
2248
2259
|
function ao(e) {
|
|
2249
|
-
if (
|
|
2260
|
+
if (le(this), !e)
|
|
2250
2261
|
return;
|
|
2251
2262
|
const t = e.label;
|
|
2252
2263
|
Ze(this, t, e.arrowObj);
|
|
@@ -2260,50 +2271,50 @@ const uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2260
2271
|
createArrowFrom: to,
|
|
2261
2272
|
editArrowLabel: ao,
|
|
2262
2273
|
removeArrow: no,
|
|
2263
|
-
renderArrow:
|
|
2274
|
+
renderArrow: lo,
|
|
2264
2275
|
selectArrow: oo,
|
|
2265
2276
|
tidyArrow: ho,
|
|
2266
2277
|
unselectArrow: io
|
|
2267
2278
|
}, Symbol.toStringTag, { value: "Module" })), fo = function(e) {
|
|
2268
|
-
var
|
|
2279
|
+
var l, a;
|
|
2269
2280
|
if (e.length === 0)
|
|
2270
2281
|
throw new Error("No selected node.");
|
|
2271
2282
|
if (e.length === 1) {
|
|
2272
|
-
const f = e[0].nodeObj,
|
|
2273
|
-
if (!
|
|
2283
|
+
const f = e[0].nodeObj, d = e[0].nodeObj.parent;
|
|
2284
|
+
if (!d)
|
|
2274
2285
|
throw new Error("Can not select root node.");
|
|
2275
|
-
const
|
|
2286
|
+
const v = d.children.findIndex((u) => f === u);
|
|
2276
2287
|
return {
|
|
2277
|
-
parent:
|
|
2278
|
-
start:
|
|
2279
|
-
end:
|
|
2288
|
+
parent: d.id,
|
|
2289
|
+
start: v,
|
|
2290
|
+
end: v
|
|
2280
2291
|
};
|
|
2281
2292
|
}
|
|
2282
2293
|
let t = 0;
|
|
2283
2294
|
const n = e.map((f) => {
|
|
2284
|
-
let
|
|
2285
|
-
const
|
|
2286
|
-
for (;
|
|
2287
|
-
const u =
|
|
2288
|
-
|
|
2295
|
+
let d = f.nodeObj;
|
|
2296
|
+
const v = [];
|
|
2297
|
+
for (; d.parent; ) {
|
|
2298
|
+
const u = d.parent, h = u.children, p = h == null ? void 0 : h.indexOf(d);
|
|
2299
|
+
d = u, v.unshift({ node: d, index: p });
|
|
2289
2300
|
}
|
|
2290
|
-
return
|
|
2301
|
+
return v.length > t && (t = v.length), v;
|
|
2291
2302
|
});
|
|
2292
2303
|
let o = 0;
|
|
2293
2304
|
e:
|
|
2294
2305
|
for (; o < t; o++) {
|
|
2295
|
-
const f = (
|
|
2296
|
-
for (let
|
|
2297
|
-
if (((
|
|
2306
|
+
const f = (l = n[0][o]) == null ? void 0 : l.node;
|
|
2307
|
+
for (let d = 1; d < n.length; d++)
|
|
2308
|
+
if (((a = n[d][o]) == null ? void 0 : a.node) !== f)
|
|
2298
2309
|
break e;
|
|
2299
2310
|
}
|
|
2300
2311
|
if (!o)
|
|
2301
2312
|
throw new Error("Can not select root node.");
|
|
2302
|
-
const i = n.map((f) => f[o - 1].index).sort(), s = i[0] || 0, r = i[i.length - 1] || 0,
|
|
2303
|
-
if (!
|
|
2313
|
+
const i = n.map((f) => f[o - 1].index).sort(), s = i[0] || 0, r = i[i.length - 1] || 0, c = n[0][o - 1].node;
|
|
2314
|
+
if (!c.parent)
|
|
2304
2315
|
throw new Error("Please select nodes in the same main topic.");
|
|
2305
2316
|
return {
|
|
2306
|
-
parent:
|
|
2317
|
+
parent: c.id,
|
|
2307
2318
|
start: s,
|
|
2308
2319
|
end: r
|
|
2309
2320
|
};
|
|
@@ -2325,25 +2336,25 @@ const uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2325
2336
|
return i.parent ? s = o.closest("me-main").className : s = e.findEle(i.children[n].id).closest("me-main").className, s;
|
|
2326
2337
|
}, ke = function(e, t) {
|
|
2327
2338
|
var E;
|
|
2328
|
-
const { id: n, label: o, parent: i, start: s, end: r } = t, { nodes:
|
|
2329
|
-
let u = 1 / 0,
|
|
2339
|
+
const { id: n, label: o, parent: i, start: s, end: r } = t, { nodes: c, theme: l, summarySvg: a } = e, d = e.findEle(i).nodeObj, v = mo(e, t);
|
|
2340
|
+
let u = 1 / 0, h = 0, p = 0, g = 0;
|
|
2330
2341
|
for (let S = s; S <= r; S++) {
|
|
2331
|
-
const D = (E =
|
|
2342
|
+
const D = (E = d.children) == null ? void 0 : E[S];
|
|
2332
2343
|
if (!D)
|
|
2333
2344
|
return e.removeSummary(n), null;
|
|
2334
|
-
const P = go(e.findEle(D.id)), { offsetLeft: R, offsetTop: _e } = B(
|
|
2335
|
-
S === s && (p = _e + Te), S === r && (
|
|
2345
|
+
const P = go(e.findEle(D.id)), { offsetLeft: R, offsetTop: _e } = B(c, P), Te = s === r ? 10 : 20;
|
|
2346
|
+
S === s && (p = _e + Te), S === r && (g = _e + P.offsetHeight - Te), R < u && (u = R), P.offsetWidth + R > h && (h = P.offsetWidth + R);
|
|
2336
2347
|
}
|
|
2337
|
-
let
|
|
2338
|
-
const w = p + 10, C =
|
|
2339
|
-
|
|
2348
|
+
let m, b;
|
|
2349
|
+
const w = p + 10, C = g + 10, k = (w + C) / 2, x = l.cssVar["--color"];
|
|
2350
|
+
v === M.LHS ? (m = Ge(`M ${u + 10} ${w} c -5 0 -10 5 -10 10 L ${u} ${C - 10} c 0 5 5 10 10 10 M ${u} ${k} h -10`, x), b = ue(o, u - 20, k + 6, { anchor: "end", color: x })) : (m = Ge(`M ${h - 10} ${w} c 5 0 10 5 10 10 L ${h} ${C - 10} c 0 5 -5 10 -10 10 M ${h} ${k} h 10`, x), b = ue(o, h + 20, k + 6, { anchor: "start", color: x }));
|
|
2340
2351
|
const y = po("s-" + n);
|
|
2341
|
-
return y.appendChild(
|
|
2352
|
+
return y.appendChild(m), y.appendChild(b), y.summaryObj = t, a.appendChild(y), y;
|
|
2342
2353
|
}, vo = function() {
|
|
2343
2354
|
if (!this.currentNodes)
|
|
2344
2355
|
return;
|
|
2345
|
-
const { currentNodes: e, summaries: t, bus: n } = this, { parent: o, start: i, end: s } = fo(e), r = { id: K(), parent: o, start: i, end: s, label: "summary" },
|
|
2346
|
-
t.push(r), this.editSummary(
|
|
2356
|
+
const { currentNodes: e, summaries: t, bus: n } = this, { parent: o, start: i, end: s } = fo(e), r = { id: K(), parent: o, start: i, end: s, label: "summary" }, c = ke(this, r);
|
|
2357
|
+
t.push(r), this.editSummary(c), n.fire("operation", {
|
|
2347
2358
|
name: "createSummary",
|
|
2348
2359
|
obj: r
|
|
2349
2360
|
});
|
|
@@ -2413,23 +2424,23 @@ function _o(e, t, n, o) {
|
|
|
2413
2424
|
const i = document.createElementNS(T, "g");
|
|
2414
2425
|
let s = "";
|
|
2415
2426
|
return e.text ? s = e.text.textContent : s = e.childNodes[0].textContent, s.split(`
|
|
2416
|
-
`).forEach((
|
|
2417
|
-
const
|
|
2418
|
-
N(
|
|
2427
|
+
`).forEach((c, l) => {
|
|
2428
|
+
const a = document.createElementNS(T, "text");
|
|
2429
|
+
N(a, {
|
|
2419
2430
|
x: n + parseInt(t.paddingLeft) + "",
|
|
2420
|
-
y: o + parseInt(t.paddingTop) + ko(t.lineHeight, t.fontSize) * (
|
|
2431
|
+
y: o + parseInt(t.paddingTop) + ko(t.lineHeight, t.fontSize) * (l + 1) + parseFloat(t.fontSize) * (l + 1) + "",
|
|
2421
2432
|
"text-anchor": "start",
|
|
2422
2433
|
"font-family": t.fontFamily,
|
|
2423
2434
|
"font-size": `${t.fontSize}`,
|
|
2424
2435
|
"font-weight": `${t.fontWeight}`,
|
|
2425
2436
|
fill: `${t.color}`
|
|
2426
|
-
}),
|
|
2437
|
+
}), a.innerHTML = c, i.appendChild(a);
|
|
2427
2438
|
}), i;
|
|
2428
2439
|
}
|
|
2429
2440
|
function To(e, t, n, o) {
|
|
2430
|
-
var
|
|
2441
|
+
var c;
|
|
2431
2442
|
let i = "";
|
|
2432
|
-
(
|
|
2443
|
+
(c = e.nodeObj) != null && c.dangerouslySetInnerHTML ? i = e.nodeObj.dangerouslySetInnerHTML : e.text ? i = e.text.textContent : i = e.childNodes[0].textContent;
|
|
2433
2444
|
const s = document.createElementNS(T, "foreignObject");
|
|
2434
2445
|
N(s, {
|
|
2435
2446
|
x: n + parseInt(t.paddingLeft) + "",
|
|
@@ -2470,10 +2481,10 @@ function ee(e, t, n = !1) {
|
|
|
2470
2481
|
stroke: o.borderColor,
|
|
2471
2482
|
"stroke-width": o.borderWidth
|
|
2472
2483
|
});
|
|
2473
|
-
const
|
|
2474
|
-
|
|
2475
|
-
let
|
|
2476
|
-
return n ?
|
|
2484
|
+
const c = document.createElementNS(T, "g");
|
|
2485
|
+
c.appendChild(r);
|
|
2486
|
+
let l;
|
|
2487
|
+
return n ? l = To(t, o, i, s) : l = _o(t, o, i, s), c.appendChild(l), c;
|
|
2477
2488
|
}
|
|
2478
2489
|
function Ao(e, t) {
|
|
2479
2490
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: i } = B(e.nodes, t), s = document.createElementNS(T, "a"), r = document.createElementNS(T, "text");
|
|
@@ -2498,33 +2509,33 @@ function Mo(e, t) {
|
|
|
2498
2509
|
}), s;
|
|
2499
2510
|
}
|
|
2500
2511
|
const te = 100, Do = '<?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">', Po = (e, t = !1) => {
|
|
2501
|
-
var
|
|
2502
|
-
const n = e.nodes, o = n.offsetHeight + te * 2, i = n.offsetWidth + te * 2, s = No(o + "px", i + "px"), r = document.createElementNS(T, "svg"),
|
|
2503
|
-
N(
|
|
2512
|
+
var d, v, u;
|
|
2513
|
+
const n = e.nodes, o = n.offsetHeight + te * 2, i = n.offsetWidth + te * 2, s = No(o + "px", i + "px"), r = document.createElementNS(T, "svg"), c = document.createElementNS(T, "rect");
|
|
2514
|
+
N(c, {
|
|
2504
2515
|
x: "0",
|
|
2505
2516
|
y: "0",
|
|
2506
2517
|
width: `${i}`,
|
|
2507
2518
|
height: `${o}`,
|
|
2508
2519
|
fill: e.theme.cssVar["--bgcolor"]
|
|
2509
|
-
}), s.appendChild(
|
|
2510
|
-
const p =
|
|
2511
|
-
p.setAttribute("x", `${
|
|
2520
|
+
}), s.appendChild(c), n.querySelectorAll(".subLines").forEach((h) => {
|
|
2521
|
+
const p = h.cloneNode(!0), { offsetLeft: g, offsetTop: m } = B(n, h.parentElement);
|
|
2522
|
+
p.setAttribute("x", `${g}`), p.setAttribute("y", `${m}`), r.appendChild(p);
|
|
2512
2523
|
});
|
|
2513
|
-
const
|
|
2514
|
-
|
|
2515
|
-
const
|
|
2516
|
-
|
|
2524
|
+
const l = (d = n.querySelector(".lines")) == null ? void 0 : d.cloneNode(!0);
|
|
2525
|
+
l && r.appendChild(l);
|
|
2526
|
+
const a = (v = n.querySelector(".topiclinks")) == null ? void 0 : v.cloneNode(!0);
|
|
2527
|
+
a && r.appendChild(a);
|
|
2517
2528
|
const f = (u = n.querySelector(".summary")) == null ? void 0 : u.cloneNode(!0);
|
|
2518
|
-
return f && r.appendChild(f), n.querySelectorAll("me-tpc").forEach((
|
|
2519
|
-
|
|
2520
|
-
}), n.querySelectorAll(".tags > span").forEach((
|
|
2521
|
-
r.appendChild(ee(e,
|
|
2522
|
-
}), n.querySelectorAll(".icons > span").forEach((
|
|
2523
|
-
r.appendChild(ee(e,
|
|
2524
|
-
}), n.querySelectorAll(".hyper-link").forEach((
|
|
2525
|
-
r.appendChild(Ao(e,
|
|
2526
|
-
}), n.querySelectorAll("img").forEach((
|
|
2527
|
-
r.appendChild(Mo(e,
|
|
2529
|
+
return f && r.appendChild(f), n.querySelectorAll("me-tpc").forEach((h) => {
|
|
2530
|
+
h.nodeObj.dangerouslySetInnerHTML ? r.appendChild(ee(e, h, !t)) : (r.appendChild(Lo(e, h)), r.appendChild(ee(e, h.text, !t)));
|
|
2531
|
+
}), n.querySelectorAll(".tags > span").forEach((h) => {
|
|
2532
|
+
r.appendChild(ee(e, h));
|
|
2533
|
+
}), n.querySelectorAll(".icons > span").forEach((h) => {
|
|
2534
|
+
r.appendChild(ee(e, h));
|
|
2535
|
+
}), n.querySelectorAll(".hyper-link").forEach((h) => {
|
|
2536
|
+
r.appendChild(Ao(e, h));
|
|
2537
|
+
}), n.querySelectorAll("img").forEach((h) => {
|
|
2538
|
+
r.appendChild(Mo(e, h));
|
|
2528
2539
|
}), N(r, {
|
|
2529
2540
|
x: te + "",
|
|
2530
2541
|
y: te + "",
|
|
@@ -2549,8 +2560,8 @@ const jo = function(e = !1, t) {
|
|
|
2549
2560
|
return new Promise((i, s) => {
|
|
2550
2561
|
const r = new Image();
|
|
2551
2562
|
r.setAttribute("crossOrigin", "anonymous"), r.onload = () => {
|
|
2552
|
-
const
|
|
2553
|
-
|
|
2563
|
+
const c = document.createElement("canvas");
|
|
2564
|
+
c.width = r.width, c.height = r.height, c.getContext("2d").drawImage(r, 0, 0), c.toBlob(i, "image/png", 1);
|
|
2554
2565
|
}, r.src = o, r.onerror = s;
|
|
2555
2566
|
});
|
|
2556
2567
|
}, Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -2564,10 +2575,10 @@ function Ro(e, t) {
|
|
|
2564
2575
|
o && !await o.apply(this, n) || e.apply(this, n);
|
|
2565
2576
|
};
|
|
2566
2577
|
}
|
|
2567
|
-
const qe = Object.keys(
|
|
2578
|
+
const qe = Object.keys(ct), ht = {};
|
|
2568
2579
|
for (let e = 0; e < qe.length; e++) {
|
|
2569
2580
|
const t = qe[e];
|
|
2570
|
-
ht[t] = Ro(
|
|
2581
|
+
ht[t] = Ro(ct[t], t);
|
|
2571
2582
|
}
|
|
2572
2583
|
const Fo = {
|
|
2573
2584
|
getObjById: ne,
|
|
@@ -2596,24 +2607,24 @@ const Fo = {
|
|
|
2596
2607
|
this.disposable.forEach((t) => t()), 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.waitCopy = void 0, this.theme = void 0, this.direction = void 0, this.bus = void 0, this.container = void 0, this.map = void 0, this.lines = void 0, this.linkController = void 0, this.linkSvgGroup = void 0, this.P2 = void 0, this.P3 = void 0, this.line1 = void 0, this.line2 = void 0, this.nodes = void 0, (e = this.selection) == null || e.destroy(), this.selection = void 0;
|
|
2597
2608
|
}
|
|
2598
2609
|
};
|
|
2599
|
-
function Wo({ pT: e, pL: t, pW: n, pH: o, cT: i, cL: s, cW: r, cH:
|
|
2610
|
+
function Wo({ pT: e, pL: t, pW: n, pH: o, cT: i, cL: s, cW: r, cH: c, direction: l, containerHeight: a }) {
|
|
2600
2611
|
let f = t + n / 2;
|
|
2601
|
-
const
|
|
2602
|
-
let
|
|
2603
|
-
|
|
2604
|
-
const u = i +
|
|
2605
|
-
return
|
|
2612
|
+
const d = e + o / 2;
|
|
2613
|
+
let v;
|
|
2614
|
+
l === M.LHS ? v = s + r : v = s;
|
|
2615
|
+
const u = i + c / 2, p = (1 - Math.abs(u - d) / a) * 0.25 * (n / 2);
|
|
2616
|
+
return l === M.LHS ? f = f - n / 10 - p : f = f + n / 10 + p, `M ${f} ${d} Q ${f} ${u} ${v} ${u}`;
|
|
2606
2617
|
}
|
|
2607
|
-
function Io({ pT: e, pL: t, pW: n, pH: o, cT: i, cL: s, cW: r, cH:
|
|
2618
|
+
function Io({ pT: e, pL: t, pW: n, pH: o, cT: i, cL: s, cW: r, cH: c, direction: l, isFirst: a }) {
|
|
2608
2619
|
const f = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
|
|
2609
|
-
let
|
|
2610
|
-
|
|
2611
|
-
const u = i +
|
|
2612
|
-
let
|
|
2613
|
-
const
|
|
2614
|
-
return
|
|
2620
|
+
let d = 0, v = 0;
|
|
2621
|
+
a ? d = e + o / 2 : d = e + o;
|
|
2622
|
+
const u = i + c;
|
|
2623
|
+
let h = 0, p = 0, g = 0;
|
|
2624
|
+
const m = Math.abs(d - u) / 300 * f;
|
|
2625
|
+
return l === M.LHS ? (g = t, h = g + f, p = g - f, v = s + f, `M ${h} ${d} C ${g} ${d} ${g + m} ${u} ${p} ${u} H ${v}`) : (g = t + n, h = g - f, p = g + f, v = s + r - f, `M ${h} ${d} C ${g} ${d} ${g - m} ${u} ${p} ${u} H ${v}`);
|
|
2615
2626
|
}
|
|
2616
|
-
const Ko = "5.1.
|
|
2627
|
+
const Ko = "5.1.1";
|
|
2617
2628
|
function Yo(e) {
|
|
2618
2629
|
return {
|
|
2619
2630
|
x: 0,
|
|
@@ -2638,17 +2649,17 @@ function $({
|
|
|
2638
2649
|
editable: i,
|
|
2639
2650
|
contextMenu: s,
|
|
2640
2651
|
toolBar: r,
|
|
2641
|
-
keypress:
|
|
2642
|
-
mouseSelectionButton:
|
|
2643
|
-
selectionContainer:
|
|
2652
|
+
keypress: c,
|
|
2653
|
+
mouseSelectionButton: l,
|
|
2654
|
+
selectionContainer: a,
|
|
2644
2655
|
before: f,
|
|
2645
|
-
newTopicName:
|
|
2646
|
-
allowUndo:
|
|
2656
|
+
newTopicName: d,
|
|
2657
|
+
allowUndo: v,
|
|
2647
2658
|
generateMainBranch: u,
|
|
2648
|
-
generateSubBranch:
|
|
2659
|
+
generateSubBranch: h,
|
|
2649
2660
|
overflowHidden: p,
|
|
2650
|
-
theme:
|
|
2651
|
-
alignment:
|
|
2661
|
+
theme: g,
|
|
2662
|
+
alignment: m,
|
|
2652
2663
|
scaleSensitivity: b,
|
|
2653
2664
|
scaleMax: w,
|
|
2654
2665
|
scaleMin: C,
|
|
@@ -2660,9 +2671,9 @@ function $({
|
|
|
2660
2671
|
const S = Object.prototype.toString.call(e);
|
|
2661
2672
|
if (S === "[object HTMLDivElement]" ? E = e : S === "[object String]" && (E = document.querySelector(e)), !E)
|
|
2662
2673
|
throw new Error("MindElixir: el is not a valid element");
|
|
2663
|
-
E.style.position = "relative", E.innerHTML = "", this.el = E, this.disposable = [], this.before = f || {}, this.locale = n || "en", this.newTopicName =
|
|
2674
|
+
E.style.position = "relative", E.innerHTML = "", this.el = E, this.disposable = [], this.before = f || {}, this.locale = n || "en", this.newTopicName = d || "New Node", this.contextMenu = s ?? !0, this.toolBar = r ?? !0, this.keypress = c ?? !0, this.mouseSelectionButton = l ?? 0, this.direction = t ?? 1, this.draggable = o ?? !0, this.editable = i ?? !0, this.allowUndo = v ?? !0, this.scaleSensitivity = b ?? 0.1, this.scaleMax = w ?? 1.4, this.scaleMin = C ?? 0.2, this.generateMainBranch = u || Wo, this.generateSubBranch = h || Io, this.overflowHidden = p ?? !1, this.alignment = m ?? "root", this.handleWheel = k ?? !0, this.markdown = x || void 0, this.imageProxy = y || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = Yo(this), this.bus = Et(), this.container = U.createElement("div"), this.selectionContainer = a || this.container, this.container.className = "map-container";
|
|
2664
2675
|
const D = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2665
|
-
this.theme =
|
|
2676
|
+
this.theme = g || (D.matches ? ve : me);
|
|
2666
2677
|
const P = U.createElement("div");
|
|
2667
2678
|
P.className = "map-canvas", this.map = P, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = U.createElement("me-nodes"), this.lines = X("lines"), this.summarySvg = X("summary"), this.linkController = X("linkcontroller"), this.P2 = U.createElement("div"), this.P3 = U.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = De(), this.line2 = De(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = X("topiclinks"), this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(xt(this));
|
|
2668
2679
|
}
|