mind-elixir 5.12.2 → 5.14.0-beta.0
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.css +1 -1
- package/dist/MindElixir.iife.js +4 -4
- package/dist/MindElixir.js +599 -573
- package/dist/MindElixirLite.css +1 -1
- package/dist/MindElixirLite.iife.js +4 -4
- package/dist/MindElixirLite.js +416 -381
- package/dist/types/arrow.d.ts +1 -0
- package/dist/types/const.d.ts +7 -3
- package/dist/types/index.d.ts +7 -2
- package/dist/types/methods.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/pubsub.d.ts +4 -0
- package/package.json +17 -17
- package/readme/es.md +453 -0
- package/readme/fr.md +437 -0
- package/readme/ja.md +452 -0
- package/readme/ko.md +435 -0
- package/readme/pt.md +436 -0
- package/readme/ru.md +435 -0
- package/readme/zh.md +453 -0
- package/readme.md +1 -1
package/dist/MindElixirLite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Rn = 0, Xn = 1, Vn = 2, et = {
|
|
2
2
|
name: "Latte",
|
|
3
3
|
type: "light",
|
|
4
4
|
palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
|
|
@@ -27,7 +27,7 @@ const Wn = 0, Yn = 1, Rn = 2, tt = {
|
|
|
27
27
|
"--panel-border-color": "#eaeaea",
|
|
28
28
|
"--map-padding": "50px 80px"
|
|
29
29
|
}
|
|
30
|
-
},
|
|
30
|
+
}, nt = {
|
|
31
31
|
name: "Dark",
|
|
32
32
|
type: "dark",
|
|
33
33
|
palette: ["#848FA0", "#748BE9", "#D2F9FE", "#4145A5", "#789AFA", "#706CF4", "#EF987F", "#775DD5", "#FCEECF", "#DA7FBC"],
|
|
@@ -56,27 +56,27 @@ const Wn = 0, Yn = 1, Rn = 2, tt = {
|
|
|
56
56
|
"--map-padding": "50px 80px"
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
function
|
|
59
|
+
function Ot(t) {
|
|
60
60
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const j = function(t, e) {
|
|
63
63
|
if (e.id === t)
|
|
64
64
|
return e;
|
|
65
65
|
if (e.children && e.children.length) {
|
|
66
66
|
for (let n = 0; n < e.children.length; n++) {
|
|
67
|
-
const o =
|
|
67
|
+
const o = j(t, e.children[n]);
|
|
68
68
|
if (o) return o;
|
|
69
69
|
}
|
|
70
70
|
return null;
|
|
71
71
|
} else
|
|
72
72
|
return null;
|
|
73
|
-
},
|
|
73
|
+
}, ot = (t, e) => {
|
|
74
74
|
if (t.parent = e, t.children)
|
|
75
75
|
for (let n = 0; n < t.children.length; n++)
|
|
76
|
-
|
|
77
|
-
},
|
|
76
|
+
ot(t.children[n], t);
|
|
77
|
+
}, bt = (t, e, n) => {
|
|
78
78
|
t.expanded = e, t.children && t.children.forEach((o) => {
|
|
79
|
-
|
|
79
|
+
bt(o, e);
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
82
|
function _(t, e, n, o) {
|
|
@@ -88,16 +88,25 @@ function _(t, e, n, o) {
|
|
|
88
88
|
y2: o + Math.sin(d) * l
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function X() {
|
|
92
92
|
return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substring(2)).substring(2, 18);
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
const t =
|
|
94
|
+
const Bt = function() {
|
|
95
|
+
const t = X();
|
|
96
96
|
return {
|
|
97
97
|
topic: this.newTopicName,
|
|
98
98
|
id: t
|
|
99
99
|
};
|
|
100
|
-
}
|
|
100
|
+
};
|
|
101
|
+
function Yt(t) {
|
|
102
|
+
return JSON.parse(
|
|
103
|
+
JSON.stringify(t, (n, o) => {
|
|
104
|
+
if (n !== "parent")
|
|
105
|
+
return o;
|
|
106
|
+
})
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
const P = (t, e) => {
|
|
101
110
|
let n = 0, o = 0;
|
|
102
111
|
for (; e && e !== t; )
|
|
103
112
|
n += e.offsetLeft, o += e.offsetTop, e = e.offsetParent;
|
|
@@ -105,10 +114,10 @@ const Ot = function() {
|
|
|
105
114
|
}, D = (t, e) => {
|
|
106
115
|
for (const n in e)
|
|
107
116
|
t.setAttribute(n, e[n]);
|
|
108
|
-
}, J = (t) => t ? t.tagName === "ME-TPC" : !1,
|
|
117
|
+
}, J = (t) => t ? t.tagName === "ME-TPC" : !1, st = (t) => {
|
|
109
118
|
const e = /translate3d\(([^,]+),\s*([^,]+)/, n = t.match(e);
|
|
110
119
|
return n ? { x: parseFloat(n[1]), y: parseFloat(n[2]) } : { x: 0, y: 0 };
|
|
111
|
-
},
|
|
120
|
+
}, vt = function(t) {
|
|
112
121
|
for (let e = 0; e < t.length; e++) {
|
|
113
122
|
const { dom: n, evt: o, func: s } = t[e];
|
|
114
123
|
n.addEventListener(o, s);
|
|
@@ -119,31 +128,31 @@ const Ot = function() {
|
|
|
119
128
|
o.removeEventListener(s, i);
|
|
120
129
|
}
|
|
121
130
|
};
|
|
122
|
-
},
|
|
131
|
+
}, dt = (t, e) => {
|
|
123
132
|
const n = t.x - e.x, o = t.y - e.y;
|
|
124
133
|
return Math.sqrt(n * n + o * o);
|
|
125
|
-
},
|
|
134
|
+
}, Wt = function(t, e) {
|
|
126
135
|
if (!e)
|
|
127
|
-
return
|
|
136
|
+
return q(t), t;
|
|
128
137
|
let n = t.querySelector(".insert-preview");
|
|
129
138
|
const o = `insert-preview ${e} show`;
|
|
130
139
|
return n || (n = document.createElement("div"), t.appendChild(n)), n.className = o, t;
|
|
131
|
-
},
|
|
140
|
+
}, q = function(t) {
|
|
132
141
|
if (!t) return;
|
|
133
142
|
const e = t.querySelectorAll(".insert-preview");
|
|
134
143
|
for (const n of e || [])
|
|
135
144
|
n.remove();
|
|
136
|
-
},
|
|
145
|
+
}, ft = function(t, e) {
|
|
137
146
|
for (const n of e) {
|
|
138
147
|
const o = n.parentElement.parentElement.contains(t);
|
|
139
148
|
if (!(t && t.tagName === "ME-TPC" && t !== n && !o && t.nodeObj.parent)) return !1;
|
|
140
149
|
}
|
|
141
150
|
return !0;
|
|
142
|
-
},
|
|
151
|
+
}, Rt = function(t) {
|
|
143
152
|
const e = document.createElement("div");
|
|
144
153
|
return e.className = "mind-elixir-ghost", t.container.appendChild(e), e;
|
|
145
154
|
};
|
|
146
|
-
class
|
|
155
|
+
class Xt {
|
|
147
156
|
mind;
|
|
148
157
|
isMoving = !1;
|
|
149
158
|
interval = null;
|
|
@@ -160,34 +169,34 @@ class Yt {
|
|
|
160
169
|
this.isMoving = !1, this.interval && (clearInterval(this.interval), this.interval = null);
|
|
161
170
|
}
|
|
162
171
|
}
|
|
163
|
-
function
|
|
172
|
+
function Vt(t) {
|
|
164
173
|
return {
|
|
165
174
|
isDragging: !1,
|
|
166
175
|
insertType: null,
|
|
167
176
|
meet: null,
|
|
168
|
-
ghost:
|
|
169
|
-
edgeMoveController: new
|
|
177
|
+
ghost: Rt(t),
|
|
178
|
+
edgeMoveController: new Xt(t),
|
|
170
179
|
startX: 0,
|
|
171
180
|
startY: 0,
|
|
172
181
|
pointerId: null
|
|
173
182
|
};
|
|
174
183
|
}
|
|
175
|
-
const
|
|
176
|
-
function
|
|
184
|
+
const zt = 5;
|
|
185
|
+
function ut(t, e, n, o = !1) {
|
|
177
186
|
if (t.spacePressed) return !1;
|
|
178
187
|
const s = n.target;
|
|
179
188
|
if (s?.tagName !== "ME-TPC" || !s.nodeObj.parent) return !1;
|
|
180
189
|
if (e.startX = n.clientX, e.startY = n.clientY, e.pointerId = n.pointerId, t.dragged = t.currentNodes, o) {
|
|
181
|
-
|
|
190
|
+
wt(t, e);
|
|
182
191
|
const i = t.container.getBoundingClientRect();
|
|
183
|
-
|
|
192
|
+
xt(e.ghost, n.clientX - i.x, n.clientY - i.y);
|
|
184
193
|
}
|
|
185
194
|
return !0;
|
|
186
195
|
}
|
|
187
|
-
function
|
|
196
|
+
function xt(t, e, n) {
|
|
188
197
|
t.style.transform = `translate(${e - 10}px, ${n - 10}px)`, t.style.display = "block";
|
|
189
198
|
}
|
|
190
|
-
function
|
|
199
|
+
function wt(t, e) {
|
|
191
200
|
const { dragged: n } = t;
|
|
192
201
|
if (!n) return;
|
|
193
202
|
const o = document.activeElement;
|
|
@@ -196,51 +205,51 @@ function xt(t, e) {
|
|
|
196
205
|
s.parentElement.parentElement.style.opacity = "0.5";
|
|
197
206
|
t.panHelper.clear();
|
|
198
207
|
}
|
|
199
|
-
function
|
|
208
|
+
function Ft(t, e, n) {
|
|
200
209
|
const { dragged: o } = t;
|
|
201
210
|
if (!o || e.pointerId !== n.pointerId) return;
|
|
202
211
|
const s = n.clientX - e.startX, i = n.clientY - e.startY, r = Math.sqrt(s * s + i * i);
|
|
203
|
-
if (!e.isDragging && r >
|
|
212
|
+
if (!e.isDragging && r > zt && wt(t, e), !e.isDragging) return;
|
|
204
213
|
const c = t.container.getBoundingClientRect();
|
|
205
|
-
|
|
214
|
+
xt(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(), q(e.meet);
|
|
206
215
|
const l = 12 * t.scaleVal, a = document.elementFromPoint(n.clientX, n.clientY - l);
|
|
207
|
-
if (
|
|
216
|
+
if (ft(a, o)) {
|
|
208
217
|
e.meet = a;
|
|
209
218
|
const f = a.getBoundingClientRect(), d = f.y;
|
|
210
219
|
n.clientY > d + f.height ? e.insertType = "after" : e.insertType = "in";
|
|
211
220
|
} else {
|
|
212
221
|
const f = document.elementFromPoint(n.clientX, n.clientY + l);
|
|
213
|
-
if (
|
|
222
|
+
if (ft(f, o)) {
|
|
214
223
|
e.meet = f;
|
|
215
224
|
const p = f.getBoundingClientRect().y;
|
|
216
225
|
n.clientY < p ? e.insertType = "before" : e.insertType = "in";
|
|
217
226
|
} else
|
|
218
227
|
e.insertType = null, e.meet = null;
|
|
219
228
|
}
|
|
220
|
-
e.meet &&
|
|
229
|
+
e.meet && Wt(e.meet, e.insertType);
|
|
221
230
|
}
|
|
222
|
-
function
|
|
231
|
+
function Gt(t, e, n) {
|
|
223
232
|
const { dragged: o } = t;
|
|
224
233
|
if (!(!o || e.pointerId !== n.pointerId)) {
|
|
225
234
|
e.edgeMoveController.stop();
|
|
226
235
|
for (const s of o)
|
|
227
236
|
s.parentElement.parentElement.style.opacity = "1";
|
|
228
|
-
e.ghost.style.display = "none", e.ghost.innerHTML = "", e.isDragging && e.meet && (
|
|
237
|
+
e.ghost.style.display = "none", e.ghost.innerHTML = "", e.isDragging && e.meet && (q(e.meet), e.insertType === "before" ? t.moveNodeBefore(o, e.meet) : e.insertType === "after" ? t.moveNodeAfter(o, e.meet) : e.insertType === "in" && t.moveNodeIn(o, e.meet)), t.dragged = null, e.isDragging = !1, e.insertType = null, e.meet = null, e.pointerId = null;
|
|
229
238
|
}
|
|
230
239
|
}
|
|
231
|
-
function
|
|
240
|
+
function pt(t, e) {
|
|
232
241
|
const { dragged: n } = t;
|
|
233
242
|
if (n) {
|
|
234
243
|
e.edgeMoveController.stop();
|
|
235
244
|
for (const o of n)
|
|
236
245
|
o.parentElement.parentElement.style.opacity = "1";
|
|
237
|
-
e.meet &&
|
|
246
|
+
e.meet && q(e.meet), e.ghost.style.display = "none", e.ghost.innerHTML = "", t.dragged = null, e.isDragging = !1, e.insertType = null, e.meet = null, e.pointerId = null;
|
|
238
247
|
}
|
|
239
248
|
}
|
|
240
|
-
const
|
|
249
|
+
const B = {
|
|
241
250
|
LHS: "lhs",
|
|
242
251
|
RHS: "rhs"
|
|
243
|
-
},
|
|
252
|
+
}, jt = function() {
|
|
244
253
|
this.nodes.innerHTML = "";
|
|
245
254
|
const t = this.createTopic(this.nodeData);
|
|
246
255
|
St.call(this, t, this.nodeData), t.draggable = !1;
|
|
@@ -253,18 +262,18 @@ const O = {
|
|
|
253
262
|
i.direction === 0 ? o += 1 : i.direction === 1 ? s += 1 : o <= s ? (i.direction = 0, o += 1) : (i.direction = 1, s += 1);
|
|
254
263
|
});
|
|
255
264
|
}
|
|
256
|
-
|
|
257
|
-
},
|
|
265
|
+
_t(this, n, e);
|
|
266
|
+
}, _t = function(t, e, n) {
|
|
258
267
|
const o = document.createElement("me-main");
|
|
259
|
-
o.className =
|
|
268
|
+
o.className = B.LHS;
|
|
260
269
|
const s = document.createElement("me-main");
|
|
261
|
-
s.className =
|
|
270
|
+
s.className = B.RHS;
|
|
262
271
|
for (let i = 0; i < e.length; i++) {
|
|
263
272
|
const r = e[i], { grp: c } = t.createWrapper(r);
|
|
264
273
|
t.direction === 2 ? r.direction === 0 ? o.appendChild(c) : s.appendChild(c) : t.direction === 0 ? o.appendChild(c) : s.appendChild(c);
|
|
265
274
|
}
|
|
266
275
|
t.nodes.appendChild(o), t.nodes.appendChild(n), t.nodes.appendChild(s), t.nodes.appendChild(t.lines), t.nodes.appendChild(t.labelContainer);
|
|
267
|
-
},
|
|
276
|
+
}, qt = function(t, e) {
|
|
268
277
|
const n = document.createElement("me-children");
|
|
269
278
|
for (let o = 0; o < e.length; o++) {
|
|
270
279
|
const s = e[o], { grp: i } = t.createWrapper(s);
|
|
@@ -302,7 +311,7 @@ const O = {
|
|
|
302
311
|
} else t.link && (t.link = void 0);
|
|
303
312
|
if (e.icons && e.icons.length) {
|
|
304
313
|
const n = document.createElement("span");
|
|
305
|
-
n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${
|
|
314
|
+
n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${Ot(o)}</span>`).join(""), t.appendChild(n), t.icons = n;
|
|
306
315
|
} else t.icons && (t.icons = void 0);
|
|
307
316
|
if (e.tags && e.tags.length) {
|
|
308
317
|
const n = document.createElement("div");
|
|
@@ -311,23 +320,23 @@ const O = {
|
|
|
311
320
|
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);
|
|
312
321
|
}), t.appendChild(n), t.tags = n;
|
|
313
322
|
} else t.tags && (t.tags = void 0);
|
|
314
|
-
},
|
|
323
|
+
}, Ut = function(t, e) {
|
|
315
324
|
const n = document.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(t);
|
|
316
325
|
if (n.appendChild(o), !e && t.children && t.children.length > 0) {
|
|
317
|
-
const i =
|
|
326
|
+
const i = te(t.expanded);
|
|
318
327
|
if (o.appendChild(i), t.expanded !== !1) {
|
|
319
|
-
const r =
|
|
328
|
+
const r = qt(this, t.children);
|
|
320
329
|
n.appendChild(r);
|
|
321
330
|
}
|
|
322
331
|
}
|
|
323
332
|
return { grp: n, top: o, tpc: s };
|
|
324
|
-
},
|
|
333
|
+
}, Kt = function(t) {
|
|
325
334
|
const e = document.createElement("me-parent"), n = this.createTopic(t);
|
|
326
335
|
return St.call(this, n, t), e.appendChild(n), { p: e, tpc: n };
|
|
327
|
-
},
|
|
336
|
+
}, Jt = function(t) {
|
|
328
337
|
const e = document.createElement("me-children");
|
|
329
338
|
return e.append(...t), e;
|
|
330
|
-
},
|
|
339
|
+
}, Zt = function(t) {
|
|
331
340
|
const e = document.createElement("me-tpc");
|
|
332
341
|
return e.nodeObj = t, e.dataset.nodeid = "me" + t.id, e;
|
|
333
342
|
};
|
|
@@ -337,7 +346,7 @@ function Et(t) {
|
|
|
337
346
|
const n = window.getSelection();
|
|
338
347
|
n && (n.removeAllRanges(), n.addRange(e));
|
|
339
348
|
}
|
|
340
|
-
const
|
|
349
|
+
const Qt = function(t) {
|
|
341
350
|
if (!t) return;
|
|
342
351
|
const e = document.createElement("div"), n = t.nodeObj, o = n.topic, { offsetLeft: s, offsetTop: i } = P(this.nodes, t);
|
|
343
352
|
this.nodes.appendChild(e), e.id = "input-box", e.textContent = o, e.contentEditable = "plaintext-only", e.spellcheck = !1;
|
|
@@ -356,7 +365,7 @@ const Jt = function(t) {
|
|
|
356
365
|
name: "beginEdit",
|
|
357
366
|
obj: t.nodeObj
|
|
358
367
|
}), e.addEventListener("keydown", (c) => {
|
|
359
|
-
c.stopPropagation();
|
|
368
|
+
if (c.stopPropagation(), c.isComposing) return;
|
|
360
369
|
const l = c.key;
|
|
361
370
|
if (l === "Enter" || l === "Tab") {
|
|
362
371
|
if (c.shiftKey) return;
|
|
@@ -372,14 +381,14 @@ const Jt = function(t) {
|
|
|
372
381
|
origin: o
|
|
373
382
|
}));
|
|
374
383
|
});
|
|
375
|
-
},
|
|
384
|
+
}, te = function(t) {
|
|
376
385
|
const e = document.createElement("me-epd");
|
|
377
386
|
return e.expanded = t !== !1, e.className = t !== !1 ? "minus" : "", e;
|
|
378
|
-
},
|
|
387
|
+
}, ee = function(t) {
|
|
379
388
|
const n = t.parentElement.parentElement.lastElementChild;
|
|
380
389
|
n?.tagName === "svg" && n?.remove();
|
|
381
390
|
};
|
|
382
|
-
function
|
|
391
|
+
function ne(t) {
|
|
383
392
|
return {
|
|
384
393
|
nodeData: t.isFocusMode ? t.nodeDataBackup : t.nodeData,
|
|
385
394
|
arrows: t.arrows,
|
|
@@ -390,51 +399,51 @@ function te(t) {
|
|
|
390
399
|
meta: t.meta
|
|
391
400
|
};
|
|
392
401
|
}
|
|
393
|
-
const
|
|
402
|
+
const oe = function(t, e = !1) {
|
|
394
403
|
const n = this.container, o = t.getBoundingClientRect(), s = n.getBoundingClientRect();
|
|
395
404
|
if (e || o.top > s.bottom - 50 || o.bottom < s.top + 50 || o.left > s.right - 50 || o.right < s.left + 50) {
|
|
396
405
|
const r = o.left + o.width / 2, c = o.top + o.height / 2, l = s.left + s.width / 2, a = s.top + s.height / 2, f = r - l, d = c - a;
|
|
397
406
|
this.move(-f, -d, !0);
|
|
398
407
|
}
|
|
399
|
-
},
|
|
408
|
+
}, se = function(t, e, n) {
|
|
400
409
|
this.clearSelection(), this.scrollIntoView(t), this.selection?.select(t), e && this.bus.fire("selectNewNode", t.nodeObj);
|
|
401
|
-
},
|
|
410
|
+
}, ie = function(t) {
|
|
402
411
|
this.selection?.select(t);
|
|
403
|
-
},
|
|
412
|
+
}, re = function(t) {
|
|
404
413
|
this.selection?.deselect(t);
|
|
405
|
-
},
|
|
414
|
+
}, ce = function() {
|
|
406
415
|
this.unselectNodes(this.currentNodes), this.unselectSummary(), this.unselectArrow();
|
|
407
416
|
}, Tt = function(t) {
|
|
408
417
|
return JSON.stringify(t, (e, n) => {
|
|
409
418
|
if (!(e === "parent" && typeof n != "string"))
|
|
410
419
|
return n;
|
|
411
420
|
});
|
|
412
|
-
},
|
|
413
|
-
const t =
|
|
421
|
+
}, le = function() {
|
|
422
|
+
const t = ne(this);
|
|
414
423
|
return Tt(t);
|
|
415
|
-
},
|
|
424
|
+
}, ae = function() {
|
|
416
425
|
return JSON.parse(this.getDataString());
|
|
417
|
-
},
|
|
426
|
+
}, he = function() {
|
|
418
427
|
this.editable = !0;
|
|
419
|
-
},
|
|
428
|
+
}, de = function() {
|
|
420
429
|
this.editable = !1;
|
|
421
|
-
},
|
|
430
|
+
}, fe = function(t, e = { x: 0, y: 0 }) {
|
|
422
431
|
if (t < this.scaleMin && t < this.scaleVal || t > this.scaleMax && t > this.scaleVal) return;
|
|
423
|
-
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 } =
|
|
424
|
-
this.map.style.transform = `translate3d(${l -
|
|
425
|
-
},
|
|
432
|
+
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 } = it(this), c = this.map.style.transform, { x: l, y: a } = st(c), f = l - i, d = a - r, p = this.scaleVal, b = (-o + f) * (1 - t / p), y = (-s + d) * (1 - t / p);
|
|
433
|
+
this.map.style.transform = `translate3d(${l - b}px, ${a - y}px, 0) scale(${t})`, this.scaleVal = t, this.bus.fire("scale", t);
|
|
434
|
+
}, ue = function() {
|
|
426
435
|
const t = this.nodes.offsetHeight / this.container.offsetHeight, e = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(t, e));
|
|
427
436
|
this.scaleVal = n;
|
|
428
|
-
const { dx: o, dy: s } =
|
|
437
|
+
const { dx: o, dy: s } = it(this, !0);
|
|
429
438
|
this.map.style.transform = `translate3d(${o}px, ${s}px, 0) scale(${n})`, this.bus.fire("scale", n);
|
|
430
|
-
},
|
|
439
|
+
}, pe = function(t, e, n = !1) {
|
|
431
440
|
const { map: o, scaleVal: s, bus: i, container: r, nodes: c } = this;
|
|
432
441
|
if (n && o.style.transition === "transform 0.3s")
|
|
433
442
|
return;
|
|
434
443
|
const l = o.style.transform;
|
|
435
|
-
let { x: a, y: f } =
|
|
436
|
-
const d = r.getBoundingClientRect(), p = c.getBoundingClientRect(),
|
|
437
|
-
if (
|
|
444
|
+
let { x: a, y: f } = st(l);
|
|
445
|
+
const d = r.getBoundingClientRect(), p = c.getBoundingClientRect(), b = p.left < d.right && p.right > d.left, y = p.top < d.bottom && p.bottom > d.top;
|
|
446
|
+
if (b) {
|
|
438
447
|
const u = p.left + t, g = p.right + t;
|
|
439
448
|
(u >= d.right || g <= d.left) && (t = 0);
|
|
440
449
|
}
|
|
@@ -445,7 +454,7 @@ const ee = function(t, e = !1) {
|
|
|
445
454
|
a += t, f += e, n && (o.style.transition = "transform 0.3s", setTimeout(() => {
|
|
446
455
|
o.style.transition = "none";
|
|
447
456
|
}, 300)), o.style.transform = `translate3d(${a}px, ${f}px, 0) scale(${s})`, i.fire("move", { dx: t, dy: e });
|
|
448
|
-
},
|
|
457
|
+
}, it = (t, e = !1) => {
|
|
449
458
|
const { container: n, map: o, nodes: s } = t;
|
|
450
459
|
let i, r;
|
|
451
460
|
if (t.alignment === "nodes" || e)
|
|
@@ -455,29 +464,29 @@ const ee = function(t, e = !1) {
|
|
|
455
464
|
i = n.offsetWidth / 2 - a - f / 2, r = n.offsetHeight / 2 - l - d / 2, o.style.transformOrigin = `${a + f / 2}px 50%`;
|
|
456
465
|
}
|
|
457
466
|
return { dx: i, dy: r };
|
|
458
|
-
},
|
|
459
|
-
const { map: t, container: e } = this, { dx: n, dy: o } =
|
|
467
|
+
}, ge = function() {
|
|
468
|
+
const { map: t, container: e } = this, { dx: n, dy: o } = it(this);
|
|
460
469
|
e.scrollTop = 0, e.scrollLeft = 0, t.style.transform = `translate3d(${n}px, ${o}px, 0) scale(${this.scaleVal})`;
|
|
461
|
-
},
|
|
470
|
+
}, me = function(t) {
|
|
462
471
|
t(this);
|
|
463
|
-
},
|
|
472
|
+
}, ye = function(t) {
|
|
464
473
|
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());
|
|
465
|
-
},
|
|
474
|
+
}, be = function() {
|
|
466
475
|
this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
|
|
467
|
-
},
|
|
476
|
+
}, ve = function() {
|
|
468
477
|
this.direction = 0, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
469
|
-
},
|
|
478
|
+
}, xe = function() {
|
|
470
479
|
this.direction = 1, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
471
|
-
},
|
|
480
|
+
}, we = function() {
|
|
472
481
|
this.direction = 2, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
473
|
-
},
|
|
482
|
+
}, Ce = function(t, e) {
|
|
474
483
|
const n = t.nodeObj;
|
|
475
484
|
typeof e == "boolean" ? n.expanded = e : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
|
|
476
485
|
const o = t.getBoundingClientRect(), s = {
|
|
477
486
|
x: o.left,
|
|
478
487
|
y: o.top
|
|
479
488
|
}, i = t.parentNode, r = i.children[1];
|
|
480
|
-
if (r.expanded = n.expanded, r.className = n.expanded ? "minus" : "",
|
|
489
|
+
if (r.expanded = n.expanded, r.className = n.expanded ? "minus" : "", ee(t), n.expanded) {
|
|
481
490
|
const d = this.createChildren(
|
|
482
491
|
n.children.map((p) => this.createWrapper(p).grp)
|
|
483
492
|
);
|
|
@@ -490,59 +499,59 @@ const ee = function(t, e = !1) {
|
|
|
490
499
|
y: c.top
|
|
491
500
|
}, a = s.x - l.x, f = s.y - l.y;
|
|
492
501
|
this.move(a, f), this.bus.fire("expandNode", n);
|
|
493
|
-
},
|
|
502
|
+
}, Se = function(t, e) {
|
|
494
503
|
const n = t.nodeObj, o = t.getBoundingClientRect(), s = {
|
|
495
504
|
x: o.left,
|
|
496
505
|
y: o.top
|
|
497
506
|
};
|
|
498
|
-
|
|
507
|
+
bt(n, e ?? !n.expanded), this.refresh();
|
|
499
508
|
const i = this.findEle(n.id).getBoundingClientRect(), r = {
|
|
500
509
|
x: i.left,
|
|
501
510
|
y: i.top
|
|
502
511
|
}, c = s.x - r.x, l = s.y - r.y;
|
|
503
512
|
this.move(c, l);
|
|
504
|
-
},
|
|
505
|
-
this.clearSelection(), t && (t = JSON.parse(JSON.stringify(t)), this.nodeData = t.nodeData, this.arrows = t.arrows || [], this.summaries = t.summaries || [], t.meta && (this.meta = t.meta), t.theme && this.changeTheme(t.theme)),
|
|
506
|
-
},
|
|
513
|
+
}, Ee = function(t) {
|
|
514
|
+
this.clearSelection(), t && (t = JSON.parse(JSON.stringify(t)), this.nodeData = t.nodeData, this.arrows = t.arrows || [], this.summaries = t.summaries || [], t.meta && (this.meta = t.meta), t.theme && this.changeTheme(t.theme)), ot(this.nodeData), this.layout(), this.linkDiv();
|
|
515
|
+
}, Te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
507
516
|
__proto__: null,
|
|
508
|
-
cancelFocus:
|
|
509
|
-
clearSelection:
|
|
510
|
-
disableEdit:
|
|
511
|
-
enableEdit:
|
|
512
|
-
expandNode:
|
|
513
|
-
expandNodeAll:
|
|
514
|
-
focusNode:
|
|
515
|
-
getData:
|
|
516
|
-
getDataString:
|
|
517
|
-
initLeft:
|
|
518
|
-
initRight:
|
|
519
|
-
initSide:
|
|
520
|
-
install:
|
|
521
|
-
move:
|
|
522
|
-
refresh:
|
|
523
|
-
scale:
|
|
524
|
-
scaleFit:
|
|
525
|
-
scrollIntoView:
|
|
526
|
-
selectNode:
|
|
527
|
-
selectNodes:
|
|
517
|
+
cancelFocus: be,
|
|
518
|
+
clearSelection: ce,
|
|
519
|
+
disableEdit: de,
|
|
520
|
+
enableEdit: he,
|
|
521
|
+
expandNode: Ce,
|
|
522
|
+
expandNodeAll: Se,
|
|
523
|
+
focusNode: ye,
|
|
524
|
+
getData: ae,
|
|
525
|
+
getDataString: le,
|
|
526
|
+
initLeft: ve,
|
|
527
|
+
initRight: xe,
|
|
528
|
+
initSide: we,
|
|
529
|
+
install: me,
|
|
530
|
+
move: pe,
|
|
531
|
+
refresh: Ee,
|
|
532
|
+
scale: fe,
|
|
533
|
+
scaleFit: ue,
|
|
534
|
+
scrollIntoView: oe,
|
|
535
|
+
selectNode: se,
|
|
536
|
+
selectNodes: ie,
|
|
528
537
|
stringifyData: Tt,
|
|
529
|
-
toCenter:
|
|
530
|
-
unselectNodes:
|
|
531
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
532
|
-
const i = -
|
|
538
|
+
toCenter: ge,
|
|
539
|
+
unselectNodes: re
|
|
540
|
+
}, Symbol.toStringTag, { value: "Module" })), De = 40, Le = 10, Me = ({ deltaMode: t, deltaY: e, viewportHeight: n }) => t === WheelEvent.DOM_DELTA_LINE ? e * De : t === WheelEvent.DOM_DELTA_PAGE ? e * n : e, Pe = ({ deltaMode: t, deltaY: e, scaleSensitivity: n, viewportHeight: o }) => {
|
|
541
|
+
const i = -Me({ deltaMode: t, deltaY: e, viewportHeight: o }) / Le * n;
|
|
533
542
|
return Math.max(-n, Math.min(n, i));
|
|
534
|
-
},
|
|
543
|
+
}, ke = (t, e, n) => {
|
|
535
544
|
e !== 0 && t.scale(t.scaleVal + e, n);
|
|
536
|
-
},
|
|
537
|
-
const n =
|
|
545
|
+
}, Ae = (t, e) => {
|
|
546
|
+
const n = Pe({
|
|
538
547
|
deltaMode: e.deltaMode,
|
|
539
548
|
deltaY: e.deltaY,
|
|
540
549
|
scaleSensitivity: t.scaleSensitivity,
|
|
541
550
|
viewportHeight: t.container.clientHeight || window.innerHeight
|
|
542
551
|
});
|
|
543
|
-
|
|
552
|
+
ke(t, n, { x: e.clientX, y: e.clientY });
|
|
544
553
|
};
|
|
545
|
-
function
|
|
554
|
+
function Ne(t) {
|
|
546
555
|
const { panHelper: e, container: n } = t;
|
|
547
556
|
let o = null;
|
|
548
557
|
t.spacePressed = !1;
|
|
@@ -555,8 +564,8 @@ function ke(t) {
|
|
|
555
564
|
this.clear();
|
|
556
565
|
return;
|
|
557
566
|
}
|
|
558
|
-
const
|
|
559
|
-
this.lastTap =
|
|
567
|
+
const w = (/* @__PURE__ */ new Date()).getTime(), E = w - this.lastTap, S = E < this.DOUBLE_CLICK_THRESHOLD && E > 0 && this.lastTapTarget === h.target;
|
|
568
|
+
this.lastTap = w, this.lastTapTarget = h.target, S && m(h);
|
|
560
569
|
},
|
|
561
570
|
clear() {
|
|
562
571
|
this.lastTap = 0, this.lastTapTarget = null;
|
|
@@ -576,20 +585,20 @@ function ke(t) {
|
|
|
576
585
|
handlePointerDown(h) {
|
|
577
586
|
if (h.pointerType !== "touch") return !1;
|
|
578
587
|
if (this.activePointers.set(h.pointerId, { x: h.clientX, y: h.clientY }), this.activePointers.size >= 2) {
|
|
579
|
-
const [m,
|
|
580
|
-
return this.lastDistance =
|
|
588
|
+
const [m, w] = Array.from(this.activePointers.values());
|
|
589
|
+
return this.lastDistance = dt(m, w), !0;
|
|
581
590
|
}
|
|
582
591
|
return !1;
|
|
583
592
|
},
|
|
584
593
|
handlePointerMove(h) {
|
|
585
594
|
if (h.pointerType !== "touch" || !this.activePointers.has(h.pointerId)) return !1;
|
|
586
595
|
if (this.activePointers.set(h.pointerId, { x: h.clientX, y: h.clientY }), this.activePointers.size >= 2) {
|
|
587
|
-
const [m,
|
|
596
|
+
const [m, w] = Array.from(this.activePointers.values()), E = dt(m, w);
|
|
588
597
|
if (this.lastDistance !== null && this.lastDistance > 0) {
|
|
589
598
|
const S = E / this.lastDistance;
|
|
590
599
|
t.scale(t.scaleVal * S, {
|
|
591
|
-
x: (m.x +
|
|
592
|
-
y: (m.y +
|
|
600
|
+
x: (m.x + w.x) / 2,
|
|
601
|
+
y: (m.y + w.y) / 2
|
|
593
602
|
});
|
|
594
603
|
}
|
|
595
604
|
return this.lastDistance = E, !0;
|
|
@@ -602,7 +611,7 @@ function ke(t) {
|
|
|
602
611
|
clear() {
|
|
603
612
|
this.activePointers.clear(), this.lastDistance = null;
|
|
604
613
|
}
|
|
605
|
-
}, c =
|
|
614
|
+
}, c = Vt(t), l = {
|
|
606
615
|
timer: null,
|
|
607
616
|
startPos: null,
|
|
608
617
|
pointerId: null,
|
|
@@ -618,16 +627,16 @@ function ke(t) {
|
|
|
618
627
|
},
|
|
619
628
|
handleMove(h) {
|
|
620
629
|
if (this.timer !== null && this.startPos !== null && h.pointerId === this.pointerId) {
|
|
621
|
-
const m = h.clientX - this.startPos.x,
|
|
622
|
-
Math.sqrt(m * m +
|
|
630
|
+
const m = h.clientX - this.startPos.x, w = h.clientY - this.startPos.y;
|
|
631
|
+
Math.sqrt(m * m + w * w) > this.MOVE_THRESHOLD && this.clear();
|
|
623
632
|
}
|
|
624
633
|
}
|
|
625
634
|
}, a = (h, m) => {
|
|
626
635
|
if (h.closest("#input-box")) return !1;
|
|
627
|
-
const
|
|
636
|
+
const w = h.closest(".svg-label"), E = h.closest(".topiclinks, .summary"), S = w ? { type: w.dataset.type, element: document.getElementById(w.dataset.svgId) } : E ? { type: E.classList.contains("topiclinks") ? "arrow" : "summary", element: h.closest("g") } : null;
|
|
628
637
|
if (!S?.type || !S?.element) return !1;
|
|
629
|
-
const { type: M, element:
|
|
630
|
-
return t.clearSelection(), M === "arrow" ? m ? t.editArrowLabel(
|
|
638
|
+
const { type: M, element: A } = S;
|
|
639
|
+
return t.clearSelection(), M === "arrow" ? m ? t.editArrowLabel(A) : t.selectArrow(A) : m ? t.editSummary(A) : t.selectSummary(A), !0;
|
|
631
640
|
}, f = (h) => {
|
|
632
641
|
if (h.pointerType === "mouse" && h.button !== 0) return;
|
|
633
642
|
if (t.helper1?.moved) {
|
|
@@ -656,7 +665,7 @@ function ke(t) {
|
|
|
656
665
|
a(m, !0);
|
|
657
666
|
}, p = (h) => {
|
|
658
667
|
if (h.pointerType === "touch" && r.handlePointerDown(h)) {
|
|
659
|
-
t.ptState = i.Pinch, l.clear(), e.clear(), (c.isDragging || c.pointerId !== null) &&
|
|
668
|
+
t.ptState = i.Pinch, l.clear(), e.clear(), (c.isDragging || c.pointerId !== null) && pt(t, c);
|
|
660
669
|
return;
|
|
661
670
|
}
|
|
662
671
|
if (t.ptState === i.Pinch) return;
|
|
@@ -671,11 +680,11 @@ function ke(t) {
|
|
|
671
680
|
const E = t.currentNodes || [];
|
|
672
681
|
if (h.ctrlKey || h.metaKey || t.mobileMultiSelect ? E.includes(m) ? o = m : ((t.currentArrow || t.currentSummary) && t.clearSelection(), t.selection?.select(m)) : E.includes(m) || t.selectNode(m), !t.editable) return;
|
|
673
682
|
h.pointerType === "touch" ? (t.ptState = i.DragWait, l.start(h, (M) => {
|
|
674
|
-
|
|
675
|
-
})) :
|
|
683
|
+
ut(t, c, M, !0) && (t.ptState = i.Drag, m.setPointerCapture(M.pointerId));
|
|
684
|
+
})) : ut(t, c, h, !1) && (t.ptState = i.Drag, m.setPointerCapture(h.pointerId));
|
|
676
685
|
} else
|
|
677
686
|
a(m, !1);
|
|
678
|
-
},
|
|
687
|
+
}, b = (h) => {
|
|
679
688
|
switch (t.ptState) {
|
|
680
689
|
case i.Pinch:
|
|
681
690
|
r.handlePointerMove(h);
|
|
@@ -684,7 +693,7 @@ function ke(t) {
|
|
|
684
693
|
l.handleMove(h), l.timer === null && (t.ptState = i.Idle);
|
|
685
694
|
break;
|
|
686
695
|
case i.Drag:
|
|
687
|
-
|
|
696
|
+
Ft(t, c, h);
|
|
688
697
|
break;
|
|
689
698
|
case i.Pan:
|
|
690
699
|
e.handlePointerMove(h);
|
|
@@ -692,50 +701,50 @@ function ke(t) {
|
|
|
692
701
|
}
|
|
693
702
|
}, y = (h) => {
|
|
694
703
|
h.pointerType === "touch" && r.handlePointerUp(h);
|
|
695
|
-
const m = c.isDragging,
|
|
704
|
+
const m = c.isDragging, w = e.moved;
|
|
696
705
|
switch (t.ptState) {
|
|
697
706
|
case i.DragWait:
|
|
698
707
|
l.clear();
|
|
699
708
|
break;
|
|
700
709
|
case i.Drag:
|
|
701
|
-
|
|
710
|
+
Gt(t, c, h);
|
|
702
711
|
break;
|
|
703
712
|
case i.Pan:
|
|
704
713
|
e.handlePointerUp(h);
|
|
705
714
|
break;
|
|
706
715
|
}
|
|
707
|
-
s.detect(h, d), (t.ptState !== i.Pinch || r.activePointers.size < 2) && (t.ptState = i.Idle), o && (!m && !
|
|
716
|
+
s.detect(h, d), (t.ptState !== i.Pinch || r.activePointers.size < 2) && (t.ptState = i.Idle), o && (!m && !w && t.selection?.deselect(o), o = null);
|
|
708
717
|
}, u = () => {
|
|
709
|
-
r.clear(), l.clear(), e.clear(), s.clear(), (c.isDragging || c.pointerId !== null) &&
|
|
718
|
+
r.clear(), l.clear(), e.clear(), s.clear(), (c.isDragging || c.pointerId !== null) && pt(t, c), t.ptState = i.Idle, o = null;
|
|
710
719
|
}, g = (h) => {
|
|
711
720
|
h.preventDefault(), h.button === 2 && t.editable && setTimeout(() => {
|
|
712
721
|
if (t.panHelper.moved || t.ptState !== i.Idle && t.ptState !== i.Pan) return;
|
|
713
722
|
const m = h.target;
|
|
714
723
|
J(m) && !m.classList.contains("selected") && t.selectNode(m), t.bus.fire("showContextMenu", h);
|
|
715
724
|
}, 200);
|
|
716
|
-
},
|
|
717
|
-
if (h.stopPropagation(), h.preventDefault(), h.ctrlKey || h.metaKey) return
|
|
725
|
+
}, x = (h) => {
|
|
726
|
+
if (h.stopPropagation(), h.preventDefault(), h.ctrlKey || h.metaKey) return Ae(t, h);
|
|
718
727
|
if (h.shiftKey) return t.move(-h.deltaY, 0);
|
|
719
728
|
t.move(-h.deltaX, -h.deltaY);
|
|
720
|
-
},
|
|
729
|
+
}, v = (h) => {
|
|
721
730
|
h.code === "Space" && (t.spacePressed = !0, t.container.classList.add("space-pressed"));
|
|
722
731
|
}, C = (h) => {
|
|
723
732
|
h.code === "Space" && (t.spacePressed = !1, t.container.classList.remove("space-pressed"));
|
|
724
733
|
};
|
|
725
|
-
return
|
|
734
|
+
return vt([
|
|
726
735
|
{ dom: n, evt: "pointerdown", func: p },
|
|
727
|
-
{ dom: n, evt: "pointermove", func:
|
|
736
|
+
{ dom: n, evt: "pointermove", func: b },
|
|
728
737
|
{ dom: n, evt: "pointerup", func: y },
|
|
729
738
|
{ dom: n, evt: "pointercancel", func: u },
|
|
730
739
|
{ dom: n, evt: "click", func: f },
|
|
731
740
|
{ dom: n, evt: "contextmenu", func: g },
|
|
732
|
-
{ dom: n, evt: "wheel", func: typeof t.handleWheel == "function" ? t.handleWheel :
|
|
741
|
+
{ dom: n, evt: "wheel", func: typeof t.handleWheel == "function" ? t.handleWheel : x },
|
|
733
742
|
{ dom: n, evt: "blur", func: u },
|
|
734
|
-
{ dom: n, evt: "keydown", func:
|
|
743
|
+
{ dom: n, evt: "keydown", func: v },
|
|
735
744
|
{ dom: n, evt: "keyup", func: C }
|
|
736
745
|
]);
|
|
737
746
|
}
|
|
738
|
-
function
|
|
747
|
+
function $e() {
|
|
739
748
|
return {
|
|
740
749
|
handlers: {},
|
|
741
750
|
addListener: function(t, e) {
|
|
@@ -776,13 +785,13 @@ const k = "http://www.w3.org/2000/svg", U = function(t) {
|
|
|
776
785
|
fill: "none",
|
|
777
786
|
"stroke-width": n
|
|
778
787
|
}), o;
|
|
779
|
-
},
|
|
788
|
+
}, R = function(t) {
|
|
780
789
|
const e = document.createElementNS(k, "svg");
|
|
781
790
|
return e.setAttribute("class", t), e.setAttribute("overflow", "visible"), e;
|
|
782
|
-
},
|
|
791
|
+
}, gt = function() {
|
|
783
792
|
const t = document.createElementNS(k, "line");
|
|
784
793
|
return t.setAttribute("stroke", "#4dc4ff"), t.setAttribute("fill", "none"), t.setAttribute("stroke-width", "2"), t.setAttribute("opacity", "0.45"), t;
|
|
785
|
-
},
|
|
794
|
+
}, He = function(t, e, n, o) {
|
|
786
795
|
const s = document.createElementNS(k, "g");
|
|
787
796
|
return [
|
|
788
797
|
{
|
|
@@ -824,7 +833,7 @@ const k = "http://www.w3.org/2000/svg", U = function(t) {
|
|
|
824
833
|
top:${e.style.top};
|
|
825
834
|
max-width: 200px;
|
|
826
835
|
`, Et(s), t.scrollIntoView(s), s.addEventListener("keydown", (i) => {
|
|
827
|
-
i.stopPropagation();
|
|
836
|
+
if (i.stopPropagation(), i.isComposing) return;
|
|
828
837
|
const r = i.key;
|
|
829
838
|
if (r === "Enter" || r === "Tab") {
|
|
830
839
|
if (i.shiftKey) return;
|
|
@@ -841,15 +850,15 @@ const k = "http://www.w3.org/2000/svg", U = function(t) {
|
|
|
841
850
|
obj: n
|
|
842
851
|
}));
|
|
843
852
|
});
|
|
844
|
-
},
|
|
853
|
+
}, Ie = function(t) {
|
|
845
854
|
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");
|
|
846
855
|
this.lines.innerHTML = "";
|
|
847
856
|
for (let c = 0; c < r.length; c++) {
|
|
848
|
-
const l = r[c], a = l.querySelector("me-tpc"), { offsetLeft: f, offsetTop: d } = P(this.nodes, a), p = a.offsetWidth,
|
|
849
|
-
if (a.style.borderColor =
|
|
857
|
+
const l = r[c], a = l.querySelector("me-tpc"), { offsetLeft: f, offsetTop: d } = P(this.nodes, a), p = a.offsetWidth, b = a.offsetHeight, y = l.parentNode.className, u = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: d, cL: f, cW: p, cH: b, direction: y, containerHeight: this.nodes.offsetHeight }), g = this.theme.palette, x = a.nodeObj.branchColor || g[c % g.length];
|
|
858
|
+
if (a.style.borderColor = x, this.lines.appendChild(Dt(u, x, "3")), t && t !== l)
|
|
850
859
|
continue;
|
|
851
|
-
const
|
|
852
|
-
C.tagName === "svg" && C.remove(), l.appendChild(
|
|
860
|
+
const v = R("subLines"), C = l.lastChild;
|
|
861
|
+
C.tagName === "svg" && C.remove(), l.appendChild(v), Mt(this, v, x, l, y, !0);
|
|
853
862
|
}
|
|
854
863
|
this.labelContainer.innerHTML = "", this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
|
|
855
864
|
}, Mt = function(t, e, n, o, s, i) {
|
|
@@ -857,42 +866,42 @@ const k = "http://www.w3.org/2000/svg", U = function(t) {
|
|
|
857
866
|
if (c.length === 0) return;
|
|
858
867
|
const l = r.offsetTop, a = r.offsetLeft, f = r.offsetWidth, d = r.offsetHeight;
|
|
859
868
|
for (let p = 0; p < c.length; p++) {
|
|
860
|
-
const
|
|
869
|
+
const b = c[p], y = b.firstChild, u = y.offsetTop, g = y.offsetLeft, x = y.offsetWidth, v = y.offsetHeight, C = y.firstChild.nodeObj.branchColor || n, T = t.generateSubBranch({ pT: l, pL: a, pW: f, pH: d, cT: u, cL: g, cW: x, cH: v, direction: s, isFirst: i });
|
|
861
870
|
e.appendChild(Dt(T, C, "2"));
|
|
862
871
|
const h = y.children[1];
|
|
863
872
|
if (h) {
|
|
864
873
|
if (!h.expanded) continue;
|
|
865
874
|
} else
|
|
866
875
|
continue;
|
|
867
|
-
Mt(t, e, C,
|
|
876
|
+
Mt(t, e, C, b, s);
|
|
868
877
|
}
|
|
869
|
-
},
|
|
870
|
-
side:
|
|
871
|
-
left:
|
|
872
|
-
right:
|
|
873
|
-
full:
|
|
874
|
-
living:
|
|
875
|
-
zoomin:
|
|
876
|
-
zoomout:
|
|
877
|
-
},
|
|
878
|
+
}, 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="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>', 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="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>', Ye = '<?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>', 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="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>', Re = '<?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>', Xe = '<?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>', Ve = '<?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>', ze = {
|
|
879
|
+
side: Oe,
|
|
880
|
+
left: Be,
|
|
881
|
+
right: Ye,
|
|
882
|
+
full: We,
|
|
883
|
+
living: Re,
|
|
884
|
+
zoomin: Xe,
|
|
885
|
+
zoomout: Ve
|
|
886
|
+
}, I = (t, e) => {
|
|
878
887
|
const n = document.createElement("span");
|
|
879
|
-
return n.id = t, n.innerHTML =
|
|
888
|
+
return n.id = t, n.innerHTML = ze[e], n;
|
|
880
889
|
};
|
|
881
|
-
function
|
|
882
|
-
const e = document.createElement("div"), n =
|
|
890
|
+
function Fe(t) {
|
|
891
|
+
const e = document.createElement("div"), n = I("fullscreen", "full"), o = I("toCenter", "living"), s = I("zoomout", "zoomout"), i = I("zoomin", "zoomin");
|
|
883
892
|
e.appendChild(n), e.appendChild(o), e.appendChild(s), e.appendChild(i), e.className = "mind-elixir-toolbar rb";
|
|
884
893
|
let r = null;
|
|
885
894
|
const c = () => {
|
|
886
|
-
const a = t.container.getBoundingClientRect(), f =
|
|
895
|
+
const a = t.container.getBoundingClientRect(), f = st(t.map.style.transform), d = a.width / 2, p = a.height / 2, b = (d - f.x) / t.scaleVal, y = (p - f.y) / t.scaleVal;
|
|
887
896
|
r = {
|
|
888
897
|
containerRect: a,
|
|
889
898
|
currentTransform: f,
|
|
890
|
-
mapCenterX:
|
|
899
|
+
mapCenterX: b,
|
|
891
900
|
mapCenterY: y
|
|
892
901
|
};
|
|
893
902
|
}, l = () => {
|
|
894
903
|
if (r) {
|
|
895
|
-
const a = t.container.getBoundingClientRect(), f = a.width / 2, d = a.height / 2, p = f - r.mapCenterX * t.scaleVal,
|
|
904
|
+
const a = t.container.getBoundingClientRect(), f = a.width / 2, d = a.height / 2, p = f - r.mapCenterX * t.scaleVal, b = d - r.mapCenterY * t.scaleVal, y = p - r.currentTransform.x, u = b - r.currentTransform.y;
|
|
896
905
|
t.move(y, u);
|
|
897
906
|
}
|
|
898
907
|
};
|
|
@@ -906,8 +915,8 @@ function Ve(t) {
|
|
|
906
915
|
t.scale(t.scaleVal + t.scaleSensitivity);
|
|
907
916
|
}, e;
|
|
908
917
|
}
|
|
909
|
-
function
|
|
910
|
-
const e = document.createElement("div"), n =
|
|
918
|
+
function Ge(t) {
|
|
919
|
+
const e = document.createElement("div"), n = I("tbltl", "left"), o = I("tbltr", "right"), s = I("tblts", "side");
|
|
911
920
|
return e.appendChild(n), e.appendChild(o), e.appendChild(s), e.className = "mind-elixir-toolbar lt", n.onclick = () => {
|
|
912
921
|
t.initLeft();
|
|
913
922
|
}, o.onclick = () => {
|
|
@@ -916,30 +925,30 @@ function ze(t) {
|
|
|
916
925
|
t.initSide();
|
|
917
926
|
}, e;
|
|
918
927
|
}
|
|
919
|
-
function
|
|
920
|
-
t.container.append(
|
|
928
|
+
function je(t) {
|
|
929
|
+
t.container.append(Fe(t)), t.container.append(Ge(t));
|
|
921
930
|
}
|
|
922
931
|
function Pt({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: l, containerHeight: a }) {
|
|
923
932
|
let f = e + n / 2;
|
|
924
933
|
const d = t + o / 2;
|
|
925
934
|
let p;
|
|
926
|
-
l ===
|
|
927
|
-
const
|
|
928
|
-
return l ===
|
|
935
|
+
l === B.LHS ? p = i + r : p = i;
|
|
936
|
+
const b = s + c / 2, u = (1 - Math.abs(b - d) / a) * 0.25 * (n / 2);
|
|
937
|
+
return l === B.LHS ? f = f - n / 10 - u : f = f + n / 10 + u, `M ${f} ${d} Q ${f} ${b} ${p} ${b}`;
|
|
929
938
|
}
|
|
930
939
|
function kt({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: l, isFirst: a }) {
|
|
931
940
|
const f = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
|
|
932
941
|
let d = 0, p = 0;
|
|
933
942
|
a ? d = t + o / 2 : d = t + o;
|
|
934
|
-
const
|
|
943
|
+
const b = s + c;
|
|
935
944
|
let y = 0, u = 0, g = 0;
|
|
936
|
-
const
|
|
937
|
-
return l ===
|
|
945
|
+
const x = Math.abs(d - b) / 300 * f;
|
|
946
|
+
return l === B.LHS ? (g = e, y = g + f, u = g - f, p = i + f, `M ${y} ${d} C ${g} ${d} ${g + x} ${b} ${u} ${b} H ${p}`) : (g = e + n, y = g - f, u = g + f, p = i + r - f, `M ${y} ${d} C ${g} ${d} ${g - x} ${b} ${u} ${b} H ${p}`);
|
|
938
947
|
}
|
|
939
|
-
const
|
|
948
|
+
const _e = function(t, e = !0) {
|
|
940
949
|
this.theme = t, this.generateMainBranch = this.theme.generateMainBranch || Pt, this.generateSubBranch = this.theme.generateSubBranch || kt;
|
|
941
950
|
const o = {
|
|
942
|
-
...(this.theme.type === "dark" ?
|
|
951
|
+
...(this.theme.type === "dark" ? nt : et).cssVar,
|
|
943
952
|
...this.theme.cssVar
|
|
944
953
|
};
|
|
945
954
|
this.compact && (o["--node-gap-x"] = "15px", o["--node-gap-y"] = "2px", o["--main-gap-x"] = "30px", o["--main-gap-y"] = "6px");
|
|
@@ -949,9 +958,9 @@ const Ge = function(t, e = !0) {
|
|
|
949
958
|
this.container.style.setProperty(r, o[r]);
|
|
950
959
|
}
|
|
951
960
|
e && this.refresh();
|
|
952
|
-
}, _e = function(t) {
|
|
953
|
-
this.compact = t, this.theme && this.changeTheme(this.theme);
|
|
954
961
|
}, qe = function(t) {
|
|
962
|
+
this.compact = t, this.theme && this.changeTheme(this.theme);
|
|
963
|
+
}, Ue = function(t) {
|
|
955
964
|
return {
|
|
956
965
|
dom: t,
|
|
957
966
|
moved: !1,
|
|
@@ -974,7 +983,7 @@ const Ge = function(t, e = !0) {
|
|
|
974
983
|
},
|
|
975
984
|
cb: null,
|
|
976
985
|
init(e, n) {
|
|
977
|
-
this.cb = n, this.handleClear = this.handleClear.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.handlePointerDown = this.handlePointerDown.bind(this), this.destroy =
|
|
986
|
+
this.cb = n, this.handleClear = this.handleClear.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.handlePointerDown = this.handlePointerDown.bind(this), this.destroy = vt([
|
|
978
987
|
{ dom: e, evt: "pointermove", func: this.handlePointerMove },
|
|
979
988
|
{ dom: e, evt: "pointerleave", func: this.handleClear },
|
|
980
989
|
{ dom: e, evt: "pointerup", func: this.handleClear },
|
|
@@ -986,19 +995,19 @@ const Ge = function(t, e = !0) {
|
|
|
986
995
|
this.moved = !1, this.pointerdown = !1;
|
|
987
996
|
}
|
|
988
997
|
};
|
|
989
|
-
},
|
|
990
|
-
create:
|
|
991
|
-
},
|
|
992
|
-
function
|
|
998
|
+
}, mt = {
|
|
999
|
+
create: Ue
|
|
1000
|
+
}, At = "#4dc4ff";
|
|
1001
|
+
function Nt(t, e, n, o, s, i, r, c) {
|
|
993
1002
|
return {
|
|
994
1003
|
x: t / 8 + n * 3 / 8 + s * 3 / 8 + r / 8,
|
|
995
1004
|
y: e / 8 + o * 3 / 8 + i * 3 / 8 + c / 8
|
|
996
1005
|
};
|
|
997
1006
|
}
|
|
998
|
-
function
|
|
1007
|
+
function Ke(t, e, n) {
|
|
999
1008
|
t && (t.dataset.x = e.toString(), t.dataset.y = n.toString(), U(t));
|
|
1000
1009
|
}
|
|
1001
|
-
function
|
|
1010
|
+
function O(t, e, n, o, s) {
|
|
1002
1011
|
D(t, {
|
|
1003
1012
|
x1: e + "",
|
|
1004
1013
|
y1: n + "",
|
|
@@ -1006,7 +1015,7 @@ function V(t, e, n, o, s) {
|
|
|
1006
1015
|
y2: s + ""
|
|
1007
1016
|
});
|
|
1008
1017
|
}
|
|
1009
|
-
function
|
|
1018
|
+
function tt(t, e, n, o, s, i, r, c, l, a) {
|
|
1010
1019
|
const f = `M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${l}`;
|
|
1011
1020
|
if (t.line.setAttribute("d", f), a.style) {
|
|
1012
1021
|
const u = a.style;
|
|
@@ -1027,19 +1036,20 @@ function mt(t, e, n, o, s, i, r, c, l, a) {
|
|
|
1027
1036
|
if (u) {
|
|
1028
1037
|
const g = `M ${u.x1} ${u.y1} L ${e} ${n} L ${u.x2} ${u.y2}`;
|
|
1029
1038
|
if (t.arrow2.setAttribute("d", g), d.length > 2 && d[2].setAttribute("d", g), a.style) {
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1039
|
+
const x = a.style;
|
|
1040
|
+
x.stroke && t.arrow2.setAttribute("stroke", x.stroke), x.strokeWidth && t.arrow2.setAttribute("stroke-width", String(x.strokeWidth)), x.strokeLinecap && t.arrow2.setAttribute("stroke-linecap", x.strokeLinecap), x.opacity !== void 0 && t.arrow2.setAttribute("opacity", String(x.opacity));
|
|
1032
1041
|
}
|
|
1033
1042
|
}
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
|
|
1043
|
+
} else
|
|
1044
|
+
t.arrow2.setAttribute("d", ""), d.length > 2 && d[2].setAttribute("d", "");
|
|
1045
|
+
const { x: b, y } = Nt(e, n, o, s, i, r, c, l);
|
|
1046
|
+
if (t.labelEl && Ke(t.labelEl, b, y), a.style?.labelColor) {
|
|
1037
1047
|
const u = t.labelEl;
|
|
1038
1048
|
u && (u.style.color = a.style.labelColor);
|
|
1039
1049
|
}
|
|
1040
|
-
|
|
1050
|
+
on(t);
|
|
1041
1051
|
}
|
|
1042
|
-
function
|
|
1052
|
+
function Y(t, e, n) {
|
|
1043
1053
|
const { offsetLeft: o, offsetTop: s } = P(t.nodes, e), i = e.offsetWidth, r = e.offsetHeight, c = o + i / 2, l = s + r / 2, a = c + n.x, f = l + n.y;
|
|
1044
1054
|
return {
|
|
1045
1055
|
w: i,
|
|
@@ -1050,7 +1060,7 @@ function q(t, e, n) {
|
|
|
1050
1060
|
ctrlY: f
|
|
1051
1061
|
};
|
|
1052
1062
|
}
|
|
1053
|
-
function
|
|
1063
|
+
function H(t) {
|
|
1054
1064
|
let e, n;
|
|
1055
1065
|
const o = (t.cy - t.ctrlY) / (t.ctrlX - t.cx);
|
|
1056
1066
|
return o > t.h / t.w || o < -t.h / t.w ? t.cy - t.ctrlY < 0 ? (e = t.cx - t.h / 2 / o, n = t.cy + t.h / 2) : (e = t.cx + t.h / 2 / o, n = t.cy - t.h / 2) : t.cx - t.ctrlX < 0 ? (e = t.cx + t.w / 2, n = t.cy - t.w * o / 2) : (e = t.cx - t.w / 2, n = t.cy + t.w * o / 2), {
|
|
@@ -1058,71 +1068,71 @@ function I(t) {
|
|
|
1058
1068
|
y: n
|
|
1059
1069
|
};
|
|
1060
1070
|
}
|
|
1061
|
-
const
|
|
1062
|
-
const o = P(t.nodes, e), s = P(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, f = l - r, d = Math.sqrt(a * a + f * f), p = Math.max(50, Math.min(200, d * 0.3)),
|
|
1071
|
+
const $t = function(t, e, n) {
|
|
1072
|
+
const o = P(t.nodes, e), s = P(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, f = l - r, d = Math.sqrt(a * a + f * f), p = Math.max(50, Math.min(200, d * 0.3)), b = Math.abs(a), y = Math.abs(f);
|
|
1063
1073
|
let u, g;
|
|
1064
1074
|
if (d < 150) {
|
|
1065
|
-
const
|
|
1066
|
-
u = { x: 200 *
|
|
1067
|
-
} else if (
|
|
1068
|
-
const
|
|
1069
|
-
u = { x:
|
|
1070
|
-
} else if (y >
|
|
1071
|
-
const
|
|
1072
|
-
u = { x: 0, y:
|
|
1075
|
+
const v = e.closest("me-main").className === "lhs" ? -1 : 1;
|
|
1076
|
+
u = { x: 200 * v, y: 0 }, g = { x: 200 * v, y: 0 };
|
|
1077
|
+
} else if (b > y * 1.5) {
|
|
1078
|
+
const v = a > 0 ? e.offsetWidth / 2 : -e.offsetWidth / 2, C = a > 0 ? -n.offsetWidth / 2 : n.offsetWidth / 2;
|
|
1079
|
+
u = { x: v + (a > 0 ? p : -p), y: 0 }, g = { x: C + (a > 0 ? -p : p), y: 0 };
|
|
1080
|
+
} else if (y > b * 1.5) {
|
|
1081
|
+
const v = f > 0 ? e.offsetHeight / 2 : -e.offsetHeight / 2, C = f > 0 ? -n.offsetHeight / 2 : n.offsetHeight / 2;
|
|
1082
|
+
u = { x: 0, y: v + (f > 0 ? p : -p) }, g = { x: 0, y: C + (f > 0 ? -p : p) };
|
|
1073
1083
|
} else {
|
|
1074
|
-
const
|
|
1075
|
-
u = { x: C +
|
|
1084
|
+
const v = Math.atan2(f, a), C = e.offsetWidth / 2 * Math.cos(v), T = e.offsetHeight / 2 * Math.sin(v), h = -(n.offsetWidth / 2) * Math.cos(v), m = -(n.offsetHeight / 2) * Math.sin(v), w = p * 0.7 * (a > 0 ? 1 : -1), E = p * 0.7 * (f > 0 ? 1 : -1);
|
|
1085
|
+
u = { x: C + w, y: T + E }, g = { x: h - w, y: m - E };
|
|
1076
1086
|
}
|
|
1077
1087
|
return {
|
|
1078
1088
|
delta1: { x: Math.round(u.x), y: Math.round(u.y) },
|
|
1079
1089
|
delta2: { x: Math.round(g.x), y: Math.round(g.y) }
|
|
1080
1090
|
};
|
|
1081
|
-
},
|
|
1091
|
+
}, rt = function(t, e, n, o, s) {
|
|
1082
1092
|
if (!e || !n)
|
|
1083
1093
|
return;
|
|
1084
1094
|
if (!o.delta1 || !o.delta2) {
|
|
1085
|
-
const S =
|
|
1095
|
+
const S = $t(t, e, n);
|
|
1086
1096
|
o.delta1 = S.delta1, o.delta2 = S.delta2;
|
|
1087
1097
|
}
|
|
1088
|
-
const i =
|
|
1098
|
+
const i = Y(t, e, o.delta1), r = Y(t, n, o.delta2), { x: c, y: l } = H(i), { ctrlX: a, ctrlY: f } = i, { ctrlX: d, ctrlY: p } = r, { x: b, y } = H(r), u = _(d, p, b, y);
|
|
1089
1099
|
if (!u) return;
|
|
1090
|
-
const g = `M ${u.x1} ${u.y1} L ${
|
|
1091
|
-
let
|
|
1100
|
+
const g = `M ${u.x1} ${u.y1} L ${b} ${y} L ${u.x2} ${u.y2}`;
|
|
1101
|
+
let x = "";
|
|
1092
1102
|
if (o.bidirectional) {
|
|
1093
1103
|
const S = _(a, f, c, l);
|
|
1094
1104
|
if (!S) return;
|
|
1095
|
-
|
|
1105
|
+
x = `M ${S.x1} ${S.y1} L ${c} ${l} L ${S.x2} ${S.y2}`;
|
|
1096
1106
|
}
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1099
|
-
const
|
|
1107
|
+
const v = He(`M ${c} ${l} C ${a} ${f} ${d} ${p} ${b} ${y}`, g, x, o.style), { x: C, y: T } = Nt(c, l, a, f, d, p, b, y), h = o.style?.labelColor || "rgb(235, 95, 82)", m = "a-" + o.id;
|
|
1108
|
+
v.id = m;
|
|
1109
|
+
const w = t.markdown ? t.markdown(o.label, o) : o.label, E = Q(w, C, T, {
|
|
1100
1110
|
anchor: "middle",
|
|
1101
1111
|
color: h,
|
|
1102
1112
|
dataType: "arrow",
|
|
1103
1113
|
svgId: m
|
|
1104
1114
|
});
|
|
1105
|
-
|
|
1106
|
-
},
|
|
1115
|
+
v.labelEl = E, v.arrowObj = o, v.dataset.linkid = o.id, t.labelContainer.appendChild(E), t.arrowSvg.appendChild(v), U(E), s || (t.arrows.push(o), t.currentArrow = v, It(t, o, i, r));
|
|
1116
|
+
}, Je = function(t, e, n = {}) {
|
|
1107
1117
|
const o = {
|
|
1108
|
-
id:
|
|
1118
|
+
id: X(),
|
|
1109
1119
|
label: "Custom Link",
|
|
1110
1120
|
from: t.nodeObj.id,
|
|
1111
1121
|
to: e.nodeObj.id,
|
|
1112
1122
|
...n
|
|
1113
1123
|
};
|
|
1114
|
-
|
|
1124
|
+
rt(this, t, e, o), this.bus.fire("operation", {
|
|
1115
1125
|
name: "createArrow",
|
|
1116
1126
|
obj: o
|
|
1117
1127
|
});
|
|
1118
|
-
},
|
|
1128
|
+
}, Ze = function(t) {
|
|
1119
1129
|
K(this);
|
|
1120
|
-
const e = { ...t, id:
|
|
1121
|
-
|
|
1130
|
+
const e = { ...t, id: X() };
|
|
1131
|
+
rt(this, this.findEle(e.from), this.findEle(e.to), e), this.bus.fire("operation", {
|
|
1122
1132
|
name: "createArrow",
|
|
1123
1133
|
obj: e
|
|
1124
1134
|
});
|
|
1125
|
-
},
|
|
1135
|
+
}, Qe = function(t) {
|
|
1126
1136
|
let e;
|
|
1127
1137
|
if (t ? e = t : e = this.currentArrow, !e) return;
|
|
1128
1138
|
K(this);
|
|
@@ -1133,11 +1143,11 @@ const Ue = function(t, e, n) {
|
|
|
1133
1143
|
id: n
|
|
1134
1144
|
}
|
|
1135
1145
|
});
|
|
1136
|
-
},
|
|
1146
|
+
}, tn = function(t) {
|
|
1137
1147
|
this.currentArrow = t;
|
|
1138
|
-
const e = t.arrowObj, n = this.findEle(e.from), o = this.findEle(e.to), s =
|
|
1139
|
-
this.editable ?
|
|
1140
|
-
},
|
|
1148
|
+
const e = t.arrowObj, n = this.findEle(e.from), o = this.findEle(e.to), s = Y(this, n, e.delta1), i = Y(this, o, e.delta2);
|
|
1149
|
+
this.editable ? It(this, e, s, i) : Ht(t, At), this.bus.fire("selectArrow", e);
|
|
1150
|
+
}, en = function() {
|
|
1141
1151
|
K(this), this.currentArrow = null, this.bus.fire("unselectArrow");
|
|
1142
1152
|
}, Z = function(t, e) {
|
|
1143
1153
|
const n = document.createElementNS(k, "path");
|
|
@@ -1149,7 +1159,7 @@ const Ue = function(t, e, n) {
|
|
|
1149
1159
|
"stroke-linecap": "round",
|
|
1150
1160
|
"stroke-linejoin": "round"
|
|
1151
1161
|
}), n;
|
|
1152
|
-
},
|
|
1162
|
+
}, Ht = function(t, e) {
|
|
1153
1163
|
const n = document.createElementNS(k, "g");
|
|
1154
1164
|
n.setAttribute("class", "arrow-highlight"), n.setAttribute("opacity", "0.45");
|
|
1155
1165
|
const o = Z(t.line.getAttribute("d"), e);
|
|
@@ -1160,59 +1170,84 @@ const Ue = function(t, e, n) {
|
|
|
1160
1170
|
n.appendChild(i);
|
|
1161
1171
|
}
|
|
1162
1172
|
t.insertBefore(n, t.firstChild);
|
|
1163
|
-
},
|
|
1173
|
+
}, nn = function(t) {
|
|
1164
1174
|
const e = t.querySelector(".arrow-highlight");
|
|
1165
1175
|
e && e.remove();
|
|
1166
|
-
},
|
|
1176
|
+
}, on = function(t) {
|
|
1167
1177
|
const e = t.querySelector(".arrow-highlight");
|
|
1168
1178
|
if (!e) return;
|
|
1169
1179
|
const n = e.querySelectorAll("path");
|
|
1170
1180
|
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"));
|
|
1171
1181
|
}, K = function(t) {
|
|
1172
|
-
t.helper1?.destroy(), t.helper2?.destroy(), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none", t.currentArrow &&
|
|
1173
|
-
},
|
|
1182
|
+
t.helper1?.destroy(), t.helper2?.destroy(), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none", t.currentArrow && nn(t.currentArrow);
|
|
1183
|
+
}, It = function(t, e, n, o) {
|
|
1174
1184
|
const { linkController: s, P2: i, P3: r, line1: c, line2: l, nodes: a, map: f, currentArrow: d, bus: p } = t;
|
|
1175
1185
|
if (!d) return;
|
|
1176
|
-
s.style.display = "initial", i.style.display = "initial", r.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(r),
|
|
1177
|
-
let { x:
|
|
1178
|
-
i.style.cssText = `top:${g}px;left:${u}px;`, r.style.cssText = `top:${
|
|
1186
|
+
s.style.display = "initial", i.style.display = "initial", r.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(r), Ht(d, At);
|
|
1187
|
+
let { x: b, y } = H(n), { ctrlX: u, ctrlY: g } = n, { ctrlX: x, ctrlY: v } = o, { x: C, y: T } = H(o);
|
|
1188
|
+
i.style.cssText = `top:${g}px;left:${u}px;`, r.style.cssText = `top:${v}px;left:${x}px;`, O(c, b, y, u, g), O(l, x, v, C, T), t.helper1 = mt.create(i), t.helper2 = mt.create(r), t.helper1.init(f, (h, m) => {
|
|
1179
1189
|
u = u + h / t.scaleVal, g = g + m / t.scaleVal;
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1190
|
+
const w = H({ ...n, ctrlX: u, ctrlY: g });
|
|
1191
|
+
b = w.x, y = w.y, i.style.top = g + "px", i.style.left = u + "px", tt(d, b, y, u, g, x, v, C, T, e), O(c, b, y, u, g), e.delta1.x = Math.round(u - n.cx), e.delta1.y = Math.round(g - n.cy), p.fire("updateArrowDelta", e);
|
|
1182
1192
|
}), t.helper2.init(f, (h, m) => {
|
|
1183
|
-
|
|
1184
|
-
const
|
|
1185
|
-
C =
|
|
1193
|
+
x = x + h / t.scaleVal, v = v + m / t.scaleVal;
|
|
1194
|
+
const w = H({ ...o, ctrlX: x, ctrlY: v });
|
|
1195
|
+
C = w.x, T = w.y, r.style.top = v + "px", r.style.left = x + "px", tt(d, b, y, u, g, x, v, C, T, e), O(l, x, v, C, T), e.delta2.x = Math.round(x - o.cx), e.delta2.y = Math.round(v - o.cy), p.fire("updateArrowDelta", e);
|
|
1186
1196
|
});
|
|
1187
1197
|
};
|
|
1188
|
-
function
|
|
1198
|
+
function sn() {
|
|
1189
1199
|
this.arrowSvg.innerHTML = "", this.labelContainer.querySelectorAll('.svg-label[data-type="arrow"]').forEach((e) => e.remove());
|
|
1190
1200
|
for (let e = 0; e < this.arrows.length; e++) {
|
|
1191
1201
|
const n = this.arrows[e];
|
|
1192
1202
|
try {
|
|
1193
|
-
|
|
1203
|
+
rt(this, this.findEle(n.from), this.findEle(n.to), n, !0);
|
|
1194
1204
|
} catch {
|
|
1195
1205
|
}
|
|
1196
1206
|
}
|
|
1197
1207
|
this.nodes.appendChild(this.arrowSvg);
|
|
1198
1208
|
}
|
|
1199
|
-
function
|
|
1209
|
+
function rn(t) {
|
|
1200
1210
|
K(this), t && t.labelEl && Lt(this, t.labelEl, t.arrowObj);
|
|
1201
1211
|
}
|
|
1202
|
-
function
|
|
1203
|
-
this.arrows = this.arrows.filter((t) =>
|
|
1212
|
+
function cn() {
|
|
1213
|
+
this.arrows = this.arrows.filter((t) => j(t.from, this.nodeData) && j(t.to, this.nodeData));
|
|
1204
1214
|
}
|
|
1205
|
-
const
|
|
1215
|
+
const ln = function(t, e) {
|
|
1216
|
+
const n = Yt(t);
|
|
1217
|
+
n.style && e.style && (e.style = Object.assign({}, n.style, e.style)), Object.assign(t, e);
|
|
1218
|
+
const o = this.arrowSvg.querySelector(`g[data-linkid="${t.id}"]`);
|
|
1219
|
+
if (o) {
|
|
1220
|
+
if (e.label !== void 0 && o.labelEl) {
|
|
1221
|
+
const r = this.markdown ? this.markdown(t.label, t) : t.label;
|
|
1222
|
+
o.labelEl.innerHTML = r;
|
|
1223
|
+
}
|
|
1224
|
+
const s = this.findEle(t.from), i = this.findEle(t.to);
|
|
1225
|
+
if (s && i) {
|
|
1226
|
+
if (!t.delta1 || !t.delta2) {
|
|
1227
|
+
const g = $t(this, s, i);
|
|
1228
|
+
t.delta1 = t.delta1 || g.delta1, t.delta2 = t.delta2 || g.delta2;
|
|
1229
|
+
}
|
|
1230
|
+
const r = Y(this, s, t.delta1), c = Y(this, i, t.delta2), { x: l, y: a } = H(r), { ctrlX: f, ctrlY: d } = r, { ctrlX: p, ctrlY: b } = c, { x: y, y: u } = H(c);
|
|
1231
|
+
tt(o, l, a, f, d, p, b, y, u, t), this.currentArrow?.arrowObj?.id === t.id && (this.P2.style.cssText = `top:${d}px;left:${f}px;`, this.P3.style.cssText = `top:${b}px;left:${p}px;`, O(this.line1, l, a, f, d), O(this.line2, p, b, y, u));
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
this.bus.fire("operation", {
|
|
1235
|
+
name: "reshapeArrow",
|
|
1236
|
+
obj: t,
|
|
1237
|
+
origin: n
|
|
1238
|
+
});
|
|
1239
|
+
}, an = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1206
1240
|
__proto__: null,
|
|
1207
|
-
createArrow:
|
|
1208
|
-
createArrowFrom:
|
|
1209
|
-
editArrowLabel:
|
|
1210
|
-
removeArrow:
|
|
1211
|
-
renderArrow:
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1241
|
+
createArrow: Je,
|
|
1242
|
+
createArrowFrom: Ze,
|
|
1243
|
+
editArrowLabel: rn,
|
|
1244
|
+
removeArrow: Qe,
|
|
1245
|
+
renderArrow: sn,
|
|
1246
|
+
reshapeArrow: ln,
|
|
1247
|
+
selectArrow: tn,
|
|
1248
|
+
tidyArrow: cn,
|
|
1249
|
+
unselectArrow: en
|
|
1250
|
+
}, Symbol.toStringTag, { value: "Module" })), hn = function(t) {
|
|
1216
1251
|
if (t.length === 0) throw new Error("No selected node.");
|
|
1217
1252
|
if (t.length === 1) {
|
|
1218
1253
|
const l = t[0].nodeObj, a = t[0].nodeObj.parent;
|
|
@@ -1229,8 +1264,8 @@ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1229
1264
|
let a = l.nodeObj;
|
|
1230
1265
|
const f = [];
|
|
1231
1266
|
for (; a.parent; ) {
|
|
1232
|
-
const d = a.parent,
|
|
1233
|
-
a = d, f.unshift({ node: a, index:
|
|
1267
|
+
const d = a.parent, b = d.children?.indexOf(a);
|
|
1268
|
+
a = d, f.unshift({ node: a, index: b });
|
|
1234
1269
|
}
|
|
1235
1270
|
return f.length > e && (e = f.length), f;
|
|
1236
1271
|
});
|
|
@@ -1249,7 +1284,7 @@ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1249
1284
|
start: i,
|
|
1250
1285
|
end: r
|
|
1251
1286
|
};
|
|
1252
|
-
},
|
|
1287
|
+
}, dn = function(t) {
|
|
1253
1288
|
const e = document.createElementNS(k, "g");
|
|
1254
1289
|
return e.setAttribute("id", t), e;
|
|
1255
1290
|
}, yt = function(t, e) {
|
|
@@ -1261,69 +1296,69 @@ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1261
1296
|
"stroke-linecap": "round",
|
|
1262
1297
|
"stroke-width": "2"
|
|
1263
1298
|
}), n;
|
|
1264
|
-
},
|
|
1299
|
+
}, fn = (t) => t.parentElement.parentElement, un = function(t, { parent: e, start: n }) {
|
|
1265
1300
|
const o = t.findEle(e), s = o.nodeObj;
|
|
1266
1301
|
let i;
|
|
1267
1302
|
return s.parent ? i = o.closest("me-main").className : i = t.findEle(s.children[n].id).closest("me-main").className, i;
|
|
1268
|
-
},
|
|
1269
|
-
const { id: n, label: o, parent: s, start: i, end: r, style: c } = e, { nodes: l, theme: a, summarySvg: f } = t, p = t.findEle(s).nodeObj,
|
|
1270
|
-
let y = 1 / 0, u = 0, g = 0,
|
|
1271
|
-
for (let
|
|
1272
|
-
const
|
|
1273
|
-
if (!
|
|
1303
|
+
}, ct = function(t, e) {
|
|
1304
|
+
const { id: n, label: o, parent: s, start: i, end: r, style: c } = e, { nodes: l, theme: a, summarySvg: f } = t, p = t.findEle(s).nodeObj, b = un(t, e);
|
|
1305
|
+
let y = 1 / 0, u = 0, g = 0, x = 0;
|
|
1306
|
+
for (let W = i; W <= r; W++) {
|
|
1307
|
+
const lt = p.children?.[W];
|
|
1308
|
+
if (!lt)
|
|
1274
1309
|
return t.removeSummary(n), null;
|
|
1275
|
-
const
|
|
1276
|
-
|
|
1310
|
+
const V = fn(t.findEle(lt.id)), { offsetLeft: z, offsetTop: at } = P(l, V), ht = i === r ? 10 : 20;
|
|
1311
|
+
W === i && (g = at + ht), W === r && (x = at + V.offsetHeight - ht), z < y && (y = z), V.offsetWidth + z > u && (u = V.offsetWidth + z);
|
|
1277
1312
|
}
|
|
1278
|
-
let
|
|
1279
|
-
const T = p.parent ? 10 : 0, h = g + T, m =
|
|
1280
|
-
|
|
1281
|
-
const $ =
|
|
1282
|
-
return $.appendChild(
|
|
1283
|
-
},
|
|
1313
|
+
let v, C;
|
|
1314
|
+
const T = p.parent ? 10 : 0, h = g + T, m = x + T, w = (h + m) / 2, E = c?.stroke || a.cssVar["--color"], S = c?.labelColor || a.cssVar["--color"], M = "s-" + n, A = t.markdown ? t.markdown(o, e) : o;
|
|
1315
|
+
b === B.LHS ? (v = yt(`M ${y + 10} ${h} c -5 0 -10 5 -10 10 L ${y} ${m - 10} c 0 5 5 10 10 10 M ${y} ${w} h -10`, E), C = Q(A, y - 20, w, { anchor: "end", color: S, dataType: "summary", svgId: M })) : (v = yt(`M ${u - 10} ${h} c 5 0 10 5 10 10 L ${u} ${m - 10} c 0 5 -5 10 -10 10 M ${u} ${w} h 10`, E), C = Q(A, u + 20, w, { anchor: "start", color: S, dataType: "summary", svgId: M }));
|
|
1316
|
+
const $ = dn(M);
|
|
1317
|
+
return $.appendChild(v), t.labelContainer.appendChild(C), U(C), $.summaryObj = e, $.labelEl = C, f.appendChild($), $;
|
|
1318
|
+
}, pn = function(t = {}) {
|
|
1284
1319
|
if (!this.currentNodes) return;
|
|
1285
|
-
const { currentNodes: e, summaries: n, bus: o } = this, { parent: s, start: i, end: r } =
|
|
1320
|
+
const { currentNodes: e, summaries: n, bus: o } = this, { parent: s, start: i, end: r } = hn(e), c = { id: X(), parent: s, start: i, end: r, label: "summary", style: t.style }, l = ct(this, c);
|
|
1286
1321
|
n.push(c), this.editSummary(l), o.fire("operation", {
|
|
1287
1322
|
name: "createSummary",
|
|
1288
1323
|
obj: c
|
|
1289
1324
|
});
|
|
1290
|
-
},
|
|
1291
|
-
const e =
|
|
1292
|
-
|
|
1325
|
+
}, gn = function(t) {
|
|
1326
|
+
const e = X(), n = { ...t, id: e };
|
|
1327
|
+
ct(this, n), this.summaries.push(n), this.bus.fire("operation", {
|
|
1293
1328
|
name: "createSummary",
|
|
1294
1329
|
obj: n
|
|
1295
1330
|
});
|
|
1296
|
-
},
|
|
1331
|
+
}, mn = function(t) {
|
|
1297
1332
|
const e = this.summaries.findIndex((n) => n.id === t);
|
|
1298
1333
|
e > -1 && (this.summaries.splice(e, 1), this.nodes.querySelector("#s-" + t)?.remove(), this.nodes.querySelector("#label-s-" + t)?.remove()), this.bus.fire("operation", {
|
|
1299
1334
|
name: "removeSummary",
|
|
1300
1335
|
obj: { id: t }
|
|
1301
1336
|
});
|
|
1302
|
-
},
|
|
1337
|
+
}, yn = function(t) {
|
|
1303
1338
|
const e = t.labelEl;
|
|
1304
1339
|
e && e.classList.add("selected"), this.currentSummary = t, this.bus.fire("selectSummary", t.summaryObj);
|
|
1305
|
-
},
|
|
1340
|
+
}, bn = function() {
|
|
1306
1341
|
this.currentSummary?.labelEl?.classList.remove("selected"), this.currentSummary = null, this.bus.fire("unselectSummary");
|
|
1307
|
-
},
|
|
1342
|
+
}, vn = function() {
|
|
1308
1343
|
this.summarySvg.innerHTML = "", this.summaries.forEach((t) => {
|
|
1309
1344
|
try {
|
|
1310
|
-
|
|
1345
|
+
ct(this, t);
|
|
1311
1346
|
} catch {
|
|
1312
1347
|
}
|
|
1313
1348
|
}), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
|
|
1314
|
-
},
|
|
1349
|
+
}, xn = function(t) {
|
|
1315
1350
|
t && t.labelEl && Lt(this, t.labelEl, t.summaryObj);
|
|
1316
|
-
},
|
|
1351
|
+
}, wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1317
1352
|
__proto__: null,
|
|
1318
|
-
createSummary:
|
|
1319
|
-
createSummaryFrom:
|
|
1320
|
-
editSummary:
|
|
1321
|
-
removeSummary:
|
|
1322
|
-
renderSummary:
|
|
1323
|
-
selectSummary:
|
|
1324
|
-
unselectSummary:
|
|
1353
|
+
createSummary: pn,
|
|
1354
|
+
createSummaryFrom: gn,
|
|
1355
|
+
editSummary: xn,
|
|
1356
|
+
removeSummary: mn,
|
|
1357
|
+
renderSummary: vn,
|
|
1358
|
+
selectSummary: yn,
|
|
1359
|
+
unselectSummary: bn
|
|
1325
1360
|
}, Symbol.toStringTag, { value: "Module" })), L = "http://www.w3.org/2000/svg";
|
|
1326
|
-
function
|
|
1361
|
+
function Cn(t, e) {
|
|
1327
1362
|
const n = document.createElementNS(L, "svg");
|
|
1328
1363
|
return D(n, {
|
|
1329
1364
|
version: "1.1",
|
|
@@ -1332,10 +1367,10 @@ function vn(t, e) {
|
|
|
1332
1367
|
width: e
|
|
1333
1368
|
}), n;
|
|
1334
1369
|
}
|
|
1335
|
-
function
|
|
1370
|
+
function Sn(t, e) {
|
|
1336
1371
|
return (parseInt(t) - parseInt(e)) / 2;
|
|
1337
1372
|
}
|
|
1338
|
-
function
|
|
1373
|
+
function En(t, e, n, o) {
|
|
1339
1374
|
const s = document.createElementNS(L, "g");
|
|
1340
1375
|
let i = "";
|
|
1341
1376
|
return t.text ? i = t.text.textContent : i = t.childNodes[0].textContent, i.split(`
|
|
@@ -1343,7 +1378,7 @@ function Cn(t, e, n, o) {
|
|
|
1343
1378
|
const a = document.createElementNS(L, "text");
|
|
1344
1379
|
D(a, {
|
|
1345
1380
|
x: n + parseInt(e.paddingLeft) + "",
|
|
1346
|
-
y: o + parseInt(e.paddingTop) +
|
|
1381
|
+
y: o + parseInt(e.paddingTop) + Sn(e.lineHeight, e.fontSize) * (l + 1) + parseFloat(e.fontSize) * (l + 1) + "",
|
|
1347
1382
|
"text-anchor": "start",
|
|
1348
1383
|
"font-family": e.fontFamily,
|
|
1349
1384
|
"font-size": `${e.fontSize}`,
|
|
@@ -1352,7 +1387,7 @@ function Cn(t, e, n, o) {
|
|
|
1352
1387
|
}), a.innerHTML = c, s.appendChild(a);
|
|
1353
1388
|
}), s;
|
|
1354
1389
|
}
|
|
1355
|
-
function
|
|
1390
|
+
function Tn(t, e, n, o) {
|
|
1356
1391
|
let s = "";
|
|
1357
1392
|
t.nodeObj?.dangerouslySetInnerHTML ? s = t.nodeObj.dangerouslySetInnerHTML : t.text ? s = t.text.textContent : s = t.childNodes[0].textContent;
|
|
1358
1393
|
const i = document.createElementNS(L, "foreignObject");
|
|
@@ -1368,7 +1403,7 @@ function Sn(t, e, n, o) {
|
|
|
1368
1403
|
style: `font-family: ${e.fontFamily}; font-size: ${e.fontSize}; font-weight: ${e.fontWeight}; color: ${e.color}; white-space: pre-wrap;`
|
|
1369
1404
|
}), r.innerHTML = s, i.appendChild(r), i;
|
|
1370
1405
|
}
|
|
1371
|
-
function
|
|
1406
|
+
function Dn(t, e) {
|
|
1372
1407
|
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = P(t.nodes, e), i = document.createElementNS(L, "rect");
|
|
1373
1408
|
return D(i, {
|
|
1374
1409
|
x: o + "",
|
|
@@ -1382,7 +1417,7 @@ function En(t, e) {
|
|
|
1382
1417
|
"stroke-width": n.borderWidth
|
|
1383
1418
|
}), i;
|
|
1384
1419
|
}
|
|
1385
|
-
function
|
|
1420
|
+
function F(t, e, n = !1) {
|
|
1386
1421
|
const o = getComputedStyle(e), { offsetLeft: s, offsetTop: i } = P(t.nodes, e), r = document.createElementNS(L, "rect");
|
|
1387
1422
|
D(r, {
|
|
1388
1423
|
x: s + "",
|
|
@@ -1398,9 +1433,9 @@ function z(t, e, n = !1) {
|
|
|
1398
1433
|
const c = document.createElementNS(L, "g");
|
|
1399
1434
|
c.appendChild(r);
|
|
1400
1435
|
let l;
|
|
1401
|
-
return n ? l =
|
|
1436
|
+
return n ? l = Tn(e, o, s, i) : l = En(e, o, s, i), c.appendChild(l), c;
|
|
1402
1437
|
}
|
|
1403
|
-
function
|
|
1438
|
+
function Ln(t, e) {
|
|
1404
1439
|
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = P(t.nodes, e), i = document.createElementNS(L, "a"), r = document.createElementNS(L, "text");
|
|
1405
1440
|
return D(r, {
|
|
1406
1441
|
x: o + "",
|
|
@@ -1412,7 +1447,7 @@ function Tn(t, e) {
|
|
|
1412
1447
|
fill: `${n.color}`
|
|
1413
1448
|
}), r.innerHTML = e.textContent, i.appendChild(r), i.setAttribute("href", e.href), i;
|
|
1414
1449
|
}
|
|
1415
|
-
function
|
|
1450
|
+
function Mn(t, e) {
|
|
1416
1451
|
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = P(t.nodes, e), i = document.createElementNS(L, "image");
|
|
1417
1452
|
return D(i, {
|
|
1418
1453
|
x: o + "",
|
|
@@ -1422,8 +1457,8 @@ function Dn(t, e) {
|
|
|
1422
1457
|
href: e.src
|
|
1423
1458
|
}), i;
|
|
1424
1459
|
}
|
|
1425
|
-
const
|
|
1426
|
-
const n = t.nodes, o = n.offsetHeight +
|
|
1460
|
+
const G = 100, Pn = '<?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">', kn = (t, e = !1) => {
|
|
1461
|
+
const n = t.nodes, o = n.offsetHeight + G * 2, s = n.offsetWidth + G * 2, i = Cn(o + "px", s + "px"), r = document.createElementNS(L, "svg"), c = document.createElementNS(L, "rect");
|
|
1427
1462
|
D(c, {
|
|
1428
1463
|
x: "0",
|
|
1429
1464
|
y: "0",
|
|
@@ -1431,8 +1466,8 @@ const F = 100, Ln = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "
|
|
|
1431
1466
|
height: `${o}`,
|
|
1432
1467
|
fill: t.theme.cssVar["--bgcolor"]
|
|
1433
1468
|
}), i.appendChild(c), n.querySelectorAll(".subLines").forEach((d) => {
|
|
1434
|
-
const p = d.cloneNode(!0), { offsetLeft:
|
|
1435
|
-
p.setAttribute("x", `${
|
|
1469
|
+
const p = d.cloneNode(!0), { offsetLeft: b, offsetTop: y } = P(n, d.parentElement);
|
|
1470
|
+
p.setAttribute("x", `${b}`), p.setAttribute("y", `${y}`), r.appendChild(p);
|
|
1436
1471
|
});
|
|
1437
1472
|
const l = n.querySelector(".lines")?.cloneNode(!0);
|
|
1438
1473
|
l && r.appendChild(l);
|
|
@@ -1440,22 +1475,22 @@ const F = 100, Ln = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "
|
|
|
1440
1475
|
a && r.appendChild(a);
|
|
1441
1476
|
const f = n.querySelector(".summary")?.cloneNode(!0);
|
|
1442
1477
|
return f && r.appendChild(f), n.querySelectorAll("me-tpc").forEach((d) => {
|
|
1443
|
-
d.nodeObj.dangerouslySetInnerHTML ? r.appendChild(
|
|
1478
|
+
d.nodeObj.dangerouslySetInnerHTML ? r.appendChild(F(t, d, !e)) : (r.appendChild(Dn(t, d)), r.appendChild(F(t, d.text, !e)));
|
|
1444
1479
|
}), n.querySelectorAll(".tags > span").forEach((d) => {
|
|
1445
|
-
r.appendChild(
|
|
1480
|
+
r.appendChild(F(t, d));
|
|
1446
1481
|
}), n.querySelectorAll(".icons > span").forEach((d) => {
|
|
1447
|
-
r.appendChild(
|
|
1482
|
+
r.appendChild(F(t, d));
|
|
1448
1483
|
}), n.querySelectorAll(".hyper-link").forEach((d) => {
|
|
1449
|
-
r.appendChild(
|
|
1484
|
+
r.appendChild(Ln(t, d));
|
|
1450
1485
|
}), n.querySelectorAll("img").forEach((d) => {
|
|
1451
|
-
r.appendChild(
|
|
1486
|
+
r.appendChild(Mn(t, d));
|
|
1452
1487
|
}), D(r, {
|
|
1453
|
-
x:
|
|
1454
|
-
y:
|
|
1488
|
+
x: G + "",
|
|
1489
|
+
y: G + "",
|
|
1455
1490
|
overflow: "visible"
|
|
1456
1491
|
}), i.appendChild(r), i;
|
|
1457
|
-
},
|
|
1458
|
-
function
|
|
1492
|
+
}, An = (t, e) => (e && t.insertAdjacentHTML("afterbegin", "<style>" + e + "</style>"), Pn + t.outerHTML);
|
|
1493
|
+
function Nn(t) {
|
|
1459
1494
|
return new Promise((e, n) => {
|
|
1460
1495
|
const o = new FileReader();
|
|
1461
1496
|
o.onload = (s) => {
|
|
@@ -1465,11 +1500,11 @@ function kn(t) {
|
|
|
1465
1500
|
}, o.readAsDataURL(t);
|
|
1466
1501
|
});
|
|
1467
1502
|
}
|
|
1468
|
-
const
|
|
1469
|
-
const n =
|
|
1503
|
+
const $n = function(t = !1, e) {
|
|
1504
|
+
const n = kn(this, t), o = An(n, e);
|
|
1470
1505
|
return new Blob([o], { type: "image/svg+xml" });
|
|
1471
|
-
},
|
|
1472
|
-
const n = this.exportSvg(t, e), o = await
|
|
1506
|
+
}, Hn = async function(t = !1, e) {
|
|
1507
|
+
const n = this.exportSvg(t, e), o = await Nn(n);
|
|
1473
1508
|
return new Promise((s, i) => {
|
|
1474
1509
|
const r = new Image();
|
|
1475
1510
|
r.setAttribute("crossOrigin", "anonymous"), r.onload = () => {
|
|
@@ -1477,31 +1512,31 @@ const Nn = function(t = !1, e) {
|
|
|
1477
1512
|
c.width = r.width, c.height = r.height, c.getContext("2d").drawImage(r, 0, 0), c.toBlob(s, "image/png", 1);
|
|
1478
1513
|
}, r.src = o, r.onerror = i;
|
|
1479
1514
|
});
|
|
1480
|
-
},
|
|
1515
|
+
}, In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1481
1516
|
__proto__: null,
|
|
1482
|
-
exportPng:
|
|
1483
|
-
exportSvg:
|
|
1484
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1485
|
-
getObjById:
|
|
1486
|
-
generateNewObj:
|
|
1487
|
-
layout:
|
|
1488
|
-
linkDiv:
|
|
1489
|
-
editTopic:
|
|
1490
|
-
createWrapper:
|
|
1491
|
-
createParent:
|
|
1492
|
-
createChildren:
|
|
1493
|
-
createTopic:
|
|
1517
|
+
exportPng: Hn,
|
|
1518
|
+
exportSvg: $n
|
|
1519
|
+
}, Symbol.toStringTag, { value: "Module" })), On = {}, Bn = {
|
|
1520
|
+
getObjById: j,
|
|
1521
|
+
generateNewObj: Bt,
|
|
1522
|
+
layout: jt,
|
|
1523
|
+
linkDiv: Ie,
|
|
1524
|
+
editTopic: Qt,
|
|
1525
|
+
createWrapper: Ut,
|
|
1526
|
+
createParent: Kt,
|
|
1527
|
+
createChildren: Jt,
|
|
1528
|
+
createTopic: Zt,
|
|
1494
1529
|
findEle: Ct,
|
|
1495
|
-
changeTheme:
|
|
1496
|
-
changeCompact:
|
|
1497
|
-
...
|
|
1498
|
-
...
|
|
1499
|
-
...
|
|
1500
|
-
...
|
|
1501
|
-
|
|
1530
|
+
changeTheme: _e,
|
|
1531
|
+
changeCompact: qe,
|
|
1532
|
+
...Te,
|
|
1533
|
+
...On,
|
|
1534
|
+
...an,
|
|
1535
|
+
...wn,
|
|
1536
|
+
...In,
|
|
1502
1537
|
init(t) {
|
|
1503
1538
|
if (t = JSON.parse(JSON.stringify(t)), !t || !t.nodeData) return new Error("MindElixir: `data` is required");
|
|
1504
|
-
t.direction !== void 0 && (this.direction = t.direction), t.compact !== void 0 && (this.compact = t.compact), this.changeTheme(t.theme || this.theme, !1), t.meta && (this.meta = t.meta), this.nodeData = t.nodeData,
|
|
1539
|
+
t.direction !== void 0 && (this.direction = t.direction), t.compact !== void 0 && (this.compact = t.compact), this.changeTheme(t.theme || this.theme, !1), t.meta && (this.meta = t.meta), this.nodeData = t.nodeData, ot(this.nodeData), this.arrows = t.arrows || [], this.summaries = t.summaries || [], this.tidyArrow(), this.toolBar && je(this), this.layout(), this.linkDiv(), this.toCenter();
|
|
1505
1540
|
},
|
|
1506
1541
|
destroy() {
|
|
1507
1542
|
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;
|
|
@@ -1513,8 +1548,8 @@ const Nn = function(t = !1, e) {
|
|
|
1513
1548
|
enableMobileMultiSelect(t) {
|
|
1514
1549
|
this.mobileMultiSelect = t;
|
|
1515
1550
|
}
|
|
1516
|
-
},
|
|
1517
|
-
function
|
|
1551
|
+
}, Yn = "5.14.0-beta.0";
|
|
1552
|
+
function Wn(t) {
|
|
1518
1553
|
return {
|
|
1519
1554
|
x: 0,
|
|
1520
1555
|
y: 0,
|
|
@@ -1541,7 +1576,7 @@ function Bn(t) {
|
|
|
1541
1576
|
}
|
|
1542
1577
|
};
|
|
1543
1578
|
}
|
|
1544
|
-
function
|
|
1579
|
+
function N({
|
|
1545
1580
|
el: t,
|
|
1546
1581
|
direction: e,
|
|
1547
1582
|
editable: n,
|
|
@@ -1555,47 +1590,47 @@ function A({
|
|
|
1555
1590
|
allowUndo: f,
|
|
1556
1591
|
generateMainBranch: d,
|
|
1557
1592
|
generateSubBranch: p,
|
|
1558
|
-
overflowHidden:
|
|
1593
|
+
overflowHidden: b,
|
|
1559
1594
|
compact: y,
|
|
1560
1595
|
theme: u,
|
|
1561
1596
|
alignment: g,
|
|
1562
|
-
scaleSensitivity:
|
|
1563
|
-
scaleMax:
|
|
1597
|
+
scaleSensitivity: x,
|
|
1598
|
+
scaleMax: v,
|
|
1564
1599
|
scaleMin: C,
|
|
1565
1600
|
handleWheel: T,
|
|
1566
1601
|
markdown: h,
|
|
1567
1602
|
imageProxy: m,
|
|
1568
|
-
pasteHandler:
|
|
1603
|
+
pasteHandler: w,
|
|
1569
1604
|
mobileMultiSelect: E
|
|
1570
1605
|
}) {
|
|
1571
1606
|
let S = null;
|
|
1572
1607
|
const M = Object.prototype.toString.call(t);
|
|
1573
1608
|
if (M === "[object HTMLDivElement]" ? S = t : M === "[object String]" && (S = document.querySelector(t)), !S) throw new Error("MindElixir: el is not a valid element");
|
|
1574
|
-
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 = f ?? !0, this.scaleSensitivity =
|
|
1575
|
-
const
|
|
1576
|
-
this.theme = u || (
|
|
1609
|
+
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 = f ?? !0, this.scaleSensitivity = x ?? 0.1, this.scaleMax = v ?? 1.4, this.scaleMin = C ?? 0.2, this.generateMainBranch = d || Pt, this.generateSubBranch = p || kt, this.overflowHidden = b ?? !1, this.compact = y ?? !1, this.alignment = g ?? "root", this.handleWheel = T ?? !0, this.markdown = h || void 0, this.imageProxy = m || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.mobileMultiSelect = E ?? !1, this.panHelper = Wn(this), this.bus = $e(), this.container = document.createElement("div"), this.selectionContainer = c || this.container, this.container.className = "map-container";
|
|
1610
|
+
const A = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1611
|
+
this.theme = u || (A.matches ? nt : et);
|
|
1577
1612
|
const $ = document.createElement("div");
|
|
1578
|
-
$.className = "map-canvas", this.map = $, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines =
|
|
1613
|
+
$.className = "map-canvas", this.map = $, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = R("lines"), this.summarySvg = R("summary"), this.linkController = R("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 = gt(), this.line2 = gt(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.arrowSvg = R("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(Ne(this)), w && (this.pasteHandler = w);
|
|
1579
1614
|
}
|
|
1580
|
-
|
|
1581
|
-
Object.defineProperty(
|
|
1615
|
+
N.prototype = Bn;
|
|
1616
|
+
Object.defineProperty(N.prototype, "currentNode", {
|
|
1582
1617
|
get() {
|
|
1583
1618
|
return this.currentNodes[this.currentNodes.length - 1];
|
|
1584
1619
|
},
|
|
1585
1620
|
enumerable: !0
|
|
1586
1621
|
});
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1622
|
+
N.LEFT = 0;
|
|
1623
|
+
N.RIGHT = 1;
|
|
1624
|
+
N.SIDE = 2;
|
|
1625
|
+
N.THEME = et;
|
|
1626
|
+
N.DARK_THEME = nt;
|
|
1627
|
+
N.version = Yn;
|
|
1628
|
+
N.E = Ct;
|
|
1594
1629
|
export {
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1630
|
+
nt as DARK_THEME,
|
|
1631
|
+
Rn as LEFT,
|
|
1632
|
+
Xn as RIGHT,
|
|
1633
|
+
Vn as SIDE,
|
|
1634
|
+
et as THEME,
|
|
1635
|
+
N as default
|
|
1601
1636
|
};
|