@ones-editor/editor 0.0.3-beta.212 → 0.0.3-beta.214
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/block-locker/src/hook.d.ts +1 -1
- package/@ones-editor/comments/src/comments-helper/active-comment.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/comments-list.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +2 -2
- package/@ones-editor/core/src/core/doc/doc.d.ts +4 -1
- package/@ones-editor/core/src/core/editor/actions/is-writable.d.ts +1 -1
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +4 -1
- package/@ones-editor/core/src/core/types.d.ts +2 -2
- package/@ones-editor/core/src/local-doc/index.d.ts +4 -1
- package/@ones-editor/exclusive-block/src/exclusive-block-hook.d.ts +1 -1
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +5 -2
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/versions/src/history-doc/history-doc.d.ts +1 -1
- package/dist/index.js +51 -51
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { BlockCommands, BlockElement, BlockPath, CommandItem, ContainerElement,
|
|
|
2
2
|
export default class BlockLockerHook implements OnesEditorBlockHook {
|
|
3
3
|
create(editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock): void;
|
|
4
4
|
update(editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock): void;
|
|
5
|
-
writable(editor: OnesEditor, blockElement: BlockElement): boolean | undefined;
|
|
5
|
+
writable(editor: OnesEditor, blockElement: BlockElement | BlockElement[]): boolean | undefined;
|
|
6
6
|
commands(editor: OnesEditor, blockElement: BlockElement): BlockCommands;
|
|
7
7
|
executeCommand: (editor: OnesEditor, blockElement: BlockElement, item: CommandItem) => void;
|
|
8
8
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
export declare function activeComment(editor: OnesEditor, commentId: string): void;
|
|
2
|
+
export declare function activeComment(editor: OnesEditor, commentId: string, direction?: 'prev' | 'next'): void;
|
|
@@ -20,7 +20,7 @@ export default class CommentsList extends TypedEmitter<CommentsListEvents> imple
|
|
|
20
20
|
createList(): CommentGroupList;
|
|
21
21
|
handleSelectionOnComment: () => void;
|
|
22
22
|
updateCommentCount: () => void;
|
|
23
|
-
handleActiveItemChanged: () => void;
|
|
23
|
+
handleActiveItemChanged: (index: number, direction?: 'prev' | 'next') => void;
|
|
24
24
|
handleItemLayoutUpdated: () => void;
|
|
25
25
|
show(groupId?: string): void;
|
|
26
26
|
hide(): void;
|
|
@@ -4,7 +4,7 @@ import { CommentGroupItem } from './group-item';
|
|
|
4
4
|
import ListBase from './list-base';
|
|
5
5
|
import { CommentGroupItemHandlers } from './handler';
|
|
6
6
|
export interface CommentGroupListEvents {
|
|
7
|
-
activeItemChanged: (index: number) => void;
|
|
7
|
+
activeItemChanged: (index: number, direction?: 'prev' | 'next') => void;
|
|
8
8
|
itemLayoutUpdated: () => void;
|
|
9
9
|
selectionOnComment: () => void;
|
|
10
10
|
commentCountChanged: () => void;
|
|
@@ -21,7 +21,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
|
|
|
21
21
|
insertItem(data: CommentWithChildren, options?: {
|
|
22
22
|
active: boolean;
|
|
23
23
|
}): CommentGroupItem | null;
|
|
24
|
-
setActiveItem(index: number): void;
|
|
24
|
+
setActiveItem(index: number, direction?: 'prev' | 'next'): void;
|
|
25
25
|
get activeIndex(): number;
|
|
26
26
|
get activeItem(): CommentGroupItem | null;
|
|
27
27
|
findGroupItem: (groupId: string) => CommentGroupItem | undefined;
|
|
@@ -199,7 +199,10 @@ export interface OnesEditorDoc {
|
|
|
199
199
|
localUpdateBlockData: (containerId: string, blockIndex: number, delta: DocBlockDelta, newRange: OnesEditorDocRange) => DocBlock;
|
|
200
200
|
localInsertBlock: (containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange, options?: InsertBlockOptions) => DocBlock;
|
|
201
201
|
localDeleteBlock: (containerId: string, blockIndex: number, newRange: OnesEditorDocRange) => DocBlock;
|
|
202
|
-
|
|
202
|
+
localInsertChildContainers: (containers: {
|
|
203
|
+
containerId: string;
|
|
204
|
+
blocks: DocBlock[];
|
|
205
|
+
}[]) => void;
|
|
203
206
|
localDeleteChildContainers: (containerIds: string[]) => void;
|
|
204
207
|
addResources: (resourceIds: string[]) => Promise<string[]>;
|
|
205
208
|
uploadResource: (file: File, options?: UploadResourceOptions) => Promise<UploadResourceResult>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../types';
|
|
2
|
-
export declare function editorIsBlockWritable(editor: OnesEditor, block: BlockElement): boolean;
|
|
2
|
+
export declare function editorIsBlockWritable(editor: OnesEditor, block: BlockElement | BlockElement[]): boolean;
|
|
3
3
|
export declare function editorIsWritable(editor: OnesEditor): boolean;
|
|
@@ -19,7 +19,10 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
|
|
|
19
19
|
localInsertBlock(containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange, options?: InsertBlockOptions): DocBlock;
|
|
20
20
|
localDeleteBlock(containerId: string, blockIndex: number, newRange: OnesEditorDocRange): DocBlock;
|
|
21
21
|
localDeleteChildContainers(containerIds: string[]): void;
|
|
22
|
-
|
|
22
|
+
localInsertChildContainers(containers: {
|
|
23
|
+
containerId: string;
|
|
24
|
+
blocks: DocBlock[];
|
|
25
|
+
}[]): void;
|
|
23
26
|
onRequestReload(reason: string): void;
|
|
24
27
|
onUpdateBlockText(containerId: string, blockIndex: number, actions: DocBlockTextActions, local: boolean): void;
|
|
25
28
|
onUpdateBlockData(containerId: string, blockIndex: number, delta: DocBlockDelta, local: boolean): void;
|
|
@@ -487,7 +487,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
487
487
|
tryFocusToChildSimpleBlock?: boolean;
|
|
488
488
|
}) => void;
|
|
489
489
|
isWritable: () => boolean;
|
|
490
|
-
isBlockWritable: (block: BlockElement) => boolean;
|
|
490
|
+
isBlockWritable: (block: BlockElement | BlockElement[]) => boolean;
|
|
491
491
|
reload: () => void;
|
|
492
492
|
getChildContainerData: (childContainerId: string) => DocBlocks;
|
|
493
493
|
createChildContainer: (path: BlockPath, parentElement: HTMLElement, childContainerId: string) => ContainerElement;
|
|
@@ -675,6 +675,6 @@ export interface EditorDocLocalActionCallbacks {
|
|
|
675
675
|
export interface OnesEditorBlockHook {
|
|
676
676
|
create?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
677
677
|
update?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
678
|
-
writable?: (editor: OnesEditor, blockElement: BlockElement) => boolean | undefined;
|
|
678
|
+
writable?: (editor: OnesEditor, blockElement: BlockElement | BlockElement[]) => boolean | undefined;
|
|
679
679
|
commands?: (editor: OnesEditor, blockElement: BlockElement) => BlockCommands;
|
|
680
680
|
}
|
|
@@ -16,7 +16,10 @@ export declare class LocalDoc extends EventCallbacks<OnesEditorDocCallbacks> imp
|
|
|
16
16
|
localUpdateBlockData(containerId: string, blockIndex: number, delta: DocBlockDelta): DocBlock;
|
|
17
17
|
localInsertBlock(containerId: string, blockIndex: number, data: DocBlock): DocBlock;
|
|
18
18
|
localDeleteBlock(containerId: string, blockIndex: number): DocBlock;
|
|
19
|
-
|
|
19
|
+
localInsertChildContainers(containers: {
|
|
20
|
+
containerId: string;
|
|
21
|
+
blocks: DocBlock[];
|
|
22
|
+
}[]): void;
|
|
20
23
|
localDeleteChildContainers(containerIds: string[]): void;
|
|
21
24
|
uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
|
|
22
25
|
addResources(resourceIds: string[]): Promise<string[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockElement, BlockPath, ContainerElement, DocBlock, OnesEditor, OnesEditorBlockHook } from '../../../@ones-editor/core';
|
|
2
2
|
export default class BlockExclusiveHook implements OnesEditorBlockHook {
|
|
3
|
-
writable(editor: OnesEditor, blockElement: BlockElement): boolean | undefined;
|
|
3
|
+
writable(editor: OnesEditor, blockElement: BlockElement | BlockElement[]): boolean | undefined;
|
|
4
4
|
create(editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock): void;
|
|
5
5
|
update(editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock): void;
|
|
6
6
|
}
|
|
@@ -39,7 +39,7 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
|
|
|
39
39
|
toJSON(): DocObject;
|
|
40
40
|
private submitOp;
|
|
41
41
|
createDoc: (data: EditorDoc) => Promise<void>;
|
|
42
|
-
private
|
|
42
|
+
private submitInsertChildContainers;
|
|
43
43
|
private submitDeleteChildContainer;
|
|
44
44
|
private submitInsertBlock;
|
|
45
45
|
private submitDeleteBlock;
|
|
@@ -51,7 +51,10 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
|
|
|
51
51
|
localDeleteBlock(containerId: string, blockIndex: number): DocBlock;
|
|
52
52
|
localUpdateBlockText(containerId: string, blockIndex: number, actions: DocBlockTextActions): DocBlockText;
|
|
53
53
|
localUpdateBlockData(containerId: string, blockIndex: number, delta: DocBlockDelta): DocBlock;
|
|
54
|
-
|
|
54
|
+
localInsertChildContainers(containers: {
|
|
55
|
+
containerId: string;
|
|
56
|
+
blocks: DocBlock[];
|
|
57
|
+
}[]): void;
|
|
55
58
|
localDeleteChildContainers(containerIds: string[]): void;
|
|
56
59
|
getComments(): OnesEditorComment[];
|
|
57
60
|
getComment(commentId: string): OnesEditorComment;
|