@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/index.js CHANGED
@@ -1,41 +1,41 @@
1
- var Se = Object.defineProperty;
2
- var Pe = (t, e, i) => e in t ? Se(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
3
- var g = (t, e, i) => Pe(t, typeof e != "symbol" ? e + "" : e, i);
4
- import { Inject as h, IUniverInstanceService as D, Disposable as N, InterceptorEffectEnum as Ie, UniverInstanceType as M, DisposableCollection as Ne, RANGE_TYPE as Q, Rectangle as Me, ObjectMatrix as B, CommandType as we, LocaleService as be, ICommandService as ne, DependentOn as ye, Injector as Ee, IConfigService as Oe, Plugin as xe, merge as He, touchDependencies as X } from "@univerjs/core";
5
- import { IRenderManagerService as F } from "@univerjs/engine-render";
6
- import { SheetInterceptorService as Te, INTERCEPTOR_POINT as $e, SheetsSelectionsService as W, WorksheetEditPermission as oe, WorkbookEditablePermission as se, getSheetCommandTarget as Le } from "@univerjs/sheets";
7
- import { SheetsNoteModel as w, SheetUpdateNoteCommand as Ue, SheetDeleteNoteCommand as z, SheetToggleNotePopupCommand as ae, UniverSheetsNotePlugin as De } from "@univerjs/sheets-note";
8
- import { debounceTime as Ve, BehaviorSubject as Re, switchMap as je, of as Ze, map as V, combineLatest as ke } from "rxjs";
9
- import { CellPopupManagerService as ce, IEditorBridgeService as Be, HoverManagerService as Ae, SheetSkeletonManagerService as Fe, getCurrentRangeDisable$ as ue } from "@univerjs/sheets-ui";
10
- import { debounceTime as We } from "rxjs/operators";
11
- import { IZenZoneService as ze, useDependency as y, useConfigValue as Ge, useDebounceFn as Ke, MenuItemType as G, getMenuHiddenObservable as Ye, ContextMenuPosition as qe, ContextMenuGroup as Je, ComponentManager as Qe, IMenuManagerService as Xe } from "@univerjs/ui";
12
- import { jsx as et } from "react/jsx-runtime";
13
- import { Textarea as tt, clsx as it } from "@univerjs/design";
14
- import { forwardRef as R, useRef as le, createElement as j, useState as rt, useEffect as nt, useCallback as ee } from "react";
15
- var ot = Object.getOwnPropertyDescriptor, st = (t, e, i, r) => {
16
- for (var n = r > 1 ? void 0 : r ? ot(e, i) : e, s = t.length - 1, o; s >= 0; s--)
17
- (o = t[s]) && (n = o(n) || n);
18
- return n;
19
- }, E = (t, e) => (i, r) => e(i, r, t);
20
- let x = class extends N {
21
- constructor(t, e, i, r) {
22
- super(), this._sheetInterceptorService = t, this._sheetsNoteModel = e, this._renderManagerService = i, this._univerInstanceService = r, this._initViewModelIntercept(), this._initSkeletonChange();
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
- $e.CELL_CONTENT,
27
+ Oe.CELL_CONTENT,
28
28
  {
29
- effect: Ie.Style,
30
- handler: (t, e, i) => {
31
- const { row: r, col: n, unitId: s, subUnitId: o } = e;
32
- return this._sheetsNoteModel.getNote(s, o, r, n) && ((!t || t === e.rawData) && (t = { ...e.rawData }), t.markers = {
33
- ...t == null ? void 0 : t.markers,
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(t);
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 t = () => {
47
- var n;
48
- const e = this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SHEET);
46
+ const i = () => {
47
+ var o;
48
+ const e = this._univerInstanceService.getCurrentUnitForType(I.UNIVER_SHEET);
49
49
  if (!e) return;
50
- const i = e.getUnitId(), r = this._renderManagerService.getRenderById(i);
51
- (n = r == null ? void 0 : r.mainComponent) == null || n.makeForceDirty();
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(Ve(16)).subscribe(() => {
54
- t();
53
+ this.disposeWithMe(this._sheetsNoteModel.change$.pipe(Ue(16)).subscribe(() => {
54
+ i();
55
55
  }));
56
56
  }
57
57
  };
58
- x = st([
59
- E(0, h(Te)),
60
- E(1, h(w)),
61
- E(2, F),
58
+ $ = nt([
59
+ E(0, h(He)),
60
+ E(1, h(M)),
61
+ E(2, B),
62
62
  E(3, D)
63
- ], x);
64
- const K = "SHEET_NOTE_COMPONENT";
65
- var at = Object.getOwnPropertyDescriptor, ct = (t, e, i, r) => {
66
- for (var n = r > 1 ? void 0 : r ? at(e, i) : e, s = t.length - 1, o; s >= 0; s--)
67
- (o = t[s]) && (n = o(n) || n);
68
- return n;
69
- }, te = (t, e) => (i, r) => e(i, r, t);
70
- let P = class extends N {
71
- constructor(e, i) {
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
- g(this, "_lastPopup", null);
74
- g(this, "_activePopup");
75
- g(this, "_activePopup$", new Re(null));
76
- g(this, "activePopup$", this._activePopup$.asObservable());
77
- this._zenZoneService = e, this._cellPopupManagerService = i, this._initZenVisible(), this.disposeWithMe(() => {
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, i) {
92
+ showPopup(e, t) {
93
93
  var c;
94
- const { row: r, col: n, unitId: s, subUnitId: o } = e;
95
- if (this._activePopup && r === this._activePopup.row && n === this._activePopup.col && s === this._activePopup.unitId && o === ((c = this.activePopup) == null ? void 0 : c.subUnitId)) {
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: o,
105
+ subUnitId: n,
106
106
  row: r,
107
- col: n
107
+ col: o
108
108
  },
109
109
  {
110
- componentKey: K,
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
- i == null || i();
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
- P = ct([
141
- te(0, ze),
142
- te(1, h(ce))
143
- ], P);
144
- var ut = Object.getOwnPropertyDescriptor, lt = (t, e, i, r) => {
145
- for (var n = r > 1 ? void 0 : r ? ut(e, i) : e, s = t.length - 1, o; s >= 0; s--)
146
- (o = t[s]) && (n = o(n) || n);
147
- return n;
148
- }, S = (t, e) => (i, r) => e(i, r, t);
149
- let H = class extends N {
150
- constructor(e, i, r, n, s, o) {
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
- g(this, "_isSwitchingSheet", !1);
153
- this._sheetsNotePopupService = e, this._sheetsNoteModel = i, this._sheetSelectionService = r, this._editorBridgeService = n, this._renderManagerService = s, this._hoverManagerService = o, this._initSelectionUpdateListener(), this._initEditorBridge(), this._initHoverEvent();
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, i, r) {
156
- var f, v, C;
157
- const n = (f = e[0]) == null ? void 0 : f.range, s = this._renderManagerService.getRenderById(i), o = (v = s == null ? void 0 : s.with(Fe).getSkeletonParam(r)) == null ? void 0 : v.skeleton;
158
- if (!o || !n)
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 = o.getCellWithCoordByIndex(n.startRow, n.startColumn);
161
- if ((((C = n.rangeType) != null ? C : Q.NORMAL) !== Q.NORMAL || n.endColumn - n.startColumn > 0 || n.endRow - n.startRow > 0) && !((a.isMerged || a.isMergedMainCell) && Me.equals(a.mergeInfo, n))) {
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, p = a.actualColumn, l = this._sheetsNoteModel.getNote(i, r, c, p);
166
- l != null && l.show || (l ? this._sheetsNotePopupService.showPopup({
167
- unitId: i,
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: p
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 i = this._sheetSelectionService.currentSelectionParam;
179
- i && this._handleSelectionChange(e, i.unitId, i.sheetId);
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(We(100)).subscribe((e) => {
192
+ this._hoverManagerService.currentCell$.pipe(Fe(100)).subscribe((e) => {
193
193
  if (!(e != null && e.location)) return;
194
- const { unitId: i, subUnitId: r, row: n, col: s } = e.location, o = this._sheetsNoteModel.getNote(i, r, n, s);
195
- o != null && o.show || (o ? this._sheetsNotePopupService.showPopup({
196
- unitId: i,
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: n,
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
- H = lt([
207
- S(0, h(P)),
208
- S(1, h(w)),
209
- S(2, h(W)),
210
- S(3, Be),
211
- S(4, F),
212
- S(5, h(Ae))
213
- ], H);
214
- const pe = "sheets-note-ui.config", ie = {};
215
- var pt = Object.getOwnPropertyDescriptor, ht = (t, e, i, r) => {
216
- for (var n = r > 1 ? void 0 : r ? pt(e, i) : e, s = t.length - 1, o; s >= 0; s--)
217
- (o = t[s]) && (n = o(n) || n);
218
- return n;
219
- }, O = (t, e) => (i, r) => e(i, r, t);
220
- let T = class extends N {
221
- constructor(e, i, r, n) {
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
- g(this, "_noteMatrix", new B());
224
- this._sheetsNoteModel = e, this._univerInstanceService = i, this._cellPopupManagerService = r, this._sheetsNotePopupService = n, this._initNoteChangeListener();
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, i, r, n) {
226
+ _showPopup(e, t, r, o) {
227
227
  return this._sheetsNotePopupService.hidePopup(!0), this._cellPopupManagerService.showPopup(
228
228
  {
229
229
  unitId: e,
230
- subUnitId: i,
230
+ subUnitId: t,
231
231
  row: r,
232
- col: n
232
+ col: o
233
233
  },
234
234
  {
235
- componentKey: K,
235
+ componentKey: G,
236
236
  direction: "horizontal",
237
237
  extraProps: {
238
238
  location: {
239
239
  unitId: e,
240
- subUnitId: i,
240
+ subUnitId: t,
241
241
  row: r,
242
- col: n
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, i, r) => {
250
+ super.dispose(), this._noteMatrix.forValue((e, t, r) => {
251
251
  r.dispose();
252
252
  });
253
253
  }
254
- _initSheet(e, i) {
254
+ _initSheet(e, t) {
255
255
  var s;
256
- this._noteMatrix.forValue((o, a, u) => {
256
+ this._noteMatrix.forValue((n, a, u) => {
257
257
  u.dispose();
258
- }), this._noteMatrix = new B();
259
- const n = (o, a, u, c, p) => {
260
- const l = this._noteMatrix, f = l.getValue(u, c);
261
- if (p != null && p.show) {
262
- if (!f) {
263
- const v = this._showPopup(o, a, u, c);
264
- v && l.setValue(u, c, v);
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
- f && (f.dispose(), l.realDeleteValue(u, c));
267
+ d && (d.dispose(), p.realDeleteValue(u, c));
268
268
  };
269
- return (s = this._sheetsNoteModel.getSheetNotes(e, i)) == null || s.forValue((o, a, u) => {
270
- n(e, i, o, a, u);
271
- }), this._sheetsNoteModel.change$.subscribe((o) => {
272
- if (!(o.unitId !== e || o.sheetId !== i))
273
- switch (o.type) {
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: p, newPosition: l, note: f } = o, v = this._noteMatrix;
276
- if (!f.show) return;
277
- const C = v.getValue(c, p);
278
- C && (C.dispose(), v.realDeleteValue(c, p));
279
- const I = this._showPopup(a, u, l.row, l.col);
280
- I && v.setValue(l.row, l.col, I);
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: p, note: l } = o;
285
- n(a, u, c, p, l);
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$(M.UNIVER_SHEET).pipe(
294
- je((e) => {
295
- var i;
296
- return (i = e == null ? void 0 : e.activeSheet$) != null ? i : Ze(null);
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 i = this._initSheet(e.getUnitId(), e.getSheetId());
300
+ const t = this._initSheet(e.getUnitId(), e.getSheetId());
301
301
  return () => {
302
- i.unsubscribe();
302
+ t.unsubscribe();
303
303
  };
304
304
  } else
305
- this._noteMatrix.forValue((i, r, n) => {
306
- n.dispose();
307
- }), this._noteMatrix = new B();
305
+ this._noteMatrix.forValue((t, r, o) => {
306
+ o.dispose();
307
+ }), this._noteMatrix = new j();
308
308
  })
309
309
  );
310
310
  }
311
311
  };
312
- T = ht([
313
- O(0, h(w)),
314
- O(1, h(D)),
315
- O(2, h(ce)),
316
- O(3, h(P))
317
- ], T);
318
- var d = function() {
319
- return d = Object.assign || function(t) {
320
- for (var e, i = 1, r = arguments.length; i < r; i++) {
321
- e = arguments[i];
322
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
323
- }
324
- return t;
325
- }, d.apply(this, arguments);
326
- }, dt = function(t, e) {
327
- var i = {};
328
- for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (i[r] = t[r]);
329
- if (t != null && typeof Object.getOwnPropertySymbols == "function")
330
- for (var n = 0, r = Object.getOwnPropertySymbols(t); n < r.length; n++)
331
- e.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[n]) && (i[r[n]] = t[r[n]]);
332
- return i;
333
- }, Z = R(function(t, e) {
334
- var i = t.icon, r = t.id, n = t.className, s = t.extend, o = dt(t, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(n || "").trim(), u = le("_".concat(_t()));
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 ft(t, e, i) {
343
- var r = d({}, t.attrs);
344
- i != null && i.colorChannel1 && r.fill === "colorChannel1" && (r.fill = i.colorChannel1), t.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(function(s) {
345
- var o = s[0], a = s[1];
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
- var n = e.defIds;
349
- return !n || n.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(s) {
350
- var o = s[0], a = s[1];
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 vt(t, e) {
355
- var i, r = e.defIds;
356
- return !r || r.length === 0 ? t : t.tag === "defs" && (!((i = t.children) === null || i === void 0) && i.length) ? d(d({}, t), { children: t.children.map(function(n) {
357
- return typeof n.attrs.id == "string" && r && r.includes(n.attrs.id) ? d(d({}, n), { attrs: d(d({}, n.attrs), { id: n.attrs.id + e.idSuffix }) }) : n;
358
- }) }) : t;
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
- Z.displayName = "UniverIcon";
364
- var Ct = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M10.8813 14.4312V10.2925C10.8813 9.92522 11.1791 9.62745 11.5463 9.62745C11.9136 9.62745 12.2114 9.92522 12.2114 10.2925V14.4312C12.2112 14.7983 11.9135 15.0962 11.5463 15.0962C11.1791 15.0962 10.8814 14.7983 10.8813 14.4312Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M9.47697 11.6968H11.5463H13.6156C13.9829 11.6968 14.2807 11.9946 14.2807 12.3618C14.2807 12.7291 13.9829 13.0269 13.6156 13.0269H9.47697C9.10981 13.0267 8.81193 12.729 8.81193 12.3618C8.81193 11.9946 9.10981 11.6969 9.47697 11.6968Z" } }] }, de = R(function(t, e) {
365
- return j(Z, Object.assign({}, t, {
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: e,
420
+ ref: t,
368
421
  icon: Ct
369
422
  }));
370
423
  });
371
- de.displayName = "AddNoteIcon";
372
- 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 = R(function(t, e) {
373
- return j(Z, Object.assign({}, t, {
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: e,
376
- icon: gt
474
+ ref: t,
475
+ icon: ft
377
476
  }));
378
477
  });
379
- fe.displayName = "DeleteNoteIcon";
380
- var mt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.8481 8.00049V3.87451C12.8481 3.13737 12.2503 2.5398 11.5132 2.53955H4.48682C3.74952 2.53955 3.15186 3.13721 3.15186 3.87451V12.1255C3.15186 12.8628 3.74952 13.4604 4.48682 13.4604H6.99951L7.1333 13.4741C7.43655 13.536 7.66454 13.804 7.66455 14.1255C7.66455 14.447 7.43655 14.715 7.1333 14.7769L6.99951 14.7905H4.48682C3.01498 14.7905 1.82178 13.5973 1.82178 12.1255V3.87451C1.82178 2.40267 3.01498 1.20947 4.48682 1.20947H11.5132C12.9848 1.20972 14.1772 2.40283 14.1772 3.87451V8.00049C14.177 8.36738 13.8801 8.6643 13.5132 8.66455C13.1461 8.66455 12.8484 8.36754 12.8481 8.00049Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M10.1463 4.53859L10.2801 4.55226C10.5832 4.61419 10.8113 4.8822 10.8113 5.20363C10.8113 5.52506 10.5832 5.79306 10.2801 5.85499L10.1463 5.86867H5.85331C5.48604 5.86867 5.18827 5.5709 5.18827 5.20363C5.18827 4.83636 5.48604 4.53859 5.85331 4.53859H10.1463Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.11307 7.33497L8.24686 7.34865C8.54984 7.41069 8.77811 7.67869 8.77811 8.00001C8.77811 8.32134 8.54984 8.58933 8.24686 8.65138L8.11307 8.66505H5.85331C5.48604 8.66505 5.18827 8.36728 5.18827 8.00001C5.18827 7.63274 5.48604 7.33497 5.85331 7.33497H8.11307Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.98319 10.1314L7.11698 10.145C7.42003 10.207 7.64823 10.475 7.64823 10.7964C7.64823 11.1178 7.42003 11.3858 7.11698 11.4478L6.98319 11.4614H5.85331C5.48604 11.4614 5.18827 11.1637 5.18827 10.7964C5.18827 10.4291 5.48604 10.1314 5.85331 10.1314H6.98319Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M13.8743 12.6147C13.8742 12.5394 13.7749 12.2553 13.3909 11.9477C13.039 11.6659 12.5573 11.4614 12.0394 11.4614C11.5213 11.4614 11.0398 11.6666 10.6878 11.9487C10.3037 12.2565 10.2045 12.5399 10.2044 12.6147C10.2044 12.6893 10.3034 12.9737 10.6878 13.2817C11.0398 13.5636 11.5215 13.768 12.0394 13.768C12.5574 13.768 13.039 13.5635 13.3909 13.2817C13.7751 12.9739 13.8743 12.6897 13.8743 12.6147ZM15.2044 12.6147C15.2044 13.2772 14.7436 13.9027 14.223 14.3198C13.6701 14.7627 12.9019 15.0981 12.0394 15.0981C11.1768 15.0981 10.4085 14.7627 9.85577 14.3198C9.33533 13.9027 8.87433 13.2769 8.87433 12.6147C8.8744 11.9526 9.33541 11.3276 9.85577 10.9106C10.4086 10.4676 11.1767 10.1313 12.0394 10.1313C12.9018 10.1313 13.6701 10.4668 14.223 10.9096C14.7435 11.3267 15.2043 11.9523 15.2044 12.6147Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M12.0394 13.299C12.4172 13.299 12.7234 12.9927 12.7234 12.6149C12.7234 12.2371 12.4172 11.9308 12.0394 11.9308C11.6616 11.9308 11.3553 12.2371 11.3553 12.6149C11.3553 12.9927 11.6616 13.299 12.0394 13.299Z" } }] }, ve = R(function(t, e) {
381
- return j(Z, Object.assign({}, t, {
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: e,
384
- icon: mt
535
+ ref: t,
536
+ icon: vt
385
537
  }));
386
538
  });
387
- ve.displayName = "HideNoteIcon";
388
- const $ = {
539
+ _e.displayName = "HideNoteIcon";
540
+ const O = {
389
541
  id: "sheet.operation.add-note-popup",
390
- type: we.OPERATION,
391
- handler: async (t, e) => {
392
- const i = t.get(W), r = t.get(P), s = t.get(D).getCurrentUnitForType(M.UNIVER_SHEET);
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 o = s.getActiveSheet(), a = i.getCurrentLastSelection();
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: o.getSheetId(),
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
- }, St = (t) => {
409
- var I;
410
- const { popup: e } = t, i = y(w), r = y(be), n = y(F), s = Ge(pe), o = (I = e.extraProps) == null ? void 0 : I.location;
411
- if (!o)
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 = le(null), u = n.getRenderById(o.unitId), [c, p] = rt(null);
414
- nt(() => {
415
- var q, J;
416
- const { unitId: _, subUnitId: m, row: b, col: Ce } = o, { width: ge = 160, height: me = 72 } = (q = s == null ? void 0 : s.defaultNoteSize) != null ? q : {}, k = (J = i.getNote(_, m, b, Ce)) != null ? J : { width: ge, height: me, note: "" };
417
- a.current && (p(k), a.current.style.width = `${k.width}px`, a.current.style.height = `${k.height}px`);
418
- }, [o, a]);
419
- const l = y(ne), f = Ke((_) => {
420
- o && (_.note ? l.executeCommand(Ue.id, {
421
- unitId: o.unitId,
422
- sheetId: o.subUnitId,
423
- row: o.row,
424
- col: o.col,
425
- note: _
426
- }) : l.executeCommand(z.id, {
427
- unitId: o.unitId,
428
- sheetId: o.subUnitId,
429
- row: o.row,
430
- col: o.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
- }), v = ee((_) => {
584
+ }), _ = X((C) => {
433
585
  if (!c) return;
434
- const m = { ...c, note: _ };
435
- p(m), f(m);
436
- }, [c]), C = ee((_, m) => {
586
+ const g = { ...c, note: C };
587
+ l(g), d(g);
588
+ }, [c]), f = X((C, g) => {
437
589
  if (!c) return;
438
- const b = { ...c, width: _, height: m };
439
- p(b), f(b);
590
+ const w = { ...c, width: C, height: g };
591
+ l(w), d(w);
440
592
  }, [c]);
441
- return /* @__PURE__ */ et(
442
- tt,
593
+ return /* @__PURE__ */ tt(
594
+ it,
443
595
  {
444
596
  ref: a,
445
597
  "data-u-comp": "note-textarea",
446
- className: it("univer-ml-px univer-min-h-1 univer-min-w-1 univer-bg-white !univer-text-sm univer-shadow dark:!univer-bg-gray-800"),
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: C,
450
- onValueChange: v,
451
- onWheel: (_) => {
452
- document.activeElement !== a.current && u.engine.getCanvasElement().dispatchEvent(new WheelEvent(_.type, _.nativeEvent));
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 Y(t) {
458
- const e = t.get(W), i = t.get(D);
459
- return e.selectionMoveEnd$.pipe(V(() => {
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 n = Le(i);
463
- if (!n) return !1;
464
- const { actualColumn: s, actualRow: o } = r.primary;
465
- return !!t.get(w).getNote(n.unitId, n.subUnitId, o, s);
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 Pt(t) {
620
+ function mt(i) {
469
621
  return {
470
- id: $.id,
471
- type: G.BUTTON,
622
+ id: O.id,
623
+ type: W.BUTTON,
472
624
  title: "rightClick.addNote",
473
625
  icon: "AddNoteIcon",
474
- hidden$: ke([Ye(t, M.UNIVER_SHEET), Y(t)]).pipe(V(([e, i]) => e || i)),
475
- disabled$: ue(t, { workbookTypes: [se], worksheetTypes: [oe] }),
476
- commandId: $.id
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 It(t) {
631
+ function St(i) {
480
632
  return {
481
- id: z.id,
482
- type: G.BUTTON,
633
+ id: F.id,
634
+ type: W.BUTTON,
483
635
  title: "rightClick.deleteNote",
484
636
  icon: "DeleteNoteIcon",
485
- hidden$: Y(t).pipe(V((e) => !e)),
486
- disabled$: ue(t, { workbookTypes: [se], worksheetTypes: [oe] })
637
+ hidden$: K(i).pipe(U((e) => !e)),
638
+ disabled$: ce(i, { workbookTypes: [ne], worksheetTypes: [oe] })
487
639
  };
488
640
  }
489
- function Nt(t) {
641
+ function Pt(i) {
490
642
  return {
491
- id: ae.id,
492
- type: G.BUTTON,
643
+ id: se.id,
644
+ type: W.BUTTON,
493
645
  title: "rightClick.toggleNote",
494
646
  icon: "HideNoteIcon",
495
- hidden$: Y(t).pipe(V((e) => !e))
647
+ hidden$: K(i).pipe(U((e) => !e))
496
648
  };
497
649
  }
498
- const Mt = {
499
- [qe.MAIN_AREA]: {
500
- [Je.OTHERS]: {
650
+ const Nt = {
651
+ [Ye.MAIN_AREA]: {
652
+ [qe.OTHERS]: {
501
653
  order: 0,
502
- [$.id]: {
654
+ [O.id]: {
503
655
  order: 0,
504
- menuItemFactory: Pt
656
+ menuItemFactory: mt
505
657
  },
506
- [z.id]: {
658
+ [F.id]: {
507
659
  order: 0,
508
- menuItemFactory: It
660
+ menuItemFactory: St
509
661
  },
510
- [ae.id]: {
662
+ [se.id]: {
511
663
  order: 0,
512
- menuItemFactory: Nt
664
+ menuItemFactory: Pt
513
665
  }
514
666
  }
515
667
  }
516
668
  };
517
- var wt = Object.getOwnPropertyDescriptor, bt = (t, e, i, r) => {
518
- for (var n = r > 1 ? void 0 : r ? wt(e, i) : e, s = t.length - 1, o; s >= 0; s--)
519
- (o = t[s]) && (n = o(n) || n);
520
- return n;
521
- }, A = (t, e) => (i, r) => e(i, r, t);
522
- let L = class extends N {
523
- constructor(t, e, i) {
524
- super(), this._componentManager = t, this._menuManagerService = e, this._commandService = i, this._initComponents(), this._initMenu(), this._initCommands();
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
- [K, St],
529
- ["AddNoteIcon", de],
530
- ["DeleteNoteIcon", fe],
531
- ["HideNoteIcon", ve]
532
- ].forEach(([t, e]) => {
680
+ [G, gt],
681
+ ["AddNoteIcon", he],
682
+ ["DeleteNoteIcon", de],
683
+ ["HideNoteIcon", _e]
684
+ ].forEach(([i, e]) => {
533
685
  this.disposeWithMe(
534
- this._componentManager.register(t, e)
686
+ this._componentManager.register(i, e)
535
687
  );
536
688
  });
537
689
  }
538
690
  _initMenu() {
539
- this._menuManagerService.mergeMenu(Mt);
691
+ this._menuManagerService.mergeMenu(Nt);
540
692
  }
541
693
  _initCommands() {
542
- this._commandService.registerCommand($);
694
+ this._commandService.registerCommand(O);
543
695
  }
544
696
  };
545
- L = bt([
546
- A(0, h(Qe)),
547
- A(1, h(Xe)),
548
- A(2, ne)
549
- ], L);
550
- var yt = Object.defineProperty, Et = Object.getOwnPropertyDescriptor, Ot = (t, e, i) => e in t ? yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, xt = (t, e, i, r) => {
551
- for (var n = r > 1 ? void 0 : r ? Et(e, i) : e, s = t.length - 1, o; s >= 0; s--)
552
- (o = t[s]) && (n = o(n) || n);
553
- return n;
554
- }, re = (t, e) => (i, r) => e(i, r, t), _e = (t, e, i) => Ot(t, typeof e != "symbol" ? e + "" : e, i);
555
- const Ht = "SHEET_NOTE_UI_PLUGIN";
556
- let U = class extends xe {
557
- constructor(t = ie, e, i) {
558
- super(), this._config = t, this._injector = e, this._configService = i;
559
- const { menu: r, ...n } = He(
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
- ie,
713
+ te,
562
714
  this._config
563
715
  );
564
- r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(pe, n);
716
+ r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(pe, o);
565
717
  }
566
718
  onStarting() {
567
719
  [
568
- [P],
720
+ [S],
721
+ [$],
569
722
  [x],
570
- [H],
571
- [L],
572
- [T]
573
- ].forEach((t) => {
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
- X(this._injector, [
579
- [L],
580
- [x]
730
+ Q(this._injector, [
731
+ [T],
732
+ [$]
581
733
  ]);
582
734
  }
583
735
  onRendered() {
584
- X(this._injector, [
585
- [H],
586
- [T]
736
+ Q(this._injector, [
737
+ [x],
738
+ [H]
587
739
  ]);
588
740
  }
589
741
  };
590
- _e(U, "pluginName", Ht);
591
- _e(U, "type", M.UNIVER_SHEET);
592
- U = xt([
593
- ye(De),
594
- re(1, h(Ee)),
595
- re(2, Oe)
596
- ], U);
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
- x as SheetsCellContentController,
599
- St as SheetsNote,
600
- H as SheetsNotePopupController,
601
- P as SheetsNotePopupService,
602
- U as UniverSheetsNoteUIPlugin
750
+ $ as SheetsCellContentController,
751
+ gt as SheetsNote,
752
+ x as SheetsNotePopupController,
753
+ S as SheetsNotePopupService,
754
+ L as UniverSheetsNoteUIPlugin
603
755
  };