@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/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 ie, RANGE_TYPE as he, Rectangle as Le, Tools as Fe, DependentOn as We, Injector as Ze, IConfigService as ze, Plugin as Ge, merge as Ke } from "@univerjs/core";
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 se, 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 fn } from "@univerjs/thread-comment-ui";
9
- import { SheetCanvasPopManagerService 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 ge } from "@univerjs/sheets-ui";
10
- import { IZenZoneService as ut, useDependency as U, useObservable as D, KeyCode as lt, MetaKeys as me, getMenuHiddenObservable as Ie, MenuItemType as Pe, ContextMenuPosition as pt, ContextMenuGroup as vt, RibbonStartGroup as _t, IMenuManagerService as Ct, ComponentManager as St, IShortcutService as ft } from "@univerjs/ui";
11
- import { BehaviorSubject as gt, debounceTime as ae, map as It } from "rxjs";
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 Pt } from "@univerjs/engine-formula";
14
- import { IThreadCommentDataSourceService as be, DeleteCommentMutation as L, AddCommentMutation as oe, 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";
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 bt, useCallback as ue, useEffect as Mt } from "react";
18
- const Ue = "univer.sheet.thread-comment-modal", ce = "comment-single", Re = "SHEET_THREAD_COMMENT";
19
- var wt = Object.getOwnPropertyDescriptor, yt = (n, e, r, t) => {
20
- for (var o = t > 1 ? void 0 : t ? wt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
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
- }, le = (n, e) => (r, t) => e(r, t, n);
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 gt(null));
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._canvasPopupManagerService.attachPopupToCell(
54
- t,
55
- o,
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 = yt([
88
- le(0, v(ot)),
89
- le(1, ut)
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(se), i = (_ = e.getCurrentLastSelection()) == null ? void 0 : _.primary, s = 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
- }, Et = "sheets-thread-comment.config", pe = {};
120
- var Ut = Object.getOwnPropertyDescriptor, Rt = (n, e, r, t) => {
121
- for (var o = t > 1 ? void 0 : t ? Ut(e, r) : e, i = n.length - 1, s; i >= 0; i--)
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(ae(16)).subscribe(() => {
167
+ this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(ce(16)).subscribe(() => {
162
168
  n();
163
169
  }));
164
170
  }
165
171
  };
166
- F = Rt([
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 Ot = Object.getOwnPropertyDescriptor, kt = (n, e, r, t) => {
173
- for (var o = t > 1 ? void 0 : t ? Ot(e, r) : e, i = n.length - 1, s; i >= 0; i--)
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
- }, te = (n, e) => (r, t) => e(r, t, n);
177
- const Nt = (n, e, r) => {
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 Pt(s);
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 === st.CUT && this._copyInfo) {
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: oe.id,
240
+ id: ie.id,
235
241
  params: {
236
242
  unitId: i,
237
243
  subUnitId: s,
238
244
  comment: {
239
245
  ...g,
240
- ref: Nt(g.ref, u, c),
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: oe.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 = kt([
281
- te(0, v(it)),
282
- te(1, v($)),
283
- te(2, be)
286
+ W = Nt([
287
+ ne(0, v(st)),
288
+ ne(1, v($)),
289
+ ne(2, be)
284
290
  ], W);
285
- var $t = Object.getOwnPropertyDescriptor, xt = (n, e, r, t) => {
286
- for (var o = t > 1 ? void 0 : t ? $t(e, r) : e, i = n.length - 1, s; i >= 0; i--)
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(ae(100)).subscribe((n) => {
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 = xt([
324
- j(0, v(at)),
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 Dt = Object.getOwnPropertyDescriptor, At = (n, e, r, t) => {
330
- for (var o = t > 1 ? void 0 : t ? Dt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
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(dt).getSkeletonParam(t)) == null ? void 0 : p.skeleton;
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 ? _ : he.NORMAL) !== he.NORMAL || o.endColumn - o.startColumn > 0 || o.endRow - o.startRow > 0) && !((a.isMerged || a.isMergedMainCell) && Le.equals(a.mergeInfo, o))) {
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(ht.id, {
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(ae(100)).subscribe((e) => {
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 = At([
477
- w(0, ie),
482
+ z = Vt([
483
+ w(0, se),
478
484
  w(1, v(R)),
479
485
  w(2, v($)),
480
- w(3, v(se)),
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, ct),
491
+ w(8, dt),
486
492
  w(9, Te)
487
493
  ], z);
488
- var Vt = Object.getOwnPropertyDescriptor, Ht = (n, e, r, t) => {
489
- for (var o = t > 1 ? void 0 : t ? Vt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
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: oe.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 = Ht([
542
+ G = jt([
537
543
  B(0, v(_e)),
538
544
  B(1, N),
539
- B(2, v(Tt)),
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
- }, jt = function(n, e) {
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 = jt(n, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(o || "").trim(), c = ye("_".concat(Ft()));
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 }, Bt(n, r, o)), t), (Lt(n, r).children || []).map(function(i, s) {
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 Bt(n, e, r) {
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 Lt(n, e) {
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 Ft() {
590
+ function Wt() {
585
591
  return Math.random().toString(36).substring(2, 8);
586
592
  }
587
593
  Oe.displayName = "UniverIcon";
588
- var Wt = { 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) {
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: Wt
598
+ icon: Zt
593
599
  }));
594
600
  });
595
601
  Ne.displayName = "CommentSingle";
596
- const Zt = () => {
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
- }, zt = () => {
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(ie), s = bt(() => t.activeSheet$.pipe(It((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(se), m = D(d.activeCommentId$), h = D(d.panelVisible$, d.panelVisible), u = ue((l) => {
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 de;
632
- const y = A(S.ref), xe = [(de = C[S.subUnitId]) != null ? de : 0, y.row, y.column];
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 = ue((l) => {
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 Mt(() => {
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
- }, Gt = (n) => ({
697
+ }, Kt = (n) => ({
692
698
  id: V.id,
693
699
  type: Pe.BUTTON,
694
- icon: ce,
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
- }), Kt = (n) => ({
708
+ }), Yt = (n) => ({
703
709
  id: Se.id,
704
710
  type: Pe.BUTTON,
705
- icon: ce,
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
- }), Yt = {
719
+ }), qt = {
714
720
  id: V.id,
715
- binding: lt.M | me.CTRL_COMMAND | me.ALT,
716
- preconditions: mt
717
- }, qt = {
718
- [_t.OTHERS]: {
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: Kt
727
+ menuItemFactory: Yt
722
728
  }
723
729
  },
724
- [pt.MAIN_AREA]: {
725
- [vt.OTHERS]: {
730
+ [vt.MAIN_AREA]: {
731
+ [_t.OTHERS]: {
726
732
  [V.id]: {
727
733
  order: 0,
728
- menuItemFactory: Gt
734
+ menuItemFactory: Kt
729
735
  }
730
736
  }
731
737
  }
732
738
  };
733
- var Jt = Object.getOwnPropertyDescriptor, Qt = (n, e, r, t) => {
734
- for (var o = t > 1 ? void 0 : t ? Jt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
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
- }, ne = (n, e) => (r, t) => e(r, t, n);
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(Yt);
749
+ this._shortcutService.registerShortcut(qt);
744
750
  }
745
751
  _initMenu() {
746
- this._menuManagerService.mergeMenu(qt);
752
+ this._menuManagerService.mergeMenu(Jt);
747
753
  }
748
754
  _initComponent() {
749
755
  [
750
- [Ue, Zt],
751
- [nt, zt],
752
- [ce, Ne]
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 = Qt([
759
- ne(0, Ct),
760
- ne(1, v(St)),
761
- ne(2, ft)
764
+ K = Xt([
765
+ re(0, St),
766
+ re(1, v(ft)),
767
+ re(2, gt)
762
768
  ], K);
763
- var Xt = Object.defineProperty, en = Object.getOwnPropertyDescriptor, tn = (n, e, r) => e in n ? Xt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[e] = r, nn = (n, e, r, t) => {
764
- for (var o = t > 1 ? void 0 : t ? en(e, r) : e, i = n.length - 1, s; i >= 0; i--)
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
- }, re = (n, e) => (r, t) => e(r, t, n), $e = (n, e, r) => tn(n, typeof e != "symbol" ? e + "" : e, r);
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(Et, i);
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 = nn([
808
+ Y = rn([
803
809
  We(rt, Xe),
804
- re(1, v(Ze)),
805
- re(2, v(ie)),
806
- re(3, ze)
810
+ oe(1, v(Ze)),
811
+ oe(2, v(se)),
812
+ oe(3, ze)
807
813
  ], Y);
808
814
  export {
809
- In as AddCommentCommand,
810
- Pn as DeleteCommentCommand,
811
- Tn as DeleteCommentTreeCommand,
812
- bn as IThreadCommentDataSourceService,
813
- Mn as ResolveCommentCommand,
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
- fn as UniverThreadCommentUIPlugin,
819
- wn as UpdateCommentCommand
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;