@univerjs/sheets-note 0.10.12 → 0.10.13-nightly.202510290902

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,87 +1,87 @@
1
- var A = Object.defineProperty;
2
- var W = (i, o, e) => o in i ? A(i, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[o] = e;
3
- var d = (i, o, e) => W(i, typeof o != "symbol" ? o + "" : o, e);
4
- import { Disposable as S, ObjectMatrix as L, CommandType as l, IUniverInstanceService as x, ICommandService as p, IResourceManagerService as J, Inject as g, UniverInstanceType as U, sequenceExecuteAsync as G, DependentOn as H, IConfigService as z, Injector as F, Plugin as q, merge as K, touchDependencies as O } from "@univerjs/core";
5
- import { getSheetCommandTarget as D, SheetsSelectionsService as I, RefRangeService as Y, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests as B, UniverSheetsPlugin as Q } from "@univerjs/sheets";
6
- import { Subject as X, filter as y, map as $ } from "rxjs";
7
- class u extends S {
1
+ var W = Object.defineProperty;
2
+ var L = (i, r, e) => r in i ? W(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e;
3
+ var l = (i, r, e) => L(i, typeof r != "symbol" ? r + "" : r, e);
4
+ import { Disposable as x, ObjectMatrix as H, CommandType as p, IUniverInstanceService as P, ICommandService as N, IResourceManagerService as J, Inject as g, UniverInstanceType as v, sequenceExecuteAsync as G, DependentOn as z, IConfigService as F, Injector as q, Plugin as K, merge as Y, touchDependencies as O } from "@univerjs/core";
5
+ import { getSheetCommandTarget as T, SheetsSelectionsService as y, SheetInterceptorService as B, RemoveSheetCommand as Q, CopySheetCommand as X, RefRangeService as Z, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests as k, UniverSheetsPlugin as ee } from "@univerjs/sheets";
6
+ import { Subject as te, filter as U, map as E } from "rxjs";
7
+ class u extends x {
8
8
  constructor() {
9
9
  super(...arguments);
10
- d(this, "_noteMatrix", /* @__PURE__ */ new Map());
11
- d(this, "_change$", new X());
12
- d(this, "change$", this._change$.asObservable());
10
+ l(this, "_noteMatrix", /* @__PURE__ */ new Map());
11
+ l(this, "_change$", new te());
12
+ l(this, "change$", this._change$.asObservable());
13
13
  }
14
- _ensureNoteMatrix(e, n) {
14
+ _ensureNoteMatrix(e, s) {
15
15
  let t = this._noteMatrix.get(e);
16
16
  t || (t = /* @__PURE__ */ new Map(), this._noteMatrix.set(e, t));
17
- let s = t.get(n);
18
- return s || (s = new L(), t.set(n, s)), s;
17
+ let n = t.get(s);
18
+ return n || (n = new H(), t.set(s, n)), n;
19
19
  }
20
- getSheetShowNotes$(e, n) {
20
+ getSheetShowNotes$(e, s) {
21
21
  return this._change$.pipe(
22
- y(({ unitId: t, sheetId: s }) => t === e && s === n),
23
- $(() => {
24
- const t = this._ensureNoteMatrix(e, n), s = [];
25
- return t.forValue((r, a, c) => {
26
- c.show && s.push({ loc: { row: r, col: a, unitId: e, subUnitId: n }, note: c });
27
- }), s;
22
+ U(({ unitId: t, sheetId: n }) => t === e && n === s),
23
+ E(() => {
24
+ const t = this._ensureNoteMatrix(e, s), n = [];
25
+ return t.forValue((o, a, c) => {
26
+ c.show && n.push({ loc: { row: o, col: a, unitId: e, subUnitId: s }, note: c });
27
+ }), n;
28
28
  })
29
29
  );
30
30
  }
31
- getCellNoteChange$(e, n, t, s) {
31
+ getCellNoteChange$(e, s, t, n) {
32
32
  return this._change$.pipe(
33
- y(({ unitId: r, sheetId: a, row: c, col: h }) => r === e && a === n && c === t && h === s),
34
- $(({ note: r }) => r)
33
+ U(({ unitId: o, sheetId: a, row: c, col: h }) => o === e && a === s && c === t && h === n),
34
+ E(({ note: o }) => o)
35
35
  );
36
36
  }
37
- updateNote(e, n, t, s, r, a) {
38
- const c = this._ensureNoteMatrix(e, n), h = c.getValue(t, s);
39
- c.setValue(t, s, r), this._change$.next({ unitId: e, sheetId: n, row: t, col: s, type: "update", note: r, oldNote: h, silent: a });
37
+ updateNote(e, s, t, n, o, a) {
38
+ const c = this._ensureNoteMatrix(e, s), h = c.getValue(t, n);
39
+ c.setValue(t, n, o), this._change$.next({ unitId: e, sheetId: s, row: t, col: n, type: "update", note: o, oldNote: h, silent: a });
40
40
  }
41
- removeNote(e, n, t, s, r) {
42
- const a = this._ensureNoteMatrix(e, n), c = a.getValue(t, s);
43
- a.realDeleteValue(t, s), this._change$.next({ unitId: e, sheetId: n, row: t, col: s, type: "update", note: null, oldNote: c, silent: r });
41
+ removeNote(e, s, t, n, o) {
42
+ const a = this._ensureNoteMatrix(e, s), c = a.getValue(t, n);
43
+ a.realDeleteValue(t, n), this._change$.next({ unitId: e, sheetId: s, row: t, col: n, type: "update", note: null, oldNote: c, silent: o });
44
44
  }
45
- toggleNotePopup(e, n, t, s, r) {
46
- const a = this._ensureNoteMatrix(e, n), c = a.getValue(t, s);
45
+ toggleNotePopup(e, s, t, n, o) {
46
+ const a = this._ensureNoteMatrix(e, s), c = a.getValue(t, n);
47
47
  if (c) {
48
48
  c.show = !c.show;
49
49
  const h = { ...c, show: c.show };
50
- a.setValue(t, s, h), this._change$.next({
50
+ a.setValue(t, n, h), this._change$.next({
51
51
  unitId: e,
52
- sheetId: n,
52
+ sheetId: s,
53
53
  row: t,
54
- col: s,
54
+ col: n,
55
55
  type: "update",
56
56
  note: h,
57
57
  oldNote: c,
58
- silent: r
58
+ silent: o
59
59
  });
60
60
  }
61
61
  }
62
- updateNotePosition(e, n, t, s, r, a, c) {
63
- const h = this._ensureNoteMatrix(e, n), _ = h.getValue(t, s);
64
- _ && (h.realDeleteValue(t, s), h.setValue(r, a, _), this._change$.next({
62
+ updateNotePosition(e, s, t, n, o, a, c) {
63
+ const h = this._ensureNoteMatrix(e, s), d = h.getValue(t, n);
64
+ d && (h.realDeleteValue(t, n), h.setValue(o, a, d), this._change$.next({
65
65
  unitId: e,
66
- sheetId: n,
66
+ sheetId: s,
67
67
  row: t,
68
- col: s,
68
+ col: n,
69
69
  type: "ref",
70
- newPosition: { row: r, col: a },
71
- note: _,
70
+ newPosition: { row: o, col: a },
71
+ note: d,
72
72
  silent: c
73
73
  }));
74
74
  }
75
- getNote(e, n, t, s) {
76
- return this._ensureNoteMatrix(e, n).getValue(t, s);
75
+ getNote(e, s, t, n) {
76
+ return this._ensureNoteMatrix(e, s).getValue(t, n);
77
77
  }
78
78
  getUnitNotes(e) {
79
79
  return this._noteMatrix.get(e);
80
80
  }
81
- getSheetNotes(e, n) {
81
+ getSheetNotes(e, s) {
82
82
  const t = this._noteMatrix.get(e);
83
83
  if (t)
84
- return t.get(n);
84
+ return t.get(s);
85
85
  }
86
86
  getNotes() {
87
87
  return this._noteMatrix;
@@ -90,93 +90,93 @@ class u extends S {
90
90
  this._noteMatrix.delete(e);
91
91
  }
92
92
  }
93
- const R = {
93
+ const _ = {
94
94
  id: "sheet.mutation.update-note",
95
- type: l.MUTATION,
96
- handler: (i, o) => {
97
- const { unitId: e, sheetId: n, row: t, col: s, note: r, silent: a } = o;
98
- return i.get(u).updateNote(e, n, t, s, r, a), !0;
95
+ type: p.MUTATION,
96
+ handler: (i, r) => {
97
+ const { unitId: e, sheetId: s, row: t, col: n, note: o, silent: a } = r;
98
+ return i.get(u).updateNote(e, s, t, n, o, a), !0;
99
99
  }
100
- }, P = {
100
+ }, m = {
101
101
  id: "sheet.mutation.remove-note",
102
- type: l.MUTATION,
103
- handler: (i, o) => {
104
- const { unitId: e, sheetId: n, row: t, col: s, silent: r } = o;
105
- return i.get(u).removeNote(e, n, t, s, r), !0;
102
+ type: p.MUTATION,
103
+ handler: (i, r) => {
104
+ const { unitId: e, sheetId: s, row: t, col: n, silent: o } = r;
105
+ return i.get(u).removeNote(e, s, t, n, o), !0;
106
106
  }
107
- }, T = {
107
+ }, D = {
108
108
  id: "sheet.mutation.toggle-note-popup",
109
- type: l.MUTATION,
110
- handler: (i, o) => {
111
- const { unitId: e, sheetId: n, row: t, col: s, silent: r } = o;
112
- return i.get(u).toggleNotePopup(e, n, t, s, r), !0;
109
+ type: p.MUTATION,
110
+ handler: (i, r) => {
111
+ const { unitId: e, sheetId: s, row: t, col: n, silent: o } = r;
112
+ return i.get(u).toggleNotePopup(e, s, t, n, o), !0;
113
113
  }
114
- }, C = {
114
+ }, R = {
115
115
  id: "sheet.mutation.update-note-position",
116
- type: l.MUTATION,
117
- handler: (i, o) => {
118
- const { unitId: e, sheetId: n, row: t, col: s, newPosition: r, silent: a } = o;
119
- return i.get(u).updateNotePosition(e, n, t, s, r.row, r.col, a), !0;
116
+ type: p.MUTATION,
117
+ handler: (i, r) => {
118
+ const { unitId: e, sheetId: s, row: t, col: n, newPosition: o, silent: a } = r;
119
+ return i.get(u).updateNotePosition(e, s, t, n, o.row, o.col, a), !0;
120
120
  }
121
- }, Z = {
121
+ }, se = {
122
122
  id: "sheet.command.delete-note",
123
- type: l.COMMAND,
124
- handler: (i, o) => {
125
- const e = i.get(x), n = D(e);
126
- if (!n) return !1;
127
- const s = i.get(I).getCurrentLastSelection();
128
- if (!(s != null && s.primary)) return !1;
129
- const { actualColumn: r, actualRow: a } = s.primary;
130
- return i.get(p).executeCommand(P.id, {
131
- unitId: n.unitId,
132
- sheetId: n.subUnitId,
123
+ type: p.COMMAND,
124
+ handler: (i, r) => {
125
+ const e = i.get(P), s = T(e);
126
+ if (!s) return !1;
127
+ const n = i.get(y).getCurrentLastSelection();
128
+ if (!(n != null && n.primary)) return !1;
129
+ const { actualColumn: o, actualRow: a } = n.primary;
130
+ return i.get(N).executeCommand(m.id, {
131
+ unitId: s.unitId,
132
+ sheetId: s.subUnitId,
133
133
  row: a,
134
- col: r
134
+ col: o
135
135
  });
136
136
  }
137
- }, k = {
137
+ }, ne = {
138
138
  id: "sheet.command.toggle-note-popup",
139
- type: l.COMMAND,
140
- handler: (i, o) => {
141
- const e = i.get(x), n = D(e);
142
- if (!n) return !1;
143
- const s = i.get(I).getCurrentLastSelection();
144
- if (!(s != null && s.primary)) return !1;
145
- const { actualColumn: r, actualRow: a } = s.primary;
146
- return i.get(p).executeCommand(T.id, {
147
- unitId: n.unitId,
148
- sheetId: n.subUnitId,
139
+ type: p.COMMAND,
140
+ handler: (i, r) => {
141
+ const e = i.get(P), s = T(e);
142
+ if (!s) return !1;
143
+ const n = i.get(y).getCurrentLastSelection();
144
+ if (!(n != null && n.primary)) return !1;
145
+ const { actualColumn: o, actualRow: a } = n.primary;
146
+ return i.get(N).executeCommand(D.id, {
147
+ unitId: s.unitId,
148
+ sheetId: s.subUnitId,
149
149
  row: a,
150
- col: r
150
+ col: o
151
151
  });
152
152
  }
153
- }, ee = {
153
+ }, re = {
154
154
  id: "sheet.command.update-note",
155
- type: l.COMMAND,
156
- handler: (i, o) => i.get(p).syncExecuteCommand(R.id, o)
155
+ type: p.COMMAND,
156
+ handler: (i, r) => i.get(N).syncExecuteCommand(_.id, r)
157
157
  }, V = "SHEET_NOTE_PLUGIN";
158
- var te = Object.getOwnPropertyDescriptor, se = (i, o, e, n) => {
159
- for (var t = n > 1 ? void 0 : n ? te(o, e) : o, s = i.length - 1, r; s >= 0; s--)
160
- (r = i[s]) && (t = r(t) || t);
158
+ var oe = Object.getOwnPropertyDescriptor, ie = (i, r, e, s) => {
159
+ for (var t = s > 1 ? void 0 : s ? oe(r, e) : r, n = i.length - 1, o; n >= 0; n--)
160
+ (o = i[n]) && (t = o(t) || t);
161
161
  return t;
162
- }, w = (i, o) => (e, n) => o(e, n, i);
163
- let N = class extends S {
164
- constructor(i, o, e) {
165
- super(), this._resourceManagerService = i, this._univerInstanceService = o, this._sheetsNoteModel = e, this._initSnapshot();
162
+ }, f = (i, r) => (e, s) => r(e, s, i);
163
+ let M = class extends x {
164
+ constructor(i, r, e, s) {
165
+ super(), this._resourceManagerService = i, this._univerInstanceService = r, this._sheetInterceptorService = e, this._sheetsNoteModel = s, this._initSnapshot(), this._initSheetChange();
166
166
  }
167
167
  _initSnapshot() {
168
168
  const i = (e) => {
169
- const n = this._sheetsNoteModel.getUnitNotes(e);
170
- if (!n)
169
+ const s = this._sheetsNoteModel.getUnitNotes(e);
170
+ if (!s)
171
171
  return "";
172
172
  const t = {};
173
- return n.forEach((s, r) => {
173
+ return s.forEach((n, o) => {
174
174
  const a = {};
175
- s.forValue((c, h, _) => {
176
- a[c] || (a[c] = {}), a[c][h] = _;
177
- }), Object.keys(a).length > 0 && (t[r] = a);
175
+ n.forValue((c, h, d) => {
176
+ a[c] || (a[c] = {}), a[c][h] = d;
177
+ }), Object.keys(a).length > 0 && (t[o] = a);
178
178
  }), JSON.stringify(t);
179
- }, o = (e) => {
179
+ }, r = (e) => {
180
180
  if (!e)
181
181
  return {};
182
182
  try {
@@ -188,20 +188,20 @@ let N = class extends S {
188
188
  this.disposeWithMe(
189
189
  this._resourceManagerService.registerPluginResource({
190
190
  pluginName: V,
191
- businesses: [U.UNIVER_SHEET],
191
+ businesses: [v.UNIVER_SHEET],
192
192
  toJson: (e) => i(e),
193
- parseJson: (e) => o(e),
193
+ parseJson: (e) => r(e),
194
194
  onUnLoad: (e) => {
195
195
  this._sheetsNoteModel.deleteUnitNotes(e);
196
196
  },
197
- onLoad: (e, n) => {
198
- Object.entries(n).forEach(([t, s]) => {
199
- Object.entries(s).forEach(([r, a]) => {
197
+ onLoad: (e, s) => {
198
+ Object.entries(s).forEach(([t, n]) => {
199
+ Object.entries(n).forEach(([o, a]) => {
200
200
  Object.entries(a).forEach(([c, h]) => {
201
201
  this._sheetsNoteModel.updateNote(
202
202
  e,
203
203
  t,
204
- Number(r),
204
+ Number(o),
205
205
  Number(c),
206
206
  h
207
207
  );
@@ -212,140 +212,210 @@ let N = class extends S {
212
212
  })
213
213
  );
214
214
  }
215
+ // eslint-disable-next-line max-lines-per-function
216
+ _initSheetChange() {
217
+ this.disposeWithMe(
218
+ this._sheetInterceptorService.interceptCommand({
219
+ // eslint-disable-next-line max-lines-per-function
220
+ getMutations: (i) => {
221
+ var r;
222
+ if (i.id === Q.id) {
223
+ const e = i.params, s = e.unitId || this._univerInstanceService.getCurrentUnitOfType(v.UNIVER_SHEET).getUnitId(), t = e.subUnitId || ((r = this._univerInstanceService.getCurrentUnitOfType(v.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : r.getSheetId());
224
+ if (!s || !t)
225
+ return { redos: [], undos: [] };
226
+ const n = this._sheetsNoteModel.getSheetNotes(s, t);
227
+ if (!n)
228
+ return { redos: [], undos: [] };
229
+ const o = [], a = [];
230
+ return n.forValue((c, h, d) => {
231
+ o.push({
232
+ id: m.id,
233
+ params: {
234
+ unitId: s,
235
+ sheetId: t,
236
+ row: c,
237
+ col: h
238
+ }
239
+ }), a.push({
240
+ id: _.id,
241
+ params: {
242
+ unitId: s,
243
+ sheetId: t,
244
+ row: c,
245
+ col: h,
246
+ note: d
247
+ }
248
+ });
249
+ }), { redos: o, undos: a };
250
+ } else if (i.id === X.id) {
251
+ const e = i.params, { unitId: s, subUnitId: t, targetSubUnitId: n } = e;
252
+ if (!s || !t || !n)
253
+ return { redos: [], undos: [] };
254
+ const o = this._sheetsNoteModel.getSheetNotes(s, t);
255
+ if (!o)
256
+ return { redos: [], undos: [] };
257
+ const a = [], c = [];
258
+ return o.forValue((h, d, A) => {
259
+ a.push({
260
+ id: _.id,
261
+ params: {
262
+ unitId: s,
263
+ sheetId: n,
264
+ row: h,
265
+ col: d,
266
+ note: A
267
+ }
268
+ }), c.push({
269
+ id: m.id,
270
+ params: {
271
+ unitId: s,
272
+ sheetId: n,
273
+ row: h,
274
+ col: d
275
+ }
276
+ });
277
+ }), { redos: a, undos: c };
278
+ }
279
+ return { redos: [], undos: [] };
280
+ }
281
+ })
282
+ );
283
+ }
215
284
  };
216
- N = se([
217
- w(0, J),
218
- w(1, x),
219
- w(2, g(u))
220
- ], N);
221
- const ne = "sheets-note.config", b = {};
222
- var oe = Object.getOwnPropertyDescriptor, re = (i, o, e, n) => {
223
- for (var t = n > 1 ? void 0 : n ? oe(o, e) : o, s = i.length - 1, r; s >= 0; s--)
224
- (r = i[s]) && (t = r(t) || t);
285
+ M = ie([
286
+ f(0, J),
287
+ f(1, P),
288
+ f(2, g(B)),
289
+ f(3, g(u))
290
+ ], M);
291
+ const ae = "sheets-note.config", b = {};
292
+ var ce = Object.getOwnPropertyDescriptor, he = (i, r, e, s) => {
293
+ for (var t = s > 1 ? void 0 : s ? ce(r, e) : r, n = i.length - 1, o; n >= 0; n--)
294
+ (o = i[n]) && (t = o(t) || t);
225
295
  return t;
226
- }, m = (i, o) => (e, n) => o(e, n, i);
227
- let f = class extends S {
228
- constructor(o, e, n, t) {
296
+ }, S = (i, r) => (e, s) => r(e, s, i);
297
+ let I = class extends x {
298
+ constructor(r, e, s, t) {
229
299
  super();
230
- d(this, "_disposableMap", /* @__PURE__ */ new Map());
231
- d(this, "_watcherMap", /* @__PURE__ */ new Map());
232
- d(this, "_handleRangeChange", (o, e, n, t, s, r, a) => r ? {
300
+ l(this, "_disposableMap", /* @__PURE__ */ new Map());
301
+ l(this, "_watcherMap", /* @__PURE__ */ new Map());
302
+ l(this, "_handleRangeChange", (r, e, s, t, n, o, a) => o ? {
233
303
  redos: [{
234
- id: C.id,
304
+ id: R.id,
235
305
  params: {
236
- unitId: o,
306
+ unitId: r,
237
307
  sheetId: e,
238
308
  row: t,
239
- col: s,
309
+ col: n,
240
310
  newPosition: {
241
- row: r.startRow,
242
- col: r.startColumn
311
+ row: o.startRow,
312
+ col: o.startColumn
243
313
  },
244
314
  silent: a
245
315
  }
246
316
  }],
247
317
  undos: [{
248
- id: C.id,
318
+ id: R.id,
249
319
  params: {
250
- unitId: o,
320
+ unitId: r,
251
321
  sheetId: e,
252
- row: r.startRow,
253
- col: r.startColumn,
322
+ row: o.startRow,
323
+ col: o.startColumn,
254
324
  newPosition: {
255
325
  row: t,
256
- col: s
326
+ col: n
257
327
  },
258
- note: n,
328
+ note: s,
259
329
  silent: a
260
330
  }
261
331
  }]
262
332
  } : {
263
333
  redos: [{
264
- id: P.id,
334
+ id: m.id,
265
335
  params: {
266
- unitId: o,
336
+ unitId: r,
267
337
  sheetId: e,
268
338
  row: t,
269
- col: s
339
+ col: n
270
340
  }
271
341
  }],
272
342
  undos: [{
273
- id: R.id,
343
+ id: _.id,
274
344
  params: {
275
- unitId: o,
345
+ unitId: r,
276
346
  sheetId: e,
277
347
  row: t,
278
- col: s,
279
- note: n
348
+ col: n,
349
+ note: s
280
350
  }
281
351
  }]
282
352
  });
283
- this._refRangeService = o, this._sheetsNoteModel = e, this._selectionManagerService = n, this._commandService = t, this._initData(), this._initRefRange();
353
+ this._refRangeService = r, this._sheetsNoteModel = e, this._selectionManagerService = s, this._commandService = t, this._initData(), this._initRefRange();
284
354
  }
285
- _getIdWithUnitId(o, e, n, t) {
286
- return `${o}-${e}-${n}-${t}`;
355
+ _getIdWithUnitId(r, e, s, t) {
356
+ return `${r}-${e}-${s}-${t}`;
287
357
  }
288
- _register(o, e, n, t, s) {
289
- const r = {
290
- startColumn: s,
291
- endColumn: s,
358
+ _register(r, e, s, t, n) {
359
+ const o = {
360
+ startColumn: n,
361
+ endColumn: n,
292
362
  startRow: t,
293
363
  endRow: t
294
364
  };
295
365
  this._disposableMap.set(
296
- this._getIdWithUnitId(o, e, t, s),
297
- this._refRangeService.registerRefRange(r, (a) => {
298
- const c = B(r, a, { selectionManagerService: this._selectionManagerService }), h = Array.isArray(c) ? c[0] : c;
299
- return h && h.startColumn === r.startColumn && h.startRow === r.startRow ? {
366
+ this._getIdWithUnitId(r, e, t, n),
367
+ this._refRangeService.registerRefRange(o, (a) => {
368
+ const c = k(o, a, { selectionManagerService: this._selectionManagerService }), h = Array.isArray(c) ? c[0] : c;
369
+ return h && h.startColumn === o.startColumn && h.startRow === o.startRow ? {
300
370
  undos: [],
301
371
  redos: []
302
- } : this._handleRangeChange(o, e, n, t, s, h, !1);
303
- }, o, e)
372
+ } : this._handleRangeChange(r, e, s, t, n, h, !1);
373
+ }, r, e)
304
374
  );
305
375
  }
306
- _watch(o, e, n, t, s) {
307
- const r = {
308
- startColumn: s,
309
- endColumn: s,
376
+ _watch(r, e, s, t, n) {
377
+ const o = {
378
+ startColumn: n,
379
+ endColumn: n,
310
380
  startRow: t,
311
381
  endRow: t
312
382
  };
313
383
  this._watcherMap.set(
314
- this._getIdWithUnitId(o, e, t, s),
315
- this._refRangeService.watchRange(o, e, r, (a, c) => {
316
- const { redos: h } = this._handleRangeChange(o, e, n, a.startRow, a.startColumn, c, !0);
384
+ this._getIdWithUnitId(r, e, t, n),
385
+ this._refRangeService.watchRange(r, e, o, (a, c) => {
386
+ const { redos: h } = this._handleRangeChange(r, e, s, a.startRow, a.startColumn, c, !0);
317
387
  G(h, this._commandService, { onlyLocal: !0 });
318
388
  }, !0)
319
389
  );
320
390
  }
321
- _unwatch(o, e, n, t) {
322
- var r;
323
- const s = this._getIdWithUnitId(o, e, n, t);
324
- (r = this._watcherMap.get(s)) == null || r.dispose(), this._watcherMap.delete(s);
391
+ _unwatch(r, e, s, t) {
392
+ var o;
393
+ const n = this._getIdWithUnitId(r, e, s, t);
394
+ (o = this._watcherMap.get(n)) == null || o.dispose(), this._watcherMap.delete(n);
325
395
  }
326
- _unregister(o, e, n, t) {
327
- var r;
328
- const s = this._getIdWithUnitId(o, e, n, t);
329
- (r = this._disposableMap.get(s)) == null || r.dispose(), this._disposableMap.delete(s);
396
+ _unregister(r, e, s, t) {
397
+ var o;
398
+ const n = this._getIdWithUnitId(r, e, s, t);
399
+ (o = this._disposableMap.get(n)) == null || o.dispose(), this._disposableMap.delete(n);
330
400
  }
331
401
  _initData() {
332
- const o = this._sheetsNoteModel.getNotes();
333
- for (const [e, n] of o)
334
- for (const [t, s] of n)
335
- s.forValue((r, a, c) => (c && (this._register(e, t, c, r, a), this._watch(e, t, c, r, a)), !0));
402
+ const r = this._sheetsNoteModel.getNotes();
403
+ for (const [e, s] of r)
404
+ for (const [t, n] of s)
405
+ n.forValue((o, a, c) => (c && (this._register(e, t, c, o, a), this._watch(e, t, c, o, a)), !0));
336
406
  }
337
407
  _initRefRange() {
338
408
  this.disposeWithMe(
339
- this._sheetsNoteModel.change$.subscribe((o) => {
340
- switch (o.type) {
409
+ this._sheetsNoteModel.change$.subscribe((r) => {
410
+ switch (r.type) {
341
411
  case "update": {
342
- const { unitId: e, sheetId: n, row: t, col: s, note: r } = o, a = this._getIdWithUnitId(e, n, t, s);
343
- r ? this._disposableMap.has(a) || (this._register(e, n, r, t, s), this._watch(e, n, r, t, s)) : (this._unregister(e, n, t, s), this._unwatch(e, n, t, s));
412
+ const { unitId: e, sheetId: s, row: t, col: n, note: o } = r, a = this._getIdWithUnitId(e, s, t, n);
413
+ o ? this._disposableMap.has(a) || (this._register(e, s, o, t, n), this._watch(e, s, o, t, n)) : (this._unregister(e, s, t, n), this._unwatch(e, s, t, n));
344
414
  break;
345
415
  }
346
416
  case "ref": {
347
- const { unitId: e, sheetId: n, row: t, col: s, newPosition: r, note: a, silent: c } = o;
348
- this._unregister(e, n, t, s), c || (this._unwatch(e, n, t, s), this._watch(e, n, a, r.row, r.col)), this._register(e, n, a, r.row, r.col);
417
+ const { unitId: e, sheetId: s, row: t, col: n, newPosition: o, note: a, silent: c } = r;
418
+ this._unregister(e, s, t, n), c || (this._unwatch(e, s, t, n), this._watch(e, s, a, o.row, o.col)), this._register(e, s, a, o.row, o.col);
349
419
  break;
350
420
  }
351
421
  }
@@ -353,30 +423,30 @@ let f = class extends S {
353
423
  );
354
424
  }
355
425
  };
356
- f = re([
357
- m(0, g(Y)),
358
- m(1, g(u)),
359
- m(2, g(I)),
360
- m(3, p)
361
- ], f);
362
- var ie = Object.getOwnPropertyDescriptor, ae = (i, o, e, n) => {
363
- for (var t = n > 1 ? void 0 : n ? ie(o, e) : o, s = i.length - 1, r; s >= 0; s--)
364
- (r = i[s]) && (t = r(t) || t);
426
+ I = he([
427
+ S(0, g(Z)),
428
+ S(1, g(u)),
429
+ S(2, g(y)),
430
+ S(3, N)
431
+ ], I);
432
+ var de = Object.getOwnPropertyDescriptor, ue = (i, r, e, s) => {
433
+ for (var t = s > 1 ? void 0 : s ? de(r, e) : r, n = i.length - 1, o; n >= 0; n--)
434
+ (o = i[n]) && (t = o(t) || t);
365
435
  return t;
366
- }, ce = (i, o) => (e, n) => o(e, n, i);
367
- let M = class extends S {
436
+ }, le = (i, r) => (e, s) => r(e, s, i);
437
+ let C = class extends x {
368
438
  constructor(i) {
369
439
  super(), this._commandService = i, this._initialize();
370
440
  }
371
441
  _initialize() {
372
442
  [
373
- C,
374
- T,
375
443
  R,
376
- P,
377
- Z,
378
- k,
379
- ee
444
+ D,
445
+ _,
446
+ m,
447
+ se,
448
+ ne,
449
+ re
380
450
  ].forEach((i) => {
381
451
  this.disposeWithMe(
382
452
  this._commandService.registerCommand(i)
@@ -384,60 +454,60 @@ let M = class extends S {
384
454
  });
385
455
  }
386
456
  };
387
- M = ae([
388
- ce(0, p)
389
- ], M);
390
- var he = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, de = (i, o, e) => o in i ? he(i, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[o] = e, le = (i, o, e, n) => {
391
- for (var t = n > 1 ? void 0 : n ? ue(o, e) : o, s = i.length - 1, r; s >= 0; s--)
392
- (r = i[s]) && (t = r(t) || t);
457
+ C = ue([
458
+ le(0, N)
459
+ ], C);
460
+ var pe = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, _e = (i, r, e) => r in i ? pe(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e, me = (i, r, e, s) => {
461
+ for (var t = s > 1 ? void 0 : s ? ge(r, e) : r, n = i.length - 1, o; n >= 0; n--)
462
+ (o = i[n]) && (t = o(t) || t);
393
463
  return t;
394
- }, E = (i, o) => (e, n) => o(e, n, i), j = (i, o, e) => de(i, typeof o != "symbol" ? o + "" : o, e);
395
- let v = class extends q {
396
- constructor(i = b, o, e) {
397
- super(), this._config = i, this._configService = o, this._injector = e;
398
- const { ...n } = K(
464
+ }, $ = (i, r) => (e, s) => r(e, s, i), j = (i, r, e) => _e(i, typeof r != "symbol" ? r + "" : r, e);
465
+ let w = class extends K {
466
+ constructor(i = b, r, e) {
467
+ super(), this._config = i, this._configService = r, this._injector = e;
468
+ const { ...s } = Y(
399
469
  {},
400
470
  b,
401
471
  this._config
402
472
  );
403
- this._configService.setConfig(ne, n);
473
+ this._configService.setConfig(ae, s);
404
474
  }
405
475
  onStarting() {
406
476
  [
407
477
  [u],
478
+ [C],
408
479
  [M],
409
- [N],
410
- [f]
480
+ [I]
411
481
  ].forEach((i) => {
412
482
  this._injector.add(i);
413
483
  }), O(this._injector, [
414
484
  [u],
415
- [M],
416
- [N]
485
+ [C],
486
+ [M]
417
487
  ]);
418
488
  }
419
489
  onReady() {
420
490
  O(this._injector, [
421
- [f]
491
+ [I]
422
492
  ]);
423
493
  }
424
494
  };
425
- j(v, "pluginName", V);
426
- j(v, "type", U.UNIVER_SHEET);
427
- v = le([
428
- H(Q),
429
- E(1, z),
430
- E(2, g(F))
431
- ], v);
495
+ j(w, "pluginName", V);
496
+ j(w, "type", v.UNIVER_SHEET);
497
+ w = me([
498
+ z(ee),
499
+ $(1, F),
500
+ $(2, g(q))
501
+ ], w);
432
502
  export {
433
- P as RemoveNoteMutation,
434
- Z as SheetDeleteNoteCommand,
435
- k as SheetToggleNotePopupCommand,
436
- ee as SheetUpdateNoteCommand,
503
+ m as RemoveNoteMutation,
504
+ se as SheetDeleteNoteCommand,
505
+ ne as SheetToggleNotePopupCommand,
506
+ re as SheetUpdateNoteCommand,
437
507
  u as SheetsNoteModel,
438
- N as SheetsNoteResourceController,
439
- T as ToggleNotePopupMutation,
440
- v as UniverSheetsNotePlugin,
441
- R as UpdateNoteMutation,
442
- C as UpdateNotePositionMutation
508
+ M as SheetsNoteResourceController,
509
+ D as ToggleNotePopupMutation,
510
+ w as UniverSheetsNotePlugin,
511
+ _ as UpdateNoteMutation,
512
+ R as UpdateNotePositionMutation
443
513
  };