mind-elixir 5.0.5 → 5.0.6
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 +369 -355
- package/dist/MindElixirLite.iife.js +7 -7
- package/dist/MindElixirLite.js +308 -294
- package/dist/types/index.d.ts +1 -1
- package/dist/types/interact.d.ts +1 -1
- package/dist/types/methods.d.ts +1 -1
- package/package.json +1 -1
package/dist/MindElixirLite.js
CHANGED
|
@@ -52,12 +52,12 @@ const Q = {
|
|
|
52
52
|
function rt(t) {
|
|
53
53
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
54
54
|
}
|
|
55
|
-
const
|
|
55
|
+
const j = function(t, e) {
|
|
56
56
|
if (e.id === t)
|
|
57
57
|
return e;
|
|
58
58
|
if (e.children && e.children.length) {
|
|
59
59
|
for (let n = 0; n < e.children.length; n++) {
|
|
60
|
-
const o =
|
|
60
|
+
const o = j(t, e.children[n]);
|
|
61
61
|
if (o)
|
|
62
62
|
return o;
|
|
63
63
|
}
|
|
@@ -80,25 +80,25 @@ const Y = function(t, e) {
|
|
|
80
80
|
K(o, !1);
|
|
81
81
|
});
|
|
82
82
|
};
|
|
83
|
-
function
|
|
84
|
-
const i = o - e,
|
|
85
|
-
let
|
|
86
|
-
if (isNaN(
|
|
83
|
+
function z(t, e, n, o) {
|
|
84
|
+
const i = o - e, s = t - n;
|
|
85
|
+
let r = Math.atan(Math.abs(i) / Math.abs(s)) / 3.14 * 180;
|
|
86
|
+
if (isNaN(r))
|
|
87
87
|
return;
|
|
88
|
-
|
|
89
|
-
const l = 12,
|
|
88
|
+
s < 0 && i > 0 && (r = 180 - r), s < 0 && i < 0 && (r = 180 + r), s > 0 && i < 0 && (r = 360 - r);
|
|
89
|
+
const l = 12, h = 30, f = r + h, p = r - h;
|
|
90
90
|
return {
|
|
91
|
-
x1: n + Math.cos(Math.PI *
|
|
92
|
-
y1: o - Math.sin(Math.PI *
|
|
91
|
+
x1: n + Math.cos(Math.PI * f / 180) * l,
|
|
92
|
+
y1: o - Math.sin(Math.PI * f / 180) * l,
|
|
93
93
|
x2: n + Math.cos(Math.PI * p / 180) * l,
|
|
94
94
|
y2: o - Math.sin(Math.PI * p / 180) * l
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function G() {
|
|
98
98
|
return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16);
|
|
99
99
|
}
|
|
100
100
|
const Et = function() {
|
|
101
|
-
const t =
|
|
101
|
+
const t = G();
|
|
102
102
|
return {
|
|
103
103
|
topic: this.newTopicName,
|
|
104
104
|
id: t
|
|
@@ -121,8 +121,8 @@ const Et = function() {
|
|
|
121
121
|
}
|
|
122
122
|
return function() {
|
|
123
123
|
for (let n = 0; n < t.length; n++) {
|
|
124
|
-
const { dom: o, evt: i, func:
|
|
125
|
-
o.removeEventListener(i,
|
|
124
|
+
const { dom: o, evt: i, func: s } = t[n];
|
|
125
|
+
o.removeEventListener(i, s);
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
};
|
|
@@ -139,14 +139,14 @@ const lt = function(t, e, n) {
|
|
|
139
139
|
};
|
|
140
140
|
function Tt(t) {
|
|
141
141
|
const { dragMoveHelper: e } = t, n = (a) => {
|
|
142
|
-
var m,
|
|
142
|
+
var m, x, w;
|
|
143
143
|
if (a.button !== 0)
|
|
144
144
|
return;
|
|
145
145
|
if ((m = t.helper1) != null && m.moved) {
|
|
146
146
|
t.helper1.clear();
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
if ((
|
|
149
|
+
if ((x = t.helper2) != null && x.moved) {
|
|
150
150
|
t.helper2.clear();
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
@@ -161,44 +161,44 @@ function Tt(t) {
|
|
|
161
161
|
t.selectNode(c);
|
|
162
162
|
else if (!t.editable)
|
|
163
163
|
return;
|
|
164
|
-
const
|
|
165
|
-
|
|
164
|
+
const d = (w = c.parentElement) == null ? void 0 : w.parentElement;
|
|
165
|
+
d.getAttribute("class") === "topiclinks" ? t.selectArrow(c.parentElement) : d.getAttribute("class") === "summary" && t.selectSummary(c.parentElement);
|
|
166
166
|
}, o = (a) => {
|
|
167
167
|
var m;
|
|
168
168
|
if (!t.editable)
|
|
169
169
|
return;
|
|
170
170
|
const c = a.target;
|
|
171
171
|
ct(c) && t.beginEdit(c);
|
|
172
|
-
const
|
|
173
|
-
|
|
172
|
+
const d = (m = c.parentElement) == null ? void 0 : m.parentElement;
|
|
173
|
+
d.getAttribute("class") === "topiclinks" ? t.editArrowLabel(c.parentElement) : d.getAttribute("class") === "summary" && t.editSummary(c.parentElement);
|
|
174
174
|
};
|
|
175
175
|
let i = 0;
|
|
176
|
-
const
|
|
176
|
+
const s = (a) => {
|
|
177
177
|
if (a.pointerType === "mouse")
|
|
178
178
|
return;
|
|
179
|
-
const c = (/* @__PURE__ */ new Date()).getTime(),
|
|
180
|
-
|
|
181
|
-
},
|
|
179
|
+
const c = (/* @__PURE__ */ new Date()).getTime(), d = c - i;
|
|
180
|
+
d < 300 && d > 0 && o(a), i = c;
|
|
181
|
+
}, r = (a) => {
|
|
182
182
|
e.moved = !1;
|
|
183
183
|
const c = t.mouseSelectionButton === 0 ? 2 : 0;
|
|
184
184
|
if (a.button !== c && a.pointerType === "mouse")
|
|
185
185
|
return;
|
|
186
186
|
e.x = a.clientX, e.y = a.clientY;
|
|
187
|
-
const
|
|
188
|
-
|
|
187
|
+
const d = a.target;
|
|
188
|
+
d.className !== "circle" && d.contentEditable !== "plaintext-only" && (e.mousedown = !0, d.setPointerCapture(a.pointerId));
|
|
189
189
|
}, l = (a) => {
|
|
190
190
|
if (a.target.contentEditable !== "plaintext-only") {
|
|
191
|
-
const c = a.clientX - e.x,
|
|
192
|
-
e.onMove(c,
|
|
191
|
+
const c = a.clientX - e.x, d = a.clientY - e.y;
|
|
192
|
+
e.onMove(c, d);
|
|
193
193
|
}
|
|
194
194
|
e.x = a.clientX, e.y = a.clientY;
|
|
195
|
-
},
|
|
195
|
+
}, h = (a) => {
|
|
196
196
|
const c = t.mouseSelectionButton === 0 ? 2 : 0;
|
|
197
197
|
if (a.button !== c && a.pointerType === "mouse")
|
|
198
198
|
return;
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
},
|
|
199
|
+
const d = a.target;
|
|
200
|
+
d.hasPointerCapture && d.hasPointerCapture(a.pointerId) && d.releasePointerCapture(a.pointerId), e.clear();
|
|
201
|
+
}, f = (a) => {
|
|
202
202
|
if (a.preventDefault(), a.button !== 2 || !t.editable)
|
|
203
203
|
return;
|
|
204
204
|
const c = a.target;
|
|
@@ -206,16 +206,16 @@ function Tt(t) {
|
|
|
206
206
|
t.dragMoveHelper.moved || t.bus.fire("showContextMenu", a);
|
|
207
207
|
}, 200);
|
|
208
208
|
}, p = (a) => {
|
|
209
|
-
a.stopPropagation(), a.preventDefault(), a.ctrlKey || a.metaKey ? a.deltaY < 0 ? lt(t, "in", t.dragMoveHelper) : t.scaleVal - t.scaleSensitivity > 0 && lt(t, "out", t.dragMoveHelper) : a.shiftKey ? t.move(-a.deltaY, 0) :
|
|
209
|
+
a.stopPropagation(), a.preventDefault(), a.ctrlKey || a.metaKey ? a.deltaY < 0 ? lt(t, "in", t.dragMoveHelper) : t.scaleVal - t.scaleSensitivity > 0 && lt(t, "out", t.dragMoveHelper) : a.shiftKey ? t.move(-a.deltaY, 0) : t.move(-a.deltaX, -a.deltaY);
|
|
210
210
|
}, { container: u } = t;
|
|
211
211
|
return ut([
|
|
212
|
-
{ dom: u, evt: "pointerdown", func:
|
|
212
|
+
{ dom: u, evt: "pointerdown", func: r },
|
|
213
213
|
{ dom: u, evt: "pointermove", func: l },
|
|
214
|
-
{ dom: u, evt: "pointerup", func:
|
|
215
|
-
{ dom: u, evt: "pointerup", func:
|
|
214
|
+
{ dom: u, evt: "pointerup", func: h },
|
|
215
|
+
{ dom: u, evt: "pointerup", func: s },
|
|
216
216
|
{ dom: u, evt: "click", func: n },
|
|
217
217
|
{ dom: u, evt: "dblclick", func: o },
|
|
218
|
-
{ dom: u, evt: "contextmenu", func:
|
|
218
|
+
{ dom: u, evt: "contextmenu", func: f },
|
|
219
219
|
{ dom: u, evt: "wheel", func: typeof t.handleWheel == "function" ? t.handleWheel : p }
|
|
220
220
|
]);
|
|
221
221
|
}
|
|
@@ -253,8 +253,8 @@ const X = document, kt = function() {
|
|
|
253
253
|
const n = this.nodeData.children || [];
|
|
254
254
|
if (this.direction === 2) {
|
|
255
255
|
let o = 0, i = 0;
|
|
256
|
-
n.map((
|
|
257
|
-
|
|
256
|
+
n.map((s) => {
|
|
257
|
+
s.direction === 0 ? o += 1 : s.direction === 1 ? i += 1 : o <= i ? (s.direction = 0, o += 1) : (s.direction = 1, i += 1);
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
$t(this, n, e);
|
|
@@ -263,16 +263,16 @@ const X = document, kt = function() {
|
|
|
263
263
|
o.className = H.LHS;
|
|
264
264
|
const i = X.createElement("me-main");
|
|
265
265
|
i.className = H.RHS;
|
|
266
|
-
for (let
|
|
267
|
-
const
|
|
268
|
-
t.direction === 2 ?
|
|
266
|
+
for (let s = 0; s < e.length; s++) {
|
|
267
|
+
const r = e[s], { grp: l } = t.createWrapper(r);
|
|
268
|
+
t.direction === 2 ? r.direction === 0 ? o.appendChild(l) : i.appendChild(l) : t.direction === 0 ? o.appendChild(l) : i.appendChild(l);
|
|
269
269
|
}
|
|
270
270
|
t.nodes.appendChild(o), t.nodes.appendChild(n), t.nodes.appendChild(i), t.nodes.appendChild(t.lines);
|
|
271
271
|
}, At = function(t, e) {
|
|
272
272
|
const n = X.createElement("me-children");
|
|
273
273
|
for (let o = 0; o < e.length; o++) {
|
|
274
|
-
const i = e[o], { grp:
|
|
275
|
-
n.appendChild(
|
|
274
|
+
const i = e[o], { grp: s } = t.createWrapper(i);
|
|
275
|
+
n.appendChild(s);
|
|
276
276
|
}
|
|
277
277
|
return n;
|
|
278
278
|
}, L = document, gt = function(t, e) {
|
|
@@ -320,10 +320,10 @@ const X = document, kt = function() {
|
|
|
320
320
|
}, Mt = function(t, e) {
|
|
321
321
|
const n = L.createElement("me-wrapper"), { p: o, tpc: i } = this.createParent(t);
|
|
322
322
|
if (n.appendChild(o), !e && t.children && t.children.length > 0) {
|
|
323
|
-
const
|
|
324
|
-
if (o.appendChild(
|
|
325
|
-
const
|
|
326
|
-
n.appendChild(
|
|
323
|
+
const s = Bt(t.expanded);
|
|
324
|
+
if (o.appendChild(s), t.expanded !== !1) {
|
|
325
|
+
const r = At(this, t.children);
|
|
326
|
+
n.appendChild(r);
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
return { grp: n, top: o, tpc: i };
|
|
@@ -337,7 +337,7 @@ const X = document, kt = function() {
|
|
|
337
337
|
const e = L.createElement("me-tpc");
|
|
338
338
|
return e.nodeObj = t, e.dataset.nodeid = "me" + t.id, e.draggable = this.draggable, e;
|
|
339
339
|
};
|
|
340
|
-
function
|
|
340
|
+
function xt(t) {
|
|
341
341
|
const e = L.createRange();
|
|
342
342
|
e.selectNodeContents(t);
|
|
343
343
|
const n = window.getSelection();
|
|
@@ -355,23 +355,23 @@ const Ht = function(t) {
|
|
|
355
355
|
margin:${o.margin};
|
|
356
356
|
font:${o.font};
|
|
357
357
|
background-color:${o.backgroundColor !== "rgba(0, 0, 0, 0)" && o.backgroundColor};
|
|
358
|
-
border-radius:${o.borderRadius};`, this.direction === 0 && (e.style.right = "0"),
|
|
358
|
+
border-radius:${o.borderRadius};`, this.direction === 0 && (e.style.right = "0"), xt(e), this.bus.fire("operation", {
|
|
359
359
|
name: "beginEdit",
|
|
360
360
|
obj: t.nodeObj
|
|
361
361
|
}), e.addEventListener("keydown", (i) => {
|
|
362
362
|
i.stopPropagation();
|
|
363
|
-
const
|
|
364
|
-
if (
|
|
363
|
+
const s = i.key;
|
|
364
|
+
if (s === "Enter" || s === "Tab") {
|
|
365
365
|
if (i.shiftKey)
|
|
366
366
|
return;
|
|
367
367
|
i.preventDefault(), e.blur(), this.container.focus();
|
|
368
368
|
}
|
|
369
369
|
}), e.addEventListener("blur", () => {
|
|
370
|
-
var
|
|
370
|
+
var r;
|
|
371
371
|
if (!e)
|
|
372
372
|
return;
|
|
373
|
-
const i = t.nodeObj,
|
|
374
|
-
|
|
373
|
+
const i = t.nodeObj, s = ((r = e.textContent) == null ? void 0 : r.trim()) || "";
|
|
374
|
+
s === "" ? i.topic = n : i.topic = s, e.remove(), s !== n && (t.text.textContent = i.topic, this.linkDiv(), this.bus.fire("operation", {
|
|
375
375
|
name: "finishEdit",
|
|
376
376
|
obj: i,
|
|
377
377
|
origin: n
|
|
@@ -381,14 +381,14 @@ const Ht = function(t) {
|
|
|
381
381
|
const e = L.createElement("me-epd");
|
|
382
382
|
return e.expanded = t !== !1, e.className = t !== !1 ? "minus" : "", e;
|
|
383
383
|
}, P = document, k = "http://www.w3.org/2000/svg", J = function(t, e, n, o = {}) {
|
|
384
|
-
const { anchor: i = "middle", color:
|
|
384
|
+
const { anchor: i = "middle", color: s, dataType: r } = o, l = document.createElementNS(k, "text");
|
|
385
385
|
return v(l, {
|
|
386
386
|
"text-anchor": i,
|
|
387
387
|
x: e + "",
|
|
388
388
|
y: n + "",
|
|
389
|
-
fill:
|
|
390
|
-
}),
|
|
391
|
-
},
|
|
389
|
+
fill: s || (i === "middle" ? "rgb(235, 95, 82)" : "#666")
|
|
390
|
+
}), r && (l.dataset.type = r), l.innerHTML = t, l;
|
|
391
|
+
}, wt = function(t, e, n) {
|
|
392
392
|
const o = P.createElementNS(k, "path");
|
|
393
393
|
return v(o, {
|
|
394
394
|
d: t,
|
|
@@ -417,22 +417,22 @@ const Ht = function(t) {
|
|
|
417
417
|
name: "arrow2",
|
|
418
418
|
d: n
|
|
419
419
|
}
|
|
420
|
-
].forEach((
|
|
421
|
-
const
|
|
422
|
-
d:
|
|
420
|
+
].forEach((r, l) => {
|
|
421
|
+
const h = r.d, f = P.createElementNS(k, "path"), p = {
|
|
422
|
+
d: h,
|
|
423
423
|
stroke: (o == null ? void 0 : o.stroke) || "rgb(235, 95, 82)",
|
|
424
424
|
fill: "none",
|
|
425
425
|
"stroke-linecap": (o == null ? void 0 : o.strokeLinecap) || "cap",
|
|
426
426
|
"stroke-width": String((o == null ? void 0 : o.strokeWidth) || "2")
|
|
427
427
|
};
|
|
428
|
-
(o == null ? void 0 : o.opacity) !== void 0 && (p.opacity = String(o.opacity)), v(
|
|
428
|
+
(o == null ? void 0 : o.opacity) !== void 0 && (p.opacity = String(o.opacity)), v(f, p), l === 0 && f.setAttribute("stroke-dasharray", (o == null ? void 0 : o.strokeDasharray) || "8,2");
|
|
429
429
|
const u = P.createElementNS(k, "path");
|
|
430
430
|
v(u, {
|
|
431
|
-
d:
|
|
431
|
+
d: h,
|
|
432
432
|
stroke: "transparent",
|
|
433
433
|
fill: "none",
|
|
434
434
|
"stroke-width": "15"
|
|
435
|
-
}), i.appendChild(u), i.appendChild(
|
|
435
|
+
}), i.appendChild(u), i.appendChild(f), i[r.name] = f;
|
|
436
436
|
}), i;
|
|
437
437
|
}, yt = function(t, e, n) {
|
|
438
438
|
if (!e)
|
|
@@ -441,28 +441,28 @@ const Ht = function(t) {
|
|
|
441
441
|
t.nodes.appendChild(o);
|
|
442
442
|
const i = e.innerHTML;
|
|
443
443
|
o.id = "input-box", o.textContent = i, o.contentEditable = "plaintext-only", o.spellcheck = !1;
|
|
444
|
-
const
|
|
444
|
+
const s = e.getBBox();
|
|
445
445
|
o.style.cssText = `
|
|
446
|
-
min-width:${Math.max(88,
|
|
446
|
+
min-width:${Math.max(88, s.width)}px;
|
|
447
447
|
position:absolute;
|
|
448
|
-
left:${
|
|
449
|
-
top:${
|
|
448
|
+
left:${s.x}px;
|
|
449
|
+
top:${s.y}px;
|
|
450
450
|
padding: 2px 4px;
|
|
451
451
|
margin: -2px -4px;
|
|
452
|
-
`,
|
|
453
|
-
|
|
454
|
-
const l =
|
|
452
|
+
`, xt(o), t.scrollIntoView(o), o.addEventListener("keydown", (r) => {
|
|
453
|
+
r.stopPropagation();
|
|
454
|
+
const l = r.key;
|
|
455
455
|
if (l === "Enter" || l === "Tab") {
|
|
456
|
-
if (
|
|
456
|
+
if (r.shiftKey)
|
|
457
457
|
return;
|
|
458
|
-
|
|
458
|
+
r.preventDefault(), o.blur(), t.container.focus();
|
|
459
459
|
}
|
|
460
460
|
}), o.addEventListener("blur", () => {
|
|
461
461
|
var l;
|
|
462
462
|
if (!o)
|
|
463
463
|
return;
|
|
464
|
-
const
|
|
465
|
-
|
|
464
|
+
const r = ((l = o.textContent) == null ? void 0 : l.trim()) || "";
|
|
465
|
+
r === "" ? n.label = i : n.label = r, o.remove(), r !== i && (e.innerHTML = n.label, t.linkDiv(), "parent" in n ? t.bus.fire("operation", {
|
|
466
466
|
name: "finishEditSummary",
|
|
467
467
|
obj: n
|
|
468
468
|
}) : t.bus.fire("operation", {
|
|
@@ -471,24 +471,24 @@ const Ht = function(t) {
|
|
|
471
471
|
}));
|
|
472
472
|
});
|
|
473
473
|
}, Wt = function(t) {
|
|
474
|
-
const e = this.map.querySelector("me-root"), n = e.offsetTop, o = e.offsetLeft, i = e.offsetWidth,
|
|
474
|
+
const e = this.map.querySelector("me-root"), n = e.offsetTop, o = e.offsetLeft, i = e.offsetWidth, s = e.offsetHeight, r = this.map.querySelectorAll("me-main > me-wrapper");
|
|
475
475
|
this.lines.innerHTML = "";
|
|
476
|
-
for (let l = 0; l <
|
|
477
|
-
const
|
|
478
|
-
if (
|
|
476
|
+
for (let l = 0; l < r.length; l++) {
|
|
477
|
+
const h = r[l], f = h.querySelector("me-tpc"), { offsetLeft: p, offsetTop: u } = D(this.nodes, f), g = f.offsetWidth, a = f.offsetHeight, c = h.parentNode.className, d = this.generateMainBranch({ pT: n, pL: o, pW: i, pH: s, cT: u, cL: p, cW: g, cH: a, direction: c, containerHeight: this.nodes.offsetHeight }), m = this.theme.palette, x = f.nodeObj.branchColor || m[l % m.length];
|
|
478
|
+
if (f.style.borderColor = x, this.lines.appendChild(wt(d, x, "3")), t && t !== h)
|
|
479
479
|
continue;
|
|
480
|
-
const
|
|
481
|
-
y.tagName === "svg" && y.remove(),
|
|
480
|
+
const w = W("subLines"), y = h.lastChild;
|
|
481
|
+
y.tagName === "svg" && y.remove(), h.appendChild(w), vt(this, w, x, h, c, !0);
|
|
482
482
|
}
|
|
483
483
|
this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
|
|
484
|
-
}, vt = function(t, e, n, o, i,
|
|
485
|
-
const
|
|
484
|
+
}, vt = function(t, e, n, o, i, s) {
|
|
485
|
+
const r = o.firstChild, l = o.children[1].children;
|
|
486
486
|
if (l.length === 0)
|
|
487
487
|
return;
|
|
488
|
-
const
|
|
488
|
+
const h = r.offsetTop, f = r.offsetLeft, p = r.offsetWidth, u = r.offsetHeight;
|
|
489
489
|
for (let g = 0; g < l.length; g++) {
|
|
490
|
-
const a = l[g], c = a.firstChild,
|
|
491
|
-
e.appendChild(
|
|
490
|
+
const a = l[g], c = a.firstChild, d = c.offsetTop, m = c.offsetLeft, x = c.offsetWidth, w = c.offsetHeight, y = c.firstChild.nodeObj.branchColor || n, S = t.generateSubBranch({ pT: h, pL: f, pW: p, pH: u, cT: d, cL: m, cW: x, cH: w, direction: i, isFirst: s });
|
|
491
|
+
e.appendChild(wt(S, y, "2"));
|
|
492
492
|
const E = c.children[1];
|
|
493
493
|
if (E) {
|
|
494
494
|
if (!E.expanded)
|
|
@@ -498,28 +498,28 @@ const Ht = function(t) {
|
|
|
498
498
|
vt(t, e, y, a, i);
|
|
499
499
|
}
|
|
500
500
|
};
|
|
501
|
-
const
|
|
502
|
-
const
|
|
503
|
-
side:
|
|
504
|
-
left:
|
|
505
|
-
right:
|
|
501
|
+
const 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="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>', 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="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>', Vt = '<?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>', 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="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>', Rt = '<?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>', 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="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>', jt = '<?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>';
|
|
502
|
+
const zt = {
|
|
503
|
+
side: Gt,
|
|
504
|
+
left: It,
|
|
505
|
+
right: Vt,
|
|
506
506
|
full: Ft,
|
|
507
|
-
living:
|
|
508
|
-
zoomin:
|
|
509
|
-
zoomout:
|
|
507
|
+
living: Rt,
|
|
508
|
+
zoomin: Yt,
|
|
509
|
+
zoomout: jt
|
|
510
510
|
}, N = (t, e) => {
|
|
511
511
|
const n = document.createElement("span");
|
|
512
|
-
return n.id = t, n.innerHTML =
|
|
512
|
+
return n.id = t, n.innerHTML = zt[e], n;
|
|
513
513
|
};
|
|
514
514
|
function Xt(t) {
|
|
515
|
-
const e = document.createElement("div"), n = N("fullscreen", "full"), o = N("toCenter", "living"), i = N("zoomout", "zoomout"),
|
|
516
|
-
return
|
|
515
|
+
const e = document.createElement("div"), n = N("fullscreen", "full"), o = N("toCenter", "living"), i = N("zoomout", "zoomout"), s = N("zoomin", "zoomin"), r = document.createElement("span");
|
|
516
|
+
return r.innerText = "100%", e.appendChild(n), e.appendChild(o), e.appendChild(i), e.appendChild(s), e.className = "mind-elixir-toolbar rb", n.onclick = () => {
|
|
517
517
|
document.fullscreenElement === t.el ? document.exitFullscreen() : t.el.requestFullscreen();
|
|
518
518
|
}, o.onclick = () => {
|
|
519
519
|
t.toCenter();
|
|
520
520
|
}, i.onclick = () => {
|
|
521
521
|
t.scale(t.scaleVal - t.scaleSensitivity);
|
|
522
|
-
},
|
|
522
|
+
}, s.onclick = () => {
|
|
523
523
|
t.scale(t.scaleVal + t.scaleSensitivity);
|
|
524
524
|
}, e;
|
|
525
525
|
}
|
|
@@ -542,9 +542,9 @@ const Ut = function(t, e = !0) {
|
|
|
542
542
|
...(t.type === "dark" ? Z : Q).cssVar,
|
|
543
543
|
...t.cssVar
|
|
544
544
|
}, i = Object.keys(o);
|
|
545
|
-
for (let
|
|
546
|
-
const
|
|
547
|
-
this.container.style.setProperty(
|
|
545
|
+
for (let s = 0; s < i.length; s++) {
|
|
546
|
+
const r = i[s];
|
|
547
|
+
this.container.style.setProperty(r, o[r]);
|
|
548
548
|
}
|
|
549
549
|
e && this.refresh();
|
|
550
550
|
}, Kt = function(t) {
|
|
@@ -563,8 +563,8 @@ function Jt(t) {
|
|
|
563
563
|
const Qt = function(t) {
|
|
564
564
|
const e = this.container, n = t.getBoundingClientRect(), o = e.getBoundingClientRect();
|
|
565
565
|
if (n.top > o.bottom || n.bottom < o.top || n.left > o.right || n.right < o.left) {
|
|
566
|
-
const
|
|
567
|
-
this.move(-
|
|
566
|
+
const s = n.left + n.width / 2, r = n.top + n.height / 2, l = o.left + o.width / 2, h = o.top + o.height / 2, f = s - l, p = r - h;
|
|
567
|
+
this.move(-f, -p, !0);
|
|
568
568
|
}
|
|
569
569
|
}, Zt = function(t, e, n) {
|
|
570
570
|
this.clearSelection(), this.scrollIntoView(t), this.selection.select(t), e && this.bus.fire("selectNewNode", t.nodeObj);
|
|
@@ -589,19 +589,21 @@ const Qt = function(t) {
|
|
|
589
589
|
}, ce = function(t, e = { x: 0, y: 0 }) {
|
|
590
590
|
if (t < this.scaleMin || t > this.scaleMax)
|
|
591
591
|
return;
|
|
592
|
-
const n = this.container.getBoundingClientRect(), o = e.x ? e.x - n.left - n.width / 2 : 0, i = e.y ? e.y - n.top - n.height / 2 : 0, { dx:
|
|
593
|
-
this.map.style.transform = `translate(${
|
|
592
|
+
const n = this.container.getBoundingClientRect(), o = e.x ? e.x - n.left - n.width / 2 : 0, i = e.y ? e.y - n.top - n.height / 2 : 0, { dx: s, dy: r } = bt(this), l = this.map.style.transform, { x: h, y: f } = pt(l), p = h - s, u = f - r, g = this.scaleVal, a = (-o + p) * (1 - t / g), c = (-i + u) * (1 - t / g);
|
|
593
|
+
this.map.style.transform = `translate(${h - a}px, ${f - c}px) scale(${t})`, this.scaleVal = t, this.bus.fire("scale", t);
|
|
594
594
|
}, le = function() {
|
|
595
595
|
const t = this.nodes.offsetHeight / this.container.offsetHeight, e = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(t, e));
|
|
596
596
|
this.scaleVal = n, this.map.style.transform = "scale(" + n + ")", this.bus.fire("scale", n);
|
|
597
|
-
}, ae = function(t, e) {
|
|
598
|
-
const { map:
|
|
599
|
-
let { x:
|
|
600
|
-
|
|
597
|
+
}, ae = function(t, e, n = !1) {
|
|
598
|
+
const { map: o, scaleVal: i, bus: s } = this, r = o.style.transform;
|
|
599
|
+
let { x: l, y: h } = pt(r);
|
|
600
|
+
l += t, h += e, n && (o.style.transition = "transform 0.3s", setTimeout(() => {
|
|
601
|
+
o.style.transition = "none";
|
|
602
|
+
}, 300)), o.style.transform = `translate(${l}px, ${h}px) scale(${i})`, s.fire("move", { dx: t, dy: e });
|
|
601
603
|
}, bt = (t) => {
|
|
602
|
-
const { container: e, map: n, nodes: o } = t, i = n.querySelector("me-root"),
|
|
603
|
-
let
|
|
604
|
-
return t.alignment === "root" ? (
|
|
604
|
+
const { container: e, map: n, nodes: o } = t, i = n.querySelector("me-root"), s = i.offsetTop, r = i.offsetLeft, l = i.offsetWidth, h = i.offsetHeight;
|
|
605
|
+
let f, p;
|
|
606
|
+
return t.alignment === "root" ? (f = e.offsetWidth / 2 - r - l / 2, p = e.offsetHeight / 2 - s - h / 2, n.style.transformOrigin = `${r + l / 2}px 50%`) : (f = (e.offsetWidth - o.offsetWidth) / 2, p = (e.offsetHeight - o.offsetHeight) / 2, n.style.transformOrigin = "50% 50%"), { dx: f, dy: p };
|
|
605
607
|
}, he = function() {
|
|
606
608
|
const { map: t } = this, { dx: e, dy: n } = bt(this);
|
|
607
609
|
t.style.transform = `translate(${e}px, ${n}px) scale(${this.scaleVal})`;
|
|
@@ -617,25 +619,39 @@ const Qt = function(t) {
|
|
|
617
619
|
this.direction = 1, this.refresh(), this.toCenter();
|
|
618
620
|
}, me = function() {
|
|
619
621
|
this.direction = 2, this.refresh(), this.toCenter();
|
|
620
|
-
},
|
|
622
|
+
}, xe = function(t) {
|
|
621
623
|
this.locale = t, this.refresh();
|
|
622
|
-
},
|
|
624
|
+
}, we = function(t, e) {
|
|
623
625
|
const n = t.nodeObj;
|
|
624
626
|
typeof e == "boolean" ? n.expanded = e : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
|
|
625
|
-
const o = t.
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
627
|
+
const o = t.getBoundingClientRect(), i = {
|
|
628
|
+
x: o.left,
|
|
629
|
+
y: o.top
|
|
630
|
+
}, s = t.parentNode, r = s.children[1];
|
|
631
|
+
if (r.expanded = n.expanded, r.className = n.expanded ? "minus" : "", Kt(t), n.expanded) {
|
|
632
|
+
const u = this.createChildren(
|
|
633
|
+
n.children.map((g) => this.createWrapper(g).grp)
|
|
629
634
|
);
|
|
630
|
-
|
|
635
|
+
s.parentNode.appendChild(u);
|
|
631
636
|
} else
|
|
632
|
-
|
|
637
|
+
s.parentNode.children[1].remove();
|
|
633
638
|
this.linkDiv(t.closest("me-main > me-wrapper"));
|
|
634
|
-
const
|
|
635
|
-
|
|
639
|
+
const l = t.getBoundingClientRect(), h = {
|
|
640
|
+
x: l.left,
|
|
641
|
+
y: l.top
|
|
642
|
+
}, f = i.x - h.x, p = i.y - h.y;
|
|
643
|
+
this.move(f, p), this.bus.fire("expandNode", n);
|
|
636
644
|
}, ye = function(t, e) {
|
|
637
|
-
const n = t.nodeObj
|
|
645
|
+
const n = t.nodeObj, o = t.getBoundingClientRect(), i = {
|
|
646
|
+
x: o.left,
|
|
647
|
+
y: o.top
|
|
648
|
+
};
|
|
638
649
|
K(n, e ?? !n.expanded), this.refresh();
|
|
650
|
+
const s = this.findEle(n.id).getBoundingClientRect(), r = {
|
|
651
|
+
x: s.left,
|
|
652
|
+
y: s.top
|
|
653
|
+
}, l = i.x - r.x, h = i.y - r.y;
|
|
654
|
+
this.move(l, h);
|
|
639
655
|
}, ve = function(t) {
|
|
640
656
|
this.clearSelection(), t && (t = JSON.parse(JSON.stringify(t)), this.nodeData = t.nodeData, this.arrows = t.arrows || [], this.summaries = t.summaries || [], t.theme && this.changeTheme(t.theme)), tt(this.nodeData), this.layout(), this.linkDiv();
|
|
641
657
|
}, be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -644,7 +660,7 @@ const Qt = function(t) {
|
|
|
644
660
|
clearSelection: ne,
|
|
645
661
|
disableEdit: re,
|
|
646
662
|
enableEdit: se,
|
|
647
|
-
expandNode:
|
|
663
|
+
expandNode: we,
|
|
648
664
|
expandNodeAll: ye,
|
|
649
665
|
focusNode: fe,
|
|
650
666
|
getData: ie,
|
|
@@ -660,7 +676,7 @@ const Qt = function(t) {
|
|
|
660
676
|
scrollIntoView: Qt,
|
|
661
677
|
selectNode: Zt,
|
|
662
678
|
selectNodes: te,
|
|
663
|
-
setLocale:
|
|
679
|
+
setLocale: xe,
|
|
664
680
|
toCenter: he,
|
|
665
681
|
unselectNodes: ee
|
|
666
682
|
}, Symbol.toStringTag, { value: "Module" })), Ce = function(t) {
|
|
@@ -701,10 +717,10 @@ const Qt = function(t) {
|
|
|
701
717
|
}, ht = {
|
|
702
718
|
create: Ce
|
|
703
719
|
}, Se = "#4dc4ff";
|
|
704
|
-
function Ct(t, e, n, o, i,
|
|
720
|
+
function Ct(t, e, n, o, i, s, r, l) {
|
|
705
721
|
return {
|
|
706
|
-
x: t / 8 + n * 3 / 8 + i * 3 / 8 +
|
|
707
|
-
y: e / 8 + o * 3 / 8 +
|
|
722
|
+
x: t / 8 + n * 3 / 8 + i * 3 / 8 + r / 8,
|
|
723
|
+
y: e / 8 + o * 3 / 8 + s * 3 / 8 + l / 8
|
|
708
724
|
};
|
|
709
725
|
}
|
|
710
726
|
function Ee(t, e, n) {
|
|
@@ -721,35 +737,35 @@ function F(t, e, n, o, i) {
|
|
|
721
737
|
y2: i + ""
|
|
722
738
|
});
|
|
723
739
|
}
|
|
724
|
-
function dt(t, e, n, o, i,
|
|
740
|
+
function dt(t, e, n, o, i, s, r, l, h, f) {
|
|
725
741
|
var a;
|
|
726
|
-
if (t.line.setAttribute("d", `M ${e} ${n} C ${o} ${i} ${
|
|
727
|
-
const c =
|
|
742
|
+
if (t.line.setAttribute("d", `M ${e} ${n} C ${o} ${i} ${s} ${r} ${l} ${h}`), f.style) {
|
|
743
|
+
const c = f.style;
|
|
728
744
|
c.stroke && t.line.setAttribute("stroke", c.stroke), c.strokeWidth && t.line.setAttribute("stroke-width", String(c.strokeWidth)), c.strokeDasharray && t.line.setAttribute("stroke-dasharray", c.strokeDasharray), c.strokeLinecap && t.line.setAttribute("stroke-linecap", c.strokeLinecap), c.opacity !== void 0 && t.line.setAttribute("opacity", String(c.opacity));
|
|
729
745
|
}
|
|
730
|
-
const p =
|
|
731
|
-
if (p && (t.arrow1.setAttribute("d", `M ${p.x1} ${p.y1} L ${l} ${
|
|
732
|
-
const c =
|
|
746
|
+
const p = z(s, r, l, h);
|
|
747
|
+
if (p && (t.arrow1.setAttribute("d", `M ${p.x1} ${p.y1} L ${l} ${h} L ${p.x2} ${p.y2}`), f.style)) {
|
|
748
|
+
const c = f.style;
|
|
733
749
|
c.stroke && t.arrow1.setAttribute("stroke", c.stroke), c.strokeWidth && t.arrow1.setAttribute("stroke-width", String(c.strokeWidth)), c.strokeLinecap && t.arrow1.setAttribute("stroke-linecap", c.strokeLinecap), c.opacity !== void 0 && t.arrow1.setAttribute("opacity", String(c.opacity));
|
|
734
750
|
}
|
|
735
|
-
if (
|
|
736
|
-
const c =
|
|
737
|
-
if (c && (t.arrow2.setAttribute("d", `M ${c.x1} ${c.y1} L ${e} ${n} L ${c.x2} ${c.y2}`),
|
|
738
|
-
const
|
|
739
|
-
|
|
751
|
+
if (f.bidirectional) {
|
|
752
|
+
const c = z(o, i, e, n);
|
|
753
|
+
if (c && (t.arrow2.setAttribute("d", `M ${c.x1} ${c.y1} L ${e} ${n} L ${c.x2} ${c.y2}`), f.style)) {
|
|
754
|
+
const d = f.style;
|
|
755
|
+
d.stroke && t.arrow2.setAttribute("stroke", d.stroke), d.strokeWidth && t.arrow2.setAttribute("stroke-width", String(d.strokeWidth)), d.strokeLinecap && t.arrow2.setAttribute("stroke-linecap", d.strokeLinecap), d.opacity !== void 0 && t.arrow2.setAttribute("opacity", String(d.opacity));
|
|
740
756
|
}
|
|
741
757
|
}
|
|
742
|
-
const { x: u, y: g } = Ct(e, n, o, i,
|
|
743
|
-
Ee(t.label, u, g), (a =
|
|
758
|
+
const { x: u, y: g } = Ct(e, n, o, i, s, r, l, h);
|
|
759
|
+
Ee(t.label, u, g), (a = f.style) != null && a.labelColor && t.label.setAttribute("fill", f.style.labelColor), Ne(t);
|
|
744
760
|
}
|
|
745
761
|
function q(t, e, n) {
|
|
746
|
-
const { offsetLeft: o, offsetTop: i } = D(t.nodes, e),
|
|
762
|
+
const { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = e.offsetWidth, r = e.offsetHeight, l = o + s / 2, h = i + r / 2, f = l + n.x, p = h + n.y;
|
|
747
763
|
return {
|
|
748
|
-
w:
|
|
749
|
-
h:
|
|
764
|
+
w: s,
|
|
765
|
+
h: r,
|
|
750
766
|
cx: l,
|
|
751
|
-
cy:
|
|
752
|
-
ctrlX:
|
|
767
|
+
cy: h,
|
|
768
|
+
ctrlX: f,
|
|
753
769
|
ctrlY: p
|
|
754
770
|
};
|
|
755
771
|
}
|
|
@@ -765,26 +781,26 @@ const et = function(t, e, n, o, i) {
|
|
|
765
781
|
var C;
|
|
766
782
|
if (!e || !n)
|
|
767
783
|
return;
|
|
768
|
-
const
|
|
769
|
-
if (!
|
|
784
|
+
const s = q(t, e, o.delta1), r = q(t, n, o.delta2), { x: l, y: h } = B(s), { ctrlX: f, ctrlY: p } = s, { ctrlX: u, ctrlY: g } = r, { x: a, y: c } = B(r), d = z(u, g, a, c);
|
|
785
|
+
if (!d)
|
|
770
786
|
return;
|
|
771
|
-
const m = `M ${
|
|
772
|
-
let
|
|
787
|
+
const m = `M ${d.x1} ${d.y1} L ${a} ${c} L ${d.x2} ${d.y2}`;
|
|
788
|
+
let x = "";
|
|
773
789
|
if (o.bidirectional) {
|
|
774
|
-
const $ =
|
|
790
|
+
const $ = z(f, p, l, h);
|
|
775
791
|
if (!$)
|
|
776
792
|
return;
|
|
777
|
-
|
|
793
|
+
x = `M ${$.x1} ${$.y1} L ${l} ${h} L ${$.x2} ${$.y2}`;
|
|
778
794
|
}
|
|
779
|
-
const
|
|
795
|
+
const w = Ot(`M ${l} ${h} C ${f} ${p} ${u} ${g} ${a} ${c}`, m, x, o.style), { x: y, y: S } = Ct(l, h, f, p, u, g, a, c), E = (C = o.style) == null ? void 0 : C.labelColor, b = J(o.label, y, S, {
|
|
780
796
|
anchor: "middle",
|
|
781
797
|
color: E,
|
|
782
798
|
dataType: "custom-link"
|
|
783
799
|
});
|
|
784
|
-
|
|
800
|
+
w.appendChild(b), w.label = b, w.arrowObj = o, w.dataset.linkid = o.id, t.linkSvgGroup.appendChild(w), i || (t.arrows.push(o), t.currentArrow = w, St(t, o, s, r));
|
|
785
801
|
}, Te = function(t, e, n = {}) {
|
|
786
802
|
const o = {
|
|
787
|
-
id:
|
|
803
|
+
id: G(),
|
|
788
804
|
label: "Custom Link",
|
|
789
805
|
from: t.nodeObj.id,
|
|
790
806
|
to: e.nodeObj.id,
|
|
@@ -804,7 +820,7 @@ const et = function(t, e, n, o, i) {
|
|
|
804
820
|
});
|
|
805
821
|
}, Le = function(t) {
|
|
806
822
|
_(this);
|
|
807
|
-
const e = { ...t, id:
|
|
823
|
+
const e = { ...t, id: G() };
|
|
808
824
|
et(this, this.findEle(e.from), this.findEle(e.to), e), this.bus.fire("operation", {
|
|
809
825
|
name: "createArrow",
|
|
810
826
|
obj: e
|
|
@@ -823,8 +839,8 @@ const et = function(t, e, n, o, i) {
|
|
|
823
839
|
});
|
|
824
840
|
}, $e = function(t) {
|
|
825
841
|
this.currentArrow = t;
|
|
826
|
-
const e = t.arrowObj, n = this.findEle(e.from), o = this.findEle(e.to), i = q(this, n, e.delta1),
|
|
827
|
-
St(this, e, i,
|
|
842
|
+
const e = t.arrowObj, n = this.findEle(e.from), o = this.findEle(e.to), i = q(this, n, e.delta1), s = q(this, o, e.delta2);
|
|
843
|
+
St(this, e, i, s);
|
|
828
844
|
}, Ae = function() {
|
|
829
845
|
_(this), this.currentArrow = null;
|
|
830
846
|
}, U = function(t, e) {
|
|
@@ -844,8 +860,8 @@ const et = function(t, e, n, o, i) {
|
|
|
844
860
|
n.appendChild(o);
|
|
845
861
|
const i = U(t.arrow1.getAttribute("d"), e);
|
|
846
862
|
if (n.appendChild(i), t.arrow2.getAttribute("d")) {
|
|
847
|
-
const
|
|
848
|
-
n.appendChild(
|
|
863
|
+
const s = U(t.arrow2.getAttribute("d"), e);
|
|
864
|
+
n.appendChild(s);
|
|
849
865
|
}
|
|
850
866
|
t.insertBefore(n, t.firstChild);
|
|
851
867
|
}, De = function(t) {
|
|
@@ -861,19 +877,19 @@ const et = function(t, e, n, o, i) {
|
|
|
861
877
|
var e, n;
|
|
862
878
|
(e = t.helper1) == null || e.destroy(), (n = t.helper2) == null || n.destroy(), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none", t.currentArrow && De(t.currentArrow);
|
|
863
879
|
}, St = function(t, e, n, o) {
|
|
864
|
-
const { linkController: i, P2:
|
|
880
|
+
const { linkController: i, P2: s, P3: r, line1: l, line2: h, nodes: f, map: p, currentArrow: u, bus: g } = t;
|
|
865
881
|
if (!u)
|
|
866
882
|
return;
|
|
867
|
-
i.style.display = "initial",
|
|
868
|
-
let { x: a, y: c } = B(n), { ctrlX:
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
const C = B({ ...n, ctrlX:
|
|
872
|
-
a = C.x, c = C.y,
|
|
883
|
+
i.style.display = "initial", s.style.display = "initial", r.style.display = "initial", f.appendChild(i), f.appendChild(s), f.appendChild(r), Me(u, Se);
|
|
884
|
+
let { x: a, y: c } = B(n), { ctrlX: d, ctrlY: m } = n, { ctrlX: x, ctrlY: w } = o, { x: y, y: S } = B(o);
|
|
885
|
+
s.style.cssText = `top:${m}px;left:${d}px;`, r.style.cssText = `top:${w}px;left:${x}px;`, F(l, a, c, d, m), F(h, x, w, y, S), t.helper1 = ht.create(s), t.helper2 = ht.create(r), t.helper1.init(p, (E, b) => {
|
|
886
|
+
d = d + E / t.scaleVal, m = m + b / t.scaleVal;
|
|
887
|
+
const C = B({ ...n, ctrlX: d, ctrlY: m });
|
|
888
|
+
a = C.x, c = C.y, s.style.top = m + "px", s.style.left = d + "px", dt(u, a, c, d, m, x, w, y, S, e), F(l, a, c, d, m), e.delta1.x = d - n.cx, e.delta1.y = m - n.cy, g.fire("updateArrowDelta", e);
|
|
873
889
|
}), t.helper2.init(p, (E, b) => {
|
|
874
|
-
|
|
875
|
-
const C = B({ ...o, ctrlX:
|
|
876
|
-
y = C.x, S = C.y,
|
|
890
|
+
x = x + E / t.scaleVal, w = w + b / t.scaleVal;
|
|
891
|
+
const C = B({ ...o, ctrlX: x, ctrlY: w });
|
|
892
|
+
y = C.x, S = C.y, r.style.top = w + "px", r.style.left = x + "px", dt(u, a, c, d, m, x, w, y, S, e), F(h, x, w, y, S), e.delta2.x = x - o.cx, e.delta2.y = w - o.cy, g.fire("updateArrowDelta", e);
|
|
877
893
|
});
|
|
878
894
|
};
|
|
879
895
|
function Pe() {
|
|
@@ -894,7 +910,7 @@ function He(t) {
|
|
|
894
910
|
yt(this, e, t.arrowObj);
|
|
895
911
|
}
|
|
896
912
|
function Be() {
|
|
897
|
-
this.arrows = this.arrows.filter((t) =>
|
|
913
|
+
this.arrows = this.arrows.filter((t) => j(t.from, this.nodeData) && j(t.to, this.nodeData));
|
|
898
914
|
}
|
|
899
915
|
const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
900
916
|
__proto__: null,
|
|
@@ -907,7 +923,7 @@ const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
907
923
|
tidyArrow: Be,
|
|
908
924
|
unselectArrow: Ae
|
|
909
925
|
}, Symbol.toStringTag, { value: "Module" })), We = function(t) {
|
|
910
|
-
var
|
|
926
|
+
var h, f;
|
|
911
927
|
if (t.length === 0)
|
|
912
928
|
throw new Error("No selected node.");
|
|
913
929
|
if (t.length === 1) {
|
|
@@ -926,30 +942,30 @@ const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
926
942
|
let u = p.nodeObj;
|
|
927
943
|
const g = [];
|
|
928
944
|
for (; u.parent; ) {
|
|
929
|
-
const a = u.parent, c = a.children,
|
|
930
|
-
u = a, g.unshift({ node: u, index:
|
|
945
|
+
const a = u.parent, c = a.children, d = c == null ? void 0 : c.indexOf(u);
|
|
946
|
+
u = a, g.unshift({ node: u, index: d });
|
|
931
947
|
}
|
|
932
948
|
return g.length > e && (e = g.length), g;
|
|
933
949
|
});
|
|
934
950
|
let o = 0;
|
|
935
951
|
t:
|
|
936
952
|
for (; o < e; o++) {
|
|
937
|
-
const p = (
|
|
953
|
+
const p = (h = n[0][o]) == null ? void 0 : h.node;
|
|
938
954
|
for (let u = 1; u < n.length; u++)
|
|
939
|
-
if (((
|
|
955
|
+
if (((f = n[u][o]) == null ? void 0 : f.node) !== p)
|
|
940
956
|
break t;
|
|
941
957
|
}
|
|
942
958
|
if (!o)
|
|
943
959
|
throw new Error("Can not select root node.");
|
|
944
|
-
const i = n.map((p) => p[o - 1].index).sort(),
|
|
960
|
+
const i = n.map((p) => p[o - 1].index).sort(), s = i[0] || 0, r = i[i.length - 1] || 0, l = n[0][o - 1].node;
|
|
945
961
|
if (!l.parent)
|
|
946
962
|
throw new Error("Please select nodes in the same main topic.");
|
|
947
963
|
return {
|
|
948
964
|
parent: l.id,
|
|
949
|
-
start:
|
|
950
|
-
end:
|
|
965
|
+
start: s,
|
|
966
|
+
end: r
|
|
951
967
|
};
|
|
952
|
-
},
|
|
968
|
+
}, Ge = function(t) {
|
|
953
969
|
const e = document.createElementNS(k, "g");
|
|
954
970
|
return e.setAttribute("id", t), e;
|
|
955
971
|
}, ft = function(t, e) {
|
|
@@ -961,48 +977,48 @@ const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
961
977
|
"stroke-linecap": "round",
|
|
962
978
|
"stroke-width": "2"
|
|
963
979
|
}), n;
|
|
964
|
-
},
|
|
980
|
+
}, Ie = (t) => t.parentElement.parentElement, Ve = function(t, { parent: e, start: n }) {
|
|
965
981
|
const o = t.findEle(e), i = o.nodeObj;
|
|
966
|
-
let
|
|
967
|
-
return i.parent ?
|
|
982
|
+
let s;
|
|
983
|
+
return i.parent ? s = o.closest("me-main").className : s = t.findEle(i.children[n].id).closest("me-main").className, s;
|
|
968
984
|
}, nt = function(t, e) {
|
|
969
985
|
var $;
|
|
970
|
-
const { id: n, label: o, parent: i, start:
|
|
971
|
-
let a = 1 / 0, c = 0,
|
|
972
|
-
for (let
|
|
973
|
-
const ot = ($ = u.children) == null ? void 0 : $[
|
|
986
|
+
const { id: n, label: o, parent: i, start: s, end: r } = e, { nodes: l, theme: h, summarySvg: f } = t, u = t.findEle(i).nodeObj, g = Ve(t, e);
|
|
987
|
+
let a = 1 / 0, c = 0, d = 0, m = 0;
|
|
988
|
+
for (let M = s; M <= r; M++) {
|
|
989
|
+
const ot = ($ = u.children) == null ? void 0 : $[M];
|
|
974
990
|
if (!ot)
|
|
975
991
|
return t.removeSummary(n), null;
|
|
976
|
-
const
|
|
977
|
-
|
|
992
|
+
const I = Ie(t.findEle(ot.id)), { offsetLeft: V, offsetTop: it } = D(l, I), st = s === r ? 10 : 20;
|
|
993
|
+
M === s && (d = it + st), M === r && (m = it + I.offsetHeight - st), V < a && (a = V), I.offsetWidth + V > c && (c = I.offsetWidth + V);
|
|
978
994
|
}
|
|
979
|
-
let
|
|
980
|
-
const y =
|
|
981
|
-
g === H.LHS ? (
|
|
982
|
-
const C =
|
|
983
|
-
return C.appendChild(
|
|
995
|
+
let x, w;
|
|
996
|
+
const y = d + 10, S = m + 10, E = (y + S) / 2, b = h.cssVar["--color"];
|
|
997
|
+
g === H.LHS ? (x = ft(`M ${a + 10} ${y} c -5 0 -10 5 -10 10 L ${a} ${S - 10} c 0 5 5 10 10 10 M ${a} ${E} h -10`, b), w = J(o, a - 20, E + 6, { anchor: "end", color: b })) : (x = ft(`M ${c - 10} ${y} c 5 0 10 5 10 10 L ${c} ${S - 10} c 0 5 -5 10 -10 10 M ${c} ${E} h 10`, b), w = J(o, c + 20, E + 6, { anchor: "start", color: b }));
|
|
998
|
+
const C = Ge("s-" + n);
|
|
999
|
+
return C.appendChild(x), C.appendChild(w), C.summaryObj = e, f.appendChild(C), C;
|
|
984
1000
|
}, Fe = function() {
|
|
985
1001
|
if (!this.currentNodes)
|
|
986
1002
|
return;
|
|
987
|
-
const { currentNodes: t, summaries: e, bus: n } = this, { parent: o, start: i, end:
|
|
988
|
-
e.push(
|
|
1003
|
+
const { currentNodes: t, summaries: e, bus: n } = this, { parent: o, start: i, end: s } = We(t), r = { id: G(), parent: o, start: i, end: s, label: "summary" }, l = nt(this, r);
|
|
1004
|
+
e.push(r), this.editSummary(l), n.fire("operation", {
|
|
989
1005
|
name: "createSummary",
|
|
990
|
-
obj:
|
|
1006
|
+
obj: r
|
|
991
1007
|
});
|
|
992
|
-
},
|
|
993
|
-
const e =
|
|
1008
|
+
}, Re = function(t) {
|
|
1009
|
+
const e = G(), n = { ...t, id: e };
|
|
994
1010
|
nt(this, n), this.summaries.push(n), this.bus.fire("operation", {
|
|
995
1011
|
name: "createSummary",
|
|
996
1012
|
obj: n
|
|
997
1013
|
});
|
|
998
|
-
},
|
|
1014
|
+
}, Ye = function(t) {
|
|
999
1015
|
var n;
|
|
1000
1016
|
const e = this.summaries.findIndex((o) => o.id === t);
|
|
1001
1017
|
e > -1 && (this.summaries.splice(e, 1), (n = document.querySelector("#s-" + t)) == null || n.remove()), this.bus.fire("operation", {
|
|
1002
1018
|
name: "removeSummary",
|
|
1003
1019
|
obj: { id: t }
|
|
1004
1020
|
});
|
|
1005
|
-
},
|
|
1021
|
+
}, je = function(t) {
|
|
1006
1022
|
const e = t.children[1].getBBox(), n = 6, o = 3, i = document.createElementNS(k, "rect");
|
|
1007
1023
|
v(i, {
|
|
1008
1024
|
x: e.x - n + "",
|
|
@@ -1014,7 +1030,7 @@ const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1014
1030
|
"stroke-width": "2",
|
|
1015
1031
|
fill: "none"
|
|
1016
1032
|
}), t.appendChild(i), this.currentSummary = t;
|
|
1017
|
-
},
|
|
1033
|
+
}, ze = function() {
|
|
1018
1034
|
var t, e;
|
|
1019
1035
|
(e = (t = this.currentSummary) == null ? void 0 : t.querySelector("rect")) == null || e.remove(), this.currentSummary = null;
|
|
1020
1036
|
}, Xe = function() {
|
|
@@ -1032,12 +1048,12 @@ const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1032
1048
|
}, _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1033
1049
|
__proto__: null,
|
|
1034
1050
|
createSummary: Fe,
|
|
1035
|
-
createSummaryFrom:
|
|
1051
|
+
createSummaryFrom: Re,
|
|
1036
1052
|
editSummary: qe,
|
|
1037
|
-
removeSummary:
|
|
1053
|
+
removeSummary: Ye,
|
|
1038
1054
|
renderSummary: Xe,
|
|
1039
|
-
selectSummary:
|
|
1040
|
-
unselectSummary:
|
|
1055
|
+
selectSummary: je,
|
|
1056
|
+
unselectSummary: ze
|
|
1041
1057
|
}, Symbol.toStringTag, { value: "Module" })), T = "http://www.w3.org/2000/svg";
|
|
1042
1058
|
function Ue(t, e) {
|
|
1043
1059
|
const n = document.createElementNS(T, "svg");
|
|
@@ -1053,41 +1069,41 @@ function Ke(t, e) {
|
|
|
1053
1069
|
}
|
|
1054
1070
|
function Je(t, e, n, o) {
|
|
1055
1071
|
const i = document.createElementNS(T, "g");
|
|
1056
|
-
let
|
|
1057
|
-
return t.text ?
|
|
1058
|
-
`).forEach((l,
|
|
1059
|
-
const
|
|
1060
|
-
v(
|
|
1072
|
+
let s = "";
|
|
1073
|
+
return t.text ? s = t.text.textContent : s = t.childNodes[0].textContent, s.split(`
|
|
1074
|
+
`).forEach((l, h) => {
|
|
1075
|
+
const f = document.createElementNS(T, "text");
|
|
1076
|
+
v(f, {
|
|
1061
1077
|
x: n + parseInt(e.paddingLeft) + "",
|
|
1062
|
-
y: o + parseInt(e.paddingTop) + Ke(e.lineHeight, e.fontSize) * (
|
|
1078
|
+
y: o + parseInt(e.paddingTop) + Ke(e.lineHeight, e.fontSize) * (h + 1) + parseFloat(e.fontSize) * (h + 1) + "",
|
|
1063
1079
|
"text-anchor": "start",
|
|
1064
1080
|
"font-family": e.fontFamily,
|
|
1065
1081
|
"font-size": `${e.fontSize}`,
|
|
1066
1082
|
"font-weight": `${e.fontWeight}`,
|
|
1067
1083
|
fill: `${e.color}`
|
|
1068
|
-
}),
|
|
1084
|
+
}), f.innerHTML = l, i.appendChild(f);
|
|
1069
1085
|
}), i;
|
|
1070
1086
|
}
|
|
1071
1087
|
function Qe(t, e, n, o) {
|
|
1072
1088
|
var l;
|
|
1073
1089
|
let i = "";
|
|
1074
1090
|
(l = t.nodeObj) != null && l.dangerouslySetInnerHTML ? i = t.nodeObj.dangerouslySetInnerHTML : t.text ? i = t.text.textContent : i = t.childNodes[0].textContent;
|
|
1075
|
-
const
|
|
1076
|
-
v(
|
|
1091
|
+
const s = document.createElementNS(T, "foreignObject");
|
|
1092
|
+
v(s, {
|
|
1077
1093
|
x: n + parseInt(e.paddingLeft) + "",
|
|
1078
1094
|
y: o + parseInt(e.paddingTop) + "",
|
|
1079
1095
|
width: e.width,
|
|
1080
1096
|
height: e.height
|
|
1081
1097
|
});
|
|
1082
|
-
const
|
|
1083
|
-
return v(
|
|
1098
|
+
const r = document.createElement("div");
|
|
1099
|
+
return v(r, {
|
|
1084
1100
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
1085
1101
|
style: `font-family: ${e.fontFamily}; font-size: ${e.fontSize}; font-weight: ${e.fontWeight}; color: ${e.color}; white-space: pre-wrap;`
|
|
1086
|
-
}),
|
|
1102
|
+
}), r.innerHTML = i, s.appendChild(r), s;
|
|
1087
1103
|
}
|
|
1088
1104
|
function Ze(t, e) {
|
|
1089
|
-
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e),
|
|
1090
|
-
return v(
|
|
1105
|
+
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = document.createElementNS(T, "rect");
|
|
1106
|
+
return v(s, {
|
|
1091
1107
|
x: o + "",
|
|
1092
1108
|
y: i + "",
|
|
1093
1109
|
rx: n.borderRadius,
|
|
@@ -1097,13 +1113,13 @@ function Ze(t, e) {
|
|
|
1097
1113
|
fill: n.backgroundColor,
|
|
1098
1114
|
stroke: n.borderColor,
|
|
1099
1115
|
"stroke-width": n.borderWidth
|
|
1100
|
-
}),
|
|
1116
|
+
}), s;
|
|
1101
1117
|
}
|
|
1102
|
-
function
|
|
1103
|
-
const o = getComputedStyle(e), { offsetLeft: i, offsetTop:
|
|
1104
|
-
v(
|
|
1118
|
+
function R(t, e, n = !1) {
|
|
1119
|
+
const o = getComputedStyle(e), { offsetLeft: i, offsetTop: s } = D(t.nodes, e), r = document.createElementNS(T, "rect");
|
|
1120
|
+
v(r, {
|
|
1105
1121
|
x: i + "",
|
|
1106
|
-
y:
|
|
1122
|
+
y: s + "",
|
|
1107
1123
|
rx: o.borderRadius,
|
|
1108
1124
|
ry: o.borderRadius,
|
|
1109
1125
|
width: o.width,
|
|
@@ -1113,13 +1129,13 @@ function j(t, e, n = !1) {
|
|
|
1113
1129
|
"stroke-width": o.borderWidth
|
|
1114
1130
|
});
|
|
1115
1131
|
const l = document.createElementNS(T, "g");
|
|
1116
|
-
l.appendChild(
|
|
1117
|
-
let
|
|
1118
|
-
return n ?
|
|
1132
|
+
l.appendChild(r);
|
|
1133
|
+
let h;
|
|
1134
|
+
return n ? h = Qe(e, o, i, s) : h = Je(e, o, i, s), l.appendChild(h), l;
|
|
1119
1135
|
}
|
|
1120
1136
|
function tn(t, e) {
|
|
1121
|
-
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e),
|
|
1122
|
-
return v(
|
|
1137
|
+
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = document.createElementNS(T, "a"), r = document.createElementNS(T, "text");
|
|
1138
|
+
return v(r, {
|
|
1123
1139
|
x: o + "",
|
|
1124
1140
|
y: i + parseInt(n.fontSize) + "",
|
|
1125
1141
|
"text-anchor": "start",
|
|
@@ -1127,51 +1143,51 @@ function tn(t, e) {
|
|
|
1127
1143
|
"font-size": `${n.fontSize}`,
|
|
1128
1144
|
"font-weight": `${n.fontWeight}`,
|
|
1129
1145
|
fill: `${n.color}`
|
|
1130
|
-
}),
|
|
1146
|
+
}), r.innerHTML = e.textContent, s.appendChild(r), s.setAttribute("href", e.href), s;
|
|
1131
1147
|
}
|
|
1132
1148
|
function en(t, e) {
|
|
1133
|
-
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e),
|
|
1134
|
-
return v(
|
|
1149
|
+
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = document.createElementNS(T, "image");
|
|
1150
|
+
return v(s, {
|
|
1135
1151
|
x: o + "",
|
|
1136
1152
|
y: i + "",
|
|
1137
1153
|
width: n.width + "",
|
|
1138
1154
|
height: n.height + "",
|
|
1139
1155
|
href: e.src
|
|
1140
|
-
}),
|
|
1156
|
+
}), s;
|
|
1141
1157
|
}
|
|
1142
|
-
const
|
|
1158
|
+
const Y = 100, nn = '<?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">', on = (t, e = !1) => {
|
|
1143
1159
|
var u, g, a;
|
|
1144
|
-
const n = t.nodes, o = n.offsetHeight +
|
|
1160
|
+
const n = t.nodes, o = n.offsetHeight + Y * 2, i = n.offsetWidth + Y * 2, s = Ue(o + "px", i + "px"), r = document.createElementNS(T, "svg"), l = document.createElementNS(T, "rect");
|
|
1145
1161
|
v(l, {
|
|
1146
1162
|
x: "0",
|
|
1147
1163
|
y: "0",
|
|
1148
1164
|
width: `${i}`,
|
|
1149
1165
|
height: `${o}`,
|
|
1150
1166
|
fill: t.theme.cssVar["--bgcolor"]
|
|
1151
|
-
}),
|
|
1152
|
-
const
|
|
1153
|
-
|
|
1167
|
+
}), s.appendChild(l), n.querySelectorAll(".subLines").forEach((c) => {
|
|
1168
|
+
const d = c.cloneNode(!0), { offsetLeft: m, offsetTop: x } = D(n, c.parentElement);
|
|
1169
|
+
d.setAttribute("x", `${m}`), d.setAttribute("y", `${x}`), r.appendChild(d);
|
|
1154
1170
|
});
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1171
|
+
const h = (u = n.querySelector(".lines")) == null ? void 0 : u.cloneNode(!0);
|
|
1172
|
+
h && r.appendChild(h);
|
|
1173
|
+
const f = (g = n.querySelector(".topiclinks")) == null ? void 0 : g.cloneNode(!0);
|
|
1174
|
+
f && r.appendChild(f);
|
|
1159
1175
|
const p = (a = n.querySelector(".summary")) == null ? void 0 : a.cloneNode(!0);
|
|
1160
|
-
return p &&
|
|
1161
|
-
c.nodeObj.dangerouslySetInnerHTML ?
|
|
1176
|
+
return p && r.appendChild(p), n.querySelectorAll("me-tpc").forEach((c) => {
|
|
1177
|
+
c.nodeObj.dangerouslySetInnerHTML ? r.appendChild(R(t, c, !e)) : (r.appendChild(Ze(t, c)), r.appendChild(R(t, c.text, !e)));
|
|
1162
1178
|
}), n.querySelectorAll(".tags > span").forEach((c) => {
|
|
1163
|
-
|
|
1179
|
+
r.appendChild(R(t, c));
|
|
1164
1180
|
}), n.querySelectorAll(".icons > span").forEach((c) => {
|
|
1165
|
-
|
|
1181
|
+
r.appendChild(R(t, c));
|
|
1166
1182
|
}), n.querySelectorAll(".hyper-link").forEach((c) => {
|
|
1167
|
-
|
|
1183
|
+
r.appendChild(tn(t, c));
|
|
1168
1184
|
}), n.querySelectorAll("img").forEach((c) => {
|
|
1169
|
-
|
|
1170
|
-
}), v(
|
|
1171
|
-
x:
|
|
1172
|
-
y:
|
|
1185
|
+
r.appendChild(en(t, c));
|
|
1186
|
+
}), v(r, {
|
|
1187
|
+
x: Y + "",
|
|
1188
|
+
y: Y + "",
|
|
1173
1189
|
overflow: "visible"
|
|
1174
|
-
}),
|
|
1190
|
+
}), s.appendChild(r), s;
|
|
1175
1191
|
}, sn = (t, e) => (e && t.insertAdjacentHTML("afterbegin", "<style>" + e + "</style>"), nn + t.outerHTML);
|
|
1176
1192
|
function rn(t) {
|
|
1177
1193
|
return new Promise((e, n) => {
|
|
@@ -1188,19 +1204,19 @@ const cn = function(t = !1, e) {
|
|
|
1188
1204
|
return new Blob([o], { type: "image/svg+xml" });
|
|
1189
1205
|
}, ln = async function(t = !1, e) {
|
|
1190
1206
|
const n = this.exportSvg(t, e), o = await rn(n);
|
|
1191
|
-
return new Promise((i,
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1207
|
+
return new Promise((i, s) => {
|
|
1208
|
+
const r = new Image();
|
|
1209
|
+
r.setAttribute("crossOrigin", "anonymous"), r.onload = () => {
|
|
1194
1210
|
const l = document.createElement("canvas");
|
|
1195
|
-
l.width =
|
|
1196
|
-
},
|
|
1211
|
+
l.width = r.width, l.height = r.height, l.getContext("2d").drawImage(r, 0, 0), l.toBlob(i, "image/png", 1);
|
|
1212
|
+
}, r.src = o, r.onerror = s;
|
|
1197
1213
|
});
|
|
1198
1214
|
}, an = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1199
1215
|
__proto__: null,
|
|
1200
1216
|
exportPng: ln,
|
|
1201
1217
|
exportSvg: cn
|
|
1202
1218
|
}, Symbol.toStringTag, { value: "Module" })), hn = {}, dn = {
|
|
1203
|
-
getObjById:
|
|
1219
|
+
getObjById: j,
|
|
1204
1220
|
generateNewObj: Et,
|
|
1205
1221
|
layout: kt,
|
|
1206
1222
|
linkDiv: Wt,
|
|
@@ -1226,24 +1242,24 @@ const cn = function(t = !1, e) {
|
|
|
1226
1242
|
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.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, (t = this.selection) == null || t.destroy(), this.selection = void 0;
|
|
1227
1243
|
}
|
|
1228
1244
|
};
|
|
1229
|
-
function fn({ pT: t, pL: e, pW: n, pH: o, cT: i, cL:
|
|
1245
|
+
function fn({ pT: t, pL: e, pW: n, pH: o, cT: i, cL: s, cW: r, cH: l, direction: h, containerHeight: f }) {
|
|
1230
1246
|
let p = e + n / 2;
|
|
1231
1247
|
const u = t + o / 2;
|
|
1232
1248
|
let g;
|
|
1233
|
-
|
|
1234
|
-
const a = i + l / 2,
|
|
1235
|
-
return
|
|
1249
|
+
h === H.LHS ? g = s + r : g = s;
|
|
1250
|
+
const a = i + l / 2, d = (1 - Math.abs(a - u) / f) * 0.25 * (n / 2);
|
|
1251
|
+
return h === H.LHS ? p = p - n / 10 - d : p = p + n / 10 + d, `M ${p} ${u} Q ${p} ${a} ${g} ${a}`;
|
|
1236
1252
|
}
|
|
1237
|
-
function pn({ pT: t, pL: e, pW: n, pH: o, cT: i, cL:
|
|
1253
|
+
function pn({ pT: t, pL: e, pW: n, pH: o, cT: i, cL: s, cW: r, cH: l, direction: h, isFirst: f }) {
|
|
1238
1254
|
const p = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
|
|
1239
1255
|
let u = 0, g = 0;
|
|
1240
|
-
|
|
1256
|
+
f ? u = t + o / 2 : u = t + o;
|
|
1241
1257
|
const a = i + l;
|
|
1242
|
-
let c = 0,
|
|
1243
|
-
const
|
|
1244
|
-
return
|
|
1258
|
+
let c = 0, d = 0, m = 0;
|
|
1259
|
+
const x = Math.abs(u - a) / 300 * p;
|
|
1260
|
+
return h === H.LHS ? (m = e, c = m + p, d = m - p, g = s + p, `M ${c} ${u} C ${m} ${u} ${m + x} ${a} ${d} ${a} H ${g}`) : (m = e + n, c = m - p, d = m + p, g = s + r - p, `M ${c} ${u} C ${m} ${u} ${m - x} ${a} ${d} ${a} H ${g}`);
|
|
1245
1261
|
}
|
|
1246
|
-
const un = "5.0.
|
|
1262
|
+
const un = "5.0.6";
|
|
1247
1263
|
function gn(t) {
|
|
1248
1264
|
return {
|
|
1249
1265
|
x: 0,
|
|
@@ -1255,31 +1271,31 @@ function gn(t) {
|
|
|
1255
1271
|
this.mousedown && (this.moved = !0, t.move(e, n));
|
|
1256
1272
|
},
|
|
1257
1273
|
clear() {
|
|
1258
|
-
this.mousedown = !1
|
|
1274
|
+
this.mousedown = !1;
|
|
1259
1275
|
}
|
|
1260
1276
|
};
|
|
1261
1277
|
}
|
|
1262
1278
|
const O = document;
|
|
1263
|
-
function
|
|
1279
|
+
function A({
|
|
1264
1280
|
el: t,
|
|
1265
1281
|
direction: e,
|
|
1266
1282
|
locale: n,
|
|
1267
1283
|
draggable: o,
|
|
1268
1284
|
editable: i,
|
|
1269
|
-
contextMenu:
|
|
1270
|
-
toolBar:
|
|
1285
|
+
contextMenu: s,
|
|
1286
|
+
toolBar: r,
|
|
1271
1287
|
keypress: l,
|
|
1272
|
-
mouseSelectionButton:
|
|
1273
|
-
selectionContainer:
|
|
1288
|
+
mouseSelectionButton: h,
|
|
1289
|
+
selectionContainer: f,
|
|
1274
1290
|
before: p,
|
|
1275
1291
|
newTopicName: u,
|
|
1276
1292
|
allowUndo: g,
|
|
1277
1293
|
generateMainBranch: a,
|
|
1278
1294
|
generateSubBranch: c,
|
|
1279
|
-
overflowHidden:
|
|
1295
|
+
overflowHidden: d,
|
|
1280
1296
|
theme: m,
|
|
1281
|
-
alignment:
|
|
1282
|
-
scaleSensitivity:
|
|
1297
|
+
alignment: x,
|
|
1298
|
+
scaleSensitivity: w,
|
|
1283
1299
|
scaleMax: y,
|
|
1284
1300
|
scaleMin: S,
|
|
1285
1301
|
handleWheel: E
|
|
@@ -1288,28 +1304,26 @@ function M({
|
|
|
1288
1304
|
const C = Object.prototype.toString.call(t);
|
|
1289
1305
|
if (C === "[object HTMLDivElement]" ? b = t : C === "[object String]" && (b = document.querySelector(t)), !b)
|
|
1290
1306
|
throw new Error("MindElixir: el is not a valid element");
|
|
1291
|
-
b.style.position = "relative", b.innerHTML = "", this.el = b, this.disposable = [], this.before = p || {}, this.locale = n || "en", this.newTopicName = u || "New Node", this.contextMenu =
|
|
1307
|
+
b.style.position = "relative", b.innerHTML = "", this.el = b, this.disposable = [], this.before = p || {}, this.locale = n || "en", this.newTopicName = u || "New Node", this.contextMenu = s ?? !0, this.toolBar = r ?? !0, this.keypress = l ?? !0, this.mouseSelectionButton = h ?? 0, this.direction = e ?? 1, this.draggable = o ?? !0, this.editable = i ?? !0, this.allowUndo = g ?? !0, this.scaleSensitivity = w ?? 0.1, this.scaleMax = y ?? 1.4, this.scaleMin = S ?? 0.2, this.generateMainBranch = a || fn, this.generateSubBranch = c || pn, this.overflowHidden = d ?? !1, this.alignment = x ?? "root", this.handleWheel = E ?? !0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = gn(this), this.bus = Lt(), this.container = O.createElement("div"), this.selectionContainer = f || this.container, this.container.className = "map-container";
|
|
1292
1308
|
const $ = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1293
1309
|
this.theme = m || ($.matches ? Z : Q);
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1296
|
-
A.style.transition = "all 0.3s";
|
|
1297
|
-
}, 300), this.map = A, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = O.createElement("me-nodes"), this.lines = W("lines"), this.summarySvg = W("summary"), this.linkController = W("linkcontroller"), this.P2 = O.createElement("div"), this.P3 = O.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = at(), this.line2 = at(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = W("topiclinks"), this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(Tt(this));
|
|
1310
|
+
const M = O.createElement("div");
|
|
1311
|
+
M.className = "map-canvas", this.map = M, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = O.createElement("me-nodes"), this.lines = W("lines"), this.summarySvg = W("summary"), this.linkController = W("linkcontroller"), this.P2 = O.createElement("div"), this.P3 = O.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = at(), this.line2 = at(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = W("topiclinks"), this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(Tt(this));
|
|
1298
1312
|
}
|
|
1299
|
-
|
|
1300
|
-
Object.defineProperty(
|
|
1313
|
+
A.prototype = dn;
|
|
1314
|
+
Object.defineProperty(A.prototype, "currentNode", {
|
|
1301
1315
|
get() {
|
|
1302
1316
|
return this.currentNodes[this.currentNodes.length - 1];
|
|
1303
1317
|
},
|
|
1304
1318
|
enumerable: !0
|
|
1305
1319
|
});
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1320
|
+
A.LEFT = 0;
|
|
1321
|
+
A.RIGHT = 1;
|
|
1322
|
+
A.SIDE = 2;
|
|
1323
|
+
A.THEME = Q;
|
|
1324
|
+
A.DARK_THEME = Z;
|
|
1325
|
+
A.version = un;
|
|
1326
|
+
A.E = gt;
|
|
1313
1327
|
export {
|
|
1314
|
-
|
|
1328
|
+
A as default
|
|
1315
1329
|
};
|