@univerjs/docs-thread-comment-ui 0.5.5-nightly.202501241606 → 0.6.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +176 -0
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +383 -390
- package/lib/umd/index.js +2 -2
- package/package.json +9 -9
package/lib/es/index.js
CHANGED
|
@@ -1,288 +1,285 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
constructor(_sidebarService, _threadCommentPanelService) {
|
|
1
|
+
var Me = Object.defineProperty;
|
|
2
|
+
var be = (e, t, r) => t in e ? Me(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var G = (e, t, r) => be(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { Inject as v, Disposable as j, CommandType as E, ICommandService as M, CustomDecorationType as Y, sequenceExecute as ne, UniverInstanceType as S, SHEET_EDITOR_UNITS as De, useDependency as P, IUniverInstanceService as B, Injector as re, isInternalEditorID as ie, useObservable as Z, UserManagerService as Te, BuildTextUtils as xe, DependentOn as ye, Plugin as Ue, merge as Re, IConfigService as Pe } from "@univerjs/core";
|
|
5
|
+
import { IRenderManagerService as F, DocumentEditArea as k } from "@univerjs/engine-render";
|
|
6
|
+
import { ThreadCommentPanelService as U, SetActiveCommentOperation as oe, ThreadCommentPanel as Ee, UniverThreadCommentUIPlugin as Ae } from "@univerjs/thread-comment-ui";
|
|
7
|
+
import { DocSelectionManagerService as H, DocSkeletonManagerService as we, RichTextEditingMutation as se, SetTextSelectionsOperation as Ne, DocInterceptorService as Ve, DOC_INTERCEPTOR_POINT as $e } from "@univerjs/docs";
|
|
8
|
+
import { addCustomDecorationBySelectionFactory as je, deleteCustomDecorationFactory as Be, DocSelectionRenderService as Fe, DocBackScrollRenderController as He, DocRenderController as Le } from "@univerjs/docs-ui";
|
|
9
|
+
import { IThreadCommentDataSourceService as We, AddCommentMutation as Ke, getDT as Ge, ThreadCommentModel as de } from "@univerjs/thread-comment";
|
|
10
|
+
import { ISidebarService as L, MenuItemType as ce, getMenuHiddenObservable as ae, RibbonStartGroup as Ze, ContextMenuPosition as ze, ContextMenuGroup as Je, ComponentManager as qe, IMenuManagerService as Ye } from "@univerjs/ui";
|
|
11
|
+
import { BehaviorSubject as Qe, Observable as me, debounceTime as le, filter as Xe } from "rxjs";
|
|
12
|
+
import { jsx as ke } from "react/jsx-runtime";
|
|
13
|
+
import { useMemo as z, useState as et, useEffect as tt, forwardRef as ue, useRef as nt, createElement as fe } from "react";
|
|
14
|
+
const rt = "DOC_THREAD_COMMENT_UI_PLUGIN", I = "default_doc", it = "docs-thread-comment-ui.config", ee = {};
|
|
15
|
+
var ot = Object.defineProperty, st = Object.getOwnPropertyDescriptor, dt = (e, t, r, n) => {
|
|
16
|
+
for (var i = n > 1 ? void 0 : n ? st(t, r) : t, o = e.length - 1, s; o >= 0; o--)
|
|
17
|
+
(s = e[o]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
18
|
+
return n && i && ot(t, r, i), i;
|
|
19
|
+
}, te = (e, t) => (r, n) => t(r, n, e);
|
|
20
|
+
let x = class extends j {
|
|
21
|
+
constructor(t, r) {
|
|
23
22
|
super();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
this._sidebarService =
|
|
23
|
+
G(this, "_addingComment$", new Qe(void 0));
|
|
24
|
+
G(this, "addingComment$", this._addingComment$.asObservable());
|
|
25
|
+
this._sidebarService = t, this._threadCommentPanelService = r, this.disposeWithMe(() => {
|
|
27
26
|
this._addingComment$.complete();
|
|
28
27
|
});
|
|
29
28
|
}
|
|
30
29
|
get addingComment() {
|
|
31
30
|
return this._addingComment$.getValue();
|
|
32
31
|
}
|
|
33
|
-
startAdd(
|
|
34
|
-
this._addingComment$.next(
|
|
32
|
+
startAdd(t) {
|
|
33
|
+
this._addingComment$.next(t);
|
|
35
34
|
}
|
|
36
35
|
endAdd() {
|
|
37
36
|
this._addingComment$.next(void 0);
|
|
38
37
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
],
|
|
44
|
-
const
|
|
38
|
+
};
|
|
39
|
+
x = dt([
|
|
40
|
+
te(0, L),
|
|
41
|
+
te(1, v(U))
|
|
42
|
+
], x);
|
|
43
|
+
const he = {
|
|
45
44
|
id: "docs.command.add-comment",
|
|
46
|
-
type:
|
|
47
|
-
async handler(
|
|
48
|
-
if (!
|
|
45
|
+
type: E.COMMAND,
|
|
46
|
+
async handler(e, t) {
|
|
47
|
+
if (!t)
|
|
49
48
|
return !1;
|
|
50
|
-
const { comment:
|
|
51
|
-
|
|
49
|
+
const { comment: r, unitId: n } = t, o = await e.get(We).addComment(r), s = e.get(M), d = je(
|
|
50
|
+
e,
|
|
52
51
|
{
|
|
53
|
-
id:
|
|
54
|
-
type:
|
|
55
|
-
unitId
|
|
52
|
+
id: o.threadId,
|
|
53
|
+
type: Y.COMMENT,
|
|
54
|
+
unitId: n
|
|
56
55
|
}
|
|
57
56
|
);
|
|
58
|
-
if (
|
|
59
|
-
const
|
|
60
|
-
id:
|
|
57
|
+
if (d) {
|
|
58
|
+
const l = {
|
|
59
|
+
id: Ke.id,
|
|
61
60
|
params: {
|
|
62
|
-
unitId,
|
|
63
|
-
subUnitId:
|
|
64
|
-
comment
|
|
61
|
+
unitId: n,
|
|
62
|
+
subUnitId: I,
|
|
63
|
+
comment: o
|
|
65
64
|
}
|
|
66
|
-
},
|
|
67
|
-
id:
|
|
65
|
+
}, f = {
|
|
66
|
+
id: oe.id,
|
|
68
67
|
params: {
|
|
69
|
-
unitId,
|
|
70
|
-
subUnitId:
|
|
71
|
-
commentId:
|
|
68
|
+
unitId: n,
|
|
69
|
+
subUnitId: I,
|
|
70
|
+
commentId: o.id
|
|
72
71
|
}
|
|
73
72
|
};
|
|
74
|
-
return (await
|
|
73
|
+
return (await ne([l, d, f], s)).result;
|
|
75
74
|
}
|
|
76
75
|
return !1;
|
|
77
76
|
}
|
|
78
|
-
},
|
|
77
|
+
}, Ce = {
|
|
79
78
|
id: "docs.command.delete-comment",
|
|
80
|
-
type:
|
|
81
|
-
async handler(
|
|
82
|
-
if (!
|
|
79
|
+
type: E.COMMAND,
|
|
80
|
+
async handler(e, t) {
|
|
81
|
+
if (!t)
|
|
83
82
|
return !1;
|
|
84
|
-
const { commentId, unitId } =
|
|
85
|
-
id:
|
|
86
|
-
unitId
|
|
83
|
+
const { commentId: r, unitId: n } = t, i = e.get(M), o = Be(e, {
|
|
84
|
+
id: r,
|
|
85
|
+
unitId: n
|
|
87
86
|
});
|
|
88
|
-
return
|
|
87
|
+
return o ? (await ne([o], i)).result : !1;
|
|
89
88
|
}
|
|
90
|
-
},
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
89
|
+
}, _e = (e) => {
|
|
90
|
+
const t = e.get(F), r = e.get(H), n = t.getCurrent(), i = n == null ? void 0 : n.with(we).getSkeleton(), o = i == null ? void 0 : i.getViewModel().getEditArea();
|
|
91
|
+
if (o === k.FOOTER || o === k.HEADER)
|
|
93
92
|
return !0;
|
|
94
|
-
const
|
|
95
|
-
return !!(
|
|
96
|
-
}
|
|
97
|
-
function
|
|
93
|
+
const s = r.getActiveTextRange();
|
|
94
|
+
return !!(s == null || s.collapsed);
|
|
95
|
+
};
|
|
96
|
+
function ct(e) {
|
|
98
97
|
return {
|
|
99
|
-
id:
|
|
100
|
-
type:
|
|
98
|
+
id: W.id,
|
|
99
|
+
type: ce.BUTTON,
|
|
101
100
|
icon: "CommentSingle",
|
|
102
101
|
title: "threadCommentUI.panel.addComment",
|
|
103
102
|
tooltip: "threadCommentUI.panel.addComment",
|
|
104
|
-
hidden$:
|
|
105
|
-
disabled$: new
|
|
106
|
-
const
|
|
107
|
-
|
|
103
|
+
hidden$: ae(e, S.UNIVER_DOC, void 0, De),
|
|
104
|
+
disabled$: new me(function(t) {
|
|
105
|
+
const n = e.get(H).textSelection$.pipe(le(16)).subscribe(() => {
|
|
106
|
+
t.next(_e(e));
|
|
108
107
|
});
|
|
109
108
|
return () => {
|
|
110
|
-
|
|
109
|
+
n.unsubscribe();
|
|
111
110
|
};
|
|
112
111
|
})
|
|
113
112
|
};
|
|
114
113
|
}
|
|
115
|
-
|
|
116
|
-
function ToolbarDocCommentMenuItemFactory(accessor) {
|
|
114
|
+
function at(e) {
|
|
117
115
|
return {
|
|
118
|
-
id:
|
|
119
|
-
type:
|
|
116
|
+
id: X.id,
|
|
117
|
+
type: ce.BUTTON,
|
|
120
118
|
icon: "CommentSingle",
|
|
121
119
|
title: "threadCommentUI.panel.addComment",
|
|
122
120
|
tooltip: "threadCommentUI.panel.addComment",
|
|
123
|
-
hidden$:
|
|
121
|
+
hidden$: ae(e, S.UNIVER_DOC)
|
|
124
122
|
};
|
|
125
123
|
}
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
[docSelectionManagerService.textSelection$]
|
|
124
|
+
const y = () => {
|
|
125
|
+
const e = P(B), t = P(re), r = z(() => e.getCurrentTypeOfUnit$(S.UNIVER_DOC).pipe(Xe((c) => !!c && !ie(c.getUnitId()))), [e]), n = Z(r), i = z(() => new me((c) => c.next(I)), []), o = P(H), s = z(
|
|
126
|
+
() => o.textSelection$.pipe(le(16)),
|
|
127
|
+
[o.textSelection$]
|
|
131
128
|
);
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
var
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
return
|
|
140
|
-
})) != null ?
|
|
141
|
-
const
|
|
142
|
-
var
|
|
143
|
-
if (
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
return
|
|
148
|
-
})) != null ?
|
|
129
|
+
Z(s);
|
|
130
|
+
const d = P(M), l = P(x), f = Z(l.addingComment$), [a, h] = et([]);
|
|
131
|
+
if (tt(() => {
|
|
132
|
+
var b;
|
|
133
|
+
const c = /* @__PURE__ */ new Set(), m = n == null ? void 0 : n.getCustomDecorations();
|
|
134
|
+
h((b = m == null ? void 0 : m.map((u) => u.id).filter((u) => {
|
|
135
|
+
const O = c.has(u);
|
|
136
|
+
return c.add(u), !O;
|
|
137
|
+
})) != null ? b : []);
|
|
138
|
+
const p = d.onCommandExecuted((u) => {
|
|
139
|
+
var O;
|
|
140
|
+
if (u.id === se.id) {
|
|
141
|
+
const R = /* @__PURE__ */ new Set(), K = n == null ? void 0 : n.getCustomDecorations();
|
|
142
|
+
h((O = K == null ? void 0 : K.map((A) => A.id).filter((A) => {
|
|
143
|
+
const Oe = R.has(A);
|
|
144
|
+
return R.add(A), !Oe;
|
|
145
|
+
})) != null ? O : []);
|
|
149
146
|
}
|
|
150
147
|
});
|
|
151
148
|
return () => {
|
|
152
|
-
|
|
149
|
+
p.dispose();
|
|
153
150
|
};
|
|
154
|
-
}, [
|
|
151
|
+
}, [d, n]), !n)
|
|
155
152
|
return null;
|
|
156
|
-
const
|
|
157
|
-
return /* @__PURE__ */
|
|
158
|
-
|
|
153
|
+
const _ = _e(t), C = n.getUnitId();
|
|
154
|
+
return /* @__PURE__ */ ke(
|
|
155
|
+
Ee,
|
|
159
156
|
{
|
|
160
|
-
unitId,
|
|
161
|
-
subUnitId
|
|
162
|
-
type:
|
|
163
|
-
onAdd:
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
getSubUnitName:
|
|
167
|
-
disableAdd:
|
|
168
|
-
tempComment,
|
|
169
|
-
onAddComment:
|
|
170
|
-
if (!
|
|
171
|
-
const
|
|
172
|
-
unitId,
|
|
173
|
-
range:
|
|
174
|
-
comment
|
|
157
|
+
unitId: C,
|
|
158
|
+
subUnitId$: i,
|
|
159
|
+
type: S.UNIVER_DOC,
|
|
160
|
+
onAdd: () => {
|
|
161
|
+
d.executeCommand(W.id);
|
|
162
|
+
},
|
|
163
|
+
getSubUnitName: () => "",
|
|
164
|
+
disableAdd: _,
|
|
165
|
+
tempComment: f,
|
|
166
|
+
onAddComment: (c) => {
|
|
167
|
+
if (!c.parentId) {
|
|
168
|
+
const m = {
|
|
169
|
+
unitId: C,
|
|
170
|
+
range: f,
|
|
171
|
+
comment: c
|
|
175
172
|
};
|
|
176
|
-
return
|
|
173
|
+
return d.executeCommand(he.id, m), l.endAdd(), !1;
|
|
177
174
|
}
|
|
178
175
|
return !0;
|
|
179
|
-
},
|
|
180
|
-
onDeleteComment:
|
|
181
|
-
if (!
|
|
182
|
-
const
|
|
183
|
-
unitId,
|
|
184
|
-
commentId:
|
|
176
|
+
},
|
|
177
|
+
onDeleteComment: (c) => {
|
|
178
|
+
if (!c.parentId) {
|
|
179
|
+
const m = {
|
|
180
|
+
unitId: C,
|
|
181
|
+
commentId: c.id
|
|
185
182
|
};
|
|
186
|
-
return
|
|
183
|
+
return d.executeCommand(Ce.id, m), !1;
|
|
187
184
|
}
|
|
188
185
|
return !0;
|
|
189
|
-
},
|
|
190
|
-
showComments:
|
|
186
|
+
},
|
|
187
|
+
showComments: a
|
|
191
188
|
}
|
|
192
189
|
);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
const
|
|
190
|
+
};
|
|
191
|
+
y.componentKey = "univer.doc.thread-comment-panel";
|
|
192
|
+
const w = {
|
|
196
193
|
id: "docs.operation.show-comment-panel",
|
|
197
|
-
type:
|
|
198
|
-
handler(
|
|
199
|
-
var
|
|
200
|
-
const
|
|
201
|
-
return (!
|
|
194
|
+
type: E.OPERATION,
|
|
195
|
+
handler(e, t) {
|
|
196
|
+
var i;
|
|
197
|
+
const r = e.get(U), n = e.get(L);
|
|
198
|
+
return (!r.panelVisible || ((i = n.options.children) == null ? void 0 : i.label) !== y.componentKey) && (n.open({
|
|
202
199
|
header: { title: "threadCommentUI.panel.title" },
|
|
203
|
-
children: { label:
|
|
200
|
+
children: { label: y.componentKey },
|
|
204
201
|
width: 320,
|
|
205
|
-
onClose:
|
|
206
|
-
}),
|
|
202
|
+
onClose: () => r.setPanelVisible(!1)
|
|
203
|
+
}), r.setPanelVisible(!0)), t && r.setActiveComment(t == null ? void 0 : t.activeComment), !0;
|
|
207
204
|
}
|
|
208
|
-
},
|
|
205
|
+
}, X = {
|
|
209
206
|
id: "docs.operation.toggle-comment-panel",
|
|
210
|
-
type:
|
|
211
|
-
handler(
|
|
212
|
-
var
|
|
213
|
-
const
|
|
214
|
-
return !
|
|
207
|
+
type: E.OPERATION,
|
|
208
|
+
handler(e) {
|
|
209
|
+
var n;
|
|
210
|
+
const t = e.get(U), r = e.get(L);
|
|
211
|
+
return !t.panelVisible || ((n = r.options.children) == null ? void 0 : n.label) !== y.componentKey ? (r.open({
|
|
215
212
|
header: { title: "threadCommentUI.panel.title" },
|
|
216
|
-
children: { label:
|
|
213
|
+
children: { label: y.componentKey },
|
|
217
214
|
width: 320,
|
|
218
|
-
onClose:
|
|
219
|
-
}),
|
|
215
|
+
onClose: () => t.setPanelVisible(!1)
|
|
216
|
+
}), t.setPanelVisible(!0)) : (r.close(), t.setPanelVisible(!1), t.setActiveComment(null)), !0;
|
|
220
217
|
}
|
|
221
|
-
},
|
|
218
|
+
}, W = {
|
|
222
219
|
id: "docs.operation.start-add-comment",
|
|
223
|
-
type:
|
|
224
|
-
handler(
|
|
225
|
-
var
|
|
226
|
-
const
|
|
227
|
-
if (!
|
|
220
|
+
type: E.OPERATION,
|
|
221
|
+
handler(e) {
|
|
222
|
+
var u, O, R;
|
|
223
|
+
const t = e.get(U), n = e.get(B).getCurrentUnitForType(S.UNIVER_DOC), i = e.get(H), o = e.get(F), s = e.get(Te), d = e.get(x), l = e.get(M), f = e.get(L), a = i.getActiveTextRange();
|
|
224
|
+
if (!n || !a)
|
|
228
225
|
return !1;
|
|
229
|
-
const
|
|
230
|
-
if (
|
|
231
|
-
return
|
|
232
|
-
|
|
233
|
-
const
|
|
234
|
-
unitId,
|
|
235
|
-
subUnitId,
|
|
236
|
-
id:
|
|
237
|
-
ref:
|
|
238
|
-
dT:
|
|
239
|
-
personId:
|
|
226
|
+
const h = (u = o.getRenderById(n.getUnitId())) == null ? void 0 : u.with(Fe);
|
|
227
|
+
if (h == null || h.setReserveRangesStatus(!0), a.collapsed)
|
|
228
|
+
return t.panelVisible ? (t.setPanelVisible(!1), f.close()) : l.executeCommand(w.id), !0;
|
|
229
|
+
l.executeCommand(w.id);
|
|
230
|
+
const _ = n.getUnitId(), C = ((R = (O = n.getBody()) == null ? void 0 : O.dataStream) != null ? R : "").slice(a.startOffset, a.endOffset), c = xe.transform.getPlainText(C), m = I, p = "", b = {
|
|
231
|
+
unitId: _,
|
|
232
|
+
subUnitId: m,
|
|
233
|
+
id: p,
|
|
234
|
+
ref: c,
|
|
235
|
+
dT: Ge(),
|
|
236
|
+
personId: s.getCurrentUser().userID,
|
|
240
237
|
text: {
|
|
241
238
|
dataStream: `\r
|
|
242
239
|
`
|
|
243
240
|
},
|
|
244
|
-
startOffset:
|
|
245
|
-
endOffset:
|
|
241
|
+
startOffset: a.startOffset,
|
|
242
|
+
endOffset: a.endOffset,
|
|
246
243
|
collapsed: !0,
|
|
247
|
-
threadId:
|
|
244
|
+
threadId: p
|
|
248
245
|
};
|
|
249
|
-
return
|
|
250
|
-
unitId,
|
|
251
|
-
subUnitId,
|
|
252
|
-
commentId
|
|
246
|
+
return h == null || h.blur(), d.startAdd(b), t.setActiveComment({
|
|
247
|
+
unitId: _,
|
|
248
|
+
subUnitId: m,
|
|
249
|
+
commentId: p
|
|
253
250
|
}), !0;
|
|
254
251
|
}
|
|
255
252
|
};
|
|
256
|
-
var
|
|
257
|
-
for (var
|
|
258
|
-
(
|
|
259
|
-
return
|
|
260
|
-
},
|
|
261
|
-
let
|
|
262
|
-
constructor(
|
|
263
|
-
super(), this._threadCommentPanelService =
|
|
253
|
+
var mt = Object.defineProperty, lt = Object.getOwnPropertyDescriptor, ut = (e, t, r, n) => {
|
|
254
|
+
for (var i = n > 1 ? void 0 : n ? lt(t, r) : t, o = e.length - 1, s; o >= 0; o--)
|
|
255
|
+
(s = e[o]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
256
|
+
return n && i && mt(t, r, i), i;
|
|
257
|
+
}, D = (e, t) => (r, n) => t(r, n, e);
|
|
258
|
+
let N = class extends j {
|
|
259
|
+
constructor(e, t, r, n, i, o) {
|
|
260
|
+
super(), this._threadCommentPanelService = e, this._univerInstanceService = t, this._commandService = r, this._docThreadCommentService = n, this._renderManagerService = i, this._threadCommentModel = o, this._initSelectionChange(), this._initActiveCommandChange();
|
|
264
261
|
}
|
|
265
262
|
_initSelectionChange() {
|
|
266
|
-
let
|
|
263
|
+
let e;
|
|
267
264
|
this.disposeWithMe(
|
|
268
|
-
this._commandService.onCommandExecuted((
|
|
269
|
-
var
|
|
270
|
-
if (
|
|
271
|
-
const
|
|
272
|
-
if (
|
|
273
|
-
const
|
|
274
|
-
if ((
|
|
265
|
+
this._commandService.onCommandExecuted((t) => {
|
|
266
|
+
var r, n, i, o;
|
|
267
|
+
if (t.id === Ne.id) {
|
|
268
|
+
const s = t.params, { unitId: d, ranges: l } = s;
|
|
269
|
+
if (ie(d)) return;
|
|
270
|
+
const f = this._univerInstanceService.getUnit(d, S.UNIVER_DOC), a = l[0];
|
|
271
|
+
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))
|
|
275
272
|
return;
|
|
276
|
-
if (
|
|
277
|
-
const { startOffset, endOffset, collapsed } =
|
|
278
|
-
let
|
|
279
|
-
if (
|
|
280
|
-
const
|
|
281
|
-
|
|
273
|
+
if (e = a, a && f) {
|
|
274
|
+
const { startOffset: h, endOffset: _, collapsed: C } = a;
|
|
275
|
+
let c;
|
|
276
|
+
if (C ? c = (n = (r = f.getBody()) == null ? void 0 : r.customDecorations) == null ? void 0 : n.find((m) => m.startIndex <= h && m.endIndex >= _ - 1) : c = (o = (i = f.getBody()) == null ? void 0 : i.customDecorations) == null ? void 0 : o.find((m) => m.startIndex <= h && m.endIndex >= _ - 1), c) {
|
|
277
|
+
const m = this._threadCommentModel.getComment(d, I, c.id);
|
|
278
|
+
m && !m.resolved && this._commandService.executeCommand(w.id, {
|
|
282
279
|
activeComment: {
|
|
283
|
-
unitId,
|
|
284
|
-
subUnitId:
|
|
285
|
-
commentId:
|
|
280
|
+
unitId: d,
|
|
281
|
+
subUnitId: I,
|
|
282
|
+
commentId: c.id
|
|
286
283
|
}
|
|
287
284
|
});
|
|
288
285
|
return;
|
|
@@ -290,264 +287,260 @@ let DocThreadCommentSelectionController = (_a2 = class extends Disposable {
|
|
|
290
287
|
}
|
|
291
288
|
if (!this._threadCommentPanelService.activeCommentId)
|
|
292
289
|
return;
|
|
293
|
-
this._commandService.executeCommand(
|
|
290
|
+
this._commandService.executeCommand(oe.id);
|
|
294
291
|
}
|
|
295
292
|
})
|
|
296
293
|
);
|
|
297
294
|
}
|
|
298
295
|
_initActiveCommandChange() {
|
|
299
|
-
this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe((
|
|
300
|
-
var
|
|
301
|
-
if (
|
|
302
|
-
const
|
|
303
|
-
if (
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
startOffset:
|
|
307
|
-
endOffset:
|
|
296
|
+
this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe((e) => {
|
|
297
|
+
var t, r, n, i;
|
|
298
|
+
if (e) {
|
|
299
|
+
const o = this._univerInstanceService.getUnit(e.unitId);
|
|
300
|
+
if (o) {
|
|
301
|
+
const s = (t = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : t.with(He), d = (n = (r = o.getBody()) == null ? void 0 : r.customDecorations) == null ? void 0 : n.find((l) => l.id === e.commentId);
|
|
302
|
+
d && s && s.scrollToRange({
|
|
303
|
+
startOffset: d.startIndex,
|
|
304
|
+
endOffset: d.endIndex,
|
|
308
305
|
collapsed: !1
|
|
309
306
|
});
|
|
310
307
|
}
|
|
311
308
|
}
|
|
312
|
-
(!
|
|
309
|
+
(!e || e.commentId !== ((i = this._docThreadCommentService.addingComment) == null ? void 0 : i.id)) && this._docThreadCommentService.endAdd();
|
|
313
310
|
}));
|
|
314
311
|
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
],
|
|
324
|
-
var
|
|
325
|
-
return
|
|
326
|
-
for (var
|
|
327
|
-
|
|
328
|
-
for (var
|
|
312
|
+
};
|
|
313
|
+
N = ut([
|
|
314
|
+
D(0, v(U)),
|
|
315
|
+
D(1, B),
|
|
316
|
+
D(2, M),
|
|
317
|
+
D(3, v(x)),
|
|
318
|
+
D(4, F),
|
|
319
|
+
D(5, v(de))
|
|
320
|
+
], N);
|
|
321
|
+
var g = function() {
|
|
322
|
+
return g = Object.assign || function(e) {
|
|
323
|
+
for (var t, r = 1, n = arguments.length; r < n; r++) {
|
|
324
|
+
t = arguments[r];
|
|
325
|
+
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
329
326
|
}
|
|
330
|
-
return
|
|
331
|
-
},
|
|
332
|
-
},
|
|
333
|
-
var
|
|
334
|
-
for (var
|
|
335
|
-
if (
|
|
336
|
-
for (var i = 0,
|
|
337
|
-
|
|
338
|
-
return
|
|
339
|
-
},
|
|
340
|
-
var
|
|
341
|
-
return
|
|
327
|
+
return e;
|
|
328
|
+
}, g.apply(this, arguments);
|
|
329
|
+
}, ft = function(e, t) {
|
|
330
|
+
var r = {};
|
|
331
|
+
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
332
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
333
|
+
for (var i = 0, n = Object.getOwnPropertySymbols(e); i < n.length; i++)
|
|
334
|
+
t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]]);
|
|
335
|
+
return r;
|
|
336
|
+
}, ge = ue(function(e, t) {
|
|
337
|
+
var r = e.icon, n = e.id, i = e.className, o = e.extend, s = ft(e, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), l = nt("_".concat(_t()));
|
|
338
|
+
return ve(r, "".concat(n), { defIds: r.defIds, idSuffix: l.current }, g({ ref: t, className: d }, s), o);
|
|
342
339
|
});
|
|
343
|
-
function
|
|
344
|
-
return
|
|
345
|
-
return
|
|
340
|
+
function ve(e, t, r, n, i) {
|
|
341
|
+
return fe(e.tag, g(g({ key: t }, ht(e, r, i)), n), (Ct(e, r).children || []).map(function(o, s) {
|
|
342
|
+
return ve(o, "".concat(t, "-").concat(e.tag, "-").concat(s), r, void 0, i);
|
|
346
343
|
}));
|
|
347
344
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
})), attrs;
|
|
345
|
+
function ht(e, t, r) {
|
|
346
|
+
var n = g({}, e.attrs);
|
|
347
|
+
r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1);
|
|
348
|
+
var i = t.defIds;
|
|
349
|
+
return !i || i.length === 0 || (e.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(function(o) {
|
|
350
|
+
var s = o[0], d = o[1];
|
|
351
|
+
typeof d == "string" && (n[s] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
352
|
+
})), n;
|
|
357
353
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}) }) : node;
|
|
354
|
+
function Ct(e, t) {
|
|
355
|
+
var r, n = t.defIds;
|
|
356
|
+
return !n || n.length === 0 ? e : e.tag === "defs" && (!((r = e.children) === null || r === void 0) && r.length) ? g(g({}, e), { children: e.children.map(function(i) {
|
|
357
|
+
return typeof i.attrs.id == "string" && n && n.indexOf(i.attrs.id) > -1 ? g(g({}, i), { attrs: g(g({}, i.attrs), { id: i.attrs.id + t.idSuffix }) }) : i;
|
|
358
|
+
}) }) : e;
|
|
364
359
|
}
|
|
365
|
-
|
|
366
|
-
function generateShortUuid() {
|
|
360
|
+
function _t() {
|
|
367
361
|
return Math.random().toString(36).substring(2, 8);
|
|
368
362
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
363
|
+
ge.displayName = "UniverIcon";
|
|
364
|
+
var gt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", 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", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", 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.13521 5.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.13521 8.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.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z" } }, { tag: "path", attrs: { fill: "currentColor", 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", fillRule: "evenodd", clipRule: "evenodd" } }] }, pe = ue(function(e, t) {
|
|
365
|
+
return fe(ge, Object.assign({}, e, {
|
|
373
366
|
id: "comment-single",
|
|
374
|
-
ref,
|
|
375
|
-
icon:
|
|
367
|
+
ref: t,
|
|
368
|
+
icon: gt
|
|
376
369
|
}));
|
|
377
370
|
});
|
|
378
|
-
|
|
379
|
-
const
|
|
380
|
-
[
|
|
381
|
-
[
|
|
371
|
+
pe.displayName = "CommentSingle";
|
|
372
|
+
const vt = {
|
|
373
|
+
[Ze.OTHERS]: {
|
|
374
|
+
[X.id]: {
|
|
382
375
|
order: 1,
|
|
383
|
-
menuItemFactory:
|
|
376
|
+
menuItemFactory: at
|
|
384
377
|
}
|
|
385
378
|
},
|
|
386
|
-
[
|
|
387
|
-
[
|
|
388
|
-
[
|
|
379
|
+
[ze.MAIN_AREA]: {
|
|
380
|
+
[Je.DATA]: {
|
|
381
|
+
[W.id]: {
|
|
389
382
|
order: 1,
|
|
390
|
-
menuItemFactory:
|
|
383
|
+
menuItemFactory: ct
|
|
391
384
|
}
|
|
392
385
|
}
|
|
393
386
|
}
|
|
394
387
|
};
|
|
395
|
-
var
|
|
396
|
-
for (var
|
|
397
|
-
(
|
|
398
|
-
return
|
|
399
|
-
},
|
|
400
|
-
let
|
|
401
|
-
constructor(
|
|
402
|
-
super(), this._commandService =
|
|
388
|
+
var pt = Object.defineProperty, It = Object.getOwnPropertyDescriptor, St = (e, t, r, n) => {
|
|
389
|
+
for (var i = n > 1 ? void 0 : n ? It(t, r) : t, o = e.length - 1, s; o >= 0; o--)
|
|
390
|
+
(s = e[o]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
391
|
+
return n && i && pt(t, r, i), i;
|
|
392
|
+
}, J = (e, t) => (r, n) => t(r, n, e);
|
|
393
|
+
let V = class extends j {
|
|
394
|
+
constructor(e, t, r) {
|
|
395
|
+
super(), this._commandService = e, this._menuManagerService = t, this._componentManager = r, this._initCommands(), this._initMenus(), this._initComponents();
|
|
403
396
|
}
|
|
404
397
|
_initCommands() {
|
|
405
398
|
[
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
].forEach((
|
|
412
|
-
this.disposeWithMe(this._commandService.registerCommand(
|
|
399
|
+
he,
|
|
400
|
+
Ce,
|
|
401
|
+
w,
|
|
402
|
+
W,
|
|
403
|
+
X
|
|
404
|
+
].forEach((e) => {
|
|
405
|
+
this.disposeWithMe(this._commandService.registerCommand(e));
|
|
413
406
|
});
|
|
414
407
|
}
|
|
415
408
|
_initMenus() {
|
|
416
|
-
this._menuManagerService.mergeMenu(
|
|
409
|
+
this._menuManagerService.mergeMenu(vt);
|
|
417
410
|
}
|
|
418
411
|
_initComponents() {
|
|
419
|
-
[
|
|
420
|
-
this.disposeWithMe(this._componentManager.register(
|
|
421
|
-
}), this.disposeWithMe(this._componentManager.register("CommentSingle",
|
|
412
|
+
[y].forEach((e) => {
|
|
413
|
+
this.disposeWithMe(this._componentManager.register(e.componentKey, e));
|
|
414
|
+
}), this.disposeWithMe(this._componentManager.register("CommentSingle", pe));
|
|
422
415
|
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
],
|
|
429
|
-
var
|
|
430
|
-
for (var
|
|
431
|
-
(
|
|
432
|
-
return
|
|
433
|
-
},
|
|
434
|
-
let
|
|
435
|
-
constructor(
|
|
436
|
-
super(), this._context =
|
|
416
|
+
};
|
|
417
|
+
V = St([
|
|
418
|
+
J(0, M),
|
|
419
|
+
J(1, Ye),
|
|
420
|
+
J(2, v(qe))
|
|
421
|
+
], V);
|
|
422
|
+
var Ot = Object.defineProperty, Mt = Object.getOwnPropertyDescriptor, bt = (e, t, r, n) => {
|
|
423
|
+
for (var i = n > 1 ? void 0 : n ? Mt(t, r) : t, o = e.length - 1, s; o >= 0; o--)
|
|
424
|
+
(s = e[o]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
425
|
+
return n && i && Ot(t, r, i), i;
|
|
426
|
+
}, T = (e, t) => (r, n) => t(r, n, e);
|
|
427
|
+
let Q = class extends j {
|
|
428
|
+
constructor(e, t, r, n, i, o, s) {
|
|
429
|
+
super(), this._context = e, this._docInterceptorService = t, this._threadCommentPanelService = r, this._docRenderController = n, this._univerInstanceService = i, this._threadCommentModel = o, this._commandService = s, this._interceptorViewModel(), this._initReRender(), this._initSyncComments();
|
|
437
430
|
}
|
|
438
431
|
_initReRender() {
|
|
439
|
-
this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe((
|
|
440
|
-
var
|
|
441
|
-
if (
|
|
442
|
-
this._docRenderController.reRender(
|
|
432
|
+
this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe((e) => {
|
|
433
|
+
var r;
|
|
434
|
+
if (e) {
|
|
435
|
+
this._docRenderController.reRender(e.unitId);
|
|
443
436
|
return;
|
|
444
437
|
}
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
})), this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe((
|
|
448
|
-
|
|
438
|
+
const t = (r = this._univerInstanceService.getCurrentUnitForType(S.UNIVER_DOC)) == null ? void 0 : r.getUnitId();
|
|
439
|
+
t && this._docRenderController.reRender(t);
|
|
440
|
+
})), this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe((e) => {
|
|
441
|
+
e.type === "resolve" && this._docRenderController.reRender(e.unitId);
|
|
449
442
|
}));
|
|
450
443
|
}
|
|
451
444
|
_interceptorViewModel() {
|
|
452
|
-
this._docInterceptorService.intercept(
|
|
453
|
-
handler:
|
|
454
|
-
if (!
|
|
455
|
-
return
|
|
456
|
-
const { unitId, index, customDecorations } =
|
|
457
|
-
if (!
|
|
458
|
-
return
|
|
459
|
-
...
|
|
445
|
+
this._docInterceptorService.intercept($e.CUSTOM_DECORATION, {
|
|
446
|
+
handler: (e, t, r) => {
|
|
447
|
+
if (!e)
|
|
448
|
+
return r(e);
|
|
449
|
+
const { unitId: n, index: i, customDecorations: o } = t, s = this._threadCommentPanelService.activeCommentId, { commentId: d, unitId: l } = s || {}, f = o.find((C) => C.id === d), a = this._threadCommentModel.getComment(n, I, e.id);
|
|
450
|
+
if (!a)
|
|
451
|
+
return r({
|
|
452
|
+
...e,
|
|
460
453
|
show: !1
|
|
461
454
|
});
|
|
462
|
-
const
|
|
463
|
-
return
|
|
464
|
-
...
|
|
465
|
-
active:
|
|
466
|
-
show: !
|
|
455
|
+
const h = f && i >= f.startIndex && i <= f.endIndex, _ = l === n && e.id === d;
|
|
456
|
+
return r({
|
|
457
|
+
...e,
|
|
458
|
+
active: _ || h,
|
|
459
|
+
show: !a.resolved
|
|
467
460
|
});
|
|
468
|
-
}
|
|
461
|
+
}
|
|
469
462
|
});
|
|
470
463
|
}
|
|
471
464
|
_initSyncComments() {
|
|
472
|
-
var
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
this._threadCommentModel.getComment(
|
|
476
|
-
}),
|
|
477
|
-
let
|
|
478
|
-
this.disposeWithMe(this._commandService.onCommandExecuted((
|
|
479
|
-
var
|
|
480
|
-
if (
|
|
481
|
-
if (
|
|
465
|
+
var i, o, s;
|
|
466
|
+
const e = this._context.unit.getUnitId(), t = I, r = (s = (o = (i = this._context.unit.getBody()) == null ? void 0 : i.customDecorations) == null ? void 0 : o.filter((d) => d.type === Y.COMMENT).map((d) => d.id)) != null ? s : [];
|
|
467
|
+
r.forEach((d) => {
|
|
468
|
+
this._threadCommentModel.getComment(e, t, d) || this._threadCommentModel.addComment(e, t, { id: d, threadId: d, ref: "", dT: "", personId: "", text: { dataStream: "" }, unitId: e, subUnitId: t });
|
|
469
|
+
}), r.length && this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(), I, r);
|
|
470
|
+
let n = r.sort();
|
|
471
|
+
this.disposeWithMe(this._commandService.onCommandExecuted((d) => {
|
|
472
|
+
var l, f, a;
|
|
473
|
+
if (d.id === se.id) {
|
|
474
|
+
if (d.params.unitId !== this._context.unit.getUnitId())
|
|
482
475
|
return;
|
|
483
|
-
const
|
|
484
|
-
if (JSON.stringify(
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}),
|
|
489
|
-
|
|
490
|
-
}),
|
|
491
|
-
this._threadCommentModel.getComment(
|
|
492
|
-
}), this._threadCommentModel.syncThreadComments(
|
|
476
|
+
const _ = (a = (f = (l = this._context.unit.getBody()) == null ? void 0 : l.customDecorations) == null ? void 0 : f.filter((c) => c.type === Y.COMMENT).map((c) => c.id)) != null ? a : [], C = _.sort();
|
|
477
|
+
if (JSON.stringify(n) !== JSON.stringify(C)) {
|
|
478
|
+
const c = new Set(n), m = new Set(C), p = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set();
|
|
479
|
+
_.forEach((u) => {
|
|
480
|
+
c.has(u) || p.add(u);
|
|
481
|
+
}), n.forEach((u) => {
|
|
482
|
+
m.has(u) || b.add(u);
|
|
483
|
+
}), n = C, p.forEach((u) => {
|
|
484
|
+
this._threadCommentModel.getComment(e, t, u) || this._threadCommentModel.addComment(e, t, { id: u, threadId: u, ref: "", dT: "", personId: "", text: { dataStream: "" }, unitId: e, subUnitId: t });
|
|
485
|
+
}), this._threadCommentModel.syncThreadComments(e, t, [...p]);
|
|
493
486
|
}
|
|
494
487
|
}
|
|
495
488
|
}));
|
|
496
489
|
}
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
],
|
|
506
|
-
var
|
|
507
|
-
for (var
|
|
508
|
-
(
|
|
509
|
-
return
|
|
510
|
-
},
|
|
511
|
-
let
|
|
512
|
-
constructor(
|
|
513
|
-
super(), this._config =
|
|
514
|
-
const { menu, ...
|
|
490
|
+
};
|
|
491
|
+
Q = bt([
|
|
492
|
+
T(1, v(Ve)),
|
|
493
|
+
T(2, v(U)),
|
|
494
|
+
T(3, v(Le)),
|
|
495
|
+
T(4, B),
|
|
496
|
+
T(5, v(de)),
|
|
497
|
+
T(6, M)
|
|
498
|
+
], Q);
|
|
499
|
+
var Ie = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor, Tt = (e, t, r) => t in e ? Ie(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, xt = (e, t, r, n) => {
|
|
500
|
+
for (var i = n > 1 ? void 0 : n ? Dt(t, r) : t, o = e.length - 1, s; o >= 0; o--)
|
|
501
|
+
(s = e[o]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
502
|
+
return n && i && Ie(t, r, i), i;
|
|
503
|
+
}, q = (e, t) => (r, n) => t(r, n, e), Se = (e, t, r) => Tt(e, typeof t != "symbol" ? t + "" : t, r);
|
|
504
|
+
let $ = class extends Ue {
|
|
505
|
+
constructor(e = ee, t, r, n) {
|
|
506
|
+
super(), this._config = e, this._injector = t, this._renderManagerSrv = r, this._configService = n;
|
|
507
|
+
const { menu: i, ...o } = Re(
|
|
515
508
|
{},
|
|
516
|
-
|
|
509
|
+
ee,
|
|
517
510
|
this._config
|
|
518
511
|
);
|
|
519
|
-
|
|
512
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(it, o);
|
|
520
513
|
}
|
|
521
514
|
onStarting() {
|
|
522
515
|
[
|
|
523
|
-
[
|
|
524
|
-
[
|
|
525
|
-
[
|
|
526
|
-
].forEach((
|
|
527
|
-
this._injector.add(
|
|
516
|
+
[V],
|
|
517
|
+
[N],
|
|
518
|
+
[x]
|
|
519
|
+
].forEach((e) => {
|
|
520
|
+
this._injector.add(e);
|
|
528
521
|
});
|
|
529
522
|
}
|
|
530
523
|
onRendered() {
|
|
531
|
-
this._initRenderModule(), this._injector.get(
|
|
524
|
+
this._initRenderModule(), this._injector.get(N), this._injector.get(V);
|
|
532
525
|
}
|
|
533
526
|
_initRenderModule() {
|
|
534
|
-
[
|
|
535
|
-
this._renderManagerSrv.registerRenderModule(
|
|
527
|
+
[Q].forEach((e) => {
|
|
528
|
+
this._renderManagerSrv.registerRenderModule(S.UNIVER_DOC, e);
|
|
536
529
|
});
|
|
537
530
|
}
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
],
|
|
531
|
+
};
|
|
532
|
+
Se($, "pluginName", rt);
|
|
533
|
+
Se($, "type", S.UNIVER_DOC);
|
|
534
|
+
$ = xt([
|
|
535
|
+
ye(Ae),
|
|
536
|
+
q(1, v(re)),
|
|
537
|
+
q(2, F),
|
|
538
|
+
q(3, Pe)
|
|
539
|
+
], $);
|
|
547
540
|
export {
|
|
548
|
-
AddDocCommentComment,
|
|
549
|
-
DeleteDocCommentComment,
|
|
550
|
-
ShowCommentPanelOperation,
|
|
551
|
-
StartAddCommentOperation,
|
|
552
|
-
UniverDocsThreadCommentUIPlugin
|
|
541
|
+
he as AddDocCommentComment,
|
|
542
|
+
Ce as DeleteDocCommentComment,
|
|
543
|
+
w as ShowCommentPanelOperation,
|
|
544
|
+
W as StartAddCommentOperation,
|
|
545
|
+
$ as UniverDocsThreadCommentUIPlugin
|
|
553
546
|
};
|