@univerjs/docs-thread-comment-ui 0.17.0 → 0.18.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,615 +1,2 @@
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
- import { jsx as Qe } from "react/jsx-runtime";
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
- id: "docs.command.add-comment",
16
- type: A.COMMAND,
17
- async handler(e, t) {
18
- if (!t)
19
- return !1;
20
- const { comment: r, unitId: n } = t, i = await e.get(we).addComment(r), s = e.get(M), d = ye(
21
- e,
22
- {
23
- id: i.threadId,
24
- type: Y.COMMENT,
25
- unitId: n
26
- }
27
- );
28
- if (d) {
29
- const l = {
30
- id: Ne.id,
31
- params: {
32
- unitId: n,
33
- subUnitId: I,
34
- comment: i
35
- }
36
- }, C = {
37
- id: se.id,
38
- params: {
39
- unitId: n,
40
- subUnitId: I,
41
- commentId: i.id
42
- }
43
- };
44
- return (await ne([l, d, C], s)).result;
45
- }
46
- return !1;
47
- }
48
- }, he = {
49
- id: "docs.command.delete-comment",
50
- type: A.COMMAND,
51
- async handler(e, t) {
52
- if (!t)
53
- return !1;
54
- const { commentId: r, unitId: n } = t, o = e.get(M), i = Ee(e, {
55
- id: r,
56
- unitId: n
57
- });
58
- return i ? (await ne([i], o)).result : !1;
59
- }
60
- };
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
- (s = e[i]) && (o = s(o) || o);
64
- return o;
65
- }, ee = (e, t) => (r, n) => t(r, n, e);
66
- let x = class extends j {
67
- constructor(t, r) {
68
- super();
69
- K(this, "_addingComment$", new Ye(void 0));
70
- K(this, "addingComment$", this._addingComment$.asObservable());
71
- this._sidebarService = t, this._threadCommentPanelService = r, this.disposeWithMe(() => {
72
- this._addingComment$.complete();
73
- });
74
- }
75
- get addingComment() {
76
- return this._addingComment$.getValue();
77
- }
78
- startAdd(t) {
79
- this._addingComment$.next(t);
80
- }
81
- endAdd() {
82
- this._addingComment$.next(void 0);
83
- }
84
- };
85
- x = it([
86
- ee(0, H),
87
- ee(1, p(R))
88
- ], x);
89
- const fe = (e) => {
90
- var s;
91
- const t = e.get(F), r = e.get(B), n = (s = Ze(
92
- v.UNIVER_DOC,
93
- Fe,
94
- e.get($),
95
- t
96
- )) == null ? void 0 : s.getSkeleton(), o = n == null ? void 0 : n.getViewModel().getEditArea();
97
- if (o === X.FOOTER || o === X.HEADER)
98
- return !0;
99
- const i = r.getActiveTextRange();
100
- return !!(i == null || i.collapsed);
101
- };
102
- function st(e) {
103
- return {
104
- id: L.id,
105
- type: ae.BUTTON,
106
- icon: "CommentIcon",
107
- title: "threadCommentUI.panel.addComment",
108
- tooltip: "threadCommentUI.panel.addComment",
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
- });
114
- return () => {
115
- n.unsubscribe();
116
- };
117
- })
118
- };
119
- }
120
- function dt(e) {
121
- return {
122
- id: Q.id,
123
- type: ae.BUTTON,
124
- icon: "CommentIcon",
125
- title: "threadCommentUI.panel.addComment",
126
- tooltip: "threadCommentUI.panel.addComment",
127
- hidden$: ce(e, v.UNIVER_DOC)
128
- };
129
- }
130
- const O = () => {
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
- [i.textSelection$]
134
- );
135
- G(s);
136
- const d = E(M), l = E(x), C = G(l.addingComment$), [a, h] = Xe([]);
137
- if (et(() => {
138
- var D;
139
- const c = /* @__PURE__ */ new Set(), m = n == null ? void 0 : n.getCustomDecorations();
140
- h((D = m == null ? void 0 : m.map((u) => u.id).filter((u) => {
141
- const S = c.has(u);
142
- return c.add(u), !S;
143
- })) != null ? D : []);
144
- const _ = d.onCommandExecuted((u) => {
145
- var S;
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
- })) != null ? S : []);
152
- }
153
- });
154
- return () => {
155
- _.dispose();
156
- };
157
- }, [d, n]), !n)
158
- return null;
159
- const g = fe(t), f = n.getUnitId();
160
- return /* @__PURE__ */ Qe(
161
- je,
162
- {
163
- unitId: f,
164
- subUnitId$: o,
165
- type: v.UNIVER_DOC,
166
- onAdd: () => {
167
- d.executeCommand(L.id);
168
- },
169
- getSubUnitName: () => "",
170
- disableAdd: g,
171
- tempComment: C,
172
- onAddComment: (c) => {
173
- if (!c.parentId) {
174
- const m = {
175
- unitId: f,
176
- range: C,
177
- comment: c
178
- };
179
- return d.executeCommand(Ce.id, m), l.endAdd(), !1;
180
- }
181
- return !0;
182
- },
183
- onDeleteComment: (c) => {
184
- if (!c.parentId) {
185
- const m = {
186
- unitId: f,
187
- commentId: c.id
188
- };
189
- return d.executeCommand(he.id, m), !1;
190
- }
191
- return !0;
192
- },
193
- showComments: a
194
- }
195
- );
196
- };
197
- O.componentKey = "univer.doc.thread-comment-panel";
198
- const w = {
199
- id: "docs.operation.show-comment-panel",
200
- type: A.OPERATION,
201
- handler(e, t) {
202
- var o;
203
- const r = e.get(R), n = e.get(H);
204
- return (!r.panelVisible || ((o = n.options.children) == null ? void 0 : o.label) !== O.componentKey) && (n.open({
205
- header: { title: "threadCommentUI.panel.title" },
206
- children: { label: O.componentKey },
207
- width: 320,
208
- onClose: () => r.setPanelVisible(!1)
209
- }), r.setPanelVisible(!0)), t && r.setActiveComment(t == null ? void 0 : t.activeComment), !0;
210
- }
211
- }, Q = {
212
- id: "docs.operation.toggle-comment-panel",
213
- type: A.OPERATION,
214
- handler(e) {
215
- var n;
216
- const t = e.get(R), r = e.get(H);
217
- return !t.panelVisible || ((n = r.options.children) == null ? void 0 : n.label) !== O.componentKey ? (r.open({
218
- header: { title: "threadCommentUI.panel.title" },
219
- children: { label: O.componentKey },
220
- width: 320,
221
- onClose: () => t.setPanelVisible(!1)
222
- }), t.setPanelVisible(!0)) : (r.close(), t.setPanelVisible(!1), t.setActiveComment(null)), !0;
223
- }
224
- }, L = {
225
- id: "docs.operation.start-add-comment",
226
- type: A.OPERATION,
227
- handler(e) {
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
- if (!n || !a)
231
- return !1;
232
- const h = (u = i.getRenderById(n.getUnitId())) == null ? void 0 : u.with(Ae);
233
- if (h == null || h.setReserveRangesStatus(!0), a.collapsed)
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
- unitId: g,
238
- subUnitId: m,
239
- id: _,
240
- ref: c,
241
- dT: Ve(),
242
- personId: s.getCurrentUser().userID,
243
- text: {
244
- dataStream: `\r
245
- `
246
- },
247
- startOffset: a.startOffset,
248
- endOffset: a.endOffset,
249
- collapsed: !0,
250
- threadId: _
251
- };
252
- return h == null || h.blur(), d.startAdd(D), t.setActiveComment({
253
- unitId: g,
254
- subUnitId: m,
255
- commentId: _
256
- }), !0;
257
- }
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--)
264
- (s = e[i]) && (o = s(o) || o);
265
- return o;
266
- }, b = (e, t) => (r, n) => t(r, n, e);
267
- let N = class extends j {
268
- constructor(e, t, r, n, o, i) {
269
- super(), this._threadCommentPanelService = e, this._univerInstanceService = t, this._commandService = r, this._docThreadCommentService = n, this._renderManagerService = o, this._threadCommentModel = i, this._initSelectionChange(), this._initActiveCommandChange();
270
- }
271
- _initSelectionChange() {
272
- let e;
273
- this.disposeWithMe(
274
- this._commandService.onCommandExecuted((t) => {
275
- var r, n, o, i;
276
- if (t.id === He.id) {
277
- const s = t.params, { unitId: d, ranges: l } = s;
278
- if (oe(d)) return;
279
- const C = this._univerInstanceService.getUnit(d, v.UNIVER_DOC), a = l[0];
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))
281
- return;
282
- if (e = a, a && C) {
283
- const { startOffset: h, endOffset: g, collapsed: f } = a;
284
- let c;
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) {
286
- const m = this._threadCommentModel.getComment(d, I, c.id);
287
- m && !m.resolved && this._commandService.executeCommand(w.id, {
288
- activeComment: {
289
- unitId: d,
290
- subUnitId: I,
291
- commentId: c.id
292
- }
293
- });
294
- return;
295
- }
296
- }
297
- if (!this._threadCommentPanelService.activeCommentId)
298
- return;
299
- this._commandService.executeCommand(se.id);
300
- }
301
- })
302
- );
303
- }
304
- _initActiveCommandChange() {
305
- this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe((e) => {
306
- var t, r, n, o;
307
- if (e) {
308
- const i = this._univerInstanceService.getUnit(e.unitId);
309
- if (i) {
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);
311
- d && s && s.scrollToRange({
312
- startOffset: d.startIndex,
313
- endOffset: d.endIndex,
314
- collapsed: !1
315
- });
316
- }
317
- }
318
- (!e || e.commentId !== ((o = this._docThreadCommentService.addingComment) == null ? void 0 : o.id)) && this._docThreadCommentService.endAdd();
319
- }));
320
- }
321
- };
322
- N = ut([
323
- b(0, p(R)),
324
- b(1, $),
325
- b(2, M),
326
- b(3, p(x)),
327
- b(4, F),
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}`, {
333
- defIds: r.defIds,
334
- idSuffix: l.current
335
- }, {
336
- ref: e,
337
- className: d,
338
- ...s
339
- }, i);
340
- }
341
- function ve(e, t, r, n, o) {
342
- return ue(e.tag, {
343
- key: t,
344
- ...Ct(e, r, o),
345
- ...n
346
- }, (ht(e, r).children || []).map((i, s) => ve(i, `${t}-${e.tag}-${s}`, r, void 0, o)));
347
- }
348
- function Ct(e, t, r) {
349
- const n = { ...e.attrs };
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]) => {
351
- i === "mask" && typeof s == "string" && (n[i] = s.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
352
- });
353
- const { defIds: o } = t;
354
- return !o || o.length === 0 || (e.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(([i, s]) => {
355
- typeof s == "string" && (n[i] = s.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
356
- })), n;
357
- }
358
- function ht(e, t) {
359
- var n;
360
- const { defIds: r } = t;
361
- return !r || r.length === 0 ? e : e.tag === "defs" && ((n = e.children) != null && n.length) ? {
362
- ...e,
363
- children: e.children.map((o) => typeof o.attrs.id == "string" && r && r.includes(o.attrs.id) ? {
364
- ...o,
365
- attrs: {
366
- ...o.attrs,
367
- id: o.attrs.id + t.idSuffix
368
- }
369
- } : o)
370
- } : e;
371
- }
372
- function ft() {
373
- return Math.random().toString(36).substring(2, 8);
374
- }
375
- pe.displayName = "UniverIcon";
376
- const gt = {
377
- tag: "svg",
378
- attrs: {
379
- xmlns: "http://www.w3.org/2000/svg",
380
- fill: "none",
381
- viewBox: "0 0 17 17",
382
- width: "1em",
383
- height: "1em"
384
- },
385
- children: [
386
- {
387
- tag: "path",
388
- attrs: {
389
- fill: "currentColor",
390
- d: "M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",
391
- fillRule: "evenodd",
392
- clipRule: "evenodd"
393
- }
394
- },
395
- {
396
- tag: "path",
397
- attrs: {
398
- fill: "currentColor",
399
- d: "M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345Z"
400
- }
401
- },
402
- {
403
- tag: "path",
404
- attrs: {
405
- fill: "currentColor",
406
- d: "M8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345Z"
407
- }
408
- },
409
- {
410
- tag: "path",
411
- attrs: {
412
- fill: "currentColor",
413
- d: "M11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z"
414
- }
415
- },
416
- {
417
- tag: "path",
418
- attrs: {
419
- fill: "currentColor",
420
- d: "M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",
421
- fillRule: "evenodd",
422
- clipRule: "evenodd"
423
- }
424
- }
425
- ]
426
- }, _e = nt(function(t, r) {
427
- return ue(pe, Object.assign({}, t, {
428
- id: "comment-icon",
429
- ref: r,
430
- icon: gt
431
- }));
432
- });
433
- _e.displayName = "CommentIcon";
434
- const pt = {
435
- [Je.MEDIA]: {
436
- [Q.id]: {
437
- order: 3,
438
- menuItemFactory: dt
439
- }
440
- },
441
- [Ke.MAIN_AREA]: {
442
- [Ge.DATA]: {
443
- [L.id]: {
444
- order: 1,
445
- menuItemFactory: st
446
- }
447
- }
448
- }
449
- };
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--)
452
- (s = e[i]) && (o = s(o) || o);
453
- return o;
454
- }, k = (e, t) => (r, n) => t(r, n, e);
455
- let V = class extends j {
456
- constructor(e, t, r) {
457
- super(), this._commandService = e, this._menuManagerService = t, this._componentManager = r, this._initCommands(), this._initMenus(), this._initComponents();
458
- }
459
- _initCommands() {
460
- [
461
- Ce,
462
- he,
463
- w,
464
- L,
465
- Q
466
- ].forEach((e) => {
467
- this.disposeWithMe(this._commandService.registerCommand(e));
468
- });
469
- }
470
- _initMenus() {
471
- this._menuManagerService.mergeMenu(pt);
472
- }
473
- _initComponents() {
474
- [
475
- [O.componentKey, O],
476
- ["CommentIcon", _e]
477
- ].forEach(([e, t]) => {
478
- this.disposeWithMe(
479
- this._componentManager.register(e, t)
480
- );
481
- });
482
- }
483
- };
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--)
491
- (s = e[i]) && (o = s(o) || o);
492
- return o;
493
- }, T = (e, t) => (r, n) => t(r, n, e);
494
- let z = class extends j {
495
- constructor(e, t, r, n, o, i, s) {
496
- super(), this._context = e, this._docInterceptorService = t, this._threadCommentPanelService = r, this._docRenderController = n, this._univerInstanceService = o, this._threadCommentModel = i, this._commandService = s, this._interceptorViewModel(), this._initReRender(), this._initSyncComments();
497
- }
498
- _initReRender() {
499
- this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe((e) => {
500
- var r;
501
- if (e) {
502
- this._docRenderController.reRender(e.unitId);
503
- return;
504
- }
505
- const t = (r = this._univerInstanceService.getCurrentUnitForType(v.UNIVER_DOC)) == null ? void 0 : r.getUnitId();
506
- t && this._docRenderController.reRender(t);
507
- })), this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe((e) => {
508
- e.type === "resolve" && this._docRenderController.reRender(e.unitId);
509
- }));
510
- }
511
- _interceptorViewModel() {
512
- this._docInterceptorService.intercept(We.CUSTOM_DECORATION, {
513
- handler: (e, t, r) => {
514
- if (!e)
515
- return r(e);
516
- const { unitId: n, index: o, customDecorations: i } = t, s = this._threadCommentPanelService.activeCommentId, { commentId: d, unitId: l } = s || {}, C = i.find((f) => f.id === d), a = this._threadCommentModel.getComment(n, I, e.id);
517
- if (!a)
518
- return r({
519
- ...e,
520
- show: !1
521
- });
522
- const h = C && o >= C.startIndex && o <= C.endIndex, g = l === n && e.id === d;
523
- return r({
524
- ...e,
525
- active: g || h,
526
- show: !a.resolved
527
- });
528
- }
529
- });
530
- }
531
- _initSyncComments() {
532
- var o, i, s;
533
- const e = this._context.unit.getUnitId(), t = I, r = (s = (i = (o = this._context.unit.getBody()) == null ? void 0 : o.customDecorations) == null ? void 0 : i.filter((d) => d.type === Y.COMMENT).map((d) => d.id)) != null ? s : [];
534
- r.forEach((d) => {
535
- this._threadCommentModel.getComment(e, t, d) || this._threadCommentModel.addComment(e, t, { id: d, threadId: d, ref: "", dT: "", personId: "", text: { dataStream: "" }, unitId: e, subUnitId: t });
536
- }), r.length && this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(), I, r);
537
- let n = r.sort();
538
- this.disposeWithMe(this._commandService.onCommandExecuted((d) => {
539
- var l, C, a;
540
- if (d.id === de.id) {
541
- if (d.params.unitId !== this._context.unit.getUnitId())
542
- return;
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();
544
- if (JSON.stringify(n) !== JSON.stringify(f)) {
545
- const c = new Set(n), m = new Set(f), _ = /* @__PURE__ */ new Set(), D = /* @__PURE__ */ new Set();
546
- g.forEach((u) => {
547
- c.has(u) || _.add(u);
548
- }), n.forEach((u) => {
549
- m.has(u) || D.add(u);
550
- }), n = f, _.forEach((u) => {
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 });
552
- }), this._threadCommentModel.syncThreadComments(e, t, [..._]);
553
- }
554
- }
555
- }));
556
- }
557
- };
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)),
564
- T(6, M)
565
- ], z);
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--)
568
- (s = e[i]) && (o = s(o) || o);
569
- return o;
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) {
573
- super(), this._config = e, this._injector = t, this._renderManagerSrv = r, this._configService = n;
574
- const { menu: o, ...i } = Re(
575
- {},
576
- te,
577
- this._config
578
- );
579
- o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(mt, i);
580
- }
581
- onStarting() {
582
- [
583
- [V],
584
- [N],
585
- [x]
586
- ].forEach((e) => {
587
- this._injector.add(e);
588
- });
589
- }
590
- onRendered() {
591
- this._initRenderModule(), this._injector.get(N), this._injector.get(V);
592
- }
593
- _initRenderModule() {
594
- [z].forEach((e) => {
595
- this._renderManagerSrv.registerRenderModule(v.UNIVER_DOC, e);
596
- });
597
- }
598
- };
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)),
606
- q(2, F),
607
- q(3, xe)
608
- ], U);
609
- export {
610
- Ce as AddDocCommentComment,
611
- he as DeleteDocCommentComment,
612
- w as ShowCommentPanelOperation,
613
- L as StartAddCommentOperation,
614
- U as UniverDocsThreadCommentUIPlugin
615
- };
1
+ import{BuildTextUtils as e,CommandType as t,CustomDecorationType as n,DependentOn as r,Disposable as i,ICommandService as a,IConfigService as o,IUniverInstanceService as s,Inject as c,Injector as l,Plugin as u,SHEET_EDITOR_UNITS as d,UniverInstanceType as f,UserManagerService as p,isInternalEditorID as m,merge as h,sequenceExecute as g}from"@univerjs/core";import{DocBackScrollRenderController as _,DocRenderController as v,DocSelectionRenderService as ee,addCustomDecorationBySelectionFactory as y,deleteCustomDecorationFactory as b}from"@univerjs/docs-ui";import{AddCommentMutation as x,IThreadCommentDataSourceService as S,ThreadCommentModel as C,getDT as te}from"@univerjs/thread-comment";import{SetActiveCommentOperation as w,ThreadCommentPanel as ne,ThreadCommentPanelService as T,UniverThreadCommentUIPlugin as re}from"@univerjs/thread-comment-ui";import{DOC_INTERCEPTOR_POINT as ie,DocInterceptorService as ae,DocSelectionManagerService as E,DocSkeletonManagerService as oe,RichTextEditingMutation as D,SetTextSelectionsOperation as se}from"@univerjs/docs";import{DocumentEditArea as O,IRenderManagerService as k,withCurrentTypeOfRenderer as ce}from"@univerjs/engine-render";import{ComponentManager as le,ContextMenuGroup as ue,ContextMenuPosition as de,IMenuManagerService as fe,ISidebarService as A,MenuItemType as pe,RibbonInsertGroup as me,getMenuHiddenObservable as he,useDependency as j,useObservable as M}from"@univerjs/ui";import{BehaviorSubject as ge,Observable as N,debounceTime as P,filter as _e}from"rxjs";import{useEffect as ve,useMemo as F,useState as ye}from"react";import{jsx as be}from"react/jsx-runtime";import{CommentIcon as xe}from"@univerjs/icons";const I=`default_doc`,L={id:`docs.command.add-comment`,type:t.COMMAND,async handler(e,t){if(!t)return!1;let{comment:r,unitId:i}=t,o=await e.get(S).addComment(r),s=e.get(a),c=y(e,{id:o.threadId,type:n.COMMENT,unitId:i});return c?(await g([{id:x.id,params:{unitId:i,subUnitId:I,comment:o}},c,{id:w.id,params:{unitId:i,subUnitId:I,commentId:o.id}}],s)).result:!1}},R={id:`docs.command.delete-comment`,type:t.COMMAND,async handler(e,t){if(!t)return!1;let{commentId:n,unitId:r}=t,i=e.get(a),o=b(e,{id:n,unitId:r});return o?(await g([o],i)).result:!1}};function z(e){"@babel/helpers - typeof";return z=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},z(e)}function Se(e,t){if(z(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(z(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ce(e){var t=Se(e,`string`);return z(t)==`symbol`?t:t+``}function B(e,t,n){return(t=Ce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V(e,t){return function(n,r){t(n,r,e)}}function H(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let U=class extends i{get addingComment(){return this._addingComment$.getValue()}constructor(e,t){super(),this._sidebarService=e,this._threadCommentPanelService=t,B(this,`_addingComment$`,new ge(void 0)),B(this,`addingComment$`,this._addingComment$.asObservable()),this.disposeWithMe(()=>{this._addingComment$.complete()})}startAdd(e){this._addingComment$.next(e)}endAdd(){this._addingComment$.next(void 0)}};U=H([V(0,A),V(1,c(T))],U);const W=e=>{var t;let n=e.get(k),r=e.get(E),i=(t=ce(f.UNIVER_DOC,oe,e.get(s),n))==null?void 0:t.getSkeleton(),a=i==null?void 0:i.getViewModel().getEditArea();if(a===O.FOOTER||a===O.HEADER)return!0;let o=r.getActiveTextRange();return!!(o==null||o.collapsed)};function we(e){return{id:J.id,type:pe.BUTTON,icon:`CommentIcon`,title:`threadCommentUI.panel.addComment`,tooltip:`threadCommentUI.panel.addComment`,hidden$:he(e,f.UNIVER_DOC,void 0,d),disabled$:new N(function(t){let n=e.get(E).textSelection$.pipe(P(16)).subscribe(()=>{t.next(W(e))});return()=>{n.unsubscribe()}})}}function Te(e){return{id:q.id,type:pe.BUTTON,icon:`CommentIcon`,title:`threadCommentUI.panel.addComment`,tooltip:`threadCommentUI.panel.addComment`,hidden$:he(e,f.UNIVER_DOC)}}const G=()=>{let e=j(s),t=j(l),n=M(F(()=>e.getCurrentTypeOfUnit$(f.UNIVER_DOC).pipe(_e(e=>!!e&&!m(e.getUnitId()))),[e])),r=F(()=>new N(e=>e.next(I)),[]),i=j(E);M(F(()=>i.textSelection$.pipe(P(16)),[i.textSelection$]));let o=j(a),c=j(U),u=M(c.addingComment$),[d,p]=ye([]);if(ve(()=>{var e;let t=new Set,r=n==null?void 0:n.getCustomDecorations();p((e=r==null?void 0:r.map(e=>e.id).filter(e=>{let n=t.has(e);return t.add(e),!n}))==null?[]:e);let i=o.onCommandExecuted(e=>{if(e.id===D.id){var t;let e=new Set,r=n==null?void 0:n.getCustomDecorations();p((t=r==null?void 0:r.map(e=>e.id).filter(t=>{let n=e.has(t);return e.add(t),!n}))==null?[]:t)}});return()=>{i.dispose()}},[o,n]),!n)return null;let h=W(t),g=n.getUnitId();return be(ne,{unitId:g,subUnitId$:r,type:f.UNIVER_DOC,onAdd:()=>{o.executeCommand(J.id)},getSubUnitName:()=>``,disableAdd:h,tempComment:u,onAddComment:e=>{if(!e.parentId){let t={unitId:g,range:u,comment:e};return o.executeCommand(L.id,t),c.endAdd(),!1}return!0},onDeleteComment:e=>{if(!e.parentId){let t={unitId:g,commentId:e.id};return o.executeCommand(R.id,t),!1}return!0},showComments:d})};G.componentKey=`univer.doc.thread-comment-panel`;const K={id:`docs.operation.show-comment-panel`,type:t.OPERATION,handler(e,t){var n;let r=e.get(T),i=e.get(A);return(!r.panelVisible||((n=i.options.children)==null?void 0:n.label)!==G.componentKey)&&(i.open({header:{title:`threadCommentUI.panel.title`},children:{label:G.componentKey},width:320,onClose:()=>r.setPanelVisible(!1)}),r.setPanelVisible(!0)),t&&r.setActiveComment(t==null?void 0:t.activeComment),!0}},q={id:`docs.operation.toggle-comment-panel`,type:t.OPERATION,handler(e){var t;let n=e.get(T),r=e.get(A);return!n.panelVisible||((t=r.options.children)==null?void 0:t.label)!==G.componentKey?(r.open({header:{title:`threadCommentUI.panel.title`},children:{label:G.componentKey},width:320,onClose:()=>n.setPanelVisible(!1)}),n.setPanelVisible(!0)):(r.close(),n.setPanelVisible(!1),n.setActiveComment(null)),!0}},J={id:`docs.operation.start-add-comment`,type:t.OPERATION,handler(t){var n,r,i;let o=t.get(T),c=t.get(s).getCurrentUnitForType(f.UNIVER_DOC),l=t.get(E),u=t.get(k),d=t.get(p),m=t.get(U),h=t.get(a),g=t.get(A),_=l.getActiveTextRange();if(!c||!_)return!1;let v=(n=u.getRenderById(c.getUnitId()))==null?void 0:n.with(ee);if(v==null||v.setReserveRangesStatus(!0),_.collapsed)return o.panelVisible?(o.setPanelVisible(!1),g.close()):h.executeCommand(K.id),!0;h.executeCommand(K.id);let y=c.getUnitId(),b=((r=(i=c.getBody())==null?void 0:i.dataStream)==null?``:r).slice(_.startOffset,_.endOffset),x=e.transform.getPlainText(b),S=I,C={unitId:y,subUnitId:S,id:``,ref:x,dT:te(),personId:d.getCurrentUser().userID,text:{dataStream:`\r
2
+ `},startOffset:_.startOffset,endOffset:_.endOffset,collapsed:!0,threadId:``};return v==null||v.blur(),m.startAdd(C),o.setActiveComment({unitId:y,subUnitId:S,commentId:``}),!0}};var Ee=`@univerjs/docs-thread-comment-ui`,De=`0.18.0`;const Y=`docs-thread-comment-ui.config`;Symbol(Y);const Oe={};let X=class extends i{constructor(e,t,n,r,i,a){super(),this._threadCommentPanelService=e,this._univerInstanceService=t,this._commandService=n,this._docThreadCommentService=r,this._renderManagerService=i,this._threadCommentModel=a,this._initSelectionChange(),this._initActiveCommandChange()}_initSelectionChange(){let e;this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(t.id===se.id){let{unitId:i,ranges:a}=t.params;if(m(i))return;let o=this._univerInstanceService.getUnit(i,f.UNIVER_DOC),s=a[0];if((e==null?void 0:e.startOffset)===(s==null?void 0:s.startOffset)&&(e==null?void 0:e.endOffset)===(s==null?void 0:s.endOffset))return;if(e=s,s&&o){let{startOffset:e,endOffset:t,collapsed:a}=s,c;if(a){var n;c=(n=o.getBody())==null||(n=n.customDecorations)==null?void 0:n.find(n=>n.startIndex<=e&&n.endIndex>=t-1)}else{var r;c=(r=o.getBody())==null||(r=r.customDecorations)==null?void 0:r.find(n=>n.startIndex<=e&&n.endIndex>=t-1)}if(c){let e=this._threadCommentModel.getComment(i,I,c.id);e&&!e.resolved&&this._commandService.executeCommand(K.id,{activeComment:{unitId:i,subUnitId:I,commentId:c.id}});return}}if(!this._threadCommentPanelService.activeCommentId)return;this._commandService.executeCommand(w.id)}}))}_initActiveCommandChange(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var t;if(e){let t=this._univerInstanceService.getUnit(e.unitId);if(t){var n,r;let i=(n=this._renderManagerService.getRenderById(e.unitId))==null?void 0:n.with(_),a=(r=t.getBody())==null||(r=r.customDecorations)==null?void 0:r.find(t=>t.id===e.commentId);a&&i&&i.scrollToRange({startOffset:a.startIndex,endOffset:a.endIndex,collapsed:!1})}}(!e||e.commentId!==((t=this._docThreadCommentService.addingComment)==null?void 0:t.id))&&this._docThreadCommentService.endAdd()}))}};X=H([V(0,c(T)),V(1,s),V(2,a),V(3,c(U)),V(4,k),V(5,c(C))],X);const ke={[me.MEDIA]:{[q.id]:{order:3,menuItemFactory:Te}},[de.MAIN_AREA]:{[ue.DATA]:{[J.id]:{order:1,menuItemFactory:we}}}};let Z=class extends i{constructor(e,t,n){super(),this._commandService=e,this._menuManagerService=t,this._componentManager=n,this._initCommands(),this._initMenus(),this._initComponents()}_initCommands(){[L,R,K,J,q].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(ke)}_initComponents(){[[G.componentKey,G],[`CommentIcon`,xe]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}};Z=H([V(0,a),V(1,fe),V(2,c(le))],Z);let Q=class extends i{constructor(e,t,n,r,i,a,o){super(),this._context=e,this._docInterceptorService=t,this._threadCommentPanelService=n,this._docRenderController=r,this._univerInstanceService=i,this._threadCommentModel=a,this._commandService=o,this._interceptorViewModel(),this._initReRender(),this._initSyncComments()}_initReRender(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var t;if(e){this._docRenderController.reRender(e.unitId);return}let n=(t=this._univerInstanceService.getCurrentUnitForType(f.UNIVER_DOC))==null?void 0:t.getUnitId();n&&this._docRenderController.reRender(n)})),this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe(e=>{e.type===`resolve`&&this._docRenderController.reRender(e.unitId)}))}_interceptorViewModel(){this._docInterceptorService.intercept(ie.CUSTOM_DECORATION,{handler:(e,t,n)=>{if(!e)return n(e);let{unitId:r,index:i,customDecorations:a}=t,{commentId:o,unitId:s}=this._threadCommentPanelService.activeCommentId||{},c=a.find(e=>e.id===o),l=this._threadCommentModel.getComment(r,I,e.id);if(!l)return n({...e,show:!1});let u=c&&i>=c.startIndex&&i<=c.endIndex,d=s===r&&e.id===o;return n({...e,active:d||u,show:!l.resolved})}})}_initSyncComments(){var e,t;let r=this._context.unit.getUnitId(),i=I,a=(e=(t=this._context.unit.getBody())==null||(t=t.customDecorations)==null?void 0:t.filter(e=>e.type===n.COMMENT).map(e=>e.id))==null?[]:e;a.forEach(e=>{this._threadCommentModel.getComment(r,i,e)||this._threadCommentModel.addComment(r,i,{id:e,threadId:e,ref:``,dT:``,personId:``,text:{dataStream:``},unitId:r,subUnitId:i})}),a.length&&this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(),`default_doc`,a);let o=a.sort();this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===D.id){var t,a;if(e.params.unitId!==this._context.unit.getUnitId())return;let s=(t=(a=this._context.unit.getBody())==null||(a=a.customDecorations)==null?void 0:a.filter(e=>e.type===n.COMMENT).map(e=>e.id))==null?[]:t,c=s.sort();if(JSON.stringify(o)!==JSON.stringify(c)){let e=new Set(o),t=new Set(c),n=new Set,a=new Set;s.forEach(t=>{e.has(t)||n.add(t)}),o.forEach(e=>{t.has(e)||a.add(e)}),o=c,n.forEach(e=>{this._threadCommentModel.getComment(r,i,e)||this._threadCommentModel.addComment(r,i,{id:e,threadId:e,ref:``,dT:``,personId:``,text:{dataStream:``},unitId:r,subUnitId:i})}),this._threadCommentModel.syncThreadComments(r,i,[...n])}}}))}};Q=H([V(1,c(ae)),V(2,c(T)),V(3,c(v)),V(4,s),V(5,c(C)),V(6,a)],Q);let $=class extends u{constructor(e=Oe,t,n,r){super(),this._config=e,this._injector=t,this._renderManagerSrv=n,this._configService=r;let{menu:i,...a}=h({},Oe,this._config);i&&this._configService.setConfig(`menu`,i,{merge:!0}),this._configService.setConfig(Y,a)}onStarting(){[[Z],[X],[U]].forEach(e=>{this._injector.add(e)})}onRendered(){this._initRenderModule(),this._injector.get(X),this._injector.get(Z)}_initRenderModule(){[Q].forEach(e=>{this._renderManagerSrv.registerRenderModule(f.UNIVER_DOC,e)})}};B($,`pluginName`,`DOC_THREAD_COMMENT_UI_PLUGIN`),B($,`packageName`,Ee),B($,`version`,De),B($,`type`,f.UNIVER_DOC),$=H([r(re),V(1,c(l)),V(2,k),V(3,o)],$);export{L as AddDocCommentComment,R as DeleteDocCommentComment,K as ShowCommentPanelOperation,J as StartAddCommentOperation,$ as UniverDocsThreadCommentUIPlugin};
@@ -1,5 +1,20 @@
1
- import { ICommand, ITextRange } from '@univerjs/core';
2
- import { IThreadComment } from '@univerjs/thread-comment';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { ICommand, ITextRange } from '@univerjs/core';
17
+ import type { IThreadComment } from '@univerjs/thread-comment';
3
18
  export interface IAddDocCommentComment {
4
19
  unitId: string;
5
20
  comment: IThreadComment;
@@ -1,4 +1,19 @@
1
- import { ICommand } from '@univerjs/core';
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { ICommand } from '@univerjs/core';
2
17
  export interface IDeleteDocCommentComment {
3
18
  unitId: string;
4
19
  commentId: string;