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