@ones-editor/editor 2.1.0-beta.5 → 2.1.0-beta.6
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-menu/src/block-menu-button/menu-button/index.d.ts +1 -1
- package/@ones-editor/callout-block/src/callout-block/callout-quick-menu-item-filter.d.ts +3 -4
- package/@ones-editor/comments/src/index.d.ts +0 -3
- package/@ones-editor/comments/src/text-comments/comments-command-provider.d.ts +4 -3
- package/@ones-editor/core/src/core/blocks/common/block-properties.d.ts +9 -9
- package/@ones-editor/core/src/core/blocks/common/execute-block-command.d.ts +2 -2
- package/@ones-editor/core/src/core/blocks/complex-blocks/child-blocks.d.ts +1 -2
- package/@ones-editor/core/src/core/blocks/text-blocks/base/child.d.ts +7 -2
- package/@ones-editor/core/src/core/command-providers/block-attributes.d.ts +14 -0
- package/@ones-editor/core/src/core/command-providers/commands/index.d.ts +2 -0
- package/@ones-editor/core/src/core/command-providers/commands/inject-source.d.ts +3 -0
- package/@ones-editor/core/src/core/command-providers/commands/merge-commands.d.ts +3 -0
- package/@ones-editor/core/src/core/command-providers/commands/range-commands.d.ts +3 -3
- package/@ones-editor/core/src/core/command-providers/editor-command-providers.d.ts +4 -3
- package/@ones-editor/core/src/core/command-providers/index.d.ts +2 -1
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -1
- package/@ones-editor/core/src/core/containers/root-container.d.ts +4 -4
- package/@ones-editor/core/src/core/doc/doc.d.ts +0 -1
- package/@ones-editor/core/src/core/selection/actions/index.d.ts +2 -1
- package/@ones-editor/core/src/core/selection/index.d.ts +1 -0
- package/@ones-editor/core/src/core/selection/select-handler.d.ts +3 -3
- package/@ones-editor/core/src/core/types.d.ts +29 -35
- package/@ones-editor/core/src/utils/dom.d.ts +3 -0
- package/@ones-editor/core/src/utils/drag-drop.d.ts +8 -3
- package/@ones-editor/image-embed/src/splitter-resizer/index.d.ts +3 -3
- package/@ones-editor/layout-block/src/command-filter.d.ts +7 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/fixed-providers.d.ts +7 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/index.d.ts +18 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/align-dropdown.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/group.d.ts +7 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert-menu.d.ts +13 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert.d.ts +8 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/text-dropdown.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/turn-into.d.ts +8 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/toolbar-handler.d.ts +11 -0
- package/@ones-editor/mobile-helper/src/index.d.ts +6 -0
- package/@ones-editor/mobile-helper/src/selection-gripper/index.d.ts +19 -0
- package/@ones-editor/mobile-helper/src/selection-gripper/select-handle.d.ts +3 -0
- package/@ones-editor/mobile-helper/src/ui/init-menu-item.d.ts +3 -0
- package/@ones-editor/mobile-helper/src/ui/mobile-bottom-menu.d.ts +22 -0
- package/@ones-editor/sharedb-doc/src/index.d.ts +0 -3
- package/@ones-editor/table-block/src/commands/index.d.ts +2 -0
- package/@ones-editor/table-block/src/commands/table-block-commands.d.ts +4 -3
- package/@ones-editor/table-block/src/index.d.ts +4 -1
- package/@ones-editor/table-block/src/table-block/cell-menu/table-cell-dom.d.ts +6 -0
- package/@ones-editor/table-block/src/table-block/table-resize/resize-drag-drop.d.ts +4 -4
- package/@ones-editor/text-commands/src/index.d.ts +1 -2
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/block-menu/block-command-providers.d.ts +10 -0
- package/@ones-editor/{block-menu → ui}/src/block-menu/index.d.ts +3 -1
- package/@ones-editor/ui/src/index.d.ts +22 -10
- package/@ones-editor/ui/src/providers/abstract-providers.d.ts +27 -0
- package/@ones-editor/ui/src/providers/align-dropdown.d.ts +10 -0
- package/@ones-editor/ui/src/{toolbar/commands → providers}/align.d.ts +4 -4
- package/@ones-editor/ui/src/providers/block-hook-provider.d.ts +16 -0
- package/@ones-editor/ui/src/providers/color-provider.d.ts +16 -0
- package/@ones-editor/ui/src/providers/heading.d.ts +13 -0
- package/@ones-editor/ui/src/providers/inline-code-provider.d.ts +12 -0
- package/@ones-editor/ui/src/providers/inline-style-provider.d.ts +10 -0
- package/@ones-editor/ui/src/providers/insert-above.d.ts +9 -0
- package/@ones-editor/ui/src/providers/insert-after.d.ts +9 -0
- package/@ones-editor/ui/src/providers/insert-box-provider.d.ts +12 -0
- package/@ones-editor/ui/src/providers/insert-group.d.ts +7 -0
- package/@ones-editor/ui/src/providers/insert-menu.d.ts +16 -0
- package/@ones-editor/ui/src/providers/link.d.ts +17 -0
- package/@ones-editor/ui/src/providers/list.d.ts +14 -0
- package/@ones-editor/ui/src/providers/paragraph.d.ts +8 -0
- package/@ones-editor/ui/src/providers/proxy-provider.d.ts +10 -0
- package/@ones-editor/ui/src/providers/quoted.d.ts +12 -0
- package/@ones-editor/ui/src/providers/script-with-dropdown.d.ts +9 -0
- package/@ones-editor/ui/src/providers/text-command-provider.d.ts +18 -0
- package/@ones-editor/ui/src/providers/text-fixed-provider.d.ts +16 -0
- package/@ones-editor/ui/src/providers/text-script-provider.d.ts +10 -0
- package/@ones-editor/ui/src/providers/text-styles.d.ts +9 -0
- package/@ones-editor/ui/src/providers/turn-into.d.ts +9 -0
- package/@ones-editor/ui/src/providers/types.d.ts +3 -0
- package/@ones-editor/ui/src/providers/utils/add-section.d.ts +2 -0
- package/@ones-editor/ui/src/{quick-menu → providers/utils}/basic-commands.d.ts +1 -2
- package/@ones-editor/ui/src/providers/utils/inject-block-options.d.ts +5 -0
- package/@ones-editor/ui/src/providers/utils/range-commands.d.ts +2 -0
- package/@ones-editor/ui/src/providers/utils/text-commands.d.ts +3 -0
- package/@ones-editor/{text-commands/src → ui/src/providers/utils}/text-styles.d.ts +3 -1
- package/@ones-editor/ui/src/quick-menu/index.d.ts +6 -18
- package/@ones-editor/ui/src/quick-menu/quick-command-providers.d.ts +10 -0
- package/@ones-editor/ui/src/quick-menu/types.d.ts +0 -4
- package/@ones-editor/ui/src/toolbar/text-commands.d.ts +2 -2
- package/@ones-editor/ui-base/src/color-button/text-color-item.d.ts +1 -0
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +1 -1
- package/@ones-editor/ui-base/src/command-bar/mobile-bottom-menu.d.ts +18 -0
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +2 -1
- package/@ones-editor/ui-base/src/popup/popup.d.ts +1 -1
- package/dist/comments/local-doc-comments-provider.d.ts +1 -2
- package/dist/index.js +19592 -18724
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/@ones-editor/block-menu/src/block-menu/items/block-command-items.d.ts +0 -3
- package/@ones-editor/block-menu/src/block-menu/items/index.d.ts +0 -5
- package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +0 -5
- package/@ones-editor/block-menu/src/block-menu/items/text-styles/text-style-item.d.ts +0 -30
- package/@ones-editor/block-menu/src/block-menu/items/types.d.ts +0 -5
- package/@ones-editor/comments/src/comments-helper/old-version-comment.d.ts +0 -17
- package/@ones-editor/text-commands/src/text-command-provider.d.ts +0 -24
- package/@ones-editor/text-commands/src/text-commands.d.ts +0 -4
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +0 -16
- package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +0 -8
- package/@ones-editor/ui/src/quick-menu/insert-empty-block.d.ts +0 -4
- package/@ones-editor/ui/src/quick-menu/order.d.ts +0 -1
- package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +0 -9
- package/@ones-editor/ui/src/readonly-toolbar/add-comment-to-old-doc.d.ts +0 -22
- package/@ones-editor/ui/src/readonly-toolbar/index.d.ts +0 -30
- package/@ones-editor/ui/src/readonly-toolbar/types.d.ts +0 -12
- package/@ones-editor/ui/src/toolbar/commands/paragraph.d.ts +0 -11
- package/@ones-editor/ui/src/toolbar/commands/turn-into.d.ts +0 -10
- package/@ones-editor/ui/src/toolbar/link-commands.d.ts +0 -7
- package/@ones-editor/ui/src/toolbar/merge-commands.d.ts +0 -2
- /package/@ones-editor/{block-menu → ui}/src/block-menu/standard-block-actions/hook.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { BlockMenu } from '../../../../../@ones-editor/ui';
|
|
2
3
|
import EmptyBlockMenu from '../../empty-block-menu';
|
|
3
|
-
import BlockMenu from '../../block-menu';
|
|
4
4
|
export default class OnesEditorBlockMenuButton {
|
|
5
5
|
private editor;
|
|
6
6
|
buttonElement: HTMLButtonElement;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { OnesEditor, OnesEditorCustom } from '../../../../@ones-editor/core';
|
|
2
|
-
|
|
3
|
-
export declare class CalloutQuickMenuItemFilter implements QuickMenuItemFilter, OnesEditorCustom {
|
|
1
|
+
import { CommandFilter, CommandItemWithSource, OnesEditor, OnesEditorCustom, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class CalloutQuickMenuItemFilter implements CommandFilter, OnesEditorCustom {
|
|
4
3
|
constructor(editor: OnesEditor);
|
|
5
|
-
filter(editor: OnesEditor, items:
|
|
4
|
+
filter(editor: OnesEditor, range: SelectionRange, items: CommandItemWithSource[], source: string[]): CommandItemWithSource[];
|
|
6
5
|
destroy(): void;
|
|
7
6
|
static init(editor: OnesEditor): CalloutQuickMenuItemFilter;
|
|
8
7
|
}
|
|
@@ -8,7 +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 { addCommentToTextBlocks } from './actions/add-comment-to-text-block';
|
|
12
|
-
export { addCommentToBlock } from './actions/add-comment-to-block';
|
|
13
11
|
export { editorAddComment } from './actions/editor-add-comment';
|
|
14
|
-
export * from './comments-helper/old-version-comment';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockElement, CommandItem, CommandItemWithSource, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorCommentsProvider } from '../types';
|
|
3
3
|
import type { OnesEditorComments } from '../comments';
|
|
4
4
|
export default class CommentsCommandProvider implements OnesEditorCommandProvider {
|
|
5
5
|
private provider;
|
|
6
6
|
private editorComments;
|
|
7
7
|
id: string;
|
|
8
|
+
groupIndex: number;
|
|
8
9
|
constructor(provider: OnesEditorCommentsProvider, editorComments: OnesEditorComments);
|
|
9
|
-
getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange):
|
|
10
|
+
getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): CommandItem[];
|
|
10
11
|
hideToolbar(editor: OnesEditor): void;
|
|
11
|
-
executeRangeCommand(editor: OnesEditor, range: SelectionRange, command:
|
|
12
|
+
executeRangeCommand(editor: OnesEditor, range: SelectionRange, command: CommandItemWithSource, params: CommandParams, result?: CommandResult): boolean;
|
|
12
13
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BlockCommands, BlockElement,
|
|
1
|
+
import { BlockCommands, BlockElement, OnesEditor } from '../../types';
|
|
2
2
|
export declare function getBlockProperties(editor: OnesEditor, block: BlockElement): import("../../types").BlockProperties | undefined;
|
|
3
|
-
export declare function getBlockCommandsWithHook(editor: OnesEditor, block: BlockElement
|
|
4
|
-
|
|
5
|
-
element:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
export declare function getBlockCommandsWithHook(editor: OnesEditor, block: BlockElement): Record<string, BlockCommands>;
|
|
4
|
+
export declare function getSpecialBlockCommands(editor: OnesEditor, blockElement: BlockElement, group: string): {
|
|
5
|
+
element: import("../../types").BlockContentElement;
|
|
6
|
+
commands: import("../../types").CommandItem[];
|
|
7
|
+
} | {
|
|
8
|
+
element: null;
|
|
9
|
+
commands: never[];
|
|
10
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockElement, CommandItem, CommandItemWithSource, OnesEditor } from '../../types';
|
|
2
2
|
export declare function executeEmbedBlockCommand(editor: OnesEditor, block: BlockElement, commandGroup: string, item: CommandItem): unknown;
|
|
3
|
-
export declare function executeBlockCommand(editor: OnesEditor, block: BlockElement, commandGroup: string, item:
|
|
3
|
+
export declare function executeBlockCommand(editor: OnesEditor, block: BlockElement, commandGroup: string, item: CommandItemWithSource): unknown;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { BlockElement, OnesEditor, SelectedBlock
|
|
1
|
+
import { BlockElement, OnesEditor, SelectedBlock } from '../../types';
|
|
2
2
|
export type GetAllChildBlocksOptions = {
|
|
3
3
|
simpleBlockOnly?: boolean;
|
|
4
4
|
visibleOnly?: boolean;
|
|
5
|
-
range?: SelectionRange;
|
|
6
5
|
};
|
|
7
6
|
export declare function getAllChildBlocks(editor: OnesEditor, options?: GetAllChildBlocksOptions): BlockElement[];
|
|
8
7
|
export declare function getAllSelectedBlocks(editor: OnesEditor, options?: GetAllChildBlocksOptions): SelectedBlock[];
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { BlockElement,
|
|
2
|
-
export type
|
|
1
|
+
import { BlockElement, BoxElement, InsertionElement } from '../../../types';
|
|
2
|
+
export type TextBlockContentTextChild = HTMLSpanElement & {
|
|
3
|
+
__neverUse: 'TextBlockContentTextChild';
|
|
4
|
+
};
|
|
5
|
+
export type TextBlockContentInsertionChild = InsertionElement;
|
|
6
|
+
export type TextBlockContentBoxChild = BoxElement;
|
|
7
|
+
export type TextBlockContentChild = TextBlockContentTextChild | TextBlockContentBoxChild | TextBlockContentInsertionChild;
|
|
3
8
|
export type TextBlockContentChildren = TextBlockContentChild[];
|
|
4
9
|
export type TextBlockContentChildType = 'text' | 'box' | 'insertion';
|
|
5
10
|
export declare function isTextBlockContentChild(elem: Element): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DocBlockTextAttributes } from '../doc';
|
|
2
|
+
import { CommandParams, OnesEditor, OnesEditorCustom } from '../types';
|
|
3
|
+
export default class BlockAttributesHandler implements OnesEditorCustom {
|
|
4
|
+
private editor;
|
|
5
|
+
private textBlockAttributes;
|
|
6
|
+
private activeBlockAttributes;
|
|
7
|
+
constructor(editor: OnesEditor);
|
|
8
|
+
clear: () => void;
|
|
9
|
+
destroy(): void;
|
|
10
|
+
getEmptyBlockTextAttributes(blockId: string): DocBlockTextAttributes | undefined;
|
|
11
|
+
setEmptyBlockTextAttributes: (blockId: string, attributes: CommandParams) => void;
|
|
12
|
+
setActiveAttribute: (attribute: string, value: unknown) => void;
|
|
13
|
+
getActiveAttribute: () => Map<string, unknown>;
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getRangeCommands(range: SelectionRange, source: string):
|
|
3
|
-
export declare function executeRangeCommand(range: SelectionRange, command:
|
|
1
|
+
import { CommandItemWithSource, CommandParams, CommandResult, SelectionRange } from '../../types';
|
|
2
|
+
export declare function getRangeCommands(range: SelectionRange, source: string): CommandItemWithSource[];
|
|
3
|
+
export declare function executeRangeCommand(range: SelectionRange, command: CommandItemWithSource, params: CommandParams): {
|
|
4
4
|
[index: string]: CommandResult;
|
|
5
5
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { DocBlockTextAttributes } from '../doc';
|
|
2
|
-
import { OnesEditor, OnesEditorCommandProviders, OnesEditorCommandProvider, SelectionRange, CommandParams,
|
|
2
|
+
import { OnesEditor, OnesEditorCommandProviders, OnesEditorCommandProvider, SelectionRange, CommandParams, CommandItemWithSource } from '../types';
|
|
3
3
|
export default class EditorCommandProviders implements OnesEditorCommandProviders {
|
|
4
4
|
private editor;
|
|
5
|
+
id: string;
|
|
5
6
|
private providers;
|
|
6
7
|
constructor(editor: OnesEditor);
|
|
7
8
|
registerCommandProvider(provider: OnesEditorCommandProvider): void;
|
|
8
9
|
getCommandProviders(): OnesEditorCommandProvider[];
|
|
9
10
|
getCommandProvider(id: string): OnesEditorCommandProvider;
|
|
10
|
-
getCommands(range: SelectionRange
|
|
11
|
-
executeCommand(range: SelectionRange, command:
|
|
11
|
+
getCommands(range: SelectionRange): CommandItemWithSource[];
|
|
12
|
+
executeCommand(range: SelectionRange, command: CommandItemWithSource, params: CommandParams): {
|
|
12
13
|
[index: string]: import("../types").CommandResult;
|
|
13
14
|
};
|
|
14
15
|
getEmptyBlockTextAttributes(editor: OnesEditor, blockId: string): DocBlockTextAttributes | undefined;
|
|
@@ -34,7 +34,7 @@ export declare class EditorInput implements OnesEditorInput {
|
|
|
34
34
|
isInDisableScrollMask(target: Node): boolean;
|
|
35
35
|
handleWindowBlur: () => void;
|
|
36
36
|
handleWindowFocus: () => void;
|
|
37
|
-
handleDocumentClick: (event: MouseEvent) => void;
|
|
37
|
+
handleDocumentClick: (event: MouseEvent | TouchEvent) => void;
|
|
38
38
|
handleDocumentSelectionChange: () => void;
|
|
39
39
|
handleEditorSelectionChanged: () => void;
|
|
40
40
|
handleReadonlyChanged: () => void;
|
|
@@ -12,12 +12,12 @@ export declare class RootContainer {
|
|
|
12
12
|
destroy(): void;
|
|
13
13
|
handleContextMenu: (event: MouseEvent) => void;
|
|
14
14
|
handleResize: () => void;
|
|
15
|
-
handleClick: (event: MouseEvent) => void;
|
|
16
|
-
handleBlockClick: (event: MouseEvent, block: BlockElement, elem: Element) => void;
|
|
15
|
+
handleClick: (event: MouseEvent | TouchEvent) => void;
|
|
16
|
+
handleBlockClick: (event: MouseEvent | TouchEvent, block: BlockElement, elem: Element) => void;
|
|
17
17
|
handleDblClick: (event: MouseEvent) => void;
|
|
18
|
-
handleMouseDown: (event: MouseEvent) => void;
|
|
18
|
+
handleMouseDown: (event: TouchEvent | MouseEvent) => void;
|
|
19
19
|
handleMouseMove: (event: MouseEvent) => void;
|
|
20
|
-
handleMouseUp: (event: MouseEvent) => void;
|
|
20
|
+
handleMouseUp: (event: MouseEvent | TouchEvent) => void;
|
|
21
21
|
handleCaptureClick: (event: MouseEvent) => void;
|
|
22
22
|
handleCaptureDbClick: (event: MouseEvent) => void;
|
|
23
23
|
reload(): void;
|
|
@@ -23,4 +23,5 @@ import { editorMovePageDown } from './move-page-down';
|
|
|
23
23
|
import { editorSelectPageUp } from './select-page-up';
|
|
24
24
|
import { editorSelectPageDown } from './select-page-down';
|
|
25
25
|
import { editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks } from './select-all';
|
|
26
|
-
|
|
26
|
+
import { editorSelectWord } from './select-word';
|
|
27
|
+
export { editorMoveLeft, editorMoveRight, editorMoveUp, editorMoveDown, editorSelectDown, editorSelectUp, editorSelectLeft, editorSelectRight, editorSelectWord, editorMoveWordLeft, editorMoveWordEnd, editorSelectWordLeft, editorSelectWordEnd, editorMoveHome, editorMoveEnd, editorSelectHome, editorSelectEnd, editorMovePageUp, editorMovePageDown, editorSelectPageUp, editorSelectPageDown, editorSelectLineHome, editorSelectLineEnd, editorMoveLineHome, editorMoveLineEnd, editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks, };
|
|
@@ -4,16 +4,16 @@ export declare class EditorSelectionHandler implements OnesEditorSelectionHandle
|
|
|
4
4
|
editor: OnesEditor;
|
|
5
5
|
startPos: BlockPosition | null;
|
|
6
6
|
lastCaretRect: DOMRect;
|
|
7
|
-
mouseDownEvent: MouseEvent | null;
|
|
7
|
+
mouseDownEvent: TouchEvent | MouseEvent | null;
|
|
8
8
|
autoScroll: AutoScroll | null;
|
|
9
9
|
constructor(editor: OnesEditor);
|
|
10
10
|
isSelecting(): boolean;
|
|
11
11
|
stopSelection(): void;
|
|
12
|
-
handleMouseDown: (event: MouseEvent, options: {
|
|
12
|
+
handleMouseDown: (event: MouseEvent | TouchEvent, options: {
|
|
13
13
|
autoScroll: boolean;
|
|
14
14
|
}) => void;
|
|
15
15
|
handleMouseMove: (event: MouseEvent) => void;
|
|
16
|
-
handleMouseUp: (event: MouseEvent) => void;
|
|
16
|
+
handleMouseUp: (event: MouseEvent | TouchEvent) => void;
|
|
17
17
|
handleDblClick(event: MouseEvent): void;
|
|
18
18
|
handleTripleClick(event: MouseEvent): void;
|
|
19
19
|
}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
2
|
import { DocBlock, DocBlockAttributes, DocBlockDelta, DocBlocks, DocBlockText, DocBlockTextAttributes, DocBox, DocEmbedBlock, DocEmbedData, DocInsertion, DocObject, InsertBlockOptions, OnesEditorDoc, OnesEditorDocRange, UpdateBlockOptions } from './doc';
|
|
3
|
-
export type TextBlockContentTextChild = HTMLSpanElement & {
|
|
4
|
-
__neverUse: 'TextBlockContentTextChild';
|
|
5
|
-
};
|
|
6
|
-
export type TextBlockContentInsertionChild = InsertionElement;
|
|
7
|
-
export type TextBlockContentBoxChild = BoxElement;
|
|
8
|
-
export type TextBlockContentChild = TextBlockContentTextChild | TextBlockContentBoxChild | TextBlockContentInsertionChild;
|
|
9
3
|
export type ContainerElement = HTMLDivElement & {
|
|
10
4
|
__neverUse: 'ContainerElement';
|
|
11
5
|
};
|
|
@@ -58,7 +52,6 @@ export type BlockPosition = SimpleBlockPosition | ComplexBlockPosition;
|
|
|
58
52
|
export interface BoxCommands {
|
|
59
53
|
group: string;
|
|
60
54
|
commands: CommandItem[];
|
|
61
|
-
startGroup?: boolean;
|
|
62
55
|
executeCommand: (editor: OnesEditor, block: BlockElement, box: BoxElement, item: CommandItem) => unknown;
|
|
63
56
|
}
|
|
64
57
|
export interface BoxProperties {
|
|
@@ -126,7 +119,6 @@ export interface Closeable {
|
|
|
126
119
|
click: (item: CommandItem, target: HTMLElement) => void;
|
|
127
120
|
}
|
|
128
121
|
export type CommandItemChildrenPlacement = 'auto' | 'top' | 'left' | 'right' | 'bottom' | 'auto-start' | 'auto-end' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'right-start' | 'right-end' | 'left-start' | 'left-end';
|
|
129
|
-
export type CommandItemMenuType = 'inline' | 'sibling';
|
|
130
122
|
export interface CommandItem {
|
|
131
123
|
id: string;
|
|
132
124
|
name: string;
|
|
@@ -137,7 +129,7 @@ export interface CommandItem {
|
|
|
137
129
|
type?: CommandItemType;
|
|
138
130
|
element?: HTMLElement | ((item: CommandItem) => HTMLElement);
|
|
139
131
|
icon?: string;
|
|
140
|
-
childrenType?: 'menu' | 'toolbar';
|
|
132
|
+
childrenType?: 'menu' | 'toolbar' | 'mobile-bottom-menu';
|
|
141
133
|
children?: CommandItem[];
|
|
142
134
|
childrenMenuId?: string;
|
|
143
135
|
data?: unknown;
|
|
@@ -159,18 +151,8 @@ export interface CommandItem {
|
|
|
159
151
|
/**
|
|
160
152
|
* defaults to true
|
|
161
153
|
*/
|
|
162
|
-
shouldShown?: (currentBlock: BlockElement | undefined, menuType: CommandItemMenuType) => boolean;
|
|
163
|
-
/**
|
|
164
|
-
* defaults to true
|
|
165
|
-
*/
|
|
166
154
|
clickToClose?: boolean;
|
|
167
155
|
}
|
|
168
|
-
export interface BlockCommandItem extends CommandItem {
|
|
169
|
-
blockId: string;
|
|
170
|
-
blockType: string;
|
|
171
|
-
blockKind: BlockKind;
|
|
172
|
-
groupIndex: number;
|
|
173
|
-
}
|
|
174
156
|
export type StyleType = boolean | string | number;
|
|
175
157
|
export type BlockStyles = {
|
|
176
158
|
[index: string]: StyleType;
|
|
@@ -181,11 +163,9 @@ export type BlockPathComponent = {
|
|
|
181
163
|
};
|
|
182
164
|
export type BlockPath = BlockPathComponent[];
|
|
183
165
|
export interface BlockCommands {
|
|
184
|
-
element?: HTMLElement;
|
|
185
166
|
group: string;
|
|
186
167
|
commands: CommandItem[];
|
|
187
|
-
|
|
188
|
-
executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem, child: TextBlockContentChild | null) => unknown;
|
|
168
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem) => unknown;
|
|
189
169
|
}
|
|
190
170
|
export interface BlockProperties {
|
|
191
171
|
blockCommands?: Record<string, BlockCommands>;
|
|
@@ -668,11 +648,11 @@ export interface OnesEditorInput {
|
|
|
668
648
|
export interface OnesEditorSelectionHandler {
|
|
669
649
|
isSelecting: () => boolean;
|
|
670
650
|
stopSelection: () => void;
|
|
671
|
-
handleMouseDown: (event: MouseEvent, options: {
|
|
651
|
+
handleMouseDown: (event: MouseEvent | TouchEvent, options: {
|
|
672
652
|
autoScroll: boolean;
|
|
673
653
|
}) => void;
|
|
674
654
|
handleMouseMove: (event: MouseEvent) => void;
|
|
675
|
-
handleMouseUp: (event: MouseEvent) => void;
|
|
655
|
+
handleMouseUp: (event: MouseEvent | TouchEvent) => void;
|
|
676
656
|
handleDblClick: (event: MouseEvent) => void;
|
|
677
657
|
handleTripleClick: (event: MouseEvent) => void;
|
|
678
658
|
}
|
|
@@ -723,32 +703,46 @@ export interface OnesEditorInsertions {
|
|
|
723
703
|
}
|
|
724
704
|
export type CommandParams = {
|
|
725
705
|
[index: string]: unknown;
|
|
706
|
+
} & {
|
|
707
|
+
source?: string[];
|
|
726
708
|
};
|
|
727
709
|
export type CommandResult = {
|
|
728
710
|
[index: string]: unknown;
|
|
729
711
|
};
|
|
730
712
|
export interface OnesEditorCommandProvider {
|
|
731
713
|
id: string;
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
714
|
+
groupIndex?: number;
|
|
715
|
+
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: {
|
|
716
|
+
isFilter: boolean;
|
|
717
|
+
}) => CommandItem[];
|
|
718
|
+
getInsertCommands?: (editor: OnesEditor, containerId: string, blockIndex: number) => CommandItem[];
|
|
719
|
+
executeInsertCommand?: (editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItem, params: CommandParams, result?: CommandResult) => boolean;
|
|
720
|
+
executeRangeCommand?: (editor: OnesEditor, range: SelectionRange, command: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
|
|
721
|
+
executeCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItem, params: CommandParams, result?: CommandResult) => boolean;
|
|
722
|
+
filterCommands?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, commands: CommandItemWithSource[]) => CommandItemWithSource[] | undefined;
|
|
723
|
+
beforeExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItem, params: CommandParams) => boolean | undefined;
|
|
724
|
+
afterExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItem, params: CommandParams, result: CommandResult) => void;
|
|
737
725
|
getEmptyBlockTextAttributes?: (editor: OnesEditor, blockId: string) => DocBlockTextAttributes | undefined;
|
|
738
|
-
executeRangeCommand?: (editor: OnesEditor, range: SelectionRange, command: BlockCommandItemWithSource, params: CommandParams, result: CommandResult) => boolean;
|
|
739
726
|
}
|
|
740
|
-
export interface
|
|
727
|
+
export interface CommandItemWithSource extends CommandItem {
|
|
741
728
|
source: string;
|
|
742
729
|
}
|
|
730
|
+
export interface CommandFilter {
|
|
731
|
+
filter: (editor: OnesEditor, range: SelectionRange, items: CommandItemWithSource[], source: string[]) => CommandItemWithSource[];
|
|
732
|
+
}
|
|
733
|
+
export type CommandFilterId = keyof any;
|
|
743
734
|
export interface OnesEditorCommandProviders {
|
|
735
|
+
commandFilters?: Map<CommandFilterId, CommandFilter>;
|
|
736
|
+
addFilter?: (id: CommandFilterId, filter: CommandFilter) => void;
|
|
737
|
+
filterItems?: (range: SelectionRange, items: CommandItemWithSource[]) => CommandItemWithSource[];
|
|
744
738
|
registerCommandProvider: (provider: OnesEditorCommandProvider) => void;
|
|
745
739
|
getCommandProviders: () => OnesEditorCommandProvider[];
|
|
746
740
|
getCommandProvider: (id: string) => OnesEditorCommandProvider;
|
|
747
|
-
getCommands: (range: SelectionRange
|
|
748
|
-
executeCommand: (range: SelectionRange, item:
|
|
741
|
+
getCommands: (range: SelectionRange) => CommandItemWithSource[];
|
|
742
|
+
executeCommand: (range: SelectionRange, item: CommandItemWithSource, params: CommandParams) => {
|
|
749
743
|
[index: string]: CommandResult;
|
|
750
744
|
};
|
|
751
|
-
getEmptyBlockTextAttributes
|
|
745
|
+
getEmptyBlockTextAttributes?: (editor: OnesEditor, blockId: string) => DocBlockTextAttributes | undefined;
|
|
752
746
|
}
|
|
753
747
|
export interface EditorDocLocalActionCallbacks {
|
|
754
748
|
onBeforeUpdateBlockText: (containerId: string, blockId: string, oldText: DocBlockText, newText: DocBlockText, newRange: OnesEditorDocRange) => void;
|
|
@@ -762,5 +756,5 @@ export interface OnesEditorBlockHook {
|
|
|
762
756
|
create?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
763
757
|
update?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
764
758
|
writable?: (editor: OnesEditor, blockElement: BlockElement | BlockElement[]) => boolean | undefined;
|
|
765
|
-
commands?: (editor: OnesEditor, blockElement: BlockElement
|
|
759
|
+
commands?: (editor: OnesEditor, blockElement: BlockElement) => BlockCommands;
|
|
766
760
|
}
|
|
@@ -37,4 +37,7 @@ export declare function bindKeyDownEvent(input: HTMLInputElement | HTMLTextAreaE
|
|
|
37
37
|
export declare function getElementFromPoint(x: number, y: number, options?: {
|
|
38
38
|
noFilter: boolean;
|
|
39
39
|
}): Element;
|
|
40
|
+
export declare function ensureIsMobileEvent(events: MouseEvent | TouchEvent): events is TouchEvent;
|
|
41
|
+
export declare function createMouseEventFromTouchEvent(event: TouchEvent, type: 'mousedown' | 'mousemove' | 'mouseup' | 'click'): MouseEvent;
|
|
42
|
+
export declare function bindTouchEnd(elem: HTMLElement | Document, callback: (e: any) => void): void;
|
|
40
43
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type DragStartHandler<T> = (drag: DragDrop<T>, event: MouseEvent, elem: HTMLElement) => void;
|
|
2
|
-
export type DraggingHandler<T> = (drag: DragDrop<T>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number) => void;
|
|
3
|
-
export type DragEndHandler<T> = (drag: DragDrop<T>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number) => void;
|
|
1
|
+
export type DragStartHandler<T> = (drag: DragDrop<T>, event: MouseEvent | TouchEvent, elem: HTMLElement) => void;
|
|
2
|
+
export type DraggingHandler<T> = (drag: DragDrop<T>, event: MouseEvent | TouchEvent, elem: HTMLElement, deltaX: number, deltaY: number) => void;
|
|
3
|
+
export type DragEndHandler<T> = (drag: DragDrop<T>, event: MouseEvent | TouchEvent, elem: HTMLElement, deltaX: number, deltaY: number) => void;
|
|
4
4
|
export interface DragDropOptions<T> {
|
|
5
5
|
elem: HTMLElement;
|
|
6
6
|
onDragStart: DragStartHandler<T>;
|
|
@@ -10,6 +10,7 @@ export interface DragDropOptions<T> {
|
|
|
10
10
|
minThreshold?: number;
|
|
11
11
|
cursor?: string;
|
|
12
12
|
mouseDownEvent?: MouseEvent;
|
|
13
|
+
mobile?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare const MIN_DISTANCE_THRESHOLD = 3;
|
|
15
16
|
export declare class DragDrop<T> {
|
|
@@ -37,5 +38,9 @@ export declare class DragDrop<T> {
|
|
|
37
38
|
private onDragging;
|
|
38
39
|
private onDragEnd;
|
|
39
40
|
destroy(): void;
|
|
41
|
+
static getEventPosition(event: MouseEvent | TouchEvent): {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
};
|
|
40
45
|
}
|
|
41
46
|
export declare function registerDragDrop<T>(options: DragDropOptions<T>): DragDrop<T>;
|
|
@@ -11,7 +11,7 @@ export declare class ImageSplitterResizer implements DragDropOptions<ImageSplitt
|
|
|
11
11
|
cursor: string;
|
|
12
12
|
initWidths: number[];
|
|
13
13
|
constructor(editor: OnesEditor, elem: HTMLElement, data: ImageSplitterResizerData, mouseDownEvent: MouseEvent);
|
|
14
|
-
onDragStart(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent, elem: HTMLElement): void;
|
|
15
|
-
onDragging(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number): void;
|
|
16
|
-
onDragEnd(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number): void;
|
|
14
|
+
onDragStart(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent | TouchEvent, elem: HTMLElement): void;
|
|
15
|
+
onDragging(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent | TouchEvent, elem: HTMLElement, deltaX: number, deltaY: number): void;
|
|
16
|
+
onDragEnd(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent | TouchEvent, elem: HTMLElement, deltaX: number, deltaY: number): void;
|
|
17
17
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommandFilter, CommandItemWithSource, OnesEditor, OnesEditorCustom, SelectionRange } from '../../../@ones-editor/core';
|
|
2
|
+
export declare class LayoutQuickMenuItemFilter implements CommandFilter, OnesEditorCustom {
|
|
3
|
+
constructor(editor: OnesEditor);
|
|
4
|
+
filter(editor: OnesEditor, range: SelectionRange, items: CommandItemWithSource[], source: string[]): CommandItemWithSource[];
|
|
5
|
+
destroy(): void;
|
|
6
|
+
static init(editor: OnesEditor): LayoutQuickMenuItemFilter;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OnesEditor, OnesEditorCommandProviders } from '../../../../@ones-editor/core';
|
|
2
|
+
import { AbstractProvider } from '../../../../@ones-editor/ui';
|
|
3
|
+
export declare class FixedProviders extends AbstractProvider implements OnesEditorCommandProviders {
|
|
4
|
+
protected editor: OnesEditor;
|
|
5
|
+
id: string;
|
|
6
|
+
constructor(editor: OnesEditor);
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import './mobile.scss';
|
|
3
|
+
export declare class CommandHandler {
|
|
4
|
+
private editor;
|
|
5
|
+
private commandBar;
|
|
6
|
+
private showKeyboard;
|
|
7
|
+
private initViewportHeight;
|
|
8
|
+
constructor(editor: OnesEditor);
|
|
9
|
+
destroy(): void;
|
|
10
|
+
private get isKeyboardShow();
|
|
11
|
+
private get virtualViewportHeight();
|
|
12
|
+
private get virtualViewportOffsetTop();
|
|
13
|
+
private setDebugInfo;
|
|
14
|
+
toggle: () => void;
|
|
15
|
+
handleViewportScroll: () => void;
|
|
16
|
+
handleFocusIn: () => void;
|
|
17
|
+
handleFocusOut: (event: FocusEvent) => void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BlockElement, CommandItem, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { ProxyProvider } from '../../../../../@ones-editor/ui';
|
|
3
|
+
export default class AlignDropdownProvider extends ProxyProvider implements OnesEditorCommandProvider {
|
|
4
|
+
private editor;
|
|
5
|
+
id: string;
|
|
6
|
+
constructor(editor: OnesEditor);
|
|
7
|
+
getInsertCommands: () => never[];
|
|
8
|
+
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OnesEditor, OnesEditorCommandProvider } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { ProxyProvider } from '../../../../../@ones-editor/ui';
|
|
3
|
+
export default class GroupProvider extends ProxyProvider implements OnesEditorCommandProvider {
|
|
4
|
+
private editor;
|
|
5
|
+
id: string;
|
|
6
|
+
constructor(editor: OnesEditor);
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BlockElement, CommandItem, CommandParams, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { ProxyProvider } from '../../../../../@ones-editor/ui';
|
|
3
|
+
export default class InsertMenuProvider extends ProxyProvider {
|
|
4
|
+
private editor;
|
|
5
|
+
id: string;
|
|
6
|
+
whiteList: string[];
|
|
7
|
+
providers: OnesEditorCommandProvider[];
|
|
8
|
+
constructor(editor: OnesEditor);
|
|
9
|
+
getInsertCommands: () => CommandItem[];
|
|
10
|
+
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
|
|
11
|
+
executeInsertCommand: () => boolean;
|
|
12
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItem, params: CommandParams) => boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BlockElement, CommandItem, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { ProxyProvider } from '../../../../../@ones-editor/ui';
|
|
3
|
+
export default class InsertProvider extends ProxyProvider implements OnesEditorCommandProvider {
|
|
4
|
+
private editor;
|
|
5
|
+
id: string;
|
|
6
|
+
constructor(editor: OnesEditor);
|
|
7
|
+
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BlockElement, CommandItem, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { ProxyProvider } from '../../../../../@ones-editor/ui';
|
|
3
|
+
export default class TextDropdownProvider extends ProxyProvider implements OnesEditorCommandProvider {
|
|
4
|
+
private editor;
|
|
5
|
+
id: string;
|
|
6
|
+
constructor(editor: OnesEditor);
|
|
7
|
+
getInsertCommands: () => never[];
|
|
8
|
+
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BlockElement, CommandItem, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { ProxyProvider } from '../../../../../@ones-editor/ui';
|
|
3
|
+
export default class TurnIntoCommandProvider extends ProxyProvider implements OnesEditorCommandProvider {
|
|
4
|
+
private editor;
|
|
5
|
+
id: string;
|
|
6
|
+
constructor(editor: OnesEditor);
|
|
7
|
+
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommandItem, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class MobileToolbarHandler {
|
|
3
|
+
private editor;
|
|
4
|
+
private mobileToolbar;
|
|
5
|
+
private fixedProviders;
|
|
6
|
+
bar: HTMLElement;
|
|
7
|
+
constructor(editor: OnesEditor, parent: HTMLElement);
|
|
8
|
+
private handleSelectionChange;
|
|
9
|
+
handleClick: (_: any, item: CommandItem) => void;
|
|
10
|
+
destroy(): void;
|
|
11
|
+
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { OnesEditor, OnesEditorCustom } from '../../../@ones-editor/core';
|
|
2
|
+
import { CommandHandler } from './fixed-toolbar';
|
|
3
|
+
import './mobile-helper-styles.scss';
|
|
4
|
+
export { CommandHandler };
|
|
2
5
|
export declare class OnesEditorMobileHelper implements OnesEditorCustom {
|
|
3
6
|
private editor;
|
|
4
7
|
private longPressTimeout;
|
|
8
|
+
private gripper;
|
|
5
9
|
constructor(editor: OnesEditor);
|
|
6
10
|
destroy(): void;
|
|
7
11
|
handleSelectionChange: () => void;
|
|
8
12
|
handleLongPress: (event: TouchEvent) => void;
|
|
13
|
+
private isMoving;
|
|
14
|
+
handleTouchMove: (event: TouchEvent) => void;
|
|
9
15
|
handleTouchStart: (event: TouchEvent) => void;
|
|
10
16
|
handleTouchEnd: (event: TouchEvent) => void;
|
|
11
17
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DragDrop, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
interface DragData {
|
|
3
|
+
type: 'start' | 'end';
|
|
4
|
+
}
|
|
5
|
+
export default class SelectionGripper {
|
|
6
|
+
private editor;
|
|
7
|
+
private startGripper;
|
|
8
|
+
private endGripper;
|
|
9
|
+
private dragDropStart;
|
|
10
|
+
private dragDropEnd;
|
|
11
|
+
constructor(editor: OnesEditor);
|
|
12
|
+
destroy(): void;
|
|
13
|
+
handleDragStart: (drag: DragDrop<DragData>, event: MouseEvent | TouchEvent, elem: HTMLElement) => void;
|
|
14
|
+
handleDragging: (drag: DragDrop<DragData>, event: MouseEvent | TouchEvent, elem: HTMLElement) => void;
|
|
15
|
+
handleDragEnd: (drag: DragDrop<DragData>, event: MouseEvent | TouchEvent, elem: HTMLElement) => void;
|
|
16
|
+
update(): void;
|
|
17
|
+
close(): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|