@univerjs/sheets-note-ui 0.10.12 → 0.10.13
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 +487 -335
- package/lib/index.js +487 -335
- package/lib/umd/index.js +1 -1
- package/package.json +10 -10
package/lib/index.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { Inject as h, IUniverInstanceService as D, Disposable as N, InterceptorEffectEnum as
|
|
5
|
-
import { IRenderManagerService as
|
|
6
|
-
import { SheetInterceptorService as
|
|
7
|
-
import { SheetsNoteModel as
|
|
8
|
-
import { debounceTime as
|
|
9
|
-
import { CellPopupManagerService as
|
|
10
|
-
import { debounceTime as
|
|
11
|
-
import { IZenZoneService as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
var ot = Object.getOwnPropertyDescriptor,
|
|
16
|
-
for (var
|
|
17
|
-
(
|
|
18
|
-
return
|
|
19
|
-
}, E = (
|
|
20
|
-
let
|
|
21
|
-
constructor(
|
|
22
|
-
super(), this._sheetInterceptorService =
|
|
1
|
+
var me = Object.defineProperty;
|
|
2
|
+
var Se = (i, e, t) => e in i ? me(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var v = (i, e, t) => Se(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { Inject as h, IUniverInstanceService as D, Disposable as N, InterceptorEffectEnum as Pe, UniverInstanceType as I, DisposableCollection as Ne, RANGE_TYPE as J, Rectangle as Ie, ObjectMatrix as j, CommandType as Me, LocaleService as we, ICommandService as re, DependentOn as be, Injector as Ee, IConfigService as ye, Plugin as $e, merge as xe, touchDependencies as Q } from "@univerjs/core";
|
|
5
|
+
import { IRenderManagerService as B } from "@univerjs/engine-render";
|
|
6
|
+
import { SheetInterceptorService as He, INTERCEPTOR_POINT as Oe, SheetsSelectionsService as A, WorksheetEditPermission as oe, WorkbookEditablePermission as ne, getSheetCommandTarget as Te } from "@univerjs/sheets";
|
|
7
|
+
import { SheetsNoteModel as M, SheetUpdateNoteCommand as Le, SheetDeleteNoteCommand as F, SheetToggleNotePopupCommand as se, UniverSheetsNotePlugin as De } from "@univerjs/sheets-note";
|
|
8
|
+
import { debounceTime as Ue, BehaviorSubject as Ve, switchMap as Re, of as Ze, map as U, combineLatest as je } from "rxjs";
|
|
9
|
+
import { CellPopupManagerService as ae, IEditorBridgeService as ke, HoverManagerService as Be, SheetSkeletonManagerService as Ae, getCurrentRangeDisable$ as ce } from "@univerjs/sheets-ui";
|
|
10
|
+
import { debounceTime as Fe } from "rxjs/operators";
|
|
11
|
+
import { IZenZoneService as We, useDependency as b, useConfigValue as ze, useDebounceFn as Ge, MenuItemType as W, getMenuHiddenObservable as Ke, ContextMenuPosition as Ye, ContextMenuGroup as qe, ComponentManager as Je, IMenuManagerService as Qe } from "@univerjs/ui";
|
|
12
|
+
import { useRef as ue, createElement as V, forwardRef as z, useState as Xe, useEffect as et, useCallback as X } from "react";
|
|
13
|
+
import { jsx as tt } from "react/jsx-runtime";
|
|
14
|
+
import { Textarea as it, clsx as rt } from "@univerjs/design";
|
|
15
|
+
var ot = Object.getOwnPropertyDescriptor, nt = (i, e, t, r) => {
|
|
16
|
+
for (var o = r > 1 ? void 0 : r ? ot(e, t) : e, s = i.length - 1, n; s >= 0; s--)
|
|
17
|
+
(n = i[s]) && (o = n(o) || o);
|
|
18
|
+
return o;
|
|
19
|
+
}, E = (i, e) => (t, r) => e(t, r, i);
|
|
20
|
+
let $ = class extends N {
|
|
21
|
+
constructor(i, e, t, r) {
|
|
22
|
+
super(), this._sheetInterceptorService = i, this._sheetsNoteModel = e, this._renderManagerService = t, this._univerInstanceService = r, this._initViewModelIntercept(), this._initSkeletonChange();
|
|
23
23
|
}
|
|
24
24
|
_initViewModelIntercept() {
|
|
25
25
|
this.disposeWithMe(
|
|
26
26
|
this._sheetInterceptorService.intercept(
|
|
27
|
-
|
|
27
|
+
Oe.CELL_CONTENT,
|
|
28
28
|
{
|
|
29
|
-
effect:
|
|
30
|
-
handler: (
|
|
31
|
-
const { row: r, col:
|
|
32
|
-
return this._sheetsNoteModel.getNote(s,
|
|
33
|
-
...
|
|
29
|
+
effect: Pe.Style,
|
|
30
|
+
handler: (i, e, t) => {
|
|
31
|
+
const { row: r, col: o, unitId: s, subUnitId: n } = e;
|
|
32
|
+
return this._sheetsNoteModel.getNote(s, n, r, o) && ((!i || i === e.rawData) && (i = { ...e.rawData }), i.markers = {
|
|
33
|
+
...i == null ? void 0 : i.markers,
|
|
34
34
|
tr: {
|
|
35
35
|
color: "#FFBD37",
|
|
36
36
|
size: 6
|
|
37
37
|
}
|
|
38
|
-
}), i
|
|
38
|
+
}), t(i);
|
|
39
39
|
},
|
|
40
40
|
priority: 100
|
|
41
41
|
}
|
|
@@ -43,38 +43,38 @@ let x = class extends N {
|
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
_initSkeletonChange() {
|
|
46
|
-
const
|
|
47
|
-
var
|
|
48
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
46
|
+
const i = () => {
|
|
47
|
+
var o;
|
|
48
|
+
const e = this._univerInstanceService.getCurrentUnitForType(I.UNIVER_SHEET);
|
|
49
49
|
if (!e) return;
|
|
50
|
-
const
|
|
51
|
-
(
|
|
50
|
+
const t = e.getUnitId(), r = this._renderManagerService.getRenderById(t);
|
|
51
|
+
(o = r == null ? void 0 : r.mainComponent) == null || o.makeForceDirty();
|
|
52
52
|
};
|
|
53
|
-
this.disposeWithMe(this._sheetsNoteModel.change$.pipe(
|
|
54
|
-
|
|
53
|
+
this.disposeWithMe(this._sheetsNoteModel.change$.pipe(Ue(16)).subscribe(() => {
|
|
54
|
+
i();
|
|
55
55
|
}));
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
|
|
59
|
-
E(0, h(
|
|
60
|
-
E(1, h(
|
|
61
|
-
E(2,
|
|
58
|
+
$ = nt([
|
|
59
|
+
E(0, h(He)),
|
|
60
|
+
E(1, h(M)),
|
|
61
|
+
E(2, B),
|
|
62
62
|
E(3, D)
|
|
63
|
-
],
|
|
64
|
-
const
|
|
65
|
-
var
|
|
66
|
-
for (var
|
|
67
|
-
(
|
|
68
|
-
return
|
|
69
|
-
},
|
|
70
|
-
let
|
|
71
|
-
constructor(e,
|
|
63
|
+
], $);
|
|
64
|
+
const G = "SHEET_NOTE_COMPONENT";
|
|
65
|
+
var st = Object.getOwnPropertyDescriptor, at = (i, e, t, r) => {
|
|
66
|
+
for (var o = r > 1 ? void 0 : r ? st(e, t) : e, s = i.length - 1, n; s >= 0; s--)
|
|
67
|
+
(n = i[s]) && (o = n(o) || o);
|
|
68
|
+
return o;
|
|
69
|
+
}, ee = (i, e) => (t, r) => e(t, r, i);
|
|
70
|
+
let S = class extends N {
|
|
71
|
+
constructor(e, t) {
|
|
72
72
|
super();
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
this._zenZoneService = e, this._cellPopupManagerService =
|
|
73
|
+
v(this, "_lastPopup", null);
|
|
74
|
+
v(this, "_activePopup");
|
|
75
|
+
v(this, "_activePopup$", new Ve(null));
|
|
76
|
+
v(this, "activePopup$", this._activePopup$.asObservable());
|
|
77
|
+
this._zenZoneService = e, this._cellPopupManagerService = t, this._initZenVisible(), this.disposeWithMe(() => {
|
|
78
78
|
this._activePopup$.complete();
|
|
79
79
|
});
|
|
80
80
|
}
|
|
@@ -89,10 +89,10 @@ let P = class extends N {
|
|
|
89
89
|
dispose() {
|
|
90
90
|
super.dispose(), this.hidePopup();
|
|
91
91
|
}
|
|
92
|
-
showPopup(e,
|
|
92
|
+
showPopup(e, t) {
|
|
93
93
|
var c;
|
|
94
|
-
const { row: r, col:
|
|
95
|
-
if (this._activePopup && r === this._activePopup.row &&
|
|
94
|
+
const { row: r, col: o, unitId: s, subUnitId: n } = e;
|
|
95
|
+
if (this._activePopup && r === this._activePopup.row && o === this._activePopup.col && s === this._activePopup.unitId && n === ((c = this.activePopup) == null ? void 0 : c.subUnitId)) {
|
|
96
96
|
this._activePopup = e, this._activePopup$.next(e);
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
@@ -102,12 +102,12 @@ let P = class extends N {
|
|
|
102
102
|
const a = this._cellPopupManagerService.showPopup(
|
|
103
103
|
{
|
|
104
104
|
unitId: s,
|
|
105
|
-
subUnitId:
|
|
105
|
+
subUnitId: n,
|
|
106
106
|
row: r,
|
|
107
|
-
col:
|
|
107
|
+
col: o
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
|
-
componentKey:
|
|
110
|
+
componentKey: G,
|
|
111
111
|
onClickOutside: () => {
|
|
112
112
|
this.hidePopup();
|
|
113
113
|
},
|
|
@@ -123,7 +123,7 @@ let P = class extends N {
|
|
|
123
123
|
const u = new Ne();
|
|
124
124
|
u.add(a), u.add({
|
|
125
125
|
dispose: () => {
|
|
126
|
-
|
|
126
|
+
t == null || t();
|
|
127
127
|
}
|
|
128
128
|
}), this._lastPopup = u;
|
|
129
129
|
}
|
|
@@ -137,37 +137,37 @@ let P = class extends N {
|
|
|
137
137
|
}, this._activePopup$.next(this._activePopup));
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
],
|
|
144
|
-
var
|
|
145
|
-
for (var
|
|
146
|
-
(
|
|
147
|
-
return
|
|
148
|
-
},
|
|
149
|
-
let
|
|
150
|
-
constructor(e,
|
|
140
|
+
S = at([
|
|
141
|
+
ee(0, We),
|
|
142
|
+
ee(1, h(ae))
|
|
143
|
+
], S);
|
|
144
|
+
var ct = Object.getOwnPropertyDescriptor, ut = (i, e, t, r) => {
|
|
145
|
+
for (var o = r > 1 ? void 0 : r ? ct(e, t) : e, s = i.length - 1, n; s >= 0; s--)
|
|
146
|
+
(n = i[s]) && (o = n(o) || o);
|
|
147
|
+
return o;
|
|
148
|
+
}, m = (i, e) => (t, r) => e(t, r, i);
|
|
149
|
+
let x = class extends N {
|
|
150
|
+
constructor(e, t, r, o, s, n) {
|
|
151
151
|
super();
|
|
152
|
-
|
|
153
|
-
this._sheetsNotePopupService = e, this._sheetsNoteModel =
|
|
152
|
+
v(this, "_isSwitchingSheet", !1);
|
|
153
|
+
this._sheetsNotePopupService = e, this._sheetsNoteModel = t, this._sheetSelectionService = r, this._editorBridgeService = o, this._renderManagerService = s, this._hoverManagerService = n, this._initSelectionUpdateListener(), this._initEditorBridge(), this._initHoverEvent();
|
|
154
154
|
}
|
|
155
|
-
_handleSelectionChange(e,
|
|
156
|
-
var
|
|
157
|
-
const
|
|
158
|
-
if (!
|
|
155
|
+
_handleSelectionChange(e, t, r) {
|
|
156
|
+
var d, _, f;
|
|
157
|
+
const o = (d = e[0]) == null ? void 0 : d.range, s = this._renderManagerService.getRenderById(t), n = (_ = s == null ? void 0 : s.with(Ae).getSkeletonParam(r)) == null ? void 0 : _.skeleton;
|
|
158
|
+
if (!n || !o)
|
|
159
159
|
return;
|
|
160
|
-
const a =
|
|
161
|
-
if ((((
|
|
160
|
+
const a = n.getCellWithCoordByIndex(o.startRow, o.startColumn);
|
|
161
|
+
if ((((f = o.rangeType) != null ? f : J.NORMAL) !== J.NORMAL || o.endColumn - o.startColumn > 0 || o.endRow - o.startRow > 0) && !((a.isMerged || a.isMergedMainCell) && Ie.equals(a.mergeInfo, o))) {
|
|
162
162
|
this._sheetsNotePopupService.hidePopup();
|
|
163
163
|
return;
|
|
164
164
|
}
|
|
165
|
-
const c = a.actualRow,
|
|
166
|
-
|
|
167
|
-
unitId:
|
|
165
|
+
const c = a.actualRow, l = a.actualColumn, p = this._sheetsNoteModel.getNote(t, r, c, l);
|
|
166
|
+
p != null && p.show || (p ? this._sheetsNotePopupService.showPopup({
|
|
167
|
+
unitId: t,
|
|
168
168
|
subUnitId: r,
|
|
169
169
|
row: c,
|
|
170
|
-
col:
|
|
170
|
+
col: l
|
|
171
171
|
}) : this._sheetsNotePopupService.hidePopup(!0));
|
|
172
172
|
}
|
|
173
173
|
_initSelectionUpdateListener() {
|
|
@@ -175,8 +175,8 @@ let H = class extends N {
|
|
|
175
175
|
this._sheetSelectionService.selectionMoveEnd$.subscribe((e) => {
|
|
176
176
|
if (this._isSwitchingSheet)
|
|
177
177
|
return;
|
|
178
|
-
const
|
|
179
|
-
|
|
178
|
+
const t = this._sheetSelectionService.currentSelectionParam;
|
|
179
|
+
t && this._handleSelectionChange(e, t.unitId, t.sheetId);
|
|
180
180
|
})
|
|
181
181
|
);
|
|
182
182
|
}
|
|
@@ -189,13 +189,13 @@ let H = class extends N {
|
|
|
189
189
|
}
|
|
190
190
|
_initHoverEvent() {
|
|
191
191
|
this.disposeWithMe(
|
|
192
|
-
this._hoverManagerService.currentCell$.pipe(
|
|
192
|
+
this._hoverManagerService.currentCell$.pipe(Fe(100)).subscribe((e) => {
|
|
193
193
|
if (!(e != null && e.location)) return;
|
|
194
|
-
const { unitId:
|
|
195
|
-
|
|
196
|
-
unitId:
|
|
194
|
+
const { unitId: t, subUnitId: r, row: o, col: s } = e.location, n = this._sheetsNoteModel.getNote(t, r, o, s);
|
|
195
|
+
n != null && n.show || (n ? this._sheetsNotePopupService.showPopup({
|
|
196
|
+
unitId: t,
|
|
197
197
|
subUnitId: r,
|
|
198
|
-
row:
|
|
198
|
+
row: o,
|
|
199
199
|
col: s,
|
|
200
200
|
temp: !0
|
|
201
201
|
}) : this._sheetsNotePopupService.hidePopup());
|
|
@@ -203,43 +203,43 @@ let H = class extends N {
|
|
|
203
203
|
);
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
],
|
|
214
|
-
const pe = "sheets-note-ui.config",
|
|
215
|
-
var pt = Object.getOwnPropertyDescriptor,
|
|
216
|
-
for (var
|
|
217
|
-
(
|
|
218
|
-
return
|
|
219
|
-
},
|
|
220
|
-
let
|
|
221
|
-
constructor(e,
|
|
206
|
+
x = ut([
|
|
207
|
+
m(0, h(S)),
|
|
208
|
+
m(1, h(M)),
|
|
209
|
+
m(2, h(A)),
|
|
210
|
+
m(3, ke),
|
|
211
|
+
m(4, B),
|
|
212
|
+
m(5, h(Be))
|
|
213
|
+
], x);
|
|
214
|
+
const pe = "sheets-note-ui.config", te = {};
|
|
215
|
+
var pt = Object.getOwnPropertyDescriptor, lt = (i, e, t, r) => {
|
|
216
|
+
for (var o = r > 1 ? void 0 : r ? pt(e, t) : e, s = i.length - 1, n; s >= 0; s--)
|
|
217
|
+
(n = i[s]) && (o = n(o) || o);
|
|
218
|
+
return o;
|
|
219
|
+
}, y = (i, e) => (t, r) => e(t, r, i);
|
|
220
|
+
let H = class extends N {
|
|
221
|
+
constructor(e, t, r, o) {
|
|
222
222
|
super();
|
|
223
|
-
|
|
224
|
-
this._sheetsNoteModel = e, this._univerInstanceService =
|
|
223
|
+
v(this, "_noteMatrix", new j());
|
|
224
|
+
this._sheetsNoteModel = e, this._univerInstanceService = t, this._cellPopupManagerService = r, this._sheetsNotePopupService = o, this._initNoteChangeListener();
|
|
225
225
|
}
|
|
226
|
-
_showPopup(e,
|
|
226
|
+
_showPopup(e, t, r, o) {
|
|
227
227
|
return this._sheetsNotePopupService.hidePopup(!0), this._cellPopupManagerService.showPopup(
|
|
228
228
|
{
|
|
229
229
|
unitId: e,
|
|
230
|
-
subUnitId:
|
|
230
|
+
subUnitId: t,
|
|
231
231
|
row: r,
|
|
232
|
-
col:
|
|
232
|
+
col: o
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
|
-
componentKey:
|
|
235
|
+
componentKey: G,
|
|
236
236
|
direction: "horizontal",
|
|
237
237
|
extraProps: {
|
|
238
238
|
location: {
|
|
239
239
|
unitId: e,
|
|
240
|
-
subUnitId:
|
|
240
|
+
subUnitId: t,
|
|
241
241
|
row: r,
|
|
242
|
-
col:
|
|
242
|
+
col: o
|
|
243
243
|
}
|
|
244
244
|
},
|
|
245
245
|
priority: 3
|
|
@@ -247,42 +247,42 @@ let T = class extends N {
|
|
|
247
247
|
);
|
|
248
248
|
}
|
|
249
249
|
dispose() {
|
|
250
|
-
super.dispose(), this._noteMatrix.forValue((e,
|
|
250
|
+
super.dispose(), this._noteMatrix.forValue((e, t, r) => {
|
|
251
251
|
r.dispose();
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
-
_initSheet(e,
|
|
254
|
+
_initSheet(e, t) {
|
|
255
255
|
var s;
|
|
256
|
-
this._noteMatrix.forValue((
|
|
256
|
+
this._noteMatrix.forValue((n, a, u) => {
|
|
257
257
|
u.dispose();
|
|
258
|
-
}), this._noteMatrix = new
|
|
259
|
-
const
|
|
260
|
-
const
|
|
261
|
-
if (
|
|
262
|
-
if (!
|
|
263
|
-
const
|
|
264
|
-
|
|
258
|
+
}), this._noteMatrix = new j();
|
|
259
|
+
const o = (n, a, u, c, l) => {
|
|
260
|
+
const p = this._noteMatrix, d = p.getValue(u, c);
|
|
261
|
+
if (l != null && l.show) {
|
|
262
|
+
if (!d) {
|
|
263
|
+
const _ = this._showPopup(n, a, u, c);
|
|
264
|
+
_ && p.setValue(u, c, _);
|
|
265
265
|
}
|
|
266
266
|
} else
|
|
267
|
-
|
|
267
|
+
d && (d.dispose(), p.realDeleteValue(u, c));
|
|
268
268
|
};
|
|
269
|
-
return (s = this._sheetsNoteModel.getSheetNotes(e,
|
|
270
|
-
|
|
271
|
-
}), this._sheetsNoteModel.change$.subscribe((
|
|
272
|
-
if (!(
|
|
273
|
-
switch (
|
|
269
|
+
return (s = this._sheetsNoteModel.getSheetNotes(e, t)) == null || s.forValue((n, a, u) => {
|
|
270
|
+
o(e, t, n, a, u);
|
|
271
|
+
}), this._sheetsNoteModel.change$.subscribe((n) => {
|
|
272
|
+
if (!(n.unitId !== e || n.sheetId !== t))
|
|
273
|
+
switch (n.type) {
|
|
274
274
|
case "ref": {
|
|
275
|
-
const { unitId: a, sheetId: u, row: c, col:
|
|
276
|
-
if (!
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
const
|
|
280
|
-
|
|
275
|
+
const { unitId: a, sheetId: u, row: c, col: l, newPosition: p, note: d } = n, _ = this._noteMatrix;
|
|
276
|
+
if (!d.show) return;
|
|
277
|
+
const f = _.getValue(c, l);
|
|
278
|
+
f && (f.dispose(), _.realDeleteValue(c, l));
|
|
279
|
+
const P = this._showPopup(a, u, p.row, p.col);
|
|
280
|
+
P && _.setValue(p.row, p.col, P);
|
|
281
281
|
break;
|
|
282
282
|
}
|
|
283
283
|
case "update": {
|
|
284
|
-
const { unitId: a, sheetId: u, row: c, col:
|
|
285
|
-
|
|
284
|
+
const { unitId: a, sheetId: u, row: c, col: l, note: p } = n;
|
|
285
|
+
o(a, u, c, l, p);
|
|
286
286
|
break;
|
|
287
287
|
}
|
|
288
288
|
}
|
|
@@ -290,314 +290,466 @@ let T = class extends N {
|
|
|
290
290
|
}
|
|
291
291
|
_initNoteChangeListener() {
|
|
292
292
|
this.disposeWithMe(
|
|
293
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
294
|
-
|
|
295
|
-
var
|
|
296
|
-
return (
|
|
293
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(I.UNIVER_SHEET).pipe(
|
|
294
|
+
Re((e) => {
|
|
295
|
+
var t;
|
|
296
|
+
return (t = e == null ? void 0 : e.activeSheet$) != null ? t : Ze(null);
|
|
297
297
|
})
|
|
298
298
|
).subscribe((e) => {
|
|
299
299
|
if (e) {
|
|
300
|
-
const
|
|
300
|
+
const t = this._initSheet(e.getUnitId(), e.getSheetId());
|
|
301
301
|
return () => {
|
|
302
|
-
|
|
302
|
+
t.unsubscribe();
|
|
303
303
|
};
|
|
304
304
|
} else
|
|
305
|
-
this._noteMatrix.forValue((
|
|
306
|
-
|
|
307
|
-
}), this._noteMatrix = new
|
|
305
|
+
this._noteMatrix.forValue((t, r, o) => {
|
|
306
|
+
o.dispose();
|
|
307
|
+
}), this._noteMatrix = new j();
|
|
308
308
|
})
|
|
309
309
|
);
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
],
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
return he(i, "".concat(r), { defIds: i.defIds, idSuffix: u.current }, d({ ref: e, className: a }, o), s);
|
|
336
|
-
});
|
|
337
|
-
function he(t, e, i, r, n) {
|
|
338
|
-
return j(t.tag, d(d({ key: e }, ft(t, i, n)), r), (vt(t, i).children || []).map(function(s, o) {
|
|
339
|
-
return he(s, "".concat(e, "-").concat(t.tag, "-").concat(o), i, void 0, n);
|
|
340
|
-
}));
|
|
312
|
+
H = lt([
|
|
313
|
+
y(0, h(M)),
|
|
314
|
+
y(1, h(D)),
|
|
315
|
+
y(2, h(ae)),
|
|
316
|
+
y(3, h(S))
|
|
317
|
+
], H);
|
|
318
|
+
function R({ ref: i, ...e }) {
|
|
319
|
+
const { icon: t, id: r, className: o, extend: s, ...n } = e, a = `univerjs-icon univerjs-icon-${r} ${o || ""}`.trim(), u = ue(`_${_t()}`);
|
|
320
|
+
return le(t, `${r}`, {
|
|
321
|
+
defIds: t.defIds,
|
|
322
|
+
idSuffix: u.current
|
|
323
|
+
}, {
|
|
324
|
+
ref: i,
|
|
325
|
+
className: a,
|
|
326
|
+
...n
|
|
327
|
+
}, s);
|
|
328
|
+
}
|
|
329
|
+
function le(i, e, t, r, o) {
|
|
330
|
+
return V(i.tag, {
|
|
331
|
+
key: e,
|
|
332
|
+
...ht(i, t, o),
|
|
333
|
+
...r
|
|
334
|
+
}, (dt(i, t).children || []).map((s, n) => le(s, `${e}-${i.tag}-${n}`, t, void 0, o)));
|
|
341
335
|
}
|
|
342
|
-
function
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
o === "mask" && typeof a == "string" && (r[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
336
|
+
function ht(i, e, t) {
|
|
337
|
+
const r = { ...i.attrs };
|
|
338
|
+
t != null && t.colorChannel1 && r.fill === "colorChannel1" && (r.fill = t.colorChannel1), i.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(([s, n]) => {
|
|
339
|
+
s === "mask" && typeof n == "string" && (r[s] = n.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
|
|
347
340
|
});
|
|
348
|
-
|
|
349
|
-
return !
|
|
350
|
-
|
|
351
|
-
typeof a == "string" && (r[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
341
|
+
const { defIds: o } = e;
|
|
342
|
+
return !o || o.length === 0 || (i.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(([s, n]) => {
|
|
343
|
+
typeof n == "string" && (r[s] = n.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
|
|
352
344
|
})), r;
|
|
353
345
|
}
|
|
354
|
-
function
|
|
355
|
-
var
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
346
|
+
function dt(i, e) {
|
|
347
|
+
var r;
|
|
348
|
+
const { defIds: t } = e;
|
|
349
|
+
return !t || t.length === 0 ? i : i.tag === "defs" && ((r = i.children) != null && r.length) ? {
|
|
350
|
+
...i,
|
|
351
|
+
children: i.children.map((o) => typeof o.attrs.id == "string" && t && t.includes(o.attrs.id) ? {
|
|
352
|
+
...o,
|
|
353
|
+
attrs: {
|
|
354
|
+
...o.attrs,
|
|
355
|
+
id: o.attrs.id + e.idSuffix
|
|
356
|
+
}
|
|
357
|
+
} : o)
|
|
358
|
+
} : i;
|
|
359
359
|
}
|
|
360
360
|
function _t() {
|
|
361
361
|
return Math.random().toString(36).substring(2, 8);
|
|
362
362
|
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
363
|
+
R.displayName = "UniverIcon";
|
|
364
|
+
const Ct = {
|
|
365
|
+
tag: "svg",
|
|
366
|
+
attrs: {
|
|
367
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
368
|
+
fill: "none",
|
|
369
|
+
viewBox: "0 0 16 16",
|
|
370
|
+
width: "1em",
|
|
371
|
+
height: "1em"
|
|
372
|
+
},
|
|
373
|
+
children: [
|
|
374
|
+
{
|
|
375
|
+
tag: "path",
|
|
376
|
+
attrs: {
|
|
377
|
+
fill: "currentColor",
|
|
378
|
+
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"
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
tag: "path",
|
|
383
|
+
attrs: {
|
|
384
|
+
fill: "currentColor",
|
|
385
|
+
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"
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
tag: "path",
|
|
390
|
+
attrs: {
|
|
391
|
+
fill: "currentColor",
|
|
392
|
+
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"
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
tag: "path",
|
|
397
|
+
attrs: {
|
|
398
|
+
fill: "currentColor",
|
|
399
|
+
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"
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
tag: "path",
|
|
404
|
+
attrs: {
|
|
405
|
+
fill: "currentColor",
|
|
406
|
+
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"
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
tag: "path",
|
|
411
|
+
attrs: {
|
|
412
|
+
fill: "currentColor",
|
|
413
|
+
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"
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
]
|
|
417
|
+
}, he = z(function(e, t) {
|
|
418
|
+
return V(R, Object.assign({}, e, {
|
|
366
419
|
id: "add-note-icon",
|
|
367
|
-
ref:
|
|
420
|
+
ref: t,
|
|
368
421
|
icon: Ct
|
|
369
422
|
}));
|
|
370
423
|
});
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
424
|
+
he.displayName = "AddNoteIcon";
|
|
425
|
+
const ft = {
|
|
426
|
+
tag: "svg",
|
|
427
|
+
attrs: {
|
|
428
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
429
|
+
fill: "none",
|
|
430
|
+
viewBox: "0 0 16 16",
|
|
431
|
+
width: "1em",
|
|
432
|
+
height: "1em"
|
|
433
|
+
},
|
|
434
|
+
children: [
|
|
435
|
+
{
|
|
436
|
+
tag: "path",
|
|
437
|
+
attrs: {
|
|
438
|
+
fill: "currentColor",
|
|
439
|
+
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"
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
tag: "path",
|
|
444
|
+
attrs: {
|
|
445
|
+
fill: "currentColor",
|
|
446
|
+
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"
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
tag: "path",
|
|
451
|
+
attrs: {
|
|
452
|
+
fill: "currentColor",
|
|
453
|
+
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"
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
tag: "path",
|
|
458
|
+
attrs: {
|
|
459
|
+
fill: "currentColor",
|
|
460
|
+
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"
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
tag: "path",
|
|
465
|
+
attrs: {
|
|
466
|
+
fill: "currentColor",
|
|
467
|
+
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"
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
]
|
|
471
|
+
}, de = z(function(e, t) {
|
|
472
|
+
return V(R, Object.assign({}, e, {
|
|
374
473
|
id: "delete-note-icon",
|
|
375
|
-
ref:
|
|
376
|
-
icon:
|
|
474
|
+
ref: t,
|
|
475
|
+
icon: ft
|
|
377
476
|
}));
|
|
378
477
|
});
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
478
|
+
de.displayName = "DeleteNoteIcon";
|
|
479
|
+
const vt = {
|
|
480
|
+
tag: "svg",
|
|
481
|
+
attrs: {
|
|
482
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
483
|
+
fill: "none",
|
|
484
|
+
viewBox: "0 0 16 16",
|
|
485
|
+
width: "1em",
|
|
486
|
+
height: "1em"
|
|
487
|
+
},
|
|
488
|
+
children: [
|
|
489
|
+
{
|
|
490
|
+
tag: "path",
|
|
491
|
+
attrs: {
|
|
492
|
+
fill: "currentColor",
|
|
493
|
+
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"
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
tag: "path",
|
|
498
|
+
attrs: {
|
|
499
|
+
fill: "currentColor",
|
|
500
|
+
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"
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
tag: "path",
|
|
505
|
+
attrs: {
|
|
506
|
+
fill: "currentColor",
|
|
507
|
+
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"
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
tag: "path",
|
|
512
|
+
attrs: {
|
|
513
|
+
fill: "currentColor",
|
|
514
|
+
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"
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
tag: "path",
|
|
519
|
+
attrs: {
|
|
520
|
+
fill: "currentColor",
|
|
521
|
+
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"
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
tag: "path",
|
|
526
|
+
attrs: {
|
|
527
|
+
fill: "currentColor",
|
|
528
|
+
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"
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
]
|
|
532
|
+
}, _e = z(function(e, t) {
|
|
533
|
+
return V(R, Object.assign({}, e, {
|
|
382
534
|
id: "hide-note-icon",
|
|
383
|
-
ref:
|
|
384
|
-
icon:
|
|
535
|
+
ref: t,
|
|
536
|
+
icon: vt
|
|
385
537
|
}));
|
|
386
538
|
});
|
|
387
|
-
|
|
388
|
-
const
|
|
539
|
+
_e.displayName = "HideNoteIcon";
|
|
540
|
+
const O = {
|
|
389
541
|
id: "sheet.operation.add-note-popup",
|
|
390
|
-
type:
|
|
391
|
-
handler: async (
|
|
392
|
-
const
|
|
542
|
+
type: Me.OPERATION,
|
|
543
|
+
handler: async (i, e) => {
|
|
544
|
+
const t = i.get(A), r = i.get(S), s = i.get(D).getCurrentUnitForType(I.UNIVER_SHEET);
|
|
393
545
|
if (!s)
|
|
394
546
|
return !1;
|
|
395
|
-
const
|
|
547
|
+
const n = s.getActiveSheet(), a = t.getCurrentLastSelection();
|
|
396
548
|
if (!(a != null && a.primary))
|
|
397
549
|
return !1;
|
|
398
550
|
const { primary: u } = a;
|
|
399
551
|
return r.showPopup({
|
|
400
552
|
unitId: s.getUnitId(),
|
|
401
|
-
subUnitId:
|
|
553
|
+
subUnitId: n.getSheetId(),
|
|
402
554
|
row: u.actualRow,
|
|
403
555
|
col: u.actualColumn,
|
|
404
556
|
temp: !1,
|
|
405
557
|
trigger: e == null ? void 0 : e.trigger
|
|
406
558
|
}), !0;
|
|
407
559
|
}
|
|
408
|
-
},
|
|
409
|
-
var
|
|
410
|
-
const { popup: e } =
|
|
411
|
-
if (!
|
|
560
|
+
}, gt = (i) => {
|
|
561
|
+
var P;
|
|
562
|
+
const { popup: e } = i, t = b(M), r = b(we), o = b(B), s = ze(pe), n = (P = e.extraProps) == null ? void 0 : P.location;
|
|
563
|
+
if (!n)
|
|
412
564
|
return console.error("Popup extraProps or location is undefined."), null;
|
|
413
|
-
const a =
|
|
414
|
-
|
|
415
|
-
var
|
|
416
|
-
const { unitId:
|
|
417
|
-
a.current && (
|
|
418
|
-
}, [
|
|
419
|
-
const
|
|
420
|
-
|
|
421
|
-
unitId:
|
|
422
|
-
sheetId:
|
|
423
|
-
row:
|
|
424
|
-
col:
|
|
425
|
-
note:
|
|
426
|
-
}) :
|
|
427
|
-
unitId:
|
|
428
|
-
sheetId:
|
|
429
|
-
row:
|
|
430
|
-
col:
|
|
565
|
+
const a = ue(null), u = o.getRenderById(n.unitId), [c, l] = Xe(null);
|
|
566
|
+
et(() => {
|
|
567
|
+
var Y, q;
|
|
568
|
+
const { unitId: C, subUnitId: g, row: w, col: fe } = n, { width: ve = 160, height: ge = 72 } = (Y = s == null ? void 0 : s.defaultNoteSize) != null ? Y : {}, Z = (q = t.getNote(C, g, w, fe)) != null ? q : { width: ve, height: ge, note: "" };
|
|
569
|
+
a.current && (l(Z), a.current.style.width = `${Z.width}px`, a.current.style.height = `${Z.height}px`);
|
|
570
|
+
}, [n, a]);
|
|
571
|
+
const p = b(re), d = Ge((C) => {
|
|
572
|
+
n && (C.note ? p.executeCommand(Le.id, {
|
|
573
|
+
unitId: n.unitId,
|
|
574
|
+
sheetId: n.subUnitId,
|
|
575
|
+
row: n.row,
|
|
576
|
+
col: n.col,
|
|
577
|
+
note: C
|
|
578
|
+
}) : p.executeCommand(F.id, {
|
|
579
|
+
unitId: n.unitId,
|
|
580
|
+
sheetId: n.subUnitId,
|
|
581
|
+
row: n.row,
|
|
582
|
+
col: n.col
|
|
431
583
|
}));
|
|
432
|
-
}),
|
|
584
|
+
}), _ = X((C) => {
|
|
433
585
|
if (!c) return;
|
|
434
|
-
const
|
|
435
|
-
|
|
436
|
-
}, [c]),
|
|
586
|
+
const g = { ...c, note: C };
|
|
587
|
+
l(g), d(g);
|
|
588
|
+
}, [c]), f = X((C, g) => {
|
|
437
589
|
if (!c) return;
|
|
438
|
-
const
|
|
439
|
-
|
|
590
|
+
const w = { ...c, width: C, height: g };
|
|
591
|
+
l(w), d(w);
|
|
440
592
|
}, [c]);
|
|
441
|
-
return /* @__PURE__ */
|
|
442
|
-
|
|
593
|
+
return /* @__PURE__ */ tt(
|
|
594
|
+
it,
|
|
443
595
|
{
|
|
444
596
|
ref: a,
|
|
445
597
|
"data-u-comp": "note-textarea",
|
|
446
|
-
className:
|
|
598
|
+
className: rt("univer-ml-px univer-min-h-1 univer-min-w-1 univer-bg-white !univer-text-sm univer-shadow dark:!univer-bg-gray-800"),
|
|
447
599
|
value: c == null ? void 0 : c.note,
|
|
448
600
|
placeholder: r.t("note.placeholder"),
|
|
449
|
-
onResize:
|
|
450
|
-
onValueChange:
|
|
451
|
-
onWheel: (
|
|
452
|
-
document.activeElement !== a.current && u.engine.getCanvasElement().dispatchEvent(new WheelEvent(
|
|
601
|
+
onResize: f,
|
|
602
|
+
onValueChange: _,
|
|
603
|
+
onWheel: (C) => {
|
|
604
|
+
document.activeElement !== a.current && u.engine.getCanvasElement().dispatchEvent(new WheelEvent(C.type, C.nativeEvent));
|
|
453
605
|
}
|
|
454
606
|
}
|
|
455
607
|
);
|
|
456
608
|
};
|
|
457
|
-
function
|
|
458
|
-
const e =
|
|
459
|
-
return e.selectionMoveEnd$.pipe(
|
|
609
|
+
function K(i) {
|
|
610
|
+
const e = i.get(A), t = i.get(D);
|
|
611
|
+
return e.selectionMoveEnd$.pipe(U(() => {
|
|
460
612
|
const r = e.getCurrentLastSelection();
|
|
461
613
|
if (!(r != null && r.primary)) return !1;
|
|
462
|
-
const
|
|
463
|
-
if (!
|
|
464
|
-
const { actualColumn: s, actualRow:
|
|
465
|
-
return !!
|
|
614
|
+
const o = Te(t);
|
|
615
|
+
if (!o) return !1;
|
|
616
|
+
const { actualColumn: s, actualRow: n } = r.primary;
|
|
617
|
+
return !!i.get(M).getNote(o.unitId, o.subUnitId, n, s);
|
|
466
618
|
}));
|
|
467
619
|
}
|
|
468
|
-
function
|
|
620
|
+
function mt(i) {
|
|
469
621
|
return {
|
|
470
|
-
id:
|
|
471
|
-
type:
|
|
622
|
+
id: O.id,
|
|
623
|
+
type: W.BUTTON,
|
|
472
624
|
title: "rightClick.addNote",
|
|
473
625
|
icon: "AddNoteIcon",
|
|
474
|
-
hidden$:
|
|
475
|
-
disabled$:
|
|
476
|
-
commandId:
|
|
626
|
+
hidden$: je([Ke(i, I.UNIVER_SHEET), K(i)]).pipe(U(([e, t]) => e || t)),
|
|
627
|
+
disabled$: ce(i, { workbookTypes: [ne], worksheetTypes: [oe] }),
|
|
628
|
+
commandId: O.id
|
|
477
629
|
};
|
|
478
630
|
}
|
|
479
|
-
function
|
|
631
|
+
function St(i) {
|
|
480
632
|
return {
|
|
481
|
-
id:
|
|
482
|
-
type:
|
|
633
|
+
id: F.id,
|
|
634
|
+
type: W.BUTTON,
|
|
483
635
|
title: "rightClick.deleteNote",
|
|
484
636
|
icon: "DeleteNoteIcon",
|
|
485
|
-
hidden$:
|
|
486
|
-
disabled$:
|
|
637
|
+
hidden$: K(i).pipe(U((e) => !e)),
|
|
638
|
+
disabled$: ce(i, { workbookTypes: [ne], worksheetTypes: [oe] })
|
|
487
639
|
};
|
|
488
640
|
}
|
|
489
|
-
function
|
|
641
|
+
function Pt(i) {
|
|
490
642
|
return {
|
|
491
|
-
id:
|
|
492
|
-
type:
|
|
643
|
+
id: se.id,
|
|
644
|
+
type: W.BUTTON,
|
|
493
645
|
title: "rightClick.toggleNote",
|
|
494
646
|
icon: "HideNoteIcon",
|
|
495
|
-
hidden$:
|
|
647
|
+
hidden$: K(i).pipe(U((e) => !e))
|
|
496
648
|
};
|
|
497
649
|
}
|
|
498
|
-
const
|
|
499
|
-
[
|
|
500
|
-
[
|
|
650
|
+
const Nt = {
|
|
651
|
+
[Ye.MAIN_AREA]: {
|
|
652
|
+
[qe.OTHERS]: {
|
|
501
653
|
order: 0,
|
|
502
|
-
[
|
|
654
|
+
[O.id]: {
|
|
503
655
|
order: 0,
|
|
504
|
-
menuItemFactory:
|
|
656
|
+
menuItemFactory: mt
|
|
505
657
|
},
|
|
506
|
-
[
|
|
658
|
+
[F.id]: {
|
|
507
659
|
order: 0,
|
|
508
|
-
menuItemFactory:
|
|
660
|
+
menuItemFactory: St
|
|
509
661
|
},
|
|
510
|
-
[
|
|
662
|
+
[se.id]: {
|
|
511
663
|
order: 0,
|
|
512
|
-
menuItemFactory:
|
|
664
|
+
menuItemFactory: Pt
|
|
513
665
|
}
|
|
514
666
|
}
|
|
515
667
|
}
|
|
516
668
|
};
|
|
517
|
-
var
|
|
518
|
-
for (var
|
|
519
|
-
(
|
|
520
|
-
return
|
|
521
|
-
},
|
|
522
|
-
let
|
|
523
|
-
constructor(
|
|
524
|
-
super(), this._componentManager =
|
|
669
|
+
var It = Object.getOwnPropertyDescriptor, Mt = (i, e, t, r) => {
|
|
670
|
+
for (var o = r > 1 ? void 0 : r ? It(e, t) : e, s = i.length - 1, n; s >= 0; s--)
|
|
671
|
+
(n = i[s]) && (o = n(o) || o);
|
|
672
|
+
return o;
|
|
673
|
+
}, k = (i, e) => (t, r) => e(t, r, i);
|
|
674
|
+
let T = class extends N {
|
|
675
|
+
constructor(i, e, t) {
|
|
676
|
+
super(), this._componentManager = i, this._menuManagerService = e, this._commandService = t, this._initComponents(), this._initMenu(), this._initCommands();
|
|
525
677
|
}
|
|
526
678
|
_initComponents() {
|
|
527
679
|
[
|
|
528
|
-
[
|
|
529
|
-
["AddNoteIcon",
|
|
530
|
-
["DeleteNoteIcon",
|
|
531
|
-
["HideNoteIcon",
|
|
532
|
-
].forEach(([
|
|
680
|
+
[G, gt],
|
|
681
|
+
["AddNoteIcon", he],
|
|
682
|
+
["DeleteNoteIcon", de],
|
|
683
|
+
["HideNoteIcon", _e]
|
|
684
|
+
].forEach(([i, e]) => {
|
|
533
685
|
this.disposeWithMe(
|
|
534
|
-
this._componentManager.register(
|
|
686
|
+
this._componentManager.register(i, e)
|
|
535
687
|
);
|
|
536
688
|
});
|
|
537
689
|
}
|
|
538
690
|
_initMenu() {
|
|
539
|
-
this._menuManagerService.mergeMenu(
|
|
691
|
+
this._menuManagerService.mergeMenu(Nt);
|
|
540
692
|
}
|
|
541
693
|
_initCommands() {
|
|
542
|
-
this._commandService.registerCommand(
|
|
694
|
+
this._commandService.registerCommand(O);
|
|
543
695
|
}
|
|
544
696
|
};
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
],
|
|
550
|
-
var
|
|
551
|
-
for (var
|
|
552
|
-
(
|
|
553
|
-
return
|
|
554
|
-
},
|
|
555
|
-
const
|
|
556
|
-
let
|
|
557
|
-
constructor(
|
|
558
|
-
super(), this._config =
|
|
559
|
-
const { menu: r, ...
|
|
697
|
+
T = Mt([
|
|
698
|
+
k(0, h(Je)),
|
|
699
|
+
k(1, h(Qe)),
|
|
700
|
+
k(2, re)
|
|
701
|
+
], T);
|
|
702
|
+
var wt = Object.defineProperty, bt = Object.getOwnPropertyDescriptor, Et = (i, e, t) => e in i ? wt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, yt = (i, e, t, r) => {
|
|
703
|
+
for (var o = r > 1 ? void 0 : r ? bt(e, t) : e, s = i.length - 1, n; s >= 0; s--)
|
|
704
|
+
(n = i[s]) && (o = n(o) || o);
|
|
705
|
+
return o;
|
|
706
|
+
}, ie = (i, e) => (t, r) => e(t, r, i), Ce = (i, e, t) => Et(i, typeof e != "symbol" ? e + "" : e, t);
|
|
707
|
+
const $t = "SHEET_NOTE_UI_PLUGIN";
|
|
708
|
+
let L = class extends $e {
|
|
709
|
+
constructor(i = te, e, t) {
|
|
710
|
+
super(), this._config = i, this._injector = e, this._configService = t;
|
|
711
|
+
const { menu: r, ...o } = xe(
|
|
560
712
|
{},
|
|
561
|
-
|
|
713
|
+
te,
|
|
562
714
|
this._config
|
|
563
715
|
);
|
|
564
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(pe,
|
|
716
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(pe, o);
|
|
565
717
|
}
|
|
566
718
|
onStarting() {
|
|
567
719
|
[
|
|
568
|
-
[
|
|
720
|
+
[S],
|
|
721
|
+
[$],
|
|
569
722
|
[x],
|
|
570
|
-
[
|
|
571
|
-
[
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
this._injector.add(t);
|
|
723
|
+
[T],
|
|
724
|
+
[H]
|
|
725
|
+
].forEach((i) => {
|
|
726
|
+
this._injector.add(i);
|
|
575
727
|
});
|
|
576
728
|
}
|
|
577
729
|
onReady() {
|
|
578
|
-
|
|
579
|
-
[
|
|
580
|
-
[
|
|
730
|
+
Q(this._injector, [
|
|
731
|
+
[T],
|
|
732
|
+
[$]
|
|
581
733
|
]);
|
|
582
734
|
}
|
|
583
735
|
onRendered() {
|
|
584
|
-
|
|
585
|
-
[
|
|
586
|
-
[
|
|
736
|
+
Q(this._injector, [
|
|
737
|
+
[x],
|
|
738
|
+
[H]
|
|
587
739
|
]);
|
|
588
740
|
}
|
|
589
741
|
};
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
],
|
|
742
|
+
Ce(L, "pluginName", $t);
|
|
743
|
+
Ce(L, "type", I.UNIVER_SHEET);
|
|
744
|
+
L = yt([
|
|
745
|
+
be(De),
|
|
746
|
+
ie(1, h(Ee)),
|
|
747
|
+
ie(2, ye)
|
|
748
|
+
], L);
|
|
597
749
|
export {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
750
|
+
$ as SheetsCellContentController,
|
|
751
|
+
gt as SheetsNote,
|
|
752
|
+
x as SheetsNotePopupController,
|
|
753
|
+
S as SheetsNotePopupService,
|
|
754
|
+
L as UniverSheetsNoteUIPlugin
|
|
603
755
|
};
|