@univerjs/sheets-note-ui 0.9.3 → 0.9.4
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 +225 -244
- package/lib/index.css +1 -1
- package/lib/index.js +225 -244
- package/lib/umd/index.js +1 -1
- package/package.json +8 -8
package/lib/es/index.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { Inject as
|
|
1
|
+
var Se = Object.defineProperty;
|
|
2
|
+
var Pe = (t, e, i) => e in t ? Se(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
|
|
3
|
+
var g = (t, e, i) => Pe(t, typeof e != "symbol" ? e + "" : e, i);
|
|
4
|
+
import { Inject as h, IUniverInstanceService as D, Disposable as N, InterceptorEffectEnum as Ie, UniverInstanceType as w, DisposableCollection as Ne, RANGE_TYPE as Q, Rectangle as we, ObjectMatrix as B, CommandType as Me, LocaleService as be, ICommandService as ne, DependentOn as ye, Injector as Ee, IConfigService as Oe, Plugin as xe, merge as He, touchDependencies as X } from "@univerjs/core";
|
|
5
5
|
import { IRenderManagerService as F } from "@univerjs/engine-render";
|
|
6
|
-
import { SheetInterceptorService as
|
|
7
|
-
import { SheetsNoteModel as M, SheetUpdateNoteCommand as
|
|
8
|
-
import { debounceTime as
|
|
9
|
-
import { CellPopupManagerService as
|
|
10
|
-
import { debounceTime as
|
|
11
|
-
import { IZenZoneService as
|
|
12
|
-
import { jsx as
|
|
13
|
-
import {
|
|
14
|
-
import { forwardRef as V, useRef as
|
|
15
|
-
var
|
|
16
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
17
|
-
(
|
|
6
|
+
import { SheetInterceptorService as Te, INTERCEPTOR_POINT as $e, SheetsSelectionsService as W, WorksheetEditPermission as oe, WorkbookEditablePermission as se, getSheetCommandTarget as Le } from "@univerjs/sheets";
|
|
7
|
+
import { SheetsNoteModel as M, SheetUpdateNoteCommand as Ue, SheetDeleteNoteCommand as z, SheetToggleNotePopupCommand as ae, UniverSheetsNotePlugin as De } from "@univerjs/sheets-note";
|
|
8
|
+
import { debounceTime as Re, BehaviorSubject as Ve, switchMap as je, of as Ze, map as R, combineLatest as ke } from "rxjs";
|
|
9
|
+
import { CellPopupManagerService as ce, IEditorBridgeService as Be, HoverManagerService as Ae, SheetSkeletonManagerService as Fe, getCurrentRangeDisable$ as ue } from "@univerjs/sheets-ui";
|
|
10
|
+
import { debounceTime as We } from "rxjs/operators";
|
|
11
|
+
import { IZenZoneService as ze, useDependency as y, useConfigValue as Ge, useDebounceFn as Ke, MenuItemType as G, getMenuHiddenObservable as Ye, ContextMenuPosition as qe, ContextMenuGroup as Je, ComponentManager as Qe, IMenuManagerService as Xe } from "@univerjs/ui";
|
|
12
|
+
import { jsx as et } from "react/jsx-runtime";
|
|
13
|
+
import { Textarea as tt, clsx as it } from "@univerjs/design";
|
|
14
|
+
import { forwardRef as V, useRef as le, createElement as j, useState as rt, useEffect as nt, useCallback as ee } from "react";
|
|
15
|
+
var ot = Object.getOwnPropertyDescriptor, st = (t, e, i, r) => {
|
|
16
|
+
for (var n = r > 1 ? void 0 : r ? ot(e, i) : e, s = t.length - 1, o; s >= 0; s--)
|
|
17
|
+
(o = t[s]) && (n = o(n) || n);
|
|
18
18
|
return n;
|
|
19
19
|
}, E = (t, e) => (i, r) => e(i, r, t);
|
|
20
|
-
let x = class extends
|
|
20
|
+
let x = class extends N {
|
|
21
21
|
constructor(t, e, i, r) {
|
|
22
22
|
super(), this._sheetInterceptorService = t, this._sheetsNoteModel = e, this._renderManagerService = i, this._univerInstanceService = r, this._initViewModelIntercept(), this._initSkeletonChange();
|
|
23
23
|
}
|
|
24
24
|
_initViewModelIntercept() {
|
|
25
25
|
this.disposeWithMe(
|
|
26
26
|
this._sheetInterceptorService.intercept(
|
|
27
|
-
|
|
27
|
+
$e.CELL_CONTENT,
|
|
28
28
|
{
|
|
29
|
-
effect:
|
|
29
|
+
effect: Ie.Style,
|
|
30
30
|
handler: (t, e, i) => {
|
|
31
|
-
const { row: r, col: n, unitId:
|
|
32
|
-
return this._sheetsNoteModel.getNote(
|
|
31
|
+
const { row: r, col: n, unitId: s, subUnitId: o } = e;
|
|
32
|
+
return this._sheetsNoteModel.getNote(s, o, r, n) && ((!t || t === e.rawData) && (t = { ...e.rawData }), t.markers = {
|
|
33
33
|
...t == null ? void 0 : t.markers,
|
|
34
34
|
tr: {
|
|
35
35
|
color: "#FFBD37",
|
|
@@ -45,35 +45,35 @@ let x = class extends w {
|
|
|
45
45
|
_initSkeletonChange() {
|
|
46
46
|
const t = () => {
|
|
47
47
|
var n;
|
|
48
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
48
|
+
const e = this._univerInstanceService.getCurrentUnitForType(w.UNIVER_SHEET);
|
|
49
49
|
if (!e) return;
|
|
50
50
|
const i = e.getUnitId(), r = this._renderManagerService.getRenderById(i);
|
|
51
51
|
(n = r == null ? void 0 : r.mainComponent) == null || n.makeForceDirty();
|
|
52
52
|
};
|
|
53
|
-
this.disposeWithMe(this._sheetsNoteModel.change$.pipe(
|
|
53
|
+
this.disposeWithMe(this._sheetsNoteModel.change$.pipe(Re(16)).subscribe(() => {
|
|
54
54
|
t();
|
|
55
55
|
}));
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
x =
|
|
59
|
-
E(0,
|
|
60
|
-
E(1,
|
|
58
|
+
x = st([
|
|
59
|
+
E(0, h(Te)),
|
|
60
|
+
E(1, h(M)),
|
|
61
61
|
E(2, F),
|
|
62
62
|
E(3, D)
|
|
63
63
|
], x);
|
|
64
64
|
const K = "SHEET_NOTE_COMPONENT";
|
|
65
|
-
var
|
|
66
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
67
|
-
(
|
|
65
|
+
var at = Object.getOwnPropertyDescriptor, ct = (t, e, i, r) => {
|
|
66
|
+
for (var n = r > 1 ? void 0 : r ? at(e, i) : e, s = t.length - 1, o; s >= 0; s--)
|
|
67
|
+
(o = t[s]) && (n = o(n) || n);
|
|
68
68
|
return n;
|
|
69
69
|
}, te = (t, e) => (i, r) => e(i, r, t);
|
|
70
|
-
let P = class extends
|
|
70
|
+
let P = class extends N {
|
|
71
71
|
constructor(e, i) {
|
|
72
72
|
super();
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
g(this, "_lastPopup", null);
|
|
74
|
+
g(this, "_activePopup");
|
|
75
|
+
g(this, "_activePopup$", new Ve(null));
|
|
76
|
+
g(this, "activePopup$", this._activePopup$.asObservable());
|
|
77
77
|
this._zenZoneService = e, this._cellPopupManagerService = i, this._initZenVisible(), this.disposeWithMe(() => {
|
|
78
78
|
this._activePopup$.complete();
|
|
79
79
|
});
|
|
@@ -87,9 +87,9 @@ let P = class extends w {
|
|
|
87
87
|
}));
|
|
88
88
|
}
|
|
89
89
|
showPopup(e, i) {
|
|
90
|
-
var
|
|
91
|
-
const { row: r, col: n, unitId:
|
|
92
|
-
if (this._activePopup && r === this._activePopup.row && n === this._activePopup.col &&
|
|
90
|
+
var c;
|
|
91
|
+
const { row: r, col: n, unitId: s, subUnitId: o } = e;
|
|
92
|
+
if (this._activePopup && r === this._activePopup.row && n === this._activePopup.col && s === this._activePopup.unitId && o === ((c = this.activePopup) == null ? void 0 : c.subUnitId)) {
|
|
93
93
|
this._activePopup = e, this._activePopup$.next(e);
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
@@ -98,8 +98,8 @@ let P = class extends w {
|
|
|
98
98
|
this._activePopup = e, this._activePopup$.next(e);
|
|
99
99
|
const a = this._cellPopupManagerService.showPopup(
|
|
100
100
|
{
|
|
101
|
-
unitId:
|
|
102
|
-
subUnitId:
|
|
101
|
+
unitId: s,
|
|
102
|
+
subUnitId: o,
|
|
103
103
|
row: r,
|
|
104
104
|
col: n
|
|
105
105
|
},
|
|
@@ -117,12 +117,12 @@ let P = class extends w {
|
|
|
117
117
|
);
|
|
118
118
|
if (!a)
|
|
119
119
|
throw new Error("[SheetsNotePopupService]: cannot show popup!");
|
|
120
|
-
const
|
|
121
|
-
|
|
120
|
+
const u = new Ne();
|
|
121
|
+
u.add(a), u.add({
|
|
122
122
|
dispose: () => {
|
|
123
123
|
i == null || i();
|
|
124
124
|
}
|
|
125
|
-
}), this._lastPopup =
|
|
125
|
+
}), this._lastPopup = u;
|
|
126
126
|
}
|
|
127
127
|
hidePopup(e) {
|
|
128
128
|
this._activePopup && (!e && !this._activePopup.temp || (this._lastPopup && this._lastPopup.dispose(), this._lastPopup = null, this._activePopup = null, this._activePopup$.next(null)));
|
|
@@ -134,37 +134,37 @@ let P = class extends w {
|
|
|
134
134
|
}, this._activePopup$.next(this._activePopup));
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
|
-
P =
|
|
138
|
-
te(0,
|
|
139
|
-
te(1,
|
|
137
|
+
P = ct([
|
|
138
|
+
te(0, ze),
|
|
139
|
+
te(1, h(ce))
|
|
140
140
|
], P);
|
|
141
|
-
var
|
|
142
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
143
|
-
(
|
|
141
|
+
var ut = Object.getOwnPropertyDescriptor, lt = (t, e, i, r) => {
|
|
142
|
+
for (var n = r > 1 ? void 0 : r ? ut(e, i) : e, s = t.length - 1, o; s >= 0; s--)
|
|
143
|
+
(o = t[s]) && (n = o(n) || n);
|
|
144
144
|
return n;
|
|
145
|
-
},
|
|
146
|
-
let H = class extends
|
|
147
|
-
constructor(e, i, r, n,
|
|
145
|
+
}, S = (t, e) => (i, r) => e(i, r, t);
|
|
146
|
+
let H = class extends N {
|
|
147
|
+
constructor(e, i, r, n, s, o) {
|
|
148
148
|
super();
|
|
149
|
-
|
|
150
|
-
this._sheetsNotePopupService = e, this._sheetsNoteModel = i, this._sheetSelectionService = r, this._editorBridgeService = n, this._renderManagerService =
|
|
149
|
+
g(this, "_isSwitchingSheet", !1);
|
|
150
|
+
this._sheetsNotePopupService = e, this._sheetsNoteModel = i, this._sheetSelectionService = r, this._editorBridgeService = n, this._renderManagerService = s, this._hoverManagerService = o, this._initSelectionUpdateListener(), this._initEditorBridge(), this._initHoverEvent();
|
|
151
151
|
}
|
|
152
152
|
_handleSelectionChange(e, i, r) {
|
|
153
|
-
var f,
|
|
154
|
-
const n = (f = e[0]) == null ? void 0 : f.range,
|
|
155
|
-
if (!
|
|
153
|
+
var f, v, C;
|
|
154
|
+
const n = (f = e[0]) == null ? void 0 : f.range, s = this._renderManagerService.getRenderById(i), o = (v = s == null ? void 0 : s.with(Fe).getSkeletonParam(r)) == null ? void 0 : v.skeleton;
|
|
155
|
+
if (!o || !n)
|
|
156
156
|
return;
|
|
157
|
-
const a =
|
|
158
|
-
if ((((C = n.rangeType) != null ? C :
|
|
157
|
+
const a = o.getCellWithCoordByIndex(n.startRow, n.startColumn);
|
|
158
|
+
if ((((C = n.rangeType) != null ? C : Q.NORMAL) !== Q.NORMAL || n.endColumn - n.startColumn > 0 || n.endRow - n.startRow > 0) && !((a.isMerged || a.isMergedMainCell) && we.equals(a.mergeInfo, n))) {
|
|
159
159
|
this._sheetsNotePopupService.hidePopup();
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
const
|
|
163
|
-
|
|
162
|
+
const c = a.actualRow, p = a.actualColumn, l = this._sheetsNoteModel.getNote(i, r, c, p);
|
|
163
|
+
l != null && l.show || (l ? this._sheetsNotePopupService.showPopup({
|
|
164
164
|
unitId: i,
|
|
165
165
|
subUnitId: r,
|
|
166
|
-
row:
|
|
167
|
-
col:
|
|
166
|
+
row: c,
|
|
167
|
+
col: p
|
|
168
168
|
}) : this._sheetsNotePopupService.hidePopup(!0));
|
|
169
169
|
}
|
|
170
170
|
_initSelectionUpdateListener() {
|
|
@@ -186,38 +186,38 @@ let H = class extends w {
|
|
|
186
186
|
}
|
|
187
187
|
_initHoverEvent() {
|
|
188
188
|
this.disposeWithMe(
|
|
189
|
-
this._hoverManagerService.currentCell$.pipe(
|
|
189
|
+
this._hoverManagerService.currentCell$.pipe(We(100)).subscribe((e) => {
|
|
190
190
|
if (!(e != null && e.location)) return;
|
|
191
|
-
const { unitId: i, subUnitId: r, row: n, col:
|
|
192
|
-
|
|
191
|
+
const { unitId: i, subUnitId: r, row: n, col: s } = e.location, o = this._sheetsNoteModel.getNote(i, r, n, s);
|
|
192
|
+
o != null && o.show || (o ? this._sheetsNotePopupService.showPopup({
|
|
193
193
|
unitId: i,
|
|
194
194
|
subUnitId: r,
|
|
195
195
|
row: n,
|
|
196
|
-
col:
|
|
196
|
+
col: s,
|
|
197
197
|
temp: !0
|
|
198
198
|
}) : this._sheetsNotePopupService.hidePopup());
|
|
199
199
|
})
|
|
200
200
|
);
|
|
201
201
|
}
|
|
202
202
|
};
|
|
203
|
-
H =
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
203
|
+
H = lt([
|
|
204
|
+
S(0, h(P)),
|
|
205
|
+
S(1, h(M)),
|
|
206
|
+
S(2, h(W)),
|
|
207
|
+
S(3, Be),
|
|
208
|
+
S(4, F),
|
|
209
|
+
S(5, h(Ae))
|
|
210
210
|
], H);
|
|
211
|
-
const
|
|
212
|
-
var
|
|
213
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
214
|
-
(
|
|
211
|
+
const pe = "sheets-note-ui.config", ie = {};
|
|
212
|
+
var pt = Object.getOwnPropertyDescriptor, ht = (t, e, i, r) => {
|
|
213
|
+
for (var n = r > 1 ? void 0 : r ? pt(e, i) : e, s = t.length - 1, o; s >= 0; s--)
|
|
214
|
+
(o = t[s]) && (n = o(n) || n);
|
|
215
215
|
return n;
|
|
216
216
|
}, O = (t, e) => (i, r) => e(i, r, t);
|
|
217
|
-
let T = class extends
|
|
217
|
+
let T = class extends N {
|
|
218
218
|
constructor(e, i, r, n) {
|
|
219
219
|
super();
|
|
220
|
-
|
|
220
|
+
g(this, "_noteMatrix", new B());
|
|
221
221
|
this._sheetsNoteModel = e, this._univerInstanceService = i, this._cellPopupManagerService = r, this._sheetsNotePopupService = n, this._initNoteChangeListener();
|
|
222
222
|
}
|
|
223
223
|
_showPopup(e, i, r, n) {
|
|
@@ -244,37 +244,37 @@ let T = class extends w {
|
|
|
244
244
|
);
|
|
245
245
|
}
|
|
246
246
|
_initSheet(e, i) {
|
|
247
|
-
var
|
|
248
|
-
this._noteMatrix.forValue((
|
|
249
|
-
|
|
250
|
-
}), this._noteMatrix = new
|
|
251
|
-
const n = (
|
|
252
|
-
const
|
|
253
|
-
if (
|
|
247
|
+
var s;
|
|
248
|
+
this._noteMatrix.forValue((o, a, u) => {
|
|
249
|
+
u.dispose();
|
|
250
|
+
}), this._noteMatrix = new B();
|
|
251
|
+
const n = (o, a, u, c, p) => {
|
|
252
|
+
const l = this._noteMatrix, f = l.getValue(u, c);
|
|
253
|
+
if (p != null && p.show) {
|
|
254
254
|
if (!f) {
|
|
255
|
-
const
|
|
256
|
-
|
|
255
|
+
const v = this._showPopup(o, a, u, c);
|
|
256
|
+
v && l.setValue(u, c, v);
|
|
257
257
|
}
|
|
258
258
|
} else
|
|
259
|
-
f && (f.dispose(),
|
|
259
|
+
f && (f.dispose(), l.realDeleteValue(u, c));
|
|
260
260
|
};
|
|
261
|
-
return (
|
|
262
|
-
n(e, i,
|
|
263
|
-
}), this._sheetsNoteModel.change$.subscribe((
|
|
264
|
-
if (!(
|
|
265
|
-
switch (
|
|
261
|
+
return (s = this._sheetsNoteModel.getSheetNotes(e, i)) == null || s.forValue((o, a, u) => {
|
|
262
|
+
n(e, i, o, a, u);
|
|
263
|
+
}), this._sheetsNoteModel.change$.subscribe((o) => {
|
|
264
|
+
if (!(o.unitId !== e || o.sheetId !== i))
|
|
265
|
+
switch (o.type) {
|
|
266
266
|
case "ref": {
|
|
267
|
-
const { unitId: a, sheetId:
|
|
267
|
+
const { unitId: a, sheetId: u, row: c, col: p, newPosition: l, note: f } = o, v = this._noteMatrix;
|
|
268
268
|
if (!f.show) return;
|
|
269
|
-
const C =
|
|
270
|
-
C && (C.dispose(),
|
|
271
|
-
const
|
|
272
|
-
|
|
269
|
+
const C = v.getValue(c, p);
|
|
270
|
+
C && (C.dispose(), v.realDeleteValue(c, p));
|
|
271
|
+
const I = this._showPopup(a, u, l.row, l.col);
|
|
272
|
+
I && v.setValue(l.row, l.col, I);
|
|
273
273
|
break;
|
|
274
274
|
}
|
|
275
275
|
case "update": {
|
|
276
|
-
const { unitId: a, sheetId:
|
|
277
|
-
n(a,
|
|
276
|
+
const { unitId: a, sheetId: u, row: c, col: p, note: l } = o;
|
|
277
|
+
n(a, u, c, p, l);
|
|
278
278
|
break;
|
|
279
279
|
}
|
|
280
280
|
}
|
|
@@ -282,10 +282,10 @@ let T = class extends w {
|
|
|
282
282
|
}
|
|
283
283
|
_initNoteChangeListener() {
|
|
284
284
|
this.disposeWithMe(
|
|
285
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
286
|
-
|
|
285
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(w.UNIVER_SHEET).pipe(
|
|
286
|
+
je((e) => {
|
|
287
287
|
var i;
|
|
288
|
-
return (i = e == null ? void 0 : e.activeSheet$) != null ? i :
|
|
288
|
+
return (i = e == null ? void 0 : e.activeSheet$) != null ? i : Ze(null);
|
|
289
289
|
})
|
|
290
290
|
).subscribe((e) => {
|
|
291
291
|
if (e) {
|
|
@@ -296,26 +296,26 @@ let T = class extends w {
|
|
|
296
296
|
} else
|
|
297
297
|
this._noteMatrix.forValue((i, r, n) => {
|
|
298
298
|
n.dispose();
|
|
299
|
-
}), this._noteMatrix = new
|
|
299
|
+
}), this._noteMatrix = new B();
|
|
300
300
|
})
|
|
301
301
|
);
|
|
302
302
|
}
|
|
303
303
|
};
|
|
304
|
-
T =
|
|
305
|
-
O(0,
|
|
306
|
-
O(1,
|
|
307
|
-
O(2,
|
|
308
|
-
O(3,
|
|
304
|
+
T = ht([
|
|
305
|
+
O(0, h(M)),
|
|
306
|
+
O(1, h(D)),
|
|
307
|
+
O(2, h(ce)),
|
|
308
|
+
O(3, h(P))
|
|
309
309
|
], T);
|
|
310
|
-
var
|
|
311
|
-
return
|
|
310
|
+
var d = function() {
|
|
311
|
+
return d = Object.assign || function(t) {
|
|
312
312
|
for (var e, i = 1, r = arguments.length; i < r; i++) {
|
|
313
313
|
e = arguments[i];
|
|
314
314
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
|
|
315
315
|
}
|
|
316
316
|
return t;
|
|
317
|
-
},
|
|
318
|
-
},
|
|
317
|
+
}, d.apply(this, arguments);
|
|
318
|
+
}, dt = function(t, e) {
|
|
319
319
|
var i = {};
|
|
320
320
|
for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (i[r] = t[r]);
|
|
321
321
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -323,44 +323,44 @@ var v = function() {
|
|
|
323
323
|
e.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[n]) && (i[r[n]] = t[r[n]]);
|
|
324
324
|
return i;
|
|
325
325
|
}, Z = V(function(t, e) {
|
|
326
|
-
var i = t.icon, r = t.id, n = t.className,
|
|
327
|
-
return
|
|
326
|
+
var i = t.icon, r = t.id, n = t.className, s = t.extend, o = dt(t, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(n || "").trim(), u = le("_".concat(_t()));
|
|
327
|
+
return he(i, "".concat(r), { defIds: i.defIds, idSuffix: u.current }, d({ ref: e, className: a }, o), s);
|
|
328
328
|
});
|
|
329
|
-
function
|
|
330
|
-
return j(t.tag,
|
|
331
|
-
return
|
|
329
|
+
function he(t, e, i, r, n) {
|
|
330
|
+
return j(t.tag, d(d({ key: e }, ft(t, i, n)), r), (vt(t, i).children || []).map(function(s, o) {
|
|
331
|
+
return he(s, "".concat(e, "-").concat(t.tag, "-").concat(o), i, void 0, n);
|
|
332
332
|
}));
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
var r =
|
|
336
|
-
i != null && i.colorChannel1 && r.fill === "colorChannel1" && (r.fill = i.colorChannel1), t.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(function(
|
|
337
|
-
var
|
|
338
|
-
|
|
334
|
+
function ft(t, e, i) {
|
|
335
|
+
var r = d({}, t.attrs);
|
|
336
|
+
i != null && i.colorChannel1 && r.fill === "colorChannel1" && (r.fill = i.colorChannel1), t.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(function(s) {
|
|
337
|
+
var o = s[0], a = s[1];
|
|
338
|
+
o === "mask" && typeof a == "string" && (r[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
339
339
|
});
|
|
340
340
|
var n = e.defIds;
|
|
341
|
-
return !n || n.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(
|
|
342
|
-
var
|
|
343
|
-
typeof a == "string" && (r[
|
|
341
|
+
return !n || n.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(s) {
|
|
342
|
+
var o = s[0], a = s[1];
|
|
343
|
+
typeof a == "string" && (r[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
344
344
|
})), r;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function vt(t, e) {
|
|
347
347
|
var i, r = e.defIds;
|
|
348
|
-
return !r || r.length === 0 ? t : t.tag === "defs" && (!((i = t.children) === null || i === void 0) && i.length) ?
|
|
349
|
-
return typeof n.attrs.id == "string" && r && r.includes(n.attrs.id) ?
|
|
348
|
+
return !r || r.length === 0 ? t : t.tag === "defs" && (!((i = t.children) === null || i === void 0) && i.length) ? d(d({}, t), { children: t.children.map(function(n) {
|
|
349
|
+
return typeof n.attrs.id == "string" && r && r.includes(n.attrs.id) ? d(d({}, n), { attrs: d(d({}, n.attrs), { id: n.attrs.id + e.idSuffix }) }) : n;
|
|
350
350
|
}) }) : t;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function _t() {
|
|
353
353
|
return Math.random().toString(36).substring(2, 8);
|
|
354
354
|
}
|
|
355
355
|
Z.displayName = "UniverIcon";
|
|
356
|
-
var
|
|
356
|
+
var Ct = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M10.8813 14.4312V10.2925C10.8813 9.92522 11.1791 9.62745 11.5463 9.62745C11.9136 9.62745 12.2114 9.92522 12.2114 10.2925V14.4312C12.2112 14.7983 11.9135 15.0962 11.5463 15.0962C11.1791 15.0962 10.8814 14.7983 10.8813 14.4312Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M9.47697 11.6968H11.5463H13.6156C13.9829 11.6968 14.2807 11.9946 14.2807 12.3618C14.2807 12.7291 13.9829 13.0269 13.6156 13.0269H9.47697C9.10981 13.0267 8.81193 12.729 8.81193 12.3618C8.81193 11.9946 9.10981 11.6969 9.47697 11.6968Z" } }] }, de = V(function(t, e) {
|
|
357
357
|
return j(Z, Object.assign({}, t, {
|
|
358
358
|
id: "add-note-icon",
|
|
359
359
|
ref: e,
|
|
360
|
-
icon:
|
|
360
|
+
icon: Ct
|
|
361
361
|
}));
|
|
362
362
|
});
|
|
363
|
-
|
|
363
|
+
de.displayName = "AddNoteIcon";
|
|
364
364
|
var gt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M9.47489 11.6968H13.6175C13.9847 11.6968 14.2825 11.9946 14.2825 12.3618C14.2825 12.7291 13.9847 13.0269 13.6175 13.0269H9.47489C9.10762 13.0269 8.80985 12.7291 8.80985 12.3618C8.80985 11.9946 9.10762 11.6968 9.47489 11.6968Z" } }] }, fe = V(function(t, e) {
|
|
365
365
|
return j(Z, Object.assign({}, t, {
|
|
366
366
|
id: "delete-note-icon",
|
|
@@ -369,99 +369,80 @@ var gt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none
|
|
|
369
369
|
}));
|
|
370
370
|
});
|
|
371
371
|
fe.displayName = "DeleteNoteIcon";
|
|
372
|
-
var
|
|
372
|
+
var mt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M13.8743 12.6147C13.8742 12.5394 13.7749 12.2553 13.3909 11.9477C13.039 11.6659 12.5573 11.4614 12.0394 11.4614C11.5213 11.4614 11.0398 11.6666 10.6878 11.9487C10.3037 12.2565 10.2045 12.5399 10.2044 12.6147C10.2044 12.6893 10.3034 12.9737 10.6878 13.2817C11.0398 13.5636 11.5215 13.768 12.0394 13.768C12.5574 13.768 13.039 13.5635 13.3909 13.2817C13.7751 12.9739 13.8743 12.6897 13.8743 12.6147ZM15.2044 12.6147C15.2044 13.2772 14.7436 13.9027 14.223 14.3198C13.6701 14.7627 12.9019 15.0981 12.0394 15.0981C11.1768 15.0981 10.4085 14.7627 9.85577 14.3198C9.33533 13.9027 8.87433 13.2769 8.87433 12.6147C8.8744 11.9526 9.33541 11.3276 9.85577 10.9106C10.4086 10.4676 11.1767 10.1313 12.0394 10.1313C12.9018 10.1313 13.6701 10.4668 14.223 10.9096C14.7435 11.3267 15.2043 11.9523 15.2044 12.6147Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M12.0394 13.299C12.4172 13.299 12.7234 12.9927 12.7234 12.6149C12.7234 12.2371 12.4172 11.9308 12.0394 11.9308C11.6616 11.9308 11.3553 12.2371 11.3553 12.6149C11.3553 12.9927 11.6616 13.299 12.0394 13.299Z" } }] }, ve = V(function(t, e) {
|
|
373
373
|
return j(Z, Object.assign({}, t, {
|
|
374
374
|
id: "hide-note-icon",
|
|
375
375
|
ref: e,
|
|
376
|
-
icon:
|
|
376
|
+
icon: mt
|
|
377
377
|
}));
|
|
378
378
|
});
|
|
379
|
-
|
|
379
|
+
ve.displayName = "HideNoteIcon";
|
|
380
380
|
const $ = {
|
|
381
381
|
id: "sheet.operation.add-note-popup",
|
|
382
|
-
type:
|
|
382
|
+
type: Me.OPERATION,
|
|
383
383
|
handler: async (t, e) => {
|
|
384
|
-
const i = t.get(W), r = t.get(P),
|
|
385
|
-
if (!
|
|
384
|
+
const i = t.get(W), r = t.get(P), s = t.get(D).getCurrentUnitForType(w.UNIVER_SHEET);
|
|
385
|
+
if (!s)
|
|
386
386
|
return !1;
|
|
387
|
-
const
|
|
387
|
+
const o = s.getActiveSheet(), a = i.getCurrentLastSelection();
|
|
388
388
|
if (!(a != null && a.primary))
|
|
389
389
|
return !1;
|
|
390
|
-
const { primary:
|
|
390
|
+
const { primary: u } = a;
|
|
391
391
|
return r.showPopup({
|
|
392
|
-
unitId:
|
|
393
|
-
subUnitId:
|
|
394
|
-
row:
|
|
395
|
-
col:
|
|
392
|
+
unitId: s.getUnitId(),
|
|
393
|
+
subUnitId: o.getSheetId(),
|
|
394
|
+
row: u.actualRow,
|
|
395
|
+
col: u.actualColumn,
|
|
396
396
|
temp: !1,
|
|
397
397
|
trigger: e == null ? void 0 : e.trigger
|
|
398
398
|
}), !0;
|
|
399
399
|
}
|
|
400
|
-
},
|
|
401
|
-
var
|
|
402
|
-
const e = y(M),
|
|
400
|
+
}, St = (t) => {
|
|
401
|
+
var I;
|
|
402
|
+
const { popup: e } = t, i = y(M), r = y(be), n = y(F), s = Ge(pe), o = (I = e.extraProps) == null ? void 0 : I.location;
|
|
403
403
|
if (!o)
|
|
404
404
|
return console.error("Popup extraProps or location is undefined."), null;
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
405
|
+
const a = le(null), u = n.getRenderById(o.unitId), [c, p] = rt(null);
|
|
406
|
+
nt(() => {
|
|
407
|
+
var q, J;
|
|
408
|
+
const { unitId: _, subUnitId: m, row: b, col: Ce } = o, { width: ge = 160, height: me = 72 } = (q = s == null ? void 0 : s.defaultNoteSize) != null ? q : {}, k = (J = i.getNote(_, m, b, Ce)) != null ? J : { width: ge, height: me, note: "" };
|
|
409
|
+
a.current && (p(k), a.current.style.width = `${k.width}px`, a.current.style.height = `${k.height}px`);
|
|
410
|
+
}, [o, a]);
|
|
411
|
+
const l = y(ne), f = Ke((_) => {
|
|
412
|
+
o && (_.note ? l.executeCommand(Ue.id, {
|
|
411
413
|
unitId: o.unitId,
|
|
412
414
|
sheetId: o.subUnitId,
|
|
413
415
|
row: o.row,
|
|
414
416
|
col: o.col,
|
|
415
|
-
note:
|
|
416
|
-
}) :
|
|
417
|
+
note: _
|
|
418
|
+
}) : l.executeCommand(z.id, {
|
|
417
419
|
unitId: o.unitId,
|
|
418
420
|
sheetId: o.subUnitId,
|
|
419
421
|
row: o.row,
|
|
420
422
|
col: o.col
|
|
421
423
|
}));
|
|
422
|
-
})
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
}, [
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
}, [p]), B(() => {
|
|
434
|
-
const u = l.current;
|
|
435
|
-
if (!u) return;
|
|
436
|
-
const _ = new ResizeObserver((m) => {
|
|
437
|
-
const I = m[0];
|
|
438
|
-
if (!I) return;
|
|
439
|
-
const { width: q, height: J } = I.contentRect;
|
|
440
|
-
if (q === 0 && J === 0) return;
|
|
441
|
-
const Q = { ...a, width: q, height: J };
|
|
442
|
-
c(Q), f(Q);
|
|
443
|
-
});
|
|
444
|
-
return _.observe(u), () => {
|
|
445
|
-
_.unobserve(u), _.disconnect();
|
|
446
|
-
};
|
|
447
|
-
}, [a.note]);
|
|
448
|
-
const g = (u) => {
|
|
449
|
-
const _ = u.target.value, m = { ...a, note: _ };
|
|
450
|
-
c(m), f(m);
|
|
451
|
-
};
|
|
452
|
-
return /* @__PURE__ */ Je(
|
|
453
|
-
"textarea",
|
|
424
|
+
}), v = ee((_) => {
|
|
425
|
+
if (!c) return;
|
|
426
|
+
const m = { ...c, note: _ };
|
|
427
|
+
p(m), f(m);
|
|
428
|
+
}, [c]), C = ee((_, m) => {
|
|
429
|
+
if (!c) return;
|
|
430
|
+
const b = { ...c, width: _, height: m };
|
|
431
|
+
p(b), f(b);
|
|
432
|
+
}, [c]);
|
|
433
|
+
return /* @__PURE__ */ et(
|
|
434
|
+
tt,
|
|
454
435
|
{
|
|
455
|
-
|
|
456
|
-
document.activeElement !== l.current && s.engine.getCanvasElement().dispatchEvent(new WheelEvent(u.type, u.nativeEvent));
|
|
457
|
-
},
|
|
458
|
-
ref: l,
|
|
436
|
+
ref: a,
|
|
459
437
|
"data-u-comp": "note-textarea",
|
|
460
|
-
className:
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
438
|
+
className: it("univer-ml-px univer-min-h-1 univer-min-w-1 univer-bg-white !univer-text-sm univer-shadow dark:!univer-bg-gray-800"),
|
|
439
|
+
value: c == null ? void 0 : c.note,
|
|
440
|
+
placeholder: r.t("note.placeholder"),
|
|
441
|
+
onResize: C,
|
|
442
|
+
onValueChange: v,
|
|
443
|
+
onWheel: (_) => {
|
|
444
|
+
document.activeElement !== a.current && u.engine.getCanvasElement().dispatchEvent(new WheelEvent(_.type, _.nativeEvent));
|
|
445
|
+
}
|
|
465
446
|
}
|
|
466
447
|
);
|
|
467
448
|
};
|
|
@@ -470,31 +451,31 @@ function Y(t) {
|
|
|
470
451
|
return e.selectionMoveEnd$.pipe(R(() => {
|
|
471
452
|
const r = e.getCurrentLastSelection();
|
|
472
453
|
if (!(r != null && r.primary)) return !1;
|
|
473
|
-
const n =
|
|
454
|
+
const n = Le(i);
|
|
474
455
|
if (!n) return !1;
|
|
475
|
-
const { actualColumn:
|
|
476
|
-
return !!t.get(M).getNote(n.unitId, n.subUnitId,
|
|
456
|
+
const { actualColumn: s, actualRow: o } = r.primary;
|
|
457
|
+
return !!t.get(M).getNote(n.unitId, n.subUnitId, o, s);
|
|
477
458
|
}));
|
|
478
459
|
}
|
|
479
|
-
function
|
|
460
|
+
function Pt(t) {
|
|
480
461
|
return {
|
|
481
462
|
id: $.id,
|
|
482
463
|
type: G.BUTTON,
|
|
483
464
|
title: "rightClick.addNote",
|
|
484
465
|
icon: "AddNoteIcon",
|
|
485
|
-
hidden$:
|
|
486
|
-
disabled$:
|
|
466
|
+
hidden$: ke([Ye(t, w.UNIVER_SHEET), Y(t)]).pipe(R(([e, i]) => e || i)),
|
|
467
|
+
disabled$: ue(t, { workbookTypes: [se], worksheetTypes: [oe] }),
|
|
487
468
|
commandId: $.id
|
|
488
469
|
};
|
|
489
470
|
}
|
|
490
|
-
function
|
|
471
|
+
function It(t) {
|
|
491
472
|
return {
|
|
492
473
|
id: z.id,
|
|
493
474
|
type: G.BUTTON,
|
|
494
475
|
title: "rightClick.deleteNote",
|
|
495
476
|
icon: "DeleteNoteIcon",
|
|
496
477
|
hidden$: Y(t).pipe(R((e) => !e)),
|
|
497
|
-
disabled$:
|
|
478
|
+
disabled$: ue(t, { workbookTypes: [se], worksheetTypes: [oe] })
|
|
498
479
|
};
|
|
499
480
|
}
|
|
500
481
|
function Nt(t) {
|
|
@@ -506,17 +487,17 @@ function Nt(t) {
|
|
|
506
487
|
hidden$: Y(t).pipe(R((e) => !e))
|
|
507
488
|
};
|
|
508
489
|
}
|
|
509
|
-
const
|
|
510
|
-
[
|
|
511
|
-
[
|
|
490
|
+
const wt = {
|
|
491
|
+
[qe.MAIN_AREA]: {
|
|
492
|
+
[Je.OTHERS]: {
|
|
512
493
|
order: 0,
|
|
513
494
|
[$.id]: {
|
|
514
495
|
order: 0,
|
|
515
|
-
menuItemFactory:
|
|
496
|
+
menuItemFactory: Pt
|
|
516
497
|
},
|
|
517
498
|
[z.id]: {
|
|
518
499
|
order: 0,
|
|
519
|
-
menuItemFactory:
|
|
500
|
+
menuItemFactory: It
|
|
520
501
|
},
|
|
521
502
|
[ae.id]: {
|
|
522
503
|
order: 0,
|
|
@@ -525,21 +506,21 @@ const Pt = {
|
|
|
525
506
|
}
|
|
526
507
|
}
|
|
527
508
|
};
|
|
528
|
-
var
|
|
529
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
530
|
-
(
|
|
509
|
+
var Mt = Object.getOwnPropertyDescriptor, bt = (t, e, i, r) => {
|
|
510
|
+
for (var n = r > 1 ? void 0 : r ? Mt(e, i) : e, s = t.length - 1, o; s >= 0; s--)
|
|
511
|
+
(o = t[s]) && (n = o(n) || n);
|
|
531
512
|
return n;
|
|
532
513
|
}, A = (t, e) => (i, r) => e(i, r, t);
|
|
533
|
-
let
|
|
514
|
+
let L = class extends N {
|
|
534
515
|
constructor(t, e, i) {
|
|
535
516
|
super(), this._componentManager = t, this._menuManagerService = e, this._commandService = i, this._initComponents(), this._initMenu(), this._initCommands();
|
|
536
517
|
}
|
|
537
518
|
_initComponents() {
|
|
538
519
|
[
|
|
539
|
-
[K,
|
|
540
|
-
["AddNoteIcon",
|
|
520
|
+
[K, St],
|
|
521
|
+
["AddNoteIcon", de],
|
|
541
522
|
["DeleteNoteIcon", fe],
|
|
542
|
-
["HideNoteIcon",
|
|
523
|
+
["HideNoteIcon", ve]
|
|
543
524
|
].forEach(([t, e]) => {
|
|
544
525
|
this.disposeWithMe(
|
|
545
526
|
this._componentManager.register(t, e)
|
|
@@ -547,68 +528,68 @@ let U = class extends w {
|
|
|
547
528
|
});
|
|
548
529
|
}
|
|
549
530
|
_initMenu() {
|
|
550
|
-
this._menuManagerService.mergeMenu(
|
|
531
|
+
this._menuManagerService.mergeMenu(wt);
|
|
551
532
|
}
|
|
552
533
|
_initCommands() {
|
|
553
534
|
this._commandService.registerCommand($);
|
|
554
535
|
}
|
|
555
536
|
};
|
|
556
|
-
|
|
557
|
-
A(0,
|
|
558
|
-
A(1,
|
|
537
|
+
L = bt([
|
|
538
|
+
A(0, h(Qe)),
|
|
539
|
+
A(1, h(Xe)),
|
|
559
540
|
A(2, ne)
|
|
560
|
-
],
|
|
561
|
-
var
|
|
562
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
563
|
-
(
|
|
541
|
+
], L);
|
|
542
|
+
var yt = Object.defineProperty, Et = Object.getOwnPropertyDescriptor, Ot = (t, e, i) => e in t ? yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, xt = (t, e, i, r) => {
|
|
543
|
+
for (var n = r > 1 ? void 0 : r ? Et(e, i) : e, s = t.length - 1, o; s >= 0; s--)
|
|
544
|
+
(o = t[s]) && (n = o(n) || n);
|
|
564
545
|
return n;
|
|
565
|
-
}, re = (t, e) => (i, r) => e(i, r, t), _e = (t, e, i) =>
|
|
566
|
-
const
|
|
567
|
-
let
|
|
546
|
+
}, re = (t, e) => (i, r) => e(i, r, t), _e = (t, e, i) => Ot(t, typeof e != "symbol" ? e + "" : e, i);
|
|
547
|
+
const Ht = "SHEET_NOTE_UI_PLUGIN";
|
|
548
|
+
let U = class extends xe {
|
|
568
549
|
constructor(t = ie, e, i) {
|
|
569
550
|
super(), this._config = t, this._injector = e, this._configService = i;
|
|
570
|
-
const { menu: r, ...n } =
|
|
551
|
+
const { menu: r, ...n } = He(
|
|
571
552
|
{},
|
|
572
553
|
ie,
|
|
573
554
|
this._config
|
|
574
555
|
);
|
|
575
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
556
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(pe, n);
|
|
576
557
|
}
|
|
577
558
|
onStarting() {
|
|
578
559
|
[
|
|
579
560
|
[P],
|
|
580
561
|
[x],
|
|
581
562
|
[H],
|
|
582
|
-
[
|
|
563
|
+
[L],
|
|
583
564
|
[T]
|
|
584
565
|
].forEach((t) => {
|
|
585
566
|
this._injector.add(t);
|
|
586
567
|
});
|
|
587
568
|
}
|
|
588
569
|
onReady() {
|
|
589
|
-
|
|
590
|
-
[
|
|
570
|
+
X(this._injector, [
|
|
571
|
+
[L],
|
|
591
572
|
[x]
|
|
592
573
|
]);
|
|
593
574
|
}
|
|
594
575
|
onRendered() {
|
|
595
|
-
|
|
576
|
+
X(this._injector, [
|
|
596
577
|
[H],
|
|
597
578
|
[T]
|
|
598
579
|
]);
|
|
599
580
|
}
|
|
600
581
|
};
|
|
601
|
-
_e(
|
|
602
|
-
_e(
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
re(1,
|
|
606
|
-
re(2,
|
|
607
|
-
],
|
|
582
|
+
_e(U, "pluginName", Ht);
|
|
583
|
+
_e(U, "type", w.UNIVER_SHEET);
|
|
584
|
+
U = xt([
|
|
585
|
+
ye(De),
|
|
586
|
+
re(1, h(Ee)),
|
|
587
|
+
re(2, Oe)
|
|
588
|
+
], U);
|
|
608
589
|
export {
|
|
609
590
|
x as SheetsCellContentController,
|
|
610
|
-
|
|
591
|
+
St as SheetsNote,
|
|
611
592
|
H as SheetsNotePopupController,
|
|
612
593
|
P as SheetsNotePopupService,
|
|
613
|
-
|
|
594
|
+
U as UniverSheetsNoteUIPlugin
|
|
614
595
|
};
|