@ones-editor/editor 5.0.7 → 5.0.8-beta.ONES22302592.1

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.
@@ -4,5 +4,8 @@
4
4
  "main": "./src/index.ts",
5
5
  "private": true,
6
6
  "type": "module",
7
+ "scripts": {
8
+ "test:focus-lifecycle": "node --test test/focus-lifecycle.test.cjs"
9
+ },
7
10
  "types": "src/index.d.ts"
8
11
  }
@@ -16,6 +16,7 @@ export default class OnesEditorToolbar implements OnesEditorHoveringBlockFilter,
16
16
  private _disableTextToolbar;
17
17
  private _lastClickTime;
18
18
  private _disabled;
19
+ private cancelFocus?;
19
20
  constructor(editor: OnesEditor);
20
21
  disableTextToolbar(): void;
21
22
  enableTextToolbar(): void;
@@ -24,7 +25,7 @@ export default class OnesEditorToolbar implements OnesEditorHoveringBlockFilter,
24
25
  isInToolbar: (event: MouseEvent) => boolean;
25
26
  isInBlock(block: BlockElement, event: MouseEvent): boolean;
26
27
  handleButtonClick: (toolbar: AbstractCommandBar, item: CommandItem) => void;
27
- handleClose: () => void;
28
+ handleClose: (toolbar: AbstractCommandBar) => void;
28
29
  handleClosing: (bar: unknown, event: MouseEvent | TouchEvent) => boolean;
29
30
  bindEvents(): void;
30
31
  unbindEvents(): void;
@@ -6,7 +6,9 @@ export type EditorAutoSuggestMenuOptions = AutoSuggestMenuOptions & {
6
6
  export default class EditorAutoSuggestMenu extends AutoSuggestMenu {
7
7
  private editor;
8
8
  private editorOptions;
9
+ private cancelFocus?;
9
10
  constructor(editor: OnesEditor, editorOptions: EditorAutoSuggestMenuOptions);
10
11
  popupInEditor(containerId: string, blockIndex: number, offset: number): Promise<void>;
11
12
  handleClose: () => void;
13
+ destroy(): void;
12
14
  }
@@ -6,8 +6,17 @@ export default abstract class ManualCommandBar extends CommandBar implements Abs
6
6
  private manualCommandBarOptions?;
7
7
  tippyInstance: Instance | null;
8
8
  _target: HTMLElement | null;
9
+ private cancelFocus?;
10
+ private focusTimer;
11
+ private focusRestoreGeneration;
9
12
  constructor(items: CommandItem[], closeable?: Closeable, manualCommandBarOptions?: CommandBarOptions | undefined);
10
13
  handleBeforeClose: (event?: MouseEvent | TouchEvent) => boolean;
14
+ private getFocusOwner;
15
+ private restoreFocusAfterClose;
16
+ private isFocusOwner;
17
+ private handleFocusInteraction;
18
+ private handleWindowBlur;
19
+ private clearFocusTimer;
11
20
  setProps: (props: ManualShowCommandBarOptions) => void;
12
21
  manualShow(target: HTMLElement, options?: ManualShowCommandBarOptions): void;
13
22
  close(reason: CloseReason, e?: MouseEvent | null): void;
@@ -24,6 +24,7 @@ export interface ManualShowCommandBarOptions {
24
24
  }
25
25
  export interface AbstractCommandBar extends TypedEmitter<CommandBarEvents> {
26
26
  readonly isVisible: boolean;
27
+ readonly closeReason: CloseReason;
27
28
  readonly parentItem: CommandItem | null;
28
29
  closeable: Closeable | null;
29
30
  close: (reason: CloseReason, e?: MouseEvent | null) => void;