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