@univerjs/sheets-thread-comment-ui 0.5.1 → 0.5.2-nightly.202412281605

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/es/index.js CHANGED
@@ -1,31 +1,31 @@
1
- var He = Object.defineProperty;
2
- var Le = (o, e, n) => e in o ? He(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n;
3
- var E = (o, e, n) => Le(o, typeof e != "symbol" ? e + "" : e, n);
4
- import { Inject as _, Disposable as $, DisposableCollection as ke, CommandType as Fe, IUniverInstanceService as N, InterceptorEffectEnum as We, UniverInstanceType as b, Range as Ze, ICommandService as ae, RANGE_TYPE as he, Rectangle as ze, useDependency as R, Tools as qe, DependentOn as Ge, Injector as Je, Plugin as Ye, IConfigService as Ke } from "@univerjs/core";
5
- import { SheetsSelectionsService as Ce, getSheetCommandTarget as Qe, SheetInterceptorService as Se, INTERCEPTOR_POINT as Xe, WorkbookCommentPermission as K, WorksheetViewPermission as Q, RangeProtectionPermissionViewPoint as X, SetWorksheetActiveOperation as et, RemoveSheetCommand as tt } from "@univerjs/sheets";
6
- import { SheetsThreadCommentModel as x, UniverSheetsThreadCommentPlugin as nt } from "@univerjs/sheets-thread-comment";
7
- import { ThreadCommentPanelService as ce, SetActiveCommentOperation as te, ThreadCommentTree as rt, ThreadCommentPanel as ot, ToggleSheetCommentPanelOperation as ge, THREAD_COMMENT_PANEL as it, UniverThreadCommentUIPlugin as st } from "@univerjs/thread-comment-ui";
8
- import { UniverThreadCommentUIPlugin as Un } from "@univerjs/thread-comment-ui";
9
- import { SheetCanvasPopManagerService as at, ISheetClipboardService as ct, COPY_TYPE as ut, HoverManagerService as mt, SheetPermissionInterceptorBaseController as Ie, IMarkSelectionService as Pe, IEditorBridgeService as dt, SheetSkeletonManagerService as ht, ScrollToRangeOperation as lt, whenSheetEditorFocused as pt, getCurrentRangeDisable$ as Te } from "@univerjs/sheets-ui";
10
- import { IZenZoneService as _t, useObservable as A, KeyCode as vt, MetaKeys as le, MenuItemType as be, getMenuHiddenObservable as Me, RibbonStartGroup as ft, ContextMenuPosition as Ct, ContextMenuGroup as St, ComponentManager as gt, IMenuManagerService as It, IShortcutService as Pt } from "@univerjs/ui";
11
- import { BehaviorSubject as Tt, debounceTime as ue, map as bt } from "rxjs";
12
- import { IRenderManagerService as we } from "@univerjs/engine-render";
13
- import { singleReferenceToGrid as V, serializeRange as Mt } from "@univerjs/engine-formula";
14
- import { IThreadCommentDataSourceService as ye, DeleteCommentMutation as F, AddCommentMutation as se, ThreadCommentModel as wt } from "@univerjs/thread-comment";
15
- import { AddCommentCommand as Nn, DeleteCommentCommand as xn, DeleteCommentTreeCommand as Dn, IThreadCommentDataSourceService as jn, ResolveCommentCommand as An, UpdateCommentCommand as Vn } from "@univerjs/thread-comment";
16
- import yt, { forwardRef as Ee, useRef as Re, createElement as Oe, useMemo as Et, useCallback as pe, useEffect as Rt } from "react";
17
- const Ue = "univer.sheet.thread-comment-modal", me = "comment-single", $e = "SHEET_THREAD_COMMENT";
18
- var Ot = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor, $t = (o, e, n, t) => {
19
- for (var r = t > 1 ? void 0 : t ? Ut(e, n) : e, i = o.length - 1, s; i >= 0; i--)
1
+ var Le = Object.defineProperty;
2
+ var ke = (o, e, n) => e in o ? Le(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n;
3
+ var E = (o, e, n) => ke(o, typeof e != "symbol" ? e + "" : e, n);
4
+ import { Inject as _, Disposable as $, DisposableCollection as Fe, CommandType as We, IUniverInstanceService as N, InterceptorEffectEnum as Ze, UniverInstanceType as b, Range as ze, ICommandService as ae, RANGE_TYPE as he, Rectangle as qe, useDependency as R, Tools as Ge, DependentOn as Je, Injector as Ye, Plugin as Ke, merge as Qe, IConfigService as Xe } from "@univerjs/core";
5
+ import { SheetsSelectionsService as Se, getSheetCommandTarget as et, SheetInterceptorService as ge, INTERCEPTOR_POINT as tt, WorkbookCommentPermission as K, WorksheetViewPermission as Q, RangeProtectionPermissionViewPoint as X, SetWorksheetActiveOperation as nt, RemoveSheetCommand as rt } from "@univerjs/sheets";
6
+ import { SheetsThreadCommentModel as x, UniverSheetsThreadCommentPlugin as ot } from "@univerjs/sheets-thread-comment";
7
+ import { ThreadCommentPanelService as ce, SetActiveCommentOperation as te, ThreadCommentTree as it, ThreadCommentPanel as st, ToggleSheetCommentPanelOperation as Ie, THREAD_COMMENT_PANEL as at, UniverThreadCommentUIPlugin as ct } from "@univerjs/thread-comment-ui";
8
+ import { UniverThreadCommentUIPlugin as $n } from "@univerjs/thread-comment-ui";
9
+ import { SheetCanvasPopManagerService as mt, ISheetClipboardService as ut, COPY_TYPE as dt, HoverManagerService as ht, SheetPermissionInterceptorBaseController as Pe, IMarkSelectionService as Te, IEditorBridgeService as lt, SheetSkeletonManagerService as pt, ScrollToRangeOperation as _t, whenSheetEditorFocused as vt, getCurrentRangeDisable$ as be } from "@univerjs/sheets-ui";
10
+ import { IZenZoneService as ft, useObservable as A, KeyCode as Ct, MetaKeys as le, MenuItemType as Me, getMenuHiddenObservable as we, RibbonStartGroup as St, ContextMenuPosition as gt, ContextMenuGroup as It, ComponentManager as Pt, IMenuManagerService as Tt, IShortcutService as bt } from "@univerjs/ui";
11
+ import { BehaviorSubject as Mt, debounceTime as me, map as wt } from "rxjs";
12
+ import { IRenderManagerService as ye } from "@univerjs/engine-render";
13
+ import { singleReferenceToGrid as V, serializeRange as yt } from "@univerjs/engine-formula";
14
+ import { IThreadCommentDataSourceService as Ee, DeleteCommentMutation as F, AddCommentMutation as se, ThreadCommentModel as Et } from "@univerjs/thread-comment";
15
+ import { AddCommentCommand as xn, DeleteCommentCommand as Dn, DeleteCommentTreeCommand as jn, IThreadCommentDataSourceService as An, ResolveCommentCommand as Vn, UpdateCommentCommand as Bn } from "@univerjs/thread-comment";
16
+ import Rt, { forwardRef as Re, useRef as Oe, createElement as Ue, useMemo as Ot, useCallback as pe, useEffect as Ut } from "react";
17
+ const $e = "univer.sheet.thread-comment-modal", ue = "comment-single", Ne = "SHEET_THREAD_COMMENT";
18
+ var $t = Object.defineProperty, Nt = Object.getOwnPropertyDescriptor, xt = (o, e, n, t) => {
19
+ for (var r = t > 1 ? void 0 : t ? Nt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
20
20
  (s = o[i]) && (r = (t ? s(e, n, r) : s(r)) || r);
21
- return t && r && Ot(e, n, r), r;
21
+ return t && r && $t(e, n, r), r;
22
22
  }, _e = (o, e) => (n, t) => e(n, t, o);
23
23
  let O = class extends $ {
24
24
  constructor(e, n) {
25
25
  super();
26
26
  E(this, "_lastPopup", null);
27
27
  E(this, "_activePopup");
28
- E(this, "_activePopup$", new Tt(null));
28
+ E(this, "_activePopup$", new Mt(null));
29
29
  E(this, "activePopup$", this._activePopup$.asObservable());
30
30
  this._canvasPopupManagerService = e, this._zenZoneService = n, this._initZenVisible(), this.disposeWithMe(() => {
31
31
  this._activePopup$.complete();
@@ -53,7 +53,7 @@ let O = class extends $ {
53
53
  t,
54
54
  r,
55
55
  {
56
- componentKey: Ue,
56
+ componentKey: $e,
57
57
  onClickOutside: () => {
58
58
  this.hidePopup();
59
59
  },
@@ -66,7 +66,7 @@ let O = class extends $ {
66
66
  );
67
67
  if (!a)
68
68
  throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");
69
- const c = new ke();
69
+ const c = new Fe();
70
70
  c.add(a), c.add({
71
71
  dispose: () => {
72
72
  n == null || n();
@@ -83,43 +83,43 @@ let O = class extends $ {
83
83
  }, this._activePopup$.next(this._activePopup));
84
84
  }
85
85
  };
86
- O = $t([
87
- _e(0, _(at)),
88
- _e(1, _t)
86
+ O = xt([
87
+ _e(0, _(mt)),
88
+ _e(1, ft)
89
89
  ], O);
90
90
  const B = {
91
- type: Fe.OPERATION,
91
+ type: We.OPERATION,
92
92
  id: "sheets.operation.show-comment-modal",
93
93
  handler(o) {
94
94
  var v;
95
- const e = o.get(Ce), n = o.get(N), t = o.get(O), r = o.get(ce), i = (v = e.getCurrentLastSelection()) == null ? void 0 : v.primary, s = o.get(x);
95
+ const e = o.get(Se), n = o.get(N), t = o.get(O), r = o.get(ce), i = (v = e.getCurrentLastSelection()) == null ? void 0 : v.primary, s = o.get(x);
96
96
  if (!i)
97
97
  return !1;
98
- const a = Qe(n);
98
+ const a = et(n);
99
99
  if (!a)
100
100
  return !1;
101
- const { workbook: c, worksheet: d, unitId: u, subUnitId: m } = a, h = {
101
+ const { workbook: c, worksheet: d, unitId: m, subUnitId: u } = a, h = {
102
102
  workbook: c,
103
103
  worksheet: d,
104
- unitId: u,
105
- subUnitId: m,
104
+ unitId: m,
105
+ subUnitId: u,
106
106
  row: i.startRow,
107
107
  col: i.startColumn
108
108
  };
109
109
  t.showPopup(h);
110
- const l = s.getByLocation(u, m, i.startRow, i.startColumn);
110
+ const l = s.getByLocation(m, u, i.startRow, i.startColumn);
111
111
  return l && r.setActiveComment({
112
- unitId: u,
113
- subUnitId: m,
112
+ unitId: m,
113
+ subUnitId: u,
114
114
  commentId: l,
115
115
  trigger: "context-menu"
116
116
  }), !0;
117
117
  }
118
- }, Nt = "sheets-thread-comment.config", xt = {};
119
- var Dt = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, At = (o, e, n, t) => {
120
- for (var r = t > 1 ? void 0 : t ? jt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
118
+ }, Dt = "sheets-thread-comment.config", ve = {};
119
+ var jt = Object.defineProperty, At = Object.getOwnPropertyDescriptor, Vt = (o, e, n, t) => {
120
+ for (var r = t > 1 ? void 0 : t ? At(e, n) : e, i = o.length - 1, s; i >= 0; i--)
121
121
  (s = o[i]) && (r = (t ? s(e, n, r) : s(r)) || r);
122
- return t && r && Dt(e, n, r), r;
122
+ return t && r && jt(e, n, r), r;
123
123
  }, H = (o, e) => (n, t) => e(n, t, o);
124
124
  let W = class extends $ {
125
125
  constructor(o, e, n, t) {
@@ -128,9 +128,9 @@ let W = class extends $ {
128
128
  _initViewModelIntercept() {
129
129
  this.disposeWithMe(
130
130
  this._sheetInterceptorService.intercept(
131
- Xe.CELL_CONTENT,
131
+ tt.CELL_CONTENT,
132
132
  {
133
- effect: We.Style,
133
+ effect: Ze.Style,
134
134
  handler: (o, e, n) => {
135
135
  const { row: t, col: r, unitId: i, subUnitId: s } = e;
136
136
  return this._sheetsThreadCommentModel.showCommentMarker(i, s, t, r) ? n({
@@ -157,30 +157,30 @@ let W = class extends $ {
157
157
  const n = e.getUnitId(), t = this._renderManagerService.getRenderById(n);
158
158
  (r = t == null ? void 0 : t.mainComponent) == null || r.makeForceDirty();
159
159
  };
160
- this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(ue(16)).subscribe(() => {
160
+ this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(me(16)).subscribe(() => {
161
161
  o();
162
162
  }));
163
163
  }
164
164
  };
165
- W = At([
166
- H(0, _(Se)),
165
+ W = Vt([
166
+ H(0, _(ge)),
167
167
  H(1, _(x)),
168
168
  H(2, N),
169
- H(3, we)
169
+ H(3, ye)
170
170
  ], W);
171
- var Vt = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, Ht = (o, e, n, t) => {
172
- for (var r = t > 1 ? void 0 : t ? Bt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
171
+ var Bt = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, Lt = (o, e, n, t) => {
172
+ for (var r = t > 1 ? void 0 : t ? Ht(e, n) : e, i = o.length - 1, s; i >= 0; i--)
173
173
  (s = o[i]) && (r = (t ? s(e, n, r) : s(r)) || r);
174
- return t && r && Vt(e, n, r), r;
174
+ return t && r && Bt(e, n, r), r;
175
175
  }, ne = (o, e) => (n, t) => e(n, t, o);
176
- const Lt = (o, e, n) => {
176
+ const kt = (o, e, n) => {
177
177
  const t = V(o), r = n.row - e.row, i = n.column - e.column, s = {
178
178
  startColumn: t.column + i,
179
179
  startRow: t.row + r,
180
180
  endColumn: t.column + i,
181
181
  endRow: t.row + r
182
182
  };
183
- return Mt(s);
183
+ return yt(s);
184
184
  };
185
185
  let Z = class extends $ {
186
186
  constructor(e, n, t) {
@@ -192,7 +192,7 @@ let Z = class extends $ {
192
192
  _initClipboardHook() {
193
193
  this.disposeWithMe(
194
194
  this._sheetClipboardService.addClipboardHook({
195
- id: $e,
195
+ id: Ne,
196
196
  onBeforeCopy: (e, n, t) => {
197
197
  this._copyInfo = {
198
198
  unitId: e,
@@ -206,15 +206,15 @@ let Z = class extends $ {
206
206
  row: a.rows[0],
207
207
  column: a.cols[0]
208
208
  };
209
- if (r.copyType === ut.CUT && this._copyInfo) {
210
- const { range: d, unitId: u, subUnitId: m } = this._copyInfo, h = {
209
+ if (r.copyType === dt.CUT && this._copyInfo) {
210
+ const { range: d, unitId: m, subUnitId: u } = this._copyInfo, h = {
211
211
  row: d.startRow,
212
212
  column: d.startColumn
213
213
  };
214
- if (!(i === u && s === m)) {
214
+ if (!(i === m && s === u)) {
215
215
  const l = [];
216
- Ze.foreach(d, (g, p) => {
217
- const I = this._sheetsThreadCommentModel.getAllByLocation(u, m, g, p);
216
+ ze.foreach(d, (g, p) => {
217
+ const I = this._sheetsThreadCommentModel.getAllByLocation(m, u, g, p);
218
218
  this._threadCommentDataSourceService.syncUpdateMutationToColla ? I.forEach((f) => {
219
219
  l.push(f);
220
220
  }) : I.forEach(({ children: f, ...M }) => {
@@ -225,8 +225,8 @@ let Z = class extends $ {
225
225
  v.unshift({
226
226
  id: F.id,
227
227
  params: {
228
- unitId: u,
229
- subUnitId: m,
228
+ unitId: m,
229
+ subUnitId: u,
230
230
  commentId: g.id
231
231
  }
232
232
  }), U.push({
@@ -236,7 +236,7 @@ let Z = class extends $ {
236
236
  subUnitId: s,
237
237
  comment: {
238
238
  ...g,
239
- ref: Lt(g.ref, h, c),
239
+ ref: kt(g.ref, h, c),
240
240
  unitId: i,
241
241
  subUnitId: s
242
242
  },
@@ -245,8 +245,8 @@ let Z = class extends $ {
245
245
  }), S.push({
246
246
  id: se.id,
247
247
  params: {
248
- unitId: u,
249
- subUnitId: m,
248
+ unitId: m,
249
+ subUnitId: u,
250
250
  comment: g,
251
251
  sync: !0
252
252
  }
@@ -276,15 +276,15 @@ let Z = class extends $ {
276
276
  );
277
277
  }
278
278
  };
279
- Z = Ht([
280
- ne(0, _(ct)),
279
+ Z = Lt([
280
+ ne(0, _(ut)),
281
281
  ne(1, _(x)),
282
- ne(2, ye)
282
+ ne(2, Ee)
283
283
  ], Z);
284
- var kt = Object.defineProperty, Ft = Object.getOwnPropertyDescriptor, Wt = (o, e, n, t) => {
285
- for (var r = t > 1 ? void 0 : t ? Ft(e, n) : e, i = o.length - 1, s; i >= 0; i--)
284
+ var Ft = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, Zt = (o, e, n, t) => {
285
+ for (var r = t > 1 ? void 0 : t ? Wt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
286
286
  (s = o[i]) && (r = (t ? s(e, n, r) : s(r)) || r);
287
- return t && r && kt(e, n, r), r;
287
+ return t && r && Ft(e, n, r), r;
288
288
  }, L = (o, e) => (n, t) => e(n, t, o);
289
289
  let z = class extends $ {
290
290
  constructor(o, e, n, t) {
@@ -292,7 +292,7 @@ let z = class extends $ {
292
292
  }
293
293
  _initHoverEvent() {
294
294
  this.disposeWithMe(
295
- this._hoverManagerService.currentCell$.pipe(ue(100)).subscribe((o) => {
295
+ this._hoverManagerService.currentCell$.pipe(me(100)).subscribe((o) => {
296
296
  const e = this._sheetsThreadCommentPopupService.activePopup;
297
297
  if (o && (e && e.temp || !e)) {
298
298
  const { location: n } = o, { unitId: t, subUnitId: r, row: i, col: s } = n, a = this._sheetsThreadCommentModel.getByLocation(t, r, i, s);
@@ -319,44 +319,44 @@ let z = class extends $ {
319
319
  );
320
320
  }
321
321
  };
322
- z = Wt([
323
- L(0, _(mt)),
322
+ z = Zt([
323
+ L(0, _(ht)),
324
324
  L(1, _(O)),
325
325
  L(2, _(x)),
326
- L(3, _(Ie))
326
+ L(3, _(Pe))
327
327
  ], z);
328
- var Zt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, qt = (o, e, n, t) => {
329
- for (var r = t > 1 ? void 0 : t ? zt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
328
+ var zt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, Gt = (o, e, n, t) => {
329
+ for (var r = t > 1 ? void 0 : t ? qt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
330
330
  (s = o[i]) && (r = (t ? s(e, n, r) : s(r)) || r);
331
- return t && r && Zt(e, n, r), r;
331
+ return t && r && zt(e, n, r), r;
332
332
  }, w = (o, e) => (n, t) => e(n, t, o);
333
333
  let q = class extends $ {
334
- constructor(e, n, t, r, i, s, a, c, d, u) {
334
+ constructor(e, n, t, r, i, s, a, c, d, m) {
335
335
  super();
336
336
  E(this, "_isSwitchToCommenting", !1);
337
337
  E(this, "_selectionShapeInfo", null);
338
- this._commandService = e, this._sheetsThreadCommentPopupService = n, this._sheetsThreadCommentModel = t, this._threadCommentPanelService = r, this._univerInstanceService = i, this._sheetPermissionInterceptorBaseController = s, this._markSelectionService = a, this._sheetSelectionService = c, this._editorBridgeService = d, this._renderManagerService = u, this._initCommandListener(), this._initPanelListener(), this._initMarkSelection(), this._initSelectionUpdateListener(), this._initEditorBridge();
338
+ this._commandService = e, this._sheetsThreadCommentPopupService = n, this._sheetsThreadCommentModel = t, this._threadCommentPanelService = r, this._univerInstanceService = i, this._sheetPermissionInterceptorBaseController = s, this._markSelectionService = a, this._sheetSelectionService = c, this._editorBridgeService = d, this._renderManagerService = m, this._initCommandListener(), this._initPanelListener(), this._initMarkSelection(), this._initSelectionUpdateListener(), this._initEditorBridge();
339
339
  }
340
340
  _handleSelectionChange(e, n, t) {
341
341
  var h, l, v;
342
- const r = (h = e[0]) == null ? void 0 : h.range, i = this._renderManagerService.getRenderById(n), s = (l = i == null ? void 0 : i.with(ht).getWorksheetSkeleton(t)) == null ? void 0 : l.skeleton;
342
+ const r = (h = e[0]) == null ? void 0 : h.range, i = this._renderManagerService.getRenderById(n), s = (l = i == null ? void 0 : i.with(pt).getWorksheetSkeleton(t)) == null ? void 0 : l.skeleton;
343
343
  if (!s || !r)
344
344
  return;
345
345
  const a = s.getCellWithCoordByIndex(r.startRow, r.startColumn);
346
- if ((((v = r.rangeType) != null ? v : he.NORMAL) !== he.NORMAL || r.endColumn - r.startColumn > 0 || r.endRow - r.startRow > 0) && !((a.isMerged || a.isMergedMainCell) && ze.equals(a.mergeInfo, r))) {
346
+ if ((((v = r.rangeType) != null ? v : he.NORMAL) !== he.NORMAL || r.endColumn - r.startColumn > 0 || r.endRow - r.startRow > 0) && !((a.isMerged || a.isMergedMainCell) && qe.equals(a.mergeInfo, r))) {
347
347
  this._threadCommentPanelService.activeCommentId && this._commandService.executeCommand(te.id);
348
348
  return;
349
349
  }
350
- const d = a.actualRow, u = a.actualColumn;
351
- if (!this._sheetsThreadCommentModel.showCommentMarker(n, t, d, u)) {
350
+ const d = a.actualRow, m = a.actualColumn;
351
+ if (!this._sheetsThreadCommentModel.showCommentMarker(n, t, d, m)) {
352
352
  this._threadCommentPanelService.activeCommentId && this._commandService.executeCommand(te.id);
353
353
  return;
354
354
  }
355
- const m = this._sheetsThreadCommentModel.getByLocation(n, t, d, u);
356
- m && this._commandService.executeCommand(te.id, {
355
+ const u = this._sheetsThreadCommentModel.getByLocation(n, t, d, m);
356
+ u && this._commandService.executeCommand(te.id, {
357
357
  unitId: n,
358
358
  subUnitId: t,
359
- commentId: m
359
+ commentId: u
360
360
  });
361
361
  }
362
362
  _initSelectionUpdateListener() {
@@ -397,11 +397,11 @@ let q = class extends $ {
397
397
  const c = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET);
398
398
  if (!c || c.getUnitId() !== t)
399
399
  return;
400
- this._isSwitchToCommenting = !0, ((n = c.getActiveSheet()) == null ? void 0 : n.getSheetId()) !== r && await this._commandService.executeCommand(et.id, {
400
+ this._isSwitchToCommenting = !0, ((n = c.getActiveSheet()) == null ? void 0 : n.getSheetId()) !== r && await this._commandService.executeCommand(nt.id, {
401
401
  unitId: t,
402
402
  subUnitId: r
403
403
  }), this._isSwitchToCommenting = !1;
404
- const m = V(a.ref), { row: h, column: l } = m;
404
+ const u = V(a.ref), { row: h, column: l } = u;
405
405
  if (!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
406
406
  workbookTypes: [K],
407
407
  worksheetTypes: [Q],
@@ -409,20 +409,20 @@ let q = class extends $ {
409
409
  }, [{ startRow: h, startColumn: l, endRow: h, endColumn: l }]))
410
410
  return;
411
411
  const S = 1;
412
- if (await this._commandService.executeCommand(lt.id, {
412
+ if (await this._commandService.executeCommand(_t.id, {
413
413
  range: {
414
- startRow: Math.max(m.row - S, 0),
415
- endRow: m.row + S,
416
- startColumn: Math.max(m.column - S, 0),
417
- endColumn: m.column + S
414
+ startRow: Math.max(u.row - S, 0),
415
+ endRow: u.row + S,
416
+ startColumn: Math.max(u.column - S, 0),
417
+ endColumn: u.column + S
418
418
  }
419
419
  }), this._editorBridgeService.isVisible().visible)
420
420
  return;
421
421
  this._sheetsThreadCommentPopupService.showPopup({
422
422
  unitId: t,
423
423
  subUnitId: r,
424
- row: m.row,
425
- col: m.column,
424
+ row: u.row,
425
+ col: u.column,
426
426
  commentId: a.id,
427
427
  trigger: s
428
428
  });
@@ -431,7 +431,7 @@ let q = class extends $ {
431
431
  }));
432
432
  }
433
433
  _initMarkSelection() {
434
- this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.pipe(ue(100)).subscribe((e) => {
434
+ this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.pipe(me(100)).subscribe((e) => {
435
435
  var h, l;
436
436
  if (!e) {
437
437
  this._selectionShapeInfo && (this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId), this._selectionShapeInfo = null);
@@ -445,14 +445,14 @@ let q = class extends $ {
445
445
  const s = V(i.ref), { row: a, column: c } = s;
446
446
  if (Number.isNaN(a) || Number.isNaN(c))
447
447
  return null;
448
- const d = (h = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET)) == null ? void 0 : h.getSheetBySheetId(t), u = (l = d == null ? void 0 : d.getMergedCell(a, c)) != null ? l : {
448
+ const d = (h = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET)) == null ? void 0 : h.getSheetBySheetId(t), m = (l = d == null ? void 0 : d.getMergedCell(a, c)) != null ? l : {
449
449
  startColumn: c,
450
450
  endColumn: c,
451
451
  startRow: a,
452
452
  endRow: a
453
- }, m = this._markSelectionService.addShape(
453
+ }, u = this._markSelectionService.addShape(
454
454
  {
455
- range: u,
455
+ range: m,
456
456
  style: {
457
457
  // hasAutoFill: false,
458
458
  fill: "rgb(255, 189, 55, 0.35)",
@@ -465,29 +465,29 @@ let q = class extends $ {
465
465
  [],
466
466
  -1
467
467
  );
468
- m && (this._selectionShapeInfo = {
468
+ u && (this._selectionShapeInfo = {
469
469
  ...e,
470
- shapeId: m
470
+ shapeId: u
471
471
  });
472
472
  }));
473
473
  }
474
474
  };
475
- q = qt([
475
+ q = Gt([
476
476
  w(0, ae),
477
477
  w(1, _(O)),
478
478
  w(2, _(x)),
479
479
  w(3, _(ce)),
480
480
  w(4, N),
481
- w(5, _(Ie)),
482
- w(6, Pe),
483
- w(7, _(Ce)),
484
- w(8, dt),
485
- w(9, we)
481
+ w(5, _(Pe)),
482
+ w(6, Te),
483
+ w(7, _(Se)),
484
+ w(8, lt),
485
+ w(9, ye)
486
486
  ], q);
487
- var Gt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, Yt = (o, e, n, t) => {
488
- for (var r = t > 1 ? void 0 : t ? Jt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
487
+ var Jt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, Kt = (o, e, n, t) => {
488
+ for (var r = t > 1 ? void 0 : t ? Yt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
489
489
  (s = o[i]) && (r = (t ? s(e, n, r) : s(r)) || r);
490
- return t && r && Gt(e, n, r), r;
490
+ return t && r && Jt(e, n, r), r;
491
491
  }, k = (o, e) => (n, t) => e(n, t, o);
492
492
  let G = class extends $ {
493
493
  constructor(o, e, n, t) {
@@ -498,21 +498,21 @@ let G = class extends $ {
498
498
  this._sheetInterceptorService.interceptCommand({
499
499
  getMutations: (o) => {
500
500
  var e;
501
- if (o.id === tt.id) {
501
+ if (o.id === rt.id) {
502
502
  const n = o.params, t = n.unitId ? this._univerInstanceService.getUnit(n.unitId) : this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET);
503
503
  if (!t)
504
504
  return { redos: [], undos: [] };
505
505
  const r = t.getUnitId(), i = n.subUnitId || ((e = t.getActiveSheet()) == null ? void 0 : e.getSheetId());
506
506
  if (!i)
507
507
  return { redos: [], undos: [] };
508
- const s = this._threadCommentModel.ensureMap(r, i), a = Array.from(s.values()).filter((h) => !h.parentId), c = a.map((h) => h.id), d = this._threadCommentDataSourceService.syncUpdateMutationToColla, u = c.map((h) => ({
508
+ const s = this._threadCommentModel.ensureMap(r, i), a = Array.from(s.values()).filter((h) => !h.parentId), c = a.map((h) => h.id), d = this._threadCommentDataSourceService.syncUpdateMutationToColla, m = c.map((h) => ({
509
509
  id: F.id,
510
510
  params: {
511
511
  unitId: r,
512
512
  subUnitId: i,
513
513
  commentId: h
514
514
  }
515
- })), m = a.map(({ children: h, ...l }) => ({
515
+ })), u = a.map(({ children: h, ...l }) => ({
516
516
  id: se.id,
517
517
  params: {
518
518
  unitId: r,
@@ -524,7 +524,7 @@ let G = class extends $ {
524
524
  sync: !d
525
525
  }
526
526
  }));
527
- return { redos: u, undos: m };
527
+ return { redos: m, undos: u };
528
528
  }
529
529
  return { redos: [], undos: [] };
530
530
  }
@@ -532,11 +532,11 @@ let G = class extends $ {
532
532
  );
533
533
  }
534
534
  };
535
- G = Yt([
536
- k(0, _(Se)),
535
+ G = Kt([
536
+ k(0, _(ge)),
537
537
  k(1, N),
538
- k(2, _(wt)),
539
- k(3, ye)
538
+ k(2, _(Et)),
539
+ k(3, Ee)
540
540
  ], G);
541
541
  var P = function() {
542
542
  return P = Object.assign || function(o) {
@@ -546,23 +546,23 @@ var P = function() {
546
546
  }
547
547
  return o;
548
548
  }, P.apply(this, arguments);
549
- }, Kt = function(o, e) {
549
+ }, Qt = function(o, e) {
550
550
  var n = {};
551
551
  for (var t in o) Object.prototype.hasOwnProperty.call(o, t) && e.indexOf(t) < 0 && (n[t] = o[t]);
552
552
  if (o != null && typeof Object.getOwnPropertySymbols == "function")
553
553
  for (var r = 0, t = Object.getOwnPropertySymbols(o); r < t.length; r++)
554
554
  e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(o, t[r]) && (n[t[r]] = o[t[r]]);
555
555
  return n;
556
- }, Ne = Ee(function(o, e) {
557
- var n = o.icon, t = o.id, r = o.className, i = o.extend, s = Kt(o, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), c = Re("_".concat(en()));
558
- return xe(n, "".concat(t), { defIds: n.defIds, idSuffix: c.current }, P({ ref: e, className: a }, s), i);
556
+ }, xe = Re(function(o, e) {
557
+ var n = o.icon, t = o.id, r = o.className, i = o.extend, s = Qt(o, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), c = Oe("_".concat(tn()));
558
+ return De(n, "".concat(t), { defIds: n.defIds, idSuffix: c.current }, P({ ref: e, className: a }, s), i);
559
559
  });
560
- function xe(o, e, n, t, r) {
561
- return Oe(o.tag, P(P({ key: e }, Qt(o, n, r)), t), (Xt(o, n).children || []).map(function(i, s) {
562
- return xe(i, "".concat(e, "-").concat(o.tag, "-").concat(s), n, void 0, r);
560
+ function De(o, e, n, t, r) {
561
+ return Ue(o.tag, P(P({ key: e }, Xt(o, n, r)), t), (en(o, n).children || []).map(function(i, s) {
562
+ return De(i, "".concat(e, "-").concat(o.tag, "-").concat(s), n, void 0, r);
563
563
  }));
564
564
  }
565
- function Qt(o, e, n) {
565
+ function Xt(o, e, n) {
566
566
  var t = P({}, o.attrs);
567
567
  n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
568
568
  var r = e.defIds;
@@ -571,24 +571,24 @@ function Qt(o, e, n) {
571
571
  typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
572
572
  })), t;
573
573
  }
574
- function Xt(o, e) {
574
+ function en(o, e) {
575
575
  var n, t = e.defIds;
576
576
  return !t || t.length === 0 ? o : o.tag === "defs" && (!((n = o.children) === null || n === void 0) && n.length) ? P(P({}, o), { children: o.children.map(function(r) {
577
577
  return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? P(P({}, r), { attrs: P(P({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
578
578
  }) }) : o;
579
579
  }
580
- function en() {
580
+ function tn() {
581
581
  return Math.random().toString(36).substring(2, 8);
582
582
  }
583
- Ne.displayName = "UniverIcon";
584
- var tn = { 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" } }] }, De = Ee(function(o, e) {
585
- return Oe(Ne, Object.assign({}, o, {
583
+ xe.displayName = "UniverIcon";
584
+ var nn = { 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" } }] }, je = Re(function(o, e) {
585
+ return Ue(xe, Object.assign({}, o, {
586
586
  id: "comment-single",
587
587
  ref: e,
588
- icon: tn
588
+ icon: nn
589
589
  }));
590
590
  });
591
- De.displayName = "CommentSingle";
591
+ je.displayName = "CommentSingle";
592
592
  var re = { exports: {} }, j = {};
593
593
  /**
594
594
  * @license React
@@ -599,37 +599,37 @@ var re = { exports: {} }, j = {};
599
599
  * This source code is licensed under the MIT license found in the
600
600
  * LICENSE file in the root directory of this source tree.
601
601
  */
602
- var ve;
603
- function nn() {
604
- if (ve) return j;
605
- ve = 1;
606
- var o = yt, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, r = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
602
+ var fe;
603
+ function rn() {
604
+ if (fe) return j;
605
+ fe = 1;
606
+ var o = Rt, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, r = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
607
607
  function s(a, c, d) {
608
- var u, m = {}, h = null, l = null;
608
+ var m, u = {}, h = null, l = null;
609
609
  d !== void 0 && (h = "" + d), c.key !== void 0 && (h = "" + c.key), c.ref !== void 0 && (l = c.ref);
610
- for (u in c) t.call(c, u) && !i.hasOwnProperty(u) && (m[u] = c[u]);
611
- if (a && a.defaultProps) for (u in c = a.defaultProps, c) m[u] === void 0 && (m[u] = c[u]);
612
- return { $$typeof: e, type: a, key: h, ref: l, props: m, _owner: r.current };
610
+ for (m in c) t.call(c, m) && !i.hasOwnProperty(m) && (u[m] = c[m]);
611
+ if (a && a.defaultProps) for (m in c = a.defaultProps, c) u[m] === void 0 && (u[m] = c[m]);
612
+ return { $$typeof: e, type: a, key: h, ref: l, props: u, _owner: r.current };
613
613
  }
614
614
  return j.Fragment = n, j.jsx = s, j.jsxs = s, j;
615
615
  }
616
- var fe;
617
- function rn() {
618
- return fe || (fe = 1, re.exports = nn()), re.exports;
616
+ var Ce;
617
+ function on() {
618
+ return Ce || (Ce = 1, re.exports = rn()), re.exports;
619
619
  }
620
- var je = rn();
621
- const on = () => {
620
+ var Ae = on();
621
+ const sn = () => {
622
622
  const o = R(N), e = R(O), n = A(e.activePopup$), t = R(x);
623
623
  if (A(t.commentUpdate$), !n)
624
624
  return null;
625
- const { row: r, col: i, unitId: s, subUnitId: a, trigger: c } = n, d = t.getByLocation(s, a, r, i), u = `${qe.chatAtABC(i)}${r + 1}`, m = () => {
625
+ const { row: r, col: i, unitId: s, subUnitId: a, trigger: c } = n, d = t.getByLocation(s, a, r, i), m = `${Ge.chatAtABC(i)}${r + 1}`, u = () => {
626
626
  e.hidePopup();
627
627
  }, h = (l) => {
628
628
  var v, S, U;
629
629
  return (U = (S = (v = o.getCurrentUnitForType(b.UNIVER_SHEET)) == null ? void 0 : v.getSheetBySheetId(l)) == null ? void 0 : S.getName()) != null ? U : "";
630
630
  };
631
- return /* @__PURE__ */ je.jsx(
632
- rt,
631
+ return /* @__PURE__ */ Ae.jsx(
632
+ it,
633
633
  {
634
634
  onClick: () => {
635
635
  e.persistPopup();
@@ -639,23 +639,23 @@ const on = () => {
639
639
  unitId: s,
640
640
  subUnitId: a,
641
641
  type: b.UNIVER_SHEET,
642
- refStr: u,
643
- onClose: m,
642
+ refStr: m,
643
+ onClose: u,
644
644
  getSubUnitName: h,
645
645
  autoFocus: c === "context-menu"
646
646
  }
647
647
  );
648
- }, sn = () => {
648
+ }, an = () => {
649
649
  var g;
650
- const o = R(Pe), e = R(N), n = R(O), t = e.getCurrentUnitForType(b.UNIVER_SHEET), r = t.getUnitId(), i = R(ae), s = Et(() => t.activeSheet$.pipe(bt((p) => p == null ? void 0 : p.getSheetId())), [t.activeSheet$]), a = A(s, (g = t.getActiveSheet()) == null ? void 0 : g.getSheetId()), c = Re(), d = R(ce), u = A(d.activeCommentId$), m = A(d.panelVisible$, d.panelVisible), h = pe((p) => {
650
+ const o = R(Te), e = R(N), n = R(O), t = e.getCurrentUnitForType(b.UNIVER_SHEET), r = t.getUnitId(), i = R(ae), s = Ot(() => t.activeSheet$.pipe(wt((p) => p == null ? void 0 : p.getSheetId())), [t.activeSheet$]), a = A(s, (g = t.getActiveSheet()) == null ? void 0 : g.getSheetId()), c = Oe(), d = R(ce), m = A(d.activeCommentId$), u = A(d.panelVisible$, d.panelVisible), h = pe((p) => {
651
651
  const I = t.getSheets(), f = {};
652
652
  I.forEach((T, C) => {
653
653
  f[T.getSheetId()] = C;
654
654
  });
655
655
  const M = (T) => T.map((C) => {
656
656
  var de;
657
- const y = V(C.ref), Be = [(de = f[C.subUnitId]) != null ? de : 0, y.row, y.column];
658
- return { ...C, p: Be };
657
+ const y = V(C.ref), He = [(de = f[C.subUnitId]) != null ? de : 0, y.row, y.column];
658
+ return { ...C, p: He };
659
659
  }).sort((C, y) => C.p[0] === y.p[0] ? C.p[1] === y.p[1] ? C.p[2] - y.p[2] : C.p[1] - y.p[1] : C.p[0] - y.p[0]);
660
660
  return [
661
661
  ...M(p.filter((T) => !T.resolved)),
@@ -689,16 +689,16 @@ const on = () => {
689
689
  }, S = () => {
690
690
  i.executeCommand(B.id);
691
691
  }, U = (p) => {
692
- u && u.unitId === p.unitId && u.subUnitId === p.subUnitId && u.commentId === p.id || (c.current && (o.removeShape(c.current), c.current = null), c.current = l(p));
692
+ m && m.unitId === p.unitId && m.subUnitId === p.subUnitId && m.commentId === p.id || (c.current && (o.removeShape(c.current), c.current = null), c.current = l(p));
693
693
  }, D = () => {
694
694
  c.current && (o.removeShape(c.current), c.current = null);
695
695
  }, ee = (p, I) => {
696
696
  I && n.hidePopup();
697
697
  };
698
- return Rt(() => {
699
- !m && c.current && o.removeShape(c.current);
700
- }, [o, m]), /* @__PURE__ */ je.jsx(
701
- ot,
698
+ return Ut(() => {
699
+ !u && c.current && o.removeShape(c.current);
700
+ }, [o, u]), /* @__PURE__ */ Ae.jsx(
701
+ st,
702
702
  {
703
703
  unitId: r,
704
704
  subUnitId$: s,
@@ -712,52 +712,52 @@ const on = () => {
712
712
  onDeleteComment: () => (D(), !0)
713
713
  }
714
714
  );
715
- }, an = (o) => ({
715
+ }, cn = (o) => ({
716
716
  id: B.id,
717
- type: be.BUTTON,
718
- icon: me,
717
+ type: Me.BUTTON,
718
+ icon: ue,
719
719
  title: "sheetThreadComment.menu.addComment",
720
- hidden$: Me(o, b.UNIVER_SHEET),
721
- disabled$: Te(o, {
720
+ hidden$: we(o, b.UNIVER_SHEET),
721
+ disabled$: be(o, {
722
722
  workbookTypes: [K],
723
723
  worksheetTypes: [Q],
724
724
  rangeTypes: [X]
725
725
  })
726
- }), cn = (o) => ({
727
- id: ge.id,
728
- type: be.BUTTON,
729
- icon: me,
726
+ }), mn = (o) => ({
727
+ id: Ie.id,
728
+ type: Me.BUTTON,
729
+ icon: ue,
730
730
  tooltip: "sheetThreadComment.menu.commentManagement",
731
- disabled$: Te(o, {
731
+ disabled$: be(o, {
732
732
  workbookTypes: [K],
733
733
  worksheetTypes: [Q],
734
734
  rangeTypes: [X]
735
735
  }),
736
- hidden$: Me(o, b.UNIVER_SHEET)
736
+ hidden$: we(o, b.UNIVER_SHEET)
737
737
  }), un = {
738
738
  id: B.id,
739
- binding: vt.M | le.CTRL_COMMAND | le.ALT,
740
- preconditions: pt
741
- }, mn = {
742
- [ft.OTHERS]: {
743
- [ge.id]: {
739
+ binding: Ct.M | le.CTRL_COMMAND | le.ALT,
740
+ preconditions: vt
741
+ }, dn = {
742
+ [St.OTHERS]: {
743
+ [Ie.id]: {
744
744
  order: 1,
745
- menuItemFactory: cn
745
+ menuItemFactory: mn
746
746
  }
747
747
  },
748
- [Ct.MAIN_AREA]: {
749
- [St.OTHERS]: {
748
+ [gt.MAIN_AREA]: {
749
+ [It.OTHERS]: {
750
750
  [B.id]: {
751
751
  order: 0,
752
- menuItemFactory: an
752
+ menuItemFactory: cn
753
753
  }
754
754
  }
755
755
  }
756
756
  };
757
- var dn = Object.defineProperty, hn = Object.getOwnPropertyDescriptor, ln = (o, e, n, t) => {
758
- for (var r = t > 1 ? void 0 : t ? hn(e, n) : e, i = o.length - 1, s; i >= 0; i--)
757
+ var hn = Object.defineProperty, ln = Object.getOwnPropertyDescriptor, pn = (o, e, n, t) => {
758
+ for (var r = t > 1 ? void 0 : t ? ln(e, n) : e, i = o.length - 1, s; i >= 0; i--)
759
759
  (s = o[i]) && (r = (t ? s(e, n, r) : s(r)) || r);
760
- return t && r && dn(e, n, r), r;
760
+ return t && r && hn(e, n, r), r;
761
761
  }, oe = (o, e) => (n, t) => e(n, t, o);
762
762
  let J = class extends $ {
763
763
  constructor(o, e, n) {
@@ -767,33 +767,37 @@ let J = class extends $ {
767
767
  this._shortcutService.registerShortcut(un);
768
768
  }
769
769
  _initMenu() {
770
- this._menuManagerService.mergeMenu(mn);
770
+ this._menuManagerService.mergeMenu(dn);
771
771
  }
772
772
  _initComponent() {
773
773
  [
774
- [Ue, on],
775
- [it, sn],
776
- [me, De]
774
+ [$e, sn],
775
+ [at, an],
776
+ [ue, je]
777
777
  ].forEach(([o, e]) => {
778
778
  this._componentManager.register(o, e);
779
779
  });
780
780
  }
781
781
  };
782
- J = ln([
783
- oe(0, It),
784
- oe(1, _(gt)),
785
- oe(2, Pt)
782
+ J = pn([
783
+ oe(0, Tt),
784
+ oe(1, _(Pt)),
785
+ oe(2, bt)
786
786
  ], J);
787
- var Ae = Object.defineProperty, pn = Object.getOwnPropertyDescriptor, _n = (o, e, n) => e in o ? Ae(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n, vn = (o, e, n, t) => {
788
- for (var r = t > 1 ? void 0 : t ? pn(e, n) : e, i = o.length - 1, s; i >= 0; i--)
787
+ var Ve = Object.defineProperty, _n = Object.getOwnPropertyDescriptor, vn = (o, e, n) => e in o ? Ve(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n, fn = (o, e, n, t) => {
788
+ for (var r = t > 1 ? void 0 : t ? _n(e, n) : e, i = o.length - 1, s; i >= 0; i--)
789
789
  (s = o[i]) && (r = (t ? s(e, n, r) : s(r)) || r);
790
- return t && r && Ae(e, n, r), r;
791
- }, ie = (o, e) => (n, t) => e(n, t, o), Ve = (o, e, n) => _n(o, typeof e != "symbol" ? e + "" : e, n);
792
- let Y = class extends Ye {
793
- constructor(o = xt, e, n, t) {
790
+ return t && r && Ve(e, n, r), r;
791
+ }, ie = (o, e) => (n, t) => e(n, t, o), Be = (o, e, n) => vn(o, typeof e != "symbol" ? e + "" : e, n);
792
+ let Y = class extends Ke {
793
+ constructor(o = ve, e, n, t) {
794
794
  super(), this._config = o, this._injector = e, this._commandService = n, this._configService = t;
795
- const { menu: r, ...i } = this._config;
796
- r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Nt, i);
795
+ const { menu: r, ...i } = Qe(
796
+ {},
797
+ ve,
798
+ this._config
799
+ );
800
+ r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Dt, i);
797
801
  }
798
802
  onStarting() {
799
803
  [
@@ -817,24 +821,24 @@ let Y = class extends Ye {
817
821
  this._injector.get(Z), this._injector.get(z), this._injector.get(q);
818
822
  }
819
823
  };
820
- Ve(Y, "pluginName", $e);
821
- Ve(Y, "type", b.UNIVER_SHEET);
822
- Y = vn([
823
- Ge(st, nt),
824
- ie(1, _(Je)),
824
+ Be(Y, "pluginName", Ne);
825
+ Be(Y, "type", b.UNIVER_SHEET);
826
+ Y = fn([
827
+ Je(ct, ot),
828
+ ie(1, _(Ye)),
825
829
  ie(2, _(ae)),
826
- ie(3, Ke)
830
+ ie(3, Xe)
827
831
  ], Y);
828
832
  export {
829
- Nn as AddCommentCommand,
830
- xn as DeleteCommentCommand,
831
- Dn as DeleteCommentTreeCommand,
832
- jn as IThreadCommentDataSourceService,
833
- An as ResolveCommentCommand,
834
- $e as SHEETS_THREAD_COMMENT,
833
+ xn as AddCommentCommand,
834
+ Dn as DeleteCommentCommand,
835
+ jn as DeleteCommentTreeCommand,
836
+ An as IThreadCommentDataSourceService,
837
+ Vn as ResolveCommentCommand,
838
+ Ne as SHEETS_THREAD_COMMENT,
835
839
  O as SheetsThreadCommentPopupService,
836
840
  B as ShowAddSheetCommentModalOperation,
837
841
  Y as UniverSheetsThreadCommentUIPlugin,
838
- Un as UniverThreadCommentUIPlugin,
839
- Vn as UpdateCommentCommand
842
+ $n as UniverThreadCommentUIPlugin,
843
+ Bn as UpdateCommentCommand
840
844
  };