@ones-editor/editor 3.0.16-beta.2 → 3.0.16-beta.5

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.
@@ -1,4 +1,4 @@
1
1
  import { BlockElement, OnesEditor, OnesEditorComment } from '../../../../@ones-editor/core';
2
2
  import { OnesEditorCommentsProvider } from '../types';
3
3
  export declare function updateCommentToBlock(editor: OnesEditor, block: BlockElement, comment: OnesEditorComment): void;
4
- export declare function addCommentToBlock(editor: OnesEditor, block: BlockElement, provider: OnesEditorCommentsProvider): OnesEditorComment;
4
+ export declare function addCommentToBlock(editor: OnesEditor, block: BlockElement, provider: OnesEditorCommentsProvider): OnesEditorComment | undefined;
@@ -1,4 +1,4 @@
1
1
  import { OnesEditor, OnesEditorComment, SelectedBlock, SelectionRange } from '../../../../@ones-editor/core';
2
2
  import { OnesEditorCommentsProvider } from '../types';
3
3
  export declare function addCommentToSelectedTextBlock(editor: OnesEditor, selectedBlock: SelectedBlock, comment: OnesEditorComment): void;
4
- export declare function addCommentToTextBlocks(editor: OnesEditor, range: SelectionRange, provider: OnesEditorCommentsProvider): OnesEditorComment;
4
+ export declare function addCommentToTextBlocks(editor: OnesEditor, range: SelectionRange, provider: OnesEditorCommentsProvider): OnesEditorComment | undefined;
@@ -9,6 +9,7 @@ export interface AddCommentToOldVersionBody {
9
9
  commentGroupId?: string;
10
10
  comment: DocObject;
11
11
  abstract?: string;
12
+ silent?: boolean;
12
13
  }
13
14
  export declare function addCommentToOldVersion(editor: OnesEditor, version: number, range: SelectionRange, comment: OnesEditorComment, commentDoc: DocObject): Promise<void>;
14
15
  export declare function replyCommentToOldVersion(editor: OnesEditor, version: number, comment: OnesEditorComment, commentDoc: DocObject): Promise<unknown>;
@@ -13,5 +13,6 @@ export { removeCommentFromBlock } from './actions/remove-comment-from-block';
13
13
  export { addCommentToTextBlocks } from './actions/add-comment-to-text-block';
14
14
  export { addCommentToBlock } from './actions/add-comment-to-block';
15
15
  export { editorAddComment } from './actions/editor-add-comment';
16
+ export { canRunCommentAction } from './permission/check-comment-action';
16
17
  export * from './comments-helper/old-version-comment';
17
18
  export * from './resolved-comments';
@@ -0,0 +1,3 @@
1
+ import type { OnesEditor } from '../../../../@ones-editor/core';
2
+ import type { CommentActionType } from '../types';
3
+ export declare function canRunCommentAction(editor: OnesEditor, action: CommentActionType): boolean;
@@ -16,6 +16,8 @@ export type CommentRoot = {
16
16
  };
17
17
  export interface OnesEditorCommentOptions {
18
18
  controller: OnesEditorCommentController;
19
+ beforeCommentAction?: (action: CommentActionType) => boolean;
20
+ oldVersionSilentResolver?: () => boolean;
19
21
  disableReply?: boolean;
20
22
  disableEdit?: boolean;
21
23
  pullThreshold?: number;
@@ -69,4 +71,5 @@ export interface MiniCommentGroup {
69
71
  }
70
72
  export type MiniCommentGroups = MiniCommentGroup[];
71
73
  export type CommentListType = 'current' | 'resolved';
74
+ export type CommentActionType = 'add' | 'reply' | 'update' | 'delete';
72
75
  export {};