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