@ones-editor/editor 1.1.2 → 1.1.3-bate.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.
- package/@ones-editor/core/src/core/doc/doc.d.ts +2 -0
- package/@ones-editor/core/src/local-doc/index.d.ts +1 -0
- package/@ones-editor/core/src/utils/dom-scroll.d.ts +1 -1
- package/@ones-editor/drawio-embed/src/helper/iframe-embed-doc-event.d.ts +24 -0
- package/@ones-editor/drawio-embed/src/helper/index.d.ts +1 -1
- package/@ones-editor/drawio-embed/src/lang/en-us.d.ts +3 -0
- package/@ones-editor/drawio-embed/src/lang/ja-jp.d.ts +3 -0
- package/@ones-editor/drawio-embed/src/lang/zh-cn.d.ts +3 -0
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +3 -0
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +2 -0
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/versions/src/history-doc/history-doc.d.ts +1 -0
- package/dist/index.js +75420 -830
- package/package.json +1 -1
|
@@ -109,6 +109,7 @@ export interface OnesEditorDocCallbacks {
|
|
|
109
109
|
onCustomMessage?: (msg: unknown) => void;
|
|
110
110
|
onStatusChanged?: (status: OnesEditorDocStatus) => void;
|
|
111
111
|
onError?: (error: Error) => void;
|
|
112
|
+
onAuthRecover?: () => void;
|
|
112
113
|
}
|
|
113
114
|
export interface UploadResourceOptions {
|
|
114
115
|
onProgress?: (progress: number) => void;
|
|
@@ -195,6 +196,7 @@ export interface OnesEditorDocServer {
|
|
|
195
196
|
buildResourceUrl: (resourceId: string, options?: BuildResourceUrlOptions) => string;
|
|
196
197
|
getVersionHelper?: () => OnesEditorDocVersionHelper | undefined;
|
|
197
198
|
getRemoteUsers: () => OnesEditorRemoteUsers;
|
|
199
|
+
triggerReAuth?: () => void;
|
|
198
200
|
}
|
|
199
201
|
export interface OnesEditorDoc extends OnesEditorDocServer {
|
|
200
202
|
registerCallback: (callbacks: OnesEditorDocCallbacks) => void;
|
|
@@ -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):
|
|
4
|
+
export declare function disablePageScroll(id: string): HTMLDivElement | null;
|
|
5
5
|
export declare function enablePageScroll(id: string): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
+
import type { BlockElement, OnesEditor, OnesEditorCustom, OnesEditorDocCallbacks } from '../../../../@ones-editor/core';
|
|
3
|
+
type ErrorRender = ((block: BlockElement, iframe: HTMLIFrameElement) => void) | undefined;
|
|
4
|
+
export declare class IframeKindEmbedDocCallbacks extends TypedEmitter implements OnesEditorCustom, OnesEditorDocCallbacks {
|
|
5
|
+
private editor;
|
|
6
|
+
private currentBlock;
|
|
7
|
+
private currentIframe;
|
|
8
|
+
private onReAuthErrorWhenIframeEditing;
|
|
9
|
+
private onIframeExitEdit;
|
|
10
|
+
constructor(editor: OnesEditor);
|
|
11
|
+
destroy: () => void;
|
|
12
|
+
onError: (error: Error) => void;
|
|
13
|
+
onAuthRecover: () => void;
|
|
14
|
+
unregisterCallbacks: () => void;
|
|
15
|
+
register: (block: BlockElement, iframe: HTMLIFrameElement, options: {
|
|
16
|
+
onError?: ErrorRender;
|
|
17
|
+
onExit?: () => void;
|
|
18
|
+
}) => void;
|
|
19
|
+
unRegister: () => void;
|
|
20
|
+
onConnectReAuthError: () => void;
|
|
21
|
+
private reAuth;
|
|
22
|
+
private exit;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -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): Promise<{
|
|
10
|
+
export declare function initializeDrawioIframe(editor: OnesEditor, block: BlockElement): Promise<{
|
|
11
11
|
drawioIframe: HTMLIFrameElement;
|
|
12
12
|
exit: () => void;
|
|
13
13
|
}>;
|
|
@@ -24,6 +24,8 @@ 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 emitAuthRecover;
|
|
27
29
|
private emitAuthError;
|
|
28
30
|
private emitRequestReloadError;
|
|
29
31
|
private emitWriteConflictError;
|
|
@@ -32,6 +34,7 @@ export declare class AuthConnection {
|
|
|
32
34
|
get(collectionName: string, documentID: string): Doc;
|
|
33
35
|
addEventListener(event: 'open' | 'close' | 'error', callback: (e: Event | Error) => void): void;
|
|
34
36
|
onAuthError(callback: (error: Error) => void): void;
|
|
37
|
+
onAuthRecover(callback: () => void): void;
|
|
35
38
|
onWriteConflictError(callback: (error: Error) => void): void;
|
|
36
39
|
onMaxUsersError(callback: () => void): void;
|
|
37
40
|
onRequestReloadError(callback: (error: Error) => void): void;
|
|
@@ -15,9 +15,11 @@ 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;
|
|
18
19
|
onWriteConflictError(callback: (error: Error) => void): void;
|
|
19
20
|
onMaxUsersError(callback: () => void): void;
|
|
20
21
|
onRequestReloadError(callback: (error: Error) => void): void;
|
|
22
|
+
triggerReAuth(): void;
|
|
21
23
|
/**
|
|
22
24
|
* 根据Id生成一个文档对象,如果文档不存在,则创建一个新的。
|
|
23
25
|
* @param id 待获取的containerId
|
|
@@ -106,4 +106,5 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
|
|
|
106
106
|
recognizeLink(url: string): Promise<import("../types").LinkDetails>;
|
|
107
107
|
parseHistoryData(historyData: OnesEditorDocHistoryData, handler: OnesEditorHistoryDataParseHandler): void;
|
|
108
108
|
getServerMeta(): OnesEditorDocServerMeta;
|
|
109
|
+
triggerReAuth(): void;
|
|
109
110
|
}
|