@ones-editor/editor 0.0.3-beta.5 → 0.0.3-beta.51
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/i18n/en-US.d.ts +8 -0
- package/@ones-editor/block-locker/src/i18n/index.d.ts +1 -0
- package/@ones-editor/block-locker/src/i18n/zh-CN.d.ts +8 -0
- package/@ones-editor/block-locker/src/index.d.ts +2 -0
- package/@ones-editor/block-menu/src/block-menu/index.d.ts +1 -0
- package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +1 -1
- package/@ones-editor/block-menu/src/block-menu-button/drag-drop/find-preview-element.d.ts +1 -1
- package/@ones-editor/code-block/src/code-block/caption/caption-input-handler.d.ts +2 -2
- package/@ones-editor/code-block/src/code-block/code-caret.d.ts +7 -0
- package/@ones-editor/code-block/src/code-block/code-copy.d.ts +4 -0
- package/@ones-editor/code-block/src/code-block/create-empty-code.d.ts +2 -2
- package/@ones-editor/code-block/src/code-block/index.d.ts +3 -1
- package/@ones-editor/code-block/src/code-block/settings/index.d.ts +3 -0
- package/@ones-editor/comments/src/actions/add-comment-to-block.d.ts +3 -2
- package/@ones-editor/comments/src/actions/add-comment-to-text-block.d.ts +2 -1
- package/@ones-editor/comments/src/actions/editor-add-comment.d.ts +2 -0
- package/@ones-editor/comments/src/comment-item/comment-item.d.ts +1 -0
- package/@ones-editor/comments/src/comments/comments.d.ts +4 -3
- package/@ones-editor/comments/src/comments-helper/utils.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/arrange-items.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/comments-list.d.ts +0 -8
- package/@ones-editor/comments/src/comments-list/group-item.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +0 -3
- package/@ones-editor/comments/src/index.d.ts +1 -0
- package/@ones-editor/comments/src/types.d.ts +10 -4
- package/@ones-editor/core/src/core/blocks/block-anchor/create-block-anchor.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/index.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-markdown.d.ts +3 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-html.d.ts +3 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-text.d.ts +3 -0
- package/@ones-editor/core/src/core/composition/clipboard/copy.d.ts +2 -2
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +3 -0
- package/@ones-editor/core/src/core/converter/block-to-doc.d.ts +1 -1
- package/@ones-editor/core/src/core/converter/block-to-html.d.ts +2 -2
- package/@ones-editor/core/src/core/converter/block-to-markdown.d.ts +2 -2
- package/@ones-editor/core/src/core/converter/block-to-text.d.ts +2 -2
- package/@ones-editor/core/src/core/converter/selected-block-to-doc.d.ts +3 -1
- package/@ones-editor/core/src/core/doc/doc.d.ts +6 -2
- package/@ones-editor/core/src/core/doc/rich-text/insert-text.d.ts +2 -1
- package/@ones-editor/core/src/core/editor/actions/auto-insert-block.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/break-text-block.d.ts +2 -0
- package/@ones-editor/core/src/core/editor/actions/delete-block-text.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/focus-to-end.d.ts +0 -1
- package/@ones-editor/core/src/core/editor/actions/insert-block.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/insert-text.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/editor-dom/dom-events.d.ts +3 -3
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +4 -3
- package/@ones-editor/core/src/core/index.d.ts +1 -0
- package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +3 -0
- package/@ones-editor/core/src/core/input-handler/remove-quoted.d.ts +2 -0
- package/@ones-editor/core/src/core/selection/actions/index.d.ts +2 -2
- package/@ones-editor/core/src/core/selection/actions/select-all.d.ts +3 -1
- package/@ones-editor/core/src/core/selection/actions/select-block.d.ts +2 -0
- package/@ones-editor/core/src/core/selection/actions/word-offset.d.ts +1 -1
- package/@ones-editor/core/src/core/selection/editor-selection.d.ts +3 -2
- package/@ones-editor/core/src/core/types.d.ts +35 -15
- package/@ones-editor/core/src/i18n/i18n.d.ts +36 -0
- package/@ones-editor/core/src/local-doc/index.d.ts +6 -2
- package/@ones-editor/core/src/utils/dom-scroll.d.ts +3 -1
- package/@ones-editor/core/src/utils/file.d.ts +3 -0
- package/@ones-editor/core/src/utils/logger/index.d.ts +1 -0
- package/@ones-editor/drop-target/src/drop-indicator.d.ts +1 -0
- package/@ones-editor/drop-target/src/drop-target.d.ts +1 -1
- package/@ones-editor/drop-target/src/handlers/drag-file.d.ts +8 -0
- package/@ones-editor/e2e/cypress/support/commands.d.ts +25 -0
- package/@ones-editor/e2e/cypress/support/e2e.d.ts +1 -0
- package/@ones-editor/e2e/cypress.config.d.ts +3 -0
- package/@ones-editor/e2e/package.json +13 -0
- package/@ones-editor/e2e/src/block-menu/case.d.ts +17 -0
- package/@ones-editor/e2e/src/block-menu/menu.cy.d.ts +1 -0
- package/@ones-editor/e2e/src/data.d.ts +131 -0
- package/@ones-editor/e2e/src/input-handlers/case.d.ts +10 -0
- package/@ones-editor/e2e/src/input-handlers/shortcut.cy.d.ts +1 -0
- package/@ones-editor/e2e/src/list-block/case.d.ts +8 -0
- package/@ones-editor/e2e/src/list-block/list.cy.d.ts +1 -0
- package/@ones-editor/e2e/src/toc/case.d.ts +5 -0
- package/@ones-editor/e2e/src/toc/toc.cy.d.ts +1 -0
- package/@ones-editor/embed-block-helper/src/block-properties/embed-block-properties.d.ts +1 -0
- package/@ones-editor/file/package.json +8 -0
- package/@ones-editor/file/src/file-box/index.d.ts +4 -0
- package/@ones-editor/file/src/file-embed/card/file-icon.d.ts +1 -0
- package/@ones-editor/file/src/file-embed/card/index.d.ts +6 -0
- package/@ones-editor/file/src/file-embed/download-file.d.ts +2 -0
- package/@ones-editor/file/src/file-embed/index.d.ts +4 -0
- package/@ones-editor/file/src/index.d.ts +3 -0
- package/@ones-editor/file/src/types.d.ts +22 -0
- package/@ones-editor/find-dialog/src/find-dialog.d.ts +0 -1
- package/@ones-editor/graph-embed/src/helper/graph-base.d.ts +1 -0
- package/@ones-editor/heading-collapse/src/heading-collapse-button/drop-handler.d.ts +1 -1
- package/@ones-editor/image-embed/package.json +2 -1
- package/@ones-editor/image-embed/src/drag-drop/drag-handler.d.ts +4 -0
- package/@ones-editor/image-embed/src/drag-drop/handle-drop-over.d.ts +5 -1
- package/@ones-editor/image-embed/src/drag-drop/handle-drop.d.ts +1 -1
- package/@ones-editor/image-embed/src/empty-image-converter.d.ts +5 -0
- package/@ones-editor/image-embed/src/index.d.ts +2 -1
- package/@ones-editor/input-handlers/src/enforce-with-document-title/types.d.ts +1 -0
- package/@ones-editor/input-handlers/src/i18n/en-us.d.ts +1 -0
- package/@ones-editor/input-handlers/src/i18n/zh-cn.d.ts +1 -0
- package/@ones-editor/input-handlers/src/markdown-shortcuts/table-converter.d.ts +2 -0
- package/@ones-editor/list-block/src/converter/convert-list-to.d.ts +2 -0
- package/@ones-editor/list-block/src/converter/convert-to-list.d.ts +14 -0
- package/@ones-editor/list-block/src/converter/index.d.ts +2 -14
- package/@ones-editor/list-block/src/drop/index.d.ts +1 -1
- package/@ones-editor/list-block/src/index.d.ts +3 -2
- package/@ones-editor/list-block/src/level/change-multi-levels.d.ts +2 -0
- package/@ones-editor/list-block/src/level/decrease-level.d.ts +1 -0
- package/@ones-editor/list-block/src/types.d.ts +2 -1
- package/@ones-editor/markdown-to-doc/src/markdown-to-doc.d.ts +1 -0
- package/@ones-editor/markdown-to-doc/src/tokens/block-tokens/latex.d.ts +4 -0
- package/@ones-editor/mathjax/package.json +3 -0
- package/@ones-editor/mathjax/src/index.d.ts +2 -1
- package/@ones-editor/mathjax/src/mathjax-box/convert-mathjax.d.ts +5 -0
- package/@ones-editor/mathjax/src/mathjax-box/mathjax-editor.d.ts +2 -2
- package/@ones-editor/media-embed/src/core/media-embed.d.ts +3 -1
- package/@ones-editor/mention/src/mention.d.ts +1 -0
- package/@ones-editor/paste-handler/src/paste-handler.d.ts +1 -1
- package/@ones-editor/paste-special/src/paste-special-handler.d.ts +2 -2
- package/@ones-editor/scroll-container/src/dom-utils.d.ts +9 -0
- package/@ones-editor/scroll-container/src/index.d.ts +8 -18
- package/@ones-editor/scroll-container/src/observer/container-resize-observer.d.ts +2 -1
- package/@ones-editor/scroll-container/src/observer/locating-resize-observer.d.ts +13 -0
- package/@ones-editor/scroll-container/src/scroll-listener.d.ts +3 -0
- package/@ones-editor/scroll-container/src/types.d.ts +1 -0
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +3 -3
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +3 -3
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +6 -1
- package/@ones-editor/sharedb-doc/src/index.d.ts +1 -0
- package/@ones-editor/sharedb-doc/src/types.d.ts +3 -2
- package/@ones-editor/table-block/src/locale/en-us.d.ts +5 -0
- package/@ones-editor/table-block/src/locale/zh-cn.d.ts +5 -0
- package/@ones-editor/table-block/src/table-block/convert-table-to.d.ts +2 -0
- package/@ones-editor/table-block/src/table-block/doc-table-data.d.ts +1 -1
- package/@ones-editor/table-block/src/table-block/table-creator/index.d.ts +1 -1
- package/@ones-editor/table-block/src/table-block/table-resize/resize-gripper.d.ts +1 -1
- package/@ones-editor/table-block/src/table-block/table-scroll-events.d.ts +1 -0
- package/@ones-editor/table-block/src/types.d.ts +2 -0
- package/@ones-editor/templates/package.json +9 -0
- package/@ones-editor/templates/src/index.d.ts +4 -0
- package/@ones-editor/templates/src/locale/en-us.d.ts +9 -0
- package/@ones-editor/templates/src/locale/index.d.ts +1 -0
- package/@ones-editor/templates/src/locale/zh-cn.d.ts +9 -0
- package/@ones-editor/templates/src/templates/select-template.d.ts +7 -0
- package/@ones-editor/templates/src/templates/types.d.ts +14 -0
- package/@ones-editor/text-commands/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/text-commands/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/toc/src/heading-scroll/index.d.ts +22 -0
- package/@ones-editor/toc/src/heading-scroll/utils.d.ts +7 -0
- package/@ones-editor/toc/src/index.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +3 -1
- package/@ones-editor/ui/src/locale/en-us.d.ts +2 -0
- package/@ones-editor/ui/src/locale/zh-cn.d.ts +2 -0
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +10 -12
- package/@ones-editor/ui/src/quick-menu/index.d.ts +1 -6
- package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +1 -0
- package/@ones-editor/ui/src/quick-menu/insert-empty-block.d.ts +4 -2
- package/@ones-editor/ui/src/quick-menu/types.d.ts +24 -1
- package/@ones-editor/ui/src/toolbar/box-only.d.ts +2 -0
- package/@ones-editor/ui/src/toolbar/commands/paragraph.d.ts +1 -0
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +2 -2
- package/@ones-editor/ui/src/tooltips/index.d.ts +4 -0
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +2 -1
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +1 -1
- package/@ones-editor/ui-base/src/auto-suggest/index.d.ts +2 -1
- package/@ones-editor/ui-base/src/auto-suggest/should-focus-to-editor.d.ts +2 -0
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +2 -1
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +5 -0
- package/@ones-editor/ui-base/src/dialog/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/dialog/manual-close-dialog.d.ts +1 -1
- package/@ones-editor/ui-base/src/dialog/types.d.ts +4 -0
- package/@ones-editor/ui-base/src/input/create-input.d.ts +1 -0
- package/@ones-editor/ui-base/src/item-shortcuts/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/list/drop-down-filterable-list.d.ts +2 -2
- package/@ones-editor/ui-base/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/versions/src/types.d.ts +1 -0
- package/@ones-editor/versions/src/version-dialog/index.d.ts +3 -1
- package/@ones-editor/webpage-embed/src/ui/dialog.d.ts +2 -2
- package/@ones-editor/webpage-embed/src/webpage-embed/webpage-items.d.ts +2 -0
- package/dist/comments/create-comment-editor.d.ts +4 -7
- package/dist/comments/local-doc-comments-provider.d.ts +18 -0
- package/dist/comments/{comments-provider.d.ts → sharedb-doc-comments-provider.d.ts} +3 -6
- package/dist/index.d.ts +15 -3
- package/dist/index.js +244 -220
- package/dist/lang/en-us.d.ts +13 -0
- package/dist/lang/index.d.ts +1 -0
- package/dist/lang/zh-cn.d.ts +13 -0
- package/dist/types.d.ts +25 -4
- package/package.json +6 -1
- package/@ones-editor/list-block/src/command/covert-to-list.d.ts +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,6 +8,7 @@ export default class BlockMenu {
|
|
|
8
8
|
show(target: HTMLElement): void;
|
|
9
9
|
isInMenu(eventTarget: EventTarget | null): boolean;
|
|
10
10
|
handleShow: () => void;
|
|
11
|
+
handleClose: () => void;
|
|
11
12
|
handleItemClick: (bar: unknown, item: CommandItem) => void;
|
|
12
13
|
setBlock(block: BlockElement): void;
|
|
13
14
|
close: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../../../@ones-editor/core';
|
|
2
2
|
import { BlockMenuItem } from '../types';
|
|
3
|
-
export declare function getAllInsertBlockItems(editor: OnesEditor): BlockMenuItem[];
|
|
3
|
+
export declare function getAllInsertBlockItems(editor: OnesEditor, source: 'insert-block' | 'insert-block-before'): BlockMenuItem[];
|
|
4
4
|
export declare function executeInsertBlockCommand(editor: OnesEditor, block: BlockElement, item: BlockMenuItem, insertAbove?: boolean): Promise<BlockElement | null> | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BlockElement } from '../../../../../@ones-editor/core';
|
|
2
2
|
export declare function findPreviewElement(block: BlockElement): HTMLElement;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { OnesEditor, OnesEditorCustom, OnesEditorInputHandler } from '../../../../../@ones-editor/core';
|
|
1
|
+
import { OnesEditor, OnesEditorCustom, OnesEditorDocs, OnesEditorInputHandler } from '../../../../../@ones-editor/core';
|
|
2
2
|
export default class CodeBlockCaptionInputHandler implements OnesEditorInputHandler, OnesEditorCustom {
|
|
3
3
|
constructor(editor: OnesEditor);
|
|
4
4
|
destroy(): void;
|
|
5
5
|
handleBeforeKeyDown(editor: OnesEditor, event: KeyboardEvent): boolean;
|
|
6
|
-
handleBeforePaste(editor: OnesEditor, event: ClipboardEvent): Promise<boolean>;
|
|
6
|
+
handleBeforePaste(editor: OnesEditor, event: ClipboardEvent | null, docs: OnesEditorDocs): Promise<boolean>;
|
|
7
7
|
static init(editor: OnesEditor): void;
|
|
8
8
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DocObject, OnesEditor, OnesEditorInputHandler } from '../../../../@ones-editor/core';
|
|
2
|
+
export default class CopyCodeInputHandler implements OnesEditorInputHandler {
|
|
3
|
+
handleBeforeCopy(editor: OnesEditor, event: ClipboardEvent, doc: DocObject): boolean | DocObject | undefined;
|
|
4
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import { DocCodeBlockData } from './code-block-data';
|
|
3
|
-
export declare function createEmptyCode(editor: OnesEditor): {
|
|
3
|
+
export declare function createEmptyCode(editor: OnesEditor): Promise<{
|
|
4
4
|
blockData: DocCodeBlockData;
|
|
5
5
|
focusBlockId: string;
|
|
6
|
-
}
|
|
6
|
+
}>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import CodeBlock, { CodeLineBlock } from './code-block';
|
|
2
|
+
import OnesEditorCodeCaret from './code-caret';
|
|
3
|
+
import CopyCodeInputHandler from './code-copy';
|
|
2
4
|
import CodeShortcuts from './code-shortcuts';
|
|
3
5
|
import CodeTextDecorator from './code-text-decorate';
|
|
4
|
-
export { CodeBlock, CodeLineBlock, CodeTextDecorator, CodeShortcuts };
|
|
6
|
+
export { CodeBlock, CodeLineBlock, CodeTextDecorator, CodeShortcuts, CopyCodeInputHandler, OnesEditorCodeCaret };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, OnesEditor, OnesEditorComment } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorCommentsProvider } from '../types';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function updateCommentToBlock(editor: OnesEditor, block: BlockElement, comment: OnesEditorComment): void;
|
|
4
|
+
export declare function addCommentToBlock(editor: OnesEditor, block: BlockElement, provider: OnesEditorCommentsProvider): OnesEditorComment;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { OnesEditor, OnesEditorComment, SelectionRange } from '../../../../@ones-editor/core';
|
|
1
|
+
import { OnesEditor, OnesEditorComment, SelectedBlock, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorCommentsProvider } from '../types';
|
|
3
|
+
export declare function addCommentToSelectedTextBlock(editor: OnesEditor, selectedBlock: SelectedBlock, comment: OnesEditorComment): void;
|
|
3
4
|
export declare function addCommentToTextBlocks(editor: OnesEditor, range: SelectionRange, provider: OnesEditorCommentsProvider): OnesEditorComment;
|
|
@@ -3,17 +3,18 @@ import { OnesEditorCommentsProvider } from '../types';
|
|
|
3
3
|
export default class OnesEditorComments {
|
|
4
4
|
private editor;
|
|
5
5
|
private provider;
|
|
6
|
-
private root;
|
|
7
6
|
private commentList;
|
|
8
7
|
private mobileCommentList;
|
|
9
8
|
private miniCommentList;
|
|
10
|
-
constructor(editor: OnesEditor, provider: OnesEditorCommentsProvider
|
|
9
|
+
constructor(editor: OnesEditor, provider: OnesEditorCommentsProvider);
|
|
10
|
+
private get commentOptions();
|
|
11
|
+
get commentProvider(): OnesEditorCommentsProvider;
|
|
11
12
|
get isMobile(): boolean;
|
|
13
|
+
private getCommentRoot;
|
|
12
14
|
destroy(): void;
|
|
13
15
|
private showComment;
|
|
14
16
|
showCommentList: (groupId?: string) => void;
|
|
15
17
|
private handleCommentListClose;
|
|
16
18
|
private handleOnSelectComment;
|
|
17
|
-
private handleMiniCommentClose;
|
|
18
19
|
private handleMiniCommentItemClick;
|
|
19
20
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OnesEditorComment, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare function isChildComment(comment: OnesEditorComment): boolean;
|
|
3
|
-
export declare function getCommentsRoot(): HTMLDivElement;
|
|
4
3
|
export declare function getCommentItemCountInGroupItem(groupItemRoot: HTMLElement, commentItemCls?: string): number;
|
|
5
4
|
export declare function getClosestCommentItemId(element: HTMLElement): string | null;
|
|
6
5
|
export declare function addGroupActionToElement(element: HTMLElement, action: string): void;
|
|
@@ -8,3 +7,4 @@ export declare function getClosestGroupItemActionElement(element: HTMLElement):
|
|
|
8
7
|
export declare function getActionFromActionElement(actionElement: HTMLElement): string;
|
|
9
8
|
export declare function isDisabledActionElement(actionElement: HTMLElement): boolean;
|
|
10
9
|
export declare function getBlockIdByGroupId(editor: OnesEditor, commentId: string): string | null;
|
|
10
|
+
export declare function getAllCommentInCommentElement(element: HTMLElement): string[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import type { CommentGroupItem } from './group-item';
|
|
3
|
-
export declare function arrangeItems(editor: OnesEditor, items: CommentGroupItem[], activeItem: CommentGroupItem | null): void;
|
|
3
|
+
export declare function arrangeItems(editor: OnesEditor, items: CommentGroupItem[], activeItem: CommentGroupItem | null, fixTop?: number): void;
|
|
@@ -3,14 +3,12 @@ import { TypedEmitter } from 'tiny-typed-emitter';
|
|
|
3
3
|
import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../types';
|
|
4
4
|
import CommentGroupList from './group-list';
|
|
5
5
|
interface CommentsListEvents {
|
|
6
|
-
onCommentListClose: () => void;
|
|
7
6
|
onSelectComment: () => void;
|
|
8
7
|
}
|
|
9
8
|
export default class CommentsList extends TypedEmitter<CommentsListEvents> implements OnesEditorCommentsEvents {
|
|
10
9
|
private editor;
|
|
11
10
|
private commentsProvider;
|
|
12
11
|
private root;
|
|
13
|
-
private header;
|
|
14
12
|
private groupsContainer;
|
|
15
13
|
private list;
|
|
16
14
|
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
|
|
@@ -19,13 +17,7 @@ export default class CommentsList extends TypedEmitter<CommentsListEvents> imple
|
|
|
19
17
|
onCreateComment(commentId: string, local: boolean): void;
|
|
20
18
|
onDeleteComment(commentId: string, local: boolean): void;
|
|
21
19
|
onUpdateComment(commentId: string, local: boolean): void;
|
|
22
|
-
createHeader(): {
|
|
23
|
-
header: HTMLDivElement;
|
|
24
|
-
count: HTMLSpanElement;
|
|
25
|
-
closeButton: HTMLButtonElement;
|
|
26
|
-
};
|
|
27
20
|
createList(): CommentGroupList;
|
|
28
|
-
handleCloseButtonClick: () => void;
|
|
29
21
|
handleSelectionOnComment: () => void;
|
|
30
22
|
updateCommentCount: () => void;
|
|
31
23
|
handleActiveItemChanged: () => void;
|
|
@@ -33,6 +33,7 @@ export declare class CommentGroupItem extends TypedEmitter<CommentGroupItemEvent
|
|
|
33
33
|
handleUpdateChildComment(comment: OnesEditorComment): void;
|
|
34
34
|
handleUpdateMainComment(comment: OnesEditorComment): void;
|
|
35
35
|
deleteMainComment(commentId: OnesEditorComment['id']): void;
|
|
36
|
+
handleReadonlyChanged: (editor: OnesEditor) => void;
|
|
36
37
|
edit(): void;
|
|
37
38
|
destroy(): void;
|
|
38
39
|
private handleResize;
|
|
@@ -6,7 +6,6 @@ import { CommentGroupItemHandlers } from './handler';
|
|
|
6
6
|
export interface CommentGroupListEvents {
|
|
7
7
|
activeItemChanged: (index: number) => void;
|
|
8
8
|
itemLayoutUpdated: () => void;
|
|
9
|
-
itemCountClicked: () => void;
|
|
10
9
|
selectionOnComment: () => void;
|
|
11
10
|
commentCountChanged: () => void;
|
|
12
11
|
}
|
|
@@ -32,6 +31,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
|
|
|
32
31
|
handleEditorResize: () => void;
|
|
33
32
|
handleDocChanged: () => void;
|
|
34
33
|
handleItemResize: () => void;
|
|
34
|
+
handleScroll: (event: WheelEvent) => void;
|
|
35
35
|
updateGroupItemSwitch: () => void;
|
|
36
36
|
private updateComments;
|
|
37
37
|
}
|
|
@@ -11,15 +11,12 @@ export declare class MiniCommentsList extends TypedEmitter<MiniCommentsListEvent
|
|
|
11
11
|
private commentsProvider;
|
|
12
12
|
list: MiniGroupList;
|
|
13
13
|
root: HTMLElement;
|
|
14
|
-
header: HTMLElement;
|
|
15
14
|
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
|
|
16
15
|
onCreateComment(commentId: string, local: boolean): void;
|
|
17
16
|
onDeleteComment(commentId: string, local: boolean): void;
|
|
18
17
|
onUpdateComment(commentId: string, local: boolean): void;
|
|
19
|
-
private createHeader;
|
|
20
18
|
private createList;
|
|
21
19
|
private handleListContainerClick;
|
|
22
|
-
private closeMiniComment;
|
|
23
20
|
show(): void;
|
|
24
21
|
hide(): void;
|
|
25
22
|
destroy(): void;
|
|
@@ -8,3 +8,4 @@ export { OnesEditorComments };
|
|
|
8
8
|
export type { CommentItem } from './comment-item';
|
|
9
9
|
export type { CommentGroupItem } from './comments-list/group-item';
|
|
10
10
|
export { removeCommentFromBlock } from './actions/remove-comment-from-block';
|
|
11
|
+
export { editorAddComment } from './actions/editor-add-comment';
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { DocObject, LocalDoc, OnesEditor, OnesEditorComment } from '../../../@ones-editor/core';
|
|
2
|
-
import { AuthMessage } from '../../../@ones-editor/sharedb-doc';
|
|
3
2
|
export type CommentData = {
|
|
4
3
|
[p in string]: unknown;
|
|
5
4
|
};
|
|
5
|
+
export interface OnesEditorCommentController {
|
|
6
|
+
showCommentList: () => void;
|
|
7
|
+
}
|
|
8
|
+
export type CommentRootType = keyof Pick<OnesEditorCommentOptions, 'container' | 'miniContainer' | 'mobileContainer'>;
|
|
6
9
|
export interface OnesEditorCommentOptions {
|
|
7
|
-
|
|
10
|
+
controller: OnesEditorCommentController;
|
|
11
|
+
container?: HTMLElement;
|
|
12
|
+
miniContainer?: HTMLElement;
|
|
13
|
+
mobileContainer?: HTMLElement;
|
|
8
14
|
disableReply?: boolean;
|
|
9
15
|
disableEdit?: boolean;
|
|
10
|
-
onUpdateLayout?: (editor: OnesEditor, data: CommentData) => void;
|
|
11
16
|
pullThreshold?: number;
|
|
17
|
+
onUpdateLayout?: (editor: OnesEditor, data: CommentData) => void;
|
|
18
|
+
onCommentCountChange?: (count: number) => void;
|
|
12
19
|
}
|
|
13
20
|
export interface OnesEditorCommentsEvents {
|
|
14
21
|
onCreateComment: (commentId: string, local: boolean) => void;
|
|
@@ -16,7 +23,6 @@ export interface OnesEditorCommentsEvents {
|
|
|
16
23
|
onUpdateComment: (commentId: string, local: boolean) => void;
|
|
17
24
|
}
|
|
18
25
|
export interface OnesEditorCommentsProvider {
|
|
19
|
-
getAuth: () => AuthMessage;
|
|
20
26
|
getComments: () => OnesEditorComment[];
|
|
21
27
|
getComment: (id: string) => OnesEditorComment;
|
|
22
28
|
getCommentDoc: (commentId: string) => DocObject;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../types';
|
|
2
2
|
import './anchor.scss';
|
|
3
3
|
export declare function createBlockAnchor(editor: OnesEditor, block: BlockElement, id: string, refClientRect?: DOMRect): HTMLElement;
|
|
4
|
+
export declare function createBlockCaretAnchor(editor: OnesEditor, block: BlockElement, offset: number, id: string): HTMLElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DocObject } from '../../doc';
|
|
2
2
|
import { BlockElement, OnesEditor } from '../../types';
|
|
3
|
-
export declare function docToPlainText(editor: OnesEditor, doc: DocObject): string;
|
|
4
3
|
export declare function addMetaToDoc(editor: OnesEditor, doc: DocObject): void;
|
|
5
|
-
export
|
|
4
|
+
export type BeforeCopyCallback = (editor: OnesEditor, event: ClipboardEvent, doc: DocObject) => DocObject | boolean | undefined;
|
|
5
|
+
export declare function editorCopy(editor: OnesEditor, event: ClipboardEvent, beforeCopy?: BeforeCopyCallback): void;
|
|
6
6
|
export declare function editorCopyWithoutEvent(editor: OnesEditor): void;
|
|
7
7
|
export declare function editorCopyBlock(editor: OnesEditor, block: BlockElement): Promise<boolean>;
|
|
@@ -10,6 +10,8 @@ export interface EditorInputCallbacks {
|
|
|
10
10
|
onFocus: () => void;
|
|
11
11
|
onBlur: () => void;
|
|
12
12
|
onPaste: (event: ClipboardEvent) => void;
|
|
13
|
+
onPasteText: (text: string) => void;
|
|
14
|
+
onCopy: (event: ClipboardEvent) => void;
|
|
13
15
|
addHandler: (handler: OnesEditorInputHandler) => void;
|
|
14
16
|
removeHandler: (handler: OnesEditorInputHandler) => void;
|
|
15
17
|
defaultInsertText: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => void;
|
|
@@ -36,6 +38,7 @@ export declare class EditorInput implements OnesEditorInput {
|
|
|
36
38
|
handleCopy: (event: ClipboardEvent) => void;
|
|
37
39
|
handleCut: (event: ClipboardEvent) => void;
|
|
38
40
|
handlePaste: (event: ClipboardEvent) => void;
|
|
41
|
+
handlePasteText: (text: string) => void;
|
|
39
42
|
handleChanged(action: OnesEditorUndoAction): void;
|
|
40
43
|
handleRemoteChanged(type: RemoteChangeType): void;
|
|
41
44
|
addHandler(handler: OnesEditorInputHandler): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DocObject } from '../doc';
|
|
2
2
|
import { BlockElement, OnesEditor } from '../types';
|
|
3
|
-
export declare function blockToDoc(editor: OnesEditor, block: BlockElement): DocObject;
|
|
3
|
+
export declare function blockToDoc(editor: OnesEditor, block: BlockElement, ignoreLockInfo?: boolean): DocObject;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DocBlock, DocObject } from '../doc';
|
|
2
|
-
import { OnesEditor } from '../types';
|
|
3
|
-
export declare function blockToHtml(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
|
|
2
|
+
import { BlockPath, OnesEditor } from '../types';
|
|
3
|
+
export declare function blockToHtml(editor: OnesEditor, blockData: DocBlock, doc: DocObject, path: BlockPath): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DocBlock, DocObject } from '../doc';
|
|
2
|
-
import { OnesEditor } from '../types';
|
|
3
|
-
export declare function blockToMarkdown(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
|
|
2
|
+
import { BlockPath, OnesEditor } from '../types';
|
|
3
|
+
export declare function blockToMarkdown(editor: OnesEditor, blockData: DocBlock, doc: DocObject, path: BlockPath): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DocBlock, DocObject } from '../doc';
|
|
2
|
-
import { OnesEditor } from '../types';
|
|
3
|
-
export declare function blockToText(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
|
|
2
|
+
import { BlockPath, OnesEditor } from '../types';
|
|
3
|
+
export declare function blockToText(editor: OnesEditor, blockData: DocBlock, doc: DocObject, path: BlockPath): string;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { DocObject } from '../doc';
|
|
2
2
|
import { OnesEditor, SelectedBlock } from '../types';
|
|
3
|
-
export declare function selectedBlockToDoc(editor: OnesEditor, selectedBlock: SelectedBlock
|
|
3
|
+
export declare function selectedBlockToDoc(editor: OnesEditor, selectedBlock: SelectedBlock, options?: {
|
|
4
|
+
ignoreLockInfo: boolean;
|
|
5
|
+
}): DocObject;
|
|
@@ -179,15 +179,19 @@ export interface RecognizeLinkResult {
|
|
|
179
179
|
providerName?: string;
|
|
180
180
|
url: string;
|
|
181
181
|
}
|
|
182
|
+
export interface InsertBlockOptions {
|
|
183
|
+
noScroll?: boolean;
|
|
184
|
+
}
|
|
185
|
+
export type UpdateBlockOptions = InsertBlockOptions;
|
|
182
186
|
export interface OnesEditorDoc {
|
|
183
187
|
registerCallback: (callbacks: OnesEditorDocCallbacks) => void;
|
|
184
188
|
unregisterCallback: (callbacks: OnesEditorDocCallbacks) => void;
|
|
185
189
|
toJSON: () => DocObject;
|
|
186
190
|
getContainerBlocks: (containerId: string) => DocBlock[];
|
|
187
191
|
getBlockData: (containerId: string, blockIndex: number) => DocBlock;
|
|
188
|
-
localUpdateBlockText: (containerId: string, blockIndex: number, actions: DocBlockTextActions) => DocBlockText;
|
|
192
|
+
localUpdateBlockText: (containerId: string, blockIndex: number, actions: DocBlockTextActions, options?: UpdateBlockOptions) => DocBlockText;
|
|
189
193
|
localUpdateBlockData: (containerId: string, blockIndex: number, delta: DocBlockDelta, newRange: OnesEditorDocRange) => DocBlock;
|
|
190
|
-
localInsertBlock: (containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange) => DocBlock;
|
|
194
|
+
localInsertBlock: (containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange, options?: InsertBlockOptions) => DocBlock;
|
|
191
195
|
localDeleteBlock: (containerId: string, blockIndex: number, newRange: OnesEditorDocRange) => DocBlock;
|
|
192
196
|
localInsertChildContainer: (containerId: string, blocks: DocBlock[]) => void;
|
|
193
197
|
localDeleteChildContainers: (containerIds: string[]) => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { DocBlockText, DocBlockTextActions, DocBlockTextAttributes } from '../doc';
|
|
1
|
+
import { DocBlockText, DocBlockTextActions, DocBlockTextAttributes, DocBox, DocBlockTextOp } from '../doc';
|
|
2
2
|
export declare function insertText(richText: DocBlockText, offset: number, text: string | DocBlockText, attributes: DocBlockTextAttributes | null): DocBlockText;
|
|
3
|
+
export declare function createBoxOp(boxData: DocBox): DocBlockTextOp;
|
|
3
4
|
export declare function createInsertOps(offset: number, text: string | DocBlockText, attributes: DocBlockTextAttributes | null): DocBlockTextActions;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DocBlock, OnesEditorDocRange } from '../../doc';
|
|
1
|
+
import { InsertBlockOptions, DocBlock, OnesEditorDocRange } from '../../doc';
|
|
2
2
|
import { OnesEditor } from '../../types';
|
|
3
|
-
export declare function editorAutoInsertBlock(editor: OnesEditor, blockData: DocBlock, containerId?: string, blockIndex?: number, newRange?: OnesEditorDocRange): import("../../types").BlockElement;
|
|
3
|
+
export declare function editorAutoInsertBlock(editor: OnesEditor, blockData: DocBlock, containerId?: string, blockIndex?: number, newRange?: OnesEditorDocRange, insertBlockOptions?: InsertBlockOptions): import("../../types").BlockElement;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BlockElement, BreakTextOptions, OnesEditor } from '../../types';
|
|
2
|
+
import { DocBlockAttributes } from '../../doc';
|
|
2
3
|
export interface BreakTextBlockResult {
|
|
3
4
|
block: BlockElement;
|
|
4
5
|
newBlock: BlockElement;
|
|
5
6
|
}
|
|
7
|
+
export declare function copyBlockAttributes(editor: OnesEditor, block: BlockElement): DocBlockAttributes;
|
|
6
8
|
export declare function editorBreakTextBlock(editor: OnesEditor, block: BlockElement, offset: number, options?: BreakTextOptions): BreakTextBlockResult;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OnesEditor, BlockElement } from '../../types';
|
|
2
|
-
export declare function editorDeleteBlockText(editor: OnesEditor, block: BlockElement, offset: number, count: number): number;
|
|
1
|
+
import { OnesEditor, BlockElement, InsertTextOptions } from '../../types';
|
|
2
|
+
export declare function editorDeleteBlockText(editor: OnesEditor, block: BlockElement, offset: number, count: number, options?: InsertTextOptions): number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DocBlock, OnesEditorDocRange } from '../../doc';
|
|
1
|
+
import { DocBlock, InsertBlockOptions, OnesEditorDocRange } from '../../doc';
|
|
2
2
|
import { OnesEditor, BlockElement } from '../../types';
|
|
3
|
-
export declare function editorInsertBlock(editor: OnesEditor, containerId: string, blockIndex: number, blockData: DocBlock, newRange: OnesEditorDocRange): BlockElement;
|
|
3
|
+
export declare function editorInsertBlock(editor: OnesEditor, containerId: string, blockIndex: number, blockData: DocBlock, newRange: OnesEditorDocRange, options?: InsertBlockOptions): BlockElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OnesEditor, BlockElement } from '../../types';
|
|
1
|
+
import { OnesEditor, BlockElement, InsertTextOptions } from '../../types';
|
|
2
2
|
import { DocBlockText, DocBox } from '../../doc';
|
|
3
|
-
export declare function editorInsertTextToBlock(editor: OnesEditor, block: BlockElement, offset: number, text: string | DocBlockText): DocBlockText;
|
|
3
|
+
export declare function editorInsertTextToBlock(editor: OnesEditor, block: BlockElement, offset: number, text: string | DocBlockText, options?: InsertTextOptions): DocBlockText;
|
|
4
4
|
export declare function editorInsertBoxToBlock(editor: OnesEditor, block: BlockElement, offset: number, boxData: DocBox): DocBlockText;
|
|
5
5
|
export declare function editorInsertTextToBlockEx(editor: OnesEditor, text: string | DocBlockText, containerId: string, blockIndex: number, offset: number): DocBlockText;
|
|
6
6
|
export declare function editorInsertText(editor: OnesEditor, text: string | DocBlockText): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OnesEditor } from '../../types';
|
|
2
|
-
export type DomEventCallback = (editor: OnesEditor, event:
|
|
2
|
+
export type DomEventCallback<T = Event> = (editor: OnesEditor, event: T, data: unknown) => void;
|
|
3
3
|
declare class DomEventHandler {
|
|
4
4
|
editor: OnesEditor;
|
|
5
5
|
dom: Element | Document | Window;
|
|
@@ -12,10 +12,10 @@ declare class DomEventHandler {
|
|
|
12
12
|
}
|
|
13
13
|
export declare class EditorDomEvents {
|
|
14
14
|
private editor;
|
|
15
|
-
handlers: Map<
|
|
15
|
+
handlers: Map<Document | Element | Window, DomEventHandler[]>;
|
|
16
16
|
constructor(editor: OnesEditor);
|
|
17
17
|
destroy(): void;
|
|
18
|
-
addEventListener(element: Element | Document | Window, eventName: string, eventHandler: DomEventCallback
|
|
18
|
+
addEventListener<T = Event>(element: Element | Document | Window, eventName: string, eventHandler: DomEventCallback<T>, data?: unknown): void;
|
|
19
19
|
removeEventListener(element: Element | Document | Window | null, eventName: string | null, eventHandler: DomEventCallback): void;
|
|
20
20
|
removeAllListeners(element: Element | Document | Window, eventName?: string): void;
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EditorDocLocalActionCallbacks, OnesEditor } from '../types';
|
|
2
|
-
import { BuildResourceUrlOptions, DocBlock, DocBlockDelta, DocBlockText, DocBlockTextActions, DocObject, OnesEditorDoc, OnesEditorDocCallbacks, OnesEditorDocRange, OnesEditorDocServerMeta, OnesEditorDocStatus, UploadResourceOptions, UploadResourceResult } from '../doc';
|
|
2
|
+
import { BuildResourceUrlOptions, InsertBlockOptions, DocBlock, DocBlockDelta, DocBlockText, DocBlockTextActions, DocObject, OnesEditorDoc, OnesEditorDocCallbacks, OnesEditorDocRange, OnesEditorDocServerMeta, OnesEditorDocStatus, UploadResourceOptions, UploadResourceResult, UpdateBlockOptions } from '../doc';
|
|
3
3
|
import { EventCallbacks } from '../../utils';
|
|
4
4
|
export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> implements OnesEditorDoc, OnesEditorDocCallbacks {
|
|
5
5
|
private editor;
|
|
@@ -13,9 +13,9 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
|
|
|
13
13
|
getVersionHelper(): import("../doc").OnesEditorDocVersionHelper | undefined;
|
|
14
14
|
getContainerBlocks(containerId: string): DocBlock[];
|
|
15
15
|
getBlockData(containerId: string, blockIndex: number): DocBlock;
|
|
16
|
-
localUpdateBlockText(containerId: string, blockIndex: number, actions: DocBlockTextActions): DocBlockText;
|
|
16
|
+
localUpdateBlockText(containerId: string, blockIndex: number, actions: DocBlockTextActions, options?: UpdateBlockOptions): DocBlockText;
|
|
17
17
|
localUpdateBlockData(containerId: string, blockIndex: number, delta: DocBlockDelta, newRange: OnesEditorDocRange): DocBlock;
|
|
18
|
-
localInsertBlock(containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange): DocBlock;
|
|
18
|
+
localInsertBlock(containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange, options?: InsertBlockOptions): DocBlock;
|
|
19
19
|
localDeleteBlock(containerId: string, blockIndex: number, newRange: OnesEditorDocRange): DocBlock;
|
|
20
20
|
localDeleteChildContainers(containerIds: string[]): void;
|
|
21
21
|
localInsertChildContainer(containerId: string, blocks: DocBlock[]): void;
|
|
@@ -38,4 +38,5 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
|
|
|
38
38
|
getRemoteUsers(): import("../doc").OnesEditorRemoteUsers;
|
|
39
39
|
destroy(): void;
|
|
40
40
|
getServerMeta(): OnesEditorDocServerMeta;
|
|
41
|
+
reset(doc: OnesEditorDoc): void;
|
|
41
42
|
}
|
|
@@ -11,7 +11,9 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
|
|
|
11
11
|
onRemoteChanged(type: RemoteChangeType): void;
|
|
12
12
|
onCompositionStart(event: Event): void;
|
|
13
13
|
onUpdateCompositionText(event: Event, text: string, end: boolean): void;
|
|
14
|
+
onCopy(event: ClipboardEvent): void;
|
|
14
15
|
onPaste(event: ClipboardEvent): void;
|
|
16
|
+
onPasteText: (text: string) => Promise<void>;
|
|
15
17
|
onFocus(): void;
|
|
16
18
|
onBlur(): void;
|
|
17
19
|
addHandler(handler: OnesEditorInputHandler): void;
|
|
@@ -23,5 +25,6 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
|
|
|
23
25
|
defaultInsertText(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string): void;
|
|
24
26
|
defaultHandleKeydown(editor: OnesEditor, event: KeyboardEvent): boolean;
|
|
25
27
|
pasteDoc(doc: DocObject): Promise<void>;
|
|
28
|
+
private pasteDocs;
|
|
26
29
|
destroy(): void;
|
|
27
30
|
}
|
|
@@ -22,5 +22,5 @@ import { editorMovePageUp } from './move-page-up';
|
|
|
22
22
|
import { editorMovePageDown } from './move-page-down';
|
|
23
23
|
import { editorSelectPageUp } from './select-page-up';
|
|
24
24
|
import { editorSelectPageDown } from './select-page-down';
|
|
25
|
-
import { editorSelectAll } from './select-all';
|
|
26
|
-
export { editorMoveLeft, editorMoveRight, editorMoveUp, editorMoveDown, editorSelectDown, editorSelectUp, editorSelectLeft, editorSelectRight, editorMoveWordLeft, editorMoveWordEnd, editorSelectWordLeft, editorSelectWordEnd, editorMoveHome, editorMoveEnd, editorSelectHome, editorSelectEnd, editorMovePageUp, editorMovePageDown, editorSelectPageUp, editorSelectPageDown, editorSelectLineHome, editorSelectLineEnd, editorMoveLineHome, editorMoveLineEnd, editorSelectAll, };
|
|
25
|
+
import { editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks } from './select-all';
|
|
26
|
+
export { editorMoveLeft, editorMoveRight, editorMoveUp, editorMoveDown, editorSelectDown, editorSelectUp, editorSelectLeft, editorSelectRight, editorMoveWordLeft, editorMoveWordEnd, editorSelectWordLeft, editorSelectWordEnd, editorMoveHome, editorMoveEnd, editorSelectHome, editorSelectEnd, editorMovePageUp, editorMovePageDown, editorSelectPageUp, editorSelectPageDown, editorSelectLineHome, editorSelectLineEnd, editorMoveLineHome, editorMoveLineEnd, editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks, };
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { OnesEditor } from '../../types';
|
|
1
|
+
import { ContainerElement, OnesEditor, SimpleSelectionRange } from '../../types';
|
|
2
|
+
export declare function isContainerSelectedAllChildBlocks(container: ContainerElement, range: SimpleSelectionRange): boolean;
|
|
2
3
|
export declare function editorSelectAll(editor: OnesEditor): boolean;
|
|
4
|
+
export declare function editorSelectContainer(editor: OnesEditor, container: ContainerElement): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OnesEditor, SimpleBlockPosition } from '../../types';
|
|
2
2
|
export declare function editorGetWordLeftPos(editor: OnesEditor, type: 'move' | 'select'): SimpleBlockPosition | null;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function editorGetWordRightPos(editor: OnesEditor, type: 'move' | 'select'): SimpleBlockPosition | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EditorCaret } from '../blocks/text-blocks/caret/editor-caret';
|
|
2
|
-
import { OnesEditorSelection, BlockElement, BlockPosition, SelectionRange, OnesEditor,
|
|
2
|
+
import { OnesEditorSelection, BlockElement, BlockPosition, SelectionRange, OnesEditor, DeleteBlockEventOptions, ChangeSelectionOptions } from '../types';
|
|
3
3
|
export declare class EditorSelection implements OnesEditorSelection {
|
|
4
4
|
readonly editor: OnesEditor;
|
|
5
5
|
readonly caret: EditorCaret;
|
|
@@ -16,7 +16,7 @@ export declare class EditorSelection implements OnesEditorSelection {
|
|
|
16
16
|
getEndBlock(): BlockElement;
|
|
17
17
|
selectBlock(block: BlockElement, start: number, end?: number): void;
|
|
18
18
|
setSelection(anchor: BlockPosition, focus?: BlockPosition, options?: ChangeSelectionOptions): SelectionRange;
|
|
19
|
-
setRange(range: SelectionRange): SelectionRange;
|
|
19
|
+
setRange(range: SelectionRange, options?: ChangeSelectionOptions): SelectionRange;
|
|
20
20
|
updateSelection(): void;
|
|
21
21
|
getFocusedPos(): BlockPosition;
|
|
22
22
|
getAnchorPos(): BlockPosition;
|
|
@@ -29,6 +29,7 @@ export declare class EditorSelection implements OnesEditorSelection {
|
|
|
29
29
|
private verifyPos;
|
|
30
30
|
private updateFocusedBlock;
|
|
31
31
|
verify(): void;
|
|
32
|
+
to(type: 'text' | 'markdown' | 'html'): string;
|
|
32
33
|
private removeAllBlockFocusedClass;
|
|
33
34
|
private setBlockFocused;
|
|
34
35
|
}
|