@univerjs/sheets-thread-comment-ui 0.8.0-nightly.202505261607 → 0.8.0-nightly.202505281606

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