@ones-editor/editor 2.8.37-beta.9 → 2.8.38
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 -11
- 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/main-toolbar/src/index.d.ts +1 -7
- package/@ones-editor/main-toolbar/src/items/index.d.ts +2 -3
- package/@ones-editor/scroll-container/src/scroll-bar-handle.d.ts +1 -4
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +1 -0
- package/@ones-editor/sharedb-doc/src/doc/comments.d.ts +1 -2
- package/@ones-editor/sharedb-doc/src/doc/edit-status.d.ts +1 -1
- 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 +2 -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/command-bar/types.d.ts +7 -8
- package/@ones-editor/ui-base/src/icons/index.d.ts +1 -3
- 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 +1 -3
- package/dist/index.js +612 -1513
- 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
- package/@ones-editor/main-toolbar/src/items/file.d.ts +0 -8
|
@@ -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 & {
|
|
@@ -139,10 +133,8 @@ export interface OnesEditorDocCallbacks {
|
|
|
139
133
|
onStatusChanged?: (status: OnesEditorDocStatus) => void;
|
|
140
134
|
onError?: (error: Error) => void;
|
|
141
135
|
}
|
|
142
|
-
export type OnesEditorResourceType = 'image' | 'media' | 'file' | 'graph' | 'paste' | 'unknown';
|
|
143
136
|
export interface UploadResourceOptions {
|
|
144
137
|
onProgress?: (progress: number) => void;
|
|
145
|
-
resourceType?: OnesEditorResourceType;
|
|
146
138
|
}
|
|
147
139
|
export interface UploadResourceResult {
|
|
148
140
|
resourceId: string;
|
|
@@ -255,7 +247,6 @@ export interface OnesEditorDoc extends OnesEditorDocServer {
|
|
|
255
247
|
beginBatchUpdate: () => number;
|
|
256
248
|
endBatchUpdate: () => number;
|
|
257
249
|
triggerReAuth?: (auto?: boolean) => void;
|
|
258
|
-
rawData?: () => DocObject;
|
|
259
250
|
}
|
|
260
251
|
export interface OnesEditorDocHistoryData {
|
|
261
252
|
user: {
|
|
@@ -274,7 +265,6 @@ export interface OnesEditorHistoryDataParseHandler {
|
|
|
274
265
|
onDeleteComment: (commentId: string, local: boolean) => void;
|
|
275
266
|
onCreateComment: (commentId: string, local: boolean) => void;
|
|
276
267
|
onUpdateComment: (commentId: string, local: boolean) => void;
|
|
277
|
-
onUpdateCommentResolver: (commentId: string, local: boolean) => void;
|
|
278
268
|
}
|
|
279
269
|
export interface OnesEditorDocVersionHelper {
|
|
280
270
|
getVersions: (showPublished?: boolean) => Promise<DocVersion[]>;
|
|
@@ -298,5 +288,4 @@ export interface OnesEditorComment {
|
|
|
298
288
|
abstract: string;
|
|
299
289
|
created: number;
|
|
300
290
|
modified: number;
|
|
301
|
-
resolver?: DocCommentResolver;
|
|
302
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;
|
|
@@ -5,16 +5,10 @@ import './locale';
|
|
|
5
5
|
import './style.scss';
|
|
6
6
|
export * from './types';
|
|
7
7
|
export * from './items';
|
|
8
|
-
export interface MainToolbarOptions {
|
|
9
|
-
enableFullScreen?: boolean;
|
|
10
|
-
onFullScreenClick?: (editor: OnesEditor, item: CommandItem) => void;
|
|
11
|
-
}
|
|
12
8
|
export declare class MainToolbar implements OnesEditorCustom {
|
|
13
9
|
private editor;
|
|
14
|
-
private options;
|
|
15
10
|
toolbar: FixedToolbar;
|
|
16
|
-
|
|
17
|
-
constructor(editor: OnesEditor, parent: HTMLElement, options?: MainToolbarOptions);
|
|
11
|
+
constructor(editor: OnesEditor, parent: HTMLElement);
|
|
18
12
|
destroy(): void;
|
|
19
13
|
setItems(items: ToolbarItem[]): void;
|
|
20
14
|
getItems(): ToolbarItem[];
|
|
@@ -13,6 +13,5 @@ import { FindReplaceItem } from './find';
|
|
|
13
13
|
import { CommentItem } from './comment';
|
|
14
14
|
import { ColorItem } from './text-color';
|
|
15
15
|
import { MoreItem } from './more-item';
|
|
16
|
-
|
|
17
|
-
export
|
|
18
|
-
export { UndoItem, RedoItem, FontBoldItem, FontItalicItem, FontUnderlineItem, FontStrikethroughItem, ColorItem, InlineCodeItem, SuperscriptItem, SubscriptItem, AlignLeftItem, AlignCenterItem, AlignRightItem, ParagraphItem, SeparatorItem, OrderedListItem, UnorderedListItem, CheckListItem, InsertImageItem, InsertFileItem, InsertLinkItem, QuoteItem, InsertItem, FindReplaceItem, CommentItem, MoreItem, };
|
|
16
|
+
export declare function getToolbarDefaultItems(editor: OnesEditor): (FontBoldItem | FontItalicItem | FontUnderlineItem | FontStrikethroughItem | InlineCodeItem | SuperscriptItem | SubscriptItem | InsertImageItem | InsertLinkItem | OrderedListItem | UnorderedListItem | CheckListItem | ParagraphItem | QuoteItem | SeparatorItem | AlignLeftItem | AlignCenterItem | AlignRightItem | UndoItem | RedoItem | InsertItem | FindReplaceItem | CommentItem | ColorItem | MoreItem)[];
|
|
17
|
+
export { UndoItem, RedoItem, FontBoldItem, FontItalicItem, FontUnderlineItem, FontStrikethroughItem, ColorItem, InlineCodeItem, SuperscriptItem, SubscriptItem, AlignLeftItem, AlignCenterItem, AlignRightItem, ParagraphItem, SeparatorItem, OrderedListItem, UnorderedListItem, CheckListItem, InsertImageItem, InsertLinkItem, QuoteItem, InsertItem, FindReplaceItem, CommentItem, MoreItem, };
|
|
@@ -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 {};
|
|
@@ -15,6 +15,7 @@ export interface AutoConnectionEvents {
|
|
|
15
15
|
writeConflictError: (error: Error) => void;
|
|
16
16
|
maxUsersError: () => void;
|
|
17
17
|
requestReloadError: (error: Error) => void;
|
|
18
|
+
opReceived: () => void;
|
|
18
19
|
ready: () => void;
|
|
19
20
|
}
|
|
20
21
|
export declare class AuthConnection extends TypedEmitter<AutoConnectionEvents> {
|
|
@@ -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';
|
|
@@ -26,6 +26,7 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
|
|
|
26
26
|
private handleReload;
|
|
27
27
|
private handleReset;
|
|
28
28
|
private handleWriteConflictError;
|
|
29
|
+
private handleOpReceived;
|
|
29
30
|
private setStatus;
|
|
30
31
|
initEvents(): void;
|
|
31
32
|
clearEvents(): void;
|
|
@@ -66,7 +67,6 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
|
|
|
66
67
|
localCreateComment(comment: OnesEditorComment, doc: DocObject): Promise<void>;
|
|
67
68
|
localDeleteComment(commentId: string): Promise<void>;
|
|
68
69
|
localUpdateComment(comment: OnesEditorComment, doc: DocObject): Promise<void>;
|
|
69
|
-
localUpdateCommentResolver(commentId: string, resolver?: DocCommentResolver): Promise<void> | Promise<boolean>;
|
|
70
70
|
destroy(): void;
|
|
71
71
|
private handleOp;
|
|
72
72
|
onDeleteBlock(containerId: string, blockIndex: number, local: boolean): void;
|
|
@@ -78,7 +78,6 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
|
|
|
78
78
|
onDeleteComment(commentId: string, local: boolean): void;
|
|
79
79
|
onCreateComment(commentId: string, local: boolean): void;
|
|
80
80
|
onUpdateComment(commentId: string, local: boolean): void;
|
|
81
|
-
onUpdateCommentResolver(commentId: string, local: boolean): void;
|
|
82
81
|
onCustomMessage(msg: unknown): void;
|
|
83
82
|
addResources(resourceIds: string[]): Promise<string[]>;
|
|
84
83
|
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 {};
|