@univerjs/sheets-note 0.7.0-nightly.202505121607 → 0.7.0-nightly.202505131607

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,48 +1,49 @@
1
- var j = Object.defineProperty;
2
- var A = (i, r, e) => r in i ? j(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e;
3
- var d = (i, r, e) => A(i, typeof r != "symbol" ? r + "" : r, e);
4
- import { Disposable as S, ObjectMatrix as W, CommandType as l, Inject as _, ICommandService as g, sequenceExecuteAsync as L, IResourceManagerService as J, IUniverInstanceService as x, UniverInstanceType as U, DependentOn as H, IConfigService as z, Injector as G, Plugin as q, touchDependencies as y } from "@univerjs/core";
5
- import { RefRangeService as F, SheetsSelectionsService as R, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests as B, getSheetCommandTarget as D, UniverSheetsPlugin as K } from "@univerjs/sheets";
6
- import { Subject as Q, filter as O, map as $ } from "rxjs";
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, Inject as g, ICommandService as p, sequenceExecuteAsync as J, IResourceManagerService as G, IUniverInstanceService as x, UniverInstanceType as U, DependentOn as H, IConfigService as z, Injector as F, Plugin as q, merge as K, touchDependencies as O } from "@univerjs/core";
5
+ import { RefRangeService as Y, SheetsSelectionsService as I, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests as B, getSheetCommandTarget as D, UniverSheetsPlugin as Q } from "@univerjs/sheets";
6
+ import { Subject as X, filter as y, map as $ } from "rxjs";
7
+ const T = "SHEET_NOTE_PLUGIN", Z = "sheets-note.config", b = {};
7
8
  class u extends S {
8
9
  constructor() {
9
10
  super(...arguments);
10
11
  d(this, "_noteMatrix", /* @__PURE__ */ new Map());
11
- d(this, "_change$", new Q());
12
+ d(this, "_change$", new X());
12
13
  d(this, "change$", this._change$.asObservable());
13
14
  }
14
15
  _ensureNoteMatrix(e, n) {
15
16
  let t = this._noteMatrix.get(e);
16
17
  t || (t = /* @__PURE__ */ new Map(), this._noteMatrix.set(e, t));
17
18
  let s = t.get(n);
18
- return s || (s = new W(), t.set(n, s)), s;
19
+ return s || (s = new L(), t.set(n, s)), s;
19
20
  }
20
21
  getSheetShowNotes$(e, n) {
21
22
  return this._change$.pipe(
22
- O(({ unitId: t, sheetId: s }) => t === e && s === n),
23
+ y(({ unitId: t, sheetId: s }) => t === e && s === n),
23
24
  $(() => {
24
25
  const t = this._ensureNoteMatrix(e, n), s = [];
25
- return t.forValue((o, a, c) => {
26
- c.show && s.push({ loc: { row: o, col: a, unitId: e, subUnitId: n }, note: c });
26
+ return t.forValue((r, a, c) => {
27
+ c.show && s.push({ loc: { row: r, col: a, unitId: e, subUnitId: n }, note: c });
27
28
  }), s;
28
29
  })
29
30
  );
30
31
  }
31
32
  getCellNoteChange$(e, n, t, s) {
32
33
  return this._change$.pipe(
33
- O(({ unitId: o, sheetId: a, row: c, col: h }) => o === e && a === n && c === t && h === s),
34
- $(({ note: o }) => o)
34
+ y(({ unitId: r, sheetId: a, row: c, col: h }) => r === e && a === n && c === t && h === s),
35
+ $(({ note: r }) => r)
35
36
  );
36
37
  }
37
- updateNote(e, n, t, s, o, a) {
38
+ updateNote(e, n, t, s, r, a) {
38
39
  const c = this._ensureNoteMatrix(e, n), h = c.getValue(t, s);
39
- c.setValue(t, s, o), this._change$.next({ unitId: e, sheetId: n, row: t, col: s, type: "update", note: o, oldNote: h, silent: a });
40
+ c.setValue(t, s, r), this._change$.next({ unitId: e, sheetId: n, row: t, col: s, type: "update", note: r, oldNote: h, silent: a });
40
41
  }
41
- removeNote(e, n, t, s, o) {
42
+ removeNote(e, n, t, s, r) {
42
43
  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: o });
44
+ a.realDeleteValue(t, s), this._change$.next({ unitId: e, sheetId: n, row: t, col: s, type: "update", note: null, oldNote: c, silent: r });
44
45
  }
45
- toggleNotePopup(e, n, t, s, o) {
46
+ toggleNotePopup(e, n, t, s, r) {
46
47
  const a = this._ensureNoteMatrix(e, n), c = a.getValue(t, s);
47
48
  if (c) {
48
49
  c.show = !c.show;
@@ -55,20 +56,20 @@ class u extends S {
55
56
  type: "update",
56
57
  note: h,
57
58
  oldNote: c,
58
- silent: o
59
+ silent: r
59
60
  });
60
61
  }
61
62
  }
62
- updateNotePosition(e, n, t, s, o, a, c) {
63
- const h = this._ensureNoteMatrix(e, n), p = h.getValue(t, s);
64
- p && (h.realDeleteValue(t, s), h.setValue(o, a, p), this._change$.next({
63
+ updateNotePosition(e, n, t, s, r, a, c) {
64
+ const h = this._ensureNoteMatrix(e, n), _ = h.getValue(t, s);
65
+ _ && (h.realDeleteValue(t, s), h.setValue(r, a, _), this._change$.next({
65
66
  unitId: e,
66
67
  sheetId: n,
67
68
  row: t,
68
69
  col: s,
69
70
  type: "ref",
70
- newPosition: { row: o, col: a },
71
- note: p,
71
+ newPosition: { row: r, col: a },
72
+ note: _,
72
73
  silent: c
73
74
  }));
74
75
  }
@@ -90,56 +91,56 @@ class u extends S {
90
91
  this._noteMatrix.delete(e);
91
92
  }
92
93
  }
93
- const I = {
94
+ const R = {
94
95
  id: "sheet.mutation.update-note",
95
96
  type: l.MUTATION,
96
- handler: (i, r) => {
97
- const { unitId: e, sheetId: n, row: t, col: s, note: o, silent: a } = r;
98
- return i.get(u).updateNote(e, n, t, s, o, a), !0;
97
+ handler: (i, o) => {
98
+ const { unitId: e, sheetId: n, row: t, col: s, note: r, silent: a } = o;
99
+ return i.get(u).updateNote(e, n, t, s, r, a), !0;
99
100
  }
100
101
  }, P = {
101
102
  id: "sheet.mutation.remove-note",
102
103
  type: l.MUTATION,
103
- handler: (i, r) => {
104
- const { unitId: e, sheetId: n, row: t, col: s, silent: o } = r;
105
- return i.get(u).removeNote(e, n, t, s, o), !0;
104
+ handler: (i, o) => {
105
+ const { unitId: e, sheetId: n, row: t, col: s, silent: r } = o;
106
+ return i.get(u).removeNote(e, n, t, s, r), !0;
106
107
  }
107
- }, E = {
108
+ }, V = {
108
109
  id: "sheet.mutation.toggle-note-popup",
109
110
  type: l.MUTATION,
110
- handler: (i, r) => {
111
- const { unitId: e, sheetId: n, row: t, col: s, silent: o } = r;
112
- return i.get(u).toggleNotePopup(e, n, t, s, o), !0;
111
+ handler: (i, o) => {
112
+ const { unitId: e, sheetId: n, row: t, col: s, silent: r } = o;
113
+ return i.get(u).toggleNotePopup(e, n, t, s, r), !0;
113
114
  }
114
115
  }, C = {
115
116
  id: "sheet.mutation.update-note-position",
116
117
  type: l.MUTATION,
117
- handler: (i, r) => {
118
- const { unitId: e, sheetId: n, row: t, col: s, newPosition: o, silent: a } = r;
119
- return i.get(u).updateNotePosition(e, n, t, s, o.row, o.col, a), !0;
118
+ handler: (i, o) => {
119
+ const { unitId: e, sheetId: n, row: t, col: s, newPosition: r, silent: a } = o;
120
+ return i.get(u).updateNotePosition(e, n, t, s, r.row, r.col, a), !0;
120
121
  }
121
122
  };
122
- var X = Object.getOwnPropertyDescriptor, Y = (i, r, e, n) => {
123
- for (var t = n > 1 ? void 0 : n ? X(r, e) : r, s = i.length - 1, o; s >= 0; s--)
124
- (o = i[s]) && (t = o(t) || t);
123
+ var k = Object.getOwnPropertyDescriptor, ee = (i, o, e, n) => {
124
+ for (var t = n > 1 ? void 0 : n ? k(o, e) : o, s = i.length - 1, r; s >= 0; s--)
125
+ (r = i[s]) && (t = r(t) || t);
125
126
  return t;
126
- }, m = (i, r) => (e, n) => r(e, n, i);
127
+ }, m = (i, o) => (e, n) => o(e, n, i);
127
128
  let N = class extends S {
128
- constructor(r, e, n, t) {
129
+ constructor(o, e, n, t) {
129
130
  super();
130
131
  d(this, "_disposableMap", /* @__PURE__ */ new Map());
131
132
  d(this, "_watcherMap", /* @__PURE__ */ new Map());
132
- d(this, "_handleRangeChange", (r, e, n, t, s, o, a) => o ? {
133
+ d(this, "_handleRangeChange", (o, e, n, t, s, r, a) => r ? {
133
134
  redos: [{
134
135
  id: C.id,
135
136
  params: {
136
- unitId: r,
137
+ unitId: o,
137
138
  sheetId: e,
138
139
  row: t,
139
140
  col: s,
140
141
  newPosition: {
141
- row: o.startRow,
142
- col: o.startColumn
142
+ row: r.startRow,
143
+ col: r.startColumn
143
144
  },
144
145
  silent: a
145
146
  }
@@ -147,10 +148,10 @@ let N = class extends S {
147
148
  undos: [{
148
149
  id: C.id,
149
150
  params: {
150
- unitId: r,
151
+ unitId: o,
151
152
  sheetId: e,
152
- row: o.startRow,
153
- col: o.startColumn,
153
+ row: r.startRow,
154
+ col: r.startColumn,
154
155
  newPosition: {
155
156
  row: t,
156
157
  col: s
@@ -163,16 +164,16 @@ let N = class extends S {
163
164
  redos: [{
164
165
  id: P.id,
165
166
  params: {
166
- unitId: r,
167
+ unitId: o,
167
168
  sheetId: e,
168
169
  row: t,
169
170
  col: s
170
171
  }
171
172
  }],
172
173
  undos: [{
173
- id: I.id,
174
+ id: R.id,
174
175
  params: {
175
- unitId: r,
176
+ unitId: o,
176
177
  sheetId: e,
177
178
  row: t,
178
179
  col: s,
@@ -180,72 +181,72 @@ let N = class extends S {
180
181
  }
181
182
  }]
182
183
  });
183
- this._refRangeService = r, this._sheetsNoteModel = e, this._selectionManagerService = n, this._commandService = t, this._initData(), this._initRefRange();
184
+ this._refRangeService = o, this._sheetsNoteModel = e, this._selectionManagerService = n, this._commandService = t, this._initData(), this._initRefRange();
184
185
  }
185
- _getIdWithUnitId(r, e, n, t) {
186
- return `${r}-${e}-${n}-${t}`;
186
+ _getIdWithUnitId(o, e, n, t) {
187
+ return `${o}-${e}-${n}-${t}`;
187
188
  }
188
- _register(r, e, n, t, s) {
189
- const o = {
189
+ _register(o, e, n, t, s) {
190
+ const r = {
190
191
  startColumn: s,
191
192
  endColumn: s,
192
193
  startRow: t,
193
194
  endRow: t
194
195
  };
195
196
  this._disposableMap.set(
196
- this._getIdWithUnitId(r, e, t, s),
197
- this._refRangeService.registerRefRange(o, (a) => {
198
- const c = B(o, a, { selectionManagerService: this._selectionManagerService }), h = Array.isArray(c) ? c[0] : c;
199
- return h && h.startColumn === o.startColumn && h.startRow === o.startRow ? {
197
+ this._getIdWithUnitId(o, e, t, s),
198
+ this._refRangeService.registerRefRange(r, (a) => {
199
+ const c = B(r, a, { selectionManagerService: this._selectionManagerService }), h = Array.isArray(c) ? c[0] : c;
200
+ return h && h.startColumn === r.startColumn && h.startRow === r.startRow ? {
200
201
  undos: [],
201
202
  redos: []
202
- } : this._handleRangeChange(r, e, n, t, s, h, !1);
203
- }, r, e)
203
+ } : this._handleRangeChange(o, e, n, t, s, h, !1);
204
+ }, o, e)
204
205
  );
205
206
  }
206
- _watch(r, e, n, t, s) {
207
- const o = {
207
+ _watch(o, e, n, t, s) {
208
+ const r = {
208
209
  startColumn: s,
209
210
  endColumn: s,
210
211
  startRow: t,
211
212
  endRow: t
212
213
  };
213
214
  this._watcherMap.set(
214
- this._getIdWithUnitId(r, e, t, s),
215
- this._refRangeService.watchRange(r, e, o, (a, c) => {
216
- const { redos: h } = this._handleRangeChange(r, e, n, a.startRow, a.startColumn, c, !0);
217
- L(h, this._commandService, { onlyLocal: !0 });
215
+ this._getIdWithUnitId(o, e, t, s),
216
+ this._refRangeService.watchRange(o, e, r, (a, c) => {
217
+ const { redos: h } = this._handleRangeChange(o, e, n, a.startRow, a.startColumn, c, !0);
218
+ J(h, this._commandService, { onlyLocal: !0 });
218
219
  }, !0)
219
220
  );
220
221
  }
221
- _unwatch(r, e, n, t) {
222
- var o;
223
- const s = this._getIdWithUnitId(r, e, n, t);
224
- (o = this._watcherMap.get(s)) == null || o.dispose(), this._watcherMap.delete(s);
222
+ _unwatch(o, e, n, t) {
223
+ var r;
224
+ const s = this._getIdWithUnitId(o, e, n, t);
225
+ (r = this._watcherMap.get(s)) == null || r.dispose(), this._watcherMap.delete(s);
225
226
  }
226
- _unregister(r, e, n, t) {
227
- var o;
228
- const s = this._getIdWithUnitId(r, e, n, t);
229
- (o = this._disposableMap.get(s)) == null || o.dispose(), this._disposableMap.delete(s);
227
+ _unregister(o, e, n, t) {
228
+ var r;
229
+ const s = this._getIdWithUnitId(o, e, n, t);
230
+ (r = this._disposableMap.get(s)) == null || r.dispose(), this._disposableMap.delete(s);
230
231
  }
231
232
  _initData() {
232
- const r = this._sheetsNoteModel.getNotes();
233
- for (const [e, n] of r)
233
+ const o = this._sheetsNoteModel.getNotes();
234
+ for (const [e, n] of o)
234
235
  for (const [t, s] of n)
235
- s.forValue((o, a, c) => (c && (this._register(e, t, c, o, a), this._watch(e, t, c, o, a)), !0));
236
+ s.forValue((r, a, c) => (c && (this._register(e, t, c, r, a), this._watch(e, t, c, r, a)), !0));
236
237
  }
237
238
  _initRefRange() {
238
239
  this.disposeWithMe(
239
- this._sheetsNoteModel.change$.subscribe((r) => {
240
- switch (r.type) {
240
+ this._sheetsNoteModel.change$.subscribe((o) => {
241
+ switch (o.type) {
241
242
  case "update": {
242
- const { unitId: e, sheetId: n, row: t, col: s, note: o } = r, a = this._getIdWithUnitId(e, n, t, s);
243
- o ? this._disposableMap.has(a) || (this._register(e, n, o, t, s), this._watch(e, n, o, t, s)) : (this._unregister(e, n, t, s), this._unwatch(e, n, t, s));
243
+ const { unitId: e, sheetId: n, row: t, col: s, note: r } = o, a = this._getIdWithUnitId(e, n, t, s);
244
+ 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));
244
245
  break;
245
246
  }
246
247
  case "ref": {
247
- const { unitId: e, sheetId: n, row: t, col: s, newPosition: o, note: a, silent: c } = r;
248
- this._unregister(e, n, t, s), c || (this._unwatch(e, n, t, s), this._watch(e, n, a, o.row, o.col)), this._register(e, n, a, o.row, o.col);
248
+ const { unitId: e, sheetId: n, row: t, col: s, newPosition: r, note: a, silent: c } = o;
249
+ 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);
249
250
  break;
250
251
  }
251
252
  }
@@ -253,20 +254,20 @@ let N = class extends S {
253
254
  );
254
255
  }
255
256
  };
256
- N = Y([
257
- m(0, _(F)),
258
- m(1, _(u)),
259
- m(2, _(R)),
260
- m(3, g)
257
+ N = ee([
258
+ m(0, g(Y)),
259
+ m(1, g(u)),
260
+ m(2, g(I)),
261
+ m(3, p)
261
262
  ], N);
262
- var Z = Object.getOwnPropertyDescriptor, k = (i, r, e, n) => {
263
- for (var t = n > 1 ? void 0 : n ? Z(r, e) : r, s = i.length - 1, o; s >= 0; s--)
264
- (o = i[s]) && (t = o(t) || t);
263
+ var te = Object.getOwnPropertyDescriptor, se = (i, o, e, n) => {
264
+ for (var t = n > 1 ? void 0 : n ? te(o, e) : o, s = i.length - 1, r; s >= 0; s--)
265
+ (r = i[s]) && (t = r(t) || t);
265
266
  return t;
266
- }, w = (i, r) => (e, n) => r(e, n, i);
267
- let M = class extends S {
268
- constructor(i, r, e) {
269
- super(), this._resourceManagerService = i, this._univerInstanceService = r, this._sheetsNoteModel = e, this._initSnapshot();
267
+ }, w = (i, o) => (e, n) => o(e, n, i);
268
+ let f = class extends S {
269
+ constructor(i, o, e) {
270
+ super(), this._resourceManagerService = i, this._univerInstanceService = o, this._sheetsNoteModel = e, this._initSnapshot();
270
271
  }
271
272
  _initSnapshot() {
272
273
  const i = (e) => {
@@ -274,13 +275,13 @@ let M = class extends S {
274
275
  if (!n)
275
276
  return "";
276
277
  const t = {};
277
- return n.forEach((s, o) => {
278
+ return n.forEach((s, r) => {
278
279
  const a = {};
279
- s.forValue((c, h, p) => {
280
- a[c] || (a[c] = {}), a[c][h] = p;
281
- }), Object.keys(a).length > 0 && (t[o] = a);
280
+ s.forValue((c, h, _) => {
281
+ a[c] || (a[c] = {}), a[c][h] = _;
282
+ }), Object.keys(a).length > 0 && (t[r] = a);
282
283
  }), JSON.stringify(t);
283
- }, r = (e) => {
284
+ }, o = (e) => {
284
285
  if (!e)
285
286
  return {};
286
287
  try {
@@ -291,21 +292,21 @@ let M = class extends S {
291
292
  };
292
293
  this.disposeWithMe(
293
294
  this._resourceManagerService.registerPluginResource({
294
- pluginName: V,
295
+ pluginName: T,
295
296
  businesses: [U.UNIVER_SHEET],
296
297
  toJson: (e) => i(e),
297
- parseJson: (e) => r(e),
298
+ parseJson: (e) => o(e),
298
299
  onUnLoad: (e) => {
299
300
  this._sheetsNoteModel.deleteUnitNotes(e);
300
301
  },
301
302
  onLoad: (e, n) => {
302
303
  Object.entries(n).forEach(([t, s]) => {
303
- Object.entries(s).forEach(([o, a]) => {
304
+ Object.entries(s).forEach(([r, a]) => {
304
305
  Object.entries(a).forEach(([c, h]) => {
305
306
  this._sheetsNoteModel.updateNote(
306
307
  e,
307
308
  t,
308
- Number(o),
309
+ Number(r),
309
310
  Number(c),
310
311
  h
311
312
  );
@@ -317,66 +318,66 @@ let M = class extends S {
317
318
  );
318
319
  }
319
320
  };
320
- M = k([
321
- w(0, J),
321
+ f = se([
322
+ w(0, G),
322
323
  w(1, x),
323
- w(2, _(u))
324
- ], M);
325
- const ee = {
324
+ w(2, g(u))
325
+ ], f);
326
+ const ne = {
326
327
  id: "sheet.command.delete-note",
327
328
  type: l.COMMAND,
328
- handler: (i, r) => {
329
+ handler: (i, o) => {
329
330
  const e = i.get(x), n = D(e);
330
331
  if (!n) return !1;
331
- const s = i.get(R).getCurrentLastSelection();
332
+ const s = i.get(I).getCurrentLastSelection();
332
333
  if (!(s != null && s.primary)) return !1;
333
- const { actualColumn: o, actualRow: a } = s.primary;
334
- return i.get(g).executeCommand(P.id, {
334
+ const { actualColumn: r, actualRow: a } = s.primary;
335
+ return i.get(p).executeCommand(P.id, {
335
336
  unitId: n.unitId,
336
337
  sheetId: n.subUnitId,
337
338
  row: a,
338
- col: o
339
+ col: r
339
340
  });
340
341
  }
341
- }, te = {
342
+ }, oe = {
342
343
  id: "sheet.command.toggle-note-popup",
343
344
  type: l.COMMAND,
344
- handler: (i, r) => {
345
+ handler: (i, o) => {
345
346
  const e = i.get(x), n = D(e);
346
347
  if (!n) return !1;
347
- const s = i.get(R).getCurrentLastSelection();
348
+ const s = i.get(I).getCurrentLastSelection();
348
349
  if (!(s != null && s.primary)) return !1;
349
- const { actualColumn: o, actualRow: a } = s.primary;
350
- return i.get(g).executeCommand(E.id, {
350
+ const { actualColumn: r, actualRow: a } = s.primary;
351
+ return i.get(p).executeCommand(V.id, {
351
352
  unitId: n.unitId,
352
353
  sheetId: n.subUnitId,
353
354
  row: a,
354
- col: o
355
+ col: r
355
356
  });
356
357
  }
357
- }, se = {
358
+ }, re = {
358
359
  id: "sheet.command.update-note",
359
360
  type: l.COMMAND,
360
- handler: (i, r) => i.get(g).syncExecuteCommand(I.id, r)
361
+ handler: (i, o) => i.get(p).syncExecuteCommand(R.id, o)
361
362
  };
362
- var ne = Object.getOwnPropertyDescriptor, re = (i, r, e, n) => {
363
- for (var t = n > 1 ? void 0 : n ? ne(r, e) : r, s = i.length - 1, o; s >= 0; s--)
364
- (o = i[s]) && (t = o(t) || t);
363
+ var ie = Object.getOwnPropertyDescriptor, ae = (i, o, e, n) => {
364
+ for (var t = n > 1 ? void 0 : n ? ie(o, e) : o, s = i.length - 1, r; s >= 0; s--)
365
+ (r = i[s]) && (t = r(t) || t);
365
366
  return t;
366
- }, oe = (i, r) => (e, n) => r(e, n, i);
367
- let f = class extends S {
367
+ }, ce = (i, o) => (e, n) => o(e, n, i);
368
+ let M = class extends S {
368
369
  constructor(i) {
369
370
  super(), this._commandService = i, this._initialize();
370
371
  }
371
372
  _initialize() {
372
373
  [
373
374
  C,
374
- E,
375
- I,
375
+ V,
376
+ R,
376
377
  P,
377
- ee,
378
- te,
379
- se
378
+ ne,
379
+ oe,
380
+ re
380
381
  ].forEach((i) => {
381
382
  this.disposeWithMe(
382
383
  this._commandService.registerCommand(i)
@@ -384,55 +385,60 @@ let f = class extends S {
384
385
  });
385
386
  }
386
387
  };
387
- f = re([
388
- oe(0, g)
389
- ], f);
390
- var ie = Object.defineProperty, ae = Object.getOwnPropertyDescriptor, ce = (i, r, e) => r in i ? ie(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e, he = (i, r, e, n) => {
391
- for (var t = n > 1 ? void 0 : n ? ae(r, e) : r, s = i.length - 1, o; s >= 0; s--)
392
- (o = i[s]) && (t = o(t) || t);
388
+ M = ae([
389
+ ce(0, p)
390
+ ], M);
391
+ 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) => {
392
+ for (var t = n > 1 ? void 0 : n ? ue(o, e) : o, s = i.length - 1, r; s >= 0; s--)
393
+ (r = i[s]) && (t = r(t) || t);
393
394
  return t;
394
- }, b = (i, r) => (e, n) => r(e, n, i), T = (i, r, e) => ce(i, typeof r != "symbol" ? r + "" : r, e);
395
- const V = "SHEET_NOTE_PLUGIN";
395
+ }, E = (i, o) => (e, n) => o(e, n, i), j = (i, o, e) => de(i, typeof o != "symbol" ? o + "" : o, e);
396
396
  let v = class extends q {
397
- constructor(i, r) {
398
- super(), this._configService = i, this._injector = r;
397
+ constructor(i = b, o, e) {
398
+ super(), this._config = i, this._configService = o, this._injector = e;
399
+ const { ...n } = K(
400
+ {},
401
+ b,
402
+ this._config
403
+ );
404
+ this._configService.setConfig(Z, n);
399
405
  }
400
406
  onStarting() {
401
407
  [
402
408
  [u],
403
- [f],
404
409
  [M],
410
+ [f],
405
411
  [N]
406
412
  ].forEach((i) => {
407
413
  this._injector.add(i);
408
- }), y(this._injector, [
414
+ }), O(this._injector, [
409
415
  [u],
410
- [f],
411
- [M]
416
+ [M],
417
+ [f]
412
418
  ]);
413
419
  }
414
420
  onReady() {
415
- y(this._injector, [
421
+ O(this._injector, [
416
422
  [N]
417
423
  ]);
418
424
  }
419
425
  };
420
- T(v, "pluginName", V);
421
- T(v, "type", U.UNIVER_SHEET);
422
- v = he([
423
- H(K),
424
- b(0, z),
425
- b(1, _(G))
426
+ j(v, "pluginName", T);
427
+ j(v, "type", U.UNIVER_SHEET);
428
+ v = le([
429
+ H(Q),
430
+ E(1, z),
431
+ E(2, g(F))
426
432
  ], v);
427
433
  export {
428
434
  P as RemoveNoteMutation,
429
- ee as SheetDeleteNoteCommand,
430
- te as SheetToggleNotePopupCommand,
431
- se as SheetUpdateNoteCommand,
435
+ ne as SheetDeleteNoteCommand,
436
+ oe as SheetToggleNotePopupCommand,
437
+ re as SheetUpdateNoteCommand,
432
438
  u as SheetsNoteModel,
433
- M as SheetsNoteResourceController,
434
- E as ToggleNotePopupMutation,
439
+ f as SheetsNoteResourceController,
440
+ V as ToggleNotePopupMutation,
435
441
  v as UniverSheetsNotePlugin,
436
- I as UpdateNoteMutation,
442
+ R as UpdateNoteMutation,
437
443
  C as UpdateNotePositionMutation
438
444
  };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare const PLUGIN_NAME = "SHEET_NOTE_PLUGIN";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare const SHEETS_NOTE_PLUGIN_CONFIG_KEY = "sheets-note.config";
17
+ export declare const configSymbol: unique symbol;
18
+ export interface IUniverSheetsNoteConfig {
19
+ }
20
+ export declare const defaultPluginConfig: IUniverSheetsNoteConfig;
@@ -1,11 +1,12 @@
1
+ import { IUniverSheetsNoteConfig } from './controllers/config.schema';
1
2
  import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
2
- export declare const PLUGIN_NAME = "SHEET_NOTE_PLUGIN";
3
3
  export declare class UniverSheetsNotePlugin extends Plugin {
4
+ private readonly _config;
4
5
  private readonly _configService;
5
6
  protected readonly _injector: Injector;
6
7
  static pluginName: string;
7
8
  static type: UniverInstanceType;
8
- constructor(_configService: IConfigService, _injector: Injector);
9
+ constructor(_config: IUniverSheetsNoteConfig | undefined, _configService: IConfigService, _injector: Injector);
9
10
  onStarting(): void;
10
11
  onReady(): void;
11
12
  }