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