@univerjs/sheets-thread-comment 1.5.2 → 1.6.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.
Files changed (108) hide show
  1. package/README.md +1 -1
  2. package/lib/cjs/facade.js +6 -6
  3. package/lib/cjs/index.js +108 -9
  4. package/lib/cjs/locale/ar-SA.js +4 -0
  5. package/lib/cjs/locale/ca-ES.js +4 -0
  6. package/lib/cjs/locale/de-DE.js +4 -0
  7. package/lib/cjs/locale/en-US.js +19 -0
  8. package/lib/cjs/locale/es-ES.js +4 -0
  9. package/lib/cjs/locale/fa-IR.js +4 -0
  10. package/lib/cjs/locale/fr-FR.js +4 -0
  11. package/lib/cjs/locale/id-ID.js +4 -0
  12. package/lib/cjs/locale/it-IT.js +4 -0
  13. package/lib/cjs/locale/ja-JP.js +4 -0
  14. package/lib/cjs/locale/ko-KR.js +4 -0
  15. package/lib/cjs/locale/pl-PL.js +4 -0
  16. package/lib/cjs/locale/pt-BR.js +4 -0
  17. package/lib/cjs/locale/ru-RU.js +4 -0
  18. package/lib/cjs/locale/sk-SK.js +4 -0
  19. package/lib/cjs/locale/vi-VN.js +4 -0
  20. package/lib/cjs/locale/zh-CN.js +4 -0
  21. package/lib/cjs/locale/zh-HK.js +4 -0
  22. package/lib/cjs/locale/zh-TW.js +4 -0
  23. package/lib/es/facade.js +6 -6
  24. package/lib/es/index.js +111 -12
  25. package/lib/es/locale/ar-SA.js +4 -0
  26. package/lib/es/locale/ca-ES.js +4 -0
  27. package/lib/es/locale/de-DE.js +4 -0
  28. package/lib/es/locale/en-US.js +19 -0
  29. package/lib/es/locale/es-ES.js +4 -0
  30. package/lib/es/locale/fa-IR.js +4 -0
  31. package/lib/es/locale/fr-FR.js +4 -0
  32. package/lib/es/locale/id-ID.js +4 -0
  33. package/lib/es/locale/it-IT.js +4 -0
  34. package/lib/es/locale/ja-JP.js +4 -0
  35. package/lib/es/locale/ko-KR.js +4 -0
  36. package/lib/es/locale/pl-PL.js +4 -0
  37. package/lib/es/locale/pt-BR.js +4 -0
  38. package/lib/es/locale/ru-RU.js +4 -0
  39. package/lib/es/locale/sk-SK.js +4 -0
  40. package/lib/es/locale/vi-VN.js +4 -0
  41. package/lib/es/locale/zh-CN.js +4 -0
  42. package/lib/es/locale/zh-HK.js +4 -0
  43. package/lib/es/locale/zh-TW.js +4 -0
  44. package/lib/facade.js +6 -6
  45. package/lib/index.js +111 -12
  46. package/lib/locale/ar-SA.js +4 -0
  47. package/lib/locale/ca-ES.js +4 -0
  48. package/lib/locale/de-DE.js +4 -0
  49. package/lib/locale/en-US.js +19 -0
  50. package/lib/locale/es-ES.js +4 -0
  51. package/lib/locale/fa-IR.js +4 -0
  52. package/lib/locale/fr-FR.js +4 -0
  53. package/lib/locale/id-ID.js +4 -0
  54. package/lib/locale/it-IT.js +4 -0
  55. package/lib/locale/ja-JP.js +4 -0
  56. package/lib/locale/ko-KR.js +4 -0
  57. package/lib/locale/pl-PL.js +4 -0
  58. package/lib/locale/pt-BR.js +4 -0
  59. package/lib/locale/ru-RU.js +4 -0
  60. package/lib/locale/sk-SK.js +4 -0
  61. package/lib/locale/vi-VN.js +4 -0
  62. package/lib/locale/zh-CN.js +4 -0
  63. package/lib/locale/zh-HK.js +4 -0
  64. package/lib/locale/zh-TW.js +4 -0
  65. package/lib/types/controllers/sheets-thread-comment-permission.controller.d.ts +33 -0
  66. package/lib/types/locale/ar-SA.d.ts +18 -0
  67. package/lib/types/locale/ca-ES.d.ts +18 -0
  68. package/lib/types/locale/de-DE.d.ts +18 -0
  69. package/lib/types/locale/en-US.d.ts +23 -0
  70. package/lib/types/locale/es-ES.d.ts +18 -0
  71. package/lib/types/locale/fa-IR.d.ts +18 -0
  72. package/lib/types/locale/fr-FR.d.ts +18 -0
  73. package/lib/types/locale/id-ID.d.ts +18 -0
  74. package/lib/types/locale/it-IT.d.ts +18 -0
  75. package/lib/types/locale/ja-JP.d.ts +18 -0
  76. package/lib/types/locale/ko-KR.d.ts +18 -0
  77. package/lib/types/locale/pl-PL.d.ts +18 -0
  78. package/lib/types/locale/pt-BR.d.ts +18 -0
  79. package/lib/types/locale/ru-RU.d.ts +18 -0
  80. package/lib/types/locale/sk-SK.d.ts +18 -0
  81. package/lib/types/locale/types.d.ts +18 -0
  82. package/lib/types/locale/vi-VN.d.ts +18 -0
  83. package/lib/types/locale/zh-CN.d.ts +18 -0
  84. package/lib/types/locale/zh-HK.d.ts +18 -0
  85. package/lib/types/locale/zh-TW.d.ts +18 -0
  86. package/lib/types/plugin.d.ts +1 -1
  87. package/lib/types/services/sheets-thread-comment-authz.service.d.ts +31 -0
  88. package/lib/umd/index.js +1 -1
  89. package/lib/umd/locale/ar-SA.js +1 -0
  90. package/lib/umd/locale/ca-ES.js +1 -0
  91. package/lib/umd/locale/de-DE.js +1 -0
  92. package/lib/umd/locale/en-US.js +1 -0
  93. package/lib/umd/locale/es-ES.js +1 -0
  94. package/lib/umd/locale/fa-IR.js +1 -0
  95. package/lib/umd/locale/fr-FR.js +1 -0
  96. package/lib/umd/locale/id-ID.js +1 -0
  97. package/lib/umd/locale/it-IT.js +1 -0
  98. package/lib/umd/locale/ja-JP.js +1 -0
  99. package/lib/umd/locale/ko-KR.js +1 -0
  100. package/lib/umd/locale/pl-PL.js +1 -0
  101. package/lib/umd/locale/pt-BR.js +1 -0
  102. package/lib/umd/locale/ru-RU.js +1 -0
  103. package/lib/umd/locale/sk-SK.js +1 -0
  104. package/lib/umd/locale/vi-VN.js +1 -0
  105. package/lib/umd/locale/zh-CN.js +1 -0
  106. package/lib/umd/locale/zh-HK.js +1 -0
  107. package/lib/umd/locale/zh-TW.js +1 -0
  108. package/package.json +13 -8
@@ -0,0 +1,4 @@
1
+ // src/locale/fa-IR.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "شما مجوز استفاده از نظرات را ندارید." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/fr-FR.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Vous n’avez pas l’autorisation d’utiliser les commentaires." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/id-ID.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Anda tidak memiliki izin untuk menggunakan komentar." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/it-IT.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Non hai l’autorizzazione per usare i commenti." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/ja-JP.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "コメントを使用する権限がありません。" } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/ko-KR.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "댓글을 사용할 권한이 없습니다." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/pl-PL.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Nie masz uprawnień do używania komentarzy." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/pt-BR.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Você não tem permissão para usar comentários." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/ru-RU.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "У вас нет разрешения на использование комментариев." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/sk-SK.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Nemáte povolenie používať komentáre." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/vi-VN.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Bạn không có quyền sử dụng bình luận." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/zh-CN.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "你没有权限使用评论。" } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/zh-HK.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "你沒有權限使用評論。" } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/zh-TW.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "你沒有權限使用評論。" } } };
3
+
4
+ export { locale as default };
package/lib/facade.js CHANGED
@@ -7,7 +7,7 @@ import { AddCommentCommand, DeleteCommentCommand, DeleteCommentTreeCommand, Reso
7
7
  import { deserializeRangeWithSheet } from "@univerjs/engine-formula";
8
8
  import { FEventName, FUniver } from "@univerjs/core/facade";
9
9
 
10
- // \0@oxc-project+runtime@0.157.0/helpers/esm/typeof.js
10
+ // \0@oxc-project+runtime@0.158.0/helpers/esm/typeof.js
11
11
  function _typeof(o) {
12
12
  "@babel/helpers - typeof";
13
13
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -17,7 +17,7 @@ function _typeof(o) {
17
17
  }, _typeof(o);
18
18
  }
19
19
 
20
- // \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
20
+ // \0@oxc-project+runtime@0.158.0/helpers/esm/toPrimitive.js
21
21
  function toPrimitive(t, e) {
22
22
  if ("object" != _typeof(t) || !t) return t;
23
23
  var r;
@@ -29,13 +29,13 @@ function toPrimitive(t, e) {
29
29
  return ("string" === e ? String : Number)(t);
30
30
  }
31
31
 
32
- // \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
32
+ // \0@oxc-project+runtime@0.158.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
- // \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
38
+ // \0@oxc-project+runtime@0.158.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,
@@ -45,14 +45,14 @@ function _defineProperty(e, r, t) {
45
45
  }) : e[r] = t, e;
46
46
  }
47
47
 
48
- // \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
48
+ // \0@oxc-project+runtime@0.158.0/helpers/esm/decorateParam.js
49
49
  function __decorateParam(paramIndex, decorator) {
50
50
  return function(target, key) {
51
51
  decorator(target, key, paramIndex);
52
52
  };
53
53
  }
54
54
 
55
- // \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
55
+ // \0@oxc-project+runtime@0.158.0/helpers/esm/decorate.js
56
56
  function __decorate(decorators, target, key, desc) {
57
57
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
58
58
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
package/lib/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { DependentOn, Disposable, ICommandService, IConfigService, IResourceManagerService, IUniverInstanceService, Inject, Injector, ObjectMatrix, Plugin, UniverInstanceType, generateRandomId, merge, sequenceExecuteAsync, toDisposable, touchDependencies } from "@univerjs/core";
1
+ import { DependentOn, Disposable, ICommandService, IConfigService, IResourceManagerService, IUniverInstanceService, Inject, Injector, LocaleService, 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, UniverSheetsPlugin, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests } from "@univerjs/sheets";
4
- import { AddCommentMutation, DeleteCommentMutation, IThreadCommentDataSourceService, TC_PLUGIN_NAME, ThreadCommentModel, UniverThreadCommentPlugin, UpdateCommentRefMutation, createThreadCommentResourceHook, deserializeThreadCommentAnchor } from "@univerjs/thread-comment";
3
+ import { CopySheetCommand, RangeProtectionPermissionViewPoint, RefRangeService, RemoveSheetCommand, SheetInterceptorService, SheetPermissionCheckController, SheetsSelectionsService, UniverSheetsPlugin, WorkbookCommentPermission, WorkbookViewPermission, WorksheetViewPermission, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests } from "@univerjs/sheets";
4
+ import { AddCommentCommand, AddCommentMutation, DeleteCommentCommand, DeleteCommentMutation, DeleteCommentTreeCommand, IThreadCommentAuthzService, IThreadCommentDataSourceService, ResolveCommentCommand, TC_PLUGIN_NAME, ThreadCommentAnchorKind, ThreadCommentModel, UniverThreadCommentPlugin, UpdateCommentCommand, UpdateCommentRefMutation, createThreadCommentResourceHook, deserializeThreadCommentAnchor } from "@univerjs/thread-comment";
5
5
  import { Subject } from "rxjs";
6
6
 
7
- // \0@oxc-project+runtime@0.157.0/helpers/esm/typeof.js
7
+ // \0@oxc-project+runtime@0.158.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) {
@@ -14,7 +14,7 @@ function _typeof(o) {
14
14
  }, _typeof(o);
15
15
  }
16
16
 
17
- // \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
17
+ // \0@oxc-project+runtime@0.158.0/helpers/esm/toPrimitive.js
18
18
  function toPrimitive(t, e) {
19
19
  if ("object" != _typeof(t) || !t) return t;
20
20
  var r;
@@ -26,13 +26,13 @@ function toPrimitive(t, e) {
26
26
  return ("string" === e ? String : Number)(t);
27
27
  }
28
28
 
29
- // \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
29
+ // \0@oxc-project+runtime@0.158.0/helpers/esm/toPropertyKey.js
30
30
  function toPropertyKey(t) {
31
31
  var i = toPrimitive(t, "string");
32
32
  return "symbol" == _typeof(i) ? i : i + "";
33
33
  }
34
34
 
35
- // \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
35
+ // \0@oxc-project+runtime@0.158.0/helpers/esm/defineProperty.js
36
36
  function _defineProperty(e, r, t) {
37
37
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
38
38
  value: t,
@@ -42,14 +42,14 @@ function _defineProperty(e, r, t) {
42
42
  }) : e[r] = t, e;
43
43
  }
44
44
 
45
- // \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
45
+ // \0@oxc-project+runtime@0.158.0/helpers/esm/decorateParam.js
46
46
  function __decorateParam(paramIndex, decorator) {
47
47
  return function(target, key) {
48
48
  decorator(target, key, paramIndex);
49
49
  };
50
50
  }
51
51
 
52
- // \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
52
+ // \0@oxc-project+runtime@0.158.0/helpers/esm/decorate.js
53
53
  function __decorate(decorators, target, key, desc) {
54
54
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
55
55
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -581,7 +581,7 @@ SheetsThreadCommentResourceController = __decorate([
581
581
 
582
582
  // package.json
583
583
  var name = "@univerjs/sheets-thread-comment";
584
- var version = "1.5.2";
584
+ var version = "1.6.0";
585
585
 
586
586
  // src/config/config.ts
587
587
  /**
@@ -603,6 +603,98 @@ const SHEETS_THREAD_COMMENT_PLUGIN_CONFIG_KEY = "sheets-thread-comment.config";
603
603
  const configSymbol = Symbol(SHEETS_THREAD_COMMENT_PLUGIN_CONFIG_KEY);
604
604
  const defaultPluginConfig = {};
605
605
 
606
+ // src/controllers/sheets-thread-comment-permission.controller.ts
607
+ let SheetsThreadCommentPermissionController = class SheetsThreadCommentPermissionController extends Disposable {
608
+ constructor(_localeService, _commandService, _sheetPermissionCheckController, _threadCommentModel, _authzService) {
609
+ super();
610
+ this._localeService = _localeService;
611
+ this._commandService = _commandService;
612
+ this._sheetPermissionCheckController = _sheetPermissionCheckController;
613
+ this._threadCommentModel = _threadCommentModel;
614
+ this._authzService = _authzService;
615
+ this._commandExecutedListener();
616
+ }
617
+ _commandExecutedListener() {
618
+ this.disposeWithMe(this._commandService.beforeCommandExecuted((command) => {
619
+ const { id } = command;
620
+ if (!command.params) return;
621
+ if (id === AddCommentCommand.id) {
622
+ const { unitId, subUnitId, comment } = command.params;
623
+ this._checkWrite(comment.parentId ? "reply" : "add", unitId, subUnitId, comment.ref, comment.personId);
624
+ } else if (id === UpdateCommentCommand.id) {
625
+ const { unitId, subUnitId, payload } = command.params;
626
+ const comment = this._threadCommentModel.getComment(unitId, subUnitId, payload.commentId);
627
+ if (comment) this._checkWrite("update", unitId, subUnitId, comment.ref, comment.personId);
628
+ } else if (id === ResolveCommentCommand.id || id === DeleteCommentCommand.id || id === DeleteCommentTreeCommand.id) {
629
+ var _this$_threadCommentM;
630
+ const { unitId, subUnitId, commentId } = command.params;
631
+ const action = id === ResolveCommentCommand.id ? "resolve" : "delete";
632
+ const comment = action === "delete" && id === DeleteCommentTreeCommand.id ? (_this$_threadCommentM = this._threadCommentModel.getCommentWithChildren(unitId, subUnitId, commentId)) === null || _this$_threadCommentM === void 0 ? void 0 : _this$_threadCommentM.root : this._threadCommentModel.getComment(unitId, subUnitId, commentId);
633
+ if (comment) this._checkWrite(action, unitId, subUnitId, comment.ref, comment.personId);
634
+ }
635
+ }));
636
+ }
637
+ _checkWrite(action, unitId, subUnitId, ref, personId) {
638
+ if (this._authzService.canWrite(action, {
639
+ unitId,
640
+ subUnitId,
641
+ ref,
642
+ personId
643
+ })) return;
644
+ this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("sheets-thread-comment.permission.commentErr"));
645
+ }
646
+ };
647
+ SheetsThreadCommentPermissionController = __decorate([
648
+ __decorateParam(0, Inject(LocaleService)),
649
+ __decorateParam(1, ICommandService),
650
+ __decorateParam(2, Inject(SheetPermissionCheckController)),
651
+ __decorateParam(3, Inject(ThreadCommentModel)),
652
+ __decorateParam(4, Inject(IThreadCommentAuthzService))
653
+ ], SheetsThreadCommentPermissionController);
654
+
655
+ // src/services/sheets-thread-comment-authz.service.ts
656
+ let SheetsThreadCommentAuthz = class SheetsThreadCommentAuthz extends Disposable {
657
+ constructor(_permissionCheckController, _authzService) {
658
+ super();
659
+ this._permissionCheckController = _permissionCheckController;
660
+ this._authzService = _authzService;
661
+ this.disposeWithMe(this._authzService.registerAuthz(UniverInstanceType.UNIVER_SHEET, this));
662
+ }
663
+ canRead(target) {
664
+ return this._checkPermission(target, false);
665
+ }
666
+ canWrite(_action, target) {
667
+ return this._checkPermission(target, true);
668
+ }
669
+ _checkPermission(target, write) {
670
+ const { unitId, subUnitId, ref } = target;
671
+ const permissionTypes = write ? {
672
+ workbookTypes: [WorkbookCommentPermission],
673
+ worksheetTypes: [WorksheetViewPermission]
674
+ } : {
675
+ workbookTypes: [WorkbookViewPermission],
676
+ worksheetTypes: [WorksheetViewPermission]
677
+ };
678
+ if (ref) {
679
+ const anchor = deserializeThreadCommentAnchor(ref);
680
+ if ((anchor === null || anchor === void 0 ? void 0 : anchor.kind) !== ThreadCommentAnchorKind.SHEET_DRAWING) {
681
+ const { row, column } = singleReferenceToGrid(ref);
682
+ if (Number.isFinite(row) && Number.isFinite(column)) return this._permissionCheckController.permissionCheckWithRanges({
683
+ ...permissionTypes,
684
+ rangeTypes: [RangeProtectionPermissionViewPoint]
685
+ }, [{
686
+ startRow: row,
687
+ startColumn: column,
688
+ endRow: row,
689
+ endColumn: column
690
+ }], unitId, subUnitId);
691
+ }
692
+ }
693
+ return this._permissionCheckController.permissionCheckWithoutRange(permissionTypes, unitId, subUnitId);
694
+ }
695
+ };
696
+ SheetsThreadCommentAuthz = __decorate([__decorateParam(0, Inject(SheetPermissionCheckController)), __decorateParam(1, Inject(IThreadCommentAuthzService))], SheetsThreadCommentAuthz);
697
+
606
698
  // src/plugin.ts
607
699
  let UniverSheetsThreadCommentPlugin = class UniverSheetsThreadCommentPlugin extends Plugin {
608
700
  constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
@@ -618,11 +710,18 @@ let UniverSheetsThreadCommentPlugin = class UniverSheetsThreadCommentPlugin exte
618
710
  [
619
711
  [SheetsThreadCommentModel],
620
712
  [SheetsThreadCommentRefRangeController],
621
- [SheetsThreadCommentResourceController]
713
+ [SheetsThreadCommentResourceController],
714
+ [SheetsThreadCommentAuthz],
715
+ [SheetsThreadCommentPermissionController]
622
716
  ].forEach((dep) => {
623
717
  this._injector.add(dep);
624
718
  });
625
- touchDependencies(this._injector, [[SheetsThreadCommentRefRangeController], [SheetsThreadCommentResourceController]]);
719
+ touchDependencies(this._injector, [
720
+ [SheetsThreadCommentRefRangeController],
721
+ [SheetsThreadCommentResourceController],
722
+ [SheetsThreadCommentAuthz],
723
+ [SheetsThreadCommentPermissionController]
724
+ ]);
626
725
  }
627
726
  };
628
727
  _defineProperty(UniverSheetsThreadCommentPlugin, "pluginName", SHEET_THREAD_COMMENT_BASE);
@@ -0,0 +1,4 @@
1
+ // src/locale/ar-SA.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "ليس لديك إذن لاستخدام التعليقات." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/ca-ES.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "No teniu permís per utilitzar comentaris." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/de-DE.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Sie haben keine Berechtigung, Kommentare zu verwenden." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,19 @@
1
+ // src/locale/en-US.ts
2
+ /**
3
+ * Copyright 2023-present DreamNum Co., Ltd.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "You do not have permission to use comments." } } };
18
+
19
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/es-ES.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "No tiene permiso para usar comentarios." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/fa-IR.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "شما مجوز استفاده از نظرات را ندارید." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/fr-FR.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Vous n’avez pas l’autorisation d’utiliser les commentaires." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/id-ID.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Anda tidak memiliki izin untuk menggunakan komentar." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/it-IT.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Non hai l’autorizzazione per usare i commenti." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/ja-JP.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "コメントを使用する権限がありません。" } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/ko-KR.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "댓글을 사용할 권한이 없습니다." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/pl-PL.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Nie masz uprawnień do używania komentarzy." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/pt-BR.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Você não tem permissão para usar comentários." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/ru-RU.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "У вас нет разрешения на использование комментариев." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/sk-SK.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Nemáte povolenie používať komentáre." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/vi-VN.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "Bạn không có quyền sử dụng bình luận." } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/zh-CN.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "你没有权限使用评论。" } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/zh-HK.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "你沒有權限使用評論。" } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,4 @@
1
+ // src/locale/zh-TW.ts
2
+ const locale = { "sheets-thread-comment": { permission: { commentErr: "你沒有權限使用評論。" } } };
3
+
4
+ export { locale as default };
@@ -0,0 +1,33 @@
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
+ import { Disposable, ICommandService, LocaleService } from '@univerjs/core';
17
+ import { SheetPermissionCheckController } from '@univerjs/sheets';
18
+ import { IThreadCommentAuthzService, ThreadCommentModel } from '@univerjs/thread-comment';
19
+ /**
20
+ * Blocks comment writes for sheets in the base package, so headless integrations
21
+ * get the same permission denial as the UI. The UI toast is rendered by
22
+ * `@univerjs/sheets-ui`, which subscribes to the permission event.
23
+ */
24
+ export declare class SheetsThreadCommentPermissionController extends Disposable {
25
+ private readonly _localeService;
26
+ private readonly _commandService;
27
+ private readonly _sheetPermissionCheckController;
28
+ private readonly _threadCommentModel;
29
+ private readonly _authzService;
30
+ constructor(_localeService: LocaleService, _commandService: ICommandService, _sheetPermissionCheckController: SheetPermissionCheckController, _threadCommentModel: ThreadCommentModel, _authzService: IThreadCommentAuthzService);
31
+ private _commandExecutedListener;
32
+ private _checkWrite;
33
+ }
@@ -0,0 +1,18 @@
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
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
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
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
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
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,23 @@
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
+ declare const locale: {
17
+ 'sheets-thread-comment': {
18
+ permission: {
19
+ commentErr: string;
20
+ };
21
+ };
22
+ };
23
+ export default locale;
@@ -0,0 +1,18 @@
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
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
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
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
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
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;