@billtaofbj/mindmap 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -2,31 +2,61 @@ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r
2
2
  import { BrandWatermark as O } from "@billtaofbj/core";
3
3
  import { useRoute as k, useRouter as A } from "vue-router";
4
4
  import { ElMessage as j, ElMessageBox as M } from "element-plus";
5
- import { Aim as N, ArrowLeft as P, Bell as F, Brush as I, Check as L, Clock as R, Close as z, CopyDocument as B, Delete as V, Document as H, DocumentCopy as U, Download as W, Edit as G, FullScreen as K, Grid as q, InfoFilled as ee, Link as te, Loading as ne, Monitor as J, Picture as re, Plus as ie, Promotion as ae, Refresh as oe, RefreshLeft as se, RefreshRight as ce, Scissor as Y, Share as le, Switch as ue, ZoomIn as de, ZoomOut as fe } from "@element-plus/icons-vue";
6
- import X from "axios";
7
- import * as pe from "yjs";
8
- import { HocuspocusProvider as me } from "@hocuspocus/provider";
9
- //#region \0plugin-vue:export-helper
10
- var Z = (e, t) => {
5
+ import N from "axios";
6
+ import { Aim as P, ArrowLeft as F, Bell as I, Brush as L, Check as R, Clock as z, Close as B, CopyDocument as V, Delete as H, Document as U, DocumentCopy as W, Download as G, Edit as K, FullScreen as q, Grid as ee, InfoFilled as J, Link as Y, Loading as te, Monitor as X, Picture as Z, Plus as ne, Promotion as re, Refresh as ie, RefreshLeft as ae, RefreshRight as oe, Scissor as se, Share as ce, Switch as le, ZoomIn as ue, ZoomOut as de } from "@element-plus/icons-vue";
7
+ import * as fe from "yjs";
8
+ import { HocuspocusProvider as pe } from "@hocuspocus/provider";
9
+ N.create({
10
+ baseURL: "/api",
11
+ timeout: 3e4
12
+ });
13
+ function me(e = "/api") {
14
+ let t = N.create({
15
+ baseURL: e,
16
+ timeout: 3e4
17
+ });
18
+ return {
19
+ list: (e) => t.get("/documents/", { params: e }),
20
+ get: (e) => t.get(`/documents/${e}`),
21
+ create: (e) => t.post("/documents/", e),
22
+ update: (e, n) => t.put(`/documents/${e}`, n),
23
+ delete: (e) => t.delete(`/documents/${e}`),
24
+ addAttachment: (e, n) => t.post(`/documents/${e}/attachments`, n),
25
+ listAttachments: (e) => t.get(`/documents/${e}/attachments`)
26
+ };
27
+ }
28
+ function he(e = "/api") {
29
+ let t = N.create({
30
+ baseURL: e,
31
+ timeout: 3e4
32
+ });
33
+ return {
34
+ get: (e) => t.get(`/questionnaires/${e}`),
35
+ create: (e) => t.post("/questionnaires/", e),
36
+ update: (e, n) => t.put(`/questionnaires/${e}`, n)
37
+ };
38
+ }
39
+ he("/api");
40
+ var ge = me("/api"), Q = (e, t) => {
11
41
  let n = e.__vccOpts || e;
12
42
  for (let [e, r] of t) n[e] = r;
13
43
  return n;
14
- }, Q = { class: "chat-header" }, he = { class: "chat-header-left" }, ge = { class: "chat-title" }, _e = { class: "online-users-list" }, $ = { class: "online-user-item" }, ve = { class: "online-user-name" }, ye = { key: 1 }, be = { class: "online-user-name" }, xe = { class: "chat-header-right" }, Se = {
44
+ }, _e = { class: "chat-header" }, ve = { class: "chat-header-left" }, ye = { class: "chat-title" }, $ = { class: "online-users-list" }, be = { class: "online-user-item" }, xe = { class: "online-user-name" }, Se = { key: 1 }, Ce = { class: "online-user-name" }, we = { class: "chat-header-right" }, Te = {
15
45
  key: 0,
16
46
  class: "chat-empty"
17
- }, Ce = { class: "chat-empty-hint" }, we = { key: 1 }, Te = { class: "message-content" }, Ee = {
47
+ }, Ee = { class: "chat-empty-hint" }, De = { key: 1 }, Oe = { class: "message-content" }, ke = {
18
48
  key: 0,
19
49
  class: "message-meta"
20
- }, De = {
50
+ }, Ae = {
21
51
  key: 0,
22
52
  class: "message-mention"
23
- }, Oe = ["innerHTML"], ke = { class: "message-time" }, Ae = {
53
+ }, je = ["innerHTML"], Me = { class: "message-time" }, Ne = {
24
54
  key: 1,
25
55
  class: "chat-message chat-message-ai"
26
- }, je = { class: "message-avatar ai" }, Me = { class: "chat-input-area" }, Ne = {
56
+ }, Pe = { class: "message-avatar ai" }, Fe = { class: "chat-input-area" }, Ie = {
27
57
  key: 0,
28
58
  class: "mention-popup"
29
- }, Pe = ["onClick", "onMouseenter"], Fe = { key: 1 }, Ie = /*#__PURE__*/ Z({
59
+ }, Le = ["onClick", "onMouseenter"], Re = { key: 1 }, ze = /*#__PURE__*/ Q({
30
60
  __name: "AiChatPanel",
31
61
  props: {
32
62
  visible: {
@@ -90,7 +120,7 @@ var Z = (e, t) => {
90
120
  let i = String(r || n.name || "");
91
121
  return t.has(i) ? !1 : (t.add(i), !0);
92
122
  })];
93
- }), I = t(() => P.value.length + 1), L = (e) => e.role === "ai" ? "chat-message-ai" : p.isCollab && e.user_id && e.user_id !== p.currentUser.id ? "chat-message-other" : "chat-message-user", R = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" }, B = (e) => (e.user_name || "U").charAt(0), H = (e) => {
123
+ }), F = t(() => P.value.length + 1), L = (e) => e.role === "ai" ? "chat-message-ai" : p.isCollab && e.user_id && e.user_id !== p.currentUser.id ? "chat-message-other" : "chat-message-user", R = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" }, z = (e) => (e.user_name || "U").charAt(0), V = (e) => {
94
124
  if (!p.isCollab) return;
95
125
  let t = typeof e == "string" ? e : e.target?.value || h.value, n = t.length, r = t.lastIndexOf("@", n);
96
126
  if (r !== -1 && r < n) {
@@ -140,15 +170,15 @@ var Z = (e, t) => {
140
170
  class: "ai-chat-panel",
141
171
  style: f({ width: c.panelWidth + "px" })
142
172
  }, [
143
- a("div", Q, [a("div", he, [
173
+ a("div", _e, [a("div", ve, [
144
174
  s(u, {
145
175
  size: 18,
146
176
  color: "#409EFF"
147
177
  }, {
148
- default: w(() => [s(x(J))]),
178
+ default: w(() => [s(x(X))]),
149
179
  _: 1
150
180
  }),
151
- a("span", ge, b(c.isCollab ? "协作聊天" : "AI 助手"), 1),
181
+ a("span", ye, b(c.isCollab ? "协作聊天" : "AI 助手"), 1),
152
182
  c.isCollab ? (g(), n(_, {
153
183
  key: 0,
154
184
  width: 200,
@@ -161,15 +191,15 @@ var Z = (e, t) => {
161
191
  effect: "plain",
162
192
  class: "online-tag"
163
193
  }, {
164
- default: w(() => [o(b(I.value) + "人在线 ", 1)]),
194
+ default: w(() => [o(b(F.value) + "人在线 ", 1)]),
165
195
  _: 1
166
196
  })]),
167
- default: w(() => [a("div", _e, [a("div", $, [
197
+ default: w(() => [a("div", $, [a("div", be, [
168
198
  a("div", {
169
199
  class: "online-user-avatar",
170
200
  style: f({ background: c.currentUser.color || "#409EFF" })
171
201
  }, b((c.currentUser.name || "U").charAt(0)), 5),
172
- a("span", ve, b(c.currentUser.name || "我"), 1),
202
+ a("span", xe, b(c.currentUser.name || "我"), 1),
173
203
  s(p, {
174
204
  size: "small",
175
205
  type: c.isOwner ? "warning" : "success",
@@ -191,10 +221,10 @@ var Z = (e, t) => {
191
221
  key: 0,
192
222
  size: 14
193
223
  }, {
194
- default: w(() => [s(x(J))]),
224
+ default: w(() => [s(x(X))]),
195
225
  _: 1
196
- })) : (g(), i("span", ye, b((e.name || "U").charAt(0)), 1))], 4),
197
- a("span", be, b(e.name || "未知用户"), 1),
226
+ })) : (g(), i("span", Se, b((e.name || "U").charAt(0)), 1))], 4),
227
+ a("span", Ce, b(e.name || "未知用户"), 1),
198
228
  e.isAi ? (g(), n(p, {
199
229
  key: 0,
200
230
  size: "small",
@@ -217,7 +247,7 @@ var Z = (e, t) => {
217
247
  ]))), 128))])]),
218
248
  _: 1
219
249
  })) : r("", !0)
220
- ]), a("div", xe, [
250
+ ]), a("div", we, [
221
251
  c.isCollab && c.unreadMention ? (g(), i("div", {
222
252
  key: 0,
223
253
  class: "mention-bell",
@@ -227,7 +257,7 @@ var Z = (e, t) => {
227
257
  size: 18,
228
258
  color: "#F56C6C"
229
259
  }, {
230
- default: w(() => [s(x(F))]),
260
+ default: w(() => [s(x(I))]),
231
261
  _: 1
232
262
  })])) : r("", !0),
233
263
  s(C, {
@@ -238,7 +268,7 @@ var Z = (e, t) => {
238
268
  title: "清空对话"
239
269
  }, {
240
270
  default: w(() => [s(u, null, {
241
- default: w(() => [s(x(V))]),
271
+ default: w(() => [s(x(H))]),
242
272
  _: 1
243
273
  })]),
244
274
  _: 1
@@ -251,7 +281,7 @@ var Z = (e, t) => {
251
281
  title: "关闭"
252
282
  }, {
253
283
  default: w(() => [s(u, null, {
254
- default: w(() => [s(x(z))]),
284
+ default: w(() => [s(x(B))]),
255
285
  _: 1
256
286
  })]),
257
287
  _: 1
@@ -262,16 +292,16 @@ var Z = (e, t) => {
262
292
  ref_key: "messagesRef",
263
293
  ref: S
264
294
  }, [
265
- c.messages.length === 0 ? (g(), i("div", Se, [
295
+ c.messages.length === 0 ? (g(), i("div", Te, [
266
296
  s(u, {
267
297
  size: 40,
268
298
  color: "#c0c4cc"
269
299
  }, {
270
- default: w(() => [s(x(J))]),
300
+ default: w(() => [s(x(X))]),
271
301
  _: 1
272
302
  }),
273
303
  a("p", null, b(c.isCollab ? "协作聊天室" : "你好!我是 AI 助手"), 1),
274
- a("p", Ce, b(c.isCollab ? "与团队成员和AI助手实时聊天" : "可以问我任何关于文档编辑的问题"), 1)
304
+ a("p", Ee, b(c.isCollab ? "与团队成员和AI助手实时聊天" : "可以问我任何关于文档编辑的问题"), 1)
275
305
  ])) : r("", !0),
276
306
  (g(!0), i(e, null, v(c.messages, (e) => (g(), i("div", {
277
307
  key: e._msgId || e.time + e.content,
@@ -283,21 +313,21 @@ var Z = (e, t) => {
283
313
  key: 0,
284
314
  size: 16
285
315
  }, {
286
- default: w(() => [s(x(J))]),
316
+ default: w(() => [s(x(X))]),
287
317
  _: 1
288
- })) : (g(), i("span", we, b(B(e)), 1))], 4), a("div", Te, [
289
- c.isCollab && e.role === "user" ? (g(), i("div", Ee, [a("span", {
318
+ })) : (g(), i("span", De, b(z(e)), 1))], 4), a("div", Oe, [
319
+ c.isCollab && e.role === "user" ? (g(), i("div", ke, [a("span", {
290
320
  class: "message-sender",
291
321
  style: f({ color: e.user_color || "#67C23A" })
292
- }, b(e.user_name || "用户"), 5), e.mentioned_user ? (g(), i("span", De, "@" + b(e.mentioned_user), 1)) : r("", !0)])) : r("", !0),
322
+ }, b(e.user_name || "用户"), 5), e.mentioned_user ? (g(), i("span", Ae, "@" + b(e.mentioned_user), 1)) : r("", !0)])) : r("", !0),
293
323
  a("div", {
294
324
  class: "message-text",
295
325
  innerHTML: e.content
296
- }, null, 8, Oe),
297
- a("div", ke, b(e.time), 1)
326
+ }, null, 8, je),
327
+ a("div", Me, b(e.time), 1)
298
328
  ])], 2))), 128)),
299
- c.loading ? (g(), i("div", Ae, [a("div", je, [s(u, { size: 16 }, {
300
- default: w(() => [s(x(J))]),
329
+ c.loading ? (g(), i("div", Ne, [a("div", Pe, [s(u, { size: 16 }, {
330
+ default: w(() => [s(x(X))]),
301
331
  _: 1
302
332
  })]), l[7] ||= a("div", { class: "message-content" }, [a("div", { class: "message-text typing-indicator" }, [
303
333
  a("span"),
@@ -305,7 +335,7 @@ var Z = (e, t) => {
305
335
  a("span")
306
336
  ])], -1)])) : r("", !0)
307
337
  ], 512),
308
- a("div", Me, [a("div", {
338
+ a("div", Fe, [a("div", {
309
339
  class: "chat-input-wrapper",
310
340
  ref_key: "inputWrapperRef",
311
341
  ref: T
@@ -324,14 +354,14 @@ var Z = (e, t) => {
324
354
  E(D(U, ["prevent"]), ["down"]),
325
355
  E(D(W, ["prevent"]), ["up"])
326
356
  ],
327
- onInput: H,
357
+ onInput: V,
328
358
  resize: "none"
329
359
  }, null, 8, [
330
360
  "modelValue",
331
361
  "placeholder",
332
362
  "onKeydown"
333
363
  ]),
334
- O.value ? (g(), i("div", Ne, [(g(!0), i(e, null, v(k.value, (e, t) => (g(), i("div", {
364
+ O.value ? (g(), i("div", Ie, [(g(!0), i(e, null, v(k.value, (e, t) => (g(), i("div", {
335
365
  key: e.id || e.clientId,
336
366
  class: d(["mention-item", { active: t === A.value }]),
337
367
  onClick: (t) => G(e),
@@ -343,9 +373,9 @@ var Z = (e, t) => {
343
373
  key: 0,
344
374
  size: 12
345
375
  }, {
346
- default: w(() => [s(x(J))]),
376
+ default: w(() => [s(x(X))]),
347
377
  _: 1
348
- })) : (g(), i("span", Fe, b((e.name || "U").charAt(0)), 1))], 4), a("span", null, b(e.name), 1)], 42, Pe))), 128))])) : r("", !0),
378
+ })) : (g(), i("span", Re, b((e.name || "U").charAt(0)), 1))], 4), a("span", null, b(e.name), 1)], 42, Le))), 128))])) : r("", !0),
349
379
  s(C, {
350
380
  class: "send-btn",
351
381
  type: "primary",
@@ -354,7 +384,7 @@ var Z = (e, t) => {
354
384
  onClick: K
355
385
  }, {
356
386
  default: w(() => [s(u, null, {
357
- default: w(() => [s(x(ae))]),
387
+ default: w(() => [s(x(re))]),
358
388
  _: 1
359
389
  })]),
360
390
  _: 1
@@ -366,7 +396,7 @@ var Z = (e, t) => {
366
396
  }, [["__scopeId", "data-v-01960100"]]);
367
397
  //#endregion
368
398
  //#region ../../src/composables/useChat.js
369
- function Le() {
399
+ function Be() {
370
400
  let e = _([]), t = _(!1), n = _(!1), r = _([]), i = _({
371
401
  id: "",
372
402
  name: "",
@@ -422,7 +452,7 @@ function Le() {
422
452
  console.warn("[useChat] Failed to push to Y.Array:", e);
423
453
  }
424
454
  if (r.roomId) try {
425
- await X.post(u, {
455
+ await N.post(u, {
426
456
  room_id: r.roomId,
427
457
  role: "user",
428
458
  content: t,
@@ -448,7 +478,7 @@ function Le() {
448
478
  console.warn("[useChat] Failed to push AI message to Y.Array:", e);
449
479
  }
450
480
  if (r) try {
451
- await X.post(u, {
481
+ await N.post(u, {
452
482
  room_id: r,
453
483
  role: "ai",
454
484
  content: t,
@@ -460,7 +490,7 @@ function Le() {
460
490
  }
461
491
  }, b = async (t) => {
462
492
  if (t) try {
463
- let n = await X.get(u, { params: { room_id: t } });
493
+ let n = await N.get(u, { params: { room_id: t } });
464
494
  if (Array.isArray(n.data)) {
465
495
  let t = n.data.map((e) => ({
466
496
  _msgId: e._msgId || `hist-${e.id || Date.now()}`,
@@ -479,7 +509,7 @@ function Le() {
479
509
  }
480
510
  }, S = async (t) => {
481
511
  if (e.value = [], l.clear(), t) try {
482
- await X.delete(u, { params: { room_id: t } });
512
+ await N.delete(u, { params: { room_id: t } });
483
513
  } catch (e) {
484
514
  console.warn("[useChat] Failed to clear messages on server:", e);
485
515
  }
@@ -514,7 +544,7 @@ function Le() {
514
544
  }
515
545
  //#endregion
516
546
  //#region ../../src/composables/useVersionHistory.js
517
- var Re = "/api/document-versions", ze = 5e3, Be = () => {
547
+ var Ve = "/api/document-versions", He = 5e3, Ue = () => {
518
548
  let e = _([]), t = _(!1);
519
549
  return {
520
550
  versions: e,
@@ -522,13 +552,13 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
522
552
  saveVersion: async ({ documentId: e, docType: t, content: n, userId: r, userName: i }) => {
523
553
  if (!e || !t || !n) return null;
524
554
  try {
525
- let { data: a } = await X.post(Re, {
555
+ let { data: a } = await N.post(Ve, {
526
556
  document_id: e,
527
557
  doc_type: t,
528
558
  content: typeof n == "string" ? n : JSON.stringify(n),
529
559
  user_id: r || null,
530
560
  user_name: i || null
531
- }, { timeout: ze });
561
+ }, { timeout: He });
532
562
  return a;
533
563
  } catch (e) {
534
564
  return console.warn("[useVersionHistory] Failed to save version:", e), null;
@@ -538,9 +568,9 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
538
568
  if (!n) return [];
539
569
  t.value = !0;
540
570
  try {
541
- let { data: t } = await X.get(Re, {
571
+ let { data: t } = await N.get(Ve, {
542
572
  params: { document_id: n },
543
- timeout: ze
573
+ timeout: He
544
574
  });
545
575
  return e.value = t, t;
546
576
  } catch (t) {
@@ -551,26 +581,26 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
551
581
  },
552
582
  getVersionContent: async (e) => {
553
583
  try {
554
- let { data: t } = await X.get(`${Re}/${e}`, { timeout: ze });
584
+ let { data: t } = await N.get(`${Ve}/${e}`, { timeout: He });
555
585
  return t;
556
586
  } catch (e) {
557
587
  return console.warn("[useVersionHistory] Failed to get version content:", e), null;
558
588
  }
559
589
  }
560
590
  };
561
- }, Ve = { class: "version-history-panel" }, He = {
591
+ }, We = { class: "version-history-panel" }, Ge = {
562
592
  key: 0,
563
593
  class: "loading-state"
564
- }, Ue = {
594
+ }, Ke = {
565
595
  key: 1,
566
596
  class: "empty-state"
567
- }, We = {
597
+ }, qe = {
568
598
  key: 2,
569
599
  class: "version-list"
570
- }, Ge = {
600
+ }, Je = {
571
601
  key: 0,
572
602
  class: "current-version"
573
- }, Ke = { class: "current-version-header" }, qe = { class: "version-number" }, Je = ["onClick"], Ye = { class: "version-number" }, Xe = { class: "version-user" }, Ze = { class: "panel-footer" }, Qe = /*#__PURE__*/ Z({
603
+ }, Ye = { class: "current-version-header" }, Xe = { class: "version-number" }, Ze = ["onClick"], Qe = { class: "version-number" }, $e = { class: "version-user" }, et = { class: "panel-footer" }, tt = /*#__PURE__*/ Q({
574
604
  __name: "VersionHistoryPanel",
575
605
  props: {
576
606
  modelValue: {
@@ -584,7 +614,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
584
614
  },
585
615
  emits: ["update:modelValue", "apply"],
586
616
  setup(t, { expose: c, emit: l }) {
587
- let u = t, f = l, { versions: p, loading: m, loadVersions: h, getVersionContent: S } = Be(), T = _(!1), E = _(null), D = _(!1), O = _(null);
617
+ let u = t, f = l, { versions: p, loading: m, loadVersions: h, getVersionContent: S } = Ue(), T = _(!1), E = _(null), D = _(!1), O = _(null);
588
618
  C(() => u.modelValue, (e) => {
589
619
  T.value = e, e && u.documentId && (E.value = null, h(u.documentId).then((e) => {
590
620
  e && e.length > 0 && (O.value = e[0]);
@@ -621,7 +651,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
621
651
  size: "420px",
622
652
  "before-close": M
623
653
  }, {
624
- footer: w(() => [a("div", Ze, [s(_, {
654
+ footer: w(() => [a("div", et, [s(_, {
625
655
  type: "primary",
626
656
  disabled: !E.value,
627
657
  loading: D.value,
@@ -630,22 +660,22 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
630
660
  default: w(() => [...c[4] ||= [o(" 切换到此版本 ", -1)]]),
631
661
  _: 1
632
662
  }, 8, ["disabled", "loading"])])]),
633
- default: w(() => [a("div", Ve, [x(m) ? (g(), i("div", He, [s(l, { class: "is-loading" }, {
634
- default: w(() => [s(x(ne))]),
663
+ default: w(() => [a("div", We, [x(m) ? (g(), i("div", Ge, [s(l, { class: "is-loading" }, {
664
+ default: w(() => [s(x(te))]),
635
665
  _: 1
636
- }), c[1] ||= a("span", null, "加载中...", -1)])) : x(p).length === 0 ? (g(), i("div", Ue, [s(l, {
666
+ }), c[1] ||= a("span", null, "加载中...", -1)])) : x(p).length === 0 ? (g(), i("div", Ke, [s(l, {
637
667
  size: 48,
638
668
  color: "#c0c4cc"
639
669
  }, {
640
- default: w(() => [s(x(R))]),
670
+ default: w(() => [s(x(z))]),
641
671
  _: 1
642
- }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (g(), i("div", We, [O.value ? (g(), i("div", Ge, [a("div", Ke, [s(u, {
672
+ }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (g(), i("div", qe, [O.value ? (g(), i("div", Je, [a("div", Ye, [s(u, {
643
673
  type: "success",
644
674
  size: "small"
645
675
  }, {
646
676
  default: w(() => [...c[3] ||= [o("当前版本", -1)]]),
647
677
  _: 1
648
- }), a("span", qe, "v" + b(O.value.version_number), 1)])])) : r("", !0), s(h, null, {
678
+ }), a("span", Xe, "v" + b(O.value.version_number), 1)])])) : r("", !0), s(h, null, {
649
679
  default: w(() => [(g(!0), i(e, null, v(x(p), (e) => (g(), n(f, {
650
680
  key: e.id,
651
681
  timestamp: N(e.created_at),
@@ -656,7 +686,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
656
686
  default: w(() => [a("div", {
657
687
  class: d(["version-item", { active: E.value?.id === e.id }]),
658
688
  onClick: (t) => k(e)
659
- }, [a("span", Ye, "版本号:v" + b(e.version_number), 1), a("span", Xe, "提交人:" + b(e.user_name || "未知用户"), 1)], 10, Je)]),
689
+ }, [a("span", Qe, "版本号:v" + b(e.version_number), 1), a("span", $e, "提交人:" + b(e.user_name || "未知用户"), 1)], 10, Ze)]),
660
690
  _: 2
661
691
  }, 1032, [
662
692
  "timestamp",
@@ -669,7 +699,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
669
699
  }, 8, ["modelValue"]);
670
700
  };
671
701
  }
672
- }, [["__scopeId", "data-v-87924b7c"]]), $e = [
702
+ }, [["__scopeId", "data-v-87924b7c"]]), nt = [
673
703
  {
674
704
  label: "默认",
675
705
  value: "default",
@@ -1207,13 +1237,13 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1207
1237
  node: { color: "#333" }
1208
1238
  }
1209
1239
  }
1210
- ], et = { class: "toolbar-left" }, tt = { class: "toolbar-center" }, nt = { class: "option-list" }, rt = ["onClick"], it = { class: "theme-picker" }, at = { class: "theme-header" }, ot = { class: "theme-count" }, st = { class: "theme-grid" }, ct = ["onClick", "title"], lt = { class: "theme-name" }, ut = { class: "zoom-value" }, dt = { class: "toolbar-right" }, ft = {
1240
+ ], rt = { class: "toolbar-left" }, it = { class: "toolbar-center" }, at = { class: "option-list" }, ot = ["onClick"], st = { class: "theme-picker" }, ct = { class: "theme-header" }, lt = { class: "theme-count" }, ut = { class: "theme-grid" }, dt = ["onClick", "title"], ft = { class: "theme-name" }, pt = { class: "zoom-value" }, mt = { class: "toolbar-right" }, ht = {
1211
1241
  key: 0,
1212
1242
  class: "collab-users"
1213
- }, pt = ["title"], mt = {
1243
+ }, gt = ["title"], _t = {
1214
1244
  key: 0,
1215
1245
  class: "collab-more"
1216
- }, ht = /*#__PURE__*/ Z({
1246
+ }, vt = /*#__PURE__*/ Q({
1217
1247
  __name: "MindMapToolbar",
1218
1248
  props: {
1219
1249
  undoCount: {
@@ -1267,6 +1297,18 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1267
1297
  showHistory: {
1268
1298
  type: Boolean,
1269
1299
  default: !1
1300
+ },
1301
+ backButton: {
1302
+ type: String,
1303
+ default: "show"
1304
+ },
1305
+ titleEditable: {
1306
+ type: Boolean,
1307
+ default: !0
1308
+ },
1309
+ authorEditable: {
1310
+ type: Boolean,
1311
+ default: !0
1270
1312
  }
1271
1313
  },
1272
1314
  emits: [
@@ -1353,26 +1395,28 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1353
1395
  label: "鱼骨图2",
1354
1396
  value: "fishbone2"
1355
1397
  }
1356
- ], k = $e;
1398
+ ], k = nt;
1357
1399
  return (c, u) => {
1358
- let p = y("el-icon"), _ = y("el-button"), C = y("el-input"), A = y("el-divider"), j = y("el-popover"), M = y("el-dropdown-item"), F = y("el-dropdown-menu"), R = y("el-dropdown"), z = y("Clock"), U = y("el-dialog");
1400
+ let p = y("el-icon"), _ = y("el-button"), C = y("el-input"), A = y("el-divider"), j = y("el-popover"), M = y("el-dropdown-item"), N = y("el-dropdown-menu"), I = y("el-dropdown"), z = y("Clock"), B = y("el-dialog");
1359
1401
  return g(), i(e, null, [a("div", {
1360
1402
  class: "mindmap-toolbar",
1361
1403
  onMousedown: l
1362
1404
  }, [
1363
- a("div", et, [
1364
- s(_, {
1405
+ a("div", rt, [
1406
+ t.backButton === "hide" ? r("", !0) : (g(), n(_, {
1407
+ key: 0,
1365
1408
  size: "small",
1366
1409
  circle: "",
1410
+ disabled: t.backButton === "disable",
1367
1411
  onClick: u[0] ||= (e) => c.$emit("back"),
1368
1412
  title: "返回"
1369
1413
  }, {
1370
1414
  default: w(() => [s(p, null, {
1371
- default: w(() => [s(x(P))]),
1415
+ default: w(() => [s(x(F))]),
1372
1416
  _: 1
1373
1417
  })]),
1374
1418
  _: 1
1375
- }),
1419
+ }, 8, ["disabled"])),
1376
1420
  s(C, {
1377
1421
  modelValue: m.value,
1378
1422
  "onUpdate:modelValue": u[1] ||= (e) => m.value = e,
@@ -1380,7 +1424,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1380
1424
  placeholder: "思维导图标题 *",
1381
1425
  size: "small",
1382
1426
  style: { width: "200px" },
1383
- disabled: t.isCollaborating && !t.isCollabOwner,
1427
+ disabled: t.isCollaborating && !t.isCollabOwner || !t.titleEditable,
1384
1428
  required: ""
1385
1429
  }, null, 8, ["modelValue", "disabled"]),
1386
1430
  s(C, {
@@ -1390,10 +1434,11 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1390
1434
  placeholder: "作者 *",
1391
1435
  size: "small",
1392
1436
  style: { width: "120px" },
1437
+ disabled: !t.authorEditable,
1393
1438
  required: ""
1394
- }, null, 8, ["modelValue"])
1439
+ }, null, 8, ["modelValue", "disabled"])
1395
1440
  ]),
1396
- a("div", tt, [
1441
+ a("div", it, [
1397
1442
  s(_, {
1398
1443
  size: "small",
1399
1444
  circle: "",
@@ -1402,7 +1447,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1402
1447
  title: "撤销"
1403
1448
  }, {
1404
1449
  default: w(() => [s(p, null, {
1405
- default: w(() => [s(x(se))]),
1450
+ default: w(() => [s(x(ae))]),
1406
1451
  _: 1
1407
1452
  })]),
1408
1453
  _: 1
@@ -1415,7 +1460,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1415
1460
  title: "重做"
1416
1461
  }, {
1417
1462
  default: w(() => [s(p, null, {
1418
- default: w(() => [s(x(ce))]),
1463
+ default: w(() => [s(x(oe))]),
1419
1464
  _: 1
1420
1465
  })]),
1421
1466
  _: 1
@@ -1444,7 +1489,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1444
1489
  title: "插入子节点"
1445
1490
  }, {
1446
1491
  default: w(() => [s(p, null, {
1447
- default: w(() => [s(x(ie))]),
1492
+ default: w(() => [s(x(ne))]),
1448
1493
  _: 1
1449
1494
  })]),
1450
1495
  _: 1
@@ -1457,7 +1502,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1457
1502
  disabled: t.isRootNode
1458
1503
  }, {
1459
1504
  default: w(() => [s(p, null, {
1460
- default: w(() => [s(x(B))]),
1505
+ default: w(() => [s(x(V))]),
1461
1506
  _: 1
1462
1507
  })]),
1463
1508
  _: 1
@@ -1470,7 +1515,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1470
1515
  disabled: t.isCollaborating && !t.isCollabOwner
1471
1516
  }, {
1472
1517
  default: w(() => [s(p, null, {
1473
- default: w(() => [s(x(ue))]),
1518
+ default: w(() => [s(x(le))]),
1474
1519
  _: 1
1475
1520
  })]),
1476
1521
  _: 1
@@ -1482,7 +1527,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1482
1527
  title: "删除节点"
1483
1528
  }, {
1484
1529
  default: w(() => [s(p, null, {
1485
- default: w(() => [s(x(V))]),
1530
+ default: w(() => [s(x(H))]),
1486
1531
  _: 1
1487
1532
  })]),
1488
1533
  _: 1
@@ -1500,16 +1545,16 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1500
1545
  disabled: t.isCollaborating && !t.isCollabOwner
1501
1546
  }, {
1502
1547
  default: w(() => [s(p, null, {
1503
- default: w(() => [s(x(q))]),
1548
+ default: w(() => [s(x(ee))]),
1504
1549
  _: 1
1505
1550
  })]),
1506
1551
  _: 1
1507
1552
  }, 8, ["disabled"])]),
1508
- default: w(() => [a("div", nt, [(g(), i(e, null, v(O, (e) => a("div", {
1553
+ default: w(() => [a("div", at, [(g(), i(e, null, v(O, (e) => a("div", {
1509
1554
  key: e.value,
1510
1555
  class: d(["option-item", { active: t.currentLayout === e.value }]),
1511
1556
  onClick: (t) => c.$emit("change-layout", e.value)
1512
- }, b(e.label), 11, rt)), 64))])]),
1557
+ }, b(e.label), 11, ot)), 64))])]),
1513
1558
  _: 1
1514
1559
  }),
1515
1560
  s(j, {
@@ -1524,12 +1569,12 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1524
1569
  disabled: t.isCollaborating && !t.isCollabOwner
1525
1570
  }, {
1526
1571
  default: w(() => [s(p, null, {
1527
- default: w(() => [s(x(I))]),
1572
+ default: w(() => [s(x(L))]),
1528
1573
  _: 1
1529
1574
  })]),
1530
1575
  _: 1
1531
1576
  }, 8, ["disabled"])]),
1532
- default: w(() => [a("div", it, [a("div", at, [u[25] ||= a("h4", null, "选择主题", -1), a("span", ot, b(x(k).length) + " 种配色", 1)]), a("div", st, [(g(!0), i(e, null, v(x(k), (e) => (g(), i("div", {
1577
+ default: w(() => [a("div", st, [a("div", ct, [u[25] ||= a("h4", null, "选择主题", -1), a("span", lt, b(x(k).length) + " 种配色", 1)]), a("div", ut, [(g(!0), i(e, null, v(x(k), (e) => (g(), i("div", {
1533
1578
  key: e.value,
1534
1579
  class: d(["theme-item", { active: t.currentTheme === e.value }]),
1535
1580
  onClick: (t) => c.$emit("change-theme", e.value),
@@ -1541,7 +1586,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1541
1586
  }, [a("div", {
1542
1587
  class: "theme-line",
1543
1588
  style: f({ background: e.config?.root?.fillColor || "#549688" })
1544
- }, null, 4)], 4), a("span", lt, b(e.label), 1)], 42, ct))), 128))])])]),
1589
+ }, null, 4)], 4), a("span", ft, b(e.label), 1)], 42, dt))), 128))])])]),
1545
1590
  _: 1
1546
1591
  }),
1547
1592
  s(A, { direction: "vertical" }),
@@ -1552,12 +1597,12 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1552
1597
  title: "放大"
1553
1598
  }, {
1554
1599
  default: w(() => [s(p, null, {
1555
- default: w(() => [s(x(de))]),
1600
+ default: w(() => [s(x(ue))]),
1556
1601
  _: 1
1557
1602
  })]),
1558
1603
  _: 1
1559
1604
  }),
1560
- a("span", ut, b(t.zoomPercent) + "%", 1),
1605
+ a("span", pt, b(t.zoomPercent) + "%", 1),
1561
1606
  s(_, {
1562
1607
  size: "small",
1563
1608
  circle: "",
@@ -1565,7 +1610,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1565
1610
  title: "缩小"
1566
1611
  }, {
1567
1612
  default: w(() => [s(p, null, {
1568
- default: w(() => [s(x(fe))]),
1613
+ default: w(() => [s(x(de))]),
1569
1614
  _: 1
1570
1615
  })]),
1571
1616
  _: 1
@@ -1577,7 +1622,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1577
1622
  title: "适应画布"
1578
1623
  }, {
1579
1624
  default: w(() => [s(p, null, {
1580
- default: w(() => [s(x(K))]),
1625
+ default: w(() => [s(x(q))]),
1581
1626
  _: 1
1582
1627
  })]),
1583
1628
  _: 1
@@ -1590,7 +1635,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1590
1635
  title: "自动适应画布"
1591
1636
  }, {
1592
1637
  default: w(() => [s(p, null, {
1593
- default: w(() => [s(x(N))]),
1638
+ default: w(() => [s(x(P))]),
1594
1639
  _: 1
1595
1640
  })]),
1596
1641
  _: 1
@@ -1603,19 +1648,19 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1603
1648
  disabled: t.isCollaborating && !t.isCollabOwner
1604
1649
  }, {
1605
1650
  default: w(() => [s(p, null, {
1606
- default: w(() => [s(x(oe))]),
1651
+ default: w(() => [s(x(ie))]),
1607
1652
  _: 1
1608
1653
  })]),
1609
1654
  _: 1
1610
1655
  }, 8, ["disabled"])
1611
1656
  ]),
1612
- a("div", dt, [
1613
- t.collabUsers.length > 0 ? (g(), i("div", ft, [(g(!0), i(e, null, v(t.collabUsers.slice(0, 5), (e) => (g(), i("div", {
1657
+ a("div", mt, [
1658
+ t.collabUsers.length > 0 ? (g(), i("div", ht, [(g(!0), i(e, null, v(t.collabUsers.slice(0, 5), (e) => (g(), i("div", {
1614
1659
  key: e.clientId,
1615
1660
  class: "collab-avatar",
1616
1661
  style: f({ background: e.color }),
1617
1662
  title: e.name
1618
- }, b(e.name?.charAt(0)), 13, pt))), 128)), t.collabUsers.length > 5 ? (g(), i("span", mt, "+" + b(t.collabUsers.length - 5), 1)) : r("", !0)])) : r("", !0),
1663
+ }, b(e.name?.charAt(0)), 13, gt))), 128)), t.collabUsers.length > 5 ? (g(), i("span", _t, "+" + b(t.collabUsers.length - 5), 1)) : r("", !0)])) : r("", !0),
1619
1664
  !t.isCollaborating || t.isCollabOwner ? (g(), n(_, {
1620
1665
  key: 1,
1621
1666
  size: "small",
@@ -1624,7 +1669,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1624
1669
  title: "协作"
1625
1670
  }, {
1626
1671
  default: w(() => [s(p, null, {
1627
- default: w(() => [s(x(le))]),
1672
+ default: w(() => [s(x(ce))]),
1628
1673
  _: 1
1629
1674
  }), a("span", null, b(t.isCollaborating ? "协作中" : "协作"), 1)]),
1630
1675
  _: 1
@@ -1637,34 +1682,34 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1637
1682
  title: "分享链接"
1638
1683
  }, {
1639
1684
  default: w(() => [s(p, null, {
1640
- default: w(() => [s(x(te))]),
1685
+ default: w(() => [s(x(Y))]),
1641
1686
  _: 1
1642
1687
  })]),
1643
1688
  _: 1
1644
1689
  })) : r("", !0),
1645
- s(R, {
1690
+ s(I, {
1646
1691
  trigger: "click",
1647
1692
  onCommand: u[18] ||= (e) => c.$emit("export", e)
1648
1693
  }, {
1649
- dropdown: w(() => [s(F, null, {
1694
+ dropdown: w(() => [s(N, null, {
1650
1695
  default: w(() => [
1651
1696
  s(M, { command: "png" }, {
1652
1697
  default: w(() => [s(p, null, {
1653
- default: w(() => [s(x(re))]),
1698
+ default: w(() => [s(x(Z))]),
1654
1699
  _: 1
1655
1700
  }), u[27] ||= o("导出 PNG ", -1)]),
1656
1701
  _: 1
1657
1702
  }),
1658
1703
  s(M, { command: "svg" }, {
1659
1704
  default: w(() => [s(p, null, {
1660
- default: w(() => [s(x(H))]),
1705
+ default: w(() => [s(x(U))]),
1661
1706
  _: 1
1662
1707
  }), u[28] ||= o("导出 SVG ", -1)]),
1663
1708
  _: 1
1664
1709
  }),
1665
1710
  s(M, { command: "pdf" }, {
1666
1711
  default: w(() => [s(p, null, {
1667
- default: w(() => [s(x(H))]),
1712
+ default: w(() => [s(x(U))]),
1668
1713
  _: 1
1669
1714
  }), u[29] ||= o("导出 PDF ", -1)]),
1670
1715
  _: 1
@@ -1677,7 +1722,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1677
1722
  type: "warning"
1678
1723
  }, {
1679
1724
  default: w(() => [s(p, null, {
1680
- default: w(() => [s(x(W))]),
1725
+ default: w(() => [s(x(G))]),
1681
1726
  _: 1
1682
1727
  }), u[26] ||= a("span", null, "导出", -1)]),
1683
1728
  _: 1
@@ -1690,7 +1735,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1690
1735
  type: "primary"
1691
1736
  }, {
1692
1737
  default: w(() => [s(p, null, {
1693
- default: w(() => [s(x(L))]),
1738
+ default: w(() => [s(x(R))]),
1694
1739
  _: 1
1695
1740
  }), u[30] ||= a("span", null, "保存", -1)]),
1696
1741
  _: 1
@@ -1709,7 +1754,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1709
1754
  _: 1
1710
1755
  })) : r("", !0)
1711
1756
  ])
1712
- ], 32), s(U, {
1757
+ ], 32), s(B, {
1713
1758
  modelValue: S.value,
1714
1759
  "onUpdate:modelValue": u[23] ||= (e) => S.value = e,
1715
1760
  title: "AI生成思维导图",
@@ -1743,13 +1788,13 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1743
1788
  }, 8, ["modelValue"])], 64);
1744
1789
  };
1745
1790
  }
1746
- }, [["__scopeId", "data-v-47a9ddfc"]]), gt = { class: "mindmap-property-panel" }, _t = { class: "panel-header" }, vt = {
1791
+ }, [["__scopeId", "data-v-695aef34"]]), yt = { class: "mindmap-property-panel" }, bt = { class: "panel-header" }, xt = {
1747
1792
  key: 0,
1748
1793
  class: "panel-content"
1749
- }, yt = { class: "section" }, bt = { class: "section" }, xt = { class: "setting-row" }, St = { class: "setting-row" }, Ct = { class: "setting-row" }, wt = { class: "setting-row" }, Tt = { class: "setting-row" }, Et = { class: "section" }, Dt = { class: "section" }, Ot = { class: "tags-list" }, kt = { class: "tag-input-row" }, At = { class: "section" }, jt = {
1794
+ }, St = { class: "section" }, Ct = { class: "section" }, wt = { class: "setting-row" }, Tt = { class: "setting-row" }, Et = { class: "setting-row" }, Dt = { class: "setting-row" }, Ot = { class: "setting-row" }, kt = { class: "section" }, At = { class: "section" }, jt = { class: "tags-list" }, Mt = { class: "tag-input-row" }, Nt = { class: "section" }, Pt = {
1750
1795
  key: 1,
1751
1796
  class: "panel-empty"
1752
- }, Mt = /*#__PURE__*/ Z({
1797
+ }, Ft = /*#__PURE__*/ Q({
1753
1798
  __name: "MindMapPropertyPanel",
1754
1799
  props: {
1755
1800
  visible: {
@@ -1795,28 +1840,28 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1795
1840
  O.value.splice(e, 1), l("update-tags", [...O.value]);
1796
1841
  };
1797
1842
  return (r, c) => {
1798
- let l = y("el-icon"), _ = y("el-button"), C = y("el-input"), R = y("el-slider"), B = y("el-color-picker"), V = y("el-option"), H = y("el-select"), U = y("el-tag");
1799
- return T((g(), i("div", gt, [a("div", _t, [c[16] ||= a("span", { class: "header-label" }, "属性", -1), s(_, {
1843
+ let l = y("el-icon"), _ = y("el-button"), C = y("el-input"), R = y("el-slider"), z = y("el-color-picker"), V = y("el-option"), H = y("el-select"), U = y("el-tag");
1844
+ return T((g(), i("div", yt, [a("div", bt, [c[16] ||= a("span", { class: "header-label" }, "属性", -1), s(_, {
1800
1845
  size: "small",
1801
1846
  circle: "",
1802
1847
  onClick: c[0] ||= (e) => r.$emit("close")
1803
1848
  }, {
1804
1849
  default: w(() => [s(l, null, {
1805
- default: w(() => [s(x(z))]),
1850
+ default: w(() => [s(x(B))]),
1806
1851
  _: 1
1807
1852
  })]),
1808
1853
  _: 1
1809
- })]), t.node ? (g(), i("div", vt, [
1810
- a("div", yt, [c[17] ||= a("div", { class: "section-title" }, "节点文本", -1), s(C, {
1854
+ })]), t.node ? (g(), i("div", xt, [
1855
+ a("div", St, [c[17] ||= a("div", { class: "section-title" }, "节点文本", -1), s(C, {
1811
1856
  modelValue: u.value,
1812
1857
  "onUpdate:modelValue": c[1] ||= (e) => u.value = e,
1813
1858
  size: "small",
1814
1859
  onChange: M,
1815
1860
  placeholder: "输入节点文本"
1816
1861
  }, null, 8, ["modelValue"])]),
1817
- a("div", bt, [
1862
+ a("div", Ct, [
1818
1863
  c[23] ||= a("div", { class: "section-title" }, "样式", -1),
1819
- a("div", xt, [c[18] ||= a("label", null, "字体大小", -1), s(R, {
1864
+ a("div", wt, [c[18] ||= a("label", null, "字体大小", -1), s(R, {
1820
1865
  modelValue: d.value,
1821
1866
  "onUpdate:modelValue": c[2] ||= (e) => d.value = e,
1822
1867
  min: 12,
@@ -1825,25 +1870,25 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1825
1870
  onChange: c[3] ||= (e) => N("fontSize", e + "px"),
1826
1871
  style: { width: "140px" }
1827
1872
  }, null, 8, ["modelValue"])]),
1828
- a("div", St, [c[19] ||= a("label", null, "字体颜色", -1), s(B, {
1873
+ a("div", Tt, [c[19] ||= a("label", null, "字体颜色", -1), s(z, {
1829
1874
  modelValue: f.value,
1830
1875
  "onUpdate:modelValue": c[4] ||= (e) => f.value = e,
1831
1876
  onChange: c[5] ||= (e) => N("color", e),
1832
1877
  size: "small"
1833
1878
  }, null, 8, ["modelValue"])]),
1834
- a("div", Ct, [c[20] ||= a("label", null, "背景色", -1), s(B, {
1879
+ a("div", Et, [c[20] ||= a("label", null, "背景色", -1), s(z, {
1835
1880
  modelValue: p.value,
1836
1881
  "onUpdate:modelValue": c[6] ||= (e) => p.value = e,
1837
1882
  onChange: c[7] ||= (e) => N("background", e),
1838
1883
  size: "small"
1839
1884
  }, null, 8, ["modelValue"])]),
1840
- a("div", wt, [c[21] ||= a("label", null, "边框色", -1), s(B, {
1885
+ a("div", Dt, [c[21] ||= a("label", null, "边框色", -1), s(z, {
1841
1886
  modelValue: m.value,
1842
1887
  "onUpdate:modelValue": c[8] ||= (e) => m.value = e,
1843
1888
  onChange: c[9] ||= (e) => N("borderColor", e),
1844
1889
  size: "small"
1845
1890
  }, null, 8, ["modelValue"])]),
1846
- a("div", Tt, [c[22] ||= a("label", null, "形状", -1), s(H, {
1891
+ a("div", Ot, [c[22] ||= a("label", null, "形状", -1), s(H, {
1847
1892
  modelValue: h.value,
1848
1893
  "onUpdate:modelValue": c[10] ||= (e) => h.value = e,
1849
1894
  size: "small",
@@ -1866,7 +1911,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1866
1911
  _: 1
1867
1912
  }, 8, ["modelValue"])])
1868
1913
  ]),
1869
- a("div", Et, [c[24] ||= a("div", { class: "section-title" }, "备注", -1), s(C, {
1914
+ a("div", kt, [c[24] ||= a("div", { class: "section-title" }, "备注", -1), s(C, {
1870
1915
  modelValue: D.value,
1871
1916
  "onUpdate:modelValue": c[12] ||= (e) => D.value = e,
1872
1917
  type: "textarea",
@@ -1875,9 +1920,9 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1875
1920
  onChange: P,
1876
1921
  placeholder: "添加备注..."
1877
1922
  }, null, 8, ["modelValue"])]),
1878
- a("div", Dt, [
1923
+ a("div", At, [
1879
1924
  c[26] ||= a("div", { class: "section-title" }, "标签", -1),
1880
- a("div", Ot, [(g(!0), i(e, null, v(O.value, (e, t) => (g(), n(U, {
1925
+ a("div", jt, [(g(!0), i(e, null, v(O.value, (e, t) => (g(), n(U, {
1881
1926
  key: t,
1882
1927
  closable: "",
1883
1928
  size: "small",
@@ -1886,7 +1931,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1886
1931
  default: w(() => [o(b(e.text || e), 1)]),
1887
1932
  _: 2
1888
1933
  }, 1032, ["onClose"]))), 128))]),
1889
- a("div", kt, [s(C, {
1934
+ a("div", Mt, [s(C, {
1890
1935
  modelValue: k.value,
1891
1936
  "onUpdate:modelValue": c[13] ||= (e) => k.value = e,
1892
1937
  size: "small",
@@ -1902,7 +1947,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1902
1947
  _: 1
1903
1948
  }, 8, ["disabled"])])
1904
1949
  ]),
1905
- a("div", At, [
1950
+ a("div", Nt, [
1906
1951
  c[27] ||= a("div", { class: "section-title" }, "超链接", -1),
1907
1952
  s(C, {
1908
1953
  modelValue: A.value,
@@ -1920,16 +1965,16 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1920
1965
  style: { "margin-top": "6px" }
1921
1966
  }, null, 8, ["modelValue"])
1922
1967
  ])
1923
- ])) : (g(), i("div", jt, [s(l, {
1968
+ ])) : (g(), i("div", Pt, [s(l, {
1924
1969
  size: 32,
1925
1970
  color: "#c0c4cc"
1926
1971
  }, {
1927
- default: w(() => [s(x(ee))]),
1972
+ default: w(() => [s(x(J))]),
1928
1973
  _: 1
1929
1974
  }), c[28] ||= a("p", null, "点击节点编辑属性", -1)]))], 512)), [[S, t.visible]]);
1930
1975
  };
1931
1976
  }
1932
- }, [["__scopeId", "data-v-c06f1443"]]), Nt = /*#__PURE__*/ Z({
1977
+ }, [["__scopeId", "data-v-c06f1443"]]), It = /*#__PURE__*/ Q({
1933
1978
  __name: "MindMapContextMenu",
1934
1979
  props: {
1935
1980
  visible: {
@@ -1963,14 +2008,14 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1963
2008
  class: "menu-item",
1964
2009
  onClick: n[0] ||= (e) => r("insertChild")
1965
2010
  }, [s(c, null, {
1966
- default: w(() => [s(x(ie))]),
2011
+ default: w(() => [s(x(ne))]),
1967
2012
  _: 1
1968
2013
  }), n[7] ||= o("插入子节点 ", -1)]),
1969
2014
  a("div", {
1970
2015
  class: "menu-item",
1971
2016
  onClick: n[1] ||= (e) => r("insertSibling")
1972
2017
  }, [s(c, null, {
1973
- default: w(() => [s(x(B))]),
2018
+ default: w(() => [s(x(V))]),
1974
2019
  _: 1
1975
2020
  }), n[8] ||= o("插入同级节点 ", -1)]),
1976
2021
  n[14] ||= a("div", { class: "menu-divider" }, null, -1),
@@ -1978,14 +2023,14 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1978
2023
  class: "menu-item",
1979
2024
  onClick: n[2] ||= (e) => r("edit")
1980
2025
  }, [s(c, null, {
1981
- default: w(() => [s(x(G))]),
2026
+ default: w(() => [s(x(K))]),
1982
2027
  _: 1
1983
2028
  }), n[9] ||= o("编辑文本 ", -1)]),
1984
2029
  a("div", {
1985
2030
  class: "menu-item",
1986
2031
  onClick: n[3] ||= (e) => r("delete")
1987
2032
  }, [s(c, null, {
1988
- default: w(() => [s(x(V))]),
2033
+ default: w(() => [s(x(H))]),
1989
2034
  _: 1
1990
2035
  }), n[10] ||= o("删除节点 ", -1)]),
1991
2036
  n[15] ||= a("div", { class: "menu-divider" }, null, -1),
@@ -1993,27 +2038,27 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
1993
2038
  class: "menu-item",
1994
2039
  onClick: n[4] ||= (e) => r("copy")
1995
2040
  }, [s(c, null, {
1996
- default: w(() => [s(x(H))]),
2041
+ default: w(() => [s(x(U))]),
1997
2042
  _: 1
1998
2043
  }), n[11] ||= o("复制 ", -1)]),
1999
2044
  a("div", {
2000
2045
  class: "menu-item",
2001
2046
  onClick: n[5] ||= (e) => r("cut")
2002
2047
  }, [s(c, null, {
2003
- default: w(() => [s(x(Y))]),
2048
+ default: w(() => [s(x(se))]),
2004
2049
  _: 1
2005
2050
  }), n[12] ||= o("剪切 ", -1)]),
2006
2051
  a("div", {
2007
2052
  class: "menu-item",
2008
2053
  onClick: n[6] ||= (e) => r("paste")
2009
2054
  }, [s(c, null, {
2010
- default: w(() => [s(x(U))]),
2055
+ default: w(() => [s(x(W))]),
2011
2056
  _: 1
2012
2057
  }), n[13] ||= o("粘贴 ", -1)])
2013
2058
  ], 4)), [[S, e.visible]]);
2014
2059
  };
2015
2060
  }
2016
- }, [["__scopeId", "data-v-0ca9bee8"]]), Pt = { class: "export-options" }, Ft = /*#__PURE__*/ Z({
2061
+ }, [["__scopeId", "data-v-0ca9bee8"]]), Lt = { class: "export-options" }, Rt = /*#__PURE__*/ Q({
2017
2062
  __name: "MindMapExportDialog",
2018
2063
  props: { visible: {
2019
2064
  type: Boolean,
@@ -2037,7 +2082,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2037
2082
  default: w(() => [...r[9] ||= [o("取消", -1)]]),
2038
2083
  _: 1
2039
2084
  })]),
2040
- default: w(() => [a("div", Pt, [
2085
+ default: w(() => [a("div", Lt, [
2041
2086
  a("div", {
2042
2087
  class: "export-item",
2043
2088
  onClick: r[0] ||= (e) => i("png")
@@ -2045,7 +2090,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2045
2090
  size: 32,
2046
2091
  color: "#409eff"
2047
2092
  }, {
2048
- default: w(() => [s(x(re))]),
2093
+ default: w(() => [s(x(Z))]),
2049
2094
  _: 1
2050
2095
  }), r[6] ||= a("div", { class: "export-info" }, [a("div", { class: "export-name" }, "PNG 图片"), a("div", { class: "export-desc" }, "高清位图,适合分享和预览")], -1)]),
2051
2096
  a("div", {
@@ -2055,7 +2100,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2055
2100
  size: 32,
2056
2101
  color: "#67c23a"
2057
2102
  }, {
2058
- default: w(() => [s(x(H))]),
2103
+ default: w(() => [s(x(U))]),
2059
2104
  _: 1
2060
2105
  }), r[7] ||= a("div", { class: "export-info" }, [a("div", { class: "export-name" }, "SVG 矢量图"), a("div", { class: "export-desc" }, "无损缩放,适合印刷和编辑")], -1)]),
2061
2106
  a("div", {
@@ -2065,7 +2110,7 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2065
2110
  size: 32,
2066
2111
  color: "#f56c6c"
2067
2112
  }, {
2068
- default: w(() => [s(x(H))]),
2113
+ default: w(() => [s(x(U))]),
2069
2114
  _: 1
2070
2115
  }), r[8] ||= a("div", { class: "export-info" }, [a("div", { class: "export-name" }, "PDF 文档"), a("div", { class: "export-desc" }, "通用格式,适合打印和归档")], -1)])
2071
2116
  ])]),
@@ -2073,46 +2118,46 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2073
2118
  }, 8, ["model-value"]);
2074
2119
  };
2075
2120
  }
2076
- }, [["__scopeId", "data-v-c9798127"]]), It = (e) => {
2077
- let t = new pe.Doc(), n = _(!1), r = _([]), i = _(""), a = _(!1), o = !1, s = null;
2078
- t.getXmlFragment("default");
2079
- let c = `ws://${window.location.hostname || "localhost"}:1234`, l = null, u = new me({
2080
- url: c,
2121
+ }, [["__scopeId", "data-v-c9798127"]]), zt = (e, t = {}) => {
2122
+ let n = new fe.Doc(), r = _(!1), i = _([]), a = _(""), o = _(!1), s = !1, c = null;
2123
+ n.getXmlFragment("default");
2124
+ let l = window.location.hostname || "localhost", u = t.wsUrl || `ws://${l}:1234`, d = null, f = new pe({
2125
+ url: u,
2081
2126
  name: e,
2082
- document: t,
2127
+ document: n,
2083
2128
  connect: !1,
2084
2129
  reconnect: !0,
2085
2130
  onClose: () => {
2086
- n.value = !1, f();
2131
+ r.value = !1, m();
2087
2132
  },
2088
2133
  onConnect: () => {
2089
- n.value = !0, d();
2134
+ r.value = !0, p();
2090
2135
  }
2091
- }), d = () => {
2092
- f(), l = setInterval(() => {
2093
- if (u.connection && u.connection.ws) try {
2094
- u.connection.ws.send(JSON.stringify({ type: "ping" }));
2136
+ }), p = () => {
2137
+ m(), d = setInterval(() => {
2138
+ if (f.connection && f.connection.ws) try {
2139
+ f.connection.ws.send(JSON.stringify({ type: "ping" }));
2095
2140
  } catch {}
2096
2141
  }, 3e4);
2097
- }, f = () => {
2098
- l &&= (clearInterval(l), null);
2099
- }, p = t.getMap("mindmap");
2100
- t.getMap("meta"), u.awareness.on("change", () => {
2101
- r.value = Array.from(u.awareness.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
2142
+ }, m = () => {
2143
+ d &&= (clearInterval(d), null);
2144
+ }, h = n.getMap("mindmap");
2145
+ n.getMap("meta"), f.awareness.on("change", () => {
2146
+ i.value = Array.from(f.awareness.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
2102
2147
  clientId: e,
2103
2148
  ...t.user
2104
2149
  }));
2105
- }), p.observe((e) => {
2106
- e.keysChanged.has("_closed") && (a.value = p.get("_closed") === !0);
2150
+ }), h.observe((e) => {
2151
+ e.keysChanged.has("_closed") && (o.value = h.get("_closed") === !0);
2107
2152
  });
2108
- let m = (e) => {
2109
- u.awareness.setLocalStateField("user", {
2153
+ let g = (e) => {
2154
+ f.awareness.setLocalStateField("user", {
2110
2155
  id: e.id || `user-${Date.now()}`,
2111
2156
  name: e.name || `用户${Math.floor(Math.random() * 1e3)}`,
2112
- color: e.color || h(),
2157
+ color: e.color || v(),
2113
2158
  ...e
2114
2159
  });
2115
- }, h = () => {
2160
+ }, v = () => {
2116
2161
  let e = [
2117
2162
  "#409EFF",
2118
2163
  "#67C23A",
@@ -2124,56 +2169,56 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2124
2169
  "#3498DB"
2125
2170
  ];
2126
2171
  return e[Math.floor(Math.random() * e.length)];
2127
- }, g = () => {
2128
- u.connect();
2129
- }, v = () => p, y = () => {
2130
- u.disconnect();
2131
- }, b = () => {
2132
- a.value = !0, t.transact(() => {
2133
- p.set("_closed", !0);
2134
- }), u.disconnect();
2135
- }, x = () => p.get("_closed") === !0 ? (a.value = !0, !0) : !1, S = (e) => {
2136
- o || (s && clearTimeout(s), s = setTimeout(() => {
2137
- let n = JSON.stringify(e);
2138
- p.get("root") !== n && t.transact(() => {
2139
- p.set("root", n);
2172
+ }, y = () => {
2173
+ f.connect();
2174
+ }, b = () => h, x = () => {
2175
+ f.disconnect();
2176
+ }, S = () => {
2177
+ o.value = !0, n.transact(() => {
2178
+ h.set("_closed", !0);
2179
+ }), f.disconnect();
2180
+ }, C = () => h.get("_closed") === !0 ? (o.value = !0, !0) : !1, w = (e) => {
2181
+ s || (c && clearTimeout(c), c = setTimeout(() => {
2182
+ let t = JSON.stringify(e);
2183
+ h.get("root") !== t && n.transact(() => {
2184
+ h.set("root", t);
2140
2185
  });
2141
2186
  }, 50));
2142
- }, C = (e) => {
2143
- p.observe((t) => {
2187
+ }, T = (e) => {
2188
+ h.observe((t) => {
2144
2189
  if (t.keysChanged.has("root")) {
2145
- let t = p.get("root");
2190
+ let t = h.get("root");
2146
2191
  if (t) try {
2147
- o = !0, e(JSON.parse(t)), setTimeout(() => {
2148
- o = !1;
2192
+ s = !0, e(JSON.parse(t)), setTimeout(() => {
2193
+ s = !1;
2149
2194
  }, 100);
2150
2195
  } catch (e) {
2151
- console.error("Failed to parse remote mind map data:", e), o = !1;
2196
+ console.error("Failed to parse remote mind map data:", e), s = !1;
2152
2197
  }
2153
2198
  }
2154
2199
  });
2155
- }, w = () => {
2200
+ }, E = () => {
2156
2201
  let t = `${window.location.origin}/mindmap-editor/${e}?collab=1`;
2157
- return i.value = t, t;
2202
+ return a.value = t, t;
2158
2203
  };
2159
2204
  return {
2160
- ydoc: t,
2161
- provider: u,
2162
- isConnected: n,
2163
- onlineUsers: r,
2164
- shareUrl: i,
2165
- collaborationClosed: a,
2166
- setUserInfo: m,
2167
- connect: g,
2168
- disconnect: y,
2169
- closeCollaboration: b,
2170
- checkCollaborationClosed: x,
2171
- syncToYjs: S,
2172
- getYData: v,
2173
- onRemoteChange: C,
2174
- generateShareUrl: w,
2205
+ ydoc: n,
2206
+ provider: f,
2207
+ isConnected: r,
2208
+ onlineUsers: i,
2209
+ shareUrl: a,
2210
+ collaborationClosed: o,
2211
+ setUserInfo: g,
2212
+ connect: y,
2213
+ disconnect: x,
2214
+ closeCollaboration: S,
2215
+ checkCollaborationClosed: C,
2216
+ syncToYjs: w,
2217
+ getYData: b,
2218
+ onRemoteChange: T,
2219
+ generateShareUrl: E,
2175
2220
  copyShareUrl: async () => {
2176
- let e = i.value || w();
2221
+ let e = a.value || E();
2177
2222
  try {
2178
2223
  return await navigator.clipboard.writeText(e), !0;
2179
2224
  } catch {
@@ -2181,23 +2226,58 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2181
2226
  }
2182
2227
  },
2183
2228
  destroy: () => {
2184
- f(), s && clearTimeout(s), u.awareness.setLocalState(null), u.disconnect(), t.destroy();
2229
+ m(), c && clearTimeout(c), f.awareness.setLocalState(null), f.disconnect(), n.destroy();
2185
2230
  }
2186
2231
  };
2187
- }, Lt = { class: "mindmap-editor" }, Rt = { class: "editor-main" }, zt = "mindmap", Bt = /*#__PURE__*/ Z({
2232
+ }, Bt = { class: "mindmap-editor" }, Vt = { class: "editor-main" }, Ht = "mindmap", Ut = /*#__PURE__*/ Q({
2188
2233
  __name: "MindMapEditor",
2234
+ props: {
2235
+ docId: {
2236
+ type: [Number, String],
2237
+ default: null
2238
+ },
2239
+ apiBase: {
2240
+ type: String,
2241
+ default: "/api"
2242
+ },
2243
+ saveApi: {
2244
+ type: [String, Function],
2245
+ default: null
2246
+ },
2247
+ loadApi: {
2248
+ type: [String, Function],
2249
+ default: null
2250
+ },
2251
+ wsUrl: {
2252
+ type: String,
2253
+ default: ""
2254
+ },
2255
+ user: {
2256
+ type: Object,
2257
+ default: null
2258
+ },
2259
+ uiConfig: {
2260
+ type: Object,
2261
+ default: () => ({})
2262
+ }
2263
+ },
2189
2264
  setup(e) {
2190
- let n = k(), r = A(), o = _(null), c = _(null), l = _(!1), d = _(!1), f = _(!1), { saveVersion: h } = Be(), v = Le(), b = _({
2265
+ let n = e, r = k(), o = A(), c = t(() => ({
2266
+ backButton: "show",
2267
+ titleEditable: !0,
2268
+ authorEditable: !0,
2269
+ ...n.uiConfig
2270
+ })), l = t(() => n.docId ?? r.params.id), d = t(() => n.apiBase && n.apiBase !== "/api" ? me(n.apiBase) : ge), f = _(null), h = _(null), v = _(!1), b = _(!1), S = _(!1), { saveVersion: T } = Ue(), E = Be(), O = _({
2191
2271
  visible: !1,
2192
2272
  x: 0,
2193
2273
  y: 0
2194
- }), S = null, T = !1, E = null, O = _(!1), N = _(!1), P = _(!1), F = _([]), I = _(""), L = _(""), R = _(n.params.id || null), z = _(null), B = t(() => !!z.value), V = _(!1);
2195
- C(B, () => {
2274
+ }), P = null, F = !1, I = null, L = _(!1), R = _(!1), z = _(!1), B = _([]), V = _(""), H = _(""), U = _(l.value || null), W = _(null), G = t(() => !!W.value), K = _(!1);
2275
+ C(G, () => {
2196
2276
  u(() => {
2197
- S && (S.getElRectInfo(), S.resize(), q.value && S.view.fit(void 0, !0));
2277
+ P && (P.getElRectInfo(), P.resize(), Z.value && P.view.fit(void 0, !0));
2198
2278
  });
2199
2279
  });
2200
- let H = _("mindMap"), U = _("default"), W = _(0), G = _(0), K = _(100), q = _(!0), ee = {
2280
+ let q = _("mindMap"), ee = _("default"), J = _(0), Y = _(0), te = _(100), Z = _(!0), ne = {
2201
2281
  data: {
2202
2282
  text: "中心主题",
2203
2283
  expand: !0
@@ -2227,9 +2307,9 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2227
2307
  children: []
2228
2308
  }]
2229
2309
  }]
2230
- }, te = JSON.parse(JSON.stringify(ee)), ne = async () => {
2231
- if (!o.value) return;
2232
- let e = await import("./simple-mind-map-DFGmd5vc.mjs"), t = e.default || e, [r, i, a, s, c, l, d, f, p, m, h, g, _] = await Promise.all([
2310
+ }, re = JSON.parse(JSON.stringify(ne)), ie = async () => {
2311
+ if (!f.value) return;
2312
+ let e = await import("./simple-mind-map-DFGmd5vc.mjs"), t = e.default || e, [r, i, a, o, s, c, p, m, h, g, _, v, y] = await Promise.all([
2233
2313
  import("./Export-C11gtER2.mjs"),
2234
2314
  import("./Drag-BNJqZaaB.mjs"),
2235
2315
  import("./Select-CY_n5-r2.mjs"),
@@ -2243,22 +2323,22 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2243
2323
  import("./NodeImgAdjust-CU_ka96q.mjs"),
2244
2324
  import("./Watermark-B-zBgHXG.mjs"),
2245
2325
  import("./Formula-rim6V3Ro.mjs")
2246
- ]), v = r.default, y = i.default, b = a.default, x = s.default, C = c.default, w = l.default, E = d.default, D = f.default, O = p.default, k = m.default, A = h.default, j = g.default, M = _.default, N = ee, P = n.params.id;
2247
- if (P) try {
2248
- let { documentAPI: e } = await import("./api-D2rfJWe_.mjs"), t = await e.get(P);
2249
- if (t.data?.content) {
2250
- let e = JSON.parse(t.data.content);
2251
- e && e.data && (N = e, te = JSON.parse(JSON.stringify(e)));
2326
+ ]), b = r.default, x = i.default, S = a.default, C = o.default, w = s.default, T = c.default, E = p.default, D = m.default, O = h.default, k = g.default, A = _.default, j = v.default, M = y.default, I = ne, L = l.value;
2327
+ if (L) try {
2328
+ let e;
2329
+ if (e = typeof n.loadApi == "function" ? await n.loadApi(L) : n.loadApi ? await N.get(`${n.loadApi}/${L}`) : await d.value.get(L), e.data?.content) {
2330
+ let t = JSON.parse(e.data.content);
2331
+ t && t.data && (I = t, re = JSON.parse(JSON.stringify(t)));
2252
2332
  }
2253
- t.data?.title && (I.value = t.data.title), t.data?.author && (L.value = t.data.author);
2333
+ e.data?.title && (V.value = e.data.title), e.data?.author && (H.value = e.data.author);
2254
2334
  } catch (e) {
2255
2335
  console.warn("Failed to load document:", e);
2256
2336
  }
2257
- S = new t({
2258
- el: o.value,
2259
- data: N,
2260
- layout: H.value,
2261
- theme: U.value,
2337
+ P = new t({
2338
+ el: f.value,
2339
+ data: I,
2340
+ layout: q.value,
2341
+ theme: ee.value,
2262
2342
  scaleRatio: .1,
2263
2343
  mousewheelAction: "move",
2264
2344
  mousewheelMoveStep: 100,
@@ -2270,136 +2350,136 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2270
2350
  fit: !0,
2271
2351
  enableAutoEnterTextEditWhenKeydown: !1,
2272
2352
  enableShortcutOnlyWhenMouseInSvg: !0
2273
- }), S.addPlugin(v), S.addPlugin(y), S.addPlugin(b), S.addPlugin(x), S.addPlugin(C), S.addPlugin(w), S.addPlugin(E), S.addPlugin(D), S.addPlugin(O), S.addPlugin(k), S.addPlugin(A), S.addPlugin(j), S.addPlugin(M), S.on("node_click", (e) => {
2274
- z.value = e, V.value = !e.parent;
2275
- }), S.on("draw_click", () => {
2276
- z.value = null, V.value = !1;
2277
- }), S.on("history_change", () => {
2278
- re();
2279
- }), S.on("back_forward", (e, t) => {
2280
- W.value = e || 0, G.value = (t || 1) - 1 - (e || 0);
2281
- }), S.on("data_change", () => {
2282
- he();
2283
- }), S.on("before_show_text_edit", () => {
2284
- Q = !0, Z && clearTimeout(Z);
2285
- }), S.on("hide_text_edit", () => {
2286
- Q = !1, q.value && u(() => ge());
2287
- }), S.on("scale", (e) => {
2288
- K.value = Math.round(e * 100);
2289
- }), S.on("node_tree_render_end", () => {
2290
- re(), T || (T = !0, u(() => {
2291
- S.getElRectInfo(), S.resize(), S.view.fit(void 0, !0), ve();
2353
+ }), P.addPlugin(b), P.addPlugin(x), P.addPlugin(S), P.addPlugin(C), P.addPlugin(w), P.addPlugin(T), P.addPlugin(E), P.addPlugin(D), P.addPlugin(O), P.addPlugin(k), P.addPlugin(A), P.addPlugin(j), P.addPlugin(M), P.on("node_click", (e) => {
2354
+ W.value = e, K.value = !e.parent;
2355
+ }), P.on("draw_click", () => {
2356
+ W.value = null, K.value = !1;
2357
+ }), P.on("history_change", () => {
2358
+ ae();
2359
+ }), P.on("back_forward", (e, t) => {
2360
+ J.value = e || 0, Y.value = (t || 1) - 1 - (e || 0);
2361
+ }), P.on("data_change", () => {
2362
+ xe();
2363
+ }), P.on("before_show_text_edit", () => {
2364
+ be = !0, $ && clearTimeout($);
2365
+ }), P.on("hide_text_edit", () => {
2366
+ be = !1, Z.value && u(() => Se());
2367
+ }), P.on("scale", (e) => {
2368
+ te.value = Math.round(e * 100);
2369
+ }), P.on("node_tree_render_end", () => {
2370
+ ae(), F || (F = !0, u(() => {
2371
+ P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0), Te();
2292
2372
  }));
2293
2373
  });
2294
- }, re = () => {
2295
- if (S) try {
2296
- let e = S.command;
2297
- W.value = e.activeHistoryIndex || 0, G.value = (e.history?.length || 1) - 1 - (e.activeHistoryIndex || 0);
2374
+ }, ae = () => {
2375
+ if (P) try {
2376
+ let e = P.command;
2377
+ J.value = e.activeHistoryIndex || 0, Y.value = (e.history?.length || 1) - 1 - (e.activeHistoryIndex || 0);
2298
2378
  } catch {
2299
- W.value = 0, G.value = 0;
2379
+ J.value = 0, Y.value = 0;
2300
2380
  }
2301
- }, ie = async () => {
2302
- if (!S) return;
2303
- E = It(n.params.id || `mindmap-${Date.now()}`), E.connect();
2304
- let e = `用户${Math.floor(Math.random() * 1e3)}`;
2305
- E.setUserInfo({ name: e }), v.setCollabContext({
2306
- ydoc: E.ydoc,
2307
- provider: E.provider,
2308
- onlineUsers: F
2309
- }), v.setCurrentUser({
2310
- id: E.provider.awareness.clientID,
2381
+ }, oe = async () => {
2382
+ if (!P) return;
2383
+ I = zt(l.value || `mindmap-${Date.now()}`, { wsUrl: n.wsUrl || void 0 }), I.connect(n.wsUrl || void 0);
2384
+ let e = n.user?.name || `用户${Math.floor(Math.random() * 1e3)}`;
2385
+ I.setUserInfo({ name: e }), E.setCollabContext({
2386
+ ydoc: I.ydoc,
2387
+ provider: I.provider,
2388
+ onlineUsers: B
2389
+ }), E.setCurrentUser({
2390
+ id: I.provider.awareness.clientID,
2311
2391
  name: e,
2312
2392
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
2313
- }), E.syncToYjs(S.getData()), E.onRemoteChange((e) => {
2314
- S && S.setData(e);
2315
- }), S.on("data_change", () => {
2316
- E && E.syncToYjs(S.getData());
2317
- }), P.value = !0, O.value = !0, N.value = !0;
2393
+ }), I.syncToYjs(P.getData()), I.onRemoteChange((e) => {
2394
+ P && P.setData(e);
2395
+ }), P.on("data_change", () => {
2396
+ I && I.syncToYjs(P.getData());
2397
+ }), z.value = !0, L.value = !0, R.value = !0;
2318
2398
  let t = setInterval(() => {
2319
- E && (F.value = [...E.onlineUsers.value]);
2399
+ I && (B.value = [...I.onlineUsers.value]);
2320
2400
  }, 1e3);
2321
- E._userSyncTimer = t, n.params.id || await ke();
2322
- let r = E.generateShareUrl();
2401
+ I._userSyncTimer = t, l.value || await Ie();
2402
+ let r = I.generateShareUrl();
2323
2403
  j.success("协作已开启,分享链接已复制");
2324
2404
  try {
2325
2405
  await navigator.clipboard.writeText(r);
2326
2406
  } catch {}
2327
- }, ae = () => {
2328
- E &&= (E._userSyncTimer && clearInterval(E._userSyncTimer), E.closeCollaboration(), null), P.value = !1, O.value = !1, N.value = !1, F.value = [], j.info("协作已关闭");
2329
- }, oe = async () => {
2330
- if (!S) return;
2331
- let e = n.params.id;
2407
+ }, se = () => {
2408
+ I &&= (I._userSyncTimer && clearInterval(I._userSyncTimer), I.closeCollaboration(), null), z.value = !1, L.value = !1, R.value = !1, B.value = [], j.info("协作已关闭");
2409
+ }, ce = async () => {
2410
+ if (!P) return;
2411
+ let e = l.value;
2332
2412
  if (!e) return;
2333
- E = It(e), E.connect();
2334
- let t = `协作人${Math.floor(Math.random() * 1e3)}`;
2335
- if (E.setUserInfo({ name: t }), v.setCollabContext({
2336
- ydoc: E.ydoc,
2337
- provider: E.provider,
2338
- onlineUsers: F
2339
- }), v.setCurrentUser({
2340
- id: E.provider.awareness.clientID,
2413
+ I = zt(e, { wsUrl: n.wsUrl || void 0 }), I.connect();
2414
+ let t = n.user?.name || `协作人${Math.floor(Math.random() * 1e3)}`;
2415
+ if (I.setUserInfo({ name: t }), E.setCollabContext({
2416
+ ydoc: I.ydoc,
2417
+ provider: I.provider,
2418
+ onlineUsers: B
2419
+ }), E.setCurrentUser({
2420
+ id: I.provider.awareness.clientID,
2341
2421
  name: t,
2342
2422
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
2343
- }), E.onRemoteChange((e) => {
2344
- S && S.setData(e);
2345
- }), S.on("data_change", () => {
2346
- E && E.syncToYjs(S.getData());
2423
+ }), I.onRemoteChange((e) => {
2424
+ P && P.setData(e);
2425
+ }), P.on("data_change", () => {
2426
+ I && I.syncToYjs(P.getData());
2347
2427
  }), await new Promise((e) => {
2348
2428
  let t = () => {
2349
- let t = E.getYData().get("root");
2429
+ let t = I.getYData().get("root");
2350
2430
  if (t) try {
2351
2431
  let e = JSON.parse(t);
2352
- S.setData(e);
2432
+ P.setData(e);
2353
2433
  } catch {}
2354
2434
  e();
2355
2435
  };
2356
- if (E.isConnected.value) t();
2436
+ if (I.isConnected.value) t();
2357
2437
  else {
2358
- let e = C(() => E.isConnected.value, (n) => {
2438
+ let e = C(() => I.isConnected.value, (n) => {
2359
2439
  n && (e(), t());
2360
2440
  });
2361
2441
  }
2362
- }), E.checkCollaborationClosed()) {
2363
- j.warning("该协作已关闭,无法加入"), E.disconnect(), E = null;
2442
+ }), I.checkCollaborationClosed()) {
2443
+ j.warning("该协作已关闭,无法加入"), I.disconnect(), I = null;
2364
2444
  return;
2365
2445
  }
2366
- P.value = !0, O.value = !0, N.value = !1;
2446
+ z.value = !0, L.value = !0, R.value = !1;
2367
2447
  let r = setInterval(() => {
2368
- E && (F.value = [...E.onlineUsers.value]);
2448
+ I && (B.value = [...I.onlineUsers.value]);
2369
2449
  }, 1e3);
2370
- E._userSyncTimer = r, j.success("已加入协作");
2371
- }, se = async () => {
2372
- if (!E) await ie();
2450
+ I._userSyncTimer = r, j.success("已加入协作");
2451
+ }, le = async () => {
2452
+ if (!I) await oe();
2373
2453
  else {
2374
- let e = E.generateShareUrl();
2454
+ let e = I.generateShareUrl();
2375
2455
  try {
2376
2456
  await navigator.clipboard.writeText(e), j.success("分享链接已复制到剪贴板");
2377
2457
  } catch {
2378
2458
  j.info("分享链接: " + e);
2379
2459
  }
2380
2460
  }
2381
- }, ce = () => r.push("/"), Y = (e) => {
2382
- S && (e === "child" ? S.execCommand("INSERT_CHILD_NODE") : S.execCommand("INSERT_NODE"));
2383
- }, le = () => {
2384
- S && S.execCommand("REMOVE_NODE");
2385
- }, ue = () => {
2386
- if (!S) return;
2387
- let e = S.getData(), t = (e) => {
2461
+ }, ue = () => o.push("/"), de = (e) => {
2462
+ P && (e === "child" ? P.execCommand("INSERT_CHILD_NODE") : P.execCommand("INSERT_NODE"));
2463
+ }, fe = () => {
2464
+ P && P.execCommand("REMOVE_NODE");
2465
+ }, pe = () => {
2466
+ if (!P) return;
2467
+ let e = P.getData(), t = (e) => {
2388
2468
  e.children && e.children.length > 0 && (e.children.reverse(), e.children.forEach(t));
2389
2469
  };
2390
- t(e), S.setData(e), u(() => {
2391
- S && (S.getElRectInfo(), S.resize(), S.view.fit(void 0, !0));
2470
+ t(e), P.setData(e), u(() => {
2471
+ P && (P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0));
2392
2472
  });
2393
- }, de = () => S?.execCommand("BACK"), fe = () => S?.execCommand("FORWARD"), X = () => S?.view.enlarge(), pe = () => S?.view.narrow(), me = () => {
2394
- S && (S.getElRectInfo(), S.resize(), S.view.fit(void 0, !0));
2395
- }, Z = null, Q = !1, he = () => {
2396
- !q.value || !S || Q || (Z && clearTimeout(Z), Z = setTimeout(() => {
2397
- Q || (S.getElRectInfo(), S.resize(), S.view.fit(void 0, !0));
2473
+ }, he = () => P?.execCommand("BACK"), Q = () => P?.execCommand("FORWARD"), _e = () => P?.view.enlarge(), ve = () => P?.view.narrow(), ye = () => {
2474
+ P && (P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0));
2475
+ }, $ = null, be = !1, xe = () => {
2476
+ !Z.value || !P || be || ($ && clearTimeout($), $ = setTimeout(() => {
2477
+ be || (P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0));
2398
2478
  }, 200));
2399
- }, ge = () => {
2400
- S && (Z && clearTimeout(Z), S.getElRectInfo(), S.resize(), S.view.fit(void 0, !0));
2401
- }, _e = async () => {
2402
- if (S) {
2479
+ }, Se = () => {
2480
+ P && ($ && clearTimeout($), P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0));
2481
+ }, Ce = async () => {
2482
+ if (P) {
2403
2483
  try {
2404
2484
  await M.confirm("确定要复位思维导图吗?将恢复到最近一次保存的状态。", "复位确认", {
2405
2485
  confirmButtonText: "确定",
@@ -2409,127 +2489,124 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2409
2489
  } catch {
2410
2490
  return;
2411
2491
  }
2412
- S.setData(te), u(() => {
2413
- S && (S.getElRectInfo(), S.resize(), S.view.fit(void 0, !0));
2492
+ P.setData(re), u(() => {
2493
+ P && (P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0));
2414
2494
  });
2415
2495
  }
2416
- }, $ = null, ve = () => {
2417
- !o.value || !S || ($ = new ResizeObserver(() => {
2418
- S && (S.getElRectInfo(), S.resize());
2419
- }), $.observe(o.value));
2420
- }, ye = (e) => {
2421
- H.value = e, S && S.svg?.attr({ opacity: 0 }), S?.setLayout(e);
2496
+ }, we = null, Te = () => {
2497
+ !f.value || !P || (we = new ResizeObserver(() => {
2498
+ P && (P.getElRectInfo(), P.resize());
2499
+ }), we.observe(f.value));
2500
+ }, Ee = (e) => {
2501
+ q.value = e, P && P.svg?.attr({ opacity: 0 }), P?.setLayout(e);
2422
2502
  let t = () => {
2423
- S && (S.getElRectInfo(), S.resize(), S.view.fit(void 0, !0), S.svg?.attr({ opacity: 1 }), S.off("node_tree_render_end", t));
2503
+ P && (P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0), P.svg?.attr({ opacity: 1 }), P.off("node_tree_render_end", t));
2424
2504
  };
2425
- S?.on("node_tree_render_end", t), setTimeout(() => {
2426
- S && (S.svg?.attr({ opacity: 1 }), S.off("node_tree_render_end", t));
2505
+ P?.on("node_tree_render_end", t), setTimeout(() => {
2506
+ P && (P.svg?.attr({ opacity: 1 }), P.off("node_tree_render_end", t));
2427
2507
  }, 3e3);
2428
- }, be = (e) => {
2429
- U.value = e;
2430
- let t = $e.find((t) => t.value === e);
2431
- t && t.config && Object.keys(t.config).length > 0 ? S?.setThemeConfig(t.config) : S?.setTheme("default");
2432
- }, xe = (e) => {
2433
- !S || !z.value || (z.value.setData({ text: e }), S.render());
2434
- }, Se = (e) => {
2435
- if (!S || !z.value) return;
2436
- let t = z.value.getData("style") || {};
2437
- z.value.setData("style", {
2508
+ }, De = (e) => {
2509
+ ee.value = e;
2510
+ let t = nt.find((t) => t.value === e);
2511
+ t && t.config && Object.keys(t.config).length > 0 ? P?.setThemeConfig(t.config) : P?.setTheme("default");
2512
+ }, Oe = (e) => {
2513
+ !P || !W.value || (W.value.setData({ text: e }), P.render());
2514
+ }, ke = (e) => {
2515
+ if (!P || !W.value) return;
2516
+ let t = W.value.getData("style") || {};
2517
+ W.value.setData("style", {
2438
2518
  ...t,
2439
2519
  ...e
2440
- }), S.render();
2441
- }, Ce = (e) => {
2442
- !S || !z.value || z.value.setData({ note: e });
2443
- }, we = (e) => {
2444
- !S || !z.value || z.value.setData({ tag: e });
2445
- }, Te = ({ hyperlink: e, hyperlinkTitle: t }) => {
2446
- !S || !z.value || z.value.setData({
2520
+ }), P.render();
2521
+ }, Ae = (e) => {
2522
+ !P || !W.value || W.value.setData({ note: e });
2523
+ }, je = (e) => {
2524
+ !P || !W.value || W.value.setData({ tag: e });
2525
+ }, Me = ({ hyperlink: e, hyperlinkTitle: t }) => {
2526
+ !P || !W.value || W.value.setData({
2447
2527
  hyperlink: e,
2448
2528
  hyperlinkTitle: t
2449
2529
  });
2450
- }, Ee = (e) => {
2451
- e === "png" || e === "svg" ? l.value = !0 : Oe(e);
2452
- }, De = async (e) => {
2530
+ }, Ne = (e) => {
2531
+ e === "png" || e === "svg" ? v.value = !0 : Fe(e);
2532
+ }, Pe = async (e) => {
2453
2533
  j.info("AI生成功能开发中,敬请期待...");
2454
- }, Oe = async (e) => {
2455
- if (S) try {
2456
- e === "png" ? await S.export.exportImg() : e === "svg" ? await S.export.exportSvg() : e === "pdf" && await S.export.exportPdf(), j.success("导出成功");
2534
+ }, Fe = async (e) => {
2535
+ if (P) try {
2536
+ e === "png" ? await P.export.exportImg() : e === "svg" ? await P.export.exportSvg() : e === "pdf" && await P.export.exportPdf(), j.success("导出成功");
2457
2537
  } catch (e) {
2458
2538
  j.error("导出失败: " + e.message);
2459
2539
  }
2460
- }, ke = async () => {
2461
- if (S) {
2462
- if (O.value && !N.value && (!E || !E.isConnected.value || E.collaborationClosed.value)) {
2540
+ }, Ie = async () => {
2541
+ if (P) {
2542
+ if (L.value && !R.value && (!I || !I.isConnected.value || I.collaborationClosed.value)) {
2463
2543
  j.error("协作已关闭,无法提交保存");
2464
2544
  return;
2465
2545
  }
2466
- if (!I.value?.trim()) {
2546
+ if (!V.value?.trim()) {
2467
2547
  j.warning("请输入思维导图标题");
2468
2548
  return;
2469
2549
  }
2470
- if (!L.value?.trim()) {
2550
+ if (!H.value?.trim()) {
2471
2551
  j.warning("请输入作者");
2472
2552
  return;
2473
2553
  }
2474
2554
  try {
2475
- let e = S.getData(), t = JSON.stringify(e), i = n.params.id, { documentAPI: a } = await import("./api-D2rfJWe_.mjs");
2476
- if (i) await a.update(i, {
2555
+ let e = P.getData(), t = JSON.stringify(e), r = l.value, i = {
2556
+ title: V.value.trim(),
2477
2557
  content: t,
2478
- title: I.value.trim(),
2479
2558
  doc_type: "mindmap"
2480
- }), R.value = i;
2559
+ }, a = typeof n.saveApi == "function" ? n.saveApi : n.saveApi ? (e) => r ? N.put(`${n.saveApi}/${r}`, e) : N.post(n.saveApi, e) : null;
2560
+ if (a) U.value = (await a(i, r)).data?.id || r;
2561
+ else if (r) await d.value.update(r, i), U.value = r;
2481
2562
  else {
2482
- let e = await a.create({
2483
- title: I.value.trim(),
2484
- content: t,
2485
- doc_type: "mindmap"
2486
- });
2487
- R.value = e.data.id, r.replace(`/mindmap-editor/${e.data.id}`);
2563
+ let e = await d.value.create(i);
2564
+ U.value = e.data.id, n.docId || o.replace(`/mindmap-editor/${e.data.id}`);
2488
2565
  }
2489
- te = JSON.parse(JSON.stringify(e)), j.success("保存成功"), h({
2490
- documentId: String(R.value || ""),
2566
+ re = JSON.parse(JSON.stringify(e)), j.success("保存成功"), T({
2567
+ documentId: String(U.value || ""),
2491
2568
  docType: "mindmap",
2492
2569
  content: JSON.stringify(e),
2493
- userId: String(v.currentUser.value?.id || ""),
2494
- userName: v.currentUser.value?.name || L.value || "未知"
2570
+ userId: String(E.currentUser.value?.id || ""),
2571
+ userName: E.currentUser.value?.name || H.value || "未知"
2495
2572
  });
2496
2573
  } catch (e) {
2497
2574
  j.error("保存失败: " + e.message);
2498
2575
  }
2499
2576
  }
2500
- }, Ae = (e) => {
2501
- b.value = {
2577
+ }, Le = (e) => {
2578
+ O.value = {
2502
2579
  visible: !0,
2503
2580
  x: e.clientX,
2504
2581
  y: e.clientY
2505
2582
  };
2506
- }, je = (e) => {
2583
+ }, Re = (e) => {
2507
2584
  switch (e) {
2508
2585
  case "insertChild":
2509
- Y("child");
2586
+ de("child");
2510
2587
  break;
2511
2588
  case "insertSibling":
2512
- Y("sibling");
2589
+ de("sibling");
2513
2590
  break;
2514
2591
  case "edit":
2515
- z.value && (S?.execCommand("ACTIVE_NODE", z.value), S?.textEdit.enterTextEdit());
2592
+ W.value && (P?.execCommand("ACTIVE_NODE", W.value), P?.textEdit.enterTextEdit());
2516
2593
  break;
2517
2594
  case "delete":
2518
- le();
2595
+ fe();
2519
2596
  break;
2520
2597
  case "copy":
2521
- S?.execCommand("COPY");
2598
+ P?.execCommand("COPY");
2522
2599
  break;
2523
2600
  case "cut":
2524
- S?.execCommand("CUT");
2601
+ P?.execCommand("CUT");
2525
2602
  break;
2526
2603
  case "paste":
2527
- S?.execCommand("PASTE");
2604
+ P?.execCommand("PASTE");
2528
2605
  break;
2529
2606
  }
2530
- }, Me = () => {
2531
- b.value.visible = !1;
2532
- }, Ne = [
2607
+ }, Ve = () => {
2608
+ O.value.visible = !1;
2609
+ }, He = [
2533
2610
  "我可以帮您梳理思维导图结构、扩展节点内容,或者提供思路启发。请问有什么需要帮助的?",
2534
2611
  "这个思维导图的层级结构很清晰。建议在二级节点下添加更多细节,让内容更加丰富。",
2535
2612
  "根据当前的主题,我建议您尝试从不同维度展开思考,比如时间、空间、因果、对比等角度。",
@@ -2538,78 +2615,81 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2538
2615
  "建议使用不同的颜色和图标来区分不同分支的重要性,这样可以让思维导图更加直观。",
2539
2616
  "这个思维导图的逻辑框架不错。建议在关键节点添加备注,方便后续回顾和补充。",
2540
2617
  "我可以帮您将思维导图转换为大纲文本,或者根据现有内容生成新的分支建议。"
2541
- ], Pe = async (e, t = {}) => {
2542
- let r = n.params.id ? `${zt}-${n.params.id}` : null;
2543
- await v.sendMessage(e, {
2618
+ ], We = async (e, t = {}) => {
2619
+ let n = l.value ? `${Ht}-${l.value}` : null;
2620
+ await E.sendMessage(e, {
2544
2621
  ...t,
2545
- roomId: r
2622
+ roomId: n
2546
2623
  });
2547
- let i = t.mentionedUser, a = i && i.toLowerCase().includes("ai"), o = v.collabUsers.value.filter((e) => e.name !== v.currentUser.value.name);
2548
- (!i || a || o.length === 0) && (v.loading.value = !0, setTimeout(() => {
2549
- v.sendAiMessage(Ne[Math.floor(Math.random() * Ne.length)], r), v.loading.value = !1;
2624
+ let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a = E.collabUsers.value.filter((e) => e.name !== E.currentUser.value.name);
2625
+ (!r || i || a.length === 0) && (E.loading.value = !0, setTimeout(() => {
2626
+ E.sendAiMessage(He[Math.floor(Math.random() * He.length)], n), E.loading.value = !1;
2550
2627
  }, 800 + Math.random() * 1200));
2551
- }, Fe = () => {
2552
- let e = n.params.id ? `${zt}-${n.params.id}` : null;
2553
- v.clearMessages(e);
2554
- }, Re = () => {
2555
- if (!n.params.id) {
2628
+ }, Ge = () => {
2629
+ let e = l.value ? `${Ht}-${l.value}` : null;
2630
+ E.clearMessages(e);
2631
+ }, Ke = () => {
2632
+ if (!l.value) {
2556
2633
  j.warning("请先保存文档");
2557
2634
  return;
2558
2635
  }
2559
- f.value = !0;
2560
- }, ze = (e) => {
2636
+ S.value = !0;
2637
+ }, qe = (e) => {
2561
2638
  try {
2562
2639
  let t = typeof e == "string" ? JSON.parse(e) : e;
2563
- t && S && (S.setData(t), u(() => {
2564
- S.getElRectInfo(), S.resize(), S.view.fit(void 0, !0);
2640
+ t && P && (P.setData(t), u(() => {
2641
+ P.getElRectInfo(), P.resize(), P.view.fit(void 0, !0);
2565
2642
  }));
2566
2643
  } catch (e) {
2567
2644
  console.error("Version apply error:", e);
2568
2645
  }
2569
2646
  };
2570
2647
  return m(async () => {
2571
- await u(), await ne(), document.addEventListener("click", Me), n.query.collab === "1" && n.params.id && await oe();
2648
+ await u(), await ie(), document.addEventListener("click", Ve), r.query.collab === "1" && l.value && await ce();
2572
2649
  }), p(() => {
2573
- document.removeEventListener("click", Me), Z && clearTimeout(Z), E &&= (E.destroy(), null), $ &&= ($.disconnect(), null), S &&= (S.destroy(), null);
2650
+ document.removeEventListener("click", Ve), $ && clearTimeout($), I &&= (I.destroy(), null), we &&= (we.disconnect(), null), P &&= (P.destroy(), null);
2574
2651
  }), (e, t) => {
2575
2652
  let n = y("el-icon"), r = y("el-button");
2576
- return g(), i("div", Lt, [
2577
- s(ht, {
2578
- "undo-count": W.value,
2579
- "redo-count": G.value,
2580
- "current-layout": H.value,
2581
- "current-theme": U.value,
2582
- "zoom-percent": K.value,
2583
- "auto-fit": q.value,
2584
- "is-collaborating": O.value,
2585
- "is-collab-owner": N.value,
2586
- "collab-users": F.value,
2587
- "model-title": I.value,
2588
- "model-author": L.value,
2589
- "is-root-node": V.value,
2590
- onBack: ce,
2591
- onUndo: de,
2592
- onRedo: fe,
2593
- onInsertChild: t[0] ||= (e) => Y("child"),
2594
- onInsertSibling: t[1] ||= (e) => Y("sibling"),
2595
- onReverseLayout: ue,
2596
- onDeleteNode: le,
2597
- onChangeLayout: ye,
2598
- onChangeTheme: be,
2599
- onZoomIn: X,
2600
- onZoomOut: pe,
2601
- onFitView: me,
2602
- onToggleAutoFit: t[2] ||= (e) => q.value = !q.value,
2603
- onResetView: _e,
2604
- onExport: Ee,
2605
- onSave: ke,
2606
- onToggleCollab: t[3] ||= (e) => O.value ? ae() : ie(),
2607
- onShareCollab: se,
2608
- "onUpdate:title": t[4] ||= (e) => I.value = e,
2609
- "onUpdate:author": t[5] ||= (e) => L.value = e,
2610
- onAiGenerate: De,
2611
- "show-history": !!R.value,
2612
- onHistory: Re
2653
+ return g(), i("div", Bt, [
2654
+ s(vt, {
2655
+ "undo-count": J.value,
2656
+ "redo-count": Y.value,
2657
+ "current-layout": q.value,
2658
+ "current-theme": ee.value,
2659
+ "zoom-percent": te.value,
2660
+ "auto-fit": Z.value,
2661
+ "is-collaborating": L.value,
2662
+ "is-collab-owner": R.value,
2663
+ "collab-users": B.value,
2664
+ "model-title": V.value,
2665
+ "model-author": H.value,
2666
+ "is-root-node": K.value,
2667
+ "back-button": c.value.backButton,
2668
+ "title-editable": c.value.titleEditable,
2669
+ "author-editable": c.value.authorEditable,
2670
+ onBack: ue,
2671
+ onUndo: he,
2672
+ onRedo: Q,
2673
+ onInsertChild: t[0] ||= (e) => de("child"),
2674
+ onInsertSibling: t[1] ||= (e) => de("sibling"),
2675
+ onReverseLayout: pe,
2676
+ onDeleteNode: fe,
2677
+ onChangeLayout: Ee,
2678
+ onChangeTheme: De,
2679
+ onZoomIn: _e,
2680
+ onZoomOut: ve,
2681
+ onFitView: ye,
2682
+ onToggleAutoFit: t[2] ||= (e) => Z.value = !Z.value,
2683
+ onResetView: Ce,
2684
+ onExport: Ne,
2685
+ onSave: Ie,
2686
+ onToggleCollab: t[3] ||= (e) => L.value ? se() : oe(),
2687
+ onShareCollab: le,
2688
+ "onUpdate:title": t[4] ||= (e) => V.value = e,
2689
+ "onUpdate:author": t[5] ||= (e) => H.value = e,
2690
+ onAiGenerate: Pe,
2691
+ "show-history": !!U.value,
2692
+ onHistory: Ke
2613
2693
  }, null, 8, [
2614
2694
  "undo-count",
2615
2695
  "redo-count",
@@ -2623,70 +2703,73 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2623
2703
  "model-title",
2624
2704
  "model-author",
2625
2705
  "is-root-node",
2706
+ "back-button",
2707
+ "title-editable",
2708
+ "author-editable",
2626
2709
  "show-history"
2627
2710
  ]),
2628
- a("div", Rt, [a("div", {
2711
+ a("div", Vt, [a("div", {
2629
2712
  class: "canvas-area",
2630
2713
  ref_key: "canvasRef",
2631
- ref: c,
2632
- onContextmenu: D(Ae, ["prevent"])
2714
+ ref: h,
2715
+ onContextmenu: D(Le, ["prevent"])
2633
2716
  }, [a("div", {
2634
2717
  class: "mindmap-container",
2635
2718
  ref_key: "containerRef",
2636
- ref: o
2637
- }, null, 512)], 544), s(Mt, {
2638
- visible: B.value,
2639
- node: z.value,
2640
- onClose: t[6] ||= (e) => z.value = null,
2641
- onUpdateText: xe,
2642
- onUpdateStyle: Se,
2643
- onUpdateNote: Ce,
2644
- onUpdateTags: we,
2645
- onUpdateHyperlink: Te
2719
+ ref: f
2720
+ }, null, 512)], 544), s(Ft, {
2721
+ visible: G.value,
2722
+ node: W.value,
2723
+ onClose: t[6] ||= (e) => W.value = null,
2724
+ onUpdateText: Oe,
2725
+ onUpdateStyle: ke,
2726
+ onUpdateNote: Ae,
2727
+ onUpdateTags: je,
2728
+ onUpdateHyperlink: Me
2646
2729
  }, null, 8, ["visible", "node"])]),
2647
- s(Nt, {
2648
- visible: b.value.visible,
2649
- x: b.value.x,
2650
- y: b.value.y,
2651
- onCommand: je,
2652
- onClose: t[7] ||= (e) => b.value.visible = !1
2730
+ s(It, {
2731
+ visible: O.value.visible,
2732
+ x: O.value.x,
2733
+ y: O.value.y,
2734
+ onCommand: Re,
2735
+ onClose: t[7] ||= (e) => O.value.visible = !1
2653
2736
  }, null, 8, [
2654
2737
  "visible",
2655
2738
  "x",
2656
2739
  "y"
2657
2740
  ]),
2658
- s(Ft, {
2659
- visible: l.value,
2660
- "onUpdate:visible": t[8] ||= (e) => l.value = e,
2661
- onExport: Oe
2741
+ s(Rt, {
2742
+ visible: v.value,
2743
+ "onUpdate:visible": t[8] ||= (e) => v.value = e,
2744
+ onExport: Fe
2662
2745
  }, null, 8, ["visible"]),
2663
2746
  s(r, {
2664
2747
  class: "ai-chat-fab",
2665
- type: d.value ? "primary" : "default",
2748
+ type: b.value ? "primary" : "default",
2666
2749
  circle: "",
2667
2750
  size: "large",
2668
- onClick: t[9] ||= (e) => d.value = !d.value,
2751
+ onClick: t[9] ||= (e) => b.value = !b.value,
2669
2752
  title: "AI助手"
2670
2753
  }, {
2671
2754
  default: w(() => [s(n, null, {
2672
- default: w(() => [s(x(J))]),
2755
+ default: w(() => [s(x(X))]),
2673
2756
  _: 1
2674
2757
  })]),
2675
2758
  _: 1
2676
2759
  }, 8, ["type"]),
2677
- s(Ie, {
2678
- visible: d.value,
2679
- messages: x(v).messages.value,
2680
- loading: x(v).loading.value,
2681
- "is-collab": x(v).isCollabMode.value,
2682
- "collab-users": x(v).collabUsers.value,
2683
- "current-user": x(v).currentUser.value,
2684
- "is-owner": N.value,
2685
- onSend: Pe,
2686
- onClose: t[10] ||= (e) => d.value = !1,
2687
- "unread-mention": x(v).unreadMention.value,
2688
- onClearUnread: t[11] ||= (e) => x(v).clearUnreadMention(),
2689
- onClear: Fe
2760
+ s(ze, {
2761
+ visible: b.value,
2762
+ messages: x(E).messages.value,
2763
+ loading: x(E).loading.value,
2764
+ "is-collab": x(E).isCollabMode.value,
2765
+ "collab-users": x(E).collabUsers.value,
2766
+ "current-user": x(E).currentUser.value,
2767
+ "is-owner": R.value,
2768
+ onSend: We,
2769
+ onClose: t[10] ||= (e) => b.value = !1,
2770
+ "unread-mention": x(E).unreadMention.value,
2771
+ onClearUnread: t[11] ||= (e) => x(E).clearUnreadMention(),
2772
+ onClear: Ge
2690
2773
  }, null, 8, [
2691
2774
  "visible",
2692
2775
  "messages",
@@ -2697,16 +2780,16 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2697
2780
  "is-owner",
2698
2781
  "unread-mention"
2699
2782
  ]),
2700
- s(Qe, {
2701
- modelValue: f.value,
2702
- "onUpdate:modelValue": t[12] ||= (e) => f.value = e,
2703
- "document-id": R.value,
2704
- onApply: ze
2783
+ s(tt, {
2784
+ modelValue: S.value,
2785
+ "onUpdate:modelValue": t[12] ||= (e) => S.value = e,
2786
+ "document-id": U.value,
2787
+ onApply: qe
2705
2788
  }, null, 8, ["modelValue", "document-id"])
2706
2789
  ]);
2707
2790
  };
2708
2791
  }
2709
- }, [["__scopeId", "data-v-6b850065"]]), Vt = c({
2792
+ }, [["__scopeId", "data-v-b7ebbdb3"]]), Wt = c({
2710
2793
  name: "YourCompanyMindmap",
2711
2794
  props: {
2712
2795
  docId: {
@@ -2717,6 +2800,14 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2717
2800
  type: String,
2718
2801
  default: "/api"
2719
2802
  },
2803
+ saveApi: {
2804
+ type: [String, Function],
2805
+ default: null
2806
+ },
2807
+ loadApi: {
2808
+ type: [String, Function],
2809
+ default: null
2810
+ },
2720
2811
  wsUrl: {
2721
2812
  type: String,
2722
2813
  default: ""
@@ -2732,14 +2823,18 @@ var Re = "/api/document-versions", ze = 5e3, Be = () => {
2732
2823
  roomId: {
2733
2824
  type: String,
2734
2825
  default: ""
2826
+ },
2827
+ uiConfig: {
2828
+ type: Object,
2829
+ default: () => ({})
2735
2830
  }
2736
2831
  },
2737
2832
  setup(e, { slots: t }) {
2738
2833
  return () => l("div", {
2739
2834
  class: "yourcompany-mindmap-wrapper",
2740
2835
  style: "position:relative"
2741
- }, [l(Bt, { ...e }), l(O)]);
2836
+ }, [l(Ut, { ...e }), l(O)]);
2742
2837
  }
2743
2838
  });
2744
2839
  //#endregion
2745
- export { Vt as default };
2840
+ export { Wt as default };