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