@univerjs/sheets-thread-comment 1.0.0-alpha.7 → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/facade.js CHANGED
@@ -1,12 +1,11 @@
1
- import { CanceledError, ICommandService, IUniverInstanceService, Inject, Injector, Range, RichTextBuilder, RichTextValue, Tools, UniverInstanceType, UserManagerService, generateRandomId, toDisposable } from "@univerjs/core";
1
+ import { CanceledError, ICommandService, IUniverInstanceService, Inject, Injector, Range, RichTextBuilder, RichTextValue, Tools, UniverInstanceType, UserManagerService, generateRandomId } from "@univerjs/core";
2
2
  import { SheetsThreadCommentModel } from "@univerjs/sheets-thread-comment";
3
3
  import { FRange, FWorkbook, FWorksheet } from "@univerjs/sheets/facade";
4
4
  import { AddCommentCommand, DeleteCommentCommand, DeleteCommentTreeCommand, ResolveCommentCommand, ThreadCommentModel, UpdateCommentCommand, getDT } from "@univerjs/thread-comment";
5
5
  import { deserializeRangeWithSheet } from "@univerjs/engine-formula";
6
- import { filter } from "rxjs";
7
6
  import { FEventName, FUniver } from "@univerjs/core/facade";
8
7
 
9
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
8
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
10
9
  function _typeof(o) {
11
10
  "@babel/helpers - typeof";
12
11
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -17,7 +16,7 @@ function _typeof(o) {
17
16
  }
18
17
 
19
18
  //#endregion
20
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
19
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
21
20
  function toPrimitive(t, r) {
22
21
  if ("object" != _typeof(t) || !t) return t;
23
22
  var e = t[Symbol.toPrimitive];
@@ -30,14 +29,14 @@ function toPrimitive(t, r) {
30
29
  }
31
30
 
32
31
  //#endregion
33
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
32
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
34
33
  function toPropertyKey(t) {
35
34
  var i = toPrimitive(t, "string");
36
35
  return "symbol" == _typeof(i) ? i : i + "";
37
36
  }
38
37
 
39
38
  //#endregion
40
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
39
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
41
40
  function _defineProperty(e, r, t) {
42
41
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
43
42
  value: t,
@@ -48,7 +47,7 @@ function _defineProperty(e, r, t) {
48
47
  }
49
48
 
50
49
  //#endregion
51
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateParam.js
50
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
52
51
  function __decorateParam(paramIndex, decorator) {
53
52
  return function(target, key) {
54
53
  decorator(target, key, paramIndex);
@@ -56,7 +55,7 @@ function __decorateParam(paramIndex, decorator) {
56
55
  }
57
56
 
58
57
  //#endregion
59
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
58
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
60
59
  function __decorate(decorators, target, key, desc) {
61
60
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
62
61
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -430,13 +429,6 @@ let FThreadComment = _FThreadComment = class FThreadComment {
430
429
  return this._injector.createInstance(FRange, workbook, worksheet, range);
431
430
  }
432
431
  /**
433
- * @deprecated Use `getRichText` instead.
434
- * @returns {IDocumentBody} The comment content.
435
- */
436
- getContent() {
437
- return this._thread.text;
438
- }
439
- /**
440
432
  * Get the rich text of the comment
441
433
  * @returns {RichTextValue} The rich text of the comment
442
434
  * @example
@@ -481,21 +473,6 @@ let FThreadComment = _FThreadComment = class FThreadComment {
481
473
  });
482
474
  }
483
475
  /**
484
- * @deprecated Use `deleteAsync` instead.
485
- * @returns {Promise<boolean>} Whether the comment is deleted successfully.
486
- */
487
- delete() {
488
- return this.deleteAsync();
489
- }
490
- /**
491
- * @deprecated Use `updateAsync` instead.
492
- * @param {IDocumentBody} content The new content of the comment.
493
- * @returns {Promise<boolean>} Whether the comment is updated successfully.
494
- */
495
- async update(content) {
496
- return this.updateAsync(content);
497
- }
498
- /**
499
476
  * Update the comment content
500
477
  * @param {IDocumentBody | RichTextValue} content The new content of the comment
501
478
  * @returns {Promise<boolean>} Whether the comment is updated successfully
@@ -537,14 +514,6 @@ let FThreadComment = _FThreadComment = class FThreadComment {
537
514
  });
538
515
  }
539
516
  /**
540
- * @deprecated Use `resolveAsync` instead.
541
- * @param {boolean} [resolved] Whether the comment is resolved.
542
- * @returns {Promise<boolean>} Set the comment to resolved or not operation result.
543
- */
544
- resolve(resolved) {
545
- return this.resolveAsync(resolved);
546
- }
547
- /**
548
517
  * Resolve the comment
549
518
  * @param {boolean} resolved Whether the comment is resolved
550
519
  * @returns {Promise<boolean>} Set the comment to resolved or not operation result
@@ -575,7 +544,7 @@ let FThreadComment = _FThreadComment = class FThreadComment {
575
544
  unitId: this._thread.unitId,
576
545
  subUnitId: this._thread.subUnitId,
577
546
  commentId: this._thread.id,
578
- resolved: resolved !== null && resolved !== void 0 ? resolved : !this._thread.resolved
547
+ resolved: resolved ?? !this._thread.resolved
579
548
  });
580
549
  }
581
550
  /**
@@ -663,7 +632,7 @@ var FRangeSheetsThreadCommentMixin = class extends FRange {
663
632
  });
664
633
  return comments;
665
634
  }
666
- addComment(content) {
635
+ addCommentAsync(content) {
667
636
  var _this$getComment;
668
637
  const injector = this._injector;
669
638
  const currentComment = (_this$getComment = this.getComment()) === null || _this$getComment === void 0 ? void 0 : _this$getComment.getCommentData();
@@ -691,7 +660,7 @@ var FRangeSheetsThreadCommentMixin = class extends FRange {
691
660
  }
692
661
  });
693
662
  }
694
- clearComment() {
663
+ clearCommentAsync() {
695
664
  var _this$getComment2;
696
665
  const injector = this._injector;
697
666
  const currentComment = (_this$getComment2 = this.getComment()) === null || _this$getComment2 === void 0 ? void 0 : _this$getComment2.getCommentData();
@@ -706,25 +675,31 @@ var FRangeSheetsThreadCommentMixin = class extends FRange {
706
675
  });
707
676
  return Promise.resolve(true);
708
677
  }
709
- clearComments() {
678
+ clearCommentsAsync() {
710
679
  const promises = this.getComments().map((comment) => comment.deleteAsync());
711
680
  return Promise.all(promises).then(() => true);
712
681
  }
713
- addCommentAsync(content) {
714
- return this.addComment(content);
715
- }
716
- clearCommentAsync() {
717
- return this.clearComment();
718
- }
719
- clearCommentsAsync() {
720
- return this.clearComments();
721
- }
722
682
  };
723
683
  FRange.extend(FRangeSheetsThreadCommentMixin);
724
684
 
725
685
  //#endregion
726
686
  //#region src/facade/f-workbook.ts
727
687
  /**
688
+ * Copyright 2023-present DreamNum Co., Ltd.
689
+ *
690
+ * Licensed under the Apache License, Version 2.0 (the "License");
691
+ * you may not use this file except in compliance with the License.
692
+ * You may obtain a copy of the License at
693
+ *
694
+ * http://www.apache.org/licenses/LICENSE-2.0
695
+ *
696
+ * Unless required by applicable law or agreed to in writing, software
697
+ * distributed under the License is distributed on an "AS IS" BASIS,
698
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
699
+ * See the License for the specific language governing permissions and
700
+ * limitations under the License.
701
+ */
702
+ /**
728
703
  * @ignore
729
704
  */
730
705
  var FWorkbookSheetsThreadCommentMixin = class extends FWorkbook {
@@ -743,56 +718,6 @@ var FWorkbookSheetsThreadCommentMixin = class extends FWorkbook {
743
718
  const promises = this.getComments().map((comment) => comment.deleteAsync());
744
719
  return Promise.all(promises).then(() => true);
745
720
  }
746
- /**
747
- * @param callback
748
- * @returns {IDisposable} A disposable used to remove the listener.
749
- * @deprecated
750
- */
751
- onThreadCommentChange(callback) {
752
- return toDisposable(this._threadCommentModel.commentUpdate$.pipe(filter((change) => change.unitId === this._workbook.getUnitId())).subscribe(callback));
753
- }
754
- /**
755
- * @param callback
756
- * @returns {IDisposable} A disposable used to remove the listener.
757
- * @deprecated
758
- */
759
- onBeforeAddThreadComment(callback) {
760
- return toDisposable(this._commandService.beforeCommandExecuted((commandInfo, options) => {
761
- const params = commandInfo.params;
762
- if (commandInfo.id === AddCommentCommand.id) {
763
- if (params.unitId !== this._workbook.getUnitId()) return;
764
- if (callback(params, options) === false) throw new Error("Command is stopped by the hook onBeforeAddThreadComment");
765
- }
766
- }));
767
- }
768
- /**
769
- * @param callback
770
- * @returns {IDisposable} A disposable used to remove the listener.
771
- * @deprecated
772
- */
773
- onBeforeUpdateThreadComment(callback) {
774
- return toDisposable(this._commandService.beforeCommandExecuted((commandInfo, options) => {
775
- const params = commandInfo.params;
776
- if (commandInfo.id === UpdateCommentCommand.id) {
777
- if (params.unitId !== this._workbook.getUnitId()) return;
778
- if (callback(params, options) === false) throw new Error("Command is stopped by the hook onBeforeUpdateThreadComment");
779
- }
780
- }));
781
- }
782
- /**
783
- * @param callback
784
- * @returns {IDisposable} A disposable used to remove the listener.
785
- * @deprecated
786
- */
787
- onBeforeDeleteThreadComment(callback) {
788
- return toDisposable(this._commandService.beforeCommandExecuted((commandInfo, options) => {
789
- const params = commandInfo.params;
790
- if (commandInfo.id === DeleteCommentCommand.id || commandInfo.id === DeleteCommentTreeCommand.id) {
791
- if (params.unitId !== this._workbook.getUnitId()) return;
792
- if (callback(params, options) === false) throw new Error("Command is stopped by the hook onBeforeDeleteThreadComment");
793
- }
794
- }));
795
- }
796
721
  };
797
722
  FWorkbook.extend(FWorkbookSheetsThreadCommentMixin);
798
723
 
@@ -871,7 +796,7 @@ var FUniverSheetsThreadCommentMixin = class extends FUniver {
871
796
  _initialize(injector) {
872
797
  const commandService = injector.get(ICommandService);
873
798
  this.disposeWithMe(this.registerEventHandler(this.Event.CommentAdded, () => commandService.onCommandExecuted((commandInfo) => {
874
- var _threadComment$getRan, _threadComment$getRan2, _threadComment$getRan3, _threadComment$getRan4;
799
+ var _threadComment$getRan, _threadComment$getRan2;
875
800
  if (commandInfo.id !== AddCommentCommand.id) return;
876
801
  const params = commandInfo.params;
877
802
  const target = this.getSheetCommandTarget(params);
@@ -883,14 +808,14 @@ var FUniverSheetsThreadCommentMixin = class extends FUniver {
883
808
  const eventParams = {
884
809
  workbook,
885
810
  worksheet,
886
- row: (_threadComment$getRan = (_threadComment$getRan2 = threadComment.getRange()) === null || _threadComment$getRan2 === void 0 ? void 0 : _threadComment$getRan2.getRow()) !== null && _threadComment$getRan !== void 0 ? _threadComment$getRan : 0,
887
- col: (_threadComment$getRan3 = (_threadComment$getRan4 = threadComment.getRange()) === null || _threadComment$getRan4 === void 0 ? void 0 : _threadComment$getRan4.getColumn()) !== null && _threadComment$getRan3 !== void 0 ? _threadComment$getRan3 : 0,
811
+ row: ((_threadComment$getRan = threadComment.getRange()) === null || _threadComment$getRan === void 0 ? void 0 : _threadComment$getRan.getRow()) ?? 0,
812
+ col: ((_threadComment$getRan2 = threadComment.getRange()) === null || _threadComment$getRan2 === void 0 ? void 0 : _threadComment$getRan2.getColumn()) ?? 0,
888
813
  comment: threadComment
889
814
  };
890
815
  this.fireEvent(this.Event.CommentAdded, eventParams);
891
816
  })));
892
817
  this.disposeWithMe(this.registerEventHandler(this.Event.CommentUpdated, () => commandService.onCommandExecuted((commandInfo) => {
893
- var _threadComment$getRan5, _threadComment$getRan6, _threadComment$getRan7, _threadComment$getRan8;
818
+ var _threadComment$getRan3, _threadComment$getRan4;
894
819
  if (commandInfo.id !== UpdateCommentCommand.id) return;
895
820
  const params = commandInfo.params;
896
821
  const target = this.getSheetCommandTarget(params);
@@ -902,8 +827,8 @@ var FUniverSheetsThreadCommentMixin = class extends FUniver {
902
827
  const eventParams = {
903
828
  workbook,
904
829
  worksheet,
905
- row: (_threadComment$getRan5 = (_threadComment$getRan6 = threadComment.getRange()) === null || _threadComment$getRan6 === void 0 ? void 0 : _threadComment$getRan6.getRow()) !== null && _threadComment$getRan5 !== void 0 ? _threadComment$getRan5 : 0,
906
- col: (_threadComment$getRan7 = (_threadComment$getRan8 = threadComment.getRange()) === null || _threadComment$getRan8 === void 0 ? void 0 : _threadComment$getRan8.getColumn()) !== null && _threadComment$getRan7 !== void 0 ? _threadComment$getRan7 : 0,
830
+ row: ((_threadComment$getRan3 = threadComment.getRange()) === null || _threadComment$getRan3 === void 0 ? void 0 : _threadComment$getRan3.getRow()) ?? 0,
831
+ col: ((_threadComment$getRan4 = threadComment.getRange()) === null || _threadComment$getRan4 === void 0 ? void 0 : _threadComment$getRan4.getColumn()) ?? 0,
907
832
  comment: threadComment
908
833
  };
909
834
  this.fireEvent(this.Event.CommentUpdated, eventParams);
@@ -923,7 +848,7 @@ var FUniverSheetsThreadCommentMixin = class extends FUniver {
923
848
  this.fireEvent(this.Event.CommentDeleted, eventParams);
924
849
  })));
925
850
  this.disposeWithMe(this.registerEventHandler(this.Event.CommentResolved, () => commandService.onCommandExecuted((commandInfo) => {
926
- var _threadComment$getRan9, _threadComment$getRan10, _threadComment$getRan11, _threadComment$getRan12;
851
+ var _threadComment$getRan5, _threadComment$getRan6;
927
852
  if (commandInfo.id !== ResolveCommentCommand.id) return;
928
853
  const params = commandInfo.params;
929
854
  const target = this.getSheetCommandTarget(params);
@@ -935,8 +860,8 @@ var FUniverSheetsThreadCommentMixin = class extends FUniver {
935
860
  const eventParams = {
936
861
  workbook,
937
862
  worksheet,
938
- row: (_threadComment$getRan9 = (_threadComment$getRan10 = threadComment.getRange()) === null || _threadComment$getRan10 === void 0 ? void 0 : _threadComment$getRan10.getRow()) !== null && _threadComment$getRan9 !== void 0 ? _threadComment$getRan9 : 0,
939
- col: (_threadComment$getRan11 = (_threadComment$getRan12 = threadComment.getRange()) === null || _threadComment$getRan12 === void 0 ? void 0 : _threadComment$getRan12.getColumn()) !== null && _threadComment$getRan11 !== void 0 ? _threadComment$getRan11 : 0,
863
+ row: ((_threadComment$getRan5 = threadComment.getRange()) === null || _threadComment$getRan5 === void 0 ? void 0 : _threadComment$getRan5.getRow()) ?? 0,
864
+ col: ((_threadComment$getRan6 = threadComment.getRange()) === null || _threadComment$getRan6 === void 0 ? void 0 : _threadComment$getRan6.getColumn()) ?? 0,
940
865
  comment: threadComment,
941
866
  resolved
942
867
  };
@@ -961,7 +886,7 @@ var FUniverSheetsThreadCommentMixin = class extends FUniver {
961
886
  if (eventParams.cancel) throw new CanceledError();
962
887
  })));
963
888
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeCommentUpdate, () => commandService.beforeCommandExecuted((commandInfo) => {
964
- var _threadComment$getRan13, _threadComment$getRan14, _threadComment$getRan15, _threadComment$getRan16;
889
+ var _threadComment$getRan7, _threadComment$getRan8;
965
890
  if (commandInfo.id !== UpdateCommentCommand.id) return;
966
891
  const params = commandInfo.params;
967
892
  const target = this.getSheetCommandTarget(params);
@@ -973,8 +898,8 @@ var FUniverSheetsThreadCommentMixin = class extends FUniver {
973
898
  const eventParams = {
974
899
  workbook,
975
900
  worksheet,
976
- row: (_threadComment$getRan13 = (_threadComment$getRan14 = threadComment.getRange()) === null || _threadComment$getRan14 === void 0 ? void 0 : _threadComment$getRan14.getRow()) !== null && _threadComment$getRan13 !== void 0 ? _threadComment$getRan13 : 0,
977
- col: (_threadComment$getRan15 = (_threadComment$getRan16 = threadComment.getRange()) === null || _threadComment$getRan16 === void 0 ? void 0 : _threadComment$getRan16.getColumn()) !== null && _threadComment$getRan15 !== void 0 ? _threadComment$getRan15 : 0,
901
+ row: ((_threadComment$getRan7 = threadComment.getRange()) === null || _threadComment$getRan7 === void 0 ? void 0 : _threadComment$getRan7.getRow()) ?? 0,
902
+ col: ((_threadComment$getRan8 = threadComment.getRange()) === null || _threadComment$getRan8 === void 0 ? void 0 : _threadComment$getRan8.getColumn()) ?? 0,
978
903
  comment: threadComment,
979
904
  newContent: RichTextValue.createByBody(payload.text)
980
905
  };
@@ -982,7 +907,7 @@ var FUniverSheetsThreadCommentMixin = class extends FUniver {
982
907
  if (eventParams.cancel) throw new CanceledError();
983
908
  })));
984
909
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeCommentDelete, () => commandService.beforeCommandExecuted((commandInfo) => {
985
- var _threadComment$getRan17, _threadComment$getRan18, _threadComment$getRan19, _threadComment$getRan20;
910
+ var _threadComment$getRan9, _threadComment$getRan10;
986
911
  if (commandInfo.id !== DeleteCommentCommand.id && commandInfo.id !== DeleteCommentTreeCommand.id) return;
987
912
  const params = commandInfo.params;
988
913
  const target = this.getSheetCommandTarget(params);
@@ -994,15 +919,14 @@ var FUniverSheetsThreadCommentMixin = class extends FUniver {
994
919
  const eventParams = {
995
920
  workbook,
996
921
  worksheet,
997
- row: (_threadComment$getRan17 = (_threadComment$getRan18 = threadComment.getRange()) === null || _threadComment$getRan18 === void 0 ? void 0 : _threadComment$getRan18.getRow()) !== null && _threadComment$getRan17 !== void 0 ? _threadComment$getRan17 : 0,
998
- col: (_threadComment$getRan19 = (_threadComment$getRan20 = threadComment.getRange()) === null || _threadComment$getRan20 === void 0 ? void 0 : _threadComment$getRan20.getColumn()) !== null && _threadComment$getRan19 !== void 0 ? _threadComment$getRan19 : 0,
922
+ row: ((_threadComment$getRan9 = threadComment.getRange()) === null || _threadComment$getRan9 === void 0 ? void 0 : _threadComment$getRan9.getRow()) ?? 0,
923
+ col: ((_threadComment$getRan10 = threadComment.getRange()) === null || _threadComment$getRan10 === void 0 ? void 0 : _threadComment$getRan10.getColumn()) ?? 0,
999
924
  comment: threadComment
1000
925
  };
1001
926
  this.fireEvent(this.Event.BeforeCommentDelete, eventParams);
1002
927
  if (eventParams.cancel) throw new CanceledError();
1003
928
  })));
1004
929
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeCommentResolve, () => commandService.beforeCommandExecuted((commandInfo) => {
1005
- var _getRow, _getColumn;
1006
930
  if (commandInfo.id !== ResolveCommentCommand.id) return;
1007
931
  const params = commandInfo.params;
1008
932
  const target = this.getSheetCommandTarget(params);
@@ -1014,8 +938,8 @@ var FUniverSheetsThreadCommentMixin = class extends FUniver {
1014
938
  const eventParams = {
1015
939
  workbook,
1016
940
  worksheet,
1017
- row: (_getRow = threadComment.getRange().getRow()) !== null && _getRow !== void 0 ? _getRow : 0,
1018
- col: (_getColumn = threadComment.getRange().getColumn()) !== null && _getColumn !== void 0 ? _getColumn : 0,
941
+ row: threadComment.getRange().getRow() ?? 0,
942
+ col: threadComment.getRange().getColumn() ?? 0,
1019
943
  comment: threadComment,
1020
944
  resolved
1021
945
  };
package/lib/es/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { DependentOn, Disposable, ICommandService, IConfigService, IUniverInstanceService, Inject, Injector, ObjectMatrix, Plugin, UniverInstanceType, generateRandomId, merge, sequenceExecuteAsync, toDisposable, touchDependencies } from "@univerjs/core";
2
2
  import { serializeRange, singleReferenceToGrid } from "@univerjs/engine-formula";
3
- import { CopySheetCommand, RefRangeService, RemoveSheetCommand, SheetInterceptorService, SheetsSelectionsService, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests } from "@univerjs/sheets";
3
+ import { CopySheetCommand, RefRangeService, RemoveSheetCommand, SheetInterceptorService, SheetsSelectionsService, UniverSheetsPlugin, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests } from "@univerjs/sheets";
4
4
  import { AddCommentMutation, DeleteCommentMutation, IThreadCommentDataSourceService, ThreadCommentModel, UniverThreadCommentPlugin, UpdateCommentRefMutation } from "@univerjs/thread-comment";
5
5
  import { Subject } from "rxjs";
6
6
 
7
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
7
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
8
8
  function _typeof(o) {
9
9
  "@babel/helpers - typeof";
10
10
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -15,7 +15,7 @@ function _typeof(o) {
15
15
  }
16
16
 
17
17
  //#endregion
18
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
18
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
19
19
  function toPrimitive(t, r) {
20
20
  if ("object" != _typeof(t) || !t) return t;
21
21
  var e = t[Symbol.toPrimitive];
@@ -28,14 +28,14 @@ function toPrimitive(t, r) {
28
28
  }
29
29
 
30
30
  //#endregion
31
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
31
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
32
32
  function toPropertyKey(t) {
33
33
  var i = toPrimitive(t, "string");
34
34
  return "symbol" == _typeof(i) ? i : i + "";
35
35
  }
36
36
 
37
37
  //#endregion
38
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
38
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
39
39
  function _defineProperty(e, r, t) {
40
40
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
41
41
  value: t,
@@ -46,7 +46,7 @@ function _defineProperty(e, r, t) {
46
46
  }
47
47
 
48
48
  //#endregion
49
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateParam.js
49
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
50
50
  function __decorateParam(paramIndex, decorator) {
51
51
  return function(target, key) {
52
52
  decorator(target, key, paramIndex);
@@ -54,7 +54,7 @@ function __decorateParam(paramIndex, decorator) {
54
54
  }
55
55
 
56
56
  //#endregion
57
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
57
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
58
58
  function __decorate(decorators, target, key, desc) {
59
59
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
60
60
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -109,8 +109,7 @@ let SheetsThreadCommentModel = class SheetsThreadCommentModel extends Disposable
109
109
  return subUnitMap;
110
110
  }
111
111
  _addCommentToMatrix(matrix, row, column, commentId) {
112
- var _matrix$getValue;
113
- const current = (_matrix$getValue = matrix.getValue(row, column)) !== null && _matrix$getValue !== void 0 ? _matrix$getValue : /* @__PURE__ */ new Set();
112
+ const current = matrix.getValue(row, column) ?? /* @__PURE__ */ new Set();
114
113
  current.add(commentId);
115
114
  matrix.setValue(row, column, current);
116
115
  }
@@ -449,7 +448,7 @@ SheetsThreadCommentRefRangeController = __decorate([
449
448
  //#endregion
450
449
  //#region package.json
451
450
  var name = "@univerjs/sheets-thread-comment";
452
- var version = "1.0.0-alpha.7";
451
+ var version = "1.0.0-beta.0";
453
452
 
454
453
  //#endregion
455
454
  //#region src/config/config.ts
@@ -631,7 +630,7 @@ _defineProperty(UniverSheetsThreadCommentPlugin, "packageName", name);
631
630
  _defineProperty(UniverSheetsThreadCommentPlugin, "version", version);
632
631
  _defineProperty(UniverSheetsThreadCommentPlugin, "type", UniverInstanceType.UNIVER_SHEET);
633
632
  UniverSheetsThreadCommentPlugin = __decorate([
634
- DependentOn(UniverThreadCommentPlugin),
633
+ DependentOn(UniverThreadCommentPlugin, UniverSheetsPlugin),
635
634
  __decorateParam(1, Inject(Injector)),
636
635
  __decorateParam(2, Inject(ICommandService)),
637
636
  __decorateParam(3, IConfigService)