@ones-editor/editor 2.8.36 → 2.8.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@ones-editor/comments/src/comments/comments.d.ts +1 -5
- package/@ones-editor/comments/src/comments-helper/active-comment.d.ts +1 -3
- package/@ones-editor/comments/src/comments-helper/get-comment-from-selection.d.ts +0 -3
- package/@ones-editor/comments/src/comments-helper/get-comments-from-doc.d.ts +1 -5
- package/@ones-editor/comments/src/comments-helper/old-version-comment.d.ts +1 -2
- package/@ones-editor/comments/src/comments-list/comments-list.d.ts +2 -14
- package/@ones-editor/comments/src/comments-list/group-item.d.ts +0 -2
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +2 -8
- package/@ones-editor/comments/src/comments-list/handler.d.ts +1 -2
- package/@ones-editor/comments/src/comments-list/mini-comment/group-list.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +0 -1
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/mobile-comments-list.d.ts +0 -1
- package/@ones-editor/comments/src/comments-render/index.d.ts +1 -10
- package/@ones-editor/comments/src/constant/index.d.ts +1 -2
- package/@ones-editor/comments/src/index.d.ts +0 -1
- package/@ones-editor/comments/src/locale/en-us.d.ts +0 -9
- package/@ones-editor/comments/src/locale/ja-jp.d.ts +0 -9
- package/@ones-editor/comments/src/locale/zh-cn.d.ts +0 -9
- package/@ones-editor/comments/src/types.d.ts +1 -7
- package/@ones-editor/core/src/core/block-renderers/block-renderers.d.ts +0 -1
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +0 -2
- package/@ones-editor/core/src/core/doc/doc.d.ts +0 -9
- package/@ones-editor/core/src/core/types.d.ts +0 -3
- package/@ones-editor/core/src/local-doc/index.d.ts +0 -1
- package/@ones-editor/scroll-container/src/scroll-bar-handle.d.ts +1 -4
- package/@ones-editor/sharedb-doc/src/doc/comments.d.ts +1 -2
- package/@ones-editor/sharedb-doc/src/doc/op-parser/parse-handler.d.ts +1 -2
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +1 -3
- package/@ones-editor/sharedb-doc/src/types.d.ts +0 -1
- package/@ones-editor/to-docx/src/index.d.ts +1 -0
- package/@ones-editor/to-docx/src/locale/en-us.d.ts +7 -0
- package/@ones-editor/to-docx/src/locale/index.d.ts +1 -0
- package/@ones-editor/to-docx/src/locale/ja-jp.d.ts +7 -0
- package/@ones-editor/to-docx/src/locale/zh-cn.d.ts +7 -0
- package/@ones-editor/to-docx/src/locale/zh-hant-hk.d.ts +7 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/readonly-toolbar/add-comment-to-old-doc.d.ts +0 -1
- package/@ones-editor/ui-base/src/icons/index.d.ts +1 -2
- package/@ones-editor/versions/src/version-dialog/history-handler.d.ts +0 -1
- package/dist/comments/local-doc-comments-provider.d.ts +1 -2
- package/dist/comments/sharedb-doc-comments-provider.d.ts +1 -3
- package/dist/index.d.ts +0 -2
- package/dist/index.js +479 -1267
- package/dist/types.d.ts +0 -2
- package/package.json +1 -1
- package/@ones-editor/comments/src/comments-render/get-block-comments.d.ts +0 -5
- package/@ones-editor/comments/src/resolved-comments/index.d.ts +0 -4
- package/@ones-editor/comments/src/resolved-comments/resolved-comment-editor.d.ts +0 -14
- package/@ones-editor/comments/src/resolved-comments/resolved-comment-list.d.ts +0 -4
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
import CommentsList, { MobileCommentsList, MiniCommentsList } from '../comments-list';
|
|
3
2
|
import { CommentRoot, OnesEditorCommentsProvider } from '../types';
|
|
4
3
|
export default class OnesEditorComments {
|
|
5
4
|
private editor;
|
|
@@ -10,12 +9,9 @@ export default class OnesEditorComments {
|
|
|
10
9
|
constructor(editor: OnesEditor, provider: OnesEditorCommentsProvider);
|
|
11
10
|
get commentProvider(): OnesEditorCommentsProvider;
|
|
12
11
|
get isMobile(): boolean;
|
|
13
|
-
getCommentList(): CommentsList | null;
|
|
14
|
-
getMobileCommentList(): MobileCommentsList | null;
|
|
15
|
-
getMiniCommentList(): MiniCommentsList;
|
|
16
12
|
destroy(): void;
|
|
17
13
|
private showComment;
|
|
18
|
-
showCommentList: (groupId?: string
|
|
14
|
+
showCommentList: (groupId?: string) => void;
|
|
19
15
|
setFirstEditingCommentActive(): void;
|
|
20
16
|
isEditing(includeEmpty?: boolean): boolean;
|
|
21
17
|
mount(containers: CommentRoot): void;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { OnesEditor
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare function activeComment(editor: OnesEditor, commentId: string, direction?: 'prev' | 'next'): void;
|
|
3
|
-
export declare function getElementsByCommentId(editor: OnesEditor, commentId: string): HTMLElement[];
|
|
4
|
-
export declare function getBlockByComments(editor: OnesEditor, commentId: string): BlockElement[];
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
import { OnesEditorCommentsProvider } from '../types';
|
|
3
2
|
export declare function getCommentsFromSelection(editor: OnesEditor): string[];
|
|
4
|
-
export declare function removeUnresolvedComments(commentProvider: OnesEditorCommentsProvider, commentIds: string[]): string[];
|
|
5
|
-
export declare function removeResolvedComments(commentProvider: OnesEditorCommentsProvider, commentIds: string[]): string[];
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnesEditor, OnesEditorComment } from '../../../../@ones-editor/core';
|
|
2
2
|
import { CommentWithChildren, OnesEditorCommentsProvider } from '../types';
|
|
3
|
-
export declare function getCommentsFromDoc(doc: DocObject): Map<string, number>;
|
|
4
|
-
export declare function getCommentsGroup(comments: OnesEditorComment[]): CommentWithChildren[];
|
|
5
3
|
export declare function getCommentsGroupFromDoc(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider): CommentWithChildren[];
|
|
6
|
-
export declare function getUnresolvedCommentsGroupFromDoc(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider): CommentWithChildren[];
|
|
7
|
-
export declare function getResolvedCommentsGroupFromDoc(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider): CommentWithChildren[];
|
|
8
4
|
export declare function flattenCommentGroup(comment: CommentWithChildren): OnesEditorComment[];
|
|
9
5
|
export declare function getCommentsCountInDoc(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider): number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { 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,3 @@ 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 updateCommentResolverToOldDoc(editor: OnesEditor, version: number, commentId: string, resolver?: DocCommentResolver): Promise<unknown>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { OnesEditor
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
|
-
import {
|
|
4
|
-
import { OnesEditorCommentsEvents, OnesEditorCommentsProvider, CommentListType } from '../types';
|
|
3
|
+
import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../types';
|
|
5
4
|
import CommentGroupList from './group-list';
|
|
6
5
|
interface CommentsListEvents {
|
|
7
6
|
onSelectComment: () => void;
|
|
@@ -12,28 +11,17 @@ export default class CommentsList extends TypedEmitter<CommentsListEvents> imple
|
|
|
12
11
|
root: HTMLElement;
|
|
13
12
|
private groupsContainer;
|
|
14
13
|
private list;
|
|
15
|
-
private listType;
|
|
16
|
-
private switcherItem;
|
|
17
|
-
private switcherBar;
|
|
18
|
-
private noCommentTip;
|
|
19
14
|
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider);
|
|
20
15
|
private get commentOptions();
|
|
21
16
|
destroy(): void;
|
|
22
17
|
onCreateComment(commentId: string, local: boolean): void;
|
|
23
18
|
onDeleteComment(commentId: string, local: boolean): void;
|
|
24
19
|
onUpdateComment(commentId: string, local: boolean): void;
|
|
25
|
-
onUpdateCommentResolver(commentId: string, local: boolean): void;
|
|
26
20
|
createList(): CommentGroupList;
|
|
27
|
-
createSwitcher(): FixedToolbar;
|
|
28
|
-
setSwitcherParent(parent: HTMLElement): void;
|
|
29
21
|
isEditing(includeEmpty?: boolean): boolean;
|
|
30
22
|
setFirstEditingCommentActive(): void;
|
|
31
|
-
handleSwitchType: (bar: unknown, item: CommandItem) => void;
|
|
32
|
-
getListType(): CommentListType;
|
|
33
|
-
setListType(type: CommentListType): void;
|
|
34
23
|
handleSelectionOnComment: () => void;
|
|
35
24
|
updateCommentCount: () => void;
|
|
36
|
-
updateCommentCountTip(): void;
|
|
37
25
|
handleActiveItemChanged: (index: number, direction?: 'prev' | 'next') => void;
|
|
38
26
|
handleItemLayoutUpdated: () => void;
|
|
39
27
|
show(groupId?: string): void;
|
|
@@ -22,7 +22,6 @@ export declare class CommentGroupItem extends TypedEmitter<CommentGroupItemEvent
|
|
|
22
22
|
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, comment: CommentWithChildren, groupList: CommentGroupList);
|
|
23
23
|
get commentCount(): number;
|
|
24
24
|
private createRoot;
|
|
25
|
-
private createFooter;
|
|
26
25
|
private createQuickReply;
|
|
27
26
|
private createHeader;
|
|
28
27
|
private createItem;
|
|
@@ -36,7 +35,6 @@ export declare class CommentGroupItem extends TypedEmitter<CommentGroupItemEvent
|
|
|
36
35
|
deleteMainComment(commentId: OnesEditorComment['id']): void;
|
|
37
36
|
handleReadonlyChanged: (editor: OnesEditor) => void;
|
|
38
37
|
edit(): void;
|
|
39
|
-
setCreatingComment(creating: boolean): void;
|
|
40
38
|
getCommentEditor: () => import("../comment-editor").CommentEditor;
|
|
41
39
|
destroy(): void;
|
|
42
40
|
private handleResize;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
2
|
import { OnesEditor, OnesEditorComment } from '../../../../@ones-editor/core';
|
|
3
|
-
import {
|
|
3
|
+
import { CommentWithChildren, OnesEditorCommentsProvider } from '../types';
|
|
4
4
|
import { CommentGroupItem } from './group-item';
|
|
5
5
|
import ListBase from './list-base';
|
|
6
6
|
import { CommentGroupItemHandlers } from './handler';
|
|
@@ -11,10 +11,8 @@ export interface CommentGroupListEvents {
|
|
|
11
11
|
commentCountChanged: () => void;
|
|
12
12
|
}
|
|
13
13
|
export default class CommentGroupList extends ListBase<CommentWithChildren, CommentGroupItem, unknown, CommentGroupListEvents> {
|
|
14
|
-
editor: OnesEditor;
|
|
15
|
-
private type;
|
|
16
14
|
groupItemHandlers: CommentGroupItemHandlers;
|
|
17
|
-
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement
|
|
15
|
+
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
|
|
18
16
|
destroy(): void;
|
|
19
17
|
dispatchScroll: import("lodash").DebouncedFunc<() => void>;
|
|
20
18
|
updateItemsLayout(dispatchScroll?: boolean): void;
|
|
@@ -35,16 +33,12 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
|
|
|
35
33
|
findGroupItem: (groupId: string) => CommentGroupItem | undefined;
|
|
36
34
|
handleCreateComment(comment: OnesEditorComment, local: boolean): void;
|
|
37
35
|
handleDeleteComment(commentId: string): void;
|
|
38
|
-
handleResolveComment(commentId: string): void;
|
|
39
|
-
removeGroupItem(comment: OnesEditorComment): void;
|
|
40
36
|
handleUpdateComment(comment: OnesEditorComment): void;
|
|
41
37
|
handleContainerClick: (event: MouseEvent) => void;
|
|
42
38
|
handleDocumentClick: (event: MouseEvent) => void;
|
|
43
39
|
handleSelectionChanged: () => void;
|
|
44
40
|
handleEditorResize: () => void;
|
|
45
41
|
handleDocChanged: () => void;
|
|
46
|
-
changeType(type: CommentListType): void;
|
|
47
|
-
protected reloadList(data: CommentWithChildren[]): void;
|
|
48
42
|
handleItemResize: () => void;
|
|
49
43
|
handleScroll: (event: WheelEvent) => void;
|
|
50
44
|
updateGroupItemSwitch: () => void;
|
|
@@ -17,7 +17,6 @@ export declare class CommentGroupItemHandlers {
|
|
|
17
17
|
handleCommentItemCancel: (groupItem: CommentGroupItem, commentId: string | null) => void;
|
|
18
18
|
handleCommentItemEdit: (commentItem: CommentItem) => void;
|
|
19
19
|
handleCommentItemDelete: (commentItem: CommentItem) => void;
|
|
20
|
-
|
|
21
|
-
execute: (element: HTMLElement, groupItem: CommentGroupItem, commentId: string | null, itemIndex: number, event: Event) => void;
|
|
20
|
+
execute: (element: HTMLElement, groupItem: CommentGroupItem, commentId: string | null, itemIndex: number) => void;
|
|
22
21
|
destroy(): void;
|
|
23
22
|
}
|
|
@@ -10,7 +10,7 @@ export declare class MiniGroupList extends ListBase<MiniCommentGroup, MiniGroupI
|
|
|
10
10
|
protected createItem(data: MiniCommentGroup): MiniGroupItem;
|
|
11
11
|
protected findInsertPos(): number;
|
|
12
12
|
private handleDocChanged;
|
|
13
|
-
updateMiniCommentsGroup
|
|
13
|
+
private updateMiniCommentsGroup;
|
|
14
14
|
handleCreateComment(comment: OnesEditorComment, local: boolean): void;
|
|
15
15
|
handleDeleteComment(commentId: string): void;
|
|
16
16
|
destroy(): void;
|
|
@@ -15,7 +15,6 @@ export declare class MiniCommentsList extends TypedEmitter<MiniCommentsListEvent
|
|
|
15
15
|
onCreateComment(commentId: string, local: boolean): void;
|
|
16
16
|
onDeleteComment(commentId: string, local: boolean): void;
|
|
17
17
|
onUpdateComment(commentId: string, local: boolean): void;
|
|
18
|
-
onUpdateCommentResolver(commentId: string, local: boolean): void;
|
|
19
18
|
private createList;
|
|
20
19
|
private handleListContainerClick;
|
|
21
20
|
show(): void;
|
package/@ones-editor/comments/src/comments-list/mobile-comments-list/mobile-comments-list.d.ts
CHANGED
|
@@ -16,7 +16,6 @@ export declare class MobileCommentsList extends TypedEmitter<MobileCommentsListE
|
|
|
16
16
|
onCreateComment(commentId: string, local: boolean): void;
|
|
17
17
|
onDeleteComment(commentId: string, local: boolean): void;
|
|
18
18
|
onUpdateComment(commentId: string, local: boolean): void;
|
|
19
|
-
onUpdateCommentResolver(commentId: string, local: boolean): void;
|
|
20
19
|
private get commentOptions();
|
|
21
20
|
private handleRootClick;
|
|
22
21
|
private createPullInfo;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { BlockElement, BlockPath, DocBlock, DocBlockTextAttributes, OnesEditor, OnesEditorBlockRenderer, OnesEditorBlockRenderResult, OnesEditorComment } from '../../../../@ones-editor/core';
|
|
3
|
-
import { CommentListType } from '../types';
|
|
1
|
+
import { BlockElement, BlockPath, DocBlock, DocBlockTextAttributes, OnesEditor, OnesEditorBlockRenderer, OnesEditorBlockRenderResult } from '../../../../@ones-editor/core';
|
|
4
2
|
export declare class OnesEditorCommentsRender implements OnesEditorBlockRenderer {
|
|
5
|
-
private type;
|
|
6
|
-
constructor(type?: CommentListType);
|
|
7
3
|
renderText(editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
|
|
8
4
|
renderBox(editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
|
|
9
5
|
renderBlock(editor: OnesEditor, path: BlockPath, blockData: DocBlock): OnesEditorBlockRenderResult;
|
|
10
6
|
updateBlock(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock): void;
|
|
11
|
-
getCommentStatus(editor: OnesEditor, commentId: string): "unknown" | "resolved" | "unresolved";
|
|
12
|
-
renderCommentElement(editor: OnesEditor, key: string, commentId: string, classes: string[], textAttributes: Record<string, string>): void;
|
|
13
|
-
getComments(editor: OnesEditor): OnesEditorComment[];
|
|
14
|
-
updateUnknownCommentsDelayed: import("lodash").DebouncedFunc<(editor: OnesEditor) => void>;
|
|
15
|
-
changeType(editor: OnesEditor, type: CommentListType): void;
|
|
16
7
|
}
|
|
@@ -9,8 +9,7 @@ export declare enum GroupItemActions {
|
|
|
9
9
|
CommentItemEdit = "comment-item-edit",
|
|
10
10
|
QuickReply = "quick-reply",
|
|
11
11
|
QuickReplyOk = "quick-reply-ok",
|
|
12
|
-
QuickReplyCancel = "quick-reply-cancel"
|
|
13
|
-
Resolve = "resolve"
|
|
12
|
+
QuickReplyCancel = "quick-reply-cancel"
|
|
14
13
|
}
|
|
15
14
|
export declare const GROUP_ITEM_ACTION_MARK = "group-item-action";
|
|
16
15
|
export declare const LAST_COMMENT_ITEM_MARK = "last-comment-item";
|
|
@@ -14,4 +14,3 @@ 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
16
|
export * from './comments-helper/old-version-comment';
|
|
17
|
-
export * from './resolved-comments';
|
|
@@ -19,15 +19,6 @@ declare const _default: {
|
|
|
19
19
|
comment: string;
|
|
20
20
|
command: string;
|
|
21
21
|
quickMenuCommand: string;
|
|
22
|
-
resolvedBy: string;
|
|
23
|
-
reopen: string;
|
|
24
|
-
currentComment: string;
|
|
25
|
-
resolvedComment: string;
|
|
26
|
-
removedFromDoc: string;
|
|
27
|
-
noCurrentComment: string;
|
|
28
|
-
noResolvedComment: string;
|
|
29
|
-
resolveComment: string;
|
|
30
|
-
commentHasAlreadyRemoved: string;
|
|
31
22
|
};
|
|
32
23
|
};
|
|
33
24
|
export default _default;
|
|
@@ -19,15 +19,6 @@ declare const _default: {
|
|
|
19
19
|
comment: string;
|
|
20
20
|
command: string;
|
|
21
21
|
quickMenuCommand: string;
|
|
22
|
-
resolvedBy: string;
|
|
23
|
-
reopen: string;
|
|
24
|
-
currentComment: string;
|
|
25
|
-
resolvedComment: string;
|
|
26
|
-
removedFromDoc: string;
|
|
27
|
-
noCurrentComment: string;
|
|
28
|
-
noResolvedComment: string;
|
|
29
|
-
resolveComment: string;
|
|
30
|
-
commentHasAlreadyRemoved: string;
|
|
31
22
|
};
|
|
32
23
|
};
|
|
33
24
|
export default _default;
|
|
@@ -19,15 +19,6 @@ declare const _default: {
|
|
|
19
19
|
comment: string;
|
|
20
20
|
command: string;
|
|
21
21
|
quickMenuCommand: string;
|
|
22
|
-
resolvedBy: string;
|
|
23
|
-
reopen: string;
|
|
24
|
-
currentComment: string;
|
|
25
|
-
resolvedComment: string;
|
|
26
|
-
removedFromDoc: string;
|
|
27
|
-
noCurrentComment: string;
|
|
28
|
-
noResolvedComment: string;
|
|
29
|
-
resolveComment: string;
|
|
30
|
-
commentHasAlreadyRemoved: string;
|
|
31
22
|
};
|
|
32
23
|
};
|
|
33
24
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DocObject, LocalDoc, OnesEditor, OnesEditorComment } from '../../../@ones-editor/core';
|
|
2
2
|
type EditorEvents = {
|
|
3
3
|
onPreviewImage?: (editor: OnesEditor, img: HTMLImageElement) => void;
|
|
4
4
|
};
|
|
@@ -12,7 +12,6 @@ export type CommentRoot = {
|
|
|
12
12
|
container?: HTMLElement;
|
|
13
13
|
miniContainer?: HTMLElement;
|
|
14
14
|
mobileContainer?: HTMLElement;
|
|
15
|
-
switchBarContainer?: HTMLElement;
|
|
16
15
|
};
|
|
17
16
|
export interface OnesEditorCommentOptions {
|
|
18
17
|
controller: OnesEditorCommentController;
|
|
@@ -22,7 +21,6 @@ export interface OnesEditorCommentOptions {
|
|
|
22
21
|
onUpdateLayout?: (editor: OnesEditor, data: CommentData) => void;
|
|
23
22
|
onCommentCountChange?: (count: number) => void;
|
|
24
23
|
onCommentEditorClick?: (editor: OnesEditor, event: MouseEvent) => void;
|
|
25
|
-
onCommentListTypeChange?: (editor: OnesEditor, type: 'current' | 'resolved') => void;
|
|
26
24
|
events?: EditorEvents;
|
|
27
25
|
componentsOptions?: {
|
|
28
26
|
[index: string]: unknown;
|
|
@@ -32,7 +30,6 @@ export interface OnesEditorCommentsEvents {
|
|
|
32
30
|
onCreateComment: (commentId: string, local: boolean) => void;
|
|
33
31
|
onDeleteComment: (commentId: string, local: boolean) => void;
|
|
34
32
|
onUpdateComment: (commentId: string, local: boolean) => void;
|
|
35
|
-
onUpdateCommentResolver: (commentId: string, local: boolean) => void;
|
|
36
33
|
}
|
|
37
34
|
export interface OnesEditorCommentsProvider {
|
|
38
35
|
getComments: () => OnesEditorComment[];
|
|
@@ -41,7 +38,6 @@ export interface OnesEditorCommentsProvider {
|
|
|
41
38
|
localCreateComment: (comment: OnesEditorComment, doc: DocObject) => void;
|
|
42
39
|
localDeleteComment: (commentId: string) => void;
|
|
43
40
|
localUpdateComment: (comment: OnesEditorComment, doc: DocObject) => void;
|
|
44
|
-
localUpdateCommentResolver: (commentId: string, resolver?: DocCommentResolver) => void;
|
|
45
41
|
addListener: (callback: OnesEditorCommentsEvents) => void;
|
|
46
42
|
removeListener: (callback: OnesEditorCommentsEvents) => void;
|
|
47
43
|
createCommentEditor: (parent: HTMLElement, doc: LocalDoc) => OnesEditor;
|
|
@@ -49,7 +45,6 @@ export interface OnesEditorCommentsProvider {
|
|
|
49
45
|
}
|
|
50
46
|
export interface CommentWithChildren extends OnesEditorComment {
|
|
51
47
|
children: OnesEditorComment[];
|
|
52
|
-
removedFromDoc?: boolean;
|
|
53
48
|
}
|
|
54
49
|
export interface ItemBase {
|
|
55
50
|
root: HTMLElement;
|
|
@@ -68,5 +63,4 @@ export interface MiniCommentGroup {
|
|
|
68
63
|
commentIds: CommentIds;
|
|
69
64
|
}
|
|
70
65
|
export type MiniCommentGroups = MiniCommentGroup[];
|
|
71
|
-
export type CommentListType = 'current' | 'resolved';
|
|
72
66
|
export {};
|
|
@@ -4,7 +4,6 @@ export declare class EditorBlockRenderers implements OnesEditorBlockRenderers {
|
|
|
4
4
|
private editor;
|
|
5
5
|
private renders;
|
|
6
6
|
constructor(editor: OnesEditor);
|
|
7
|
-
getRenderers(): OnesEditorBlockRenderer[];
|
|
8
7
|
registerRender(render: OnesEditorBlockRenderer): void;
|
|
9
8
|
renderBox(path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
|
|
10
9
|
renderText(path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { OnesEditorInput, OnesEditor, OnesEditorInputHandler, OnesEditorUndoAction, RemoteChangeType, PasteOptions } from '../types';
|
|
3
2
|
import { DocObject } from '../doc';
|
|
4
3
|
export interface EditorInputCallbacks {
|
|
@@ -25,7 +24,6 @@ export interface EditorInputCallbacks {
|
|
|
25
24
|
export declare class EditorInput implements OnesEditorInput {
|
|
26
25
|
editor: OnesEditor;
|
|
27
26
|
composing: boolean;
|
|
28
|
-
composingTimer: NodeJS.Timeout | undefined;
|
|
29
27
|
callbacks: EditorInputCallbacks;
|
|
30
28
|
inputElement: HTMLTextAreaElement;
|
|
31
29
|
constructor(editor: OnesEditor, callbacks: EditorInputCallbacks);
|
|
@@ -70,11 +70,6 @@ export interface DocInsertion {
|
|
|
70
70
|
[index: string]: string | boolean | number | AttributeMap | undefined;
|
|
71
71
|
attributes?: AttributeMap;
|
|
72
72
|
}
|
|
73
|
-
export interface DocCommentResolver {
|
|
74
|
-
date: number;
|
|
75
|
-
userId: string;
|
|
76
|
-
displayName: string;
|
|
77
|
-
}
|
|
78
73
|
export interface DocComment {
|
|
79
74
|
id: string;
|
|
80
75
|
groupId: string;
|
|
@@ -85,7 +80,6 @@ export interface DocComment {
|
|
|
85
80
|
blocks: DocBlock[];
|
|
86
81
|
created: number;
|
|
87
82
|
modified: number;
|
|
88
|
-
resolver?: DocCommentResolver;
|
|
89
83
|
}
|
|
90
84
|
export type DocBlocks = DocBlock[];
|
|
91
85
|
export type DocMeta = OnesEditorDocServerMeta & {
|
|
@@ -253,7 +247,6 @@ export interface OnesEditorDoc extends OnesEditorDocServer {
|
|
|
253
247
|
beginBatchUpdate: () => number;
|
|
254
248
|
endBatchUpdate: () => number;
|
|
255
249
|
triggerReAuth?: (auto?: boolean) => void;
|
|
256
|
-
rawData?: () => DocObject;
|
|
257
250
|
}
|
|
258
251
|
export interface OnesEditorDocHistoryData {
|
|
259
252
|
user: {
|
|
@@ -272,7 +265,6 @@ export interface OnesEditorHistoryDataParseHandler {
|
|
|
272
265
|
onDeleteComment: (commentId: string, local: boolean) => void;
|
|
273
266
|
onCreateComment: (commentId: string, local: boolean) => void;
|
|
274
267
|
onUpdateComment: (commentId: string, local: boolean) => void;
|
|
275
|
-
onUpdateCommentResolver: (commentId: string, local: boolean) => void;
|
|
276
268
|
}
|
|
277
269
|
export interface OnesEditorDocVersionHelper {
|
|
278
270
|
getVersions: (showPublished?: boolean) => Promise<DocVersion[]>;
|
|
@@ -296,5 +288,4 @@ export interface OnesEditorComment {
|
|
|
296
288
|
abstract: string;
|
|
297
289
|
created: number;
|
|
298
290
|
modified: number;
|
|
299
|
-
resolver?: DocCommentResolver;
|
|
300
291
|
}
|
|
@@ -412,7 +412,6 @@ export interface OnesEditorBlockRenderers {
|
|
|
412
412
|
renderChildContainer: (editor: OnesEditor, path: BlockPath, containerId: string) => OnesEditorBlockRenderResult;
|
|
413
413
|
updateBlock: (editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
414
414
|
registerRender: (decorator: OnesEditorBlockRenderer) => void;
|
|
415
|
-
getRenderers: () => OnesEditorBlockRenderer[];
|
|
416
415
|
}
|
|
417
416
|
export type OnesEditorDocSource = 'text/html' | 'text/office-html' | 'text/plain' | 'text/markdown' | 'image/*' | 'text/x-ones-editor-doc' | '*';
|
|
418
417
|
export type OnesEditorDocs = Partial<Record<OnesEditorDocSource, DocObject>>;
|
|
@@ -461,7 +460,6 @@ export interface OnesEditorOptionalOptions {
|
|
|
461
460
|
colors?: string[];
|
|
462
461
|
scrollContainer?: HTMLElement;
|
|
463
462
|
enableComments?: boolean;
|
|
464
|
-
enableResolveComments?: boolean;
|
|
465
463
|
enableContextMenu?: boolean;
|
|
466
464
|
settingsProvider?: OnesEditorSettingsProvider;
|
|
467
465
|
}
|
|
@@ -471,7 +469,6 @@ export interface OnesEditorOptions {
|
|
|
471
469
|
[index: string]: unknown;
|
|
472
470
|
};
|
|
473
471
|
enableComments?: boolean;
|
|
474
|
-
enableResolveComments?: boolean;
|
|
475
472
|
enableContextMenu?: boolean;
|
|
476
473
|
scrollContainer?: HTMLElement;
|
|
477
474
|
}
|
|
@@ -10,7 +10,6 @@ export declare class LocalDoc extends EventCallbacks<OnesEditorDocCallbacks> imp
|
|
|
10
10
|
beginBatchUpdate(): number;
|
|
11
11
|
endBatchUpdate(): number;
|
|
12
12
|
toJSON(): DocObject;
|
|
13
|
-
rawData(): DocObject;
|
|
14
13
|
getContainerBlocks(containerId: string): DocBlock[];
|
|
15
14
|
findContainerBlocks(containerId: string): DocBlock[];
|
|
16
15
|
getBlockData(containerId: string, blockIndex: number): DocBlock;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import { ScrollAreaElement, ScrollContainerElement, ScrollCore } from './common-types';
|
|
3
2
|
export declare function getScrollbarContainer(scrollContainer: ScrollContainerElement): HTMLDivElement;
|
|
4
|
-
declare
|
|
5
|
-
export declare const resetScrollbar: import("lodash").DebouncedFunc<typeof resetScrollbarCore>;
|
|
3
|
+
export declare const resetScrollbar: (scrollCore: ScrollCore, scrollWrap: ScrollAreaElement) => void | undefined;
|
|
6
4
|
export declare function calcScrollbarPos(scrollCore: ScrollCore, scrollContainer: ScrollContainerElement): void;
|
|
7
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocBlocks,
|
|
1
|
+
import { DocBlocks, DocObject, OnesEditorComment } from '../../../../@ones-editor/core';
|
|
2
2
|
export interface ShareDBDocCommentBase {
|
|
3
3
|
id: string;
|
|
4
4
|
groupId: string;
|
|
@@ -9,7 +9,6 @@ export interface ShareDBDocCommentBase {
|
|
|
9
9
|
created: number;
|
|
10
10
|
modified: number;
|
|
11
11
|
blocks?: DocBlocks;
|
|
12
|
-
resolver?: DocCommentResolver;
|
|
13
12
|
}
|
|
14
13
|
export type ShareDBDocComment = ShareDBDocCommentBase & {
|
|
15
14
|
[index: string]: DocBlocks;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocBlock, DocBlockTextActions, OnesEditorHistoryDataParseHandler } from '../../../../../@ones-editor/core';
|
|
2
|
-
type ActionType = 'deleteBlock' | 'insertBlock' | 'deleteBlockData' | 'insertBlockData' | 'updateBlockText' | 'deleteContainer' | 'createContainer' | 'deleteComment' | 'createComment' | 'updateComment'
|
|
2
|
+
type ActionType = 'deleteBlock' | 'insertBlock' | 'deleteBlockData' | 'insertBlockData' | 'updateBlockText' | 'deleteContainer' | 'createContainer' | 'deleteComment' | 'createComment' | 'updateComment';
|
|
3
3
|
interface Action {
|
|
4
4
|
type: ActionType;
|
|
5
5
|
containerId?: string;
|
|
@@ -20,7 +20,6 @@ export declare class ParseHandler {
|
|
|
20
20
|
onDeleteComment(commentId: string): void;
|
|
21
21
|
onCreateComment(commentId: string): void;
|
|
22
22
|
onUpdateComment(commentId: string): void;
|
|
23
|
-
onUpdateCommentResolver(commentId: string): void;
|
|
24
23
|
end(): void;
|
|
25
24
|
}
|
|
26
25
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuildResourceUrlOptions, DocBlock, DocBlockDelta, DocBlockText, DocBlockTextActions,
|
|
1
|
+
import { BuildResourceUrlOptions, DocBlock, DocBlockDelta, DocBlockText, DocBlockTextActions, DocObject, DocVersion, EventCallbacks, OnesEditorComment, OnesEditorDoc, OnesEditorDocHistoryData, OnesEditorDocServerMeta, OnesEditorDocStatus, OnesEditorDocVersionExtra, OnesEditorDocVersionHelper, OnesEditorHistoryDataParseHandler, UploadResourceOptions, UploadResourceResult } from '../../../../@ones-editor/core';
|
|
2
2
|
import { Doc } from 'sharedb/lib/client';
|
|
3
3
|
import { LocalPresence } from 'sharedb/lib/sharedb';
|
|
4
4
|
import RemoteCaretsHandler from './remote-caret-handler';
|
|
@@ -66,7 +66,6 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
|
|
|
66
66
|
localCreateComment(comment: OnesEditorComment, doc: DocObject): Promise<void>;
|
|
67
67
|
localDeleteComment(commentId: string): Promise<void>;
|
|
68
68
|
localUpdateComment(comment: OnesEditorComment, doc: DocObject): Promise<void>;
|
|
69
|
-
localUpdateCommentResolver(commentId: string, resolver?: DocCommentResolver): Promise<void> | Promise<boolean>;
|
|
70
69
|
destroy(): void;
|
|
71
70
|
private handleOp;
|
|
72
71
|
onDeleteBlock(containerId: string, blockIndex: number, local: boolean): void;
|
|
@@ -78,7 +77,6 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
|
|
|
78
77
|
onDeleteComment(commentId: string, local: boolean): void;
|
|
79
78
|
onCreateComment(commentId: string, local: boolean): void;
|
|
80
79
|
onUpdateComment(commentId: string, local: boolean): void;
|
|
81
|
-
onUpdateCommentResolver(commentId: string, local: boolean): void;
|
|
82
80
|
onCustomMessage(msg: unknown): void;
|
|
83
81
|
addResources(resourceIds: string[]): Promise<string[]>;
|
|
84
82
|
uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
|
|
@@ -134,5 +134,4 @@ export interface ShareDBDocCallbacks extends OnesEditorDocCallbacks {
|
|
|
134
134
|
onCreateComment?: (commentId: string, local: boolean) => void;
|
|
135
135
|
onDeleteComment?: (commentId: string, local: boolean) => void;
|
|
136
136
|
onUpdateComment?: (commentId: string, local: boolean) => void;
|
|
137
|
-
onUpdateCommentResolver?: (commentId: string, local: boolean) => void;
|
|
138
137
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|