@univerjs/sheets-thread-comment-ui 0.10.12 → 0.10.13

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