@ones-editor/editor 1.1.3-bate.9 → 1.1.4

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,3 +4,4 @@ export declare function getFirstChildBlock(container: ContainerElement): BlockEl
4
4
  export declare function getLastChildBlock(container: ContainerElement): BlockElement;
5
5
  export declare function getChildBlockCount(container: ContainerElement): number;
6
6
  export declare function getBlockByIndex(container: ContainerElement, blockIndex: number): BlockElement;
7
+ export declare function findBlockByIndex(container: ContainerElement, blockIndex: number): BlockElement | null;
@@ -109,7 +109,6 @@ export interface OnesEditorDocCallbacks {
109
109
  onCustomMessage?: (msg: unknown) => void;
110
110
  onStatusChanged?: (status: OnesEditorDocStatus) => void;
111
111
  onError?: (error: Error) => void;
112
- onAuthRecover?: () => void;
113
112
  }
114
113
  export interface UploadResourceOptions {
115
114
  onProgress?: (progress: number) => void;
@@ -222,7 +221,6 @@ export interface OnesEditorDoc extends OnesEditorDocServer {
222
221
  recognizeLink?: (link: string) => Promise<RecognizeLinkResult>;
223
222
  beginBatchUpdate: () => number;
224
223
  endBatchUpdate: () => number;
225
- triggerReAuth?: () => void;
226
224
  }
227
225
  export interface OnesEditorDocHistoryData {
228
226
  user: {
@@ -41,7 +41,6 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
41
41
  broadcastMessage(data: unknown): void;
42
42
  getUser(): import("../doc").OnesEditorUser;
43
43
  getRemoteUsers(): import("../doc").OnesEditorRemoteUsers;
44
- triggerReAuth(): void | undefined;
45
44
  destroy(): void;
46
45
  getServerMeta(): OnesEditorDocServerMeta;
47
46
  reset(doc: OnesEditorDoc): void;
@@ -506,6 +506,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
506
506
  getBlockById: (id: string) => BlockElement;
507
507
  getBoxById: (id: string) => BoxElement;
508
508
  getBlockByIndex: (containerId: string, blockIndex: number) => BlockElement;
509
+ findBlockByIndex: (containerId: string, blockIndex: number) => BlockElement | null;
509
510
  getBlockIndex: (block: BlockElement | string) => number;
510
511
  getContainerById: (id: string) => ContainerElement;
511
512
  getParentContainer: (block: BlockElement) => ContainerElement;
@@ -1,5 +1,5 @@
1
1
  export declare function getScrollContainer(element: HTMLElement, options?: {
2
2
  horizontal?: boolean;
3
3
  }): HTMLElement;
4
- export declare function disablePageScroll(id: string): HTMLDivElement | null;
4
+ export declare function disablePageScroll(id: string): void;
5
5
  export declare function enablePageScroll(id: string): void;
@@ -7,7 +7,7 @@ export declare function getDrawioIframeUrl(editor: OnesEditor): string;
7
7
  export declare function resizeObserver(el: HTMLElement): {
8
8
  disconnect: () => void;
9
9
  };
10
- export declare function initializeDrawioIframe(editor: OnesEditor, block: BlockElement): Promise<{
10
+ export declare function initializeDrawioIframe(editor: OnesEditor): Promise<{
11
11
  drawioIframe: HTMLIFrameElement;
12
12
  exit: () => void;
13
13
  }>;
@@ -3,4 +3,3 @@ import './style.scss';
3
3
  export { DrawioEmbed, };
4
4
  export * from '../types';
5
5
  export * from './utils/download-object';
6
- export * from './helper/iframe-embed-doc-event';
@@ -8,8 +8,5 @@ declare const _default: {
8
8
  errorSubTips: string;
9
9
  retry: string;
10
10
  };
11
- authError: {
12
- tips: string;
13
- };
14
11
  };
15
12
  export default _default;
@@ -8,8 +8,5 @@ declare const _default: {
8
8
  errorSubTips: string;
9
9
  retry: string;
10
10
  };
11
- authError: {
12
- tips: string;
13
- };
14
11
  };
15
12
  export default _default;
@@ -8,8 +8,5 @@ declare const _default: {
8
8
  errorSubTips: string;
9
9
  retry: string;
10
10
  };
11
- authError: {
12
- tips: string;
13
- };
14
11
  };
15
12
  export default _default;
@@ -24,9 +24,6 @@ export declare class AuthConnection {
24
24
  logout(): Promise<void>;
25
25
  init(auth: AuthMessage): Promise<void>;
26
26
  handleAuthError(): Promise<void>;
27
- reAuth: () => Promise<void>;
28
- private emitPermissionError;
29
- private emitAuthRecover;
30
27
  private emitAuthError;
31
28
  private emitRequestReloadError;
32
29
  private emitWriteConflictError;
@@ -35,7 +32,6 @@ export declare class AuthConnection {
35
32
  get(collectionName: string, documentID: string): Doc;
36
33
  addEventListener(event: 'open' | 'close' | 'error', callback: (e: Event | Error) => void): void;
37
34
  onAuthError(callback: (error: Error) => void): void;
38
- onAuthRecover(callback: () => void): void;
39
35
  onWriteConflictError(callback: (error: Error) => void): void;
40
36
  onMaxUsersError(callback: () => void): void;
41
37
  onRequestReloadError(callback: (error: Error) => void): void;
@@ -15,7 +15,6 @@ export default class ShareDBClient {
15
15
  close(logout: boolean): void;
16
16
  on(event: 'open' | 'close' | 'error', callback: (event: Event | Error) => void): void;
17
17
  onAuthError(callback: (error: Error) => void): void;
18
- onAuthRecover(callback: () => void): void;
19
18
  onWriteConflictError(callback: (error: Error) => void): void;
20
19
  onMaxUsersError(callback: () => void): void;
21
20
  onRequestReloadError(callback: (error: Error) => void): void;
@@ -53,5 +52,4 @@ export default class ShareDBClient {
53
52
  createVersion(tag: string, publish: boolean): Promise<any>;
54
53
  recognizeLink(url: string): Promise<LinkDetails>;
55
54
  buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
56
- reAuth(): void;
57
55
  }
@@ -75,7 +75,6 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
75
75
  onCreateComment(commentId: string, local: boolean): void;
76
76
  onUpdateComment(commentId: string, local: boolean): void;
77
77
  onCustomMessage(msg: unknown): void;
78
- onAuthRecover(): void;
79
78
  addResources(resourceIds: string[]): Promise<string[]>;
80
79
  uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
81
80
  buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
@@ -107,5 +106,4 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
107
106
  recognizeLink(url: string): Promise<import("../types").LinkDetails>;
108
107
  parseHistoryData(historyData: OnesEditorDocHistoryData, handler: OnesEditorHistoryDataParseHandler): void;
109
108
  getServerMeta(): OnesEditorDocServerMeta;
110
- triggerReAuth(): void;
111
109
  }
@@ -1,5 +1,5 @@
1
1
  import { BuildResourceUrlOptions, DocObject, DocVersion, EventCallbacks, OnesEditorDocHistoryData, OnesEditorDocServer, OnesEditorDocServerMeta, OnesEditorDocVersionExtra, OnesEditorDocVersionHelper, OnesEditorHistoryDataParseHandler, RemoteUsers } from '../../../../@ones-editor/core';
2
- import { ShareDBDocCallbacks, ShareDBDocOptions } from '../types';
2
+ import { AuthMessage, ShareDBDocCallbacks, ShareDBDocOptions } from '../types';
3
3
  import ShareDBSimpleClient from './simple-client';
4
4
  export default class ShareDBServer extends EventCallbacks<ShareDBDocCallbacks> implements OnesEditorDocServer, OnesEditorDocVersionHelper {
5
5
  private options;
@@ -26,4 +26,9 @@ export default class ShareDBServer extends EventCallbacks<ShareDBDocCallbacks> i
26
26
  createVersion(tag: string, publish: boolean): Promise<DocVersion>;
27
27
  parseHistoryData(historyData: OnesEditorDocHistoryData, handler: OnesEditorHistoryDataParseHandler): void;
28
28
  getServerMeta(): OnesEditorDocServerMeta;
29
+ static auth(auth: AuthMessage, serverUrl: string): Promise<{
30
+ read: string;
31
+ user: string;
32
+ }>;
33
+ static load(options: ShareDBDocOptions): Promise<ShareDBServer>;
29
34
  }