mind-elixir 4.1.1 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MindElixir.iife.js +5 -5
- package/dist/MindElixir.js +427 -415
- package/dist/MindElixirLite.iife.js +1 -1
- package/dist/MindElixirLite.js +1 -1
- package/package.json +1 -1
package/dist/MindElixir.js
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
s.readyState == "complete" && (s.onreadystatechange = null, h());
|
|
30
30
|
});
|
|
31
31
|
})(window);
|
|
32
|
-
const
|
|
32
|
+
const L = 0, z = 1, ce = 2, D = 30, $e = {
|
|
33
33
|
name: "Latte",
|
|
34
34
|
palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
|
|
35
35
|
cssVar: {
|
|
@@ -41,7 +41,7 @@ const k = 0, z = 1, re = 2, D = 30, De = {
|
|
|
41
41
|
"--panel-bgcolor": "#ffffff",
|
|
42
42
|
"--panel-border-color": "#eaeaea"
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, Oe = {
|
|
45
45
|
name: "Dark",
|
|
46
46
|
palette: ["#848FA0", "#748BE9", "#D2F9FE", "#4145A5", "#789AFA", "#706CF4", "#EF987F", "#775DD5", "#FCEECF", "#DA7FBC"],
|
|
47
47
|
cssVar: {
|
|
@@ -54,15 +54,15 @@ const k = 0, z = 1, re = 2, D = 30, De = {
|
|
|
54
54
|
"--panel-border-color": "#696969"
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
function
|
|
57
|
+
function oe(e) {
|
|
58
58
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const tt = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), se = function(e, t) {
|
|
61
61
|
if (t.id === e)
|
|
62
62
|
return t;
|
|
63
63
|
if (t.children && t.children.length) {
|
|
64
64
|
for (let n = 0; n < t.children.length; n++) {
|
|
65
|
-
const o =
|
|
65
|
+
const o = se(e, t.children[n]);
|
|
66
66
|
if (o)
|
|
67
67
|
return o;
|
|
68
68
|
}
|
|
@@ -74,18 +74,18 @@ const et = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/
|
|
|
74
74
|
for (let n = 0; n < e.children.length; n++)
|
|
75
75
|
$(e.children[n], e);
|
|
76
76
|
};
|
|
77
|
-
function
|
|
77
|
+
function ue(e) {
|
|
78
78
|
if (e.id = G(), e.children)
|
|
79
79
|
for (let t = 0; t < e.children.length; t++)
|
|
80
|
-
|
|
80
|
+
ue(e.children[t]);
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const nt = (e, t) => {
|
|
83
83
|
let n = Date.now();
|
|
84
84
|
return function(...o) {
|
|
85
85
|
Date.now() - n < t || (e(...o), n = Date.now());
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
|
-
function
|
|
88
|
+
function Pe(e, t, n, o) {
|
|
89
89
|
const s = o - t, i = e - n;
|
|
90
90
|
let r = Math.atan(Math.abs(s) / Math.abs(i)) / 3.14 * 180;
|
|
91
91
|
i < 0 && s > 0 && (r = 180 - r), i < 0 && s < 0 && (r = 180 + r), i > 0 && s < 0 && (r = 360 - r);
|
|
@@ -100,14 +100,14 @@ function Oe(e, t, n, o) {
|
|
|
100
100
|
function G() {
|
|
101
101
|
return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16);
|
|
102
102
|
}
|
|
103
|
-
const
|
|
103
|
+
const ot = function() {
|
|
104
104
|
const e = G();
|
|
105
105
|
return {
|
|
106
106
|
topic: this.newTopicName,
|
|
107
107
|
id: e
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
|
-
function
|
|
110
|
+
function fe(e) {
|
|
111
111
|
return JSON.parse(
|
|
112
112
|
JSON.stringify(e, (n, o) => {
|
|
113
113
|
if (n !== "parent")
|
|
@@ -123,7 +123,7 @@ const O = (e, t) => {
|
|
|
123
123
|
}, N = (e, t) => {
|
|
124
124
|
for (const n in t)
|
|
125
125
|
e.setAttribute(n, t[n]);
|
|
126
|
-
},
|
|
126
|
+
}, ae = (e) => e ? e.tagName === "ME-TPC" : !1, le = (e) => e.filter((t) => {
|
|
127
127
|
for (let n = 0; n < e.length; n++) {
|
|
128
128
|
if (t === e[n])
|
|
129
129
|
continue;
|
|
@@ -131,7 +131,7 @@ const O = (e, t) => {
|
|
|
131
131
|
return !1;
|
|
132
132
|
}
|
|
133
133
|
return !0;
|
|
134
|
-
}),
|
|
134
|
+
}), k = {
|
|
135
135
|
moved: !1,
|
|
136
136
|
// diffrentiate click and move
|
|
137
137
|
mousedown: !1,
|
|
@@ -146,7 +146,7 @@ const O = (e, t) => {
|
|
|
146
146
|
this.moved = !1, this.mousedown = !1;
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
|
-
function
|
|
149
|
+
function st(e) {
|
|
150
150
|
e.map.addEventListener("click", (t) => {
|
|
151
151
|
var o, s;
|
|
152
152
|
if (t.button !== 0)
|
|
@@ -159,15 +159,15 @@ function ot(e) {
|
|
|
159
159
|
e.helper2.clear();
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
if (
|
|
163
|
-
|
|
162
|
+
if (k.moved) {
|
|
163
|
+
k.clear();
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
e.clearSelection();
|
|
167
167
|
const n = t.target;
|
|
168
168
|
if (n.tagName === "ME-EPD")
|
|
169
169
|
e.expandNode(n.previousSibling);
|
|
170
|
-
else if (
|
|
170
|
+
else if (ae(n))
|
|
171
171
|
e.selectNode(n, !1, t);
|
|
172
172
|
else if (e.editable)
|
|
173
173
|
n.tagName === "text" ? n.dataset.type === "custom-link" ? e.selectArrow(n.parentElement) : e.selectSummary(n.parentElement) : n.className;
|
|
@@ -177,23 +177,23 @@ function ot(e) {
|
|
|
177
177
|
if (t.preventDefault(), !e.editable)
|
|
178
178
|
return;
|
|
179
179
|
const n = t.target;
|
|
180
|
-
|
|
180
|
+
ae(n) ? e.beginEdit(n) : n.tagName === "text" && (n.dataset.type === "custom-link" ? e.editArrowLabel(n.parentElement) : e.editSummary(n.parentElement));
|
|
181
181
|
}), e.map.addEventListener("mousemove", (t) => {
|
|
182
|
-
t.target.contentEditable !== "true" &&
|
|
182
|
+
t.target.contentEditable !== "true" && k.onMove(t, e.container);
|
|
183
183
|
}), e.map.addEventListener("mousedown", (t) => {
|
|
184
184
|
const n = e.mouseSelectionButton === 0 ? 2 : 0;
|
|
185
|
-
t.button === n && t.target.contentEditable !== "true" && (
|
|
185
|
+
t.button === n && t.target.contentEditable !== "true" && (k.moved = !1, k.mousedown = !0);
|
|
186
186
|
}), e.map.addEventListener("mouseleave", (t) => {
|
|
187
187
|
const n = e.mouseSelectionButton === 0 ? 2 : 0;
|
|
188
|
-
t.button === n &&
|
|
188
|
+
t.button === n && k.clear();
|
|
189
189
|
}), e.map.addEventListener("mouseup", (t) => {
|
|
190
190
|
const n = e.mouseSelectionButton === 0 ? 2 : 0;
|
|
191
|
-
t.button === n &&
|
|
191
|
+
t.button === n && k.clear();
|
|
192
192
|
}), e.map.addEventListener("contextmenu", (t) => {
|
|
193
193
|
t.preventDefault();
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
-
const
|
|
196
|
+
const it = {
|
|
197
197
|
create() {
|
|
198
198
|
return {
|
|
199
199
|
handlers: {},
|
|
@@ -221,32 +221,32 @@ const st = {
|
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
},
|
|
224
|
+
}, ie = document, rt = function() {
|
|
225
225
|
this.nodes.innerHTML = "";
|
|
226
226
|
const e = this.createTopic(this.nodeData);
|
|
227
|
-
|
|
228
|
-
const t =
|
|
227
|
+
pe(e, this.nodeData), e.draggable = !1;
|
|
228
|
+
const t = ie.createElement("me-root");
|
|
229
229
|
t.appendChild(e);
|
|
230
230
|
const n = this.nodeData.children || [];
|
|
231
|
-
if (this.direction ===
|
|
231
|
+
if (this.direction === ce) {
|
|
232
232
|
let o = 0, s = 0;
|
|
233
233
|
n.map((i) => {
|
|
234
|
-
i.direction ===
|
|
234
|
+
i.direction === L ? o += 1 : i.direction === z ? s += 1 : o <= s ? (i.direction = L, o += 1) : (i.direction = z, s += 1);
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
|
-
|
|
238
|
-
},
|
|
239
|
-
const o =
|
|
237
|
+
ct(this, n, t);
|
|
238
|
+
}, ct = function(e, t, n) {
|
|
239
|
+
const o = ie.createElement("me-main");
|
|
240
240
|
o.className = "lhs";
|
|
241
|
-
const s =
|
|
241
|
+
const s = ie.createElement("me-main");
|
|
242
242
|
s.className = "rhs";
|
|
243
243
|
for (let i = 0; i < t.length; i++) {
|
|
244
244
|
const r = t[i], { grp: c } = e.createWrapper(r);
|
|
245
|
-
e.direction ===
|
|
245
|
+
e.direction === ce ? r.direction === L ? o.appendChild(c) : s.appendChild(c) : e.direction === L ? o.appendChild(c) : s.appendChild(c);
|
|
246
246
|
}
|
|
247
247
|
e.nodes.appendChild(o), e.nodes.appendChild(n), e.nodes.appendChild(s), e.nodes.appendChild(e.lines);
|
|
248
|
-
},
|
|
249
|
-
const n =
|
|
248
|
+
}, lt = function(e, t) {
|
|
249
|
+
const n = ie.createElement("me-children");
|
|
250
250
|
for (let o = 0; o < t.length; o++) {
|
|
251
251
|
const s = t[o], { grp: i } = e.createWrapper(s);
|
|
252
252
|
n.appendChild(i);
|
|
@@ -257,7 +257,7 @@ const st = {
|
|
|
257
257
|
if (!o)
|
|
258
258
|
throw new Error(`FindEle: Node ${e} not found, maybe it's collapsed.`);
|
|
259
259
|
return o;
|
|
260
|
-
},
|
|
260
|
+
}, pe = function(e, t) {
|
|
261
261
|
if (e.innerHTML = "", t.style && (e.style.color = t.style.color || "", e.style.background = t.style.background || "", e.style.fontSize = t.style.fontSize + "px", e.style.fontWeight = t.style.fontWeight || "normal"), t.dangerouslySetInnerHTML) {
|
|
262
262
|
e.innerHTML = t.dangerouslySetInnerHTML;
|
|
263
263
|
return;
|
|
@@ -281,45 +281,45 @@ const st = {
|
|
|
281
281
|
e.linkContainer && (e.linkContainer = void 0);
|
|
282
282
|
if (t.icons && t.icons.length) {
|
|
283
283
|
const n = S.createElement("span");
|
|
284
|
-
n.className = "icons", n.innerHTML = t.icons.map((o) => `<span>${
|
|
284
|
+
n.className = "icons", n.innerHTML = t.icons.map((o) => `<span>${oe(o)}</span>`).join(""), e.appendChild(n), e.icons = n;
|
|
285
285
|
} else
|
|
286
286
|
e.icons && (e.icons = void 0);
|
|
287
287
|
if (t.tags && t.tags.length) {
|
|
288
288
|
const n = S.createElement("div");
|
|
289
|
-
n.className = "tags", n.innerHTML = t.tags.map((o) => `<span>${
|
|
289
|
+
n.className = "tags", n.innerHTML = t.tags.map((o) => `<span>${oe(o)}</span>`).join(""), e.appendChild(n), e.tags = n;
|
|
290
290
|
} else
|
|
291
291
|
e.tags && (e.tags = void 0);
|
|
292
|
-
},
|
|
292
|
+
}, at = function(e, t) {
|
|
293
293
|
const n = S.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(e);
|
|
294
294
|
if (n.appendChild(o), !t && e.children && e.children.length > 0) {
|
|
295
|
-
const i =
|
|
295
|
+
const i = me(e.expanded);
|
|
296
296
|
if (o.appendChild(i), e.expanded !== !1) {
|
|
297
|
-
const r =
|
|
297
|
+
const r = lt(this, e.children);
|
|
298
298
|
n.appendChild(r);
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
return { grp: n, top: o, tpc: s };
|
|
302
|
-
}, at = function(e) {
|
|
303
|
-
const t = S.createElement("me-parent"), n = this.createTopic(e);
|
|
304
|
-
return fe(n, e), t.appendChild(n), { p: t, tpc: n };
|
|
305
302
|
}, dt = function(e) {
|
|
303
|
+
const t = S.createElement("me-parent"), n = this.createTopic(e);
|
|
304
|
+
return pe(n, e), t.appendChild(n), { p: t, tpc: n };
|
|
305
|
+
}, ht = function(e) {
|
|
306
306
|
const t = S.createElement("me-children");
|
|
307
307
|
return t.append(...e), t;
|
|
308
|
-
},
|
|
308
|
+
}, ut = function(e) {
|
|
309
309
|
const t = S.createElement("me-tpc");
|
|
310
310
|
return t.nodeObj = e, t.dataset.nodeid = "me" + e.id, t.draggable = this.draggable, t;
|
|
311
311
|
};
|
|
312
|
-
function
|
|
312
|
+
function He(e) {
|
|
313
313
|
const t = S.createRange();
|
|
314
314
|
t.selectNodeContents(e);
|
|
315
315
|
const n = window.getSelection();
|
|
316
316
|
n && (n.removeAllRanges(), n.addRange(t));
|
|
317
317
|
}
|
|
318
|
-
const
|
|
318
|
+
const ft = function(e) {
|
|
319
319
|
if (!e)
|
|
320
320
|
return;
|
|
321
321
|
const t = S.createElement("div"), n = e.text.textContent;
|
|
322
|
-
e.appendChild(t), t.id = "input-box", t.textContent = n, t.contentEditable = "true", t.spellcheck = !1, t.style.cssText = `min-width:${e.offsetWidth - 8}px;`, this.direction ===
|
|
322
|
+
e.appendChild(t), t.id = "input-box", t.textContent = n, t.contentEditable = "true", t.spellcheck = !1, t.style.cssText = `min-width:${e.offsetWidth - 8}px;`, this.direction === L && (t.style.right = "0"), t.focus(), He(t), this.bus.fire("operation", {
|
|
323
323
|
name: "beginEdit",
|
|
324
324
|
obj: e.nodeObj
|
|
325
325
|
}), t.addEventListener("keydown", (o) => {
|
|
@@ -341,10 +341,10 @@ const ut = function(e) {
|
|
|
341
341
|
origin: n
|
|
342
342
|
}));
|
|
343
343
|
});
|
|
344
|
-
},
|
|
344
|
+
}, me = function(e) {
|
|
345
345
|
const t = S.createElement("me-epd");
|
|
346
346
|
return t.expanded = e !== !1, t.className = e !== !1 ? "minus" : "", t;
|
|
347
|
-
}, K = document, V = "http://www.w3.org/2000/svg",
|
|
347
|
+
}, K = document, V = "http://www.w3.org/2000/svg", Be = function(e, t, n) {
|
|
348
348
|
const o = K.createElementNS(V, "path");
|
|
349
349
|
return N(o, {
|
|
350
350
|
d: e,
|
|
@@ -355,10 +355,10 @@ const ut = function(e) {
|
|
|
355
355
|
}, X = function(e) {
|
|
356
356
|
const t = K.createElementNS(V, "svg");
|
|
357
357
|
return t.setAttribute("class", e), t.setAttribute("overflow", "visible"), t;
|
|
358
|
-
},
|
|
358
|
+
}, ye = function() {
|
|
359
359
|
const e = K.createElementNS(V, "line");
|
|
360
360
|
return e.setAttribute("stroke", "#bbb"), e.setAttribute("fill", "none"), e.setAttribute("stroke-width", "2"), e;
|
|
361
|
-
},
|
|
361
|
+
}, pt = function(e, t) {
|
|
362
362
|
const n = {
|
|
363
363
|
stroke: "rgb(235, 95, 82)",
|
|
364
364
|
fill: "none",
|
|
@@ -373,7 +373,7 @@ const ut = function(e) {
|
|
|
373
373
|
...n,
|
|
374
374
|
"stroke-dasharray": "8,2"
|
|
375
375
|
}), o.appendChild(s), o.appendChild(i), o;
|
|
376
|
-
},
|
|
376
|
+
}, ze = function(e, t, n) {
|
|
377
377
|
if (!t)
|
|
378
378
|
return;
|
|
379
379
|
const o = document.createElement("div");
|
|
@@ -383,7 +383,7 @@ const ut = function(e) {
|
|
|
383
383
|
const i = t.getAttribute("x"), r = t.getAttribute("y");
|
|
384
384
|
o.style.cssText = `min-width:88px;position:absolute;left:${i}px;top:${r}px;`;
|
|
385
385
|
const c = t.getAttribute("text-anchor");
|
|
386
|
-
c === "end" ? o.style.cssText += "transform: translate(-100%, -100%);" : c === "middle" ? o.style.cssText += "transform: translate(-50%, -100%);" : o.style.cssText += "transform: translate(0, -100%);", o.focus(),
|
|
386
|
+
c === "end" ? o.style.cssText += "transform: translate(-100%, -100%);" : c === "middle" ? o.style.cssText += "transform: translate(-50%, -100%);" : o.style.cssText += "transform: translate(0, -100%);", o.focus(), He(o), o.addEventListener("keydown", (l) => {
|
|
387
387
|
l.stopPropagation();
|
|
388
388
|
const h = l.key;
|
|
389
389
|
if (h === "Enter" || h === "Tab") {
|
|
@@ -394,38 +394,38 @@ const ut = function(e) {
|
|
|
394
394
|
}), o.addEventListener("blur", () => {
|
|
395
395
|
o && n(o);
|
|
396
396
|
});
|
|
397
|
-
},
|
|
397
|
+
}, mt = function(e) {
|
|
398
398
|
const t = this.map.querySelector("me-root"), n = t.offsetTop, o = t.offsetLeft, s = t.offsetWidth, i = t.offsetHeight;
|
|
399
399
|
this.nodes.style.top = `${1e4 - this.nodes.offsetHeight / 2}px`, this.nodes.style.left = `${1e4 - o - s / 2}px`;
|
|
400
400
|
const r = this.map.querySelectorAll("me-main > me-wrapper");
|
|
401
401
|
this.lines.innerHTML = "";
|
|
402
402
|
for (let c = 0; c < r.length; c++) {
|
|
403
403
|
const l = r[c], h = l.querySelector("me-tpc"), { offsetLeft: a, offsetTop: u } = O(this.nodes, h), d = h.offsetWidth, m = h.offsetHeight, g = l.parentNode.className, p = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: u, cL: a, cW: d, cH: m, direction: g, containerHeight: this.nodes.offsetHeight }), f = this.theme.palette, v = h.nodeObj.branchColor || f[c % f.length];
|
|
404
|
-
h.style.borderColor = v, this.lines.appendChild(
|
|
404
|
+
h.style.borderColor = v, this.lines.appendChild(Be(p, v, "3"));
|
|
405
405
|
const b = l.children[0].children[1];
|
|
406
406
|
if (b && (b.style.top = (b.parentNode.offsetHeight - b.offsetHeight) / 2 + "px", g === "lhs" ? b.style.left = "-10px" : b.style.right = "-10px"), e && e !== l)
|
|
407
407
|
continue;
|
|
408
408
|
const y = X("subLines"), x = l.lastChild;
|
|
409
|
-
x.tagName === "svg" && x.remove(), l.appendChild(y),
|
|
409
|
+
x.tagName === "svg" && x.remove(), l.appendChild(y), Re(this, y, v, l, g, !0);
|
|
410
410
|
}
|
|
411
411
|
this.renderArrow(), this.renderSummary();
|
|
412
|
-
},
|
|
412
|
+
}, Re = function(e, t, n, o, s, i) {
|
|
413
413
|
const r = o.firstChild, c = o.children[1].children;
|
|
414
414
|
if (c.length === 0)
|
|
415
415
|
return;
|
|
416
416
|
const l = r.offsetTop, h = r.offsetLeft, a = r.offsetWidth, u = r.offsetHeight;
|
|
417
417
|
for (let d = 0; d < c.length; d++) {
|
|
418
418
|
const m = c[d], g = m.firstChild, p = g.offsetTop, f = g.offsetLeft, v = g.offsetWidth, b = g.offsetHeight, y = g.firstChild.nodeObj.branchColor || n, x = e.generateSubBranch({ pT: l, pL: h, pW: a, pH: u, cT: p, cL: f, cW: v, cH: b, direction: s, isFirst: i });
|
|
419
|
-
t.appendChild(
|
|
419
|
+
t.appendChild(Be(x, y, "2"));
|
|
420
420
|
const w = g.children[1];
|
|
421
421
|
if (w) {
|
|
422
422
|
if (w.style.bottom = -(w.offsetHeight / 2) + "px", s === "lhs" ? w.style.left = "10px" : s === "rhs" && (w.style.right = "10px"), !w.expanded)
|
|
423
423
|
continue;
|
|
424
424
|
} else
|
|
425
425
|
continue;
|
|
426
|
-
|
|
426
|
+
Re(e, t, y, m, s);
|
|
427
427
|
}
|
|
428
|
-
},
|
|
428
|
+
}, xe = {
|
|
429
429
|
addChild: "插入子节点",
|
|
430
430
|
addParent: "插入父节点",
|
|
431
431
|
addSibling: "插入同级节点",
|
|
@@ -437,9 +437,9 @@ const ut = function(e) {
|
|
|
437
437
|
link: "连接",
|
|
438
438
|
clickTips: "请点击目标节点",
|
|
439
439
|
summary: "摘要"
|
|
440
|
-
},
|
|
441
|
-
cn:
|
|
442
|
-
zh_CN:
|
|
440
|
+
}, we = {
|
|
441
|
+
cn: xe,
|
|
442
|
+
zh_CN: xe,
|
|
443
443
|
zh_TW: {
|
|
444
444
|
addChild: "插入子節點",
|
|
445
445
|
addParent: "插入父節點",
|
|
@@ -532,14 +532,14 @@ const ut = function(e) {
|
|
|
532
532
|
summary: "Resumen"
|
|
533
533
|
}
|
|
534
534
|
};
|
|
535
|
-
function
|
|
535
|
+
function gt(e, t) {
|
|
536
536
|
const n = (y) => {
|
|
537
537
|
const x = document.createElement("div");
|
|
538
538
|
return x.innerText = y, x.className = "tips", x;
|
|
539
539
|
}, o = (y, x, w) => {
|
|
540
540
|
const _ = document.createElement("li");
|
|
541
|
-
return _.id = y, _.innerHTML = `<span>${
|
|
542
|
-
}, s =
|
|
541
|
+
return _.id = y, _.innerHTML = `<span>${oe(x)}</span><span>${oe(w)}</span>`, _;
|
|
542
|
+
}, s = we[e.locale] ? e.locale : "en", i = we[s], r = o("cm-add_child", i.addChild, "tab"), c = o("cm-add_parent", i.addParent, ""), l = o("cm-add_sibling", i.addSibling, "enter"), h = o("cm-remove_child", i.removeNode, "delete"), a = o("cm-fucus", i.focus, ""), u = o("cm-unfucus", i.cancelFocus, ""), d = o("cm-up", i.moveUp, "PgUp"), m = o("cm-down", i.moveDown, "Pgdn"), g = o("cm-link", i.link, ""), p = o("cm-summary", i.summary, ""), f = document.createElement("ul");
|
|
543
543
|
if (f.className = "menu-list", f.appendChild(r), f.appendChild(c), f.appendChild(l), f.appendChild(h), (!t || t.focus) && (f.appendChild(a), f.appendChild(u)), f.appendChild(d), f.appendChild(m), f.appendChild(p), (!t || t.link) && f.appendChild(g), t && t.extend)
|
|
544
544
|
for (let y = 0; y < t.extend.length; y++) {
|
|
545
545
|
const x = t.extend[y], w = o(x.name, x.name, x.key || "");
|
|
@@ -554,8 +554,8 @@ function mt(e, t) {
|
|
|
554
554
|
if (y.preventDefault(), !e.editable)
|
|
555
555
|
return;
|
|
556
556
|
const x = y.target;
|
|
557
|
-
if (
|
|
558
|
-
x.parentElement.tagName === "ME-ROOT" ? b = !0 : b = !1, b ? (a.className = "disabled", d.className = "disabled", m.className = "disabled", c.className = "disabled", l.className = "disabled", h.className = "disabled") : (a.className = "", d.className = "", m.className = "", c.className = "", l.className = "", h.className = ""), e.currentNodes || e.selectNode(x), v.hidden = !1,
|
|
557
|
+
if (ae(x)) {
|
|
558
|
+
x.parentElement.tagName === "ME-ROOT" ? b = !0 : b = !1, b ? (a.className = "disabled", d.className = "disabled", m.className = "disabled", c.className = "disabled", l.className = "disabled", h.className = "disabled") : (a.className = "", d.className = "", m.className = "", c.className = "", l.className = "", h.className = ""), e.currentNodes || e.selectNode(x), v.hidden = !1, k.mousedown && (k.mousedown = !1), f.style.top = "", f.style.bottom = "", f.style.left = "", f.style.right = "";
|
|
559
559
|
const w = f.getBoundingClientRect(), _ = f.offsetHeight, P = f.offsetWidth, U = y.clientY - w.top, H = y.clientX - w.left;
|
|
560
560
|
_ + U > window.innerHeight ? (f.style.top = "", f.style.bottom = "0px") : (f.style.bottom = "", f.style.top = U + 15 + "px"), P + H > window.innerWidth ? (f.style.left = "", f.style.right = "0px") : (f.style.right = "", f.style.left = H + 10 + "px");
|
|
561
561
|
}
|
|
@@ -597,123 +597,127 @@ function mt(e, t) {
|
|
|
597
597
|
r.onclick = null, c.onclick = null, l.onclick = null, h.onclick = null, a.onclick = null, u.onclick = null, d.onclick = null, m.onclick = null, g.onclick = null, p.onclick = null, v.onclick = null, e.container.oncontextmenu = null;
|
|
598
598
|
};
|
|
599
599
|
}
|
|
600
|
-
const
|
|
600
|
+
const vt = (e) => {
|
|
601
601
|
const t = e.map.querySelectorAll(".lhs>me-wrapper>me-parent>me-tpc");
|
|
602
602
|
e.selectNode(t[Math.ceil(t.length / 2) - 1]);
|
|
603
|
-
},
|
|
603
|
+
}, bt = (e) => {
|
|
604
604
|
const t = e.map.querySelectorAll(".rhs>me-wrapper>me-parent>me-tpc");
|
|
605
605
|
e.selectNode(t[Math.ceil(t.length / 2) - 1]);
|
|
606
|
-
},
|
|
606
|
+
}, yt = (e) => {
|
|
607
607
|
e.selectNode(e.map.querySelector("me-root>me-tpc"));
|
|
608
|
-
},
|
|
608
|
+
}, xt = function(e, t) {
|
|
609
609
|
const n = t.parentElement.parentElement.parentElement.previousSibling;
|
|
610
610
|
if (n) {
|
|
611
611
|
const o = n.firstChild;
|
|
612
612
|
e.selectNode(o);
|
|
613
613
|
}
|
|
614
|
-
},
|
|
614
|
+
}, wt = function(e, t) {
|
|
615
615
|
const n = t.parentElement.nextSibling;
|
|
616
616
|
if (n && n.firstChild) {
|
|
617
617
|
const o = n.firstChild.firstChild.firstChild;
|
|
618
618
|
e.selectNode(o);
|
|
619
619
|
}
|
|
620
|
-
},
|
|
620
|
+
}, Ee = function(e, t) {
|
|
621
621
|
var i, r;
|
|
622
622
|
const n = e.currentNode || ((i = e.currentNodes) == null ? void 0 : i[0]);
|
|
623
623
|
if (!n)
|
|
624
624
|
return;
|
|
625
625
|
const o = n.nodeObj, s = n.offsetParent.offsetParent.parentElement;
|
|
626
|
-
o.parent ? s.className === t ?
|
|
627
|
-
},
|
|
626
|
+
o.parent ? s.className === t ? wt(e, n) : (r = o.parent) != null && r.parent ? xt(e, n) : yt(e) : t === "lhs" ? vt(e) : bt(e);
|
|
627
|
+
}, Ne = function(e, t) {
|
|
628
628
|
var r;
|
|
629
629
|
const n = e.currentNode || ((r = e.currentNodes) == null ? void 0 : r[0]);
|
|
630
630
|
if (!n || !n.nodeObj.parent)
|
|
631
631
|
return;
|
|
632
632
|
const s = t + "Sibling", i = n.parentElement.parentElement[s];
|
|
633
633
|
i && e.selectNode(i.firstChild.firstChild);
|
|
634
|
+
}, Q = function(e, t, n = 1) {
|
|
635
|
+
switch (t) {
|
|
636
|
+
case "in":
|
|
637
|
+
if (e.scaleVal * n > 1.6)
|
|
638
|
+
return;
|
|
639
|
+
e.scale(e.scaleVal += 0.2);
|
|
640
|
+
break;
|
|
641
|
+
case "out":
|
|
642
|
+
if (e.scaleVal * n < 0.6)
|
|
643
|
+
return;
|
|
644
|
+
e.scale(e.scaleVal -= 0.2);
|
|
645
|
+
}
|
|
634
646
|
};
|
|
635
|
-
function
|
|
647
|
+
function Et(e) {
|
|
636
648
|
const t = () => {
|
|
637
649
|
e.currentArrow ? e.removeArrow() : e.currentSummary ? e.removeSummary(e.currentSummary.summaryObj.id) : e.currentNode ? e.removeNode() : e.currentNodes && e.removeNodes(e.currentNodes);
|
|
638
650
|
}, n = {
|
|
639
|
-
|
|
651
|
+
Enter: (o) => {
|
|
640
652
|
o.shiftKey ? e.insertSibling("before") : o.ctrlKey ? e.insertParent() : e.insertSibling("after");
|
|
641
653
|
},
|
|
642
|
-
|
|
654
|
+
Tab: () => {
|
|
643
655
|
e.addChild();
|
|
644
656
|
},
|
|
645
|
-
|
|
657
|
+
F1: () => {
|
|
646
658
|
e.toCenter();
|
|
647
659
|
},
|
|
648
|
-
|
|
660
|
+
F2: () => {
|
|
649
661
|
e.beginEdit();
|
|
650
662
|
},
|
|
651
|
-
|
|
663
|
+
ArrowUp: (o) => {
|
|
652
664
|
if (o.altKey)
|
|
653
665
|
e.moveUpNode();
|
|
654
666
|
else {
|
|
655
667
|
if (o.metaKey || o.ctrlKey)
|
|
656
668
|
return e.initSide();
|
|
657
|
-
|
|
669
|
+
Ne(e, "previous");
|
|
658
670
|
}
|
|
659
671
|
},
|
|
660
|
-
|
|
661
|
-
o.altKey ? e.moveDownNode() :
|
|
672
|
+
ArrowDown: (o) => {
|
|
673
|
+
o.altKey ? e.moveDownNode() : Ne(e, "next");
|
|
662
674
|
},
|
|
663
|
-
|
|
675
|
+
ArrowLeft: (o) => {
|
|
664
676
|
if (o.metaKey || o.ctrlKey)
|
|
665
677
|
return e.initLeft();
|
|
666
|
-
|
|
678
|
+
Ee(e, "lhs");
|
|
667
679
|
},
|
|
668
|
-
|
|
680
|
+
ArrowRight: (o) => {
|
|
669
681
|
if (o.metaKey || o.ctrlKey)
|
|
670
682
|
return e.initRight();
|
|
671
|
-
|
|
683
|
+
Ee(e, "rhs");
|
|
672
684
|
},
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
},
|
|
676
|
-
34() {
|
|
685
|
+
PageUp: () => e.moveUpNode(),
|
|
686
|
+
PageDown: () => {
|
|
677
687
|
e.moveDownNode();
|
|
678
688
|
},
|
|
679
|
-
|
|
689
|
+
c: (o) => {
|
|
680
690
|
(o.metaKey || o.ctrlKey) && (e.currentNode ? e.waitCopy = [e.currentNode] : e.currentNodes && (e.waitCopy = e.currentNodes));
|
|
681
691
|
},
|
|
682
|
-
|
|
692
|
+
v: (o) => {
|
|
683
693
|
!e.waitCopy || !e.currentNode || (o.metaKey || o.ctrlKey) && (e.waitCopy.length === 1 ? e.copyNode(e.waitCopy[0], e.currentNode) : e.copyNodes(e.waitCopy, e.currentNode));
|
|
684
694
|
},
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
if (o.metaKey || o.ctrlKey) {
|
|
688
|
-
if (e.scaleVal > 1.6)
|
|
689
|
-
return;
|
|
690
|
-
e.scale(e.scaleVal += 0.2);
|
|
691
|
-
}
|
|
695
|
+
"+": (o) => {
|
|
696
|
+
(o.metaKey || o.ctrlKey) && Q(e, "in");
|
|
692
697
|
},
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
if (o.metaKey || o.ctrlKey) {
|
|
696
|
-
if (e.scaleVal < 0.6)
|
|
697
|
-
return;
|
|
698
|
-
e.scale(e.scaleVal -= 0.2);
|
|
699
|
-
}
|
|
698
|
+
"-": (o) => {
|
|
699
|
+
(o.metaKey || o.ctrlKey) && Q(e, "out");
|
|
700
700
|
},
|
|
701
|
-
|
|
702
|
-
48: (o) => {
|
|
701
|
+
0: (o) => {
|
|
703
702
|
(o.metaKey || o.ctrlKey) && e.scale(1);
|
|
704
703
|
},
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
46: t
|
|
704
|
+
Delete: t,
|
|
705
|
+
Backspace: t
|
|
708
706
|
};
|
|
709
707
|
e.map.onkeydown = (o) => {
|
|
710
708
|
if (o.preventDefault(), !e.editable || o.target !== o.currentTarget)
|
|
711
709
|
return;
|
|
712
|
-
const s = n[o.
|
|
710
|
+
const s = n[o.key];
|
|
713
711
|
s && s(o);
|
|
712
|
+
}, e.map.onwheel = (o) => {
|
|
713
|
+
if (o.ctrlKey || o.metaKey) {
|
|
714
|
+
o.preventDefault();
|
|
715
|
+
const s = Math.abs(o.deltaY / 100);
|
|
716
|
+
o.deltaY < 0 ? Q(e, "in", s) : e.scaleVal - 0.2 > 0 && Q(e, "out", s), o.stopPropagation();
|
|
717
|
+
}
|
|
714
718
|
};
|
|
715
719
|
}
|
|
716
|
-
function
|
|
720
|
+
function Nt(e, t) {
|
|
717
721
|
const n = (d, m) => {
|
|
718
722
|
const g = document.createElement("div");
|
|
719
723
|
return g.id = d, g.innerHTML = `<svg class="icon" aria-hidden="true">
|
|
@@ -750,32 +754,32 @@ function Et(e, t) {
|
|
|
750
754
|
e.beginEdit();
|
|
751
755
|
};
|
|
752
756
|
}
|
|
753
|
-
const
|
|
757
|
+
const de = document, Ct = function(e, t) {
|
|
754
758
|
if (!t)
|
|
755
|
-
return
|
|
759
|
+
return he(e), e;
|
|
756
760
|
let n = e.querySelector(".insert-preview");
|
|
757
761
|
const o = `insert-preview ${t} show`;
|
|
758
|
-
return n || (n =
|
|
759
|
-
},
|
|
762
|
+
return n || (n = de.createElement("div"), e.appendChild(n)), n.className = o, e;
|
|
763
|
+
}, he = function(e) {
|
|
760
764
|
if (!e)
|
|
761
765
|
return;
|
|
762
766
|
const t = e.querySelectorAll(".insert-preview");
|
|
763
767
|
for (const n of t || [])
|
|
764
768
|
n.remove();
|
|
765
|
-
},
|
|
769
|
+
}, Ce = function(e, t) {
|
|
766
770
|
for (const n of t) {
|
|
767
771
|
const o = n.parentElement.parentElement.contains(e);
|
|
768
772
|
if (!(e && e.tagName === "ME-TPC" && e !== n && !o && e.nodeObj.parent))
|
|
769
773
|
return !1;
|
|
770
774
|
}
|
|
771
775
|
return !0;
|
|
772
|
-
},
|
|
776
|
+
}, _t = function(e) {
|
|
773
777
|
const t = document.createElement("div");
|
|
774
778
|
return t.className = "mind-elixir-ghost", e.map.appendChild(t), t;
|
|
775
779
|
};
|
|
776
|
-
function
|
|
780
|
+
function St(e) {
|
|
777
781
|
let t = null, n = null, o = null;
|
|
778
|
-
const s =
|
|
782
|
+
const s = _t(e), i = 12;
|
|
779
783
|
e.map.addEventListener("dragstart", (r) => {
|
|
780
784
|
var l, h;
|
|
781
785
|
const c = r.target;
|
|
@@ -786,39 +790,39 @@ function _t(e) {
|
|
|
786
790
|
(l = e.currentNodes) != null && l.includes(c) || (e.unselectNodes(), e.selectNode(c)), e.currentNodes ? (t = e.currentNodes, s.innerHTML = e.currentNodes.length + " nodes") : (t = [c], s.innerHTML = c.innerHTML);
|
|
787
791
|
for (const a of t)
|
|
788
792
|
a.parentElement.parentElement.style.opacity = "0.5";
|
|
789
|
-
(h = r.dataTransfer) == null || h.setDragImage(s, 0, 0),
|
|
793
|
+
(h = r.dataTransfer) == null || h.setDragImage(s, 0, 0), k.clear();
|
|
790
794
|
}), e.map.addEventListener("dragend", async (r) => {
|
|
791
795
|
if (!t)
|
|
792
796
|
return;
|
|
793
797
|
for (const l of t)
|
|
794
798
|
l.parentElement.parentElement.style.opacity = "1";
|
|
795
799
|
const c = r.target;
|
|
796
|
-
c.style.opacity = "", o && (
|
|
800
|
+
c.style.opacity = "", o && (he(o), n === "before" ? e.moveNodeBefore(t, o) : n === "after" ? e.moveNodeAfter(t, o) : n === "in" && e.moveNodeIn(t, o), t = null);
|
|
797
801
|
}), e.map.addEventListener(
|
|
798
802
|
"dragover",
|
|
799
|
-
|
|
803
|
+
nt(function(r) {
|
|
800
804
|
if (!t)
|
|
801
805
|
return;
|
|
802
|
-
|
|
803
|
-
const c =
|
|
804
|
-
if (
|
|
806
|
+
he(o);
|
|
807
|
+
const c = de.elementFromPoint(r.clientX, r.clientY - i);
|
|
808
|
+
if (Ce(c, t)) {
|
|
805
809
|
o = c;
|
|
806
810
|
const l = c.getBoundingClientRect().y;
|
|
807
811
|
r.clientY > l + c.clientHeight ? n = "after" : n = "in";
|
|
808
812
|
} else {
|
|
809
|
-
const l =
|
|
810
|
-
if (
|
|
813
|
+
const l = de.elementFromPoint(r.clientX, r.clientY + i);
|
|
814
|
+
if (Ce(l, t)) {
|
|
811
815
|
o = l;
|
|
812
816
|
const h = l.getBoundingClientRect().y;
|
|
813
817
|
r.clientY < h ? n = "before" : n = "in";
|
|
814
818
|
} else
|
|
815
819
|
n = o = null;
|
|
816
820
|
}
|
|
817
|
-
o &&
|
|
821
|
+
o && Ct(o, n);
|
|
818
822
|
}, 100)
|
|
819
823
|
);
|
|
820
824
|
}
|
|
821
|
-
const
|
|
825
|
+
const Mt = function(e) {
|
|
822
826
|
return ["createSummary", "removeSummary", "finishEditSummary"].includes(e.name) ? {
|
|
823
827
|
type: "summary",
|
|
824
828
|
value: e.obj.id
|
|
@@ -833,14 +837,14 @@ const St = function(e) {
|
|
|
833
837
|
value: e.obj.id
|
|
834
838
|
};
|
|
835
839
|
};
|
|
836
|
-
function
|
|
840
|
+
function kt(e) {
|
|
837
841
|
let t = [], n = -1, o = e.getData();
|
|
838
842
|
e.bus.addListener("operation", (s) => {
|
|
839
843
|
if (s.name === "beginEdit")
|
|
840
844
|
return;
|
|
841
845
|
t = t.slice(0, n + 1);
|
|
842
846
|
const i = e.getData();
|
|
843
|
-
t.push({ prev: o, currentObject:
|
|
847
|
+
t.push({ prev: o, currentObject: Mt(s), next: i }), o = i, n = t.length - 1;
|
|
844
848
|
}), e.undo = function() {
|
|
845
849
|
if (n > -1) {
|
|
846
850
|
const s = t[n];
|
|
@@ -880,7 +884,7 @@ function Lt(e) {
|
|
|
880
884
|
e.scaleVal > 1.6 || e.scale(e.scaleVal += 0.2);
|
|
881
885
|
}, t;
|
|
882
886
|
}
|
|
883
|
-
function
|
|
887
|
+
function Tt(e) {
|
|
884
888
|
const t = document.createElement("div"), n = R("tbltl", "left"), o = R("tbltr", "right"), s = R("tblts", "side");
|
|
885
889
|
return t.appendChild(n), t.appendChild(o), t.appendChild(s), t.className = "mind-elixir-toolbar lt", n.onclick = () => {
|
|
886
890
|
e.initLeft();
|
|
@@ -890,12 +894,12 @@ function kt(e) {
|
|
|
890
894
|
e.initSide();
|
|
891
895
|
}, t;
|
|
892
896
|
}
|
|
893
|
-
function
|
|
894
|
-
e.container.append(Lt(e)), e.container.append(
|
|
897
|
+
function At(e) {
|
|
898
|
+
e.container.append(Lt(e)), e.container.append(Tt(e));
|
|
895
899
|
}
|
|
896
900
|
/*! @viselect/vanilla v3.5.1 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */
|
|
897
|
-
var
|
|
898
|
-
class
|
|
901
|
+
var jt = Object.defineProperty, Dt = (e, t, n) => t in e ? jt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, E = (e, t, n) => (Dt(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
902
|
+
class $t {
|
|
899
903
|
constructor() {
|
|
900
904
|
E(this, "_listeners", /* @__PURE__ */ new Map()), E(this, "on", this.addEventListener), E(this, "off", this.removeEventListener), E(this, "emit", this.dispatchEvent);
|
|
901
905
|
}
|
|
@@ -917,27 +921,27 @@ class Dt {
|
|
|
917
921
|
this._listeners.clear();
|
|
918
922
|
}
|
|
919
923
|
}
|
|
920
|
-
const
|
|
924
|
+
const _e = (e, t = "px") => typeof e == "number" ? e + t : e;
|
|
921
925
|
function A({ style: e }, t, n) {
|
|
922
926
|
if (typeof t == "object")
|
|
923
927
|
for (const [o, s] of Object.entries(t))
|
|
924
|
-
s !== void 0 && (e[o] =
|
|
928
|
+
s !== void 0 && (e[o] = _e(s));
|
|
925
929
|
else
|
|
926
|
-
n !== void 0 && (e[t] =
|
|
930
|
+
n !== void 0 && (e[t] = _e(n));
|
|
927
931
|
}
|
|
928
|
-
const
|
|
932
|
+
const qe = (e) => (t, n, o, s = {}) => {
|
|
929
933
|
t instanceof HTMLCollection || t instanceof NodeList ? t = Array.from(t) : Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
|
|
930
934
|
for (const i of t)
|
|
931
935
|
if (i)
|
|
932
936
|
for (const r of n)
|
|
933
937
|
i[e](r, o, { capture: !1, ...s });
|
|
934
938
|
return [t, n, o, s];
|
|
935
|
-
}, q =
|
|
939
|
+
}, q = qe("addEventListener"), j = qe("removeEventListener"), ee = (e) => {
|
|
936
940
|
var t;
|
|
937
941
|
const { clientX: n, clientY: o, target: s } = ((t = e.touches) == null ? void 0 : t[0]) ?? e;
|
|
938
942
|
return { x: n, y: o, target: s };
|
|
939
943
|
};
|
|
940
|
-
function
|
|
944
|
+
function Se(e, t, n = "touch") {
|
|
941
945
|
switch (n) {
|
|
942
946
|
case "center": {
|
|
943
947
|
const o = t.left + t.width / 2, s = t.top + t.height / 2;
|
|
@@ -958,7 +962,7 @@ function F(e, t = document) {
|
|
|
958
962
|
}
|
|
959
963
|
return o;
|
|
960
964
|
}
|
|
961
|
-
const
|
|
965
|
+
const Ot = () => matchMedia("(hover: none), (pointer: coarse)").matches, Pt = () => "safari" in window, Ht = (e) => {
|
|
962
966
|
let t, n = -1, o = !1;
|
|
963
967
|
return {
|
|
964
968
|
next(...s) {
|
|
@@ -971,7 +975,7 @@ const $t = () => matchMedia("(hover: none), (pointer: coarse)").matches, Ot = ()
|
|
|
971
975
|
}
|
|
972
976
|
};
|
|
973
977
|
};
|
|
974
|
-
function
|
|
978
|
+
function Bt(e, t) {
|
|
975
979
|
for (const n of t) {
|
|
976
980
|
if (typeof n == "number")
|
|
977
981
|
return e.button === n;
|
|
@@ -991,8 +995,8 @@ function Ht(e, t) {
|
|
|
991
995
|
}
|
|
992
996
|
return !1;
|
|
993
997
|
}
|
|
994
|
-
const { abs: B, max:
|
|
995
|
-
class
|
|
998
|
+
const { abs: B, max: Me, min: ke, ceil: Le } = Math;
|
|
999
|
+
class Fe extends $t {
|
|
996
1000
|
constructor(t) {
|
|
997
1001
|
var n, o, s, i, r;
|
|
998
1002
|
super(), E(this, "_options"), E(this, "_selection", {
|
|
@@ -1057,7 +1061,7 @@ class qe extends Dt {
|
|
|
1057
1061
|
// https://stackoverflow.com/a/38268846
|
|
1058
1062
|
pointerEvents: "none",
|
|
1059
1063
|
zIndex: "1"
|
|
1060
|
-
}), this._frame =
|
|
1064
|
+
}), this._frame = Ht((a) => {
|
|
1061
1065
|
this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move", a), this._redrawSelectionArea();
|
|
1062
1066
|
}), this.enable();
|
|
1063
1067
|
}
|
|
@@ -1068,12 +1072,12 @@ class qe extends Dt {
|
|
|
1068
1072
|
});
|
|
1069
1073
|
}
|
|
1070
1074
|
_onTapStart(t, n = !1) {
|
|
1071
|
-
const { x: o, y: s, target: i } =
|
|
1072
|
-
if (t instanceof MouseEvent && !
|
|
1075
|
+
const { x: o, y: s, target: i } = ee(t), { _options: r } = this, { document: c } = this._options, l = i.getBoundingClientRect();
|
|
1076
|
+
if (t instanceof MouseEvent && !Bt(t, r.behaviour.triggers))
|
|
1073
1077
|
return;
|
|
1074
1078
|
const h = F(r.startAreas, r.document), a = F(r.boundaries, r.document);
|
|
1075
1079
|
this._targetElement = a.find(
|
|
1076
|
-
(m) =>
|
|
1080
|
+
(m) => Se(m.getBoundingClientRect(), l)
|
|
1077
1081
|
);
|
|
1078
1082
|
const u = t.composedPath();
|
|
1079
1083
|
if (!this._targetElement || !h.find((m) => u.includes(m)) || !a.find((m) => u.includes(m)) || !n && this._emitEvent("beforestart", t) === !1)
|
|
@@ -1083,7 +1087,7 @@ class qe extends Dt {
|
|
|
1083
1087
|
this._scrollDelta = { x: d.scrollLeft, y: d.scrollTop }, this._singleClick = !0, this.clearSelection(!1, !0), q(c, ["touchmove", "mousemove"], this._delayedTapMove, { passive: !1 }), q(c, ["mouseup", "touchcancel", "touchend"], this._onTapStop), q(c, "scroll", this._onScroll);
|
|
1084
1088
|
}
|
|
1085
1089
|
_onSingleTap(t) {
|
|
1086
|
-
const { singleTap: { intersect: n }, range: o } = this._options.features, s =
|
|
1090
|
+
const { singleTap: { intersect: n }, range: o } = this._options.features, s = ee(t);
|
|
1087
1091
|
let i;
|
|
1088
1092
|
if (n === "native")
|
|
1089
1093
|
i = s.target;
|
|
@@ -1112,7 +1116,7 @@ class qe extends Dt {
|
|
|
1112
1116
|
r.includes(i) && (r.length === 1 || t.ctrlKey || r.every((c) => this._selection.stored.includes(c))) ? this.deselect(i) : (this.select(i), this._latestElement = i);
|
|
1113
1117
|
}
|
|
1114
1118
|
_delayedTapMove(t) {
|
|
1115
|
-
const { container: n, document: o, behaviour: { startThreshold: s } } = this._options, { x1: i, y1: r } = this._areaLocation, { x: c, y: l } =
|
|
1119
|
+
const { container: n, document: o, behaviour: { startThreshold: s } } = this._options, { x1: i, y1: r } = this._areaLocation, { x: c, y: l } = ee(t);
|
|
1116
1120
|
if (
|
|
1117
1121
|
// Single number for both coordinates
|
|
1118
1122
|
typeof s == "number" && B(c + l - (i + r)) >= s || // Different x and y threshold
|
|
@@ -1147,7 +1151,7 @@ class qe extends Dt {
|
|
|
1147
1151
|
}));
|
|
1148
1152
|
}
|
|
1149
1153
|
_onTapMove(t) {
|
|
1150
|
-
const { x: n, y: o } =
|
|
1154
|
+
const { x: n, y: o } = ee(t), { _scrollSpeed: s, _areaLocation: i, _options: r, _frame: c } = this, { speedDivider: l } = r.behaviour.scrolling, h = this._targetElement;
|
|
1151
1155
|
if (i.x2 = n, i.y2 = o, this._scrollAvailable && !this._scrollingActive && (s.y || s.x)) {
|
|
1152
1156
|
this._scrollingActive = !0;
|
|
1153
1157
|
const a = () => {
|
|
@@ -1165,7 +1169,7 @@ class qe extends Dt {
|
|
|
1165
1169
|
}
|
|
1166
1170
|
_handleMoveEvent(t) {
|
|
1167
1171
|
const { features: n } = this._options;
|
|
1168
|
-
(n.touch &&
|
|
1172
|
+
(n.touch && Ot() || this._scrollAvailable && Pt()) && t.preventDefault();
|
|
1169
1173
|
}
|
|
1170
1174
|
_onScroll() {
|
|
1171
1175
|
const { _scrollDelta: t, _options: { document: n } } = this, { scrollTop: o, scrollLeft: s } = n.scrollingElement ?? n.body;
|
|
@@ -1180,7 +1184,7 @@ class qe extends Dt {
|
|
|
1180
1184
|
let { x2: p, y2: f } = n;
|
|
1181
1185
|
const { behaviour: { scrolling: { startScrollMargins: v } } } = i;
|
|
1182
1186
|
p < d.left + v.x ? (t.x = h ? -B(d.left - p + v.x) : 0, p = p < d.left ? d.left : p) : p > d.right - v.x ? (t.x = a - h - u ? B(d.left + d.width - p - v.x) : 0, p = p > d.right ? d.right : p) : t.x = 0, f < d.top + v.y ? (t.y = r ? -B(d.top - f + v.y) : 0, f = f < d.top ? d.top : f) : f > d.bottom - v.y ? (t.y = c - r - l ? B(d.top + d.height - f - v.y) : 0, f = f > d.bottom ? d.bottom : f) : t.y = 0;
|
|
1183
|
-
const b =
|
|
1187
|
+
const b = ke(m, p), y = ke(g, f), x = Me(m, p), w = Me(g, f);
|
|
1184
1188
|
o.x = b, o.y = y, o.width = x - b, o.height = w - y;
|
|
1185
1189
|
}
|
|
1186
1190
|
_redrawSelectionArea() {
|
|
@@ -1196,7 +1200,7 @@ class qe extends Dt {
|
|
|
1196
1200
|
const { _selectables: t, _options: n, _selection: o, _areaRect: s } = this, { stored: i, selected: r, touched: c } = o, { intersect: l, overlap: h } = n.behaviour, a = h === "invert", u = [], d = [], m = [];
|
|
1197
1201
|
for (let p = 0; p < t.length; p++) {
|
|
1198
1202
|
const f = t[p];
|
|
1199
|
-
if (
|
|
1203
|
+
if (Se(s, f.getBoundingClientRect(), l)) {
|
|
1200
1204
|
if (r.includes(f))
|
|
1201
1205
|
i.includes(f) && !c.includes(f) && c.push(f);
|
|
1202
1206
|
else if (a && i.includes(f)) {
|
|
@@ -1335,9 +1339,9 @@ class qe extends Dt {
|
|
|
1335
1339
|
), this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)));
|
|
1336
1340
|
}
|
|
1337
1341
|
}
|
|
1338
|
-
E(
|
|
1339
|
-
function
|
|
1340
|
-
const t = new
|
|
1342
|
+
E(Fe, "version", "3.5.1");
|
|
1343
|
+
function zt(e) {
|
|
1344
|
+
const t = new Fe({
|
|
1341
1345
|
selectables: [".map-container me-tpc"],
|
|
1342
1346
|
boundaries: [e.container],
|
|
1343
1347
|
container: "body",
|
|
@@ -1370,7 +1374,7 @@ function Bt(e) {
|
|
|
1370
1374
|
changed: { added: n, removed: o }
|
|
1371
1375
|
}
|
|
1372
1376
|
}) => {
|
|
1373
|
-
|
|
1377
|
+
k.moved = !0;
|
|
1374
1378
|
for (const s of n)
|
|
1375
1379
|
s.classList.add("selected");
|
|
1376
1380
|
for (const s of o)
|
|
@@ -1381,7 +1385,7 @@ function Bt(e) {
|
|
|
1381
1385
|
});
|
|
1382
1386
|
e.selection = t;
|
|
1383
1387
|
}
|
|
1384
|
-
const
|
|
1388
|
+
const Rt = function(e, t = !0) {
|
|
1385
1389
|
this.theme = e;
|
|
1386
1390
|
const n = this.theme.cssVar, o = Object.keys(n);
|
|
1387
1391
|
for (let s = 0; s < o.length; s++) {
|
|
@@ -1391,49 +1395,57 @@ const zt = function(e, t = !0) {
|
|
|
1391
1395
|
t && this.refresh();
|
|
1392
1396
|
}, W = (e) => {
|
|
1393
1397
|
var o;
|
|
1394
|
-
const t = (o = e.parent) == null ? void 0 : o.children, n = t.indexOf(e);
|
|
1398
|
+
const t = (o = e.parent) == null ? void 0 : o.children, n = (t == null ? void 0 : t.indexOf(e)) ?? 0;
|
|
1395
1399
|
return { siblings: t, index: n };
|
|
1396
1400
|
};
|
|
1397
|
-
function
|
|
1398
|
-
const { siblings: t, index: n } = W(e)
|
|
1401
|
+
function qt(e) {
|
|
1402
|
+
const { siblings: t, index: n } = W(e);
|
|
1403
|
+
if (t === void 0)
|
|
1404
|
+
return;
|
|
1405
|
+
const o = t[n];
|
|
1399
1406
|
n === 0 ? (t[n] = t[t.length - 1], t[t.length - 1] = o) : (t[n] = t[n - 1], t[n - 1] = o);
|
|
1400
1407
|
}
|
|
1401
|
-
function
|
|
1402
|
-
const { siblings: t, index: n } = W(e)
|
|
1408
|
+
function Ft(e) {
|
|
1409
|
+
const { siblings: t, index: n } = W(e);
|
|
1410
|
+
if (t === void 0)
|
|
1411
|
+
return;
|
|
1412
|
+
const o = t[n];
|
|
1403
1413
|
n === t.length - 1 ? (t[n] = t[0], t[0] = o) : (t[n] = t[n + 1], t[n + 1] = o);
|
|
1404
1414
|
}
|
|
1405
|
-
function
|
|
1415
|
+
function ge(e) {
|
|
1406
1416
|
const { siblings: t, index: n } = W(e);
|
|
1407
|
-
return t.splice(n, 1), t.length;
|
|
1417
|
+
return t === void 0 ? 0 : (t.splice(n, 1), t.length);
|
|
1408
1418
|
}
|
|
1409
|
-
function
|
|
1419
|
+
function It(e, t, n) {
|
|
1410
1420
|
const { siblings: o, index: s } = W(n);
|
|
1411
|
-
t === "before" ? o.splice(s, 0, e) : o.splice(s + 1, 0, e);
|
|
1421
|
+
o !== void 0 && (t === "before" ? o.splice(s, 0, e) : o.splice(s + 1, 0, e));
|
|
1412
1422
|
}
|
|
1413
|
-
function
|
|
1423
|
+
function Kt(e, t) {
|
|
1414
1424
|
const { siblings: n, index: o } = W(e);
|
|
1415
|
-
n[o] = t, t.children = [e];
|
|
1425
|
+
n !== void 0 && (n[o] = t, t.children = [e]);
|
|
1416
1426
|
}
|
|
1417
|
-
function
|
|
1418
|
-
if (
|
|
1427
|
+
function Ie(e, t, n) {
|
|
1428
|
+
if (ge(t), e === "in")
|
|
1419
1429
|
n.children ? n.children.push(t) : n.children = [t];
|
|
1420
1430
|
else {
|
|
1421
1431
|
t.direction !== void 0 && (t.direction = n.direction);
|
|
1422
1432
|
const { siblings: o, index: s } = W(n);
|
|
1433
|
+
if (o === void 0)
|
|
1434
|
+
return;
|
|
1423
1435
|
e === "before" ? o.splice(s, 0, t) : o.splice(s + 1, 0, t);
|
|
1424
1436
|
}
|
|
1425
1437
|
}
|
|
1426
|
-
const
|
|
1438
|
+
const Vt = function(e, t) {
|
|
1427
1439
|
var n, o;
|
|
1428
|
-
if (e ===
|
|
1429
|
-
return
|
|
1440
|
+
if (e === L)
|
|
1441
|
+
return L;
|
|
1430
1442
|
if (e === z)
|
|
1431
1443
|
return z;
|
|
1432
|
-
if (e ===
|
|
1444
|
+
if (e === ce) {
|
|
1433
1445
|
const s = ((n = document.querySelector(".lhs")) == null ? void 0 : n.childElementCount) || 0, i = ((o = document.querySelector(".rhs")) == null ? void 0 : o.childElementCount) || 0;
|
|
1434
|
-
return s <= i ? (t.direction =
|
|
1446
|
+
return s <= i ? (t.direction = L, L) : (t.direction = z, z);
|
|
1435
1447
|
}
|
|
1436
|
-
},
|
|
1448
|
+
}, Ke = function(e, t, n) {
|
|
1437
1449
|
var i, r;
|
|
1438
1450
|
const o = n.children[0].children[0], s = t.parentElement;
|
|
1439
1451
|
if (s.tagName === "ME-PARENT") {
|
|
@@ -1441,34 +1453,34 @@ const Kt = function(e, t) {
|
|
|
1441
1453
|
s.nextSibling.appendChild(n);
|
|
1442
1454
|
else {
|
|
1443
1455
|
const c = e.createChildren([n]);
|
|
1444
|
-
s.appendChild(
|
|
1456
|
+
s.appendChild(me(!0)), s.insertAdjacentElement("afterend", c);
|
|
1445
1457
|
}
|
|
1446
1458
|
e.linkDiv(n.offsetParent);
|
|
1447
1459
|
} else
|
|
1448
|
-
s.tagName === "ME-ROOT" && (
|
|
1449
|
-
},
|
|
1460
|
+
s.tagName === "ME-ROOT" && (Vt(e.direction, o.nodeObj) === L ? (i = e.container.querySelector(".lhs")) == null || i.appendChild(n) : (r = e.container.querySelector(".rhs")) == null || r.appendChild(n), e.linkDiv());
|
|
1461
|
+
}, Ve = function(e, t) {
|
|
1450
1462
|
const n = e.parentNode;
|
|
1451
1463
|
if (t === 0) {
|
|
1452
1464
|
const o = n.parentNode.parentNode;
|
|
1453
1465
|
o.tagName !== "ME-MAIN" && o.previousSibling.children[1].remove();
|
|
1454
1466
|
}
|
|
1455
1467
|
n.parentNode.remove();
|
|
1456
|
-
},
|
|
1468
|
+
}, We = {
|
|
1457
1469
|
before: "beforebegin",
|
|
1458
1470
|
after: "afterend"
|
|
1459
1471
|
}, J = function(e) {
|
|
1460
1472
|
const n = e.parentElement.parentElement.lastElementChild;
|
|
1461
1473
|
(n == null ? void 0 : n.tagName) === "svg" && (n == null || n.remove());
|
|
1462
|
-
},
|
|
1463
|
-
const n = e.nodeObj, o =
|
|
1474
|
+
}, Wt = function(e, t) {
|
|
1475
|
+
const n = e.nodeObj, o = fe(n);
|
|
1464
1476
|
o.style && t.style && (t.style = Object.assign(o.style, t.style));
|
|
1465
1477
|
const s = Object.assign(n, t);
|
|
1466
|
-
|
|
1478
|
+
pe(e, s), this.linkDiv(), this.bus.fire("operation", {
|
|
1467
1479
|
name: "reshapeNode",
|
|
1468
1480
|
obj: s,
|
|
1469
1481
|
origin: o
|
|
1470
1482
|
});
|
|
1471
|
-
},
|
|
1483
|
+
}, ve = function(e, t, n) {
|
|
1472
1484
|
if (!t)
|
|
1473
1485
|
return null;
|
|
1474
1486
|
const o = t.nodeObj;
|
|
@@ -1476,8 +1488,8 @@ const Kt = function(e, t) {
|
|
|
1476
1488
|
const s = n || e.generateNewObj();
|
|
1477
1489
|
o.children ? o.children.push(s) : o.children = [s], $(e.nodeData);
|
|
1478
1490
|
const { grp: i, top: r } = e.createWrapper(s);
|
|
1479
|
-
return
|
|
1480
|
-
},
|
|
1491
|
+
return Ke(e, t, i), { newTop: r, newNodeObj: s };
|
|
1492
|
+
}, Ut = function(e, t, n) {
|
|
1481
1493
|
var h, a, u;
|
|
1482
1494
|
const o = t || this.currentNode;
|
|
1483
1495
|
if (!o)
|
|
@@ -1493,14 +1505,14 @@ const Kt = function(e, t) {
|
|
|
1493
1505
|
return;
|
|
1494
1506
|
}
|
|
1495
1507
|
const i = n || this.generateNewObj();
|
|
1496
|
-
|
|
1508
|
+
It(i, e, s), $(this.nodeData);
|
|
1497
1509
|
const r = o.parentElement, { grp: c, top: l } = this.createWrapper(i);
|
|
1498
|
-
r.parentElement.insertAdjacentElement(
|
|
1510
|
+
r.parentElement.insertAdjacentElement(We[e], c), this.linkDiv(c.offsetParent), n || this.editTopic(l.firstChild), this.selectNode(l.firstChild, !0), this.bus.fire("operation", {
|
|
1499
1511
|
name: "insertSibling",
|
|
1500
1512
|
type: e,
|
|
1501
1513
|
obj: i
|
|
1502
1514
|
});
|
|
1503
|
-
},
|
|
1515
|
+
}, Yt = function(e, t) {
|
|
1504
1516
|
const n = e || this.currentNode;
|
|
1505
1517
|
if (!n)
|
|
1506
1518
|
return;
|
|
@@ -1509,19 +1521,19 @@ const Kt = function(e, t) {
|
|
|
1509
1521
|
if (!o.parent)
|
|
1510
1522
|
return;
|
|
1511
1523
|
const s = t || this.generateNewObj();
|
|
1512
|
-
|
|
1524
|
+
Kt(o, s), $(this.nodeData);
|
|
1513
1525
|
const i = n.parentElement.parentElement, { grp: r, top: c } = this.createWrapper(s, !0);
|
|
1514
|
-
c.appendChild(
|
|
1526
|
+
c.appendChild(me(!0)), i.insertAdjacentElement("afterend", r);
|
|
1515
1527
|
const l = this.createChildren([i]);
|
|
1516
1528
|
c.insertAdjacentElement("afterend", l), this.linkDiv(), t || this.editTopic(c.firstChild), this.selectNode(c.firstChild, !0), this.bus.fire("operation", {
|
|
1517
1529
|
name: "insertParent",
|
|
1518
1530
|
obj: s
|
|
1519
1531
|
});
|
|
1520
|
-
},
|
|
1532
|
+
}, Xt = function(e, t) {
|
|
1521
1533
|
const n = e || this.currentNode;
|
|
1522
1534
|
if (!n)
|
|
1523
1535
|
return;
|
|
1524
|
-
const o =
|
|
1536
|
+
const o = ve(this, n, t);
|
|
1525
1537
|
if (!o)
|
|
1526
1538
|
return;
|
|
1527
1539
|
const { newTop: s, newNodeObj: i } = o;
|
|
@@ -1529,10 +1541,10 @@ const Kt = function(e, t) {
|
|
|
1529
1541
|
name: "addChild",
|
|
1530
1542
|
obj: i
|
|
1531
1543
|
}), t || this.editTopic(s.firstChild), this.selectNode(s.firstChild, !0);
|
|
1532
|
-
},
|
|
1533
|
-
const n =
|
|
1534
|
-
|
|
1535
|
-
const o =
|
|
1544
|
+
}, Gt = function(e, t) {
|
|
1545
|
+
const n = fe(e.nodeObj);
|
|
1546
|
+
ue(n);
|
|
1547
|
+
const o = ve(this, t, n);
|
|
1536
1548
|
if (!o)
|
|
1537
1549
|
return;
|
|
1538
1550
|
const { newNodeObj: s } = o;
|
|
@@ -1540,13 +1552,13 @@ const Kt = function(e, t) {
|
|
|
1540
1552
|
name: "copyNode",
|
|
1541
1553
|
obj: s
|
|
1542
1554
|
});
|
|
1543
|
-
},
|
|
1544
|
-
e =
|
|
1555
|
+
}, Jt = function(e, t) {
|
|
1556
|
+
e = le(e);
|
|
1545
1557
|
const n = [];
|
|
1546
1558
|
for (let o = 0; o < e.length; o++) {
|
|
1547
|
-
const s = e[o], i =
|
|
1548
|
-
|
|
1549
|
-
const r =
|
|
1559
|
+
const s = e[o], i = fe(s.nodeObj);
|
|
1560
|
+
ue(i);
|
|
1561
|
+
const r = ve(this, t, i);
|
|
1550
1562
|
if (!r)
|
|
1551
1563
|
return;
|
|
1552
1564
|
const { newNodeObj: c } = r;
|
|
@@ -1556,12 +1568,12 @@ const Kt = function(e, t) {
|
|
|
1556
1568
|
name: "copyNodes",
|
|
1557
1569
|
objs: n
|
|
1558
1570
|
});
|
|
1559
|
-
},
|
|
1571
|
+
}, Zt = function(e) {
|
|
1560
1572
|
const t = e || this.currentNode;
|
|
1561
1573
|
if (!t)
|
|
1562
1574
|
return;
|
|
1563
1575
|
const n = t.nodeObj;
|
|
1564
|
-
|
|
1576
|
+
qt(n);
|
|
1565
1577
|
const o = t.parentNode.parentNode;
|
|
1566
1578
|
o.parentNode.insertBefore(o, o.previousSibling), this.linkDiv(), this.bus.fire("operation", {
|
|
1567
1579
|
name: "moveUpNode",
|
|
@@ -1572,13 +1584,13 @@ const Kt = function(e, t) {
|
|
|
1572
1584
|
if (!t)
|
|
1573
1585
|
return;
|
|
1574
1586
|
const n = t.nodeObj;
|
|
1575
|
-
|
|
1587
|
+
Ft(n);
|
|
1576
1588
|
const o = t.parentNode.parentNode;
|
|
1577
1589
|
o.nextSibling ? o.nextSibling.insertAdjacentElement("afterend", o) : o.parentNode.prepend(o), this.linkDiv(), this.bus.fire("operation", {
|
|
1578
1590
|
name: "moveDownNode",
|
|
1579
1591
|
obj: n
|
|
1580
1592
|
});
|
|
1581
|
-
},
|
|
1593
|
+
}, en = function(e) {
|
|
1582
1594
|
var r;
|
|
1583
1595
|
const t = e || this.currentNode;
|
|
1584
1596
|
if (!t)
|
|
@@ -1586,8 +1598,8 @@ const Kt = function(e, t) {
|
|
|
1586
1598
|
const n = t.nodeObj;
|
|
1587
1599
|
if (!n.parent)
|
|
1588
1600
|
throw new Error("Can not remove root node");
|
|
1589
|
-
const o = n.parent.children, s = o.findIndex((c) => c === n), i =
|
|
1590
|
-
if (
|
|
1601
|
+
const o = n.parent.children, s = o.findIndex((c) => c === n), i = ge(n);
|
|
1602
|
+
if (Ve(t, i), o.length !== 0) {
|
|
1591
1603
|
const c = o[s] || o[s - 1];
|
|
1592
1604
|
this.selectNode(C(c.id));
|
|
1593
1605
|
} else
|
|
@@ -1598,77 +1610,77 @@ const Kt = function(e, t) {
|
|
|
1598
1610
|
originIndex: s,
|
|
1599
1611
|
originParentId: (r = n == null ? void 0 : n.parent) == null ? void 0 : r.id
|
|
1600
1612
|
});
|
|
1601
|
-
},
|
|
1602
|
-
e =
|
|
1613
|
+
}, tn = function(e) {
|
|
1614
|
+
e = le(e);
|
|
1603
1615
|
for (const t of e) {
|
|
1604
1616
|
const n = t.nodeObj;
|
|
1605
1617
|
if (!n.parent)
|
|
1606
1618
|
continue;
|
|
1607
|
-
const o =
|
|
1608
|
-
|
|
1619
|
+
const o = ge(n);
|
|
1620
|
+
Ve(t, o);
|
|
1609
1621
|
}
|
|
1610
1622
|
this.linkDiv(), this.bus.fire("operation", {
|
|
1611
1623
|
name: "removeNodes",
|
|
1612
1624
|
objs: e.map((t) => t.nodeObj)
|
|
1613
1625
|
});
|
|
1614
|
-
},
|
|
1615
|
-
e =
|
|
1626
|
+
}, nn = function(e, t) {
|
|
1627
|
+
e = le(e);
|
|
1616
1628
|
const n = t.nodeObj;
|
|
1617
1629
|
n.expanded === !1 && (this.expandNode(t, !0), t = C(n.id));
|
|
1618
1630
|
for (const o of e) {
|
|
1619
1631
|
const s = o.nodeObj;
|
|
1620
|
-
|
|
1632
|
+
Ie("in", s, n), $(this.nodeData);
|
|
1621
1633
|
const i = o.parentElement;
|
|
1622
|
-
|
|
1634
|
+
Ke(this, t, i.parentElement);
|
|
1623
1635
|
}
|
|
1624
1636
|
this.linkDiv(), this.bus.fire("operation", {
|
|
1625
1637
|
name: "moveNodeIn",
|
|
1626
1638
|
objs: e.map((o) => o.nodeObj),
|
|
1627
1639
|
toObj: n
|
|
1628
1640
|
});
|
|
1629
|
-
},
|
|
1630
|
-
e =
|
|
1641
|
+
}, Ue = (e, t, n, o) => {
|
|
1642
|
+
e = le(e), t === "after" && (e = e.reverse());
|
|
1631
1643
|
const s = n.nodeObj;
|
|
1632
1644
|
for (const i of e) {
|
|
1633
1645
|
const r = i.nodeObj;
|
|
1634
|
-
|
|
1646
|
+
Ie(t, r, s), $(o.nodeData), J(i);
|
|
1635
1647
|
const c = i.parentElement.parentNode;
|
|
1636
|
-
n.parentElement.parentNode.insertAdjacentElement(
|
|
1648
|
+
n.parentElement.parentNode.insertAdjacentElement(We[t], c);
|
|
1637
1649
|
}
|
|
1638
1650
|
o.linkDiv(), o.bus.fire("operation", {
|
|
1639
1651
|
name: t === "before" ? "moveNodeBefore" : "moveNodeAfter",
|
|
1640
1652
|
objs: e.map((i) => i.nodeObj),
|
|
1641
1653
|
toObj: s
|
|
1642
1654
|
});
|
|
1643
|
-
}, nn = function(e, t) {
|
|
1644
|
-
We(e, "before", t, this);
|
|
1645
1655
|
}, on = function(e, t) {
|
|
1646
|
-
|
|
1647
|
-
}, sn = function(e) {
|
|
1656
|
+
Ue(e, "before", t, this);
|
|
1657
|
+
}, sn = function(e, t) {
|
|
1658
|
+
Ue(e, "after", t, this);
|
|
1659
|
+
}, rn = function(e) {
|
|
1648
1660
|
const t = e || this.currentNode;
|
|
1649
1661
|
t && (t.nodeObj.dangerouslySetInnerHTML || this.editTopic(t));
|
|
1650
|
-
},
|
|
1662
|
+
}, cn = function(e, t) {
|
|
1651
1663
|
e.text.textContent = t, e.nodeObj.topic = t, this.linkDiv();
|
|
1652
|
-
},
|
|
1664
|
+
}, Ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1653
1665
|
__proto__: null,
|
|
1654
|
-
addChild:
|
|
1655
|
-
beginEdit:
|
|
1656
|
-
copyNode:
|
|
1657
|
-
copyNodes:
|
|
1658
|
-
insertParent:
|
|
1659
|
-
insertSibling:
|
|
1666
|
+
addChild: Xt,
|
|
1667
|
+
beginEdit: rn,
|
|
1668
|
+
copyNode: Gt,
|
|
1669
|
+
copyNodes: Jt,
|
|
1670
|
+
insertParent: Yt,
|
|
1671
|
+
insertSibling: Ut,
|
|
1660
1672
|
moveDownNode: Qt,
|
|
1661
|
-
moveNodeAfter:
|
|
1662
|
-
moveNodeBefore:
|
|
1663
|
-
moveNodeIn:
|
|
1664
|
-
moveUpNode:
|
|
1665
|
-
removeNode:
|
|
1666
|
-
removeNodes:
|
|
1667
|
-
reshapeNode:
|
|
1673
|
+
moveNodeAfter: sn,
|
|
1674
|
+
moveNodeBefore: on,
|
|
1675
|
+
moveNodeIn: nn,
|
|
1676
|
+
moveUpNode: Zt,
|
|
1677
|
+
removeNode: en,
|
|
1678
|
+
removeNodes: tn,
|
|
1679
|
+
reshapeNode: Wt,
|
|
1668
1680
|
rmSubline: J,
|
|
1669
|
-
setNodeTopic:
|
|
1681
|
+
setNodeTopic: cn
|
|
1670
1682
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1671
|
-
function
|
|
1683
|
+
function Xe(e) {
|
|
1672
1684
|
return {
|
|
1673
1685
|
nodeData: e.isFocusMode ? e.nodeDataBackup : e.nodeData,
|
|
1674
1686
|
arrows: e.arrows,
|
|
@@ -1677,7 +1689,7 @@ function Ye(e) {
|
|
|
1677
1689
|
theme: e.theme
|
|
1678
1690
|
};
|
|
1679
1691
|
}
|
|
1680
|
-
const
|
|
1692
|
+
const ln = function(e, t, n) {
|
|
1681
1693
|
if (e) {
|
|
1682
1694
|
if (this.clearSelection(), typeof e == "string") {
|
|
1683
1695
|
const o = C(e);
|
|
@@ -1685,9 +1697,9 @@ const cn = function(e, t, n) {
|
|
|
1685
1697
|
}
|
|
1686
1698
|
e.className = "selected", e.scrollIntoView({ block: "nearest", inline: "nearest" }), this.currentNode = e, t ? this.bus.fire("selectNewNode", e.nodeObj) : this.bus.fire("selectNode", e.nodeObj, n);
|
|
1687
1699
|
}
|
|
1688
|
-
},
|
|
1700
|
+
}, an = function() {
|
|
1689
1701
|
this.currentNode && (this.currentNode.className = ""), this.currentNode = null, this.bus.fire("unselectNode");
|
|
1690
|
-
},
|
|
1702
|
+
}, dn = function(e) {
|
|
1691
1703
|
this.clearSelection();
|
|
1692
1704
|
for (const t of e)
|
|
1693
1705
|
t.className = "selected";
|
|
@@ -1695,23 +1707,23 @@ const cn = function(e, t, n) {
|
|
|
1695
1707
|
"selectNodes",
|
|
1696
1708
|
e.map((t) => t.nodeObj)
|
|
1697
1709
|
);
|
|
1698
|
-
},
|
|
1710
|
+
}, hn = function() {
|
|
1699
1711
|
if (this.currentNodes)
|
|
1700
1712
|
for (const e of this.currentNodes)
|
|
1701
1713
|
e.classList.remove("selected");
|
|
1702
1714
|
this.currentNodes = null, this.bus.fire("unselectNodes");
|
|
1703
|
-
}, hn = function() {
|
|
1704
|
-
this.unselectNode(), this.unselectNodes(), this.unselectSummary(), this.unselectArrow();
|
|
1705
1715
|
}, un = function() {
|
|
1706
|
-
|
|
1716
|
+
this.unselectNode(), this.unselectNodes(), this.unselectSummary(), this.unselectArrow();
|
|
1717
|
+
}, fn = function() {
|
|
1718
|
+
const e = Xe(this);
|
|
1707
1719
|
return JSON.stringify(e, (t, n) => {
|
|
1708
1720
|
if (!(t === "parent" && typeof n != "string"))
|
|
1709
1721
|
return n;
|
|
1710
1722
|
});
|
|
1711
|
-
}, fn = function() {
|
|
1712
|
-
return JSON.parse(this.getDataString());
|
|
1713
1723
|
}, pn = function() {
|
|
1714
|
-
|
|
1724
|
+
return JSON.parse(this.getDataString());
|
|
1725
|
+
}, mn = function() {
|
|
1726
|
+
const e = Xe(this).nodeData;
|
|
1715
1727
|
let t = "# " + e.topic + `
|
|
1716
1728
|
|
|
1717
1729
|
`;
|
|
@@ -1723,29 +1735,29 @@ const cn = function(e, t, n) {
|
|
|
1723
1735
|
`, o[i].children && n(o[i].children || [], s + 1);
|
|
1724
1736
|
}
|
|
1725
1737
|
return n(e.children || [], 2), t;
|
|
1726
|
-
}, mn = function() {
|
|
1727
|
-
this.editable = !0;
|
|
1728
1738
|
}, gn = function() {
|
|
1739
|
+
this.editable = !0;
|
|
1740
|
+
}, vn = function() {
|
|
1729
1741
|
this.editable = !1;
|
|
1730
|
-
},
|
|
1742
|
+
}, bn = function(e) {
|
|
1731
1743
|
this.scaleVal = e, this.map.style.transform = "scale(" + e + ")";
|
|
1732
|
-
},
|
|
1744
|
+
}, yn = function() {
|
|
1733
1745
|
this.container.scrollTo(1e4 - this.container.offsetWidth / 2, 1e4 - this.container.offsetHeight / 2);
|
|
1734
|
-
}, yn = function(e) {
|
|
1735
|
-
e(this);
|
|
1736
1746
|
}, xn = function(e) {
|
|
1747
|
+
e(this);
|
|
1748
|
+
}, wn = function(e) {
|
|
1737
1749
|
e.nodeObj.parent && (this.tempDirection === null && (this.tempDirection = this.direction), this.isFocusMode || (this.nodeDataBackup = this.nodeData, this.isFocusMode = !0), this.nodeData = e.nodeObj, this.initRight(), this.toCenter());
|
|
1738
|
-
}, wn = function() {
|
|
1739
|
-
this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
|
|
1740
1750
|
}, En = function() {
|
|
1741
|
-
this.direction =
|
|
1751
|
+
this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
|
|
1742
1752
|
}, Nn = function() {
|
|
1743
|
-
this.direction =
|
|
1753
|
+
this.direction = 0, this.refresh();
|
|
1744
1754
|
}, Cn = function() {
|
|
1755
|
+
this.direction = 1, this.refresh();
|
|
1756
|
+
}, _n = function() {
|
|
1745
1757
|
this.direction = 2, this.refresh();
|
|
1746
|
-
},
|
|
1758
|
+
}, Sn = function(e) {
|
|
1747
1759
|
this.locale = e, this.refresh();
|
|
1748
|
-
},
|
|
1760
|
+
}, Mn = function(e, t) {
|
|
1749
1761
|
const n = e.nodeObj;
|
|
1750
1762
|
typeof t == "boolean" ? n.expanded = t : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
|
|
1751
1763
|
const o = e.parentNode, s = o.children[1];
|
|
@@ -1757,32 +1769,32 @@ const cn = function(e, t, n) {
|
|
|
1757
1769
|
} else
|
|
1758
1770
|
o.parentNode.children[1].remove();
|
|
1759
1771
|
this.linkDiv(), this.bus.fire("expandNode", n);
|
|
1760
|
-
},
|
|
1772
|
+
}, kn = function(e) {
|
|
1761
1773
|
e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.arrows = e.arrows || [], this.summaries = e.summaries || []), $(this.nodeData), this.layout(), this.linkDiv();
|
|
1762
1774
|
}, Ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1763
1775
|
__proto__: null,
|
|
1764
|
-
cancelFocus:
|
|
1765
|
-
clearSelection:
|
|
1766
|
-
disableEdit:
|
|
1767
|
-
enableEdit:
|
|
1768
|
-
expandNode:
|
|
1769
|
-
focusNode:
|
|
1770
|
-
getData:
|
|
1771
|
-
getDataMd:
|
|
1772
|
-
getDataString:
|
|
1773
|
-
initLeft:
|
|
1774
|
-
initRight:
|
|
1775
|
-
initSide:
|
|
1776
|
-
install:
|
|
1777
|
-
refresh:
|
|
1778
|
-
scale:
|
|
1779
|
-
selectNode:
|
|
1780
|
-
selectNodes:
|
|
1781
|
-
setLocale:
|
|
1782
|
-
toCenter:
|
|
1783
|
-
unselectNode:
|
|
1784
|
-
unselectNodes:
|
|
1785
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1776
|
+
cancelFocus: En,
|
|
1777
|
+
clearSelection: un,
|
|
1778
|
+
disableEdit: vn,
|
|
1779
|
+
enableEdit: gn,
|
|
1780
|
+
expandNode: Mn,
|
|
1781
|
+
focusNode: wn,
|
|
1782
|
+
getData: pn,
|
|
1783
|
+
getDataMd: mn,
|
|
1784
|
+
getDataString: fn,
|
|
1785
|
+
initLeft: Nn,
|
|
1786
|
+
initRight: Cn,
|
|
1787
|
+
initSide: _n,
|
|
1788
|
+
install: xn,
|
|
1789
|
+
refresh: kn,
|
|
1790
|
+
scale: bn,
|
|
1791
|
+
selectNode: ln,
|
|
1792
|
+
selectNodes: dn,
|
|
1793
|
+
setLocale: Sn,
|
|
1794
|
+
toCenter: yn,
|
|
1795
|
+
unselectNode: an,
|
|
1796
|
+
unselectNodes: hn
|
|
1797
|
+
}, Symbol.toStringTag, { value: "Module" })), Tn = function(e) {
|
|
1786
1798
|
return {
|
|
1787
1799
|
dom: e,
|
|
1788
1800
|
moved: !1,
|
|
@@ -1808,10 +1820,10 @@ const cn = function(e, t, n) {
|
|
|
1808
1820
|
this.moved = !1, this.mousedown = !1;
|
|
1809
1821
|
}
|
|
1810
1822
|
};
|
|
1811
|
-
},
|
|
1812
|
-
create:
|
|
1823
|
+
}, Te = {
|
|
1824
|
+
create: Tn
|
|
1813
1825
|
};
|
|
1814
|
-
function
|
|
1826
|
+
function re(e, t, n) {
|
|
1815
1827
|
const { offsetLeft: o, offsetTop: s } = O(e.nodes, t), i = t.offsetWidth, r = t.offsetHeight, c = o + i / 2, l = s + r / 2, h = c + n.x, a = l + n.y;
|
|
1816
1828
|
return {
|
|
1817
1829
|
w: i,
|
|
@@ -1830,7 +1842,7 @@ function I(e) {
|
|
|
1830
1842
|
y: n
|
|
1831
1843
|
};
|
|
1832
1844
|
}
|
|
1833
|
-
const
|
|
1845
|
+
const An = function(e, t, n, o) {
|
|
1834
1846
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
1835
1847
|
return N(s, {
|
|
1836
1848
|
"text-anchor": "middle",
|
|
@@ -1838,16 +1850,16 @@ const Tn = function(e, t, n, o) {
|
|
|
1838
1850
|
y: n + "",
|
|
1839
1851
|
fill: o || "#666"
|
|
1840
1852
|
}), s.dataset.type = "custom-link", s.innerHTML = e, s;
|
|
1841
|
-
},
|
|
1853
|
+
}, Ge = function(e, t, n, o, s) {
|
|
1842
1854
|
if (!t || !n)
|
|
1843
1855
|
return;
|
|
1844
1856
|
performance.now();
|
|
1845
|
-
const i =
|
|
1857
|
+
const i = re(e, t, o.delta1), r = re(e, n, o.delta2), { x: c, y: l } = I(i), { ctrlX: h, ctrlY: a } = i, { ctrlX: u, ctrlY: d } = r, { x: m, y: g } = I(r), p = Pe(u, d, m, g), f = pt(
|
|
1846
1858
|
`M ${c} ${l} C ${h} ${a} ${u} ${d} ${m} ${g}`,
|
|
1847
1859
|
`M ${p.x1} ${p.y1} L ${m} ${g} L ${p.x2} ${p.y2}`
|
|
1848
|
-
), v = c / 8 + h * 3 / 8 + u * 3 / 8 + m / 8, b = l / 8 + a * 3 / 8 + d * 3 / 8 + g / 8, y =
|
|
1849
|
-
f.appendChild(y), f.arrowObj = o, f.dataset.linkid = o.id, e.linkSvgGroup.appendChild(f), s || (e.arrows.push(o), e.currentArrow = f,
|
|
1850
|
-
},
|
|
1860
|
+
), v = c / 8 + h * 3 / 8 + u * 3 / 8 + m / 8, b = l / 8 + a * 3 / 8 + d * 3 / 8 + g / 8, y = An(o.label, v, b, e.theme.cssVar["--color"]);
|
|
1861
|
+
f.appendChild(y), f.arrowObj = o, f.dataset.linkid = o.id, e.linkSvgGroup.appendChild(f), s || (e.arrows.push(o), e.currentArrow = f, Ze(e, o, i, r)), performance.now();
|
|
1862
|
+
}, jn = function(e, t) {
|
|
1851
1863
|
const n = {
|
|
1852
1864
|
id: G(),
|
|
1853
1865
|
label: "Custom Link",
|
|
@@ -1862,15 +1874,15 @@ const Tn = function(e, t, n, o) {
|
|
|
1862
1874
|
y: -200
|
|
1863
1875
|
}
|
|
1864
1876
|
};
|
|
1865
|
-
|
|
1877
|
+
Ge(this, e, t, n), this.bus.fire("operation", {
|
|
1866
1878
|
name: "createArrow",
|
|
1867
1879
|
obj: n
|
|
1868
1880
|
});
|
|
1869
|
-
},
|
|
1881
|
+
}, Dn = function(e) {
|
|
1870
1882
|
let t;
|
|
1871
1883
|
if (e ? t = e : t = this.currentArrow, !t)
|
|
1872
1884
|
return;
|
|
1873
|
-
|
|
1885
|
+
Je(this);
|
|
1874
1886
|
const n = t.arrowObj.id;
|
|
1875
1887
|
this.arrows = this.arrows.filter((o) => o.id !== n), t.remove(), this.bus.fire("operation", {
|
|
1876
1888
|
name: "removeArrow",
|
|
@@ -1878,15 +1890,15 @@ const Tn = function(e, t, n, o) {
|
|
|
1878
1890
|
id: n
|
|
1879
1891
|
}
|
|
1880
1892
|
});
|
|
1881
|
-
},
|
|
1893
|
+
}, $n = function(e) {
|
|
1882
1894
|
this.currentArrow = e;
|
|
1883
|
-
const t = e.arrowObj, n = C(t.from), o = C(t.to), s =
|
|
1884
|
-
|
|
1885
|
-
},
|
|
1886
|
-
this.currentArrow = null,
|
|
1887
|
-
},
|
|
1895
|
+
const t = e.arrowObj, n = C(t.from), o = C(t.to), s = re(this, n, t.delta1), i = re(this, o, t.delta2);
|
|
1896
|
+
Ze(this, t, s, i);
|
|
1897
|
+
}, On = function() {
|
|
1898
|
+
this.currentArrow = null, Je(this);
|
|
1899
|
+
}, Je = function(e) {
|
|
1888
1900
|
e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none";
|
|
1889
|
-
},
|
|
1901
|
+
}, Ze = function(e, t, n, o) {
|
|
1890
1902
|
var d;
|
|
1891
1903
|
e.linkController.style.display = "initial", e.P2.style.display = "initial", e.P3.style.display = "initial", e.nodes.appendChild(e.linkController), e.nodes.appendChild(e.P2), e.nodes.appendChild(e.P3);
|
|
1892
1904
|
let { x: s, y: i } = I(n), { ctrlX: r, ctrlY: c } = n, { ctrlX: l, ctrlY: h } = o, { x: a, y: u } = I(o);
|
|
@@ -1900,7 +1912,7 @@ const Tn = function(e, t, n, o) {
|
|
|
1900
1912
|
y1: h + "",
|
|
1901
1913
|
x2: a + "",
|
|
1902
1914
|
y2: u + ""
|
|
1903
|
-
}), e.helper1 && (e.helper1.destory(e.map), (d = e.helper2) == null || d.destory(e.map)), e.helper1 =
|
|
1915
|
+
}), e.helper1 && (e.helper1.destory(e.map), (d = e.helper2) == null || d.destory(e.map)), e.helper1 = Te.create(e.P2), e.helper2 = Te.create(e.P3), e.helper1.init(e.map, (m, g) => {
|
|
1904
1916
|
var b;
|
|
1905
1917
|
r = r + m / e.scaleVal, c = c + g / e.scaleVal;
|
|
1906
1918
|
const p = I({ ...n, ctrlX: r, ctrlY: c });
|
|
@@ -1920,7 +1932,7 @@ const Tn = function(e, t, n, o) {
|
|
|
1920
1932
|
l = l + m / e.scaleVal, h = h + g / e.scaleVal;
|
|
1921
1933
|
const p = I({ ...o, ctrlX: l, ctrlY: h });
|
|
1922
1934
|
a = p.x, u = p.y;
|
|
1923
|
-
const f = s / 8 + r * 3 / 8 + l * 3 / 8 + a / 8, v = i / 8 + c * 3 / 8 + h * 3 / 8 + u / 8, b =
|
|
1935
|
+
const f = s / 8 + r * 3 / 8 + l * 3 / 8 + a / 8, v = i / 8 + c * 3 / 8 + h * 3 / 8 + u / 8, b = Pe(l, h, a, u);
|
|
1924
1936
|
e.P3.style.top = h + "px", e.P3.style.left = l + "px", (y = e.currentArrow) == null || y.children[0].setAttribute("d", `M ${s} ${i} C ${r} ${c} ${l} ${h} ${a} ${u}`), (x = e.currentArrow) == null || x.children[1].setAttribute("d", `M ${b.x1} ${b.y1} L ${a} ${u} L ${b.x2} ${b.y2}`), N(e.currentArrow.children[2], {
|
|
1925
1937
|
x: f + "",
|
|
1926
1938
|
y: v + ""
|
|
@@ -1932,22 +1944,22 @@ const Tn = function(e, t, n, o) {
|
|
|
1932
1944
|
}), t.delta2.x = l - o.cx, t.delta2.y = h - o.cy;
|
|
1933
1945
|
});
|
|
1934
1946
|
};
|
|
1935
|
-
function
|
|
1947
|
+
function Pn() {
|
|
1936
1948
|
this.linkSvgGroup.innerHTML = "";
|
|
1937
1949
|
for (let e = 0; e < this.arrows.length; e++) {
|
|
1938
1950
|
const t = this.arrows[e];
|
|
1939
1951
|
try {
|
|
1940
|
-
|
|
1952
|
+
Ge(this, C(t.from), C(t.to), t, !0);
|
|
1941
1953
|
} catch {
|
|
1942
1954
|
}
|
|
1943
1955
|
}
|
|
1944
1956
|
this.nodes.appendChild(this.linkSvgGroup);
|
|
1945
1957
|
}
|
|
1946
|
-
function
|
|
1958
|
+
function Hn(e) {
|
|
1947
1959
|
if (!e)
|
|
1948
1960
|
return;
|
|
1949
1961
|
const t = e.children[2];
|
|
1950
|
-
|
|
1962
|
+
ze(this, t, (n) => {
|
|
1951
1963
|
var i;
|
|
1952
1964
|
const o = e.arrowObj, s = ((i = n.textContent) == null ? void 0 : i.trim()) || "";
|
|
1953
1965
|
s === "" ? o.label = origin : o.label = s, n.remove(), s !== origin && (t.innerHTML = o.label, this.linkDiv(), this.bus.fire("operation", {
|
|
@@ -1956,19 +1968,19 @@ function Pn(e) {
|
|
|
1956
1968
|
}));
|
|
1957
1969
|
});
|
|
1958
1970
|
}
|
|
1959
|
-
function
|
|
1960
|
-
this.arrows = this.arrows.filter((e) =>
|
|
1971
|
+
function Bn() {
|
|
1972
|
+
this.arrows = this.arrows.filter((e) => se(e.from, this.nodeData) && se(e.to, this.nodeData));
|
|
1961
1973
|
}
|
|
1962
|
-
const
|
|
1974
|
+
const zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1963
1975
|
__proto__: null,
|
|
1964
|
-
createArrow:
|
|
1965
|
-
editArrowLabel:
|
|
1966
|
-
removeArrow:
|
|
1967
|
-
renderArrow:
|
|
1968
|
-
selectArrow:
|
|
1969
|
-
tidyArrow:
|
|
1970
|
-
unselectArrow:
|
|
1971
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1976
|
+
createArrow: jn,
|
|
1977
|
+
editArrowLabel: Hn,
|
|
1978
|
+
removeArrow: Dn,
|
|
1979
|
+
renderArrow: Pn,
|
|
1980
|
+
selectArrow: $n,
|
|
1981
|
+
tidyArrow: Bn,
|
|
1982
|
+
unselectArrow: On
|
|
1983
|
+
}, Symbol.toStringTag, { value: "Module" })), Rn = function(e) {
|
|
1972
1984
|
var l, h;
|
|
1973
1985
|
if (e.length === 0)
|
|
1974
1986
|
throw new Error("No selected node.");
|
|
@@ -2011,10 +2023,10 @@ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2011
2023
|
start: i,
|
|
2012
2024
|
end: r
|
|
2013
2025
|
};
|
|
2014
|
-
},
|
|
2026
|
+
}, qn = function(e) {
|
|
2015
2027
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
2016
2028
|
return t.setAttribute("id", e), t;
|
|
2017
|
-
},
|
|
2029
|
+
}, Ae = function(e, t) {
|
|
2018
2030
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
2019
2031
|
return N(n, {
|
|
2020
2032
|
d: e,
|
|
@@ -2023,7 +2035,7 @@ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2023
2035
|
"stroke-linecap": "round",
|
|
2024
2036
|
"stroke-width": "2"
|
|
2025
2037
|
}), n;
|
|
2026
|
-
},
|
|
2038
|
+
}, je = function(e, t, n, o, s) {
|
|
2027
2039
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
2028
2040
|
return N(i, {
|
|
2029
2041
|
"text-anchor": o,
|
|
@@ -2031,43 +2043,43 @@ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2031
2043
|
y: n + "",
|
|
2032
2044
|
fill: s || "#666"
|
|
2033
2045
|
}), i.innerHTML = e, i;
|
|
2034
|
-
},
|
|
2046
|
+
}, Fn = (e) => C(e).parentElement.parentElement, In = function({ parent: e, start: t }) {
|
|
2035
2047
|
var i, r;
|
|
2036
2048
|
const n = C(e), o = n.nodeObj;
|
|
2037
2049
|
let s;
|
|
2038
2050
|
return o.parent ? s = (i = n.closest("me-main")) == null ? void 0 : i.className : s = (r = C(o.children[t].id).closest("me-main")) == null ? void 0 : r.className, s;
|
|
2039
2051
|
}, Qe = function(e, t) {
|
|
2040
2052
|
var _;
|
|
2041
|
-
const { id: n, text: o, parent: s, start: i, end: r } = t, c = e.nodes, h = C(s).nodeObj, a =
|
|
2053
|
+
const { id: n, text: o, parent: s, start: i, end: r } = t, c = e.nodes, h = C(s).nodeObj, a = In(t);
|
|
2042
2054
|
let u = 1 / 0, d = 0, m = 0, g = 0;
|
|
2043
2055
|
for (let P = i; P <= r; P++) {
|
|
2044
2056
|
const U = (_ = h.children) == null ? void 0 : _[P];
|
|
2045
2057
|
if (!U)
|
|
2046
2058
|
return e.removeSummary(n), null;
|
|
2047
|
-
const H =
|
|
2048
|
-
P === i && (m =
|
|
2059
|
+
const H = Fn(U.id), { offsetLeft: Z, offsetTop: be } = O(c, H);
|
|
2060
|
+
P === i && (m = be), P === r && (g = be + H.offsetHeight), Z < u && (u = Z), H.offsetWidth + Z > d && (d = H.offsetWidth + Z);
|
|
2049
2061
|
}
|
|
2050
2062
|
let p, f;
|
|
2051
2063
|
const v = m + 10, b = g + 10, y = (v + b) / 2, x = e.theme.cssVar["--color"];
|
|
2052
|
-
a === "lhs" ? (p =
|
|
2053
|
-
const w =
|
|
2064
|
+
a === "lhs" ? (p = Ae(`M ${u + 10} ${v} c -5 0 -10 5 -10 10 L ${u} ${b - 10} c 0 5 5 10 10 10 M ${u} ${y} h -10`, x), f = je(o, u - 20, y + 6, "end", x)) : (p = Ae(`M ${d - 10} ${v} c 5 0 10 5 10 10 L ${d} ${b - 10} c 0 5 -5 10 -10 10 M ${d} ${y} h 10`, x), f = je(o, d + 20, y + 6, "start", x));
|
|
2065
|
+
const w = qn("s-" + n);
|
|
2054
2066
|
return w.appendChild(p), w.appendChild(f), w.summaryObj = t, e.summarySvg.appendChild(w), w;
|
|
2055
|
-
},
|
|
2067
|
+
}, Kn = function() {
|
|
2056
2068
|
let e = [];
|
|
2057
2069
|
this.currentNode ? e = [this.currentNode] : this.currentNodes && (e = this.currentNodes);
|
|
2058
|
-
const { parent: t, start: n, end: o } =
|
|
2070
|
+
const { parent: t, start: n, end: o } = Rn(e), s = { id: G(), parent: t, start: n, end: o, text: "summary" }, i = Qe(this, s);
|
|
2059
2071
|
this.summaries.push(s), this.editSummary(i), this.bus.fire("operation", {
|
|
2060
2072
|
name: "createSummary",
|
|
2061
2073
|
obj: s
|
|
2062
2074
|
});
|
|
2063
|
-
},
|
|
2075
|
+
}, Vn = function(e) {
|
|
2064
2076
|
var n;
|
|
2065
2077
|
const t = this.summaries.findIndex((o) => o.id === e);
|
|
2066
2078
|
t > -1 && (this.summaries.splice(t, 1), (n = document.querySelector("#s-" + e)) == null || n.remove()), this.bus.fire("operation", {
|
|
2067
2079
|
name: "removeSummary",
|
|
2068
2080
|
obj: { id: e }
|
|
2069
2081
|
});
|
|
2070
|
-
},
|
|
2082
|
+
}, Wn = function(e) {
|
|
2071
2083
|
const t = e.children[1].getBBox(), n = 6, o = 3, s = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2072
2084
|
N(s, {
|
|
2073
2085
|
x: t.x - n + "",
|
|
@@ -2079,21 +2091,21 @@ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2079
2091
|
"stroke-width": "2",
|
|
2080
2092
|
fill: "none"
|
|
2081
2093
|
}), s.classList.add("selected"), e.appendChild(s), this.currentSummary = e;
|
|
2082
|
-
},
|
|
2094
|
+
}, Un = function() {
|
|
2083
2095
|
var e, t;
|
|
2084
2096
|
(t = (e = this.currentSummary) == null ? void 0 : e.querySelector("rect")) == null || t.remove(), this.currentSummary = null;
|
|
2085
|
-
},
|
|
2097
|
+
}, Yn = function() {
|
|
2086
2098
|
this.summarySvg.innerHTML = "", this.summaries.forEach((e) => {
|
|
2087
2099
|
try {
|
|
2088
2100
|
Qe(this, e);
|
|
2089
2101
|
} catch {
|
|
2090
2102
|
}
|
|
2091
2103
|
}), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
|
|
2092
|
-
},
|
|
2104
|
+
}, Xn = function(e) {
|
|
2093
2105
|
if (!e)
|
|
2094
2106
|
return;
|
|
2095
2107
|
const t = e.childNodes[1];
|
|
2096
|
-
|
|
2108
|
+
ze(this, t, (n) => {
|
|
2097
2109
|
var i;
|
|
2098
2110
|
const o = e.summaryObj, s = ((i = n.textContent) == null ? void 0 : i.trim()) || "";
|
|
2099
2111
|
s === "" ? o.text = origin : o.text = s, n.remove(), s !== origin && (t.innerHTML = o.text, this.linkDiv(), this.bus.fire("operation", {
|
|
@@ -2101,16 +2113,16 @@ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2101
2113
|
obj: o
|
|
2102
2114
|
}));
|
|
2103
2115
|
});
|
|
2104
|
-
},
|
|
2116
|
+
}, Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2105
2117
|
__proto__: null,
|
|
2106
|
-
createSummary:
|
|
2107
|
-
editSummary:
|
|
2108
|
-
removeSummary:
|
|
2109
|
-
renderSummary:
|
|
2110
|
-
selectSummary:
|
|
2111
|
-
unselectSummary:
|
|
2118
|
+
createSummary: Kn,
|
|
2119
|
+
editSummary: Xn,
|
|
2120
|
+
removeSummary: Vn,
|
|
2121
|
+
renderSummary: Yn,
|
|
2122
|
+
selectSummary: Wn,
|
|
2123
|
+
unselectSummary: Un
|
|
2112
2124
|
}, Symbol.toStringTag, { value: "Module" })), M = "http://www.w3.org/2000/svg";
|
|
2113
|
-
function
|
|
2125
|
+
function Jn(e, t) {
|
|
2114
2126
|
const n = document.createElementNS(M, "svg");
|
|
2115
2127
|
return N(n, {
|
|
2116
2128
|
version: "1.1",
|
|
@@ -2119,7 +2131,7 @@ function Gn(e, t) {
|
|
|
2119
2131
|
width: t
|
|
2120
2132
|
}), n;
|
|
2121
2133
|
}
|
|
2122
|
-
function
|
|
2134
|
+
function Zn(e, t) {
|
|
2123
2135
|
return (parseInt(e) - parseInt(t)) / 2;
|
|
2124
2136
|
}
|
|
2125
2137
|
function Qn(e, t, n, o) {
|
|
@@ -2130,7 +2142,7 @@ function Qn(e, t, n, o) {
|
|
|
2130
2142
|
const h = document.createElementNS(M, "text");
|
|
2131
2143
|
N(h, {
|
|
2132
2144
|
x: n + parseInt(t.paddingLeft) + "",
|
|
2133
|
-
y: o + parseInt(t.paddingTop) +
|
|
2145
|
+
y: o + parseInt(t.paddingTop) + Zn(t.lineHeight, t.fontSize) * (l + 1) + parseFloat(t.fontSize) * (l + 1) + "",
|
|
2134
2146
|
"text-anchor": "start",
|
|
2135
2147
|
"font-family": t.fontFamily,
|
|
2136
2148
|
"font-size": `${t.fontSize}`,
|
|
@@ -2139,7 +2151,7 @@ function Qn(e, t, n, o) {
|
|
|
2139
2151
|
}), h.innerHTML = c, s.appendChild(h);
|
|
2140
2152
|
}), s;
|
|
2141
2153
|
}
|
|
2142
|
-
function
|
|
2154
|
+
function eo(e, t, n, o) {
|
|
2143
2155
|
var c;
|
|
2144
2156
|
let s = "";
|
|
2145
2157
|
(c = e.nodeObj) != null && c.dangerouslySetInnerHTML ? s = e.nodeObj.dangerouslySetInnerHTML : e.text ? s = e.text.textContent : s = e.childNodes[0].textContent;
|
|
@@ -2156,7 +2168,7 @@ function Zn(e, t, n, o) {
|
|
|
2156
2168
|
style: `font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`
|
|
2157
2169
|
}), r.innerHTML = s, i.appendChild(r), i;
|
|
2158
2170
|
}
|
|
2159
|
-
function
|
|
2171
|
+
function to(e, t) {
|
|
2160
2172
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = O(e.nodes, t), i = document.createElementNS(M, "rect");
|
|
2161
2173
|
return N(i, {
|
|
2162
2174
|
x: o + "",
|
|
@@ -2170,7 +2182,7 @@ function eo(e, t) {
|
|
|
2170
2182
|
"stroke-width": n.borderWidth
|
|
2171
2183
|
}), i;
|
|
2172
2184
|
}
|
|
2173
|
-
function
|
|
2185
|
+
function te(e, t, n = !1) {
|
|
2174
2186
|
const o = getComputedStyle(t), { offsetLeft: s, offsetTop: i } = O(e.nodes, t), r = document.createElementNS(M, "rect");
|
|
2175
2187
|
N(r, {
|
|
2176
2188
|
x: s + "",
|
|
@@ -2186,9 +2198,9 @@ function ee(e, t, n = !1) {
|
|
|
2186
2198
|
const c = document.createElementNS(M, "g");
|
|
2187
2199
|
c.appendChild(r);
|
|
2188
2200
|
let l;
|
|
2189
|
-
return n ? l =
|
|
2201
|
+
return n ? l = eo(t, o, s, i) : l = Qn(t, o, s, i), c.appendChild(l), c;
|
|
2190
2202
|
}
|
|
2191
|
-
function
|
|
2203
|
+
function no(e, t) {
|
|
2192
2204
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = O(e.nodes, t), i = document.createElementNS(M, "a"), r = document.createElementNS(M, "text");
|
|
2193
2205
|
return N(r, {
|
|
2194
2206
|
x: o + "",
|
|
@@ -2200,7 +2212,7 @@ function to(e, t) {
|
|
|
2200
2212
|
fill: `${n.color}`
|
|
2201
2213
|
}), r.innerHTML = t.textContent, i.appendChild(r), i.setAttribute("href", t.href), i;
|
|
2202
2214
|
}
|
|
2203
|
-
function
|
|
2215
|
+
function oo(e, t) {
|
|
2204
2216
|
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = O(e.nodes, t), i = document.createElementNS(M, "image");
|
|
2205
2217
|
return N(i, {
|
|
2206
2218
|
x: o + "",
|
|
@@ -2210,9 +2222,9 @@ function no(e, t) {
|
|
|
2210
2222
|
href: t.src
|
|
2211
2223
|
}), i;
|
|
2212
2224
|
}
|
|
2213
|
-
const
|
|
2225
|
+
const ne = 100, so = '<?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">', io = (e, t = !1) => {
|
|
2214
2226
|
var u, d, m;
|
|
2215
|
-
const n = e.nodes, o = n.offsetHeight +
|
|
2227
|
+
const n = e.nodes, o = n.offsetHeight + ne * 2, s = n.offsetWidth + ne * 2, i = Jn(o + "px", s + "px"), r = document.createElementNS(M, "svg"), c = document.createElementNS(M, "rect");
|
|
2216
2228
|
N(c, {
|
|
2217
2229
|
x: "0",
|
|
2218
2230
|
y: "0",
|
|
@@ -2229,22 +2241,22 @@ const te = 100, oo = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC
|
|
|
2229
2241
|
h && r.appendChild(h);
|
|
2230
2242
|
const a = (m = n.querySelector(".summary")) == null ? void 0 : m.cloneNode(!0);
|
|
2231
2243
|
return a && r.appendChild(a), n.querySelectorAll("me-tpc").forEach((g) => {
|
|
2232
|
-
g.nodeObj.dangerouslySetInnerHTML ? r.appendChild(
|
|
2244
|
+
g.nodeObj.dangerouslySetInnerHTML ? r.appendChild(te(e, g, !t)) : (r.appendChild(to(e, g)), r.appendChild(te(e, g.text, !t)));
|
|
2233
2245
|
}), n.querySelectorAll(".tags > span").forEach((g) => {
|
|
2234
|
-
r.appendChild(
|
|
2246
|
+
r.appendChild(te(e, g));
|
|
2235
2247
|
}), n.querySelectorAll(".icons > span").forEach((g) => {
|
|
2236
|
-
r.appendChild(
|
|
2248
|
+
r.appendChild(te(e, g));
|
|
2237
2249
|
}), n.querySelectorAll(".hyper-link").forEach((g) => {
|
|
2238
|
-
r.appendChild(to(e, g));
|
|
2239
|
-
}), n.querySelectorAll("img").forEach((g) => {
|
|
2240
2250
|
r.appendChild(no(e, g));
|
|
2251
|
+
}), n.querySelectorAll("img").forEach((g) => {
|
|
2252
|
+
r.appendChild(oo(e, g));
|
|
2241
2253
|
}), N(r, {
|
|
2242
|
-
x:
|
|
2243
|
-
y:
|
|
2254
|
+
x: ne + "",
|
|
2255
|
+
y: ne + "",
|
|
2244
2256
|
overflow: "visible"
|
|
2245
2257
|
}), i.appendChild(r), i;
|
|
2246
|
-
},
|
|
2247
|
-
function
|
|
2258
|
+
}, ro = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), so + e.outerHTML);
|
|
2259
|
+
function co(e) {
|
|
2248
2260
|
return new Promise((t, n) => {
|
|
2249
2261
|
const o = new FileReader();
|
|
2250
2262
|
o.onload = (s) => {
|
|
@@ -2254,11 +2266,11 @@ function ro(e) {
|
|
|
2254
2266
|
}, o.readAsDataURL(e);
|
|
2255
2267
|
});
|
|
2256
2268
|
}
|
|
2257
|
-
const
|
|
2258
|
-
const n =
|
|
2269
|
+
const lo = function(e = !1, t) {
|
|
2270
|
+
const n = io(this, e), o = ro(n, t);
|
|
2259
2271
|
return new Blob([o], { type: "image/svg+xml" });
|
|
2260
|
-
},
|
|
2261
|
-
const n = this.exportSvg(e, t), o = await
|
|
2272
|
+
}, ao = async function(e = !1, t) {
|
|
2273
|
+
const n = this.exportSvg(e, t), o = await co(n);
|
|
2262
2274
|
return new Promise((s, i) => {
|
|
2263
2275
|
const r = new Image();
|
|
2264
2276
|
r.setAttribute("crossOrigin", "anonymous"), r.onload = () => {
|
|
@@ -2266,50 +2278,50 @@ const co = function(e = !1, t) {
|
|
|
2266
2278
|
c.width = r.width, c.height = r.height, c.getContext("2d").drawImage(r, 0, 0), c.toBlob(s, "image/png", 1);
|
|
2267
2279
|
}, r.src = o, r.onerror = i;
|
|
2268
2280
|
});
|
|
2269
|
-
},
|
|
2281
|
+
}, ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2270
2282
|
__proto__: null,
|
|
2271
|
-
exportPng:
|
|
2272
|
-
exportSvg:
|
|
2283
|
+
exportPng: ao,
|
|
2284
|
+
exportSvg: lo
|
|
2273
2285
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2274
|
-
function
|
|
2286
|
+
function uo(e, t) {
|
|
2275
2287
|
return async function(...n) {
|
|
2276
2288
|
const o = this.before[t];
|
|
2277
2289
|
o && !await o.apply(this, n) || e.apply(this, n);
|
|
2278
2290
|
};
|
|
2279
2291
|
}
|
|
2280
|
-
const
|
|
2281
|
-
for (let e = 0; e <
|
|
2282
|
-
const t =
|
|
2283
|
-
|
|
2292
|
+
const De = Object.keys(Ye), et = {};
|
|
2293
|
+
for (let e = 0; e < De.length; e++) {
|
|
2294
|
+
const t = De[e];
|
|
2295
|
+
et[t] = uo(Ye[t], t);
|
|
2284
2296
|
}
|
|
2285
|
-
const
|
|
2286
|
-
getObjById:
|
|
2287
|
-
generateNewObj:
|
|
2288
|
-
layout:
|
|
2289
|
-
linkDiv:
|
|
2290
|
-
editTopic:
|
|
2291
|
-
createWrapper:
|
|
2292
|
-
createParent:
|
|
2293
|
-
createChildren:
|
|
2294
|
-
createTopic:
|
|
2297
|
+
const fo = {
|
|
2298
|
+
getObjById: se,
|
|
2299
|
+
generateNewObj: ot,
|
|
2300
|
+
layout: rt,
|
|
2301
|
+
linkDiv: mt,
|
|
2302
|
+
editTopic: ft,
|
|
2303
|
+
createWrapper: at,
|
|
2304
|
+
createParent: dt,
|
|
2305
|
+
createChildren: ht,
|
|
2306
|
+
createTopic: ut,
|
|
2295
2307
|
findEle: C,
|
|
2296
|
-
changeTheme:
|
|
2308
|
+
changeTheme: Rt,
|
|
2297
2309
|
...Ln,
|
|
2298
|
-
...
|
|
2299
|
-
...
|
|
2300
|
-
...
|
|
2301
|
-
...
|
|
2310
|
+
...et,
|
|
2311
|
+
...zn,
|
|
2312
|
+
...Gn,
|
|
2313
|
+
...ho,
|
|
2302
2314
|
init(e) {
|
|
2303
2315
|
if (!e || !e.nodeData)
|
|
2304
2316
|
return new Error("MindElixir: `data` is required");
|
|
2305
|
-
e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, $(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar &&
|
|
2317
|
+
e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, $(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && At(this), this.keypress && Et(this), this.editable && zt(this), tt() && this.mobileMenu ? Nt(this) : this.contextMenu && this.disposable.push(gt(this, this.contextMenuOption)), this.draggable && St(this), this.allowUndo && kt(this), this.toCenter(), this.layout(), this.linkDiv();
|
|
2306
2318
|
},
|
|
2307
2319
|
destroy() {
|
|
2308
2320
|
var e, t;
|
|
2309
2321
|
this.disposable.forEach((n) => n()), (e = this.mindElixirBox) == null || e.remove(), this.mindElixirBox = void 0, this.nodeData = void 0, this.arrows = void 0, this.summaries = void 0, this.currentArrow = void 0, this.currentNode = 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;
|
|
2310
2322
|
}
|
|
2311
2323
|
};
|
|
2312
|
-
function
|
|
2324
|
+
function po({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: l, containerHeight: h }) {
|
|
2313
2325
|
let a = t + n / 2;
|
|
2314
2326
|
const u = e + o / 2;
|
|
2315
2327
|
let d;
|
|
@@ -2317,7 +2329,7 @@ function fo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction:
|
|
|
2317
2329
|
const m = s + c / 2, p = (1 - Math.abs(m - u) / h) * 0.25 * (n / 2);
|
|
2318
2330
|
return l === "lhs" ? a = a - n / 10 - p : a = a + n / 10 + p, `M ${a} ${u} Q ${a} ${m} ${d} ${m}`;
|
|
2319
2331
|
}
|
|
2320
|
-
function
|
|
2332
|
+
function mo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: l, isFirst: h }) {
|
|
2321
2333
|
let a = 0, u = 0;
|
|
2322
2334
|
h ? a = e + o / 2 : a = e + o;
|
|
2323
2335
|
const d = s + c;
|
|
@@ -2350,19 +2362,19 @@ function T({
|
|
|
2350
2362
|
const y = Object.prototype.toString.call(e);
|
|
2351
2363
|
if (y === "[object HTMLDivElement]" ? b = e : y === "[object String]" && (b = document.querySelector(e)), !b)
|
|
2352
2364
|
throw new Error("MindElixir: el is not a valid element");
|
|
2353
|
-
b.className += " mind-elixir", b.innerHTML = "", b.style.setProperty("--gap", D + "px"), this.mindElixirBox = b, this.disposable = [], this.before = a || {}, this.locale = n || "en", this.contextMenuOption = r, this.contextMenu = i === void 0 ? !0 : i, this.toolBar = c === void 0 ? !0 : c, this.keypress = l === void 0 ? !0 : l, this.mouseSelectionButton = h || 0, this.mobileMenu = f || !1, this.direction = typeof t == "number" ? t : 1, this.draggable = o === void 0 ? !0 : o, this.newTopicName = u || "new node", this.editable = s === void 0 ? !0 : s, this.allowUndo = d === void 0 ? !1 : d, this.currentNode = null, this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.generateMainBranch = m ||
|
|
2365
|
+
b.className += " mind-elixir", b.innerHTML = "", b.style.setProperty("--gap", D + "px"), this.mindElixirBox = b, this.disposable = [], this.before = a || {}, this.locale = n || "en", this.contextMenuOption = r, this.contextMenu = i === void 0 ? !0 : i, this.toolBar = c === void 0 ? !0 : c, this.keypress = l === void 0 ? !0 : l, this.mouseSelectionButton = h || 0, this.mobileMenu = f || !1, this.direction = typeof t == "number" ? t : 1, this.draggable = o === void 0 ? !0 : o, this.newTopicName = u || "new node", this.editable = s === void 0 ? !0 : s, this.allowUndo = d === void 0 ? !1 : d, this.currentNode = null, this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.generateMainBranch = m || po, this.generateSubBranch = g || mo, this.overflowHidden = p || !1, this.bus = it.create(), this.container = Y.createElement("div"), this.container.className = "map-container";
|
|
2354
2366
|
const x = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2355
|
-
this.theme = v || (x.matches ?
|
|
2367
|
+
this.theme = v || (x.matches ? Oe : $e);
|
|
2356
2368
|
const w = Y.createElement("div");
|
|
2357
|
-
w.className = "map-canvas", this.map = w, this.map.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.mindElixirBox.appendChild(this.container), this.nodes = Y.createElement("me-nodes"), this.nodes.className = "main-node-container", this.lines = X("lines"), this.summarySvg = X("summary"), this.linkController = X("linkcontroller"), this.P2 = Y.createElement("div"), this.P3 = Y.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 =
|
|
2369
|
+
w.className = "map-canvas", this.map = w, this.map.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.mindElixirBox.appendChild(this.container), this.nodes = Y.createElement("me-nodes"), this.nodes.className = "main-node-container", this.lines = X("lines"), this.summarySvg = X("summary"), this.linkController = X("linkcontroller"), this.P2 = Y.createElement("div"), this.P3 = Y.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = ye(), this.line2 = ye(), 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" : st(this);
|
|
2358
2370
|
}
|
|
2359
|
-
T.prototype =
|
|
2360
|
-
T.LEFT =
|
|
2371
|
+
T.prototype = fo;
|
|
2372
|
+
T.LEFT = L;
|
|
2361
2373
|
T.RIGHT = z;
|
|
2362
|
-
T.SIDE =
|
|
2363
|
-
T.THEME =
|
|
2364
|
-
T.DARK_THEME =
|
|
2365
|
-
T.version = "4.1.
|
|
2374
|
+
T.SIDE = ce;
|
|
2375
|
+
T.THEME = $e;
|
|
2376
|
+
T.DARK_THEME = Oe;
|
|
2377
|
+
T.version = "4.1.2";
|
|
2366
2378
|
T.E = C;
|
|
2367
2379
|
T.new = (e) => ({
|
|
2368
2380
|
nodeData: {
|