@univerjs/sheets-thread-comment 0.16.0 → 0.16.1-insiders.20260311-074e8ca

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/facade.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var z = Object.defineProperty;
2
2
  var $ = (o, e, n) => e in o ? z(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n;
3
3
  var D = (o, e, n) => $(o, typeof e != "symbol" ? e + "" : e, n);
4
- import { Inject as B, Injector as L, ICommandService as p, IUniverInstanceService as N, UserManagerService as M, UniverInstanceType as V, RichTextValue as f, generateRandomId as E, RichTextBuilder as q, Tools as j, Range as G, toDisposable as b, CanceledError as U } from "@univerjs/core";
4
+ import { Inject as B, Injector as L, UserManagerService as M, UniverInstanceType as N, RichTextValue as p, generateRandomId as E, RichTextBuilder as V, Tools as j, ICommandService as f, IUniverInstanceService as q, Range as G, toDisposable as b, CanceledError as U } from "@univerjs/core";
5
5
  import { SheetsThreadCommentModel as v } from "@univerjs/sheets-thread-comment";
6
6
  import { FRange as A, FWorkbook as W, FWorksheet as P } from "@univerjs/sheets/facade";
7
7
  import { DeleteCommentTreeCommand as w, DeleteCommentCommand as R, getDT as x, UpdateCommentCommand as y, ResolveCommentCommand as T, AddCommentCommand as _, ThreadCommentModel as J } from "@univerjs/thread-comment";
@@ -21,7 +21,7 @@ class S {
21
21
  threadId: "",
22
22
  dT: "",
23
23
  personId: "",
24
- text: q.newEmptyData().body,
24
+ text: V.newEmptyData().body,
25
25
  attachments: [],
26
26
  unitId: "",
27
27
  subUnitId: ""
@@ -75,7 +75,7 @@ class S {
75
75
  * ```
76
76
  */
77
77
  get content() {
78
- return f.createByBody(this._comment.text);
78
+ return p.createByBody(this._comment.text);
79
79
  }
80
80
  /**
81
81
  * Get the id of the comment
@@ -140,7 +140,7 @@ class k extends S {
140
140
  * ```
141
141
  */
142
142
  setContent(e) {
143
- return e instanceof f ? this._comment.text = e.getData().body : this._comment.text = e, this;
143
+ return e instanceof p ? this._comment.text = e.getData().body : this._comment.text = e, this;
144
144
  }
145
145
  /**
146
146
  * Set the person id of the comment
@@ -340,7 +340,7 @@ let l = class {
340
340
  * ```
341
341
  */
342
342
  getRange() {
343
- const o = this._univerInstanceService.getUnit(this._thread.unitId, V.UNIVER_SHEET);
343
+ const o = this._univerInstanceService.getUnit(this._thread.unitId, N.UNIVER_SHEET);
344
344
  if (!o)
345
345
  return null;
346
346
  const e = o.getSheetBySheetId(this._thread.subUnitId);
@@ -349,7 +349,6 @@ let l = class {
349
349
  const n = this._getRef();
350
350
  return this._injector.createInstance(A, o, e, n);
351
351
  }
352
- // eslint-disable-next-line
353
352
  /**
354
353
  * @deprecated use `getRichText` as instead
355
354
  */
@@ -371,7 +370,7 @@ let l = class {
371
370
  */
372
371
  getRichText() {
373
372
  const o = this._thread.text;
374
- return f.create({ body: o, documentStyle: {}, id: "d" });
373
+ return p.create({ body: o, documentStyle: {}, id: "d" });
375
374
  }
376
375
  /**
377
376
  * Delete the comment and it's replies
@@ -397,14 +396,12 @@ let l = class {
397
396
  }
398
397
  );
399
398
  }
400
- // eslint-disable-next-line
401
399
  /**
402
400
  * @deprecated use `deleteAsync` as instead.
403
401
  */
404
402
  delete() {
405
403
  return this.deleteAsync();
406
404
  }
407
- // eslint-disable-next-line
408
405
  /**
409
406
  * @deprecated use `updateAsync` as instead
410
407
  */
@@ -438,7 +435,7 @@ let l = class {
438
435
  * ```
439
436
  */
440
437
  async updateAsync(o) {
441
- const e = o instanceof f ? o.getData().body : o, n = x();
438
+ const e = o instanceof p ? o.getData().body : o, n = x();
442
439
  return await this._commandService.executeCommand(
443
440
  y.id,
444
441
  {
@@ -453,7 +450,6 @@ let l = class {
453
450
  }
454
451
  );
455
452
  }
456
- // eslint-disable-next-line
457
453
  /**
458
454
  * @deprecated use `resolveAsync` as instead
459
455
  */
@@ -547,8 +543,8 @@ let l = class {
547
543
  };
548
544
  l = X([
549
545
  I(2, B(L)),
550
- I(3, p),
551
- I(4, N),
546
+ I(3, f),
547
+ I(4, q),
552
548
  I(5, B(v)),
553
549
  I(6, B(M))
554
550
  ], l);
@@ -572,7 +568,7 @@ class Y extends A {
572
568
  }
573
569
  addComment(e) {
574
570
  var c;
575
- const n = this._injector, t = (c = this.getComment()) == null ? void 0 : c.getCommentData(), r = n.get(p), i = n.get(M), s = this._workbook.getUnitId(), a = this._worksheet.getSheetId(), m = `${j.chatAtABC(this._range.startColumn)}${this._range.startRow + 1}`, d = i.getCurrentUser(), h = e instanceof k ? e.build() : { text: e };
571
+ const n = this._injector, t = (c = this.getComment()) == null ? void 0 : c.getCommentData(), r = n.get(f), i = n.get(M), s = this._workbook.getUnitId(), a = this._worksheet.getSheetId(), m = `${j.chatAtABC(this._range.startColumn)}${this._range.startRow + 1}`, d = i.getCurrentUser(), h = e instanceof k ? e.build() : { text: e };
576
572
  return r.executeCommand(_.id, {
577
573
  unitId: s,
578
574
  subUnitId: a,
@@ -592,7 +588,7 @@ class Y extends A {
592
588
  }
593
589
  clearComment() {
594
590
  var s;
595
- const e = this._injector, n = (s = this.getComment()) == null ? void 0 : s.getCommentData(), t = e.get(p), r = this._workbook.getUnitId(), i = this._worksheet.getSheetId();
591
+ const e = this._injector, n = (s = this.getComment()) == null ? void 0 : s.getCommentData(), t = e.get(f), r = this._workbook.getUnitId(), i = this._worksheet.getSheetId();
596
592
  return n ? t.executeCommand(w.id, {
597
593
  unitId: r,
598
594
  subUnitId: i,
@@ -700,7 +696,7 @@ class ee extends P {
700
696
  * @param callback Callback function, param contains comment info and target cell.
701
697
  */
702
698
  onCommented(e) {
703
- return this._injector.get(p).onCommandExecuted((t) => {
699
+ return this._injector.get(f).onCommandExecuted((t) => {
704
700
  if (t.id === _.id) {
705
701
  const r = t.params;
706
702
  e(r);
@@ -764,7 +760,7 @@ class ne extends O {
764
760
  }
765
761
  // eslint-disable-next-line max-lines-per-function
766
762
  _initialize(e) {
767
- const n = e.get(p);
763
+ const n = e.get(f);
768
764
  this.disposeWithMe(
769
765
  this.registerEventHandler(
770
766
  this.Event.CommentAdded,
@@ -869,7 +865,7 @@ class ne extends O {
869
865
  row: (h = (d = m.getRange()) == null ? void 0 : d.getRow()) != null ? h : 0,
870
866
  col: (u = (c = m.getRange()) == null ? void 0 : c.getColumn()) != null ? u : 0,
871
867
  comment: m,
872
- newContent: f.createByBody(a.text)
868
+ newContent: p.createByBody(a.text)
873
869
  };
874
870
  if (this.fireEvent(this.Event.BeforeCommentUpdate, g), g.cancel)
875
871
  throw new U();