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