@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/cjs/index.js +1 -1
- package/lib/es/index.js +490 -484
- package/lib/locale/en-US.json +8 -0
- package/lib/locale/ru-RU.json +8 -0
- package/lib/locale/zh-CN.json +8 -0
- package/lib/types/controllers/menu.d.ts +3 -1
- package/lib/types/controllers/sheets-thread-comment.controller.d.ts +0 -1
- package/lib/types/plugin.d.ts +2 -3
- package/lib/umd/index.js +1 -1
- package/package.json +22 -21
- package/LICENSE +0 -176
- package/lib/types/locale/index.d.ts +0 -18
package/lib/es/index.js
CHANGED
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { Inject as h, Injector as
|
|
5
|
-
import { Inject as
|
|
6
|
-
import { Disposable as
|
|
7
|
-
import { ICommandService as
|
|
8
|
-
import { ThreadCommentTree as
|
|
9
|
-
import { IThreadCommentMentionDataService as
|
|
10
|
-
import { IZenZoneService as
|
|
11
|
-
import { SelectionManagerService as
|
|
12
|
-
import { singleReferenceToGrid as
|
|
13
|
-
import { SheetCanvasPopManagerService as
|
|
14
|
-
import { ThreadCommentModel as G, DeleteCommentMutation as
|
|
15
|
-
import { IThreadCommentDataSourceService as
|
|
16
|
-
import { useDependency as
|
|
17
|
-
import
|
|
18
|
-
import { Subject as
|
|
19
|
-
import { IRenderManagerService as
|
|
20
|
-
var
|
|
21
|
-
return
|
|
22
|
-
for (var e,
|
|
23
|
-
e = arguments[
|
|
24
|
-
for (var
|
|
25
|
-
Object.prototype.hasOwnProperty.call(e,
|
|
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
|
-
},
|
|
29
|
-
},
|
|
30
|
-
var
|
|
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 && (
|
|
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
|
|
35
|
-
e.indexOf(r[
|
|
36
|
-
return
|
|
37
|
-
},
|
|
38
|
-
var
|
|
39
|
-
return
|
|
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
|
|
42
|
-
return Pe(o.tag,
|
|
43
|
-
return
|
|
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
|
|
47
|
-
var r =
|
|
48
|
-
|
|
49
|
-
var
|
|
50
|
-
return !
|
|
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
|
|
56
|
-
var
|
|
57
|
-
return !r || r.length === 0 ? o : o.tag === "defs" && (!((
|
|
58
|
-
return typeof
|
|
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
|
|
61
|
+
function Ut() {
|
|
62
62
|
return Math.random().toString(36).substring(2, 8);
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
var
|
|
66
|
-
return Pe(
|
|
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:
|
|
69
|
+
icon: Rt
|
|
70
70
|
}));
|
|
71
71
|
});
|
|
72
|
-
|
|
73
|
-
var
|
|
74
|
-
for (var
|
|
75
|
-
(s = o[i]) && (
|
|
76
|
-
return
|
|
77
|
-
},
|
|
78
|
-
let
|
|
79
|
-
constructor(e,
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
this._threadCommentModel = e, this._univerInstanceService =
|
|
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,
|
|
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
|
|
94
|
-
return
|
|
93
|
+
let n = r.get(t);
|
|
94
|
+
return n || (n = new Ve(), r.set(t, n)), n;
|
|
95
95
|
}
|
|
96
|
-
_ensureCommentLocationMap(e,
|
|
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
|
|
100
|
-
return
|
|
99
|
+
let n = r.get(t);
|
|
100
|
+
return n || (n = /* @__PURE__ */ new Map(), r.set(t, n)), n;
|
|
101
101
|
}
|
|
102
|
-
_ensure(e,
|
|
103
|
-
const r = this._ensureCommentMatrix(e,
|
|
104
|
-
return { matrix: r, locationMap:
|
|
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
|
|
109
|
-
const r = e[
|
|
110
|
-
for (const
|
|
111
|
-
const i = r[
|
|
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(
|
|
114
|
+
this._addComment(t, n, a);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
_addComment(e,
|
|
120
|
-
const
|
|
121
|
-
!i && s >= 0 && a >= 0 && (
|
|
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:
|
|
123
|
+
subUnitId: t,
|
|
124
124
|
payload: r,
|
|
125
125
|
type: "add",
|
|
126
|
-
...
|
|
126
|
+
...n
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
_initUpdateTransform() {
|
|
130
130
|
this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe((e) => {
|
|
131
|
-
const { unitId:
|
|
131
|
+
const { unitId: t, subUnitId: r } = e;
|
|
132
132
|
try {
|
|
133
|
-
if (this._univerInstanceService.getUnitType(
|
|
133
|
+
if (this._univerInstanceService.getUnitType(t) !== g.UNIVER_SHEET)
|
|
134
134
|
return;
|
|
135
135
|
} catch {
|
|
136
136
|
}
|
|
137
|
-
const { matrix:
|
|
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 =
|
|
144
|
+
const { isRoot: s, comment: a } = e.payload, c = w(a.ref);
|
|
145
145
|
if (s) {
|
|
146
|
-
const { row:
|
|
147
|
-
|
|
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(
|
|
156
|
+
const { commentId: s } = e.payload, a = this._threadCommentModel.getComment(t, r, s);
|
|
157
157
|
if (!a)
|
|
158
158
|
return;
|
|
159
|
-
const c =
|
|
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 =
|
|
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:
|
|
171
|
-
|
|
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,
|
|
181
|
-
return this._ensureCommentMatrix(e,
|
|
180
|
+
getByLocation(e, t, r, n) {
|
|
181
|
+
return this._ensureCommentMatrix(e, t).getValue(r, n);
|
|
182
182
|
}
|
|
183
|
-
getComment(e,
|
|
184
|
-
return this._threadCommentModel.getComment(e,
|
|
183
|
+
getComment(e, t, r) {
|
|
184
|
+
return this._threadCommentModel.getComment(e, t, r);
|
|
185
185
|
}
|
|
186
|
-
getCommentWithChildren(e,
|
|
187
|
-
const s = this._ensureCommentMatrix(e,
|
|
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,
|
|
189
|
+
return this._threadCommentModel.getCommentWithChildren(e, t, s);
|
|
190
190
|
}
|
|
191
|
-
showCommentMarker(e,
|
|
192
|
-
const i = this.getByLocation(e,
|
|
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,
|
|
195
|
+
const s = this.getComment(e, t, i);
|
|
196
196
|
return !!(s && !s.resolved);
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
],
|
|
203
|
-
const
|
|
204
|
-
var
|
|
205
|
-
for (var
|
|
206
|
-
(s = o[i]) && (
|
|
207
|
-
return
|
|
208
|
-
},
|
|
209
|
-
let U = class extends
|
|
210
|
-
constructor(e,
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
this._canvasPopupManagerService = e, this._zenZoneService =
|
|
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,
|
|
227
|
-
var
|
|
228
|
-
const { row: r, col:
|
|
229
|
-
if (this._activePopup && r === this._activePopup.row &&
|
|
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
|
-
|
|
238
|
+
n,
|
|
239
239
|
{
|
|
240
|
-
componentKey:
|
|
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
|
|
253
|
+
const c = new Ae();
|
|
254
254
|
c.add(a), c.add({
|
|
255
255
|
dispose: () => {
|
|
256
|
-
|
|
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 =
|
|
271
|
-
|
|
272
|
-
|
|
270
|
+
U = kt([
|
|
271
|
+
me(0, h(mt)),
|
|
272
|
+
me(1, Ye)
|
|
273
273
|
], U);
|
|
274
|
-
const
|
|
275
|
-
const o =
|
|
276
|
-
if (oe(r.commentUpdate$), !
|
|
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:
|
|
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
|
-
},
|
|
281
|
-
var I, M,
|
|
282
|
-
return (
|
|
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__ */
|
|
285
|
-
|
|
284
|
+
return /* @__PURE__ */ be.createElement(
|
|
285
|
+
Fe,
|
|
286
286
|
{
|
|
287
287
|
onClick: () => {
|
|
288
288
|
e.persistPopup();
|
|
289
289
|
},
|
|
290
290
|
prefix: "cell",
|
|
291
|
-
id:
|
|
291
|
+
id: d,
|
|
292
292
|
unitId: s,
|
|
293
293
|
subUnitId: a,
|
|
294
|
-
type:
|
|
294
|
+
type: g.UNIVER_SHEET,
|
|
295
295
|
refStr: u,
|
|
296
296
|
onClose: l,
|
|
297
|
-
getSubUnitName:
|
|
297
|
+
getSubUnitName: E,
|
|
298
298
|
autoFocus: c === "context-menu"
|
|
299
299
|
}
|
|
300
300
|
);
|
|
301
|
-
},
|
|
302
|
-
type:
|
|
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(
|
|
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:
|
|
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:
|
|
312
|
+
const { workbook: l, worksheet: E } = u, S = {
|
|
313
313
|
workbook: l,
|
|
314
|
-
worksheet:
|
|
314
|
+
worksheet: E,
|
|
315
315
|
unitId: c,
|
|
316
|
-
subUnitId:
|
|
316
|
+
subUnitId: d,
|
|
317
317
|
row: i.actualRow,
|
|
318
318
|
col: i.startColumn
|
|
319
319
|
};
|
|
320
|
-
r.showPopup(
|
|
321
|
-
const I = a.getByLocation(c,
|
|
322
|
-
return I &&
|
|
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:
|
|
324
|
+
subUnitId: d,
|
|
325
325
|
commentId: I,
|
|
326
326
|
trigger: "context-menu"
|
|
327
327
|
}), !0;
|
|
328
328
|
}
|
|
329
329
|
}, Ot = () => {
|
|
330
|
-
const o =
|
|
331
|
-
if (!
|
|
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 =
|
|
334
|
-
const p =
|
|
335
|
-
return p.forEach((
|
|
336
|
-
|
|
337
|
-
}),
|
|
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
|
|
340
|
-
return { ...
|
|
341
|
-
}).sort((
|
|
342
|
-
}, [
|
|
343
|
-
if (
|
|
344
|
-
const { row: p, column:
|
|
345
|
-
if (!Number.isNaN(p) && !Number.isNaN(
|
|
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:
|
|
349
|
-
endColumn:
|
|
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 = (
|
|
364
|
-
var p,
|
|
365
|
-
return (
|
|
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(
|
|
368
|
-
},
|
|
367
|
+
s.executeCommand(K.id);
|
|
368
|
+
}, k = () => {
|
|
369
369
|
r.hidePopup();
|
|
370
|
-
},
|
|
371
|
-
l && l.unitId ===
|
|
372
|
-
},
|
|
373
|
-
|
|
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
|
|
375
|
+
return gt(() => {
|
|
376
376
|
if (!l)
|
|
377
377
|
return;
|
|
378
|
-
const
|
|
379
|
-
if (!
|
|
378
|
+
const m = t.getComment(l.unitId, l.subUnitId, l.commentId);
|
|
379
|
+
if (!m)
|
|
380
380
|
return;
|
|
381
|
-
const p =
|
|
381
|
+
const p = S(m);
|
|
382
382
|
return () => {
|
|
383
383
|
p && o.removeShape(p);
|
|
384
384
|
};
|
|
385
|
-
}, [
|
|
386
|
-
|
|
385
|
+
}, [S, l, t, o]), /* @__PURE__ */ be.createElement(
|
|
386
|
+
Ze,
|
|
387
387
|
{
|
|
388
388
|
unitId: i,
|
|
389
389
|
subUnitId$: a,
|
|
390
|
-
type:
|
|
390
|
+
type: g.UNIVER_SHEET,
|
|
391
391
|
onAdd: M,
|
|
392
392
|
getSubUnitName: I,
|
|
393
|
-
onResolve:
|
|
394
|
-
sortComments:
|
|
395
|
-
onItemEnter:
|
|
396
|
-
onItemLeave:
|
|
393
|
+
onResolve: k,
|
|
394
|
+
sortComments: E,
|
|
395
|
+
onItemEnter: L,
|
|
396
|
+
onItemLeave: D
|
|
397
397
|
}
|
|
398
398
|
);
|
|
399
|
-
},
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
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,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
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:
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
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
|
|
426
|
-
for (var
|
|
427
|
-
(s = o[i]) && (
|
|
428
|
-
return
|
|
429
|
-
},
|
|
430
|
-
const
|
|
431
|
-
let
|
|
432
|
-
constructor(o, e,
|
|
433
|
-
super(), this._config = o, this._menuService = e, this._injector =
|
|
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(
|
|
440
|
+
this._shortcutService.registerShortcut(Vt);
|
|
437
441
|
}
|
|
438
442
|
_initCommandListener() {
|
|
439
443
|
this._commandService.onCommandExecuted((o) => {
|
|
440
|
-
if (o.id ===
|
|
441
|
-
const e = o.params, { unitId:
|
|
442
|
-
if ((i ===
|
|
443
|
-
const s =
|
|
444
|
-
if (!this._sheetsThreadCommentModel.showCommentMarker(
|
|
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(
|
|
452
|
+
const c = this._sheetsThreadCommentModel.getByLocation(t, r, s, a);
|
|
449
453
|
c && this._commandService.executeCommand(re.id, {
|
|
450
|
-
unitId:
|
|
454
|
+
unitId: t,
|
|
451
455
|
subUnitId: r,
|
|
452
456
|
commentId: c
|
|
453
457
|
});
|
|
454
458
|
}
|
|
455
459
|
}
|
|
456
|
-
if (o.id ===
|
|
457
|
-
const e = o.params,
|
|
458
|
-
if (!
|
|
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:
|
|
461
|
-
e.unitId === r && e.subUnitId ===
|
|
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
|
-
|
|
469
|
-
|
|
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
|
-
[
|
|
477
|
-
[
|
|
478
|
-
[te,
|
|
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:
|
|
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(
|
|
493
|
+
const s = this._univerInstanceService.getCurrentUnitForType(g.UNIVER_SHEET);
|
|
493
494
|
if (!s || s.getUnitId() !== e)
|
|
494
495
|
return;
|
|
495
|
-
s.getActiveSheet().getSheetId() !==
|
|
496
|
+
s.getActiveSheet().getSheetId() !== t && await this._commandService.executeCommand(it.id, {
|
|
496
497
|
unitId: e,
|
|
497
|
-
subUnitId:
|
|
498
|
+
subUnitId: t
|
|
498
499
|
});
|
|
499
|
-
const
|
|
500
|
-
await this._commandService.executeCommand(
|
|
500
|
+
const d = w(i.ref);
|
|
501
|
+
await this._commandService.executeCommand(lt.id, {
|
|
501
502
|
range: {
|
|
502
|
-
startColumn:
|
|
503
|
-
endColumn:
|
|
504
|
-
startRow:
|
|
505
|
-
endRow:
|
|
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:
|
|
510
|
-
row:
|
|
511
|
-
col:
|
|
510
|
+
subUnitId: t,
|
|
511
|
+
row: d.row,
|
|
512
|
+
col: d.column,
|
|
512
513
|
commentId: i.id,
|
|
513
|
-
trigger:
|
|
514
|
+
trigger: n
|
|
514
515
|
});
|
|
515
516
|
} else
|
|
516
517
|
this._sheetsThreadCommentPopupService.hidePopup();
|
|
517
518
|
}));
|
|
518
519
|
}
|
|
519
520
|
};
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
],
|
|
533
|
-
var
|
|
534
|
-
for (var
|
|
535
|
-
(s = o[i]) && (
|
|
536
|
-
return
|
|
537
|
-
},
|
|
538
|
-
let
|
|
539
|
-
constructor(e,
|
|
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
|
-
|
|
542
|
-
this._refRangeService = e, this._sheetsThreadCommentModel =
|
|
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,
|
|
545
|
-
return `${e}-${
|
|
545
|
+
_getIdWithUnitId(e, t, r) {
|
|
546
|
+
return `${e}-${t}-${r}`;
|
|
546
547
|
}
|
|
547
|
-
_register(e,
|
|
548
|
-
const
|
|
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 =
|
|
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:
|
|
564
|
+
subUnitId: t,
|
|
564
565
|
payload: {
|
|
565
566
|
ref: J(c),
|
|
566
|
-
commentId:
|
|
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:
|
|
575
|
+
subUnitId: t,
|
|
575
576
|
payload: {
|
|
576
577
|
ref: J(i),
|
|
577
|
-
commentId:
|
|
578
|
+
commentId: n
|
|
578
579
|
}
|
|
579
580
|
}
|
|
580
581
|
}]
|
|
581
582
|
} : {
|
|
582
583
|
redos: [{
|
|
583
|
-
id:
|
|
584
|
+
id: A.id,
|
|
584
585
|
params: {
|
|
585
586
|
unitId: e,
|
|
586
|
-
subUnitId:
|
|
587
|
-
commentId:
|
|
587
|
+
subUnitId: t,
|
|
588
|
+
commentId: n
|
|
588
589
|
}
|
|
589
590
|
}],
|
|
590
591
|
undos: [{
|
|
591
|
-
id:
|
|
592
|
+
id: Z.id,
|
|
592
593
|
params: {
|
|
593
594
|
unitId: e,
|
|
594
|
-
subUnitId:
|
|
595
|
+
subUnitId: t,
|
|
595
596
|
comment: r
|
|
596
597
|
}
|
|
597
598
|
}]
|
|
598
599
|
};
|
|
599
600
|
};
|
|
600
601
|
this._disposableMap.set(
|
|
601
|
-
this._getIdWithUnitId(e,
|
|
602
|
-
this._refRangeService.registerRefRange(i, s, e,
|
|
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
|
|
608
|
-
const r = e[
|
|
609
|
-
for (const
|
|
610
|
-
const i = r[
|
|
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,
|
|
613
|
-
this._register(
|
|
613
|
+
const a = i[s], c = a.ref, d = w(c);
|
|
614
|
+
this._register(t, n, {
|
|
614
615
|
...a,
|
|
615
|
-
...
|
|
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:
|
|
625
|
+
const { unitId: t, subUnitId: r } = e;
|
|
625
626
|
switch (e.type) {
|
|
626
627
|
case "add": {
|
|
627
|
-
const
|
|
628
|
+
const n = e.payload;
|
|
628
629
|
this._register(e.unitId, e.subUnitId, {
|
|
629
|
-
...
|
|
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
|
|
637
|
-
|
|
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
|
|
642
|
-
if (!
|
|
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(
|
|
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
|
-
...
|
|
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(
|
|
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
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
],
|
|
667
|
-
var
|
|
668
|
-
for (var
|
|
669
|
-
(s = o[i]) && (
|
|
670
|
-
return
|
|
671
|
-
},
|
|
672
|
-
let
|
|
673
|
-
constructor(o, e,
|
|
674
|
-
super(), this._sheetInterceptorService = o, this._sheetsThreadCommentModel = e, this._univerInstanceService =
|
|
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
|
-
|
|
680
|
+
ct.CELL_CONTENT,
|
|
680
681
|
{
|
|
681
|
-
handler: (o, e,
|
|
682
|
-
const { row: r, col:
|
|
683
|
-
return this._sheetsThreadCommentModel.showCommentMarker(i, s, r,
|
|
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
|
-
}) :
|
|
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(
|
|
702
|
+
const e = this._univerInstanceService.getCurrentUnitForType(g.UNIVER_SHEET);
|
|
702
703
|
if (!e)
|
|
703
704
|
return;
|
|
704
|
-
const
|
|
705
|
-
|
|
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
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
],
|
|
720
|
-
var
|
|
721
|
-
for (var
|
|
722
|
-
(s = o[i]) && (
|
|
723
|
-
return
|
|
724
|
-
}, ue = (o, e) => (
|
|
725
|
-
const
|
|
726
|
-
const r =
|
|
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 +
|
|
729
|
+
startRow: r.row + n,
|
|
729
730
|
endColumn: r.column + i,
|
|
730
|
-
endRow: r.row +
|
|
731
|
+
endRow: r.row + n
|
|
731
732
|
};
|
|
732
733
|
return J(s);
|
|
733
734
|
};
|
|
734
|
-
let
|
|
735
|
-
constructor(e,
|
|
735
|
+
let B = class extends R {
|
|
736
|
+
constructor(e, t) {
|
|
736
737
|
super();
|
|
737
|
-
|
|
738
|
-
this._sheetClipboardService = e, this._sheetsThreadCommentModel =
|
|
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:
|
|
745
|
-
onBeforeCopy: (e,
|
|
745
|
+
id: ke,
|
|
746
|
+
onBeforeCopy: (e, t, r) => {
|
|
746
747
|
this._copyInfo = {
|
|
747
748
|
unitId: e,
|
|
748
|
-
subUnitId:
|
|
749
|
+
subUnitId: t,
|
|
749
750
|
range: r
|
|
750
751
|
};
|
|
751
752
|
},
|
|
752
753
|
// eslint-disable-next-line max-lines-per-function
|
|
753
|
-
onPasteCells: (e,
|
|
754
|
-
const { unitId: i, subUnitId: s, range: a } =
|
|
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 (
|
|
759
|
-
const { range:
|
|
760
|
-
row:
|
|
761
|
-
column:
|
|
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
|
|
765
|
-
|
|
766
|
-
const
|
|
767
|
-
|
|
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 = [],
|
|
770
|
+
const I = [], M = [], k = [], L = [], D = (m) => {
|
|
770
771
|
I.unshift({
|
|
771
|
-
id:
|
|
772
|
+
id: A.id,
|
|
772
773
|
params: {
|
|
773
774
|
unitId: u,
|
|
774
775
|
subUnitId: l,
|
|
775
|
-
commentId:
|
|
776
|
+
commentId: m.id
|
|
776
777
|
}
|
|
777
|
-
}),
|
|
778
|
-
id:
|
|
778
|
+
}), k.push({
|
|
779
|
+
id: Z.id,
|
|
779
780
|
params: {
|
|
780
781
|
unitId: i,
|
|
781
782
|
subUnitId: s,
|
|
782
783
|
comment: {
|
|
783
|
-
...
|
|
784
|
-
ref:
|
|
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:
|
|
791
|
+
id: Z.id,
|
|
791
792
|
params: {
|
|
792
793
|
unitId: u,
|
|
793
794
|
subUnitId: l,
|
|
794
|
-
comment:
|
|
795
|
+
comment: m
|
|
795
796
|
}
|
|
796
|
-
}),
|
|
797
|
-
id:
|
|
797
|
+
}), L.unshift({
|
|
798
|
+
id: A.id,
|
|
798
799
|
params: {
|
|
799
800
|
unitId: i,
|
|
800
801
|
subUnitId: s,
|
|
801
|
-
commentId:
|
|
802
|
+
commentId: m.id
|
|
802
803
|
}
|
|
803
804
|
});
|
|
804
805
|
};
|
|
805
|
-
return
|
|
806
|
-
|
|
807
|
-
|
|
806
|
+
return S.forEach((m) => {
|
|
807
|
+
D(m.root), m.children.forEach((p) => {
|
|
808
|
+
D(p);
|
|
808
809
|
});
|
|
809
810
|
}), {
|
|
810
|
-
redos: [...I, ...
|
|
811
|
-
undos: [...
|
|
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
|
-
|
|
825
|
-
|
|
826
|
-
ue(0, h(
|
|
827
|
-
ue(1, h(
|
|
828
|
-
],
|
|
829
|
-
var
|
|
830
|
-
for (var
|
|
831
|
-
(s = o[i]) && (
|
|
832
|
-
return
|
|
833
|
-
}, q = (o, e) => (
|
|
834
|
-
let
|
|
835
|
-
constructor(o, e,
|
|
836
|
-
super(), this._hoverManagerService = o, this._sheetsThreadCommentPopupService = e, this._sheetsThreadCommentModel =
|
|
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.
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
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
|
-
|
|
860
|
-
|
|
861
|
-
q(0, h(
|
|
862
|
+
W = Wt([
|
|
863
|
+
O($.Rendered, W),
|
|
864
|
+
q(0, h(Ct)),
|
|
862
865
|
q(1, h(U)),
|
|
863
|
-
q(2, h(
|
|
864
|
-
],
|
|
865
|
-
var
|
|
866
|
-
for (var
|
|
867
|
-
(s = o[i]) && (
|
|
868
|
-
return
|
|
869
|
-
}, X = (o, e) => (
|
|
870
|
-
let
|
|
871
|
-
constructor(o, e,
|
|
872
|
-
super(), this._sheetInterceptorService = o, this._univerInstanceService = e, this._threadCommentModel =
|
|
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 ===
|
|
879
|
-
const e = o.params,
|
|
880
|
-
if (!
|
|
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 =
|
|
883
|
-
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:
|
|
889
|
+
subUnitId: n,
|
|
887
890
|
commentId: u
|
|
888
891
|
}
|
|
889
|
-
})),
|
|
890
|
-
id:
|
|
892
|
+
})), d = a.map((u) => ({
|
|
893
|
+
id: Z.id,
|
|
891
894
|
params: {
|
|
892
895
|
unitId: r,
|
|
893
|
-
subUnitId:
|
|
896
|
+
subUnitId: n,
|
|
894
897
|
comment: u
|
|
895
898
|
}
|
|
896
899
|
}));
|
|
897
|
-
return { redos: c, undos:
|
|
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
|
-
|
|
906
|
-
|
|
907
|
-
X(0, h(
|
|
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
|
-
],
|
|
911
|
-
var
|
|
912
|
-
for (var
|
|
913
|
-
(s = o[i]) && (
|
|
914
|
-
return
|
|
915
|
-
}, he = (o, e) => (
|
|
916
|
-
let
|
|
917
|
-
constructor(e = {},
|
|
918
|
-
super(
|
|
919
|
-
|
|
920
|
-
this._injector =
|
|
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
|
-
|
|
924
|
-
[
|
|
926
|
+
[
|
|
927
|
+
[y],
|
|
925
928
|
[
|
|
926
|
-
|
|
929
|
+
V,
|
|
927
930
|
{
|
|
928
|
-
useFactory: () => this._injector.createInstance(
|
|
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((
|
|
938
|
-
|
|
939
|
-
}), [
|
|
940
|
-
this._commandService.registerCommand(
|
|
940
|
+
].forEach((t) => {
|
|
941
|
+
e.add(t);
|
|
942
|
+
}), [K].forEach((t) => {
|
|
943
|
+
this._commandService.registerCommand(t);
|
|
941
944
|
});
|
|
942
945
|
}
|
|
943
|
-
}
|
|
944
|
-
|
|
945
|
-
|
|
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
|
-
],
|
|
953
|
+
], z);
|
|
948
954
|
export {
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
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
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
967
|
+
H as SheetsThreadCommentRefRangeController,
|
|
968
|
+
F as ThreadCommentRemoveSheetsController,
|
|
969
|
+
_n as UniverInstanceType,
|
|
970
|
+
z as UniverSheetsThreadCommentPlugin,
|
|
971
|
+
fn as UniverThreadCommentUIPlugin
|
|
966
972
|
};
|