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