mind-elixir 5.11.1-beta.2 → 5.11.1-beta.4
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 +205 -204
- package/dist/MindElixirLite.iife.js +4 -4
- package/dist/MindElixirLite.js +145 -144
- package/package.json +17 -17
- package/readme/es.md +0 -453
- package/readme/fr.md +0 -437
- package/readme/ja.md +0 -452
- package/readme/ko.md +0 -435
- package/readme/pt.md +0 -436
- package/readme/ru.md +0 -435
- package/readme/zh.md +0 -453
package/dist/MindElixirLite.js
CHANGED
|
@@ -53,7 +53,7 @@ const Bn = 0, Wn = 1, Yn = 2, tt = {
|
|
|
53
53
|
"--map-padding": "50px 80px"
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
function
|
|
56
|
+
function $t(t) {
|
|
57
57
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
58
58
|
}
|
|
59
59
|
const G = function(t, e) {
|
|
@@ -88,7 +88,7 @@ function _(t, e, n, o) {
|
|
|
88
88
|
function Y() {
|
|
89
89
|
return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substring(2)).substring(2, 18);
|
|
90
90
|
}
|
|
91
|
-
const
|
|
91
|
+
const Ht = function() {
|
|
92
92
|
const t = Y();
|
|
93
93
|
return {
|
|
94
94
|
topic: this.newTopicName,
|
|
@@ -119,7 +119,7 @@ const At = function() {
|
|
|
119
119
|
}, ht = (t, e) => {
|
|
120
120
|
const n = t.x - e.x, o = t.y - e.y;
|
|
121
121
|
return Math.sqrt(n * n + o * o);
|
|
122
|
-
},
|
|
122
|
+
}, It = function(t, e) {
|
|
123
123
|
if (!e)
|
|
124
124
|
return j(t), t;
|
|
125
125
|
let n = t.querySelector(".insert-preview");
|
|
@@ -136,11 +136,11 @@ const At = function() {
|
|
|
136
136
|
if (!(t && t.tagName === "ME-TPC" && t !== n && !o && t.nodeObj.parent)) return !1;
|
|
137
137
|
}
|
|
138
138
|
return !0;
|
|
139
|
-
},
|
|
139
|
+
}, Ot = function(t) {
|
|
140
140
|
const e = document.createElement("div");
|
|
141
141
|
return e.className = "mind-elixir-ghost", t.container.appendChild(e), e;
|
|
142
142
|
};
|
|
143
|
-
class
|
|
143
|
+
class Bt {
|
|
144
144
|
mind;
|
|
145
145
|
isMoving = !1;
|
|
146
146
|
interval = null;
|
|
@@ -157,19 +157,19 @@ class It {
|
|
|
157
157
|
this.isMoving = !1, this.interval && (clearInterval(this.interval), this.interval = null);
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function Wt(t) {
|
|
161
161
|
return {
|
|
162
162
|
isDragging: !1,
|
|
163
163
|
insertType: null,
|
|
164
164
|
meet: null,
|
|
165
|
-
ghost:
|
|
166
|
-
edgeMoveController: new
|
|
165
|
+
ghost: Ot(t),
|
|
166
|
+
edgeMoveController: new Bt(t),
|
|
167
167
|
startX: 0,
|
|
168
168
|
startY: 0,
|
|
169
169
|
pointerId: null
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
-
const
|
|
172
|
+
const Yt = 5;
|
|
173
173
|
function ft(t, e, n, o = !1) {
|
|
174
174
|
if (t.spacePressed) return !1;
|
|
175
175
|
const s = n.target;
|
|
@@ -193,11 +193,11 @@ function xt(t, e) {
|
|
|
193
193
|
s.parentElement.parentElement.style.opacity = "0.5";
|
|
194
194
|
t.panHelper.clear();
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function Rt(t, e, n) {
|
|
197
197
|
const { dragged: o } = t;
|
|
198
198
|
if (!o || e.pointerId !== n.pointerId) return;
|
|
199
199
|
const s = n.clientX - e.startX, i = n.clientY - e.startY, r = Math.sqrt(s * s + i * i);
|
|
200
|
-
if (!e.isDragging && r >
|
|
200
|
+
if (!e.isDragging && r > Yt && xt(t, e), !e.isDragging) return;
|
|
201
201
|
const c = t.container.getBoundingClientRect();
|
|
202
202
|
bt(e.ghost, n.clientX - c.x, n.clientY - c.y), n.clientX < c.x + 50 ? e.edgeMoveController.move(1, 0) : n.clientX > c.x + c.width - 50 ? e.edgeMoveController.move(-1, 0) : n.clientY < c.y + 50 ? e.edgeMoveController.move(0, 1) : n.clientY > c.y + c.height - 50 ? e.edgeMoveController.move(0, -1) : e.edgeMoveController.stop(), j(e.meet);
|
|
203
203
|
const l = 12 * t.scaleVal, a = document.elementFromPoint(n.clientX, n.clientY - l);
|
|
@@ -214,9 +214,9 @@ function Wt(t, e, n) {
|
|
|
214
214
|
} else
|
|
215
215
|
e.insertType = null, e.meet = null;
|
|
216
216
|
}
|
|
217
|
-
e.meet &&
|
|
217
|
+
e.meet && It(e.meet, e.insertType);
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function Xt(t, e, n) {
|
|
220
220
|
const { dragged: o } = t;
|
|
221
221
|
if (!(!o || e.pointerId !== n.pointerId)) {
|
|
222
222
|
e.edgeMoveController.stop();
|
|
@@ -237,7 +237,7 @@ function ut(t, e) {
|
|
|
237
237
|
const I = {
|
|
238
238
|
LHS: "lhs",
|
|
239
239
|
RHS: "rhs"
|
|
240
|
-
},
|
|
240
|
+
}, Vt = function() {
|
|
241
241
|
this.nodes.innerHTML = "";
|
|
242
242
|
const t = this.createTopic(this.nodeData);
|
|
243
243
|
St.call(this, t, this.nodeData), t.draggable = !1;
|
|
@@ -250,8 +250,8 @@ const I = {
|
|
|
250
250
|
i.direction === 0 ? o += 1 : i.direction === 1 ? s += 1 : o <= s ? (i.direction = 0, o += 1) : (i.direction = 1, s += 1);
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
|
-
|
|
254
|
-
},
|
|
253
|
+
zt(this, n, e);
|
|
254
|
+
}, zt = function(t, e, n) {
|
|
255
255
|
const o = document.createElement("me-main");
|
|
256
256
|
o.className = I.LHS;
|
|
257
257
|
const s = document.createElement("me-main");
|
|
@@ -261,7 +261,7 @@ const I = {
|
|
|
261
261
|
t.direction === 2 ? r.direction === 0 ? o.appendChild(c) : s.appendChild(c) : t.direction === 0 ? o.appendChild(c) : s.appendChild(c);
|
|
262
262
|
}
|
|
263
263
|
t.nodes.appendChild(o), t.nodes.appendChild(n), t.nodes.appendChild(s), t.nodes.appendChild(t.lines), t.nodes.appendChild(t.labelContainer);
|
|
264
|
-
},
|
|
264
|
+
}, Ft = function(t, e) {
|
|
265
265
|
const n = document.createElement("me-children");
|
|
266
266
|
for (let o = 0; o < e.length; o++) {
|
|
267
267
|
const s = e[o], { grp: i } = t.createWrapper(s);
|
|
@@ -299,7 +299,7 @@ const I = {
|
|
|
299
299
|
} else t.link && (t.link = void 0);
|
|
300
300
|
if (e.icons && e.icons.length) {
|
|
301
301
|
const n = document.createElement("span");
|
|
302
|
-
n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${
|
|
302
|
+
n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${$t(o)}</span>`).join(""), t.appendChild(n), t.icons = n;
|
|
303
303
|
} else t.icons && (t.icons = void 0);
|
|
304
304
|
if (e.tags && e.tags.length) {
|
|
305
305
|
const n = document.createElement("div");
|
|
@@ -308,23 +308,23 @@ const I = {
|
|
|
308
308
|
typeof o == "string" ? s.textContent = o : (s.textContent = o.text, o.className && (s.className = o.className), o.style && Object.assign(s.style, o.style)), n.appendChild(s);
|
|
309
309
|
}), t.appendChild(n), t.tags = n;
|
|
310
310
|
} else t.tags && (t.tags = void 0);
|
|
311
|
-
},
|
|
311
|
+
}, Gt = function(t, e) {
|
|
312
312
|
const n = document.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(t);
|
|
313
313
|
if (n.appendChild(o), !e && t.children && t.children.length > 0) {
|
|
314
|
-
const i =
|
|
314
|
+
const i = Kt(t.expanded);
|
|
315
315
|
if (o.appendChild(i), t.expanded !== !1) {
|
|
316
|
-
const r =
|
|
316
|
+
const r = Ft(this, t.children);
|
|
317
317
|
n.appendChild(r);
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
return { grp: n, top: o, tpc: s };
|
|
321
|
-
},
|
|
321
|
+
}, _t = function(t) {
|
|
322
322
|
const e = document.createElement("me-parent"), n = this.createTopic(t);
|
|
323
323
|
return St.call(this, n, t), e.appendChild(n), { p: e, tpc: n };
|
|
324
|
-
},
|
|
324
|
+
}, qt = function(t) {
|
|
325
325
|
const e = document.createElement("me-children");
|
|
326
326
|
return e.append(...t), e;
|
|
327
|
-
},
|
|
327
|
+
}, jt = function(t) {
|
|
328
328
|
const e = document.createElement("me-tpc");
|
|
329
329
|
return e.nodeObj = t, e.dataset.nodeid = "me" + t.id, e;
|
|
330
330
|
};
|
|
@@ -334,7 +334,7 @@ function Et(t) {
|
|
|
334
334
|
const n = window.getSelection();
|
|
335
335
|
n && (n.removeAllRanges(), n.addRange(e));
|
|
336
336
|
}
|
|
337
|
-
const
|
|
337
|
+
const Ut = function(t) {
|
|
338
338
|
if (!t) return;
|
|
339
339
|
const e = document.createElement("div"), n = t.nodeObj, o = n.topic, { offsetLeft: s, offsetTop: i } = M(this.nodes, t);
|
|
340
340
|
this.nodes.appendChild(e), e.id = "input-box", e.textContent = o, e.contentEditable = "plaintext-only", e.spellcheck = !1;
|
|
@@ -369,14 +369,14 @@ const qt = function(t) {
|
|
|
369
369
|
origin: o
|
|
370
370
|
}));
|
|
371
371
|
});
|
|
372
|
-
},
|
|
372
|
+
}, Kt = function(t) {
|
|
373
373
|
const e = document.createElement("me-epd");
|
|
374
374
|
return e.expanded = t !== !1, e.className = t !== !1 ? "minus" : "", e;
|
|
375
|
-
},
|
|
375
|
+
}, Jt = function(t) {
|
|
376
376
|
const n = t.parentElement.parentElement.lastElementChild;
|
|
377
377
|
n?.tagName === "svg" && n?.remove();
|
|
378
378
|
};
|
|
379
|
-
function
|
|
379
|
+
function Zt(t) {
|
|
380
380
|
return {
|
|
381
381
|
nodeData: t.isFocusMode ? t.nodeDataBackup : t.nodeData,
|
|
382
382
|
arrows: t.arrows,
|
|
@@ -385,44 +385,44 @@ function Kt(t) {
|
|
|
385
385
|
theme: t.theme
|
|
386
386
|
};
|
|
387
387
|
}
|
|
388
|
-
const
|
|
388
|
+
const Qt = function(t) {
|
|
389
389
|
const e = this.container, n = t.getBoundingClientRect(), o = e.getBoundingClientRect();
|
|
390
390
|
if (n.top > o.bottom - 50 || n.bottom < o.top + 50 || n.left > o.right - 50 || n.right < o.left + 50) {
|
|
391
391
|
const i = n.left + n.width / 2, r = n.top + n.height / 2, c = o.left + o.width / 2, l = o.top + o.height / 2, a = i - c, d = r - l;
|
|
392
392
|
this.move(-a, -d, !0);
|
|
393
393
|
}
|
|
394
|
-
},
|
|
394
|
+
}, te = function(t, e, n) {
|
|
395
395
|
this.clearSelection(), this.scrollIntoView(t), this.selection?.select(t), e && this.bus.fire("selectNewNode", t.nodeObj);
|
|
396
|
-
},
|
|
396
|
+
}, ee = function(t) {
|
|
397
397
|
this.selection?.select(t);
|
|
398
|
-
},
|
|
398
|
+
}, ne = function(t) {
|
|
399
399
|
this.selection?.deselect(t);
|
|
400
|
-
},
|
|
400
|
+
}, oe = function() {
|
|
401
401
|
this.unselectNodes(this.currentNodes), this.unselectSummary(), this.unselectArrow();
|
|
402
402
|
}, Tt = function(t) {
|
|
403
403
|
return JSON.stringify(t, (e, n) => {
|
|
404
404
|
if (!(e === "parent" && typeof n != "string"))
|
|
405
405
|
return n;
|
|
406
406
|
});
|
|
407
|
-
},
|
|
408
|
-
const t =
|
|
407
|
+
}, se = function() {
|
|
408
|
+
const t = Zt(this);
|
|
409
409
|
return Tt(t);
|
|
410
|
-
},
|
|
410
|
+
}, ie = function() {
|
|
411
411
|
return JSON.parse(this.getDataString());
|
|
412
|
-
},
|
|
412
|
+
}, re = function() {
|
|
413
413
|
this.editable = !0;
|
|
414
|
-
},
|
|
414
|
+
}, ce = function() {
|
|
415
415
|
this.editable = !1;
|
|
416
|
-
},
|
|
416
|
+
}, le = function(t, e = { x: 0, y: 0 }) {
|
|
417
417
|
if (t < this.scaleMin && t < this.scaleVal || t > this.scaleMax && t > this.scaleVal) return;
|
|
418
418
|
const n = this.container.getBoundingClientRect(), o = e.x ? e.x - n.left - n.width / 2 : 0, s = e.y ? e.y - n.top - n.height / 2 : 0, { dx: i, dy: r } = st(this), c = this.map.style.transform, { x: l, y: a } = ot(c), d = l - i, f = a - r, p = this.scaleVal, w = (-o + d) * (1 - t / p), y = (-s + f) * (1 - t / p);
|
|
419
419
|
this.map.style.transform = `translate3d(${l - w}px, ${a - y}px, 0) scale(${t})`, this.scaleVal = t, this.bus.fire("scale", t);
|
|
420
|
-
},
|
|
420
|
+
}, ae = function() {
|
|
421
421
|
const t = this.nodes.offsetHeight / this.container.offsetHeight, e = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(t, e));
|
|
422
422
|
this.scaleVal = n;
|
|
423
423
|
const { dx: o, dy: s } = st(this, !0);
|
|
424
424
|
this.map.style.transform = `translate3d(${o}px, ${s}px, 0) scale(${n})`, this.bus.fire("scale", n);
|
|
425
|
-
},
|
|
425
|
+
}, he = function(t, e, n = !1) {
|
|
426
426
|
const { map: o, scaleVal: s, bus: i, container: r, nodes: c } = this;
|
|
427
427
|
if (n && o.style.transition === "transform 0.3s")
|
|
428
428
|
return;
|
|
@@ -450,29 +450,29 @@ const Jt = function(t) {
|
|
|
450
450
|
i = n.offsetWidth / 2 - a - d / 2, r = n.offsetHeight / 2 - l - f / 2, o.style.transformOrigin = `${a + d / 2}px 50%`;
|
|
451
451
|
}
|
|
452
452
|
return { dx: i, dy: r };
|
|
453
|
-
},
|
|
453
|
+
}, de = function() {
|
|
454
454
|
const { map: t, container: e } = this, { dx: n, dy: o } = st(this);
|
|
455
455
|
e.scrollTop = 0, e.scrollLeft = 0, t.style.transform = `translate3d(${n}px, ${o}px, 0) scale(${this.scaleVal})`;
|
|
456
|
-
},
|
|
456
|
+
}, fe = function(t) {
|
|
457
457
|
t(this);
|
|
458
|
-
},
|
|
458
|
+
}, ue = function(t) {
|
|
459
459
|
t.nodeObj.parent && (this.clearSelection(), this.tempDirection === null && (this.tempDirection = this.direction), this.isFocusMode || (this.nodeDataBackup = this.nodeData, this.isFocusMode = !0), this.nodeData = t.nodeObj, this.initRight(), this.toCenter());
|
|
460
|
-
},
|
|
460
|
+
}, pe = function() {
|
|
461
461
|
this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
|
|
462
|
-
},
|
|
462
|
+
}, ge = function() {
|
|
463
463
|
this.direction = 0, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
464
|
-
},
|
|
464
|
+
}, me = function() {
|
|
465
465
|
this.direction = 1, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
466
|
-
},
|
|
466
|
+
}, ye = function() {
|
|
467
467
|
this.direction = 2, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
468
|
-
},
|
|
468
|
+
}, we = function(t, e) {
|
|
469
469
|
const n = t.nodeObj;
|
|
470
470
|
typeof e == "boolean" ? n.expanded = e : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
|
|
471
471
|
const o = t.getBoundingClientRect(), s = {
|
|
472
472
|
x: o.left,
|
|
473
473
|
y: o.top
|
|
474
474
|
}, i = t.parentNode, r = i.children[1];
|
|
475
|
-
if (r.expanded = n.expanded, r.className = n.expanded ? "minus" : "",
|
|
475
|
+
if (r.expanded = n.expanded, r.className = n.expanded ? "minus" : "", Jt(t), n.expanded) {
|
|
476
476
|
const f = this.createChildren(
|
|
477
477
|
n.children.map((p) => this.createWrapper(p).grp)
|
|
478
478
|
);
|
|
@@ -485,7 +485,7 @@ const Jt = function(t) {
|
|
|
485
485
|
y: c.top
|
|
486
486
|
}, a = s.x - l.x, d = s.y - l.y;
|
|
487
487
|
this.move(a, d), this.bus.fire("expandNode", n);
|
|
488
|
-
},
|
|
488
|
+
}, ve = function(t, e) {
|
|
489
489
|
const n = t.nodeObj, o = t.getBoundingClientRect(), s = {
|
|
490
490
|
x: o.left,
|
|
491
491
|
y: o.top
|
|
@@ -496,48 +496,48 @@ const Jt = function(t) {
|
|
|
496
496
|
y: i.top
|
|
497
497
|
}, c = s.x - r.x, l = s.y - r.y;
|
|
498
498
|
this.move(c, l);
|
|
499
|
-
},
|
|
499
|
+
}, be = function(t) {
|
|
500
500
|
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)), nt(this.nodeData), this.layout(), this.linkDiv();
|
|
501
|
-
},
|
|
501
|
+
}, xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
502
502
|
__proto__: null,
|
|
503
|
-
cancelFocus:
|
|
504
|
-
clearSelection:
|
|
505
|
-
disableEdit:
|
|
506
|
-
enableEdit:
|
|
507
|
-
expandNode:
|
|
508
|
-
expandNodeAll:
|
|
509
|
-
focusNode:
|
|
510
|
-
getData:
|
|
511
|
-
getDataString:
|
|
512
|
-
initLeft:
|
|
513
|
-
initRight:
|
|
514
|
-
initSide:
|
|
515
|
-
install:
|
|
516
|
-
move:
|
|
517
|
-
refresh:
|
|
518
|
-
scale:
|
|
519
|
-
scaleFit:
|
|
520
|
-
scrollIntoView:
|
|
521
|
-
selectNode:
|
|
522
|
-
selectNodes:
|
|
503
|
+
cancelFocus: pe,
|
|
504
|
+
clearSelection: oe,
|
|
505
|
+
disableEdit: ce,
|
|
506
|
+
enableEdit: re,
|
|
507
|
+
expandNode: we,
|
|
508
|
+
expandNodeAll: ve,
|
|
509
|
+
focusNode: ue,
|
|
510
|
+
getData: ie,
|
|
511
|
+
getDataString: se,
|
|
512
|
+
initLeft: ge,
|
|
513
|
+
initRight: me,
|
|
514
|
+
initSide: ye,
|
|
515
|
+
install: fe,
|
|
516
|
+
move: he,
|
|
517
|
+
refresh: be,
|
|
518
|
+
scale: le,
|
|
519
|
+
scaleFit: ae,
|
|
520
|
+
scrollIntoView: Qt,
|
|
521
|
+
selectNode: te,
|
|
522
|
+
selectNodes: ee,
|
|
523
523
|
stringifyData: Tt,
|
|
524
|
-
toCenter:
|
|
525
|
-
unselectNodes:
|
|
526
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
527
|
-
const i = -
|
|
524
|
+
toCenter: de,
|
|
525
|
+
unselectNodes: ne
|
|
526
|
+
}, Symbol.toStringTag, { value: "Module" })), Ce = 40, Se = 10, Ee = ({ deltaMode: t, deltaY: e, viewportHeight: n }) => t === WheelEvent.DOM_DELTA_LINE ? e * Ce : t === WheelEvent.DOM_DELTA_PAGE ? e * n : e, Te = ({ deltaMode: t, deltaY: e, scaleSensitivity: n, viewportHeight: o }) => {
|
|
527
|
+
const i = -Ee({ deltaMode: t, deltaY: e, viewportHeight: o }) / Se * n;
|
|
528
528
|
return Math.max(-n, Math.min(n, i));
|
|
529
|
-
},
|
|
529
|
+
}, De = (t, e, n) => {
|
|
530
530
|
e !== 0 && t.scale(t.scaleVal + e, n);
|
|
531
|
-
},
|
|
532
|
-
const n =
|
|
531
|
+
}, Le = (t, e) => {
|
|
532
|
+
const n = Te({
|
|
533
533
|
deltaMode: e.deltaMode,
|
|
534
534
|
deltaY: e.deltaY,
|
|
535
535
|
scaleSensitivity: t.scaleSensitivity,
|
|
536
536
|
viewportHeight: t.container.clientHeight || window.innerHeight
|
|
537
537
|
});
|
|
538
|
-
|
|
538
|
+
De(t, n, { x: e.clientX, y: e.clientY });
|
|
539
539
|
};
|
|
540
|
-
function
|
|
540
|
+
function Me(t) {
|
|
541
541
|
const { panHelper: e, container: n } = t;
|
|
542
542
|
let o = null;
|
|
543
543
|
t.spacePressed = !1;
|
|
@@ -593,7 +593,7 @@ function De(t) {
|
|
|
593
593
|
clear() {
|
|
594
594
|
this.activePointers.clear(), this.lastDistance = null;
|
|
595
595
|
}
|
|
596
|
-
}, c =
|
|
596
|
+
}, c = Wt(t), l = {
|
|
597
597
|
timer: null,
|
|
598
598
|
startPos: null,
|
|
599
599
|
pointerId: null,
|
|
@@ -652,7 +652,7 @@ function De(t) {
|
|
|
652
652
|
}
|
|
653
653
|
if (t.ptState === i.Pinch) return;
|
|
654
654
|
const m = h.target;
|
|
655
|
-
if (m.className === "map-container" && h.button === 0 && h.pointerType === "mouse") {
|
|
655
|
+
if (t.editable && m.className === "map-container" && h.button === 0 && h.pointerType === "mouse") {
|
|
656
656
|
t.ptState = i.BoxSelect;
|
|
657
657
|
return;
|
|
658
658
|
}
|
|
@@ -660,7 +660,8 @@ function De(t) {
|
|
|
660
660
|
if (J(m)) {
|
|
661
661
|
t.selection?.cancel();
|
|
662
662
|
const S = t.currentNodes || [];
|
|
663
|
-
h.ctrlKey || h.metaKey || t.mobileMultiSelect ? S.includes(m) ? o = m : ((t.currentArrow || t.currentSummary) && t.clearSelection(), t.selection?.select(m)) : S.includes(m) || t.selectNode(m),
|
|
663
|
+
if (h.ctrlKey || h.metaKey || t.mobileMultiSelect ? S.includes(m) ? o = m : ((t.currentArrow || t.currentSummary) && t.clearSelection(), t.selection?.select(m)) : S.includes(m) || t.selectNode(m), !t.editable) return;
|
|
664
|
+
h.pointerType === "touch" ? (t.ptState = i.DragWait, l.start(h, (P) => {
|
|
664
665
|
ft(t, c, P, !0) && (t.ptState = i.Drag, m.setPointerCapture(P.pointerId));
|
|
665
666
|
})) : ft(t, c, h, !1) && (t.ptState = i.Drag, m.setPointerCapture(h.pointerId));
|
|
666
667
|
} else
|
|
@@ -674,7 +675,7 @@ function De(t) {
|
|
|
674
675
|
l.handleMove(h), l.timer === null && (t.ptState = i.Idle);
|
|
675
676
|
break;
|
|
676
677
|
case i.Drag:
|
|
677
|
-
|
|
678
|
+
Rt(t, c, h);
|
|
678
679
|
break;
|
|
679
680
|
case i.Pan:
|
|
680
681
|
e.handlePointerMove(h);
|
|
@@ -688,7 +689,7 @@ function De(t) {
|
|
|
688
689
|
l.clear();
|
|
689
690
|
break;
|
|
690
691
|
case i.Drag:
|
|
691
|
-
|
|
692
|
+
Xt(t, c, h);
|
|
692
693
|
break;
|
|
693
694
|
case i.Pan:
|
|
694
695
|
e.handlePointerUp(h);
|
|
@@ -704,7 +705,7 @@ function De(t) {
|
|
|
704
705
|
J(m) && !m.classList.contains("selected") && t.selectNode(m), t.bus.fire("showContextMenu", h);
|
|
705
706
|
}, 200);
|
|
706
707
|
}, b = (h) => {
|
|
707
|
-
if (h.stopPropagation(), h.preventDefault(), h.ctrlKey || h.metaKey) return
|
|
708
|
+
if (h.stopPropagation(), h.preventDefault(), h.ctrlKey || h.metaKey) return Le(t, h);
|
|
708
709
|
if (h.shiftKey) return t.move(-h.deltaY, 0);
|
|
709
710
|
t.move(-h.deltaX, -h.deltaY);
|
|
710
711
|
}, v = (h) => {
|
|
@@ -725,7 +726,7 @@ function De(t) {
|
|
|
725
726
|
{ dom: n, evt: "keyup", func: C }
|
|
726
727
|
]);
|
|
727
728
|
}
|
|
728
|
-
function
|
|
729
|
+
function Pe() {
|
|
729
730
|
return {
|
|
730
731
|
handlers: {},
|
|
731
732
|
addListener: function(t, e) {
|
|
@@ -772,7 +773,7 @@ const N = "http://www.w3.org/2000/svg", U = function(t) {
|
|
|
772
773
|
}, pt = function() {
|
|
773
774
|
const t = document.createElementNS(N, "line");
|
|
774
775
|
return t.setAttribute("stroke", "#4dc4ff"), t.setAttribute("fill", "none"), t.setAttribute("stroke-width", "2"), t.setAttribute("opacity", "0.45"), t;
|
|
775
|
-
},
|
|
776
|
+
}, ke = function(t, e, n, o) {
|
|
776
777
|
const s = document.createElementNS(N, "g");
|
|
777
778
|
return [
|
|
778
779
|
{
|
|
@@ -831,7 +832,7 @@ const N = "http://www.w3.org/2000/svg", U = function(t) {
|
|
|
831
832
|
obj: n
|
|
832
833
|
}));
|
|
833
834
|
});
|
|
834
|
-
},
|
|
835
|
+
}, Ne = function(t) {
|
|
835
836
|
const e = this.map.querySelector("me-root"), n = e.offsetTop, o = e.offsetLeft, s = e.offsetWidth, i = e.offsetHeight, r = this.map.querySelectorAll("me-main > me-wrapper");
|
|
836
837
|
this.lines.innerHTML = "";
|
|
837
838
|
for (let c = 0; c < r.length; c++) {
|
|
@@ -856,19 +857,19 @@ const N = "http://www.w3.org/2000/svg", U = function(t) {
|
|
|
856
857
|
continue;
|
|
857
858
|
Mt(t, e, C, w, s);
|
|
858
859
|
}
|
|
859
|
-
},
|
|
860
|
-
side:
|
|
861
|
-
left:
|
|
862
|
-
right:
|
|
863
|
-
full:
|
|
864
|
-
living:
|
|
865
|
-
zoomin:
|
|
866
|
-
zoomout:
|
|
860
|
+
}, Ae = '<?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>', $e = '<?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>', He = '<?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>', Ie = '<?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>', Oe = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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>', Be = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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>', We = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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>', Ye = {
|
|
861
|
+
side: Ae,
|
|
862
|
+
left: $e,
|
|
863
|
+
right: He,
|
|
864
|
+
full: Ie,
|
|
865
|
+
living: Oe,
|
|
866
|
+
zoomin: Be,
|
|
867
|
+
zoomout: We
|
|
867
868
|
}, $ = (t, e) => {
|
|
868
869
|
const n = document.createElement("span");
|
|
869
|
-
return n.id = t, n.innerHTML =
|
|
870
|
+
return n.id = t, n.innerHTML = Ye[e], n;
|
|
870
871
|
};
|
|
871
|
-
function
|
|
872
|
+
function Re(t) {
|
|
872
873
|
const e = document.createElement("div"), n = $("fullscreen", "full"), o = $("toCenter", "living"), s = $("zoomout", "zoomout"), i = $("zoomin", "zoomin");
|
|
873
874
|
e.appendChild(n), e.appendChild(o), e.appendChild(s), e.appendChild(i), e.className = "mind-elixir-toolbar rb";
|
|
874
875
|
let r = null;
|
|
@@ -896,7 +897,7 @@ function We(t) {
|
|
|
896
897
|
t.scale(t.scaleVal + t.scaleSensitivity);
|
|
897
898
|
}, e;
|
|
898
899
|
}
|
|
899
|
-
function
|
|
900
|
+
function Xe(t) {
|
|
900
901
|
const e = document.createElement("div"), n = $("tbltl", "left"), o = $("tbltr", "right"), s = $("tblts", "side");
|
|
901
902
|
return e.appendChild(n), e.appendChild(o), e.appendChild(s), e.className = "mind-elixir-toolbar lt", n.onclick = () => {
|
|
902
903
|
t.initLeft();
|
|
@@ -906,10 +907,10 @@ function Ye(t) {
|
|
|
906
907
|
t.initSide();
|
|
907
908
|
}, e;
|
|
908
909
|
}
|
|
909
|
-
function
|
|
910
|
-
t.container.append(
|
|
910
|
+
function Ve(t) {
|
|
911
|
+
t.container.append(Re(t)), t.container.append(Xe(t));
|
|
911
912
|
}
|
|
912
|
-
const
|
|
913
|
+
const ze = function(t, e = !0) {
|
|
913
914
|
this.theme = t;
|
|
914
915
|
const o = {
|
|
915
916
|
...(t.type === "dark" ? et : tt).cssVar,
|
|
@@ -920,7 +921,7 @@ const Xe = function(t, e = !0) {
|
|
|
920
921
|
this.container.style.setProperty(r, o[r]);
|
|
921
922
|
}
|
|
922
923
|
e && this.refresh();
|
|
923
|
-
},
|
|
924
|
+
}, Fe = function(t) {
|
|
924
925
|
return {
|
|
925
926
|
dom: t,
|
|
926
927
|
moved: !1,
|
|
@@ -956,15 +957,15 @@ const Xe = function(t, e = !0) {
|
|
|
956
957
|
}
|
|
957
958
|
};
|
|
958
959
|
}, gt = {
|
|
959
|
-
create:
|
|
960
|
-
},
|
|
961
|
-
function
|
|
960
|
+
create: Fe
|
|
961
|
+
}, Pt = "#4dc4ff";
|
|
962
|
+
function kt(t, e, n, o, s, i, r, c) {
|
|
962
963
|
return {
|
|
963
964
|
x: t / 8 + n * 3 / 8 + s * 3 / 8 + r / 8,
|
|
964
965
|
y: e / 8 + o * 3 / 8 + i * 3 / 8 + c / 8
|
|
965
966
|
};
|
|
966
967
|
}
|
|
967
|
-
function
|
|
968
|
+
function Ge(t, e, n) {
|
|
968
969
|
t && (t.dataset.x = e.toString(), t.dataset.y = n.toString(), U(t));
|
|
969
970
|
}
|
|
970
971
|
function V(t, e, n, o, s) {
|
|
@@ -1001,8 +1002,8 @@ function mt(t, e, n, o, s, i, r, c, l, a) {
|
|
|
1001
1002
|
}
|
|
1002
1003
|
}
|
|
1003
1004
|
}
|
|
1004
|
-
const { x: w, y } =
|
|
1005
|
-
if (t.labelEl &&
|
|
1005
|
+
const { x: w, y } = kt(e, n, o, s, i, r, c, l);
|
|
1006
|
+
if (t.labelEl && Ge(t.labelEl, w, y), a.style?.labelColor) {
|
|
1006
1007
|
const u = t.labelEl;
|
|
1007
1008
|
u && (u.style.color = a.style.labelColor);
|
|
1008
1009
|
}
|
|
@@ -1027,7 +1028,7 @@ function H(t) {
|
|
|
1027
1028
|
y: n
|
|
1028
1029
|
};
|
|
1029
1030
|
}
|
|
1030
|
-
const
|
|
1031
|
+
const _e = function(t, e, n) {
|
|
1031
1032
|
const o = M(t.nodes, e), s = M(t.nodes, n), i = o.offsetLeft + e.offsetWidth / 2, r = o.offsetTop + e.offsetHeight / 2, c = s.offsetLeft + n.offsetWidth / 2, l = s.offsetTop + n.offsetHeight / 2, a = c - i, d = l - r, f = Math.sqrt(a * a + d * d), p = Math.max(50, Math.min(200, f * 0.3)), w = Math.abs(a), y = Math.abs(d);
|
|
1032
1033
|
let u, g;
|
|
1033
1034
|
if (f < 150) {
|
|
@@ -1051,7 +1052,7 @@ const Ge = function(t, e, n) {
|
|
|
1051
1052
|
if (!e || !n)
|
|
1052
1053
|
return;
|
|
1053
1054
|
if (!o.delta1 || !o.delta2) {
|
|
1054
|
-
const E =
|
|
1055
|
+
const E = _e(t, e, n);
|
|
1055
1056
|
o.delta1 = E.delta1, o.delta2 = E.delta2;
|
|
1056
1057
|
}
|
|
1057
1058
|
const i = q(t, e, o.delta1), r = q(t, n, o.delta2), { x: c, y: l } = H(i), { ctrlX: a, ctrlY: d } = i, { ctrlX: f, ctrlY: p } = r, { x: w, y } = H(r), u = _(f, p, w, y);
|
|
@@ -1063,7 +1064,7 @@ const Ge = function(t, e, n) {
|
|
|
1063
1064
|
if (!E) return;
|
|
1064
1065
|
b = `M ${E.x1} ${E.y1} L ${c} ${l} L ${E.x2} ${E.y2}`;
|
|
1065
1066
|
}
|
|
1066
|
-
const v =
|
|
1067
|
+
const v = ke(`M ${c} ${l} C ${a} ${d} ${f} ${p} ${w} ${y}`, g, b, o.style), { x: C, y: T } = kt(c, l, a, d, f, p, w, y), h = o.style?.labelColor || "rgb(235, 95, 82)", m = "a-" + o.id;
|
|
1067
1068
|
v.id = m;
|
|
1068
1069
|
const x = t.markdown ? t.markdown(o.label, o) : o.label, S = Q(x, C, T, {
|
|
1069
1070
|
anchor: "middle",
|
|
@@ -1071,8 +1072,8 @@ const Ge = function(t, e, n) {
|
|
|
1071
1072
|
dataType: "arrow",
|
|
1072
1073
|
svgId: m
|
|
1073
1074
|
});
|
|
1074
|
-
v.labelEl = S, v.arrowObj = o, v.dataset.linkid = o.id, t.labelContainer.appendChild(S), t.arrowSvg.appendChild(v), U(S), s || (t.arrows.push(o), t.currentArrow = v,
|
|
1075
|
-
},
|
|
1075
|
+
v.labelEl = S, v.arrowObj = o, v.dataset.linkid = o.id, t.labelContainer.appendChild(S), t.arrowSvg.appendChild(v), U(S), s || (t.arrows.push(o), t.currentArrow = v, At(t, o, i, r));
|
|
1076
|
+
}, qe = function(t, e, n = {}) {
|
|
1076
1077
|
const o = {
|
|
1077
1078
|
id: Y(),
|
|
1078
1079
|
label: "Custom Link",
|
|
@@ -1084,14 +1085,14 @@ const Ge = function(t, e, n) {
|
|
|
1084
1085
|
name: "createArrow",
|
|
1085
1086
|
obj: o
|
|
1086
1087
|
});
|
|
1087
|
-
},
|
|
1088
|
+
}, je = function(t) {
|
|
1088
1089
|
K(this);
|
|
1089
1090
|
const e = { ...t, id: Y() };
|
|
1090
1091
|
it(this, this.findEle(e.from), this.findEle(e.to), e), this.bus.fire("operation", {
|
|
1091
1092
|
name: "createArrow",
|
|
1092
1093
|
obj: e
|
|
1093
1094
|
});
|
|
1094
|
-
},
|
|
1095
|
+
}, Ue = function(t) {
|
|
1095
1096
|
let e;
|
|
1096
1097
|
if (t ? e = t : e = this.currentArrow, !e) return;
|
|
1097
1098
|
K(this);
|
|
@@ -1102,11 +1103,11 @@ const Ge = function(t, e, n) {
|
|
|
1102
1103
|
id: n
|
|
1103
1104
|
}
|
|
1104
1105
|
});
|
|
1105
|
-
},
|
|
1106
|
+
}, Ke = function(t) {
|
|
1106
1107
|
this.currentArrow = t;
|
|
1107
1108
|
const e = t.arrowObj, n = this.findEle(e.from), o = this.findEle(e.to), s = q(this, n, e.delta1), i = q(this, o, e.delta2);
|
|
1108
|
-
|
|
1109
|
-
},
|
|
1109
|
+
this.editable ? At(this, e, s, i) : Nt(t, Pt), this.bus.fire("selectArrow", e);
|
|
1110
|
+
}, Je = function() {
|
|
1110
1111
|
K(this), this.currentArrow = null, this.bus.fire("unselectArrow");
|
|
1111
1112
|
}, Z = function(t, e) {
|
|
1112
1113
|
const n = document.createElementNS(N, "path");
|
|
@@ -1118,7 +1119,7 @@ const Ge = function(t, e, n) {
|
|
|
1118
1119
|
"stroke-linecap": "round",
|
|
1119
1120
|
"stroke-linejoin": "round"
|
|
1120
1121
|
}), n;
|
|
1121
|
-
},
|
|
1122
|
+
}, Nt = function(t, e) {
|
|
1122
1123
|
const n = document.createElementNS(N, "g");
|
|
1123
1124
|
n.setAttribute("class", "arrow-highlight"), n.setAttribute("opacity", "0.45");
|
|
1124
1125
|
const o = Z(t.line.getAttribute("d"), e);
|
|
@@ -1139,10 +1140,10 @@ const Ge = function(t, e, n) {
|
|
|
1139
1140
|
n.length >= 1 && n[0].setAttribute("d", t.line.getAttribute("d")), n.length >= 2 && n[1].setAttribute("d", t.arrow1.getAttribute("d")), n.length >= 3 && t.arrow2.getAttribute("d") && n[2].setAttribute("d", t.arrow2.getAttribute("d"));
|
|
1140
1141
|
}, K = function(t) {
|
|
1141
1142
|
t.helper1?.destroy(), t.helper2?.destroy(), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none", t.currentArrow && Ze(t.currentArrow);
|
|
1142
|
-
},
|
|
1143
|
+
}, At = function(t, e, n, o) {
|
|
1143
1144
|
const { linkController: s, P2: i, P3: r, line1: c, line2: l, nodes: a, map: d, currentArrow: f, bus: p } = t;
|
|
1144
1145
|
if (!f) return;
|
|
1145
|
-
s.style.display = "initial", i.style.display = "initial", r.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(r),
|
|
1146
|
+
s.style.display = "initial", i.style.display = "initial", r.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(r), Nt(f, Pt);
|
|
1146
1147
|
let { x: w, y } = H(n), { ctrlX: u, ctrlY: g } = n, { ctrlX: b, ctrlY: v } = o, { x: C, y: T } = H(o);
|
|
1147
1148
|
i.style.cssText = `top:${g}px;left:${u}px;`, r.style.cssText = `top:${v}px;left:${b}px;`, V(c, w, y, u, g), V(l, b, v, C, T), t.helper1 = gt.create(i), t.helper2 = gt.create(r), t.helper1.init(d, (h, m) => {
|
|
1148
1149
|
u = u + h / t.scaleVal, g = g + m / t.scaleVal;
|
|
@@ -1173,14 +1174,14 @@ function nn() {
|
|
|
1173
1174
|
}
|
|
1174
1175
|
const on = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1175
1176
|
__proto__: null,
|
|
1176
|
-
createArrow:
|
|
1177
|
-
createArrowFrom:
|
|
1177
|
+
createArrow: qe,
|
|
1178
|
+
createArrowFrom: je,
|
|
1178
1179
|
editArrowLabel: en,
|
|
1179
|
-
removeArrow:
|
|
1180
|
+
removeArrow: Ue,
|
|
1180
1181
|
renderArrow: tn,
|
|
1181
|
-
selectArrow:
|
|
1182
|
+
selectArrow: Ke,
|
|
1182
1183
|
tidyArrow: nn,
|
|
1183
|
-
unselectArrow:
|
|
1184
|
+
unselectArrow: Je
|
|
1184
1185
|
}, Symbol.toStringTag, { value: "Module" })), sn = function(t) {
|
|
1185
1186
|
if (t.length === 0) throw new Error("No selected node.");
|
|
1186
1187
|
if (t.length === 1) {
|
|
@@ -1452,24 +1453,24 @@ const Mn = function(t = !1, e) {
|
|
|
1452
1453
|
exportSvg: Mn
|
|
1453
1454
|
}, Symbol.toStringTag, { value: "Module" })), Nn = {}, An = {
|
|
1454
1455
|
getObjById: G,
|
|
1455
|
-
generateNewObj:
|
|
1456
|
-
layout:
|
|
1457
|
-
linkDiv:
|
|
1458
|
-
editTopic:
|
|
1459
|
-
createWrapper:
|
|
1460
|
-
createParent:
|
|
1461
|
-
createChildren:
|
|
1462
|
-
createTopic:
|
|
1456
|
+
generateNewObj: Ht,
|
|
1457
|
+
layout: Vt,
|
|
1458
|
+
linkDiv: Ne,
|
|
1459
|
+
editTopic: Ut,
|
|
1460
|
+
createWrapper: Gt,
|
|
1461
|
+
createParent: _t,
|
|
1462
|
+
createChildren: qt,
|
|
1463
|
+
createTopic: jt,
|
|
1463
1464
|
findEle: Ct,
|
|
1464
|
-
changeTheme:
|
|
1465
|
-
...
|
|
1465
|
+
changeTheme: ze,
|
|
1466
|
+
...xe,
|
|
1466
1467
|
...Nn,
|
|
1467
1468
|
...on,
|
|
1468
1469
|
...mn,
|
|
1469
1470
|
...kn,
|
|
1470
1471
|
init(t) {
|
|
1471
1472
|
if (t = JSON.parse(JSON.stringify(t)), !t || !t.nodeData) return new Error("MindElixir: `data` is required");
|
|
1472
|
-
t.direction !== void 0 && (this.direction = t.direction), this.changeTheme(t.theme || this.theme, !1), this.nodeData = t.nodeData, nt(this.nodeData), this.arrows = t.arrows || [], this.summaries = t.summaries || [], this.tidyArrow(), this.toolBar &&
|
|
1473
|
+
t.direction !== void 0 && (this.direction = t.direction), this.changeTheme(t.theme || this.theme, !1), this.nodeData = t.nodeData, nt(this.nodeData), this.arrows = t.arrows || [], this.summaries = t.summaries || [], this.tidyArrow(), this.toolBar && Ve(this), this.layout(), this.linkDiv(), this.toCenter();
|
|
1473
1474
|
},
|
|
1474
1475
|
destroy() {
|
|
1475
1476
|
this.disposable.forEach((t) => t()), this.el && (this.el.innerHTML = ""), this.el = void 0, this.nodeData = void 0, this.arrows = void 0, this.summaries = void 0, this.currentArrow = void 0, this.currentNodes = void 0, this.currentSummary = void 0, this.theme = void 0, this.direction = void 0, this.bus = void 0, this.container = void 0, this.map = void 0, this.lines = void 0, this.linkController = void 0, this.arrowSvg = void 0, this.P2 = void 0, this.P3 = void 0, this.line1 = void 0, this.line2 = void 0, this.nodes = void 0, this.selection?.destroy(), this.selection = void 0;
|
|
@@ -1499,7 +1500,7 @@ function Hn({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction:
|
|
|
1499
1500
|
const b = Math.abs(f - w) / 300 * d;
|
|
1500
1501
|
return l === I.LHS ? (g = e, y = g + d, u = g - d, p = i + d, `M ${y} ${f} C ${g} ${f} ${g + b} ${w} ${u} ${w} H ${p}`) : (g = e + n, y = g - d, u = g + d, p = i + r - d, `M ${y} ${f} C ${g} ${f} ${g - b} ${w} ${u} ${w} H ${p}`);
|
|
1501
1502
|
}
|
|
1502
|
-
const In = "5.11.1-beta.
|
|
1503
|
+
const In = "5.11.1-beta.4";
|
|
1503
1504
|
function On(t) {
|
|
1504
1505
|
return {
|
|
1505
1506
|
x: 0,
|
|
@@ -1556,11 +1557,11 @@ function A({
|
|
|
1556
1557
|
let S = null;
|
|
1557
1558
|
const E = Object.prototype.toString.call(t);
|
|
1558
1559
|
if (E === "[object HTMLDivElement]" ? S = t : E === "[object String]" && (S = document.querySelector(t)), !S) throw new Error("MindElixir: el is not a valid element");
|
|
1559
|
-
S.style.position = "relative", S.innerHTML = "", this.el = S, this.disposable = [], this.before = l || {}, this.newTopicName = a || "New Node", this.contextMenu = o ?? !0, this.toolBar = s ?? !0, this.keypress = i ?? !0, this.mouseSelectionButton = r ?? 0, this.direction = e ?? 1, this.editable = n ?? !0, this.allowUndo = d ?? !0, this.scaleSensitivity = g ?? 0.1, this.scaleMax = b ?? 1.4, this.scaleMin = v ?? 0.2, this.generateMainBranch = f || $n, this.generateSubBranch = p || Hn, this.overflowHidden = w ?? !1, this.alignment = u ?? "root", this.handleWheel = C ?? !0, this.markdown = T || void 0, this.imageProxy = h || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.mobileMultiSelect = x ?? !1, this.panHelper = On(this), this.bus =
|
|
1560
|
+
S.style.position = "relative", S.innerHTML = "", this.el = S, this.disposable = [], this.before = l || {}, this.newTopicName = a || "New Node", this.contextMenu = o ?? !0, this.toolBar = s ?? !0, this.keypress = i ?? !0, this.mouseSelectionButton = r ?? 0, this.direction = e ?? 1, this.editable = n ?? !0, this.allowUndo = d ?? !0, this.scaleSensitivity = g ?? 0.1, this.scaleMax = b ?? 1.4, this.scaleMin = v ?? 0.2, this.generateMainBranch = f || $n, this.generateSubBranch = p || Hn, this.overflowHidden = w ?? !1, this.alignment = u ?? "root", this.handleWheel = C ?? !0, this.markdown = T || void 0, this.imageProxy = h || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.mobileMultiSelect = x ?? !1, this.panHelper = On(this), this.bus = Pe(), this.container = document.createElement("div"), this.selectionContainer = c || this.container, this.container.className = "map-container";
|
|
1560
1561
|
const P = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1561
1562
|
this.theme = y || (P.matches ? et : tt);
|
|
1562
1563
|
const k = document.createElement("div");
|
|
1563
|
-
k.className = "map-canvas", this.map = k, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = W("lines"), this.summarySvg = W("summary"), this.linkController = W("linkcontroller"), this.P2 = document.createElement("div"), this.P3 = document.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = pt(), this.line2 = pt(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.arrowSvg = W("topiclinks"), this.labelContainer = document.createElement("div"), this.labelContainer.className = "label-container", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(
|
|
1564
|
+
k.className = "map-canvas", this.map = k, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = W("lines"), this.summarySvg = W("summary"), this.linkController = W("linkcontroller"), this.P2 = document.createElement("div"), this.P3 = document.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = pt(), this.line2 = pt(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.arrowSvg = W("topiclinks"), this.labelContainer = document.createElement("div"), this.labelContainer.className = "label-container", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(Me(this)), m && (this.pasteHandler = m);
|
|
1564
1565
|
}
|
|
1565
1566
|
A.prototype = An;
|
|
1566
1567
|
Object.defineProperty(A.prototype, "currentNode", {
|