flow-mindmap 0.1.1-beta.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/layout.d.ts +7 -1
- package/dist/entry.d.ts +4 -4
- package/dist/flow-mindmap.js +1110 -989
- package/dist/flow-mindmap.umd.cjs +12 -5
- package/dist/style.css +1 -1
- package/dist/tree.d.ts +28 -0
- package/dist/types.d.ts +28 -0
- package/package.json +1 -1
package/dist/flow-mindmap.js
CHANGED
|
@@ -1,400 +1,401 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as ct, openBlock as C, createElementBlock as E, Fragment as F, createElementVNode as p, createStaticVNode as Ne, createCommentVNode as X, ref as O, reactive as je, onMounted as st, onBeforeUnmount as dt, computed as te, withModifiers as D, normalizeStyle as ve, createVNode as q, toDisplayString as be, watch as Ue, nextTick as ee, unref as N, renderList as Ot, normalizeClass as Ie, withDirectives as Wn, withKeys as Ye, vModelText as $n, createBlock as Rn } from "vue";
|
|
2
|
+
const Bn = ["width", "height", "stroke-width"], Ln = {
|
|
3
3
|
key: 4,
|
|
4
4
|
points: "6 9 12 15 18 9"
|
|
5
|
-
},
|
|
5
|
+
}, An = {
|
|
6
6
|
key: 5,
|
|
7
7
|
points: "9 6 15 12 9 18"
|
|
8
|
-
},
|
|
8
|
+
}, U = /* @__PURE__ */ ct({
|
|
9
9
|
__name: "Icon",
|
|
10
10
|
props: {
|
|
11
11
|
name: {},
|
|
12
12
|
size: {},
|
|
13
13
|
stroke: {}
|
|
14
14
|
},
|
|
15
|
-
setup(
|
|
16
|
-
return (s, o) => (
|
|
17
|
-
width:
|
|
18
|
-
height:
|
|
15
|
+
setup(i) {
|
|
16
|
+
return (s, o) => (C(), E("svg", {
|
|
17
|
+
width: i.size ?? 16,
|
|
18
|
+
height: i.size ?? 16,
|
|
19
19
|
viewBox: "0 0 24 24",
|
|
20
20
|
fill: "none",
|
|
21
21
|
stroke: "currentColor",
|
|
22
|
-
"stroke-width":
|
|
22
|
+
"stroke-width": i.stroke ?? 1.8,
|
|
23
23
|
"stroke-linecap": "round",
|
|
24
24
|
"stroke-linejoin": "round",
|
|
25
25
|
"aria-hidden": "true"
|
|
26
26
|
}, [
|
|
27
|
-
|
|
28
|
-
o[0] || (o[0] =
|
|
27
|
+
i.name === "add" ? (C(), E(F, { key: 0 }, [
|
|
28
|
+
o[0] || (o[0] = p("circle", {
|
|
29
29
|
cx: "12",
|
|
30
30
|
cy: "12",
|
|
31
31
|
r: "9"
|
|
32
32
|
}, null, -1)),
|
|
33
|
-
o[1] || (o[1] =
|
|
33
|
+
o[1] || (o[1] = p("line", {
|
|
34
34
|
x1: "12",
|
|
35
35
|
y1: "8",
|
|
36
36
|
x2: "12",
|
|
37
37
|
y2: "16"
|
|
38
38
|
}, null, -1)),
|
|
39
|
-
o[2] || (o[2] =
|
|
39
|
+
o[2] || (o[2] = p("line", {
|
|
40
40
|
x1: "8",
|
|
41
41
|
y1: "12",
|
|
42
42
|
x2: "16",
|
|
43
43
|
y2: "12"
|
|
44
44
|
}, null, -1))
|
|
45
|
-
], 64)) :
|
|
46
|
-
o[3] || (o[3] =
|
|
45
|
+
], 64)) : i.name === "minus" ? (C(), E(F, { key: 1 }, [
|
|
46
|
+
o[3] || (o[3] = p("circle", {
|
|
47
47
|
cx: "12",
|
|
48
48
|
cy: "12",
|
|
49
49
|
r: "9"
|
|
50
50
|
}, null, -1)),
|
|
51
|
-
o[4] || (o[4] =
|
|
51
|
+
o[4] || (o[4] = p("line", {
|
|
52
52
|
x1: "8",
|
|
53
53
|
y1: "12",
|
|
54
54
|
x2: "16",
|
|
55
55
|
y2: "12"
|
|
56
56
|
}, null, -1))
|
|
57
|
-
], 64)) :
|
|
57
|
+
], 64)) : i.name === "delete" ? (C(), E(F, { key: 2 }, [
|
|
58
58
|
o[5] || (o[5] = Ne('<polyline points="4 7 20 7"></polyline><path d="M9 7 V5 a1 1 0 0 1 1 -1 h4 a1 1 0 0 1 1 1 V7"></path><path d="M6 7 l1 12 a1 1 0 0 0 1 1 h8 a1 1 0 0 0 1 -1 l1 -12"></path><line x1="10" y1="11" x2="10" y2="18"></line><line x1="14" y1="11" x2="14" y2="18"></line>', 5))
|
|
59
|
-
], 64)) :
|
|
60
|
-
o[6] || (o[6] =
|
|
61
|
-
o[7] || (o[7] =
|
|
59
|
+
], 64)) : i.name === "edit" ? (C(), E(F, { key: 3 }, [
|
|
60
|
+
o[6] || (o[6] = p("path", { d: "M4 20 l4 -1 11 -11 -3 -3 -11 11 z" }, null, -1)),
|
|
61
|
+
o[7] || (o[7] = p("line", {
|
|
62
62
|
x1: "14",
|
|
63
63
|
y1: "6",
|
|
64
64
|
x2: "18",
|
|
65
65
|
y2: "10"
|
|
66
66
|
}, null, -1))
|
|
67
|
-
], 64)) :
|
|
68
|
-
o[8] || (o[8] =
|
|
67
|
+
], 64)) : i.name === "collapse" ? (C(), E("polyline", Ln)) : i.name === "expand" ? (C(), E("polyline", An)) : i.name === "zoom-in" ? (C(), E(F, { key: 6 }, [
|
|
68
|
+
o[8] || (o[8] = p("circle", {
|
|
69
69
|
cx: "11",
|
|
70
70
|
cy: "11",
|
|
71
71
|
r: "7"
|
|
72
72
|
}, null, -1)),
|
|
73
|
-
o[9] || (o[9] =
|
|
73
|
+
o[9] || (o[9] = p("line", {
|
|
74
74
|
x1: "11",
|
|
75
75
|
y1: "8",
|
|
76
76
|
x2: "11",
|
|
77
77
|
y2: "14"
|
|
78
78
|
}, null, -1)),
|
|
79
|
-
o[10] || (o[10] =
|
|
79
|
+
o[10] || (o[10] = p("line", {
|
|
80
80
|
x1: "8",
|
|
81
81
|
y1: "11",
|
|
82
82
|
x2: "14",
|
|
83
83
|
y2: "11"
|
|
84
84
|
}, null, -1)),
|
|
85
|
-
o[11] || (o[11] =
|
|
85
|
+
o[11] || (o[11] = p("line", {
|
|
86
86
|
x1: "16",
|
|
87
87
|
y1: "16",
|
|
88
88
|
x2: "21",
|
|
89
89
|
y2: "21"
|
|
90
90
|
}, null, -1))
|
|
91
|
-
], 64)) :
|
|
92
|
-
o[12] || (o[12] =
|
|
91
|
+
], 64)) : i.name === "zoom-out" ? (C(), E(F, { key: 7 }, [
|
|
92
|
+
o[12] || (o[12] = p("circle", {
|
|
93
93
|
cx: "11",
|
|
94
94
|
cy: "11",
|
|
95
95
|
r: "7"
|
|
96
96
|
}, null, -1)),
|
|
97
|
-
o[13] || (o[13] =
|
|
97
|
+
o[13] || (o[13] = p("line", {
|
|
98
98
|
x1: "8",
|
|
99
99
|
y1: "11",
|
|
100
100
|
x2: "14",
|
|
101
101
|
y2: "11"
|
|
102
102
|
}, null, -1)),
|
|
103
|
-
o[14] || (o[14] =
|
|
103
|
+
o[14] || (o[14] = p("line", {
|
|
104
104
|
x1: "16",
|
|
105
105
|
y1: "16",
|
|
106
106
|
x2: "21",
|
|
107
107
|
y2: "21"
|
|
108
108
|
}, null, -1))
|
|
109
|
-
], 64)) :
|
|
110
|
-
o[15] || (o[15] =
|
|
109
|
+
], 64)) : i.name === "reset" ? (C(), E(F, { key: 8 }, [
|
|
110
|
+
o[15] || (o[15] = p("circle", {
|
|
111
111
|
cx: "12",
|
|
112
112
|
cy: "12",
|
|
113
113
|
r: "9"
|
|
114
114
|
}, null, -1)),
|
|
115
|
-
o[16] || (o[16] =
|
|
115
|
+
o[16] || (o[16] = p("circle", {
|
|
116
116
|
cx: "12",
|
|
117
117
|
cy: "12",
|
|
118
118
|
r: "4"
|
|
119
119
|
}, null, -1)),
|
|
120
|
-
o[17] || (o[17] =
|
|
120
|
+
o[17] || (o[17] = p("circle", {
|
|
121
121
|
cx: "12",
|
|
122
122
|
cy: "12",
|
|
123
123
|
r: "0.8",
|
|
124
124
|
fill: "currentColor"
|
|
125
125
|
}, null, -1))
|
|
126
|
-
], 64)) :
|
|
126
|
+
], 64)) : i.name === "logo" ? (C(), E(F, { key: 9 }, [
|
|
127
127
|
o[18] || (o[18] = Ne('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>', 9))
|
|
128
|
-
], 64)) :
|
|
129
|
-
o[19] || (o[19] =
|
|
130
|
-
o[20] || (o[20] =
|
|
131
|
-
o[21] || (o[21] =
|
|
132
|
-
], 64)) :
|
|
133
|
-
o[22] || (o[22] =
|
|
134
|
-
o[23] || (o[23] =
|
|
135
|
-
o[24] || (o[24] =
|
|
136
|
-
], 64)) :
|
|
128
|
+
], 64)) : i.name === "import" ? (C(), E(F, { key: 10 }, [
|
|
129
|
+
o[19] || (o[19] = p("path", { d: "M12 4 V15" }, null, -1)),
|
|
130
|
+
o[20] || (o[20] = p("polyline", { points: "7 10 12 15 17 10" }, null, -1)),
|
|
131
|
+
o[21] || (o[21] = p("path", { d: "M4 19 H20" }, null, -1))
|
|
132
|
+
], 64)) : i.name === "export" ? (C(), E(F, { key: 11 }, [
|
|
133
|
+
o[22] || (o[22] = p("path", { d: "M12 15 V4" }, null, -1)),
|
|
134
|
+
o[23] || (o[23] = p("polyline", { points: "7 9 12 4 17 9" }, null, -1)),
|
|
135
|
+
o[24] || (o[24] = p("path", { d: "M4 19 H20" }, null, -1))
|
|
136
|
+
], 64)) : i.name === "balance" ? (C(), E(F, { key: 12 }, [
|
|
137
137
|
o[25] || (o[25] = Ne('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>', 9))
|
|
138
|
-
], 64)) :
|
|
138
|
+
], 64)) : i.name === "mindmap" ? (C(), E(F, { key: 13 }, [
|
|
139
139
|
o[26] || (o[26] = Ne('<circle cx="12" cy="12" r="2.2" fill="currentColor" stroke="none"></circle><line x1="13" y1="11" x2="19" y2="6"></line><line x1="13" y1="13" x2="19" y2="18"></line><line x1="11" y1="11" x2="5" y2="6"></line><line x1="11" y1="13" x2="5" y2="18"></line>', 5))
|
|
140
|
-
], 64)) :
|
|
140
|
+
], 64)) : i.name === "tree" ? (C(), E(F, { key: 14 }, [
|
|
141
141
|
o[27] || (o[27] = Ne('<circle cx="6" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="6" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="18" r="2" fill="currentColor" stroke="none"></circle><line x1="8" y1="12" x2="16" y2="6"></line><line x1="8" y1="12" x2="16" y2="12"></line><line x1="8" y1="12" x2="16" y2="18"></line>', 7))
|
|
142
|
-
], 64)) :
|
|
142
|
+
], 64)) : i.name === "org" ? (C(), E(F, { key: 15 }, [
|
|
143
143
|
o[28] || (o[28] = Ne('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>', 9))
|
|
144
|
-
], 64)) :
|
|
145
|
-
o[29] || (o[29] =
|
|
144
|
+
], 64)) : i.name === "image" ? (C(), E(F, { key: 16 }, [
|
|
145
|
+
o[29] || (o[29] = p("rect", {
|
|
146
146
|
x: "3",
|
|
147
147
|
y: "5",
|
|
148
148
|
width: "18",
|
|
149
149
|
height: "14",
|
|
150
150
|
rx: "2"
|
|
151
151
|
}, null, -1)),
|
|
152
|
-
o[30] || (o[30] =
|
|
152
|
+
o[30] || (o[30] = p("circle", {
|
|
153
153
|
cx: "9",
|
|
154
154
|
cy: "11",
|
|
155
155
|
r: "1.6"
|
|
156
156
|
}, null, -1)),
|
|
157
|
-
o[31] || (o[31] =
|
|
158
|
-
], 64)) :
|
|
159
|
-
o[32] || (o[32] =
|
|
157
|
+
o[31] || (o[31] = p("polyline", { points: "3 17 9 12 13 15 16 13 21 17" }, null, -1))
|
|
158
|
+
], 64)) : i.name === "x" ? (C(), E(F, { key: 17 }, [
|
|
159
|
+
o[32] || (o[32] = p("line", {
|
|
160
160
|
x1: "6",
|
|
161
161
|
y1: "6",
|
|
162
162
|
x2: "18",
|
|
163
163
|
y2: "18"
|
|
164
164
|
}, null, -1)),
|
|
165
|
-
o[33] || (o[33] =
|
|
165
|
+
o[33] || (o[33] = p("line", {
|
|
166
166
|
x1: "18",
|
|
167
167
|
y1: "6",
|
|
168
168
|
x2: "6",
|
|
169
169
|
y2: "18"
|
|
170
170
|
}, null, -1))
|
|
171
|
-
], 64)) :
|
|
172
|
-
o[34] || (o[34] =
|
|
173
|
-
o[35] || (o[35] =
|
|
174
|
-
], 64)) :
|
|
175
|
-
o[36] || (o[36] =
|
|
176
|
-
o[37] || (o[37] =
|
|
171
|
+
], 64)) : i.name === "link" ? (C(), E(F, { key: 18 }, [
|
|
172
|
+
o[34] || (o[34] = p("path", { d: "M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1" }, null, -1)),
|
|
173
|
+
o[35] || (o[35] = p("path", { d: "M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1" }, null, -1))
|
|
174
|
+
], 64)) : i.name === "note" ? (C(), E(F, { key: 19 }, [
|
|
175
|
+
o[36] || (o[36] = p("path", { d: "M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z" }, null, -1)),
|
|
176
|
+
o[37] || (o[37] = p("line", {
|
|
177
177
|
x1: "8",
|
|
178
178
|
y1: "10",
|
|
179
179
|
x2: "16",
|
|
180
180
|
y2: "10"
|
|
181
181
|
}, null, -1)),
|
|
182
|
-
o[38] || (o[38] =
|
|
182
|
+
o[38] || (o[38] = p("line", {
|
|
183
183
|
x1: "8",
|
|
184
184
|
y1: "13",
|
|
185
185
|
x2: "16",
|
|
186
186
|
y2: "13"
|
|
187
187
|
}, null, -1)),
|
|
188
|
-
o[39] || (o[39] =
|
|
188
|
+
o[39] || (o[39] = p("line", {
|
|
189
189
|
x1: "8",
|
|
190
190
|
y1: "16",
|
|
191
191
|
x2: "13",
|
|
192
192
|
y2: "16"
|
|
193
193
|
}, null, -1))
|
|
194
|
-
], 64)) :
|
|
195
|
-
], 8,
|
|
194
|
+
], 64)) : X("", !0)
|
|
195
|
+
], 8, Bn));
|
|
196
196
|
}
|
|
197
|
-
}), Hn = "data:image/svg+xml,%3csvg%20t='1780822312364'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7459'%20width='200'%20height='200'%3e%3cpath%20d='M329.16%20292.571h658.286V512H329.16zM329.16%200h658.286v219.429H329.16z'%20fill='%239AA1A2'%20p-id='7460'%3e%3c/path%3e%3cpath%20d='M44.927%20146.286a46.519%2046.519%200%200%201%2038.107-73.143h319.269v73.143H109.73V791.99l-48.713%205.705-24.43-651.41h8.339z'%20fill='%239AA1A2'%20p-id='7461'%3e%3c/path%3e%3cpath%20d='M363.83%20877.714H179.51c-78.775%200-142.921-66.12-142.921-147.31V112.787c0-21.943%2017.188-39.643%2038.473-39.643%2021.211%200%2033.5%2017.774%2033.5%2039.643v617.619c0%2037.522%2028.013%2076.58%2064.438%2076.58h190.903c21.211%200%2038.766%2013.97%2038.766%2035.84%200%2021.943-17.555%2034.89-38.766%2034.89z'%20fill='%239AA1A2'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M432.95%20438.857H179.51c-78.775%200-81.043-18.578-81.043-62.903l10.094-90.624c0%2020.48%2013.458%2080.677%2049.884%2080.677h210.139c21.211%200%20120.613%204.023%20120.613%2016.018%200%2011.922-35.036%2056.832-56.32%2056.832zM640.017%20749.714V640a54.857%2054.857%200%200%201%20109.714%200v109.714h109.715a54.857%2054.857%200%200%201%200%20109.715H749.73v109.714a54.857%2054.857%200%200%201-109.714%200V859.429H530.303a54.857%2054.857%200%200%201%200-109.715h109.714z'%20fill='%239AA1A2'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e", Dn = "data:image/svg+xml,%3csvg%20t='1780822464335'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8457'%20width='200'%20height='200'%3e%3cpath%20d='M512%20804.571h512V1024H512V804.571zM0%200h658.286v219.429H0V0z'%20fill='%239AA1A2'%20p-id='8458'%3e%3c/path%3e%3cpath%20d='M619.813%20950.857h-184.32c-78.775%200-142.922-66.121-142.922-147.31V185.93c0-21.943%2017.189-39.643%2038.474-39.643%2021.211%200%2033.353%2017.773%2033.353%2039.643v617.618c0%2037.523%2034.743%2073.728%2071.095%2073.728h184.32c21.211%200%2038.473%2012.069%2038.473%2033.939%200%2021.943-17.189%2039.643-38.473%2039.643z'%20fill='%239AA1A2'%20p-id='8459'%3e%3c/path%3e%3cpath%20d='M676.571%20457.143V347.429a54.857%2054.857%200%200%201%20109.715%200v109.714H896a54.857%2054.857%200%200%201%200%20109.714H786.286v109.714a54.857%2054.857%200%200%201-109.715%200V566.857H566.857a54.857%2054.857%200%200%201%200-109.714h109.714z'%20fill='%239AA1A2'%20p-id='8460'%3e%3c/path%3e%3c/svg%3e",
|
|
198
|
-
function Xn(
|
|
199
|
-
return Math.round(ft(
|
|
197
|
+
}), Hn = "data:image/svg+xml,%3csvg%20t='1780822312364'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7459'%20width='200'%20height='200'%3e%3cpath%20d='M329.16%20292.571h658.286V512H329.16zM329.16%200h658.286v219.429H329.16z'%20fill='%239AA1A2'%20p-id='7460'%3e%3c/path%3e%3cpath%20d='M44.927%20146.286a46.519%2046.519%200%200%201%2038.107-73.143h319.269v73.143H109.73V791.99l-48.713%205.705-24.43-651.41h8.339z'%20fill='%239AA1A2'%20p-id='7461'%3e%3c/path%3e%3cpath%20d='M363.83%20877.714H179.51c-78.775%200-142.921-66.12-142.921-147.31V112.787c0-21.943%2017.188-39.643%2038.473-39.643%2021.211%200%2033.5%2017.774%2033.5%2039.643v617.619c0%2037.522%2028.013%2076.58%2064.438%2076.58h190.903c21.211%200%2038.766%2013.97%2038.766%2035.84%200%2021.943-17.555%2034.89-38.766%2034.89z'%20fill='%239AA1A2'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M432.95%20438.857H179.51c-78.775%200-81.043-18.578-81.043-62.903l10.094-90.624c0%2020.48%2013.458%2080.677%2049.884%2080.677h210.139c21.211%200%20120.613%204.023%20120.613%2016.018%200%2011.922-35.036%2056.832-56.32%2056.832zM640.017%20749.714V640a54.857%2054.857%200%200%201%20109.714%200v109.714h109.715a54.857%2054.857%200%200%201%200%20109.715H749.73v109.714a54.857%2054.857%200%200%201-109.714%200V859.429H530.303a54.857%2054.857%200%200%201%200-109.715h109.714z'%20fill='%239AA1A2'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e", Dn = "data:image/svg+xml,%3csvg%20t='1780822464335'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8457'%20width='200'%20height='200'%3e%3cpath%20d='M512%20804.571h512V1024H512V804.571zM0%200h658.286v219.429H0V0z'%20fill='%239AA1A2'%20p-id='8458'%3e%3c/path%3e%3cpath%20d='M619.813%20950.857h-184.32c-78.775%200-142.922-66.121-142.922-147.31V185.93c0-21.943%2017.189-39.643%2038.474-39.643%2021.211%200%2033.353%2017.773%2033.353%2039.643v617.618c0%2037.523%2034.743%2073.728%2071.095%2073.728h184.32c21.211%200%2038.473%2012.069%2038.473%2033.939%200%2021.943-17.189%2039.643-38.473%2039.643z'%20fill='%239AA1A2'%20p-id='8459'%3e%3c/path%3e%3cpath%20d='M676.571%20457.143V347.429a54.857%2054.857%200%200%201%20109.715%200v109.714H896a54.857%2054.857%200%200%201%200%20109.714H786.286v109.714a54.857%2054.857%200%200%201-109.715%200V566.857H566.857a54.857%2054.857%200%200%201%200-109.714h109.714z'%20fill='%239AA1A2'%20p-id='8460'%3e%3c/path%3e%3c/svg%3e", Ut = [18, 15, 13, 12], Pn = [700, 600, 500, 400], Tn = [52, 40, 32, 28], On = [120, 80, 60, 44], Fn = [0.8, 0.8, 0.8, 0.8], Vn = Ut.length - 1;
|
|
198
|
+
function Xn(i, s) {
|
|
199
|
+
return Math.round(ft(i, s) * Fn[Ze(i)]);
|
|
200
200
|
}
|
|
201
|
-
function Ze(
|
|
202
|
-
return Math.min(Vn, Math.max(0,
|
|
201
|
+
function Ze(i) {
|
|
202
|
+
return Math.min(Vn, Math.max(0, i));
|
|
203
203
|
}
|
|
204
|
-
function ft(
|
|
205
|
-
return Math.round(
|
|
204
|
+
function ft(i, s = 14) {
|
|
205
|
+
return Math.round(Ut[Ze(i)] * s / 14 * 10) / 10;
|
|
206
206
|
}
|
|
207
|
-
function qn(
|
|
208
|
-
return Math.round(Tn[Ze(
|
|
207
|
+
function qn(i, s = 14) {
|
|
208
|
+
return Math.round(Tn[Ze(i)] * s / 14);
|
|
209
209
|
}
|
|
210
|
-
const
|
|
210
|
+
const Ke = 60, $e = 14, oe = 24;
|
|
211
211
|
let at = null;
|
|
212
|
-
function
|
|
212
|
+
function Un() {
|
|
213
213
|
if (at) return at;
|
|
214
|
-
const
|
|
215
|
-
return
|
|
214
|
+
const i = typeof document < "u" ? document.createElement("canvas").getContext("2d") : null;
|
|
215
|
+
return i ? (at = i, i) : {
|
|
216
216
|
font: "",
|
|
217
217
|
measureText: () => ({ width: 0 })
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
const Ft = /* @__PURE__ */ new Map();
|
|
221
|
-
function
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
const
|
|
227
|
-
return Ft.set(
|
|
221
|
+
function Yn(i, s, o) {
|
|
222
|
+
const n = `${o}|${s}|${i}`, r = Ft.get(n);
|
|
223
|
+
if (r !== void 0) return r;
|
|
224
|
+
const c = Un();
|
|
225
|
+
c.font = `${o} ${s}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;
|
|
226
|
+
const d = c.measureText(i).width;
|
|
227
|
+
return Ft.set(n, d), d;
|
|
228
228
|
}
|
|
229
|
-
const
|
|
230
|
-
function Qn(
|
|
231
|
-
return Math.min(o, Math.max(s,
|
|
229
|
+
const Kn = 24, jn = 400, Gn = 8, Vt = 16, Jn = 4, Zn = 200;
|
|
230
|
+
function Qn(i, s, o) {
|
|
231
|
+
return Math.min(o, Math.max(s, i));
|
|
232
232
|
}
|
|
233
|
-
function _n(
|
|
234
|
-
const
|
|
235
|
-
let
|
|
236
|
-
if (
|
|
237
|
-
const
|
|
238
|
-
|
|
233
|
+
function _n(i, s, o) {
|
|
234
|
+
const n = Ze(s), r = ft(s, o), c = Math.min(Yn(i.text || "", r, Pn[n]), Zn), d = Xn(s, o), x = Math.ceil(c + d * 2), f = qn(s, o);
|
|
235
|
+
let v = 0;
|
|
236
|
+
if (i.link && (v += Vt), i.note && (v += Vt), v > 0) {
|
|
237
|
+
const Y = (i.link ? 1 : 0) + (i.note ? 1 : 0);
|
|
238
|
+
v += Jn * Y;
|
|
239
239
|
}
|
|
240
|
-
const u = x +
|
|
241
|
-
if (!
|
|
242
|
-
return { w: Math.max(
|
|
243
|
-
const
|
|
244
|
-
return { w:
|
|
240
|
+
const u = x + v, g = Math.round(On[n] * o / 14), M = 0, w = 0;
|
|
241
|
+
if (!i.image)
|
|
242
|
+
return { w: Math.max(g, u), h: f + w + M };
|
|
243
|
+
const H = Qn(i.image.width, Kn, jn), j = Math.max(g, u, Math.ceil(H + d * 2)), Z = Math.ceil(i.image.height + Gn + f + w + M);
|
|
244
|
+
return { w: j, h: Z };
|
|
245
245
|
}
|
|
246
|
-
function ei(
|
|
247
|
-
const o = s.mode ?? "mindmap",
|
|
248
|
-
return ni(
|
|
246
|
+
function ei(i, s = {}) {
|
|
247
|
+
const o = s.mode ?? "mindmap", n = s.preservePositions === !0, r = s.baseFontSize ?? 14, c = Kt(i, 0, null, 1, "right", r);
|
|
248
|
+
return ni(c), ti(c, o, n), c.x = 0, c.y = 0, ii(c, n);
|
|
249
249
|
}
|
|
250
|
-
function ti(
|
|
250
|
+
function ti(i, s, o = !1) {
|
|
251
251
|
if (s === "mindmap") {
|
|
252
|
-
const
|
|
253
|
-
if (
|
|
254
|
-
|
|
252
|
+
const n = i.children;
|
|
253
|
+
if (n.length !== 0) if (n.length === 1)
|
|
254
|
+
n[0]._dir = "right", n[0].side = 1, n[0]._dirRight = 1;
|
|
255
255
|
else {
|
|
256
|
-
const x =
|
|
257
|
-
let
|
|
258
|
-
for (let
|
|
259
|
-
u +=
|
|
260
|
-
const
|
|
261
|
-
|
|
256
|
+
const x = n.reduce((g, M) => g + M._subtreeH, 0);
|
|
257
|
+
let f = 1, v = Math.abs(n[0]._subtreeH - (x - n[0]._subtreeH)), u = 0;
|
|
258
|
+
for (let g = 0; g < n.length - 1; g++) {
|
|
259
|
+
u += n[g]._subtreeH;
|
|
260
|
+
const M = Math.abs(u - (x - u));
|
|
261
|
+
M < v && (v = M, f = g + 1);
|
|
262
262
|
}
|
|
263
|
-
for (let
|
|
264
|
-
|
|
265
|
-
for (let
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
const
|
|
269
|
-
const
|
|
270
|
-
x._dir =
|
|
271
|
-
for (const u of x.children)
|
|
263
|
+
for (let g = 0; g < f; g++)
|
|
264
|
+
n[g]._dir = "right", n[g].side = 1, n[g]._dirRight = 1;
|
|
265
|
+
for (let g = f; g < n.length; g++)
|
|
266
|
+
n[g]._dir = "left", n[g].side = -1, n[g]._dirRight = -1;
|
|
267
|
+
}
|
|
268
|
+
const r = i.children.filter((x) => x.side === 1), c = i.children.filter((x) => x.side === -1), d = (x, f) => {
|
|
269
|
+
const v = f === "right" ? 1 : -1;
|
|
270
|
+
x._dir = f, x.side = v, x._dirRight = v;
|
|
271
|
+
for (const u of x.children) d(u, f);
|
|
272
272
|
};
|
|
273
|
-
for (const x of
|
|
274
|
-
for (const x of
|
|
275
|
-
if (
|
|
276
|
-
const x = { ...
|
|
277
|
-
|
|
273
|
+
for (const x of r) d(x, "right");
|
|
274
|
+
for (const x of c) d(x, "left");
|
|
275
|
+
if (r.length > 0) {
|
|
276
|
+
const x = { ...i, children: r };
|
|
277
|
+
Ge(x, "right", Ke, !0, o);
|
|
278
278
|
}
|
|
279
|
-
if (
|
|
280
|
-
const x = { ...
|
|
281
|
-
|
|
279
|
+
if (c.length > 0) {
|
|
280
|
+
const x = { ...i, children: c };
|
|
281
|
+
Ge(x, "left", Ke, !0, o);
|
|
282
282
|
}
|
|
283
283
|
} else if (s === "tree") {
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
for (const
|
|
284
|
+
const n = (r) => {
|
|
285
|
+
r.side = 1, r._dir = "right";
|
|
286
|
+
for (const c of r.children) n(c);
|
|
287
287
|
};
|
|
288
|
-
for (const
|
|
289
|
-
|
|
288
|
+
for (const r of i.children) r._dir = "right";
|
|
289
|
+
Ge(i, "right", Ke, !0, o), n(i);
|
|
290
290
|
} else {
|
|
291
|
-
for (const
|
|
292
|
-
|
|
291
|
+
for (const n of i.children) n._dir = "down";
|
|
292
|
+
Yt(i, Ke, o);
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
if (
|
|
297
|
-
const
|
|
298
|
-
(
|
|
295
|
+
function Ge(i, s, o, n, r = !1) {
|
|
296
|
+
if (i.children.length === 0) return;
|
|
297
|
+
const c = i.children.reduce(
|
|
298
|
+
(v, u, g) => v + u._subtreeH + (g > 0 ? $e : 0),
|
|
299
299
|
0
|
|
300
|
-
),
|
|
301
|
-
let
|
|
302
|
-
|
|
303
|
-
|
|
300
|
+
), d = s === "right" ? 1 : -1, x = n ? d : 1;
|
|
301
|
+
let f = i.y - x * c / 2;
|
|
302
|
+
i.children.forEach((v) => {
|
|
303
|
+
r || (v.x = i.x + d * (i.width / 2 + o + v.width / 2), v.y = f + x * v._subtreeH / 2), v._dir = s, f += x * (v._subtreeH + $e), Ge(v, s, o, !1, r);
|
|
304
304
|
});
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
if (
|
|
308
|
-
const
|
|
309
|
-
(
|
|
306
|
+
function Yt(i, s, o = !1) {
|
|
307
|
+
if (i.children.length === 0) return;
|
|
308
|
+
const n = i.children.reduce(
|
|
309
|
+
(c, d, x) => c + d._subtreeW + (x > 0 ? $e * 2 : 0),
|
|
310
310
|
0
|
|
311
311
|
);
|
|
312
|
-
let
|
|
313
|
-
|
|
314
|
-
o || (
|
|
312
|
+
let r = i.x - n / 2;
|
|
313
|
+
i.children.forEach((c) => {
|
|
314
|
+
o || (c.x = r + c._subtreeW / 2, c.y = i.y + i.height / 2 + s + c.height / 2), c._dir = "down", r += c._subtreeW + $e * 2, Yt(c, s, o);
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
|
-
function
|
|
318
|
-
const
|
|
319
|
-
id:
|
|
320
|
-
text:
|
|
317
|
+
function Kt(i, s, o, n, r, c) {
|
|
318
|
+
const d = _n(i, s, c), x = {
|
|
319
|
+
id: i.id,
|
|
320
|
+
text: i.text,
|
|
321
321
|
depth: s,
|
|
322
322
|
// Honor a user-set position from the data tree (drag commit).
|
|
323
323
|
// The next applyDoLayout pass will overwrite these unless
|
|
324
324
|
// preservePositions is true.
|
|
325
|
-
x:
|
|
326
|
-
y:
|
|
327
|
-
width:
|
|
328
|
-
height:
|
|
329
|
-
fontSize: ft(s,
|
|
325
|
+
x: i._x ?? 0,
|
|
326
|
+
y: i._y ?? 0,
|
|
327
|
+
width: d.w,
|
|
328
|
+
height: d.h,
|
|
329
|
+
fontSize: ft(s, c),
|
|
330
330
|
isRoot: s === 0,
|
|
331
|
-
collapsed:
|
|
332
|
-
side:
|
|
333
|
-
_dir:
|
|
334
|
-
_dirRight:
|
|
335
|
-
_subtreeH:
|
|
336
|
-
_subtreeW:
|
|
337
|
-
image:
|
|
338
|
-
link:
|
|
339
|
-
note:
|
|
331
|
+
collapsed: i.collapsed,
|
|
332
|
+
side: n,
|
|
333
|
+
_dir: r,
|
|
334
|
+
_dirRight: n,
|
|
335
|
+
_subtreeH: d.h,
|
|
336
|
+
_subtreeW: d.w,
|
|
337
|
+
image: i.image ? { ...i.image } : void 0,
|
|
338
|
+
link: i.link ? { url: i.link.url } : void 0,
|
|
339
|
+
note: i.note ? { text: i.note.text } : void 0,
|
|
340
|
+
richContent: i.richContent ? { kind: i.richContent.kind, raw: i.richContent.raw, lang: i.richContent.lang } : void 0,
|
|
340
341
|
children: [],
|
|
341
342
|
parent: o
|
|
342
343
|
};
|
|
343
|
-
if (
|
|
344
|
-
const
|
|
345
|
-
return x.children =
|
|
346
|
-
const
|
|
347
|
-
return
|
|
344
|
+
if (i.collapsed) return x;
|
|
345
|
+
const f = i.children.length, v = Math.ceil(f / 2);
|
|
346
|
+
return x.children = i.children.map((u, g) => {
|
|
347
|
+
const M = s === 0 ? g < v ? 1 : -1 : n;
|
|
348
|
+
return Kt(u, s + 1, x, M, r, c);
|
|
348
349
|
}), x;
|
|
349
350
|
}
|
|
350
|
-
function ni(
|
|
351
|
-
const s = [
|
|
351
|
+
function ni(i) {
|
|
352
|
+
const s = [i];
|
|
352
353
|
for (let o = 0; o < s.length; o++) {
|
|
353
|
-
const
|
|
354
|
-
for (const
|
|
354
|
+
const n = s[o];
|
|
355
|
+
for (const r of n.children) s.push(r);
|
|
355
356
|
}
|
|
356
357
|
for (let o = s.length - 1; o >= 0; o--) {
|
|
357
|
-
const
|
|
358
|
-
if (
|
|
359
|
-
|
|
358
|
+
const n = s[o];
|
|
359
|
+
if (n.collapsed || n.children.length === 0) {
|
|
360
|
+
n._subtreeH = n.height, n._subtreeW = n.width;
|
|
360
361
|
continue;
|
|
361
362
|
}
|
|
362
|
-
let
|
|
363
|
-
for (const
|
|
364
|
-
|
|
365
|
-
|
|
363
|
+
let r = 0, c = 0;
|
|
364
|
+
for (const d of n.children)
|
|
365
|
+
r += d._subtreeH, c += d._subtreeW;
|
|
366
|
+
n.children.length > 1 && (r += $e * (n.children.length - 1), c += $e * 2 * (n.children.length - 1)), n._subtreeH = Math.max(n.height, r), n._subtreeW = Math.max(n.width, c);
|
|
366
367
|
}
|
|
367
368
|
}
|
|
368
|
-
function ii(
|
|
369
|
-
const o = [
|
|
370
|
-
let
|
|
369
|
+
function ii(i, s = !1) {
|
|
370
|
+
const o = [i];
|
|
371
|
+
let n = 1 / 0, r = -1 / 0, c = 1 / 0, d = -1 / 0;
|
|
371
372
|
for (; o.length; ) {
|
|
372
|
-
const
|
|
373
|
-
|
|
373
|
+
const v = o.pop(), u = v.width / 2, g = v.height / 2;
|
|
374
|
+
v.x - u < n && (n = v.x - u), v.x + u > r && (r = v.x + u), v.y - g < c && (c = v.y - g), v.y + g > d && (d = v.y + g), o.push(...v.children);
|
|
374
375
|
}
|
|
375
376
|
if (s)
|
|
376
377
|
return {
|
|
377
|
-
root:
|
|
378
|
-
width:
|
|
379
|
-
height:
|
|
380
|
-
vbX:
|
|
381
|
-
vbY:
|
|
382
|
-
vbW:
|
|
383
|
-
vbH:
|
|
378
|
+
root: i,
|
|
379
|
+
width: r - n + oe * 2,
|
|
380
|
+
height: d - c + oe * 2,
|
|
381
|
+
vbX: n - oe,
|
|
382
|
+
vbY: c - oe,
|
|
383
|
+
vbW: r - n + oe * 2,
|
|
384
|
+
vbH: d - c + oe * 2
|
|
384
385
|
};
|
|
385
|
-
const x =
|
|
386
|
-
for (;
|
|
387
|
-
const
|
|
388
|
-
|
|
386
|
+
const x = oe - c, f = [i];
|
|
387
|
+
for (; f.length; ) {
|
|
388
|
+
const v = f.pop();
|
|
389
|
+
v.y += x, f.push(...v.children);
|
|
389
390
|
}
|
|
390
|
-
return
|
|
391
|
-
root:
|
|
392
|
-
width:
|
|
393
|
-
height:
|
|
394
|
-
vbX:
|
|
391
|
+
return c += x, d += x, {
|
|
392
|
+
root: i,
|
|
393
|
+
width: r - n + oe * 2,
|
|
394
|
+
height: d + oe,
|
|
395
|
+
vbX: n - oe,
|
|
395
396
|
vbY: 0,
|
|
396
|
-
vbW:
|
|
397
|
-
vbH:
|
|
397
|
+
vbW: r - n + oe * 2,
|
|
398
|
+
vbH: d + oe
|
|
398
399
|
};
|
|
399
400
|
}
|
|
400
401
|
const Pe = [
|
|
@@ -469,344 +470,462 @@ const Pe = [
|
|
|
469
470
|
]
|
|
470
471
|
}
|
|
471
472
|
];
|
|
472
|
-
function oi(
|
|
473
|
-
return [...Pe, ...s].find((
|
|
473
|
+
function oi(i, s = []) {
|
|
474
|
+
return [...Pe, ...s].find((n) => n.id === i) ?? Pe[0];
|
|
474
475
|
}
|
|
475
|
-
function
|
|
476
|
+
function ue() {
|
|
476
477
|
return "n_" + Math.random().toString(36).slice(2, 10) + Date.now().toString(36).slice(-4);
|
|
477
478
|
}
|
|
478
|
-
function
|
|
479
|
-
return JSON.parse(JSON.stringify(
|
|
479
|
+
function me(i) {
|
|
480
|
+
return JSON.parse(JSON.stringify(i));
|
|
480
481
|
}
|
|
481
|
-
function
|
|
482
|
-
if (
|
|
483
|
-
for (const o of
|
|
484
|
-
const
|
|
485
|
-
if (
|
|
482
|
+
function A(i, s) {
|
|
483
|
+
if (i.id === s) return i;
|
|
484
|
+
for (const o of i.children) {
|
|
485
|
+
const n = A(o, s);
|
|
486
|
+
if (n) return n;
|
|
486
487
|
}
|
|
487
488
|
return null;
|
|
488
489
|
}
|
|
489
|
-
function
|
|
490
|
-
if (
|
|
491
|
-
for (const
|
|
492
|
-
const
|
|
493
|
-
if (
|
|
490
|
+
function ce(i, s, o = null) {
|
|
491
|
+
if (i.id === s) return o;
|
|
492
|
+
for (const n of i.children) {
|
|
493
|
+
const r = ce(n, s, i);
|
|
494
|
+
if (r !== null) return r;
|
|
494
495
|
}
|
|
495
496
|
return null;
|
|
496
497
|
}
|
|
497
|
-
function
|
|
498
|
-
const o =
|
|
498
|
+
function jt(i, s) {
|
|
499
|
+
const o = i.children.findIndex((n) => n.id === s);
|
|
499
500
|
if (o >= 0)
|
|
500
|
-
return
|
|
501
|
-
for (const
|
|
502
|
-
if (
|
|
501
|
+
return i.children.splice(o, 1), !0;
|
|
502
|
+
for (const n of i.children)
|
|
503
|
+
if (jt(n, s)) return !0;
|
|
503
504
|
return !1;
|
|
504
505
|
}
|
|
505
|
-
function li(
|
|
506
|
-
const
|
|
507
|
-
return !
|
|
506
|
+
function li(i, s, o) {
|
|
507
|
+
const n = A(i, s);
|
|
508
|
+
return !n || n.text === o ? !1 : (n.text = o, !0);
|
|
508
509
|
}
|
|
509
|
-
function ri(
|
|
510
|
-
if (!
|
|
511
|
-
const
|
|
512
|
-
if (
|
|
513
|
-
const [
|
|
514
|
-
if (
|
|
515
|
-
const
|
|
516
|
-
return
|
|
510
|
+
function ri(i, s, o, n) {
|
|
511
|
+
if (!ce(i, s) || s === o || A(A(i, s), o)) return !1;
|
|
512
|
+
const r = ce(i, s), c = r.children.findIndex((v) => v.id === s);
|
|
513
|
+
if (c < 0) return !1;
|
|
514
|
+
const [d] = r.children.splice(c, 1);
|
|
515
|
+
if (n === "child") {
|
|
516
|
+
const v = A(i, o);
|
|
517
|
+
return v ? (v.children.push(d), !0) : (r.children.splice(c, 0, d), !1);
|
|
517
518
|
}
|
|
518
|
-
const x =
|
|
519
|
+
const x = ce(i, o);
|
|
519
520
|
if (!x)
|
|
520
|
-
return
|
|
521
|
-
let
|
|
522
|
-
return
|
|
521
|
+
return r.children.splice(c, 0, d), !1;
|
|
522
|
+
let f = x.children.findIndex((v) => v.id === o);
|
|
523
|
+
return f < 0 ? (r.children.splice(c, 0, d), !1) : (n === "after" && (f += 1), x.children.splice(f, 0, d), !0);
|
|
523
524
|
}
|
|
524
|
-
function
|
|
525
|
+
function Gt(i) {
|
|
525
526
|
const s = /^新节点(?:\s+(\d+))?$/;
|
|
526
|
-
let o = 0,
|
|
527
|
-
for (const
|
|
528
|
-
const
|
|
529
|
-
if (
|
|
530
|
-
if (
|
|
531
|
-
const
|
|
532
|
-
|
|
527
|
+
let o = 0, n = !1;
|
|
528
|
+
for (const r of i.children) {
|
|
529
|
+
const c = r.text.match(s);
|
|
530
|
+
if (c)
|
|
531
|
+
if (c[1]) {
|
|
532
|
+
const d = parseInt(c[1], 10);
|
|
533
|
+
d > o && (o = d);
|
|
533
534
|
} else
|
|
534
|
-
|
|
535
|
+
n = !0;
|
|
535
536
|
}
|
|
536
|
-
return o === 0 && !
|
|
537
|
+
return o === 0 && !n ? Je : o > 0 ? `新节点 ${o + 1}` : "新节点 2";
|
|
537
538
|
}
|
|
538
|
-
function ai(
|
|
539
|
-
const
|
|
540
|
-
if (!
|
|
541
|
-
const
|
|
542
|
-
return
|
|
539
|
+
function ai(i, s, o) {
|
|
540
|
+
const n = A(i, s);
|
|
541
|
+
if (!n) return null;
|
|
542
|
+
const r = { id: ue(), text: o ?? Gt(n), children: [] };
|
|
543
|
+
return n.children.push(r), r;
|
|
543
544
|
}
|
|
544
|
-
function
|
|
545
|
-
const
|
|
546
|
-
if (!
|
|
547
|
-
const
|
|
548
|
-
if (
|
|
549
|
-
const
|
|
550
|
-
return
|
|
545
|
+
function si(i, s, o) {
|
|
546
|
+
const n = ce(i, s);
|
|
547
|
+
if (!n) return null;
|
|
548
|
+
const r = n.children.findIndex((d) => d.id === s);
|
|
549
|
+
if (r < 0) return null;
|
|
550
|
+
const c = { id: ue(), text: o ?? Gt(n), children: [] };
|
|
551
|
+
return n.children.splice(r + 1, 0, c), c;
|
|
551
552
|
}
|
|
552
|
-
function
|
|
553
|
-
const
|
|
554
|
-
if (!
|
|
555
|
-
const
|
|
556
|
-
if (
|
|
557
|
-
const
|
|
558
|
-
return
|
|
553
|
+
function ui(i, s, o) {
|
|
554
|
+
const n = ce(i, s);
|
|
555
|
+
if (!n) return null;
|
|
556
|
+
const r = n.children.findIndex((d) => d.id === s);
|
|
557
|
+
if (r < 0) return null;
|
|
558
|
+
const c = { id: ue(), text: o, children: [] };
|
|
559
|
+
return n.children.splice(r, 0, c), c;
|
|
559
560
|
}
|
|
560
|
-
function
|
|
561
|
-
const o =
|
|
561
|
+
function ci(i, s) {
|
|
562
|
+
const o = ce(i, s);
|
|
562
563
|
if (!o) return null;
|
|
563
|
-
const
|
|
564
|
-
if (
|
|
565
|
-
const
|
|
566
|
-
return Jt(
|
|
564
|
+
const n = o.children.findIndex((d) => d.id === s);
|
|
565
|
+
if (n < 0) return null;
|
|
566
|
+
const r = o.children[n], c = me(r);
|
|
567
|
+
return Jt(c), o.children.splice(n + 1, 0, c), c;
|
|
567
568
|
}
|
|
568
|
-
function Jt(
|
|
569
|
-
|
|
570
|
-
for (const s of
|
|
569
|
+
function Jt(i) {
|
|
570
|
+
i.id = ue();
|
|
571
|
+
for (const s of i.children) Jt(s);
|
|
571
572
|
}
|
|
572
573
|
const Je = "新节点";
|
|
573
|
-
function Xt(
|
|
574
|
-
const o =
|
|
575
|
-
let
|
|
576
|
-
function
|
|
577
|
-
|
|
574
|
+
function Xt(i, s = "导入的导图") {
|
|
575
|
+
const o = i.split(/\r?\n/), n = { id: ue(), text: s, children: [] }, r = [n], c = [-1 / 0], d = [], x = /^(#{1,6})\s+(.+?)\s*#*\s*$/, f = /^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/, v = /^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/, u = /^(`{3,}|~{3,})\s*(\S+)?\s*$/;
|
|
576
|
+
let g = !1, M = [], w = null;
|
|
577
|
+
function H(b) {
|
|
578
|
+
M.push(b);
|
|
578
579
|
}
|
|
579
|
-
function
|
|
580
|
-
if (
|
|
581
|
-
for (;
|
|
582
|
-
for (;
|
|
583
|
-
const
|
|
580
|
+
function j() {
|
|
581
|
+
if (w && M.length > 0) {
|
|
582
|
+
for (; M.length > 0 && M[0].trim() === ""; ) M.shift();
|
|
583
|
+
for (; M.length > 0 && M[M.length - 1].trim() === ""; ) M.pop();
|
|
584
|
+
const b = M.join(`
|
|
584
585
|
`);
|
|
585
|
-
|
|
586
|
+
b && (w.note = { text: b });
|
|
586
587
|
}
|
|
587
|
-
|
|
588
|
+
g = !1, M = [];
|
|
588
589
|
}
|
|
589
|
-
for (const
|
|
590
|
-
if (
|
|
591
|
-
const
|
|
592
|
-
if (
|
|
593
|
-
|
|
590
|
+
for (const b of o) {
|
|
591
|
+
if (g) {
|
|
592
|
+
const V = b.match(u);
|
|
593
|
+
if (V && V[1][0] === "`") {
|
|
594
|
+
j();
|
|
594
595
|
continue;
|
|
595
596
|
}
|
|
596
|
-
|
|
597
|
+
H(b);
|
|
597
598
|
continue;
|
|
598
599
|
}
|
|
599
|
-
const
|
|
600
|
-
if (
|
|
601
|
-
const
|
|
602
|
-
|
|
600
|
+
const z = b.match(x);
|
|
601
|
+
if (z) {
|
|
602
|
+
const V = z[1].length, se = z[2].trim();
|
|
603
|
+
d.push({ level: V, text: se, body: "" }), w = d[d.length - 1];
|
|
603
604
|
continue;
|
|
604
605
|
}
|
|
605
|
-
const
|
|
606
|
-
if (
|
|
607
|
-
|
|
606
|
+
const L = b.match(u);
|
|
607
|
+
if (L && L[2] === "note") {
|
|
608
|
+
g = !0, M = [];
|
|
608
609
|
continue;
|
|
609
610
|
}
|
|
610
|
-
const
|
|
611
|
-
if (
|
|
612
|
-
const
|
|
613
|
-
|
|
611
|
+
const $ = b.match(f);
|
|
612
|
+
if ($ && w) {
|
|
613
|
+
const V = $[2], se = 160, ge = 120;
|
|
614
|
+
w.image = { src: V, naturalW: se, naturalH: ge, width: se, height: ge };
|
|
614
615
|
continue;
|
|
615
616
|
}
|
|
616
|
-
const
|
|
617
|
-
if (
|
|
618
|
-
|
|
617
|
+
const J = b.match(v);
|
|
618
|
+
if (J && w) {
|
|
619
|
+
w.link = { url: J[2] }, w.text = J[1];
|
|
619
620
|
continue;
|
|
620
621
|
}
|
|
621
|
-
|
|
622
|
+
b.trim().length > 0 && w && (w.body = w.body ? w.body + " " + b.trim() : b.trim());
|
|
622
623
|
}
|
|
623
|
-
|
|
624
|
-
function
|
|
625
|
-
for (;
|
|
626
|
-
const
|
|
627
|
-
if (
|
|
628
|
-
|
|
629
|
-
}
|
|
630
|
-
const
|
|
631
|
-
|
|
624
|
+
g && j();
|
|
625
|
+
function Z(b) {
|
|
626
|
+
for (; r.length > 1; ) {
|
|
627
|
+
const J = r.length - 1, V = c[J];
|
|
628
|
+
if (V !== void 0 && V < b.level) break;
|
|
629
|
+
r.pop(), c.pop();
|
|
630
|
+
}
|
|
631
|
+
const z = r[r.length - 1], L = b.text, $ = { id: ue(), text: L, children: [] };
|
|
632
|
+
b.image && ($.image = { ...b.image }), b.link && ($.link = { url: b.link.url }), b.note && ($.note = { text: b.note.text }), b.body && Y(b, d, d.indexOf(b)) && $.children.push({ id: ue(), text: b.body, children: [] }), z.children.push($), r.push($), c.push(b.level);
|
|
632
633
|
}
|
|
633
|
-
function
|
|
634
|
-
for (let
|
|
635
|
-
if (
|
|
636
|
-
if (
|
|
634
|
+
function Y(b, z, L) {
|
|
635
|
+
for (let $ = L + 1; $ < z.length; $++) {
|
|
636
|
+
if (z[$].level <= b.level) return !0;
|
|
637
|
+
if (z[$].level > b.level) return !1;
|
|
637
638
|
}
|
|
638
639
|
return !0;
|
|
639
640
|
}
|
|
640
|
-
for (const
|
|
641
|
-
if (
|
|
642
|
-
const
|
|
643
|
-
|
|
641
|
+
for (const b of d) Z(b);
|
|
642
|
+
if (d.length > 0 && d[0].level === 1) {
|
|
643
|
+
const b = n.children[0];
|
|
644
|
+
b && (n.text = b.text, n.id = b.id, b.image && (n.image = { ...b.image }), b.link && (n.link = { url: b.link.url }), b.note && (n.note = { text: b.note.text }), n.children = b.children);
|
|
644
645
|
}
|
|
645
|
-
return
|
|
646
|
+
return n;
|
|
646
647
|
}
|
|
647
|
-
function
|
|
648
|
-
let o = "#".repeat(s) + " " + (
|
|
648
|
+
function ut(i, s = 1) {
|
|
649
|
+
let o = "#".repeat(s) + " " + (i.text || "") + `
|
|
649
650
|
`;
|
|
650
|
-
|
|
651
|
-
`),
|
|
652
|
-
`),
|
|
653
|
-
|
|
651
|
+
i.link && (o += `[${i.text || "link"}](${i.link.url})
|
|
652
|
+
`), i.image && (o += `
|
|
653
|
+
`), i.note && (o += "```note\n" + i.note.text + "\n```\n"), i.richContent && (o += i.richContent.raw + `
|
|
654
|
+
`);
|
|
655
|
+
for (const n of i.children) o += ut(n, s + 1);
|
|
654
656
|
return o;
|
|
655
657
|
}
|
|
656
|
-
function
|
|
657
|
-
|
|
658
|
+
function di(i) {
|
|
659
|
+
var v, u;
|
|
660
|
+
const s = i.split(/\r?\n/), o = [];
|
|
661
|
+
let n = 0;
|
|
662
|
+
const r = /^(#{1,6})\s+(.+?)\s*#*\s*$/, c = /^(`{3,}|~{3,})\s*(\S+)?\s*$/, d = /^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/, x = /^(\s*)[-*+]\s+(.*)$/, f = /^(\s*)\d+\.\s+(.*)$/;
|
|
663
|
+
for (; n < s.length; ) {
|
|
664
|
+
const g = s[n], M = g.match(c);
|
|
665
|
+
if (M) {
|
|
666
|
+
const z = M[1][0], L = M[2] || "", $ = [g];
|
|
667
|
+
for (n++; n < s.length; ) {
|
|
668
|
+
const V = s[n].match(c);
|
|
669
|
+
if (V && V[1][0] === z) {
|
|
670
|
+
$.push(s[n]), n++;
|
|
671
|
+
break;
|
|
672
|
+
}
|
|
673
|
+
$.push(s[n]), n++;
|
|
674
|
+
}
|
|
675
|
+
const J = $.slice(1, -1).join(`
|
|
676
|
+
`).trim();
|
|
677
|
+
o.push({
|
|
678
|
+
kind: "code",
|
|
679
|
+
text: ((v = J.split(`
|
|
680
|
+
`)[0]) == null ? void 0 : v.slice(0, 80)) || "(空代码块)",
|
|
681
|
+
raw: $.join(`
|
|
682
|
+
`),
|
|
683
|
+
lang: L
|
|
684
|
+
});
|
|
685
|
+
continue;
|
|
686
|
+
}
|
|
687
|
+
const w = g.match(r);
|
|
688
|
+
if (w) {
|
|
689
|
+
o.push({ kind: "heading", level: w[1].length, text: w[2].trim(), raw: g }), n++;
|
|
690
|
+
continue;
|
|
691
|
+
}
|
|
692
|
+
if (/^\s*\|/.test(g)) {
|
|
693
|
+
const z = [];
|
|
694
|
+
let L = n, $ = !1;
|
|
695
|
+
for (; L < s.length && /^\s*\|/.test(s[L]); )
|
|
696
|
+
z.push(s[L]), d.test(s[L]) && ($ = !0), L++;
|
|
697
|
+
if ($ && z.length >= 2) {
|
|
698
|
+
o.push({
|
|
699
|
+
kind: "table",
|
|
700
|
+
text: ((u = z[0].replace(/^\s*\|/, "").replace(/\|\s*$/, "").split("|")[0]) == null ? void 0 : u.trim()) || "表格",
|
|
701
|
+
raw: z.join(`
|
|
702
|
+
`)
|
|
703
|
+
}), n = L;
|
|
704
|
+
continue;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
const H = g.match(x), j = g.match(f);
|
|
708
|
+
if (H || j) {
|
|
709
|
+
let z = n;
|
|
710
|
+
for (; z < s.length; ) {
|
|
711
|
+
const L = s[z].match(x), $ = s[z].match(f);
|
|
712
|
+
if (!(L || $)) break;
|
|
713
|
+
const J = s[z].replace(/^\s*[-*+]\s+/, "").replace(/^\s*\d+\.\s+/, "").trim();
|
|
714
|
+
J.length > 0 && o.push({
|
|
715
|
+
kind: "list",
|
|
716
|
+
text: J.slice(0, 80) || "(列表项)",
|
|
717
|
+
raw: s[z]
|
|
718
|
+
}), z++;
|
|
719
|
+
}
|
|
720
|
+
n = z;
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
if (g.trim() === "") {
|
|
724
|
+
n++;
|
|
725
|
+
continue;
|
|
726
|
+
}
|
|
727
|
+
const Z = [g];
|
|
728
|
+
let Y = n + 1;
|
|
729
|
+
for (; Y < s.length; ) {
|
|
730
|
+
const z = s[Y];
|
|
731
|
+
if (z.trim() === "" || r.test(z) || c.test(z) || x.test(z) || f.test(z) || /^\s*\|/.test(z)) break;
|
|
732
|
+
Z.push(z), Y++;
|
|
733
|
+
}
|
|
734
|
+
const b = Z.join(" ").trim();
|
|
735
|
+
o.push({
|
|
736
|
+
kind: "paragraph",
|
|
737
|
+
text: b.slice(0, 80) || "(空段落)",
|
|
738
|
+
raw: Z.join(`
|
|
739
|
+
`)
|
|
740
|
+
}), n = Y;
|
|
741
|
+
}
|
|
742
|
+
return o;
|
|
743
|
+
}
|
|
744
|
+
function Xi(i, s = "导入的导图") {
|
|
745
|
+
const o = di(i || ""), n = { id: ue(), text: s, children: [] }, r = [n], c = [0];
|
|
746
|
+
let d = !1;
|
|
747
|
+
function x(f) {
|
|
748
|
+
if (f.kind === "heading") {
|
|
749
|
+
const u = f.level;
|
|
750
|
+
for (; r.length > 1 && c[c.length - 1] >= u; )
|
|
751
|
+
r.pop(), c.pop();
|
|
752
|
+
if (!d && u === 1) {
|
|
753
|
+
d = !0, n.text = f.text, c[0] = 1;
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
const g = { id: ue(), text: f.text, children: [] };
|
|
757
|
+
r[r.length - 1].children.push(g), r.push(g), c.push(u);
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
const v = {
|
|
761
|
+
id: ue(),
|
|
762
|
+
text: f.text,
|
|
763
|
+
children: [],
|
|
764
|
+
richContent: { kind: f.kind, raw: f.raw, lang: f.lang }
|
|
765
|
+
};
|
|
766
|
+
r[r.length - 1].children.push(v);
|
|
767
|
+
}
|
|
768
|
+
for (const f of o) x(f);
|
|
769
|
+
return n;
|
|
770
|
+
}
|
|
771
|
+
function qi(i) {
|
|
772
|
+
return i.richContent ? i.richContent.raw + `
|
|
773
|
+
` : "";
|
|
774
|
+
}
|
|
775
|
+
function fi(i) {
|
|
776
|
+
const s = i.minScale ?? 0.2, o = i.maxScale ?? 3, n = i.step ?? 1.2, r = O(1), c = O(0), d = O(0), x = O(!1), f = je({
|
|
658
777
|
x: 0,
|
|
659
778
|
y: 0,
|
|
660
779
|
ox: 0,
|
|
661
780
|
oy: 0
|
|
662
|
-
}),
|
|
663
|
-
let
|
|
664
|
-
function
|
|
665
|
-
|
|
781
|
+
}), v = O(!1), u = je({ x: 0, y: 0 }), g = je({ x: 0, y: 0, width: 0, height: 0 }), M = O(0);
|
|
782
|
+
let w = null;
|
|
783
|
+
function H(W) {
|
|
784
|
+
w = W;
|
|
666
785
|
}
|
|
667
|
-
function
|
|
668
|
-
|
|
669
|
-
const
|
|
670
|
-
if (!
|
|
671
|
-
const
|
|
672
|
-
|
|
786
|
+
function j(W) {
|
|
787
|
+
W.preventDefault();
|
|
788
|
+
const R = i.getContainer();
|
|
789
|
+
if (!R) return;
|
|
790
|
+
const Q = -W.deltaY * 1e-3, ne = Math.min(o, Math.max(s, r.value * (1 + Q))), le = R.getBoundingClientRect(), re = W.clientX - le.left, ke = W.clientY - le.top, Re = (re - c.value) / r.value, Me = (ke - d.value) / r.value;
|
|
791
|
+
r.value = ne, c.value = re - Re * ne, d.value = ke - Me * ne;
|
|
673
792
|
}
|
|
674
|
-
function
|
|
675
|
-
|
|
793
|
+
function Z() {
|
|
794
|
+
r.value = Math.min(o, r.value * n);
|
|
676
795
|
}
|
|
677
|
-
function
|
|
678
|
-
|
|
796
|
+
function Y() {
|
|
797
|
+
r.value = Math.max(s, r.value / n);
|
|
679
798
|
}
|
|
680
|
-
function
|
|
681
|
-
var
|
|
682
|
-
|
|
799
|
+
function b(W) {
|
|
800
|
+
var Q;
|
|
801
|
+
W.target.closest(".zm-node, .zm-toolbar, button, input, textarea") || (x.value = !0, f.x = W.clientX, f.y = W.clientY, f.ox = c.value, f.oy = d.value, window.addEventListener("mousemove", z), window.addEventListener("mouseup", L), (Q = W.preventDefault) == null || Q.call(W));
|
|
683
802
|
}
|
|
684
|
-
function
|
|
685
|
-
x.value && (
|
|
803
|
+
function z(W) {
|
|
804
|
+
x.value && (c.value = f.ox + (W.clientX - f.x), d.value = f.oy + (W.clientY - f.y));
|
|
686
805
|
}
|
|
687
|
-
function
|
|
688
|
-
x.value = !1, window.removeEventListener("mousemove",
|
|
806
|
+
function L() {
|
|
807
|
+
x.value = !1, window.removeEventListener("mousemove", z), window.removeEventListener("mouseup", L);
|
|
689
808
|
}
|
|
690
|
-
function
|
|
691
|
-
|
|
809
|
+
function $(W, R) {
|
|
810
|
+
v.value = !0, u.x = W, u.y = R, g.x = W, g.y = R, g.width = 0, g.height = 0, M.value++, window.addEventListener("mousemove", se), window.addEventListener("mouseup", V);
|
|
692
811
|
}
|
|
693
|
-
function
|
|
694
|
-
if (!
|
|
695
|
-
const
|
|
696
|
-
|
|
812
|
+
function J(W, R) {
|
|
813
|
+
if (!v.value) return;
|
|
814
|
+
const Q = Math.min(u.x, W), ne = Math.min(u.y, R), le = Math.max(u.x, W), re = Math.max(u.y, R);
|
|
815
|
+
g.x = Q, g.y = ne, g.width = le - Q, g.height = re - ne, M.value++;
|
|
697
816
|
}
|
|
698
|
-
function
|
|
699
|
-
|
|
817
|
+
function V() {
|
|
818
|
+
v.value = !1, window.removeEventListener("mousemove", se), window.removeEventListener("mouseup", V), w && w();
|
|
700
819
|
}
|
|
701
|
-
function
|
|
702
|
-
if (!
|
|
703
|
-
const
|
|
704
|
-
if (!
|
|
705
|
-
const
|
|
706
|
-
|
|
820
|
+
function se(W) {
|
|
821
|
+
if (!v.value) return;
|
|
822
|
+
const R = i.getContainer();
|
|
823
|
+
if (!R) return;
|
|
824
|
+
const Q = R.getBoundingClientRect(), ne = (W.clientX - Q.left - c.value) / r.value, le = (W.clientY - Q.top - d.value) / r.value;
|
|
825
|
+
J(ne, le);
|
|
707
826
|
}
|
|
708
|
-
function
|
|
709
|
-
const
|
|
710
|
-
if (!
|
|
711
|
-
const
|
|
712
|
-
|
|
827
|
+
function ge(W, R, Q, ne = 60) {
|
|
828
|
+
const le = i.getContainer();
|
|
829
|
+
if (!le) return;
|
|
830
|
+
const re = le.getBoundingClientRect(), ke = (re.width - ne * 2) / W, Re = (re.height - ne * 2) / R, Me = Math.min(1, Math.max(0.3, Math.min(ke, Re)));
|
|
831
|
+
r.value = Me, c.value = re.width / 2, d.value = re.height / 2 - Q * Me;
|
|
713
832
|
}
|
|
714
833
|
return {
|
|
715
|
-
scale:
|
|
716
|
-
offsetX:
|
|
717
|
-
offsetY:
|
|
834
|
+
scale: r,
|
|
835
|
+
offsetX: c,
|
|
836
|
+
offsetY: d,
|
|
718
837
|
isPanning: x,
|
|
719
|
-
onWheel:
|
|
720
|
-
zoomIn:
|
|
721
|
-
zoomOut:
|
|
722
|
-
startPan:
|
|
723
|
-
startMarquee:
|
|
724
|
-
updateMarquee:
|
|
725
|
-
isMarquee:
|
|
726
|
-
marquee:
|
|
727
|
-
marqueeVersion:
|
|
728
|
-
setOnMarqueeEnd:
|
|
729
|
-
resetView:
|
|
838
|
+
onWheel: j,
|
|
839
|
+
zoomIn: Z,
|
|
840
|
+
zoomOut: Y,
|
|
841
|
+
startPan: b,
|
|
842
|
+
startMarquee: $,
|
|
843
|
+
updateMarquee: J,
|
|
844
|
+
isMarquee: v,
|
|
845
|
+
marquee: g,
|
|
846
|
+
marqueeVersion: M,
|
|
847
|
+
setOnMarqueeEnd: H,
|
|
848
|
+
resetView: ge
|
|
730
849
|
};
|
|
731
850
|
}
|
|
732
|
-
const
|
|
733
|
-
function qt(
|
|
734
|
-
return
|
|
851
|
+
const hi = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform);
|
|
852
|
+
function qt(i) {
|
|
853
|
+
return hi ? i.metaKey : i.ctrlKey;
|
|
735
854
|
}
|
|
736
|
-
function vi(
|
|
855
|
+
function vi(i) {
|
|
737
856
|
function s() {
|
|
738
|
-
const
|
|
739
|
-
return
|
|
857
|
+
const n = i.getSelectedId();
|
|
858
|
+
return n || (i.defaultTargetId ? i.defaultTargetId() : i.getRootId());
|
|
740
859
|
}
|
|
741
|
-
function o(
|
|
742
|
-
const
|
|
743
|
-
if (
|
|
744
|
-
const
|
|
745
|
-
if (
|
|
746
|
-
if (qt(
|
|
747
|
-
if (
|
|
748
|
-
|
|
860
|
+
function o(n) {
|
|
861
|
+
const r = n.target;
|
|
862
|
+
if (r && (r.tagName === "INPUT" || r.tagName === "TEXTAREA" || r.isContentEditable) || i.isReadonly() || i.isEditing()) return;
|
|
863
|
+
const c = i.getSelectedId(), d = s();
|
|
864
|
+
if (d) {
|
|
865
|
+
if (qt(n) && !n.shiftKey) {
|
|
866
|
+
if (n.key === "d" || n.key === "D") {
|
|
867
|
+
c && c !== i.getRootId() && (n.preventDefault(), i.onDuplicate(c));
|
|
749
868
|
return;
|
|
750
869
|
}
|
|
751
|
-
if (
|
|
752
|
-
|
|
870
|
+
if (n.key === "z" || n.key === "Z") {
|
|
871
|
+
n.preventDefault(), i.onUndo();
|
|
753
872
|
return;
|
|
754
873
|
}
|
|
755
|
-
if (
|
|
756
|
-
|
|
874
|
+
if (n.key === "y" || n.key === "Y") {
|
|
875
|
+
n.preventDefault(), i.onRedo();
|
|
757
876
|
return;
|
|
758
877
|
}
|
|
759
|
-
if (
|
|
760
|
-
|
|
878
|
+
if (n.key === "Home") {
|
|
879
|
+
n.preventDefault(), i.onSelectRoot();
|
|
761
880
|
return;
|
|
762
881
|
}
|
|
763
882
|
}
|
|
764
|
-
if (qt(
|
|
765
|
-
|
|
883
|
+
if (qt(n) && n.shiftKey && (n.key === "Z" || n.key === "z")) {
|
|
884
|
+
n.preventDefault(), i.onRedo();
|
|
766
885
|
return;
|
|
767
886
|
}
|
|
768
|
-
|
|
887
|
+
n.key === "Tab" ? (n.preventDefault(), i.onAddChild(d)) : n.key === "Enter" ? (n.preventDefault(), n.shiftKey ? c && c !== i.getRootId() && i.onAddSiblingBefore(c) : i.onAddSibling(d)) : (n.key === "Delete" || n.key === "Backspace") && c && c !== i.getRootId() ? (n.preventDefault(), i.onRemove(c)) : n.key === "F2" && c ? (n.preventDefault(), i.onStartEdit(c)) : n.key === "Escape" ? (n.preventDefault(), i.onClearSelection()) : n.key === "ArrowDown" ? (n.preventDefault(), i.onNavigate(0, 1)) : n.key === "ArrowUp" ? (n.preventDefault(), i.onNavigate(0, -1)) : n.key === "ArrowRight" ? (n.preventDefault(), i.onNavigate(1, 0)) : n.key === "ArrowLeft" && (n.preventDefault(), i.onNavigate(-1, 0));
|
|
769
888
|
}
|
|
770
889
|
}
|
|
771
|
-
|
|
890
|
+
st(() => {
|
|
772
891
|
window.addEventListener("keydown", o);
|
|
773
|
-
}),
|
|
892
|
+
}), dt(() => {
|
|
774
893
|
window.removeEventListener("keydown", o);
|
|
775
894
|
});
|
|
776
895
|
}
|
|
777
|
-
function
|
|
778
|
-
const s =
|
|
896
|
+
function mi(i = 100) {
|
|
897
|
+
const s = O([]);
|
|
779
898
|
let o = -1;
|
|
780
|
-
function
|
|
899
|
+
function n() {
|
|
781
900
|
return o > 0;
|
|
782
901
|
}
|
|
783
|
-
function
|
|
902
|
+
function r() {
|
|
784
903
|
return o < s.value.length - 1;
|
|
785
904
|
}
|
|
786
|
-
function
|
|
787
|
-
const u = JSON.stringify(
|
|
788
|
-
for (o < s.value.length - 1 && (s.value = s.value.slice(0, o + 1)), s.value.push(u), o = s.value.length - 1; s.value.length >
|
|
905
|
+
function c(v) {
|
|
906
|
+
const u = JSON.stringify(v);
|
|
907
|
+
for (o < s.value.length - 1 && (s.value = s.value.slice(0, o + 1)), s.value.push(u), o = s.value.length - 1; s.value.length > i; )
|
|
789
908
|
s.value.shift(), o--;
|
|
790
909
|
}
|
|
791
|
-
function
|
|
792
|
-
return
|
|
910
|
+
function d() {
|
|
911
|
+
return n() ? (o--, JSON.parse(s.value[o])) : null;
|
|
793
912
|
}
|
|
794
913
|
function x() {
|
|
795
|
-
return
|
|
914
|
+
return r() ? (o++, JSON.parse(s.value[o])) : null;
|
|
796
915
|
}
|
|
797
|
-
function
|
|
916
|
+
function f() {
|
|
798
917
|
s.value = [], o = -1;
|
|
799
918
|
}
|
|
800
919
|
return {
|
|
801
|
-
canUndo:
|
|
802
|
-
canRedo:
|
|
803
|
-
record:
|
|
804
|
-
undo:
|
|
920
|
+
canUndo: n,
|
|
921
|
+
canRedo: r,
|
|
922
|
+
record: c,
|
|
923
|
+
undo: d,
|
|
805
924
|
redo: x,
|
|
806
|
-
reset:
|
|
925
|
+
reset: f
|
|
807
926
|
};
|
|
808
927
|
}
|
|
809
|
-
const
|
|
928
|
+
const gi = ["disabled"], yi = ["disabled"], xi = ["disabled"], pi = ["disabled"], wi = ["disabled"], bi = ["disabled"], ki = /* @__PURE__ */ ct({
|
|
810
929
|
__name: "NodeContextMenu",
|
|
811
930
|
props: {
|
|
812
931
|
x: {},
|
|
@@ -818,115 +937,115 @@ const mi = ["disabled"], gi = ["disabled"], yi = ["disabled"], xi = ["disabled"]
|
|
|
818
937
|
readonly: { type: Boolean, default: !1 }
|
|
819
938
|
},
|
|
820
939
|
emits: ["pickImage", "setLink", "removeLink", "editNote", "removeNote", "removeImage", "close"],
|
|
821
|
-
setup(
|
|
822
|
-
const o =
|
|
823
|
-
let
|
|
940
|
+
setup(i, { emit: s }) {
|
|
941
|
+
const o = i, n = s, r = te(() => {
|
|
942
|
+
let M = o.x + 2, w = o.y + 2;
|
|
824
943
|
if (o.container) {
|
|
825
|
-
const
|
|
826
|
-
|
|
944
|
+
const H = o.container.getBoundingClientRect(), j = 180, Z = c.value ? d.value ? 184 : 160 : 136;
|
|
945
|
+
M + j > H.right && (M = Math.max(H.left + 4, o.x - j - 2)), w + Z > H.bottom && (w = Math.max(H.top + 4, o.y - Z - 2)), M < H.left + 2 && (M = H.left + 2), w < H.top + 2 && (w = H.top + 2);
|
|
827
946
|
}
|
|
828
|
-
return { left:
|
|
829
|
-
}),
|
|
830
|
-
function
|
|
831
|
-
const
|
|
832
|
-
|
|
947
|
+
return { left: M, top: w };
|
|
948
|
+
}), c = te(() => o.hasImage), d = te(() => o.hasLink), x = te(() => o.hasNote);
|
|
949
|
+
function f(M) {
|
|
950
|
+
const w = M.target;
|
|
951
|
+
w && w.closest(".zm-node-menu") || n("close");
|
|
833
952
|
}
|
|
834
|
-
function
|
|
835
|
-
|
|
953
|
+
function v(M) {
|
|
954
|
+
M.key === "Escape" && n("close");
|
|
836
955
|
}
|
|
837
956
|
function u() {
|
|
838
|
-
|
|
957
|
+
n("close");
|
|
839
958
|
}
|
|
840
|
-
window.addEventListener("mousedown",
|
|
841
|
-
window.removeEventListener("mousedown",
|
|
959
|
+
window.addEventListener("mousedown", f, !0), window.addEventListener("keydown", v, !0), window.addEventListener("wheel", u, !0), window.addEventListener("scroll", u, !0), dt(() => {
|
|
960
|
+
window.removeEventListener("mousedown", f, !0), window.removeEventListener("keydown", v, !0), window.removeEventListener("wheel", u, !0), window.removeEventListener("scroll", u, !0);
|
|
842
961
|
});
|
|
843
|
-
function
|
|
844
|
-
o.readonly || (
|
|
962
|
+
function g(M) {
|
|
963
|
+
o.readonly || (M(), n("close"));
|
|
845
964
|
}
|
|
846
|
-
return (
|
|
965
|
+
return (M, w) => (C(), E("div", {
|
|
847
966
|
class: "zm-node-menu",
|
|
848
|
-
style: ve({ left:
|
|
849
|
-
onContextmenu:
|
|
967
|
+
style: ve({ left: r.value.left + "px", top: r.value.top + "px" }),
|
|
968
|
+
onContextmenu: w[6] || (w[6] = D(() => {
|
|
850
969
|
}, ["prevent"]))
|
|
851
970
|
}, [
|
|
852
|
-
|
|
971
|
+
p("button", {
|
|
853
972
|
class: "zm-node-menu-item",
|
|
854
|
-
disabled:
|
|
855
|
-
onClick:
|
|
973
|
+
disabled: i.readonly,
|
|
974
|
+
onClick: w[0] || (w[0] = D((H) => g(() => n("pickImage")), ["stop"]))
|
|
856
975
|
}, [
|
|
857
|
-
|
|
976
|
+
q(U, {
|
|
858
977
|
name: "image",
|
|
859
978
|
size: 13
|
|
860
979
|
}),
|
|
861
|
-
|
|
862
|
-
], 8,
|
|
863
|
-
|
|
980
|
+
p("span", null, be(c.value ? "替换图片" : "添加图片"), 1)
|
|
981
|
+
], 8, gi),
|
|
982
|
+
c.value ? (C(), E("button", {
|
|
864
983
|
key: 0,
|
|
865
984
|
class: "zm-node-menu-item",
|
|
866
|
-
disabled:
|
|
867
|
-
onClick:
|
|
985
|
+
disabled: i.readonly,
|
|
986
|
+
onClick: w[1] || (w[1] = D((H) => g(() => n("removeImage")), ["stop"]))
|
|
868
987
|
}, [
|
|
869
|
-
|
|
988
|
+
q(U, {
|
|
870
989
|
name: "x",
|
|
871
990
|
size: 13
|
|
872
991
|
}),
|
|
873
|
-
|
|
874
|
-
], 8,
|
|
875
|
-
|
|
992
|
+
w[7] || (w[7] = p("span", null, "移除图片", -1))
|
|
993
|
+
], 8, yi)) : X("", !0),
|
|
994
|
+
p("button", {
|
|
876
995
|
class: "zm-node-menu-item",
|
|
877
|
-
disabled:
|
|
878
|
-
onClick:
|
|
996
|
+
disabled: i.readonly,
|
|
997
|
+
onClick: w[2] || (w[2] = D((H) => g(() => n("setLink")), ["stop"]))
|
|
879
998
|
}, [
|
|
880
|
-
|
|
999
|
+
q(U, {
|
|
881
1000
|
name: "link",
|
|
882
1001
|
size: 13
|
|
883
1002
|
}),
|
|
884
|
-
|
|
885
|
-
], 8,
|
|
886
|
-
|
|
1003
|
+
p("span", null, be(d.value ? "编辑链接" : "添加链接"), 1)
|
|
1004
|
+
], 8, xi),
|
|
1005
|
+
d.value ? (C(), E("button", {
|
|
887
1006
|
key: 1,
|
|
888
1007
|
class: "zm-node-menu-item",
|
|
889
|
-
disabled:
|
|
890
|
-
onClick:
|
|
1008
|
+
disabled: i.readonly,
|
|
1009
|
+
onClick: w[3] || (w[3] = D((H) => g(() => n("removeLink")), ["stop"]))
|
|
891
1010
|
}, [
|
|
892
|
-
|
|
1011
|
+
q(U, {
|
|
893
1012
|
name: "x",
|
|
894
1013
|
size: 13
|
|
895
1014
|
}),
|
|
896
|
-
|
|
897
|
-
], 8,
|
|
898
|
-
|
|
1015
|
+
w[8] || (w[8] = p("span", null, "移除链接", -1))
|
|
1016
|
+
], 8, pi)) : X("", !0),
|
|
1017
|
+
p("button", {
|
|
899
1018
|
class: "zm-node-menu-item",
|
|
900
|
-
disabled:
|
|
901
|
-
onClick:
|
|
1019
|
+
disabled: i.readonly,
|
|
1020
|
+
onClick: w[4] || (w[4] = D((H) => g(() => n("editNote")), ["stop"]))
|
|
902
1021
|
}, [
|
|
903
|
-
|
|
1022
|
+
q(U, {
|
|
904
1023
|
name: "note",
|
|
905
1024
|
size: 13
|
|
906
1025
|
}),
|
|
907
|
-
|
|
908
|
-
], 8,
|
|
909
|
-
x.value ? (
|
|
1026
|
+
p("span", null, be(x.value ? "编辑笔记" : "添加笔记"), 1)
|
|
1027
|
+
], 8, wi),
|
|
1028
|
+
x.value ? (C(), E("button", {
|
|
910
1029
|
key: 2,
|
|
911
1030
|
class: "zm-node-menu-item",
|
|
912
|
-
disabled:
|
|
913
|
-
onClick:
|
|
1031
|
+
disabled: i.readonly,
|
|
1032
|
+
onClick: w[5] || (w[5] = D((H) => g(() => n("removeNote")), ["stop"]))
|
|
914
1033
|
}, [
|
|
915
|
-
|
|
1034
|
+
q(U, {
|
|
916
1035
|
name: "x",
|
|
917
1036
|
size: 13
|
|
918
1037
|
}),
|
|
919
|
-
|
|
920
|
-
], 8, bi)) :
|
|
1038
|
+
w[9] || (w[9] = p("span", null, "移除笔记", -1))
|
|
1039
|
+
], 8, bi)) : X("", !0)
|
|
921
1040
|
], 36));
|
|
922
1041
|
}
|
|
923
|
-
}),
|
|
1042
|
+
}), Mi = ["viewBox", "width", "height"], Ci = { class: "zm-edges" }, Ei = ["d", "fill"], Si = ["data-node-id", "onClick", "onDblclick", "onContextmenu", "onMouseenter", "onMouseleave"], zi = ["src", "width", "height", "alt"], Ni = {
|
|
924
1043
|
key: 1,
|
|
925
1044
|
class: "zm-text"
|
|
926
|
-
},
|
|
1045
|
+
}, Ii = { class: "zm-text-label" }, Wi = ["href", "title"], $i = ["title", "onClick"], Ri = ["title"], Bi = ["title", "onClick"], Li = ["onClick"], Ai = ["onMousedown"], Hi = ["onClick"], Di = {
|
|
927
1046
|
key: 0,
|
|
928
1047
|
class: "zm-toolbar"
|
|
929
|
-
},
|
|
1048
|
+
}, Pi = ["src"], Ti = ["src"], Oi = { class: "zm-tb-tip" }, We = 24, De = 400, we = 160, Fi = /* @__PURE__ */ ct({
|
|
930
1049
|
__name: "MindMap",
|
|
931
1050
|
props: {
|
|
932
1051
|
data: {},
|
|
@@ -937,213 +1056,213 @@ const mi = ["disabled"], gi = ["disabled"], yi = ["disabled"], xi = ["disabled"]
|
|
|
937
1056
|
lineColors: {}
|
|
938
1057
|
},
|
|
939
1058
|
emits: ["change", "select", "edit-note", "markdownChange"],
|
|
940
|
-
setup(
|
|
941
|
-
const
|
|
942
|
-
let
|
|
943
|
-
|
|
944
|
-
() =>
|
|
1059
|
+
setup(i, { expose: s, emit: o }) {
|
|
1060
|
+
const n = i, r = o, c = O(null), d = O(null), x = O(""), f = O(null), v = O(/* @__PURE__ */ new Set()), u = O(me(n.data)), g = O(n.markdown !== void 0);
|
|
1061
|
+
let M = !1;
|
|
1062
|
+
Ue(
|
|
1063
|
+
() => n.markdown,
|
|
945
1064
|
(e) => {
|
|
946
1065
|
if (e === void 0) {
|
|
947
|
-
|
|
1066
|
+
g.value = !1;
|
|
948
1067
|
return;
|
|
949
1068
|
}
|
|
950
|
-
|
|
1069
|
+
g.value = !0;
|
|
951
1070
|
const t = Xt(e || "");
|
|
952
|
-
|
|
953
|
-
|
|
1071
|
+
M = !0, u.value = me(t), f.value = null, v.value = /* @__PURE__ */ new Set(), T(), ee(() => {
|
|
1072
|
+
M = !1, de();
|
|
954
1073
|
});
|
|
955
1074
|
}
|
|
956
|
-
),
|
|
1075
|
+
), Ue(
|
|
957
1076
|
u,
|
|
958
1077
|
() => {
|
|
959
|
-
|
|
1078
|
+
g.value && !M && r("markdownChange", ut(u.value));
|
|
960
1079
|
},
|
|
961
1080
|
{ deep: !0 }
|
|
962
1081
|
);
|
|
963
|
-
const
|
|
964
|
-
function
|
|
965
|
-
const
|
|
966
|
-
t.bg && (
|
|
1082
|
+
const w = te(() => k.showOrderBadge === !0), H = O(/* @__PURE__ */ new Map()), j = H.value;
|
|
1083
|
+
function Z(e, t) {
|
|
1084
|
+
const a = {};
|
|
1085
|
+
t.bg && (a.bg = t.bg), t.textColor && (a.textColor = t.textColor), t.borderColor && (a.borderColor = t.borderColor), t.fontWeight && (a.fontWeight = t.fontWeight), Object.keys(a).length === 0 ? j.delete(e) : j.set(e, a), H.value = new Map(j);
|
|
967
1086
|
}
|
|
968
|
-
function
|
|
969
|
-
return
|
|
1087
|
+
function Y(e) {
|
|
1088
|
+
return j.get(e) ?? {};
|
|
970
1089
|
}
|
|
971
|
-
function
|
|
972
|
-
const
|
|
973
|
-
|
|
1090
|
+
function b(e, t) {
|
|
1091
|
+
const a = A(u.value, e);
|
|
1092
|
+
a && (a.image = {
|
|
974
1093
|
src: t.src,
|
|
975
1094
|
naturalW: t.naturalW,
|
|
976
1095
|
naturalH: t.naturalH,
|
|
977
|
-
width:
|
|
978
|
-
height:
|
|
979
|
-
},
|
|
980
|
-
}
|
|
981
|
-
function
|
|
982
|
-
const t =
|
|
983
|
-
!t || !t.image || (delete t.image,
|
|
984
|
-
}
|
|
985
|
-
function
|
|
986
|
-
return Math.min(
|
|
987
|
-
}
|
|
988
|
-
function
|
|
989
|
-
const
|
|
990
|
-
|
|
991
|
-
if (typeof
|
|
992
|
-
const
|
|
993
|
-
|
|
994
|
-
const l =
|
|
995
|
-
t({ src:
|
|
996
|
-
},
|
|
997
|
-
t({ src:
|
|
998
|
-
},
|
|
999
|
-
},
|
|
1000
|
-
}
|
|
1001
|
-
function
|
|
1096
|
+
width: L(t.width, We, De),
|
|
1097
|
+
height: L(t.height, We, De)
|
|
1098
|
+
}, G(), T(), r("change", u.value));
|
|
1099
|
+
}
|
|
1100
|
+
function z(e) {
|
|
1101
|
+
const t = A(u.value, e);
|
|
1102
|
+
!t || !t.image || (delete t.image, G(), T(), r("change", u.value));
|
|
1103
|
+
}
|
|
1104
|
+
function L(e, t, a) {
|
|
1105
|
+
return Math.min(a, Math.max(t, e));
|
|
1106
|
+
}
|
|
1107
|
+
function $(e, t) {
|
|
1108
|
+
const a = new FileReader();
|
|
1109
|
+
a.onload = () => {
|
|
1110
|
+
if (typeof a.result != "string") return;
|
|
1111
|
+
const m = a.result, h = new window.Image();
|
|
1112
|
+
h.onload = () => {
|
|
1113
|
+
const l = h.naturalWidth || we, y = h.naturalHeight || we, B = L(l, We, we), K = L(Math.round(y * B / l), We, De);
|
|
1114
|
+
t({ src: m, naturalW: l, naturalH: y, width: B, height: K });
|
|
1115
|
+
}, h.onerror = () => {
|
|
1116
|
+
t({ src: m, naturalW: we, naturalH: we, width: we, height: we });
|
|
1117
|
+
}, h.src = m;
|
|
1118
|
+
}, a.readAsDataURL(e);
|
|
1119
|
+
}
|
|
1120
|
+
function J(e) {
|
|
1002
1121
|
const t = document.createElement("input");
|
|
1003
1122
|
t.type = "file", t.accept = "image/*", t.style.display = "none", t.onchange = () => {
|
|
1004
|
-
var
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1123
|
+
var m;
|
|
1124
|
+
const a = (m = t.files) == null ? void 0 : m[0];
|
|
1125
|
+
a && ($(a, (h) => b(e, h)), document.body.removeChild(t));
|
|
1007
1126
|
}, document.body.appendChild(t), t.click();
|
|
1008
1127
|
}
|
|
1009
|
-
function
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1128
|
+
function V(e, t) {
|
|
1129
|
+
const a = t.trim(), m = A(u.value, e);
|
|
1130
|
+
m && (a ? m.link = { url: a } : delete m.link, G(), T(), r("change", u.value));
|
|
1012
1131
|
}
|
|
1013
|
-
function
|
|
1014
|
-
|
|
1132
|
+
function se(e) {
|
|
1133
|
+
V(e, "");
|
|
1015
1134
|
}
|
|
1016
|
-
function
|
|
1017
|
-
const
|
|
1018
|
-
|
|
1135
|
+
function ge(e, t) {
|
|
1136
|
+
const a = A(u.value, e);
|
|
1137
|
+
a && (t ? a.note = { text: t } : delete a.note, G(), T(), r("change", u.value));
|
|
1019
1138
|
}
|
|
1020
|
-
function
|
|
1021
|
-
|
|
1139
|
+
function W(e) {
|
|
1140
|
+
ge(e, "");
|
|
1022
1141
|
}
|
|
1023
|
-
const
|
|
1024
|
-
function
|
|
1025
|
-
|
|
1026
|
-
}
|
|
1027
|
-
function _() {
|
|
1028
|
-
W.value = null;
|
|
1142
|
+
const R = O(null);
|
|
1143
|
+
function Q(e, t) {
|
|
1144
|
+
n.readonly || (e.preventDefault(), e.stopPropagation(), f.value = t.id, r("select", A(u.value, t.id)), R.value = { nodeId: t.id, x: e.clientX, y: e.clientY });
|
|
1029
1145
|
}
|
|
1030
1146
|
function ne() {
|
|
1147
|
+
R.value = null;
|
|
1148
|
+
}
|
|
1149
|
+
function le() {
|
|
1031
1150
|
var t;
|
|
1032
|
-
const e = (t =
|
|
1033
|
-
e &&
|
|
1151
|
+
const e = (t = R.value) == null ? void 0 : t.nodeId;
|
|
1152
|
+
e && J(e);
|
|
1034
1153
|
}
|
|
1035
|
-
function
|
|
1036
|
-
var
|
|
1037
|
-
const e = (
|
|
1154
|
+
function re() {
|
|
1155
|
+
var m, h, l;
|
|
1156
|
+
const e = (m = R.value) == null ? void 0 : m.nodeId;
|
|
1038
1157
|
if (!e) return;
|
|
1039
|
-
const t = ((l = (
|
|
1040
|
-
|
|
1158
|
+
const t = ((l = (h = A(u.value, e)) == null ? void 0 : h.link) == null ? void 0 : l.url) ?? "", a = window.prompt("输入链接 URL(留空取消)", t);
|
|
1159
|
+
a !== null && V(e, a);
|
|
1041
1160
|
}
|
|
1042
1161
|
function ke() {
|
|
1043
1162
|
var t;
|
|
1044
|
-
const e = (t =
|
|
1045
|
-
e &&
|
|
1163
|
+
const e = (t = R.value) == null ? void 0 : t.nodeId;
|
|
1164
|
+
e && se(e);
|
|
1046
1165
|
}
|
|
1047
|
-
function
|
|
1166
|
+
function Re() {
|
|
1048
1167
|
var t;
|
|
1049
|
-
const e = (t =
|
|
1050
|
-
e &&
|
|
1168
|
+
const e = (t = R.value) == null ? void 0 : t.nodeId;
|
|
1169
|
+
e && ht(e);
|
|
1051
1170
|
}
|
|
1052
1171
|
function Me() {
|
|
1053
1172
|
var t;
|
|
1054
|
-
const e = (t =
|
|
1055
|
-
e &&
|
|
1173
|
+
const e = (t = R.value) == null ? void 0 : t.nodeId;
|
|
1174
|
+
e && W(e);
|
|
1056
1175
|
}
|
|
1057
1176
|
function Zt() {
|
|
1058
1177
|
var t;
|
|
1059
|
-
const e = (t =
|
|
1060
|
-
e &&
|
|
1178
|
+
const e = (t = R.value) == null ? void 0 : t.nodeId;
|
|
1179
|
+
e && z(e);
|
|
1061
1180
|
}
|
|
1062
|
-
function
|
|
1063
|
-
|
|
1181
|
+
function ht(e) {
|
|
1182
|
+
n.readonly || r("edit-note", e);
|
|
1064
1183
|
}
|
|
1065
1184
|
function Qt(e, t = 60) {
|
|
1066
|
-
const
|
|
1067
|
-
return
|
|
1185
|
+
const a = e.replace(/\s+/g, " ").trim();
|
|
1186
|
+
return a.length <= t ? a || "点击编辑笔记" : a.slice(0, t) + "…";
|
|
1068
1187
|
}
|
|
1069
|
-
function
|
|
1070
|
-
var
|
|
1071
|
-
if (
|
|
1188
|
+
function vt(e) {
|
|
1189
|
+
var h;
|
|
1190
|
+
if (n.readonly || d.value) return;
|
|
1072
1191
|
const t = e.target;
|
|
1073
1192
|
if (t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable))
|
|
1074
1193
|
return;
|
|
1075
|
-
const
|
|
1076
|
-
if (!
|
|
1077
|
-
const
|
|
1078
|
-
if (
|
|
1079
|
-
for (let l = 0; l <
|
|
1080
|
-
const
|
|
1081
|
-
if (
|
|
1082
|
-
const
|
|
1083
|
-
if (
|
|
1194
|
+
const a = f.value;
|
|
1195
|
+
if (!a) return;
|
|
1196
|
+
const m = (h = e.clipboardData) == null ? void 0 : h.items;
|
|
1197
|
+
if (m)
|
|
1198
|
+
for (let l = 0; l < m.length; l++) {
|
|
1199
|
+
const y = m[l];
|
|
1200
|
+
if (y.kind === "file" && y.type.startsWith("image/")) {
|
|
1201
|
+
const B = y.getAsFile();
|
|
1202
|
+
if (!B) continue;
|
|
1084
1203
|
e.preventDefault();
|
|
1085
|
-
const
|
|
1086
|
-
if (
|
|
1204
|
+
const K = A(u.value, a);
|
|
1205
|
+
if (K != null && K.image && !window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))
|
|
1087
1206
|
return;
|
|
1088
|
-
|
|
1207
|
+
$(B, (_) => b(a, _));
|
|
1089
1208
|
return;
|
|
1090
1209
|
}
|
|
1091
1210
|
}
|
|
1092
1211
|
}
|
|
1093
|
-
|
|
1094
|
-
window.addEventListener("paste",
|
|
1095
|
-
}),
|
|
1096
|
-
window.removeEventListener("paste",
|
|
1212
|
+
st(() => {
|
|
1213
|
+
window.addEventListener("paste", vt);
|
|
1214
|
+
}), dt(() => {
|
|
1215
|
+
window.removeEventListener("paste", vt);
|
|
1097
1216
|
});
|
|
1098
|
-
const
|
|
1217
|
+
const Be = O(null), _t = te(() => {
|
|
1099
1218
|
var e;
|
|
1100
|
-
return ((e =
|
|
1219
|
+
return ((e = Be.value) == null ? void 0 : e.nodeId) ?? null;
|
|
1101
1220
|
});
|
|
1102
1221
|
function en(e, t) {
|
|
1103
1222
|
if (!t.image) return;
|
|
1104
1223
|
e.preventDefault(), e.stopPropagation();
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1224
|
+
const a = t.image.naturalW || t.image.width, m = t.image.naturalH || t.image.height, h = m > 0 ? m / a : 1;
|
|
1225
|
+
Be.value = {
|
|
1107
1226
|
nodeId: t.id,
|
|
1108
1227
|
startX: e.clientX,
|
|
1109
1228
|
startY: e.clientY,
|
|
1110
1229
|
startW: t.image.width,
|
|
1111
1230
|
startH: t.image.height,
|
|
1112
|
-
naturalW:
|
|
1113
|
-
naturalH:
|
|
1114
|
-
ratio:
|
|
1231
|
+
naturalW: a,
|
|
1232
|
+
naturalH: m,
|
|
1233
|
+
ratio: h,
|
|
1115
1234
|
pendingW: t.image.width,
|
|
1116
1235
|
pendingH: t.image.height
|
|
1117
1236
|
}, window.addEventListener("mousemove", mt), window.addEventListener("mouseup", gt);
|
|
1118
1237
|
}
|
|
1119
1238
|
function mt(e) {
|
|
1120
|
-
var
|
|
1121
|
-
const t =
|
|
1239
|
+
var K, _;
|
|
1240
|
+
const t = Be.value;
|
|
1122
1241
|
if (!t) return;
|
|
1123
|
-
const
|
|
1124
|
-
t.pendingW =
|
|
1125
|
-
const
|
|
1242
|
+
const a = S.scale.value || 1, m = e.clientX - t.startX, h = L(t.startW + m / a, We, De), l = L(h * t.ratio, We, De);
|
|
1243
|
+
t.pendingW = h, t.pendingH = l;
|
|
1244
|
+
const y = (K = c.value) == null ? void 0 : K.querySelector(
|
|
1126
1245
|
`[data-node-id="${t.nodeId}"] .zm-node-img`
|
|
1127
1246
|
);
|
|
1128
|
-
|
|
1129
|
-
const
|
|
1247
|
+
y && (y.style.width = `${h}px`, y.style.height = `${l}px`);
|
|
1248
|
+
const B = (_ = c.value) == null ? void 0 : _.querySelector(
|
|
1130
1249
|
`[data-node-id="${t.nodeId}"]`
|
|
1131
1250
|
);
|
|
1132
|
-
|
|
1251
|
+
B && (B.style.minWidth = `${Math.max(80, Math.ceil(h + 28))}px`, B.style.height = `${Math.ceil(l + 8 + 30)}px`);
|
|
1133
1252
|
}
|
|
1134
1253
|
function gt() {
|
|
1135
|
-
const e =
|
|
1136
|
-
if (window.removeEventListener("mousemove", mt), window.removeEventListener("mouseup", gt),
|
|
1137
|
-
const t =
|
|
1138
|
-
!t || !t.image || (
|
|
1254
|
+
const e = Be.value;
|
|
1255
|
+
if (window.removeEventListener("mousemove", mt), window.removeEventListener("mouseup", gt), Be.value = null, !e) return;
|
|
1256
|
+
const t = A(u.value, e.nodeId);
|
|
1257
|
+
!t || !t.image || (b(e.nodeId, {
|
|
1139
1258
|
src: t.image.src,
|
|
1140
1259
|
naturalW: t.image.naturalW,
|
|
1141
1260
|
naturalH: t.image.naturalH,
|
|
1142
1261
|
width: e.pendingW,
|
|
1143
1262
|
height: e.pendingH
|
|
1144
|
-
}),
|
|
1263
|
+
}), f.value = e.nodeId, r("select", t), _e = !0);
|
|
1145
1264
|
}
|
|
1146
|
-
const Qe =
|
|
1265
|
+
const Qe = O(null);
|
|
1147
1266
|
let _e = !1;
|
|
1148
1267
|
function tn(e) {
|
|
1149
1268
|
Qe.value = e;
|
|
@@ -1151,28 +1270,28 @@ const mi = ["disabled"], gi = ["disabled"], yi = ["disabled"], xi = ["disabled"]
|
|
|
1151
1270
|
function nn(e) {
|
|
1152
1271
|
Qe.value === e && (Qe.value = null);
|
|
1153
1272
|
}
|
|
1154
|
-
const yt =
|
|
1155
|
-
function
|
|
1156
|
-
|
|
1273
|
+
const yt = O(0), et = O(!1), he = mi(100);
|
|
1274
|
+
function G() {
|
|
1275
|
+
he.record({ data: u.value });
|
|
1157
1276
|
}
|
|
1158
|
-
function
|
|
1159
|
-
|
|
1277
|
+
function T() {
|
|
1278
|
+
v.value = new Set(v.value), yt.value++;
|
|
1160
1279
|
}
|
|
1161
|
-
const
|
|
1162
|
-
var e, t,
|
|
1280
|
+
const ae = te(() => {
|
|
1281
|
+
var e, t, a, m, h, l, y, B, K, _;
|
|
1163
1282
|
return {
|
|
1164
|
-
rootBg: ((e =
|
|
1165
|
-
rootText: ((t =
|
|
1166
|
-
branchBg: ((
|
|
1167
|
-
branchText: ((
|
|
1168
|
-
lineColor: ((
|
|
1169
|
-
bgColor: ((l =
|
|
1170
|
-
fontSize: ((
|
|
1171
|
-
lineWidthStart: ((
|
|
1172
|
-
lineWidthEnd: ((
|
|
1173
|
-
rainbowBranch: ((
|
|
1283
|
+
rootBg: ((e = n.theme) == null ? void 0 : e.rootBg) ?? "#1f2937",
|
|
1284
|
+
rootText: ((t = n.theme) == null ? void 0 : t.rootText) ?? "#ffffff",
|
|
1285
|
+
branchBg: ((a = n.theme) == null ? void 0 : a.branchBg) ?? "#ffffff",
|
|
1286
|
+
branchText: ((m = n.theme) == null ? void 0 : m.branchText) ?? "#1f2937",
|
|
1287
|
+
lineColor: ((h = n.theme) == null ? void 0 : h.lineColor) ?? "#94a3b8",
|
|
1288
|
+
bgColor: ((l = n.theme) == null ? void 0 : l.bgColor) ?? "#f8fafc",
|
|
1289
|
+
fontSize: ((y = n.theme) == null ? void 0 : y.fontSize) ?? 14,
|
|
1290
|
+
lineWidthStart: ((B = n.theme) == null ? void 0 : B.lineWidthStart) ?? 2.2,
|
|
1291
|
+
lineWidthEnd: ((K = n.theme) == null ? void 0 : K.lineWidthEnd) ?? 0.8,
|
|
1292
|
+
rainbowBranch: ((_ = n.theme) == null ? void 0 : _.rainbowBranch) ?? !1
|
|
1174
1293
|
};
|
|
1175
|
-
}), k =
|
|
1294
|
+
}), k = je({
|
|
1176
1295
|
autoBalanceOnChange: !0,
|
|
1177
1296
|
lineWidthStart: 12,
|
|
1178
1297
|
lineWidthEnd: 3.6,
|
|
@@ -1185,195 +1304,195 @@ const mi = ["disabled"], gi = ["disabled"], yi = ["disabled"], xi = ["disabled"]
|
|
|
1185
1304
|
showOrderBadge: !1
|
|
1186
1305
|
});
|
|
1187
1306
|
function xt(e) {
|
|
1188
|
-
return k.taperedEdge ? on(e) :
|
|
1307
|
+
return k.taperedEdge ? on(e) : wt(e);
|
|
1189
1308
|
}
|
|
1190
1309
|
function pt(e) {
|
|
1191
|
-
return k.taperedEdge ? k.lineWidthEnd :
|
|
1310
|
+
return k.taperedEdge ? k.lineWidthEnd : wt(e);
|
|
1192
1311
|
}
|
|
1193
1312
|
function on(e) {
|
|
1194
1313
|
return e <= 0 ? k.lineWidthStart : e === 1 ? Math.max(1.5, k.lineWidthStart * 0.67) : e === 2 ? Math.max(0.8, k.lineWidthStart * 0.42) : k.lineWidthEnd;
|
|
1195
1314
|
}
|
|
1196
|
-
function
|
|
1315
|
+
function wt(e) {
|
|
1197
1316
|
if (e <= 0) return k.lineWidthStart;
|
|
1198
1317
|
if (e >= 3) return k.lineWidthEnd;
|
|
1199
1318
|
const t = e / 3;
|
|
1200
1319
|
return k.lineWidthStart + (k.lineWidthEnd - k.lineWidthStart) * t;
|
|
1201
1320
|
}
|
|
1202
|
-
function ln(e, t,
|
|
1203
|
-
const
|
|
1204
|
-
return { x: l, y
|
|
1321
|
+
function ln(e, t, a, m) {
|
|
1322
|
+
const h = 1 - e, l = h * h * h * t.x + 3 * h * h * e * a.x1 + 3 * h * e * e * a.x2 + e * e * e * m.x, y = h * h * h * t.y + 3 * h * h * e * a.y1 + 3 * h * e * e * a.y2 + e * e * e * m.y;
|
|
1323
|
+
return { x: l, y };
|
|
1205
1324
|
}
|
|
1206
|
-
function rn(e, t,
|
|
1325
|
+
function rn(e, t, a, m, h = 32, l = "curve", y = "right") {
|
|
1207
1326
|
if (l === "curve") {
|
|
1208
|
-
let
|
|
1209
|
-
if (
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1327
|
+
let pe;
|
|
1328
|
+
if (y === "right" || y === "left") {
|
|
1329
|
+
const P = Math.abs(t.x - e.x) * 0.45, fe = y === "right" ? 1 : -1;
|
|
1330
|
+
pe = { x1: e.x + fe * P, y1: e.y, x2: t.x - fe * P, y2: t.y };
|
|
1212
1331
|
} else {
|
|
1213
|
-
const
|
|
1214
|
-
|
|
1332
|
+
const P = Math.abs(t.y - e.y) * 0.45;
|
|
1333
|
+
pe = { x1: e.x, y1: e.y + P, x2: t.x, y2: t.y - P };
|
|
1215
1334
|
}
|
|
1216
|
-
const In = (
|
|
1217
|
-
const
|
|
1218
|
-
return { dx:
|
|
1335
|
+
const In = (I) => {
|
|
1336
|
+
const P = 1 - I, fe = -3 * P * P * e.x + 3 * (P * P - 2 * P * I) * pe.x1 + 3 * (2 * P * I - I * I) * pe.x2 + 3 * I * I * t.x, ze = -3 * P * P * e.y + 3 * (P * P - 2 * P * I) * pe.y1 + 3 * (2 * P * I - I * I) * pe.y2 + 3 * I * I * t.y;
|
|
1337
|
+
return { dx: fe, dy: ze };
|
|
1219
1338
|
}, He = [], rt = [];
|
|
1220
|
-
for (let
|
|
1221
|
-
const
|
|
1339
|
+
for (let I = 0; I <= h; I++) {
|
|
1340
|
+
const P = I / h, fe = I === 0 ? e : I === h ? t : ln(P, e, pe, t), ze = In(P);
|
|
1222
1341
|
let Xe = Math.hypot(ze.dx, ze.dy);
|
|
1223
1342
|
Xe < 1e-6 && (Xe = 1);
|
|
1224
|
-
const Pt = -ze.dy / Xe, Tt = ze.dx / Xe, qe = (
|
|
1225
|
-
He.push({ x:
|
|
1343
|
+
const Pt = -ze.dy / Xe, Tt = ze.dx / Xe, qe = (a + (m - a) * P) / 2;
|
|
1344
|
+
He.push({ x: fe.x + Pt * qe, y: fe.y + Tt * qe }), rt.push({ x: fe.x - Pt * qe, y: fe.y - Tt * qe });
|
|
1226
1345
|
}
|
|
1227
1346
|
let Ve = `M ${He[0].x.toFixed(2)} ${He[0].y.toFixed(2)}`;
|
|
1228
|
-
for (let
|
|
1229
|
-
for (let
|
|
1347
|
+
for (let I = 1; I <= h; I++) Ve += ` L ${He[I].x.toFixed(2)} ${He[I].y.toFixed(2)}`;
|
|
1348
|
+
for (let I = h; I >= 0; I--) Ve += ` L ${rt[I].x.toFixed(2)} ${rt[I].y.toFixed(2)}`;
|
|
1230
1349
|
return Ve += " Z", Ve;
|
|
1231
1350
|
}
|
|
1232
|
-
const
|
|
1233
|
-
let
|
|
1234
|
-
|
|
1235
|
-
const
|
|
1236
|
-
return `M ${
|
|
1351
|
+
const B = t.x - e.x, K = t.y - e.y;
|
|
1352
|
+
let _ = Math.hypot(B, K);
|
|
1353
|
+
_ < 1e-6 && (_ = 1);
|
|
1354
|
+
const xe = -K / _, Ee = B / _, Se = a / 2, Ae = m / 2, Lt = { x: e.x + xe * Se, y: e.y + Ee * Se }, At = { x: e.x - xe * Se, y: e.y - Ee * Se }, Ht = { x: t.x - xe * Ae, y: t.y - Ee * Ae }, Dt = { x: t.x + xe * Ae, y: t.y + Ee * Ae };
|
|
1355
|
+
return `M ${Lt.x.toFixed(2)} ${Lt.y.toFixed(2)} L ${Dt.x.toFixed(2)} ${Dt.y.toFixed(2)} L ${Ht.x.toFixed(2)} ${Ht.y.toFixed(2)} L ${At.x.toFixed(2)} ${At.y.toFixed(2)} Z`;
|
|
1237
1356
|
}
|
|
1238
|
-
const Te =
|
|
1357
|
+
const Te = te(() => ie.value.root.children), an = Pe[0].colors, bt = te(
|
|
1239
1358
|
() => oi(k.branchPaletteId, k.customPalettes)
|
|
1240
|
-
),
|
|
1359
|
+
), ye = te(() => {
|
|
1241
1360
|
const e = /* @__PURE__ */ new Map();
|
|
1242
1361
|
if (!k.rainbowBranch) return e;
|
|
1243
|
-
const t =
|
|
1244
|
-
for (let
|
|
1245
|
-
const l = Te.value[
|
|
1246
|
-
e.set(l.id,
|
|
1362
|
+
const t = n.lineColors, a = t && t.length > 0 ? t : bt.value.colors.length > 0 ? bt.value.colors : an;
|
|
1363
|
+
for (let h = 0; h < Te.value.length; h++) {
|
|
1364
|
+
const l = Te.value[h];
|
|
1365
|
+
e.set(l.id, a[h % a.length]);
|
|
1247
1366
|
}
|
|
1248
|
-
const
|
|
1249
|
-
e.set(
|
|
1250
|
-
for (const
|
|
1367
|
+
const m = (h, l) => {
|
|
1368
|
+
e.set(h.id, l);
|
|
1369
|
+
for (const y of h.children) m(y, l);
|
|
1251
1370
|
};
|
|
1252
|
-
for (let
|
|
1253
|
-
const l = Te.value[
|
|
1254
|
-
|
|
1371
|
+
for (let h = 0; h < Te.value.length; h++) {
|
|
1372
|
+
const l = Te.value[h];
|
|
1373
|
+
m(l, a[h % a.length]);
|
|
1255
1374
|
}
|
|
1256
1375
|
return e;
|
|
1257
1376
|
});
|
|
1258
|
-
function
|
|
1259
|
-
return k.rainbowBranch ?
|
|
1377
|
+
function sn(e, t) {
|
|
1378
|
+
return k.rainbowBranch ? ye.value.get(t.id) ?? ae.value.lineColor : ae.value.lineColor;
|
|
1260
1379
|
}
|
|
1261
|
-
function
|
|
1262
|
-
const t =
|
|
1380
|
+
function un(e) {
|
|
1381
|
+
const t = Y(e.id);
|
|
1263
1382
|
if (t.bg) return t.bg;
|
|
1264
|
-
if (e.isRoot) return
|
|
1383
|
+
if (e.isRoot) return ae.value.rootBg;
|
|
1265
1384
|
if (k.rainbowBranch) {
|
|
1266
|
-
const
|
|
1267
|
-
if (
|
|
1385
|
+
const a = ye.value.get(e.id);
|
|
1386
|
+
if (a) return hn(a, 0.18);
|
|
1268
1387
|
}
|
|
1269
|
-
return
|
|
1388
|
+
return ae.value.branchBg;
|
|
1270
1389
|
}
|
|
1271
|
-
function
|
|
1272
|
-
const t =
|
|
1390
|
+
function cn(e) {
|
|
1391
|
+
const t = Y(e.id);
|
|
1273
1392
|
if (t.textColor) return t.textColor;
|
|
1274
|
-
if (e.isRoot) return
|
|
1393
|
+
if (e.isRoot) return ae.value.rootText;
|
|
1275
1394
|
if (k.rainbowBranch) {
|
|
1276
|
-
const
|
|
1277
|
-
if (
|
|
1395
|
+
const a = ye.value.get(e.id);
|
|
1396
|
+
if (a) return kt(a, 0.55);
|
|
1278
1397
|
}
|
|
1279
|
-
return
|
|
1398
|
+
return ae.value.branchText;
|
|
1280
1399
|
}
|
|
1281
|
-
function
|
|
1282
|
-
const t =
|
|
1400
|
+
function dn(e) {
|
|
1401
|
+
const t = Y(e.id);
|
|
1283
1402
|
if (t.borderColor) return t.borderColor;
|
|
1284
|
-
if (e.isRoot) return
|
|
1403
|
+
if (e.isRoot) return ae.value.rootBg;
|
|
1285
1404
|
if (k.rainbowBranch) {
|
|
1286
|
-
const
|
|
1287
|
-
if (
|
|
1405
|
+
const a = ye.value.get(e.id);
|
|
1406
|
+
if (a) return kt(a, 0.3);
|
|
1288
1407
|
}
|
|
1289
|
-
return
|
|
1408
|
+
return ae.value.lineColor;
|
|
1290
1409
|
}
|
|
1291
1410
|
function fn(e) {
|
|
1292
|
-
return
|
|
1411
|
+
return Y(e.id).fontWeight ?? (e.isRoot ? 600 : 400);
|
|
1293
1412
|
}
|
|
1294
|
-
function
|
|
1295
|
-
const
|
|
1296
|
-
return `rgba(${
|
|
1413
|
+
function hn(e, t) {
|
|
1414
|
+
const a = e.replace("#", ""), m = a.length === 6 ? a : a.split("").map((B) => B + B).join(""), h = parseInt(m.slice(0, 2), 16), l = parseInt(m.slice(2, 4), 16), y = parseInt(m.slice(4, 6), 16);
|
|
1415
|
+
return `rgba(${h}, ${l}, ${y}, ${t})`;
|
|
1297
1416
|
}
|
|
1298
1417
|
function kt(e, t) {
|
|
1299
|
-
const
|
|
1300
|
-
return `rgb(${
|
|
1301
|
-
}
|
|
1302
|
-
const
|
|
1303
|
-
|
|
1304
|
-
isEditing: () =>
|
|
1305
|
-
isReadonly: () =>
|
|
1306
|
-
getSelectedId: () =>
|
|
1418
|
+
const a = e.replace("#", ""), m = a.length === 6 ? a : a.split("").map((B) => B + B).join(""), h = Math.round(parseInt(m.slice(0, 2), 16) * (1 - t)), l = Math.round(parseInt(m.slice(2, 4), 16) * (1 - t)), y = Math.round(parseInt(m.slice(4, 6), 16) * (1 - t));
|
|
1419
|
+
return `rgb(${h}, ${l}, ${y})`;
|
|
1420
|
+
}
|
|
1421
|
+
const S = fi({ getContainer: () => c.value });
|
|
1422
|
+
S.setOnMarqueeEnd(Cn), vi({
|
|
1423
|
+
isEditing: () => d.value !== null,
|
|
1424
|
+
isReadonly: () => n.readonly,
|
|
1425
|
+
getSelectedId: () => f.value,
|
|
1307
1426
|
getRootId: () => u.value.id,
|
|
1308
1427
|
// If nothing is selected, default Tab/Enter to the root so the user
|
|
1309
1428
|
// can build a tree from scratch without first clicking somewhere.
|
|
1310
1429
|
defaultTargetId: () => u.value.id,
|
|
1311
1430
|
onAddChild: Ce,
|
|
1312
1431
|
onAddSibling: Fe,
|
|
1313
|
-
onAddSiblingBefore:
|
|
1432
|
+
onAddSiblingBefore: Et,
|
|
1314
1433
|
onRemove: zt,
|
|
1315
|
-
onStartEdit:
|
|
1434
|
+
onStartEdit: Le,
|
|
1316
1435
|
onClearSelection: () => {
|
|
1317
|
-
|
|
1436
|
+
f.value = null, r("select", null);
|
|
1318
1437
|
},
|
|
1319
|
-
onDuplicate:
|
|
1438
|
+
onDuplicate: St,
|
|
1320
1439
|
onUndo: nt,
|
|
1321
1440
|
onRedo: it,
|
|
1322
1441
|
onNavigate: xn,
|
|
1323
1442
|
onSelectRoot: () => {
|
|
1324
|
-
|
|
1325
|
-
const e =
|
|
1326
|
-
e &&
|
|
1443
|
+
f.value = u.value.id;
|
|
1444
|
+
const e = A(u.value, u.value.id);
|
|
1445
|
+
e && r("select", e);
|
|
1327
1446
|
}
|
|
1328
1447
|
});
|
|
1329
|
-
const
|
|
1330
|
-
const e =
|
|
1331
|
-
return Ct(e), ei(e, { mode: k.layoutMode, baseFontSize:
|
|
1332
|
-
}), Mt =
|
|
1333
|
-
|
|
1334
|
-
|
|
1448
|
+
const ie = te(() => {
|
|
1449
|
+
const e = me(u.value);
|
|
1450
|
+
return Ct(e), ei(e, { mode: k.layoutMode, baseFontSize: ae.value.fontSize });
|
|
1451
|
+
}), Mt = O([]), tt = te(() => (yt.value, Mt.value));
|
|
1452
|
+
Ue(
|
|
1453
|
+
ie,
|
|
1335
1454
|
(e) => {
|
|
1336
|
-
const t = [],
|
|
1337
|
-
t.push(
|
|
1338
|
-
for (const
|
|
1455
|
+
const t = [], a = (m) => {
|
|
1456
|
+
t.push(m);
|
|
1457
|
+
for (const h of m.children) a(h);
|
|
1339
1458
|
};
|
|
1340
|
-
|
|
1459
|
+
a(e.root), Mt.value = t;
|
|
1341
1460
|
},
|
|
1342
1461
|
{ immediate: !0 }
|
|
1343
1462
|
);
|
|
1344
|
-
const
|
|
1463
|
+
const vn = te(() => {
|
|
1345
1464
|
const e = [];
|
|
1346
1465
|
for (const t of tt.value)
|
|
1347
|
-
for (const
|
|
1348
|
-
e.push({ from: t, to:
|
|
1466
|
+
for (const a of t.children)
|
|
1467
|
+
e.push({ from: t, to: a, key: `${t.id}->${a.id}` });
|
|
1349
1468
|
return e;
|
|
1350
|
-
}), mn =
|
|
1351
|
-
() => `${
|
|
1469
|
+
}), mn = te(
|
|
1470
|
+
() => `${ie.value.vbX} ${ie.value.vbY} ${ie.value.vbW} ${ie.value.vbH}`
|
|
1352
1471
|
);
|
|
1353
1472
|
function Ct(e) {
|
|
1354
|
-
if (
|
|
1473
|
+
if (v.value.has(e.id)) {
|
|
1355
1474
|
e.children = [], e.collapsed = !0;
|
|
1356
1475
|
return;
|
|
1357
1476
|
}
|
|
1358
1477
|
e.collapsed = !1;
|
|
1359
1478
|
for (const t of e.children) Ct(t);
|
|
1360
1479
|
}
|
|
1361
|
-
function
|
|
1362
|
-
const t =
|
|
1363
|
-
t && (
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1480
|
+
function Le(e) {
|
|
1481
|
+
const t = A(u.value, e);
|
|
1482
|
+
t && (d.value = e, x.value = t.text, ee(() => {
|
|
1483
|
+
const a = document.querySelector(".zm-input");
|
|
1484
|
+
a == null || a.focus(), a == null || a.select();
|
|
1366
1485
|
}));
|
|
1367
1486
|
}
|
|
1368
1487
|
function Oe(e = {}) {
|
|
1369
|
-
if (!
|
|
1370
|
-
const t =
|
|
1371
|
-
t && t.text !== (x.value.trim() || " ") && (t.text = x.value.trim() || " ",
|
|
1372
|
-
const
|
|
1373
|
-
|
|
1488
|
+
if (!d.value) return;
|
|
1489
|
+
const t = A(u.value, d.value);
|
|
1490
|
+
t && t.text !== (x.value.trim() || " ") && (t.text = x.value.trim() || " ", G(), r("change", u.value));
|
|
1491
|
+
const a = d.value;
|
|
1492
|
+
d.value = null, e.addChild ? ee(() => Ce(a)) : e.addSibling === "after" ? ee(() => Fe(a)) : e.addSibling === "before" && ee(() => Et(a));
|
|
1374
1493
|
}
|
|
1375
1494
|
function gn() {
|
|
1376
|
-
|
|
1495
|
+
d.value = null;
|
|
1377
1496
|
}
|
|
1378
1497
|
function yn(e) {
|
|
1379
1498
|
const t = e.metaKey || e.ctrlKey;
|
|
@@ -1381,90 +1500,90 @@ const mi = ["disabled"], gi = ["disabled"], yi = ["disabled"], xi = ["disabled"]
|
|
|
1381
1500
|
}
|
|
1382
1501
|
function Ce(e) {
|
|
1383
1502
|
const t = ai(u.value, e, Je);
|
|
1384
|
-
t && (
|
|
1503
|
+
t && (G(), T(), r("change", u.value), ee(() => Le(t.id)));
|
|
1385
1504
|
}
|
|
1386
1505
|
function Fe(e) {
|
|
1387
1506
|
if (e === u.value.id) {
|
|
1388
1507
|
Ce(e);
|
|
1389
1508
|
return;
|
|
1390
1509
|
}
|
|
1391
|
-
const t =
|
|
1392
|
-
t && (
|
|
1510
|
+
const t = si(u.value, e, Je);
|
|
1511
|
+
t && (G(), T(), r("change", u.value), ee(() => Le(t.id)));
|
|
1393
1512
|
}
|
|
1394
|
-
function
|
|
1513
|
+
function Et(e) {
|
|
1395
1514
|
if (e === u.value.id) {
|
|
1396
1515
|
Ce(e);
|
|
1397
1516
|
return;
|
|
1398
1517
|
}
|
|
1399
|
-
const t =
|
|
1400
|
-
t && (
|
|
1518
|
+
const t = ui(u.value, e, Je);
|
|
1519
|
+
t && (G(), T(), r("change", u.value), ee(() => Le(t.id)));
|
|
1401
1520
|
}
|
|
1402
|
-
function
|
|
1521
|
+
function St(e) {
|
|
1403
1522
|
if (e === u.value.id) return;
|
|
1404
|
-
const t =
|
|
1405
|
-
t && (
|
|
1523
|
+
const t = ci(u.value, e);
|
|
1524
|
+
t && (G(), f.value = t.id, r("change", u.value), T());
|
|
1406
1525
|
}
|
|
1407
1526
|
function nt() {
|
|
1408
|
-
const e =
|
|
1409
|
-
e && (u.value = e.data,
|
|
1527
|
+
const e = he.undo();
|
|
1528
|
+
e && (u.value = e.data, f.value = null, r("select", null), T(), r("change", u.value));
|
|
1410
1529
|
}
|
|
1411
1530
|
function it() {
|
|
1412
|
-
const e =
|
|
1413
|
-
e && (u.value = e.data,
|
|
1531
|
+
const e = he.redo();
|
|
1532
|
+
e && (u.value = e.data, f.value = null, r("select", null), T(), r("change", u.value));
|
|
1414
1533
|
}
|
|
1415
1534
|
function xn(e, t) {
|
|
1416
|
-
const
|
|
1417
|
-
if (!
|
|
1418
|
-
let
|
|
1535
|
+
const a = f.value ?? u.value.id, m = A(u.value, a);
|
|
1536
|
+
if (!m) return;
|
|
1537
|
+
let h = null;
|
|
1419
1538
|
if (t === 1) {
|
|
1420
|
-
const l =
|
|
1539
|
+
const l = ce(u.value, m.id);
|
|
1421
1540
|
if (l) {
|
|
1422
|
-
const
|
|
1423
|
-
|
|
1541
|
+
const y = l.children.findIndex((B) => B.id === m.id);
|
|
1542
|
+
y >= 0 && y < l.children.length - 1 && (h = l.children[y + 1].id);
|
|
1424
1543
|
}
|
|
1425
1544
|
} else if (t === -1) {
|
|
1426
|
-
const l =
|
|
1545
|
+
const l = ce(u.value, m.id);
|
|
1427
1546
|
if (l) {
|
|
1428
|
-
const
|
|
1429
|
-
|
|
1547
|
+
const y = l.children.findIndex((B) => B.id === m.id);
|
|
1548
|
+
y > 0 && (h = l.children[y - 1].id);
|
|
1430
1549
|
}
|
|
1431
1550
|
} else if (e === 1) {
|
|
1432
|
-
const l =
|
|
1433
|
-
l && (
|
|
1434
|
-
} else e === -1 &&
|
|
1435
|
-
if (
|
|
1436
|
-
|
|
1437
|
-
const l =
|
|
1438
|
-
l &&
|
|
1551
|
+
const l = ce(u.value, m.id);
|
|
1552
|
+
l && (h = l.id);
|
|
1553
|
+
} else e === -1 && m.children.length > 0 && (h = m.children[0].id);
|
|
1554
|
+
if (h) {
|
|
1555
|
+
f.value = h;
|
|
1556
|
+
const l = A(u.value, h);
|
|
1557
|
+
l && r("select", l);
|
|
1439
1558
|
}
|
|
1440
1559
|
}
|
|
1441
1560
|
function zt(e) {
|
|
1442
|
-
e !== u.value.id &&
|
|
1561
|
+
e !== u.value.id && jt(u.value, e) && (G(), f.value === e && (f.value = null), T(), r("change", u.value));
|
|
1443
1562
|
}
|
|
1444
1563
|
function Nt(e) {
|
|
1445
|
-
|
|
1564
|
+
v.value.has(e) ? v.value.delete(e) : v.value.add(e), T();
|
|
1446
1565
|
}
|
|
1447
1566
|
function pn(e, t) {
|
|
1448
|
-
li(u.value, e, t) && (
|
|
1567
|
+
li(u.value, e, t) && (G(), T(), r("change", u.value));
|
|
1449
1568
|
}
|
|
1450
|
-
function
|
|
1451
|
-
return ri(u.value, e, t,
|
|
1569
|
+
function wn(e, t, a) {
|
|
1570
|
+
return ri(u.value, e, t, a) ? (G(), T(), r("change", u.value), !0) : !1;
|
|
1452
1571
|
}
|
|
1453
|
-
function
|
|
1454
|
-
e.stopPropagation(),
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1572
|
+
function bn(e, t) {
|
|
1573
|
+
e.stopPropagation(), f.value = t.id;
|
|
1574
|
+
const a = A(u.value, t.id);
|
|
1575
|
+
r("select", a);
|
|
1457
1576
|
}
|
|
1458
1577
|
function kn(e) {
|
|
1459
1578
|
const t = e.target;
|
|
1460
1579
|
if (!t || t.closest(".zm-node, .zm-toolbar, button, input, textarea")) return;
|
|
1461
1580
|
if (e.button === 2) {
|
|
1462
|
-
|
|
1581
|
+
S.startPan(e);
|
|
1463
1582
|
return;
|
|
1464
1583
|
}
|
|
1465
1584
|
if (e.button !== 0) return;
|
|
1466
|
-
const
|
|
1467
|
-
|
|
1585
|
+
const a = c.value.getBoundingClientRect(), m = (e.clientX - a.left - S.offsetX.value) / S.scale.value, h = (e.clientY - a.top - S.offsetY.value) / S.scale.value;
|
|
1586
|
+
S.startMarquee(m, h);
|
|
1468
1587
|
}
|
|
1469
1588
|
function Mn(e) {
|
|
1470
1589
|
if (_e) {
|
|
@@ -1473,68 +1592,68 @@ const mi = ["disabled"], gi = ["disabled"], yi = ["disabled"], xi = ["disabled"]
|
|
|
1473
1592
|
}
|
|
1474
1593
|
const t = e.target;
|
|
1475
1594
|
if (!t || t.closest(".zm-node")) return;
|
|
1476
|
-
const
|
|
1477
|
-
|
|
1595
|
+
const a = S.marquee;
|
|
1596
|
+
a.width >= 4 || a.height >= 4 || f.value !== null && (f.value = null, r("select", null));
|
|
1478
1597
|
}
|
|
1479
1598
|
function Cn() {
|
|
1480
|
-
const e =
|
|
1599
|
+
const e = S.marquee;
|
|
1481
1600
|
if (e.width < 4 && e.height < 4)
|
|
1482
1601
|
return;
|
|
1483
|
-
const t = e.x,
|
|
1484
|
-
for (const
|
|
1485
|
-
const
|
|
1486
|
-
|
|
1602
|
+
const t = e.x, a = e.y, m = e.x + e.width, h = e.y + e.height, l = [];
|
|
1603
|
+
for (const y of tt.value) {
|
|
1604
|
+
const B = y.width / 2, K = y.height / 2, _ = y.x - B, xe = y.x + B, Ee = y.y - K, Se = y.y + K;
|
|
1605
|
+
_ <= m && xe >= t && Ee <= h && Se >= a && l.push(y.id);
|
|
1487
1606
|
}
|
|
1488
1607
|
if (l.length > 0) {
|
|
1489
|
-
|
|
1490
|
-
const
|
|
1491
|
-
|
|
1608
|
+
f.value = l[0];
|
|
1609
|
+
const y = A(u.value, l[0]);
|
|
1610
|
+
y && r("select", y);
|
|
1492
1611
|
}
|
|
1493
1612
|
}
|
|
1494
1613
|
function It(e) {
|
|
1495
|
-
return
|
|
1614
|
+
return v.value.has(e);
|
|
1496
1615
|
}
|
|
1497
|
-
function
|
|
1498
|
-
const t =
|
|
1616
|
+
function En(e) {
|
|
1617
|
+
const t = A(u.value, e.id);
|
|
1499
1618
|
return !!t && t.children.length > 0;
|
|
1500
1619
|
}
|
|
1501
1620
|
function ot(e) {
|
|
1502
|
-
const t =
|
|
1621
|
+
const t = A(u.value, e);
|
|
1503
1622
|
return t ? t.children.length : 0;
|
|
1504
1623
|
}
|
|
1505
1624
|
function Wt(e) {
|
|
1506
|
-
if (!
|
|
1507
|
-
const
|
|
1508
|
-
for (;
|
|
1509
|
-
const
|
|
1625
|
+
if (!A(u.value, e)) return 0;
|
|
1626
|
+
const m = [u.value];
|
|
1627
|
+
for (; m.length; ) {
|
|
1628
|
+
const h = m.pop(), l = h.children.findIndex((y) => y.id === e);
|
|
1510
1629
|
if (l >= 0) return l;
|
|
1511
|
-
for (const
|
|
1630
|
+
for (const y of h.children) m.push(y);
|
|
1512
1631
|
}
|
|
1513
1632
|
return 0;
|
|
1514
1633
|
}
|
|
1515
|
-
function $t(e, t,
|
|
1516
|
-
if (((
|
|
1634
|
+
function $t(e, t, a, m) {
|
|
1635
|
+
if (((m == null ? void 0 : m._dir) ?? e._dir) === "down")
|
|
1517
1636
|
return t === "out" ? { x: e.x, y: e.y + e.height / 2 } : { x: e.x, y: e.y - e.height / 2 };
|
|
1518
1637
|
let l;
|
|
1519
|
-
return t === "in" ? l = -e.side :
|
|
1638
|
+
return t === "in" ? l = -e.side : a !== void 0 ? l = a : l = e.side, { x: e.x + l * (e.width / 2), y: e.y };
|
|
1520
1639
|
}
|
|
1521
|
-
function
|
|
1522
|
-
const e =
|
|
1523
|
-
|
|
1640
|
+
function de() {
|
|
1641
|
+
const e = ie.value;
|
|
1642
|
+
S.resetView(e.width, e.height, e.root.y);
|
|
1524
1643
|
}
|
|
1525
|
-
function
|
|
1526
|
-
et.value = !0,
|
|
1644
|
+
function Sn() {
|
|
1645
|
+
et.value = !0, G(), T(), ee(() => de());
|
|
1527
1646
|
}
|
|
1528
1647
|
function lt(e) {
|
|
1529
|
-
k.layoutMode !== e && (k.layoutMode = e,
|
|
1648
|
+
k.layoutMode !== e && (k.layoutMode = e, T(), ee(() => de()));
|
|
1530
1649
|
}
|
|
1531
|
-
function
|
|
1650
|
+
function Rt() {
|
|
1532
1651
|
return JSON.stringify(u.value, null, 2);
|
|
1533
1652
|
}
|
|
1534
|
-
function
|
|
1653
|
+
function Bt(e) {
|
|
1535
1654
|
try {
|
|
1536
1655
|
const t = JSON.parse(e);
|
|
1537
|
-
return !t.id || !Array.isArray(t.children) ? !1 : (
|
|
1656
|
+
return !t.id || !Array.isArray(t.children) ? !1 : (he.reset(), u.value = me(t), f.value = null, v.value = /* @__PURE__ */ new Set(), T(), ee(() => de()), r("change", u.value), !0);
|
|
1538
1657
|
} catch {
|
|
1539
1658
|
return !1;
|
|
1540
1659
|
}
|
|
@@ -1542,47 +1661,47 @@ const mi = ["disabled"], gi = ["disabled"], yi = ["disabled"], xi = ["disabled"]
|
|
|
1542
1661
|
function zn() {
|
|
1543
1662
|
const e = document.createElement("input");
|
|
1544
1663
|
e.type = "file", e.accept = "application/json", e.onchange = () => {
|
|
1545
|
-
var
|
|
1546
|
-
const t = (
|
|
1664
|
+
var m;
|
|
1665
|
+
const t = (m = e.files) == null ? void 0 : m[0];
|
|
1547
1666
|
if (!t) return;
|
|
1548
|
-
const
|
|
1549
|
-
|
|
1550
|
-
typeof
|
|
1551
|
-
},
|
|
1667
|
+
const a = new FileReader();
|
|
1668
|
+
a.onload = () => {
|
|
1669
|
+
typeof a.result == "string" && (Bt(a.result) || alert("导入失败:JSON 格式无效"));
|
|
1670
|
+
}, a.readAsText(t);
|
|
1552
1671
|
}, e.click();
|
|
1553
1672
|
}
|
|
1554
1673
|
function Nn() {
|
|
1555
|
-
const e = new Blob([
|
|
1556
|
-
|
|
1674
|
+
const e = new Blob([Rt()], { type: "application/json" }), t = URL.createObjectURL(e), a = document.createElement("a");
|
|
1675
|
+
a.href = t, a.download = `${u.value.text || "mindmap"}.json`, a.click(), URL.revokeObjectURL(t);
|
|
1557
1676
|
}
|
|
1558
1677
|
return s({
|
|
1559
1678
|
addChild: (e) => Ce(e),
|
|
1560
1679
|
addSibling: (e) => Fe(e),
|
|
1561
1680
|
removeNode: (e) => zt(e),
|
|
1562
|
-
duplicateNode: (e) =>
|
|
1681
|
+
duplicateNode: (e) => St(e),
|
|
1563
1682
|
setNodeText: (e, t) => pn(e, t),
|
|
1564
|
-
moveNode: (e, t,
|
|
1683
|
+
moveNode: (e, t, a) => wn(e, t, a),
|
|
1565
1684
|
lineWidthForDepth: xt,
|
|
1566
1685
|
endWidthForDepth: pt,
|
|
1567
1686
|
getData: () => u.value,
|
|
1568
1687
|
setData: (e) => {
|
|
1569
|
-
|
|
1688
|
+
he.reset(), u.value = me(e), f.value = null, v.value = /* @__PURE__ */ new Set(), T(), G(), ee(() => de());
|
|
1570
1689
|
},
|
|
1571
|
-
resetView: () =>
|
|
1572
|
-
exportData:
|
|
1573
|
-
importData:
|
|
1690
|
+
resetView: () => de(),
|
|
1691
|
+
exportData: Rt,
|
|
1692
|
+
importData: Bt,
|
|
1574
1693
|
/** Serialize the current data tree as markdown. Always available
|
|
1575
1694
|
* — the same serializer is used to emit `markdownChange`. */
|
|
1576
|
-
getMarkdown: () =>
|
|
1695
|
+
getMarkdown: () => ut(u.value),
|
|
1577
1696
|
/** Replace the data tree with the result of parsing `md`. The
|
|
1578
1697
|
* flag `emitMarkdownChange` (default true) controls whether the
|
|
1579
1698
|
* change is also echoed via `markdownChange` (use false when
|
|
1580
1699
|
* the host just set the same value back from the prop). */
|
|
1581
1700
|
setMarkdown: (e, t = !0) => {
|
|
1582
|
-
const
|
|
1583
|
-
t && (
|
|
1584
|
-
|
|
1585
|
-
}),
|
|
1701
|
+
const a = Xt(e || "");
|
|
1702
|
+
t && (g.value = !0), M = !t, he.reset(), u.value = me(a), f.value = null, v.value = /* @__PURE__ */ new Set(), T(), G(), ee(() => {
|
|
1703
|
+
M = !1, de();
|
|
1704
|
+
}), r("change", u.value);
|
|
1586
1705
|
},
|
|
1587
1706
|
// Make balanced the active layout (sticky). Subsequent data changes
|
|
1588
1707
|
// and additions stay in balanced mode. Pass `false` to revert to the
|
|
@@ -1594,17 +1713,17 @@ const mi = ["disabled"], gi = ["disabled"], yi = ["disabled"], xi = ["disabled"]
|
|
|
1594
1713
|
// Re-balance now: clear all manual drag offsets, re-run the balanced
|
|
1595
1714
|
// layout, and re-center the view. This is the action tied to the
|
|
1596
1715
|
// "balance" toolbar button.
|
|
1597
|
-
balance: () =>
|
|
1598
|
-
applyNodeStyle: (e, t) =>
|
|
1599
|
-
getNodeStyle: (e) =>
|
|
1600
|
-
applyNodeLink: (e, t) =>
|
|
1601
|
-
removeNodeLink: (e) =>
|
|
1602
|
-
applyNodeNote: (e, t) =>
|
|
1603
|
-
removeNodeNote: (e) =>
|
|
1716
|
+
balance: () => Sn(),
|
|
1717
|
+
applyNodeStyle: (e, t) => Z(e, t),
|
|
1718
|
+
getNodeStyle: (e) => Y(e),
|
|
1719
|
+
applyNodeLink: (e, t) => V(e, t),
|
|
1720
|
+
removeNodeLink: (e) => se(e),
|
|
1721
|
+
applyNodeNote: (e, t) => ge(e, t),
|
|
1722
|
+
removeNodeNote: (e) => W(e),
|
|
1604
1723
|
undo: () => nt(),
|
|
1605
1724
|
redo: () => it(),
|
|
1606
|
-
canUndo: () =>
|
|
1607
|
-
canRedo: () =>
|
|
1725
|
+
canUndo: () => he.canUndo(),
|
|
1726
|
+
canRedo: () => he.canRedo(),
|
|
1608
1727
|
// Settings panel / external mutation hooks
|
|
1609
1728
|
applySettings: (e) => {
|
|
1610
1729
|
e.autoBalanceOnChange !== void 0 && (k.autoBalanceOnChange = e.autoBalanceOnChange), e.lineWidthStart !== void 0 && (k.lineWidthStart = Math.max(0.5, Math.min(20, e.lineWidthStart))), e.lineWidthEnd !== void 0 && (k.lineWidthEnd = Math.max(0.3, Math.min(10, e.lineWidthEnd))), e.rainbowBranch !== void 0 && (k.rainbowBranch = e.rainbowBranch), e.branchPaletteId !== void 0 && (k.branchPaletteId = e.branchPaletteId), e.customPalettes !== void 0 && (k.customPalettes = e.customPalettes), e.lineStyle !== void 0 && (k.lineStyle = e.lineStyle), e.taperedEdge !== void 0 && (k.taperedEdge = e.taperedEdge), e.showOrderBadge !== void 0 && (k.showOrderBadge = e.showOrderBadge);
|
|
@@ -1623,83 +1742,83 @@ const mi = ["disabled"], gi = ["disabled"], yi = ["disabled"], xi = ["disabled"]
|
|
|
1623
1742
|
}),
|
|
1624
1743
|
setBranchPalette: (e) => {
|
|
1625
1744
|
if (!e) return;
|
|
1626
|
-
[...Pe, ...k.customPalettes].find((
|
|
1745
|
+
[...Pe, ...k.customPalettes].find((a) => a.id === e) && (k.branchPaletteId = e);
|
|
1627
1746
|
},
|
|
1628
1747
|
getBranchPalette: () => k.branchPaletteId,
|
|
1629
1748
|
getBranchPalettes: () => [...Pe, ...k.customPalettes]
|
|
1630
|
-
}),
|
|
1631
|
-
() =>
|
|
1749
|
+
}), Ue(
|
|
1750
|
+
() => n.data,
|
|
1632
1751
|
(e) => {
|
|
1633
|
-
u.value =
|
|
1752
|
+
u.value = me(e), T();
|
|
1634
1753
|
},
|
|
1635
1754
|
{ deep: !1 }
|
|
1636
|
-
),
|
|
1637
|
-
|
|
1755
|
+
), st(() => {
|
|
1756
|
+
G(), ee(() => de());
|
|
1638
1757
|
}), (e, t) => {
|
|
1639
|
-
var
|
|
1640
|
-
return
|
|
1758
|
+
var a, m, h;
|
|
1759
|
+
return C(), E("div", {
|
|
1641
1760
|
class: "zm-mindmap",
|
|
1642
|
-
style: ve({ background:
|
|
1761
|
+
style: ve({ background: ae.value.bgColor, fontSize: ae.value.fontSize + "px" })
|
|
1643
1762
|
}, [
|
|
1644
|
-
|
|
1763
|
+
p("div", {
|
|
1645
1764
|
ref_key: "wrapperRef",
|
|
1646
|
-
ref:
|
|
1765
|
+
ref: c,
|
|
1647
1766
|
class: "zm-canvas",
|
|
1648
1767
|
onMousedown: kn,
|
|
1649
|
-
onContextmenu: t[13] || (t[13] =
|
|
1768
|
+
onContextmenu: t[13] || (t[13] = D(() => {
|
|
1650
1769
|
}, ["prevent"])),
|
|
1651
1770
|
onWheel: t[14] || (t[14] = //@ts-ignore
|
|
1652
|
-
(...l) =>
|
|
1771
|
+
(...l) => N(S).onWheel && N(S).onWheel(...l)),
|
|
1653
1772
|
onClick: Mn
|
|
1654
1773
|
}, [
|
|
1655
|
-
|
|
1774
|
+
p("div", {
|
|
1656
1775
|
class: "zm-svg-layer",
|
|
1657
1776
|
style: ve({
|
|
1658
|
-
left:
|
|
1659
|
-
top:
|
|
1660
|
-
width:
|
|
1661
|
-
height:
|
|
1777
|
+
left: ie.value.vbX * N(S).scale.value + N(S).offsetX.value + "px",
|
|
1778
|
+
top: ie.value.vbY * N(S).scale.value + N(S).offsetY.value + "px",
|
|
1779
|
+
width: ie.value.vbW * N(S).scale.value + "px",
|
|
1780
|
+
height: ie.value.vbH * N(S).scale.value + "px"
|
|
1662
1781
|
})
|
|
1663
1782
|
}, [
|
|
1664
|
-
(
|
|
1783
|
+
(C(), E("svg", {
|
|
1665
1784
|
class: "zm-svg",
|
|
1666
1785
|
viewBox: mn.value,
|
|
1667
1786
|
preserveAspectRatio: "xMinYMin meet",
|
|
1668
|
-
width:
|
|
1669
|
-
height:
|
|
1787
|
+
width: ie.value.vbW * N(S).scale.value,
|
|
1788
|
+
height: ie.value.vbH * N(S).scale.value
|
|
1670
1789
|
}, [
|
|
1671
|
-
|
|
1672
|
-
(
|
|
1790
|
+
p("g", Ci, [
|
|
1791
|
+
(C(!0), E(F, null, Ot(vn.value, (l) => (C(), E("path", {
|
|
1673
1792
|
key: l.key,
|
|
1674
1793
|
d: rn($t(l.from, "out", l.to.side, l.to), $t(l.to, "in"), xt(l.from.depth), pt(l.to.depth), 32, k.lineStyle, l.to._dir),
|
|
1675
|
-
fill:
|
|
1794
|
+
fill: sn(l.from, l.to),
|
|
1676
1795
|
stroke: "none"
|
|
1677
|
-
}, null, 8,
|
|
1796
|
+
}, null, 8, Ei))), 128))
|
|
1678
1797
|
])
|
|
1679
|
-
], 8,
|
|
1798
|
+
], 8, Mi))
|
|
1680
1799
|
], 4),
|
|
1681
|
-
|
|
1800
|
+
N(S).isMarquee.value ? (C(), E("div", {
|
|
1682
1801
|
key: 0,
|
|
1683
1802
|
class: "zm-marquee",
|
|
1684
1803
|
style: ve({
|
|
1685
|
-
left:
|
|
1686
|
-
top:
|
|
1687
|
-
width:
|
|
1688
|
-
height:
|
|
1804
|
+
left: N(S).marquee.x * N(S).scale.value + N(S).offsetX.value + "px",
|
|
1805
|
+
top: N(S).marquee.y * N(S).scale.value + N(S).offsetY.value + "px",
|
|
1806
|
+
width: N(S).marquee.width * N(S).scale.value + "px",
|
|
1807
|
+
height: N(S).marquee.height * N(S).scale.value + "px"
|
|
1689
1808
|
})
|
|
1690
|
-
}, null, 4)) :
|
|
1691
|
-
|
|
1809
|
+
}, null, 4)) : X("", !0),
|
|
1810
|
+
p("div", {
|
|
1692
1811
|
class: "zm-world",
|
|
1693
1812
|
style: ve({
|
|
1694
|
-
transform: `translate(${
|
|
1813
|
+
transform: `translate(${N(S).offsetX.value}px, ${N(S).offsetY.value}px) scale(${N(S).scale.value})`
|
|
1695
1814
|
})
|
|
1696
1815
|
}, [
|
|
1697
|
-
(
|
|
1816
|
+
(C(!0), E(F, null, Ot(tt.value, (l) => (C(), E("div", {
|
|
1698
1817
|
key: l.id,
|
|
1699
1818
|
class: Ie(["zm-node", {
|
|
1700
1819
|
"is-root": l.isRoot,
|
|
1701
|
-
"is-selected":
|
|
1702
|
-
"is-editing":
|
|
1820
|
+
"is-selected": f.value === l.id,
|
|
1821
|
+
"is-editing": d.value === l.id,
|
|
1703
1822
|
"has-image": !!l.image,
|
|
1704
1823
|
"is-resizing": _t.value === l.id
|
|
1705
1824
|
}]),
|
|
@@ -1710,22 +1829,22 @@ const mi = ["disabled"], gi = ["disabled"], yi = ["disabled"], xi = ["disabled"]
|
|
|
1710
1829
|
minWidth: l.width + "px",
|
|
1711
1830
|
height: l.height + "px",
|
|
1712
1831
|
fontSize: l.fontSize + "px",
|
|
1713
|
-
background:
|
|
1714
|
-
color:
|
|
1715
|
-
borderColor:
|
|
1832
|
+
background: un(l),
|
|
1833
|
+
color: cn(l),
|
|
1834
|
+
borderColor: dn(l),
|
|
1716
1835
|
fontWeight: fn(l),
|
|
1717
1836
|
// Center the box on (x, y) with translate(-50%, -50%)
|
|
1718
1837
|
transform: "translate(-50%, -50%)"
|
|
1719
1838
|
}),
|
|
1720
|
-
onClick: (
|
|
1721
|
-
onDblclick: (
|
|
1722
|
-
|
|
1839
|
+
onClick: (y) => bn(y, l),
|
|
1840
|
+
onDblclick: (y) => {
|
|
1841
|
+
y.stopPropagation(), i.readonly || Le(l.id);
|
|
1723
1842
|
},
|
|
1724
|
-
onContextmenu: (
|
|
1725
|
-
onMouseenter: (
|
|
1726
|
-
onMouseleave: (
|
|
1843
|
+
onContextmenu: (y) => Q(y, l),
|
|
1844
|
+
onMouseenter: (y) => tn(l.id),
|
|
1845
|
+
onMouseleave: (y) => nn(l.id)
|
|
1727
1846
|
}, [
|
|
1728
|
-
l.image ? (
|
|
1847
|
+
l.image ? (C(), E("img", {
|
|
1729
1848
|
key: 0,
|
|
1730
1849
|
class: "zm-node-img",
|
|
1731
1850
|
src: l.image.src,
|
|
@@ -1733,242 +1852,244 @@ const mi = ["disabled"], gi = ["disabled"], yi = ["disabled"], xi = ["disabled"]
|
|
|
1733
1852
|
height: l.image.height,
|
|
1734
1853
|
alt: l.text,
|
|
1735
1854
|
draggable: "false"
|
|
1736
|
-
}, null, 8,
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
l.link && !
|
|
1855
|
+
}, null, 8, zi)) : X("", !0),
|
|
1856
|
+
d.value !== l.id ? (C(), E("span", Ni, [
|
|
1857
|
+
p("span", Ii, be(l.text), 1),
|
|
1858
|
+
l.link && !d.value ? (C(), E("a", {
|
|
1740
1859
|
key: 0,
|
|
1741
1860
|
class: "zm-node-link",
|
|
1742
1861
|
href: l.link.url,
|
|
1743
1862
|
target: "_blank",
|
|
1744
1863
|
rel: "noopener noreferrer",
|
|
1745
1864
|
title: `打开链接:${l.link.url}`,
|
|
1746
|
-
onClick: t[0] || (t[0] =
|
|
1865
|
+
onClick: t[0] || (t[0] = D(() => {
|
|
1747
1866
|
}, ["stop"])),
|
|
1748
|
-
onMousedown: t[1] || (t[1] =
|
|
1867
|
+
onMousedown: t[1] || (t[1] = D(() => {
|
|
1749
1868
|
}, ["stop"]))
|
|
1750
1869
|
}, [
|
|
1751
|
-
|
|
1870
|
+
q(U, {
|
|
1752
1871
|
name: "link",
|
|
1753
1872
|
size: 11,
|
|
1754
1873
|
stroke: 2
|
|
1755
1874
|
})
|
|
1756
|
-
], 40,
|
|
1757
|
-
l.note && !
|
|
1875
|
+
], 40, Wi)) : X("", !0),
|
|
1876
|
+
l.note && !d.value ? (C(), E("button", {
|
|
1758
1877
|
key: 1,
|
|
1759
1878
|
class: "zm-node-note-btn",
|
|
1760
1879
|
type: "button",
|
|
1761
1880
|
title: Qt(l.note.text),
|
|
1762
|
-
onClick:
|
|
1763
|
-
onMousedown: t[2] || (t[2] =
|
|
1881
|
+
onClick: D((y) => ht(l.id), ["stop"]),
|
|
1882
|
+
onMousedown: t[2] || (t[2] = D(() => {
|
|
1764
1883
|
}, ["stop"]))
|
|
1765
1884
|
}, [
|
|
1766
|
-
|
|
1885
|
+
q(U, {
|
|
1767
1886
|
name: "note",
|
|
1768
1887
|
size: 11,
|
|
1769
1888
|
stroke: 2
|
|
1770
1889
|
})
|
|
1771
|
-
], 40,
|
|
1772
|
-
])) : Wn((
|
|
1890
|
+
], 40, $i)) : X("", !0)
|
|
1891
|
+
])) : Wn((C(), E("input", {
|
|
1773
1892
|
key: 2,
|
|
1774
1893
|
class: "zm-input",
|
|
1775
|
-
"onUpdate:modelValue": t[3] || (t[3] = (
|
|
1894
|
+
"onUpdate:modelValue": t[3] || (t[3] = (y) => x.value = y),
|
|
1776
1895
|
autofocus: "",
|
|
1777
|
-
onBlur: t[4] || (t[4] = (
|
|
1896
|
+
onBlur: t[4] || (t[4] = (y) => Oe()),
|
|
1778
1897
|
onKeydown: [
|
|
1779
|
-
t[5] || (t[5] =
|
|
1780
|
-
t[6] || (t[6] =
|
|
1781
|
-
t[7] || (t[7] =
|
|
1782
|
-
|
|
1898
|
+
t[5] || (t[5] = Ye(D((y) => Oe({ addSibling: "after" }), ["exact"]), ["enter"])),
|
|
1899
|
+
t[6] || (t[6] = Ye(D((y) => Oe({ addSibling: "before" }), ["shift", "prevent", "exact"]), ["enter"])),
|
|
1900
|
+
t[7] || (t[7] = Ye(D((y) => Oe({ addChild: !0 }), ["prevent"]), ["tab"])),
|
|
1901
|
+
Ye(gn, ["esc"]),
|
|
1783
1902
|
yn
|
|
1784
1903
|
],
|
|
1785
|
-
onMousedown: t[8] || (t[8] =
|
|
1904
|
+
onMousedown: t[8] || (t[8] = D(() => {
|
|
1786
1905
|
}, ["stop"])),
|
|
1787
|
-
onClick: t[9] || (t[9] =
|
|
1906
|
+
onClick: t[9] || (t[9] = D(() => {
|
|
1788
1907
|
}, ["stop"]))
|
|
1789
1908
|
}, null, 544)), [
|
|
1790
1909
|
[$n, x.value]
|
|
1791
1910
|
]),
|
|
1792
|
-
|
|
1911
|
+
w.value ? (C(), E("span", {
|
|
1793
1912
|
key: 3,
|
|
1794
1913
|
class: "zm-order-badge",
|
|
1795
1914
|
title: `数据顺序:第 ${Wt(l.id) + 1} 个`
|
|
1796
|
-
}, be(Wt(l.id) + 1), 9,
|
|
1797
|
-
It(l.id) && !l.isRoot && ot(l.id) > 0 ? (
|
|
1915
|
+
}, be(Wt(l.id) + 1), 9, Ri)) : X("", !0),
|
|
1916
|
+
It(l.id) && !l.isRoot && ot(l.id) > 0 ? (C(), E("span", {
|
|
1798
1917
|
key: 4,
|
|
1799
1918
|
class: Ie(["zm-collapse-badge", { "is-on-left": l.side === -1 }]),
|
|
1800
|
-
style: ve({ background:
|
|
1919
|
+
style: ve({ background: ye.value.get(l.id) ?? "#64748b" }),
|
|
1801
1920
|
title: `展开 ${ot(l.id)} 个子节点`,
|
|
1802
|
-
onMousedown: t[10] || (t[10] =
|
|
1921
|
+
onMousedown: t[10] || (t[10] = D(() => {
|
|
1803
1922
|
}, ["stop"])),
|
|
1804
|
-
onClick:
|
|
1805
|
-
}, be(ot(l.id)), 47, Bi)) :
|
|
1806
|
-
!
|
|
1923
|
+
onClick: D((y) => Nt(l.id), ["stop"])
|
|
1924
|
+
}, be(ot(l.id)), 47, Bi)) : X("", !0),
|
|
1925
|
+
!i.readonly && !l.isRoot && En(l) && !It(l.id) ? (C(), E("button", {
|
|
1807
1926
|
key: 5,
|
|
1808
1927
|
class: Ie(["zm-btn zm-collapse", { "is-on-left": l.side === -1 }]),
|
|
1809
|
-
style: ve({ color:
|
|
1928
|
+
style: ve({ color: ye.value.get(l.id) ?? "#64748b", borderColor: ye.value.get(l.id) ?? "#64748b" }),
|
|
1810
1929
|
title: "折叠",
|
|
1811
|
-
onMousedown: t[11] || (t[11] =
|
|
1930
|
+
onMousedown: t[11] || (t[11] = D(() => {
|
|
1812
1931
|
}, ["stop"])),
|
|
1813
|
-
onClick:
|
|
1932
|
+
onClick: D((y) => Nt(l.id), ["stop"])
|
|
1814
1933
|
}, [
|
|
1815
|
-
|
|
1934
|
+
q(U, {
|
|
1816
1935
|
name: "minus",
|
|
1817
1936
|
size: 10,
|
|
1818
1937
|
stroke: 2.4
|
|
1819
1938
|
})
|
|
1820
|
-
], 46,
|
|
1821
|
-
l.image &&
|
|
1939
|
+
], 46, Li)) : X("", !0),
|
|
1940
|
+
l.image && f.value === l.id && d.value !== l.id ? (C(), E("span", {
|
|
1822
1941
|
key: 6,
|
|
1823
1942
|
class: "zm-img-resize-handle",
|
|
1824
1943
|
title: "拖动调整图片大小",
|
|
1825
|
-
onMousedown:
|
|
1826
|
-
}, null, 40, Ai)) :
|
|
1827
|
-
l.image &&
|
|
1944
|
+
onMousedown: D((y) => en(y, l), ["stop"])
|
|
1945
|
+
}, null, 40, Ai)) : X("", !0),
|
|
1946
|
+
l.image && f.value === l.id && d.value !== l.id ? (C(), E("button", {
|
|
1828
1947
|
key: 7,
|
|
1829
1948
|
class: "zm-img-remove-btn",
|
|
1830
1949
|
title: "移除图片",
|
|
1831
|
-
onMousedown: t[12] || (t[12] =
|
|
1950
|
+
onMousedown: t[12] || (t[12] = D(() => {
|
|
1832
1951
|
}, ["stop"])),
|
|
1833
|
-
onClick:
|
|
1952
|
+
onClick: D((y) => z(l.id), ["stop"])
|
|
1834
1953
|
}, [
|
|
1835
|
-
|
|
1954
|
+
q(U, {
|
|
1836
1955
|
name: "x",
|
|
1837
1956
|
size: 9,
|
|
1838
1957
|
stroke: 2.2
|
|
1839
1958
|
})
|
|
1840
|
-
], 40,
|
|
1959
|
+
], 40, Hi)) : X("", !0)
|
|
1841
1960
|
], 46, Si))), 128))
|
|
1842
1961
|
], 4),
|
|
1843
|
-
|
|
1962
|
+
R.value ? (C(), Rn(ki, {
|
|
1844
1963
|
key: 1,
|
|
1845
|
-
x:
|
|
1846
|
-
y:
|
|
1847
|
-
container:
|
|
1848
|
-
"has-image": !!((
|
|
1849
|
-
"has-link": !!((
|
|
1850
|
-
"has-note": !!((
|
|
1851
|
-
readonly:
|
|
1852
|
-
onPickImage:
|
|
1964
|
+
x: R.value.x,
|
|
1965
|
+
y: R.value.y,
|
|
1966
|
+
container: c.value,
|
|
1967
|
+
"has-image": !!((a = N(A)(u.value, R.value.nodeId)) != null && a.image),
|
|
1968
|
+
"has-link": !!((m = N(A)(u.value, R.value.nodeId)) != null && m.link),
|
|
1969
|
+
"has-note": !!((h = N(A)(u.value, R.value.nodeId)) != null && h.note),
|
|
1970
|
+
readonly: n.readonly,
|
|
1971
|
+
onPickImage: le,
|
|
1853
1972
|
onRemoveImage: Zt,
|
|
1854
|
-
onSetLink:
|
|
1973
|
+
onSetLink: re,
|
|
1855
1974
|
onRemoveLink: ke,
|
|
1856
|
-
onEditNote:
|
|
1975
|
+
onEditNote: Re,
|
|
1857
1976
|
onRemoveNote: Me,
|
|
1858
|
-
onClose:
|
|
1859
|
-
}, null, 8, ["x", "y", "container", "has-image", "has-link", "has-note", "readonly"])) :
|
|
1977
|
+
onClose: ne
|
|
1978
|
+
}, null, 8, ["x", "y", "container", "has-image", "has-link", "has-note", "readonly"])) : X("", !0)
|
|
1860
1979
|
], 544),
|
|
1861
|
-
|
|
1862
|
-
|
|
1980
|
+
n.previewMode ? X("", !0) : (C(), E("div", Di, [
|
|
1981
|
+
p("button", {
|
|
1863
1982
|
class: "zm-tb-btn",
|
|
1864
1983
|
title: "放大",
|
|
1865
1984
|
onClick: t[15] || (t[15] = //@ts-ignore
|
|
1866
|
-
(...l) =>
|
|
1985
|
+
(...l) => N(S).zoomIn && N(S).zoomIn(...l))
|
|
1867
1986
|
}, [
|
|
1868
|
-
|
|
1987
|
+
q(U, { name: "zoom-in" })
|
|
1869
1988
|
]),
|
|
1870
|
-
|
|
1989
|
+
p("button", {
|
|
1871
1990
|
class: "zm-tb-btn",
|
|
1872
1991
|
title: "缩小",
|
|
1873
1992
|
onClick: t[16] || (t[16] = //@ts-ignore
|
|
1874
|
-
(...l) =>
|
|
1993
|
+
(...l) => N(S).zoomOut && N(S).zoomOut(...l))
|
|
1875
1994
|
}, [
|
|
1876
|
-
|
|
1995
|
+
q(U, { name: "zoom-out" })
|
|
1877
1996
|
]),
|
|
1878
|
-
|
|
1997
|
+
p("button", {
|
|
1879
1998
|
class: "zm-tb-btn",
|
|
1880
1999
|
title: "重置视图",
|
|
1881
|
-
onClick:
|
|
2000
|
+
onClick: de
|
|
1882
2001
|
}, [
|
|
1883
|
-
|
|
2002
|
+
q(U, { name: "reset" })
|
|
1884
2003
|
]),
|
|
1885
|
-
t[22] || (t[22] =
|
|
1886
|
-
|
|
2004
|
+
t[22] || (t[22] = p("span", { class: "zm-tb-divider" }, null, -1)),
|
|
2005
|
+
i.readonly ? X("", !0) : (C(), E("button", {
|
|
1887
2006
|
key: 0,
|
|
1888
2007
|
class: "zm-tb-btn",
|
|
1889
2008
|
title: "添加子节点 (Tab)",
|
|
1890
|
-
onClick: t[17] || (t[17] = (l) =>
|
|
2009
|
+
onClick: t[17] || (t[17] = (l) => f.value && Ce(f.value))
|
|
1891
2010
|
}, [
|
|
1892
|
-
|
|
1893
|
-
src:
|
|
2011
|
+
p("img", {
|
|
2012
|
+
src: N(Dn),
|
|
1894
2013
|
width: "14",
|
|
1895
2014
|
height: "14",
|
|
1896
2015
|
alt: "添加子节点",
|
|
1897
2016
|
draggable: "false"
|
|
1898
|
-
}, null, 8,
|
|
2017
|
+
}, null, 8, Pi)
|
|
1899
2018
|
])),
|
|
1900
|
-
|
|
2019
|
+
i.readonly ? X("", !0) : (C(), E("button", {
|
|
1901
2020
|
key: 1,
|
|
1902
2021
|
class: "zm-tb-btn",
|
|
1903
2022
|
title: "添加同级 (Enter)",
|
|
1904
|
-
onClick: t[18] || (t[18] = (l) =>
|
|
2023
|
+
onClick: t[18] || (t[18] = (l) => f.value && Fe(f.value))
|
|
1905
2024
|
}, [
|
|
1906
|
-
|
|
1907
|
-
src:
|
|
2025
|
+
p("img", {
|
|
2026
|
+
src: N(Hn),
|
|
1908
2027
|
width: "14",
|
|
1909
2028
|
height: "14",
|
|
1910
2029
|
alt: "添加同级",
|
|
1911
2030
|
draggable: "false"
|
|
1912
|
-
}, null, 8,
|
|
2031
|
+
}, null, 8, Ti)
|
|
1913
2032
|
])),
|
|
1914
|
-
t[23] || (t[23] =
|
|
1915
|
-
|
|
2033
|
+
t[23] || (t[23] = p("span", { class: "zm-tb-divider" }, null, -1)),
|
|
2034
|
+
p("button", {
|
|
1916
2035
|
class: Ie(["zm-tb-btn", { active: k.layoutMode === "mindmap" }]),
|
|
1917
2036
|
title: "思维导图布局 (中心辐射)",
|
|
1918
2037
|
onClick: t[19] || (t[19] = (l) => lt("mindmap"))
|
|
1919
2038
|
}, [
|
|
1920
|
-
|
|
2039
|
+
q(U, { name: "mindmap" })
|
|
1921
2040
|
], 2),
|
|
1922
|
-
|
|
2041
|
+
p("button", {
|
|
1923
2042
|
class: Ie(["zm-tb-btn", { active: k.layoutMode === "tree" }]),
|
|
1924
2043
|
title: "树形布局 (向右展开)",
|
|
1925
2044
|
onClick: t[20] || (t[20] = (l) => lt("tree"))
|
|
1926
2045
|
}, [
|
|
1927
|
-
|
|
2046
|
+
q(U, { name: "tree" })
|
|
1928
2047
|
], 2),
|
|
1929
|
-
|
|
2048
|
+
p("button", {
|
|
1930
2049
|
class: Ie(["zm-tb-btn", { active: k.layoutMode === "org" }]),
|
|
1931
2050
|
title: "组织结构布局 (向下展开)",
|
|
1932
2051
|
onClick: t[21] || (t[21] = (l) => lt("org"))
|
|
1933
2052
|
}, [
|
|
1934
|
-
|
|
2053
|
+
q(U, { name: "org" })
|
|
1935
2054
|
], 2),
|
|
1936
|
-
t[24] || (t[24] =
|
|
1937
|
-
|
|
2055
|
+
t[24] || (t[24] = p("span", { class: "zm-tb-divider" }, null, -1)),
|
|
2056
|
+
i.readonly ? X("", !0) : (C(), E("button", {
|
|
1938
2057
|
key: 2,
|
|
1939
2058
|
class: "zm-tb-btn",
|
|
1940
2059
|
title: "导入 JSON",
|
|
1941
2060
|
onClick: zn
|
|
1942
2061
|
}, [
|
|
1943
|
-
|
|
2062
|
+
q(U, { name: "import" })
|
|
1944
2063
|
])),
|
|
1945
|
-
|
|
2064
|
+
p("button", {
|
|
1946
2065
|
class: "zm-tb-btn",
|
|
1947
2066
|
title: "导出 JSON",
|
|
1948
2067
|
onClick: Nn
|
|
1949
2068
|
}, [
|
|
1950
|
-
|
|
2069
|
+
q(U, { name: "export" })
|
|
1951
2070
|
]),
|
|
1952
|
-
|
|
2071
|
+
p("span", Oi, be(Math.round(N(S).scale.value * 100)) + "%", 1)
|
|
1953
2072
|
]))
|
|
1954
2073
|
], 4);
|
|
1955
2074
|
};
|
|
1956
2075
|
}
|
|
1957
|
-
}),
|
|
1958
|
-
install(
|
|
1959
|
-
|
|
2076
|
+
}), Ui = {
|
|
2077
|
+
install(i) {
|
|
2078
|
+
i.component("FlowMindMap", Fi);
|
|
1960
2079
|
}
|
|
1961
2080
|
};
|
|
1962
2081
|
export {
|
|
1963
|
-
|
|
2082
|
+
Fi as MindMap,
|
|
1964
2083
|
ai as addChild,
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
2084
|
+
si as addSibling,
|
|
2085
|
+
me as clone,
|
|
2086
|
+
Ui as default,
|
|
2087
|
+
A as findNode,
|
|
2088
|
+
ce as findParent,
|
|
1970
2089
|
Xt as markdownToMindMap,
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
2090
|
+
Xi as markdownToRichMindMap,
|
|
2091
|
+
ut as mindMapToMarkdown,
|
|
2092
|
+
jt as removeNode,
|
|
2093
|
+
qi as richBlockToMarkdown,
|
|
2094
|
+
ue as uid
|
|
1974
2095
|
};
|