@univerjs/sheets-thread-comment-ui 0.6.0-nightly.202502191606 → 0.6.0-nightly.202502201606
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 +338 -335
- package/lib/umd/index.js +1 -1
- package/package.json +14 -14
package/lib/es/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var E = (
|
|
4
|
-
import { Inject as
|
|
5
|
-
import { SheetsSelectionsService as
|
|
6
|
-
import { SheetsThreadCommentModel as
|
|
7
|
-
import { ThreadCommentPanelService as se, SetActiveCommentOperation as ee, ThreadCommentTree as
|
|
8
|
-
import { UniverThreadCommentUIPlugin as
|
|
9
|
-
import { SheetCanvasPopManagerService as
|
|
10
|
-
import { IZenZoneService as
|
|
11
|
-
import { BehaviorSubject as
|
|
1
|
+
var De = Object.defineProperty;
|
|
2
|
+
var Ae = (n, e, r) => e in n ? De(n, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[e] = r;
|
|
3
|
+
var E = (n, e, r) => Ae(n, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { Inject as v, Disposable as k, DisposableCollection as Ve, CommandType as He, IUniverInstanceService as N, InterceptorEffectEnum as je, UniverInstanceType as b, Range as Be, ICommandService as ie, RANGE_TYPE as he, Rectangle as Le, Tools as Fe, DependentOn as We, Injector as Ze, IConfigService as ze, Plugin as Ge, merge as Ke } from "@univerjs/core";
|
|
5
|
+
import { SheetsSelectionsService as ve, getSheetCommandTarget as Ye, SheetInterceptorService as _e, INTERCEPTOR_POINT as qe, SheetPermissionCheckController as Ce, RangeProtectionPermissionViewPoint as q, WorksheetViewPermission as J, WorkbookCommentPermission as Q, SetWorksheetActiveOperation as Je, RemoveSheetCommand as Qe } from "@univerjs/sheets";
|
|
6
|
+
import { SheetsThreadCommentModel as $, UniverSheetsThreadCommentPlugin as Xe } from "@univerjs/sheets-thread-comment";
|
|
7
|
+
import { ThreadCommentPanelService as se, SetActiveCommentOperation as ee, ThreadCommentTree as et, ThreadCommentPanel as tt, ToggleSheetCommentPanelOperation as Se, THREAD_COMMENT_PANEL as nt, UniverThreadCommentUIPlugin as rt } from "@univerjs/thread-comment-ui";
|
|
8
|
+
import { UniverThreadCommentUIPlugin as fn } from "@univerjs/thread-comment-ui";
|
|
9
|
+
import { SheetCanvasPopManagerService as ot, ISheetClipboardService as it, COPY_TYPE as st, HoverManagerService as at, IMarkSelectionService as fe, IEditorBridgeService as ct, SheetSkeletonManagerService as dt, ScrollToRangeOperation as ht, whenSheetEditorFocused as mt, getCurrentRangeDisable$ as ge } from "@univerjs/sheets-ui";
|
|
10
|
+
import { IZenZoneService as ut, useDependency as U, useObservable as D, KeyCode as lt, MetaKeys as me, getMenuHiddenObservable as Ie, MenuItemType as Pe, ContextMenuPosition as pt, ContextMenuGroup as vt, RibbonStartGroup as _t, IMenuManagerService as Ct, ComponentManager as St, IShortcutService as ft } from "@univerjs/ui";
|
|
11
|
+
import { BehaviorSubject as gt, debounceTime as ae, map as It } from "rxjs";
|
|
12
12
|
import { IRenderManagerService as Te } from "@univerjs/engine-render";
|
|
13
|
-
import { singleReferenceToGrid as A, serializeRange as
|
|
14
|
-
import { IThreadCommentDataSourceService as be, DeleteCommentMutation as
|
|
15
|
-
import { AddCommentCommand as
|
|
13
|
+
import { singleReferenceToGrid as A, serializeRange as Pt } from "@univerjs/engine-formula";
|
|
14
|
+
import { IThreadCommentDataSourceService as be, DeleteCommentMutation as L, AddCommentMutation as oe, ThreadCommentModel as Tt } from "@univerjs/thread-comment";
|
|
15
|
+
import { AddCommentCommand as In, DeleteCommentCommand as Pn, DeleteCommentTreeCommand as Tn, IThreadCommentDataSourceService as bn, ResolveCommentCommand as Mn, UpdateCommentCommand as wn } from "@univerjs/thread-comment";
|
|
16
16
|
import { jsx as Me } from "react/jsx-runtime";
|
|
17
|
-
import { forwardRef as we, useRef as ye, createElement as Ee, useMemo as
|
|
18
|
-
const
|
|
19
|
-
var
|
|
20
|
-
for (var
|
|
21
|
-
(s =
|
|
22
|
-
return
|
|
23
|
-
}, le = (
|
|
24
|
-
let
|
|
25
|
-
constructor(e,
|
|
17
|
+
import { forwardRef as we, useRef as ye, createElement as Ee, useMemo as bt, useCallback as ue, useEffect as Mt } from "react";
|
|
18
|
+
const Ue = "univer.sheet.thread-comment-modal", ce = "comment-single", Re = "SHEET_THREAD_COMMENT";
|
|
19
|
+
var wt = Object.getOwnPropertyDescriptor, yt = (n, e, r, t) => {
|
|
20
|
+
for (var o = t > 1 ? void 0 : t ? wt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
21
|
+
(s = n[i]) && (o = s(o) || o);
|
|
22
|
+
return o;
|
|
23
|
+
}, le = (n, e) => (r, t) => e(r, t, n);
|
|
24
|
+
let R = class extends k {
|
|
25
|
+
constructor(e, r) {
|
|
26
26
|
super();
|
|
27
27
|
E(this, "_lastPopup", null);
|
|
28
28
|
E(this, "_activePopup");
|
|
29
|
-
E(this, "_activePopup$", new
|
|
29
|
+
E(this, "_activePopup$", new gt(null));
|
|
30
30
|
E(this, "activePopup$", this._activePopup$.asObservable());
|
|
31
|
-
this._canvasPopupManagerService = e, this._zenZoneService =
|
|
31
|
+
this._canvasPopupManagerService = e, this._zenZoneService = r, this._initZenVisible(), this.disposeWithMe(() => {
|
|
32
32
|
this._activePopup$.complete();
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -40,10 +40,10 @@ let U = class extends N {
|
|
|
40
40
|
e && this.hidePopup();
|
|
41
41
|
}));
|
|
42
42
|
}
|
|
43
|
-
showPopup(e,
|
|
43
|
+
showPopup(e, r) {
|
|
44
44
|
var d;
|
|
45
|
-
const { row: t, col:
|
|
46
|
-
if (this._activePopup && t === this._activePopup.row &&
|
|
45
|
+
const { row: t, col: o, unitId: i, subUnitId: s } = e;
|
|
46
|
+
if (this._activePopup && t === this._activePopup.row && o === this._activePopup.col && i === this._activePopup.unitId && s === ((d = this.activePopup) == null ? void 0 : d.subUnitId)) {
|
|
47
47
|
this._activePopup = e, this._activePopup$.next(e);
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
@@ -52,9 +52,9 @@ let U = class extends N {
|
|
|
52
52
|
this._activePopup = e, this._activePopup$.next(e);
|
|
53
53
|
const a = this._canvasPopupManagerService.attachPopupToCell(
|
|
54
54
|
t,
|
|
55
|
-
|
|
55
|
+
o,
|
|
56
56
|
{
|
|
57
|
-
componentKey:
|
|
57
|
+
componentKey: Ue,
|
|
58
58
|
onClickOutside: () => {
|
|
59
59
|
this.hidePopup();
|
|
60
60
|
},
|
|
@@ -67,10 +67,10 @@ let U = class extends N {
|
|
|
67
67
|
);
|
|
68
68
|
if (!a)
|
|
69
69
|
throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");
|
|
70
|
-
const c = new
|
|
70
|
+
const c = new Ve();
|
|
71
71
|
c.add(a), c.add({
|
|
72
72
|
dispose: () => {
|
|
73
|
-
|
|
73
|
+
r == null || r();
|
|
74
74
|
}
|
|
75
75
|
}), this._lastPopup = c;
|
|
76
76
|
}
|
|
@@ -84,19 +84,19 @@ let U = class extends N {
|
|
|
84
84
|
}, this._activePopup$.next(this._activePopup));
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
|
|
88
|
-
le(0,
|
|
89
|
-
le(1,
|
|
90
|
-
],
|
|
87
|
+
R = yt([
|
|
88
|
+
le(0, v(ot)),
|
|
89
|
+
le(1, ut)
|
|
90
|
+
], R);
|
|
91
91
|
const V = {
|
|
92
|
-
type:
|
|
92
|
+
type: He.OPERATION,
|
|
93
93
|
id: "sheets.operation.show-comment-modal",
|
|
94
|
-
handler(
|
|
95
|
-
var
|
|
96
|
-
const e =
|
|
94
|
+
handler(n) {
|
|
95
|
+
var _;
|
|
96
|
+
const e = n.get(ve), r = n.get(N), t = n.get(R), o = n.get(se), i = (_ = e.getCurrentLastSelection()) == null ? void 0 : _.primary, s = n.get($);
|
|
97
97
|
if (!i)
|
|
98
98
|
return !1;
|
|
99
|
-
const a =
|
|
99
|
+
const a = Ye(r);
|
|
100
100
|
if (!a)
|
|
101
101
|
return !1;
|
|
102
102
|
const { workbook: c, worksheet: d, unitId: m, subUnitId: h } = a, u = {
|
|
@@ -109,41 +109,41 @@ const V = {
|
|
|
109
109
|
};
|
|
110
110
|
t.showPopup(u);
|
|
111
111
|
const p = s.getByLocation(m, h, i.startRow, i.startColumn);
|
|
112
|
-
return p &&
|
|
112
|
+
return p && o.setActiveComment({
|
|
113
113
|
unitId: m,
|
|
114
114
|
subUnitId: h,
|
|
115
115
|
commentId: p,
|
|
116
116
|
trigger: "context-menu"
|
|
117
117
|
}), !0;
|
|
118
118
|
}
|
|
119
|
-
},
|
|
120
|
-
var
|
|
121
|
-
for (var
|
|
122
|
-
(s =
|
|
123
|
-
return
|
|
124
|
-
}, H = (
|
|
125
|
-
let F = class extends
|
|
126
|
-
constructor(
|
|
127
|
-
super(), this._sheetInterceptorService =
|
|
119
|
+
}, Et = "sheets-thread-comment.config", pe = {};
|
|
120
|
+
var Ut = Object.getOwnPropertyDescriptor, Rt = (n, e, r, t) => {
|
|
121
|
+
for (var o = t > 1 ? void 0 : t ? Ut(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
122
|
+
(s = n[i]) && (o = s(o) || o);
|
|
123
|
+
return o;
|
|
124
|
+
}, H = (n, e) => (r, t) => e(r, t, n);
|
|
125
|
+
let F = class extends k {
|
|
126
|
+
constructor(n, e, r, t) {
|
|
127
|
+
super(), this._sheetInterceptorService = n, this._sheetsThreadCommentModel = e, this._univerInstanceService = r, this._renderManagerService = t, this._initViewModelIntercept(), this._initSkeletonChange();
|
|
128
128
|
}
|
|
129
129
|
_initViewModelIntercept() {
|
|
130
130
|
this.disposeWithMe(
|
|
131
131
|
this._sheetInterceptorService.intercept(
|
|
132
|
-
|
|
132
|
+
qe.CELL_CONTENT,
|
|
133
133
|
{
|
|
134
|
-
effect:
|
|
135
|
-
handler: (
|
|
136
|
-
const { row: t, col:
|
|
137
|
-
return this._sheetsThreadCommentModel.showCommentMarker(i, s, t,
|
|
138
|
-
...
|
|
134
|
+
effect: je.Style,
|
|
135
|
+
handler: (n, e, r) => {
|
|
136
|
+
const { row: t, col: o, unitId: i, subUnitId: s } = e;
|
|
137
|
+
return this._sheetsThreadCommentModel.showCommentMarker(i, s, t, o) ? r({
|
|
138
|
+
...n,
|
|
139
139
|
markers: {
|
|
140
|
-
...
|
|
140
|
+
...n == null ? void 0 : n.markers,
|
|
141
141
|
tr: {
|
|
142
142
|
color: "#FFBD37",
|
|
143
143
|
size: 6
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
}) : n
|
|
146
|
+
}) : r(n);
|
|
147
147
|
},
|
|
148
148
|
priority: 100
|
|
149
149
|
}
|
|
@@ -151,99 +151,99 @@ let F = class extends N {
|
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
153
|
_initSkeletonChange() {
|
|
154
|
-
const
|
|
155
|
-
var
|
|
154
|
+
const n = () => {
|
|
155
|
+
var o;
|
|
156
156
|
const e = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET);
|
|
157
157
|
if (!e) return;
|
|
158
|
-
const
|
|
159
|
-
(
|
|
158
|
+
const r = e.getUnitId(), t = this._renderManagerService.getRenderById(r);
|
|
159
|
+
(o = t == null ? void 0 : t.mainComponent) == null || o.makeForceDirty();
|
|
160
160
|
};
|
|
161
161
|
this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(ae(16)).subscribe(() => {
|
|
162
|
-
|
|
162
|
+
n();
|
|
163
163
|
}));
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
|
-
F =
|
|
167
|
-
H(0,
|
|
168
|
-
H(1,
|
|
169
|
-
H(2,
|
|
166
|
+
F = Rt([
|
|
167
|
+
H(0, v(_e)),
|
|
168
|
+
H(1, v($)),
|
|
169
|
+
H(2, N),
|
|
170
170
|
H(3, Te)
|
|
171
171
|
], F);
|
|
172
|
-
var
|
|
173
|
-
for (var
|
|
174
|
-
(s =
|
|
175
|
-
return
|
|
176
|
-
}, te = (
|
|
177
|
-
const
|
|
178
|
-
const t = A(
|
|
172
|
+
var Ot = Object.getOwnPropertyDescriptor, kt = (n, e, r, t) => {
|
|
173
|
+
for (var o = t > 1 ? void 0 : t ? Ot(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
174
|
+
(s = n[i]) && (o = s(o) || o);
|
|
175
|
+
return o;
|
|
176
|
+
}, te = (n, e) => (r, t) => e(r, t, n);
|
|
177
|
+
const Nt = (n, e, r) => {
|
|
178
|
+
const t = A(n), o = r.row - e.row, i = r.column - e.column, s = {
|
|
179
179
|
startColumn: t.column + i,
|
|
180
|
-
startRow: t.row +
|
|
180
|
+
startRow: t.row + o,
|
|
181
181
|
endColumn: t.column + i,
|
|
182
|
-
endRow: t.row +
|
|
182
|
+
endRow: t.row + o
|
|
183
183
|
};
|
|
184
|
-
return
|
|
184
|
+
return Pt(s);
|
|
185
185
|
};
|
|
186
|
-
let W = class extends
|
|
187
|
-
constructor(e,
|
|
186
|
+
let W = class extends k {
|
|
187
|
+
constructor(e, r, t) {
|
|
188
188
|
super();
|
|
189
189
|
E(this, "_copyInfo");
|
|
190
|
-
this._sheetClipboardService = e, this._sheetsThreadCommentModel =
|
|
190
|
+
this._sheetClipboardService = e, this._sheetsThreadCommentModel = r, this._threadCommentDataSourceService = t, this._initClipboardHook();
|
|
191
191
|
}
|
|
192
192
|
// eslint-disable-next-line max-lines-per-function
|
|
193
193
|
_initClipboardHook() {
|
|
194
194
|
this.disposeWithMe(
|
|
195
195
|
this._sheetClipboardService.addClipboardHook({
|
|
196
|
-
id:
|
|
197
|
-
onBeforeCopy: (e,
|
|
196
|
+
id: Re,
|
|
197
|
+
onBeforeCopy: (e, r, t) => {
|
|
198
198
|
this._copyInfo = {
|
|
199
199
|
unitId: e,
|
|
200
|
-
subUnitId:
|
|
200
|
+
subUnitId: r,
|
|
201
201
|
range: t
|
|
202
202
|
};
|
|
203
203
|
},
|
|
204
204
|
// eslint-disable-next-line max-lines-per-function
|
|
205
|
-
onPasteCells: (e,
|
|
206
|
-
const { unitId: i, subUnitId: s, range: a } =
|
|
205
|
+
onPasteCells: (e, r, t, o) => {
|
|
206
|
+
const { unitId: i, subUnitId: s, range: a } = r, c = {
|
|
207
207
|
row: a.rows[0],
|
|
208
208
|
column: a.cols[0]
|
|
209
209
|
};
|
|
210
|
-
if (
|
|
210
|
+
if (o.copyType === st.CUT && this._copyInfo) {
|
|
211
211
|
const { range: d, unitId: m, subUnitId: h } = this._copyInfo, u = {
|
|
212
212
|
row: d.startRow,
|
|
213
213
|
column: d.startColumn
|
|
214
214
|
};
|
|
215
215
|
if (!(i === m && s === h)) {
|
|
216
216
|
const p = [];
|
|
217
|
-
|
|
217
|
+
Be.foreach(d, (g, l) => {
|
|
218
218
|
const I = this._sheetsThreadCommentModel.getAllByLocation(m, h, g, l);
|
|
219
|
-
this._threadCommentDataSourceService.syncUpdateMutationToColla ? I.forEach((
|
|
220
|
-
p.push(
|
|
221
|
-
}) : I.forEach(({ children:
|
|
219
|
+
this._threadCommentDataSourceService.syncUpdateMutationToColla ? I.forEach((C) => {
|
|
220
|
+
p.push(C);
|
|
221
|
+
}) : I.forEach(({ children: C, ...M }) => {
|
|
222
222
|
M.parentId || p.push(M);
|
|
223
223
|
});
|
|
224
224
|
});
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
id:
|
|
225
|
+
const _ = [], f = [], O = [], x = [], X = (g) => {
|
|
226
|
+
_.unshift({
|
|
227
|
+
id: L.id,
|
|
228
228
|
params: {
|
|
229
229
|
unitId: m,
|
|
230
230
|
subUnitId: h,
|
|
231
231
|
commentId: g.id
|
|
232
232
|
}
|
|
233
|
-
}),
|
|
233
|
+
}), O.push({
|
|
234
234
|
id: oe.id,
|
|
235
235
|
params: {
|
|
236
236
|
unitId: i,
|
|
237
237
|
subUnitId: s,
|
|
238
238
|
comment: {
|
|
239
239
|
...g,
|
|
240
|
-
ref:
|
|
240
|
+
ref: Nt(g.ref, u, c),
|
|
241
241
|
unitId: i,
|
|
242
242
|
subUnitId: s
|
|
243
243
|
},
|
|
244
244
|
sync: !0
|
|
245
245
|
}
|
|
246
|
-
}),
|
|
246
|
+
}), f.push({
|
|
247
247
|
id: oe.id,
|
|
248
248
|
params: {
|
|
249
249
|
unitId: m,
|
|
@@ -252,7 +252,7 @@ let W = class extends N {
|
|
|
252
252
|
sync: !0
|
|
253
253
|
}
|
|
254
254
|
}), x.unshift({
|
|
255
|
-
id:
|
|
255
|
+
id: L.id,
|
|
256
256
|
params: {
|
|
257
257
|
unitId: i,
|
|
258
258
|
subUnitId: s,
|
|
@@ -263,8 +263,8 @@ let W = class extends N {
|
|
|
263
263
|
return p.forEach((g) => {
|
|
264
264
|
X(g);
|
|
265
265
|
}), {
|
|
266
|
-
redos: [...
|
|
267
|
-
undos: [...x, ...
|
|
266
|
+
redos: [..._, ...O],
|
|
267
|
+
undos: [...x, ...f]
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
270
|
}
|
|
@@ -277,37 +277,37 @@ let W = class extends N {
|
|
|
277
277
|
);
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
|
-
W =
|
|
281
|
-
te(0,
|
|
282
|
-
te(1,
|
|
280
|
+
W = kt([
|
|
281
|
+
te(0, v(it)),
|
|
282
|
+
te(1, v($)),
|
|
283
283
|
te(2, be)
|
|
284
284
|
], W);
|
|
285
|
-
var
|
|
286
|
-
for (var
|
|
287
|
-
(s =
|
|
288
|
-
return
|
|
289
|
-
},
|
|
290
|
-
let Z = class extends
|
|
291
|
-
constructor(
|
|
292
|
-
super(), this._hoverManagerService =
|
|
285
|
+
var $t = Object.getOwnPropertyDescriptor, xt = (n, e, r, t) => {
|
|
286
|
+
for (var o = t > 1 ? void 0 : t ? $t(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
287
|
+
(s = n[i]) && (o = s(o) || o);
|
|
288
|
+
return o;
|
|
289
|
+
}, j = (n, e) => (r, t) => e(r, t, n);
|
|
290
|
+
let Z = class extends k {
|
|
291
|
+
constructor(n, e, r, t) {
|
|
292
|
+
super(), this._hoverManagerService = n, this._sheetsThreadCommentPopupService = e, this._sheetsThreadCommentModel = r, this._sheetPermissionCheckController = t, this._initHoverEvent();
|
|
293
293
|
}
|
|
294
294
|
_initHoverEvent() {
|
|
295
295
|
this.disposeWithMe(
|
|
296
|
-
this._hoverManagerService.currentCell$.pipe(ae(100)).subscribe((
|
|
296
|
+
this._hoverManagerService.currentCell$.pipe(ae(100)).subscribe((n) => {
|
|
297
297
|
const e = this._sheetsThreadCommentPopupService.activePopup;
|
|
298
|
-
if (
|
|
299
|
-
const { location:
|
|
298
|
+
if (n && (e && e.temp || !e)) {
|
|
299
|
+
const { location: r } = n, { unitId: t, subUnitId: o, row: i, col: s } = r, a = this._sheetsThreadCommentModel.getByLocation(t, o, i, s);
|
|
300
300
|
if (a) {
|
|
301
301
|
if (!this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
302
|
-
workbookTypes: [
|
|
302
|
+
workbookTypes: [Q],
|
|
303
303
|
worksheetTypes: [J],
|
|
304
|
-
rangeTypes: [
|
|
304
|
+
rangeTypes: [q]
|
|
305
305
|
}, [{ startRow: i, startColumn: s, endRow: i, endColumn: s }]))
|
|
306
306
|
return;
|
|
307
|
-
const d = this._sheetsThreadCommentModel.getComment(t,
|
|
307
|
+
const d = this._sheetsThreadCommentModel.getComment(t, o, a);
|
|
308
308
|
d && !d.resolved && this._sheetsThreadCommentPopupService.showPopup({
|
|
309
309
|
unitId: t,
|
|
310
|
-
subUnitId:
|
|
310
|
+
subUnitId: o,
|
|
311
311
|
row: i,
|
|
312
312
|
col: s,
|
|
313
313
|
commentId: a,
|
|
@@ -320,42 +320,42 @@ let Z = class extends N {
|
|
|
320
320
|
);
|
|
321
321
|
}
|
|
322
322
|
};
|
|
323
|
-
Z =
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
323
|
+
Z = xt([
|
|
324
|
+
j(0, v(at)),
|
|
325
|
+
j(1, v(R)),
|
|
326
|
+
j(2, v($)),
|
|
327
|
+
j(3, v(Ce))
|
|
328
328
|
], Z);
|
|
329
|
-
var
|
|
330
|
-
for (var
|
|
331
|
-
(s =
|
|
332
|
-
return
|
|
333
|
-
}, w = (
|
|
334
|
-
let z = class extends
|
|
335
|
-
constructor(e,
|
|
329
|
+
var Dt = Object.getOwnPropertyDescriptor, At = (n, e, r, t) => {
|
|
330
|
+
for (var o = t > 1 ? void 0 : t ? Dt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
331
|
+
(s = n[i]) && (o = s(o) || o);
|
|
332
|
+
return o;
|
|
333
|
+
}, w = (n, e) => (r, t) => e(r, t, n);
|
|
334
|
+
let z = class extends k {
|
|
335
|
+
constructor(e, r, t, o, i, s, a, c, d, m) {
|
|
336
336
|
super();
|
|
337
337
|
E(this, "_isSwitchToCommenting", !1);
|
|
338
338
|
E(this, "_selectionShapeInfo", null);
|
|
339
|
-
this._commandService = e, this._sheetsThreadCommentPopupService =
|
|
339
|
+
this._commandService = e, this._sheetsThreadCommentPopupService = r, this._sheetsThreadCommentModel = t, this._threadCommentPanelService = o, this._univerInstanceService = i, this._sheetPermissionCheckController = s, this._markSelectionService = a, this._sheetSelectionService = c, this._editorBridgeService = d, this._renderManagerService = m, this._initCommandListener(), this._initPanelListener(), this._initMarkSelection(), this._initSelectionUpdateListener(), this._initEditorBridge();
|
|
340
340
|
}
|
|
341
|
-
_handleSelectionChange(e,
|
|
342
|
-
var u, p,
|
|
343
|
-
const
|
|
344
|
-
if (!s || !
|
|
341
|
+
_handleSelectionChange(e, r, t) {
|
|
342
|
+
var u, p, _;
|
|
343
|
+
const o = (u = e[0]) == null ? void 0 : u.range, i = this._renderManagerService.getRenderById(r), s = (p = i == null ? void 0 : i.with(dt).getSkeletonParam(t)) == null ? void 0 : p.skeleton;
|
|
344
|
+
if (!s || !o)
|
|
345
345
|
return;
|
|
346
|
-
const a = s.getCellWithCoordByIndex(
|
|
347
|
-
if ((((
|
|
346
|
+
const a = s.getCellWithCoordByIndex(o.startRow, o.startColumn);
|
|
347
|
+
if ((((_ = o.rangeType) != null ? _ : he.NORMAL) !== he.NORMAL || o.endColumn - o.startColumn > 0 || o.endRow - o.startRow > 0) && !((a.isMerged || a.isMergedMainCell) && Le.equals(a.mergeInfo, o))) {
|
|
348
348
|
this._threadCommentPanelService.activeCommentId && this._commandService.executeCommand(ee.id);
|
|
349
349
|
return;
|
|
350
350
|
}
|
|
351
351
|
const d = a.actualRow, m = a.actualColumn;
|
|
352
|
-
if (!this._sheetsThreadCommentModel.showCommentMarker(
|
|
352
|
+
if (!this._sheetsThreadCommentModel.showCommentMarker(r, t, d, m)) {
|
|
353
353
|
this._threadCommentPanelService.activeCommentId && this._commandService.executeCommand(ee.id);
|
|
354
354
|
return;
|
|
355
355
|
}
|
|
356
|
-
const h = this._sheetsThreadCommentModel.getByLocation(
|
|
356
|
+
const h = this._sheetsThreadCommentModel.getByLocation(r, t, d, m);
|
|
357
357
|
h && this._commandService.executeCommand(ee.id, {
|
|
358
|
-
unitId:
|
|
358
|
+
unitId: r,
|
|
359
359
|
subUnitId: t,
|
|
360
360
|
commentId: h
|
|
361
361
|
});
|
|
@@ -365,8 +365,8 @@ let z = class extends N {
|
|
|
365
365
|
this._sheetSelectionService.selectionMoveEnd$.subscribe((e) => {
|
|
366
366
|
if (this._isSwitchToCommenting)
|
|
367
367
|
return;
|
|
368
|
-
const
|
|
369
|
-
|
|
368
|
+
const r = this._sheetSelectionService.currentSelectionParam;
|
|
369
|
+
r && this._handleSelectionChange(e, r.unitId, r.sheetId);
|
|
370
370
|
})
|
|
371
371
|
);
|
|
372
372
|
}
|
|
@@ -379,49 +379,49 @@ let z = class extends N {
|
|
|
379
379
|
}
|
|
380
380
|
_initCommandListener() {
|
|
381
381
|
this._commandService.onCommandExecuted((e) => {
|
|
382
|
-
if (e.id ===
|
|
383
|
-
const
|
|
382
|
+
if (e.id === L.id) {
|
|
383
|
+
const r = e.params, t = this._sheetsThreadCommentPopupService.activePopup;
|
|
384
384
|
if (!t)
|
|
385
385
|
return;
|
|
386
|
-
const { unitId:
|
|
387
|
-
|
|
386
|
+
const { unitId: o, subUnitId: i, commentId: s } = t;
|
|
387
|
+
r.unitId === o && r.subUnitId === i && r.commentId === s && this._sheetsThreadCommentPopupService.hidePopup();
|
|
388
388
|
}
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
391
|
_initPanelListener() {
|
|
392
392
|
this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async (e) => {
|
|
393
|
-
var
|
|
393
|
+
var r;
|
|
394
394
|
if (e) {
|
|
395
|
-
const { unitId: t, subUnitId:
|
|
395
|
+
const { unitId: t, subUnitId: o, commentId: i, trigger: s } = e, a = this._sheetsThreadCommentModel.getComment(t, o, i);
|
|
396
396
|
if (!a || a.resolved)
|
|
397
397
|
return;
|
|
398
398
|
const c = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET);
|
|
399
399
|
if (!c || c.getUnitId() !== t)
|
|
400
400
|
return;
|
|
401
|
-
this._isSwitchToCommenting = !0, ((
|
|
401
|
+
this._isSwitchToCommenting = !0, ((r = c.getActiveSheet()) == null ? void 0 : r.getSheetId()) !== o && await this._commandService.executeCommand(Je.id, {
|
|
402
402
|
unitId: t,
|
|
403
|
-
subUnitId:
|
|
403
|
+
subUnitId: o
|
|
404
404
|
}), this._isSwitchToCommenting = !1;
|
|
405
405
|
const h = A(a.ref), { row: u, column: p } = h;
|
|
406
406
|
if (!this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
407
|
-
workbookTypes: [
|
|
407
|
+
workbookTypes: [Q],
|
|
408
408
|
worksheetTypes: [J],
|
|
409
|
-
rangeTypes: [
|
|
409
|
+
rangeTypes: [q]
|
|
410
410
|
}, [{ startRow: u, startColumn: p, endRow: u, endColumn: p }]))
|
|
411
411
|
return;
|
|
412
|
-
const
|
|
413
|
-
if (await this._commandService.executeCommand(
|
|
412
|
+
const f = 1;
|
|
413
|
+
if (await this._commandService.executeCommand(ht.id, {
|
|
414
414
|
range: {
|
|
415
|
-
startRow: Math.max(h.row -
|
|
416
|
-
endRow: h.row +
|
|
417
|
-
startColumn: Math.max(h.column -
|
|
418
|
-
endColumn: h.column +
|
|
415
|
+
startRow: Math.max(h.row - f, 0),
|
|
416
|
+
endRow: h.row + f,
|
|
417
|
+
startColumn: Math.max(h.column - f, 0),
|
|
418
|
+
endColumn: h.column + f
|
|
419
419
|
}
|
|
420
420
|
}), this._editorBridgeService.isVisible().visible)
|
|
421
421
|
return;
|
|
422
422
|
this._sheetsThreadCommentPopupService.showPopup({
|
|
423
423
|
unitId: t,
|
|
424
|
-
subUnitId:
|
|
424
|
+
subUnitId: o,
|
|
425
425
|
row: h.row,
|
|
426
426
|
col: h.column,
|
|
427
427
|
commentId: a.id,
|
|
@@ -438,9 +438,9 @@ let z = class extends N {
|
|
|
438
438
|
this._selectionShapeInfo && (this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId), this._selectionShapeInfo = null);
|
|
439
439
|
return;
|
|
440
440
|
}
|
|
441
|
-
const { unitId:
|
|
441
|
+
const { unitId: r, subUnitId: t, commentId: o } = e;
|
|
442
442
|
this._selectionShapeInfo && (this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId), this._selectionShapeInfo = null);
|
|
443
|
-
const i = this._sheetsThreadCommentModel.getComment(
|
|
443
|
+
const i = this._sheetsThreadCommentModel.getComment(r, t, o);
|
|
444
444
|
if (!i)
|
|
445
445
|
return;
|
|
446
446
|
const s = A(i.ref), { row: a, column: c } = s;
|
|
@@ -473,50 +473,50 @@ let z = class extends N {
|
|
|
473
473
|
}));
|
|
474
474
|
}
|
|
475
475
|
};
|
|
476
|
-
z =
|
|
476
|
+
z = At([
|
|
477
477
|
w(0, ie),
|
|
478
|
-
w(1,
|
|
479
|
-
w(2,
|
|
480
|
-
w(3,
|
|
481
|
-
w(4,
|
|
482
|
-
w(5,
|
|
483
|
-
w(6,
|
|
484
|
-
w(7,
|
|
485
|
-
w(8,
|
|
478
|
+
w(1, v(R)),
|
|
479
|
+
w(2, v($)),
|
|
480
|
+
w(3, v(se)),
|
|
481
|
+
w(4, N),
|
|
482
|
+
w(5, v(Ce)),
|
|
483
|
+
w(6, fe),
|
|
484
|
+
w(7, v(ve)),
|
|
485
|
+
w(8, ct),
|
|
486
486
|
w(9, Te)
|
|
487
487
|
], z);
|
|
488
|
-
var
|
|
489
|
-
for (var
|
|
490
|
-
(s =
|
|
491
|
-
return
|
|
492
|
-
},
|
|
493
|
-
let G = class extends
|
|
494
|
-
constructor(
|
|
495
|
-
super(), this._sheetInterceptorService =
|
|
488
|
+
var Vt = Object.getOwnPropertyDescriptor, Ht = (n, e, r, t) => {
|
|
489
|
+
for (var o = t > 1 ? void 0 : t ? Vt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
490
|
+
(s = n[i]) && (o = s(o) || o);
|
|
491
|
+
return o;
|
|
492
|
+
}, B = (n, e) => (r, t) => e(r, t, n);
|
|
493
|
+
let G = class extends k {
|
|
494
|
+
constructor(n, e, r, t) {
|
|
495
|
+
super(), this._sheetInterceptorService = n, this._univerInstanceService = e, this._threadCommentModel = r, this._threadCommentDataSourceService = t, this._initSheetChange();
|
|
496
496
|
}
|
|
497
497
|
_initSheetChange() {
|
|
498
498
|
this.disposeWithMe(
|
|
499
499
|
this._sheetInterceptorService.interceptCommand({
|
|
500
|
-
getMutations: (
|
|
500
|
+
getMutations: (n) => {
|
|
501
501
|
var e;
|
|
502
|
-
if (
|
|
503
|
-
const
|
|
502
|
+
if (n.id === Qe.id) {
|
|
503
|
+
const r = n.params, t = r.unitId ? this._univerInstanceService.getUnit(r.unitId) : this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET);
|
|
504
504
|
if (!t)
|
|
505
505
|
return { redos: [], undos: [] };
|
|
506
|
-
const
|
|
506
|
+
const o = t.getUnitId(), i = r.subUnitId || ((e = t.getActiveSheet()) == null ? void 0 : e.getSheetId());
|
|
507
507
|
if (!i)
|
|
508
508
|
return { redos: [], undos: [] };
|
|
509
|
-
const s = this._threadCommentModel.ensureMap(
|
|
510
|
-
id:
|
|
509
|
+
const s = this._threadCommentModel.ensureMap(o, i), a = Array.from(s.values()).filter((u) => !u.parentId), c = a.map((u) => u.id), d = this._threadCommentDataSourceService.syncUpdateMutationToColla, m = c.map((u) => ({
|
|
510
|
+
id: L.id,
|
|
511
511
|
params: {
|
|
512
|
-
unitId:
|
|
512
|
+
unitId: o,
|
|
513
513
|
subUnitId: i,
|
|
514
514
|
commentId: u
|
|
515
515
|
}
|
|
516
516
|
})), h = a.map(({ children: u, ...p }) => ({
|
|
517
517
|
id: oe.id,
|
|
518
518
|
params: {
|
|
519
|
-
unitId:
|
|
519
|
+
unitId: o,
|
|
520
520
|
subUnitId: i,
|
|
521
521
|
comment: {
|
|
522
522
|
...p,
|
|
@@ -533,75 +533,78 @@ let G = class extends N {
|
|
|
533
533
|
);
|
|
534
534
|
}
|
|
535
535
|
};
|
|
536
|
-
G =
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
536
|
+
G = Ht([
|
|
537
|
+
B(0, v(_e)),
|
|
538
|
+
B(1, N),
|
|
539
|
+
B(2, v(Tt)),
|
|
540
|
+
B(3, be)
|
|
541
541
|
], G);
|
|
542
542
|
var P = function() {
|
|
543
|
-
return P = Object.assign || function(
|
|
544
|
-
for (var e,
|
|
545
|
-
e = arguments[
|
|
546
|
-
for (var
|
|
543
|
+
return P = Object.assign || function(n) {
|
|
544
|
+
for (var e, r = 1, t = arguments.length; r < t; r++) {
|
|
545
|
+
e = arguments[r];
|
|
546
|
+
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (n[o] = e[o]);
|
|
547
547
|
}
|
|
548
|
-
return
|
|
548
|
+
return n;
|
|
549
549
|
}, P.apply(this, arguments);
|
|
550
|
-
},
|
|
551
|
-
var
|
|
552
|
-
for (var t in
|
|
553
|
-
if (
|
|
554
|
-
for (var
|
|
555
|
-
e.indexOf(t[
|
|
556
|
-
return
|
|
557
|
-
},
|
|
558
|
-
var
|
|
559
|
-
return
|
|
550
|
+
}, jt = function(n, e) {
|
|
551
|
+
var r = {};
|
|
552
|
+
for (var t in n) Object.prototype.hasOwnProperty.call(n, t) && e.indexOf(t) < 0 && (r[t] = n[t]);
|
|
553
|
+
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
554
|
+
for (var o = 0, t = Object.getOwnPropertySymbols(n); o < t.length; o++)
|
|
555
|
+
e.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(n, t[o]) && (r[t[o]] = n[t[o]]);
|
|
556
|
+
return r;
|
|
557
|
+
}, Oe = we(function(n, e) {
|
|
558
|
+
var r = n.icon, t = n.id, o = n.className, i = n.extend, s = jt(n, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(o || "").trim(), c = ye("_".concat(Ft()));
|
|
559
|
+
return ke(r, "".concat(t), { defIds: r.defIds, idSuffix: c.current }, P({ ref: e, className: a }, s), i);
|
|
560
560
|
});
|
|
561
|
-
function
|
|
562
|
-
return Ee(
|
|
563
|
-
return
|
|
561
|
+
function ke(n, e, r, t, o) {
|
|
562
|
+
return Ee(n.tag, P(P({ key: e }, Bt(n, r, o)), t), (Lt(n, r).children || []).map(function(i, s) {
|
|
563
|
+
return ke(i, "".concat(e, "-").concat(n.tag, "-").concat(s), r, void 0, o);
|
|
564
564
|
}));
|
|
565
565
|
}
|
|
566
|
-
function
|
|
567
|
-
var t = P({},
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
566
|
+
function Bt(n, e, r) {
|
|
567
|
+
var t = P({}, n.attrs);
|
|
568
|
+
r != null && r.colorChannel1 && t.fill === "colorChannel1" && (t.fill = r.colorChannel1), n.tag === "mask" && t.id && (t.id = t.id + e.idSuffix), Object.entries(t).forEach(function(i) {
|
|
569
|
+
var s = i[0], a = i[1];
|
|
570
|
+
s === "mask" && typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
571
|
+
});
|
|
572
|
+
var o = e.defIds;
|
|
573
|
+
return !o || o.length === 0 || (n.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + e.idSuffix), Object.entries(t).forEach(function(i) {
|
|
571
574
|
var s = i[0], a = i[1];
|
|
572
575
|
typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
573
576
|
})), t;
|
|
574
577
|
}
|
|
575
|
-
function
|
|
576
|
-
var
|
|
577
|
-
return !t || t.length === 0 ?
|
|
578
|
-
return typeof
|
|
579
|
-
}) }) :
|
|
578
|
+
function Lt(n, e) {
|
|
579
|
+
var r, t = e.defIds;
|
|
580
|
+
return !t || t.length === 0 ? n : n.tag === "defs" && (!((r = n.children) === null || r === void 0) && r.length) ? P(P({}, n), { children: n.children.map(function(o) {
|
|
581
|
+
return typeof o.attrs.id == "string" && t && t.indexOf(o.attrs.id) > -1 ? P(P({}, o), { attrs: P(P({}, o.attrs), { id: o.attrs.id + e.idSuffix }) }) : o;
|
|
582
|
+
}) }) : n;
|
|
580
583
|
}
|
|
581
|
-
function
|
|
584
|
+
function Ft() {
|
|
582
585
|
return Math.random().toString(36).substring(2, 8);
|
|
583
586
|
}
|
|
584
|
-
|
|
585
|
-
var
|
|
586
|
-
return Ee(
|
|
587
|
+
Oe.displayName = "UniverIcon";
|
|
588
|
+
var Wt = { 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" } }] }, Ne = we(function(n, e) {
|
|
589
|
+
return Ee(Oe, Object.assign({}, n, {
|
|
587
590
|
id: "comment-single",
|
|
588
591
|
ref: e,
|
|
589
|
-
icon:
|
|
592
|
+
icon: Wt
|
|
590
593
|
}));
|
|
591
594
|
});
|
|
592
|
-
|
|
593
|
-
const
|
|
594
|
-
const
|
|
595
|
-
if (
|
|
595
|
+
Ne.displayName = "CommentSingle";
|
|
596
|
+
const Zt = () => {
|
|
597
|
+
const n = U(N), e = U(R), r = D(e.activePopup$), t = U($);
|
|
598
|
+
if (D(t.commentUpdate$), !r)
|
|
596
599
|
return null;
|
|
597
|
-
const { row:
|
|
600
|
+
const { row: o, col: i, unitId: s, subUnitId: a, trigger: c } = r, d = t.getByLocation(s, a, o, i), m = `${Fe.chatAtABC(i)}${o + 1}`, h = () => {
|
|
598
601
|
e.hidePopup();
|
|
599
602
|
}, u = (p) => {
|
|
600
|
-
var
|
|
601
|
-
return (
|
|
603
|
+
var _, f, O;
|
|
604
|
+
return (O = (f = (_ = n.getCurrentUnitForType(b.UNIVER_SHEET)) == null ? void 0 : _.getSheetBySheetId(p)) == null ? void 0 : f.getName()) != null ? O : "";
|
|
602
605
|
};
|
|
603
606
|
return /* @__PURE__ */ Me(
|
|
604
|
-
|
|
607
|
+
et,
|
|
605
608
|
{
|
|
606
609
|
onClick: () => {
|
|
607
610
|
e.persistPopup();
|
|
@@ -617,34 +620,34 @@ const Qt = () => {
|
|
|
617
620
|
autoFocus: c === "context-menu"
|
|
618
621
|
}
|
|
619
622
|
);
|
|
620
|
-
},
|
|
623
|
+
}, zt = () => {
|
|
621
624
|
var g;
|
|
622
|
-
const
|
|
623
|
-
const I = t.getSheets(),
|
|
624
|
-
I.forEach((T,
|
|
625
|
-
|
|
625
|
+
const n = U(fe), e = U(N), r = U(R), t = e.getCurrentUnitForType(b.UNIVER_SHEET), o = t.getUnitId(), i = U(ie), s = bt(() => t.activeSheet$.pipe(It((l) => l == null ? void 0 : l.getSheetId())), [t.activeSheet$]), a = D(s, (g = t.getActiveSheet()) == null ? void 0 : g.getSheetId()), c = ye(null), d = U(se), m = D(d.activeCommentId$), h = D(d.panelVisible$, d.panelVisible), u = ue((l) => {
|
|
626
|
+
const I = t.getSheets(), C = {};
|
|
627
|
+
I.forEach((T, S) => {
|
|
628
|
+
C[T.getSheetId()] = S;
|
|
626
629
|
});
|
|
627
|
-
const M = (T) => T.map((
|
|
630
|
+
const M = (T) => T.map((S) => {
|
|
628
631
|
var de;
|
|
629
|
-
const y = A(
|
|
630
|
-
return { ...
|
|
631
|
-
}).sort((
|
|
632
|
+
const y = A(S.ref), xe = [(de = C[S.subUnitId]) != null ? de : 0, y.row, y.column];
|
|
633
|
+
return { ...S, p: xe };
|
|
634
|
+
}).sort((S, y) => S.p[0] === y.p[0] ? S.p[1] === y.p[1] ? S.p[2] - y.p[2] : S.p[1] - y.p[1] : S.p[0] - y.p[0]);
|
|
632
635
|
return [
|
|
633
636
|
...M(l.filter((T) => !T.resolved)),
|
|
634
637
|
...M(l.filter((T) => T.resolved))
|
|
635
638
|
];
|
|
636
639
|
}, [t]), p = ue((l) => {
|
|
637
640
|
var I;
|
|
638
|
-
if (l.unitId ===
|
|
639
|
-
const { row:
|
|
641
|
+
if (l.unitId === o && l.subUnitId === a && !l.resolved) {
|
|
642
|
+
const { row: C, column: M } = A(l.ref), T = t.getSheetBySheetId(l.subUnitId), S = (I = T == null ? void 0 : T.getMergedCell(C, M)) != null ? I : {
|
|
640
643
|
startColumn: M,
|
|
641
644
|
endColumn: M,
|
|
642
|
-
startRow:
|
|
643
|
-
endRow:
|
|
645
|
+
startRow: C,
|
|
646
|
+
endRow: C
|
|
644
647
|
};
|
|
645
|
-
if (!Number.isNaN(
|
|
646
|
-
return
|
|
647
|
-
range:
|
|
648
|
+
if (!Number.isNaN(C) && !Number.isNaN(M))
|
|
649
|
+
return n.addShape({
|
|
650
|
+
range: S,
|
|
648
651
|
style: {
|
|
649
652
|
// hasAutoFill: false,
|
|
650
653
|
fill: "rgb(255, 189, 55, 0.35)",
|
|
@@ -656,121 +659,121 @@ const Qt = () => {
|
|
|
656
659
|
});
|
|
657
660
|
}
|
|
658
661
|
return null;
|
|
659
|
-
}, [
|
|
660
|
-
var I,
|
|
661
|
-
return (
|
|
662
|
-
},
|
|
662
|
+
}, [n, a, o]), _ = (l) => {
|
|
663
|
+
var I, C;
|
|
664
|
+
return (C = (I = t.getSheetBySheetId(l)) == null ? void 0 : I.getName()) != null ? C : "";
|
|
665
|
+
}, f = () => {
|
|
663
666
|
i.executeCommand(V.id);
|
|
664
|
-
},
|
|
665
|
-
m && m.unitId === l.unitId && m.subUnitId === l.subUnitId && m.commentId === l.id || (c.current && (
|
|
667
|
+
}, O = (l) => {
|
|
668
|
+
m && m.unitId === l.unitId && m.subUnitId === l.subUnitId && m.commentId === l.id || (c.current && (n.removeShape(c.current), c.current = null), c.current = p(l));
|
|
666
669
|
}, x = () => {
|
|
667
|
-
c.current && (
|
|
670
|
+
c.current && (n.removeShape(c.current), c.current = null);
|
|
668
671
|
}, X = (l, I) => {
|
|
669
|
-
I &&
|
|
672
|
+
I && r.hidePopup();
|
|
670
673
|
};
|
|
671
|
-
return
|
|
672
|
-
!h && c.current &&
|
|
673
|
-
}, [
|
|
674
|
-
|
|
674
|
+
return Mt(() => {
|
|
675
|
+
!h && c.current && n.removeShape(c.current);
|
|
676
|
+
}, [n, h]), /* @__PURE__ */ Me(
|
|
677
|
+
tt,
|
|
675
678
|
{
|
|
676
|
-
unitId:
|
|
679
|
+
unitId: o,
|
|
677
680
|
subUnitId$: s,
|
|
678
681
|
type: b.UNIVER_SHEET,
|
|
679
|
-
onAdd:
|
|
680
|
-
getSubUnitName:
|
|
682
|
+
onAdd: f,
|
|
683
|
+
getSubUnitName: _,
|
|
681
684
|
onResolve: X,
|
|
682
685
|
sortComments: u,
|
|
683
|
-
onItemEnter:
|
|
686
|
+
onItemEnter: O,
|
|
684
687
|
onItemLeave: x,
|
|
685
688
|
onDeleteComment: () => (x(), !0)
|
|
686
689
|
}
|
|
687
690
|
);
|
|
688
|
-
},
|
|
691
|
+
}, Gt = (n) => ({
|
|
689
692
|
id: V.id,
|
|
690
|
-
type:
|
|
693
|
+
type: Pe.BUTTON,
|
|
691
694
|
icon: ce,
|
|
692
695
|
title: "sheetThreadComment.menu.addComment",
|
|
693
|
-
hidden$:
|
|
694
|
-
disabled$: ge(
|
|
695
|
-
workbookTypes: [
|
|
696
|
+
hidden$: Ie(n, b.UNIVER_SHEET),
|
|
697
|
+
disabled$: ge(n, {
|
|
698
|
+
workbookTypes: [Q],
|
|
696
699
|
worksheetTypes: [J],
|
|
697
|
-
rangeTypes: [
|
|
700
|
+
rangeTypes: [q]
|
|
698
701
|
})
|
|
699
|
-
}),
|
|
700
|
-
id:
|
|
701
|
-
type:
|
|
702
|
+
}), Kt = (n) => ({
|
|
703
|
+
id: Se.id,
|
|
704
|
+
type: Pe.BUTTON,
|
|
702
705
|
icon: ce,
|
|
703
706
|
tooltip: "sheetThreadComment.menu.commentManagement",
|
|
704
|
-
disabled$: ge(
|
|
705
|
-
workbookTypes: [
|
|
707
|
+
disabled$: ge(n, {
|
|
708
|
+
workbookTypes: [Q],
|
|
706
709
|
worksheetTypes: [J],
|
|
707
|
-
rangeTypes: [
|
|
710
|
+
rangeTypes: [q]
|
|
708
711
|
}),
|
|
709
|
-
hidden$:
|
|
710
|
-
}),
|
|
712
|
+
hidden$: Ie(n, b.UNIVER_SHEET)
|
|
713
|
+
}), Yt = {
|
|
711
714
|
id: V.id,
|
|
712
|
-
binding:
|
|
713
|
-
preconditions:
|
|
714
|
-
},
|
|
715
|
+
binding: lt.M | me.CTRL_COMMAND | me.ALT,
|
|
716
|
+
preconditions: mt
|
|
717
|
+
}, qt = {
|
|
715
718
|
[_t.OTHERS]: {
|
|
716
|
-
[
|
|
719
|
+
[Se.id]: {
|
|
717
720
|
order: 1,
|
|
718
|
-
menuItemFactory:
|
|
721
|
+
menuItemFactory: Kt
|
|
719
722
|
}
|
|
720
723
|
},
|
|
721
|
-
[
|
|
722
|
-
[
|
|
724
|
+
[pt.MAIN_AREA]: {
|
|
725
|
+
[vt.OTHERS]: {
|
|
723
726
|
[V.id]: {
|
|
724
727
|
order: 0,
|
|
725
|
-
menuItemFactory:
|
|
728
|
+
menuItemFactory: Gt
|
|
726
729
|
}
|
|
727
730
|
}
|
|
728
731
|
}
|
|
729
732
|
};
|
|
730
|
-
var
|
|
731
|
-
for (var
|
|
732
|
-
(s =
|
|
733
|
-
return
|
|
734
|
-
}, ne = (
|
|
735
|
-
let K = class extends
|
|
736
|
-
constructor(
|
|
737
|
-
super(), this._menuManagerService =
|
|
733
|
+
var Jt = Object.getOwnPropertyDescriptor, Qt = (n, e, r, t) => {
|
|
734
|
+
for (var o = t > 1 ? void 0 : t ? Jt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
735
|
+
(s = n[i]) && (o = s(o) || o);
|
|
736
|
+
return o;
|
|
737
|
+
}, ne = (n, e) => (r, t) => e(r, t, n);
|
|
738
|
+
let K = class extends k {
|
|
739
|
+
constructor(n, e, r) {
|
|
740
|
+
super(), this._menuManagerService = n, this._componentManager = e, this._shortcutService = r, this._initMenu(), this._initShortcut(), this._initComponent();
|
|
738
741
|
}
|
|
739
742
|
_initShortcut() {
|
|
740
|
-
this._shortcutService.registerShortcut(
|
|
743
|
+
this._shortcutService.registerShortcut(Yt);
|
|
741
744
|
}
|
|
742
745
|
_initMenu() {
|
|
743
|
-
this._menuManagerService.mergeMenu(
|
|
746
|
+
this._menuManagerService.mergeMenu(qt);
|
|
744
747
|
}
|
|
745
748
|
_initComponent() {
|
|
746
749
|
[
|
|
747
|
-
[
|
|
748
|
-
[
|
|
749
|
-
[ce,
|
|
750
|
-
].forEach(([
|
|
751
|
-
this._componentManager.register(
|
|
750
|
+
[Ue, Zt],
|
|
751
|
+
[nt, zt],
|
|
752
|
+
[ce, Ne]
|
|
753
|
+
].forEach(([n, e]) => {
|
|
754
|
+
this._componentManager.register(n, e);
|
|
752
755
|
});
|
|
753
756
|
}
|
|
754
757
|
};
|
|
755
|
-
K =
|
|
756
|
-
ne(0,
|
|
757
|
-
ne(1,
|
|
758
|
-
ne(2,
|
|
758
|
+
K = Qt([
|
|
759
|
+
ne(0, Ct),
|
|
760
|
+
ne(1, v(St)),
|
|
761
|
+
ne(2, ft)
|
|
759
762
|
], K);
|
|
760
|
-
var
|
|
761
|
-
for (var
|
|
762
|
-
(s =
|
|
763
|
-
return
|
|
764
|
-
}, re = (
|
|
763
|
+
var Xt = Object.defineProperty, en = Object.getOwnPropertyDescriptor, tn = (n, e, r) => e in n ? Xt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[e] = r, nn = (n, e, r, t) => {
|
|
764
|
+
for (var o = t > 1 ? void 0 : t ? en(e, r) : e, i = n.length - 1, s; i >= 0; i--)
|
|
765
|
+
(s = n[i]) && (o = s(o) || o);
|
|
766
|
+
return o;
|
|
767
|
+
}, re = (n, e) => (r, t) => e(r, t, n), $e = (n, e, r) => tn(n, typeof e != "symbol" ? e + "" : e, r);
|
|
765
768
|
let Y = class extends Ge {
|
|
766
|
-
constructor(
|
|
767
|
-
super(), this._config =
|
|
768
|
-
const { menu:
|
|
769
|
+
constructor(n = pe, e, r, t) {
|
|
770
|
+
super(), this._config = n, this._injector = e, this._commandService = r, this._configService = t;
|
|
771
|
+
const { menu: o, ...i } = Ke(
|
|
769
772
|
{},
|
|
770
773
|
pe,
|
|
771
774
|
this._config
|
|
772
775
|
);
|
|
773
|
-
|
|
776
|
+
o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(Et, i);
|
|
774
777
|
}
|
|
775
778
|
onStarting() {
|
|
776
779
|
[
|
|
@@ -780,11 +783,11 @@ let Y = class extends Ge {
|
|
|
780
783
|
[Z],
|
|
781
784
|
[G],
|
|
782
785
|
[z],
|
|
783
|
-
[
|
|
784
|
-
].forEach((
|
|
785
|
-
this._injector.add(
|
|
786
|
-
}), [V].forEach((
|
|
787
|
-
this._commandService.registerCommand(
|
|
786
|
+
[R]
|
|
787
|
+
].forEach((n) => {
|
|
788
|
+
this._injector.add(n);
|
|
789
|
+
}), [V].forEach((n) => {
|
|
790
|
+
this._commandService.registerCommand(n);
|
|
788
791
|
}), this._injector.get(K);
|
|
789
792
|
}
|
|
790
793
|
onReady() {
|
|
@@ -794,24 +797,24 @@ let Y = class extends Ge {
|
|
|
794
797
|
this._injector.get(W), this._injector.get(Z), this._injector.get(z);
|
|
795
798
|
}
|
|
796
799
|
};
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
Y =
|
|
800
|
-
|
|
801
|
-
re(1,
|
|
802
|
-
re(2,
|
|
803
|
-
re(3,
|
|
800
|
+
$e(Y, "pluginName", Re);
|
|
801
|
+
$e(Y, "type", b.UNIVER_SHEET);
|
|
802
|
+
Y = nn([
|
|
803
|
+
We(rt, Xe),
|
|
804
|
+
re(1, v(Ze)),
|
|
805
|
+
re(2, v(ie)),
|
|
806
|
+
re(3, ze)
|
|
804
807
|
], Y);
|
|
805
808
|
export {
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
809
|
+
In as AddCommentCommand,
|
|
810
|
+
Pn as DeleteCommentCommand,
|
|
811
|
+
Tn as DeleteCommentTreeCommand,
|
|
812
|
+
bn as IThreadCommentDataSourceService,
|
|
813
|
+
Mn as ResolveCommentCommand,
|
|
814
|
+
Re as SHEETS_THREAD_COMMENT,
|
|
815
|
+
R as SheetsThreadCommentPopupService,
|
|
813
816
|
V as ShowAddSheetCommentModalOperation,
|
|
814
817
|
Y as UniverSheetsThreadCommentUIPlugin,
|
|
815
|
-
|
|
816
|
-
|
|
818
|
+
fn as UniverThreadCommentUIPlugin,
|
|
819
|
+
wn as UpdateCommentCommand
|
|
817
820
|
};
|