@ones-editor/editor 2.1.1-beta.63 → 2.1.1-beta.67

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.
@@ -8,6 +8,9 @@ export declare class RootContainer {
8
8
  private mouseDownEvent;
9
9
  private dbClickRef;
10
10
  constructor(editor: OnesEditor, rootContainer: ContainerElement);
11
+ private isMove;
12
+ handleTouchMove: (e: TouchEvent) => void;
13
+ handleTouchEnd: (e: TouchEvent) => void;
11
14
  private bindEvents;
12
15
  private unbindEvents;
13
16
  destroy(): void;
@@ -717,6 +717,7 @@ export type CommandParams = {
717
717
  [index: string]: unknown;
718
718
  } & {
719
719
  source?: string[];
720
+ isFilter?: boolean;
720
721
  };
721
722
  export type CommandResult = {
722
723
  [index: string]: unknown;
@@ -726,12 +727,12 @@ export interface OnesEditorCommandProvider {
726
727
  groupIndex?: number;
727
728
  getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: CommandParams) => CommandItem[];
728
729
  getInsertCommands?: (editor: OnesEditor, containerId: string) => CommandItem[];
729
- executeInsertCommand?: (editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItem, params: CommandParams, result?: CommandResult) => boolean;
730
+ executeInsertCommand?: (editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
730
731
  executeRangeCommand?: (editor: OnesEditor, range: SelectionRange, command: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
731
- executeCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItem, params: CommandParams, result?: CommandResult) => boolean;
732
+ executeCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
732
733
  filterCommands?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, commands: CommandItemWithSource[]) => CommandItemWithSource[] | undefined;
733
- beforeExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItem, params: CommandParams) => boolean | undefined;
734
- afterExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItem, params: CommandParams, result: CommandResult) => void;
734
+ beforeExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams) => boolean | undefined;
735
+ afterExecuteCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams, result: CommandResult) => void;
735
736
  }
736
737
  export interface CommandItemWithSource extends CommandItem {
737
738
  source: string;
@@ -37,7 +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
40
  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;
41
+ export declare function ensureIsMobileEvent(events: MouseEvent | TouchEvent): events is TouchEvent;
42
+ export declare function bindDbClick(elem: HTMLElement, handler: (event: MouseEvent) => void): () => void;
43
43
  export {};
@@ -13,12 +13,14 @@ export default class OnesEditorMention implements OnesEditorCustom {
13
13
  onClose: () => void;
14
14
  destroy(): void;
15
15
  onShow: (suggest: OnesEditorAutoSuggest, containerId: string, blockIndex: number, offset: number) => boolean;
16
+ onShown: (bar: OnesEditorAutoSuggest) => void;
16
17
  handleClickItem: (item: CommandItem) => void;
17
18
  handleMobileWrapClick: (e: Event) => void;
18
19
  onClickItem: (menu: OnesEditorAutoSuggest, item: CommandItem, anchor: AutoSuggestAnchor) => void;
19
20
  createItemElement: (item: CommandItem, find: string) => HTMLElement;
20
21
  createMobileItems: (content: HTMLElement, items: CommandItem[], find: string) => void;
21
22
  onInputChanged: import("lodash").DebouncedFunc<(content: HTMLElement, e: Event) => void>;
23
+ getMobileCommandElement: () => HTMLElement;
22
24
  createMobileCommandItem: (items: CommandItem[]) => {
23
25
  id: string;
24
26
  name: string;
@@ -1,4 +1,4 @@
1
- import { BlockElement, CommandItem, CommandParams, ContainerElement, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../../@ones-editor/core';
1
+ import { BlockElement, CommandItem, CommandItemWithSource, CommandParams, ContainerElement, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../../@ones-editor/core';
2
2
  import { ProxyProvider } from '../../../../../@ones-editor/ui';
3
3
  export default class InsertMenuProvider extends ProxyProvider {
4
4
  private editor;
@@ -11,5 +11,5 @@ export default class InsertMenuProvider extends ProxyProvider {
11
11
  getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: CommandParams) => CommandItem[];
12
12
  executeInsertCommand: () => boolean;
13
13
  getNextBlockIndex: (container: ContainerElement, block: BlockElement) => number;
14
- executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItem, params: CommandParams) => boolean;
14
+ executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams) => boolean;
15
15
  }
@@ -1,5 +1,5 @@
1
1
  import { ContainerElement, ScrollAreaElement, ScrollContainerElement, ScrollCore } from './common-types';
2
- export declare function getContainerOption(scrollCore: ScrollCore, container: ContainerElement): import("./types").ScrollContainerOptions | undefined;
2
+ export declare function getContainerOption(scrollCore: ScrollCore, container: ContainerElement): import("@ones-editor/editor").ScrollContainerOptions | undefined;
3
3
  export declare function getScrollContainer(scrollChild: HTMLElement): ScrollContainerElement;
4
4
  export declare function getContainerScrollArea(scrollContainer: ScrollContainerElement): ScrollAreaElement;
5
5
  export declare function getContainer(scrollChild: HTMLElement): ContainerElement;