@ones-editor/editor 2.2.8-beta.1 → 2.2.8-beta.12

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.
@@ -15,7 +15,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
15
15
  constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
16
16
  destroy(): void;
17
17
  dispatchScroll: import("lodash").DebouncedFunc<() => void>;
18
- updateItemsLayout(): void;
18
+ updateItemsLayout(dispatchScroll?: boolean): void;
19
19
  private bindEvents;
20
20
  private unbindEvents;
21
21
  protected createItem(data: CommentWithChildren, reason: 'init' | 'insert'): CommentGroupItem;
@@ -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,3 +1,4 @@
1
+ import { IUserOptions } from '../../../utils/animate-scroll';
1
2
  import { OnesEditor, SimpleBlockPosition } from '../../types';
2
3
  export declare function editorGetClientHeight(editor: OnesEditor): number;
3
4
  export declare function editorGetClientTop(editor: OnesEditor): number;
@@ -6,7 +7,5 @@ export declare function editorGetVisibleRect(editor: OnesEditor): DOMRect;
6
7
  export declare function isBlockPositionVisible(editor: OnesEditor, pos: SimpleBlockPosition): boolean;
7
8
  export declare function scrollIntoView(editor: OnesEditor, target: HTMLElement, options?: {
8
9
  animation?: boolean;
9
- verticalOffset?: number;
10
- elementToScroll?: HTMLElement;
11
- }): void;
10
+ } & Pick<IUserOptions, 'elementToScroll' | 'verticalOffset' | 'speed'>): void;
12
11
  export declare function editorScrollIntoView(editor: OnesEditor): 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
  }
@@ -646,7 +646,7 @@ export interface OnesEditorInput {
646
646
  readonly inputElement: HTMLTextAreaElement;
647
647
  getInput: () => HTMLTextAreaElement;
648
648
  destroy: () => void;
649
- focus: () => void;
649
+ focus: (options?: FocusOptions) => void;
650
650
  handleDocumentSelectionChange: () => void;
651
651
  handleCompositionstart: (event: CompositionEvent) => void;
652
652
  handleCompositionend: (event: CompositionEvent) => void;
@@ -5,8 +5,9 @@
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
7
7
  "devDependencies": {
8
+ "@types/lodash.clonedeep": "^4.5.0",
8
9
  "@types/lodash.debounce": "^4.0.7",
9
- "@types/lodash.clonedeep": "^4.5.0"
10
+ "@types/lodash.memoize": "^4.1.9"
10
11
  },
11
12
  "types": "src/index.d.ts"
12
13
  }
@@ -6,6 +6,7 @@ export default class MathjaxEditor {
6
6
  editMathjaxPopup: Popup | null;
7
7
  onChange: OnEditChange | null;
8
8
  tex: string;
9
+ oldTex: string;
9
10
  private observer;
10
11
  editMathjax(elem: HTMLElement, tex: string, onChange: OnEditChange, options?: ManualShowCommandBarOptions): void;
11
12
  handleClose: (commandBar: AbstractCommandBar) => void;
@@ -0,0 +1,3 @@
1
+ export declare class ExportImageError extends Error {
2
+ constructor(message: string);
3
+ }
@@ -1,5 +1,7 @@
1
1
  import { IImageOptions } from 'docx';
2
2
  import { OnesEditor } from '../../../@ones-editor/core';
3
+ import { ExportImageError } from './errors';
4
+ export { ExportImageError };
3
5
  export interface EditorToDocxOptions {
4
6
  template?: Blob;
5
7
  download?: boolean;