@univerjs/sheets-note-ui 0.8.0-beta.0 → 0.8.0-beta.1

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/es/index.js CHANGED
@@ -1,45 +1,42 @@
1
- var _e = Object.defineProperty;
2
- var ge = (i, e, n) => e in i ? _e(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
- var C = (i, e, n) => ge(i, typeof e != "symbol" ? e + "" : e, n);
4
- import { Inject as v, IUniverInstanceService as $, Disposable as P, InterceptorEffectEnum as Ce, UniverInstanceType as b, DisposableCollection as me, ObjectMatrix as R, RANGE_TYPE as q, Rectangle as Se, CommandType as Ne, LocaleService as Pe, ICommandService as te, DependentOn as be, Injector as Ie, IConfigService as Me, Plugin as we, merge as ye, touchDependencies as J } from "@univerjs/core";
5
- import { SheetsNoteModel as I, SheetUpdateNoteCommand as Oe, SheetDeleteNoteCommand as B, SheetToggleNotePopupCommand as ie, UniverSheetsNotePlugin as xe } from "@univerjs/sheets-note";
6
- import { IRenderManagerService as re } from "@univerjs/engine-render";
7
- import { SheetInterceptorService as Ee, INTERCEPTOR_POINT as He, SheetsSelectionsService as A, WorksheetEditPermission as ne, WorkbookEditablePermission as oe, getSheetCommandTarget as Te } from "@univerjs/sheets";
8
- import { debounceTime as $e, BehaviorSubject as Ue, switchMap as Le, of as se, map as U, combineLatest as De } from "rxjs";
9
- import { CellPopupManagerService as ae, IEditorBridgeService as Ve, HoverManagerService as Re, SheetSkeletonManagerService as je, getCurrentRangeDisable$ as ce } from "@univerjs/sheets-ui";
10
- import { IZenZoneService as ze, useDependency as j, useConfigValue as ke, useDebounceFn as Be, MenuItemType as F, getMenuHiddenObservable as Ae, ContextMenuPosition as Fe, ContextMenuGroup as We, ComponentManager as Ze, IMenuManagerService as Ge } from "@univerjs/ui";
11
- import { debounceTime as Ke } from "rxjs/operators";
12
- import { jsx as Ye } from "react/jsx-runtime";
13
- import { clsx as qe, borderClassName as Je, scrollbarClassName as Qe } from "@univerjs/design";
14
- import { forwardRef as L, useRef as ue, createElement as D, useState as Xe, useMemo as et, useEffect as z } from "react";
15
- const le = "sheets-note-ui.config", Q = {};
16
- var tt = Object.getOwnPropertyDescriptor, it = (i, e, n, r) => {
17
- for (var t = r > 1 ? void 0 : r ? tt(e, n) : e, o = i.length - 1, s; o >= 0; o--)
18
- (s = i[o]) && (t = s(t) || t);
19
- return t;
20
- }, M = (i, e) => (n, r) => e(n, r, i);
21
- let y = class extends P {
22
- constructor(i, e, n, r) {
23
- super(), this._sheetInterceptorService = i, this._sheetsNoteModel = e, this._renderManagerService = n, this._univerInstanceService = r, this._initViewModelIntercept(), this._initSkeletonChange();
1
+ var Ce = Object.defineProperty;
2
+ var me = (t, e, i) => e in t ? Ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
3
+ var S = (t, e, i) => me(t, typeof e != "symbol" ? e + "" : e, i);
4
+ import { Inject as d, IUniverInstanceService as D, Disposable as w, InterceptorEffectEnum as Se, UniverInstanceType as b, DisposableCollection as Ne, ObjectMatrix as k, RANGE_TYPE as X, Rectangle as Pe, CommandType as Ie, LocaleService as we, ICommandService as ne, DependentOn as be, Injector as Me, IConfigService as ye, Plugin as Ee, merge as Oe, touchDependencies as ee } from "@univerjs/core";
5
+ import { SheetsNoteModel as M, SheetUpdateNoteCommand as xe, SheetDeleteNoteCommand as F, SheetToggleNotePopupCommand as oe, UniverSheetsNotePlugin as He } from "@univerjs/sheets-note";
6
+ import { IRenderManagerService as W } from "@univerjs/engine-render";
7
+ import { SheetInterceptorService as Te, INTERCEPTOR_POINT as $e, SheetsSelectionsService as z, WorksheetEditPermission as se, WorkbookEditablePermission as ae, getSheetCommandTarget as Ue } from "@univerjs/sheets";
8
+ import { debounceTime as Le, BehaviorSubject as De, switchMap as Re, of as ce, map as R, combineLatest as Ve } from "rxjs";
9
+ import { CellPopupManagerService as ue, IEditorBridgeService as je, HoverManagerService as Ze, SheetSkeletonManagerService as ke, getCurrentRangeDisable$ as le } from "@univerjs/sheets-ui";
10
+ import { IZenZoneService as Be, useDependency as y, useConfigValue as Ae, useDebounceFn as Fe, MenuItemType as G, getMenuHiddenObservable as We, ContextMenuPosition as ze, ContextMenuGroup as Ge, ComponentManager as Ke, IMenuManagerService as Ye } from "@univerjs/ui";
11
+ import { debounceTime as qe } from "rxjs/operators";
12
+ import { jsx as Je } from "react/jsx-runtime";
13
+ import { clsx as Qe, borderClassName as Xe, scrollbarClassName as et } from "@univerjs/design";
14
+ import { forwardRef as V, useRef as pe, createElement as j, useState as tt, useMemo as it, useEffect as B } from "react";
15
+ const he = "sheets-note-ui.config", te = {};
16
+ var rt = Object.getOwnPropertyDescriptor, nt = (t, e, i, r) => {
17
+ for (var n = r > 1 ? void 0 : r ? rt(e, i) : e, o = t.length - 1, s; o >= 0; o--)
18
+ (s = t[o]) && (n = s(n) || n);
19
+ return n;
20
+ }, E = (t, e) => (i, r) => e(i, r, t);
21
+ let x = class extends w {
22
+ constructor(t, e, i, r) {
23
+ super(), this._sheetInterceptorService = t, this._sheetsNoteModel = e, this._renderManagerService = i, this._univerInstanceService = r, this._initViewModelIntercept(), this._initSkeletonChange();
24
24
  }
25
25
  _initViewModelIntercept() {
26
26
  this.disposeWithMe(
27
27
  this._sheetInterceptorService.intercept(
28
- He.CELL_CONTENT,
28
+ $e.CELL_CONTENT,
29
29
  {
30
- effect: Ce.Style,
31
- handler: (i, e, n) => {
32
- const { row: r, col: t, unitId: o, subUnitId: s } = e;
33
- return this._sheetsNoteModel.getNote(o, s, r, t) ? n({
34
- ...i,
35
- markers: {
36
- ...i == null ? void 0 : i.markers,
37
- tr: {
38
- color: "#FFBD37",
39
- size: 6
40
- }
30
+ effect: Se.Style,
31
+ handler: (t, e, i) => {
32
+ const { row: r, col: n, unitId: o, subUnitId: s } = e;
33
+ return this._sheetsNoteModel.getNote(o, s, r, n) && ((!t || t === e.rawData) && (t = { ...e.rawData }), t.markers = {
34
+ ...t == null ? void 0 : t.markers,
35
+ tr: {
36
+ color: "#FFBD37",
37
+ size: 6
41
38
  }
42
- }) : n(i);
39
+ }), i(t);
43
40
  },
44
41
  priority: 100
45
42
  }
@@ -47,38 +44,38 @@ let y = class extends P {
47
44
  );
48
45
  }
49
46
  _initSkeletonChange() {
50
- const i = () => {
51
- var t;
47
+ const t = () => {
48
+ var n;
52
49
  const e = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET);
53
50
  if (!e) return;
54
- const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
55
- (t = r == null ? void 0 : r.mainComponent) == null || t.makeForceDirty();
51
+ const i = e.getUnitId(), r = this._renderManagerService.getRenderById(i);
52
+ (n = r == null ? void 0 : r.mainComponent) == null || n.makeForceDirty();
56
53
  };
57
- this.disposeWithMe(this._sheetsNoteModel.change$.pipe($e(16)).subscribe(() => {
58
- i();
54
+ this.disposeWithMe(this._sheetsNoteModel.change$.pipe(Le(16)).subscribe(() => {
55
+ t();
59
56
  }));
60
57
  }
61
58
  };
62
- y = it([
63
- M(0, v(Ee)),
64
- M(1, v(I)),
65
- M(2, re),
66
- M(3, $)
67
- ], y);
68
- const W = "SHEET_NOTE_COMPONENT";
69
- var rt = Object.getOwnPropertyDescriptor, nt = (i, e, n, r) => {
70
- for (var t = r > 1 ? void 0 : r ? rt(e, n) : e, o = i.length - 1, s; o >= 0; o--)
71
- (s = i[o]) && (t = s(t) || t);
72
- return t;
73
- }, X = (i, e) => (n, r) => e(n, r, i);
74
- let S = class extends P {
75
- constructor(e, n) {
59
+ x = nt([
60
+ E(0, d(Te)),
61
+ E(1, d(M)),
62
+ E(2, W),
63
+ E(3, D)
64
+ ], x);
65
+ const K = "SHEET_NOTE_COMPONENT";
66
+ var ot = Object.getOwnPropertyDescriptor, st = (t, e, i, r) => {
67
+ for (var n = r > 1 ? void 0 : r ? ot(e, i) : e, o = t.length - 1, s; o >= 0; o--)
68
+ (s = t[o]) && (n = s(n) || n);
69
+ return n;
70
+ }, ie = (t, e) => (i, r) => e(i, r, t);
71
+ let P = class extends w {
72
+ constructor(e, i) {
76
73
  super();
77
- C(this, "_lastPopup", null);
78
- C(this, "_activePopup");
79
- C(this, "_activePopup$", new Ue(null));
80
- C(this, "activePopup$", this._activePopup$.asObservable());
81
- this._zenZoneService = e, this._cellPopupManagerService = n, this._initZenVisible(), this.disposeWithMe(() => {
74
+ S(this, "_lastPopup", null);
75
+ S(this, "_activePopup");
76
+ S(this, "_activePopup$", new De(null));
77
+ S(this, "activePopup$", this._activePopup$.asObservable());
78
+ this._zenZoneService = e, this._cellPopupManagerService = i, this._initZenVisible(), this.disposeWithMe(() => {
82
79
  this._activePopup$.complete();
83
80
  });
84
81
  }
@@ -90,10 +87,10 @@ let S = class extends P {
90
87
  e && this.hidePopup();
91
88
  }));
92
89
  }
93
- showPopup(e, n) {
90
+ showPopup(e, i) {
94
91
  var l;
95
- const { row: r, col: t, unitId: o, subUnitId: s } = e;
96
- if (this._activePopup && r === this._activePopup.row && t === this._activePopup.col && o === this._activePopup.unitId && s === ((l = this.activePopup) == null ? void 0 : l.subUnitId)) {
92
+ const { row: r, col: n, unitId: o, subUnitId: s } = e;
93
+ if (this._activePopup && r === this._activePopup.row && n === this._activePopup.col && o === this._activePopup.unitId && s === ((l = this.activePopup) == null ? void 0 : l.subUnitId)) {
97
94
  this._activePopup = e, this._activePopup$.next(e);
98
95
  return;
99
96
  }
@@ -105,10 +102,10 @@ let S = class extends P {
105
102
  unitId: o,
106
103
  subUnitId: s,
107
104
  row: r,
108
- col: t
105
+ col: n
109
106
  },
110
107
  {
111
- componentKey: W,
108
+ componentKey: K,
112
109
  onClickOutside: () => {
113
110
  this.hidePopup();
114
111
  },
@@ -121,10 +118,10 @@ let S = class extends P {
121
118
  );
122
119
  if (!a)
123
120
  throw new Error("[SheetsNotePopupService]: cannot show popup!");
124
- const c = new me();
121
+ const c = new Ne();
125
122
  c.add(a), c.add({
126
123
  dispose: () => {
127
- n == null || n();
124
+ i == null || i();
128
125
  }
129
126
  }), this._lastPopup = c;
130
127
  }
@@ -138,76 +135,76 @@ let S = class extends P {
138
135
  }, this._activePopup$.next(this._activePopup));
139
136
  }
140
137
  };
141
- S = nt([
142
- X(0, ze),
143
- X(1, v(ae))
144
- ], S);
145
- var ot = Object.getOwnPropertyDescriptor, st = (i, e, n, r) => {
146
- for (var t = r > 1 ? void 0 : r ? ot(e, n) : e, o = i.length - 1, s; o >= 0; o--)
147
- (s = i[o]) && (t = s(t) || t);
148
- return t;
149
- }, w = (i, e) => (n, r) => e(n, r, i);
150
- let O = class extends P {
151
- constructor(e, n, r, t) {
138
+ P = st([
139
+ ie(0, Be),
140
+ ie(1, d(ue))
141
+ ], P);
142
+ var at = Object.getOwnPropertyDescriptor, ct = (t, e, i, r) => {
143
+ for (var n = r > 1 ? void 0 : r ? at(e, i) : e, o = t.length - 1, s; o >= 0; o--)
144
+ (s = t[o]) && (n = s(n) || n);
145
+ return n;
146
+ }, O = (t, e) => (i, r) => e(i, r, t);
147
+ let H = class extends w {
148
+ constructor(e, i, r, n) {
152
149
  super();
153
- C(this, "_noteMatrix", new R());
154
- this._sheetsNoteModel = e, this._univerInstanceService = n, this._cellPopupManagerService = r, this._sheetsNotePopupService = t, this._initNoteChangeListener();
150
+ S(this, "_noteMatrix", new k());
151
+ this._sheetsNoteModel = e, this._univerInstanceService = i, this._cellPopupManagerService = r, this._sheetsNotePopupService = n, this._initNoteChangeListener();
155
152
  }
156
- _showPopup(e, n, r, t) {
153
+ _showPopup(e, i, r, n) {
157
154
  return this._sheetsNotePopupService.hidePopup(!0), this._cellPopupManagerService.showPopup(
158
155
  {
159
156
  unitId: e,
160
- subUnitId: n,
157
+ subUnitId: i,
161
158
  row: r,
162
- col: t
159
+ col: n
163
160
  },
164
161
  {
165
- componentKey: W,
162
+ componentKey: K,
166
163
  direction: "horizontal",
167
164
  extraProps: {
168
165
  location: {
169
166
  unitId: e,
170
- subUnitId: n,
167
+ subUnitId: i,
171
168
  row: r,
172
- col: t
169
+ col: n
173
170
  }
174
171
  },
175
172
  priority: 3
176
173
  }
177
174
  );
178
175
  }
179
- _initSheet(e, n) {
176
+ _initSheet(e, i) {
180
177
  var o;
181
178
  this._noteMatrix.forValue((s, a, c) => {
182
179
  c.dispose();
183
- }), this._noteMatrix = new R();
184
- const t = (s, a, c, l, d) => {
185
- const p = this._noteMatrix, _ = p.getValue(c, l);
186
- if (d != null && d.show) {
187
- if (!_) {
188
- const u = this._showPopup(s, a, c, l);
189
- u && p.setValue(c, l, u);
180
+ }), this._noteMatrix = new k();
181
+ const n = (s, a, c, l, h) => {
182
+ const p = this._noteMatrix, f = p.getValue(c, l);
183
+ if (h != null && h.show) {
184
+ if (!f) {
185
+ const g = this._showPopup(s, a, c, l);
186
+ g && p.setValue(c, l, g);
190
187
  }
191
188
  } else
192
- _ && (_.dispose(), p.realDeleteValue(c, l));
189
+ f && (f.dispose(), p.realDeleteValue(c, l));
193
190
  };
194
- return (o = this._sheetsNoteModel.getSheetNotes(e, n)) == null || o.forValue((s, a, c) => {
195
- t(e, n, s, a, c);
191
+ return (o = this._sheetsNoteModel.getSheetNotes(e, i)) == null || o.forValue((s, a, c) => {
192
+ n(e, i, s, a, c);
196
193
  }), this._sheetsNoteModel.change$.subscribe((s) => {
197
- if (!(s.unitId !== e || s.sheetId !== n))
194
+ if (!(s.unitId !== e || s.sheetId !== i))
198
195
  switch (s.type) {
199
196
  case "ref": {
200
- const { unitId: a, sheetId: c, row: l, col: d, newPosition: p, note: _ } = s, u = this._noteMatrix;
201
- if (!_.show) return;
202
- const h = u.getValue(l, d);
203
- h && (h.dispose(), u.realDeleteValue(l, d));
204
- const g = this._showPopup(a, c, p.row, p.col);
205
- g && u.setValue(p.row, p.col, g);
197
+ const { unitId: a, sheetId: c, row: l, col: h, newPosition: p, note: f } = s, g = this._noteMatrix;
198
+ if (!f.show) return;
199
+ const C = g.getValue(l, h);
200
+ C && (C.dispose(), g.realDeleteValue(l, h));
201
+ const u = this._showPopup(a, c, p.row, p.col);
202
+ u && g.setValue(p.row, p.col, u);
206
203
  break;
207
204
  }
208
205
  case "update": {
209
- const { unitId: a, sheetId: c, row: l, col: d, note: p } = s;
210
- t(a, c, l, d, p);
206
+ const { unitId: a, sheetId: c, row: l, col: h, note: p } = s;
207
+ n(a, c, l, h, p);
211
208
  break;
212
209
  }
213
210
  }
@@ -216,57 +213,57 @@ let O = class extends P {
216
213
  _initNoteChangeListener() {
217
214
  this.disposeWithMe(
218
215
  this._univerInstanceService.getCurrentTypeOfUnit$(b.UNIVER_SHEET).pipe(
219
- Le((e) => {
220
- var n;
221
- return (n = e == null ? void 0 : e.activeSheet$) != null ? n : se(null);
216
+ Re((e) => {
217
+ var i;
218
+ return (i = e == null ? void 0 : e.activeSheet$) != null ? i : ce(null);
222
219
  })
223
220
  ).subscribe((e) => {
224
221
  if (e) {
225
- const n = this._initSheet(e.getUnitId(), e.getSheetId());
222
+ const i = this._initSheet(e.getUnitId(), e.getSheetId());
226
223
  return () => {
227
- n.unsubscribe();
224
+ i.unsubscribe();
228
225
  };
229
226
  } else
230
- this._noteMatrix.forValue((n, r, t) => {
231
- t.dispose();
232
- }), this._noteMatrix = new R();
227
+ this._noteMatrix.forValue((i, r, n) => {
228
+ n.dispose();
229
+ }), this._noteMatrix = new k();
233
230
  })
234
231
  );
235
232
  }
236
233
  };
237
- O = st([
238
- w(0, v(I)),
239
- w(1, v($)),
240
- w(2, v(ae)),
241
- w(3, v(S))
242
- ], O);
243
- var at = Object.getOwnPropertyDescriptor, ct = (i, e, n, r) => {
244
- for (var t = r > 1 ? void 0 : r ? at(e, n) : e, o = i.length - 1, s; o >= 0; o--)
245
- (s = i[o]) && (t = s(t) || t);
246
- return t;
247
- }, m = (i, e) => (n, r) => e(n, r, i);
248
- let x = class extends P {
249
- constructor(e, n, r, t, o, s) {
234
+ H = ct([
235
+ O(0, d(M)),
236
+ O(1, d(D)),
237
+ O(2, d(ue)),
238
+ O(3, d(P))
239
+ ], H);
240
+ var ut = Object.getOwnPropertyDescriptor, lt = (t, e, i, r) => {
241
+ for (var n = r > 1 ? void 0 : r ? ut(e, i) : e, o = t.length - 1, s; o >= 0; o--)
242
+ (s = t[o]) && (n = s(n) || n);
243
+ return n;
244
+ }, N = (t, e) => (i, r) => e(i, r, t);
245
+ let T = class extends w {
246
+ constructor(e, i, r, n, o, s) {
250
247
  super();
251
- C(this, "_isSwitchingSheet", !1);
252
- this._sheetsNotePopupService = e, this._sheetsNoteModel = n, this._sheetSelectionService = r, this._editorBridgeService = t, this._renderManagerService = o, this._hoverManagerService = s, this._initSelectionUpdateListener(), this._initEditorBridge(), this._initHoverEvent();
248
+ S(this, "_isSwitchingSheet", !1);
249
+ this._sheetsNotePopupService = e, this._sheetsNoteModel = i, this._sheetSelectionService = r, this._editorBridgeService = n, this._renderManagerService = o, this._hoverManagerService = s, this._initSelectionUpdateListener(), this._initEditorBridge(), this._initHoverEvent();
253
250
  }
254
- _handleSelectionChange(e, n, r) {
255
- var _, u, h;
256
- const t = (_ = e[0]) == null ? void 0 : _.range, o = this._renderManagerService.getRenderById(n), s = (u = o == null ? void 0 : o.with(je).getSkeletonParam(r)) == null ? void 0 : u.skeleton;
257
- if (!s || !t)
251
+ _handleSelectionChange(e, i, r) {
252
+ var f, g, C;
253
+ const n = (f = e[0]) == null ? void 0 : f.range, o = this._renderManagerService.getRenderById(i), s = (g = o == null ? void 0 : o.with(ke).getSkeletonParam(r)) == null ? void 0 : g.skeleton;
254
+ if (!s || !n)
258
255
  return;
259
- const a = s.getCellWithCoordByIndex(t.startRow, t.startColumn);
260
- if ((((h = t.rangeType) != null ? h : q.NORMAL) !== q.NORMAL || t.endColumn - t.startColumn > 0 || t.endRow - t.startRow > 0) && !((a.isMerged || a.isMergedMainCell) && Se.equals(a.mergeInfo, t))) {
256
+ const a = s.getCellWithCoordByIndex(n.startRow, n.startColumn);
257
+ if ((((C = n.rangeType) != null ? C : X.NORMAL) !== X.NORMAL || n.endColumn - n.startColumn > 0 || n.endRow - n.startRow > 0) && !((a.isMerged || a.isMergedMainCell) && Pe.equals(a.mergeInfo, n))) {
261
258
  this._sheetsNotePopupService.hidePopup();
262
259
  return;
263
260
  }
264
- const l = a.actualRow, d = a.actualColumn, p = this._sheetsNoteModel.getNote(n, r, l, d);
261
+ const l = a.actualRow, h = a.actualColumn, p = this._sheetsNoteModel.getNote(i, r, l, h);
265
262
  p != null && p.show || (p ? this._sheetsNotePopupService.showPopup({
266
- unitId: n,
263
+ unitId: i,
267
264
  subUnitId: r,
268
265
  row: l,
269
- col: d
266
+ col: h
270
267
  }) : this._sheetsNotePopupService.hidePopup(!0));
271
268
  }
272
269
  _initSelectionUpdateListener() {
@@ -274,8 +271,8 @@ let x = class extends P {
274
271
  this._sheetSelectionService.selectionMoveEnd$.subscribe((e) => {
275
272
  if (this._isSwitchingSheet)
276
273
  return;
277
- const n = this._sheetSelectionService.currentSelectionParam;
278
- n && this._handleSelectionChange(e, n.unitId, n.sheetId);
274
+ const i = this._sheetSelectionService.currentSelectionParam;
275
+ i && this._handleSelectionChange(e, i.unitId, i.sheetId);
279
276
  })
280
277
  );
281
278
  }
@@ -288,13 +285,13 @@ let x = class extends P {
288
285
  }
289
286
  _initHoverEvent() {
290
287
  this.disposeWithMe(
291
- this._hoverManagerService.currentCell$.pipe(Ke(100)).subscribe((e) => {
288
+ this._hoverManagerService.currentCell$.pipe(qe(100)).subscribe((e) => {
292
289
  if (!(e != null && e.location)) return;
293
- const { unitId: n, subUnitId: r, row: t, col: o } = e.location, s = this._sheetsNoteModel.getNote(n, r, t, o);
290
+ const { unitId: i, subUnitId: r, row: n, col: o } = e.location, s = this._sheetsNoteModel.getNote(i, r, n, o);
294
291
  s != null && s.show || (s ? this._sheetsNotePopupService.showPopup({
295
- unitId: n,
292
+ unitId: i,
296
293
  subUnitId: r,
297
- row: t,
294
+ row: n,
298
295
  col: o,
299
296
  temp: !0
300
297
  }) : this._sheetsNotePopupService.hidePopup());
@@ -302,92 +299,92 @@ let x = class extends P {
302
299
  );
303
300
  }
304
301
  };
305
- x = ct([
306
- m(0, v(S)),
307
- m(1, v(I)),
308
- m(2, v(A)),
309
- m(3, Ve),
310
- m(4, re),
311
- m(5, v(Re))
312
- ], x);
313
- var f = function() {
314
- return f = Object.assign || function(i) {
315
- for (var e, n = 1, r = arguments.length; n < r; n++) {
316
- e = arguments[n];
317
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && (i[t] = e[t]);
302
+ T = lt([
303
+ N(0, d(P)),
304
+ N(1, d(M)),
305
+ N(2, d(z)),
306
+ N(3, je),
307
+ N(4, W),
308
+ N(5, d(Ze))
309
+ ], T);
310
+ var v = function() {
311
+ return v = Object.assign || function(t) {
312
+ for (var e, i = 1, r = arguments.length; i < r; i++) {
313
+ e = arguments[i];
314
+ for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
318
315
  }
319
- return i;
320
- }, f.apply(this, arguments);
321
- }, ut = function(i, e) {
322
- var n = {};
323
- for (var r in i) Object.prototype.hasOwnProperty.call(i, r) && e.indexOf(r) < 0 && (n[r] = i[r]);
324
- if (i != null && typeof Object.getOwnPropertySymbols == "function")
325
- for (var t = 0, r = Object.getOwnPropertySymbols(i); t < r.length; t++)
326
- e.indexOf(r[t]) < 0 && Object.prototype.propertyIsEnumerable.call(i, r[t]) && (n[r[t]] = i[r[t]]);
327
- return n;
328
- }, V = L(function(i, e) {
329
- var n = i.icon, r = i.id, t = i.className, o = i.extend, s = ut(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(t || "").trim(), c = ue("_".concat(ht()));
330
- return pe(n, "".concat(r), { defIds: n.defIds, idSuffix: c.current }, f({ ref: e, className: a }, s), o);
316
+ return t;
317
+ }, v.apply(this, arguments);
318
+ }, pt = function(t, e) {
319
+ var i = {};
320
+ for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (i[r] = t[r]);
321
+ if (t != null && typeof Object.getOwnPropertySymbols == "function")
322
+ for (var n = 0, r = Object.getOwnPropertySymbols(t); n < r.length; n++)
323
+ e.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[n]) && (i[r[n]] = t[r[n]]);
324
+ return i;
325
+ }, Z = V(function(t, e) {
326
+ var i = t.icon, r = t.id, n = t.className, o = t.extend, s = pt(t, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(n || "").trim(), c = pe("_".concat(vt()));
327
+ return de(i, "".concat(r), { defIds: i.defIds, idSuffix: c.current }, v({ ref: e, className: a }, s), o);
331
328
  });
332
- function pe(i, e, n, r, t) {
333
- return D(i.tag, f(f({ key: e }, lt(i, n, t)), r), (pt(i, n).children || []).map(function(o, s) {
334
- return pe(o, "".concat(e, "-").concat(i.tag, "-").concat(s), n, void 0, t);
329
+ function de(t, e, i, r, n) {
330
+ return j(t.tag, v(v({ key: e }, ht(t, i, n)), r), (dt(t, i).children || []).map(function(o, s) {
331
+ return de(o, "".concat(e, "-").concat(t.tag, "-").concat(s), i, void 0, n);
335
332
  }));
336
333
  }
337
- function lt(i, e, n) {
338
- var r = f({}, i.attrs);
339
- n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1), i.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(function(o) {
334
+ function ht(t, e, i) {
335
+ var r = v({}, 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(o) {
340
337
  var s = o[0], a = o[1];
341
338
  s === "mask" && typeof a == "string" && (r[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
342
339
  });
343
- var t = e.defIds;
344
- return !t || t.length === 0 || (i.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(o) {
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(o) {
345
342
  var s = o[0], a = o[1];
346
343
  typeof a == "string" && (r[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
347
344
  })), r;
348
345
  }
349
- function pt(i, e) {
350
- var n, r = e.defIds;
351
- return !r || r.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? f(f({}, i), { children: i.children.map(function(t) {
352
- return typeof t.attrs.id == "string" && r && r.indexOf(t.attrs.id) > -1 ? f(f({}, t), { attrs: f(f({}, t.attrs), { id: t.attrs.id + e.idSuffix }) }) : t;
353
- }) }) : i;
346
+ function dt(t, e) {
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) ? v(v({}, t), { children: t.children.map(function(n) {
349
+ return typeof n.attrs.id == "string" && r && r.includes(n.attrs.id) ? v(v({}, n), { attrs: v(v({}, n.attrs), { id: n.attrs.id + e.idSuffix }) }) : n;
350
+ }) }) : t;
354
351
  }
355
- function ht() {
352
+ function vt() {
356
353
  return Math.random().toString(36).substring(2, 8);
357
354
  }
358
- V.displayName = "UniverIcon";
359
- var dt = { tag: "svg", attrs: { 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.20363 10.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.20363 5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463zM8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001 8.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.00001 5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307zM6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964 7.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.7964 5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319zM10.8813 14.4312V10.2925C10.8813 9.92522 11.1791 9.62745 11.5463 9.62745 11.9136 9.62745 12.2114 9.92522 12.2114 10.2925V14.4312C12.2112 14.7983 11.9135 15.0962 11.5463 15.0962 11.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" } }] }, he = L(function(i, e) {
360
- return D(V, Object.assign({}, i, {
361
- id: "add-note-single",
355
+ Z.displayName = "UniverIcon";
356
+ var ft = { 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" } }] }, ve = V(function(t, e) {
357
+ return j(Z, Object.assign({}, t, {
358
+ id: "add-note-icon",
362
359
  ref: e,
363
- icon: dt
360
+ icon: ft
364
361
  }));
365
362
  });
366
- he.displayName = "AddNoteSingle";
367
- var vt = { tag: "svg", attrs: { 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.20363 10.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.20363 5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463zM8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001 8.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.00001 5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307zM6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964 7.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.7964 5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319zM9.47489 11.6968H13.6175C13.9847 11.6968 14.2825 11.9946 14.2825 12.3618 14.2825 12.7291 13.9847 13.0269 13.6175 13.0269H9.47489C9.10762 13.0269 8.80985 12.7291 8.80985 12.3618 8.80985 11.9946 9.10762 11.6968 9.47489 11.6968z" } }] }, de = L(function(i, e) {
368
- return D(V, Object.assign({}, i, {
369
- id: "delete-note-single",
363
+ ve.displayName = "AddNoteIcon";
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
+ return j(Z, Object.assign({}, t, {
366
+ id: "delete-note-icon",
370
367
  ref: e,
371
- icon: vt
368
+ icon: gt
372
369
  }));
373
370
  });
374
- de.displayName = "DeleteNoteSingle";
375
- var ft = { tag: "svg", attrs: { 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.20363 10.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.20363 5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463zM8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001 8.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.00001 5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307zM6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964 7.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.7964 5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319zM13.8743 12.6147C13.8742 12.5394 13.7749 12.2553 13.3909 11.9477 13.039 11.6659 12.5573 11.4614 12.0394 11.4614 11.5213 11.4614 11.0398 11.6666 10.6878 11.9487 10.3037 12.2565 10.2045 12.5399 10.2044 12.6147 10.2044 12.6893 10.3034 12.9737 10.6878 13.2817 11.0398 13.5636 11.5215 13.768 12.0394 13.768 12.5574 13.768 13.039 13.5635 13.3909 13.2817 13.7751 12.9739 13.8743 12.6897 13.8743 12.6147zM15.2044 12.6147C15.2044 13.2772 14.7436 13.9027 14.223 14.3198 13.6701 14.7627 12.9019 15.0981 12.0394 15.0981 11.1768 15.0981 10.4085 14.7627 9.85577 14.3198 9.33533 13.9027 8.87433 13.2769 8.87433 12.6147 8.8744 11.9526 9.33541 11.3276 9.85577 10.9106 10.4086 10.4676 11.1767 10.1313 12.0394 10.1313 12.9018 10.1313 13.6701 10.4668 14.223 10.9096 14.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 = L(function(i, e) {
376
- return D(V, Object.assign({}, i, {
377
- id: "hide-note-single",
371
+ fe.displayName = "DeleteNoteIcon";
372
+ var _t = { 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" } }] }, ge = V(function(t, e) {
373
+ return j(Z, Object.assign({}, t, {
374
+ id: "hide-note-icon",
378
375
  ref: e,
379
- icon: ft
376
+ icon: _t
380
377
  }));
381
378
  });
382
- ve.displayName = "HideNoteSingle";
383
- const E = {
379
+ ge.displayName = "HideNoteIcon";
380
+ const $ = {
384
381
  id: "sheet.operation.add-note-popup",
385
- type: Ne.OPERATION,
386
- handler: async (i, e) => {
387
- const n = i.get(A), r = i.get(S), o = i.get($).getCurrentUnitForType(b.UNIVER_SHEET);
382
+ type: Ie.OPERATION,
383
+ handler: async (t, e) => {
384
+ const i = t.get(z), r = t.get(P), o = t.get(D).getCurrentUnitForType(b.UNIVER_SHEET);
388
385
  if (!o)
389
386
  return !1;
390
- const s = o.getActiveSheet(), a = n.getCurrentLastSelection();
387
+ const s = o.getActiveSheet(), a = i.getCurrentLastSelection();
391
388
  if (!(a != null && a.primary))
392
389
  return !1;
393
390
  const { primary: c } = a;
@@ -400,215 +397,218 @@ const E = {
400
397
  trigger: e == null ? void 0 : e.trigger
401
398
  }), !0;
402
399
  }
403
- }, _t = (i) => {
404
- var _;
405
- const e = j(I), n = j(Pe), r = ke(le), t = (_ = i.popup.extraProps) == null ? void 0 : _.location;
406
- if (!t)
400
+ }, Ct = (t) => {
401
+ var C;
402
+ const e = y(M), i = y(we), r = y(W), n = Ae(he), o = (C = t.popup.extraProps) == null ? void 0 : C.location;
403
+ if (!o)
407
404
  return console.error("Popup extraProps or location is undefined."), null;
408
- const [o, s] = Xe(() => {
409
- var g, N;
410
- const u = { width: ((g = r == null ? void 0 : r.defaultNoteSize) == null ? void 0 : g.width) || 216, height: ((N = r == null ? void 0 : r.defaultNoteSize) == null ? void 0 : N.height) || 92, note: "" };
411
- return e.getNote(t.unitId, t.subUnitId, t.row, t.col) || u;
412
- }), a = ue(null), c = j(te), l = et(() => t ? e.getCellNoteChange$(t.unitId, t.subUnitId, t.row, t.col) : se(null), [t]), d = Be((u) => {
413
- t && (u.note ? c.executeCommand(Oe.id, {
414
- unitId: t.unitId,
415
- sheetId: t.subUnitId,
416
- row: t.row,
417
- col: t.col,
405
+ const s = r.getRenderById(o.unitId), [a, c] = tt(() => {
406
+ var m, I;
407
+ const u = { width: ((m = n == null ? void 0 : n.defaultNoteSize) == null ? void 0 : m.width) || 216, height: ((I = n == null ? void 0 : n.defaultNoteSize) == null ? void 0 : I.height) || 92, note: "" };
408
+ return e.getNote(o.unitId, o.subUnitId, o.row, o.col) || u;
409
+ }), l = pe(null), h = y(ne), p = it(() => o ? e.getCellNoteChange$(o.unitId, o.subUnitId, o.row, o.col) : ce(null), [o]), f = Fe((u) => {
410
+ o && (u.note ? h.executeCommand(xe.id, {
411
+ unitId: o.unitId,
412
+ sheetId: o.subUnitId,
413
+ row: o.row,
414
+ col: o.col,
418
415
  note: u
419
- }) : c.executeCommand(B.id, {
420
- unitId: t.unitId,
421
- sheetId: t.subUnitId,
422
- row: t.row,
423
- col: t.col
416
+ }) : h.executeCommand(F.id, {
417
+ unitId: o.unitId,
418
+ sheetId: o.subUnitId,
419
+ row: o.row,
420
+ col: o.col
424
421
  }));
425
422
  });
426
- z(() => {
423
+ B(() => {
427
424
  var u;
428
- t && (e.getNote(t.unitId, t.subUnitId, t.row, t.col) || (u = a.current) == null || u.focus());
429
- }, [t, e]), z(() => {
430
- const u = l.subscribe(() => {
431
- if (!t) return;
432
- const h = e.getNote(t.unitId, t.subUnitId, t.row, t.col);
433
- h && s(h);
425
+ o && (e.getNote(o.unitId, o.subUnitId, o.row, o.col) || (u = l.current) == null || u.focus());
426
+ }, [o, e]), B(() => {
427
+ const u = p.subscribe(() => {
428
+ if (!o) return;
429
+ const _ = e.getNote(o.unitId, o.subUnitId, o.row, o.col);
430
+ _ && c(_);
434
431
  });
435
432
  return () => u.unsubscribe();
436
- }, [l]), z(() => {
437
- const u = a.current;
433
+ }, [p]), B(() => {
434
+ const u = l.current;
438
435
  if (!u) return;
439
- const h = new ResizeObserver((g) => {
440
- const N = g[0];
441
- if (!N) return;
442
- const { width: G, height: K } = N.contentRect;
443
- if (G === 0 && K === 0) return;
444
- const Y = { ...o, width: G, height: K };
445
- s(Y), d(Y);
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);
446
443
  });
447
- return h.observe(u), () => {
448
- h.unobserve(u), h.disconnect();
444
+ return _.observe(u), () => {
445
+ _.unobserve(u), _.disconnect();
449
446
  };
450
- }, [o.note]);
451
- const p = (u) => {
452
- const h = u.target.value, g = { ...o, note: h };
453
- s(g), d(g);
447
+ }, [a.note]);
448
+ const g = (u) => {
449
+ const _ = u.target.value, m = { ...a, note: _ };
450
+ c(m), f(m);
454
451
  };
455
- return /* @__PURE__ */ Ye(
452
+ return /* @__PURE__ */ Je(
456
453
  "textarea",
457
454
  {
458
- ref: a,
455
+ onWheel: (u) => {
456
+ document.activeElement !== l.current && s.engine.getCanvasElement().dispatchEvent(new WheelEvent(u.type, u.nativeEvent));
457
+ },
458
+ ref: l,
459
459
  "data-u-comp": "note-textarea",
460
- className: qe("univer-resize-both univer-ml-px univer-rounded-md univer-bg-white univer-p-2 univer-text-gray-900 univer-shadow dark:!univer-bg-gray-800 dark:!univer-text-white focus:univer-outline-none", Je, Qe),
461
- style: { width: o.width, height: o.height },
462
- value: o.note,
463
- placeholder: n.t("note.placeholder"),
464
- onChange: p
460
+ className: Qe("univer-resize-both univer-ml-px univer-rounded-md univer-bg-white univer-p-2 univer-text-gray-900 univer-shadow dark:!univer-bg-gray-800 dark:!univer-text-white focus:univer-outline-none", Xe, et),
461
+ style: { width: a.width, height: a.height },
462
+ value: a.note,
463
+ placeholder: i.t("note.placeholder"),
464
+ onChange: g
465
465
  }
466
466
  );
467
467
  };
468
- function Z(i) {
469
- const e = i.get(A), n = i.get($);
470
- return e.selectionMoveEnd$.pipe(U(() => {
468
+ function Y(t) {
469
+ const e = t.get(z), i = t.get(D);
470
+ return e.selectionMoveEnd$.pipe(R(() => {
471
471
  const r = e.getCurrentLastSelection();
472
472
  if (!(r != null && r.primary)) return !1;
473
- const t = Te(n);
474
- if (!t) return !1;
473
+ const n = Ue(i);
474
+ if (!n) return !1;
475
475
  const { actualColumn: o, actualRow: s } = r.primary;
476
- return !!i.get(I).getNote(t.unitId, t.subUnitId, s, o);
476
+ return !!t.get(M).getNote(n.unitId, n.subUnitId, s, o);
477
477
  }));
478
478
  }
479
- function gt(i) {
479
+ function mt(t) {
480
480
  return {
481
- id: E.id,
482
- type: F.BUTTON,
481
+ id: $.id,
482
+ type: G.BUTTON,
483
483
  title: "rightClick.addNote",
484
- icon: "AddNoteSingle",
485
- hidden$: De([Ae(i, b.UNIVER_SHEET), Z(i)]).pipe(U(([e, n]) => e || n)),
486
- disabled$: ce(i, { workbookTypes: [oe], worksheetTypes: [ne] }),
487
- commandId: E.id
484
+ icon: "AddNoteIcon",
485
+ hidden$: Ve([We(t, b.UNIVER_SHEET), Y(t)]).pipe(R(([e, i]) => e || i)),
486
+ disabled$: le(t, { workbookTypes: [ae], worksheetTypes: [se] }),
487
+ commandId: $.id
488
488
  };
489
489
  }
490
- function Ct(i) {
490
+ function St(t) {
491
491
  return {
492
- id: B.id,
493
- type: F.BUTTON,
492
+ id: F.id,
493
+ type: G.BUTTON,
494
494
  title: "rightClick.deleteNote",
495
- icon: "DeleteNoteSingle",
496
- hidden$: Z(i).pipe(U((e) => !e)),
497
- disabled$: ce(i, { workbookTypes: [oe], worksheetTypes: [ne] })
495
+ icon: "DeleteNoteIcon",
496
+ hidden$: Y(t).pipe(R((e) => !e)),
497
+ disabled$: le(t, { workbookTypes: [ae], worksheetTypes: [se] })
498
498
  };
499
499
  }
500
- function mt(i) {
500
+ function Nt(t) {
501
501
  return {
502
- id: ie.id,
503
- type: F.BUTTON,
502
+ id: oe.id,
503
+ type: G.BUTTON,
504
504
  title: "rightClick.toggleNote",
505
- icon: "HideNoteSingle",
506
- hidden$: Z(i).pipe(U((e) => !e))
505
+ icon: "HideNoteIcon",
506
+ hidden$: Y(t).pipe(R((e) => !e))
507
507
  };
508
508
  }
509
- const St = {
510
- [Fe.MAIN_AREA]: {
511
- [We.OTHERS]: {
509
+ const Pt = {
510
+ [ze.MAIN_AREA]: {
511
+ [Ge.OTHERS]: {
512
512
  order: 0,
513
- [E.id]: {
513
+ [$.id]: {
514
514
  order: 0,
515
- menuItemFactory: gt
515
+ menuItemFactory: mt
516
516
  },
517
- [B.id]: {
517
+ [F.id]: {
518
518
  order: 0,
519
- menuItemFactory: Ct
519
+ menuItemFactory: St
520
520
  },
521
- [ie.id]: {
521
+ [oe.id]: {
522
522
  order: 0,
523
- menuItemFactory: mt
523
+ menuItemFactory: Nt
524
524
  }
525
525
  }
526
526
  }
527
527
  };
528
- var Nt = Object.getOwnPropertyDescriptor, Pt = (i, e, n, r) => {
529
- for (var t = r > 1 ? void 0 : r ? Nt(e, n) : e, o = i.length - 1, s; o >= 0; o--)
530
- (s = i[o]) && (t = s(t) || t);
531
- return t;
532
- }, k = (i, e) => (n, r) => e(n, r, i);
533
- let H = class extends P {
534
- constructor(i, e, n) {
535
- super(), this._componentManager = i, this._menuManagerService = e, this._commandService = n, this._initComponents(), this._initMenu(), this._initCommands();
528
+ var It = Object.getOwnPropertyDescriptor, wt = (t, e, i, r) => {
529
+ for (var n = r > 1 ? void 0 : r ? It(e, i) : e, o = t.length - 1, s; o >= 0; o--)
530
+ (s = t[o]) && (n = s(n) || n);
531
+ return n;
532
+ }, A = (t, e) => (i, r) => e(i, r, t);
533
+ let U = class extends w {
534
+ constructor(t, e, i) {
535
+ super(), this._componentManager = t, this._menuManagerService = e, this._commandService = i, this._initComponents(), this._initMenu(), this._initCommands();
536
536
  }
537
537
  _initComponents() {
538
538
  [
539
- [W, _t],
540
- ["AddNoteSingle", he],
541
- ["DeleteNoteSingle", de],
542
- ["HideNoteSingle", ve]
543
- ].forEach(([i, e]) => {
539
+ [K, Ct],
540
+ ["AddNoteIcon", ve],
541
+ ["DeleteNoteIcon", fe],
542
+ ["HideNoteIcon", ge]
543
+ ].forEach(([t, e]) => {
544
544
  this.disposeWithMe(
545
- this._componentManager.register(i, e)
545
+ this._componentManager.register(t, e)
546
546
  );
547
547
  });
548
548
  }
549
549
  _initMenu() {
550
- this._menuManagerService.mergeMenu(St);
550
+ this._menuManagerService.mergeMenu(Pt);
551
551
  }
552
552
  _initCommands() {
553
- this._commandService.registerCommand(E);
553
+ this._commandService.registerCommand($);
554
554
  }
555
555
  };
556
- H = Pt([
557
- k(0, v(Ze)),
558
- k(1, v(Ge)),
559
- k(2, te)
560
- ], H);
561
- var bt = Object.defineProperty, It = Object.getOwnPropertyDescriptor, Mt = (i, e, n) => e in i ? bt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, wt = (i, e, n, r) => {
562
- for (var t = r > 1 ? void 0 : r ? It(e, n) : e, o = i.length - 1, s; o >= 0; o--)
563
- (s = i[o]) && (t = s(t) || t);
564
- return t;
565
- }, ee = (i, e) => (n, r) => e(n, r, i), fe = (i, e, n) => Mt(i, typeof e != "symbol" ? e + "" : e, n);
566
- const yt = "SHEET_NOTE_UI_PLUGIN";
567
- let T = class extends we {
568
- constructor(i = Q, e, n) {
569
- super(), this._config = i, this._injector = e, this._configService = n;
570
- const { menu: r, ...t } = ye(
556
+ U = wt([
557
+ A(0, d(Ke)),
558
+ A(1, d(Ye)),
559
+ A(2, ne)
560
+ ], U);
561
+ var bt = Object.defineProperty, Mt = Object.getOwnPropertyDescriptor, yt = (t, e, i) => e in t ? bt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, Et = (t, e, i, r) => {
562
+ for (var n = r > 1 ? void 0 : r ? Mt(e, i) : e, o = t.length - 1, s; o >= 0; o--)
563
+ (s = t[o]) && (n = s(n) || n);
564
+ return n;
565
+ }, re = (t, e) => (i, r) => e(i, r, t), _e = (t, e, i) => yt(t, typeof e != "symbol" ? e + "" : e, i);
566
+ const Ot = "SHEET_NOTE_UI_PLUGIN";
567
+ let L = class extends Ee {
568
+ constructor(t = te, e, i) {
569
+ super(), this._config = t, this._injector = e, this._configService = i;
570
+ const { menu: r, ...n } = Oe(
571
571
  {},
572
- Q,
572
+ te,
573
573
  this._config
574
574
  );
575
- r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(le, t);
575
+ r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(he, n);
576
576
  }
577
577
  onStarting() {
578
578
  [
579
- [S],
580
- [y],
579
+ [P],
581
580
  [x],
582
- [H],
583
- [O]
584
- ].forEach((i) => {
585
- this._injector.add(i);
581
+ [T],
582
+ [U],
583
+ [H]
584
+ ].forEach((t) => {
585
+ this._injector.add(t);
586
586
  });
587
587
  }
588
588
  onReady() {
589
- J(this._injector, [
590
- [H],
591
- [y]
589
+ ee(this._injector, [
590
+ [U],
591
+ [x]
592
592
  ]);
593
593
  }
594
594
  onRendered() {
595
- J(this._injector, [
596
- [x],
597
- [O]
595
+ ee(this._injector, [
596
+ [T],
597
+ [H]
598
598
  ]);
599
599
  }
600
600
  };
601
- fe(T, "pluginName", yt);
602
- fe(T, "type", b.UNIVER_SHEET);
603
- T = wt([
604
- be(xe),
605
- ee(1, v(Ie)),
606
- ee(2, Me)
607
- ], T);
601
+ _e(L, "pluginName", Ot);
602
+ _e(L, "type", b.UNIVER_SHEET);
603
+ L = Et([
604
+ be(He),
605
+ re(1, d(Me)),
606
+ re(2, ye)
607
+ ], L);
608
608
  export {
609
- y as SheetsCellContentController,
610
- _t as SheetsNote,
611
- x as SheetsNotePopupController,
612
- S as SheetsNotePopupService,
613
- T as UniverSheetsNoteUIPlugin
609
+ x as SheetsCellContentController,
610
+ Ct as SheetsNote,
611
+ T as SheetsNotePopupController,
612
+ P as SheetsNotePopupService,
613
+ L as UniverSheetsNoteUIPlugin
614
614
  };