@ones-editor/editor 2.8.25-beta.1 → 2.8.25-beta.11

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,5 @@
1
1
  import { OnesEditor } from '../../../../@ones-editor/core';
2
+ import CommentsList, { MobileCommentsList, MiniCommentsList } from '../comments-list';
2
3
  import { CommentRoot, OnesEditorCommentsProvider } from '../types';
3
4
  export default class OnesEditorComments {
4
5
  private editor;
@@ -9,6 +10,9 @@ export default class OnesEditorComments {
9
10
  constructor(editor: OnesEditor, provider: OnesEditorCommentsProvider);
10
11
  get commentProvider(): OnesEditorCommentsProvider;
11
12
  get isMobile(): boolean;
13
+ getCommentList(): CommentsList | null;
14
+ getMobileCommentList(): MobileCommentsList | null;
15
+ getMiniCommentList(): MiniCommentsList;
12
16
  destroy(): void;
13
17
  private showComment;
14
18
  showCommentList: (groupId?: string) => void;
@@ -1,4 +1,4 @@
1
- import { DocObject, OnesEditor, OnesEditorComment, OnesEditorDocRange, SelectionRange } from '../../../../@ones-editor/core';
1
+ import { DocCommentResolver, DocObject, OnesEditor, OnesEditorComment, OnesEditorDocRange, SelectionRange } from '../../../../@ones-editor/core';
2
2
  export interface AddCommentToOldVersionBody {
3
3
  avatarUrl: string;
4
4
  containerId: string;
@@ -14,4 +14,4 @@ export declare function addCommentToOldVersion(editor: OnesEditor, version: numb
14
14
  export declare function replyCommentToOldVersion(editor: OnesEditor, version: number, comment: OnesEditorComment, commentDoc: DocObject): Promise<unknown>;
15
15
  export declare function updateCommentToOldDoc(editor: OnesEditor, version: number, commentId: string, commentDoc: DocObject): Promise<unknown>;
16
16
  export declare function deleteCommentFromOldDoc(editor: OnesEditor, version: number, commentId: string): Promise<unknown>;
17
- export declare function updateCommentResolvedToOldDoc(editor: OnesEditor, version: number, commentId: string, resolved: boolean): Promise<unknown>;
17
+ export declare function updateCommentResolverToOldDoc(editor: OnesEditor, version: number, commentId: string, resolver?: DocCommentResolver): Promise<unknown>;
@@ -15,6 +15,7 @@ export default class CommentsList extends TypedEmitter<CommentsListEvents> imple
15
15
  private listType;
16
16
  private switcherItem;
17
17
  private switcherBar;
18
+ private noResolvedCommentTip;
18
19
  constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider);
19
20
  private get commentOptions();
20
21
  destroy(): void;
@@ -24,11 +25,13 @@ export default class CommentsList extends TypedEmitter<CommentsListEvents> imple
24
25
  onUpdateCommentResolver(commentId: string, local: boolean): void;
25
26
  createList(): CommentGroupList;
26
27
  createSwitcher(): FixedToolbar;
28
+ setSwitcherParent(parent: HTMLElement): void;
27
29
  isEditing(includeEmpty?: boolean): boolean;
28
30
  setFirstEditingCommentActive(): void;
29
31
  handleSwitchType: (bar: unknown, item: CommandItem) => void;
30
32
  handleSelectionOnComment: () => void;
31
33
  updateCommentCount: () => void;
34
+ updateNoResolvedCommentTip(): void;
32
35
  handleActiveItemChanged: (index: number, direction?: 'prev' | 'next') => void;
33
36
  handleItemLayoutUpdated: () => void;
34
37
  show(groupId?: string): void;
@@ -36,6 +36,7 @@ export declare class CommentGroupItem extends TypedEmitter<CommentGroupItemEvent
36
36
  deleteMainComment(commentId: OnesEditorComment['id']): void;
37
37
  handleReadonlyChanged: (editor: OnesEditor) => void;
38
38
  edit(): void;
39
+ setCreatingComment(creating: boolean): void;
39
40
  getCommentEditor: () => import("../comment-editor").CommentEditor;
40
41
  destroy(): void;
41
42
  private handleResize;
@@ -35,6 +35,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
35
35
  findGroupItem: (groupId: string) => CommentGroupItem | undefined;
36
36
  handleCreateComment(comment: OnesEditorComment, local: boolean): void;
37
37
  handleDeleteComment(commentId: string): void;
38
+ handleResolveComment(commentId: string): void;
38
39
  handleUpdateComment(comment: OnesEditorComment): void;
39
40
  handleContainerClick: (event: MouseEvent) => void;
40
41
  handleDocumentClick: (event: MouseEvent) => void;
@@ -18,6 +18,6 @@ export declare class CommentGroupItemHandlers {
18
18
  handleCommentItemEdit: (commentItem: CommentItem) => void;
19
19
  handleCommentItemDelete: (commentItem: CommentItem) => void;
20
20
  handleResolve: (groupItem: CommentGroupItem) => void;
21
- execute: (element: HTMLElement, groupItem: CommentGroupItem, commentId: string | null, itemIndex: number) => void;
21
+ execute: (element: HTMLElement, groupItem: CommentGroupItem, commentId: string | null, itemIndex: number, event: Event) => void;
22
22
  destroy(): void;
23
23
  }
@@ -1,2 +1,5 @@
1
1
  import { DocObject } from '../../../../@ones-editor/core';
2
- export declare function getBlockCommentsFromDoc(doc: DocObject): Map<string, Set<string>>;
2
+ type CommentIds = Set<string>;
3
+ export declare function getBlockCommentsFromDoc(doc: DocObject): Map<string, CommentIds>;
4
+ export declare function getBlocksByCommentId(doc: DocObject, commentId: string): string[];
5
+ export {};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="lodash" />
2
- import { BlockElement, BlockPath, DocBlock, DocBlockTextAttributes, OnesEditor, OnesEditorBlockRenderer, OnesEditorBlockRenderResult } from '../../../../@ones-editor/core';
2
+ import { BlockElement, BlockPath, DocBlock, DocBlockTextAttributes, OnesEditor, OnesEditorBlockRenderer, OnesEditorBlockRenderResult, OnesEditorComment } from '../../../../@ones-editor/core';
3
3
  import { CommentListType } from '../types';
4
4
  export declare class OnesEditorCommentsRender implements OnesEditorBlockRenderer {
5
5
  private type;
@@ -10,6 +10,7 @@ export declare class OnesEditorCommentsRender implements OnesEditorBlockRenderer
10
10
  updateBlock(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock): void;
11
11
  getCommentStatus(editor: OnesEditor, commentId: string): "unknown" | "resolved" | "unresolved";
12
12
  renderCommentElement(editor: OnesEditor, key: string, commentId: string, classes: string[], textAttributes: Record<string, string>): void;
13
+ getComments(editor: OnesEditor): OnesEditorComment[];
13
14
  updateUnknownCommentsDelayed: import("lodash").DebouncedFunc<(editor: OnesEditor) => void>;
14
15
  changeType(editor: OnesEditor, type: CommentListType): void;
15
16
  }
@@ -24,6 +24,7 @@ declare const _default: {
24
24
  currentComment: string;
25
25
  resolvedComment: string;
26
26
  removedFromDoc: string;
27
+ noResolvedComment: string;
27
28
  };
28
29
  };
29
30
  export default _default;
@@ -24,6 +24,7 @@ declare const _default: {
24
24
  currentComment: string;
25
25
  resolvedComment: string;
26
26
  removedFromDoc: string;
27
+ noResolvedComment: string;
27
28
  };
28
29
  };
29
30
  export default _default;
@@ -24,6 +24,7 @@ declare const _default: {
24
24
  currentComment: string;
25
25
  resolvedComment: string;
26
26
  removedFromDoc: string;
27
+ noResolvedComment: string;
27
28
  };
28
29
  };
29
30
  export default _default;
@@ -12,6 +12,7 @@ export type CommentRoot = {
12
12
  container?: HTMLElement;
13
13
  miniContainer?: HTMLElement;
14
14
  mobileContainer?: HTMLElement;
15
+ switchBarContainer?: HTMLElement;
15
16
  };
16
17
  export interface OnesEditorCommentOptions {
17
18
  controller: OnesEditorCommentController;
@@ -253,6 +253,7 @@ export interface OnesEditorDoc extends OnesEditorDocServer {
253
253
  beginBatchUpdate: () => number;
254
254
  endBatchUpdate: () => number;
255
255
  triggerReAuth?: (auto?: boolean) => void;
256
+ rawData?: () => DocObject;
256
257
  }
257
258
  export interface OnesEditorDocHistoryData {
258
259
  user: {
@@ -10,6 +10,7 @@ export declare class LocalDoc extends EventCallbacks<OnesEditorDocCallbacks> imp
10
10
  beginBatchUpdate(): number;
11
11
  endBatchUpdate(): number;
12
12
  toJSON(): DocObject;
13
+ rawData(): DocObject;
13
14
  getContainerBlocks(containerId: string): DocBlock[];
14
15
  findContainerBlocks(containerId: string): DocBlock[];
15
16
  getBlockData(containerId: string, blockIndex: number): DocBlock;