@univerjs/sheets-thread-comment-ui 0.7.0-beta.0 → 0.7.0-nightly.202504301607
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 +124 -118
- package/lib/index.js +124 -118
- package/lib/types/services/sheets-thread-comment-popup.service.d.ts +3 -2
- package/lib/umd/index.js +1 -1
- package/package.json +12 -12
- package/LICENSE +0 -176
package/lib/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
var De = Object.defineProperty;
|
|
2
2
|
var Ae = (n, e, r) => e in n ? De(n, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[e] = r;
|
|
3
3
|
var E = (n, e, r) => Ae(n, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { Inject as v, Disposable as k, DisposableCollection as Ve, CommandType as He, IUniverInstanceService as N, InterceptorEffectEnum as je, UniverInstanceType as b, Range as Be, ICommandService as
|
|
4
|
+
import { Inject as v, Disposable as k, DisposableCollection as Ve, CommandType as He, IUniverInstanceService as N, InterceptorEffectEnum as je, UniverInstanceType as b, Range as Be, ICommandService as se, RANGE_TYPE as me, Rectangle as Le, Tools as Fe, DependentOn as We, Injector as Ze, IConfigService as ze, Plugin as Ge, merge as Ke } from "@univerjs/core";
|
|
5
5
|
import { SheetsSelectionsService as ve, getSheetCommandTarget as Ye, SheetInterceptorService as _e, INTERCEPTOR_POINT as qe, SheetPermissionCheckController as Ce, RangeProtectionPermissionViewPoint as q, WorksheetViewPermission as J, WorkbookCommentPermission as Q, SetWorksheetActiveOperation as Je, RemoveSheetCommand as Qe } from "@univerjs/sheets";
|
|
6
6
|
import { SheetsThreadCommentModel as $, UniverSheetsThreadCommentPlugin as Xe } from "@univerjs/sheets-thread-comment";
|
|
7
|
-
import { ThreadCommentPanelService as
|
|
8
|
-
import { UniverThreadCommentUIPlugin as
|
|
9
|
-
import { SheetCanvasPopManagerService as ot,
|
|
10
|
-
import { IZenZoneService as
|
|
11
|
-
import { BehaviorSubject as
|
|
7
|
+
import { ThreadCommentPanelService as ae, SetActiveCommentOperation as ee, ThreadCommentTree as et, ThreadCommentPanel as tt, ToggleSheetCommentPanelOperation as Se, THREAD_COMMENT_PANEL as nt, UniverThreadCommentUIPlugin as rt } from "@univerjs/thread-comment-ui";
|
|
8
|
+
import { UniverThreadCommentUIPlugin as gn } from "@univerjs/thread-comment-ui";
|
|
9
|
+
import { SheetCanvasPopManagerService as ot, CellPopupManagerService as it, ISheetClipboardService as st, COPY_TYPE as at, HoverManagerService as ct, IMarkSelectionService as fe, IEditorBridgeService as dt, SheetSkeletonManagerService as ht, ScrollToRangeOperation as mt, whenSheetEditorFocused as ut, getCurrentRangeDisable$ as ge } from "@univerjs/sheets-ui";
|
|
10
|
+
import { IZenZoneService as lt, useDependency as U, useObservable as D, KeyCode as pt, MetaKeys as ue, getMenuHiddenObservable as Ie, MenuItemType as Pe, ContextMenuPosition as vt, ContextMenuGroup as _t, RibbonStartGroup as Ct, IMenuManagerService as St, ComponentManager as ft, IShortcutService as gt } from "@univerjs/ui";
|
|
11
|
+
import { BehaviorSubject as It, debounceTime as ce, map as Pt } from "rxjs";
|
|
12
12
|
import { IRenderManagerService as Te } from "@univerjs/engine-render";
|
|
13
|
-
import { singleReferenceToGrid as A, serializeRange as
|
|
14
|
-
import { IThreadCommentDataSourceService as be, DeleteCommentMutation as L, AddCommentMutation as
|
|
15
|
-
import { AddCommentCommand as
|
|
13
|
+
import { singleReferenceToGrid as A, serializeRange as Tt } from "@univerjs/engine-formula";
|
|
14
|
+
import { IThreadCommentDataSourceService as be, DeleteCommentMutation as L, AddCommentMutation as ie, ThreadCommentModel as bt } from "@univerjs/thread-comment";
|
|
15
|
+
import { AddCommentCommand as Pn, DeleteCommentCommand as Tn, DeleteCommentTreeCommand as bn, IThreadCommentDataSourceService as Mn, ResolveCommentCommand as wn, UpdateCommentCommand as yn } from "@univerjs/thread-comment";
|
|
16
16
|
import { jsx as Me } from "react/jsx-runtime";
|
|
17
|
-
import { forwardRef as we, useRef as ye, createElement as Ee, useMemo as
|
|
18
|
-
const Ue = "univer.sheet.thread-comment-modal",
|
|
19
|
-
var
|
|
20
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
17
|
+
import { forwardRef as we, useRef as ye, createElement as Ee, useMemo as Mt, useCallback as le, useEffect as wt } from "react";
|
|
18
|
+
const Ue = "univer.sheet.thread-comment-modal", de = "comment-single", Re = "SHEET_THREAD_COMMENT";
|
|
19
|
+
var yt = Object.getOwnPropertyDescriptor, Et = (n, e, r, t) => {
|
|
20
|
+
for (var o = t > 1 ? void 0 : t ? yt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
21
21
|
(s = n[i]) && (o = s(o) || o);
|
|
22
22
|
return o;
|
|
23
|
-
},
|
|
23
|
+
}, te = (n, e) => (r, t) => e(r, t, n);
|
|
24
24
|
let R = class extends k {
|
|
25
|
-
constructor(e, r) {
|
|
25
|
+
constructor(e, r, t) {
|
|
26
26
|
super();
|
|
27
27
|
E(this, "_lastPopup", null);
|
|
28
28
|
E(this, "_activePopup");
|
|
29
|
-
E(this, "_activePopup$", new
|
|
29
|
+
E(this, "_activePopup$", new It(null));
|
|
30
30
|
E(this, "activePopup$", this._activePopup$.asObservable());
|
|
31
|
-
this._canvasPopupManagerService = e, this._zenZoneService = r, this._initZenVisible(), this.disposeWithMe(() => {
|
|
31
|
+
this._canvasPopupManagerService = e, this._zenZoneService = r, this._cellPopupManagerService = t, this._initZenVisible(), this.disposeWithMe(() => {
|
|
32
32
|
this._activePopup$.complete();
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -50,9 +50,13 @@ let R = class extends k {
|
|
|
50
50
|
if (this._lastPopup && this._lastPopup.dispose(), this._zenZoneService.visible)
|
|
51
51
|
return;
|
|
52
52
|
this._activePopup = e, this._activePopup$.next(e);
|
|
53
|
-
const a = this.
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
const a = this._cellPopupManagerService.showPopup(
|
|
54
|
+
{
|
|
55
|
+
row: t,
|
|
56
|
+
col: o,
|
|
57
|
+
unitId: i,
|
|
58
|
+
subUnitId: s
|
|
59
|
+
},
|
|
56
60
|
{
|
|
57
61
|
componentKey: Ue,
|
|
58
62
|
onClickOutside: () => {
|
|
@@ -62,7 +66,8 @@ let R = class extends k {
|
|
|
62
66
|
excludeOutside: [
|
|
63
67
|
...Array.from(document.querySelectorAll(".univer-thread-comment")),
|
|
64
68
|
document.getElementById("thread-comment-add")
|
|
65
|
-
].filter(Boolean)
|
|
69
|
+
].filter(Boolean),
|
|
70
|
+
priority: 2
|
|
66
71
|
}
|
|
67
72
|
);
|
|
68
73
|
if (!a)
|
|
@@ -84,16 +89,17 @@ let R = class extends k {
|
|
|
84
89
|
}, this._activePopup$.next(this._activePopup));
|
|
85
90
|
}
|
|
86
91
|
};
|
|
87
|
-
R =
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
R = Et([
|
|
93
|
+
te(0, v(ot)),
|
|
94
|
+
te(1, lt),
|
|
95
|
+
te(2, v(it))
|
|
90
96
|
], R);
|
|
91
97
|
const V = {
|
|
92
98
|
type: He.OPERATION,
|
|
93
99
|
id: "sheets.operation.show-comment-modal",
|
|
94
100
|
handler(n) {
|
|
95
101
|
var _;
|
|
96
|
-
const e = n.get(ve), r = n.get(N), t = n.get(R), o = n.get(
|
|
102
|
+
const e = n.get(ve), r = n.get(N), t = n.get(R), o = n.get(ae), i = (_ = e.getCurrentLastSelection()) == null ? void 0 : _.primary, s = n.get($);
|
|
97
103
|
if (!i)
|
|
98
104
|
return !1;
|
|
99
105
|
const a = Ye(r);
|
|
@@ -116,9 +122,9 @@ const V = {
|
|
|
116
122
|
trigger: "context-menu"
|
|
117
123
|
}), !0;
|
|
118
124
|
}
|
|
119
|
-
},
|
|
120
|
-
var
|
|
121
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
125
|
+
}, Ut = "sheets-thread-comment.config", pe = {};
|
|
126
|
+
var Rt = Object.getOwnPropertyDescriptor, Ot = (n, e, r, t) => {
|
|
127
|
+
for (var o = t > 1 ? void 0 : t ? Rt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
122
128
|
(s = n[i]) && (o = s(o) || o);
|
|
123
129
|
return o;
|
|
124
130
|
}, H = (n, e) => (r, t) => e(r, t, n);
|
|
@@ -158,30 +164,30 @@ let F = class extends k {
|
|
|
158
164
|
const r = e.getUnitId(), t = this._renderManagerService.getRenderById(r);
|
|
159
165
|
(o = t == null ? void 0 : t.mainComponent) == null || o.makeForceDirty();
|
|
160
166
|
};
|
|
161
|
-
this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(
|
|
167
|
+
this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(ce(16)).subscribe(() => {
|
|
162
168
|
n();
|
|
163
169
|
}));
|
|
164
170
|
}
|
|
165
171
|
};
|
|
166
|
-
F =
|
|
172
|
+
F = Ot([
|
|
167
173
|
H(0, v(_e)),
|
|
168
174
|
H(1, v($)),
|
|
169
175
|
H(2, N),
|
|
170
176
|
H(3, Te)
|
|
171
177
|
], F);
|
|
172
|
-
var
|
|
173
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
178
|
+
var kt = Object.getOwnPropertyDescriptor, Nt = (n, e, r, t) => {
|
|
179
|
+
for (var o = t > 1 ? void 0 : t ? kt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
174
180
|
(s = n[i]) && (o = s(o) || o);
|
|
175
181
|
return o;
|
|
176
|
-
},
|
|
177
|
-
const
|
|
182
|
+
}, ne = (n, e) => (r, t) => e(r, t, n);
|
|
183
|
+
const $t = (n, e, r) => {
|
|
178
184
|
const t = A(n), o = r.row - e.row, i = r.column - e.column, s = {
|
|
179
185
|
startColumn: t.column + i,
|
|
180
186
|
startRow: t.row + o,
|
|
181
187
|
endColumn: t.column + i,
|
|
182
188
|
endRow: t.row + o
|
|
183
189
|
};
|
|
184
|
-
return
|
|
190
|
+
return Tt(s);
|
|
185
191
|
};
|
|
186
192
|
let W = class extends k {
|
|
187
193
|
constructor(e, r, t) {
|
|
@@ -207,7 +213,7 @@ let W = class extends k {
|
|
|
207
213
|
row: a.rows[0],
|
|
208
214
|
column: a.cols[0]
|
|
209
215
|
};
|
|
210
|
-
if (o.copyType ===
|
|
216
|
+
if (o.copyType === at.CUT && this._copyInfo) {
|
|
211
217
|
const { range: d, unitId: m, subUnitId: h } = this._copyInfo, u = {
|
|
212
218
|
row: d.startRow,
|
|
213
219
|
column: d.startColumn
|
|
@@ -231,20 +237,20 @@ let W = class extends k {
|
|
|
231
237
|
commentId: g.id
|
|
232
238
|
}
|
|
233
239
|
}), O.push({
|
|
234
|
-
id:
|
|
240
|
+
id: ie.id,
|
|
235
241
|
params: {
|
|
236
242
|
unitId: i,
|
|
237
243
|
subUnitId: s,
|
|
238
244
|
comment: {
|
|
239
245
|
...g,
|
|
240
|
-
ref:
|
|
246
|
+
ref: $t(g.ref, u, c),
|
|
241
247
|
unitId: i,
|
|
242
248
|
subUnitId: s
|
|
243
249
|
},
|
|
244
250
|
sync: !0
|
|
245
251
|
}
|
|
246
252
|
}), f.push({
|
|
247
|
-
id:
|
|
253
|
+
id: ie.id,
|
|
248
254
|
params: {
|
|
249
255
|
unitId: m,
|
|
250
256
|
subUnitId: h,
|
|
@@ -277,13 +283,13 @@ let W = class extends k {
|
|
|
277
283
|
);
|
|
278
284
|
}
|
|
279
285
|
};
|
|
280
|
-
W =
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
286
|
+
W = Nt([
|
|
287
|
+
ne(0, v(st)),
|
|
288
|
+
ne(1, v($)),
|
|
289
|
+
ne(2, be)
|
|
284
290
|
], W);
|
|
285
|
-
var
|
|
286
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
291
|
+
var xt = Object.getOwnPropertyDescriptor, Dt = (n, e, r, t) => {
|
|
292
|
+
for (var o = t > 1 ? void 0 : t ? xt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
287
293
|
(s = n[i]) && (o = s(o) || o);
|
|
288
294
|
return o;
|
|
289
295
|
}, j = (n, e) => (r, t) => e(r, t, n);
|
|
@@ -293,7 +299,7 @@ let Z = class extends k {
|
|
|
293
299
|
}
|
|
294
300
|
_initHoverEvent() {
|
|
295
301
|
this.disposeWithMe(
|
|
296
|
-
this._hoverManagerService.currentCell$.pipe(
|
|
302
|
+
this._hoverManagerService.currentCell$.pipe(ce(100)).subscribe((n) => {
|
|
297
303
|
const e = this._sheetsThreadCommentPopupService.activePopup;
|
|
298
304
|
if (n && (e && e.temp || !e)) {
|
|
299
305
|
const { location: r } = n, { unitId: t, subUnitId: o, row: i, col: s } = r, a = this._sheetsThreadCommentModel.getByLocation(t, o, i, s);
|
|
@@ -320,14 +326,14 @@ let Z = class extends k {
|
|
|
320
326
|
);
|
|
321
327
|
}
|
|
322
328
|
};
|
|
323
|
-
Z =
|
|
324
|
-
j(0, v(
|
|
329
|
+
Z = Dt([
|
|
330
|
+
j(0, v(ct)),
|
|
325
331
|
j(1, v(R)),
|
|
326
332
|
j(2, v($)),
|
|
327
333
|
j(3, v(Ce))
|
|
328
334
|
], Z);
|
|
329
|
-
var
|
|
330
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
335
|
+
var At = Object.getOwnPropertyDescriptor, Vt = (n, e, r, t) => {
|
|
336
|
+
for (var o = t > 1 ? void 0 : t ? At(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
331
337
|
(s = n[i]) && (o = s(o) || o);
|
|
332
338
|
return o;
|
|
333
339
|
}, w = (n, e) => (r, t) => e(r, t, n);
|
|
@@ -340,11 +346,11 @@ let z = class extends k {
|
|
|
340
346
|
}
|
|
341
347
|
_handleSelectionChange(e, r, t) {
|
|
342
348
|
var u, p, _;
|
|
343
|
-
const o = (u = e[0]) == null ? void 0 : u.range, i = this._renderManagerService.getRenderById(r), s = (p = i == null ? void 0 : i.with(
|
|
349
|
+
const o = (u = e[0]) == null ? void 0 : u.range, i = this._renderManagerService.getRenderById(r), s = (p = i == null ? void 0 : i.with(ht).getSkeletonParam(t)) == null ? void 0 : p.skeleton;
|
|
344
350
|
if (!s || !o)
|
|
345
351
|
return;
|
|
346
352
|
const a = s.getCellWithCoordByIndex(o.startRow, o.startColumn);
|
|
347
|
-
if ((((_ = o.rangeType) != null ? _ :
|
|
353
|
+
if ((((_ = o.rangeType) != null ? _ : me.NORMAL) !== me.NORMAL || o.endColumn - o.startColumn > 0 || o.endRow - o.startRow > 0) && !((a.isMerged || a.isMergedMainCell) && Le.equals(a.mergeInfo, o))) {
|
|
348
354
|
this._threadCommentPanelService.activeCommentId && this._commandService.executeCommand(ee.id);
|
|
349
355
|
return;
|
|
350
356
|
}
|
|
@@ -410,7 +416,7 @@ let z = class extends k {
|
|
|
410
416
|
}, [{ startRow: u, startColumn: p, endRow: u, endColumn: p }]))
|
|
411
417
|
return;
|
|
412
418
|
const f = 1;
|
|
413
|
-
if (await this._commandService.executeCommand(
|
|
419
|
+
if (await this._commandService.executeCommand(mt.id, {
|
|
414
420
|
range: {
|
|
415
421
|
startRow: Math.max(h.row - f, 0),
|
|
416
422
|
endRow: h.row + f,
|
|
@@ -432,7 +438,7 @@ let z = class extends k {
|
|
|
432
438
|
}));
|
|
433
439
|
}
|
|
434
440
|
_initMarkSelection() {
|
|
435
|
-
this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.pipe(
|
|
441
|
+
this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.pipe(ce(100)).subscribe((e) => {
|
|
436
442
|
var u, p;
|
|
437
443
|
if (!e) {
|
|
438
444
|
this._selectionShapeInfo && (this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId), this._selectionShapeInfo = null);
|
|
@@ -473,20 +479,20 @@ let z = class extends k {
|
|
|
473
479
|
}));
|
|
474
480
|
}
|
|
475
481
|
};
|
|
476
|
-
z =
|
|
477
|
-
w(0,
|
|
482
|
+
z = Vt([
|
|
483
|
+
w(0, se),
|
|
478
484
|
w(1, v(R)),
|
|
479
485
|
w(2, v($)),
|
|
480
|
-
w(3, v(
|
|
486
|
+
w(3, v(ae)),
|
|
481
487
|
w(4, N),
|
|
482
488
|
w(5, v(Ce)),
|
|
483
489
|
w(6, fe),
|
|
484
490
|
w(7, v(ve)),
|
|
485
|
-
w(8,
|
|
491
|
+
w(8, dt),
|
|
486
492
|
w(9, Te)
|
|
487
493
|
], z);
|
|
488
|
-
var
|
|
489
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
494
|
+
var Ht = Object.getOwnPropertyDescriptor, jt = (n, e, r, t) => {
|
|
495
|
+
for (var o = t > 1 ? void 0 : t ? Ht(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
490
496
|
(s = n[i]) && (o = s(o) || o);
|
|
491
497
|
return o;
|
|
492
498
|
}, B = (n, e) => (r, t) => e(r, t, n);
|
|
@@ -514,7 +520,7 @@ let G = class extends k {
|
|
|
514
520
|
commentId: u
|
|
515
521
|
}
|
|
516
522
|
})), h = a.map(({ children: u, ...p }) => ({
|
|
517
|
-
id:
|
|
523
|
+
id: ie.id,
|
|
518
524
|
params: {
|
|
519
525
|
unitId: o,
|
|
520
526
|
subUnitId: i,
|
|
@@ -533,10 +539,10 @@ let G = class extends k {
|
|
|
533
539
|
);
|
|
534
540
|
}
|
|
535
541
|
};
|
|
536
|
-
G =
|
|
542
|
+
G = jt([
|
|
537
543
|
B(0, v(_e)),
|
|
538
544
|
B(1, N),
|
|
539
|
-
B(2, v(
|
|
545
|
+
B(2, v(bt)),
|
|
540
546
|
B(3, be)
|
|
541
547
|
], G);
|
|
542
548
|
var P = function() {
|
|
@@ -547,7 +553,7 @@ var P = function() {
|
|
|
547
553
|
}
|
|
548
554
|
return n;
|
|
549
555
|
}, P.apply(this, arguments);
|
|
550
|
-
},
|
|
556
|
+
}, Bt = function(n, e) {
|
|
551
557
|
var r = {};
|
|
552
558
|
for (var t in n) Object.prototype.hasOwnProperty.call(n, t) && e.indexOf(t) < 0 && (r[t] = n[t]);
|
|
553
559
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -555,15 +561,15 @@ var P = function() {
|
|
|
555
561
|
e.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(n, t[o]) && (r[t[o]] = n[t[o]]);
|
|
556
562
|
return r;
|
|
557
563
|
}, Oe = we(function(n, e) {
|
|
558
|
-
var r = n.icon, t = n.id, o = n.className, i = n.extend, s =
|
|
564
|
+
var r = n.icon, t = n.id, o = n.className, i = n.extend, s = Bt(n, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(o || "").trim(), c = ye("_".concat(Wt()));
|
|
559
565
|
return ke(r, "".concat(t), { defIds: r.defIds, idSuffix: c.current }, P({ ref: e, className: a }, s), i);
|
|
560
566
|
});
|
|
561
567
|
function ke(n, e, r, t, o) {
|
|
562
|
-
return Ee(n.tag, P(P({ key: e },
|
|
568
|
+
return Ee(n.tag, P(P({ key: e }, Lt(n, r, o)), t), (Ft(n, r).children || []).map(function(i, s) {
|
|
563
569
|
return ke(i, "".concat(e, "-").concat(n.tag, "-").concat(s), r, void 0, o);
|
|
564
570
|
}));
|
|
565
571
|
}
|
|
566
|
-
function
|
|
572
|
+
function Lt(n, e, r) {
|
|
567
573
|
var t = P({}, n.attrs);
|
|
568
574
|
r != null && r.colorChannel1 && t.fill === "colorChannel1" && (t.fill = r.colorChannel1), n.tag === "mask" && t.id && (t.id = t.id + e.idSuffix), Object.entries(t).forEach(function(i) {
|
|
569
575
|
var s = i[0], a = i[1];
|
|
@@ -575,25 +581,25 @@ function Bt(n, e, r) {
|
|
|
575
581
|
typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
576
582
|
})), t;
|
|
577
583
|
}
|
|
578
|
-
function
|
|
584
|
+
function Ft(n, e) {
|
|
579
585
|
var r, t = e.defIds;
|
|
580
586
|
return !t || t.length === 0 ? n : n.tag === "defs" && (!((r = n.children) === null || r === void 0) && r.length) ? P(P({}, n), { children: n.children.map(function(o) {
|
|
581
587
|
return typeof o.attrs.id == "string" && t && t.indexOf(o.attrs.id) > -1 ? P(P({}, o), { attrs: P(P({}, o.attrs), { id: o.attrs.id + e.idSuffix }) }) : o;
|
|
582
588
|
}) }) : n;
|
|
583
589
|
}
|
|
584
|
-
function
|
|
590
|
+
function Wt() {
|
|
585
591
|
return Math.random().toString(36).substring(2, 8);
|
|
586
592
|
}
|
|
587
593
|
Oe.displayName = "UniverIcon";
|
|
588
|
-
var
|
|
594
|
+
var Zt = { 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" } }] }, Ne = we(function(n, e) {
|
|
589
595
|
return Ee(Oe, Object.assign({}, n, {
|
|
590
596
|
id: "comment-single",
|
|
591
597
|
ref: e,
|
|
592
|
-
icon:
|
|
598
|
+
icon: Zt
|
|
593
599
|
}));
|
|
594
600
|
});
|
|
595
601
|
Ne.displayName = "CommentSingle";
|
|
596
|
-
const
|
|
602
|
+
const zt = () => {
|
|
597
603
|
const n = U(N), e = U(R), r = D(e.activePopup$), t = U($);
|
|
598
604
|
if (D(t.commentUpdate$), !r)
|
|
599
605
|
return null;
|
|
@@ -620,23 +626,23 @@ const Zt = () => {
|
|
|
620
626
|
autoFocus: c === "context-menu"
|
|
621
627
|
}
|
|
622
628
|
);
|
|
623
|
-
},
|
|
629
|
+
}, Gt = () => {
|
|
624
630
|
var g;
|
|
625
|
-
const n = U(fe), e = U(N), r = U(R), t = e.getCurrentUnitForType(b.UNIVER_SHEET), o = t.getUnitId(), i = U(
|
|
631
|
+
const n = U(fe), e = U(N), r = U(R), t = e.getCurrentUnitForType(b.UNIVER_SHEET), o = t.getUnitId(), i = U(se), s = Mt(() => t.activeSheet$.pipe(Pt((l) => l == null ? void 0 : l.getSheetId())), [t.activeSheet$]), a = D(s, (g = t.getActiveSheet()) == null ? void 0 : g.getSheetId()), c = ye(null), d = U(ae), m = D(d.activeCommentId$), h = D(d.panelVisible$, d.panelVisible), u = le((l) => {
|
|
626
632
|
const I = t.getSheets(), C = {};
|
|
627
633
|
I.forEach((T, S) => {
|
|
628
634
|
C[T.getSheetId()] = S;
|
|
629
635
|
});
|
|
630
636
|
const M = (T) => T.map((S) => {
|
|
631
|
-
var
|
|
632
|
-
const y = A(S.ref), xe = [(
|
|
637
|
+
var he;
|
|
638
|
+
const y = A(S.ref), xe = [(he = C[S.subUnitId]) != null ? he : 0, y.row, y.column];
|
|
633
639
|
return { ...S, p: xe };
|
|
634
640
|
}).sort((S, y) => S.p[0] === y.p[0] ? S.p[1] === y.p[1] ? S.p[2] - y.p[2] : S.p[1] - y.p[1] : S.p[0] - y.p[0]);
|
|
635
641
|
return [
|
|
636
642
|
...M(l.filter((T) => !T.resolved)),
|
|
637
643
|
...M(l.filter((T) => T.resolved))
|
|
638
644
|
];
|
|
639
|
-
}, [t]), p =
|
|
645
|
+
}, [t]), p = le((l) => {
|
|
640
646
|
var I;
|
|
641
647
|
if (l.unitId === o && l.subUnitId === a && !l.resolved) {
|
|
642
648
|
const { row: C, column: M } = A(l.ref), T = t.getSheetBySheetId(l.subUnitId), S = (I = T == null ? void 0 : T.getMergedCell(C, M)) != null ? I : {
|
|
@@ -671,7 +677,7 @@ const Zt = () => {
|
|
|
671
677
|
}, X = (l, I) => {
|
|
672
678
|
I && r.hidePopup();
|
|
673
679
|
};
|
|
674
|
-
return
|
|
680
|
+
return wt(() => {
|
|
675
681
|
!h && c.current && n.removeShape(c.current);
|
|
676
682
|
}, [n, h]), /* @__PURE__ */ Me(
|
|
677
683
|
tt,
|
|
@@ -688,10 +694,10 @@ const Zt = () => {
|
|
|
688
694
|
onDeleteComment: () => (x(), !0)
|
|
689
695
|
}
|
|
690
696
|
);
|
|
691
|
-
},
|
|
697
|
+
}, Kt = (n) => ({
|
|
692
698
|
id: V.id,
|
|
693
699
|
type: Pe.BUTTON,
|
|
694
|
-
icon:
|
|
700
|
+
icon: de,
|
|
695
701
|
title: "sheetThreadComment.menu.addComment",
|
|
696
702
|
hidden$: Ie(n, b.UNIVER_SHEET),
|
|
697
703
|
disabled$: ge(n, {
|
|
@@ -699,10 +705,10 @@ const Zt = () => {
|
|
|
699
705
|
worksheetTypes: [J],
|
|
700
706
|
rangeTypes: [q]
|
|
701
707
|
})
|
|
702
|
-
}),
|
|
708
|
+
}), Yt = (n) => ({
|
|
703
709
|
id: Se.id,
|
|
704
710
|
type: Pe.BUTTON,
|
|
705
|
-
icon:
|
|
711
|
+
icon: de,
|
|
706
712
|
tooltip: "sheetThreadComment.menu.commentManagement",
|
|
707
713
|
disabled$: ge(n, {
|
|
708
714
|
workbookTypes: [Q],
|
|
@@ -710,61 +716,61 @@ const Zt = () => {
|
|
|
710
716
|
rangeTypes: [q]
|
|
711
717
|
}),
|
|
712
718
|
hidden$: Ie(n, b.UNIVER_SHEET)
|
|
713
|
-
}),
|
|
719
|
+
}), qt = {
|
|
714
720
|
id: V.id,
|
|
715
|
-
binding:
|
|
716
|
-
preconditions:
|
|
717
|
-
},
|
|
718
|
-
[
|
|
721
|
+
binding: pt.M | ue.CTRL_COMMAND | ue.ALT,
|
|
722
|
+
preconditions: ut
|
|
723
|
+
}, Jt = {
|
|
724
|
+
[Ct.OTHERS]: {
|
|
719
725
|
[Se.id]: {
|
|
720
726
|
order: 1,
|
|
721
|
-
menuItemFactory:
|
|
727
|
+
menuItemFactory: Yt
|
|
722
728
|
}
|
|
723
729
|
},
|
|
724
|
-
[
|
|
725
|
-
[
|
|
730
|
+
[vt.MAIN_AREA]: {
|
|
731
|
+
[_t.OTHERS]: {
|
|
726
732
|
[V.id]: {
|
|
727
733
|
order: 0,
|
|
728
|
-
menuItemFactory:
|
|
734
|
+
menuItemFactory: Kt
|
|
729
735
|
}
|
|
730
736
|
}
|
|
731
737
|
}
|
|
732
738
|
};
|
|
733
|
-
var
|
|
734
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
739
|
+
var Qt = Object.getOwnPropertyDescriptor, Xt = (n, e, r, t) => {
|
|
740
|
+
for (var o = t > 1 ? void 0 : t ? Qt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
735
741
|
(s = n[i]) && (o = s(o) || o);
|
|
736
742
|
return o;
|
|
737
|
-
},
|
|
743
|
+
}, re = (n, e) => (r, t) => e(r, t, n);
|
|
738
744
|
let K = class extends k {
|
|
739
745
|
constructor(n, e, r) {
|
|
740
746
|
super(), this._menuManagerService = n, this._componentManager = e, this._shortcutService = r, this._initMenu(), this._initShortcut(), this._initComponent();
|
|
741
747
|
}
|
|
742
748
|
_initShortcut() {
|
|
743
|
-
this._shortcutService.registerShortcut(
|
|
749
|
+
this._shortcutService.registerShortcut(qt);
|
|
744
750
|
}
|
|
745
751
|
_initMenu() {
|
|
746
|
-
this._menuManagerService.mergeMenu(
|
|
752
|
+
this._menuManagerService.mergeMenu(Jt);
|
|
747
753
|
}
|
|
748
754
|
_initComponent() {
|
|
749
755
|
[
|
|
750
|
-
[Ue,
|
|
751
|
-
[nt,
|
|
752
|
-
[
|
|
756
|
+
[Ue, zt],
|
|
757
|
+
[nt, Gt],
|
|
758
|
+
[de, Ne]
|
|
753
759
|
].forEach(([n, e]) => {
|
|
754
760
|
this._componentManager.register(n, e);
|
|
755
761
|
});
|
|
756
762
|
}
|
|
757
763
|
};
|
|
758
|
-
K =
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
764
|
+
K = Xt([
|
|
765
|
+
re(0, St),
|
|
766
|
+
re(1, v(ft)),
|
|
767
|
+
re(2, gt)
|
|
762
768
|
], K);
|
|
763
|
-
var
|
|
764
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
769
|
+
var en = Object.defineProperty, tn = Object.getOwnPropertyDescriptor, nn = (n, e, r) => e in n ? en(n, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[e] = r, rn = (n, e, r, t) => {
|
|
770
|
+
for (var o = t > 1 ? void 0 : t ? tn(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
765
771
|
(s = n[i]) && (o = s(o) || o);
|
|
766
772
|
return o;
|
|
767
|
-
},
|
|
773
|
+
}, oe = (n, e) => (r, t) => e(r, t, n), $e = (n, e, r) => nn(n, typeof e != "symbol" ? e + "" : e, r);
|
|
768
774
|
let Y = class extends Ge {
|
|
769
775
|
constructor(n = pe, e, r, t) {
|
|
770
776
|
super(), this._config = n, this._injector = e, this._commandService = r, this._configService = t;
|
|
@@ -773,7 +779,7 @@ let Y = class extends Ge {
|
|
|
773
779
|
pe,
|
|
774
780
|
this._config
|
|
775
781
|
);
|
|
776
|
-
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(
|
|
782
|
+
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(Ut, i);
|
|
777
783
|
}
|
|
778
784
|
onStarting() {
|
|
779
785
|
[
|
|
@@ -799,22 +805,22 @@ let Y = class extends Ge {
|
|
|
799
805
|
};
|
|
800
806
|
$e(Y, "pluginName", Re);
|
|
801
807
|
$e(Y, "type", b.UNIVER_SHEET);
|
|
802
|
-
Y =
|
|
808
|
+
Y = rn([
|
|
803
809
|
We(rt, Xe),
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
810
|
+
oe(1, v(Ze)),
|
|
811
|
+
oe(2, v(se)),
|
|
812
|
+
oe(3, ze)
|
|
807
813
|
], Y);
|
|
808
814
|
export {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
815
|
+
Pn as AddCommentCommand,
|
|
816
|
+
Tn as DeleteCommentCommand,
|
|
817
|
+
bn as DeleteCommentTreeCommand,
|
|
818
|
+
Mn as IThreadCommentDataSourceService,
|
|
819
|
+
wn as ResolveCommentCommand,
|
|
814
820
|
Re as SHEETS_THREAD_COMMENT,
|
|
815
821
|
R as SheetsThreadCommentPopupService,
|
|
816
822
|
V as ShowAddSheetCommentModalOperation,
|
|
817
823
|
Y as UniverSheetsThreadCommentUIPlugin,
|
|
818
|
-
|
|
819
|
-
|
|
824
|
+
gn as UniverThreadCommentUIPlugin,
|
|
825
|
+
yn as UpdateCommentCommand
|
|
820
826
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Nullable, Disposable } from '@univerjs/core';
|
|
2
2
|
import { ISheetLocationBase } from '@univerjs/sheets';
|
|
3
|
-
import { SheetCanvasPopManagerService } from '@univerjs/sheets-ui';
|
|
3
|
+
import { CellPopupManagerService, SheetCanvasPopManagerService } from '@univerjs/sheets-ui';
|
|
4
4
|
import { IZenZoneService } from '@univerjs/ui';
|
|
5
5
|
export interface IThreadCommentPopup extends ISheetLocationBase {
|
|
6
6
|
commentId?: string;
|
|
@@ -10,12 +10,13 @@ export interface IThreadCommentPopup extends ISheetLocationBase {
|
|
|
10
10
|
export declare class SheetsThreadCommentPopupService extends Disposable {
|
|
11
11
|
private readonly _canvasPopupManagerService;
|
|
12
12
|
private readonly _zenZoneService;
|
|
13
|
+
private readonly _cellPopupManagerService;
|
|
13
14
|
private _lastPopup;
|
|
14
15
|
private _activePopup;
|
|
15
16
|
private _activePopup$;
|
|
16
17
|
activePopup$: import('rxjs').Observable<Nullable<IThreadCommentPopup>>;
|
|
17
18
|
get activePopup(): Nullable<IThreadCommentPopup>;
|
|
18
|
-
constructor(_canvasPopupManagerService: SheetCanvasPopManagerService, _zenZoneService: IZenZoneService);
|
|
19
|
+
constructor(_canvasPopupManagerService: SheetCanvasPopManagerService, _zenZoneService: IZenZoneService, _cellPopupManagerService: CellPopupManagerService);
|
|
19
20
|
private _initZenVisible;
|
|
20
21
|
showPopup(location: IThreadCommentPopup, onHide?: () => void): void;
|
|
21
22
|
hidePopup(): void;
|