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