@ones-editor/editor 2.1.1-beta.77 → 2.1.1-beta.79

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.
@@ -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>;
@@ -40,5 +40,4 @@ export declare function getElementFromPoint(x: number, y: number, options?: {
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
42
  export declare function bindDbClick(editor: OnesEditor, elem: HTMLElement, handler: (event: MouseEvent) => void): () => void;
43
- export declare const getVisualViewportHeightOffset: () => number;
44
43
  export {};
@@ -1,12 +1,17 @@
1
1
  /// <reference types="lodash" />
2
2
  import { CommandItem, OnesEditor, OnesEditorCustom } from '../../../@ones-editor/core';
3
- import { AutoSuggestAnchor, OnesEditorAutoSuggest } from '../../../@ones-editor/ui-base';
3
+ import { AutoSuggestAnchor, EditorInput, OnesEditorAutoSuggest } from '../../../@ones-editor/ui-base';
4
4
  import { MentionOptions } from './types';
5
+ interface MobileWrap {
6
+ wrapper: HTMLElement;
7
+ input: EditorInput;
8
+ content: HTMLElement;
9
+ }
5
10
  export default class OnesEditorMention implements OnesEditorCustom {
6
11
  private editor;
7
12
  private options;
8
13
  suggest: OnesEditorAutoSuggest;
9
- private mobileWrap;
14
+ private mobileWrap?;
10
15
  private items;
11
16
  constructor(editor: OnesEditor, options: MentionOptions);
12
17
  createMobileHeader: () => HTMLDivElement | undefined;
@@ -20,7 +25,7 @@ export default class OnesEditorMention implements OnesEditorCustom {
20
25
  createItemElement: (item: CommandItem, find: string) => HTMLElement;
21
26
  createMobileItems: (content: HTMLElement, items: CommandItem[], find: string) => void;
22
27
  onInputChanged: import("lodash").DebouncedFunc<(content: HTMLElement, e: Event) => void>;
23
- getMobileCommandElement: () => HTMLElement;
28
+ createMobileWrap: () => MobileWrap;
24
29
  createMobileCommandItem: (items: CommandItem[]) => {
25
30
  id: string;
26
31
  name: string;
@@ -29,3 +34,4 @@ export default class OnesEditorMention implements OnesEditorCustom {
29
34
  _queryItems: (text: string) => Promise<CommandItem[]>;
30
35
  queryItems: (menu: OnesEditorAutoSuggest, text: string) => Promise<CommandItem[]>;
31
36
  }
37
+ 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>;
@@ -6,6 +6,7 @@ export declare class MobileToolbarHandler {
6
6
  bar: HTMLElement;
7
7
  constructor(editor: OnesEditor, parent: HTMLElement);
8
8
  private subBar;
9
+ private addSubBar;
9
10
  private handleSubBarShown;
10
11
  layoutSubBar(): void;
11
12
  private handleSelectionChange;