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