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