@ones-editor/editor 1.1.18-beta.8 → 1.1.18-beta.9

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.
@@ -21,4 +21,5 @@ export declare class CommentQuickReply {
21
21
  cancel: () => void;
22
22
  hide: () => void;
23
23
  show: () => void;
24
+ destroy(): void;
24
25
  }
@@ -13,7 +13,7 @@ export default class OnesEditorComments {
13
13
  private showComment;
14
14
  showCommentList: (groupId?: string) => void;
15
15
  setFirstEditingCommentActive(): void;
16
- isEditing(): boolean;
16
+ isEditing(includeEmpty?: boolean): boolean;
17
17
  mount(containers: CommentRoot): void;
18
18
  private handleCommentListClose;
19
19
  private handleOnSelectComment;
@@ -18,7 +18,7 @@ export default class CommentsList extends TypedEmitter<CommentsListEvents> imple
18
18
  onDeleteComment(commentId: string, local: boolean): void;
19
19
  onUpdateComment(commentId: string, local: boolean): void;
20
20
  createList(): CommentGroupList;
21
- isEditing(): boolean;
21
+ isEditing(includeEmpty?: boolean): boolean;
22
22
  setFirstEditingCommentActive(): void;
23
23
  handleSelectionOnComment: () => void;
24
24
  updateCommentCount: () => void;
@@ -24,7 +24,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
24
24
  active: boolean;
25
25
  }): CommentGroupItem | null;
26
26
  private findFirstEditingComment;
27
- isEditing(): boolean;
27
+ isEditing(includeEmpty?: boolean): boolean;
28
28
  closeEditing: (groupId: string) => void;
29
29
  setFirstEditingCommentActive: () => void;
30
30
  setActiveItem(index: number, direction?: 'prev' | 'next'): void;
@@ -1,6 +1,6 @@
1
1
  import { OnesEditor } from '../../../../../@ones-editor/core';
2
2
  import { TypedEmitter } from 'tiny-typed-emitter';
3
- import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../..';
3
+ import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../../types';
4
4
  import { MiniGroupList } from './group-list';
5
5
  interface MiniCommentsListEvents {
6
6
  onMiniCommentClose: () => void;
@@ -12,6 +12,7 @@ declare class OnesEditorContextMenu implements OnesEditorCustom {
12
12
  private isInEditor;
13
13
  private handleContextMenuShown;
14
14
  private handleContextMenuClick;
15
+ private handleContextMenuClose;
15
16
  private handleImageEmbedAction;
16
17
  }
17
18
  export default OnesEditorContextMenu;
@@ -2,8 +2,9 @@ import { OnesEditor, BlockElement, BlockPosition, ContainerElement, ComplexBlock
2
2
  export declare function complexBlockGetAllChildContainers(editor: OnesEditor, block: BlockElement, options?: GetChildContainerOptions): ContainerElement[];
3
3
  export declare function complexBlockGetSelectedContainers(editor: OnesEditor, block: BlockElement, start: BlockPosition, end: BlockPosition): ContainerElement[];
4
4
  export declare function isFirstChildBlockInComplexBlock(editor: OnesEditor, childBlock: BlockElement): boolean;
5
- export declare function complexBlockGeFirstSimpleChild(editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions): BlockElement | null;
5
+ export declare function complexBlockGetFirstSimpleChild(editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions): BlockElement | null;
6
6
  export declare function complexBlockGetLastSimpleChild(editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions): BlockElement | null;
7
+ export declare function complexBlockGetDeepFirstChild(editor: OnesEditor, container: ContainerElement): BlockElement | null;
7
8
  export declare function findPrevSimpleBlockBeforeChildContainer(editor: OnesEditor, childContainer: ContainerElement, options?: GetChildContainerOptions): BlockElement | null;
8
9
  export declare function complexBlockGetTopChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
9
10
  export declare function complexBlockGetBottomChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
@@ -27,9 +27,11 @@ export declare class EditorInput implements OnesEditorInput {
27
27
  callbacks: EditorInputCallbacks;
28
28
  inputElement: HTMLInputElement;
29
29
  constructor(editor: OnesEditor, callbacks: EditorInputCallbacks);
30
+ private isInCommandbar;
30
31
  destroy(): void;
31
32
  getInput(): HTMLInputElement;
32
33
  focus(): void;
34
+ isInDisableScrollMask(target: HTMLElement): boolean;
33
35
  handleWindowBlur: () => void;
34
36
  handleDocumentClick: (event: MouseEvent) => void;
35
37
  handleDocumentSelectionChange: () => void;
@@ -34,6 +34,7 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
34
34
  onCustomMessage(msg: unknown): void;
35
35
  onStatusChanged(status: OnesEditorDocStatus): void;
36
36
  onError(error: Error): void;
37
+ onAuthRecover(): void;
37
38
  uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
38
39
  addResources(resourceIds: string[]): Promise<string[]>;
39
40
  buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="lodash" />
1
2
  import { EditorInputCallbacks } from '../composition/editor-input';
2
3
  import { OnesEditor, OnesEditorInputHandler, OnesEditorUndoAction, RemoteChangeType, PasteOptions } from '../types';
3
4
  import { DocObject } from '../doc';
@@ -18,7 +19,8 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
18
19
  onPaste(event: ClipboardEvent): void;
19
20
  onPasteText: (text: string, options?: PasteOptions) => Promise<void>;
20
21
  onFocus(): void;
21
- onBlur(): void;
22
+ onBlur: import("lodash").DebouncedFunc<() => void>;
23
+ removeActiveForBlur: import("lodash").DebouncedFunc<() => void>;
22
24
  addHandler(handler: OnesEditorInputHandler): void;
23
25
  removeHandler(handler: OnesEditorInputHandler): void;
24
26
  handleBeforeInsertText(containerId: string, blockIndex: number, offset: number, text: string): boolean;
@@ -399,6 +399,7 @@ export interface OnesEditorOptionalOptions {
399
399
  colors?: string[];
400
400
  scrollContainer?: HTMLElement;
401
401
  enableComments?: boolean;
402
+ enableContextMenu?: boolean;
402
403
  settingsProvider?: OnesEditorSettingsProvider;
403
404
  }
404
405
  export interface OnesEditorOptions {
@@ -407,6 +408,7 @@ export interface OnesEditorOptions {
407
408
  [index: string]: unknown;
408
409
  };
409
410
  enableComments?: boolean;
411
+ enableContextMenu?: boolean;
410
412
  scrollContainer?: HTMLElement;
411
413
  }
412
414
  export interface OnesEditorComponents {
@@ -34,4 +34,7 @@ export declare function findEventTargetBlock(event: Event): Element | null;
34
34
  export declare function isElementVisible(element: Element | null): boolean;
35
35
  export declare function getElementScale(element: Element): number;
36
36
  export declare function bindKeyDownEvent(input: HTMLInputElement | HTMLTextAreaElement, callback: (event: KeyboardEvent, composing: boolean) => void): () => void;
37
+ export declare function getElementFromPoint(x: number, y: number, options?: {
38
+ noFilter: boolean;
39
+ }): Element;
37
40
  export {};
@@ -1,9 +1,10 @@
1
1
  interface SelectFileOptions {
2
2
  multiple?: boolean;
3
+ container?: HTMLElement;
3
4
  }
4
5
  export declare function selectFile<T extends SelectFileOptions = SelectFileOptions>(accept: string, options?: T): Promise<T extends {
5
6
  multiple: true;
6
- } ? File[] : File>;
7
+ } ? (File[] | null) : (File | null)>;
7
8
  export declare function isDraggingFiles(v: unknown): v is File[];
8
9
  export declare function getFileExt(file: string): string;
9
10
  export declare function requestDownload(downloadUrl: string, fileName?: string): void;
@@ -14,6 +14,7 @@ export default class PasteSpecialButton {
14
14
  private cleaningDoc;
15
15
  handlePasteSpecial: (bar: AbstractCommandBar, item: CommandItem) => void;
16
16
  handleClose: () => void;
17
+ handleSelectionChange: () => void;
17
18
  hide(): void;
18
19
  clearCheckedState(): void;
19
20
  destroy(): void;
@@ -27,6 +27,7 @@ export declare class AuthConnection {
27
27
  }>;
28
28
  logout(): Promise<void>;
29
29
  init(auth: AuthMessage): Promise<void>;
30
+ reConnect(token: string): Promise<void>;
30
31
  handleAuthError(): Promise<void>;
31
32
  reAuth: () => Promise<void>;
32
33
  private emitPermissionError;