mind-elixir 5.2.1 → 5.3.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/LayoutSsr.iife.js +1 -1
- package/dist/LayoutSsr.js +9 -10
- package/dist/{style.css → MindElixir.css} +1 -1
- package/dist/MindElixir.iife.js +11 -11
- package/dist/MindElixir.js +1018 -1062
- package/dist/MindElixirLite.css +1 -0
- package/dist/MindElixirLite.iife.js +4 -4
- package/dist/MindElixirLite.js +522 -580
- package/dist/example.iife.js +2 -2
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/viselect/src/EventEmitter.d.ts +13 -0
- package/dist/types/viselect/src/index.d.ts +112 -0
- package/dist/types/viselect/src/types.d.ts +85 -0
- package/dist/types/viselect/src/utils/arrayify.d.ts +1 -0
- package/dist/types/viselect/src/utils/browser.d.ts +2 -0
- package/dist/types/viselect/src/utils/css.d.ts +10 -0
- package/dist/types/viselect/src/utils/domRect.d.ts +1 -0
- package/dist/types/viselect/src/utils/events.d.ts +29 -0
- package/dist/types/viselect/src/utils/frames.d.ts +7 -0
- package/dist/types/viselect/src/utils/intersects.d.ts +9 -0
- package/dist/types/viselect/src/utils/matchesTrigger.d.ts +16 -0
- package/dist/types/viselect/src/utils/selectAll.d.ts +8 -0
- package/package.json +24 -21
- package/readme.md +0 -2
package/dist/MindElixirLite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const et = {
|
|
2
2
|
name: "Latte",
|
|
3
3
|
type: "light",
|
|
4
4
|
palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
|
|
@@ -24,7 +24,7 @@ const nt = {
|
|
|
24
24
|
"--panel-border-color": "#eaeaea",
|
|
25
25
|
"--map-padding": "50px"
|
|
26
26
|
}
|
|
27
|
-
},
|
|
27
|
+
}, nt = {
|
|
28
28
|
name: "Dark",
|
|
29
29
|
type: "dark",
|
|
30
30
|
palette: ["#848FA0", "#748BE9", "#D2F9FE", "#4145A5", "#789AFA", "#706CF4", "#EF987F", "#775DD5", "#FCEECF", "#DA7FBC"],
|
|
@@ -51,7 +51,7 @@ const nt = {
|
|
|
51
51
|
"--map-padding": "50px 80px"
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
function
|
|
54
|
+
function Tt(t) {
|
|
55
55
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
56
56
|
}
|
|
57
57
|
const q = function(t, e) {
|
|
@@ -60,63 +60,54 @@ const q = function(t, e) {
|
|
|
60
60
|
if (e.children && e.children.length) {
|
|
61
61
|
for (let n = 0; n < e.children.length; n++) {
|
|
62
62
|
const o = q(t, e.children[n]);
|
|
63
|
-
if (o)
|
|
64
|
-
return o;
|
|
63
|
+
if (o) return o;
|
|
65
64
|
}
|
|
66
65
|
return null;
|
|
67
66
|
} else
|
|
68
67
|
return null;
|
|
69
|
-
},
|
|
68
|
+
}, ot = (t, e) => {
|
|
70
69
|
if (t.parent = e, t.children)
|
|
71
70
|
for (let n = 0; n < t.children.length; n++)
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
t.children.forEach((s) => {
|
|
78
|
-
tt(s, e, o);
|
|
79
|
-
});
|
|
80
|
-
} else
|
|
81
|
-
t.children.forEach((o) => {
|
|
82
|
-
tt(o, !1);
|
|
83
|
-
});
|
|
71
|
+
ot(t.children[n], t);
|
|
72
|
+
}, gt = (t, e, n) => {
|
|
73
|
+
t.expanded = e, t.children && t.children.forEach((o) => {
|
|
74
|
+
gt(o, e);
|
|
75
|
+
});
|
|
84
76
|
};
|
|
85
77
|
function _(t, e, n, o) {
|
|
86
78
|
const s = o - e, i = t - n;
|
|
87
79
|
let r = Math.atan(Math.abs(s) / Math.abs(i)) / 3.14 * 180;
|
|
88
|
-
if (isNaN(r))
|
|
89
|
-
return;
|
|
80
|
+
if (isNaN(r)) return;
|
|
90
81
|
i < 0 && s > 0 && (r = 180 - r), i < 0 && s < 0 && (r = 180 + r), i > 0 && s < 0 && (r = 360 - r);
|
|
91
|
-
const c = 12, a = 30,
|
|
82
|
+
const c = 12, a = 30, h = r + a, f = r - a;
|
|
92
83
|
return {
|
|
93
|
-
x1: n + Math.cos(Math.PI *
|
|
94
|
-
y1: o - Math.sin(Math.PI *
|
|
95
|
-
x2: n + Math.cos(Math.PI *
|
|
96
|
-
y2: o - Math.sin(Math.PI *
|
|
84
|
+
x1: n + Math.cos(Math.PI * h / 180) * c,
|
|
85
|
+
y1: o - Math.sin(Math.PI * h / 180) * c,
|
|
86
|
+
x2: n + Math.cos(Math.PI * f / 180) * c,
|
|
87
|
+
y2: o - Math.sin(Math.PI * f / 180) * c
|
|
97
88
|
};
|
|
98
89
|
}
|
|
99
90
|
function V() {
|
|
100
91
|
return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16);
|
|
101
92
|
}
|
|
102
|
-
const
|
|
93
|
+
const $t = function() {
|
|
103
94
|
const t = V();
|
|
104
95
|
return {
|
|
105
96
|
topic: this.newTopicName,
|
|
106
97
|
id: t
|
|
107
98
|
};
|
|
108
|
-
},
|
|
99
|
+
}, D = (t, e) => {
|
|
109
100
|
let n = 0, o = 0;
|
|
110
101
|
for (; e && e !== t; )
|
|
111
102
|
n += e.offsetLeft, o += e.offsetTop, e = e.offsetParent;
|
|
112
103
|
return { offsetLeft: n, offsetTop: o };
|
|
113
|
-
},
|
|
104
|
+
}, E = (t, e) => {
|
|
114
105
|
for (const n in e)
|
|
115
106
|
t.setAttribute(n, e[n]);
|
|
116
|
-
},
|
|
107
|
+
}, at = (t) => t ? t.tagName === "ME-TPC" : !1, mt = (t) => {
|
|
117
108
|
const e = /translate\(([^,]+),\s*([^)]+)\)/, n = t.match(e);
|
|
118
109
|
return n ? { x: parseFloat(n[1]), y: parseFloat(n[2]) } : { x: 0, y: 0 };
|
|
119
|
-
},
|
|
110
|
+
}, yt = function(t) {
|
|
120
111
|
for (let e = 0; e < t.length; e++) {
|
|
121
112
|
const { dom: n, evt: o, func: s } = t[e];
|
|
122
113
|
n.addEventListener(o, s);
|
|
@@ -127,10 +118,10 @@ const Dt = function() {
|
|
|
127
118
|
o.removeEventListener(s, i);
|
|
128
119
|
}
|
|
129
120
|
};
|
|
130
|
-
},
|
|
121
|
+
}, I = {
|
|
131
122
|
LHS: "lhs",
|
|
132
123
|
RHS: "rhs"
|
|
133
|
-
},
|
|
124
|
+
}, ht = function(t, e, n) {
|
|
134
125
|
const { scaleVal: o, scaleSensitivity: s } = t;
|
|
135
126
|
switch (e) {
|
|
136
127
|
case "in":
|
|
@@ -140,19 +131,17 @@ const Dt = function() {
|
|
|
140
131
|
t.scale(o - s, n);
|
|
141
132
|
}
|
|
142
133
|
};
|
|
143
|
-
function
|
|
134
|
+
function Dt(t) {
|
|
144
135
|
const { dragMoveHelper: e } = t;
|
|
145
136
|
let n = 0;
|
|
146
137
|
t.spacePressed = !1;
|
|
147
138
|
const o = (l) => {
|
|
148
|
-
|
|
149
|
-
if (
|
|
150
|
-
return;
|
|
151
|
-
if ((b = t.helper1) != null && b.moved) {
|
|
139
|
+
if (l.button !== 0) return;
|
|
140
|
+
if (t.helper1?.moved) {
|
|
152
141
|
t.helper1.clear();
|
|
153
142
|
return;
|
|
154
143
|
}
|
|
155
|
-
if (
|
|
144
|
+
if (t.helper2?.moved) {
|
|
156
145
|
t.helper2.clear();
|
|
157
146
|
return;
|
|
158
147
|
}
|
|
@@ -160,124 +149,119 @@ function At(t) {
|
|
|
160
149
|
e.clear();
|
|
161
150
|
return;
|
|
162
151
|
}
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
165
|
-
l.ctrlKey || l.metaKey ? t.expandNodeAll(
|
|
166
|
-
else if (
|
|
167
|
-
t.selectNode(
|
|
152
|
+
const d = l.target;
|
|
153
|
+
if (d.tagName === "ME-EPD")
|
|
154
|
+
l.ctrlKey || l.metaKey ? t.expandNodeAll(d.previousSibling) : t.expandNode(d.previousSibling);
|
|
155
|
+
else if (d.tagName === "ME-TPC" && t.currentNodes.length > 1)
|
|
156
|
+
t.selectNode(d);
|
|
168
157
|
else if (!t.editable)
|
|
169
158
|
return;
|
|
170
|
-
if (
|
|
171
|
-
const
|
|
172
|
-
if (
|
|
173
|
-
if (
|
|
174
|
-
t.selectArrow(
|
|
159
|
+
if (d.classList.contains("svg-label")) {
|
|
160
|
+
const b = d.dataset.svgId, x = d.dataset.type, C = document.getElementById(b);
|
|
161
|
+
if (C) {
|
|
162
|
+
if (x === "arrow") {
|
|
163
|
+
t.selectArrow(C);
|
|
175
164
|
return;
|
|
176
|
-
} else if (
|
|
177
|
-
t.selectSummary(
|
|
165
|
+
} else if (x === "summary") {
|
|
166
|
+
t.selectSummary(C);
|
|
178
167
|
return;
|
|
179
168
|
}
|
|
180
169
|
}
|
|
181
170
|
}
|
|
182
|
-
if (
|
|
183
|
-
const
|
|
184
|
-
if (
|
|
185
|
-
t.selectArrow(
|
|
171
|
+
if (d.closest(".topiclinks")) {
|
|
172
|
+
const b = d.closest("g");
|
|
173
|
+
if (b) {
|
|
174
|
+
t.selectArrow(b);
|
|
186
175
|
return;
|
|
187
176
|
}
|
|
188
177
|
}
|
|
189
|
-
if (
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
t.selectSummary(
|
|
178
|
+
if (d.closest(".summary")) {
|
|
179
|
+
const b = d.closest("g");
|
|
180
|
+
if (b) {
|
|
181
|
+
t.selectSummary(b);
|
|
193
182
|
return;
|
|
194
183
|
}
|
|
195
184
|
}
|
|
196
185
|
}, s = (l) => {
|
|
197
|
-
if (!t.editable)
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
t.editArrowLabel(x);
|
|
186
|
+
if (!t.editable) return;
|
|
187
|
+
const d = l.target;
|
|
188
|
+
if (at(d) && t.beginEdit(d), d.classList.contains("svg-label")) {
|
|
189
|
+
const b = d.dataset.svgId, x = d.dataset.type, C = document.getElementById(b);
|
|
190
|
+
if (C) {
|
|
191
|
+
if (x === "arrow") {
|
|
192
|
+
t.editArrowLabel(C);
|
|
205
193
|
return;
|
|
206
|
-
} else if (
|
|
207
|
-
t.editSummary(
|
|
194
|
+
} else if (x === "summary") {
|
|
195
|
+
t.editSummary(C);
|
|
208
196
|
return;
|
|
209
197
|
}
|
|
210
198
|
}
|
|
211
199
|
}
|
|
212
|
-
if (
|
|
213
|
-
const b =
|
|
200
|
+
if (d.closest(".topiclinks")) {
|
|
201
|
+
const b = d.closest("g");
|
|
214
202
|
if (b) {
|
|
215
203
|
t.editArrowLabel(b);
|
|
216
204
|
return;
|
|
217
205
|
}
|
|
218
206
|
}
|
|
219
|
-
if (
|
|
220
|
-
const b =
|
|
207
|
+
if (d.closest(".summary")) {
|
|
208
|
+
const b = d.closest("g");
|
|
221
209
|
if (b) {
|
|
222
210
|
t.editSummary(b);
|
|
223
211
|
return;
|
|
224
212
|
}
|
|
225
213
|
}
|
|
226
214
|
}, i = (l) => {
|
|
227
|
-
if (l.pointerType === "mouse")
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
y < 300 && y > 0 && s(l), n = h;
|
|
215
|
+
if (l.pointerType === "mouse") return;
|
|
216
|
+
const d = (/* @__PURE__ */ new Date()).getTime(), w = d - n;
|
|
217
|
+
w < 300 && w > 0 && s(l), n = d;
|
|
231
218
|
}, r = (l) => {
|
|
232
219
|
l.code === "Space" && (t.spacePressed = !0, t.container.classList.add("space-pressed"), l.preventDefault());
|
|
233
220
|
}, c = (l) => {
|
|
234
221
|
l.code === "Space" && (t.spacePressed = !1, t.container.classList.remove("space-pressed"));
|
|
235
222
|
}, a = (l) => {
|
|
236
223
|
e.moved = !1;
|
|
237
|
-
const
|
|
238
|
-
if (!
|
|
239
|
-
return;
|
|
224
|
+
const d = t.spacePressed && l.button === 0 && l.pointerType === "mouse", w = t.mouseSelectionButton === 0 ? 2 : 0, v = l.button === w && l.pointerType === "mouse";
|
|
225
|
+
if (!d && !v) return;
|
|
240
226
|
e.x = l.clientX, e.y = l.clientY;
|
|
241
227
|
const b = l.target;
|
|
242
|
-
(
|
|
243
|
-
},
|
|
228
|
+
(d || b.className !== "circle" && b.contentEditable !== "plaintext-only") && (e.mousedown = !0, b.setPointerCapture(l.pointerId));
|
|
229
|
+
}, h = (l) => {
|
|
244
230
|
if (l.target.contentEditable !== "plaintext-only" || t.spacePressed && e.mousedown) {
|
|
245
|
-
const
|
|
246
|
-
e.onMove(
|
|
231
|
+
const d = l.clientX - e.x, w = l.clientY - e.y;
|
|
232
|
+
e.onMove(d, w);
|
|
247
233
|
}
|
|
248
234
|
e.x = l.clientX, e.y = l.clientY;
|
|
249
|
-
},
|
|
250
|
-
if (!e.mousedown)
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
h.hasPointerCapture && h.hasPointerCapture(l.pointerId) && h.releasePointerCapture(l.pointerId), e.clear();
|
|
235
|
+
}, f = (l) => {
|
|
236
|
+
if (!e.mousedown) return;
|
|
237
|
+
const d = l.target;
|
|
238
|
+
d.hasPointerCapture && d.hasPointerCapture(l.pointerId) && d.releasePointerCapture(l.pointerId), e.clear();
|
|
254
239
|
}, p = () => {
|
|
255
240
|
e.mousedown && e.clear();
|
|
256
|
-
},
|
|
257
|
-
if (l.preventDefault(), l.button !== 2 || !t.editable)
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
dt(h) && !h.classList.contains("selected") && t.selectNode(h), setTimeout(() => {
|
|
241
|
+
}, m = (l) => {
|
|
242
|
+
if (l.preventDefault(), l.button !== 2 || !t.editable) return;
|
|
243
|
+
const d = l.target;
|
|
244
|
+
at(d) && !d.classList.contains("selected") && t.selectNode(d), setTimeout(() => {
|
|
261
245
|
t.dragMoveHelper.moved || t.bus.fire("showContextMenu", l);
|
|
262
246
|
}, 200);
|
|
263
|
-
},
|
|
264
|
-
l.stopPropagation(), l.preventDefault(), l.ctrlKey || l.metaKey ? l.deltaY < 0 ?
|
|
265
|
-
}, { container:
|
|
266
|
-
return
|
|
267
|
-
{ dom:
|
|
268
|
-
{ dom:
|
|
269
|
-
{ dom:
|
|
270
|
-
{ dom:
|
|
271
|
-
{ dom:
|
|
272
|
-
{ dom:
|
|
273
|
-
{ dom:
|
|
274
|
-
{ dom:
|
|
275
|
-
{ dom:
|
|
247
|
+
}, y = (l) => {
|
|
248
|
+
l.stopPropagation(), l.preventDefault(), l.ctrlKey || l.metaKey ? l.deltaY < 0 ? ht(t, "in", t.dragMoveHelper) : t.scaleVal - t.scaleSensitivity > 0 && ht(t, "out", t.dragMoveHelper) : l.shiftKey ? t.move(-l.deltaY, 0) : t.move(-l.deltaX, -l.deltaY);
|
|
249
|
+
}, { container: g } = t;
|
|
250
|
+
return yt([
|
|
251
|
+
{ dom: g, evt: "pointerdown", func: a },
|
|
252
|
+
{ dom: g, evt: "pointermove", func: h },
|
|
253
|
+
{ dom: g, evt: "pointerup", func: f },
|
|
254
|
+
{ dom: g, evt: "pointerup", func: i },
|
|
255
|
+
{ dom: g, evt: "click", func: o },
|
|
256
|
+
{ dom: g, evt: "dblclick", func: s },
|
|
257
|
+
{ dom: g, evt: "contextmenu", func: m },
|
|
258
|
+
{ dom: g, evt: "wheel", func: typeof t.handleWheel == "function" ? t.handleWheel : y },
|
|
259
|
+
{ dom: g, evt: "blur", func: p },
|
|
276
260
|
{ dom: document, evt: "keydown", func: r },
|
|
277
261
|
{ dom: document, evt: "keyup", func: c }
|
|
278
262
|
]);
|
|
279
263
|
}
|
|
280
|
-
function
|
|
264
|
+
function At() {
|
|
281
265
|
return {
|
|
282
266
|
handlers: {},
|
|
283
267
|
addListener: function(t, e) {
|
|
@@ -291,8 +275,7 @@ function Nt() {
|
|
|
291
275
|
}
|
|
292
276
|
},
|
|
293
277
|
removeListener: function(t, e) {
|
|
294
|
-
if (!this.handlers[t])
|
|
295
|
-
return;
|
|
278
|
+
if (!this.handlers[t]) return;
|
|
296
279
|
const n = this.handlers[t];
|
|
297
280
|
if (!e)
|
|
298
281
|
n.length = 0;
|
|
@@ -302,10 +285,10 @@ function Nt() {
|
|
|
302
285
|
}
|
|
303
286
|
};
|
|
304
287
|
}
|
|
305
|
-
const U = document,
|
|
288
|
+
const U = document, Nt = function() {
|
|
306
289
|
this.nodes.innerHTML = "";
|
|
307
290
|
const t = this.createTopic(this.nodeData);
|
|
308
|
-
|
|
291
|
+
bt.call(this, t, this.nodeData), t.draggable = !1;
|
|
309
292
|
const e = U.createElement("me-root");
|
|
310
293
|
e.appendChild(t);
|
|
311
294
|
const n = this.nodeData.children || [];
|
|
@@ -315,30 +298,29 @@ const U = document, Mt = function() {
|
|
|
315
298
|
i.direction === 0 ? o += 1 : i.direction === 1 ? s += 1 : o <= s ? (i.direction = 0, o += 1) : (i.direction = 1, s += 1);
|
|
316
299
|
});
|
|
317
300
|
}
|
|
318
|
-
|
|
319
|
-
},
|
|
301
|
+
Mt(this, n, e);
|
|
302
|
+
}, Mt = function(t, e, n) {
|
|
320
303
|
const o = U.createElement("me-main");
|
|
321
|
-
o.className =
|
|
304
|
+
o.className = I.LHS;
|
|
322
305
|
const s = U.createElement("me-main");
|
|
323
|
-
s.className =
|
|
306
|
+
s.className = I.RHS;
|
|
324
307
|
for (let i = 0; i < e.length; i++) {
|
|
325
308
|
const r = e[i], { grp: c } = t.createWrapper(r);
|
|
326
309
|
t.direction === 2 ? r.direction === 0 ? o.appendChild(c) : s.appendChild(c) : t.direction === 0 ? o.appendChild(c) : s.appendChild(c);
|
|
327
310
|
}
|
|
328
311
|
t.nodes.appendChild(o), t.nodes.appendChild(n), t.nodes.appendChild(s), t.nodes.appendChild(t.lines), t.nodes.appendChild(t.labelContainer);
|
|
329
|
-
},
|
|
312
|
+
}, Pt = function(t, e) {
|
|
330
313
|
const n = U.createElement("me-children");
|
|
331
314
|
for (let o = 0; o < e.length; o++) {
|
|
332
315
|
const s = e[o], { grp: i } = t.createWrapper(s);
|
|
333
316
|
n.appendChild(i);
|
|
334
317
|
}
|
|
335
318
|
return n;
|
|
336
|
-
}, k = document,
|
|
337
|
-
const o = (this
|
|
338
|
-
if (!o)
|
|
339
|
-
throw new Error(`FindEle: Node ${t} not found, maybe it's collapsed.`);
|
|
319
|
+
}, k = document, wt = function(t, e) {
|
|
320
|
+
const o = (this?.el ? this.el : e || document).querySelector(`[data-nodeid="me${t}"]`);
|
|
321
|
+
if (!o) throw new Error(`FindEle: Node ${t} not found, maybe it's collapsed.`);
|
|
340
322
|
return o;
|
|
341
|
-
},
|
|
323
|
+
}, bt = function(t, e) {
|
|
342
324
|
if (t.innerHTML = "", e.style) {
|
|
343
325
|
const n = e.style;
|
|
344
326
|
for (const o in n)
|
|
@@ -354,8 +336,7 @@ const U = document, Mt = function() {
|
|
|
354
336
|
const o = k.createElement("img");
|
|
355
337
|
o.src = this.imageProxy ? this.imageProxy(n.url) : n.url, o.style.width = n.width + "px", o.style.height = n.height + "px", n.fit && (o.style.objectFit = n.fit), t.appendChild(o), t.image = o;
|
|
356
338
|
}
|
|
357
|
-
} else
|
|
358
|
-
t.image && (t.image = void 0);
|
|
339
|
+
} else t.image && (t.image = void 0);
|
|
359
340
|
{
|
|
360
341
|
const n = k.createElement("span");
|
|
361
342
|
n.className = "text", this.markdown ? n.innerHTML = this.markdown(e.topic, e) : n.textContent = e.topic, t.appendChild(n), t.text = n;
|
|
@@ -363,51 +344,47 @@ const U = document, Mt = function() {
|
|
|
363
344
|
if (e.hyperLink) {
|
|
364
345
|
const n = k.createElement("a");
|
|
365
346
|
n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href = e.hyperLink, t.appendChild(n), t.link = n;
|
|
366
|
-
} else
|
|
367
|
-
t.link && (t.link = void 0);
|
|
347
|
+
} else t.link && (t.link = void 0);
|
|
368
348
|
if (e.icons && e.icons.length) {
|
|
369
349
|
const n = k.createElement("span");
|
|
370
|
-
n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${
|
|
371
|
-
} else
|
|
372
|
-
t.icons && (t.icons = void 0);
|
|
350
|
+
n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${Tt(o)}</span>`).join(""), t.appendChild(n), t.icons = n;
|
|
351
|
+
} else t.icons && (t.icons = void 0);
|
|
373
352
|
if (e.tags && e.tags.length) {
|
|
374
353
|
const n = k.createElement("div");
|
|
375
354
|
n.className = "tags", e.tags.forEach((o) => {
|
|
376
355
|
const s = k.createElement("span");
|
|
377
356
|
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);
|
|
378
357
|
}), t.appendChild(n), t.tags = n;
|
|
379
|
-
} else
|
|
380
|
-
|
|
381
|
-
}, Bt = function(t, e) {
|
|
358
|
+
} else t.tags && (t.tags = void 0);
|
|
359
|
+
}, Ht = function(t, e) {
|
|
382
360
|
const n = k.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(t);
|
|
383
361
|
if (n.appendChild(o), !e && t.children && t.children.length > 0) {
|
|
384
|
-
const i =
|
|
362
|
+
const i = Gt(t.expanded);
|
|
385
363
|
if (o.appendChild(i), t.expanded !== !1) {
|
|
386
|
-
const r =
|
|
364
|
+
const r = Pt(this, t.children);
|
|
387
365
|
n.appendChild(r);
|
|
388
366
|
}
|
|
389
367
|
}
|
|
390
368
|
return { grp: n, top: o, tpc: s };
|
|
391
|
-
},
|
|
369
|
+
}, Bt = function(t) {
|
|
392
370
|
const e = k.createElement("me-parent"), n = this.createTopic(t);
|
|
393
|
-
return
|
|
394
|
-
},
|
|
371
|
+
return bt.call(this, n, t), e.appendChild(n), { p: e, tpc: n };
|
|
372
|
+
}, It = function(t) {
|
|
395
373
|
const e = k.createElement("me-children");
|
|
396
374
|
return e.append(...t), e;
|
|
397
|
-
},
|
|
375
|
+
}, Wt = function(t) {
|
|
398
376
|
const e = k.createElement("me-tpc");
|
|
399
377
|
return e.nodeObj = t, e.dataset.nodeid = "me" + t.id, e.draggable = this.draggable, e;
|
|
400
378
|
};
|
|
401
|
-
function
|
|
379
|
+
function vt(t) {
|
|
402
380
|
const e = k.createRange();
|
|
403
381
|
e.selectNodeContents(t);
|
|
404
382
|
const n = window.getSelection();
|
|
405
383
|
n && (n.removeAllRanges(), n.addRange(e));
|
|
406
384
|
}
|
|
407
|
-
const
|
|
408
|
-
if (!t)
|
|
409
|
-
|
|
410
|
-
const e = k.createElement("div"), n = t.nodeObj, o = n.topic, { offsetLeft: s, offsetTop: i } = A(this.nodes, t);
|
|
385
|
+
const Ot = function(t) {
|
|
386
|
+
if (!t) return;
|
|
387
|
+
const e = k.createElement("div"), n = t.nodeObj, o = n.topic, { offsetLeft: s, offsetTop: i } = D(this.nodes, t);
|
|
411
388
|
this.nodes.appendChild(e), e.id = "input-box", e.textContent = o, e.contentEditable = "plaintext-only", e.spellcheck = !1;
|
|
412
389
|
const r = getComputedStyle(t);
|
|
413
390
|
e.style.cssText = `
|
|
@@ -419,57 +396,54 @@ const Gt = function(t) {
|
|
|
419
396
|
margin:${r.margin};
|
|
420
397
|
background-color:${r.backgroundColor !== "rgba(0, 0, 0, 0)" && r.backgroundColor};
|
|
421
398
|
border: ${r.border};
|
|
422
|
-
border-radius:${r.borderRadius}; `, this.direction === 0 && (e.style.right = "0"),
|
|
399
|
+
border-radius:${r.borderRadius}; `, this.direction === 0 && (e.style.right = "0"), vt(e), this.bus.fire("operation", {
|
|
423
400
|
name: "beginEdit",
|
|
424
401
|
obj: t.nodeObj
|
|
425
402
|
}), e.addEventListener("keydown", (c) => {
|
|
426
403
|
c.stopPropagation();
|
|
427
404
|
const a = c.key;
|
|
428
405
|
if (a === "Enter" || a === "Tab") {
|
|
429
|
-
if (c.shiftKey)
|
|
430
|
-
return;
|
|
406
|
+
if (c.shiftKey) return;
|
|
431
407
|
c.preventDefault(), e.blur(), this.container.focus();
|
|
432
408
|
}
|
|
433
409
|
}), e.addEventListener("blur", () => {
|
|
434
|
-
|
|
435
|
-
if (!e)
|
|
436
|
-
return;
|
|
410
|
+
if (!e) return;
|
|
437
411
|
e.remove();
|
|
438
|
-
const c =
|
|
412
|
+
const c = e.textContent?.trim() || "";
|
|
439
413
|
c === o || c === "" || (n.topic = c, this.markdown ? t.text.innerHTML = this.markdown(n.topic, n) : t.text.textContent = c, this.linkDiv(), this.bus.fire("operation", {
|
|
440
414
|
name: "finishEdit",
|
|
441
415
|
obj: n,
|
|
442
416
|
origin: o
|
|
443
417
|
}));
|
|
444
418
|
});
|
|
445
|
-
},
|
|
419
|
+
}, Gt = function(t) {
|
|
446
420
|
const e = k.createElement("me-epd");
|
|
447
421
|
return e.expanded = t !== !1, e.className = t !== !1 ? "minus" : "", e;
|
|
448
|
-
},
|
|
422
|
+
}, B = document, $ = "http://www.w3.org/2000/svg", J = function(t) {
|
|
449
423
|
const e = t.clientWidth, n = t.clientHeight, o = t.dataset, s = Number(o.x), i = Number(o.y), r = o.anchor;
|
|
450
424
|
let c = s;
|
|
451
425
|
r === "middle" ? c = s - e / 2 : r === "end" && (c = s - e), t.style.left = `${c}px`, t.style.top = `${i - n / 2}px`, t.style.visibility = "visible";
|
|
452
|
-
},
|
|
426
|
+
}, tt = function(t, e, n, o) {
|
|
453
427
|
const { anchor: s = "middle", color: i, dataType: r, svgId: c } = o, a = document.createElement("div");
|
|
454
428
|
a.className = "svg-label", a.style.color = i || "#666";
|
|
455
|
-
const
|
|
456
|
-
return a.id =
|
|
457
|
-
},
|
|
458
|
-
const o =
|
|
459
|
-
return
|
|
429
|
+
const h = "label-" + c;
|
|
430
|
+
return a.id = h, a.innerHTML = t, a.dataset.type = r, a.dataset.svgId = c, a.dataset.x = e.toString(), a.dataset.y = n.toString(), a.dataset.anchor = s, a;
|
|
431
|
+
}, xt = function(t, e, n) {
|
|
432
|
+
const o = B.createElementNS($, "path");
|
|
433
|
+
return E(o, {
|
|
460
434
|
d: t,
|
|
461
435
|
stroke: e || "#666",
|
|
462
436
|
fill: "none",
|
|
463
437
|
"stroke-width": n
|
|
464
438
|
}), o;
|
|
465
439
|
}, F = function(t) {
|
|
466
|
-
const e =
|
|
440
|
+
const e = B.createElementNS($, "svg");
|
|
467
441
|
return e.setAttribute("class", t), e.setAttribute("overflow", "visible"), e;
|
|
468
|
-
},
|
|
469
|
-
const t =
|
|
442
|
+
}, dt = function() {
|
|
443
|
+
const t = B.createElementNS($, "line");
|
|
470
444
|
return t.setAttribute("stroke", "#4dc4ff"), t.setAttribute("fill", "none"), t.setAttribute("stroke-width", "2"), t.setAttribute("opacity", "0.45"), t;
|
|
471
|
-
},
|
|
472
|
-
const s =
|
|
445
|
+
}, Ft = function(t, e, n, o) {
|
|
446
|
+
const s = B.createElementNS($, "g");
|
|
473
447
|
return [
|
|
474
448
|
{
|
|
475
449
|
name: "line",
|
|
@@ -484,43 +458,39 @@ const Gt = function(t) {
|
|
|
484
458
|
d: n
|
|
485
459
|
}
|
|
486
460
|
].forEach((r, c) => {
|
|
487
|
-
const a = r.d,
|
|
461
|
+
const a = r.d, h = B.createElementNS($, "path"), f = {
|
|
488
462
|
d: a,
|
|
489
|
-
stroke:
|
|
463
|
+
stroke: o?.stroke || "rgb(227, 125, 116)",
|
|
490
464
|
fill: "none",
|
|
491
|
-
"stroke-linecap":
|
|
492
|
-
"stroke-width": String(
|
|
465
|
+
"stroke-linecap": o?.strokeLinecap || "cap",
|
|
466
|
+
"stroke-width": String(o?.strokeWidth || "2")
|
|
493
467
|
};
|
|
494
|
-
|
|
495
|
-
const p =
|
|
496
|
-
|
|
468
|
+
o?.opacity !== void 0 && (f.opacity = String(o.opacity)), E(h, f), c === 0 && h.setAttribute("stroke-dasharray", o?.strokeDasharray || "8,2");
|
|
469
|
+
const p = B.createElementNS($, "path");
|
|
470
|
+
E(p, {
|
|
497
471
|
d: a,
|
|
498
472
|
stroke: "transparent",
|
|
499
473
|
fill: "none",
|
|
500
474
|
"stroke-width": "15"
|
|
501
|
-
}), s.appendChild(p), s.appendChild(
|
|
475
|
+
}), s.appendChild(p), s.appendChild(h), s[r.name] = h;
|
|
502
476
|
}), s;
|
|
503
|
-
},
|
|
504
|
-
if (!e)
|
|
505
|
-
return;
|
|
477
|
+
}, Ct = function(t, e, n) {
|
|
478
|
+
if (!e) return;
|
|
506
479
|
const o = n.label, s = e.cloneNode(!0);
|
|
507
480
|
t.nodes.appendChild(s), s.id = "input-box", s.textContent = o, s.contentEditable = "plaintext-only", s.spellcheck = !1, s.style.cssText = `
|
|
508
481
|
left:${e.style.left};
|
|
509
482
|
top:${e.style.top};
|
|
510
483
|
max-width: 200px;
|
|
511
|
-
`,
|
|
484
|
+
`, vt(s), t.scrollIntoView(s), s.addEventListener("keydown", (i) => {
|
|
512
485
|
i.stopPropagation();
|
|
513
486
|
const r = i.key;
|
|
514
487
|
if (r === "Enter" || r === "Tab") {
|
|
515
|
-
if (i.shiftKey)
|
|
516
|
-
return;
|
|
488
|
+
if (i.shiftKey) return;
|
|
517
489
|
i.preventDefault(), s.blur(), t.container.focus();
|
|
518
490
|
}
|
|
519
491
|
}), s.addEventListener("blur", () => {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
return;
|
|
523
|
-
const i = ((r = s.textContent) == null ? void 0 : r.trim()) || "";
|
|
492
|
+
if (!s) return;
|
|
493
|
+
const i = s.textContent?.trim() || "";
|
|
524
494
|
i === "" ? n.label = o : n.label = i, s.remove(), i !== o && (e.textContent = n.label, J(e), "parent" in n ? t.bus.fire("operation", {
|
|
525
495
|
name: "finishEditSummary",
|
|
526
496
|
obj: n
|
|
@@ -529,49 +499,45 @@ const Gt = function(t) {
|
|
|
529
499
|
obj: n
|
|
530
500
|
}));
|
|
531
501
|
});
|
|
532
|
-
},
|
|
502
|
+
}, Vt = function(t) {
|
|
533
503
|
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");
|
|
534
504
|
this.lines.innerHTML = "";
|
|
535
505
|
for (let c = 0; c < r.length; c++) {
|
|
536
|
-
const a = r[c],
|
|
537
|
-
if (
|
|
506
|
+
const a = r[c], h = a.querySelector("me-tpc"), { offsetLeft: f, offsetTop: p } = D(this.nodes, h), m = h.offsetWidth, y = h.offsetHeight, g = a.parentNode.className, u = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: p, cL: f, cW: m, cH: y, direction: g, containerHeight: this.nodes.offsetHeight }), l = this.theme.palette, d = h.nodeObj.branchColor || l[c % l.length];
|
|
507
|
+
if (h.style.borderColor = d, this.lines.appendChild(xt(u, d, "3")), t && t !== a)
|
|
538
508
|
continue;
|
|
539
|
-
const
|
|
540
|
-
v.tagName === "svg" && v.remove(), a.appendChild(
|
|
509
|
+
const w = F("subLines"), v = a.lastChild;
|
|
510
|
+
v.tagName === "svg" && v.remove(), a.appendChild(w), St(this, w, d, a, g, !0);
|
|
541
511
|
}
|
|
542
512
|
this.labelContainer.innerHTML = "", this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
|
|
543
|
-
},
|
|
513
|
+
}, St = function(t, e, n, o, s, i) {
|
|
544
514
|
const r = o.firstChild, c = o.children[1].children;
|
|
545
|
-
if (c.length === 0)
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
if (!C.expanded)
|
|
554
|
-
continue;
|
|
515
|
+
if (c.length === 0) return;
|
|
516
|
+
const a = r.offsetTop, h = r.offsetLeft, f = r.offsetWidth, p = r.offsetHeight;
|
|
517
|
+
for (let m = 0; m < c.length; m++) {
|
|
518
|
+
const y = c[m], g = y.firstChild, u = g.offsetTop, l = g.offsetLeft, d = g.offsetWidth, w = g.offsetHeight, v = g.firstChild.nodeObj.branchColor || n, b = t.generateSubBranch({ pT: a, pL: h, pW: f, pH: p, cT: u, cL: l, cW: d, cH: w, direction: s, isFirst: i });
|
|
519
|
+
e.appendChild(xt(b, v, "2"));
|
|
520
|
+
const x = g.children[1];
|
|
521
|
+
if (x) {
|
|
522
|
+
if (!x.expanded) continue;
|
|
555
523
|
} else
|
|
556
524
|
continue;
|
|
557
|
-
|
|
525
|
+
St(t, e, v, y, s);
|
|
558
526
|
}
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
zoomout: Ut
|
|
569
|
-
}, P = (t, e) => {
|
|
527
|
+
}, Rt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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>', Yt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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>', zt = '<?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>', jt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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>', Xt = '<?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>', qt = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="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>', _t = '<?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>', Ut = {
|
|
528
|
+
side: Rt,
|
|
529
|
+
left: Yt,
|
|
530
|
+
right: zt,
|
|
531
|
+
full: jt,
|
|
532
|
+
living: Xt,
|
|
533
|
+
zoomin: qt,
|
|
534
|
+
zoomout: _t
|
|
535
|
+
}, M = (t, e) => {
|
|
570
536
|
const n = document.createElement("span");
|
|
571
|
-
return n.id = t, n.innerHTML =
|
|
537
|
+
return n.id = t, n.innerHTML = Ut[e], n;
|
|
572
538
|
};
|
|
573
|
-
function
|
|
574
|
-
const e = document.createElement("div"), n =
|
|
539
|
+
function Kt(t) {
|
|
540
|
+
const e = document.createElement("div"), n = M("fullscreen", "full"), o = M("toCenter", "living"), s = M("zoomout", "zoomout"), i = M("zoomin", "zoomin"), r = document.createElement("span");
|
|
575
541
|
return r.innerText = "100%", e.appendChild(n), e.appendChild(o), e.appendChild(s), e.appendChild(i), e.className = "mind-elixir-toolbar rb", n.onclick = () => {
|
|
576
542
|
document.fullscreenElement === t.el ? document.exitFullscreen() : t.el.requestFullscreen();
|
|
577
543
|
}, o.onclick = () => {
|
|
@@ -582,8 +548,8 @@ function Jt(t) {
|
|
|
582
548
|
t.scale(t.scaleVal + t.scaleSensitivity);
|
|
583
549
|
}, e;
|
|
584
550
|
}
|
|
585
|
-
function
|
|
586
|
-
const e = document.createElement("div"), n =
|
|
551
|
+
function Jt(t) {
|
|
552
|
+
const e = document.createElement("div"), n = M("tbltl", "left"), o = M("tbltr", "right"), s = M("tblts", "side");
|
|
587
553
|
return e.appendChild(n), e.appendChild(o), e.appendChild(s), e.className = "mind-elixir-toolbar lt", n.onclick = () => {
|
|
588
554
|
t.initLeft();
|
|
589
555
|
}, o.onclick = () => {
|
|
@@ -592,13 +558,13 @@ function Qt(t) {
|
|
|
592
558
|
t.initSide();
|
|
593
559
|
}, e;
|
|
594
560
|
}
|
|
595
|
-
function
|
|
596
|
-
t.container.append(
|
|
561
|
+
function Qt(t) {
|
|
562
|
+
t.container.append(Kt(t)), t.container.append(Jt(t));
|
|
597
563
|
}
|
|
598
|
-
const
|
|
564
|
+
const Zt = function(t, e = !0) {
|
|
599
565
|
this.theme = t;
|
|
600
566
|
const o = {
|
|
601
|
-
...(t.type === "dark" ?
|
|
567
|
+
...(t.type === "dark" ? nt : et).cssVar,
|
|
602
568
|
...t.cssVar
|
|
603
569
|
}, s = Object.keys(o);
|
|
604
570
|
for (let i = 0; i < s.length; i++) {
|
|
@@ -606,11 +572,11 @@ const te = function(t, e = !0) {
|
|
|
606
572
|
this.container.style.setProperty(r, o[r]);
|
|
607
573
|
}
|
|
608
574
|
e && this.refresh();
|
|
609
|
-
},
|
|
575
|
+
}, te = function(t) {
|
|
610
576
|
const n = t.parentElement.parentElement.lastElementChild;
|
|
611
|
-
|
|
577
|
+
n?.tagName === "svg" && n?.remove();
|
|
612
578
|
};
|
|
613
|
-
function
|
|
579
|
+
function ee(t) {
|
|
614
580
|
return {
|
|
615
581
|
nodeData: t.isFocusMode ? t.nodeDataBackup : t.nodeData,
|
|
616
582
|
arrows: t.arrows,
|
|
@@ -619,77 +585,76 @@ function ne(t) {
|
|
|
619
585
|
theme: t.theme
|
|
620
586
|
};
|
|
621
587
|
}
|
|
622
|
-
const
|
|
588
|
+
const ne = function(t) {
|
|
623
589
|
const e = this.container, n = t.getBoundingClientRect(), o = e.getBoundingClientRect();
|
|
624
590
|
if (n.top > o.bottom || n.bottom < o.top || n.left > o.right || n.right < o.left) {
|
|
625
|
-
const i = n.left + n.width / 2, r = n.top + n.height / 2, c = o.left + o.width / 2, a = o.top + o.height / 2,
|
|
626
|
-
this.move(-
|
|
591
|
+
const i = n.left + n.width / 2, r = n.top + n.height / 2, c = o.left + o.width / 2, a = o.top + o.height / 2, h = i - c, f = r - a;
|
|
592
|
+
this.move(-h, -f, !0);
|
|
627
593
|
}
|
|
628
|
-
},
|
|
594
|
+
}, oe = function(t, e, n) {
|
|
629
595
|
this.clearSelection(), this.scrollIntoView(t), this.selection.select(t), e && this.bus.fire("selectNewNode", t.nodeObj);
|
|
630
|
-
},
|
|
596
|
+
}, se = function(t) {
|
|
631
597
|
this.selection.select(t);
|
|
632
|
-
},
|
|
598
|
+
}, ie = function(t) {
|
|
633
599
|
this.selection.deselect(t);
|
|
634
|
-
},
|
|
600
|
+
}, re = function() {
|
|
635
601
|
this.unselectNodes(this.currentNodes), this.unselectSummary(), this.unselectArrow();
|
|
636
|
-
},
|
|
637
|
-
const t =
|
|
602
|
+
}, ce = function() {
|
|
603
|
+
const t = ee(this);
|
|
638
604
|
return JSON.stringify(t, (e, n) => {
|
|
639
605
|
if (!(e === "parent" && typeof n != "string"))
|
|
640
606
|
return n;
|
|
641
607
|
});
|
|
642
|
-
},
|
|
608
|
+
}, le = function() {
|
|
643
609
|
return JSON.parse(this.getDataString());
|
|
644
|
-
},
|
|
610
|
+
}, ae = function() {
|
|
645
611
|
this.editable = !0;
|
|
646
|
-
},
|
|
612
|
+
}, he = function() {
|
|
647
613
|
this.editable = !1;
|
|
648
|
-
},
|
|
649
|
-
if (t < this.scaleMin || t > this.scaleMax)
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
}, ue = function() {
|
|
614
|
+
}, de = function(t, e = { x: 0, y: 0 }) {
|
|
615
|
+
if (t < this.scaleMin || t > this.scaleMax) return;
|
|
616
|
+
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 } = Et(this), c = this.map.style.transform, { x: a, y: h } = mt(c), f = a - i, p = h - r, m = this.scaleVal, y = (-o + f) * (1 - t / m), g = (-s + p) * (1 - t / m);
|
|
617
|
+
this.map.style.transform = `translate(${a - y}px, ${h - g}px) scale(${t})`, this.scaleVal = t, this.bus.fire("scale", t);
|
|
618
|
+
}, fe = function() {
|
|
654
619
|
const t = this.nodes.offsetHeight / this.container.offsetHeight, e = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(t, e));
|
|
655
620
|
this.scaleVal = n, this.map.style.transform = "scale(" + n + ")", this.bus.fire("scale", n);
|
|
656
621
|
}, pe = function(t, e, n = !1) {
|
|
657
622
|
const { map: o, scaleVal: s, bus: i } = this, r = o.style.transform;
|
|
658
|
-
let { x: c, y: a } =
|
|
623
|
+
let { x: c, y: a } = mt(r);
|
|
659
624
|
c += t, a += e, n && (o.style.transition = "transform 0.3s", setTimeout(() => {
|
|
660
625
|
o.style.transition = "none";
|
|
661
626
|
}, 300)), o.style.transform = `translate(${c}px, ${a}px) scale(${s})`, i.fire("move", { dx: t, dy: e });
|
|
662
|
-
},
|
|
627
|
+
}, Et = (t) => {
|
|
663
628
|
const { container: e, map: n, nodes: o } = t, s = n.querySelector("me-root"), i = s.offsetTop, r = s.offsetLeft, c = s.offsetWidth, a = s.offsetHeight;
|
|
664
|
-
let
|
|
665
|
-
return t.alignment === "root" ? (
|
|
666
|
-
},
|
|
667
|
-
const { map: t } = this, { dx: e, dy: n } =
|
|
629
|
+
let h, f;
|
|
630
|
+
return t.alignment === "root" ? (h = e.offsetWidth / 2 - r - c / 2, f = e.offsetHeight / 2 - i - a / 2, n.style.transformOrigin = `${r + c / 2}px 50%`) : (h = (e.offsetWidth - o.offsetWidth) / 2, f = (e.offsetHeight - o.offsetHeight) / 2, n.style.transformOrigin = "50% 50%"), { dx: h, dy: f };
|
|
631
|
+
}, ue = function() {
|
|
632
|
+
const { map: t } = this, { dx: e, dy: n } = Et(this);
|
|
668
633
|
t.style.transform = `translate(${e}px, ${n}px) scale(${this.scaleVal})`;
|
|
669
|
-
},
|
|
634
|
+
}, ge = function(t) {
|
|
670
635
|
t(this);
|
|
671
|
-
},
|
|
636
|
+
}, me = function(t) {
|
|
672
637
|
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());
|
|
673
|
-
},
|
|
638
|
+
}, ye = function() {
|
|
674
639
|
this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
|
|
675
|
-
},
|
|
640
|
+
}, we = function() {
|
|
676
641
|
this.direction = 0, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
677
|
-
},
|
|
642
|
+
}, be = function() {
|
|
678
643
|
this.direction = 1, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
679
|
-
},
|
|
644
|
+
}, ve = function() {
|
|
680
645
|
this.direction = 2, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
|
|
681
|
-
},
|
|
646
|
+
}, xe = function(t) {
|
|
682
647
|
this.locale = t, this.refresh();
|
|
683
|
-
},
|
|
648
|
+
}, Ce = function(t, e) {
|
|
684
649
|
const n = t.nodeObj;
|
|
685
650
|
typeof e == "boolean" ? n.expanded = e : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
|
|
686
651
|
const o = t.getBoundingClientRect(), s = {
|
|
687
652
|
x: o.left,
|
|
688
653
|
y: o.top
|
|
689
654
|
}, i = t.parentNode, r = i.children[1];
|
|
690
|
-
if (r.expanded = n.expanded, r.className = n.expanded ? "minus" : "",
|
|
655
|
+
if (r.expanded = n.expanded, r.className = n.expanded ? "minus" : "", te(t), n.expanded) {
|
|
691
656
|
const p = this.createChildren(
|
|
692
|
-
n.children.map((
|
|
657
|
+
n.children.map((m) => this.createWrapper(m).grp)
|
|
693
658
|
);
|
|
694
659
|
i.parentNode.appendChild(p);
|
|
695
660
|
} else
|
|
@@ -698,47 +663,47 @@ const oe = function(t) {
|
|
|
698
663
|
const c = t.getBoundingClientRect(), a = {
|
|
699
664
|
x: c.left,
|
|
700
665
|
y: c.top
|
|
701
|
-
},
|
|
702
|
-
this.move(
|
|
703
|
-
},
|
|
666
|
+
}, h = s.x - a.x, f = s.y - a.y;
|
|
667
|
+
this.move(h, f), this.bus.fire("expandNode", n);
|
|
668
|
+
}, Se = function(t, e) {
|
|
704
669
|
const n = t.nodeObj, o = t.getBoundingClientRect(), s = {
|
|
705
670
|
x: o.left,
|
|
706
671
|
y: o.top
|
|
707
672
|
};
|
|
708
|
-
|
|
673
|
+
gt(n, e ?? !n.expanded), this.refresh();
|
|
709
674
|
const i = this.findEle(n.id).getBoundingClientRect(), r = {
|
|
710
675
|
x: i.left,
|
|
711
676
|
y: i.top
|
|
712
677
|
}, c = s.x - r.x, a = s.y - r.y;
|
|
713
678
|
this.move(c, a);
|
|
714
|
-
},
|
|
715
|
-
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)),
|
|
716
|
-
},
|
|
679
|
+
}, Ee = function(t) {
|
|
680
|
+
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)), ot(this.nodeData), this.layout(), this.linkDiv();
|
|
681
|
+
}, Le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
717
682
|
__proto__: null,
|
|
718
|
-
cancelFocus:
|
|
719
|
-
clearSelection:
|
|
720
|
-
disableEdit:
|
|
721
|
-
enableEdit:
|
|
722
|
-
expandNode:
|
|
723
|
-
expandNodeAll:
|
|
724
|
-
focusNode:
|
|
725
|
-
getData:
|
|
726
|
-
getDataString:
|
|
727
|
-
initLeft:
|
|
728
|
-
initRight:
|
|
729
|
-
initSide:
|
|
730
|
-
install:
|
|
683
|
+
cancelFocus: ye,
|
|
684
|
+
clearSelection: re,
|
|
685
|
+
disableEdit: he,
|
|
686
|
+
enableEdit: ae,
|
|
687
|
+
expandNode: Ce,
|
|
688
|
+
expandNodeAll: Se,
|
|
689
|
+
focusNode: me,
|
|
690
|
+
getData: le,
|
|
691
|
+
getDataString: ce,
|
|
692
|
+
initLeft: we,
|
|
693
|
+
initRight: be,
|
|
694
|
+
initSide: ve,
|
|
695
|
+
install: ge,
|
|
731
696
|
move: pe,
|
|
732
|
-
refresh:
|
|
733
|
-
scale:
|
|
734
|
-
scaleFit:
|
|
735
|
-
scrollIntoView:
|
|
736
|
-
selectNode:
|
|
737
|
-
selectNodes:
|
|
738
|
-
setLocale:
|
|
739
|
-
toCenter:
|
|
740
|
-
unselectNodes:
|
|
741
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
697
|
+
refresh: Ee,
|
|
698
|
+
scale: de,
|
|
699
|
+
scaleFit: fe,
|
|
700
|
+
scrollIntoView: ne,
|
|
701
|
+
selectNode: oe,
|
|
702
|
+
selectNodes: se,
|
|
703
|
+
setLocale: xe,
|
|
704
|
+
toCenter: ue,
|
|
705
|
+
unselectNodes: ie
|
|
706
|
+
}, Symbol.toStringTag, { value: "Module" })), ke = function(t) {
|
|
742
707
|
return {
|
|
743
708
|
dom: t,
|
|
744
709
|
moved: !1,
|
|
@@ -761,7 +726,7 @@ const oe = function(t) {
|
|
|
761
726
|
},
|
|
762
727
|
cb: null,
|
|
763
728
|
init(e, n) {
|
|
764
|
-
this.cb = n, this.handleClear = this.handleClear.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.handlePointerDown = this.handlePointerDown.bind(this), this.destroy =
|
|
729
|
+
this.cb = n, this.handleClear = this.handleClear.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.handlePointerDown = this.handlePointerDown.bind(this), this.destroy = yt([
|
|
765
730
|
{ dom: e, evt: "pointermove", func: this.handlePointerMove },
|
|
766
731
|
{ dom: e, evt: "pointerleave", func: this.handleClear },
|
|
767
732
|
{ dom: e, evt: "pointerup", func: this.handleClear },
|
|
@@ -773,72 +738,71 @@ const oe = function(t) {
|
|
|
773
738
|
this.moved = !1, this.pointerdown = !1;
|
|
774
739
|
}
|
|
775
740
|
};
|
|
776
|
-
},
|
|
777
|
-
create:
|
|
778
|
-
},
|
|
779
|
-
function
|
|
741
|
+
}, ft = {
|
|
742
|
+
create: ke
|
|
743
|
+
}, Te = "#4dc4ff";
|
|
744
|
+
function Lt(t, e, n, o, s, i, r, c) {
|
|
780
745
|
return {
|
|
781
746
|
x: t / 8 + n * 3 / 8 + s * 3 / 8 + r / 8,
|
|
782
747
|
y: e / 8 + o * 3 / 8 + i * 3 / 8 + c / 8
|
|
783
748
|
};
|
|
784
749
|
}
|
|
785
|
-
function
|
|
750
|
+
function $e(t, e, n) {
|
|
786
751
|
t && (t.dataset.x = e.toString(), t.dataset.y = n.toString(), J(t));
|
|
787
752
|
}
|
|
788
753
|
function z(t, e, n, o, s) {
|
|
789
|
-
|
|
754
|
+
E(t, {
|
|
790
755
|
x1: e + "",
|
|
791
756
|
y1: n + "",
|
|
792
757
|
x2: o + "",
|
|
793
758
|
y2: s + ""
|
|
794
759
|
});
|
|
795
760
|
}
|
|
796
|
-
function
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
l.stroke && t.line.setAttribute("stroke", l.stroke), l.strokeWidth && t.line.setAttribute("stroke-width", String(l.strokeWidth)), l.strokeDasharray && t.line.setAttribute("stroke-dasharray", l.strokeDasharray), l.strokeLinecap && t.line.setAttribute("stroke-linecap", l.strokeLinecap), l.opacity !== void 0 && t.line.setAttribute("opacity", String(l.opacity));
|
|
761
|
+
function pt(t, e, n, o, s, i, r, c, a, h) {
|
|
762
|
+
const f = `M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${a}`;
|
|
763
|
+
if (t.line.setAttribute("d", f), h.style) {
|
|
764
|
+
const u = h.style;
|
|
765
|
+
u.stroke && t.line.setAttribute("stroke", u.stroke), u.strokeWidth && t.line.setAttribute("stroke-width", String(u.strokeWidth)), u.strokeDasharray && t.line.setAttribute("stroke-dasharray", u.strokeDasharray), u.strokeLinecap && t.line.setAttribute("stroke-linecap", u.strokeLinecap), u.opacity !== void 0 && t.line.setAttribute("opacity", String(u.opacity));
|
|
802
766
|
}
|
|
803
767
|
const p = t.querySelectorAll('path[stroke="transparent"]');
|
|
804
|
-
p.length > 0 && p[0].setAttribute("d",
|
|
805
|
-
const
|
|
806
|
-
if (
|
|
807
|
-
const
|
|
808
|
-
if (t.arrow1.setAttribute("d",
|
|
809
|
-
const
|
|
810
|
-
|
|
768
|
+
p.length > 0 && p[0].setAttribute("d", f);
|
|
769
|
+
const m = _(i, r, c, a);
|
|
770
|
+
if (m) {
|
|
771
|
+
const u = `M ${m.x1} ${m.y1} L ${c} ${a} L ${m.x2} ${m.y2}`;
|
|
772
|
+
if (t.arrow1.setAttribute("d", u), p.length > 1 && p[1].setAttribute("d", u), h.style) {
|
|
773
|
+
const l = h.style;
|
|
774
|
+
l.stroke && t.arrow1.setAttribute("stroke", l.stroke), l.strokeWidth && t.arrow1.setAttribute("stroke-width", String(l.strokeWidth)), l.strokeLinecap && t.arrow1.setAttribute("stroke-linecap", l.strokeLinecap), l.opacity !== void 0 && t.arrow1.setAttribute("opacity", String(l.opacity));
|
|
811
775
|
}
|
|
812
776
|
}
|
|
813
|
-
if (
|
|
814
|
-
const
|
|
815
|
-
if (
|
|
816
|
-
const
|
|
817
|
-
if (t.arrow2.setAttribute("d",
|
|
818
|
-
const
|
|
819
|
-
|
|
777
|
+
if (h.bidirectional) {
|
|
778
|
+
const u = _(o, s, e, n);
|
|
779
|
+
if (u) {
|
|
780
|
+
const l = `M ${u.x1} ${u.y1} L ${e} ${n} L ${u.x2} ${u.y2}`;
|
|
781
|
+
if (t.arrow2.setAttribute("d", l), p.length > 2 && p[2].setAttribute("d", l), h.style) {
|
|
782
|
+
const d = h.style;
|
|
783
|
+
d.stroke && t.arrow2.setAttribute("stroke", d.stroke), d.strokeWidth && t.arrow2.setAttribute("stroke-width", String(d.strokeWidth)), d.strokeLinecap && t.arrow2.setAttribute("stroke-linecap", d.strokeLinecap), d.opacity !== void 0 && t.arrow2.setAttribute("opacity", String(d.opacity));
|
|
820
784
|
}
|
|
821
785
|
}
|
|
822
786
|
}
|
|
823
|
-
const { x:
|
|
824
|
-
if (t.labelEl &&
|
|
825
|
-
const
|
|
826
|
-
|
|
787
|
+
const { x: y, y: g } = Lt(e, n, o, s, i, r, c, a);
|
|
788
|
+
if (t.labelEl && $e(t.labelEl, y, g), h.style?.labelColor) {
|
|
789
|
+
const u = t.labelEl;
|
|
790
|
+
u && (u.style.color = h.style.labelColor);
|
|
827
791
|
}
|
|
828
|
-
|
|
792
|
+
Ie(t);
|
|
829
793
|
}
|
|
830
794
|
function K(t, e, n) {
|
|
831
|
-
const { offsetLeft: o, offsetTop: s } =
|
|
795
|
+
const { offsetLeft: o, offsetTop: s } = D(t.nodes, e), i = e.offsetWidth, r = e.offsetHeight, c = o + i / 2, a = s + r / 2, h = c + n.x, f = a + n.y;
|
|
832
796
|
return {
|
|
833
797
|
w: i,
|
|
834
798
|
h: r,
|
|
835
799
|
cx: c,
|
|
836
800
|
cy: a,
|
|
837
|
-
ctrlX:
|
|
838
|
-
ctrlY:
|
|
801
|
+
ctrlX: h,
|
|
802
|
+
ctrlY: f
|
|
839
803
|
};
|
|
840
804
|
}
|
|
841
|
-
function
|
|
805
|
+
function H(t) {
|
|
842
806
|
let e, n;
|
|
843
807
|
const o = (t.cy - t.ctrlY) / (t.ctrlX - t.cx);
|
|
844
808
|
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), {
|
|
@@ -846,31 +810,28 @@ function B(t) {
|
|
|
846
810
|
y: n
|
|
847
811
|
};
|
|
848
812
|
}
|
|
849
|
-
const
|
|
850
|
-
var E;
|
|
813
|
+
const st = function(t, e, n, o, s) {
|
|
851
814
|
if (!e || !n)
|
|
852
815
|
return;
|
|
853
|
-
const i = K(t, e, o.delta1), r = K(t, n, o.delta2), { x: c, y: a } =
|
|
854
|
-
if (!
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
let h = "";
|
|
816
|
+
const i = K(t, e, o.delta1), r = K(t, n, o.delta2), { x: c, y: a } = H(i), { ctrlX: h, ctrlY: f } = i, { ctrlX: p, ctrlY: m } = r, { x: y, y: g } = H(r), u = _(p, m, y, g);
|
|
817
|
+
if (!u) return;
|
|
818
|
+
const l = `M ${u.x1} ${u.y1} L ${y} ${g} L ${u.x2} ${u.y2}`;
|
|
819
|
+
let d = "";
|
|
858
820
|
if (o.bidirectional) {
|
|
859
|
-
const
|
|
860
|
-
if (
|
|
861
|
-
|
|
862
|
-
h = `M ${$.x1} ${$.y1} L ${c} ${a} L ${$.x2} ${$.y2}`;
|
|
821
|
+
const L = _(h, f, c, a);
|
|
822
|
+
if (!L) return;
|
|
823
|
+
d = `M ${L.x1} ${L.y1} L ${c} ${a} L ${L.x2} ${L.y2}`;
|
|
863
824
|
}
|
|
864
|
-
const
|
|
865
|
-
|
|
866
|
-
const S =
|
|
825
|
+
const w = Ft(`M ${c} ${a} C ${h} ${f} ${p} ${m} ${y} ${g}`, l, d, o.style), { x: v, y: b } = Lt(c, a, h, f, p, m, y, g), x = o.style?.labelColor || "rgb(235, 95, 82)", C = "arrow-" + o.id;
|
|
826
|
+
w.id = C;
|
|
827
|
+
const S = tt(o.label, v, b, {
|
|
867
828
|
anchor: "middle",
|
|
868
|
-
color:
|
|
829
|
+
color: x,
|
|
869
830
|
dataType: "arrow",
|
|
870
|
-
svgId:
|
|
831
|
+
svgId: C
|
|
871
832
|
});
|
|
872
|
-
|
|
873
|
-
},
|
|
833
|
+
w.labelEl = S, w.arrowObj = o, w.dataset.linkid = o.id, t.labelContainer.appendChild(S), t.linkSvgGroup.appendChild(w), J(S), s || (t.arrows.push(o), t.currentArrow = w, kt(t, o, i, r));
|
|
834
|
+
}, De = function(t, e, n = {}) {
|
|
874
835
|
const o = {
|
|
875
836
|
id: V(),
|
|
876
837
|
label: "Custom Link",
|
|
@@ -886,21 +847,20 @@ const it = function(t, e, n, o, s) {
|
|
|
886
847
|
},
|
|
887
848
|
...n
|
|
888
849
|
};
|
|
889
|
-
|
|
850
|
+
st(this, t, e, o), this.bus.fire("operation", {
|
|
890
851
|
name: "createArrow",
|
|
891
852
|
obj: o
|
|
892
853
|
});
|
|
893
|
-
},
|
|
854
|
+
}, Ae = function(t) {
|
|
894
855
|
Q(this);
|
|
895
856
|
const e = { ...t, id: V() };
|
|
896
|
-
|
|
857
|
+
st(this, this.findEle(e.from), this.findEle(e.to), e), this.bus.fire("operation", {
|
|
897
858
|
name: "createArrow",
|
|
898
859
|
obj: e
|
|
899
860
|
});
|
|
900
|
-
},
|
|
861
|
+
}, Ne = function(t) {
|
|
901
862
|
let e;
|
|
902
|
-
if (t ? e = t : e = this.currentArrow, !e)
|
|
903
|
-
return;
|
|
863
|
+
if (t ? e = t : e = this.currentArrow, !e) return;
|
|
904
864
|
Q(this);
|
|
905
865
|
const n = e.arrowObj.id;
|
|
906
866
|
this.arrows = this.arrows.filter((o) => o.id !== n), e.remove(), this.bus.fire("operation", {
|
|
@@ -909,15 +869,15 @@ const it = function(t, e, n, o, s) {
|
|
|
909
869
|
id: n
|
|
910
870
|
}
|
|
911
871
|
});
|
|
912
|
-
},
|
|
872
|
+
}, Me = function(t) {
|
|
913
873
|
this.currentArrow = t;
|
|
914
874
|
const e = t.arrowObj, n = this.findEle(e.from), o = this.findEle(e.to), s = K(this, n, e.delta1), i = K(this, o, e.delta2);
|
|
915
|
-
|
|
916
|
-
},
|
|
875
|
+
kt(this, e, s, i);
|
|
876
|
+
}, Pe = function() {
|
|
917
877
|
Q(this), this.currentArrow = null;
|
|
918
878
|
}, Z = function(t, e) {
|
|
919
|
-
const n = document.createElementNS(
|
|
920
|
-
return
|
|
879
|
+
const n = document.createElementNS($, "path");
|
|
880
|
+
return E(n, {
|
|
921
881
|
d: t,
|
|
922
882
|
stroke: e,
|
|
923
883
|
fill: "none",
|
|
@@ -925,8 +885,8 @@ const it = function(t, e, n, o, s) {
|
|
|
925
885
|
"stroke-linecap": "round",
|
|
926
886
|
"stroke-linejoin": "round"
|
|
927
887
|
}), n;
|
|
928
|
-
},
|
|
929
|
-
const n = document.createElementNS(
|
|
888
|
+
}, He = function(t, e) {
|
|
889
|
+
const n = document.createElementNS($, "g");
|
|
930
890
|
n.setAttribute("class", "arrow-highlight"), n.setAttribute("opacity", "0.45");
|
|
931
891
|
const o = Z(t.line.getAttribute("d"), e);
|
|
932
892
|
n.appendChild(o);
|
|
@@ -936,231 +896,217 @@ const it = function(t, e, n, o, s) {
|
|
|
936
896
|
n.appendChild(i);
|
|
937
897
|
}
|
|
938
898
|
t.insertBefore(n, t.firstChild);
|
|
939
|
-
},
|
|
899
|
+
}, Be = function(t) {
|
|
940
900
|
const e = t.querySelector(".arrow-highlight");
|
|
941
901
|
e && e.remove();
|
|
942
|
-
},
|
|
902
|
+
}, Ie = function(t) {
|
|
943
903
|
const e = t.querySelector(".arrow-highlight");
|
|
944
|
-
if (!e)
|
|
945
|
-
return;
|
|
904
|
+
if (!e) return;
|
|
946
905
|
const n = e.querySelectorAll("path");
|
|
947
906
|
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"));
|
|
948
907
|
}, Q = function(t) {
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
const S = B({ ...o, ctrlX: h, ctrlY: y });
|
|
964
|
-
v = S.x, b = S.y, r.style.top = y + "px", r.style.left = h + "px", gt(p, w, f, m, l, h, y, v, b, e), z(a, h, y, v, b), e.delta2.x = h - o.cx, e.delta2.y = y - o.cy, g.fire("updateArrowDelta", e);
|
|
908
|
+
t.helper1?.destroy(), t.helper2?.destroy(), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none", t.currentArrow && Be(t.currentArrow);
|
|
909
|
+
}, kt = function(t, e, n, o) {
|
|
910
|
+
const { linkController: s, P2: i, P3: r, line1: c, line2: a, nodes: h, map: f, currentArrow: p, bus: m } = t;
|
|
911
|
+
if (!p) return;
|
|
912
|
+
s.style.display = "initial", i.style.display = "initial", r.style.display = "initial", h.appendChild(s), h.appendChild(i), h.appendChild(r), He(p, Te);
|
|
913
|
+
let { x: y, y: g } = H(n), { ctrlX: u, ctrlY: l } = n, { ctrlX: d, ctrlY: w } = o, { x: v, y: b } = H(o);
|
|
914
|
+
i.style.cssText = `top:${l}px;left:${u}px;`, r.style.cssText = `top:${w}px;left:${d}px;`, z(c, y, g, u, l), z(a, d, w, v, b), t.helper1 = ft.create(i), t.helper2 = ft.create(r), t.helper1.init(f, (x, C) => {
|
|
915
|
+
u = u + x / t.scaleVal, l = l + C / t.scaleVal;
|
|
916
|
+
const S = H({ ...n, ctrlX: u, ctrlY: l });
|
|
917
|
+
y = S.x, g = S.y, i.style.top = l + "px", i.style.left = u + "px", pt(p, y, g, u, l, d, w, v, b, e), z(c, y, g, u, l), e.delta1.x = u - n.cx, e.delta1.y = l - n.cy, m.fire("updateArrowDelta", e);
|
|
918
|
+
}), t.helper2.init(f, (x, C) => {
|
|
919
|
+
d = d + x / t.scaleVal, w = w + C / t.scaleVal;
|
|
920
|
+
const S = H({ ...o, ctrlX: d, ctrlY: w });
|
|
921
|
+
v = S.x, b = S.y, r.style.top = w + "px", r.style.left = d + "px", pt(p, y, g, u, l, d, w, v, b, e), z(a, d, w, v, b), e.delta2.x = d - o.cx, e.delta2.y = w - o.cy, m.fire("updateArrowDelta", e);
|
|
965
922
|
});
|
|
966
923
|
};
|
|
967
|
-
function
|
|
924
|
+
function We() {
|
|
968
925
|
this.linkSvgGroup.innerHTML = "";
|
|
969
926
|
for (let t = 0; t < this.arrows.length; t++) {
|
|
970
927
|
const e = this.arrows[t];
|
|
971
928
|
try {
|
|
972
|
-
|
|
929
|
+
st(this, this.findEle(e.from), this.findEle(e.to), e, !0);
|
|
973
930
|
} catch {
|
|
974
931
|
}
|
|
975
932
|
}
|
|
976
933
|
this.nodes.appendChild(this.linkSvgGroup);
|
|
977
934
|
}
|
|
978
|
-
function
|
|
979
|
-
Q(this), t && t.labelEl &&
|
|
935
|
+
function Oe(t) {
|
|
936
|
+
Q(this), t && t.labelEl && Ct(this, t.labelEl, t.arrowObj);
|
|
980
937
|
}
|
|
981
|
-
function
|
|
938
|
+
function Ge() {
|
|
982
939
|
this.arrows = this.arrows.filter((t) => q(t.from, this.nodeData) && q(t.to, this.nodeData));
|
|
983
940
|
}
|
|
984
|
-
const
|
|
941
|
+
const Fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
985
942
|
__proto__: null,
|
|
986
|
-
createArrow:
|
|
987
|
-
createArrowFrom:
|
|
988
|
-
editArrowLabel:
|
|
989
|
-
removeArrow:
|
|
990
|
-
renderArrow:
|
|
991
|
-
selectArrow:
|
|
992
|
-
tidyArrow:
|
|
993
|
-
unselectArrow:
|
|
994
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
995
|
-
|
|
996
|
-
if (t.length === 0)
|
|
997
|
-
throw new Error("No selected node.");
|
|
943
|
+
createArrow: De,
|
|
944
|
+
createArrowFrom: Ae,
|
|
945
|
+
editArrowLabel: Oe,
|
|
946
|
+
removeArrow: Ne,
|
|
947
|
+
renderArrow: We,
|
|
948
|
+
selectArrow: Me,
|
|
949
|
+
tidyArrow: Ge,
|
|
950
|
+
unselectArrow: Pe
|
|
951
|
+
}, Symbol.toStringTag, { value: "Module" })), Ve = function(t) {
|
|
952
|
+
if (t.length === 0) throw new Error("No selected node.");
|
|
998
953
|
if (t.length === 1) {
|
|
999
|
-
const
|
|
1000
|
-
if (!
|
|
1001
|
-
|
|
1002
|
-
const g = p.children.findIndex((w) => u === w);
|
|
954
|
+
const a = t[0].nodeObj, h = t[0].nodeObj.parent;
|
|
955
|
+
if (!h) throw new Error("Can not select root node.");
|
|
956
|
+
const f = h.children.findIndex((p) => a === p);
|
|
1003
957
|
return {
|
|
1004
|
-
parent:
|
|
1005
|
-
start:
|
|
1006
|
-
end:
|
|
958
|
+
parent: h.id,
|
|
959
|
+
start: f,
|
|
960
|
+
end: f
|
|
1007
961
|
};
|
|
1008
962
|
}
|
|
1009
963
|
let e = 0;
|
|
1010
|
-
const n = t.map((
|
|
1011
|
-
let
|
|
1012
|
-
const
|
|
1013
|
-
for (;
|
|
1014
|
-
const
|
|
1015
|
-
|
|
964
|
+
const n = t.map((a) => {
|
|
965
|
+
let h = a.nodeObj;
|
|
966
|
+
const f = [];
|
|
967
|
+
for (; h.parent; ) {
|
|
968
|
+
const p = h.parent, y = p.children?.indexOf(h);
|
|
969
|
+
h = p, f.unshift({ node: h, index: y });
|
|
1016
970
|
}
|
|
1017
|
-
return
|
|
971
|
+
return f.length > e && (e = f.length), f;
|
|
1018
972
|
});
|
|
1019
973
|
let o = 0;
|
|
1020
|
-
t:
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
const s = n.map((u) => u[o - 1].index).sort(), i = s[0] || 0, r = s[s.length - 1] || 0, c = n[0][o - 1].node;
|
|
1030
|
-
if (!c.parent)
|
|
1031
|
-
throw new Error("Please select nodes in the same main topic.");
|
|
974
|
+
t: for (; o < e; o++) {
|
|
975
|
+
const a = n[0][o]?.node;
|
|
976
|
+
for (let h = 1; h < n.length; h++)
|
|
977
|
+
if (n[h][o]?.node !== a)
|
|
978
|
+
break t;
|
|
979
|
+
}
|
|
980
|
+
if (!o) throw new Error("Can not select root node.");
|
|
981
|
+
const s = n.map((a) => a[o - 1].index).sort(), i = s[0] || 0, r = s[s.length - 1] || 0, c = n[0][o - 1].node;
|
|
982
|
+
if (!c.parent) throw new Error("Please select nodes in the same main topic.");
|
|
1032
983
|
return {
|
|
1033
984
|
parent: c.id,
|
|
1034
985
|
start: i,
|
|
1035
986
|
end: r
|
|
1036
987
|
};
|
|
1037
|
-
},
|
|
1038
|
-
const e = document.createElementNS(
|
|
988
|
+
}, Re = function(t) {
|
|
989
|
+
const e = document.createElementNS($, "g");
|
|
1039
990
|
return e.setAttribute("id", t), e;
|
|
1040
|
-
},
|
|
1041
|
-
const n = document.createElementNS(
|
|
1042
|
-
return
|
|
991
|
+
}, ut = function(t, e) {
|
|
992
|
+
const n = document.createElementNS($, "path");
|
|
993
|
+
return E(n, {
|
|
1043
994
|
d: t,
|
|
1044
995
|
stroke: e || "#666",
|
|
1045
996
|
fill: "none",
|
|
1046
997
|
"stroke-linecap": "round",
|
|
1047
998
|
"stroke-width": "2"
|
|
1048
999
|
}), n;
|
|
1049
|
-
},
|
|
1000
|
+
}, Ye = (t) => t.parentElement.parentElement, ze = function(t, { parent: e, start: n }) {
|
|
1050
1001
|
const o = t.findEle(e), s = o.nodeObj;
|
|
1051
1002
|
let i;
|
|
1052
1003
|
return s.parent ? i = o.closest("me-main").className : i = t.findEle(s.children[n].id).closest("me-main").className, i;
|
|
1053
|
-
},
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
let f = 1 / 0, m = 0, l = 0, h = 0;
|
|
1004
|
+
}, it = function(t, e) {
|
|
1005
|
+
const { id: n, label: o, parent: s, start: i, end: r, style: c } = e, { nodes: a, theme: h, summarySvg: f } = t, m = t.findEle(s).nodeObj, y = ze(t, e);
|
|
1006
|
+
let g = 1 / 0, u = 0, l = 0, d = 0;
|
|
1057
1007
|
for (let G = i; G <= r; G++) {
|
|
1058
|
-
const
|
|
1059
|
-
if (!
|
|
1008
|
+
const rt = m.children?.[G];
|
|
1009
|
+
if (!rt)
|
|
1060
1010
|
return t.removeSummary(n), null;
|
|
1061
|
-
const R =
|
|
1062
|
-
G === i && (l =
|
|
1011
|
+
const R = Ye(t.findEle(rt.id)), { offsetLeft: Y, offsetTop: ct } = D(a, R), lt = i === r ? 10 : 20;
|
|
1012
|
+
G === i && (l = ct + lt), G === r && (d = ct + R.offsetHeight - lt), Y < g && (g = Y), R.offsetWidth + Y > u && (u = R.offsetWidth + Y);
|
|
1063
1013
|
}
|
|
1064
|
-
let
|
|
1065
|
-
const b =
|
|
1066
|
-
|
|
1067
|
-
const
|
|
1068
|
-
return
|
|
1069
|
-
},
|
|
1070
|
-
if (!this.currentNodes)
|
|
1071
|
-
|
|
1072
|
-
const { currentNodes: e, summaries: n, bus: o } = this, { parent: s, start: i, end: r } = Re(e), c = { id: V(), parent: s, start: i, end: r, label: "summary", style: t.style }, a = rt(this, c);
|
|
1014
|
+
let w, v;
|
|
1015
|
+
const b = m.parent ? 10 : 0, x = l + b, C = d + b, S = (x + C) / 2, L = c?.stroke || h.cssVar["--color"], W = c?.labelColor || h.cssVar["--color"], O = "s-" + n;
|
|
1016
|
+
y === I.LHS ? (w = ut(`M ${g + 10} ${x} c -5 0 -10 5 -10 10 L ${g} ${C - 10} c 0 5 5 10 10 10 M ${g} ${S} h -10`, L), v = tt(o, g - 20, S, { anchor: "end", color: W, dataType: "summary", svgId: O })) : (w = ut(`M ${u - 10} ${x} c 5 0 10 5 10 10 L ${u} ${C - 10} c 0 5 -5 10 -10 10 M ${u} ${S} h 10`, L), v = tt(o, u + 20, S, { anchor: "start", color: W, dataType: "summary", svgId: O }));
|
|
1017
|
+
const N = Re(O);
|
|
1018
|
+
return N.appendChild(w), t.labelContainer.appendChild(v), J(v), N.summaryObj = e, N.labelEl = v, f.appendChild(N), N;
|
|
1019
|
+
}, je = function(t = {}) {
|
|
1020
|
+
if (!this.currentNodes) return;
|
|
1021
|
+
const { currentNodes: e, summaries: n, bus: o } = this, { parent: s, start: i, end: r } = Ve(e), c = { id: V(), parent: s, start: i, end: r, label: "summary", style: t.style }, a = it(this, c);
|
|
1073
1022
|
n.push(c), this.editSummary(a), o.fire("operation", {
|
|
1074
1023
|
name: "createSummary",
|
|
1075
1024
|
obj: c
|
|
1076
1025
|
});
|
|
1077
|
-
},
|
|
1026
|
+
}, Xe = function(t) {
|
|
1078
1027
|
const e = V(), n = { ...t, id: e };
|
|
1079
|
-
|
|
1028
|
+
it(this, n), this.summaries.push(n), this.bus.fire("operation", {
|
|
1080
1029
|
name: "createSummary",
|
|
1081
1030
|
obj: n
|
|
1082
1031
|
});
|
|
1083
|
-
},
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
e > -1 && (this.summaries.splice(e, 1), (n = this.nodes.querySelector("#s-" + t)) == null || n.remove(), (o = this.nodes.querySelector("#label-s-" + t)) == null || o.remove()), this.bus.fire("operation", {
|
|
1032
|
+
}, qe = function(t) {
|
|
1033
|
+
const e = this.summaries.findIndex((n) => n.id === t);
|
|
1034
|
+
e > -1 && (this.summaries.splice(e, 1), this.nodes.querySelector("#s-" + t)?.remove(), this.nodes.querySelector("#label-s-" + t)?.remove()), this.bus.fire("operation", {
|
|
1087
1035
|
name: "removeSummary",
|
|
1088
1036
|
obj: { id: t }
|
|
1089
1037
|
});
|
|
1090
|
-
},
|
|
1038
|
+
}, _e = function(t) {
|
|
1091
1039
|
const e = t.labelEl;
|
|
1092
1040
|
e && e.classList.add("selected"), this.currentSummary = t;
|
|
1041
|
+
}, Ue = function() {
|
|
1042
|
+
this.currentSummary?.labelEl?.classList.remove("selected"), this.currentSummary = null;
|
|
1093
1043
|
}, Ke = function() {
|
|
1094
|
-
var t, e;
|
|
1095
|
-
(e = (t = this.currentSummary) == null ? void 0 : t.labelEl) == null || e.classList.remove("selected"), this.currentSummary = null;
|
|
1096
|
-
}, Je = function() {
|
|
1097
1044
|
this.summarySvg.innerHTML = "", this.summaries.forEach((t) => {
|
|
1098
1045
|
try {
|
|
1099
|
-
|
|
1046
|
+
it(this, t);
|
|
1100
1047
|
} catch {
|
|
1101
1048
|
}
|
|
1102
1049
|
}), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
|
|
1103
|
-
},
|
|
1104
|
-
t && t.labelEl &&
|
|
1105
|
-
},
|
|
1050
|
+
}, Je = function(t) {
|
|
1051
|
+
t && t.labelEl && Ct(this, t.labelEl, t.summaryObj);
|
|
1052
|
+
}, Qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1106
1053
|
__proto__: null,
|
|
1107
|
-
createSummary:
|
|
1108
|
-
createSummaryFrom:
|
|
1109
|
-
editSummary:
|
|
1110
|
-
removeSummary:
|
|
1111
|
-
renderSummary:
|
|
1112
|
-
selectSummary:
|
|
1113
|
-
unselectSummary:
|
|
1054
|
+
createSummary: je,
|
|
1055
|
+
createSummaryFrom: Xe,
|
|
1056
|
+
editSummary: Je,
|
|
1057
|
+
removeSummary: qe,
|
|
1058
|
+
renderSummary: Ke,
|
|
1059
|
+
selectSummary: _e,
|
|
1060
|
+
unselectSummary: Ue
|
|
1114
1061
|
}, Symbol.toStringTag, { value: "Module" })), T = "http://www.w3.org/2000/svg";
|
|
1115
|
-
function
|
|
1062
|
+
function Ze(t, e) {
|
|
1116
1063
|
const n = document.createElementNS(T, "svg");
|
|
1117
|
-
return
|
|
1064
|
+
return E(n, {
|
|
1118
1065
|
version: "1.1",
|
|
1119
1066
|
xmlns: T,
|
|
1120
1067
|
height: t,
|
|
1121
1068
|
width: e
|
|
1122
1069
|
}), n;
|
|
1123
1070
|
}
|
|
1124
|
-
function
|
|
1071
|
+
function tn(t, e) {
|
|
1125
1072
|
return (parseInt(t) - parseInt(e)) / 2;
|
|
1126
1073
|
}
|
|
1127
|
-
function
|
|
1074
|
+
function en(t, e, n, o) {
|
|
1128
1075
|
const s = document.createElementNS(T, "g");
|
|
1129
1076
|
let i = "";
|
|
1130
1077
|
return t.text ? i = t.text.textContent : i = t.childNodes[0].textContent, i.split(`
|
|
1131
1078
|
`).forEach((c, a) => {
|
|
1132
|
-
const
|
|
1133
|
-
|
|
1079
|
+
const h = document.createElementNS(T, "text");
|
|
1080
|
+
E(h, {
|
|
1134
1081
|
x: n + parseInt(e.paddingLeft) + "",
|
|
1135
|
-
y: o + parseInt(e.paddingTop) +
|
|
1082
|
+
y: o + parseInt(e.paddingTop) + tn(e.lineHeight, e.fontSize) * (a + 1) + parseFloat(e.fontSize) * (a + 1) + "",
|
|
1136
1083
|
"text-anchor": "start",
|
|
1137
1084
|
"font-family": e.fontFamily,
|
|
1138
1085
|
"font-size": `${e.fontSize}`,
|
|
1139
1086
|
"font-weight": `${e.fontWeight}`,
|
|
1140
1087
|
fill: `${e.color}`
|
|
1141
|
-
}),
|
|
1088
|
+
}), h.innerHTML = c, s.appendChild(h);
|
|
1142
1089
|
}), s;
|
|
1143
1090
|
}
|
|
1144
|
-
function
|
|
1145
|
-
var c;
|
|
1091
|
+
function nn(t, e, n, o) {
|
|
1146
1092
|
let s = "";
|
|
1147
|
-
|
|
1093
|
+
t.nodeObj?.dangerouslySetInnerHTML ? s = t.nodeObj.dangerouslySetInnerHTML : t.text ? s = t.text.textContent : s = t.childNodes[0].textContent;
|
|
1148
1094
|
const i = document.createElementNS(T, "foreignObject");
|
|
1149
|
-
|
|
1095
|
+
E(i, {
|
|
1150
1096
|
x: n + parseInt(e.paddingLeft) + "",
|
|
1151
1097
|
y: o + parseInt(e.paddingTop) + "",
|
|
1152
1098
|
width: e.width,
|
|
1153
1099
|
height: e.height
|
|
1154
1100
|
});
|
|
1155
1101
|
const r = document.createElement("div");
|
|
1156
|
-
return
|
|
1102
|
+
return E(r, {
|
|
1157
1103
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
1158
1104
|
style: `font-family: ${e.fontFamily}; font-size: ${e.fontSize}; font-weight: ${e.fontWeight}; color: ${e.color}; white-space: pre-wrap;`
|
|
1159
1105
|
}), r.innerHTML = s, i.appendChild(r), i;
|
|
1160
1106
|
}
|
|
1161
|
-
function
|
|
1162
|
-
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } =
|
|
1163
|
-
return
|
|
1107
|
+
function on(t, e) {
|
|
1108
|
+
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = D(t.nodes, e), i = document.createElementNS(T, "rect");
|
|
1109
|
+
return E(i, {
|
|
1164
1110
|
x: o + "",
|
|
1165
1111
|
y: s + "",
|
|
1166
1112
|
rx: n.borderRadius,
|
|
@@ -1173,8 +1119,8 @@ function sn(t, e) {
|
|
|
1173
1119
|
}), i;
|
|
1174
1120
|
}
|
|
1175
1121
|
function j(t, e, n = !1) {
|
|
1176
|
-
const o = getComputedStyle(e), { offsetLeft: s, offsetTop: i } =
|
|
1177
|
-
|
|
1122
|
+
const o = getComputedStyle(e), { offsetLeft: s, offsetTop: i } = D(t.nodes, e), r = document.createElementNS(T, "rect");
|
|
1123
|
+
E(r, {
|
|
1178
1124
|
x: s + "",
|
|
1179
1125
|
y: i + "",
|
|
1180
1126
|
rx: o.borderRadius,
|
|
@@ -1188,11 +1134,11 @@ function j(t, e, n = !1) {
|
|
|
1188
1134
|
const c = document.createElementNS(T, "g");
|
|
1189
1135
|
c.appendChild(r);
|
|
1190
1136
|
let a;
|
|
1191
|
-
return n ? a =
|
|
1137
|
+
return n ? a = nn(e, o, s, i) : a = en(e, o, s, i), c.appendChild(a), c;
|
|
1192
1138
|
}
|
|
1193
|
-
function
|
|
1194
|
-
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } =
|
|
1195
|
-
return
|
|
1139
|
+
function sn(t, e) {
|
|
1140
|
+
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = D(t.nodes, e), i = document.createElementNS(T, "a"), r = document.createElementNS(T, "text");
|
|
1141
|
+
return E(r, {
|
|
1196
1142
|
x: o + "",
|
|
1197
1143
|
y: s + parseInt(n.fontSize) + "",
|
|
1198
1144
|
"text-anchor": "start",
|
|
@@ -1202,9 +1148,9 @@ function rn(t, e) {
|
|
|
1202
1148
|
fill: `${n.color}`
|
|
1203
1149
|
}), r.innerHTML = e.textContent, i.appendChild(r), i.setAttribute("href", e.href), i;
|
|
1204
1150
|
}
|
|
1205
|
-
function
|
|
1206
|
-
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } =
|
|
1207
|
-
return
|
|
1151
|
+
function rn(t, e) {
|
|
1152
|
+
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = D(t.nodes, e), i = document.createElementNS(T, "image");
|
|
1153
|
+
return E(i, {
|
|
1208
1154
|
x: o + "",
|
|
1209
1155
|
y: s + "",
|
|
1210
1156
|
width: n.width + "",
|
|
@@ -1212,41 +1158,40 @@ function cn(t, e) {
|
|
|
1212
1158
|
href: e.src
|
|
1213
1159
|
}), i;
|
|
1214
1160
|
}
|
|
1215
|
-
const X = 100,
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
L(c, {
|
|
1161
|
+
const X = 100, cn = '<?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">', ln = (t, e = !1) => {
|
|
1162
|
+
const n = t.nodes, o = n.offsetHeight + X * 2, s = n.offsetWidth + X * 2, i = Ze(o + "px", s + "px"), r = document.createElementNS(T, "svg"), c = document.createElementNS(T, "rect");
|
|
1163
|
+
E(c, {
|
|
1219
1164
|
x: "0",
|
|
1220
1165
|
y: "0",
|
|
1221
1166
|
width: `${s}`,
|
|
1222
1167
|
height: `${o}`,
|
|
1223
1168
|
fill: t.theme.cssVar["--bgcolor"]
|
|
1224
|
-
}), i.appendChild(c), n.querySelectorAll(".subLines").forEach((
|
|
1225
|
-
const m =
|
|
1226
|
-
m.setAttribute("x", `${
|
|
1169
|
+
}), i.appendChild(c), n.querySelectorAll(".subLines").forEach((p) => {
|
|
1170
|
+
const m = p.cloneNode(!0), { offsetLeft: y, offsetTop: g } = D(n, p.parentElement);
|
|
1171
|
+
m.setAttribute("x", `${y}`), m.setAttribute("y", `${g}`), r.appendChild(m);
|
|
1227
1172
|
});
|
|
1228
|
-
const a =
|
|
1173
|
+
const a = n.querySelector(".lines")?.cloneNode(!0);
|
|
1229
1174
|
a && r.appendChild(a);
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1232
|
-
const
|
|
1233
|
-
return
|
|
1234
|
-
|
|
1235
|
-
}), n.querySelectorAll(".tags > span").forEach((
|
|
1236
|
-
r.appendChild(j(t,
|
|
1237
|
-
}), n.querySelectorAll(".icons > span").forEach((
|
|
1238
|
-
r.appendChild(j(t,
|
|
1239
|
-
}), n.querySelectorAll(".hyper-link").forEach((
|
|
1240
|
-
r.appendChild(
|
|
1241
|
-
}), n.querySelectorAll("img").forEach((
|
|
1242
|
-
r.appendChild(
|
|
1243
|
-
}),
|
|
1175
|
+
const h = n.querySelector(".topiclinks")?.cloneNode(!0);
|
|
1176
|
+
h && r.appendChild(h);
|
|
1177
|
+
const f = n.querySelector(".summary")?.cloneNode(!0);
|
|
1178
|
+
return f && r.appendChild(f), n.querySelectorAll("me-tpc").forEach((p) => {
|
|
1179
|
+
p.nodeObj.dangerouslySetInnerHTML ? r.appendChild(j(t, p, !e)) : (r.appendChild(on(t, p)), r.appendChild(j(t, p.text, !e)));
|
|
1180
|
+
}), n.querySelectorAll(".tags > span").forEach((p) => {
|
|
1181
|
+
r.appendChild(j(t, p));
|
|
1182
|
+
}), n.querySelectorAll(".icons > span").forEach((p) => {
|
|
1183
|
+
r.appendChild(j(t, p));
|
|
1184
|
+
}), n.querySelectorAll(".hyper-link").forEach((p) => {
|
|
1185
|
+
r.appendChild(sn(t, p));
|
|
1186
|
+
}), n.querySelectorAll("img").forEach((p) => {
|
|
1187
|
+
r.appendChild(rn(t, p));
|
|
1188
|
+
}), E(r, {
|
|
1244
1189
|
x: X + "",
|
|
1245
1190
|
y: X + "",
|
|
1246
1191
|
overflow: "visible"
|
|
1247
1192
|
}), i.appendChild(r), i;
|
|
1248
|
-
},
|
|
1249
|
-
function
|
|
1193
|
+
}, an = (t, e) => (e && t.insertAdjacentHTML("afterbegin", "<style>" + e + "</style>"), cn + t.outerHTML);
|
|
1194
|
+
function hn(t) {
|
|
1250
1195
|
return new Promise((e, n) => {
|
|
1251
1196
|
const o = new FileReader();
|
|
1252
1197
|
o.onload = (s) => {
|
|
@@ -1256,11 +1201,11 @@ function dn(t) {
|
|
|
1256
1201
|
}, o.readAsDataURL(t);
|
|
1257
1202
|
});
|
|
1258
1203
|
}
|
|
1259
|
-
const
|
|
1260
|
-
const n =
|
|
1204
|
+
const dn = function(t = !1, e) {
|
|
1205
|
+
const n = ln(this, t), o = an(n, e);
|
|
1261
1206
|
return new Blob([o], { type: "image/svg+xml" });
|
|
1262
|
-
},
|
|
1263
|
-
const n = this.exportSvg(t, e), o = await
|
|
1207
|
+
}, fn = async function(t = !1, e) {
|
|
1208
|
+
const n = this.exportSvg(t, e), o = await hn(n);
|
|
1264
1209
|
return new Promise((s, i) => {
|
|
1265
1210
|
const r = new Image();
|
|
1266
1211
|
r.setAttribute("crossOrigin", "anonymous"), r.onload = () => {
|
|
@@ -1270,54 +1215,52 @@ const fn = function(t = !1, e) {
|
|
|
1270
1215
|
});
|
|
1271
1216
|
}, pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1272
1217
|
__proto__: null,
|
|
1273
|
-
exportPng:
|
|
1274
|
-
exportSvg:
|
|
1275
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1218
|
+
exportPng: fn,
|
|
1219
|
+
exportSvg: dn
|
|
1220
|
+
}, Symbol.toStringTag, { value: "Module" })), un = {}, gn = {
|
|
1276
1221
|
getObjById: q,
|
|
1277
|
-
generateNewObj:
|
|
1278
|
-
layout:
|
|
1279
|
-
linkDiv:
|
|
1280
|
-
editTopic:
|
|
1281
|
-
createWrapper:
|
|
1282
|
-
createParent:
|
|
1283
|
-
createChildren:
|
|
1284
|
-
createTopic:
|
|
1285
|
-
findEle:
|
|
1286
|
-
changeTheme:
|
|
1287
|
-
...
|
|
1288
|
-
...
|
|
1289
|
-
...
|
|
1290
|
-
...
|
|
1222
|
+
generateNewObj: $t,
|
|
1223
|
+
layout: Nt,
|
|
1224
|
+
linkDiv: Vt,
|
|
1225
|
+
editTopic: Ot,
|
|
1226
|
+
createWrapper: Ht,
|
|
1227
|
+
createParent: Bt,
|
|
1228
|
+
createChildren: It,
|
|
1229
|
+
createTopic: Wt,
|
|
1230
|
+
findEle: wt,
|
|
1231
|
+
changeTheme: Zt,
|
|
1232
|
+
...Le,
|
|
1233
|
+
...un,
|
|
1234
|
+
...Fe,
|
|
1235
|
+
...Qe,
|
|
1291
1236
|
...pn,
|
|
1292
1237
|
init(t) {
|
|
1293
|
-
if (t = JSON.parse(JSON.stringify(t)), !t || !t.nodeData)
|
|
1294
|
-
|
|
1295
|
-
t.direction !== void 0 && (this.direction = t.direction), this.changeTheme(t.theme || this.theme, !1), this.nodeData = t.nodeData, st(this.nodeData), this.arrows = t.arrows || [], this.summaries = t.summaries || [], this.tidyArrow(), this.toolBar && Zt(this), this.layout(), this.linkDiv(), this.toCenter();
|
|
1238
|
+
if (t = JSON.parse(JSON.stringify(t)), !t || !t.nodeData) return new Error("MindElixir: `data` is required");
|
|
1239
|
+
t.direction !== void 0 && (this.direction = t.direction), this.changeTheme(t.theme || this.theme, !1), this.nodeData = t.nodeData, ot(this.nodeData), this.arrows = t.arrows || [], this.summaries = t.summaries || [], this.tidyArrow(), this.toolBar && Qt(this), this.layout(), this.linkDiv(), this.toCenter();
|
|
1296
1240
|
},
|
|
1297
1241
|
destroy() {
|
|
1298
|
-
|
|
1299
|
-
this.disposable.forEach((e) => e()), this.el && (this.el.innerHTML = ""), this.el = void 0, this.nodeData = void 0, this.arrows = void 0, this.summaries = void 0, this.currentArrow = void 0, this.currentNodes = void 0, this.currentSummary = void 0, this.waitCopy = void 0, this.theme = void 0, this.direction = void 0, this.bus = void 0, this.container = void 0, this.map = void 0, this.lines = void 0, this.linkController = void 0, this.linkSvgGroup = void 0, this.P2 = void 0, this.P3 = void 0, this.line1 = void 0, this.line2 = void 0, this.nodes = void 0, (t = this.selection) == null || t.destroy(), this.selection = void 0;
|
|
1242
|
+
this.disposable.forEach((t) => t()), this.el && (this.el.innerHTML = ""), this.el = void 0, this.nodeData = void 0, this.arrows = void 0, this.summaries = void 0, this.currentArrow = void 0, this.currentNodes = void 0, this.currentSummary = void 0, this.waitCopy = void 0, this.theme = void 0, this.direction = void 0, this.bus = void 0, this.container = void 0, this.map = void 0, this.lines = void 0, this.linkController = void 0, this.linkSvgGroup = void 0, this.P2 = void 0, this.P3 = void 0, this.line1 = void 0, this.line2 = void 0, this.nodes = void 0, this.selection?.destroy(), this.selection = void 0;
|
|
1300
1243
|
}
|
|
1301
1244
|
};
|
|
1302
|
-
function
|
|
1303
|
-
let
|
|
1245
|
+
function mn({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: a, containerHeight: h }) {
|
|
1246
|
+
let f = e + n / 2;
|
|
1304
1247
|
const p = t + o / 2;
|
|
1305
|
-
let
|
|
1306
|
-
a ===
|
|
1307
|
-
const
|
|
1308
|
-
return a ===
|
|
1248
|
+
let m;
|
|
1249
|
+
a === I.LHS ? m = i + r : m = i;
|
|
1250
|
+
const y = s + c / 2, u = (1 - Math.abs(y - p) / h) * 0.25 * (n / 2);
|
|
1251
|
+
return a === I.LHS ? f = f - n / 10 - u : f = f + n / 10 + u, `M ${f} ${p} Q ${f} ${y} ${m} ${y}`;
|
|
1309
1252
|
}
|
|
1310
|
-
function
|
|
1311
|
-
const
|
|
1312
|
-
let p = 0,
|
|
1313
|
-
|
|
1314
|
-
const
|
|
1315
|
-
let
|
|
1316
|
-
const
|
|
1317
|
-
return a ===
|
|
1253
|
+
function yn({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: a, isFirst: h }) {
|
|
1254
|
+
const f = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
|
|
1255
|
+
let p = 0, m = 0;
|
|
1256
|
+
h ? p = t + o / 2 : p = t + o;
|
|
1257
|
+
const y = s + c;
|
|
1258
|
+
let g = 0, u = 0, l = 0;
|
|
1259
|
+
const d = Math.abs(p - y) / 300 * f;
|
|
1260
|
+
return a === I.LHS ? (l = e, g = l + f, u = l - f, m = i + f, `M ${g} ${p} C ${l} ${p} ${l + d} ${y} ${u} ${y} H ${m}`) : (l = e + n, g = l - f, u = l + f, m = i + r - f, `M ${g} ${p} C ${l} ${p} ${l - d} ${y} ${u} ${y} H ${m}`);
|
|
1318
1261
|
}
|
|
1319
|
-
const
|
|
1320
|
-
function
|
|
1262
|
+
const wn = "5.3.0";
|
|
1263
|
+
function bn(t) {
|
|
1321
1264
|
return {
|
|
1322
1265
|
x: 0,
|
|
1323
1266
|
y: 0,
|
|
@@ -1332,8 +1275,8 @@ function vn(t) {
|
|
|
1332
1275
|
}
|
|
1333
1276
|
};
|
|
1334
1277
|
}
|
|
1335
|
-
const
|
|
1336
|
-
function
|
|
1278
|
+
const P = document;
|
|
1279
|
+
function A({
|
|
1337
1280
|
el: t,
|
|
1338
1281
|
direction: e,
|
|
1339
1282
|
locale: n,
|
|
@@ -1343,46 +1286,45 @@ function N({
|
|
|
1343
1286
|
toolBar: r,
|
|
1344
1287
|
keypress: c,
|
|
1345
1288
|
mouseSelectionButton: a,
|
|
1346
|
-
selectionContainer:
|
|
1347
|
-
before:
|
|
1289
|
+
selectionContainer: h,
|
|
1290
|
+
before: f,
|
|
1348
1291
|
newTopicName: p,
|
|
1349
|
-
allowUndo:
|
|
1350
|
-
generateMainBranch:
|
|
1351
|
-
generateSubBranch:
|
|
1352
|
-
overflowHidden:
|
|
1292
|
+
allowUndo: m,
|
|
1293
|
+
generateMainBranch: y,
|
|
1294
|
+
generateSubBranch: g,
|
|
1295
|
+
overflowHidden: u,
|
|
1353
1296
|
theme: l,
|
|
1354
|
-
alignment:
|
|
1355
|
-
scaleSensitivity:
|
|
1297
|
+
alignment: d,
|
|
1298
|
+
scaleSensitivity: w,
|
|
1356
1299
|
scaleMax: v,
|
|
1357
1300
|
scaleMin: b,
|
|
1358
|
-
handleWheel:
|
|
1359
|
-
markdown:
|
|
1301
|
+
handleWheel: x,
|
|
1302
|
+
markdown: C,
|
|
1360
1303
|
imageProxy: S
|
|
1361
1304
|
}) {
|
|
1362
|
-
let
|
|
1363
|
-
const
|
|
1364
|
-
if (
|
|
1365
|
-
|
|
1366
|
-
E.style.position = "relative", E.innerHTML = "", this.el = E, this.disposable = [], this.before = u || {}, this.locale = n || "en", this.newTopicName = p || "New Node", this.contextMenu = i ?? !0, this.toolBar = r ?? !0, this.keypress = c ?? !0, this.mouseSelectionButton = a ?? 0, this.direction = e ?? 1, this.draggable = o ?? !0, this.editable = s ?? !0, this.allowUndo = g ?? !0, this.scaleSensitivity = y ?? 0.1, this.scaleMax = v ?? 1.4, this.scaleMin = b ?? 0.2, this.generateMainBranch = w || yn, this.generateSubBranch = f || wn, this.overflowHidden = m ?? !1, this.alignment = h ?? "root", this.handleWheel = C ?? !0, this.markdown = x || void 0, this.imageProxy = S || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = vn(this), this.bus = Nt(), this.container = H.createElement("div"), this.selectionContainer = d || this.container, this.container.className = "map-container";
|
|
1305
|
+
let L = null;
|
|
1306
|
+
const W = Object.prototype.toString.call(t);
|
|
1307
|
+
if (W === "[object HTMLDivElement]" ? L = t : W === "[object String]" && (L = document.querySelector(t)), !L) throw new Error("MindElixir: el is not a valid element");
|
|
1308
|
+
L.style.position = "relative", L.innerHTML = "", this.el = L, this.disposable = [], this.before = f || {}, this.locale = n || "en", this.newTopicName = p || "New Node", this.contextMenu = i ?? !0, this.toolBar = r ?? !0, this.keypress = c ?? !0, this.mouseSelectionButton = a ?? 0, this.direction = e ?? 1, this.draggable = o ?? !0, this.editable = s ?? !0, this.allowUndo = m ?? !0, this.scaleSensitivity = w ?? 0.1, this.scaleMax = v ?? 1.4, this.scaleMin = b ?? 0.2, this.generateMainBranch = y || mn, this.generateSubBranch = g || yn, this.overflowHidden = u ?? !1, this.alignment = d ?? "root", this.handleWheel = x ?? !0, this.markdown = C || void 0, this.imageProxy = S || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = bn(this), this.bus = At(), this.container = P.createElement("div"), this.selectionContainer = h || this.container, this.container.className = "map-container";
|
|
1367
1309
|
const O = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1368
|
-
this.theme = l || (O.matches ?
|
|
1369
|
-
const
|
|
1370
|
-
|
|
1310
|
+
this.theme = l || (O.matches ? nt : et);
|
|
1311
|
+
const N = P.createElement("div");
|
|
1312
|
+
N.className = "map-canvas", this.map = N, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = P.createElement("me-nodes"), this.lines = F("lines"), this.summarySvg = F("summary"), this.linkController = F("linkcontroller"), this.P2 = P.createElement("div"), this.P3 = P.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = dt(), this.line2 = dt(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = F("topiclinks"), this.labelContainer = P.createElement("div"), this.labelContainer.className = "label-container", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(Dt(this));
|
|
1371
1313
|
}
|
|
1372
|
-
|
|
1373
|
-
Object.defineProperty(
|
|
1314
|
+
A.prototype = gn;
|
|
1315
|
+
Object.defineProperty(A.prototype, "currentNode", {
|
|
1374
1316
|
get() {
|
|
1375
1317
|
return this.currentNodes[this.currentNodes.length - 1];
|
|
1376
1318
|
},
|
|
1377
1319
|
enumerable: !0
|
|
1378
1320
|
});
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1321
|
+
A.LEFT = 0;
|
|
1322
|
+
A.RIGHT = 1;
|
|
1323
|
+
A.SIDE = 2;
|
|
1324
|
+
A.THEME = et;
|
|
1325
|
+
A.DARK_THEME = nt;
|
|
1326
|
+
A.version = wn;
|
|
1327
|
+
A.E = wt;
|
|
1386
1328
|
export {
|
|
1387
|
-
|
|
1329
|
+
A as default
|
|
1388
1330
|
};
|