@univerjs/sheets-thread-comment 0.1.12 → 0.1.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,22 +1,22 @@
1
- var Re = Object.defineProperty;
2
- var Ee = (o, e, n) => e in o ? Re(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n;
3
- var _ = (o, e, n) => (Ee(o, typeof e != "symbol" ? e + "" : e, n), n);
4
- import { Inject as h, Injector as pe } from "@wendellhu/redi";
5
- import { Inject as Sn, Injector as gn } from "@wendellhu/redi";
6
- import { Disposable as O, ObjectMatrix as $e, UniverInstanceType as S, IUniverInstanceService as $, DisposableCollection as xe, Tools as _e, CommandType as Ne, ICommandService as Q, OnLifecycle as x, LifecycleStages as N, LocaleService as De, toDisposable as je, Range as Ve } from "@univerjs/core";
7
- import { ICommandService as Mn, Plugin as Pn, UniverInstanceType as bn } from "@univerjs/core";
8
- import { ThreadCommentTree as Ae, ThreadCommentPanelService as ee, ThreadCommentPanel as Le, ToggleSheetCommentPanelOperation as He, SetActiveCommentOperation as re, THREAD_COMMENT_PANEL as Be, UniverThreadCommentUIPlugin as We } from "@univerjs/thread-comment-ui";
9
- import { IThreadCommentMentionDataService as wn, UniverThreadCommentUIPlugin as yn } from "@univerjs/thread-comment-ui";
10
- import { IZenZoneService as Fe, useObservable as oe, KeyCode as Ze, MetaKeys as ie, MenuItemType as ve, MenuPosition as fe, getMenuHiddenObservable as Ce, ComponentManager as ze, IMenuService as Ke, IShortcutService as Ge } from "@univerjs/ui";
11
- import { SelectionManagerService as Ye, getSheetCommandTarget as ke, SetSelectionsOperation as qe, SelectionMoveType as Xe, SetWorksheetActiveOperation as Je, RefRangeService as Qe, handleDefaultRangeChangeWithEffectRefCommands as et, SheetInterceptorService as Se, INTERCEPTOR_POINT as tt, RemoveSheetCommand as nt } from "@univerjs/sheets";
1
+ var De = Object.defineProperty;
2
+ var Ne = (o, e, n) => e in o ? De(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n;
3
+ var _ = (o, e, n) => (Ne(o, typeof e != "symbol" ? e + "" : e, n), n);
4
+ import { Inject as h, Injector as le } from "@wendellhu/redi";
5
+ import { Inject as bn, Injector as Tn } from "@wendellhu/redi";
6
+ import { Disposable as O, ObjectMatrix as je, UniverInstanceType as g, IUniverInstanceService as $, DisposableCollection as Ve, Tools as _e, CommandType as Ae, ICommandService as Q, OnLifecycle as x, LifecycleStages as D, LocaleService as Le, toDisposable as He, Range as Be } from "@univerjs/core";
7
+ import { ICommandService as yn, Plugin as Un, UniverInstanceType as On } from "@univerjs/core";
8
+ import { ThreadCommentTree as We, ThreadCommentPanelService as ee, ThreadCommentPanel as Fe, ToggleSheetCommentPanelOperation as Ze, SetActiveCommentOperation as re, THREAD_COMMENT_PANEL as ke, UniverThreadCommentUIPlugin as ze } from "@univerjs/thread-comment-ui";
9
+ import { IThreadCommentMentionDataService as En, UniverThreadCommentUIPlugin as $n } from "@univerjs/thread-comment-ui";
10
+ import { IZenZoneService as Ge, useObservable as oe, KeyCode as Ke, MetaKeys as ie, MenuItemType as ve, MenuPosition as fe, getMenuHiddenObservable as Ce, MenuGroup as Ye, ComponentManager as qe, IMenuService as Xe, IShortcutService as Je } from "@univerjs/ui";
11
+ import { SelectionManagerService as Qe, getSheetCommandTarget as et, WorkbookCommentPermission as ge, WorksheetViewPermission as Se, RangeProtectionPermissionEditPoint as Ie, SetSelectionsOperation as tt, SelectionMoveType as nt, SetWorksheetActiveOperation as rt, RefRangeService as ot, handleDefaultRangeChangeWithEffectRefCommands as it, SheetInterceptorService as Me, INTERCEPTOR_POINT as st, RemoveSheetCommand as at } from "@univerjs/sheets";
12
12
  import { singleReferenceToGrid as y, serializeRange as J } from "@univerjs/engine-formula";
13
- import { SheetCanvasPopManagerService as rt, IMarkSelectionService as ot, whenSheetEditorFocused as it, ScrollToCellCommand as st, SheetSkeletonManagerService as at, ISheetClipboardService as ct, COPY_TYPE as mt, HoverManagerService as dt } from "@univerjs/sheets-ui";
14
- import { ThreadCommentModel as G, DeleteCommentMutation as V, AddCommentMutation as K, UpdateCommentRefMutation as se } from "@univerjs/thread-comment";
15
- import { IThreadCommentDataSourceService as On } from "@univerjs/thread-comment";
13
+ import { SheetCanvasPopManagerService as ct, IMarkSelectionService as dt, whenSheetEditorFocused as mt, getCommentDisable$ as Pe, ScrollToCellCommand as ut, SheetSkeletonManagerService as ht, ISheetClipboardService as pt, COPY_TYPE as lt, HoverManagerService as _t } from "@univerjs/sheets-ui";
14
+ import { ThreadCommentModel as G, DeleteCommentMutation as V, AddCommentMutation as z, UpdateCommentRefMutation as se } from "@univerjs/thread-comment";
15
+ import { IThreadCommentDataSourceService as Dn } from "@univerjs/thread-comment";
16
16
  import { useDependency as w, useObservable as ae } from "@wendellhu/redi/react-bindings";
17
- import ge, { forwardRef as Ie, useRef as Me, createElement as Pe, useMemo as ut, useCallback as ce, useEffect as ht } from "react";
18
- import { Subject as lt, BehaviorSubject as pt, map as _t } from "rxjs";
19
- import { IRenderManagerService as vt } from "@univerjs/engine-render";
17
+ import be, { forwardRef as Te, useRef as we, createElement as ye, useMemo as vt, useCallback as ce, useEffect as ft } from "react";
18
+ import { Subject as Ct, BehaviorSubject as gt, map as St, debounceTime as It } from "rxjs";
19
+ import { IRenderManagerService as Mt } from "@univerjs/engine-render";
20
20
  var f = function() {
21
21
  return f = Object.assign || function(o) {
22
22
  for (var e, n = 1, r = arguments.length; n < r; n++) {
@@ -26,7 +26,7 @@ var f = function() {
26
26
  }
27
27
  return o;
28
28
  }, f.apply(this, arguments);
29
- }, ft = function(o, e) {
29
+ }, Pt = function(o, e) {
30
30
  var n = {};
31
31
  for (var r in o)
32
32
  Object.prototype.hasOwnProperty.call(o, r) && e.indexOf(r) < 0 && (n[r] = o[r]);
@@ -34,16 +34,16 @@ var f = function() {
34
34
  for (var t = 0, r = Object.getOwnPropertySymbols(o); t < r.length; t++)
35
35
  e.indexOf(r[t]) < 0 && Object.prototype.propertyIsEnumerable.call(o, r[t]) && (n[r[t]] = o[r[t]]);
36
36
  return n;
37
- }, be = Ie(function(o, e) {
38
- var n = o.icon, r = o.id, t = o.className, i = o.extend, s = ft(o, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(t || "").trim(), c = Me("_".concat(gt()));
39
- return Te(n, "".concat(r), { defIds: n.defIds, idSuffix: c.current }, f({ ref: e, className: a }, s), i);
37
+ }, Ue = Te(function(o, e) {
38
+ var n = o.icon, r = o.id, t = o.className, i = o.extend, s = Pt(o, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(t || "").trim(), c = we("_".concat(wt()));
39
+ return Oe(n, "".concat(r), { defIds: n.defIds, idSuffix: c.current }, f({ ref: e, className: a }, s), i);
40
40
  });
41
- function Te(o, e, n, r, t) {
42
- return Pe(o.tag, f(f({ key: e }, Ct(o, n, t)), r), (St(o, n).children || []).map(function(i, s) {
43
- return Te(i, "".concat(e, "-").concat(o.tag, "-").concat(s), n, void 0, t);
41
+ function Oe(o, e, n, r, t) {
42
+ return ye(o.tag, f(f({ key: e }, bt(o, n, t)), r), (Tt(o, n).children || []).map(function(i, s) {
43
+ return Oe(i, "".concat(e, "-").concat(o.tag, "-").concat(s), n, void 0, t);
44
44
  }));
45
45
  }
46
- function Ct(o, e, n) {
46
+ function bt(o, e, n) {
47
47
  var r = f({}, o.attrs);
48
48
  n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
49
49
  var t = e.defIds;
@@ -52,35 +52,35 @@ function Ct(o, e, n) {
52
52
  typeof a == "string" && (r[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
53
53
  })), r;
54
54
  }
55
- function St(o, e) {
55
+ function Tt(o, e) {
56
56
  var n, r = e.defIds;
57
57
  return !r || r.length === 0 ? o : o.tag === "defs" && (!((n = o.children) === null || n === void 0) && n.length) ? f(f({}, o), { children: o.children.map(function(t) {
58
58
  return typeof t.attrs.id == "string" && r && r.indexOf(t.attrs.id) > -1 ? f(f({}, t), { attrs: f(f({}, t.attrs), { id: t.attrs.id + e.idSuffix }) }) : t;
59
59
  }) }) : o;
60
60
  }
61
- function gt() {
61
+ function wt() {
62
62
  return Math.random().toString(36).substring(2, 8);
63
63
  }
64
- be.displayName = "UniverIcon";
65
- var It = { 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" } }] }, we = Ie(function(o, e) {
66
- return Pe(be, Object.assign({}, o, {
64
+ Ue.displayName = "UniverIcon";
65
+ var yt = { 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" } }] }, Re = Te(function(o, e) {
66
+ return ye(Ue, Object.assign({}, o, {
67
67
  id: "comment-single",
68
68
  ref: e,
69
- icon: It
69
+ icon: yt
70
70
  }));
71
71
  });
72
- we.displayName = "CommentSingle";
73
- var Mt = Object.defineProperty, Pt = Object.getOwnPropertyDescriptor, bt = (o, e, n, r) => {
74
- for (var t = r > 1 ? void 0 : r ? Pt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
72
+ Re.displayName = "CommentSingle";
73
+ var Ut = Object.defineProperty, Ot = Object.getOwnPropertyDescriptor, Rt = (o, e, n, r) => {
74
+ for (var t = r > 1 ? void 0 : r ? Ot(e, n) : e, i = o.length - 1, s; i >= 0; i--)
75
75
  (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
76
- return r && t && Mt(e, n, t), t;
77
- }, me = (o, e) => (n, r) => e(n, r, o);
76
+ return r && t && Ut(e, n, t), t;
77
+ }, de = (o, e) => (n, r) => e(n, r, o);
78
78
  let T = class extends O {
79
79
  constructor(e, n) {
80
80
  super();
81
81
  _(this, "_matrixMap", /* @__PURE__ */ new Map());
82
82
  _(this, "_locationMap", /* @__PURE__ */ new Map());
83
- _(this, "_commentUpdate$", new lt());
83
+ _(this, "_commentUpdate$", new Ct());
84
84
  _(this, "commentUpdate$", this._commentUpdate$.asObservable());
85
85
  this._threadCommentModel = e, this._univerInstanceService = n, this._init();
86
86
  }
@@ -91,7 +91,7 @@ let T = class extends O {
91
91
  let r = this._matrixMap.get(e);
92
92
  r || (r = /* @__PURE__ */ new Map(), this._matrixMap.set(e, r));
93
93
  let t = r.get(n);
94
- return t || (t = new $e(), r.set(n, t)), t;
94
+ return t || (t = new je(), r.set(n, t)), t;
95
95
  }
96
96
  _ensureCommentLocationMap(e, n) {
97
97
  let r = this._locationMap.get(e);
@@ -117,8 +117,8 @@ let T = class extends O {
117
117
  }
118
118
  }
119
119
  _addComment(e, n, r) {
120
- const t = y(r.ref), i = r.parentId, { row: s, column: a } = t, c = r.id, { matrix: m, locationMap: u } = this._ensure(e, n);
121
- !i && s >= 0 && a >= 0 && (m.setValue(s, a, c), u.set(c, { row: s, column: a })), this._commentUpdate$.next({
120
+ const t = y(r.ref), i = r.parentId, { row: s, column: a } = t, c = r.id, { matrix: d, locationMap: u } = this._ensure(e, n);
121
+ !i && s >= 0 && a >= 0 && (d.setValue(s, a, c), u.set(c, { row: s, column: a })), this._commentUpdate$.next({
122
122
  unitId: e,
123
123
  subUnitId: n,
124
124
  payload: r,
@@ -130,7 +130,7 @@ let T = class extends O {
130
130
  this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe((e) => {
131
131
  const { unitId: n, subUnitId: r } = e;
132
132
  try {
133
- if (this._univerInstanceService.getUnitType(n) !== S.UNIVER_SHEET)
133
+ if (this._univerInstanceService.getUnitType(n) !== g.UNIVER_SHEET)
134
134
  return;
135
135
  } catch {
136
136
  }
@@ -143,8 +143,8 @@ let T = class extends O {
143
143
  case "delete": {
144
144
  const { isRoot: s, comment: a } = e.payload, c = y(a.ref);
145
145
  if (s) {
146
- const { row: m, column: u } = c;
147
- m >= 0 && u >= 0 && t.realDeleteValue(m, u);
146
+ const { row: d, column: u } = c;
147
+ d >= 0 && u >= 0 && t.realDeleteValue(d, u);
148
148
  }
149
149
  this._commentUpdate$.next({
150
150
  ...e,
@@ -167,8 +167,8 @@ let T = class extends O {
167
167
  const s = y(e.payload.ref), { commentId: a } = e.payload, c = i.get(a);
168
168
  if (!c)
169
169
  return;
170
- const { row: m, column: u } = c;
171
- t.getValue(m, u) === a && (t.realDeleteValue(m, u), i.delete(a)), s.row >= 0 && s.column >= 0 && (t.setValue(s.row, s.column, a), i.set(a, { row: s.row, column: s.column })), this._commentUpdate$.next({
170
+ const { row: d, column: u } = c;
171
+ t.getValue(d, u) === a && (t.realDeleteValue(d, u), i.delete(a)), s.row >= 0 && s.column >= 0 && (t.setValue(s.row, s.column, a), i.set(a, { row: s.row, column: s.column })), this._commentUpdate$.next({
172
172
  ...e,
173
173
  ...s
174
174
  });
@@ -196,22 +196,22 @@ let T = class extends O {
196
196
  return !!(s && !s.resolved);
197
197
  }
198
198
  };
199
- T = bt([
200
- me(0, h(G)),
201
- me(1, $)
199
+ T = Rt([
200
+ de(0, h(G)),
201
+ de(1, $)
202
202
  ], T);
203
- const ye = "univer.sheet.thread-comment-modal", te = "comment-single", Ue = "univer.sheet.thread-comment";
204
- var Tt = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, yt = (o, e, n, r) => {
205
- for (var t = r > 1 ? void 0 : r ? wt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
203
+ const Ee = "univer.sheet.thread-comment-modal", te = "comment-single", $e = "univer.sheet.thread-comment";
204
+ var Et = Object.defineProperty, $t = Object.getOwnPropertyDescriptor, xt = (o, e, n, r) => {
205
+ for (var t = r > 1 ? void 0 : r ? $t(e, n) : e, i = o.length - 1, s; i >= 0; i--)
206
206
  (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
207
- return r && t && Tt(e, n, t), t;
208
- }, de = (o, e) => (n, r) => e(n, r, o);
207
+ return r && t && Et(e, n, t), t;
208
+ }, me = (o, e) => (n, r) => e(n, r, o);
209
209
  let U = class extends O {
210
210
  constructor(e, n) {
211
211
  super();
212
212
  _(this, "_lastPopup", null);
213
213
  _(this, "_activePopup");
214
- _(this, "_activePopup$", new pt(null));
214
+ _(this, "_activePopup$", new gt(null));
215
215
  _(this, "activePopup$", this._activePopup$.asObservable());
216
216
  this._canvasPopupManagerService = e, this._zenZoneService = n, this._initZenVisible();
217
217
  }
@@ -224,9 +224,9 @@ let U = class extends O {
224
224
  }));
225
225
  }
226
226
  showPopup(e, n) {
227
- var m;
227
+ var d;
228
228
  const { row: r, col: t, unitId: i, subUnitId: s } = e;
229
- if (this._activePopup && r === this._activePopup.row && t === this._activePopup.col && i === this._activePopup.unitId && s === ((m = this.activePopup) == null ? void 0 : m.subUnitId)) {
229
+ if (this._activePopup && r === this._activePopup.row && t === this._activePopup.col && i === this._activePopup.unitId && s === ((d = this.activePopup) == null ? void 0 : d.subUnitId)) {
230
230
  this._activePopup = e, this._activePopup$.next(e);
231
231
  return;
232
232
  }
@@ -237,7 +237,7 @@ let U = class extends O {
237
237
  r,
238
238
  t,
239
239
  {
240
- componentKey: ye,
240
+ componentKey: Ee,
241
241
  onClickOutside: () => {
242
242
  this.hidePopup();
243
243
  },
@@ -250,7 +250,7 @@ let U = class extends O {
250
250
  );
251
251
  if (!a)
252
252
  throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");
253
- const c = new xe();
253
+ const c = new Ve();
254
254
  c.add(a), c.add({
255
255
  dispose: () => {
256
256
  n == null || n();
@@ -267,88 +267,88 @@ let U = class extends O {
267
267
  }, this._activePopup$.next(this._activePopup));
268
268
  }
269
269
  };
270
- U = yt([
271
- de(0, h(rt)),
272
- de(1, Fe)
270
+ U = xt([
271
+ me(0, h(ct)),
272
+ me(1, Ge)
273
273
  ], U);
274
- const Ut = () => {
274
+ const Dt = () => {
275
275
  const o = w($), e = w(U), n = oe(e.activePopup$), r = w(T);
276
276
  if (oe(r.commentUpdate$), !n)
277
277
  return null;
278
- const { row: t, col: i, unitId: s, subUnitId: a, trigger: c } = n, m = r.getByLocation(s, a, t, i), u = `${_e.chatAtABC(i)}${t + 1}`, l = () => {
278
+ const { row: t, col: i, unitId: s, subUnitId: a, trigger: c } = n, d = r.getByLocation(s, a, t, i), u = `${_e.chatAtABC(i)}${t + 1}`, p = () => {
279
279
  e.hidePopup();
280
- }, R = (g) => {
280
+ }, R = (S) => {
281
281
  var I, M, E;
282
- return (E = (M = (I = o.getCurrentUnitForType(S.UNIVER_SHEET)) == null ? void 0 : I.getSheetBySheetId(g)) == null ? void 0 : M.getName()) != null ? E : "";
282
+ return (E = (M = (I = o.getCurrentUnitForType(g.UNIVER_SHEET)) == null ? void 0 : I.getSheetBySheetId(S)) == null ? void 0 : M.getName()) != null ? E : "";
283
283
  };
284
- return /* @__PURE__ */ ge.createElement(
285
- Ae,
284
+ return /* @__PURE__ */ be.createElement(
285
+ We,
286
286
  {
287
287
  onClick: () => {
288
288
  e.persistPopup();
289
289
  },
290
290
  prefix: "cell",
291
- id: m,
291
+ id: d,
292
292
  unitId: s,
293
293
  subUnitId: a,
294
- type: S.UNIVER_SHEET,
294
+ type: g.UNIVER_SHEET,
295
295
  refStr: u,
296
- onClose: l,
296
+ onClose: p,
297
297
  getSubUnitName: R,
298
298
  autoFocus: c === "context-menu"
299
299
  }
300
300
  );
301
- }, Y = {
302
- type: Ne.OPERATION,
301
+ }, K = {
302
+ type: Ae.OPERATION,
303
303
  id: "sheets.operation.show-comment-modal",
304
304
  handler(o) {
305
305
  var M;
306
- const e = o.get(Ye), n = o.get($), r = o.get(U), t = o.get(ee), i = (M = e.getFirst()) == null ? void 0 : M.primary, s = e.getCurrent(), a = o.get(T);
306
+ const e = o.get(Qe), n = o.get($), r = o.get(U), t = o.get(ee), i = (M = e.getFirst()) == null ? void 0 : M.primary, s = e.getCurrent(), a = o.get(T);
307
307
  if (!s || !i)
308
308
  return !1;
309
- const { unitId: c, sheetId: m } = s, u = ke(n, { unitId: c, subUnitId: m });
309
+ const { unitId: c, sheetId: d } = s, u = et(n, { unitId: c, subUnitId: d });
310
310
  if (!u)
311
311
  return !1;
312
- const { workbook: l, worksheet: R } = u, g = {
313
- workbook: l,
312
+ const { workbook: p, worksheet: R } = u, S = {
313
+ workbook: p,
314
314
  worksheet: R,
315
315
  unitId: c,
316
- subUnitId: m,
316
+ subUnitId: d,
317
317
  row: i.actualRow,
318
318
  col: i.startColumn
319
319
  };
320
- r.showPopup(g);
321
- const I = a.getByLocation(c, m, i.actualRow, i.startColumn);
320
+ r.showPopup(S);
321
+ const I = a.getByLocation(c, d, i.actualRow, i.startColumn);
322
322
  return I && t.setActiveComment({
323
323
  unitId: c,
324
- subUnitId: m,
324
+ subUnitId: d,
325
325
  commentId: I,
326
326
  trigger: "context-menu"
327
327
  }), !0;
328
328
  }
329
- }, Ot = () => {
330
- const o = w(ot), e = w($), n = w(G), r = w(U), t = e.getCurrentUnitForType(S.UNIVER_SHEET);
329
+ }, Nt = () => {
330
+ const o = w(dt), e = w($), n = w(G), r = w(U), t = e.getCurrentUnitForType(g.UNIVER_SHEET);
331
331
  if (!t)
332
332
  return null;
333
- const i = t.getUnitId(), s = w(Q), a = ut(() => t.activeSheet$.pipe(_t((d) => d == null ? void 0 : d.getSheetId())), [t.activeSheet$]), c = ae(a, t.getActiveSheet().getSheetId()), m = Me(), u = w(ee), l = ae(u.activeCommentId$), R = ce((d) => {
334
- const p = t.getSheets(), v = {};
335
- return p.forEach((C, P) => {
333
+ const i = t.getUnitId(), s = w(Q), a = vt(() => t.activeSheet$.pipe(St((m) => m == null ? void 0 : m.getSheetId())), [t.activeSheet$]), c = ae(a, t.getActiveSheet().getSheetId()), d = we(), u = w(ee), p = ae(u.activeCommentId$), R = ce((m) => {
334
+ const l = t.getSheets(), v = {};
335
+ return l.forEach((C, P) => {
336
336
  v[C.getSheetId()] = P;
337
- }), d.map((C) => {
337
+ }), m.map((C) => {
338
338
  var ne;
339
- const P = y(C.ref), Oe = [(ne = v[C.subUnitId]) != null ? ne : 0, P.row, P.column];
340
- return { ...C, p: Oe };
339
+ const P = y(C.ref), xe = [(ne = v[C.subUnitId]) != null ? ne : 0, P.row, P.column];
340
+ return { ...C, p: xe };
341
341
  }).sort((C, P) => C.p[0] === P.p[0] ? C.p[1] === P.p[1] ? C.p[2] - P.p[2] : C.p[1] - P.p[1] : C.p[0] - P.p[0]);
342
- }, [t]), g = ce((d) => {
343
- if (d.unitId === i && d.subUnitId === c && !d.resolved) {
344
- const { row: p, column: v } = y(d.ref);
345
- if (!Number.isNaN(p) && !Number.isNaN(v))
342
+ }, [t]), S = ce((m) => {
343
+ if (m.unitId === i && m.subUnitId === c && !m.resolved) {
344
+ const { row: l, column: v } = y(m.ref);
345
+ if (!Number.isNaN(l) && !Number.isNaN(v))
346
346
  return o.addShape({
347
347
  range: {
348
348
  startColumn: v,
349
349
  endColumn: v,
350
- startRow: p,
351
- endRow: p
350
+ startRow: l,
351
+ endRow: l
352
352
  },
353
353
  style: {
354
354
  hasAutoFill: !1,
@@ -360,34 +360,34 @@ const Ut = () => {
360
360
  primary: null
361
361
  });
362
362
  }
363
- }, [o, c, i]), I = (d) => {
364
- var p, v;
365
- return (v = (p = t.getSheetBySheetId(d)) == null ? void 0 : p.getName()) != null ? v : "";
363
+ }, [o, c, i]), I = (m) => {
364
+ var l, v;
365
+ return (v = (l = t.getSheetBySheetId(m)) == null ? void 0 : l.getName()) != null ? v : "";
366
366
  }, M = () => {
367
- s.executeCommand(Y.id);
367
+ s.executeCommand(K.id);
368
368
  }, E = () => {
369
369
  r.hidePopup();
370
- }, A = (d) => {
371
- l && l.unitId === d.unitId && l.subUnitId === d.subUnitId && l.commentId === d.id || (m.current && (o.removeShape(m.current), m.current = null), m.current = g(d));
370
+ }, A = (m) => {
371
+ p && p.unitId === m.unitId && p.subUnitId === m.subUnitId && p.commentId === m.id || (d.current && (o.removeShape(d.current), d.current = null), d.current = S(m));
372
372
  }, L = () => {
373
- m.current && (o.removeShape(m.current), m.current = null);
373
+ d.current && (o.removeShape(d.current), d.current = null);
374
374
  };
375
- return ht(() => {
376
- if (!l)
375
+ return ft(() => {
376
+ if (!p)
377
377
  return;
378
- const d = n.getComment(l.unitId, l.subUnitId, l.commentId);
379
- if (!d)
378
+ const m = n.getComment(p.unitId, p.subUnitId, p.commentId);
379
+ if (!m)
380
380
  return;
381
- const p = g(d);
381
+ const l = S(m);
382
382
  return () => {
383
- p && o.removeShape(p);
383
+ l && o.removeShape(l);
384
384
  };
385
- }, [g, l, n, o]), /* @__PURE__ */ ge.createElement(
386
- Le,
385
+ }, [S, p, n, o]), /* @__PURE__ */ be.createElement(
386
+ Fe,
387
387
  {
388
388
  unitId: i,
389
389
  subUnitId$: a,
390
- type: S.UNIVER_SHEET,
390
+ type: g.UNIVER_SHEET,
391
391
  onAdd: M,
392
392
  getSubUnitName: I,
393
393
  onResolve: E,
@@ -396,50 +396,54 @@ const Ut = () => {
396
396
  onItemLeave: L
397
397
  }
398
398
  );
399
- }, Rt = {
400
- sheetThreadComment: {
401
- menu: {
402
- addComment: "添加评论",
403
- commentManagement: "评论管理"
404
- }
405
- }
406
- }, Et = (o) => ({
407
- id: Y.id,
399
+ }, jt = (o) => ({
400
+ id: K.id,
408
401
  type: ve.BUTTON,
409
402
  positions: [fe.CONTEXT_MENU],
410
403
  icon: te,
411
404
  title: "sheetThreadComment.menu.addComment",
412
- hidden$: Ce(o, S.UNIVER_SHEET)
413
- }), $t = (o) => ({
414
- id: He.id,
405
+ hidden$: Ce(o, g.UNIVER_SHEET),
406
+ disabled$: Pe(o, {
407
+ workbookTypes: [ge],
408
+ worksheetTypes: [Se],
409
+ rangeTypes: [Ie]
410
+ })
411
+ }), Vt = (o) => ({
412
+ id: Ze.id,
415
413
  type: ve.BUTTON,
416
414
  icon: te,
417
415
  tooltip: "sheetThreadComment.menu.commentManagement",
418
416
  positions: fe.TOOLBAR_START,
419
- hidden$: Ce(o, S.UNIVER_SHEET)
420
- }), xt = {
421
- id: Y.id,
422
- binding: Ze.M | ie.CTRL_COMMAND | ie.ALT,
423
- preconditions: it
417
+ group: Ye.TOOLBAR_OTHERS,
418
+ disabled$: Pe(o, {
419
+ workbookTypes: [ge],
420
+ worksheetTypes: [Se],
421
+ rangeTypes: [Ie]
422
+ }),
423
+ hidden$: Ce(o, g.UNIVER_SHEET)
424
+ }), At = {
425
+ id: K.id,
426
+ binding: Ke.M | ie.CTRL_COMMAND | ie.ALT,
427
+ preconditions: mt
424
428
  };
425
- var Nt = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor, jt = (o, e, n, r) => {
426
- for (var t = r > 1 ? void 0 : r ? Dt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
429
+ var Lt = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, Bt = (o, e, n, r) => {
430
+ for (var t = r > 1 ? void 0 : r ? Ht(e, n) : e, i = o.length - 1, s; i >= 0; i--)
427
431
  (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
428
- return r && t && Nt(e, n, t), t;
432
+ return r && t && Lt(e, n, t), t;
429
433
  }, b = (o, e) => (n, r) => e(n, r, o);
430
- const Vt = {};
434
+ const Wt = {};
431
435
  let j = class extends O {
432
- constructor(o, e, n, r, t, i, s, a, c, m, u) {
433
- super(), this._config = o, this._menuService = e, this._injector = n, this._componentManager = r, this._localeService = t, this._commandService = i, this._sheetsThreadCommentPopupService = s, this._sheetsThreadCommentModel = a, this._threadCommentPanelService = c, this._shortcutService = m, this._univerInstanceService = u, this._initMenu(), this._initShortcut(), this._initComponent(), this._initLocale(), this._initCommandListener(), this._initPanelListener();
436
+ constructor(o, e, n, r, t, i, s, a, c, d, u) {
437
+ super(), this._config = o, this._menuService = e, this._injector = n, this._componentManager = r, this._localeService = t, this._commandService = i, this._sheetsThreadCommentPopupService = s, this._sheetsThreadCommentModel = a, this._threadCommentPanelService = c, this._shortcutService = d, this._univerInstanceService = u, this._initMenu(), this._initShortcut(), this._initComponent(), this._initCommandListener(), this._initPanelListener();
434
438
  }
435
439
  _initShortcut() {
436
- this._shortcutService.registerShortcut(xt);
440
+ this._shortcutService.registerShortcut(At);
437
441
  }
438
442
  _initCommandListener() {
439
443
  this._commandService.onCommandExecuted((o) => {
440
- if (o.id === qe.id) {
444
+ if (o.id === tt.id) {
441
445
  const e = o.params, { unitId: n, subUnitId: r, selections: t, type: i } = e;
442
- if ((i === Xe.MOVE_END || i === void 0) && t[0].primary) {
446
+ if ((i === nt.MOVE_END || i === void 0) && t[0].primary) {
443
447
  const s = t[0].primary.actualRow, a = t[0].primary.actualColumn;
444
448
  if (!this._sheetsThreadCommentModel.showCommentMarker(n, r, s, a)) {
445
449
  this._threadCommentPanelService.activeCommentId && this._commandService.executeCommand(re.id);
@@ -465,50 +469,47 @@ let j = class extends O {
465
469
  _initMenu() {
466
470
  const { menu: o = {} } = this._config;
467
471
  [
468
- Et,
469
- $t
472
+ jt,
473
+ Vt
470
474
  ].forEach((e) => {
471
475
  this._menuService.addMenuItem(e(this._injector), o);
472
476
  });
473
477
  }
474
478
  _initComponent() {
475
479
  [
476
- [ye, Ut],
477
- [Be, Ot],
478
- [te, we]
480
+ [Ee, Dt],
481
+ [ke, Nt],
482
+ [te, Re]
479
483
  ].forEach(([o, e]) => {
480
484
  this._componentManager.register(o, e);
481
485
  });
482
486
  }
483
- _initLocale() {
484
- this._localeService.load({ zhCN: Rt });
485
- }
486
487
  _initPanelListener() {
487
488
  this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async (o) => {
488
489
  if (o) {
489
490
  const { unitId: e, subUnitId: n, commentId: r, trigger: t } = o, i = this._sheetsThreadCommentModel.getComment(e, n, r);
490
491
  if (!i || i.resolved)
491
492
  return;
492
- const s = this._univerInstanceService.getCurrentUnitForType(S.UNIVER_SHEET);
493
+ const s = this._univerInstanceService.getCurrentUnitForType(g.UNIVER_SHEET);
493
494
  if (!s || s.getUnitId() !== e)
494
495
  return;
495
- s.getActiveSheet().getSheetId() !== n && await this._commandService.executeCommand(Je.id, {
496
+ s.getActiveSheet().getSheetId() !== n && await this._commandService.executeCommand(rt.id, {
496
497
  unitId: e,
497
498
  subUnitId: n
498
499
  });
499
- const m = y(i.ref);
500
- await this._commandService.executeCommand(st.id, {
500
+ const d = y(i.ref);
501
+ await this._commandService.executeCommand(ut.id, {
501
502
  range: {
502
- startColumn: m.column,
503
- endColumn: m.column,
504
- startRow: m.row,
505
- endRow: m.row
503
+ startColumn: d.column,
504
+ endColumn: d.column,
505
+ startRow: d.row,
506
+ endRow: d.row
506
507
  }
507
508
  }), this._sheetsThreadCommentPopupService.showPopup({
508
509
  unitId: e,
509
510
  subUnitId: n,
510
- row: m.row,
511
- col: m.column,
511
+ row: d.row,
512
+ col: d.column,
512
513
  commentId: i.id,
513
514
  trigger: t
514
515
  });
@@ -517,24 +518,24 @@ let j = class extends O {
517
518
  }));
518
519
  }
519
520
  };
520
- j = jt([
521
- x(N.Starting, j),
522
- b(1, Ke),
523
- b(2, h(pe)),
524
- b(3, h(ze)),
525
- b(4, h(De)),
521
+ j = Bt([
522
+ x(D.Starting, j),
523
+ b(1, Xe),
524
+ b(2, h(le)),
525
+ b(3, h(qe)),
526
+ b(4, h(Le)),
526
527
  b(5, Q),
527
528
  b(6, h(U)),
528
529
  b(7, h(T)),
529
530
  b(8, h(ee)),
530
- b(9, Ge),
531
+ b(9, Je),
531
532
  b(10, $)
532
533
  ], j);
533
- var At = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, Ht = (o, e, n, r) => {
534
- for (var t = r > 1 ? void 0 : r ? Lt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
534
+ var Ft = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, kt = (o, e, n, r) => {
535
+ for (var t = r > 1 ? void 0 : r ? Zt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
535
536
  (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
536
- return r && t && At(e, n, t), t;
537
- }, k = (o, e) => (n, r) => e(n, r, o);
537
+ return r && t && Ft(e, n, t), t;
538
+ }, Y = (o, e) => (n, r) => e(n, r, o);
538
539
  let B = class extends O {
539
540
  constructor(e, n, r) {
540
541
  super();
@@ -551,7 +552,7 @@ let B = class extends O {
551
552
  startRow: r.row,
552
553
  endRow: r.row
553
554
  }, s = (a) => {
554
- const c = et(i, a);
555
+ const c = it(i, a);
555
556
  return c && c.startColumn === i.startColumn && c.startRow === i.startRow ? {
556
557
  undos: [],
557
558
  redos: []
@@ -588,7 +589,7 @@ let B = class extends O {
588
589
  }
589
590
  }],
590
591
  undos: [{
591
- id: K.id,
592
+ id: z.id,
592
593
  params: {
593
594
  unitId: e,
594
595
  subUnitId: n,
@@ -609,10 +610,10 @@ let B = class extends O {
609
610
  for (const t in r) {
610
611
  const i = r[t];
611
612
  for (const s in i) {
612
- const a = i[s], c = a.ref, m = y(c);
613
+ const a = i[s], c = a.ref, d = y(c);
613
614
  this._register(n, t, {
614
615
  ...a,
615
- ...m
616
+ ...d
616
617
  });
617
618
  }
618
619
  }
@@ -651,24 +652,24 @@ let B = class extends O {
651
652
  }
652
653
  }
653
654
  })
654
- ), this.disposeWithMe(je(() => {
655
+ ), this.disposeWithMe(He(() => {
655
656
  this._disposableMap.forEach((e) => {
656
657
  e.dispose();
657
658
  }), this._disposableMap.clear();
658
659
  }));
659
660
  }
660
661
  };
661
- B = Ht([
662
- x(N.Starting, B),
663
- k(0, h(Qe)),
664
- k(1, h(T)),
665
- k(2, h(G))
662
+ B = kt([
663
+ x(D.Starting, B),
664
+ Y(0, h(ot)),
665
+ Y(1, h(T)),
666
+ Y(2, h(G))
666
667
  ], B);
667
- var Bt = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, Ft = (o, e, n, r) => {
668
- for (var t = r > 1 ? void 0 : r ? Wt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
668
+ var zt = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, Kt = (o, e, n, r) => {
669
+ for (var t = r > 1 ? void 0 : r ? Gt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
669
670
  (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
670
- return r && t && Bt(e, n, t), t;
671
- }, D = (o, e) => (n, r) => e(n, r, o);
671
+ return r && t && zt(e, n, t), t;
672
+ }, N = (o, e) => (n, r) => e(n, r, o);
672
673
  let W = class extends O {
673
674
  constructor(o, e, n, r, t) {
674
675
  super(), this._sheetInterceptorService = o, this._sheetsThreadCommentModel = e, this._univerInstanceService = n, this._sheetSkeletonManagerService = r, this._renderManagerService = t, this._initViewModelIntercept(), this._initSkeletonChange();
@@ -676,7 +677,7 @@ let W = class extends O {
676
677
  _initViewModelIntercept() {
677
678
  this.disposeWithMe(
678
679
  this._sheetInterceptorService.intercept(
679
- tt.CELL_CONTENT,
680
+ st.CELL_CONTENT,
680
681
  {
681
682
  handler: (o, e, n) => {
682
683
  const { row: r, col: t, unitId: i, subUnitId: s } = e;
@@ -698,7 +699,7 @@ let W = class extends O {
698
699
  }
699
700
  _initSkeletonChange() {
700
701
  const o = () => {
701
- const e = this._univerInstanceService.getCurrentUnitForType(S.UNIVER_SHEET);
702
+ const e = this._univerInstanceService.getCurrentUnitForType(g.UNIVER_SHEET);
702
703
  if (!e)
703
704
  return;
704
705
  const n = e.getUnitId(), r = e.getActiveSheet().getSheetId(), t = this._sheetSkeletonManagerService.getOrCreateSkeleton({ unitId: n, sheetId: r }), i = this._renderManagerService.getRenderById(n);
@@ -709,20 +710,20 @@ let W = class extends O {
709
710
  }));
710
711
  }
711
712
  };
712
- W = Ft([
713
- x(N.Ready, W),
714
- D(0, h(Se)),
715
- D(1, h(T)),
716
- D(2, $),
717
- D(3, h(at)),
718
- D(4, vt)
713
+ W = Kt([
714
+ x(D.Ready, W),
715
+ N(0, h(Me)),
716
+ N(1, h(T)),
717
+ N(2, $),
718
+ N(3, h(ht)),
719
+ N(4, Mt)
719
720
  ], W);
720
- var Zt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, Kt = (o, e, n, r) => {
721
- for (var t = r > 1 ? void 0 : r ? zt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
721
+ var Yt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, Xt = (o, e, n, r) => {
722
+ for (var t = r > 1 ? void 0 : r ? qt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
722
723
  (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
723
- return r && t && Zt(e, n, t), t;
724
+ return r && t && Yt(e, n, t), t;
724
725
  }, ue = (o, e) => (n, r) => e(n, r, o);
725
- const Gt = (o, e, n) => {
726
+ const Jt = (o, e, n) => {
726
727
  const r = y(o), t = n.row - e.row, i = n.column - e.column, s = {
727
728
  startColumn: r.column + i,
728
729
  startRow: r.row + t,
@@ -741,7 +742,7 @@ let F = class extends O {
741
742
  _initClipboardHook() {
742
743
  this.disposeWithMe(
743
744
  this._sheetClipboardService.addClipboardHook({
744
- id: Ue,
745
+ id: $e,
745
746
  onBeforeCopy: (e, n, r) => {
746
747
  this._copyInfo = {
747
748
  unitId: e,
@@ -755,56 +756,56 @@ let F = class extends O {
755
756
  row: a.rows[0],
756
757
  column: a.cols[0]
757
758
  };
758
- if (t.copyType === mt.CUT && this._copyInfo) {
759
- const { range: m, unitId: u, subUnitId: l } = this._copyInfo, R = {
760
- row: m.startRow,
761
- column: m.startColumn
759
+ if (t.copyType === lt.CUT && this._copyInfo) {
760
+ const { range: d, unitId: u, subUnitId: p } = this._copyInfo, R = {
761
+ row: d.startRow,
762
+ column: d.startColumn
762
763
  };
763
- if (!(i === u && s === l)) {
764
- const g = [];
765
- Ve.foreach(m, (d, p) => {
766
- const v = this._sheetsThreadCommentModel.getCommentWithChildren(u, l, d, p);
767
- v && g.push(v);
764
+ if (!(i === u && s === p)) {
765
+ const S = [];
766
+ Be.foreach(d, (m, l) => {
767
+ const v = this._sheetsThreadCommentModel.getCommentWithChildren(u, p, m, l);
768
+ v && S.push(v);
768
769
  });
769
- const I = [], M = [], E = [], A = [], L = (d) => {
770
+ const I = [], M = [], E = [], A = [], L = (m) => {
770
771
  I.unshift({
771
772
  id: V.id,
772
773
  params: {
773
774
  unitId: u,
774
- subUnitId: l,
775
- commentId: d.id
775
+ subUnitId: p,
776
+ commentId: m.id
776
777
  }
777
778
  }), E.push({
778
- id: K.id,
779
+ id: z.id,
779
780
  params: {
780
781
  unitId: i,
781
782
  subUnitId: s,
782
783
  comment: {
783
- ...d,
784
- ref: Gt(d.ref, R, c),
784
+ ...m,
785
+ ref: Jt(m.ref, R, c),
785
786
  unitId: i,
786
787
  subUnitId: s
787
788
  }
788
789
  }
789
790
  }), M.push({
790
- id: K.id,
791
+ id: z.id,
791
792
  params: {
792
793
  unitId: u,
793
- subUnitId: l,
794
- comment: d
794
+ subUnitId: p,
795
+ comment: m
795
796
  }
796
797
  }), A.unshift({
797
798
  id: V.id,
798
799
  params: {
799
800
  unitId: i,
800
801
  subUnitId: s,
801
- commentId: d.id
802
+ commentId: m.id
802
803
  }
803
804
  });
804
805
  };
805
- return g.forEach((d) => {
806
- L(d.root), d.children.forEach((p) => {
807
- L(p);
806
+ return S.forEach((m) => {
807
+ L(m.root), m.children.forEach((l) => {
808
+ L(l);
808
809
  });
809
810
  }), {
810
811
  redos: [...I, ...E],
@@ -821,53 +822,55 @@ let F = class extends O {
821
822
  );
822
823
  }
823
824
  };
824
- F = Kt([
825
- x(N.Rendered, F),
826
- ue(0, h(ct)),
825
+ F = Xt([
826
+ x(D.Rendered, F),
827
+ ue(0, h(pt)),
827
828
  ue(1, h(T))
828
829
  ], F);
829
- var Yt = Object.defineProperty, kt = Object.getOwnPropertyDescriptor, qt = (o, e, n, r) => {
830
- for (var t = r > 1 ? void 0 : r ? kt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
830
+ var Qt = Object.defineProperty, en = Object.getOwnPropertyDescriptor, tn = (o, e, n, r) => {
831
+ for (var t = r > 1 ? void 0 : r ? en(e, n) : e, i = o.length - 1, s; i >= 0; i--)
831
832
  (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
832
- return r && t && Yt(e, n, t), t;
833
+ return r && t && Qt(e, n, t), t;
833
834
  }, q = (o, e) => (n, r) => e(n, r, o);
834
835
  let Z = class extends O {
835
836
  constructor(o, e, n) {
836
837
  super(), this._hoverManagerService = o, this._sheetsThreadCommentPopupService = e, this._sheetsThreadCommentModel = n, this._initHoverEvent();
837
838
  }
838
839
  _initHoverEvent() {
839
- this._hoverManagerService.currentCell$.subscribe((o) => {
840
- const e = this._sheetsThreadCommentPopupService.activePopup;
841
- if (o && (e && e.temp || !e)) {
842
- const { location: n } = o, { unitId: r, subUnitId: t, row: i, col: s } = n, a = this._sheetsThreadCommentModel.getByLocation(r, t, i, s);
843
- if (a) {
844
- const c = this._sheetsThreadCommentModel.getComment(r, t, a);
845
- c && !c.resolved && this._sheetsThreadCommentPopupService.showPopup({
846
- unitId: r,
847
- subUnitId: t,
848
- row: i,
849
- col: s,
850
- commentId: a,
851
- temp: !0
852
- });
853
- } else
854
- e && this._sheetsThreadCommentPopupService.hidePopup();
855
- }
856
- });
840
+ this.disposeWithMe(
841
+ this._hoverManagerService.currentCell$.pipe(It(100)).subscribe((o) => {
842
+ const e = this._sheetsThreadCommentPopupService.activePopup;
843
+ if (o && (e && e.temp || !e)) {
844
+ const { location: n } = o, { unitId: r, subUnitId: t, row: i, col: s } = n, a = this._sheetsThreadCommentModel.getByLocation(r, t, i, s);
845
+ if (a) {
846
+ const c = this._sheetsThreadCommentModel.getComment(r, t, a);
847
+ c && !c.resolved && this._sheetsThreadCommentPopupService.showPopup({
848
+ unitId: r,
849
+ subUnitId: t,
850
+ row: i,
851
+ col: s,
852
+ commentId: a,
853
+ temp: !0
854
+ });
855
+ } else
856
+ e && this._sheetsThreadCommentPopupService.hidePopup();
857
+ }
858
+ })
859
+ );
857
860
  }
858
861
  };
859
- Z = qt([
860
- x(N.Rendered, Z),
861
- q(0, h(dt)),
862
+ Z = tn([
863
+ x(D.Rendered, Z),
864
+ q(0, h(_t)),
862
865
  q(1, h(U)),
863
866
  q(2, h(T))
864
867
  ], Z);
865
- var Xt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, Qt = (o, e, n, r) => {
866
- for (var t = r > 1 ? void 0 : r ? Jt(e, n) : e, i = o.length - 1, s; i >= 0; i--)
868
+ var nn = Object.defineProperty, rn = Object.getOwnPropertyDescriptor, on = (o, e, n, r) => {
869
+ for (var t = r > 1 ? void 0 : r ? rn(e, n) : e, i = o.length - 1, s; i >= 0; i--)
867
870
  (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
868
- return r && t && Xt(e, n, t), t;
871
+ return r && t && nn(e, n, t), t;
869
872
  }, X = (o, e) => (n, r) => e(n, r, o);
870
- let z = class extends O {
873
+ let k = class extends O {
871
874
  constructor(o, e, n) {
872
875
  super(), this._sheetInterceptorService = o, this._univerInstanceService = e, this._threadCommentModel = n, this._initSheetChange();
873
876
  }
@@ -875,8 +878,8 @@ let z = class extends O {
875
878
  this.disposeWithMe(
876
879
  this._sheetInterceptorService.interceptCommand({
877
880
  getMutations: (o) => {
878
- if (o.id === nt.id) {
879
- const e = o.params, n = e.unitId ? this._univerInstanceService.getUnit(e.unitId) : this._univerInstanceService.getCurrentUnitForType(S.UNIVER_SHEET);
881
+ if (o.id === at.id) {
882
+ const e = o.params, n = e.unitId ? this._univerInstanceService.getUnit(e.unitId) : this._univerInstanceService.getCurrentUnitForType(g.UNIVER_SHEET);
880
883
  if (!n)
881
884
  return { redos: [], undos: [] };
882
885
  const r = n.getUnitId(), t = e.subUnitId || n.getActiveSheet().getSheetId(), { commentMap: i } = this._threadCommentModel.ensureMap(r, t), s = Array.from(Object.keys(i)), a = Array.from(Object.values(i)), c = s.map((u) => ({
@@ -886,15 +889,15 @@ let z = class extends O {
886
889
  subUnitId: t,
887
890
  commentId: u
888
891
  }
889
- })), m = a.map((u) => ({
890
- id: K.id,
892
+ })), d = a.map((u) => ({
893
+ id: z.id,
891
894
  params: {
892
895
  unitId: r,
893
896
  subUnitId: t,
894
897
  comment: u
895
898
  }
896
899
  }));
897
- return { redos: c, undos: m };
900
+ return { redos: c, undos: d };
898
901
  }
899
902
  return { redos: [], undos: [] };
900
903
  }
@@ -902,22 +905,22 @@ let z = class extends O {
902
905
  );
903
906
  }
904
907
  };
905
- z = Qt([
906
- x(N.Ready, z),
907
- X(0, h(Se)),
908
+ k = on([
909
+ x(D.Ready, k),
910
+ X(0, h(Me)),
908
911
  X(1, $),
909
912
  X(2, h(G))
910
- ], z);
911
- var en = Object.defineProperty, tn = Object.getOwnPropertyDescriptor, nn = (o, e, n, r) => {
912
- for (var t = r > 1 ? void 0 : r ? tn(e, n) : e, i = o.length - 1, s; i >= 0; i--)
913
+ ], k);
914
+ var sn = Object.defineProperty, an = Object.getOwnPropertyDescriptor, cn = (o, e, n, r) => {
915
+ for (var t = r > 1 ? void 0 : r ? an(e, n) : e, i = o.length - 1, s; i >= 0; i--)
913
916
  (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
914
- return r && t && en(e, n, t), t;
917
+ return r && t && sn(e, n, t), t;
915
918
  }, he = (o, e) => (n, r) => e(n, r, o), H;
916
- let le = (H = class extends We {
919
+ let pe = (H = class extends ze {
917
920
  constructor(e = {}, n, r) {
918
921
  super(e, n, r);
919
922
  _(this, "_pluginConfig");
920
- this._injector = n, this._commandService = r, this._pluginConfig = _e.deepMerge({}, Vt, e);
923
+ this._injector = n, this._commandService = r, this._pluginConfig = _e.deepMerge({}, Wt, e);
921
924
  }
922
925
  onStarting(e) {
923
926
  super.onStarting(e), [
@@ -932,35 +935,35 @@ let le = (H = class extends We {
932
935
  [W],
933
936
  [F],
934
937
  [Z],
935
- [z],
938
+ [k],
936
939
  [U]
937
940
  ].forEach((n) => {
938
941
  this._injector.add(n);
939
- }), [Y].forEach((n) => {
942
+ }), [K].forEach((n) => {
940
943
  this._commandService.registerCommand(n);
941
944
  });
942
945
  }
943
- }, _(H, "pluginName", Ue), _(H, "type", S.UNIVER_SHEET), H);
944
- le = nn([
945
- he(1, h(pe)),
946
+ }, _(H, "pluginName", $e), _(H, "type", g.UNIVER_SHEET), H);
947
+ pe = cn([
948
+ he(1, h(le)),
946
949
  he(2, h(Q))
947
- ], le);
950
+ ], pe);
948
951
  export {
949
- Mn as ICommandService,
950
- On as IThreadCommentDataSourceService,
951
- wn as IThreadCommentMentionDataService,
952
- Sn as Inject,
953
- gn as Injector,
954
- Pn as Plugin,
955
- Ue as SHEETS_THREAD_COMMENT,
952
+ yn as ICommandService,
953
+ Dn as IThreadCommentDataSourceService,
954
+ En as IThreadCommentMentionDataService,
955
+ bn as Inject,
956
+ Tn as Injector,
957
+ Un as Plugin,
958
+ $e as SHEETS_THREAD_COMMENT,
956
959
  j as SheetsThreadCommentController,
957
960
  F as SheetsThreadCommentCopyPasteController,
958
961
  Z as SheetsThreadCommentHoverController,
959
962
  T as SheetsThreadCommentModel,
960
963
  U as SheetsThreadCommentPopupService,
961
964
  B as SheetsThreadCommentRefRangeController,
962
- z as ThreadCommentRemoveSheetsController,
963
- bn as UniverInstanceType,
964
- le as UniverSheetsThreadCommentPlugin,
965
- yn as UniverThreadCommentUIPlugin
965
+ k as ThreadCommentRemoveSheetsController,
966
+ On as UniverInstanceType,
967
+ pe as UniverSheetsThreadCommentPlugin,
968
+ $n as UniverThreadCommentUIPlugin
966
969
  };