@univerjs/sheets-thread-comment 0.1.14 → 0.1.16

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