@univerjs/sheets-thread-comment 0.1.12 → 0.1.13-nightly.202406041140

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,150 +1,150 @@
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";
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";
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";
20
- var f = function() {
21
- return f = Object.assign || function(o) {
22
- for (var e, n = 1, r = arguments.length; n < r; n++) {
23
- e = arguments[n];
24
- for (var t in e)
25
- Object.prototype.hasOwnProperty.call(e, t) && (o[t] = e[t]);
1
+ var $e = Object.defineProperty;
2
+ var Ne = (o, e, t) => e in o ? $e(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var v = (o, e, t) => (Ne(o, typeof e != "symbol" ? e + "" : e, t), t);
4
+ import { Inject as h, Injector as le } from "@wendellhu/redi";
5
+ import { Inject as mn, Injector as un } from "@wendellhu/redi";
6
+ import { Disposable as R, ObjectMatrix as Ve, UniverInstanceType as g, IUniverInstanceService as x, DisposableCollection as Ae, Tools as pe, CommandType as Le, ICommandService as Q, OnLifecycle as O, LifecycleStages as $, LocaleService as De, toDisposable as He, Range as je, DependentOn as Be, Plugin as We } from "@univerjs/core";
7
+ import { ICommandService as ln, Plugin as pn, UniverInstanceType as _n } from "@univerjs/core";
8
+ import { ThreadCommentTree as Fe, ThreadCommentPanelService as ee, ThreadCommentPanel as Ze, ToggleSheetCommentPanelOperation as ze, SetActiveCommentOperation as re, THREAD_COMMENT_PANEL as Ge, UniverThreadCommentUIPlugin as Ke } from "@univerjs/thread-comment-ui";
9
+ import { IThreadCommentMentionDataService as Cn, UniverThreadCommentUIPlugin as fn } from "@univerjs/thread-comment-ui";
10
+ import { IZenZoneService as Ye, useObservable as oe, KeyCode as qe, MetaKeys as ie, MenuItemType as _e, MenuPosition as ve, getMenuHiddenObservable as Ce, MenuGroup as Xe, ComponentManager as Je, IMenuService as Qe, IShortcutService as et } from "@univerjs/ui";
11
+ import { SelectionManagerService as tt, getSheetCommandTarget as nt, WorkbookCommentPermission as fe, WorksheetViewPermission as ge, RangeProtectionPermissionEditPoint as Se, SetSelectionsOperation as rt, SelectionMoveType as ot, SetWorksheetActiveOperation as it, RefRangeService as st, handleDefaultRangeChangeWithEffectRefCommands as at, SheetInterceptorService as Ie, INTERCEPTOR_POINT as ct, RemoveSheetCommand as dt } from "@univerjs/sheets";
12
+ import { singleReferenceToGrid as w, serializeRange as J } from "@univerjs/engine-formula";
13
+ import { SheetCanvasPopManagerService as mt, IMarkSelectionService as ut, whenSheetEditorFocused as ht, getCommentDisable$ as Me, ScrollToCellCommand as lt, SheetSkeletonManagerService as pt, ISheetClipboardService as _t, COPY_TYPE as vt, HoverManagerService as Ct } from "@univerjs/sheets-ui";
14
+ import { ThreadCommentModel as G, DeleteCommentMutation as A, AddCommentMutation as Z, UpdateCommentRefMutation as se } from "@univerjs/thread-comment";
15
+ import { IThreadCommentDataSourceService as Sn } from "@univerjs/thread-comment";
16
+ import { useDependency as P, useObservable as ae } from "@wendellhu/redi/react-bindings";
17
+ import be, { forwardRef as Te, useRef as ye, createElement as Pe, useMemo as ft, useCallback as ce, useEffect as gt } from "react";
18
+ import { Subject as St, BehaviorSubject as It, map as Mt, debounceTime as bt } from "rxjs";
19
+ import { IRenderManagerService as Tt } from "@univerjs/engine-render";
20
+ var C = function() {
21
+ return C = Object.assign || function(o) {
22
+ for (var e, t = 1, r = arguments.length; t < r; t++) {
23
+ e = arguments[t];
24
+ for (var n in e)
25
+ Object.prototype.hasOwnProperty.call(e, n) && (o[n] = e[n]);
26
26
  }
27
27
  return o;
28
- }, f.apply(this, arguments);
29
- }, ft = function(o, e) {
30
- var n = {};
28
+ }, C.apply(this, arguments);
29
+ }, yt = function(o, e) {
30
+ var t = {};
31
31
  for (var r in o)
32
- Object.prototype.hasOwnProperty.call(o, r) && e.indexOf(r) < 0 && (n[r] = o[r]);
32
+ Object.prototype.hasOwnProperty.call(o, r) && e.indexOf(r) < 0 && (t[r] = o[r]);
33
33
  if (o != null && typeof Object.getOwnPropertySymbols == "function")
34
- for (var t = 0, r = Object.getOwnPropertySymbols(o); t < r.length; t++)
35
- e.indexOf(r[t]) < 0 && Object.prototype.propertyIsEnumerable.call(o, r[t]) && (n[r[t]] = o[r[t]]);
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);
34
+ for (var n = 0, r = Object.getOwnPropertySymbols(o); n < r.length; n++)
35
+ e.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(o, r[n]) && (t[r[n]] = o[r[n]]);
36
+ return t;
37
+ }, we = Te(function(o, e) {
38
+ var t = o.icon, r = o.id, n = o.className, i = o.extend, s = yt(o, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(n || "").trim(), c = ye("_".concat(Ut()));
39
+ return Ue(t, "".concat(r), { defIds: t.defIds, idSuffix: c.current }, C({ 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 Ue(o, e, t, r, n) {
42
+ return Pe(o.tag, C(C({ key: e }, Pt(o, t, n)), r), (wt(o, t).children || []).map(function(i, s) {
43
+ return Ue(i, "".concat(e, "-").concat(o.tag, "-").concat(s), t, void 0, n);
44
44
  }));
45
45
  }
46
- function Ct(o, e, n) {
47
- var r = f({}, o.attrs);
48
- n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
49
- var t = e.defIds;
50
- return !t || t.length === 0 || (o.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(i) {
46
+ function Pt(o, e, t) {
47
+ var r = C({}, o.attrs);
48
+ t != null && t.colorChannel1 && r.fill === "colorChannel1" && (r.fill = t.colorChannel1);
49
+ var n = e.defIds;
50
+ return !n || n.length === 0 || (o.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(i) {
51
51
  var s = i[0], a = i[1];
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) {
56
- var n, r = e.defIds;
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
- 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;
55
+ function wt(o, e) {
56
+ var t, r = e.defIds;
57
+ return !r || r.length === 0 ? o : o.tag === "defs" && (!((t = o.children) === null || t === void 0) && t.length) ? C(C({}, o), { children: o.children.map(function(n) {
58
+ return typeof n.attrs.id == "string" && r && r.indexOf(n.attrs.id) > -1 ? C(C({}, n), { attrs: C(C({}, n.attrs), { id: n.attrs.id + e.idSuffix }) }) : n;
59
59
  }) }) : o;
60
60
  }
61
- function gt() {
61
+ function Ut() {
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
+ we.displayName = "UniverIcon";
65
+ var Rt = { 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 Pe(we, Object.assign({}, o, {
67
67
  id: "comment-single",
68
68
  ref: e,
69
- icon: It
69
+ icon: Rt
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--)
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);
78
- let T = class extends O {
79
- constructor(e, n) {
72
+ Re.displayName = "CommentSingle";
73
+ var Et = (o, e, t, r) => {
74
+ for (var n = e, i = o.length - 1, s; i >= 0; i--)
75
+ (s = o[i]) && (n = s(n) || n);
76
+ return n;
77
+ }, de = (o, e) => (t, r) => e(t, r, o);
78
+ let y = class extends R {
79
+ constructor(e, t) {
80
80
  super();
81
- _(this, "_matrixMap", /* @__PURE__ */ new Map());
82
- _(this, "_locationMap", /* @__PURE__ */ new Map());
83
- _(this, "_commentUpdate$", new lt());
84
- _(this, "commentUpdate$", this._commentUpdate$.asObservable());
85
- this._threadCommentModel = e, this._univerInstanceService = n, this._init();
81
+ v(this, "_matrixMap", /* @__PURE__ */ new Map());
82
+ v(this, "_locationMap", /* @__PURE__ */ new Map());
83
+ v(this, "_commentUpdate$", new St());
84
+ v(this, "commentUpdate$", this._commentUpdate$.asObservable());
85
+ this._threadCommentModel = e, this._univerInstanceService = t, this._init();
86
86
  }
87
87
  _init() {
88
88
  this._initData(), this._initUpdateTransform();
89
89
  }
90
- _ensureCommentMatrix(e, n) {
90
+ _ensureCommentMatrix(e, t) {
91
91
  let r = this._matrixMap.get(e);
92
92
  r || (r = /* @__PURE__ */ new Map(), this._matrixMap.set(e, r));
93
- let t = r.get(n);
94
- return t || (t = new $e(), r.set(n, t)), t;
93
+ let n = r.get(t);
94
+ return n || (n = new Ve(), r.set(t, n)), n;
95
95
  }
96
- _ensureCommentLocationMap(e, n) {
96
+ _ensureCommentLocationMap(e, t) {
97
97
  let r = this._locationMap.get(e);
98
98
  r || (r = /* @__PURE__ */ new Map(), this._locationMap.set(e, r));
99
- let t = r.get(n);
100
- return t || (t = /* @__PURE__ */ new Map(), r.set(n, t)), t;
99
+ let n = r.get(t);
100
+ return n || (n = /* @__PURE__ */ new Map(), r.set(t, n)), n;
101
101
  }
102
- _ensure(e, n) {
103
- const r = this._ensureCommentMatrix(e, n), t = this._ensureCommentLocationMap(e, n);
104
- return { matrix: r, locationMap: t };
102
+ _ensure(e, t) {
103
+ const r = this._ensureCommentMatrix(e, t), n = this._ensureCommentLocationMap(e, t);
104
+ return { matrix: r, locationMap: n };
105
105
  }
106
106
  _initData() {
107
107
  const e = this._threadCommentModel.getAll();
108
- for (const n in e) {
109
- const r = e[n];
110
- for (const t in r) {
111
- const i = r[t];
108
+ for (const t in e) {
109
+ const r = e[t];
110
+ for (const n in r) {
111
+ const i = r[n];
112
112
  for (const s in i) {
113
113
  const a = i[s];
114
- this._addComment(n, t, a);
114
+ this._addComment(t, n, a);
115
115
  }
116
116
  }
117
117
  }
118
118
  }
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({
119
+ _addComment(e, t, r) {
120
+ const n = w(r.ref), i = r.parentId, { row: s, column: a } = n, c = r.id, { matrix: d, locationMap: u } = this._ensure(e, t);
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
- subUnitId: n,
123
+ subUnitId: t,
124
124
  payload: r,
125
125
  type: "add",
126
- ...t
126
+ ...n
127
127
  });
128
128
  }
129
129
  _initUpdateTransform() {
130
130
  this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe((e) => {
131
- const { unitId: n, subUnitId: r } = e;
131
+ const { unitId: t, subUnitId: r } = e;
132
132
  try {
133
- if (this._univerInstanceService.getUnitType(n) !== S.UNIVER_SHEET)
133
+ if (this._univerInstanceService.getUnitType(t) !== g.UNIVER_SHEET)
134
134
  return;
135
135
  } catch {
136
136
  }
137
- const { matrix: t, locationMap: i } = this._ensure(n, r);
137
+ const { matrix: n, locationMap: i } = this._ensure(t, r);
138
138
  switch (e.type) {
139
139
  case "add": {
140
140
  this._addComment(e.unitId, e.subUnitId, e.payload);
141
141
  break;
142
142
  }
143
143
  case "delete": {
144
- const { isRoot: s, comment: a } = e.payload, c = y(a.ref);
144
+ const { isRoot: s, comment: a } = e.payload, c = w(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 && n.realDeleteValue(d, u);
148
148
  }
149
149
  this._commentUpdate$.next({
150
150
  ...e,
@@ -153,10 +153,10 @@ let T = class extends O {
153
153
  break;
154
154
  }
155
155
  case "update": {
156
- const { commentId: s } = e.payload, a = this._threadCommentModel.getComment(n, r, s);
156
+ const { commentId: s } = e.payload, a = this._threadCommentModel.getComment(t, r, s);
157
157
  if (!a)
158
158
  return;
159
- const c = y(a.ref);
159
+ const c = w(a.ref);
160
160
  this._commentUpdate$.next({
161
161
  ...e,
162
162
  ...c
@@ -164,11 +164,11 @@ let T = class extends O {
164
164
  break;
165
165
  }
166
166
  case "updateRef": {
167
- const s = y(e.payload.ref), { commentId: a } = e.payload, c = i.get(a);
167
+ const s = w(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
+ n.getValue(d, u) === a && (n.realDeleteValue(d, u), i.delete(a)), s.row >= 0 && s.column >= 0 && (n.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
  });
@@ -177,43 +177,43 @@ let T = class extends O {
177
177
  }
178
178
  }));
179
179
  }
180
- getByLocation(e, n, r, t) {
181
- return this._ensureCommentMatrix(e, n).getValue(r, t);
180
+ getByLocation(e, t, r, n) {
181
+ return this._ensureCommentMatrix(e, t).getValue(r, n);
182
182
  }
183
- getComment(e, n, r) {
184
- return this._threadCommentModel.getComment(e, n, r);
183
+ getComment(e, t, r) {
184
+ return this._threadCommentModel.getComment(e, t, r);
185
185
  }
186
- getCommentWithChildren(e, n, r, t) {
187
- const s = this._ensureCommentMatrix(e, n).getValue(r, t);
186
+ getCommentWithChildren(e, t, r, n) {
187
+ const s = this._ensureCommentMatrix(e, t).getValue(r, n);
188
188
  if (s)
189
- return this._threadCommentModel.getCommentWithChildren(e, n, s);
189
+ return this._threadCommentModel.getCommentWithChildren(e, t, s);
190
190
  }
191
- showCommentMarker(e, n, r, t) {
192
- const i = this.getByLocation(e, n, r, t);
191
+ showCommentMarker(e, t, r, n) {
192
+ const i = this.getByLocation(e, t, r, n);
193
193
  if (!i)
194
194
  return !1;
195
- const s = this.getComment(e, n, i);
195
+ const s = this.getComment(e, t, i);
196
196
  return !!(s && !s.resolved);
197
197
  }
198
198
  };
199
- T = bt([
200
- me(0, h(G)),
201
- me(1, $)
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--)
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);
209
- let U = class extends O {
210
- constructor(e, n) {
199
+ y = Et([
200
+ de(0, h(G)),
201
+ de(1, x)
202
+ ], y);
203
+ const Ee = "univer.sheet.thread-comment-modal", te = "comment-single", ke = "univer.sheet.thread-comment";
204
+ var kt = (o, e, t, r) => {
205
+ for (var n = e, i = o.length - 1, s; i >= 0; i--)
206
+ (s = o[i]) && (n = s(n) || n);
207
+ return n;
208
+ }, me = (o, e) => (t, r) => e(t, r, o);
209
+ let U = class extends R {
210
+ constructor(e, t) {
211
211
  super();
212
- _(this, "_lastPopup", null);
213
- _(this, "_activePopup");
214
- _(this, "_activePopup$", new pt(null));
215
- _(this, "activePopup$", this._activePopup$.asObservable());
216
- this._canvasPopupManagerService = e, this._zenZoneService = n, this._initZenVisible();
212
+ v(this, "_lastPopup", null);
213
+ v(this, "_activePopup");
214
+ v(this, "_activePopup$", new It(null));
215
+ v(this, "activePopup$", this._activePopup$.asObservable());
216
+ this._canvasPopupManagerService = e, this._zenZoneService = t, this._initZenVisible();
217
217
  }
218
218
  get activePopup() {
219
219
  return this._activePopup;
@@ -223,10 +223,10 @@ let U = class extends O {
223
223
  e && this.hidePopup();
224
224
  }));
225
225
  }
226
- showPopup(e, n) {
227
- var m;
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)) {
226
+ showPopup(e, t) {
227
+ var d;
228
+ const { row: r, col: n, unitId: i, subUnitId: s } = e;
229
+ if (this._activePopup && r === this._activePopup.row && n === 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
  }
@@ -235,9 +235,9 @@ let U = class extends O {
235
235
  this._activePopup = e, this._activePopup$.next(e);
236
236
  const a = this._canvasPopupManagerService.attachPopupToCell(
237
237
  r,
238
- t,
238
+ n,
239
239
  {
240
- componentKey: ye,
240
+ componentKey: Ee,
241
241
  onClickOutside: () => {
242
242
  this.hidePopup();
243
243
  },
@@ -250,10 +250,10 @@ 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 Ae();
254
254
  c.add(a), c.add({
255
255
  dispose: () => {
256
- n == null || n();
256
+ t == null || t();
257
257
  }
258
258
  }), this._lastPopup = c;
259
259
  }
@@ -267,86 +267,86 @@ 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 = kt([
271
+ me(0, h(mt)),
272
+ me(1, Ye)
273
273
  ], U);
274
- const Ut = () => {
275
- const o = w($), e = w(U), n = oe(e.activePopup$), r = w(T);
276
- if (oe(r.commentUpdate$), !n)
274
+ const xt = () => {
275
+ const o = P(x), e = P(U), t = oe(e.activePopup$), r = P(y);
276
+ if (oe(r.commentUpdate$), !t)
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: n, col: i, unitId: s, subUnitId: a, trigger: c } = t, d = r.getByLocation(s, a, n, i), u = `${pe.chatAtABC(i)}${n + 1}`, l = () => {
279
279
  e.hidePopup();
280
- }, R = (g) => {
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 : "";
280
+ }, E = (S) => {
281
+ var I, M, k;
282
+ return (k = (M = (I = o.getCurrentUnitForType(g.UNIVER_SHEET)) == null ? void 0 : I.getSheetBySheetId(S)) == null ? void 0 : M.getName()) != null ? k : "";
283
283
  };
284
- return /* @__PURE__ */ ge.createElement(
285
- Ae,
284
+ return /* @__PURE__ */ be.createElement(
285
+ Fe,
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
296
  onClose: l,
297
- getSubUnitName: R,
297
+ getSubUnitName: E,
298
298
  autoFocus: c === "context-menu"
299
299
  }
300
300
  );
301
- }, Y = {
302
- type: Ne.OPERATION,
301
+ }, K = {
302
+ type: Le.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(tt), t = o.get(x), r = o.get(U), n = o.get(ee), i = (M = e.getFirst()) == null ? void 0 : M.primary, s = e.getCurrent(), a = o.get(y);
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 = nt(t, { unitId: c, subUnitId: d });
310
310
  if (!u)
311
311
  return !1;
312
- const { workbook: l, worksheet: R } = u, g = {
312
+ const { workbook: l, worksheet: E } = u, S = {
313
313
  workbook: l,
314
- worksheet: R,
314
+ worksheet: E,
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);
322
- return I && t.setActiveComment({
320
+ r.showPopup(S);
321
+ const I = a.getByLocation(c, d, i.actualRow, i.startColumn);
322
+ return I && n.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
329
  }, Ot = () => {
330
- const o = w(ot), e = w($), n = w(G), r = w(U), t = e.getCurrentUnitForType(S.UNIVER_SHEET);
331
- if (!t)
330
+ const o = P(ut), e = P(x), t = P(G), r = P(U), n = e.getCurrentUnitForType(g.UNIVER_SHEET);
331
+ if (!n)
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) => {
336
- v[C.getSheetId()] = P;
337
- }), d.map((C) => {
333
+ const i = n.getUnitId(), s = P(Q), a = ft(() => n.activeSheet$.pipe(Mt((m) => m == null ? void 0 : m.getSheetId())), [n.activeSheet$]), c = ae(a, n.getActiveSheet().getSheetId()), d = ye(), u = P(ee), l = ae(u.activeCommentId$), E = ce((m) => {
334
+ const p = n.getSheets(), _ = {};
335
+ return p.forEach((f, b) => {
336
+ _[f.getSheetId()] = b;
337
+ }), m.map((f) => {
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 };
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))
339
+ const b = w(f.ref), Oe = [(ne = _[f.subUnitId]) != null ? ne : 0, b.row, b.column];
340
+ return { ...f, p: Oe };
341
+ }).sort((f, b) => f.p[0] === b.p[0] ? f.p[1] === b.p[1] ? f.p[2] - b.p[2] : f.p[1] - b.p[1] : f.p[0] - b.p[0]);
342
+ }, [n]), S = ce((m) => {
343
+ if (m.unitId === i && m.subUnitId === c && !m.resolved) {
344
+ const { row: p, column: _ } = w(m.ref);
345
+ if (!Number.isNaN(p) && !Number.isNaN(_))
346
346
  return o.addShape({
347
347
  range: {
348
- startColumn: v,
349
- endColumn: v,
348
+ startColumn: _,
349
+ endColumn: _,
350
350
  startRow: p,
351
351
  endRow: p
352
352
  },
@@ -360,198 +360,199 @@ 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 p, _;
365
+ return (_ = (p = n.getSheetBySheetId(m)) == null ? void 0 : p.getName()) != null ? _ : "";
366
366
  }, M = () => {
367
- s.executeCommand(Y.id);
368
- }, E = () => {
367
+ s.executeCommand(K.id);
368
+ }, k = () => {
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));
372
- }, L = () => {
373
- m.current && (o.removeShape(m.current), m.current = null);
370
+ }, L = (m) => {
371
+ l && l.unitId === m.unitId && l.subUnitId === m.subUnitId && l.commentId === m.id || (d.current && (o.removeShape(d.current), d.current = null), d.current = S(m));
372
+ }, D = () => {
373
+ d.current && (o.removeShape(d.current), d.current = null);
374
374
  };
375
- return ht(() => {
375
+ return gt(() => {
376
376
  if (!l)
377
377
  return;
378
- const d = n.getComment(l.unitId, l.subUnitId, l.commentId);
379
- if (!d)
378
+ const m = t.getComment(l.unitId, l.subUnitId, l.commentId);
379
+ if (!m)
380
380
  return;
381
- const p = g(d);
381
+ const p = S(m);
382
382
  return () => {
383
383
  p && o.removeShape(p);
384
384
  };
385
- }, [g, l, n, o]), /* @__PURE__ */ ge.createElement(
386
- Le,
385
+ }, [S, l, t, o]), /* @__PURE__ */ be.createElement(
386
+ Ze,
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
- onResolve: E,
394
- sortComments: R,
395
- onItemEnter: A,
396
- onItemLeave: L
393
+ onResolve: k,
394
+ sortComments: E,
395
+ onItemEnter: L,
396
+ onItemLeave: D
397
397
  }
398
398
  );
399
- }, Rt = {
400
- sheetThreadComment: {
401
- menu: {
402
- addComment: "添加评论",
403
- commentManagement: "评论管理"
404
- }
405
- }
406
- }, Et = (o) => ({
407
- id: Y.id,
408
- type: ve.BUTTON,
409
- positions: [fe.CONTEXT_MENU],
399
+ }, $t = (o) => ({
400
+ id: K.id,
401
+ type: _e.BUTTON,
402
+ positions: [ve.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,
415
- type: ve.BUTTON,
405
+ hidden$: Ce(o, g.UNIVER_SHEET),
406
+ disabled$: Me(o, {
407
+ workbookTypes: [fe],
408
+ worksheetTypes: [ge],
409
+ rangeTypes: [Se]
410
+ })
411
+ }), Nt = (o) => ({
412
+ id: ze.id,
413
+ type: _e.BUTTON,
416
414
  icon: te,
417
415
  tooltip: "sheetThreadComment.menu.commentManagement",
418
- 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
416
+ positions: ve.TOOLBAR_START,
417
+ group: Xe.TOOLBAR_OTHERS,
418
+ disabled$: Me(o, {
419
+ workbookTypes: [fe],
420
+ worksheetTypes: [ge],
421
+ rangeTypes: [Se]
422
+ }),
423
+ hidden$: Ce(o, g.UNIVER_SHEET)
424
+ }), Vt = {
425
+ id: K.id,
426
+ binding: qe.M | ie.CTRL_COMMAND | ie.ALT,
427
+ preconditions: ht
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--)
427
- (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
428
- return r && t && Nt(e, n, t), t;
429
- }, b = (o, e) => (n, r) => e(n, r, o);
430
- const Vt = {};
431
- 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();
429
+ var At = (o, e, t, r) => {
430
+ for (var n = e, i = o.length - 1, s; i >= 0; i--)
431
+ (s = o[i]) && (n = s(n) || n);
432
+ return n;
433
+ }, T = (o, e) => (t, r) => e(t, r, o);
434
+ const Lt = {};
435
+ let V = class extends R {
436
+ constructor(o, e, t, r, n, i, s, a, c, d, u) {
437
+ super(), this._config = o, this._menuService = e, this._injector = t, this._componentManager = r, this._localeService = n, 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(Vt);
437
441
  }
438
442
  _initCommandListener() {
439
443
  this._commandService.onCommandExecuted((o) => {
440
- if (o.id === qe.id) {
441
- 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) {
443
- const s = t[0].primary.actualRow, a = t[0].primary.actualColumn;
444
- if (!this._sheetsThreadCommentModel.showCommentMarker(n, r, s, a)) {
444
+ if (o.id === rt.id) {
445
+ const e = o.params, { unitId: t, subUnitId: r, selections: n, type: i } = e;
446
+ if ((i === ot.MOVE_END || i === void 0) && n[0].primary) {
447
+ const s = n[0].primary.actualRow, a = n[0].primary.actualColumn;
448
+ if (!this._sheetsThreadCommentModel.showCommentMarker(t, r, s, a)) {
445
449
  this._threadCommentPanelService.activeCommentId && this._commandService.executeCommand(re.id);
446
450
  return;
447
451
  }
448
- const c = this._sheetsThreadCommentModel.getByLocation(n, r, s, a);
452
+ const c = this._sheetsThreadCommentModel.getByLocation(t, r, s, a);
449
453
  c && this._commandService.executeCommand(re.id, {
450
- unitId: n,
454
+ unitId: t,
451
455
  subUnitId: r,
452
456
  commentId: c
453
457
  });
454
458
  }
455
459
  }
456
- if (o.id === V.id) {
457
- const e = o.params, n = this._sheetsThreadCommentPopupService.activePopup;
458
- if (!n)
460
+ if (o.id === A.id) {
461
+ const e = o.params, t = this._sheetsThreadCommentPopupService.activePopup;
462
+ if (!t)
459
463
  return;
460
- const { unitId: r, subUnitId: t, commentId: i } = n;
461
- e.unitId === r && e.subUnitId === t && e.commentId === i && this._sheetsThreadCommentPopupService.hidePopup();
464
+ const { unitId: r, subUnitId: n, commentId: i } = t;
465
+ e.unitId === r && e.subUnitId === n && e.commentId === i && this._sheetsThreadCommentPopupService.hidePopup();
462
466
  }
463
467
  });
464
468
  }
465
469
  _initMenu() {
466
470
  const { menu: o = {} } = this._config;
467
471
  [
468
- Et,
469
- $t
472
+ $t,
473
+ Nt
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, xt],
481
+ [Ge, Ot],
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
- const { unitId: e, subUnitId: n, commentId: r, trigger: t } = o, i = this._sheetsThreadCommentModel.getComment(e, n, r);
490
+ const { unitId: e, subUnitId: t, commentId: r, trigger: n } = o, i = this._sheetsThreadCommentModel.getComment(e, t, 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() !== t && await this._commandService.executeCommand(it.id, {
496
497
  unitId: e,
497
- subUnitId: n
498
+ subUnitId: t
498
499
  });
499
- const m = y(i.ref);
500
- await this._commandService.executeCommand(st.id, {
500
+ const d = w(i.ref);
501
+ await this._commandService.executeCommand(lt.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
- subUnitId: n,
510
- row: m.row,
511
- col: m.column,
510
+ subUnitId: t,
511
+ row: d.row,
512
+ col: d.column,
512
513
  commentId: i.id,
513
- trigger: t
514
+ trigger: n
514
515
  });
515
516
  } else
516
517
  this._sheetsThreadCommentPopupService.hidePopup();
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)),
526
- b(5, Q),
527
- b(6, h(U)),
528
- b(7, h(T)),
529
- b(8, h(ee)),
530
- b(9, Ge),
531
- b(10, $)
532
- ], 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--)
535
- (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);
538
- let B = class extends O {
539
- constructor(e, n, r) {
521
+ V = At([
522
+ O($.Starting, V),
523
+ T(1, Qe),
524
+ T(2, h(le)),
525
+ T(3, h(Je)),
526
+ T(4, h(De)),
527
+ T(5, Q),
528
+ T(6, h(U)),
529
+ T(7, h(y)),
530
+ T(8, h(ee)),
531
+ T(9, et),
532
+ T(10, x)
533
+ ], V);
534
+ var Dt = (o, e, t, r) => {
535
+ for (var n = e, i = o.length - 1, s; i >= 0; i--)
536
+ (s = o[i]) && (n = s(n) || n);
537
+ return n;
538
+ }, Y = (o, e) => (t, r) => e(t, r, o);
539
+ let H = class extends R {
540
+ constructor(e, t, r) {
540
541
  super();
541
- _(this, "_disposableMap", /* @__PURE__ */ new Map());
542
- this._refRangeService = e, this._sheetsThreadCommentModel = n, this._threadCommentModel = r, this._initData(), this._initRefRange();
542
+ v(this, "_disposableMap", /* @__PURE__ */ new Map());
543
+ this._refRangeService = e, this._sheetsThreadCommentModel = t, this._threadCommentModel = r, this._initData(), this._initRefRange();
543
544
  }
544
- _getIdWithUnitId(e, n, r) {
545
- return `${e}-${n}-${r}`;
545
+ _getIdWithUnitId(e, t, r) {
546
+ return `${e}-${t}-${r}`;
546
547
  }
547
- _register(e, n, r) {
548
- const t = r.id, i = {
548
+ _register(e, t, r) {
549
+ const n = r.id, i = {
549
550
  startColumn: r.column,
550
551
  endColumn: r.column,
551
552
  startRow: r.row,
552
553
  endRow: r.row
553
554
  }, s = (a) => {
554
- const c = et(i, a);
555
+ const c = at(i, a);
555
556
  return c && c.startColumn === i.startColumn && c.startRow === i.startRow ? {
556
557
  undos: [],
557
558
  redos: []
@@ -560,10 +561,10 @@ let B = class extends O {
560
561
  id: se.id,
561
562
  params: {
562
563
  unitId: e,
563
- subUnitId: n,
564
+ subUnitId: t,
564
565
  payload: {
565
566
  ref: J(c),
566
- commentId: t
567
+ commentId: n
567
568
  }
568
569
  }
569
570
  }],
@@ -571,48 +572,48 @@ let B = class extends O {
571
572
  id: se.id,
572
573
  params: {
573
574
  unitId: e,
574
- subUnitId: n,
575
+ subUnitId: t,
575
576
  payload: {
576
577
  ref: J(i),
577
- commentId: t
578
+ commentId: n
578
579
  }
579
580
  }
580
581
  }]
581
582
  } : {
582
583
  redos: [{
583
- id: V.id,
584
+ id: A.id,
584
585
  params: {
585
586
  unitId: e,
586
- subUnitId: n,
587
- commentId: t
587
+ subUnitId: t,
588
+ commentId: n
588
589
  }
589
590
  }],
590
591
  undos: [{
591
- id: K.id,
592
+ id: Z.id,
592
593
  params: {
593
594
  unitId: e,
594
- subUnitId: n,
595
+ subUnitId: t,
595
596
  comment: r
596
597
  }
597
598
  }]
598
599
  };
599
600
  };
600
601
  this._disposableMap.set(
601
- this._getIdWithUnitId(e, n, t),
602
- this._refRangeService.registerRefRange(i, s, e, n)
602
+ this._getIdWithUnitId(e, t, n),
603
+ this._refRangeService.registerRefRange(i, s, e, t)
603
604
  );
604
605
  }
605
606
  _initData() {
606
607
  const e = this._threadCommentModel.getAll();
607
- for (const n in e) {
608
- const r = e[n];
609
- for (const t in r) {
610
- const i = r[t];
608
+ for (const t in e) {
609
+ const r = e[t];
610
+ for (const n in r) {
611
+ const i = r[n];
611
612
  for (const s in i) {
612
- const a = i[s], c = a.ref, m = y(c);
613
- this._register(n, t, {
613
+ const a = i[s], c = a.ref, d = w(c);
614
+ this._register(t, n, {
614
615
  ...a,
615
- ...m
616
+ ...d
616
617
  });
617
618
  }
618
619
  }
@@ -621,29 +622,29 @@ let B = class extends O {
621
622
  _initRefRange() {
622
623
  this.disposeWithMe(
623
624
  this._sheetsThreadCommentModel.commentUpdate$.subscribe((e) => {
624
- const { unitId: n, subUnitId: r } = e;
625
+ const { unitId: t, subUnitId: r } = e;
625
626
  switch (e.type) {
626
627
  case "add": {
627
- const t = e.payload;
628
+ const n = e.payload;
628
629
  this._register(e.unitId, e.subUnitId, {
629
- ...t,
630
+ ...n,
630
631
  row: e.row,
631
632
  column: e.column
632
633
  });
633
634
  break;
634
635
  }
635
636
  case "delete": {
636
- const t = this._disposableMap.get(this._getIdWithUnitId(n, r, e.payload.commentId));
637
- t == null || t.dispose();
637
+ const n = this._disposableMap.get(this._getIdWithUnitId(t, r, e.payload.commentId));
638
+ n == null || n.dispose();
638
639
  break;
639
640
  }
640
641
  case "updateRef": {
641
- const t = this._sheetsThreadCommentModel.getComment(n, r, e.payload.commentId);
642
- if (!t)
642
+ const n = this._sheetsThreadCommentModel.getComment(t, r, e.payload.commentId);
643
+ if (!n)
643
644
  return;
644
- const i = this._disposableMap.get(this._getIdWithUnitId(n, r, t.id));
645
+ const i = this._disposableMap.get(this._getIdWithUnitId(t, r, n.id));
645
646
  i == null || i.dispose(), this._register(e.unitId, e.subUnitId, {
646
- ...t,
647
+ ...n,
647
648
  row: e.row,
648
649
  column: e.column
649
650
  });
@@ -651,36 +652,36 @@ 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))
666
- ], 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--)
669
- (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);
672
- let W = class extends O {
673
- constructor(o, e, n, r, t) {
674
- super(), this._sheetInterceptorService = o, this._sheetsThreadCommentModel = e, this._univerInstanceService = n, this._sheetSkeletonManagerService = r, this._renderManagerService = t, this._initViewModelIntercept(), this._initSkeletonChange();
662
+ H = Dt([
663
+ O($.Starting, H),
664
+ Y(0, h(st)),
665
+ Y(1, h(y)),
666
+ Y(2, h(G))
667
+ ], H);
668
+ var Ht = (o, e, t, r) => {
669
+ for (var n = e, i = o.length - 1, s; i >= 0; i--)
670
+ (s = o[i]) && (n = s(n) || n);
671
+ return n;
672
+ }, N = (o, e) => (t, r) => e(t, r, o);
673
+ let j = class extends R {
674
+ constructor(o, e, t, r, n) {
675
+ super(), this._sheetInterceptorService = o, this._sheetsThreadCommentModel = e, this._univerInstanceService = t, this._sheetSkeletonManagerService = r, this._renderManagerService = n, this._initViewModelIntercept(), this._initSkeletonChange();
675
676
  }
676
677
  _initViewModelIntercept() {
677
678
  this.disposeWithMe(
678
679
  this._sheetInterceptorService.intercept(
679
- tt.CELL_CONTENT,
680
+ ct.CELL_CONTENT,
680
681
  {
681
- handler: (o, e, n) => {
682
- const { row: r, col: t, unitId: i, subUnitId: s } = e;
683
- return this._sheetsThreadCommentModel.showCommentMarker(i, s, r, t) ? n({
682
+ handler: (o, e, t) => {
683
+ const { row: r, col: n, unitId: i, subUnitId: s } = e;
684
+ return this._sheetsThreadCommentModel.showCommentMarker(i, s, r, n) ? t({
684
685
  ...o,
685
686
  markers: {
686
687
  ...o == null ? void 0 : o.markers,
@@ -689,7 +690,7 @@ let W = class extends O {
689
690
  size: 6
690
691
  }
691
692
  }
692
- }) : n(o);
693
+ }) : t(o);
693
694
  },
694
695
  priority: 100
695
696
  }
@@ -698,117 +699,117 @@ 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
- const n = e.getUnitId(), r = e.getActiveSheet().getSheetId(), t = this._sheetSkeletonManagerService.getOrCreateSkeleton({ unitId: n, sheetId: r }), i = this._renderManagerService.getRenderById(n);
705
- t == null || t.makeDirty(!0), t == null || t.calculate(), i && i.mainComponent.makeForceDirty();
705
+ const t = e.getUnitId(), r = e.getActiveSheet().getSheetId(), n = this._sheetSkeletonManagerService.getOrCreateSkeleton({ unitId: t, sheetId: r }), i = this._renderManagerService.getRenderById(t);
706
+ n == null || n.makeDirty(!0), n == null || n.calculate(), i && i.mainComponent.makeForceDirty();
706
707
  };
707
708
  this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.subscribe(() => {
708
709
  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)
719
- ], 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--)
722
- (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
723
- return r && t && Zt(e, n, t), t;
724
- }, ue = (o, e) => (n, r) => e(n, r, o);
725
- const Gt = (o, e, n) => {
726
- const r = y(o), t = n.row - e.row, i = n.column - e.column, s = {
713
+ j = Ht([
714
+ O($.Ready, j),
715
+ N(0, h(Ie)),
716
+ N(1, h(y)),
717
+ N(2, x),
718
+ N(3, h(pt)),
719
+ N(4, Tt)
720
+ ], j);
721
+ var jt = (o, e, t, r) => {
722
+ for (var n = e, i = o.length - 1, s; i >= 0; i--)
723
+ (s = o[i]) && (n = s(n) || n);
724
+ return n;
725
+ }, ue = (o, e) => (t, r) => e(t, r, o);
726
+ const Bt = (o, e, t) => {
727
+ const r = w(o), n = t.row - e.row, i = t.column - e.column, s = {
727
728
  startColumn: r.column + i,
728
- startRow: r.row + t,
729
+ startRow: r.row + n,
729
730
  endColumn: r.column + i,
730
- endRow: r.row + t
731
+ endRow: r.row + n
731
732
  };
732
733
  return J(s);
733
734
  };
734
- let F = class extends O {
735
- constructor(e, n) {
735
+ let B = class extends R {
736
+ constructor(e, t) {
736
737
  super();
737
- _(this, "_copyInfo");
738
- this._sheetClipboardService = e, this._sheetsThreadCommentModel = n, this._initClipboardHook();
738
+ v(this, "_copyInfo");
739
+ this._sheetClipboardService = e, this._sheetsThreadCommentModel = t, this._initClipboardHook();
739
740
  }
740
741
  // eslint-disable-next-line max-lines-per-function
741
742
  _initClipboardHook() {
742
743
  this.disposeWithMe(
743
744
  this._sheetClipboardService.addClipboardHook({
744
- id: Ue,
745
- onBeforeCopy: (e, n, r) => {
745
+ id: ke,
746
+ onBeforeCopy: (e, t, r) => {
746
747
  this._copyInfo = {
747
748
  unitId: e,
748
- subUnitId: n,
749
+ subUnitId: t,
749
750
  range: r
750
751
  };
751
752
  },
752
753
  // eslint-disable-next-line max-lines-per-function
753
- onPasteCells: (e, n, r, t) => {
754
- const { unitId: i, subUnitId: s, range: a } = n, c = {
754
+ onPasteCells: (e, t, r, n) => {
755
+ const { unitId: i, subUnitId: s, range: a } = t, c = {
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 (n.copyType === vt.CUT && this._copyInfo) {
760
+ const { range: d, unitId: u, subUnitId: l } = this._copyInfo, E = {
761
+ row: d.startRow,
762
+ column: d.startColumn
762
763
  };
763
764
  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);
765
+ const S = [];
766
+ je.foreach(d, (m, p) => {
767
+ const _ = this._sheetsThreadCommentModel.getCommentWithChildren(u, l, m, p);
768
+ _ && S.push(_);
768
769
  });
769
- const I = [], M = [], E = [], A = [], L = (d) => {
770
+ const I = [], M = [], k = [], L = [], D = (m) => {
770
771
  I.unshift({
771
- id: V.id,
772
+ id: A.id,
772
773
  params: {
773
774
  unitId: u,
774
775
  subUnitId: l,
775
- commentId: d.id
776
+ commentId: m.id
776
777
  }
777
- }), E.push({
778
- id: K.id,
778
+ }), k.push({
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: Bt(m.ref, E, 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
794
  subUnitId: l,
794
- comment: d
795
+ comment: m
795
796
  }
796
- }), A.unshift({
797
- id: V.id,
797
+ }), L.unshift({
798
+ id: A.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
+ D(m.root), m.children.forEach((p) => {
808
+ D(p);
808
809
  });
809
810
  }), {
810
- redos: [...I, ...E],
811
- undos: [...A, ...M]
811
+ redos: [...I, ...k],
812
+ undos: [...L, ...M]
812
813
  };
813
814
  }
814
815
  }
@@ -821,80 +822,82 @@ let F = class extends O {
821
822
  );
822
823
  }
823
824
  };
824
- F = Kt([
825
- x(N.Rendered, F),
826
- ue(0, h(ct)),
827
- ue(1, h(T))
828
- ], 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--)
831
- (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
832
- return r && t && Yt(e, n, t), t;
833
- }, q = (o, e) => (n, r) => e(n, r, o);
834
- let Z = class extends O {
835
- constructor(o, e, n) {
836
- super(), this._hoverManagerService = o, this._sheetsThreadCommentPopupService = e, this._sheetsThreadCommentModel = n, this._initHoverEvent();
825
+ B = jt([
826
+ O($.Rendered, B),
827
+ ue(0, h(_t)),
828
+ ue(1, h(y))
829
+ ], B);
830
+ var Wt = (o, e, t, r) => {
831
+ for (var n = e, i = o.length - 1, s; i >= 0; i--)
832
+ (s = o[i]) && (n = s(n) || n);
833
+ return n;
834
+ }, q = (o, e) => (t, r) => e(t, r, o);
835
+ let W = class extends R {
836
+ constructor(o, e, t) {
837
+ super(), this._hoverManagerService = o, this._sheetsThreadCommentPopupService = e, this._sheetsThreadCommentModel = t, 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(bt(100)).subscribe((o) => {
842
+ const e = this._sheetsThreadCommentPopupService.activePopup;
843
+ if (o && (e && e.temp || !e)) {
844
+ const { location: t } = o, { unitId: r, subUnitId: n, row: i, col: s } = t, a = this._sheetsThreadCommentModel.getByLocation(r, n, i, s);
845
+ if (a) {
846
+ const c = this._sheetsThreadCommentModel.getComment(r, n, a);
847
+ c && !c.resolved && this._sheetsThreadCommentPopupService.showPopup({
848
+ unitId: r,
849
+ subUnitId: n,
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
+ W = Wt([
863
+ O($.Rendered, W),
864
+ q(0, h(Ct)),
862
865
  q(1, h(U)),
863
- q(2, h(T))
864
- ], 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--)
867
- (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
868
- return r && t && Xt(e, n, t), t;
869
- }, X = (o, e) => (n, r) => e(n, r, o);
870
- let z = class extends O {
871
- constructor(o, e, n) {
872
- super(), this._sheetInterceptorService = o, this._univerInstanceService = e, this._threadCommentModel = n, this._initSheetChange();
866
+ q(2, h(y))
867
+ ], W);
868
+ var Ft = (o, e, t, r) => {
869
+ for (var n = e, i = o.length - 1, s; i >= 0; i--)
870
+ (s = o[i]) && (n = s(n) || n);
871
+ return n;
872
+ }, X = (o, e) => (t, r) => e(t, r, o);
873
+ let F = class extends R {
874
+ constructor(o, e, t) {
875
+ super(), this._sheetInterceptorService = o, this._univerInstanceService = e, this._threadCommentModel = t, this._initSheetChange();
873
876
  }
874
877
  _initSheetChange() {
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);
880
- if (!n)
881
+ if (o.id === dt.id) {
882
+ const e = o.params, t = e.unitId ? this._univerInstanceService.getUnit(e.unitId) : this._univerInstanceService.getCurrentUnitForType(g.UNIVER_SHEET);
883
+ if (!t)
881
884
  return { redos: [], undos: [] };
882
- 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) => ({
883
- id: V.id,
885
+ const r = t.getUnitId(), n = e.subUnitId || t.getActiveSheet().getSheetId(), { commentMap: i } = this._threadCommentModel.ensureMap(r, n), s = Array.from(Object.keys(i)), a = Array.from(Object.values(i)), c = s.map((u) => ({
886
+ id: A.id,
884
887
  params: {
885
888
  unitId: r,
886
- subUnitId: t,
889
+ subUnitId: n,
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
- subUnitId: t,
896
+ subUnitId: n,
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,65 +905,68 @@ 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
- X(1, $),
908
+ F = Ft([
909
+ O($.Ready, F),
910
+ X(0, h(Ie)),
911
+ X(1, x),
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
- (s = o[i]) && (t = (r ? s(e, n, t) : s(t)) || t);
914
- return r && t && en(e, n, t), t;
915
- }, he = (o, e) => (n, r) => e(n, r, o), H;
916
- let le = (H = class extends We {
917
- constructor(e = {}, n, r) {
918
- super(e, n, r);
919
- _(this, "_pluginConfig");
920
- this._injector = n, this._commandService = r, this._pluginConfig = _e.deepMerge({}, Vt, e);
913
+ ], F);
914
+ var Zt = Object.defineProperty, zt = (o, e, t) => e in o ? Zt(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, Gt = (o, e, t, r) => {
915
+ for (var n = e, i = o.length - 1, s; i >= 0; i--)
916
+ (s = o[i]) && (n = s(n) || n);
917
+ return n;
918
+ }, he = (o, e) => (t, r) => e(t, r, o), xe = (o, e, t) => (zt(o, typeof e != "symbol" ? e + "" : e, t), t);
919
+ let z = class extends We {
920
+ constructor(e = {}, t, r) {
921
+ super();
922
+ v(this, "_pluginConfig");
923
+ this._injector = t, this._commandService = r, this._pluginConfig = pe.deepMerge({}, Lt, e);
921
924
  }
922
925
  onStarting(e) {
923
- super.onStarting(e), [
924
- [T],
926
+ [
927
+ [y],
925
928
  [
926
- j,
929
+ V,
927
930
  {
928
- useFactory: () => this._injector.createInstance(j, this._pluginConfig)
931
+ useFactory: () => this._injector.createInstance(V, this._pluginConfig)
929
932
  }
930
933
  ],
934
+ [H],
935
+ [j],
931
936
  [B],
932
937
  [W],
933
938
  [F],
934
- [Z],
935
- [z],
936
939
  [U]
937
- ].forEach((n) => {
938
- this._injector.add(n);
939
- }), [Y].forEach((n) => {
940
- this._commandService.registerCommand(n);
940
+ ].forEach((t) => {
941
+ e.add(t);
942
+ }), [K].forEach((t) => {
943
+ this._commandService.registerCommand(t);
941
944
  });
942
945
  }
943
- }, _(H, "pluginName", Ue), _(H, "type", S.UNIVER_SHEET), H);
944
- le = nn([
945
- he(1, h(pe)),
946
+ };
947
+ xe(z, "pluginName", ke);
948
+ xe(z, "type", g.UNIVER_SHEET);
949
+ z = Gt([
950
+ Be(Ke),
951
+ he(1, h(le)),
946
952
  he(2, h(Q))
947
- ], le);
953
+ ], z);
948
954
  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,
956
- j as SheetsThreadCommentController,
957
- F as SheetsThreadCommentCopyPasteController,
958
- Z as SheetsThreadCommentHoverController,
959
- T as SheetsThreadCommentModel,
955
+ ln as ICommandService,
956
+ Sn as IThreadCommentDataSourceService,
957
+ Cn as IThreadCommentMentionDataService,
958
+ mn as Inject,
959
+ un as Injector,
960
+ pn as Plugin,
961
+ ke as SHEETS_THREAD_COMMENT,
962
+ V as SheetsThreadCommentController,
963
+ B as SheetsThreadCommentCopyPasteController,
964
+ W as SheetsThreadCommentHoverController,
965
+ y as SheetsThreadCommentModel,
960
966
  U as SheetsThreadCommentPopupService,
961
- B as SheetsThreadCommentRefRangeController,
962
- z as ThreadCommentRemoveSheetsController,
963
- bn as UniverInstanceType,
964
- le as UniverSheetsThreadCommentPlugin,
965
- yn as UniverThreadCommentUIPlugin
967
+ H as SheetsThreadCommentRefRangeController,
968
+ F as ThreadCommentRemoveSheetsController,
969
+ _n as UniverInstanceType,
970
+ z as UniverSheetsThreadCommentPlugin,
971
+ fn as UniverThreadCommentUIPlugin
966
972
  };