@ones-editor/editor 1.0.9 → 1.1.0-beta.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/code-block/src/index.d.ts +2 -2
- 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/containers/children.d.ts +1 -0
- package/@ones-editor/core/src/core/doc/doc.d.ts +0 -1
- package/@ones-editor/core/src/core/editor/actions/update-block-text.d.ts +3 -3
- package/@ones-editor/core/src/core/editor/actions/update-box-data.d.ts +2 -2
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +0 -1
- 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/selection/editor-selection.d.ts +1 -1
- package/@ones-editor/core/src/core/types.d.ts +6 -28
- 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/graph-embed/src/config/index.d.ts +1 -1
- package/@ones-editor/image-embed/src/shortcuts/index.d.ts +1 -2
- package/@ones-editor/misc/src/index.d.ts +0 -1
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +0 -4
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +0 -1
- package/@ones-editor/sharedb-doc/src/versions/sharedb-server.d.ts +6 -1
- package/@ones-editor/status/package.json +7 -0
- package/@ones-editor/status/src/dom/create-status-tag.d.ts +8 -0
- package/@ones-editor/status/src/dom/input.d.ts +1 -0
- package/@ones-editor/status/src/dom/overflow-tooltip-tag.d.ts +18 -0
- package/@ones-editor/status/src/dom/status-palette.d.ts +6 -0
- package/@ones-editor/status/src/index.d.ts +4 -0
- package/@ones-editor/status/src/locale/en-us.d.ts +25 -0
- package/@ones-editor/status/src/locale/ja-jp.d.ts +25 -0
- package/@ones-editor/status/src/locale/zh-cn.d.ts +25 -0
- package/@ones-editor/status/src/status-box-command.d.ts +7 -0
- package/@ones-editor/status/src/status-box-data.d.ts +5 -0
- package/@ones-editor/status/src/status-box-editor.d.ts +21 -0
- package/@ones-editor/status/src/status-box.d.ts +4 -0
- package/@ones-editor/status/src/types.d.ts +8 -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/ui-base/src/icons/index.d.ts +2 -1
- package/@ones-editor/ui-base/src/input/create-input.d.ts +2 -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.d.ts +1 -1
- package/dist/index.js +205 -199
- 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 -4
- package/@ones-editor/context-menu/src/helper/command-items.d.ts +0 -23
- package/@ones-editor/context-menu/src/helper/utils.d.ts +0 -4
- package/@ones-editor/context-menu/src/locale/en-us.d.ts +0 -14
- 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
- package/@ones-editor/misc/src/is-secure-env.d.ts +0 -1
- /package/@ones-editor/{context-menu → status}/src/locale/index.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CodeBlock, CodeLineBlock, CodeTextDecorator
|
|
1
|
+
import { CodeBlock, CodeLineBlock, CodeTextDecorator } from './code-block';
|
|
2
2
|
import './locale';
|
|
3
3
|
export * from './code-block/types';
|
|
4
|
-
export { CodeBlock, CodeLineBlock, CodeTextDecorator
|
|
4
|
+
export { CodeBlock, CodeLineBlock, CodeTextDecorator };
|
|
5
5
|
export { isCodeBlock } from './code-block/code-block-dom';
|
|
@@ -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';
|
|
@@ -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;
|
|
@@ -213,7 +213,6 @@ export interface OnesEditorDoc extends OnesEditorDocServer {
|
|
|
213
213
|
}[]) => void;
|
|
214
214
|
localDeleteChildContainers: (containerIds: string[]) => void;
|
|
215
215
|
addResources: (resourceIds: string[]) => Promise<string[]>;
|
|
216
|
-
patchSyncResources: (resourceIds: string[]) => Promise<string[]>;
|
|
217
216
|
uploadResource: (file: File, options?: UploadResourceOptions) => Promise<UploadResourceResult>;
|
|
218
217
|
request: <T = unknown>(url: string, options?: unknown) => Promise<T>;
|
|
219
218
|
broadcastMessage: (data: unknown) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnesEditor, BlockElement } from '../../types';
|
|
1
|
+
import { OnesEditor, BlockElement, InsertTextOptions } from '../../types';
|
|
2
2
|
import { DocBlockText, DocBlockTextActions } from '../../doc';
|
|
3
|
-
export declare function editorUpdateBlockText(editor: OnesEditor, block: BlockElement, ops: DocBlockTextActions): DocBlockText;
|
|
4
|
-
export declare function editorSetBlockText(editor: OnesEditor, block: BlockElement, newText: DocBlockText): void;
|
|
3
|
+
export declare function editorUpdateBlockText(editor: OnesEditor, block: BlockElement, ops: DocBlockTextActions, options?: InsertTextOptions): DocBlockText;
|
|
4
|
+
export declare function editorSetBlockText(editor: OnesEditor, block: BlockElement, newText: DocBlockText, options?: InsertTextOptions): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { OnesEditor } from '../../types';
|
|
1
|
+
import { InsertTextOptions, OnesEditor } from '../../types';
|
|
2
2
|
import { DocBox } from '../../doc';
|
|
3
|
-
export declare function editorUpdateBoxData(editor: OnesEditor, boxData: DocBox): void;
|
|
3
|
+
export declare function editorUpdateBoxData(editor: OnesEditor, boxData: DocBox, options?: InsertTextOptions): void;
|
|
@@ -36,7 +36,6 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
|
|
|
36
36
|
onError(error: Error): void;
|
|
37
37
|
uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
|
|
38
38
|
addResources(resourceIds: string[]): Promise<string[]>;
|
|
39
|
-
patchSyncResources(resourceIds: string[]): Promise<string[]>;
|
|
40
39
|
buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
|
|
41
40
|
request<T = unknown>(url: string, options?: unknown): Promise<T>;
|
|
42
41
|
broadcastMessage(data: unknown): 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
|
}
|
|
@@ -14,7 +14,7 @@ export declare class EditorSelection implements OnesEditorSelection {
|
|
|
14
14
|
getFocusedBlock(): BlockElement;
|
|
15
15
|
getStartBlock(): BlockElement;
|
|
16
16
|
getEndBlock(): BlockElement;
|
|
17
|
-
selectBlock(block: BlockElement, start: number, end?: number): void;
|
|
17
|
+
selectBlock(block: BlockElement, start: number, end?: number, options?: ChangeSelectionOptions): void;
|
|
18
18
|
setSelection(anchor: BlockPosition, focus?: BlockPosition, options?: ChangeSelectionOptions): SelectionRange;
|
|
19
19
|
setRange(range: SelectionRange, options?: ChangeSelectionOptions): SelectionRange;
|
|
20
20
|
updateSelection(): void;
|
|
@@ -66,7 +66,7 @@ export interface Box {
|
|
|
66
66
|
handleClickBox?: (editor: OnesEditor, box: BoxElement, event: MouseEvent) => void;
|
|
67
67
|
toStandardText?: (editor: OnesEditor, box: DocBox) => Promise<DocBlockText | undefined>;
|
|
68
68
|
getBoxProperties?: (editor: OnesEditor, boxElement: BoxElement) => BoxProperties;
|
|
69
|
-
getResources?: (editor: OnesEditor, box: DocBox) => string[];
|
|
69
|
+
getResources?: (editor: OnesEditor, box: DocBox) => string[] | null;
|
|
70
70
|
}
|
|
71
71
|
export interface Insertion {
|
|
72
72
|
insertionType: string;
|
|
@@ -228,7 +228,7 @@ export interface Block {
|
|
|
228
228
|
toStandardDoc?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject) => Promise<DocObject | undefined>;
|
|
229
229
|
getBlockStyles?: (editor: OnesEditor, block: BlockElement) => BlockStyles;
|
|
230
230
|
blockToDoc?: (srcDoc: DocObject, srcBlockData: DocBlock, childBlockConverter: (srcDoc: DocObject, srcBlockData: DocBlock) => DocObject) => DocObject;
|
|
231
|
-
getResources?: (editor: OnesEditor, data: DocBlock) => string[];
|
|
231
|
+
getResources?: (editor: OnesEditor, data: DocBlock) => string[] | null;
|
|
232
232
|
replaceResources?: (data: DocBlock, resources: Map<string, string>) => void;
|
|
233
233
|
}
|
|
234
234
|
export type TextStyles = {
|
|
@@ -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 {
|
|
@@ -442,6 +440,7 @@ export type OnesEditorCustomCreator = (editor: OnesEditor) => OnesEditorCustom;
|
|
|
442
440
|
export interface CloneBlockResultInfo {
|
|
443
441
|
containerIdMap: Map<string, string>;
|
|
444
442
|
blockIdMap: Map<string, string>;
|
|
443
|
+
boxIdMap: Map<string, string>;
|
|
445
444
|
}
|
|
446
445
|
export interface OnesEditorDomEvents extends OnesEditorCustom {
|
|
447
446
|
addEventListener: <T = Event>(element: Element | Document | Window, eventName: string, eventHandler: (editor: OnesEditor, event: T) => void) => void;
|
|
@@ -506,6 +505,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
506
505
|
getBlockById: (id: string) => BlockElement;
|
|
507
506
|
getBoxById: (id: string) => BoxElement;
|
|
508
507
|
getBlockByIndex: (containerId: string, blockIndex: number) => BlockElement;
|
|
508
|
+
findBlockByIndex: (containerId: string, blockIndex: number) => BlockElement | null;
|
|
509
509
|
getBlockIndex: (block: BlockElement | string) => number;
|
|
510
510
|
getContainerById: (id: string) => ContainerElement;
|
|
511
511
|
getParentContainer: (block: BlockElement) => ContainerElement;
|
|
@@ -541,7 +541,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
541
541
|
deleteChildContainers: (containerIds: string[]) => void;
|
|
542
542
|
updateBlockData: (block: BlockElement, data: DocBlockAttributes, newRange?: SelectionRange) => DocBlock;
|
|
543
543
|
updateEmbedData: (block: BlockElement, data: DocEmbedData, newRange?: SelectionRange) => DocBlock;
|
|
544
|
-
updateBoxData: (boxData: DocBox) => void;
|
|
544
|
+
updateBoxData: (boxData: DocBox, options?: InsertTextOptions) => void;
|
|
545
545
|
updateCompositionText: (text: string, end: boolean) => void;
|
|
546
546
|
getColor: (index: number, type?: string) => string;
|
|
547
547
|
}
|
|
@@ -556,7 +556,7 @@ export interface OnesEditorSelection {
|
|
|
556
556
|
readonly endBlock: BlockElement;
|
|
557
557
|
setSelection: (anchor: BlockPosition, focus?: BlockPosition, options?: ChangeSelectionOptions) => SelectionRange;
|
|
558
558
|
setRange: (range: SelectionRange, options?: ChangeSelectionOptions) => SelectionRange;
|
|
559
|
-
selectBlock: (block: BlockElement, start: number, end?: number) => void;
|
|
559
|
+
selectBlock: (block: BlockElement, start: number, end?: number, options?: ChangeSelectionOptions) => void;
|
|
560
560
|
updateSelection: (old: SelectionRange | null) => void;
|
|
561
561
|
updateLastCaretRect: () => void;
|
|
562
562
|
getSuggestedCaretX: () => number | undefined;
|
|
@@ -569,32 +569,10 @@ export type RemoteChangeType = 'UpdateBlockText' | 'UpdateBlockData' | 'InsertBl
|
|
|
569
569
|
export type PasteOptions = {
|
|
570
570
|
toPlainText?: boolean;
|
|
571
571
|
};
|
|
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
572
|
export interface OnesEditorInput {
|
|
594
573
|
readonly inputElement: HTMLInputElement;
|
|
595
574
|
destroy: () => void;
|
|
596
575
|
focus: () => void;
|
|
597
|
-
callbacks: EditorInputCallbacks;
|
|
598
576
|
handleDocumentSelectionChange: () => void;
|
|
599
577
|
handleCompositionstart: (event: CompositionEvent) => void;
|
|
600
578
|
handleCompositionend: (event: CompositionEvent) => void;
|
|
@@ -24,7 +24,6 @@ export declare class LocalDoc extends EventCallbacks<OnesEditorDocCallbacks> imp
|
|
|
24
24
|
localDeleteChildContainers(containerIds: string[]): void;
|
|
25
25
|
uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
|
|
26
26
|
addResources(resourceIds: string[]): Promise<string[]>;
|
|
27
|
-
patchSyncResources(resourceIds: string[]): Promise<string[]>;
|
|
28
27
|
buildResourceUrl(src: string): string;
|
|
29
28
|
request<T>(url: string, opt?: any): Promise<T>;
|
|
30
29
|
broadcastMessage(data: unknown): 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, };
|
|
@@ -30,11 +30,7 @@ export default class ShareDBClient {
|
|
|
30
30
|
getFileUrlByHash(uploadFileUrl: string, hash: string, name: string, size: number, headers: {
|
|
31
31
|
[index: string]: string;
|
|
32
32
|
}): Promise<any>;
|
|
33
|
-
patchSyncResourceByHash(uploadFileUrl: string, hash: string[], headers: {
|
|
34
|
-
[index: string]: string;
|
|
35
|
-
}): Promise<any[]>;
|
|
36
33
|
getFileUrlsByHashes(resourceHashes: string[]): Promise<any[]>;
|
|
37
|
-
patchSyncResourceByHashes(resourceHashes: string[]): Promise<any[]>;
|
|
38
34
|
uploadFile(url: string, file: File, headers: {
|
|
39
35
|
[index: string]: string;
|
|
40
36
|
}, onProgress: OnProgress, options?: {
|
|
@@ -76,7 +76,6 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
|
|
|
76
76
|
onUpdateComment(commentId: string, local: boolean): void;
|
|
77
77
|
onCustomMessage(msg: unknown): void;
|
|
78
78
|
addResources(resourceIds: string[]): Promise<string[]>;
|
|
79
|
-
patchSyncResources(resourceIds: string[]): Promise<any[]>;
|
|
80
79
|
uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
|
|
81
80
|
buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
|
|
82
81
|
request<T = unknown>(url: string, options?: unknown): Promise<T>;
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BoxContentElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { OverflowTooltipTag } from './overflow-tooltip-tag';
|
|
3
|
+
import { StatusBoxData } from '../types';
|
|
4
|
+
export declare class CreateStatusTag {
|
|
5
|
+
static tagRef: Map<string, OverflowTooltipTag>;
|
|
6
|
+
static create(editor: OnesEditor, classes: string[], data: StatusBoxData, boxContent: BoxContentElement): OverflowTooltipTag | undefined;
|
|
7
|
+
static remove(id: string): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createStatusInput(parent: HTMLElement, defaultValue: string, onChange: ((e: Event) => void), onKeyDown: (e: KeyboardEvent) => void): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class OverflowTooltipTag {
|
|
3
|
+
private editor;
|
|
4
|
+
root: HTMLElement;
|
|
5
|
+
private ro?;
|
|
6
|
+
private mo?;
|
|
7
|
+
constructor(editor: OnesEditor, title: string, classes: string[], parent: HTMLElement);
|
|
8
|
+
private replaceTitleSpace;
|
|
9
|
+
private check;
|
|
10
|
+
private observeResize;
|
|
11
|
+
private handleContentChange;
|
|
12
|
+
private observeRemoval;
|
|
13
|
+
private unbindResizeObserver;
|
|
14
|
+
private unbindMutationObserver;
|
|
15
|
+
rebind(root: HTMLElement): void;
|
|
16
|
+
changeTag(title: string, classes: string[]): void;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
status: {
|
|
3
|
+
empty: string;
|
|
4
|
+
command: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
color: {
|
|
8
|
+
red: string;
|
|
9
|
+
yellow: string;
|
|
10
|
+
green: string;
|
|
11
|
+
blue: string;
|
|
12
|
+
purple: string;
|
|
13
|
+
grey: string;
|
|
14
|
+
};
|
|
15
|
+
colorDefaultTitle: {
|
|
16
|
+
red: string;
|
|
17
|
+
yellow: string;
|
|
18
|
+
green: string;
|
|
19
|
+
blue: string;
|
|
20
|
+
purple: string;
|
|
21
|
+
grey: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
status: {
|
|
3
|
+
empty: string;
|
|
4
|
+
command: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
color: {
|
|
8
|
+
red: string;
|
|
9
|
+
yellow: string;
|
|
10
|
+
green: string;
|
|
11
|
+
blue: string;
|
|
12
|
+
purple: string;
|
|
13
|
+
grey: string;
|
|
14
|
+
};
|
|
15
|
+
colorDefaultTitle: {
|
|
16
|
+
red: string;
|
|
17
|
+
yellow: string;
|
|
18
|
+
green: string;
|
|
19
|
+
blue: string;
|
|
20
|
+
purple: string;
|
|
21
|
+
grey: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
status: {
|
|
3
|
+
empty: string;
|
|
4
|
+
command: {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
color: {
|
|
8
|
+
red: string;
|
|
9
|
+
yellow: string;
|
|
10
|
+
green: string;
|
|
11
|
+
blue: string;
|
|
12
|
+
purple: string;
|
|
13
|
+
grey: string;
|
|
14
|
+
};
|
|
15
|
+
colorDefaultTitle: {
|
|
16
|
+
red: string;
|
|
17
|
+
yellow: string;
|
|
18
|
+
green: string;
|
|
19
|
+
blue: string;
|
|
20
|
+
purple: string;
|
|
21
|
+
grey: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommandItem, OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
+
export declare class StatusBoxCommand {
|
|
3
|
+
static id: string;
|
|
4
|
+
static get commands(): CommandItem[];
|
|
5
|
+
static insertStatus(editor: OnesEditor, containerId: string, blockIndex: number): void;
|
|
6
|
+
static insertEmptyBlockStatus(editor: OnesEditor, containerId: string, blockIndex: number): import("@ones-editor/core").BlockElement;
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DocBlockTextOp, OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
+
import { StatusBoxData, StatusColor } from './types';
|
|
3
|
+
export declare function createEmptyStatusBox(editor: OnesEditor): DocBlockTextOp;
|
|
4
|
+
export declare function recordLastStatusBoxData(editor: OnesEditor, box: StatusBoxData): void;
|
|
5
|
+
export declare function getLastStatusBoxTitle(editor: OnesEditor, color: StatusColor): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BoxElement, OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
+
import { Popup } from '../../../@ones-editor/ui-base';
|
|
3
|
+
import { StatusColor } from './types';
|
|
4
|
+
import { StatusPalette } from './dom/status-palette';
|
|
5
|
+
export declare class StatusBoxEditor {
|
|
6
|
+
private editor;
|
|
7
|
+
linkPopup: Popup | null;
|
|
8
|
+
boxElement?: BoxElement;
|
|
9
|
+
statusPalette: StatusPalette;
|
|
10
|
+
isEditing: boolean;
|
|
11
|
+
constructor(editor: OnesEditor);
|
|
12
|
+
editorStatus: (boxElement: BoxElement) => void;
|
|
13
|
+
focus(): void;
|
|
14
|
+
handleShow: () => void;
|
|
15
|
+
handClose: () => void;
|
|
16
|
+
handleKeyDown: (e: KeyboardEvent) => void;
|
|
17
|
+
createPopupContent(title: string, color: StatusColor, subtle: boolean): HTMLDivElement;
|
|
18
|
+
onColorChange: (e: Event) => void;
|
|
19
|
+
changeTitle: (e: Event) => void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DocBox } from '../../../@ones-editor/core';
|
|
2
|
+
export declare const STATUS_COLORS: readonly ["Blue", "Grey", "Yellow", "Red", "Green", "Purple"];
|
|
3
|
+
export type StatusColor = typeof STATUS_COLORS[number];
|
|
4
|
+
export interface StatusBoxData extends DocBox {
|
|
5
|
+
title: string;
|
|
6
|
+
subtle: boolean;
|
|
7
|
+
color: StatusColor;
|
|
8
|
+
}
|