@ones-editor/editor 2.2.10-beta.3 → 2.2.10-beta.5
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/core/src/core/blocks/text-blocks/base/text-range.d.ts +1 -1
- package/@ones-editor/core/src/core/editor/editor-dom/dom-events.d.ts +2 -2
- package/@ones-editor/core/src/core/selection/range-from-point.d.ts +1 -1
- package/@ones-editor/core/src/core/types.d.ts +2 -2
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +31 -30
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../types';
|
|
2
2
|
import EditorSimpleSelectionRange from '../../../selection/range/simple-range';
|
|
3
|
-
export declare function getTextBlockRangeFromPoint(editor: OnesEditor, block: BlockElement, xOrign: number, yOrign: number): EditorSimpleSelectionRange | null;
|
|
3
|
+
export declare function getTextBlockRangeFromPoint(editor: OnesEditor, block: BlockElement, xOrign: number, yOrign: number, dragging?: boolean): EditorSimpleSelectionRange | null;
|
|
@@ -6,7 +6,7 @@ declare class DomEventHandler {
|
|
|
6
6
|
name: string;
|
|
7
7
|
handler: DomEventCallback;
|
|
8
8
|
data: unknown;
|
|
9
|
-
constructor(editor: OnesEditor, dom: Element | Document | Window, name: string, handler: DomEventCallback, data: unknown);
|
|
9
|
+
constructor(editor: OnesEditor, dom: Element | Document | Window, name: string, handler: DomEventCallback, data: unknown, options?: boolean | AddEventListenerOptions);
|
|
10
10
|
handleEvent: (event: Event) => void;
|
|
11
11
|
destroy(): void;
|
|
12
12
|
}
|
|
@@ -15,7 +15,7 @@ export declare class EditorDomEvents {
|
|
|
15
15
|
handlers: Map<Element | Document | Window, DomEventHandler[]>;
|
|
16
16
|
constructor(editor: OnesEditor);
|
|
17
17
|
destroy(): void;
|
|
18
|
-
addEventListener<T = Event>(element: Element | Document | Window, eventName: string, eventHandler: DomEventCallback<T>, data?: unknown): void;
|
|
18
|
+
addEventListener<T = Event>(element: Element | Document | Window, eventName: string, eventHandler: DomEventCallback<T>, data?: unknown, options?: boolean | AddEventListenerOptions): 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,4 +1,4 @@
|
|
|
1
1
|
import { SelectionRange, OnesEditor } from '../types';
|
|
2
2
|
import EditorSimpleSelectionRange from './range/simple-range';
|
|
3
|
-
export declare function getBlockRangeFromPoint(editor: OnesEditor, pointX: number, pointY: number): SelectionRange | null;
|
|
3
|
+
export declare function getBlockRangeFromPoint(editor: OnesEditor, pointX: number, pointY: number, dragging?: boolean): SelectionRange | null;
|
|
4
4
|
export declare function getBlockNearestRangeFromPoint(editor: OnesEditor, x: number, y: number): EditorSimpleSelectionRange | null;
|
|
@@ -261,7 +261,7 @@ export interface Block {
|
|
|
261
261
|
blockKind: BlockKind;
|
|
262
262
|
createBlockContent: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => BlockContentElement;
|
|
263
263
|
getBlockTextLength: (block: BlockElement) => number;
|
|
264
|
-
getRangeFromPoint: (editor: OnesEditor, block: BlockElement, x: number, y: number) => SelectionRange | null;
|
|
264
|
+
getRangeFromPoint: (editor: OnesEditor, block: BlockElement, x: number, y: number, dragging?: boolean) => SelectionRange | null;
|
|
265
265
|
moveCaret: (editor: OnesEditor, block: BlockElement, position: SimpleBlockPosition, direction: MoveDirection) => SimpleBlockPosition | null;
|
|
266
266
|
getCaretRect: (block: BlockElement, pos: SimpleBlockPosition) => DOMRect;
|
|
267
267
|
updateSelection: (editor: OnesEditor, block: BlockElement, from: BlockPosition, to: BlockPosition) => void;
|
|
@@ -513,7 +513,7 @@ export interface CloneBlockResultInfo {
|
|
|
513
513
|
boxIdMap: Map<string, string>;
|
|
514
514
|
}
|
|
515
515
|
export interface OnesEditorDomEvents extends OnesEditorCustom {
|
|
516
|
-
addEventListener: <T = Event>(element: Element | Document | Window, eventName: string, eventHandler: (editor: OnesEditor, event: T) => void) => void;
|
|
516
|
+
addEventListener: <T = Event>(element: Element | Document | Window, eventName: string, eventHandler: (editor: OnesEditor, event: T) => void, options?: boolean | AddEventListenerOptions) => void;
|
|
517
517
|
removeEventListener: (element: Element | Document | Window | null, eventName: string | null, eventHandler: (editor: OnesEditor, event: Event) => void) => void;
|
|
518
518
|
removeAllListeners: (element: Element | Document | Window, eventName?: string) => void;
|
|
519
519
|
}
|