@univerjs/sheets-thread-comment-ui 0.8.0-nightly.202505261607 → 0.8.0-nightly.202505271607
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 +1 -1
- package/lib/es/index.js +299 -302
- package/lib/index.js +299 -302
- package/lib/types/controllers/menu.d.ts +9 -2
- package/lib/types/types/const.d.ts +0 -1
- package/lib/umd/index.js +1 -1
- package/package.json +11 -11
package/lib/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
var De = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var E = (
|
|
4
|
-
import { Inject as v, Disposable as k, DisposableCollection as
|
|
5
|
-
import { SheetsSelectionsService as
|
|
6
|
-
import { SheetsThreadCommentModel as $, UniverSheetsThreadCommentPlugin as
|
|
7
|
-
import { ThreadCommentPanelService as ae, SetActiveCommentOperation as ee, ThreadCommentTree as
|
|
8
|
-
import { UniverThreadCommentUIPlugin as
|
|
9
|
-
import { SheetCanvasPopManagerService as
|
|
10
|
-
import { IZenZoneService as
|
|
11
|
-
import { BehaviorSubject as
|
|
12
|
-
import { IRenderManagerService as
|
|
13
|
-
import { singleReferenceToGrid as A, serializeRange as
|
|
14
|
-
import { IThreadCommentDataSourceService as
|
|
15
|
-
import { AddCommentCommand as
|
|
16
|
-
import { jsx as
|
|
17
|
-
import { forwardRef as
|
|
18
|
-
const
|
|
19
|
-
var
|
|
20
|
-
for (var o =
|
|
21
|
-
(s =
|
|
2
|
+
var xe = (t, e, r) => e in t ? De(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var E = (t, e, r) => xe(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { Inject as v, Disposable as k, DisposableCollection as Ae, CommandType as Ve, IUniverInstanceService as N, InterceptorEffectEnum as je, UniverInstanceType as b, Range as He, ICommandService as se, RANGE_TYPE as he, Rectangle as Be, Tools as Le, DependentOn as Fe, Injector as We, IConfigService as Ze, Plugin as Ge, merge as ze } from "@univerjs/core";
|
|
5
|
+
import { SheetsSelectionsService as pe, getSheetCommandTarget as Ke, SheetInterceptorService as ve, INTERCEPTOR_POINT as Ye, SheetPermissionCheckController as Ce, RangeProtectionPermissionViewPoint as q, WorksheetViewPermission as J, WorkbookCommentPermission as Q, SetWorksheetActiveOperation as qe, RemoveSheetCommand as Je } from "@univerjs/sheets";
|
|
6
|
+
import { SheetsThreadCommentModel as $, UniverSheetsThreadCommentPlugin as Qe } from "@univerjs/sheets-thread-comment";
|
|
7
|
+
import { ThreadCommentPanelService as ae, SetActiveCommentOperation as ee, ThreadCommentTree as Xe, ThreadCommentPanel as et, ToggleSheetCommentPanelOperation as _e, THREAD_COMMENT_PANEL as tt, UniverThreadCommentUIPlugin as nt } from "@univerjs/thread-comment-ui";
|
|
8
|
+
import { UniverThreadCommentUIPlugin as Sn } from "@univerjs/thread-comment-ui";
|
|
9
|
+
import { SheetCanvasPopManagerService as rt, CellPopupManagerService as ot, ISheetClipboardService as it, COPY_TYPE as st, HoverManagerService as at, IMarkSelectionService as fe, IEditorBridgeService as ct, SheetSkeletonManagerService as dt, ScrollToRangeOperation as ht, whenSheetEditorFocused as mt, getCurrentRangeDisable$ as Se } from "@univerjs/sheets-ui";
|
|
10
|
+
import { IZenZoneService as ut, useDependency as U, useObservable as x, KeyCode as lt, MetaKeys as me, getMenuHiddenObservable as ge, MenuItemType as Ie, ContextMenuPosition as pt, ContextMenuGroup as vt, RibbonInsertGroup as Ct, IMenuManagerService as _t, ComponentManager as ft, IShortcutService as St } from "@univerjs/ui";
|
|
11
|
+
import { BehaviorSubject as gt, debounceTime as ce, map as It } from "rxjs";
|
|
12
|
+
import { IRenderManagerService as Pe } from "@univerjs/engine-render";
|
|
13
|
+
import { singleReferenceToGrid as A, serializeRange as Pt } from "@univerjs/engine-formula";
|
|
14
|
+
import { IThreadCommentDataSourceService as Te, DeleteCommentMutation as L, AddCommentMutation as ie, ThreadCommentModel as Tt } from "@univerjs/thread-comment";
|
|
15
|
+
import { AddCommentCommand as In, DeleteCommentCommand as Pn, DeleteCommentTreeCommand as Tn, IThreadCommentDataSourceService as bn, ResolveCommentCommand as Mn, UpdateCommentCommand as wn } from "@univerjs/thread-comment";
|
|
16
|
+
import { jsx as be } from "react/jsx-runtime";
|
|
17
|
+
import { forwardRef as Me, useRef as we, createElement as ye, useMemo as bt, useCallback as ue, useEffect as Mt } from "react";
|
|
18
|
+
const Ee = "univer.sheet.thread-comment-modal", Ue = "SHEET_THREAD_COMMENT";
|
|
19
|
+
var wt = Object.getOwnPropertyDescriptor, yt = (t, e, r, n) => {
|
|
20
|
+
for (var o = n > 1 ? void 0 : n ? wt(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
21
|
+
(s = t[i]) && (o = s(o) || o);
|
|
22
22
|
return o;
|
|
23
|
-
}, te = (
|
|
23
|
+
}, te = (t, e) => (r, n) => e(r, n, t);
|
|
24
24
|
let R = class extends k {
|
|
25
|
-
constructor(e, r,
|
|
25
|
+
constructor(e, r, n) {
|
|
26
26
|
super();
|
|
27
27
|
E(this, "_lastPopup", null);
|
|
28
28
|
E(this, "_activePopup");
|
|
29
|
-
E(this, "_activePopup$", new
|
|
29
|
+
E(this, "_activePopup$", new gt(null));
|
|
30
30
|
E(this, "activePopup$", this._activePopup$.asObservable());
|
|
31
|
-
this._canvasPopupManagerService = e, this._zenZoneService = r, this._cellPopupManagerService =
|
|
31
|
+
this._canvasPopupManagerService = e, this._zenZoneService = r, this._cellPopupManagerService = n, this._initZenVisible(), this.disposeWithMe(() => {
|
|
32
32
|
this._activePopup$.complete();
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -42,8 +42,8 @@ let R = class extends k {
|
|
|
42
42
|
}
|
|
43
43
|
showPopup(e, r) {
|
|
44
44
|
var d;
|
|
45
|
-
const { row:
|
|
46
|
-
if (this._activePopup &&
|
|
45
|
+
const { row: n, col: o, unitId: i, subUnitId: s } = e;
|
|
46
|
+
if (this._activePopup && n === this._activePopup.row && o === this._activePopup.col && i === this._activePopup.unitId && s === ((d = this.activePopup) == null ? void 0 : d.subUnitId)) {
|
|
47
47
|
this._activePopup = e, this._activePopup$.next(e);
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
@@ -52,13 +52,13 @@ let R = class extends k {
|
|
|
52
52
|
this._activePopup = e, this._activePopup$.next(e);
|
|
53
53
|
const a = this._cellPopupManagerService.showPopup(
|
|
54
54
|
{
|
|
55
|
-
row:
|
|
55
|
+
row: n,
|
|
56
56
|
col: o,
|
|
57
57
|
unitId: i,
|
|
58
58
|
subUnitId: s
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
componentKey:
|
|
61
|
+
componentKey: Ee,
|
|
62
62
|
onClickOutside: () => {
|
|
63
63
|
this.hidePopup();
|
|
64
64
|
},
|
|
@@ -72,7 +72,7 @@ let R = class extends k {
|
|
|
72
72
|
);
|
|
73
73
|
if (!a)
|
|
74
74
|
throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");
|
|
75
|
-
const c = new
|
|
75
|
+
const c = new Ae();
|
|
76
76
|
c.add(a), c.add({
|
|
77
77
|
dispose: () => {
|
|
78
78
|
r == null || r();
|
|
@@ -89,20 +89,20 @@ let R = class extends k {
|
|
|
89
89
|
}, this._activePopup$.next(this._activePopup));
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
|
-
R =
|
|
93
|
-
te(0, v(
|
|
94
|
-
te(1,
|
|
95
|
-
te(2, v(
|
|
92
|
+
R = yt([
|
|
93
|
+
te(0, v(rt)),
|
|
94
|
+
te(1, ut),
|
|
95
|
+
te(2, v(ot))
|
|
96
96
|
], R);
|
|
97
97
|
const V = {
|
|
98
|
-
type:
|
|
98
|
+
type: Ve.OPERATION,
|
|
99
99
|
id: "sheets.operation.show-comment-modal",
|
|
100
|
-
handler(
|
|
101
|
-
var
|
|
102
|
-
const e =
|
|
100
|
+
handler(t) {
|
|
101
|
+
var C;
|
|
102
|
+
const e = t.get(pe), r = t.get(N), n = t.get(R), o = t.get(ae), i = (C = e.getCurrentLastSelection()) == null ? void 0 : C.primary, s = t.get($);
|
|
103
103
|
if (!i)
|
|
104
104
|
return !1;
|
|
105
|
-
const a =
|
|
105
|
+
const a = Ke(r);
|
|
106
106
|
if (!a)
|
|
107
107
|
return !1;
|
|
108
108
|
const { workbook: c, worksheet: d, unitId: m, subUnitId: h } = a, u = {
|
|
@@ -113,7 +113,7 @@ const V = {
|
|
|
113
113
|
row: i.startRow,
|
|
114
114
|
col: i.startColumn
|
|
115
115
|
};
|
|
116
|
-
|
|
116
|
+
n.showPopup(u);
|
|
117
117
|
const p = s.getByLocation(m, h, i.startRow, i.startColumn);
|
|
118
118
|
return p && o.setActiveComment({
|
|
119
119
|
unitId: m,
|
|
@@ -122,34 +122,31 @@ const V = {
|
|
|
122
122
|
trigger: "context-menu"
|
|
123
123
|
}), !0;
|
|
124
124
|
}
|
|
125
|
-
},
|
|
126
|
-
var
|
|
127
|
-
for (var o =
|
|
128
|
-
(s =
|
|
125
|
+
}, Et = "sheets-thread-comment.config", le = {};
|
|
126
|
+
var Ut = Object.getOwnPropertyDescriptor, Rt = (t, e, r, n) => {
|
|
127
|
+
for (var o = n > 1 ? void 0 : n ? Ut(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
128
|
+
(s = t[i]) && (o = s(o) || o);
|
|
129
129
|
return o;
|
|
130
|
-
}, j = (
|
|
130
|
+
}, j = (t, e) => (r, n) => e(r, n, t);
|
|
131
131
|
let F = class extends k {
|
|
132
|
-
constructor(
|
|
133
|
-
super(), this._sheetInterceptorService =
|
|
132
|
+
constructor(t, e, r, n) {
|
|
133
|
+
super(), this._sheetInterceptorService = t, this._sheetsThreadCommentModel = e, this._univerInstanceService = r, this._renderManagerService = n, this._initViewModelIntercept(), this._initSkeletonChange();
|
|
134
134
|
}
|
|
135
135
|
_initViewModelIntercept() {
|
|
136
136
|
this.disposeWithMe(
|
|
137
137
|
this._sheetInterceptorService.intercept(
|
|
138
|
-
|
|
138
|
+
Ye.CELL_CONTENT,
|
|
139
139
|
{
|
|
140
|
-
effect:
|
|
141
|
-
handler: (
|
|
142
|
-
const { row:
|
|
143
|
-
return this._sheetsThreadCommentModel.showCommentMarker(i, s,
|
|
144
|
-
...
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
color: "#FFBD37",
|
|
149
|
-
size: 6
|
|
150
|
-
}
|
|
140
|
+
effect: je.Style,
|
|
141
|
+
handler: (t, e, r) => {
|
|
142
|
+
const { row: n, col: o, unitId: i, subUnitId: s } = e;
|
|
143
|
+
return this._sheetsThreadCommentModel.showCommentMarker(i, s, n, o) && ((!t || t === e.rawData) && (t = { ...e.rawData }), t.markers = {
|
|
144
|
+
...t == null ? void 0 : t.markers,
|
|
145
|
+
tr: {
|
|
146
|
+
color: "#FFBD37",
|
|
147
|
+
size: 6
|
|
151
148
|
}
|
|
152
|
-
})
|
|
149
|
+
}), r(t);
|
|
153
150
|
},
|
|
154
151
|
priority: 100
|
|
155
152
|
}
|
|
@@ -157,79 +154,79 @@ let F = class extends k {
|
|
|
157
154
|
);
|
|
158
155
|
}
|
|
159
156
|
_initSkeletonChange() {
|
|
160
|
-
const
|
|
157
|
+
const t = () => {
|
|
161
158
|
var o;
|
|
162
159
|
const e = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET);
|
|
163
160
|
if (!e) return;
|
|
164
|
-
const r = e.getUnitId(),
|
|
165
|
-
(o =
|
|
161
|
+
const r = e.getUnitId(), n = this._renderManagerService.getRenderById(r);
|
|
162
|
+
(o = n == null ? void 0 : n.mainComponent) == null || o.makeForceDirty();
|
|
166
163
|
};
|
|
167
164
|
this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(ce(16)).subscribe(() => {
|
|
168
|
-
|
|
165
|
+
t();
|
|
169
166
|
}));
|
|
170
167
|
}
|
|
171
168
|
};
|
|
172
|
-
F =
|
|
173
|
-
j(0, v(
|
|
169
|
+
F = Rt([
|
|
170
|
+
j(0, v(ve)),
|
|
174
171
|
j(1, v($)),
|
|
175
172
|
j(2, N),
|
|
176
|
-
j(3,
|
|
173
|
+
j(3, Pe)
|
|
177
174
|
], F);
|
|
178
|
-
var
|
|
179
|
-
for (var o =
|
|
180
|
-
(s =
|
|
175
|
+
var Ot = Object.getOwnPropertyDescriptor, kt = (t, e, r, n) => {
|
|
176
|
+
for (var o = n > 1 ? void 0 : n ? Ot(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
177
|
+
(s = t[i]) && (o = s(o) || o);
|
|
181
178
|
return o;
|
|
182
|
-
}, ne = (
|
|
183
|
-
const
|
|
184
|
-
const
|
|
185
|
-
startColumn:
|
|
186
|
-
startRow:
|
|
187
|
-
endColumn:
|
|
188
|
-
endRow:
|
|
179
|
+
}, ne = (t, e) => (r, n) => e(r, n, t);
|
|
180
|
+
const Nt = (t, e, r) => {
|
|
181
|
+
const n = A(t), o = r.row - e.row, i = r.column - e.column, s = {
|
|
182
|
+
startColumn: n.column + i,
|
|
183
|
+
startRow: n.row + o,
|
|
184
|
+
endColumn: n.column + i,
|
|
185
|
+
endRow: n.row + o
|
|
189
186
|
};
|
|
190
|
-
return
|
|
187
|
+
return Pt(s);
|
|
191
188
|
};
|
|
192
189
|
let W = class extends k {
|
|
193
|
-
constructor(e, r,
|
|
190
|
+
constructor(e, r, n) {
|
|
194
191
|
super();
|
|
195
192
|
E(this, "_copyInfo");
|
|
196
|
-
this._sheetClipboardService = e, this._sheetsThreadCommentModel = r, this._threadCommentDataSourceService =
|
|
193
|
+
this._sheetClipboardService = e, this._sheetsThreadCommentModel = r, this._threadCommentDataSourceService = n, this._initClipboardHook();
|
|
197
194
|
}
|
|
198
195
|
// eslint-disable-next-line max-lines-per-function
|
|
199
196
|
_initClipboardHook() {
|
|
200
197
|
this.disposeWithMe(
|
|
201
198
|
this._sheetClipboardService.addClipboardHook({
|
|
202
|
-
id:
|
|
203
|
-
onBeforeCopy: (e, r,
|
|
199
|
+
id: Ue,
|
|
200
|
+
onBeforeCopy: (e, r, n) => {
|
|
204
201
|
this._copyInfo = {
|
|
205
202
|
unitId: e,
|
|
206
203
|
subUnitId: r,
|
|
207
|
-
range:
|
|
204
|
+
range: n
|
|
208
205
|
};
|
|
209
206
|
},
|
|
210
207
|
// eslint-disable-next-line max-lines-per-function
|
|
211
|
-
onPasteCells: (e, r,
|
|
208
|
+
onPasteCells: (e, r, n, o) => {
|
|
212
209
|
const { unitId: i, subUnitId: s, range: a } = r, c = {
|
|
213
210
|
row: a.rows[0],
|
|
214
211
|
column: a.cols[0]
|
|
215
212
|
};
|
|
216
|
-
if (o.copyType ===
|
|
213
|
+
if (o.copyType === st.CUT && this._copyInfo) {
|
|
217
214
|
const { range: d, unitId: m, subUnitId: h } = this._copyInfo, u = {
|
|
218
215
|
row: d.startRow,
|
|
219
216
|
column: d.startColumn
|
|
220
217
|
};
|
|
221
218
|
if (!(i === m && s === h)) {
|
|
222
219
|
const p = [];
|
|
223
|
-
|
|
220
|
+
He.foreach(d, (g, l) => {
|
|
224
221
|
const I = this._sheetsThreadCommentModel.getAllByLocation(m, h, g, l);
|
|
225
|
-
this._threadCommentDataSourceService.syncUpdateMutationToColla ? I.forEach((
|
|
226
|
-
p.push(
|
|
227
|
-
}) : I.forEach(({ children:
|
|
222
|
+
this._threadCommentDataSourceService.syncUpdateMutationToColla ? I.forEach((_) => {
|
|
223
|
+
p.push(_);
|
|
224
|
+
}) : I.forEach(({ children: _, ...M }) => {
|
|
228
225
|
M.parentId || p.push(M);
|
|
229
226
|
});
|
|
230
227
|
});
|
|
231
|
-
const
|
|
232
|
-
|
|
228
|
+
const C = [], S = [], O = [], D = [], X = (g) => {
|
|
229
|
+
C.unshift({
|
|
233
230
|
id: L.id,
|
|
234
231
|
params: {
|
|
235
232
|
unitId: m,
|
|
@@ -243,13 +240,13 @@ let W = class extends k {
|
|
|
243
240
|
subUnitId: s,
|
|
244
241
|
comment: {
|
|
245
242
|
...g,
|
|
246
|
-
ref:
|
|
243
|
+
ref: Nt(g.ref, u, c),
|
|
247
244
|
unitId: i,
|
|
248
245
|
subUnitId: s
|
|
249
246
|
},
|
|
250
247
|
sync: !0
|
|
251
248
|
}
|
|
252
|
-
}),
|
|
249
|
+
}), S.push({
|
|
253
250
|
id: ie.id,
|
|
254
251
|
params: {
|
|
255
252
|
unitId: m,
|
|
@@ -257,7 +254,7 @@ let W = class extends k {
|
|
|
257
254
|
comment: g,
|
|
258
255
|
sync: !0
|
|
259
256
|
}
|
|
260
|
-
}),
|
|
257
|
+
}), D.unshift({
|
|
261
258
|
id: L.id,
|
|
262
259
|
params: {
|
|
263
260
|
unitId: i,
|
|
@@ -269,8 +266,8 @@ let W = class extends k {
|
|
|
269
266
|
return p.forEach((g) => {
|
|
270
267
|
X(g);
|
|
271
268
|
}), {
|
|
272
|
-
redos: [...
|
|
273
|
-
undos: [...
|
|
269
|
+
redos: [...C, ...O],
|
|
270
|
+
undos: [...D, ...S]
|
|
274
271
|
};
|
|
275
272
|
}
|
|
276
273
|
}
|
|
@@ -283,26 +280,26 @@ let W = class extends k {
|
|
|
283
280
|
);
|
|
284
281
|
}
|
|
285
282
|
};
|
|
286
|
-
W =
|
|
287
|
-
ne(0, v(
|
|
283
|
+
W = kt([
|
|
284
|
+
ne(0, v(it)),
|
|
288
285
|
ne(1, v($)),
|
|
289
|
-
ne(2,
|
|
286
|
+
ne(2, Te)
|
|
290
287
|
], W);
|
|
291
|
-
var
|
|
292
|
-
for (var o =
|
|
293
|
-
(s =
|
|
288
|
+
var $t = Object.getOwnPropertyDescriptor, Dt = (t, e, r, n) => {
|
|
289
|
+
for (var o = n > 1 ? void 0 : n ? $t(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
290
|
+
(s = t[i]) && (o = s(o) || o);
|
|
294
291
|
return o;
|
|
295
|
-
}, H = (
|
|
292
|
+
}, H = (t, e) => (r, n) => e(r, n, t);
|
|
296
293
|
let Z = class extends k {
|
|
297
|
-
constructor(
|
|
298
|
-
super(), this._hoverManagerService =
|
|
294
|
+
constructor(t, e, r, n) {
|
|
295
|
+
super(), this._hoverManagerService = t, this._sheetsThreadCommentPopupService = e, this._sheetsThreadCommentModel = r, this._sheetPermissionCheckController = n, this._initHoverEvent();
|
|
299
296
|
}
|
|
300
297
|
_initHoverEvent() {
|
|
301
298
|
this.disposeWithMe(
|
|
302
|
-
this._hoverManagerService.currentCell$.pipe(ce(100)).subscribe((
|
|
299
|
+
this._hoverManagerService.currentCell$.pipe(ce(100)).subscribe((t) => {
|
|
303
300
|
const e = this._sheetsThreadCommentPopupService.activePopup;
|
|
304
|
-
if (
|
|
305
|
-
const { location: r } =
|
|
301
|
+
if (t && (e && e.temp || !e)) {
|
|
302
|
+
const { location: r } = t, { unitId: n, subUnitId: o, row: i, col: s } = r, a = this._sheetsThreadCommentModel.getByLocation(n, o, i, s);
|
|
306
303
|
if (a) {
|
|
307
304
|
if (!this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
308
305
|
workbookTypes: [Q],
|
|
@@ -310,9 +307,9 @@ let Z = class extends k {
|
|
|
310
307
|
rangeTypes: [q]
|
|
311
308
|
}, [{ startRow: i, startColumn: s, endRow: i, endColumn: s }]))
|
|
312
309
|
return;
|
|
313
|
-
const d = this._sheetsThreadCommentModel.getComment(
|
|
310
|
+
const d = this._sheetsThreadCommentModel.getComment(n, o, a);
|
|
314
311
|
d && !d.resolved && this._sheetsThreadCommentPopupService.showPopup({
|
|
315
|
-
unitId:
|
|
312
|
+
unitId: n,
|
|
316
313
|
subUnitId: o,
|
|
317
314
|
row: i,
|
|
318
315
|
col: s,
|
|
@@ -327,42 +324,42 @@ let Z = class extends k {
|
|
|
327
324
|
}
|
|
328
325
|
};
|
|
329
326
|
Z = Dt([
|
|
330
|
-
H(0, v(
|
|
327
|
+
H(0, v(at)),
|
|
331
328
|
H(1, v(R)),
|
|
332
329
|
H(2, v($)),
|
|
333
330
|
H(3, v(Ce))
|
|
334
331
|
], Z);
|
|
335
|
-
var
|
|
336
|
-
for (var o =
|
|
337
|
-
(s =
|
|
332
|
+
var xt = Object.getOwnPropertyDescriptor, At = (t, e, r, n) => {
|
|
333
|
+
for (var o = n > 1 ? void 0 : n ? xt(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
334
|
+
(s = t[i]) && (o = s(o) || o);
|
|
338
335
|
return o;
|
|
339
|
-
}, w = (
|
|
340
|
-
let
|
|
341
|
-
constructor(e, r,
|
|
336
|
+
}, w = (t, e) => (r, n) => e(r, n, t);
|
|
337
|
+
let G = class extends k {
|
|
338
|
+
constructor(e, r, n, o, i, s, a, c, d, m) {
|
|
342
339
|
super();
|
|
343
340
|
E(this, "_isSwitchToCommenting", !1);
|
|
344
341
|
E(this, "_selectionShapeInfo", null);
|
|
345
|
-
this._commandService = e, this._sheetsThreadCommentPopupService = r, this._sheetsThreadCommentModel =
|
|
342
|
+
this._commandService = e, this._sheetsThreadCommentPopupService = r, this._sheetsThreadCommentModel = n, this._threadCommentPanelService = o, this._univerInstanceService = i, this._sheetPermissionCheckController = s, this._markSelectionService = a, this._sheetSelectionService = c, this._editorBridgeService = d, this._renderManagerService = m, this._initCommandListener(), this._initPanelListener(), this._initMarkSelection(), this._initSelectionUpdateListener(), this._initEditorBridge();
|
|
346
343
|
}
|
|
347
|
-
_handleSelectionChange(e, r,
|
|
348
|
-
var u, p,
|
|
349
|
-
const o = (u = e[0]) == null ? void 0 : u.range, i = this._renderManagerService.getRenderById(r), s = (p = i == null ? void 0 : i.with(
|
|
344
|
+
_handleSelectionChange(e, r, n) {
|
|
345
|
+
var u, p, C;
|
|
346
|
+
const o = (u = e[0]) == null ? void 0 : u.range, i = this._renderManagerService.getRenderById(r), s = (p = i == null ? void 0 : i.with(dt).getSkeletonParam(n)) == null ? void 0 : p.skeleton;
|
|
350
347
|
if (!s || !o)
|
|
351
348
|
return;
|
|
352
349
|
const a = s.getCellWithCoordByIndex(o.startRow, o.startColumn);
|
|
353
|
-
if ((((
|
|
350
|
+
if ((((C = o.rangeType) != null ? C : he.NORMAL) !== he.NORMAL || o.endColumn - o.startColumn > 0 || o.endRow - o.startRow > 0) && !((a.isMerged || a.isMergedMainCell) && Be.equals(a.mergeInfo, o))) {
|
|
354
351
|
this._threadCommentPanelService.activeCommentId && this._commandService.executeCommand(ee.id);
|
|
355
352
|
return;
|
|
356
353
|
}
|
|
357
354
|
const d = a.actualRow, m = a.actualColumn;
|
|
358
|
-
if (!this._sheetsThreadCommentModel.showCommentMarker(r,
|
|
355
|
+
if (!this._sheetsThreadCommentModel.showCommentMarker(r, n, d, m)) {
|
|
359
356
|
this._threadCommentPanelService.activeCommentId && this._commandService.executeCommand(ee.id);
|
|
360
357
|
return;
|
|
361
358
|
}
|
|
362
|
-
const h = this._sheetsThreadCommentModel.getByLocation(r,
|
|
359
|
+
const h = this._sheetsThreadCommentModel.getByLocation(r, n, d, m);
|
|
363
360
|
h && this._commandService.executeCommand(ee.id, {
|
|
364
361
|
unitId: r,
|
|
365
|
-
subUnitId:
|
|
362
|
+
subUnitId: n,
|
|
366
363
|
commentId: h
|
|
367
364
|
});
|
|
368
365
|
}
|
|
@@ -386,10 +383,10 @@ let z = class extends k {
|
|
|
386
383
|
_initCommandListener() {
|
|
387
384
|
this._commandService.onCommandExecuted((e) => {
|
|
388
385
|
if (e.id === L.id) {
|
|
389
|
-
const r = e.params,
|
|
390
|
-
if (!
|
|
386
|
+
const r = e.params, n = this._sheetsThreadCommentPopupService.activePopup;
|
|
387
|
+
if (!n)
|
|
391
388
|
return;
|
|
392
|
-
const { unitId: o, subUnitId: i, commentId: s } =
|
|
389
|
+
const { unitId: o, subUnitId: i, commentId: s } = n;
|
|
393
390
|
r.unitId === o && r.subUnitId === i && r.commentId === s && this._sheetsThreadCommentPopupService.hidePopup();
|
|
394
391
|
}
|
|
395
392
|
});
|
|
@@ -398,14 +395,14 @@ let z = class extends k {
|
|
|
398
395
|
this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async (e) => {
|
|
399
396
|
var r;
|
|
400
397
|
if (e) {
|
|
401
|
-
const { unitId:
|
|
398
|
+
const { unitId: n, subUnitId: o, commentId: i, trigger: s } = e, a = this._sheetsThreadCommentModel.getComment(n, o, i);
|
|
402
399
|
if (!a || a.resolved)
|
|
403
400
|
return;
|
|
404
401
|
const c = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET);
|
|
405
|
-
if (!c || c.getUnitId() !==
|
|
402
|
+
if (!c || c.getUnitId() !== n)
|
|
406
403
|
return;
|
|
407
|
-
this._isSwitchToCommenting = !0, ((r = c.getActiveSheet()) == null ? void 0 : r.getSheetId()) !== o && await this._commandService.executeCommand(
|
|
408
|
-
unitId:
|
|
404
|
+
this._isSwitchToCommenting = !0, ((r = c.getActiveSheet()) == null ? void 0 : r.getSheetId()) !== o && await this._commandService.executeCommand(qe.id, {
|
|
405
|
+
unitId: n,
|
|
409
406
|
subUnitId: o
|
|
410
407
|
}), this._isSwitchToCommenting = !1;
|
|
411
408
|
const h = A(a.ref), { row: u, column: p } = h;
|
|
@@ -415,18 +412,18 @@ let z = class extends k {
|
|
|
415
412
|
rangeTypes: [q]
|
|
416
413
|
}, [{ startRow: u, startColumn: p, endRow: u, endColumn: p }]))
|
|
417
414
|
return;
|
|
418
|
-
const
|
|
419
|
-
if (await this._commandService.executeCommand(
|
|
415
|
+
const S = 1;
|
|
416
|
+
if (await this._commandService.executeCommand(ht.id, {
|
|
420
417
|
range: {
|
|
421
|
-
startRow: Math.max(h.row -
|
|
422
|
-
endRow: h.row +
|
|
423
|
-
startColumn: Math.max(h.column -
|
|
424
|
-
endColumn: h.column +
|
|
418
|
+
startRow: Math.max(h.row - S, 0),
|
|
419
|
+
endRow: h.row + S,
|
|
420
|
+
startColumn: Math.max(h.column - S, 0),
|
|
421
|
+
endColumn: h.column + S
|
|
425
422
|
}
|
|
426
423
|
}), this._editorBridgeService.isVisible().visible)
|
|
427
424
|
return;
|
|
428
425
|
this._sheetsThreadCommentPopupService.showPopup({
|
|
429
|
-
unitId:
|
|
426
|
+
unitId: n,
|
|
430
427
|
subUnitId: o,
|
|
431
428
|
row: h.row,
|
|
432
429
|
col: h.column,
|
|
@@ -444,15 +441,15 @@ let z = class extends k {
|
|
|
444
441
|
this._selectionShapeInfo && (this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId), this._selectionShapeInfo = null);
|
|
445
442
|
return;
|
|
446
443
|
}
|
|
447
|
-
const { unitId: r, subUnitId:
|
|
444
|
+
const { unitId: r, subUnitId: n, commentId: o } = e;
|
|
448
445
|
this._selectionShapeInfo && (this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId), this._selectionShapeInfo = null);
|
|
449
|
-
const i = this._sheetsThreadCommentModel.getComment(r,
|
|
446
|
+
const i = this._sheetsThreadCommentModel.getComment(r, n, o);
|
|
450
447
|
if (!i)
|
|
451
448
|
return;
|
|
452
449
|
const s = A(i.ref), { row: a, column: c } = s;
|
|
453
450
|
if (Number.isNaN(a) || Number.isNaN(c))
|
|
454
451
|
return null;
|
|
455
|
-
const d = (u = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET)) == null ? void 0 : u.getSheetBySheetId(
|
|
452
|
+
const d = (u = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET)) == null ? void 0 : u.getSheetBySheetId(n), m = (p = d == null ? void 0 : d.getMergedCell(a, c)) != null ? p : {
|
|
456
453
|
startColumn: c,
|
|
457
454
|
endColumn: c,
|
|
458
455
|
startRow: a,
|
|
@@ -479,7 +476,7 @@ let z = class extends k {
|
|
|
479
476
|
}));
|
|
480
477
|
}
|
|
481
478
|
};
|
|
482
|
-
|
|
479
|
+
G = At([
|
|
483
480
|
w(0, se),
|
|
484
481
|
w(1, v(R)),
|
|
485
482
|
w(2, v($)),
|
|
@@ -487,29 +484,29 @@ z = Vt([
|
|
|
487
484
|
w(4, N),
|
|
488
485
|
w(5, v(Ce)),
|
|
489
486
|
w(6, fe),
|
|
490
|
-
w(7, v(
|
|
491
|
-
w(8,
|
|
492
|
-
w(9,
|
|
493
|
-
],
|
|
494
|
-
var
|
|
495
|
-
for (var o =
|
|
496
|
-
(s =
|
|
487
|
+
w(7, v(pe)),
|
|
488
|
+
w(8, ct),
|
|
489
|
+
w(9, Pe)
|
|
490
|
+
], G);
|
|
491
|
+
var Vt = Object.getOwnPropertyDescriptor, jt = (t, e, r, n) => {
|
|
492
|
+
for (var o = n > 1 ? void 0 : n ? Vt(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
493
|
+
(s = t[i]) && (o = s(o) || o);
|
|
497
494
|
return o;
|
|
498
|
-
}, B = (
|
|
499
|
-
let
|
|
500
|
-
constructor(
|
|
501
|
-
super(), this._sheetInterceptorService =
|
|
495
|
+
}, B = (t, e) => (r, n) => e(r, n, t);
|
|
496
|
+
let z = class extends k {
|
|
497
|
+
constructor(t, e, r, n) {
|
|
498
|
+
super(), this._sheetInterceptorService = t, this._univerInstanceService = e, this._threadCommentModel = r, this._threadCommentDataSourceService = n, this._initSheetChange();
|
|
502
499
|
}
|
|
503
500
|
_initSheetChange() {
|
|
504
501
|
this.disposeWithMe(
|
|
505
502
|
this._sheetInterceptorService.interceptCommand({
|
|
506
|
-
getMutations: (
|
|
503
|
+
getMutations: (t) => {
|
|
507
504
|
var e;
|
|
508
|
-
if (
|
|
509
|
-
const r =
|
|
510
|
-
if (!
|
|
505
|
+
if (t.id === Je.id) {
|
|
506
|
+
const r = t.params, n = r.unitId ? this._univerInstanceService.getUnit(r.unitId) : this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET);
|
|
507
|
+
if (!n)
|
|
511
508
|
return { redos: [], undos: [] };
|
|
512
|
-
const o =
|
|
509
|
+
const o = n.getUnitId(), i = r.subUnitId || ((e = n.getActiveSheet()) == null ? void 0 : e.getSheetId());
|
|
513
510
|
if (!i)
|
|
514
511
|
return { redos: [], undos: [] };
|
|
515
512
|
const s = this._threadCommentModel.ensureMap(o, i), a = Array.from(s.values()).filter((u) => !u.parentId), c = a.map((u) => u.id), d = this._threadCommentDataSourceService.syncUpdateMutationToColla, m = c.map((u) => ({
|
|
@@ -539,78 +536,78 @@ let G = class extends k {
|
|
|
539
536
|
);
|
|
540
537
|
}
|
|
541
538
|
};
|
|
542
|
-
|
|
543
|
-
B(0, v(
|
|
539
|
+
z = jt([
|
|
540
|
+
B(0, v(ve)),
|
|
544
541
|
B(1, N),
|
|
545
|
-
B(2, v(
|
|
546
|
-
B(3,
|
|
547
|
-
],
|
|
542
|
+
B(2, v(Tt)),
|
|
543
|
+
B(3, Te)
|
|
544
|
+
], z);
|
|
548
545
|
var P = function() {
|
|
549
|
-
return P = Object.assign || function(
|
|
550
|
-
for (var e, r = 1,
|
|
546
|
+
return P = Object.assign || function(t) {
|
|
547
|
+
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
551
548
|
e = arguments[r];
|
|
552
|
-
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (
|
|
549
|
+
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
553
550
|
}
|
|
554
|
-
return
|
|
551
|
+
return t;
|
|
555
552
|
}, P.apply(this, arguments);
|
|
556
|
-
},
|
|
553
|
+
}, Ht = function(t, e) {
|
|
557
554
|
var r = {};
|
|
558
|
-
for (var
|
|
559
|
-
if (
|
|
560
|
-
for (var o = 0,
|
|
561
|
-
e.indexOf(
|
|
555
|
+
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
|
|
556
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
557
|
+
for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
|
|
558
|
+
e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (r[n[o]] = t[n[o]]);
|
|
562
559
|
return r;
|
|
563
|
-
},
|
|
564
|
-
var r =
|
|
565
|
-
return
|
|
560
|
+
}, Re = Me(function(t, e) {
|
|
561
|
+
var r = t.icon, n = t.id, o = t.className, i = t.extend, s = Ht(t, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(o || "").trim(), c = we("_".concat(Ft()));
|
|
562
|
+
return Oe(r, "".concat(n), { defIds: r.defIds, idSuffix: c.current }, P({ ref: e, className: a }, s), i);
|
|
566
563
|
});
|
|
567
|
-
function
|
|
568
|
-
return
|
|
569
|
-
return
|
|
564
|
+
function Oe(t, e, r, n, o) {
|
|
565
|
+
return ye(t.tag, P(P({ key: e }, Bt(t, r, o)), n), (Lt(t, r).children || []).map(function(i, s) {
|
|
566
|
+
return Oe(i, "".concat(e, "-").concat(t.tag, "-").concat(s), r, void 0, o);
|
|
570
567
|
}));
|
|
571
568
|
}
|
|
572
|
-
function
|
|
573
|
-
var
|
|
574
|
-
r != null && r.colorChannel1 &&
|
|
569
|
+
function Bt(t, e, r) {
|
|
570
|
+
var n = P({}, t.attrs);
|
|
571
|
+
r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1), t.tag === "mask" && n.id && (n.id = n.id + e.idSuffix), Object.entries(n).forEach(function(i) {
|
|
575
572
|
var s = i[0], a = i[1];
|
|
576
|
-
s === "mask" && typeof a == "string" && (
|
|
573
|
+
s === "mask" && typeof a == "string" && (n[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
577
574
|
});
|
|
578
575
|
var o = e.defIds;
|
|
579
|
-
return !o || o.length === 0 || (
|
|
576
|
+
return !o || o.length === 0 || (t.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(i) {
|
|
580
577
|
var s = i[0], a = i[1];
|
|
581
|
-
typeof a == "string" && (
|
|
582
|
-
})),
|
|
578
|
+
typeof a == "string" && (n[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
579
|
+
})), n;
|
|
583
580
|
}
|
|
584
|
-
function
|
|
585
|
-
var r,
|
|
586
|
-
return !
|
|
587
|
-
return typeof o.attrs.id == "string" &&
|
|
588
|
-
}) }) :
|
|
581
|
+
function Lt(t, e) {
|
|
582
|
+
var r, n = e.defIds;
|
|
583
|
+
return !n || n.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? P(P({}, t), { children: t.children.map(function(o) {
|
|
584
|
+
return typeof o.attrs.id == "string" && n && n.indexOf(o.attrs.id) > -1 ? P(P({}, o), { attrs: P(P({}, o.attrs), { id: o.attrs.id + e.idSuffix }) }) : o;
|
|
585
|
+
}) }) : t;
|
|
589
586
|
}
|
|
590
|
-
function
|
|
587
|
+
function Ft() {
|
|
591
588
|
return Math.random().toString(36).substring(2, 8);
|
|
592
589
|
}
|
|
593
|
-
|
|
594
|
-
var
|
|
595
|
-
return
|
|
596
|
-
id: "comment-
|
|
590
|
+
Re.displayName = "UniverIcon";
|
|
591
|
+
var Wt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z" } }, { 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" } }] }, ke = Me(function(t, e) {
|
|
592
|
+
return ye(Re, Object.assign({}, t, {
|
|
593
|
+
id: "comment-icon",
|
|
597
594
|
ref: e,
|
|
598
|
-
icon:
|
|
595
|
+
icon: Wt
|
|
599
596
|
}));
|
|
600
597
|
});
|
|
601
|
-
|
|
602
|
-
const
|
|
603
|
-
const
|
|
604
|
-
if (
|
|
598
|
+
ke.displayName = "CommentIcon";
|
|
599
|
+
const Zt = () => {
|
|
600
|
+
const t = U(N), e = U(R), r = x(e.activePopup$), n = U($);
|
|
601
|
+
if (x(n.commentUpdate$), !r)
|
|
605
602
|
return null;
|
|
606
|
-
const { row: o, col: i, unitId: s, subUnitId: a, trigger: c } = r, d =
|
|
603
|
+
const { row: o, col: i, unitId: s, subUnitId: a, trigger: c } = r, d = n.getByLocation(s, a, o, i), m = `${Le.chatAtABC(i)}${o + 1}`, h = () => {
|
|
607
604
|
e.hidePopup();
|
|
608
605
|
}, u = (p) => {
|
|
609
|
-
var
|
|
610
|
-
return (O = (
|
|
606
|
+
var C, S, O;
|
|
607
|
+
return (O = (S = (C = t.getCurrentUnitForType(b.UNIVER_SHEET)) == null ? void 0 : C.getSheetBySheetId(p)) == null ? void 0 : S.getName()) != null ? O : "";
|
|
611
608
|
};
|
|
612
|
-
return /* @__PURE__ */
|
|
613
|
-
|
|
609
|
+
return /* @__PURE__ */ be(
|
|
610
|
+
Xe,
|
|
614
611
|
{
|
|
615
612
|
onClick: () => {
|
|
616
613
|
e.persistPopup();
|
|
@@ -628,32 +625,32 @@ const zt = () => {
|
|
|
628
625
|
);
|
|
629
626
|
}, Gt = () => {
|
|
630
627
|
var g;
|
|
631
|
-
const
|
|
632
|
-
const I =
|
|
633
|
-
I.forEach((T,
|
|
634
|
-
|
|
628
|
+
const t = U(fe), e = U(N), r = U(R), n = e.getCurrentUnitForType(b.UNIVER_SHEET), o = n.getUnitId(), i = U(se), s = bt(() => n.activeSheet$.pipe(It((l) => l == null ? void 0 : l.getSheetId())), [n.activeSheet$]), a = x(s, (g = n.getActiveSheet()) == null ? void 0 : g.getSheetId()), c = we(null), d = U(ae), m = x(d.activeCommentId$), h = x(d.panelVisible$, d.panelVisible), u = ue((l) => {
|
|
629
|
+
const I = n.getSheets(), _ = {};
|
|
630
|
+
I.forEach((T, f) => {
|
|
631
|
+
_[T.getSheetId()] = f;
|
|
635
632
|
});
|
|
636
|
-
const M = (T) => T.map((
|
|
637
|
-
var
|
|
638
|
-
const y = A(
|
|
639
|
-
return { ...
|
|
640
|
-
}).sort((
|
|
633
|
+
const M = (T) => T.map((f) => {
|
|
634
|
+
var de;
|
|
635
|
+
const y = A(f.ref), $e = [(de = _[f.subUnitId]) != null ? de : 0, y.row, y.column];
|
|
636
|
+
return { ...f, p: $e };
|
|
637
|
+
}).sort((f, y) => f.p[0] === y.p[0] ? f.p[1] === y.p[1] ? f.p[2] - y.p[2] : f.p[1] - y.p[1] : f.p[0] - y.p[0]);
|
|
641
638
|
return [
|
|
642
639
|
...M(l.filter((T) => !T.resolved)),
|
|
643
640
|
...M(l.filter((T) => T.resolved))
|
|
644
641
|
];
|
|
645
|
-
}, [
|
|
642
|
+
}, [n]), p = ue((l) => {
|
|
646
643
|
var I;
|
|
647
644
|
if (l.unitId === o && l.subUnitId === a && !l.resolved) {
|
|
648
|
-
const { row:
|
|
645
|
+
const { row: _, column: M } = A(l.ref), T = n.getSheetBySheetId(l.subUnitId), f = (I = T == null ? void 0 : T.getMergedCell(_, M)) != null ? I : {
|
|
649
646
|
startColumn: M,
|
|
650
647
|
endColumn: M,
|
|
651
|
-
startRow:
|
|
652
|
-
endRow:
|
|
648
|
+
startRow: _,
|
|
649
|
+
endRow: _
|
|
653
650
|
};
|
|
654
|
-
if (!Number.isNaN(
|
|
655
|
-
return
|
|
656
|
-
range:
|
|
651
|
+
if (!Number.isNaN(_) && !Number.isNaN(M))
|
|
652
|
+
return t.addShape({
|
|
653
|
+
range: f,
|
|
657
654
|
style: {
|
|
658
655
|
// hasAutoFill: false,
|
|
659
656
|
fill: "rgb(255, 189, 55, 0.35)",
|
|
@@ -665,123 +662,123 @@ const zt = () => {
|
|
|
665
662
|
});
|
|
666
663
|
}
|
|
667
664
|
return null;
|
|
668
|
-
}, [
|
|
669
|
-
var I,
|
|
670
|
-
return (
|
|
671
|
-
},
|
|
665
|
+
}, [t, a, o]), C = (l) => {
|
|
666
|
+
var I, _;
|
|
667
|
+
return (_ = (I = n.getSheetBySheetId(l)) == null ? void 0 : I.getName()) != null ? _ : "";
|
|
668
|
+
}, S = () => {
|
|
672
669
|
i.executeCommand(V.id);
|
|
673
670
|
}, O = (l) => {
|
|
674
|
-
m && m.unitId === l.unitId && m.subUnitId === l.subUnitId && m.commentId === l.id || (c.current && (
|
|
675
|
-
},
|
|
676
|
-
c.current && (
|
|
671
|
+
m && m.unitId === l.unitId && m.subUnitId === l.subUnitId && m.commentId === l.id || (c.current && (t.removeShape(c.current), c.current = null), c.current = p(l));
|
|
672
|
+
}, D = () => {
|
|
673
|
+
c.current && (t.removeShape(c.current), c.current = null);
|
|
677
674
|
}, X = (l, I) => {
|
|
678
675
|
I && r.hidePopup();
|
|
679
676
|
};
|
|
680
|
-
return
|
|
681
|
-
!h && c.current &&
|
|
682
|
-
}, [
|
|
683
|
-
|
|
677
|
+
return Mt(() => {
|
|
678
|
+
!h && c.current && t.removeShape(c.current);
|
|
679
|
+
}, [t, h]), /* @__PURE__ */ be(
|
|
680
|
+
et,
|
|
684
681
|
{
|
|
685
682
|
unitId: o,
|
|
686
683
|
subUnitId$: s,
|
|
687
684
|
type: b.UNIVER_SHEET,
|
|
688
|
-
onAdd:
|
|
689
|
-
getSubUnitName:
|
|
685
|
+
onAdd: S,
|
|
686
|
+
getSubUnitName: C,
|
|
690
687
|
onResolve: X,
|
|
691
688
|
sortComments: u,
|
|
692
689
|
onItemEnter: O,
|
|
693
|
-
onItemLeave:
|
|
694
|
-
onDeleteComment: () => (
|
|
690
|
+
onItemLeave: D,
|
|
691
|
+
onDeleteComment: () => (D(), !0)
|
|
695
692
|
}
|
|
696
693
|
);
|
|
697
|
-
},
|
|
694
|
+
}, zt = (t) => ({
|
|
698
695
|
id: V.id,
|
|
699
|
-
type:
|
|
700
|
-
icon:
|
|
696
|
+
type: Ie.BUTTON,
|
|
697
|
+
icon: "CommentIcon",
|
|
701
698
|
title: "sheetThreadComment.menu.addComment",
|
|
702
|
-
hidden$:
|
|
703
|
-
disabled$:
|
|
699
|
+
hidden$: ge(t, b.UNIVER_SHEET),
|
|
700
|
+
disabled$: Se(t, {
|
|
704
701
|
workbookTypes: [Q],
|
|
705
702
|
worksheetTypes: [J],
|
|
706
703
|
rangeTypes: [q]
|
|
707
704
|
})
|
|
708
|
-
}),
|
|
709
|
-
id:
|
|
710
|
-
type:
|
|
711
|
-
icon:
|
|
705
|
+
}), Kt = (t) => ({
|
|
706
|
+
id: _e.id,
|
|
707
|
+
type: Ie.BUTTON,
|
|
708
|
+
icon: "CommentIcon",
|
|
712
709
|
tooltip: "sheetThreadComment.menu.commentManagement",
|
|
713
|
-
disabled$:
|
|
710
|
+
disabled$: Se(t, {
|
|
714
711
|
workbookTypes: [Q],
|
|
715
712
|
worksheetTypes: [J],
|
|
716
713
|
rangeTypes: [q]
|
|
717
714
|
}),
|
|
718
|
-
hidden$:
|
|
719
|
-
}),
|
|
715
|
+
hidden$: ge(t, b.UNIVER_SHEET)
|
|
716
|
+
}), Yt = {
|
|
720
717
|
id: V.id,
|
|
721
|
-
binding:
|
|
722
|
-
preconditions:
|
|
723
|
-
},
|
|
718
|
+
binding: lt.M | me.CTRL_COMMAND | me.ALT,
|
|
719
|
+
preconditions: mt
|
|
720
|
+
}, qt = {
|
|
724
721
|
[Ct.MEDIA]: {
|
|
725
|
-
[
|
|
722
|
+
[_e.id]: {
|
|
726
723
|
order: 2,
|
|
727
|
-
menuItemFactory:
|
|
724
|
+
menuItemFactory: Kt
|
|
728
725
|
}
|
|
729
726
|
},
|
|
730
|
-
[
|
|
731
|
-
[
|
|
727
|
+
[pt.MAIN_AREA]: {
|
|
728
|
+
[vt.OTHERS]: {
|
|
732
729
|
[V.id]: {
|
|
733
730
|
order: 0,
|
|
734
|
-
menuItemFactory:
|
|
731
|
+
menuItemFactory: zt
|
|
735
732
|
}
|
|
736
733
|
}
|
|
737
734
|
}
|
|
738
735
|
};
|
|
739
|
-
var
|
|
740
|
-
for (var o =
|
|
741
|
-
(s =
|
|
736
|
+
var Jt = Object.getOwnPropertyDescriptor, Qt = (t, e, r, n) => {
|
|
737
|
+
for (var o = n > 1 ? void 0 : n ? Jt(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
738
|
+
(s = t[i]) && (o = s(o) || o);
|
|
742
739
|
return o;
|
|
743
|
-
}, re = (
|
|
740
|
+
}, re = (t, e) => (r, n) => e(r, n, t);
|
|
744
741
|
let K = class extends k {
|
|
745
|
-
constructor(
|
|
746
|
-
super(), this._menuManagerService =
|
|
742
|
+
constructor(t, e, r) {
|
|
743
|
+
super(), this._menuManagerService = t, this._componentManager = e, this._shortcutService = r, this._initMenu(), this._initShortcut(), this._initComponent();
|
|
747
744
|
}
|
|
748
745
|
_initShortcut() {
|
|
749
|
-
this._shortcutService.registerShortcut(
|
|
746
|
+
this._shortcutService.registerShortcut(Yt);
|
|
750
747
|
}
|
|
751
748
|
_initMenu() {
|
|
752
|
-
this._menuManagerService.mergeMenu(
|
|
749
|
+
this._menuManagerService.mergeMenu(qt);
|
|
753
750
|
}
|
|
754
751
|
_initComponent() {
|
|
755
752
|
[
|
|
756
|
-
[
|
|
757
|
-
[
|
|
758
|
-
[
|
|
759
|
-
].forEach(([
|
|
753
|
+
[Ee, Zt],
|
|
754
|
+
[tt, Gt],
|
|
755
|
+
["CommentIcon", ke]
|
|
756
|
+
].forEach(([t, e]) => {
|
|
760
757
|
this.disposeWithMe(
|
|
761
|
-
this._componentManager.register(
|
|
758
|
+
this._componentManager.register(t, e)
|
|
762
759
|
);
|
|
763
760
|
});
|
|
764
761
|
}
|
|
765
762
|
};
|
|
766
|
-
K =
|
|
767
|
-
re(0,
|
|
763
|
+
K = Qt([
|
|
764
|
+
re(0, _t),
|
|
768
765
|
re(1, v(ft)),
|
|
769
|
-
re(2,
|
|
766
|
+
re(2, St)
|
|
770
767
|
], K);
|
|
771
|
-
var
|
|
772
|
-
for (var o =
|
|
773
|
-
(s =
|
|
768
|
+
var Xt = Object.defineProperty, en = Object.getOwnPropertyDescriptor, tn = (t, e, r) => e in t ? Xt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, nn = (t, e, r, n) => {
|
|
769
|
+
for (var o = n > 1 ? void 0 : n ? en(e, r) : e, i = t.length - 1, s; i >= 0; i--)
|
|
770
|
+
(s = t[i]) && (o = s(o) || o);
|
|
774
771
|
return o;
|
|
775
|
-
}, oe = (
|
|
772
|
+
}, oe = (t, e) => (r, n) => e(r, n, t), Ne = (t, e, r) => tn(t, typeof e != "symbol" ? e + "" : e, r);
|
|
776
773
|
let Y = class extends Ge {
|
|
777
|
-
constructor(
|
|
778
|
-
super(), this._config =
|
|
779
|
-
const { menu: o, ...i } =
|
|
774
|
+
constructor(t = le, e, r, n) {
|
|
775
|
+
super(), this._config = t, this._injector = e, this._commandService = r, this._configService = n;
|
|
776
|
+
const { menu: o, ...i } = ze(
|
|
780
777
|
{},
|
|
781
|
-
|
|
778
|
+
le,
|
|
782
779
|
this._config
|
|
783
780
|
);
|
|
784
|
-
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(
|
|
781
|
+
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(Et, i);
|
|
785
782
|
}
|
|
786
783
|
onStarting() {
|
|
787
784
|
[
|
|
@@ -789,40 +786,40 @@ let Y = class extends Ge {
|
|
|
789
786
|
[F],
|
|
790
787
|
[W],
|
|
791
788
|
[Z],
|
|
792
|
-
[G],
|
|
793
789
|
[z],
|
|
790
|
+
[G],
|
|
794
791
|
[R]
|
|
795
|
-
].forEach((
|
|
796
|
-
this._injector.add(
|
|
797
|
-
}), [V].forEach((
|
|
798
|
-
this._commandService.registerCommand(
|
|
792
|
+
].forEach((t) => {
|
|
793
|
+
this._injector.add(t);
|
|
794
|
+
}), [V].forEach((t) => {
|
|
795
|
+
this._commandService.registerCommand(t);
|
|
799
796
|
}), this._injector.get(K);
|
|
800
797
|
}
|
|
801
798
|
onReady() {
|
|
802
|
-
this._injector.get(F), this._injector.get(
|
|
799
|
+
this._injector.get(F), this._injector.get(z);
|
|
803
800
|
}
|
|
804
801
|
onRendered() {
|
|
805
|
-
this._injector.get(W), this._injector.get(Z), this._injector.get(
|
|
802
|
+
this._injector.get(W), this._injector.get(Z), this._injector.get(G);
|
|
806
803
|
}
|
|
807
804
|
};
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
Y =
|
|
811
|
-
|
|
812
|
-
oe(1, v(
|
|
805
|
+
Ne(Y, "pluginName", Ue);
|
|
806
|
+
Ne(Y, "type", b.UNIVER_SHEET);
|
|
807
|
+
Y = nn([
|
|
808
|
+
Fe(nt, Qe),
|
|
809
|
+
oe(1, v(We)),
|
|
813
810
|
oe(2, v(se)),
|
|
814
|
-
oe(3,
|
|
811
|
+
oe(3, Ze)
|
|
815
812
|
], Y);
|
|
816
813
|
export {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
814
|
+
In as AddCommentCommand,
|
|
815
|
+
Pn as DeleteCommentCommand,
|
|
816
|
+
Tn as DeleteCommentTreeCommand,
|
|
817
|
+
bn as IThreadCommentDataSourceService,
|
|
818
|
+
Mn as ResolveCommentCommand,
|
|
819
|
+
Ue as SHEETS_THREAD_COMMENT,
|
|
823
820
|
R as SheetsThreadCommentPopupService,
|
|
824
821
|
V as ShowAddSheetCommentModalOperation,
|
|
825
822
|
Y as UniverSheetsThreadCommentUIPlugin,
|
|
826
|
-
|
|
827
|
-
|
|
823
|
+
Sn as UniverThreadCommentUIPlugin,
|
|
824
|
+
wn as UpdateCommentCommand
|
|
828
825
|
};
|