@ones-editor/editor 4.0.7-beta.h1474.1 → 4.0.7-beta.h1474.2

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.
@@ -29,6 +29,7 @@ export declare class EditorInput implements OnesEditorInput {
29
29
  callbacks: EditorInputCallbacks;
30
30
  inputElement: HTMLTextAreaElement;
31
31
  private focused;
32
+ private focusRestoration;
32
33
  constructor(editor: OnesEditor, callbacks: EditorInputCallbacks);
33
34
  private isInCommandBar;
34
35
  destroy(): void;
@@ -0,0 +1,25 @@
1
+ import type { OnesEditor } from '../types';
2
+ export type CancelFocusRestoration = () => void;
3
+ /** Owns both restoration timers and the native focus tasks for one editor input. */
4
+ export declare class FocusRestoration {
5
+ private input;
6
+ private restore;
7
+ private generation;
8
+ private owner;
9
+ private destroyed;
10
+ private activeScope?;
11
+ private timers;
12
+ constructor(input: HTMLTextAreaElement, restore: () => void);
13
+ canFocus(): boolean;
14
+ private hasOtherInput;
15
+ schedule(callback: () => void, delay?: number, protectUserFocus?: boolean): CancelFocusRestoration;
16
+ private createScope;
17
+ private scheduleInScope;
18
+ request(delay?: number): CancelFocusRestoration;
19
+ private cancelPending;
20
+ acquire(): CancelFocusRestoration;
21
+ destroy(): void;
22
+ }
23
+ export declare function requestInputFocus(input: HTMLTextAreaElement, delay?: number): CancelFocusRestoration;
24
+ export declare function requestEditorFocus(editor: OnesEditor, delay?: number): CancelFocusRestoration;
25
+ export declare function acquireEditorFocus(editor: OnesEditor): CancelFocusRestoration;
@@ -1,3 +1,5 @@
1
1
  export { editorCopyBlock, editorCopyDoc, addMetaToDoc, injectDocToHtmlFragment } from './clipboard/copy';
2
2
  export { copyResourcesFromDoc } from './clipboard/resources/copy-resources';
3
3
  export { getAllResourcesFromDoc } from './clipboard/resources/get-all-resources';
4
+ export { FocusRestoration, requestEditorFocus, requestInputFocus, acquireEditorFocus } from './focus-restoration';
5
+ export type { CancelFocusRestoration } from './focus-restoration';
@@ -15,6 +15,8 @@ export declare class MainToolbar implements OnesEditorCustom {
15
15
  toolbar: FixedToolbar;
16
16
  toolbarFullScreen?: FixedToolbar;
17
17
  root: HTMLElement;
18
+ private cancelFocus?;
19
+ private restoreFocus;
18
20
  constructor(editor: OnesEditor, parent: HTMLElement, options?: MainToolbarOptions);
19
21
  destroy(): void;
20
22
  setItems(items: ToolbarItem[]): void;