@univerjs/sheets-thread-comment-ui 0.5.0 → 0.5.1

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