@univerjs/docs-thread-comment-ui 0.16.1 → 0.17.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/lib/index.js CHANGED
@@ -1,23 +1,23 @@
1
- var Ie = Object.defineProperty;
2
- var Se = (e, t, r) => t in e ? Ie(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var Z = (e, t, r) => Se(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { CommandType as E, ICommandService as M, CustomDecorationType as Y, sequenceExecute as te, Inject as p, Disposable as j, UniverInstanceType as _, SHEET_EDITOR_UNITS as Oe, IUniverInstanceService as A, Injector as ne, isInternalEditorID as re, UserManagerService as Me, BuildTextUtils as De, DependentOn as be, IConfigService as Te, Plugin as xe, merge as Ue } from "@univerjs/core";
5
- import { addCustomDecorationBySelectionFactory as Re, deleteCustomDecorationFactory as ye, DocSelectionRenderService as Ee, DocBackScrollRenderController as Ae, DocRenderController as $e } from "@univerjs/docs-ui";
6
- import { IThreadCommentDataSourceService as Pe, AddCommentMutation as we, getDT as Ne, ThreadCommentModel as oe } from "@univerjs/thread-comment";
7
- import { SetActiveCommentOperation as ie, ThreadCommentPanelService as U, ThreadCommentPanel as Ve, UniverThreadCommentUIPlugin as je } from "@univerjs/thread-comment-ui";
8
- import { DocSelectionManagerService as B, DocSkeletonManagerService as Be, RichTextEditingMutation as se, SetTextSelectionsOperation as Fe, DocInterceptorService as He, DOC_INTERCEPTOR_POINT as Le } from "@univerjs/docs";
9
- import { IRenderManagerService as F, withCurrentTypeOfRenderer as We, DocumentEditArea as X } from "@univerjs/engine-render";
10
- import { ISidebarService as H, getMenuHiddenObservable as de, MenuItemType as ce, useDependency as y, useObservable as K, ContextMenuPosition as Ze, ContextMenuGroup as Ke, RibbonInsertGroup as Ge, IMenuManagerService as Je, ComponentManager as qe } from "@univerjs/ui";
11
- import { BehaviorSubject as Ye, Observable as ae, debounceTime as me, filter as ze } from "rxjs";
1
+ var Se = Object.defineProperty;
2
+ var Oe = (e, t, r) => t in e ? Se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var K = (e, t, r) => Oe(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { CommandType as A, ICommandService as M, CustomDecorationType as Y, sequenceExecute as ne, Inject as p, Disposable as j, UniverInstanceType as v, SHEET_EDITOR_UNITS as Me, IUniverInstanceService as $, Injector as re, isInternalEditorID as oe, UserManagerService as De, BuildTextUtils as be, DependentOn as Te, IConfigService as xe, Plugin as Ue, merge as Re } from "@univerjs/core";
5
+ import { addCustomDecorationBySelectionFactory as ye, deleteCustomDecorationFactory as Ee, DocSelectionRenderService as Ae, DocBackScrollRenderController as $e, DocRenderController as Pe } from "@univerjs/docs-ui";
6
+ import { IThreadCommentDataSourceService as we, AddCommentMutation as Ne, getDT as Ve, ThreadCommentModel as ie } from "@univerjs/thread-comment";
7
+ import { SetActiveCommentOperation as se, ThreadCommentPanelService as R, ThreadCommentPanel as je, UniverThreadCommentUIPlugin as Be } from "@univerjs/thread-comment-ui";
8
+ import { DocSelectionManagerService as B, DocSkeletonManagerService as Fe, RichTextEditingMutation as de, SetTextSelectionsOperation as He, DocInterceptorService as Le, DOC_INTERCEPTOR_POINT as We } from "@univerjs/docs";
9
+ import { IRenderManagerService as F, withCurrentTypeOfRenderer as Ze, DocumentEditArea as X } from "@univerjs/engine-render";
10
+ import { ISidebarService as H, getMenuHiddenObservable as ce, MenuItemType as ae, useDependency as E, useObservable as G, ContextMenuPosition as Ke, ContextMenuGroup as Ge, RibbonInsertGroup as Je, IMenuManagerService as ke, ComponentManager as qe } from "@univerjs/ui";
11
+ import { BehaviorSubject as Ye, Observable as me, debounceTime as le, filter as ze } from "rxjs";
12
12
  import { jsx as Qe } from "react/jsx-runtime";
13
- import { useMemo as G, useState as Xe, useEffect as ke, useRef as et, createElement as le, forwardRef as tt } from "react";
14
- const nt = "DOC_THREAD_COMMENT_UI_PLUGIN", I = "default_doc", ue = {
13
+ import { useMemo as J, useState as Xe, useEffect as et, useRef as tt, createElement as ue, forwardRef as nt } from "react";
14
+ const rt = "DOC_THREAD_COMMENT_UI_PLUGIN", I = "default_doc", Ce = {
15
15
  id: "docs.command.add-comment",
16
- type: E.COMMAND,
16
+ type: A.COMMAND,
17
17
  async handler(e, t) {
18
18
  if (!t)
19
19
  return !1;
20
- const { comment: r, unitId: n } = t, i = await e.get(Pe).addComment(r), s = e.get(M), d = Re(
20
+ const { comment: r, unitId: n } = t, i = await e.get(we).addComment(r), s = e.get(M), d = ye(
21
21
  e,
22
22
  {
23
23
  id: i.threadId,
@@ -27,47 +27,47 @@ const nt = "DOC_THREAD_COMMENT_UI_PLUGIN", I = "default_doc", ue = {
27
27
  );
28
28
  if (d) {
29
29
  const l = {
30
- id: we.id,
30
+ id: Ne.id,
31
31
  params: {
32
32
  unitId: n,
33
33
  subUnitId: I,
34
34
  comment: i
35
35
  }
36
36
  }, C = {
37
- id: ie.id,
37
+ id: se.id,
38
38
  params: {
39
39
  unitId: n,
40
40
  subUnitId: I,
41
41
  commentId: i.id
42
42
  }
43
43
  };
44
- return (await te([l, d, C], s)).result;
44
+ return (await ne([l, d, C], s)).result;
45
45
  }
46
46
  return !1;
47
47
  }
48
- }, Ce = {
48
+ }, he = {
49
49
  id: "docs.command.delete-comment",
50
- type: E.COMMAND,
50
+ type: A.COMMAND,
51
51
  async handler(e, t) {
52
52
  if (!t)
53
53
  return !1;
54
- const { commentId: r, unitId: n } = t, o = e.get(M), i = ye(e, {
54
+ const { commentId: r, unitId: n } = t, o = e.get(M), i = Ee(e, {
55
55
  id: r,
56
56
  unitId: n
57
57
  });
58
- return i ? (await te([i], o)).result : !1;
58
+ return i ? (await ne([i], o)).result : !1;
59
59
  }
60
60
  };
61
- var rt = Object.getOwnPropertyDescriptor, ot = (e, t, r, n) => {
62
- for (var o = n > 1 ? void 0 : n ? rt(t, r) : t, i = e.length - 1, s; i >= 0; i--)
61
+ var ot = Object.getOwnPropertyDescriptor, it = (e, t, r, n) => {
62
+ for (var o = n > 1 ? void 0 : n ? ot(t, r) : t, i = e.length - 1, s; i >= 0; i--)
63
63
  (s = e[i]) && (o = s(o) || o);
64
64
  return o;
65
- }, k = (e, t) => (r, n) => t(r, n, e);
65
+ }, ee = (e, t) => (r, n) => t(r, n, e);
66
66
  let x = class extends j {
67
67
  constructor(t, r) {
68
68
  super();
69
- Z(this, "_addingComment$", new Ye(void 0));
70
- Z(this, "addingComment$", this._addingComment$.asObservable());
69
+ K(this, "_addingComment$", new Ye(void 0));
70
+ K(this, "addingComment$", this._addingComment$.asObservable());
71
71
  this._sidebarService = t, this._threadCommentPanelService = r, this.disposeWithMe(() => {
72
72
  this._addingComment$.complete();
73
73
  });
@@ -82,16 +82,16 @@ let x = class extends j {
82
82
  this._addingComment$.next(void 0);
83
83
  }
84
84
  };
85
- x = ot([
86
- k(0, H),
87
- k(1, p(U))
85
+ x = it([
86
+ ee(0, H),
87
+ ee(1, p(R))
88
88
  ], x);
89
- const he = (e) => {
89
+ const fe = (e) => {
90
90
  var s;
91
- const t = e.get(F), r = e.get(B), n = (s = We(
92
- _.UNIVER_DOC,
93
- Be,
94
- e.get(A),
91
+ const t = e.get(F), r = e.get(B), n = (s = Ze(
92
+ v.UNIVER_DOC,
93
+ Fe,
94
+ e.get($),
95
95
  t
96
96
  )) == null ? void 0 : s.getSkeleton(), o = n == null ? void 0 : n.getViewModel().getEditArea();
97
97
  if (o === X.FOOTER || o === X.HEADER)
@@ -99,17 +99,17 @@ const he = (e) => {
99
99
  const i = r.getActiveTextRange();
100
100
  return !!(i == null || i.collapsed);
101
101
  };
102
- function it(e) {
102
+ function st(e) {
103
103
  return {
104
104
  id: L.id,
105
- type: ce.BUTTON,
105
+ type: ae.BUTTON,
106
106
  icon: "CommentIcon",
107
107
  title: "threadCommentUI.panel.addComment",
108
108
  tooltip: "threadCommentUI.panel.addComment",
109
- hidden$: de(e, _.UNIVER_DOC, void 0, Oe),
110
- disabled$: new ae(function(t) {
111
- const n = e.get(B).textSelection$.pipe(me(16)).subscribe(() => {
112
- t.next(he(e));
109
+ hidden$: ce(e, v.UNIVER_DOC, void 0, Me),
110
+ disabled$: new me(function(t) {
111
+ const n = e.get(B).textSelection$.pipe(le(16)).subscribe(() => {
112
+ t.next(fe(e));
113
113
  });
114
114
  return () => {
115
115
  n.unsubscribe();
@@ -117,52 +117,52 @@ function it(e) {
117
117
  })
118
118
  };
119
119
  }
120
- function st(e) {
120
+ function dt(e) {
121
121
  return {
122
122
  id: Q.id,
123
- type: ce.BUTTON,
123
+ type: ae.BUTTON,
124
124
  icon: "CommentIcon",
125
125
  title: "threadCommentUI.panel.addComment",
126
126
  tooltip: "threadCommentUI.panel.addComment",
127
- hidden$: de(e, _.UNIVER_DOC)
127
+ hidden$: ce(e, v.UNIVER_DOC)
128
128
  };
129
129
  }
130
130
  const O = () => {
131
- const e = y(A), t = y(ne), r = G(() => e.getCurrentTypeOfUnit$(_.UNIVER_DOC).pipe(ze((c) => !!c && !re(c.getUnitId()))), [e]), n = K(r), o = G(() => new ae((c) => c.next(I)), []), i = y(B), s = G(
132
- () => i.textSelection$.pipe(me(16)),
131
+ const e = E($), t = E(re), r = J(() => e.getCurrentTypeOfUnit$(v.UNIVER_DOC).pipe(ze((c) => !!c && !oe(c.getUnitId()))), [e]), n = G(r), o = J(() => new me((c) => c.next(I)), []), i = E(B), s = J(
132
+ () => i.textSelection$.pipe(le(16)),
133
133
  [i.textSelection$]
134
134
  );
135
- K(s);
136
- const d = y(M), l = y(x), C = K(l.addingComment$), [a, h] = Xe([]);
137
- if (ke(() => {
135
+ G(s);
136
+ const d = E(M), l = E(x), C = G(l.addingComment$), [a, h] = Xe([]);
137
+ if (et(() => {
138
138
  var D;
139
139
  const c = /* @__PURE__ */ new Set(), m = n == null ? void 0 : n.getCustomDecorations();
140
140
  h((D = m == null ? void 0 : m.map((u) => u.id).filter((u) => {
141
141
  const S = c.has(u);
142
142
  return c.add(u), !S;
143
143
  })) != null ? D : []);
144
- const v = d.onCommandExecuted((u) => {
144
+ const _ = d.onCommandExecuted((u) => {
145
145
  var S;
146
- if (u.id === se.id) {
147
- const R = /* @__PURE__ */ new Set(), W = n == null ? void 0 : n.getCustomDecorations();
148
- h((S = W == null ? void 0 : W.map(($) => $.id).filter(($) => {
149
- const ve = R.has($);
150
- return R.add($), !ve;
146
+ if (u.id === de.id) {
147
+ const y = /* @__PURE__ */ new Set(), Z = n == null ? void 0 : n.getCustomDecorations();
148
+ h((S = Z == null ? void 0 : Z.map((P) => P.id).filter((P) => {
149
+ const Ie = y.has(P);
150
+ return y.add(P), !Ie;
151
151
  })) != null ? S : []);
152
152
  }
153
153
  });
154
154
  return () => {
155
- v.dispose();
155
+ _.dispose();
156
156
  };
157
157
  }, [d, n]), !n)
158
158
  return null;
159
- const g = he(t), f = n.getUnitId();
159
+ const g = fe(t), f = n.getUnitId();
160
160
  return /* @__PURE__ */ Qe(
161
- Ve,
161
+ je,
162
162
  {
163
163
  unitId: f,
164
164
  subUnitId$: o,
165
- type: _.UNIVER_DOC,
165
+ type: v.UNIVER_DOC,
166
166
  onAdd: () => {
167
167
  d.executeCommand(L.id);
168
168
  },
@@ -176,7 +176,7 @@ const O = () => {
176
176
  range: C,
177
177
  comment: c
178
178
  };
179
- return d.executeCommand(ue.id, m), l.endAdd(), !1;
179
+ return d.executeCommand(Ce.id, m), l.endAdd(), !1;
180
180
  }
181
181
  return !0;
182
182
  },
@@ -186,7 +186,7 @@ const O = () => {
186
186
  unitId: f,
187
187
  commentId: c.id
188
188
  };
189
- return d.executeCommand(Ce.id, m), !1;
189
+ return d.executeCommand(he.id, m), !1;
190
190
  }
191
191
  return !0;
192
192
  },
@@ -195,12 +195,12 @@ const O = () => {
195
195
  );
196
196
  };
197
197
  O.componentKey = "univer.doc.thread-comment-panel";
198
- const P = {
198
+ const w = {
199
199
  id: "docs.operation.show-comment-panel",
200
- type: E.OPERATION,
200
+ type: A.OPERATION,
201
201
  handler(e, t) {
202
202
  var o;
203
- const r = e.get(U), n = e.get(H);
203
+ const r = e.get(R), n = e.get(H);
204
204
  return (!r.panelVisible || ((o = n.options.children) == null ? void 0 : o.label) !== O.componentKey) && (n.open({
205
205
  header: { title: "threadCommentUI.panel.title" },
206
206
  children: { label: O.componentKey },
@@ -210,10 +210,10 @@ const P = {
210
210
  }
211
211
  }, Q = {
212
212
  id: "docs.operation.toggle-comment-panel",
213
- type: E.OPERATION,
213
+ type: A.OPERATION,
214
214
  handler(e) {
215
215
  var n;
216
- const t = e.get(U), r = e.get(H);
216
+ const t = e.get(R), r = e.get(H);
217
217
  return !t.panelVisible || ((n = r.options.children) == null ? void 0 : n.label) !== O.componentKey ? (r.open({
218
218
  header: { title: "threadCommentUI.panel.title" },
219
219
  children: { label: O.componentKey },
@@ -223,22 +223,22 @@ const P = {
223
223
  }
224
224
  }, L = {
225
225
  id: "docs.operation.start-add-comment",
226
- type: E.OPERATION,
226
+ type: A.OPERATION,
227
227
  handler(e) {
228
- var u, S, R;
229
- const t = e.get(U), n = e.get(A).getCurrentUnitForType(_.UNIVER_DOC), o = e.get(B), i = e.get(F), s = e.get(Me), d = e.get(x), l = e.get(M), C = e.get(H), a = o.getActiveTextRange();
228
+ var u, S, y;
229
+ const t = e.get(R), n = e.get($).getCurrentUnitForType(v.UNIVER_DOC), o = e.get(B), i = e.get(F), s = e.get(De), d = e.get(x), l = e.get(M), C = e.get(H), a = o.getActiveTextRange();
230
230
  if (!n || !a)
231
231
  return !1;
232
- const h = (u = i.getRenderById(n.getUnitId())) == null ? void 0 : u.with(Ee);
232
+ const h = (u = i.getRenderById(n.getUnitId())) == null ? void 0 : u.with(Ae);
233
233
  if (h == null || h.setReserveRangesStatus(!0), a.collapsed)
234
- return t.panelVisible ? (t.setPanelVisible(!1), C.close()) : l.executeCommand(P.id), !0;
235
- l.executeCommand(P.id);
236
- const g = n.getUnitId(), f = ((R = (S = n.getBody()) == null ? void 0 : S.dataStream) != null ? R : "").slice(a.startOffset, a.endOffset), c = De.transform.getPlainText(f), m = I, v = "", D = {
234
+ return t.panelVisible ? (t.setPanelVisible(!1), C.close()) : l.executeCommand(w.id), !0;
235
+ l.executeCommand(w.id);
236
+ const g = n.getUnitId(), f = ((y = (S = n.getBody()) == null ? void 0 : S.dataStream) != null ? y : "").slice(a.startOffset, a.endOffset), c = be.transform.getPlainText(f), m = I, _ = "", D = {
237
237
  unitId: g,
238
238
  subUnitId: m,
239
- id: v,
239
+ id: _,
240
240
  ref: c,
241
- dT: Ne(),
241
+ dT: Ve(),
242
242
  personId: s.getCurrentUser().userID,
243
243
  text: {
244
244
  dataStream: `\r
@@ -247,21 +247,24 @@ const P = {
247
247
  startOffset: a.startOffset,
248
248
  endOffset: a.endOffset,
249
249
  collapsed: !0,
250
- threadId: v
250
+ threadId: _
251
251
  };
252
252
  return h == null || h.blur(), d.startAdd(D), t.setActiveComment({
253
253
  unitId: g,
254
254
  subUnitId: m,
255
- commentId: v
255
+ commentId: _
256
256
  }), !0;
257
257
  }
258
- }, dt = "docs-thread-comment-ui.config", ee = {};
259
- var ct = Object.getOwnPropertyDescriptor, at = (e, t, r, n) => {
260
- for (var o = n > 1 ? void 0 : n ? ct(t, r) : t, i = e.length - 1, s; i >= 0; i--)
258
+ }, ct = "@univerjs/docs-thread-comment-ui", at = "0.17.0", ge = {
259
+ name: ct,
260
+ version: at
261
+ }, mt = "docs-thread-comment-ui.config", te = {};
262
+ var lt = Object.getOwnPropertyDescriptor, ut = (e, t, r, n) => {
263
+ for (var o = n > 1 ? void 0 : n ? lt(t, r) : t, i = e.length - 1, s; i >= 0; i--)
261
264
  (s = e[i]) && (o = s(o) || o);
262
265
  return o;
263
266
  }, b = (e, t) => (r, n) => t(r, n, e);
264
- let w = class extends j {
267
+ let N = class extends j {
265
268
  constructor(e, t, r, n, o, i) {
266
269
  super(), this._threadCommentPanelService = e, this._univerInstanceService = t, this._commandService = r, this._docThreadCommentService = n, this._renderManagerService = o, this._threadCommentModel = i, this._initSelectionChange(), this._initActiveCommandChange();
267
270
  }
@@ -270,10 +273,10 @@ let w = class extends j {
270
273
  this.disposeWithMe(
271
274
  this._commandService.onCommandExecuted((t) => {
272
275
  var r, n, o, i;
273
- if (t.id === Fe.id) {
276
+ if (t.id === He.id) {
274
277
  const s = t.params, { unitId: d, ranges: l } = s;
275
- if (re(d)) return;
276
- const C = this._univerInstanceService.getUnit(d, _.UNIVER_DOC), a = l[0];
278
+ if (oe(d)) return;
279
+ const C = this._univerInstanceService.getUnit(d, v.UNIVER_DOC), a = l[0];
277
280
  if ((e == null ? void 0 : e.startOffset) === (a == null ? void 0 : a.startOffset) && (e == null ? void 0 : e.endOffset) === (a == null ? void 0 : a.endOffset))
278
281
  return;
279
282
  if (e = a, a && C) {
@@ -281,7 +284,7 @@ let w = class extends j {
281
284
  let c;
282
285
  if (f ? c = (n = (r = C.getBody()) == null ? void 0 : r.customDecorations) == null ? void 0 : n.find((m) => m.startIndex <= h && m.endIndex >= g - 1) : c = (i = (o = C.getBody()) == null ? void 0 : o.customDecorations) == null ? void 0 : i.find((m) => m.startIndex <= h && m.endIndex >= g - 1), c) {
283
286
  const m = this._threadCommentModel.getComment(d, I, c.id);
284
- m && !m.resolved && this._commandService.executeCommand(P.id, {
287
+ m && !m.resolved && this._commandService.executeCommand(w.id, {
285
288
  activeComment: {
286
289
  unitId: d,
287
290
  subUnitId: I,
@@ -293,7 +296,7 @@ let w = class extends j {
293
296
  }
294
297
  if (!this._threadCommentPanelService.activeCommentId)
295
298
  return;
296
- this._commandService.executeCommand(ie.id);
299
+ this._commandService.executeCommand(se.id);
297
300
  }
298
301
  })
299
302
  );
@@ -304,7 +307,7 @@ let w = class extends j {
304
307
  if (e) {
305
308
  const i = this._univerInstanceService.getUnit(e.unitId);
306
309
  if (i) {
307
- const s = (t = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : t.with(Ae), d = (n = (r = i.getBody()) == null ? void 0 : r.customDecorations) == null ? void 0 : n.find((l) => l.id === e.commentId);
310
+ const s = (t = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : t.with($e), d = (n = (r = i.getBody()) == null ? void 0 : r.customDecorations) == null ? void 0 : n.find((l) => l.id === e.commentId);
308
311
  d && s && s.scrollToRange({
309
312
  startOffset: d.startIndex,
310
313
  endOffset: d.endIndex,
@@ -316,17 +319,17 @@ let w = class extends j {
316
319
  }));
317
320
  }
318
321
  };
319
- w = at([
320
- b(0, p(U)),
321
- b(1, A),
322
+ N = ut([
323
+ b(0, p(R)),
324
+ b(1, $),
322
325
  b(2, M),
323
326
  b(3, p(x)),
324
327
  b(4, F),
325
- b(5, p(oe))
326
- ], w);
327
- function fe({ ref: e, ...t }) {
328
- const { icon: r, id: n, className: o, extend: i, ...s } = t, d = `univerjs-icon univerjs-icon-${n} ${o || ""}`.trim(), l = et(`_${ut()}`);
329
- return ge(r, `${n}`, {
328
+ b(5, p(ie))
329
+ ], N);
330
+ function pe({ ref: e, ...t }) {
331
+ const { icon: r, id: n, className: o, extend: i, ...s } = t, d = `univerjs-icon univerjs-icon-${n} ${o || ""}`.trim(), l = tt(`_${ft()}`);
332
+ return ve(r, `${n}`, {
330
333
  defIds: r.defIds,
331
334
  idSuffix: l.current
332
335
  }, {
@@ -335,14 +338,14 @@ function fe({ ref: e, ...t }) {
335
338
  ...s
336
339
  }, i);
337
340
  }
338
- function ge(e, t, r, n, o) {
339
- return le(e.tag, {
341
+ function ve(e, t, r, n, o) {
342
+ return ue(e.tag, {
340
343
  key: t,
341
- ...mt(e, r, o),
344
+ ...Ct(e, r, o),
342
345
  ...n
343
- }, (lt(e, r).children || []).map((i, s) => ge(i, `${t}-${e.tag}-${s}`, r, void 0, o)));
346
+ }, (ht(e, r).children || []).map((i, s) => ve(i, `${t}-${e.tag}-${s}`, r, void 0, o)));
344
347
  }
345
- function mt(e, t, r) {
348
+ function Ct(e, t, r) {
346
349
  const n = { ...e.attrs };
347
350
  r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1), e.tag === "mask" && n.id && (n.id = n.id + t.idSuffix), Object.entries(n).forEach(([i, s]) => {
348
351
  i === "mask" && typeof s == "string" && (n[i] = s.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
@@ -352,7 +355,7 @@ function mt(e, t, r) {
352
355
  typeof s == "string" && (n[i] = s.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
353
356
  })), n;
354
357
  }
355
- function lt(e, t) {
358
+ function ht(e, t) {
356
359
  var n;
357
360
  const { defIds: r } = t;
358
361
  return !r || r.length === 0 ? e : e.tag === "defs" && ((n = e.children) != null && n.length) ? {
@@ -366,11 +369,11 @@ function lt(e, t) {
366
369
  } : o)
367
370
  } : e;
368
371
  }
369
- function ut() {
372
+ function ft() {
370
373
  return Math.random().toString(36).substring(2, 8);
371
374
  }
372
- fe.displayName = "UniverIcon";
373
- const Ct = {
375
+ pe.displayName = "UniverIcon";
376
+ const gt = {
374
377
  tag: "svg",
375
378
  attrs: {
376
379
  xmlns: "http://www.w3.org/2000/svg",
@@ -420,44 +423,44 @@ const Ct = {
420
423
  }
421
424
  }
422
425
  ]
423
- }, pe = tt(function(t, r) {
424
- return le(fe, Object.assign({}, t, {
426
+ }, _e = nt(function(t, r) {
427
+ return ue(pe, Object.assign({}, t, {
425
428
  id: "comment-icon",
426
429
  ref: r,
427
- icon: Ct
430
+ icon: gt
428
431
  }));
429
432
  });
430
- pe.displayName = "CommentIcon";
431
- const ht = {
432
- [Ge.MEDIA]: {
433
+ _e.displayName = "CommentIcon";
434
+ const pt = {
435
+ [Je.MEDIA]: {
433
436
  [Q.id]: {
434
437
  order: 3,
435
- menuItemFactory: st
438
+ menuItemFactory: dt
436
439
  }
437
440
  },
438
- [Ze.MAIN_AREA]: {
439
- [Ke.DATA]: {
441
+ [Ke.MAIN_AREA]: {
442
+ [Ge.DATA]: {
440
443
  [L.id]: {
441
444
  order: 1,
442
- menuItemFactory: it
445
+ menuItemFactory: st
443
446
  }
444
447
  }
445
448
  }
446
449
  };
447
- var ft = Object.getOwnPropertyDescriptor, gt = (e, t, r, n) => {
448
- for (var o = n > 1 ? void 0 : n ? ft(t, r) : t, i = e.length - 1, s; i >= 0; i--)
450
+ var vt = Object.getOwnPropertyDescriptor, _t = (e, t, r, n) => {
451
+ for (var o = n > 1 ? void 0 : n ? vt(t, r) : t, i = e.length - 1, s; i >= 0; i--)
449
452
  (s = e[i]) && (o = s(o) || o);
450
453
  return o;
451
- }, J = (e, t) => (r, n) => t(r, n, e);
452
- let N = class extends j {
454
+ }, k = (e, t) => (r, n) => t(r, n, e);
455
+ let V = class extends j {
453
456
  constructor(e, t, r) {
454
457
  super(), this._commandService = e, this._menuManagerService = t, this._componentManager = r, this._initCommands(), this._initMenus(), this._initComponents();
455
458
  }
456
459
  _initCommands() {
457
460
  [
458
- ue,
459
461
  Ce,
460
- P,
462
+ he,
463
+ w,
461
464
  L,
462
465
  Q
463
466
  ].forEach((e) => {
@@ -465,12 +468,12 @@ let N = class extends j {
465
468
  });
466
469
  }
467
470
  _initMenus() {
468
- this._menuManagerService.mergeMenu(ht);
471
+ this._menuManagerService.mergeMenu(pt);
469
472
  }
470
473
  _initComponents() {
471
474
  [
472
475
  [O.componentKey, O],
473
- ["CommentIcon", pe]
476
+ ["CommentIcon", _e]
474
477
  ].forEach(([e, t]) => {
475
478
  this.disposeWithMe(
476
479
  this._componentManager.register(e, t)
@@ -478,13 +481,13 @@ let N = class extends j {
478
481
  });
479
482
  }
480
483
  };
481
- N = gt([
482
- J(0, M),
483
- J(1, Je),
484
- J(2, p(qe))
485
- ], N);
486
- var pt = Object.getOwnPropertyDescriptor, _t = (e, t, r, n) => {
487
- for (var o = n > 1 ? void 0 : n ? pt(t, r) : t, i = e.length - 1, s; i >= 0; i--)
484
+ V = _t([
485
+ k(0, M),
486
+ k(1, ke),
487
+ k(2, p(qe))
488
+ ], V);
489
+ var It = Object.getOwnPropertyDescriptor, St = (e, t, r, n) => {
490
+ for (var o = n > 1 ? void 0 : n ? It(t, r) : t, i = e.length - 1, s; i >= 0; i--)
488
491
  (s = e[i]) && (o = s(o) || o);
489
492
  return o;
490
493
  }, T = (e, t) => (r, n) => t(r, n, e);
@@ -499,14 +502,14 @@ let z = class extends j {
499
502
  this._docRenderController.reRender(e.unitId);
500
503
  return;
501
504
  }
502
- const t = (r = this._univerInstanceService.getCurrentUnitForType(_.UNIVER_DOC)) == null ? void 0 : r.getUnitId();
505
+ const t = (r = this._univerInstanceService.getCurrentUnitForType(v.UNIVER_DOC)) == null ? void 0 : r.getUnitId();
503
506
  t && this._docRenderController.reRender(t);
504
507
  })), this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe((e) => {
505
508
  e.type === "resolve" && this._docRenderController.reRender(e.unitId);
506
509
  }));
507
510
  }
508
511
  _interceptorViewModel() {
509
- this._docInterceptorService.intercept(Le.CUSTOM_DECORATION, {
512
+ this._docInterceptorService.intercept(We.CUSTOM_DECORATION, {
510
513
  handler: (e, t, r) => {
511
514
  if (!e)
512
515
  return r(e);
@@ -534,77 +537,79 @@ let z = class extends j {
534
537
  let n = r.sort();
535
538
  this.disposeWithMe(this._commandService.onCommandExecuted((d) => {
536
539
  var l, C, a;
537
- if (d.id === se.id) {
540
+ if (d.id === de.id) {
538
541
  if (d.params.unitId !== this._context.unit.getUnitId())
539
542
  return;
540
543
  const g = (a = (C = (l = this._context.unit.getBody()) == null ? void 0 : l.customDecorations) == null ? void 0 : C.filter((c) => c.type === Y.COMMENT).map((c) => c.id)) != null ? a : [], f = g.sort();
541
544
  if (JSON.stringify(n) !== JSON.stringify(f)) {
542
- const c = new Set(n), m = new Set(f), v = /* @__PURE__ */ new Set(), D = /* @__PURE__ */ new Set();
545
+ const c = new Set(n), m = new Set(f), _ = /* @__PURE__ */ new Set(), D = /* @__PURE__ */ new Set();
543
546
  g.forEach((u) => {
544
- c.has(u) || v.add(u);
547
+ c.has(u) || _.add(u);
545
548
  }), n.forEach((u) => {
546
549
  m.has(u) || D.add(u);
547
- }), n = f, v.forEach((u) => {
550
+ }), n = f, _.forEach((u) => {
548
551
  this._threadCommentModel.getComment(e, t, u) || this._threadCommentModel.addComment(e, t, { id: u, threadId: u, ref: "", dT: "", personId: "", text: { dataStream: "" }, unitId: e, subUnitId: t });
549
- }), this._threadCommentModel.syncThreadComments(e, t, [...v]);
552
+ }), this._threadCommentModel.syncThreadComments(e, t, [..._]);
550
553
  }
551
554
  }
552
555
  }));
553
556
  }
554
557
  };
555
- z = _t([
556
- T(1, p(He)),
557
- T(2, p(U)),
558
- T(3, p($e)),
559
- T(4, A),
560
- T(5, p(oe)),
558
+ z = St([
559
+ T(1, p(Le)),
560
+ T(2, p(R)),
561
+ T(3, p(Pe)),
562
+ T(4, $),
563
+ T(5, p(ie)),
561
564
  T(6, M)
562
565
  ], z);
563
- var vt = Object.defineProperty, It = Object.getOwnPropertyDescriptor, St = (e, t, r) => t in e ? vt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ot = (e, t, r, n) => {
564
- for (var o = n > 1 ? void 0 : n ? It(t, r) : t, i = e.length - 1, s; i >= 0; i--)
566
+ var Ot = Object.defineProperty, Mt = Object.getOwnPropertyDescriptor, Dt = (e, t, r) => t in e ? Ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, bt = (e, t, r, n) => {
567
+ for (var o = n > 1 ? void 0 : n ? Mt(t, r) : t, i = e.length - 1, s; i >= 0; i--)
565
568
  (s = e[i]) && (o = s(o) || o);
566
569
  return o;
567
- }, q = (e, t) => (r, n) => t(r, n, e), _e = (e, t, r) => St(e, typeof t != "symbol" ? t + "" : t, r);
568
- let V = class extends xe {
569
- constructor(e = ee, t, r, n) {
570
+ }, q = (e, t) => (r, n) => t(r, n, e), W = (e, t, r) => Dt(e, typeof t != "symbol" ? t + "" : t, r);
571
+ let U = class extends Ue {
572
+ constructor(e = te, t, r, n) {
570
573
  super(), this._config = e, this._injector = t, this._renderManagerSrv = r, this._configService = n;
571
- const { menu: o, ...i } = Ue(
574
+ const { menu: o, ...i } = Re(
572
575
  {},
573
- ee,
576
+ te,
574
577
  this._config
575
578
  );
576
- o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(dt, i);
579
+ o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(mt, i);
577
580
  }
578
581
  onStarting() {
579
582
  [
583
+ [V],
580
584
  [N],
581
- [w],
582
585
  [x]
583
586
  ].forEach((e) => {
584
587
  this._injector.add(e);
585
588
  });
586
589
  }
587
590
  onRendered() {
588
- this._initRenderModule(), this._injector.get(w), this._injector.get(N);
591
+ this._initRenderModule(), this._injector.get(N), this._injector.get(V);
589
592
  }
590
593
  _initRenderModule() {
591
594
  [z].forEach((e) => {
592
- this._renderManagerSrv.registerRenderModule(_.UNIVER_DOC, e);
595
+ this._renderManagerSrv.registerRenderModule(v.UNIVER_DOC, e);
593
596
  });
594
597
  }
595
598
  };
596
- _e(V, "pluginName", nt);
597
- _e(V, "type", _.UNIVER_DOC);
598
- V = Ot([
599
- be(je),
600
- q(1, p(ne)),
599
+ W(U, "pluginName", rt);
600
+ W(U, "packageName", ge.name);
601
+ W(U, "version", ge.version);
602
+ W(U, "type", v.UNIVER_DOC);
603
+ U = bt([
604
+ Te(Be),
605
+ q(1, p(re)),
601
606
  q(2, F),
602
- q(3, Te)
603
- ], V);
607
+ q(3, xe)
608
+ ], U);
604
609
  export {
605
- ue as AddDocCommentComment,
606
- Ce as DeleteDocCommentComment,
607
- P as ShowCommentPanelOperation,
610
+ Ce as AddDocCommentComment,
611
+ he as DeleteDocCommentComment,
612
+ w as ShowCommentPanelOperation,
608
613
  L as StartAddCommentOperation,
609
- V as UniverDocsThreadCommentUIPlugin
614
+ U as UniverDocsThreadCommentUIPlugin
610
615
  };