@ones-editor/editor 2.1.1-beta.76 → 2.1.1-beta.78
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/types.d.ts +6 -0
- package/@ones-editor/core/src/utils/animate-scroll.d.ts +2 -0
- package/@ones-editor/core/src/utils/dom.d.ts +2 -3
- package/@ones-editor/mobile-helper/src/fixed-toolbar/index.d.ts +2 -3
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/readonly-toolbar/index.d.ts +1 -1
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +1 -1
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +1 -1
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +1 -1
- package/@ones-editor/ui-base/src/dialog/manual-close-dialog.d.ts +1 -1
- package/dist/index.js +81 -59
- package/dist/types.d.ts +2 -1
- package/package.json +1 -1
|
@@ -767,3 +767,9 @@ export interface OnesEditorBlockHook {
|
|
|
767
767
|
writable?: (editor: OnesEditor, blockElement: BlockElement | BlockElement[]) => boolean | undefined;
|
|
768
768
|
commands?: (editor: OnesEditor, blockElement: BlockElement, child: TextBlockContentChild | null) => BlockCommands | undefined;
|
|
769
769
|
}
|
|
770
|
+
export interface MobileClient {
|
|
771
|
+
getViewPortHeight: () => number;
|
|
772
|
+
getOffsetHeight: () => number;
|
|
773
|
+
virtualViewportHeight: number;
|
|
774
|
+
virtualViewportOffsetTop: number;
|
|
775
|
+
}
|
|
@@ -10,6 +10,7 @@ export interface IUserOptions {
|
|
|
10
10
|
verticalOffset?: number;
|
|
11
11
|
disableHorizontal?: boolean;
|
|
12
12
|
disableVertical?: boolean;
|
|
13
|
+
getClientHeight?: () => number;
|
|
13
14
|
}
|
|
14
15
|
export interface IOptions {
|
|
15
16
|
cancelOnUserAction: boolean;
|
|
@@ -22,6 +23,7 @@ export interface IOptions {
|
|
|
22
23
|
verticalOffset: number;
|
|
23
24
|
disableHorizontal?: boolean;
|
|
24
25
|
disableVertical?: boolean;
|
|
26
|
+
getClientHeight?: () => number;
|
|
25
27
|
}
|
|
26
28
|
declare function animateScrollTo(y: number, userOptions?: IUserOptions): Promise<boolean>;
|
|
27
29
|
declare function animateScrollTo(coords: TCoords, userOptions?: IUserOptions): Promise<boolean>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CSSStyles } from '../core/types';
|
|
1
|
+
import type { CSSStyles, OnesEditor } from '../core/types';
|
|
2
2
|
export declare function addClass(dom: Element, ...className: Array<string>): void;
|
|
3
3
|
export declare function hasClass(dom: Node | null, className: string): boolean;
|
|
4
4
|
export declare function removeClass(dom: Element, ...className: Array<string>): void;
|
|
@@ -39,6 +39,5 @@ export declare function getElementFromPoint(x: number, y: number, options?: {
|
|
|
39
39
|
}): Element;
|
|
40
40
|
export declare function createMouseEventFromTouchEvent(event: TouchEvent, type: 'mousedown' | 'mousemove' | 'mouseup' | 'click'): MouseEvent;
|
|
41
41
|
export declare function ensureIsMobileEvent(events: MouseEvent | TouchEvent): events is TouchEvent;
|
|
42
|
-
export declare function bindDbClick(elem: HTMLElement, handler: (event: MouseEvent) => void): () => void;
|
|
43
|
-
export declare const getVisualViewportHeightOffset: () => number;
|
|
42
|
+
export declare function bindDbClick(editor: OnesEditor, elem: HTMLElement, handler: (event: MouseEvent) => void): () => void;
|
|
44
43
|
export {};
|
|
@@ -5,10 +5,9 @@ export declare class MobileCommandHandler {
|
|
|
5
5
|
private editor;
|
|
6
6
|
private commandBar;
|
|
7
7
|
private observer;
|
|
8
|
+
private timer;
|
|
9
|
+
private mobileClient?;
|
|
8
10
|
constructor(editor: OnesEditor);
|
|
9
|
-
private get window();
|
|
10
|
-
private get virtualViewportHeight();
|
|
11
|
-
private get clientHeight();
|
|
12
11
|
private toggleDelay;
|
|
13
12
|
private preHeight;
|
|
14
13
|
layoutBar: import("lodash").DebouncedFunc<() => void>;
|