@ones-editor/editor 2.3.0-beta.7 → 2.3.0-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.
- package/@ones-editor/core/src/core/doc/doc.d.ts +0 -1
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +0 -1
- package/@ones-editor/drawio-embed/src/lang/en-us.d.ts +8 -0
- package/@ones-editor/drawio-embed/src/lang/ja-jp.d.ts +8 -0
- package/@ones-editor/drawio-embed/src/lang/zh-cn.d.ts +8 -0
- package/@ones-editor/misc/src/index.d.ts +0 -1
- package/@ones-editor/misc/src/re-auth/index.d.ts +0 -23
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +41 -31
- package/@ones-editor/sharedb-doc/src/doc/auto-renew-token.d.ts +16 -0
- package/@ones-editor/sharedb-doc/src/doc/connection-status.d.ts +19 -0
- package/@ones-editor/sharedb-doc/src/doc/edit-status.d.ts +13 -0
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +6 -13
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +4 -4
- package/@ones-editor/sharedb-doc/src/types.d.ts +16 -2
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui-base/src/dialog/alert-dialog.d.ts +19 -0
- package/@ones-editor/ui-base/src/dialog/confirm-dialog.d.ts +20 -0
- package/@ones-editor/ui-base/src/dialog/dialog-button.d.ts +10 -0
- package/@ones-editor/ui-base/src/dialog/dialog-check.d.ts +15 -0
- package/@ones-editor/ui-base/src/dialog/dialog-input.d.ts +9 -0
- package/@ones-editor/ui-base/src/dialog/dialog-radio.d.ts +12 -0
- package/@ones-editor/ui-base/src/dialog/index.d.ts +15 -0
- package/@ones-editor/ui-base/src/dialog/modal-dialog.d.ts +21 -0
- package/@ones-editor/ui-base/src/dialog/popup-dialog.d.ts +31 -0
- package/@ones-editor/ui-base/src/dialog/standard-dialog.d.ts +25 -0
- package/@ones-editor/ui-base/src/dialog/standard-modal-dialog.d.ts +7 -0
- package/@ones-editor/ui-base/src/dialog/standard-popup-dialog.d.ts +17 -0
- package/@ones-editor/ui-base/src/dialog/types.d.ts +1 -0
- package/@ones-editor/ui-base/src/locale/en-us.d.ts +5 -0
- package/@ones-editor/ui-base/src/locale/ja-jp.d.ts +5 -0
- package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +5 -0
- package/dist/error-handler/error-info-bar.d.ts +20 -0
- package/dist/error-handler/index.d.ts +29 -0
- package/dist/index.js +2699 -1889
- package/dist/lang/en-us.d.ts +3 -0
- package/dist/lang/ja-jp.d.ts +3 -0
- package/dist/lang/zh-cn.d.ts +3 -0
- package/dist/types.d.ts +16 -1
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import StandardDialog from './standard-dialog';
|
|
2
|
+
import { ButtonType } from './types';
|
|
3
|
+
import './alert-dialog.scss';
|
|
4
|
+
export interface AlertDialogOptions {
|
|
5
|
+
id?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
content: string | HTMLElement;
|
|
8
|
+
icon?: string;
|
|
9
|
+
buttons?: ButtonType[] | HTMLElement[];
|
|
10
|
+
okButtonTitle?: string;
|
|
11
|
+
onOk?: (dialog: AlertDialog) => Promise<void> | void;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
type?: 'warning' | 'info' | 'danger';
|
|
14
|
+
}
|
|
15
|
+
export default class AlertDialog extends StandardDialog {
|
|
16
|
+
private alertOptions;
|
|
17
|
+
constructor(alertOptions: AlertDialogOptions);
|
|
18
|
+
static showAlert(options: AlertDialogOptions): AlertDialog | null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import StandardDialog from './standard-dialog';
|
|
2
|
+
import './confirm-dialog.scss';
|
|
3
|
+
import { ButtonType } from './types';
|
|
4
|
+
export interface ConfirmDialogOptions {
|
|
5
|
+
id?: string;
|
|
6
|
+
buttons?: ButtonType[] | HTMLElement[];
|
|
7
|
+
title?: string;
|
|
8
|
+
content: string | HTMLElement;
|
|
9
|
+
icon?: string;
|
|
10
|
+
hideClose?: boolean;
|
|
11
|
+
bodyClasses?: string[];
|
|
12
|
+
okButtonTitle?: string;
|
|
13
|
+
onClickButton?: (dialog: StandardDialog, button: HTMLElement) => Promise<boolean> | undefined;
|
|
14
|
+
onOk?: (dialog: ConfirmDialog) => Promise<boolean>;
|
|
15
|
+
onCancel?: (dialog: ConfirmDialog) => Promise<boolean>;
|
|
16
|
+
}
|
|
17
|
+
export default class ConfirmDialog extends StandardDialog {
|
|
18
|
+
private askOptions;
|
|
19
|
+
constructor(askOptions: ConfirmDialogOptions);
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import './dialog-buttons.scss';
|
|
2
|
+
export interface StandardButtonOptions {
|
|
3
|
+
icon?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
primary?: boolean;
|
|
7
|
+
noBackground?: boolean;
|
|
8
|
+
noBorder?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function createStandardButton(parent: HTMLElement, options: StandardButtonOptions): HTMLButtonElement;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import './dialog-check.scss';
|
|
2
|
+
export interface StandardCheckOptions {
|
|
3
|
+
label: string;
|
|
4
|
+
classes?: string[];
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
labelId?: string;
|
|
8
|
+
extra?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function createStandardCheck(parent: HTMLElement, options: StandardCheckOptions): {
|
|
11
|
+
root: HTMLLabelElement;
|
|
12
|
+
check: HTMLInputElement;
|
|
13
|
+
label: HTMLSpanElement;
|
|
14
|
+
};
|
|
15
|
+
export declare function updateStandardCheckExtra(check: HTMLInputElement, extra: string): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function setInputError(input: HTMLInputElement, message: string): void;
|
|
2
|
+
export declare function clearInputError(input: HTMLInputElement): void;
|
|
3
|
+
export interface StandardInputOptions {
|
|
4
|
+
classes?: string[];
|
|
5
|
+
inputClasses?: string[];
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function createStandardInput(parent: HTMLElement, options?: StandardInputOptions): HTMLInputElement;
|
|
9
|
+
export declare function updateInputPlaceholder(input: HTMLInputElement, placeholder: string): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import './dialog-radio.scss';
|
|
2
|
+
export interface StandardRadioOptions {
|
|
3
|
+
label: string;
|
|
4
|
+
classes?: string[];
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function createStandardRadio(parent: HTMLElement, options: StandardRadioOptions): {
|
|
9
|
+
root: HTMLLabelElement;
|
|
10
|
+
radio: HTMLInputElement;
|
|
11
|
+
label: HTMLSpanElement;
|
|
12
|
+
};
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import ManualCloseDialog from './manual-close-dialog';
|
|
2
2
|
import type { ManualCloseDialogOptions } from './manual-close-dialog';
|
|
3
|
+
import AlertDialog from './alert-dialog';
|
|
4
|
+
import type { AlertDialogOptions } from './alert-dialog';
|
|
5
|
+
import ConfirmDialog from './confirm-dialog';
|
|
6
|
+
import type { ConfirmDialogOptions } from './confirm-dialog';
|
|
7
|
+
import StandardDialog from './standard-dialog';
|
|
8
|
+
import type { StandardDialogOptions } from './standard-dialog';
|
|
9
|
+
import StandardModalDialog from './standard-modal-dialog';
|
|
10
|
+
import type { StandardModalDialogOptions } from './standard-modal-dialog';
|
|
11
|
+
import StandardPopupDialog from './standard-popup-dialog';
|
|
12
|
+
import type { StandardPopupDialogOptions } from './standard-popup-dialog';
|
|
3
13
|
export * from './types';
|
|
4
14
|
export { ManualCloseDialog, ManualCloseDialogOptions };
|
|
15
|
+
export { AlertDialog, AlertDialogOptions };
|
|
16
|
+
export { ConfirmDialog, ConfirmDialogOptions };
|
|
17
|
+
export { StandardDialog, StandardDialogOptions };
|
|
18
|
+
export { StandardModalDialog, StandardModalDialogOptions };
|
|
19
|
+
export { StandardPopupDialog, StandardPopupDialogOptions };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import './modal-dialog.scss';
|
|
2
|
+
import './dialog-buttons.scss';
|
|
3
|
+
import './dialog-input.scss';
|
|
4
|
+
export type ManualCloseDialogOptions = {
|
|
5
|
+
id?: string;
|
|
6
|
+
bodyClasses?: string[];
|
|
7
|
+
dialogClasses?: string[];
|
|
8
|
+
disableBackdropClose?: boolean;
|
|
9
|
+
onClose?: (dialog: ModalDialog) => void;
|
|
10
|
+
};
|
|
11
|
+
export default class ModalDialog {
|
|
12
|
+
protected content: HTMLElement;
|
|
13
|
+
protected options?: ManualCloseDialogOptions | undefined;
|
|
14
|
+
protected root: HTMLElement | null;
|
|
15
|
+
protected static zIndex: number;
|
|
16
|
+
constructor(content: HTMLElement, options?: ManualCloseDialogOptions | undefined);
|
|
17
|
+
show(): void;
|
|
18
|
+
close(): void;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
protected handleWindowMouseDown: (event: MouseEvent) => void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import './popup-dialog.scss';
|
|
2
|
+
import { GetReferenceClientRect } from 'tippy.js';
|
|
3
|
+
import { Placement } from '../command-bar/types';
|
|
4
|
+
export interface PopupDialogOptions {
|
|
5
|
+
id?: string;
|
|
6
|
+
content: HTMLElement;
|
|
7
|
+
target?: HTMLElement;
|
|
8
|
+
placement?: Placement;
|
|
9
|
+
point?: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
theme?: string;
|
|
14
|
+
getReferenceClientRect?: GetReferenceClientRect | null | undefined;
|
|
15
|
+
offset?: [number, number];
|
|
16
|
+
arrow?: boolean;
|
|
17
|
+
disablePageScroll?: boolean;
|
|
18
|
+
onClose?: (dialog: PopupDialog) => void;
|
|
19
|
+
onShow?: (dialog: PopupDialog) => void;
|
|
20
|
+
}
|
|
21
|
+
export default class PopupDialog {
|
|
22
|
+
private options;
|
|
23
|
+
private popup;
|
|
24
|
+
constructor(options: PopupDialogOptions);
|
|
25
|
+
destroy(): void;
|
|
26
|
+
show(target?: HTMLElement): void;
|
|
27
|
+
close(): void;
|
|
28
|
+
handlePopupClose: () => void;
|
|
29
|
+
handlePopupShow: () => void;
|
|
30
|
+
popupContent(): HTMLElement;
|
|
31
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import ModalDialog from './modal-dialog';
|
|
2
|
+
import { ButtonType } from './types';
|
|
3
|
+
import './standard-dialog.scss';
|
|
4
|
+
export interface StandardDialogOptions {
|
|
5
|
+
id?: string;
|
|
6
|
+
buttons: ButtonType[] | HTMLElement[];
|
|
7
|
+
title?: string;
|
|
8
|
+
content: string | HTMLElement;
|
|
9
|
+
icon?: string;
|
|
10
|
+
hideClose?: boolean;
|
|
11
|
+
bodyClasses?: string[];
|
|
12
|
+
okButtonTitle?: string;
|
|
13
|
+
dialogClasses?: string[];
|
|
14
|
+
onClose?: (dialog: ModalDialog) => void;
|
|
15
|
+
onClickButton?: (dialog: StandardDialog, button: HTMLElement) => Promise<boolean> | undefined;
|
|
16
|
+
onClickClose?: (dialog: StandardDialog) => Promise<boolean>;
|
|
17
|
+
}
|
|
18
|
+
export default class StandardDialog extends ModalDialog {
|
|
19
|
+
protected dialogOptions: StandardDialogOptions;
|
|
20
|
+
constructor(dialogOptions: StandardDialogOptions);
|
|
21
|
+
destroy(): void;
|
|
22
|
+
private handleContentClick;
|
|
23
|
+
show(): void;
|
|
24
|
+
static createDialogContent(options: StandardDialogOptions): HTMLElement;
|
|
25
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import StandardDialog, { StandardDialogOptions } from './standard-dialog';
|
|
2
|
+
import './standard-modal-dialog.scss';
|
|
3
|
+
export type StandardModalDialogOptions = StandardDialogOptions;
|
|
4
|
+
export default class StandardModalDialog extends StandardDialog {
|
|
5
|
+
constructor(dialogOptions: StandardModalDialogOptions);
|
|
6
|
+
destroy(): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ButtonType } from './types';
|
|
2
|
+
import PopupDialog, { PopupDialogOptions } from './popup-dialog';
|
|
3
|
+
import './standard-popup-dialog.scss';
|
|
4
|
+
export interface StandardPopupDialogOptions extends PopupDialogOptions {
|
|
5
|
+
buttons: ButtonType[] | HTMLElement[];
|
|
6
|
+
bodyClasses?: string[];
|
|
7
|
+
onClickButton?: (dialog: StandardPopupDialog, button: HTMLElement) => Promise<boolean> | undefined;
|
|
8
|
+
}
|
|
9
|
+
export default class StandardPopupDialog extends PopupDialog {
|
|
10
|
+
protected dialogOptions: StandardPopupDialogOptions;
|
|
11
|
+
private dialogContent;
|
|
12
|
+
constructor(dialogOptions: StandardPopupDialogOptions);
|
|
13
|
+
destroy(): void;
|
|
14
|
+
private handleContentClick;
|
|
15
|
+
show(): void;
|
|
16
|
+
static createDialogContent(options: StandardPopupDialogOptions): HTMLElement;
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OnesEditor } from '../../@ones-editor/core';
|
|
2
|
+
import './error-info-bar.scss';
|
|
3
|
+
export type BarType = 'error' | 'warning' | 'success';
|
|
4
|
+
export default class ErrorInfoBar {
|
|
5
|
+
private editor;
|
|
6
|
+
private root;
|
|
7
|
+
private message;
|
|
8
|
+
private _hideTimer;
|
|
9
|
+
private _adjustParentInterval;
|
|
10
|
+
private _messageText;
|
|
11
|
+
private _type;
|
|
12
|
+
constructor(editor: OnesEditor);
|
|
13
|
+
show(message: string, type: BarType): void;
|
|
14
|
+
hide(): void;
|
|
15
|
+
visible(): boolean;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
private findParent;
|
|
18
|
+
private autoAdjustParent;
|
|
19
|
+
private getErrorMessage;
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { OnesEditor } from '../../@ones-editor/core';
|
|
2
|
+
import { AuthMessage } from '../../@ones-editor/sharedb-doc';
|
|
3
|
+
import ErrorInfoBar from './error-info-bar';
|
|
4
|
+
export default class DefaultErrorHandler {
|
|
5
|
+
private _editor;
|
|
6
|
+
private _errorInfoBar;
|
|
7
|
+
private _dirtyFlag;
|
|
8
|
+
private _connectionFlag;
|
|
9
|
+
private _errorMessage;
|
|
10
|
+
onMaxUsersError: () => void;
|
|
11
|
+
onDirtyTimeoutError: () => void;
|
|
12
|
+
onClean: () => void;
|
|
13
|
+
onRenewingToken: (count: number) => void;
|
|
14
|
+
onRenewedToken: (auth: AuthMessage) => void;
|
|
15
|
+
onRenewTokenError: (error: Error) => void;
|
|
16
|
+
onReauthing: () => void;
|
|
17
|
+
onReauthError: (error: Error) => void;
|
|
18
|
+
onReauthRecovered: (auth: AuthMessage) => void;
|
|
19
|
+
onUnknownError: (error: Error) => void;
|
|
20
|
+
onConnectionError: (error: Error) => void;
|
|
21
|
+
onDisconnected: (reason: string) => void;
|
|
22
|
+
onUploadResourceError: (error: Error) => void;
|
|
23
|
+
onReady: () => void;
|
|
24
|
+
setEditor(editor: OnesEditor): void;
|
|
25
|
+
private handleError;
|
|
26
|
+
private autoHide;
|
|
27
|
+
get bar(): ErrorInfoBar;
|
|
28
|
+
destroy(): void;
|
|
29
|
+
}
|