@ones-editor/editor 1.1.3-bate.1 → 1.1.3-bate.10
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/composition/editor-input.d.ts +22 -1
- package/@ones-editor/core/src/core/composition/index.d.ts +1 -1
- package/@ones-editor/core/src/core/doc/doc.d.ts +1 -1
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +1 -0
- package/@ones-editor/core/src/core/input-handler/actions.d.ts +0 -1
- package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +3 -4
- package/@ones-editor/core/src/core/keyboard/default-shortcuts.d.ts +1 -2
- package/@ones-editor/core/src/core/types.d.ts +0 -24
- package/@ones-editor/core/src/local-doc/index.d.ts +0 -1
- package/@ones-editor/core/src/utils/index.d.ts +0 -1
- package/@ones-editor/drawio-embed/src/helper/iframe-embed-doc-event.d.ts +0 -1
- package/@ones-editor/drawio-embed/src/index.d.ts +1 -0
- package/@ones-editor/graph-embed/src/config/index.d.ts +1 -1
- package/@ones-editor/image-embed/src/shortcuts/index.d.ts +1 -2
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +2 -1
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +1 -1
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +0 -1
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +0 -1
- package/@ones-editor/versions/src/history-doc/history-doc.d.ts +0 -1
- package/@ones-editor/versions/src/version-dialog/version-list.d.ts +1 -1
- package/dist/index.js +827 -75421
- package/dist/types.d.ts +0 -2
- package/package.json +1 -1
- package/@ones-editor/context-menu/index.d.ts +0 -3
- package/@ones-editor/context-menu/package.json +0 -8
- package/@ones-editor/context-menu/src/helper/actions.d.ts +0 -5
- package/@ones-editor/context-menu/src/helper/command-items.d.ts +0 -26
- package/@ones-editor/context-menu/src/helper/utils.d.ts +0 -3
- package/@ones-editor/context-menu/src/locale/en-us.d.ts +0 -14
- package/@ones-editor/context-menu/src/locale/index.d.ts +0 -1
- package/@ones-editor/context-menu/src/locale/ja-jp.d.ts +0 -14
- package/@ones-editor/context-menu/src/locale/zh-cn.d.ts +0 -14
- package/@ones-editor/context-menu/src/menu/index.d.ts +0 -17
- package/@ones-editor/core/src/utils/blob-to-string.d.ts +0 -1
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import { OnesEditorInput, OnesEditor, OnesEditorInputHandler, OnesEditorUndoAction, RemoteChangeType, PasteOptions } from '../types';
|
|
2
|
-
import
|
|
2
|
+
import { DocObject } from '../doc';
|
|
3
|
+
export interface EditorInputCallbacks {
|
|
4
|
+
onInsertText: (event: Event, text: string) => void;
|
|
5
|
+
onCompositionStart: (event: Event) => void;
|
|
6
|
+
onUpdateCompositionText: (event: Event, text: string, end: boolean) => void;
|
|
7
|
+
onKeyDown: (event: KeyboardEvent) => boolean;
|
|
8
|
+
onChanged: (action: OnesEditorUndoAction) => void;
|
|
9
|
+
onRemoteChanged: (type: RemoteChangeType) => void;
|
|
10
|
+
onFocus: () => void;
|
|
11
|
+
onBlur: () => void;
|
|
12
|
+
onPaste: (event: ClipboardEvent) => void;
|
|
13
|
+
onPasteText: (text: string, options?: PasteOptions) => void;
|
|
14
|
+
onCopy: (event: ClipboardEvent) => void;
|
|
15
|
+
onCut: (event: ClipboardEvent) => void;
|
|
16
|
+
addHandler: (handler: OnesEditorInputHandler) => void;
|
|
17
|
+
removeHandler: (handler: OnesEditorInputHandler) => void;
|
|
18
|
+
defaultInsertText: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => void;
|
|
19
|
+
defaultHandleKeydown: (editor: OnesEditor, event: KeyboardEvent) => boolean;
|
|
20
|
+
destroy: () => void;
|
|
21
|
+
pasteDoc: (doc: DocObject) => Promise<void>;
|
|
22
|
+
forEach: (callback: (handler: OnesEditorInputHandler) => void) => void;
|
|
23
|
+
}
|
|
3
24
|
export declare class EditorInput implements OnesEditorInput {
|
|
4
25
|
editor: OnesEditor;
|
|
5
26
|
composing: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { editorCopyBlock, addMetaToDoc, injectDocToHtmlFragment
|
|
1
|
+
export { editorCopyBlock, addMetaToDoc, injectDocToHtmlFragment } from './clipboard/copy';
|
|
2
2
|
export { copyResourcesFromDoc } from './clipboard/resources/copy-resources';
|
|
@@ -196,7 +196,6 @@ export interface OnesEditorDocServer {
|
|
|
196
196
|
buildResourceUrl: (resourceId: string, options?: BuildResourceUrlOptions) => string;
|
|
197
197
|
getVersionHelper?: () => OnesEditorDocVersionHelper | undefined;
|
|
198
198
|
getRemoteUsers: () => OnesEditorRemoteUsers;
|
|
199
|
-
triggerReAuth?: () => void;
|
|
200
199
|
}
|
|
201
200
|
export interface OnesEditorDoc extends OnesEditorDocServer {
|
|
202
201
|
registerCallback: (callbacks: OnesEditorDocCallbacks) => void;
|
|
@@ -223,6 +222,7 @@ export interface OnesEditorDoc extends OnesEditorDocServer {
|
|
|
223
222
|
recognizeLink?: (link: string) => Promise<RecognizeLinkResult>;
|
|
224
223
|
beginBatchUpdate: () => number;
|
|
225
224
|
endBatchUpdate: () => number;
|
|
225
|
+
triggerReAuth?: () => void;
|
|
226
226
|
}
|
|
227
227
|
export interface OnesEditorDocHistoryData {
|
|
228
228
|
user: {
|
|
@@ -41,6 +41,7 @@ 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;
|
|
44
45
|
destroy(): void;
|
|
45
46
|
getServerMeta(): OnesEditorDocServerMeta;
|
|
46
47
|
reset(doc: OnesEditorDoc): void;
|
|
@@ -4,4 +4,3 @@ export declare function editorHandleDelete(editor: OnesEditor, event: Event): bo
|
|
|
4
4
|
export declare function editorHandleBackspace(editor: OnesEditor, event: Event): boolean;
|
|
5
5
|
export declare function editorHandleInsertBr(editor: OnesEditor, event: Event): boolean;
|
|
6
6
|
export declare function editorHandlePastePlainText(editor: OnesEditor): boolean;
|
|
7
|
-
export declare function editorHandleCopyMarkdown(editor: OnesEditor): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EditorInputCallbacks } from '../composition/editor-input';
|
|
2
|
+
import { OnesEditor, OnesEditorInputHandler, OnesEditorUndoAction, RemoteChangeType, PasteOptions } from '../types';
|
|
2
3
|
import { DocObject } from '../doc';
|
|
3
|
-
import type { EditorInputCallbacks } from '../types';
|
|
4
4
|
export declare class EditorInputHandlers implements EditorInputCallbacks {
|
|
5
5
|
editor: OnesEditor;
|
|
6
6
|
handlers: OnesEditorInputHandler[];
|
|
@@ -26,8 +26,7 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
|
|
|
26
26
|
defaultInsertText(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string): void;
|
|
27
27
|
defaultHandleKeydown(editor: OnesEditor, event: KeyboardEvent): boolean;
|
|
28
28
|
pasteDoc(doc: DocObject): Promise<void>;
|
|
29
|
-
pasteDocs
|
|
29
|
+
private pasteDocs;
|
|
30
30
|
destroy(): void;
|
|
31
31
|
forEach(cb: (handler: OnesEditorInputHandler) => void): void;
|
|
32
|
-
private getClipboardData;
|
|
33
32
|
}
|
|
@@ -391,7 +391,6 @@ export interface OnesEditorOptionalOptions {
|
|
|
391
391
|
colors?: string[];
|
|
392
392
|
scrollContainer?: HTMLElement;
|
|
393
393
|
enableComments?: boolean;
|
|
394
|
-
enableContextMenu?: boolean;
|
|
395
394
|
settingsProvider?: OnesEditorSettingsProvider;
|
|
396
395
|
}
|
|
397
396
|
export interface OnesEditorOptions {
|
|
@@ -400,7 +399,6 @@ export interface OnesEditorOptions {
|
|
|
400
399
|
[index: string]: unknown;
|
|
401
400
|
};
|
|
402
401
|
enableComments?: boolean;
|
|
403
|
-
enableContextMenu?: boolean;
|
|
404
402
|
scrollContainer?: HTMLElement;
|
|
405
403
|
}
|
|
406
404
|
export interface OnesEditorComponents {
|
|
@@ -569,32 +567,10 @@ export type RemoteChangeType = 'UpdateBlockText' | 'UpdateBlockData' | 'InsertBl
|
|
|
569
567
|
export type PasteOptions = {
|
|
570
568
|
toPlainText?: boolean;
|
|
571
569
|
};
|
|
572
|
-
export interface EditorInputCallbacks {
|
|
573
|
-
onInsertText: (event: Event, text: string) => void;
|
|
574
|
-
onCompositionStart: (event: Event) => void;
|
|
575
|
-
onUpdateCompositionText: (event: Event, text: string, end: boolean) => void;
|
|
576
|
-
onKeyDown: (event: KeyboardEvent) => boolean;
|
|
577
|
-
onChanged: (action: OnesEditorUndoAction) => void;
|
|
578
|
-
onRemoteChanged: (type: RemoteChangeType) => void;
|
|
579
|
-
onFocus: () => void;
|
|
580
|
-
onBlur: () => void;
|
|
581
|
-
onPaste: (event: ClipboardEvent) => void;
|
|
582
|
-
onPasteText: (text: string, options?: PasteOptions) => void;
|
|
583
|
-
onCopy: (event: ClipboardEvent) => void;
|
|
584
|
-
onCut: (event: ClipboardEvent) => void;
|
|
585
|
-
addHandler: (handler: OnesEditorInputHandler) => void;
|
|
586
|
-
removeHandler: (handler: OnesEditorInputHandler) => void;
|
|
587
|
-
defaultInsertText: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => void;
|
|
588
|
-
defaultHandleKeydown: (editor: OnesEditor, event: KeyboardEvent) => boolean;
|
|
589
|
-
destroy: () => void;
|
|
590
|
-
pasteDoc: (doc: DocObject) => Promise<void>;
|
|
591
|
-
forEach: (callback: (handler: OnesEditorInputHandler) => void) => void;
|
|
592
|
-
}
|
|
593
570
|
export interface OnesEditorInput {
|
|
594
571
|
readonly inputElement: HTMLInputElement;
|
|
595
572
|
destroy: () => void;
|
|
596
573
|
focus: () => void;
|
|
597
|
-
callbacks: EditorInputCallbacks;
|
|
598
574
|
handleDocumentSelectionChange: () => void;
|
|
599
575
|
handleCompositionstart: (event: CompositionEvent) => void;
|
|
600
576
|
handleCompositionend: (event: CompositionEvent) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const MERMAID_SCRIPTS = "https://cdn.jsdelivr.net/npm/mermaid
|
|
1
|
+
export declare const MERMAID_SCRIPTS = "https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js";
|
|
2
2
|
export declare const FLOWCHART_SCRIPTS: string[];
|
|
3
3
|
export declare const PLANTUML_PRE = "https://www.plantuml.com/plantuml/svg";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { OnesEditor, ShortcutRecords } from '../../../../@ones-editor/core';
|
|
2
|
-
import { copyImage } from './copy-image';
|
|
3
2
|
declare function deleteImage(editor: OnesEditor): true | undefined;
|
|
4
3
|
declare const ImageShortcuts: ShortcutRecords;
|
|
5
|
-
export { ImageShortcuts, deleteImage,
|
|
4
|
+
export { ImageShortcuts, deleteImage, };
|
|
@@ -24,7 +24,8 @@ export declare class AuthConnection {
|
|
|
24
24
|
logout(): Promise<void>;
|
|
25
25
|
init(auth: AuthMessage): Promise<void>;
|
|
26
26
|
handleAuthError(): Promise<void>;
|
|
27
|
-
|
|
27
|
+
reAuth: () => Promise<void>;
|
|
28
|
+
private emitPermissionError;
|
|
28
29
|
private emitAuthRecover;
|
|
29
30
|
private emitAuthError;
|
|
30
31
|
private emitRequestReloadError;
|
|
@@ -19,7 +19,6 @@ export default class ShareDBClient {
|
|
|
19
19
|
onWriteConflictError(callback: (error: Error) => void): void;
|
|
20
20
|
onMaxUsersError(callback: () => void): void;
|
|
21
21
|
onRequestReloadError(callback: (error: Error) => void): void;
|
|
22
|
-
triggerReAuth(): void;
|
|
23
22
|
/**
|
|
24
23
|
* 根据Id生成一个文档对象,如果文档不存在,则创建一个新的。
|
|
25
24
|
* @param id 待获取的containerId
|
|
@@ -54,4 +53,5 @@ export default class ShareDBClient {
|
|
|
54
53
|
createVersion(tag: string, publish: boolean): Promise<any>;
|
|
55
54
|
recognizeLink(url: string): Promise<LinkDetails>;
|
|
56
55
|
buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
|
|
56
|
+
reAuth(): void;
|
|
57
57
|
}
|
|
@@ -75,6 +75,7 @@ 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;
|
|
78
79
|
addResources(resourceIds: string[]): Promise<string[]>;
|
|
79
80
|
uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
|
|
80
81
|
buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
|