@xiangfa/mindmap 0.4.0 → 0.5.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/README.md +32 -0
- package/README.zh-CN.md +32 -0
- package/dist/components/MindMapContextMenu.d.ts +1 -1
- package/dist/components/MindMapControls.d.ts +1 -1
- package/dist/esm/MindMap2.js +321 -333
- package/dist/esm/components/MindMapAIInput.js +2 -12
- package/dist/esm/components/MindMapContextMenu.js +28 -57
- package/dist/esm/components/MindMapControls.js +14 -27
- package/dist/esm/components/MindMapNode.js +8 -27
- package/dist/esm/style.css +1 -1
- package/dist/esm/utils/export.js +25 -25
- package/dist/esm/utils/layout.js +26 -18
- package/dist/esm/utils/theme.js +44 -1
- package/dist/mindmap.umd.cjs +22 -25
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/utils/export.d.ts +2 -1
- package/dist/utils/theme.d.ts +10 -0
- package/package.json +1 -1
package/dist/esm/MindMap2.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { generateCSSVariables as e } from "./utils/theme.js";
|
|
2
|
+
import { runRenderOverlay as t } from "./plugins/runner.js";
|
|
3
|
+
import { computeEdgePath as n, layoutMultiRoot as r } from "./utils/layout.js";
|
|
4
|
+
import { buildExportSVG as i, buildExportSVGForPNG as a, exportToPNG as o } from "./utils/export.js";
|
|
5
|
+
import { parseMarkdownMultiRoot as s, parseMarkdownWithFrontMatter as c, toMarkdownMultiRoot as l } from "./utils/markdown.js";
|
|
5
6
|
import { detectLocale as ee, resolveMessages as te } from "./utils/i18n.js";
|
|
6
7
|
import { addChildMulti as ne, addChildToSide as re, findSubtreeMulti as ie, generateId as ae, normalizeData as oe, regenerateIds as se, removeNodeMulti as ce } from "./utils/tree-ops.js";
|
|
7
8
|
import { useTheme as le } from "./hooks/useTheme.js";
|
|
@@ -14,18 +15,18 @@ import { MindMapControls as he } from "./components/MindMapControls.js";
|
|
|
14
15
|
import { MindMapContextMenu as ge } from "./components/MindMapContextMenu.js";
|
|
15
16
|
import { MindMapAIInput as _e } from "./components/MindMapAIInput.js";
|
|
16
17
|
/* empty css */
|
|
17
|
-
import { forwardRef as
|
|
18
|
-
import { Fragment as ye, jsx as
|
|
18
|
+
import { forwardRef as u, useCallback as d, useEffect as f, useImperativeHandle as ve, useMemo as p, useRef as m, useState as h } from "react";
|
|
19
|
+
import { Fragment as ye, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
19
20
|
//#region src/components/MindMap/MindMap.tsx
|
|
20
21
|
function be(e, t) {
|
|
21
22
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
22
23
|
r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
|
|
23
24
|
}
|
|
24
|
-
var
|
|
25
|
-
let Ae =
|
|
26
|
-
if (
|
|
27
|
-
if (
|
|
28
|
-
let e =
|
|
25
|
+
var v = u(function({ data: u, markdown: v, defaultDirection: xe = "both", theme: Se = "auto", locale: Ce, messages: we, readonly: y = !1, toolbar: b = !0, ai: Te, onDataChange: Ee, onEvent: De, plugins: Oe }, ke) {
|
|
26
|
+
let Ae = m(null), x = m(null), S = Oe && Oe.length > 0 ? Oe : void 0, C = p(() => {
|
|
27
|
+
if (u || v === void 0) return null;
|
|
28
|
+
if (S) {
|
|
29
|
+
let e = c(v, S), t = e.frontMatter.direction, n = e.frontMatter.theme;
|
|
29
30
|
return {
|
|
30
31
|
roots: e.roots,
|
|
31
32
|
direction: t === "left" || t === "right" || t === "both" ? t : void 0,
|
|
@@ -33,142 +34,142 @@ var _ = l(function({ data: l, markdown: _, defaultDirection: xe = "both", theme:
|
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
return {
|
|
36
|
-
roots:
|
|
37
|
+
roots: s(v),
|
|
37
38
|
direction: void 0,
|
|
38
39
|
theme: void 0
|
|
39
40
|
};
|
|
40
|
-
}, []), [
|
|
41
|
+
}, []), [w, T] = h(() => u ? oe(u) : C ? C.roots : [{
|
|
41
42
|
id: "md-0",
|
|
42
43
|
text: "Root"
|
|
43
|
-
}]), [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}, [
|
|
47
|
-
if (
|
|
48
|
-
let { roots: e, frontMatter: t } =
|
|
49
|
-
if (
|
|
44
|
+
}]), [E, je] = h(() => C?.direction ?? xe), [D, O] = h({}), [k, A] = h(null), [j, Me] = h(null), [M, Ne] = h({}), Pe = m(null), [Fe, Ie] = h("view"), [Le, Re] = h(!1), [ze, N] = h(""), [Be, Ve] = h(null), [He, Ue] = h({}), [We, Ge] = h(null), [Ke, qe] = h(() => C?.theme);
|
|
45
|
+
f(() => {
|
|
46
|
+
u && T(oe(u));
|
|
47
|
+
}, [u]), f(() => {
|
|
48
|
+
if (v !== void 0) if (S) {
|
|
49
|
+
let { roots: e, frontMatter: t } = c(v, S);
|
|
50
|
+
if (T(e), t.direction) {
|
|
50
51
|
let e = t.direction;
|
|
51
52
|
(e === "left" || e === "right" || e === "both") && je(e);
|
|
52
53
|
}
|
|
53
54
|
if (t.theme) {
|
|
54
55
|
let e = t.theme;
|
|
55
|
-
(e === "light" || e === "dark" || e === "auto") &&
|
|
56
|
+
(e === "light" || e === "dark" || e === "auto") && qe(e);
|
|
56
57
|
}
|
|
57
|
-
} else
|
|
58
|
-
}, [
|
|
59
|
-
let
|
|
60
|
-
|
|
58
|
+
} else T(s(v));
|
|
59
|
+
}, [v, S]);
|
|
60
|
+
let P = d((e) => {
|
|
61
|
+
T((t) => {
|
|
61
62
|
let n = e(t);
|
|
62
63
|
return Ee?.(n), n;
|
|
63
64
|
});
|
|
64
|
-
}, [Ee]),
|
|
65
|
-
|
|
66
|
-
let
|
|
67
|
-
|
|
68
|
-
}, []),
|
|
69
|
-
|
|
70
|
-
T,
|
|
71
|
-
j,
|
|
65
|
+
}, [Ee]), Je = m(De);
|
|
66
|
+
Je.current = De;
|
|
67
|
+
let F = d((e) => {
|
|
68
|
+
Je.current?.(e);
|
|
69
|
+
}, []), I = le(Ke ?? Se), L = p(() => te(Ce ?? ee(), we), [Ce, we]), Ye = p(() => b === !1 ? { zoom: !1 } : b === !0 || b === void 0 ? { zoom: !0 } : { zoom: b.zoom ?? !0 }, [b]), { nodes: R, edges: z } = p(() => r(w, E, M, D, S, y, He), [
|
|
70
|
+
w,
|
|
72
71
|
E,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
M,
|
|
73
|
+
D,
|
|
74
|
+
S,
|
|
75
|
+
y,
|
|
76
|
+
He
|
|
76
77
|
]);
|
|
77
|
-
|
|
78
|
+
f(() => {
|
|
78
79
|
let e = {}, t = !1;
|
|
79
|
-
for (let n of
|
|
80
|
+
for (let n of R) n.depth === 1 && !M[n.id] && (e[n.id] = n.color, t = !0);
|
|
80
81
|
t && Ne((t) => ({
|
|
81
82
|
...t,
|
|
82
83
|
...e
|
|
83
84
|
}));
|
|
84
|
-
}, [
|
|
85
|
-
let
|
|
85
|
+
}, [R, M]);
|
|
86
|
+
let B = p(() => {
|
|
86
87
|
let e = {};
|
|
87
|
-
for (let t of
|
|
88
|
+
for (let t of R) e[t.id] = t;
|
|
88
89
|
return e;
|
|
89
|
-
}, [
|
|
90
|
-
if (!
|
|
90
|
+
}, [R]), Xe = p(() => {
|
|
91
|
+
if (!We) return {};
|
|
91
92
|
let e = {}, t = [];
|
|
92
|
-
for (let e of
|
|
93
|
+
for (let e of R) e.parentId === We && t.push({
|
|
93
94
|
id: e.id,
|
|
94
95
|
depth: 1
|
|
95
96
|
});
|
|
96
97
|
for (; t.length > 0;) {
|
|
97
98
|
let { id: n, depth: r } = t.shift();
|
|
98
99
|
e[n] = r * 100;
|
|
99
|
-
for (let e of
|
|
100
|
+
for (let e of R) e.parentId === n && t.push({
|
|
100
101
|
id: e.id,
|
|
101
102
|
depth: r + 1
|
|
102
103
|
});
|
|
103
104
|
}
|
|
104
105
|
return e;
|
|
105
|
-
}, [
|
|
106
|
-
svgRef:
|
|
106
|
+
}, [We, R]), { pan: V, setPan: H, zoom: U, setZoom: Ze, animateTo: Qe, autoFit: $e, zoomIn: et, zoomOut: tt, contentCenter: nt, panToNode: rt } = ue(x, R), { draggingCanvas: it, floatingNodeId: W, floatingPos: G, floatingSubtreeIds: K, didDragRef: at, handleCanvasMouseDown: ot, handleMouseMove: st, handleMouseUp: ct, handleNodeMouseDown: lt } = de({
|
|
107
|
+
svgRef: x,
|
|
107
108
|
zoom: U,
|
|
108
|
-
pan:
|
|
109
|
-
setPan:
|
|
110
|
-
setZoom:
|
|
111
|
-
nodeMap:
|
|
112
|
-
nodes:
|
|
113
|
-
updateData:
|
|
114
|
-
direction:
|
|
115
|
-
splitIndices:
|
|
116
|
-
setSplitIndices:
|
|
117
|
-
mapData:
|
|
118
|
-
contentCenter:
|
|
119
|
-
}), { editingId:
|
|
120
|
-
nodeMap:
|
|
121
|
-
updateData:
|
|
109
|
+
pan: V,
|
|
110
|
+
setPan: H,
|
|
111
|
+
setZoom: Ze,
|
|
112
|
+
nodeMap: B,
|
|
113
|
+
nodes: R,
|
|
114
|
+
updateData: P,
|
|
115
|
+
direction: E,
|
|
116
|
+
splitIndices: D,
|
|
117
|
+
setSplitIndices: O,
|
|
118
|
+
mapData: w,
|
|
119
|
+
contentCenter: nt
|
|
120
|
+
}), { editingId: ut, editText: dt, setEditText: q, pendingEditId: J, setPendingEditId: Y, handleNodeDoubleClick: ft, commitEdit: pt, cancelEdit: mt } = fe({
|
|
121
|
+
nodeMap: B,
|
|
122
|
+
updateData: P,
|
|
122
123
|
onTextChange: (e, t, n) => {
|
|
123
|
-
|
|
124
|
+
F({
|
|
124
125
|
type: "nodeTextChange",
|
|
125
126
|
nodeId: e,
|
|
126
127
|
oldText: t,
|
|
127
128
|
newText: n
|
|
128
129
|
});
|
|
129
130
|
}
|
|
130
|
-
}),
|
|
131
|
-
|
|
131
|
+
}), ht = pe(R), [X, gt] = h(!1);
|
|
132
|
+
f(() => {
|
|
132
133
|
if (W || J) return;
|
|
133
|
-
let e =
|
|
134
|
-
e ? X ? (
|
|
134
|
+
let e = $e();
|
|
135
|
+
e ? X ? (Ze(e.zoom), H({
|
|
135
136
|
x: e.panX,
|
|
136
137
|
y: e.panY
|
|
137
|
-
})) : (
|
|
138
|
+
})) : (Ze(e.zoom * .92), H({
|
|
138
139
|
x: e.panX,
|
|
139
140
|
y: e.panY
|
|
140
141
|
}), requestAnimationFrame(() => {
|
|
141
|
-
|
|
142
|
-
})) : X || requestAnimationFrame(() =>
|
|
142
|
+
gt(!0), Qe(e.zoom, e.panX, e.panY);
|
|
143
|
+
})) : X || requestAnimationFrame(() => gt(!0));
|
|
143
144
|
}, [
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
R,
|
|
146
|
+
$e,
|
|
146
147
|
W,
|
|
147
148
|
J,
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
Ze,
|
|
150
|
+
H,
|
|
150
151
|
X,
|
|
151
|
-
|
|
152
|
-
]),
|
|
153
|
-
J &&
|
|
152
|
+
Qe
|
|
153
|
+
]), f(() => {
|
|
154
|
+
J && B[J] && rt(J);
|
|
154
155
|
}, [
|
|
155
156
|
J,
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
B,
|
|
158
|
+
rt
|
|
158
159
|
]);
|
|
159
|
-
let
|
|
160
|
-
Me(null),
|
|
161
|
-
}, [
|
|
162
|
-
e.stopPropagation(),
|
|
160
|
+
let _t = d((e) => {
|
|
161
|
+
Me(null), ot(e);
|
|
162
|
+
}, [ot]), vt = d((e, t) => {
|
|
163
|
+
e.stopPropagation(), at.current || (A(t), F({
|
|
163
164
|
type: "nodeSelect",
|
|
164
165
|
nodeId: t
|
|
165
166
|
}));
|
|
166
|
-
}, [
|
|
167
|
-
|
|
167
|
+
}, [at, F]), yt = d(() => {
|
|
168
|
+
at.current || (A(null), F({
|
|
168
169
|
type: "nodeSelect",
|
|
169
170
|
nodeId: null
|
|
170
171
|
}));
|
|
171
|
-
}, [
|
|
172
|
+
}, [at, F]), bt = d((e) => {
|
|
172
173
|
e.preventDefault(), e.stopPropagation();
|
|
173
174
|
let t = Ae.current;
|
|
174
175
|
if (!t) return;
|
|
@@ -177,167 +178,167 @@ var _ = l(function({ data: l, markdown: _, defaultDirection: xe = "both", theme:
|
|
|
177
178
|
x: e.clientX - n.left,
|
|
178
179
|
y: e.clientY - n.top
|
|
179
180
|
});
|
|
180
|
-
}, []), Z =
|
|
181
|
+
}, []), Z = d(() => {
|
|
181
182
|
Me(null);
|
|
182
|
-
}, []),
|
|
183
|
+
}, []), xt = d((e) => {
|
|
183
184
|
if (!e) {
|
|
184
|
-
|
|
185
|
+
Ve(null);
|
|
185
186
|
return;
|
|
186
187
|
}
|
|
187
|
-
let t =
|
|
188
|
+
let t = B[e];
|
|
188
189
|
if (!t || !t.remark) {
|
|
189
|
-
|
|
190
|
+
Ve(null);
|
|
190
191
|
return;
|
|
191
192
|
}
|
|
192
|
-
let n =
|
|
193
|
+
let n = x.current;
|
|
193
194
|
if (!n) return;
|
|
194
|
-
let r = n.getBoundingClientRect(), i = (t.x + t.width / 2) * U +
|
|
195
|
-
|
|
195
|
+
let r = n.getBoundingClientRect(), i = (t.x + t.width / 2) * U + V.x, a = (t.y - t.height / 2) * U + V.y;
|
|
196
|
+
Ve({
|
|
196
197
|
nodeId: e,
|
|
197
198
|
text: t.remark,
|
|
198
199
|
x: Math.min(i, r.width - 300),
|
|
199
200
|
y: a - 8
|
|
200
201
|
});
|
|
201
202
|
}, [
|
|
202
|
-
|
|
203
|
+
B,
|
|
203
204
|
U,
|
|
204
|
-
|
|
205
|
-
]),
|
|
206
|
-
if (e.stopPropagation(),
|
|
205
|
+
V
|
|
206
|
+
]), St = d((e, t, n) => {
|
|
207
|
+
if (e.stopPropagation(), y) return;
|
|
207
208
|
let r = ae(), i = {
|
|
208
209
|
id: r,
|
|
209
|
-
text:
|
|
210
|
+
text: L.newNode
|
|
210
211
|
};
|
|
211
|
-
|
|
212
|
+
w.some((e) => e.id === t) && n && E === "both" ? P((e) => e.map((e) => {
|
|
212
213
|
if (e.id !== t) return e;
|
|
213
|
-
let r = e.children || [], a =
|
|
214
|
+
let r = e.children || [], a = D[t] ?? Math.ceil(r.length / 2), o = a, s = r.length - a, c = n;
|
|
214
215
|
n === "right" && o >= 3 * Math.max(s, 1) ? c = "left" : n === "left" && s >= 3 * Math.max(o, 1) && (c = "right");
|
|
215
|
-
let
|
|
216
|
-
return
|
|
216
|
+
let l = re(e, i, c, a);
|
|
217
|
+
return O((e) => ({
|
|
217
218
|
...e,
|
|
218
|
-
[t]:
|
|
219
|
-
})),
|
|
220
|
-
})) :
|
|
219
|
+
[t]: l.newSplitIndex
|
|
220
|
+
})), l.data;
|
|
221
|
+
})) : P((e) => ne(e, t, i)), F({
|
|
221
222
|
type: "nodeAdd",
|
|
222
223
|
node: i,
|
|
223
224
|
parentId: t
|
|
224
225
|
}), Y(r), q("");
|
|
225
226
|
}, [
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
T,
|
|
227
|
+
P,
|
|
228
|
+
w,
|
|
229
229
|
E,
|
|
230
|
+
D,
|
|
230
231
|
Y,
|
|
231
232
|
q,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
]),
|
|
236
|
-
if (
|
|
233
|
+
L,
|
|
234
|
+
y,
|
|
235
|
+
F
|
|
236
|
+
]), Ct = d(() => {
|
|
237
|
+
if (y) return;
|
|
237
238
|
let e = ae(), t = {
|
|
238
239
|
id: e,
|
|
239
|
-
text:
|
|
240
|
+
text: L.newNode
|
|
240
241
|
};
|
|
241
|
-
|
|
242
|
+
P((e) => [...e, t]), F({
|
|
242
243
|
type: "nodeAdd",
|
|
243
244
|
node: t,
|
|
244
245
|
parentId: null
|
|
245
246
|
}), Y(e), q(""), Z();
|
|
246
247
|
}, [
|
|
247
|
-
|
|
248
|
+
P,
|
|
248
249
|
Z,
|
|
249
250
|
Y,
|
|
250
251
|
q,
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
]),
|
|
255
|
-
let e =
|
|
252
|
+
L,
|
|
253
|
+
y,
|
|
254
|
+
F
|
|
255
|
+
]), wt = d(() => {
|
|
256
|
+
let e = i(R, z, {}, I, S);
|
|
256
257
|
be(new Blob([e], { type: "image/svg+xml;charset=utf-8" }), "mindmap.svg"), Z();
|
|
257
258
|
}, [
|
|
259
|
+
R,
|
|
258
260
|
z,
|
|
259
|
-
|
|
260
|
-
L,
|
|
261
|
+
I,
|
|
261
262
|
Z,
|
|
262
|
-
|
|
263
|
-
]),
|
|
264
|
-
be(await a(
|
|
263
|
+
S
|
|
264
|
+
]), Tt = d(async () => {
|
|
265
|
+
be(await o(a(R, z, { pngSafe: !0 }, I, S)), "mindmap.png"), Z();
|
|
265
266
|
}, [
|
|
267
|
+
R,
|
|
266
268
|
z,
|
|
267
|
-
|
|
268
|
-
L,
|
|
269
|
+
I,
|
|
269
270
|
Z,
|
|
270
|
-
|
|
271
|
-
]),
|
|
272
|
-
let e =
|
|
271
|
+
S
|
|
272
|
+
]), Et = d(() => {
|
|
273
|
+
let e = l(w, S);
|
|
273
274
|
be(new Blob([e], { type: "text/markdown;charset=utf-8" }), "mindmap.md"), Z();
|
|
274
275
|
}, [
|
|
275
|
-
|
|
276
|
+
w,
|
|
276
277
|
Z,
|
|
277
|
-
|
|
278
|
-
]), Q =
|
|
279
|
-
let e =
|
|
280
|
-
e &&
|
|
281
|
-
}, [
|
|
282
|
-
je(e),
|
|
278
|
+
S
|
|
279
|
+
]), Q = d(() => {
|
|
280
|
+
let e = $e();
|
|
281
|
+
e && Qe(e.zoom, e.panX, e.panY);
|
|
282
|
+
}, [$e, Qe]), $ = d((e) => {
|
|
283
|
+
je(e), O({}), F({
|
|
283
284
|
type: "directionChange",
|
|
284
285
|
direction: e
|
|
285
286
|
});
|
|
286
|
-
}, [
|
|
287
|
-
|
|
288
|
-
if (e === "view") return
|
|
287
|
+
}, [F]), Dt = d(() => {
|
|
288
|
+
Ie((e) => {
|
|
289
|
+
if (e === "view") return N(l(w, S)), F({
|
|
289
290
|
type: "modeChange",
|
|
290
291
|
mode: "text"
|
|
291
292
|
}), "text";
|
|
292
293
|
{
|
|
293
|
-
let e =
|
|
294
|
-
return
|
|
294
|
+
let e = S ? c(ze, S).roots : s(ze);
|
|
295
|
+
return P(() => e), O({}), F({
|
|
295
296
|
type: "modeChange",
|
|
296
297
|
mode: "view"
|
|
297
298
|
}), "view";
|
|
298
299
|
}
|
|
299
300
|
});
|
|
300
301
|
}, [
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
]),
|
|
302
|
+
w,
|
|
303
|
+
ze,
|
|
304
|
+
P,
|
|
305
|
+
S,
|
|
306
|
+
F
|
|
307
|
+
]), Ot = d(() => {
|
|
307
308
|
let e = Ae.current;
|
|
308
309
|
e && (document.fullscreenElement ? document.exitFullscreen() : e.requestFullscreen());
|
|
309
310
|
}, []);
|
|
310
|
-
|
|
311
|
+
f(() => {
|
|
311
312
|
let e = () => {
|
|
312
313
|
let e = !!document.fullscreenElement;
|
|
313
|
-
|
|
314
|
+
Re(e), F({
|
|
314
315
|
type: "fullscreenChange",
|
|
315
316
|
fullscreen: e
|
|
316
317
|
});
|
|
317
318
|
};
|
|
318
319
|
return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
|
|
319
|
-
}, [
|
|
320
|
-
let
|
|
321
|
-
|
|
322
|
-
U !==
|
|
320
|
+
}, [F]);
|
|
321
|
+
let kt = m(U);
|
|
322
|
+
f(() => {
|
|
323
|
+
U !== kt.current && (kt.current = U, F({
|
|
323
324
|
type: "zoomChange",
|
|
324
325
|
zoom: U
|
|
325
326
|
}));
|
|
326
|
-
}, [U,
|
|
327
|
-
let
|
|
328
|
-
if (e.key === "Escape" &&
|
|
327
|
+
}, [U, F]);
|
|
328
|
+
let At = d((e) => {
|
|
329
|
+
if (e.key === "Escape" && j) {
|
|
329
330
|
e.preventDefault(), Z();
|
|
330
331
|
return;
|
|
331
332
|
}
|
|
332
|
-
if (
|
|
333
|
+
if (ut) return;
|
|
333
334
|
let t = e.metaKey || e.ctrlKey;
|
|
334
335
|
if (e.shiftKey && !t) {
|
|
335
336
|
if (e.code === "Equal") {
|
|
336
|
-
e.preventDefault(),
|
|
337
|
+
e.preventDefault(), et();
|
|
337
338
|
return;
|
|
338
339
|
}
|
|
339
340
|
if (e.code === "Minus") {
|
|
340
|
-
e.preventDefault(),
|
|
341
|
+
e.preventDefault(), tt();
|
|
341
342
|
return;
|
|
342
343
|
}
|
|
343
344
|
if (e.code === "Digit0") {
|
|
@@ -357,93 +358,93 @@ var _ = l(function({ data: l, markdown: _, defaultDirection: xe = "both", theme:
|
|
|
357
358
|
return;
|
|
358
359
|
}
|
|
359
360
|
}
|
|
360
|
-
if (e.key === "Enter" && !t &&
|
|
361
|
+
if (e.key === "Enter" && !t && k && !y) {
|
|
361
362
|
e.preventDefault();
|
|
362
363
|
let t = ae(), n = {
|
|
363
364
|
id: t,
|
|
364
|
-
text:
|
|
365
|
+
text: L.newNode
|
|
365
366
|
};
|
|
366
|
-
|
|
367
|
-
if (e.id !==
|
|
368
|
-
let t = e.children || [], r = re(e, n, "right",
|
|
369
|
-
return
|
|
367
|
+
w.some((e) => e.id === k) && E === "both" ? P((e) => e.map((e) => {
|
|
368
|
+
if (e.id !== k) return e;
|
|
369
|
+
let t = e.children || [], r = re(e, n, "right", D[k] ?? Math.ceil(t.length / 2));
|
|
370
|
+
return O((e) => ({
|
|
370
371
|
...e,
|
|
371
|
-
[
|
|
372
|
+
[k]: r.newSplitIndex
|
|
372
373
|
})), r.data;
|
|
373
|
-
})) :
|
|
374
|
+
})) : P((e) => ne(e, k, n)), Y(t), q(""), F({
|
|
374
375
|
type: "nodeAdd",
|
|
375
376
|
node: n,
|
|
376
|
-
parentId:
|
|
377
|
+
parentId: k
|
|
377
378
|
});
|
|
378
379
|
return;
|
|
379
380
|
}
|
|
380
|
-
if ((e.key === "Delete" || e.key === "Backspace") &&
|
|
381
|
-
if (e.preventDefault(),
|
|
382
|
-
|
|
381
|
+
if ((e.key === "Delete" || e.key === "Backspace") && k && !y) {
|
|
382
|
+
if (e.preventDefault(), w.some((e) => e.id === k) && w.length <= 1) return;
|
|
383
|
+
F({
|
|
383
384
|
type: "nodeDelete",
|
|
384
|
-
nodeId:
|
|
385
|
-
}),
|
|
385
|
+
nodeId: k
|
|
386
|
+
}), P((e) => ce(e, k)), A(null);
|
|
386
387
|
return;
|
|
387
388
|
}
|
|
388
|
-
if (t && e.key === "c" &&
|
|
389
|
-
e.preventDefault(),
|
|
389
|
+
if (t && e.key === "c" && k) {
|
|
390
|
+
e.preventDefault(), Pe.current = ie(w, k);
|
|
390
391
|
return;
|
|
391
392
|
}
|
|
392
|
-
if (t && e.key === "x" &&
|
|
393
|
-
if (e.preventDefault(),
|
|
394
|
-
|
|
393
|
+
if (t && e.key === "x" && k && !y) {
|
|
394
|
+
if (e.preventDefault(), Pe.current = ie(w, k), w.some((e) => e.id === k) && w.length <= 1) return;
|
|
395
|
+
F({
|
|
395
396
|
type: "nodeDelete",
|
|
396
|
-
nodeId:
|
|
397
|
-
}),
|
|
397
|
+
nodeId: k
|
|
398
|
+
}), P((e) => ce(e, k)), A(null);
|
|
398
399
|
return;
|
|
399
400
|
}
|
|
400
|
-
if (t && e.key === "v" &&
|
|
401
|
+
if (t && e.key === "v" && k && Pe.current && !y) {
|
|
401
402
|
e.preventDefault();
|
|
402
|
-
let t = se(
|
|
403
|
-
|
|
403
|
+
let t = se(Pe.current);
|
|
404
|
+
P((e) => ne(e, k, t)), F({
|
|
404
405
|
type: "nodeAdd",
|
|
405
406
|
node: t,
|
|
406
|
-
parentId:
|
|
407
|
+
parentId: k
|
|
407
408
|
});
|
|
408
409
|
return;
|
|
409
410
|
}
|
|
410
411
|
}, [
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
T,
|
|
412
|
+
ut,
|
|
413
|
+
k,
|
|
414
|
+
w,
|
|
415
415
|
E,
|
|
416
|
-
|
|
417
|
-
|
|
416
|
+
D,
|
|
417
|
+
P,
|
|
418
|
+
j,
|
|
418
419
|
Z,
|
|
419
420
|
Y,
|
|
420
421
|
q,
|
|
421
|
-
|
|
422
|
-
$e,
|
|
422
|
+
L,
|
|
423
423
|
et,
|
|
424
|
+
tt,
|
|
424
425
|
Q,
|
|
425
426
|
$,
|
|
426
|
-
|
|
427
|
-
|
|
427
|
+
y,
|
|
428
|
+
F
|
|
428
429
|
]);
|
|
429
430
|
ve(ke, () => ({
|
|
430
431
|
exportToSVG() {
|
|
431
|
-
return
|
|
432
|
+
return i(R, z, {}, I, S);
|
|
432
433
|
},
|
|
433
434
|
async exportToPNG() {
|
|
434
|
-
return a(
|
|
435
|
+
return o(a(R, z, {}, I, S));
|
|
435
436
|
},
|
|
436
437
|
exportToOutline() {
|
|
437
|
-
return
|
|
438
|
+
return l(w, S);
|
|
438
439
|
},
|
|
439
440
|
getData() {
|
|
440
|
-
return
|
|
441
|
+
return w;
|
|
441
442
|
},
|
|
442
443
|
setData(e) {
|
|
443
|
-
|
|
444
|
+
T(oe(e)), O({});
|
|
444
445
|
},
|
|
445
446
|
setMarkdown(e) {
|
|
446
|
-
|
|
447
|
+
T(S ? c(e, S).roots : s(e)), O({});
|
|
447
448
|
},
|
|
448
449
|
fitView() {
|
|
449
450
|
Q();
|
|
@@ -452,23 +453,23 @@ var _ = l(function({ data: l, markdown: _, defaultDirection: xe = "both", theme:
|
|
|
452
453
|
$(e);
|
|
453
454
|
}
|
|
454
455
|
}), [
|
|
456
|
+
R,
|
|
455
457
|
z,
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
x,
|
|
458
|
+
w,
|
|
459
|
+
S,
|
|
459
460
|
Q,
|
|
460
461
|
$,
|
|
461
|
-
|
|
462
|
-
]),
|
|
463
|
-
if (!
|
|
462
|
+
I
|
|
463
|
+
]), f(() => {
|
|
464
|
+
if (!j) return;
|
|
464
465
|
let e = () => Z();
|
|
465
466
|
return window.addEventListener("click", e), () => window.removeEventListener("click", e);
|
|
466
|
-
}, [
|
|
467
|
-
let
|
|
468
|
-
|
|
469
|
-
}, [
|
|
467
|
+
}, [j, Z]);
|
|
468
|
+
let jt = d((e) => {
|
|
469
|
+
T(S ? c(e, S).roots : s(e)), O({});
|
|
470
|
+
}, [S]), Mt = d(() => {
|
|
470
471
|
setTimeout(() => Q(), 100);
|
|
471
|
-
}, [Q]),
|
|
472
|
+
}, [Q]), Nt = d(() => {}, []), Pt = d((e) => {
|
|
472
473
|
if (e.key !== "Tab") return;
|
|
473
474
|
e.preventDefault();
|
|
474
475
|
let t = e.currentTarget, { selectionStart: n, selectionEnd: r, value: i } = t;
|
|
@@ -478,7 +479,7 @@ var _ = l(function({ data: l, markdown: _, defaultDirection: xe = "both", theme:
|
|
|
478
479
|
let a = i.slice(e, r), o = a.match(/^ {1,2}/);
|
|
479
480
|
if (!o) return;
|
|
480
481
|
let s = o[0].length;
|
|
481
|
-
|
|
482
|
+
N(i.slice(0, e) + a.slice(s) + i.slice(r)), requestAnimationFrame(() => {
|
|
482
483
|
t.selectionStart = t.selectionEnd = Math.max(e, n - s);
|
|
483
484
|
});
|
|
484
485
|
} else {
|
|
@@ -486,92 +487,86 @@ var _ = l(function({ data: l, markdown: _, defaultDirection: xe = "both", theme:
|
|
|
486
487
|
let n = e.match(/^ {1,2}/), r = n ? n[0].length : 0;
|
|
487
488
|
return o += r, t === 0 && (s = r), e.slice(r);
|
|
488
489
|
}).join("\n");
|
|
489
|
-
|
|
490
|
+
N(i.slice(0, e) + c + i.slice(r)), requestAnimationFrame(() => {
|
|
490
491
|
t.selectionStart = n - s, t.selectionEnd = r - o;
|
|
491
492
|
});
|
|
492
493
|
}
|
|
493
|
-
} else if (n === r)
|
|
494
|
+
} else if (n === r) N(i.slice(0, n) + " " + i.slice(r)), requestAnimationFrame(() => {
|
|
494
495
|
t.selectionStart = t.selectionEnd = n + 2;
|
|
495
496
|
});
|
|
496
497
|
else {
|
|
497
498
|
let e = i.lastIndexOf("\n", n - 1) + 1, a = i.slice(e, r).split("\n"), o = a.map((e) => " " + e).join("\n");
|
|
498
|
-
|
|
499
|
+
N(i.slice(0, e) + o + i.slice(r)), requestAnimationFrame(() => {
|
|
499
500
|
t.selectionStart = n + 2, t.selectionEnd = r + a.length * 2;
|
|
500
501
|
});
|
|
501
502
|
}
|
|
502
503
|
}, []);
|
|
503
|
-
return /* @__PURE__ */
|
|
504
|
+
return /* @__PURE__ */ _("div", {
|
|
504
505
|
ref: Ae,
|
|
505
506
|
className: "mindmap-container",
|
|
507
|
+
style: e(I),
|
|
506
508
|
children: [
|
|
507
|
-
|
|
509
|
+
Fe === "text" && /* @__PURE__ */ g("textarea", {
|
|
508
510
|
className: "mindmap-text-editor",
|
|
509
|
-
value:
|
|
510
|
-
onChange: (e) =>
|
|
511
|
-
onKeyDown:
|
|
512
|
-
readOnly:
|
|
513
|
-
style: {
|
|
514
|
-
background: L.canvas.bgColor,
|
|
515
|
-
color: L.node.textColor,
|
|
516
|
-
opacity: v ? .7 : 1
|
|
517
|
-
}
|
|
511
|
+
value: ze,
|
|
512
|
+
onChange: (e) => N(e.target.value),
|
|
513
|
+
onKeyDown: Pt,
|
|
514
|
+
readOnly: y,
|
|
515
|
+
style: y ? { opacity: .7 } : void 0
|
|
518
516
|
}),
|
|
519
|
-
/* @__PURE__ */
|
|
520
|
-
ref:
|
|
521
|
-
className: `mindmap-svg ${
|
|
522
|
-
style: {
|
|
523
|
-
background: L.canvas.bgColor,
|
|
524
|
-
display: Pe === "text" ? "none" : "block"
|
|
525
|
-
},
|
|
517
|
+
/* @__PURE__ */ g("svg", {
|
|
518
|
+
ref: x,
|
|
519
|
+
className: `mindmap-svg ${it ? "dragging-canvas" : ""} ${W ? "dragging-node" : ""}`,
|
|
520
|
+
style: Fe === "text" ? { display: "none" } : void 0,
|
|
526
521
|
tabIndex: 0,
|
|
527
|
-
onMouseDown:
|
|
528
|
-
onMouseMove:
|
|
529
|
-
onMouseUp:
|
|
530
|
-
onMouseLeave:
|
|
531
|
-
onClick:
|
|
532
|
-
onKeyDown:
|
|
533
|
-
onContextMenu:
|
|
534
|
-
children: /* @__PURE__ */
|
|
535
|
-
className: "mindmap-canvas"
|
|
536
|
-
transform: `translate(${
|
|
522
|
+
onMouseDown: _t,
|
|
523
|
+
onMouseMove: st,
|
|
524
|
+
onMouseUp: ct,
|
|
525
|
+
onMouseLeave: ct,
|
|
526
|
+
onClick: yt,
|
|
527
|
+
onKeyDown: At,
|
|
528
|
+
onContextMenu: bt,
|
|
529
|
+
children: /* @__PURE__ */ _("g", {
|
|
530
|
+
className: `mindmap-canvas${X ? " mindmap-canvas-ready" : ""}`,
|
|
531
|
+
transform: `translate(${V.x}, ${V.y}) scale(${U})`,
|
|
537
532
|
opacity: X ? 1 : 0,
|
|
538
|
-
style: { transition: X ? "opacity 0.4s ease-out" : "none" },
|
|
539
533
|
children: [
|
|
540
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ _("g", {
|
|
541
535
|
className: "mindmap-edges",
|
|
542
|
-
children: [
|
|
536
|
+
children: [z.some((e) => e.isCrossLink) && /* @__PURE__ */ g("defs", { children: /* @__PURE__ */ g("marker", {
|
|
543
537
|
id: "mindmap-arrowhead",
|
|
544
538
|
markerWidth: "8",
|
|
545
539
|
markerHeight: "6",
|
|
546
540
|
refX: "8",
|
|
547
541
|
refY: "3",
|
|
548
542
|
orient: "auto",
|
|
549
|
-
children: /* @__PURE__ */
|
|
543
|
+
children: /* @__PURE__ */ g("path", {
|
|
550
544
|
d: "M0,0 L8,3 L0,6",
|
|
551
545
|
fill: "none",
|
|
552
546
|
stroke: "currentColor",
|
|
553
547
|
strokeWidth: 1.5
|
|
554
548
|
})
|
|
555
|
-
}) }),
|
|
556
|
-
let t =
|
|
557
|
-
return /* @__PURE__ */
|
|
549
|
+
}) }), z.map((e) => {
|
|
550
|
+
let t = Xe[e.toId], n = t !== void 0;
|
|
551
|
+
return /* @__PURE__ */ _("g", { children: [/* @__PURE__ */ g("path", {
|
|
558
552
|
d: e.path,
|
|
559
553
|
stroke: e.color,
|
|
560
|
-
strokeWidth:
|
|
554
|
+
strokeWidth: I.connection.strokeWidth,
|
|
561
555
|
strokeLinecap: "round",
|
|
562
556
|
strokeDasharray: n ? void 0 : e.strokeDasharray,
|
|
563
557
|
markerEnd: e.isCrossLink ? "url(#mindmap-arrowhead)" : void 0,
|
|
564
558
|
opacity: e.isCrossLink ? .7 : 1,
|
|
565
559
|
fill: "none",
|
|
560
|
+
"data-branch-index": B[e.toId]?.branchIndex,
|
|
566
561
|
className: [
|
|
567
562
|
"mindmap-edge",
|
|
568
563
|
e.isCrossLink ? "mindmap-edge-cross-link" : "",
|
|
569
|
-
n ? "mindmap-edge-expanding" :
|
|
564
|
+
n ? "mindmap-edge-expanding" : it || K.has(e.fromId) || K.has(e.toId) ? "" : "mindmap-edge-animated"
|
|
570
565
|
].filter(Boolean).join(" "),
|
|
571
566
|
style: n ? { animationDelay: `${t}ms` } : void 0
|
|
572
567
|
}), e.label && (() => {
|
|
573
|
-
let t =
|
|
574
|
-
return !t || !n ? null : /* @__PURE__ */
|
|
568
|
+
let t = B[e.fromId], n = B[e.toId];
|
|
569
|
+
return !t || !n ? null : /* @__PURE__ */ g("text", {
|
|
575
570
|
className: "mindmap-edge-label",
|
|
576
571
|
x: (t.x + n.x) / 2,
|
|
577
572
|
y: (t.y + n.y) / 2 - 6,
|
|
@@ -579,72 +574,69 @@ var _ = l(function({ data: l, markdown: _, defaultDirection: xe = "both", theme:
|
|
|
579
574
|
fontSize: 11,
|
|
580
575
|
fill: e.color,
|
|
581
576
|
opacity: .8,
|
|
582
|
-
fontFamily:
|
|
583
|
-
style: { pointerEvents: "none" },
|
|
577
|
+
fontFamily: I.node.fontFamily,
|
|
584
578
|
children: e.label
|
|
585
579
|
});
|
|
586
580
|
})()] }, e.key);
|
|
587
581
|
})]
|
|
588
582
|
}),
|
|
589
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ g("g", {
|
|
590
584
|
className: "mindmap-nodes",
|
|
591
|
-
children:
|
|
592
|
-
let t = K.has(e.id), n = t ||
|
|
593
|
-
return /* @__PURE__ */
|
|
585
|
+
children: R.map((e) => {
|
|
586
|
+
let t = K.has(e.id), n = t || it ? "" : "mindmap-node-animated";
|
|
587
|
+
return /* @__PURE__ */ g(me, {
|
|
594
588
|
node: e,
|
|
595
|
-
isEditing:
|
|
589
|
+
isEditing: ut === e.id,
|
|
596
590
|
isPendingEdit: J === e.id,
|
|
597
|
-
isSelected:
|
|
598
|
-
isNew:
|
|
591
|
+
isSelected: k === e.id,
|
|
592
|
+
isNew: ht.has(e.id),
|
|
599
593
|
isGhost: t,
|
|
600
594
|
animClass: n,
|
|
601
|
-
editText:
|
|
602
|
-
theme:
|
|
603
|
-
direction:
|
|
604
|
-
onMouseDown:
|
|
605
|
-
onClick:
|
|
606
|
-
onDoubleClick:
|
|
595
|
+
editText: dt,
|
|
596
|
+
theme: I,
|
|
597
|
+
direction: E,
|
|
598
|
+
onMouseDown: lt,
|
|
599
|
+
onClick: vt,
|
|
600
|
+
onDoubleClick: y ? () => {} : ft,
|
|
607
601
|
onEditChange: q,
|
|
608
|
-
onEditCommit:
|
|
609
|
-
onEditCancel:
|
|
610
|
-
onAddChild:
|
|
611
|
-
onRemarkHover:
|
|
612
|
-
onFoldToggle:
|
|
613
|
-
|
|
602
|
+
onEditCommit: pt,
|
|
603
|
+
onEditCancel: mt,
|
|
604
|
+
onAddChild: St,
|
|
605
|
+
onRemarkHover: xt,
|
|
606
|
+
onFoldToggle: S ? (e) => {
|
|
607
|
+
He[e] || (Ge(e), setTimeout(() => Ge(null), 800)), Ue((t) => ({
|
|
614
608
|
...t,
|
|
615
609
|
[e]: !t[e]
|
|
616
610
|
}));
|
|
617
611
|
} : void 0,
|
|
618
|
-
expandDelay:
|
|
619
|
-
readonly:
|
|
620
|
-
plugins:
|
|
612
|
+
expandDelay: Xe[e.id],
|
|
613
|
+
readonly: y,
|
|
614
|
+
plugins: S
|
|
621
615
|
}, e.id);
|
|
622
616
|
})
|
|
623
617
|
}),
|
|
624
618
|
W && G && (() => {
|
|
625
|
-
let e =
|
|
619
|
+
let e = B[W];
|
|
626
620
|
if (!e) return null;
|
|
627
|
-
let
|
|
628
|
-
return /* @__PURE__ */
|
|
621
|
+
let t = G.x - e.x, r = G.y - e.y, i = e.parentId ? B[e.parentId] : null;
|
|
622
|
+
return /* @__PURE__ */ _(ye, { children: [i && /* @__PURE__ */ g("path", {
|
|
629
623
|
className: "mindmap-floating-edge",
|
|
630
|
-
d:
|
|
624
|
+
d: n(i.x, i.y, i.width, G.x, G.y, e.width, e.side),
|
|
631
625
|
stroke: e.color,
|
|
632
|
-
strokeWidth:
|
|
626
|
+
strokeWidth: I.connection.strokeWidth,
|
|
633
627
|
strokeLinecap: "round",
|
|
634
|
-
fill: "none"
|
|
635
|
-
|
|
636
|
-
}), /* @__PURE__ */ g("g", {
|
|
628
|
+
fill: "none"
|
|
629
|
+
}), /* @__PURE__ */ _("g", {
|
|
637
630
|
className: "mindmap-floating",
|
|
638
|
-
transform: `translate(${
|
|
639
|
-
|
|
640
|
-
children: [B.filter((e) => K.has(e.fromId) && K.has(e.toId)).map((e) => /* @__PURE__ */ h("path", {
|
|
631
|
+
transform: `translate(${t}, ${r})`,
|
|
632
|
+
children: [z.filter((e) => K.has(e.fromId) && K.has(e.toId)).map((e) => /* @__PURE__ */ g("path", {
|
|
641
633
|
className: "mindmap-floating-edge",
|
|
642
634
|
d: e.path,
|
|
643
635
|
stroke: e.color,
|
|
644
|
-
strokeWidth:
|
|
636
|
+
strokeWidth: I.connection.strokeWidth,
|
|
645
637
|
strokeLinecap: "round",
|
|
646
638
|
fill: "none"
|
|
647
|
-
}, `fl-${e.key}`)),
|
|
639
|
+
}, `fl-${e.key}`)), R.filter((e) => K.has(e.id)).map((e) => /* @__PURE__ */ g(me, {
|
|
648
640
|
node: e,
|
|
649
641
|
isEditing: !1,
|
|
650
642
|
isPendingEdit: !1,
|
|
@@ -652,8 +644,8 @@ var _ = l(function({ data: l, markdown: _, defaultDirection: xe = "both", theme:
|
|
|
652
644
|
isNew: !1,
|
|
653
645
|
animClass: "",
|
|
654
646
|
editText: "",
|
|
655
|
-
theme:
|
|
656
|
-
direction:
|
|
647
|
+
theme: I,
|
|
648
|
+
direction: E,
|
|
657
649
|
onMouseDown: () => {},
|
|
658
650
|
onClick: () => {},
|
|
659
651
|
onDoubleClick: () => {},
|
|
@@ -665,63 +657,59 @@ var _ = l(function({ data: l, markdown: _, defaultDirection: xe = "both", theme:
|
|
|
665
657
|
}, `fl-${e.id}`))]
|
|
666
658
|
})] });
|
|
667
659
|
})(),
|
|
668
|
-
|
|
660
|
+
S && t(S, R, z, I).map((e, t) => /* @__PURE__ */ g("g", {
|
|
669
661
|
className: "mindmap-plugin-overlay",
|
|
670
662
|
children: e
|
|
671
663
|
}, `plugin-overlay-${t}`))
|
|
672
664
|
]
|
|
673
665
|
})
|
|
674
666
|
}),
|
|
675
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ g(he, {
|
|
676
668
|
zoom: U,
|
|
677
|
-
theme:
|
|
678
|
-
messages:
|
|
679
|
-
showZoom:
|
|
680
|
-
mode:
|
|
681
|
-
isFullscreen:
|
|
682
|
-
onZoomIn:
|
|
683
|
-
onZoomOut:
|
|
669
|
+
theme: I,
|
|
670
|
+
messages: L,
|
|
671
|
+
showZoom: Ye.zoom,
|
|
672
|
+
mode: Fe,
|
|
673
|
+
isFullscreen: Le,
|
|
674
|
+
onZoomIn: et,
|
|
675
|
+
onZoomOut: tt,
|
|
684
676
|
onAutoFit: Q,
|
|
685
|
-
onModeToggle:
|
|
686
|
-
onFullscreenToggle:
|
|
677
|
+
onModeToggle: Dt,
|
|
678
|
+
onFullscreenToggle: Ot
|
|
687
679
|
}),
|
|
688
|
-
Te && /* @__PURE__ */
|
|
680
|
+
Te && /* @__PURE__ */ g(_e, {
|
|
689
681
|
config: Te,
|
|
690
|
-
theme:
|
|
691
|
-
messages:
|
|
692
|
-
currentMarkdown:
|
|
693
|
-
onMarkdownStream:
|
|
694
|
-
onComplete:
|
|
695
|
-
onError:
|
|
682
|
+
theme: I,
|
|
683
|
+
messages: L,
|
|
684
|
+
currentMarkdown: l(w, S),
|
|
685
|
+
onMarkdownStream: jt,
|
|
686
|
+
onComplete: Mt,
|
|
687
|
+
onError: Nt
|
|
696
688
|
}),
|
|
697
|
-
|
|
698
|
-
position:
|
|
699
|
-
theme:
|
|
700
|
-
messages:
|
|
701
|
-
direction:
|
|
702
|
-
readonly:
|
|
703
|
-
onNewRootNode:
|
|
704
|
-
onExportSVG:
|
|
705
|
-
onExportPNG:
|
|
706
|
-
onExportMarkdown:
|
|
689
|
+
j && /* @__PURE__ */ g(ge, {
|
|
690
|
+
position: j,
|
|
691
|
+
theme: I,
|
|
692
|
+
messages: L,
|
|
693
|
+
direction: E,
|
|
694
|
+
readonly: y,
|
|
695
|
+
onNewRootNode: Ct,
|
|
696
|
+
onExportSVG: wt,
|
|
697
|
+
onExportPNG: Tt,
|
|
698
|
+
onExportMarkdown: Et,
|
|
707
699
|
onDirectionChange: $,
|
|
708
700
|
onClose: Z
|
|
709
701
|
}),
|
|
710
|
-
|
|
702
|
+
Be && /* @__PURE__ */ g("div", {
|
|
711
703
|
className: "mindmap-remark-tooltip",
|
|
712
704
|
style: {
|
|
713
|
-
left:
|
|
714
|
-
top:
|
|
715
|
-
transform: "translateY(-100%)"
|
|
716
|
-
background: L.contextMenu.bgColor,
|
|
717
|
-
color: L.contextMenu.textColor,
|
|
718
|
-
borderColor: L.contextMenu.borderColor,
|
|
719
|
-
border: `1px solid ${L.contextMenu.borderColor}`
|
|
705
|
+
left: Be.x,
|
|
706
|
+
top: Be.y,
|
|
707
|
+
transform: "translateY(-100%)"
|
|
720
708
|
},
|
|
721
|
-
children:
|
|
709
|
+
children: Be.text
|
|
722
710
|
})
|
|
723
711
|
]
|
|
724
712
|
});
|
|
725
713
|
});
|
|
726
714
|
//#endregion
|
|
727
|
-
export {
|
|
715
|
+
export { v as MindMap };
|