@univerjs/docs-thread-comment-ui 1.0.0-insiders.20260813-7c9aa50 → 1.0.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 (95) hide show
  1. package/LICENSE +176 -0
  2. package/README.md +22 -6
  3. package/lib/cjs/index.js +402 -132
  4. package/lib/cjs/locale/ar-SA.js +2 -2
  5. package/lib/cjs/locale/ca-ES.js +2 -2
  6. package/lib/cjs/locale/de-DE.js +2 -2
  7. package/lib/cjs/locale/en-US.js +2 -2
  8. package/lib/cjs/locale/es-ES.js +2 -2
  9. package/lib/cjs/locale/fa-IR.js +2 -2
  10. package/lib/cjs/locale/fr-FR.js +2 -2
  11. package/lib/cjs/locale/id-ID.js +2 -2
  12. package/lib/cjs/locale/it-IT.js +2 -2
  13. package/lib/cjs/locale/ja-JP.js +2 -2
  14. package/lib/cjs/locale/ko-KR.js +2 -2
  15. package/lib/cjs/locale/pl-PL.js +2 -2
  16. package/lib/cjs/locale/pt-BR.js +2 -2
  17. package/lib/cjs/locale/ru-RU.js +2 -2
  18. package/lib/cjs/locale/sk-SK.js +2 -2
  19. package/lib/cjs/locale/vi-VN.js +2 -2
  20. package/lib/cjs/locale/zh-CN.js +2 -2
  21. package/lib/cjs/locale/zh-HK.js +2 -2
  22. package/lib/cjs/locale/zh-TW.js +2 -2
  23. package/lib/es/index.js +398 -134
  24. package/lib/es/locale/ar-SA.js +2 -1
  25. package/lib/es/locale/ca-ES.js +2 -1
  26. package/lib/es/locale/de-DE.js +2 -1
  27. package/lib/es/locale/en-US.js +2 -1
  28. package/lib/es/locale/es-ES.js +2 -1
  29. package/lib/es/locale/fa-IR.js +2 -1
  30. package/lib/es/locale/fr-FR.js +2 -1
  31. package/lib/es/locale/id-ID.js +2 -1
  32. package/lib/es/locale/it-IT.js +2 -1
  33. package/lib/es/locale/ja-JP.js +2 -1
  34. package/lib/es/locale/ko-KR.js +2 -1
  35. package/lib/es/locale/pl-PL.js +2 -1
  36. package/lib/es/locale/pt-BR.js +2 -1
  37. package/lib/es/locale/ru-RU.js +2 -1
  38. package/lib/es/locale/sk-SK.js +2 -1
  39. package/lib/es/locale/vi-VN.js +2 -1
  40. package/lib/es/locale/zh-CN.js +2 -1
  41. package/lib/es/locale/zh-HK.js +2 -1
  42. package/lib/es/locale/zh-TW.js +2 -1
  43. package/lib/index.js +398 -134
  44. package/lib/locale/ar-SA.js +2 -1
  45. package/lib/locale/ca-ES.js +2 -1
  46. package/lib/locale/de-DE.js +2 -1
  47. package/lib/locale/en-US.js +2 -1
  48. package/lib/locale/es-ES.js +2 -1
  49. package/lib/locale/fa-IR.js +2 -1
  50. package/lib/locale/fr-FR.js +2 -1
  51. package/lib/locale/id-ID.js +2 -1
  52. package/lib/locale/it-IT.js +2 -1
  53. package/lib/locale/ja-JP.js +2 -1
  54. package/lib/locale/ko-KR.js +2 -1
  55. package/lib/locale/pl-PL.js +2 -1
  56. package/lib/locale/pt-BR.js +2 -1
  57. package/lib/locale/ru-RU.js +2 -1
  58. package/lib/locale/sk-SK.js +2 -1
  59. package/lib/locale/vi-VN.js +2 -1
  60. package/lib/locale/zh-CN.js +2 -1
  61. package/lib/locale/zh-HK.js +2 -1
  62. package/lib/locale/zh-TW.js +2 -1
  63. package/lib/types/commands/commands/add-doc-comment.command.d.ts +4 -7
  64. package/lib/types/commands/operations/show-comment-panel.operation.d.ts +1 -0
  65. package/lib/types/common/const.d.ts +0 -1
  66. package/lib/types/controllers/doc-thread-comment-selection.controller.d.ts +1 -0
  67. package/lib/types/controllers/doc-thread-comment-ui.controller.d.ts +26 -0
  68. package/lib/types/controllers/render-controllers/render.controller.d.ts +11 -4
  69. package/lib/types/index.d.ts +1 -0
  70. package/lib/types/locale/en-US.d.ts +1 -0
  71. package/lib/types/menu/menu.d.ts +30 -6
  72. package/lib/types/mobile-plugin.d.ts +32 -0
  73. package/lib/types/views/DocThreadCommentPanel.d.ts +4 -0
  74. package/lib/types/views/doc-thread-comment-panel/index.d.ts +16 -0
  75. package/lib/umd/index.js +3 -2
  76. package/lib/umd/locale/ar-SA.js +1 -1
  77. package/lib/umd/locale/ca-ES.js +1 -1
  78. package/lib/umd/locale/de-DE.js +1 -1
  79. package/lib/umd/locale/en-US.js +1 -1
  80. package/lib/umd/locale/es-ES.js +1 -1
  81. package/lib/umd/locale/fa-IR.js +1 -1
  82. package/lib/umd/locale/fr-FR.js +1 -1
  83. package/lib/umd/locale/id-ID.js +1 -1
  84. package/lib/umd/locale/it-IT.js +1 -1
  85. package/lib/umd/locale/ja-JP.js +1 -1
  86. package/lib/umd/locale/ko-KR.js +1 -1
  87. package/lib/umd/locale/pl-PL.js +1 -1
  88. package/lib/umd/locale/pt-BR.js +1 -1
  89. package/lib/umd/locale/ru-RU.js +1 -1
  90. package/lib/umd/locale/sk-SK.js +1 -1
  91. package/lib/umd/locale/vi-VN.js +1 -1
  92. package/lib/umd/locale/zh-CN.js +1 -1
  93. package/lib/umd/locale/zh-HK.js +1 -1
  94. package/lib/umd/locale/zh-TW.js +1 -1
  95. package/package.json +15 -12
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/ar-SA.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "إدارة التعليقات",
4
- addComment: "إضافة تعليق"
4
+ addComment: "إضافة تعليق",
5
+ openComments: "فتح التعليقات"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/ca-ES.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "Gestió de comentaris",
4
- addComment: "Afegeix un comentari"
4
+ addComment: "Afegeix un comentari",
5
+ openComments: "Obre els comentaris"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/de-DE.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "Kommentarverwaltung",
4
- addComment: "Kommentar hinzufügen"
4
+ addComment: "Kommentar hinzufügen",
5
+ openComments: "Kommentare öffnen"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -16,7 +16,8 @@
16
16
  */
17
17
  const locale = { "docs-thread-comment-ui": { panel: {
18
18
  title: "Comment Management",
19
- addComment: "Add Comment"
19
+ addComment: "Add Comment",
20
+ openComments: "Comments"
20
21
  } } };
21
22
 
22
23
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/es-ES.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "Gestión de comentarios",
4
- addComment: "Añadir comentario"
4
+ addComment: "Añadir comentario",
5
+ openComments: "Abrir comentarios"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/fa-IR.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "مدیریت نظرات",
4
- addComment: "افزودن نظر"
4
+ addComment: "افزودن نظر",
5
+ openComments: "باز کردن نظرات"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/fr-FR.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "Gestion des commentaires",
4
- addComment: "Ajouter un commentaire"
4
+ addComment: "Ajouter un commentaire",
5
+ openComments: "Ouvrir les commentaires"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/id-ID.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "Manajemen Komentar",
4
- addComment: "Tambah Komentar"
4
+ addComment: "Tambah Komentar",
5
+ openComments: "Buka Komentar"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/it-IT.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "Gestione Commenti",
4
- addComment: "Aggiungi Commento"
4
+ addComment: "Aggiungi Commento",
5
+ openComments: "Apri commenti"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/ja-JP.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "コメント管理",
4
- addComment: "コメントを追加"
4
+ addComment: "コメントを追加",
5
+ openComments: "コメントを開く"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/ko-KR.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "댓글 관리",
4
- addComment: "댓글 추가"
4
+ addComment: "댓글 추가",
5
+ openComments: "댓글 열기"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/pl-PL.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "Zarządzanie komentarzami",
4
- addComment: "Dodaj komentarz"
4
+ addComment: "Dodaj komentarz",
5
+ openComments: "Otwórz komentarze"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/pt-BR.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "Gerenciamento de Comentários",
4
- addComment: "Adicionar Comentário"
4
+ addComment: "Adicionar Comentário",
5
+ openComments: "Abrir comentários"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/ru-RU.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "Управление комментариями",
4
- addComment: "Добавить комментарий"
4
+ addComment: "Добавить комментарий",
5
+ openComments: "Открыть комментарии"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/sk-SK.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "Správa komentárov",
4
- addComment: "Pridať komentár"
4
+ addComment: "Pridať komentár",
5
+ openComments: "Otvoriť komentáre"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/vi-VN.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "Quản lý Bình luận",
4
- addComment: "Thêm bình luận"
4
+ addComment: "Thêm bình luận",
5
+ openComments: "Mở bình luận"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/zh-CN.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "评论管理",
4
- addComment: "添加评论"
4
+ addComment: "添加评论",
5
+ openComments: "打开评论"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/zh-HK.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "評論管理",
4
- addComment: "新增評論"
4
+ addComment: "新增評論",
5
+ openComments: "開啟評論"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -1,7 +1,8 @@
1
1
  //#region src/locale/zh-TW.ts
2
2
  const locale = { "docs-thread-comment-ui": { panel: {
3
3
  title: "評論管理",
4
- addComment: "新增評論"
4
+ addComment: "新增評論",
5
+ openComments: "開啟評論"
5
6
  } } };
6
7
 
7
8
  //#endregion
@@ -13,11 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICommand, ITextRange } from '@univerjs/core';
17
- import type { IThreadComment } from '@univerjs/thread-comment';
18
- export interface IAddDocCommentComment {
19
- unitId: string;
20
- comment: IThreadComment;
21
- range: ITextRange;
22
- }
16
+ import type { ICommand } from '@univerjs/core';
17
+ import type { IAddDocTextRangeCommentParams } from '@univerjs/docs-thread-comment';
18
+ export type IAddDocCommentComment = IAddDocTextRangeCommentParams;
19
+ /** Adds a document comment and activates it in the UI comment panel. */
23
20
  export declare const AddDocCommentComment: ICommand<IAddDocCommentComment>;
@@ -21,3 +21,4 @@ export interface IShowCommentPanelOperationParams {
21
21
  export declare const ShowCommentPanelOperation: ICommand<IShowCommentPanelOperationParams>;
22
22
  export declare const ToggleCommentPanelOperation: ICommand;
23
23
  export declare const StartAddCommentOperation: ICommand;
24
+ export declare const AddDocDrawingCommentOperation: ICommand;
@@ -15,5 +15,4 @@
15
15
  */
16
16
  export declare const DOCS_THREAD_COMMENT_PANEL = "univer.doc.thread-comment-panel";
17
17
  export declare const PLUGIN_NAME = "DOC_THREAD_COMMENT_UI_PLUGIN";
18
- export declare const DEFAULT_DOC_SUBUNIT_ID = "default_doc";
19
18
  export declare const DEFAULT_TEMP_COMMENT_ID = "default_comment";
@@ -27,5 +27,6 @@ export declare class DocThreadCommentSelectionController extends Disposable {
27
27
  private readonly _threadCommentModel;
28
28
  constructor(_threadCommentPanelService: ThreadCommentPanelService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _docThreadCommentService: DocThreadCommentService, _renderManagerService: IRenderManagerService, _threadCommentModel: ThreadCommentModel);
29
29
  private _initSelectionChange;
30
+ private _findActiveCommentDecoration;
30
31
  private _initActiveCommandChange;
31
32
  }
@@ -0,0 +1,26 @@
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 } from '@univerjs/core';
17
+ import { ComponentManager, IMenuManagerService } from '@univerjs/ui';
18
+ export declare class DocThreadCommentUIController extends Disposable {
19
+ private readonly _commandService;
20
+ private readonly _menuManagerService;
21
+ private readonly _componentManager;
22
+ constructor(_commandService: ICommandService, _menuManagerService: IMenuManagerService, _componentManager: ComponentManager);
23
+ private _initCommands;
24
+ private _initMenus;
25
+ private _initComponents;
26
+ }
@@ -15,21 +15,28 @@
15
15
  */
16
16
  import type { DocumentDataModel } from '@univerjs/core';
17
17
  import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
18
- import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
18
+ import { Disposable, ICommandService, IUniverInstanceService, ThemeService } from '@univerjs/core';
19
19
  import { DocInterceptorService } from '@univerjs/docs';
20
- import { DocRenderController } from '@univerjs/docs-ui';
20
+ import { IDrawingManagerService } from '@univerjs/drawing';
21
21
  import { ThreadCommentModel } from '@univerjs/thread-comment';
22
22
  import { ThreadCommentPanelService } from '@univerjs/thread-comment-ui';
23
23
  export declare class DocThreadCommentRenderController extends Disposable implements IRenderModule {
24
24
  private readonly _context;
25
25
  private readonly _docInterceptorService;
26
26
  private readonly _threadCommentPanelService;
27
- private readonly _docRenderController;
28
27
  private readonly _univerInstanceService;
29
28
  private readonly _threadCommentModel;
30
29
  private readonly _commandService;
31
- constructor(_context: IRenderContext<DocumentDataModel>, _docInterceptorService: DocInterceptorService, _threadCommentPanelService: ThreadCommentPanelService, _docRenderController: DocRenderController, _univerInstanceService: IUniverInstanceService, _threadCommentModel: ThreadCommentModel, _commandService: ICommandService);
30
+ private readonly _drawingManagerService;
31
+ private readonly _themeService;
32
+ private readonly _drawingOverlay;
33
+ private readonly _drawingCommentSubUnits;
34
+ constructor(_context: IRenderContext<DocumentDataModel>, _docInterceptorService: DocInterceptorService, _threadCommentPanelService: ThreadCommentPanelService, _univerInstanceService: IUniverInstanceService, _threadCommentModel: ThreadCommentModel, _commandService: ICommandService, _drawingManagerService: IDrawingManagerService, _themeService: ThemeService);
32
35
  private _initReRender;
36
+ private _initDrawingOverlay;
37
+ private _syncDrawingOverlay;
38
+ private _getDrawingOutline;
39
+ private _getDrawingOverlayColors;
33
40
  private _interceptorViewModel;
34
41
  private _initSyncComments;
35
42
  }
@@ -22,4 +22,5 @@ export { ShowCommentPanelOperation, StartAddCommentOperation } from './commands/
22
22
  export type { IShowCommentPanelOperationParams } from './commands/operations/show-comment-panel.operation';
23
23
  export type { IUniverDocsThreadCommentUIConfig } from './config/config';
24
24
  export { menuSchema as DocsThreadCommentUIMenuSchema } from './menu/schema';
25
+ export { UniverDocsThreadCommentMobileUIPlugin } from './mobile-plugin';
25
26
  export { UniverDocsThreadCommentUIPlugin } from './plugin';
@@ -18,6 +18,7 @@ declare const locale: {
18
18
  panel: {
19
19
  title: string;
20
20
  addComment: string;
21
+ openComments: string;
21
22
  };
22
23
  };
23
24
  };
@@ -13,9 +13,33 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IAccessor } from '@univerjs/core';
17
- import type { IMenuButtonItem } from '@univerjs/ui';
18
- import type { LocaleKey } from '../locale/types';
19
- export declare const shouldDisableAddComment: (accessor: IAccessor) => boolean;
20
- export declare function AddDocCommentMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
21
- export declare function ToolbarDocCommentMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
16
+ import { getMenuHiddenObservable, MenuItemType } from '@univerjs/ui';
17
+ type MenuAccessor = Parameters<typeof getMenuHiddenObservable>[0];
18
+ export declare function AddDocDrawingCommentMenuItemFactory(accessor: MenuAccessor): {
19
+ id: string;
20
+ type: MenuItemType;
21
+ icon: string;
22
+ title: string;
23
+ tooltip: string;
24
+ hidden$: import("rxjs").Observable<boolean>;
25
+ disabled$: import("rxjs").Observable<boolean>;
26
+ };
27
+ export declare const shouldDisableAddComment: (accessor: MenuAccessor) => boolean;
28
+ export declare function AddDocCommentMenuItemFactory(accessor: MenuAccessor): {
29
+ id: string;
30
+ type: MenuItemType;
31
+ icon: string;
32
+ title: string;
33
+ tooltip: string;
34
+ hidden$: import("rxjs").Observable<boolean>;
35
+ disabled$: import("rxjs").Observable<boolean>;
36
+ };
37
+ export declare function ToolbarDocCommentMenuItemFactory(accessor: MenuAccessor): {
38
+ id: string;
39
+ type: MenuItemType;
40
+ icon: string;
41
+ title: string;
42
+ tooltip: string;
43
+ hidden$: import("rxjs").Observable<boolean>;
44
+ };
45
+ export {};
@@ -0,0 +1,32 @@
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 { IUniverDocsThreadCommentUIConfig } from './config/config';
17
+ import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
18
+ import { IRenderManagerService } from '@univerjs/engine-render';
19
+ export declare class UniverDocsThreadCommentMobileUIPlugin extends Plugin {
20
+ private readonly _config;
21
+ protected _injector: Injector;
22
+ private readonly _renderManagerSrv;
23
+ private readonly _configService;
24
+ static pluginName: string;
25
+ static packageName: string;
26
+ static version: string;
27
+ static type: UniverInstanceType;
28
+ constructor(_config: Partial<IUniverDocsThreadCommentUIConfig> | undefined, _injector: Injector, _renderManagerSrv: IRenderManagerService, _configService: IConfigService);
29
+ onStarting(): void;
30
+ onRendered(): void;
31
+ private _initRenderModule;
32
+ }
@@ -13,4 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export declare function getDocCommentPanelSubUnitId(draft: {
17
+ unitId: string;
18
+ subUnitId: string;
19
+ } | null, unitId: string | undefined): string;
16
20
  export declare const DocThreadCommentPanel: () => import("react").JSX.Element | null;
@@ -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 DocThreadCommentPanel: () => import("react/jsx-runtime").JSX.Element | null;
package/lib/umd/index.js CHANGED
@@ -1,2 +1,3 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/core"),require("@univerjs/docs-ui"),require("@univerjs/thread-comment"),require("@univerjs/thread-comment-ui"),require("@univerjs/docs"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("rxjs"),require("react"),require("react/jsx-runtime")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/docs-ui`,`@univerjs/thread-comment`,`@univerjs/thread-comment-ui`,`@univerjs/docs`,`@univerjs/engine-render`,`@univerjs/ui`,`rxjs`,`react`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverDocsThreadCommentUi={},e.UniverCore,e.UniverDocsUi,e.UniverThreadComment,e.UniverThreadCommentUi,e.UniverDocs,e.UniverEngineRender,e.UniverUi,e.rxjs,e.React,e.React))})(this,function(e,t,n,r,i,a,o,s,c,l,u){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let d=`univer.doc.thread-comment-panel`,f=`default_doc`,p={id:`docs.command.add-comment`,type:t.CommandType.COMMAND,async handler(e,a){if(!a)return!1;let{comment:o,unitId:s}=a,c=await e.get(r.IThreadCommentDataSourceService).addComment(o),l=e.get(t.ICommandService),u=(0,n.addCustomDecorationBySelectionFactory)(e,{id:c.threadId,type:t.CustomDecorationType.COMMENT,unitId:s});return u?(await(0,t.sequenceExecute)([{id:r.AddCommentMutation.id,params:{unitId:s,subUnitId:f,comment:c}},u,{id:i.SetActiveCommentOperation.id,params:{unitId:s,subUnitId:f,commentId:c.id}}],l)).result:!1}},m={id:`docs.command.delete-comment`,type:t.CommandType.COMMAND,async handler(e,r){if(!r)return!1;let{commentId:i,unitId:a}=r,o=e.get(t.ICommandService),s=(0,n.deleteCustomDecorationFactory)(e,{id:i,unitId:a});return s?(await(0,t.sequenceExecute)([s],o)).result:!1}};function h(e){"@babel/helpers - typeof";return h=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},h(e)}function g(e,t){if(h(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(h(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function _(e){var t=g(e,`string`);return h(t)==`symbol`?t:t+``}function v(e,t,n){return(t=_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){return function(n,r){t(n,r,e)}}function b(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let x=class extends t.Disposable{get addingComment(){return this._addingComment$.getValue()}constructor(e,t){super(),this._sidebarService=e,this._threadCommentPanelService=t,v(this,`_addingComment$`,new c.BehaviorSubject(void 0)),v(this,`addingComment$`,this._addingComment$.asObservable()),this.disposeWithMe(()=>{this._addingComment$.complete()})}startAdd(e){this._addingComment$.next(e)}endAdd(){this._addingComment$.next(void 0)}};x=b([y(0,s.ISidebarService),y(1,(0,t.Inject)(i.ThreadCommentPanelService))],x);let S={id:`docs.operation.show-comment-panel`,type:t.CommandType.OPERATION,handler(e,t){var n;let r=e.get(i.ThreadCommentPanelService),a=e.get(s.ISidebarService);return(!r.panelVisible||((n=a.options.children)==null?void 0:n.label)!==`univer.doc.thread-comment-panel`)&&(a.open({header:{title:`docs-thread-comment-ui.panel.title`},children:{label:d},width:320,onClose:()=>r.setPanelVisible(!1)}),r.setPanelVisible(!0)),t&&r.setActiveComment(t==null?void 0:t.activeComment),!0}},C={id:`docs.operation.toggle-comment-panel`,type:t.CommandType.OPERATION,handler(e){var t;let n=e.get(i.ThreadCommentPanelService),r=e.get(s.ISidebarService);return!n.panelVisible||((t=r.options.children)==null?void 0:t.label)!==`univer.doc.thread-comment-panel`?(r.open({header:{title:`docs-thread-comment-ui.panel.title`},children:{label:d},width:320,onClose:()=>n.setPanelVisible(!1)}),n.setPanelVisible(!0)):(r.close(),n.setPanelVisible(!1),n.setActiveComment(null)),!0}},w={id:`docs.operation.start-add-comment`,type:t.CommandType.OPERATION,handler(e){var c,l;let u=e.get(i.ThreadCommentPanelService),d=e.get(t.IUniverInstanceService).getCurrentUnitOfType(t.UniverInstanceType.UNIVER_DOC),p=e.get(a.DocSelectionManagerService),m=e.get(o.IRenderManagerService),h=e.get(t.UserManagerService),g=e.get(x),_=e.get(t.ICommandService),v=e.get(s.ISidebarService),y=p.getActiveTextRange();if(!d||!y)return!1;let b=(c=m.getRenderUnitById(d.getUnitId()))==null?void 0:c.with(n.DocSelectionRenderService);if(b==null||b.setReserveRangesStatus(!0),y.collapsed)return u.panelVisible?(u.setPanelVisible(!1),v.close()):_.executeCommand(S.id),!0;_.executeCommand(S.id);let C=d.getUnitId(),w=(((l=d.getBody())==null?void 0:l.dataStream)??``).slice(y.startOffset,y.endOffset),T=t.BuildTextUtils.transform.getPlainText(w),E=f,D={unitId:C,subUnitId:E,id:``,ref:T,dT:(0,r.getDT)(),personId:h.getCurrentUser().userID,text:{dataStream:`\r
2
- `},startOffset:y.startOffset,endOffset:y.endOffset,collapsed:!0,threadId:``};return b==null||b.blur(),g.startAdd(D),u.setActiveComment({unitId:C,subUnitId:E,commentId:``}),!0}},T=e=>{var n;let r=e.get(o.IRenderManagerService),i=e.get(a.DocSelectionManagerService),s=(n=(0,o.withCurrentTypeOfRenderer)(t.UniverInstanceType.UNIVER_DOC,a.DocSkeletonManagerService,e.get(t.IUniverInstanceService),r))==null?void 0:n.getSkeleton(),c=s==null?void 0:s.getViewModel().getEditArea();if(c===o.DocumentEditArea.FOOTER||c===o.DocumentEditArea.HEADER)return!0;let l=i.getActiveTextRange();return!!(l==null||l.collapsed)};function E(e){return{id:w.id,type:s.MenuItemType.BUTTON,icon:`CommentIcon`,title:`docs-thread-comment-ui.panel.addComment`,tooltip:`docs-thread-comment-ui.panel.addComment`,hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_DOC,void 0,t.SHEET_EDITOR_UNITS),disabled$:new c.Observable(function(t){let n=e.get(a.DocSelectionManagerService).textSelection$.pipe((0,c.debounceTime)(16)).subscribe(()=>{t.next(T(e))});return()=>{n.unsubscribe()}})}}function D(e){return{id:C.id,type:s.MenuItemType.BUTTON,icon:`CommentIcon`,title:`docs-thread-comment-ui.panel.addComment`,tooltip:`docs-thread-comment-ui.panel.addComment`,hidden$:(0,s.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_DOC)}}let O={[s.RibbonInsertGroup.MEDIA]:{[C.id]:{order:3,menuItemFactory:D}},[n.FLOAT_TOOLBAR_MENU_POSITION]:{[w.id]:{order:21,menuItemFactory:E}},[s.ContextMenuPosition.MAIN_AREA]:{[s.ContextMenuGroup.DATA]:{[w.id]:{order:1,menuItemFactory:E}}}};var k=`@univerjs/docs-thread-comment-ui`,A=`1.0.0-insiders.20260813-7c9aa50`;let j={};function M({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,s=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),c=(0,l.useRef)(`_${I()}`);return N(n,`${r}`,{defIds:n.defIds,idSuffix:c.current},{ref:e,className:s,...o},a)}function N(e,t,n,r,i){return(0,l.createElement)(e.tag,{key:t,...P(e,n,i),...r},(F(e,n).children||[]).map((r,a)=>N(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function P(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),n!=null&&n.colorChannel1&&r.stroke===`colorChannel1`&&(r.stroke=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function F(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function I(){return Math.random().toString(36).substring(2,8)}M.displayName=`UniverIcon`;let L={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},R=(0,l.forwardRef)(function(e,t){return(0,l.createElement)(M,Object.assign({},e,{id:`comment-icon`,ref:t,icon:L}))});R.displayName=`CommentIcon`;let z=()=>{let e=(0,s.useDependency)(t.IUniverInstanceService),n=(0,s.useDependency)(t.Injector),r=(0,s.useObservable)((0,l.useMemo)(()=>e.getCurrentTypeOfUnit$(t.UniverInstanceType.UNIVER_DOC).pipe((0,c.filter)(e=>!!e&&!(0,t.isInternalEditorID)(e.getUnitId()))),[e])),o=(0,l.useMemo)(()=>new c.Observable(e=>e.next(f)),[]),d=(0,s.useDependency)(a.DocSelectionManagerService),h=(0,l.useMemo)(()=>d.textSelection$.pipe((0,c.debounceTime)(16)),[d.textSelection$]),g=(0,s.useObservable)(()=>h.pipe((0,c.map)(()=>T(n))),T(n),!1,[n,h]),_=(0,s.useDependency)(t.ICommandService),v=(0,s.useDependency)(x),y=(0,s.useObservable)(v.addingComment$),[b,S]=(0,l.useState)([]);if((0,l.useEffect)(()=>{let e=new Set,t=r==null?void 0:r.getCustomDecorations();S((t==null?void 0:t.map(e=>e.id).filter(t=>{let n=e.has(t);return e.add(t),!n}))??[]);let n=_.onCommandExecuted(e=>{if(e.id===a.RichTextEditingMutation.id){let e=new Set,t=r==null?void 0:r.getCustomDecorations();S((t==null?void 0:t.map(e=>e.id).filter(t=>{let n=e.has(t);return e.add(t),!n}))??[])}});return()=>{n.dispose()}},[_,r]),!r)return null;let C=r.getUnitId();return(0,u.jsx)(i.ThreadCommentPanel,{unitId:C,subUnitId$:o,type:t.UniverInstanceType.UNIVER_DOC,onAdd:()=>{_.executeCommand(w.id)},getSubUnitName:()=>``,disableAdd:g,tempComment:y,onAddComment:e=>{if(!e.parentId){let t={unitId:C,range:y,comment:e};return _.executeCommand(p.id,t),v.endAdd(),!1}return!0},onDeleteComment:e=>{if(!e.parentId){let t={unitId:C,commentId:e.id};return _.executeCommand(m.id,t),!1}return!0},showComments:b})},B=class extends t.Disposable{constructor(e,t){super(),this._componentManager=e,this._iconManager=t,this._registerComponents(),this._registerIcons()}_registerComponents(){[[d,z]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}_registerIcons(){this.disposeWithMe(this._iconManager.register({CommentIcon:R}))}};B=b([y(0,(0,t.Inject)(s.ComponentManager)),y(1,(0,t.Inject)(s.IconManager))],B);let V=class extends t.Disposable{constructor(e,t,n,r,i,a){super(),this._threadCommentPanelService=e,this._univerInstanceService=t,this._commandService=n,this._docThreadCommentService=r,this._renderManagerService=i,this._threadCommentModel=a,this._initSelectionChange(),this._initActiveCommandChange()}_initSelectionChange(){let e;this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===a.SetTextSelectionsOperation.id){let{unitId:a,ranges:s}=n.params;if((0,t.isInternalEditorID)(a))return;let c=this._univerInstanceService.getUnit(a,t.UniverInstanceType.UNIVER_DOC),l=s[0];if((e==null?void 0:e.startOffset)===(l==null?void 0:l.startOffset)&&(e==null?void 0:e.endOffset)===(l==null?void 0:l.endOffset))return;if(e=l,l&&c){let{startOffset:e,endOffset:t,collapsed:n}=l,i;if(n){var r;i=(r=c.getBody())==null||(r=r.customDecorations)==null?void 0:r.find(n=>n.startIndex<=e&&n.endIndex>=t-1)}else{var o;i=(o=c.getBody())==null||(o=o.customDecorations)==null?void 0:o.find(n=>n.startIndex<=e&&n.endIndex>=t-1)}if(i){let e=this._threadCommentModel.getComment(a,f,i.id);e&&!e.resolved&&this._commandService.executeCommand(S.id,{activeComment:{unitId:a,subUnitId:f,commentId:i.id}});return}}if(!this._threadCommentPanelService.activeCommentId)return;let u=this._docThreadCommentService.addingComment,d=this._threadCommentPanelService.activeCommentId;if(u&&(d==null?void 0:d.unitId)===u.unitId&&(d==null?void 0:d.subUnitId)===`default_doc`&&(d==null?void 0:d.commentId)===u.id)return;this._commandService.executeCommand(i.SetActiveCommentOperation.id)}}))}_initActiveCommandChange(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var t;if(e){let t=this._univerInstanceService.getUnit(e.unitId);if(t){var r,i;let a=(r=this._renderManagerService.getRenderUnitById(e.unitId))==null?void 0:r.with(n.DocBackScrollRenderController),o=(i=t.getBody())==null||(i=i.customDecorations)==null?void 0:i.find(t=>t.id===e.commentId);o&&a&&a.scrollToRange({startOffset:o.startIndex,endOffset:o.endIndex,collapsed:!1})}}(!e||e.commentId!==((t=this._docThreadCommentService.addingComment)==null?void 0:t.id))&&this._docThreadCommentService.endAdd()}))}};V=b([y(0,(0,t.Inject)(i.ThreadCommentPanelService)),y(1,t.IUniverInstanceService),y(2,t.ICommandService),y(3,(0,t.Inject)(x)),y(4,o.IRenderManagerService),y(5,(0,t.Inject)(r.ThreadCommentModel))],V);let H=class extends t.Disposable{constructor(e,t,n,r,i,a,o){super(),this._context=e,this._docInterceptorService=t,this._threadCommentPanelService=n,this._docRenderController=r,this._univerInstanceService=i,this._threadCommentModel=a,this._commandService=o,this._interceptorViewModel(),this._initReRender(),this._initSyncComments()}_initReRender(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var n;if(e){this._docRenderController.reRender(e.unitId);return}let r=(n=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_DOC))==null?void 0:n.getUnitId();r&&this._docRenderController.reRender(r)})),this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe(e=>{e.type===`resolve`&&this._docRenderController.reRender(e.unitId)}))}_interceptorViewModel(){this._docInterceptorService.intercept(a.DOC_INTERCEPTOR_POINT.CUSTOM_DECORATION,{handler:(e,t,n)=>{if(!e)return n(e);let{unitId:r,index:i,customDecorations:a}=t,{commentId:o,unitId:s}=this._threadCommentPanelService.activeCommentId||{},c=a.find(e=>e.id===o),l=this._threadCommentModel.getComment(r,f,e.id);if(!l)return n({...e,show:!1});let u=c&&i>=c.startIndex&&i<=c.endIndex,d=s===r&&e.id===o;return n({...e,active:d||u,show:!l.resolved})}})}_initSyncComments(){var e;let n=this._context.unit.getUnitId(),r=((e=this._context.unit.getBody())==null||(e=e.customDecorations)==null?void 0:e.filter(e=>e.type===t.CustomDecorationType.COMMENT).map(e=>e.id))??[];r.length&&this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(),`default_doc`,r);let i=r.sort();this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===a.RichTextEditingMutation.id){var r;if(e.params.unitId!==this._context.unit.getUnitId())return;let a=((r=this._context.unit.getBody())==null||(r=r.customDecorations)==null?void 0:r.filter(e=>e.type===t.CustomDecorationType.COMMENT).map(e=>e.id))??[],o=a.sort();if(JSON.stringify(i)!==JSON.stringify(o)){let e=new Set(i),t=new Set;a.forEach(n=>{e.has(n)||t.add(n)}),i=o,this._threadCommentModel.syncThreadComments(n,`default_doc`,[...t])}}}))}};H=b([y(1,(0,t.Inject)(a.DocInterceptorService)),y(2,(0,t.Inject)(i.ThreadCommentPanelService)),y(3,(0,t.Inject)(n.DocRenderController)),y(4,t.IUniverInstanceService),y(5,(0,t.Inject)(r.ThreadCommentModel)),y(6,t.ICommandService)],H);let U=class extends t.Disposable{constructor(e,t){super(),this._commandService=e,this._menuManagerService=t,this._initCommands(),this._initMenus()}_initCommands(){[p,m,S,w,C].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.appendRootMenu({[n.FLOAT_TOOLBAR_MENU_POSITION]:{}}),this._menuManagerService.mergeMenu(O)}};U=b([y(0,t.ICommandService),y(1,s.IMenuManagerService)],U);let W=class extends t.Plugin{constructor(e=j,n,r,i){super(),this._config=e,this._injector=n,this._renderManagerSrv=r,this._configService=i;let{menu:a,...o}=(0,t.merge)({},j,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(`docs-thread-comment-ui.config`,o)}onStarting(){this._injector.add([B]),this._injector.get(B),[[U],[V],[x]].forEach(e=>{this._injector.add(e)})}onRendered(){this._initRenderModule(),this._injector.get(V),this._injector.get(U)}_initRenderModule(){[H].forEach(e=>{this._renderManagerSrv.registerRenderModule(t.UniverInstanceType.UNIVER_DOC,e)})}};v(W,`pluginName`,`DOC_THREAD_COMMENT_UI_PLUGIN`),v(W,`packageName`,k),v(W,`version`,A),v(W,`type`,t.UniverInstanceType.UNIVER_DOC),W=b([(0,t.DependentOn)(a.UniverDocsPlugin,r.UniverThreadCommentPlugin,o.UniverRenderEnginePlugin,n.UniverDocsUIPlugin,i.UniverThreadCommentUIPlugin),y(1,(0,t.Inject)(t.Injector)),y(2,o.IRenderManagerService),y(3,t.IConfigService)],W),e.AddDocCommentComment=p,e.DeleteDocCommentComment=m,e.DocsThreadCommentUIMenuSchema=O,e.ShowCommentPanelOperation=S,e.StartAddCommentOperation=w,Object.defineProperty(e,"UniverDocsThreadCommentUIPlugin",{enumerable:!0,get:function(){return W}})});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@univerjs/core"),require("@univerjs/docs"),require("@univerjs/docs-thread-comment"),require("@univerjs/thread-comment-ui"),require("@univerjs/docs-ui"),require("@univerjs/drawing"),require("@univerjs/engine-render"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("@univerjs/protocol"),require("react"),require("react/jsx-runtime")):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/docs`,`@univerjs/docs-thread-comment`,`@univerjs/thread-comment-ui`,`@univerjs/docs-ui`,`@univerjs/drawing`,`@univerjs/engine-render`,`@univerjs/thread-comment`,`@univerjs/ui`,`rxjs`,`@univerjs/protocol`,`react`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverDocsThreadCommentUi={},e.UniverCore,e.UniverDocs,e.UniverDocsThreadComment,e.UniverThreadCommentUi,e.UniverDocsUi,e.UniverDrawing,e.UniverEngineRender,e.UniverThreadComment,e.UniverUi,e.rxjs,e.UniverProtocol,e.React,e.React))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let m={id:`docs.command.add-comment`,type:t.CommandType.COMMAND,async handler(e,a){if(!a)return!1;let o=await(0,r.prepareDocTextRangeComment)(e,a);if(!o)return!1;let s={id:i.SetActiveCommentOperation.id,params:{unitId:o.comment.unitId,subUnitId:o.comment.subUnitId,commentId:o.comment.id}},c={id:n.RichTextEditingMutation.id,params:{...o.decorationMutationParams,textRanges:null,noNeedSetTextRange:!0}};return(await(0,t.sequenceExecute)([o.commentMutation,c,s],e.get(t.ICommandService))).result}},h={id:`docs.command.delete-comment`,type:t.CommandType.COMMAND,async handler(e,n){if(!n)return!1;let{commentId:r,unitId:i}=n,o=e.get(t.ICommandService),s=(0,a.deleteCustomDecorationFactory)(e,{id:r,unitId:i});return s?(await(0,t.sequenceExecute)([s],o)).result:!1}},g=`univer.doc.thread-comment-panel`,_=`DOC_THREAD_COMMENT_UI_PLUGIN`;function v(e){"@babel/helpers - typeof";return v=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},v(e)}function y(e,t){if(v(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(v(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function b(e){var t=y(e,`string`);return v(t)==`symbol`?t:t+``}function x(e,t,n){return(t=b(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e,t){return function(n,r){t(n,r,e)}}function C(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let w=class extends t.Disposable{get addingComment(){return this._addingComment$.getValue()}constructor(e,t){super(),this._sidebarService=e,this._threadCommentPanelService=t,x(this,`_addingComment$`,new u.BehaviorSubject(void 0)),x(this,`addingComment$`,this._addingComment$.asObservable()),this.disposeWithMe(()=>{this._addingComment$.complete()})}startAdd(e){this._addingComment$.next(e)}endAdd(){this._addingComment$.next(void 0)}};w=C([S(0,l.ISidebarService),S(1,(0,t.Inject)(i.ThreadCommentPanelService))],w);let T={id:`docs.operation.show-comment-panel`,type:t.CommandType.OPERATION,handler(e,t){var n;let r=e.get(i.ThreadCommentPanelService),a=e.get(l.ISidebarService);return(!r.panelVisible||((n=a.options.children)==null?void 0:n.label)!==`univer.doc.thread-comment-panel`)&&(a.open({header:{title:`docs-thread-comment-ui.panel.title`},children:{label:g},width:320,onClose:()=>r.setPanelVisible(!1)}),r.setPanelVisible(!0)),t&&r.setActiveComment(t==null?void 0:t.activeComment),!0}},E={id:`docs.operation.toggle-comment-panel`,type:t.CommandType.OPERATION,handler(e){var t;let n=e.get(i.ThreadCommentPanelService),r=e.get(l.ISidebarService);return!n.panelVisible||((t=r.options.children)==null?void 0:t.label)!==`univer.doc.thread-comment-panel`?(r.open({header:{title:`docs-thread-comment-ui.panel.title`},children:{label:g},width:320,onClose:()=>n.setPanelVisible(!1)}),n.setPanelVisible(!0)):(r.close(),n.setPanelVisible(!1),n.setActiveComment(null)),!0}},D={id:`docs.operation.start-add-comment`,type:t.CommandType.OPERATION,handler(e){var o,u;let d=e.get(i.ThreadCommentPanelService),f=e.get(t.IUniverInstanceService).getCurrentUnitOfType(t.UniverInstanceType.UNIVER_DOC),p=e.get(n.DocSelectionManagerService),m=e.get(s.IRenderManagerService),h=e.get(t.UserManagerService),g=e.get(w),_=e.get(t.ICommandService),v=e.get(l.ISidebarService),y=p.getActiveTextRange();if(!f||!y)return!1;let b=(o=m.getRenderUnitById(f.getUnitId()))==null?void 0:o.with(a.DocSelectionRenderService);if(b==null||b.setReserveRangesStatus(!0),y.collapsed)return d.panelVisible?(d.setPanelVisible(!1),v.close()):_.executeCommand(T.id),!0;_.executeCommand(T.id);let x=f.getUnitId(),S=(((u=f.getBody())==null?void 0:u.dataStream)??``).slice(y.startOffset,y.endOffset),C=t.BuildTextUtils.transform.getPlainText(S),E=r.DEFAULT_DOC_SUBUNIT_ID,D={unitId:x,subUnitId:E,id:``,ref:C,dT:(0,c.getDT)(),personId:h.getCurrentUser().userID,text:{dataStream:`\r
2
+ `},startOffset:y.startOffset,endOffset:y.endOffset,collapsed:!0,threadId:``};return b==null||b.blur(),g.startAdd(D),d.setActiveComment({unitId:x,subUnitId:E,commentId:``}),!0}},O={id:`docs.operation.add-drawing-comment`,type:t.CommandType.OPERATION,handler(e){let n=e.get(o.IDrawingManagerService).getFocusDrawings()[0],r=e.get(t.IUniverInstanceService).getCurrentUnitOfType(t.UniverInstanceType.UNIVER_DOC);if(!n||!r||n.unitId!==r.getUnitId())return!1;e.get(i.ThreadCommentDraftService).place({unitId:n.unitId,subUnitId:n.subUnitId,anchor:{kind:c.ThreadCommentAnchorKind.DOC_DRAWING,pageId:n.subUnitId,elementId:n.drawingId}});let a=e.get(i.ThreadCommentPanelService);return e.get(l.ISidebarService).open({header:{title:`docs-thread-comment-ui.panel.title`},children:{label:g},width:320,onClose:()=>a.setPanelVisible(!1)}),a.setPanelVisible(!0),!0}};function k(e){let r=e.get(t.IUniverInstanceService),i=e.get(t.IPermissionService);return(0,u.combineLatest)([r.getCurrentTypeOfUnit$(t.UniverInstanceType.UNIVER_DOC),i.permissionPointUpdate$.pipe((0,u.startWith)(void 0))]).pipe((0,u.map)(([e])=>!e||!(0,n.getDocumentPermissionValue)(i,e.getUnitId(),e.getUnitId(),d.UnitAction.Comment)))}function A(e){return{id:O.id,type:l.MenuItemType.BUTTON,icon:`InsertCommentDoubleIcon`,title:`docs-thread-comment-ui.panel.addComment`,tooltip:`docs-thread-comment-ui.panel.addComment`,hidden$:(0,l.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_DOC),disabled$:k(e)}}let j=e=>{var r;let i=e.get(s.IRenderManagerService),a=e.get(n.DocSelectionManagerService),o=e.get(t.IUniverInstanceService),c=e.get(t.IPermissionService),l=o.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_DOC);if(!l||!(0,n.getDocumentPermissionValue)(c,l.getUnitId(),l.getUnitId(),d.UnitAction.Comment))return!0;let u=(r=(0,s.withCurrentTypeOfRenderer)(t.UniverInstanceType.UNIVER_DOC,n.DocSkeletonManagerService,o,i))==null?void 0:r.getSkeleton(),f=u==null?void 0:u.getViewModel().getEditArea();if(f===s.DocumentEditArea.FOOTER||f===s.DocumentEditArea.HEADER)return!0;let p=a.getActiveTextRange();return!!(p==null||p.collapsed)};function M(e){return{id:D.id,type:l.MenuItemType.BUTTON,icon:`InsertCommentDoubleIcon`,title:`docs-thread-comment-ui.panel.addComment`,tooltip:`docs-thread-comment-ui.panel.addComment`,hidden$:(0,l.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_DOC,void 0,t.SHEET_EDITOR_UNITS),disabled$:(0,u.combineLatest)([e.get(n.DocSelectionManagerService).textSelection$.pipe((0,u.debounceTime)(16),(0,u.map)(()=>j(e)),(0,u.startWith)(j(e))),k(e)]).pipe((0,u.map)(([e,t])=>e||t))}}function N(e){return{id:E.id,type:l.MenuItemType.BUTTON,icon:`CommentIcon`,title:`docs-thread-comment-ui.panel.openComments`,tooltip:`docs-thread-comment-ui.panel.openComments`,hidden$:(0,l.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_DOC)}}let P={[l.RibbonInsertGroup.OTHERS]:{[E.id]:{order:0,gridLayout:{row:1,column:1,showLabel:!0},menuItemFactory:N},[D.id]:{order:.1,gridLayout:{row:2,column:1,showLabel:!0},menuItemFactory:M}},[a.FLOAT_TOOLBAR_MENU_POSITION]:{[D.id]:{order:21,menuItemFactory:M}},[l.FloatingObjectToolbarPosition.DOC]:{[O.id]:{order:10,menuItemFactory:A}},[l.ContextMenuPosition.MAIN_AREA]:{[l.ContextMenuGroup.DATA]:{[D.id]:{order:1,menuItemFactory:M}}},[l.ContextMenuPosition.DRAWING]:{[l.ContextMenuGroup.DATA]:{[O.id]:{order:1,menuItemFactory:A}}}};var F=`@univerjs/docs-thread-comment-ui`,I=`1.0.0`;let L=`docs-thread-comment-ui.config`,R={};function z({ref:e,...t}){let{preserveStrokeWidth:n,icon:r,id:i,className:a,extend:o,...s}=t,c=`univerjs-icon univerjs-icon-${i} ${a||``}`.trim(),l=`_${(0,f.useId)()}`,u=(0,f.useRef)(null);return(0,f.useImperativeHandle)(e,()=>u.current),(0,f.useLayoutEffect)(()=>{if(n&&u.current&&u.current.localName===r.tag)return U(u.current)},[n,r]),B(r,`${i}`,{defIds:r.defIds,idSuffix:l},{ref:u,className:c,...s},o)}function B(e,t,n,r,i){return(0,f.createElement)(e.tag,{key:t,...V(e,n,i),...r},(H(e,n).children||[]).map((r,a)=>B(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function V(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),n!=null&&n.colorChannel1&&r.stroke===`colorChannel1`&&(r.stroke=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function H(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function U(e){let t=e.viewBox.baseVal,n=Math.max(t.width,t.height);if(!Number.isFinite(n)||n<=0||t.width<=0||t.height<=0)return()=>void 0;let r=16/n,i=Array.from(e.querySelectorAll(`circle, ellipse, line, path, polygon, polyline, rect, text, textPath, tspan, use`)).flatMap(e=>{let t=getComputedStyle(e),n=Number.parseFloat(t.strokeWidth);return t.stroke===`none`||Number.parseFloat(t.strokeOpacity)===0||t.vectorEffect===`non-scaling-stroke`||!Number.isFinite(n)||n<=0?[]:[{element:e,hadStyleAttribute:e.hasAttribute(`style`),originalStrokeWidth:n,strokeWidth:W(e.style,`stroke-width`)}]}).map(e=>({appliedStrokeWidth:null,element:e.element,hadStyleAttribute:e.hadStyleAttribute,isReleased:!1,originalStrokeWidth:e.originalStrokeWidth,strokeWidth:e.strokeWidth}));if(i.length===0)return()=>void 0;let a=(e,n)=>{if(t.width<=0||t.height<=0||e<=0||n<=0)return;let a=Math.min(e/t.width,n/t.height);!Number.isFinite(a)||a<=0||i.forEach(e=>{if(e.isReleased)return;if(e.appliedStrokeWidth!==null&&(e.element.style.getPropertyValue(`stroke-width`)!==e.appliedStrokeWidth||e.element.style.getPropertyPriority(`stroke-width`)!==e.strokeWidth.priority)){e.appliedStrokeWidth=null,e.isReleased=!0;return}let t=e.originalStrokeWidth*r/a,n=`${Number(t.toFixed(12))}px`;e.element.style.setProperty(`stroke-width`,n,e.strokeWidth.priority),e.appliedStrokeWidth=n})},o=e.getBoundingClientRect();a(o.width,o.height);let s=typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{if(t.some(t=>t.target===e)){let t=e.getBoundingClientRect();a(t.width,t.height)}});return s==null||s.observe(e),()=>{s==null||s.disconnect(),i.forEach(e=>{e.appliedStrokeWidth!==null&&(G(e.element.style,`stroke-width`,e.appliedStrokeWidth,e.strokeWidth.priority,e.strokeWidth),!e.hadStyleAttribute&&e.element.style.length===0&&e.element.removeAttribute(`style`))})}}function W(e,t){return{priority:e.getPropertyPriority(t),value:e.getPropertyValue(t)}}function G(e,t,n,r,i){e.getPropertyValue(t)===n&&e.getPropertyPriority(t)===r&&(i.value?e.setProperty(t,i.value,i.priority):e.removeProperty(t))}z.displayName=`UniverIcon`;let ee={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 17`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{stroke:`currentColor`,d:`M2.43993 3.31861H15.0381V12.5611H8.65676L5.75498 14.069V12.5611H2.43993V3.31861Z`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.2}},{tag:`path`,attrs:{stroke:`currentColor`,d:`M5.83725 7.50706V8.41159M8.73904 7.50706V8.41159M11.6408 7.50706V8.41159`,strokeLinecap:`round`,strokeWidth:1.39}}]},K=(0,f.forwardRef)(function(e,t){return(0,f.createElement)(z,Object.assign({},e,{id:`comment-icon`,ref:t,icon:ee}))});K.displayName=`CommentIcon`;let te={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M1.63636 1.99658C1.28491 1.99658 1 2.28149 1 2.63295V10.2693C1 10.6208 1.28491 10.9057 1.63636 10.9057H2.96368L4.05003 11.992C4.29854 12.2405 4.70146 12.2405 4.94997 11.992L6.03632 10.9057H6.72727V12.4128C6.72727 12.7643 7.01218 13.0492 7.36364 13.0492H10.6001L11.3682 13.8173C11.6167 14.0658 12.0196 14.0658 12.2682 13.8173L13.0363 13.0492H14.3636C14.7151 13.0492 15 12.7643 15 12.4128V7.32192C15 6.97047 14.7151 6.68556 14.3636 6.68556H12.4545V2.63295C12.4545 2.28149 12.1696 1.99658 11.8182 1.99658H1.63636ZM12.4545 7.95829V10.2693C12.4545 10.6208 12.1696 10.9057 11.8182 10.9057H8V11.7765H10.8636C11.0324 11.7765 11.1942 11.8435 11.3136 11.9628L11.8182 12.4674L12.3228 11.9628C12.4421 11.8435 12.604 11.7765 12.7727 11.7765H13.7273V7.95829H12.4545ZM11.1818 3.26931H2.27273V9.63295H3.22727C3.39604 9.63295 3.5579 9.70001 3.67725 9.81936L4.5 10.6421L5.32275 9.81936C5.4421 9.70001 5.60396 9.63295 5.77273 9.63295H11.1818V3.26931Z`,fillRule:`evenodd`,clipRule:`evenodd`}},{tag:`path`,attrs:{fill:`colorChannel1`,d:`M5.13617 4.54199C4.78472 4.54199 4.49981 4.8269 4.49981 5.17836C4.49981 5.52981 4.78472 5.81472 5.13617 5.81472H8.95435C9.3058 5.81472 9.59072 5.52981 9.59072 5.17836C9.59072 4.8269 9.3058 4.54199 8.95435 4.54199H5.13617ZM4.49981 7.72381C4.49981 7.37236 4.78472 7.08744 5.13617 7.08744H7.04526C7.39671 7.08744 7.68162 7.37236 7.68162 7.72381C7.68162 8.07526 7.39671 8.36018 7.04526 8.36018H5.13617C4.78472 8.36018 4.49981 8.07526 4.49981 7.72381Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},q=(0,f.forwardRef)(function(e,t){return(0,f.createElement)(z,Object.assign({},e,{id:`insert-comment-double-icon`,ref:t,icon:te}))});q.displayName=`InsertCommentDoubleIcon`;function ne(e,t){return e&&e.unitId===t?e.subUnitId:r.DEFAULT_DOC_SUBUNIT_ID}let re=()=>{let e=(0,l.useDependency)(t.IUniverInstanceService),r=(0,l.useDependency)(t.Injector),a=(0,f.useMemo)(()=>e.getCurrentTypeOfUnit$(t.UniverInstanceType.UNIVER_DOC).pipe((0,u.filter)(e=>!!e&&!(0,t.isInternalEditorID)(e.getUnitId()))),[e]),o=(0,l.useObservable)(a),s=(0,l.useDependency)(i.ThreadCommentDraftService),d=(0,l.useObservable)(s.draft$,s.draft),g=(0,f.useMemo)(()=>new u.Observable(e=>e.next(ne(d,o==null?void 0:o.getUnitId()))),[o,d]),_=(0,l.useDependency)(n.DocSelectionManagerService),v=(0,f.useMemo)(()=>_.textSelection$.pipe((0,u.debounceTime)(16)),[_.textSelection$]),y=(0,l.useDependency)(t.IPermissionService),b=(0,f.useMemo)(()=>(0,u.merge)(v,y.permissionPointUpdate$),[y.permissionPointUpdate$,v]),x=(0,l.useObservable)(()=>b.pipe((0,u.map)(()=>j(r))),j(r),!1,[b,r]),S=(0,l.useDependency)(t.ICommandService),C=(0,l.useDependency)(c.ThreadCommentModel);(0,l.useObservable)(C.commentUpdate$);let T=(0,l.useDependency)(w),E=(0,l.useObservable)(T.addingComment$),O=(0,l.useDependency)(t.UserManagerService),k=(d==null?void 0:d.anchor.kind)===c.ThreadCommentAnchorKind.DOC_DRAWING&&d.unitId===(o==null?void 0:o.getUnitId())?{id:``,threadId:``,unitId:d.unitId,subUnitId:d.subUnitId,ref:(0,c.serializeThreadCommentAnchor)(d.anchor),dT:``,personId:O.getCurrentUser().userID,text:{dataStream:`\r
3
+ `}}:null,A=k??E,M=new Set(Object.keys((o==null?void 0:o.getSnapshot().drawings)??{})),N=e=>{let t=(0,c.deserializeThreadCommentAnchor)(e.ref);return(t==null?void 0:t.kind)===c.ThreadCommentAnchorKind.DOC_DRAWING||e.ref.startsWith(`#`)&&M.has(e.ref.slice(1))},P=o?C.getUnit(o.getUnitId()).filter(e=>N(e.root)).map(e=>e.root.id):[],[F,I]=(0,f.useState)([]);if((0,f.useEffect)(()=>{let e=new Set,t=o==null?void 0:o.getCustomDecorations();I((t==null?void 0:t.map(e=>e.id).filter(t=>{let n=e.has(t);return e.add(t),!n}))??[]);let r=S.onCommandExecuted(e=>{if(e.id===n.RichTextEditingMutation.id){let e=new Set,t=o==null?void 0:o.getCustomDecorations();I((t==null?void 0:t.map(e=>e.id).filter(t=>{let n=e.has(t);return e.add(t),!n}))??[])}});return()=>{r.dispose()}},[S,o]),!o)return null;let L=o.getUnitId();return(0,p.jsx)(i.ThreadCommentPanel,{unitId:L,subUnitId$:g,type:t.UniverInstanceType.UNIVER_DOC,onAdd:()=>{S.executeCommand(D.id)},getSubUnitName:()=>``,disableAdd:x,tempComment:A,onAddComment:async e=>{if(k&&!e.parentId)return!0;if(!e.parentId){let t={unitId:L,range:E,comment:e};if(!await S.executeCommand(m.id,t))throw Error(`Failed to add document comment.`);return T.endAdd(),!1}return!0},onAfterDeleteComment:async e=>{if(!e.parentId){if(N(e))return;let t={unitId:L,commentId:e.id};await S.executeCommand(h.id,t)}},showComments:[...F,...P],onTempCommentClose:()=>s.cancel(),formatRef:e=>{let t=(0,c.deserializeThreadCommentAnchor)(e.ref);return(t==null?void 0:t.kind)===c.ThreadCommentAnchorKind.DOC_DRAWING?`#${t.elementId}`:e.ref}})},J=class extends t.Disposable{constructor(e,t){super(),this._componentManager=e,this._iconManager=t,this._registerComponents(),this._registerIcons()}_registerComponents(){[[g,re]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}_registerIcons(){this.disposeWithMe(this._iconManager.register({CommentIcon:K,InsertCommentDoubleIcon:q}))}};J=C([S(0,(0,t.Inject)(l.ComponentManager)),S(1,(0,t.Inject)(l.IconManager))],J);let Y=class extends t.Disposable{constructor(e,t,n,r,i,a){super(),this._threadCommentPanelService=e,this._univerInstanceService=t,this._commandService=n,this._docThreadCommentService=r,this._renderManagerService=i,this._threadCommentModel=a,this._initSelectionChange(),this._initActiveCommandChange()}_initSelectionChange(){let e;this.disposeWithMe(this._commandService.onCommandExecuted(a=>{if(a.id===n.SetTextSelectionsOperation.id){let{unitId:n,ranges:o}=a.params;if((0,t.isInternalEditorID)(n))return;let s=this._univerInstanceService.getUnit(n,t.UniverInstanceType.UNIVER_DOC),c=o[0];if((e==null?void 0:e.startOffset)===(c==null?void 0:c.startOffset)&&(e==null?void 0:e.endOffset)===(c==null?void 0:c.endOffset))return;if(e=c,c&&s){let{startOffset:e,endOffset:t,collapsed:i}=c,a=i?e:t-1,o=this._findActiveCommentDecoration(s,n,e,a);if(o){this._commandService.executeCommand(T.id,{activeComment:{unitId:n,subUnitId:r.DEFAULT_DOC_SUBUNIT_ID,commentId:o.id}});return}}if(!this._threadCommentPanelService.activeCommentId)return;let l=this._docThreadCommentService.addingComment,u=this._threadCommentPanelService.activeCommentId;if(l&&(u==null?void 0:u.unitId)===l.unitId&&(u==null?void 0:u.subUnitId)===r.DEFAULT_DOC_SUBUNIT_ID&&(u==null?void 0:u.commentId)===l.id)return;this._commandService.executeCommand(i.SetActiveCommentOperation.id)}}))}_findActiveCommentDecoration(e,n,i,a){var o;return[...((o=e.getBody())==null?void 0:o.customDecorations)??[]].reverse().filter(e=>e.type===t.CustomDecorationType.COMMENT&&e.startIndex<=i&&e.endIndex>=a).sort((e,t)=>e.endIndex-e.startIndex-(t.endIndex-t.startIndex)).find(e=>{let t=this._threadCommentModel.getComment(n,r.DEFAULT_DOC_SUBUNIT_ID,e.id);return t&&!t.resolved})}_initActiveCommandChange(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var t;if(e){let t=this._univerInstanceService.getUnit(e.unitId);if(t){var n,r;let i=(n=this._renderManagerService.getRenderUnitById(e.unitId))==null?void 0:n.with(a.DocBackScrollRenderController),o=(r=t.getBody())==null||(r=r.customDecorations)==null?void 0:r.find(t=>t.id===e.commentId);o&&i&&i.scrollToRange({startOffset:o.startIndex,endOffset:o.endIndex,collapsed:!1})}}(!e||e.commentId!==((t=this._docThreadCommentService.addingComment)==null?void 0:t.id))&&this._docThreadCommentService.endAdd()}))}};Y=C([S(0,(0,t.Inject)(i.ThreadCommentPanelService)),S(1,t.IUniverInstanceService),S(2,t.ICommandService),S(3,(0,t.Inject)(w)),S(4,s.IRenderManagerService),S(5,(0,t.Inject)(c.ThreadCommentModel))],Y);let X=class extends t.Disposable{constructor(e,t,n,r,a,o,s,c){super(),this._context=e,this._docInterceptorService=t,this._threadCommentPanelService=n,this._univerInstanceService=r,this._threadCommentModel=a,this._commandService=o,this._drawingManagerService=s,this._themeService=c,x(this,`_drawingOverlay`,void 0),x(this,`_drawingCommentSubUnits`,new Map),this._drawingOverlay=new i.ThreadCommentCanvasOverlay(`doc-thread-comment-drawing-overlay`,{...this._getDrawingOverlayColors(),zoomRatio:1,markers:[],underlines:[]}),this._context.scene.addObject(this._drawingOverlay,10100),this._interceptorViewModel(),this._initReRender(),this._initSyncComments(),this._initDrawingOverlay()}_initReRender(){[this._threadCommentPanelService.activeCommentId$,this._threadCommentPanelService.hoveredCommentId$].forEach(e=>this.disposeWithMe(e.pipe((0,u.skip)(1),(0,u.startWith)(void 0),(0,u.pairwise)()).subscribe(([e,n])=>{var r;let i=(r=this._univerInstanceService.getCurrentUnitOfType(t.UniverInstanceType.UNIVER_DOC))==null?void 0:r.getUnitId();if(new Set([e==null?void 0:e.unitId,n==null?void 0:n.unitId,i]).has(this._context.unitId)){var a;(a=this._context.mainComponent)==null||a.makeDirty(!0)}}))),this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe(e=>{if(e.type===`resolve`&&e.unitId===this._context.unitId){var t;(t=this._context.mainComponent)==null||t.makeDirty(!0)}e.unitId===this._context.unitId&&this._syncDrawingOverlay()}))}_initDrawingOverlay(){this.disposeWithMe((0,t.toDisposable)(this._drawingOverlay.onPointerDown$.subscribeEvent((e,t)=>{let n=this._drawingOverlay.hitCommentId,r=n&&this._drawingCommentSubUnits.get(n);n&&r&&(t.stopPropagation(),this._commandService.executeCommand(T.id,{activeComment:{unitId:this._context.unitId,subUnitId:r,commentId:n,trigger:`doc-canvas`}}))}))),this.disposeWithMe((0,t.toDisposable)(this._context.engine.onTransformChange$.subscribeEvent(()=>this._syncDrawingOverlay()))),[this._threadCommentPanelService.activeCommentId$,this._threadCommentPanelService.hoveredCommentId$].forEach(e=>this.disposeWithMe(e.subscribe(()=>this._syncDrawingOverlay()))),[this._drawingManagerService.add$,this._drawingManagerService.update$,this._drawingManagerService.remove$].forEach(e=>this.disposeWithMe(e.subscribe(e=>{e.some(e=>e.unitId===this._context.unitId)&&this._syncDrawingOverlay()}))),this.disposeWithMe(this._themeService.currentTheme$.subscribe(()=>this._syncDrawingOverlay())),this._syncDrawingOverlay()}_syncDrawingOverlay(){let e=new Map;this._drawingCommentSubUnits.clear(),this._threadCommentModel.query({unitIds:[this._context.unitId],anchorKinds:[c.ThreadCommentAnchorKind.DOC_DRAWING],resolved:!1}).forEach(({root:t,subUnitId:n})=>{let r=(0,c.deserializeThreadCommentAnchor)(t.ref);if((r==null?void 0:r.kind)!==c.ThreadCommentAnchorKind.DOC_DRAWING)return;let i=this._getDrawingOutline(r.pageId??n,r.elementId);i&&(this._drawingCommentSubUnits.set(t.id,n),e.set(`${r.pageId??n}\0${r.elementId}`,{commentId:t.id,left:i.left,top:i.top+i.height+2,width:i.width}))});let t=[],n=new Map;[this._threadCommentPanelService.activeCommentId,this._threadCommentPanelService.hoveredCommentId].forEach(e=>{if(!e||e.unitId!==this._context.unitId)return;let r=this._threadCommentModel.getComment(e.unitId,e.subUnitId,e.commentId),i=r&&(0,c.deserializeThreadCommentAnchor)(r.ref);if((i==null?void 0:i.kind)!==c.ThreadCommentAnchorKind.DOC_DRAWING)return;t.push(e.commentId);let a=this._getDrawingOutline(i.pageId??e.subUnitId,i.elementId);a&&n.set(`${i.pageId??e.subUnitId}\0${i.elementId}`,a)}),this._drawingOverlay.updateState({...this._getDrawingOverlayColors(),markers:[],underlines:Array.from(e.values()),focusedCommentIds:t,focusOutlines:Array.from(n.values())})}_getDrawingOutline(e,t){var n,r;let i=(0,o.getDrawingShapeKeyByDrawingSearch)({unitId:this._context.unitId,subUnitId:e,drawingId:t}),a=((n=(r=this._context.scene).getObjectIncludeInGroup)==null?void 0:n.call(r,i))??this._context.scene.getObject(i);if(!a)return null;let s=a.getRealBound();return{left:s.left,top:s.top,width:s.width,height:s.height}}_getDrawingOverlayColors(){return{accentColor:this._themeService.getColorFromTheme(`yellow.400`),foregroundColor:this._themeService.getColorFromTheme(`gray.900`),outlineColor:this._themeService.getColorFromTheme(`white`)}}_interceptorViewModel(){this._docInterceptorService.intercept(n.DOC_INTERCEPTOR_POINT.CUSTOM_DECORATION,{handler:(e,t,n)=>{if(!e)return n(e);let{unitId:i}=t,a=[this._threadCommentPanelService.activeCommentId,this._threadCommentPanelService.hoveredCommentId],o=this._threadCommentModel.getComment(i,r.DEFAULT_DOC_SUBUNIT_ID,e.id);if(!o)return n({...e,show:!1});let s=a.some(t=>(t==null?void 0:t.unitId)===i&&t.subUnitId===r.DEFAULT_DOC_SUBUNIT_ID&&t.commentId===e.id);return n({...e,active:s,show:!o.resolved})}})}_initSyncComments(){var e;let i=this._context.unit.getUnitId(),a=r.DEFAULT_DOC_SUBUNIT_ID,o=((e=this._context.unit.getBody())==null||(e=e.customDecorations)==null?void 0:e.filter(e=>e.type===t.CustomDecorationType.COMMENT).map(e=>e.id))??[];o.length&&this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(),r.DEFAULT_DOC_SUBUNIT_ID,o);let s=o.sort();this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===n.RichTextEditingMutation.id){var r;if(e.params.unitId!==this._context.unit.getUnitId())return;let n=((r=this._context.unit.getBody())==null||(r=r.customDecorations)==null?void 0:r.filter(e=>e.type===t.CustomDecorationType.COMMENT).map(e=>e.id))??[],o=n.sort();if(JSON.stringify(s)!==JSON.stringify(o)){let e=new Set(s),t=new Set;n.forEach(n=>{e.has(n)||t.add(n)}),s=o,this._threadCommentModel.syncThreadComments(i,a,[...t])}}}))}};X=C([S(1,(0,t.Inject)(n.DocInterceptorService)),S(2,(0,t.Inject)(i.ThreadCommentPanelService)),S(3,t.IUniverInstanceService),S(4,(0,t.Inject)(c.ThreadCommentModel)),S(5,t.ICommandService),S(6,o.IDrawingManagerService),S(7,(0,t.Inject)(t.ThemeService))],X);let Z=class extends t.Disposable{constructor(e,t){super(),this._commandService=e,this._menuManagerService=t,this._initCommands(),this._initMenus()}_initCommands(){[O,m,h,T,D,E].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.appendRootMenu({[a.FLOAT_TOOLBAR_MENU_POSITION]:{}}),this._menuManagerService.mergeMenu(P)}};Z=C([S(0,t.ICommandService),S(1,l.IMenuManagerService)],Z);let Q=class extends t.Plugin{constructor(e=R,n,r,i){super(),this._config=e,this._injector=n,this._renderManagerSrv=r,this._configService=i;let{menu:a,...o}=(0,t.merge)({},R,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(L,o)}onStarting(){[[J],[Z],[Y],[w]].forEach(e=>{this._injector.add(e)}),this._injector.get(J)}onRendered(){this._initRenderModule(),this._injector.get(Y),this._injector.get(Z)}_initRenderModule(){this._renderManagerSrv.registerRenderModule(t.UniverInstanceType.UNIVER_DOC,[X])}};x(Q,`pluginName`,_),x(Q,`packageName`,F),x(Q,`version`,I),x(Q,`type`,t.UniverInstanceType.UNIVER_DOC),Q=C([(0,t.DependentOn)(n.UniverDocsPlugin,r.UniverDocsThreadCommentPlugin,c.UniverThreadCommentPlugin,o.UniverDrawingPlugin,s.UniverRenderEnginePlugin,a.UniverDocsMobileUIPlugin,i.UniverThreadCommentMobileUIPlugin),S(1,(0,t.Inject)(t.Injector)),S(2,s.IRenderManagerService),S(3,t.IConfigService)],Q);let ie=[[Z],[Y],[w]],$=class extends t.Plugin{constructor(e=R,n,r,i){super(),this._config=e,this._injector=n,this._renderManagerSrv=r,this._configService=i;let{menu:a,...o}=(0,t.merge)({},R,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(L,o)}onStarting(){this._injector.add([J]),this._injector.get(J),ie.forEach(e=>{this._injector.add(e)})}onRendered(){this._initRenderModule(),this._injector.get(Y),this._injector.get(Z)}_initRenderModule(){this._renderManagerSrv.registerRenderModule(t.UniverInstanceType.UNIVER_DOC,[X])}};x($,`pluginName`,_),x($,`packageName`,F),x($,`version`,I),x($,`type`,t.UniverInstanceType.UNIVER_DOC),$=C([(0,t.DependentOn)(n.UniverDocsPlugin,r.UniverDocsThreadCommentPlugin,c.UniverThreadCommentPlugin,o.UniverDrawingPlugin,s.UniverRenderEnginePlugin,a.UniverDocsUIPlugin,i.UniverThreadCommentUIPlugin),S(1,(0,t.Inject)(t.Injector)),S(2,s.IRenderManagerService),S(3,t.IConfigService)],$),e.AddDocCommentComment=m,e.DeleteDocCommentComment=h,e.DocsThreadCommentUIMenuSchema=P,e.ShowCommentPanelOperation=T,e.StartAddCommentOperation=D,Object.defineProperty(e,"UniverDocsThreadCommentMobileUIPlugin",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(e,"UniverDocsThreadCommentUIPlugin",{enumerable:!0,get:function(){return $}})});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiArSA=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`إدارة التعليقات`,addComment:`إضافة تعليق`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiArSA=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`إدارة التعليقات`,addComment:`إضافة تعليق`,openComments:`فتح التعليقات`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiCaES=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Gestió de comentaris`,addComment:`Afegeix un comentari`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiCaES=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Gestió de comentaris`,addComment:`Afegeix un comentari`,openComments:`Obre els comentaris`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiDeDE=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Kommentarverwaltung`,addComment:`Kommentar hinzufügen`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiDeDE=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Kommentarverwaltung`,addComment:`Kommentar hinzufügen`,openComments:`Kommentare öffnen`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiEnUS=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Comment Management`,addComment:`Add Comment`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiEnUS=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Comment Management`,addComment:`Add Comment`,openComments:`Comments`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiEsES=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Gestión de comentarios`,addComment:`Añadir comentario`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiEsES=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Gestión de comentarios`,addComment:`Añadir comentario`,openComments:`Abrir comentarios`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiFaIR=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`مدیریت نظرات`,addComment:`افزودن نظر`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiFaIR=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`مدیریت نظرات`,addComment:`افزودن نظر`,openComments:`باز کردن نظرات`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiFrFR=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Gestion des commentaires`,addComment:`Ajouter un commentaire`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiFrFR=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Gestion des commentaires`,addComment:`Ajouter un commentaire`,openComments:`Ouvrir les commentaires`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiIdID=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Manajemen Komentar`,addComment:`Tambah Komentar`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiIdID=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Manajemen Komentar`,addComment:`Tambah Komentar`,openComments:`Buka Komentar`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiItIT=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Gestione Commenti`,addComment:`Aggiungi Commento`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiItIT=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`Gestione Commenti`,addComment:`Aggiungi Commento`,openComments:`Apri commenti`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiJaJP=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`コメント管理`,addComment:`コメントを追加`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiJaJP=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`コメント管理`,addComment:`コメントを追加`,openComments:`コメントを開く`}}}});
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiKoKR=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`댓글 관리`,addComment:`댓글 추가`}}}});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverDocsThreadCommentUiKoKR=t())})(this,function(){return{"docs-thread-comment-ui":{panel:{title:`댓글 관리`,addComment:`댓글 추가`,openComments:`댓글 열기`}}}});