@ones-editor/editor 2.1.7-beta.22 → 2.1.7-beta.24
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/block-resizer/src/index.d.ts +1 -0
- package/@ones-editor/comments/src/block-hook/block-comment-hook.d.ts +10 -0
- package/@ones-editor/comments/src/comment-quick-reply/index.d.ts +1 -0
- package/@ones-editor/comments/src/comments-helper/get-comment-abstract.d.ts +2 -1
- package/@ones-editor/core/src/core/block-renderers/block-renderers.d.ts +1 -0
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -1
- package/@ones-editor/core/src/core/doc/doc.d.ts +1 -1
- package/@ones-editor/core/src/core/editor/editor-dom/dom-events.d.ts +2 -2
- package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +2 -1
- package/@ones-editor/core/src/core/types.d.ts +5 -4
- package/@ones-editor/embed-block-helper/src/block-properties/embed-block-properties.d.ts +1 -1
- package/@ones-editor/embed-block-helper/src/block-resizer/index.d.ts +1 -0
- package/@ones-editor/image-embed/src/hovering-toolbar/index.d.ts +0 -11
- package/@ones-editor/list-block/src/list-data/index.d.ts +2 -0
- package/@ones-editor/mathjax/package.json +2 -1
- package/@ones-editor/mathjax/src/mathjax-box/mathjax-editor.d.ts +1 -0
- package/@ones-editor/mathjax/src/mathjax-state/index.d.ts +2 -0
- package/@ones-editor/media-embed/src/core/hovering-toolbar/index.d.ts +2 -20
- package/@ones-editor/sharedb-doc/src/versions/sharedb-server.d.ts +1 -1
- package/@ones-editor/sharedb-doc/src/versions/simple-client.d.ts +1 -1
- package/@ones-editor/to-docx/src/errors.d.ts +3 -0
- package/@ones-editor/to-docx/src/index.d.ts +2 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +2 -1
- package/@ones-editor/ui/src/readonly-toolbar/add-comment-to-old-doc.d.ts +2 -0
- package/@ones-editor/ui/src/readonly-toolbar/helper.d.ts +2 -0
- package/@ones-editor/ui/src/readonly-toolbar/index.d.ts +2 -0
- package/@ones-editor/ui/src/tooltips/index.d.ts +21 -9
- package/@ones-editor/ui-base/src/color-button/text-color-item.d.ts +8 -5
- package/@ones-editor/ui-base/src/color-palette/color-palette.d.ts +7 -1
- package/@ones-editor/ui-base/src/color-palette/index.d.ts +3 -3
- package/@ones-editor/ui-base/src/command-bar/active-observer.d.ts +11 -0
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +1 -0
- package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +1 -0
- package/@ones-editor/versions/package.json +3 -0
- package/@ones-editor/versions/src/constant/index.d.ts +2 -0
- package/@ones-editor/versions/src/history-doc/history-doc.d.ts +2 -2
- package/@ones-editor/versions/src/history-render/index.d.ts +15 -1
- package/@ones-editor/versions/src/history-tooltip/index.d.ts +14 -0
- package/@ones-editor/versions/src/index.d.ts +1 -0
- package/@ones-editor/versions/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/versions/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/versions/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/versions/src/types.d.ts +4 -0
- package/@ones-editor/versions/src/utils/block-text.d.ts +3 -1
- package/dist/index.js +3510 -2419
- package/package.json +3 -1
|
@@ -18,6 +18,7 @@ export declare class BlockResizer extends TypedEmitter<BlockResizerEvents> {
|
|
|
18
18
|
constructor(editor: OnesEditor, options: BlockResizerOptions);
|
|
19
19
|
enableResize(block: BlockElement, resizableElement?: HTMLElement): void;
|
|
20
20
|
disableResize(): void;
|
|
21
|
+
handleEditorResize: () => void;
|
|
21
22
|
update(block: BlockElement, resizableElement?: HTMLElement): void;
|
|
22
23
|
updateResizer(): void;
|
|
23
24
|
getBlock(): BlockElement | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BlockCommands, BlockElement, CommandItem, OnesEditor, OnesEditorBlockHook, TextBlockContentChild } from '../../../../@ones-editor/core';
|
|
2
|
+
import type { OnesEditorComments } from '../comments';
|
|
3
|
+
import { OnesEditorCommentsProvider } from '../types';
|
|
4
|
+
export default class HoveringCommentBlockHook implements OnesEditorBlockHook {
|
|
5
|
+
private provider;
|
|
6
|
+
private editorComments;
|
|
7
|
+
constructor(provider: OnesEditorCommentsProvider, editorComments: OnesEditorComments);
|
|
8
|
+
commands(editor: OnesEditor, blockElement: BlockElement, child: TextBlockContentChild | null): BlockCommands | undefined;
|
|
9
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem) => void;
|
|
10
|
+
}
|
|
@@ -11,6 +11,7 @@ export declare class CommentQuickReply {
|
|
|
11
11
|
root: HTMLDivElement;
|
|
12
12
|
private components;
|
|
13
13
|
constructor(mainEditor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, comment: CommentWithChildren, groupItem: CommentGroupItem);
|
|
14
|
+
private get commentOptions();
|
|
14
15
|
private createQuickReply;
|
|
15
16
|
private handleFocus;
|
|
16
17
|
private handleDocChange;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, OnesEditor, SelectedBlock } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare function getCommentAbstract(editor: OnesEditor, blocks: BlockElement[]): string;
|
|
3
|
+
export declare function getCommentAbstractFromSelectedBlocks(editor: OnesEditor, blocks: SelectedBlock[]): string;
|
|
@@ -9,4 +9,5 @@ export declare class EditorBlockRenderers implements OnesEditorBlockRenderers {
|
|
|
9
9
|
renderText(path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
|
|
10
10
|
renderBlock(editor: OnesEditor, path: BlockPath, blockData: DocBlock): OnesEditorBlockRenderResult;
|
|
11
11
|
updateBlock(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock): void;
|
|
12
|
+
renderChildContainer(editor: OnesEditor, path: BlockPath, containerId: string): OnesEditorBlockRenderResult;
|
|
12
13
|
}
|
|
@@ -32,7 +32,7 @@ export declare class EditorInput implements OnesEditorInput {
|
|
|
32
32
|
getInput(): HTMLTextAreaElement;
|
|
33
33
|
focus(options?: FocusOptions): void;
|
|
34
34
|
isInDisableScrollMask(target: Node): boolean;
|
|
35
|
-
|
|
35
|
+
handleBlur: () => void;
|
|
36
36
|
handleWindowFocus: () => void;
|
|
37
37
|
handleDocumentClick: (event: MouseEvent | TouchEvent) => void;
|
|
38
38
|
handleDocumentSelectionChange: () => void;
|
|
@@ -268,7 +268,7 @@ export interface OnesEditorHistoryDataParseHandler {
|
|
|
268
268
|
onUpdateComment: (commentId: string, local: boolean) => void;
|
|
269
269
|
}
|
|
270
270
|
export interface OnesEditorDocVersionHelper {
|
|
271
|
-
getVersions: () => Promise<DocVersion[]>;
|
|
271
|
+
getVersions: (showPublished?: boolean) => Promise<DocVersion[]>;
|
|
272
272
|
getVersion: (ver: number) => Promise<DocObject>;
|
|
273
273
|
getLatestVersion: () => Promise<DocObject>;
|
|
274
274
|
getHistoryData: (version: number, from?: number) => Promise<{
|
|
@@ -6,7 +6,7 @@ declare class DomEventHandler {
|
|
|
6
6
|
name: string;
|
|
7
7
|
handler: DomEventCallback;
|
|
8
8
|
data: unknown;
|
|
9
|
-
constructor(editor: OnesEditor, dom: Element | Document | Window, name: string, handler: DomEventCallback, data: unknown);
|
|
9
|
+
constructor(editor: OnesEditor, dom: Element | Document | Window, name: string, handler: DomEventCallback, data: unknown, options?: boolean | AddEventListenerOptions);
|
|
10
10
|
handleEvent: (event: Event) => void;
|
|
11
11
|
destroy(): void;
|
|
12
12
|
}
|
|
@@ -15,7 +15,7 @@ export declare class EditorDomEvents {
|
|
|
15
15
|
handlers: Map<Element | Document | Window, DomEventHandler[]>;
|
|
16
16
|
constructor(editor: OnesEditor);
|
|
17
17
|
destroy(): void;
|
|
18
|
-
addEventListener<T = Event>(element: Element | Document | Window, eventName: string, eventHandler: DomEventCallback<T>, data?: unknown): void;
|
|
18
|
+
addEventListener<T = Event>(element: Element | Document | Window, eventName: string, eventHandler: DomEventCallback<T>, data?: unknown, options?: boolean | AddEventListenerOptions): void;
|
|
19
19
|
removeEventListener(element: Element | Document | Window | null, eventName: string | null, eventHandler: DomEventCallback): void;
|
|
20
20
|
removeAllListeners(element: Element | Document | Window, eventName?: string): void;
|
|
21
21
|
}
|
|
@@ -19,7 +19,8 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
|
|
|
19
19
|
onPaste(event: ClipboardEvent): void;
|
|
20
20
|
onPasteText: (text: string, options?: PasteOptions) => Promise<void>;
|
|
21
21
|
onFocus(): void;
|
|
22
|
-
onBlur:
|
|
22
|
+
onBlur: () => void;
|
|
23
|
+
debounceBlur: import("lodash").DebouncedFunc<() => void>;
|
|
23
24
|
removeActiveForBlur: import("lodash").DebouncedFunc<() => void>;
|
|
24
25
|
addHandler(handler: OnesEditorInputHandler): void;
|
|
25
26
|
removeHandler(handler: OnesEditorInputHandler): void;
|
|
@@ -58,7 +58,6 @@ export type BlockPosition = SimpleBlockPosition | ComplexBlockPosition;
|
|
|
58
58
|
export interface BoxCommands {
|
|
59
59
|
group: string;
|
|
60
60
|
commands: CommandItem[];
|
|
61
|
-
startGroup?: boolean;
|
|
62
61
|
executeCommand: (editor: OnesEditor, block: BlockElement, box: BoxElement, item: CommandItem) => unknown;
|
|
63
62
|
}
|
|
64
63
|
export interface BoxProperties {
|
|
@@ -177,7 +176,6 @@ export interface BlockCommands {
|
|
|
177
176
|
element?: HTMLElement;
|
|
178
177
|
group: string;
|
|
179
178
|
commands: CommandItem[];
|
|
180
|
-
startGroup?: boolean;
|
|
181
179
|
executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem, child: TextBlockContentChild | null) => unknown;
|
|
182
180
|
}
|
|
183
181
|
export interface BlockProperties {
|
|
@@ -404,12 +402,14 @@ export interface OnesEditorBlockRenderer {
|
|
|
404
402
|
renderBox?: (editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes) => OnesEditorBlockRenderResult;
|
|
405
403
|
renderText?: (editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes) => OnesEditorBlockRenderResult;
|
|
406
404
|
renderBlock?: (editor: OnesEditor, path: BlockPath, blockData: DocBlock) => OnesEditorBlockRenderResult;
|
|
405
|
+
renderChildContainer?: (editor: OnesEditor, path: BlockPath, containerId: string) => OnesEditorBlockRenderResult;
|
|
407
406
|
updateBlock?: (editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
408
407
|
}
|
|
409
408
|
export interface OnesEditorBlockRenderers {
|
|
410
409
|
renderBox: (path: BlockPath, attributes: DocBlockTextAttributes) => OnesEditorBlockRenderResult;
|
|
411
410
|
renderText: (path: BlockPath, attributes: DocBlockTextAttributes) => OnesEditorBlockRenderResult;
|
|
412
411
|
renderBlock: (editor: OnesEditor, path: BlockPath, blockData: DocBlock) => OnesEditorBlockRenderResult;
|
|
412
|
+
renderChildContainer: (editor: OnesEditor, path: BlockPath, containerId: string) => OnesEditorBlockRenderResult;
|
|
413
413
|
updateBlock: (editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock) => void;
|
|
414
414
|
registerRender: (decorator: OnesEditorBlockRenderer) => void;
|
|
415
415
|
}
|
|
@@ -513,7 +513,7 @@ export interface CloneBlockResultInfo {
|
|
|
513
513
|
boxIdMap: Map<string, string>;
|
|
514
514
|
}
|
|
515
515
|
export interface OnesEditorDomEvents extends OnesEditorCustom {
|
|
516
|
-
addEventListener: <T = Event>(element: Element | Document | Window, eventName: string, eventHandler: (editor: OnesEditor, event: T) => void) => void;
|
|
516
|
+
addEventListener: <T = Event>(element: Element | Document | Window, eventName: string, eventHandler: (editor: OnesEditor, event: T) => void, options?: boolean | AddEventListenerOptions) => void;
|
|
517
517
|
removeEventListener: (element: Element | Document | Window | null, eventName: string | null, eventHandler: (editor: OnesEditor, event: Event) => void) => void;
|
|
518
518
|
removeAllListeners: (element: Element | Document | Window, eventName?: string) => void;
|
|
519
519
|
}
|
|
@@ -646,7 +646,7 @@ export interface OnesEditorInput {
|
|
|
646
646
|
readonly inputElement: HTMLTextAreaElement;
|
|
647
647
|
getInput: () => HTMLTextAreaElement;
|
|
648
648
|
destroy: () => void;
|
|
649
|
-
focus: () => void;
|
|
649
|
+
focus: (options?: FocusOptions) => void;
|
|
650
650
|
handleDocumentSelectionChange: () => void;
|
|
651
651
|
handleCompositionstart: (event: CompositionEvent) => void;
|
|
652
652
|
handleCompositionend: (event: CompositionEvent) => void;
|
|
@@ -692,6 +692,7 @@ export interface OnesEditorInputHandler {
|
|
|
692
692
|
handleRemoteChanged?: (editor: OnesEditor, type: RemoteChangeType) => void;
|
|
693
693
|
handleCompositionStart?: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number) => void;
|
|
694
694
|
handleUpdateCompositionText?: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, end: boolean) => void;
|
|
695
|
+
handleBlur?: (editor: OnesEditor) => void;
|
|
695
696
|
destroy?: (editor: OnesEditor) => void;
|
|
696
697
|
}
|
|
697
698
|
export interface OnesEditorBlocks {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlockCommands, BlockElement, CommandItem, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
export type CommandId = 'edit' | '
|
|
2
|
+
export type CommandId = 'edit' | 'separator';
|
|
3
3
|
export interface StandardEmbedBlockProperties<T = CommandId> {
|
|
4
4
|
presetIds?: T[];
|
|
5
5
|
extIds?: T[];
|
|
@@ -9,6 +9,7 @@ export declare class EmbedBlockResizer {
|
|
|
9
9
|
handleResizing: (resizer: BlockResizer, rect: DOMRect) => void;
|
|
10
10
|
destroy(): void;
|
|
11
11
|
handleHoveringBlockChange: (block: BlockElement | null, old: BlockElement | null) => void;
|
|
12
|
+
handleEditorResize: () => void;
|
|
12
13
|
tryEnableResizer(block: BlockElement): void;
|
|
13
14
|
disableResizer(): void;
|
|
14
15
|
static get(editor: OnesEditor): EmbedBlockResizer;
|
|
@@ -10,22 +10,11 @@ export default class ImageHoveringToolbarCommands implements BlockCommands {
|
|
|
10
10
|
name: string;
|
|
11
11
|
icon: string;
|
|
12
12
|
type?: undefined;
|
|
13
|
-
groupOrder?: undefined;
|
|
14
|
-
order?: undefined;
|
|
15
13
|
} | {
|
|
16
14
|
id: string;
|
|
17
15
|
name: string;
|
|
18
16
|
type: CommandItemType;
|
|
19
17
|
icon?: undefined;
|
|
20
|
-
groupOrder?: undefined;
|
|
21
|
-
order?: undefined;
|
|
22
|
-
} | {
|
|
23
|
-
id: string;
|
|
24
|
-
name: string;
|
|
25
|
-
icon: string;
|
|
26
|
-
groupOrder: number;
|
|
27
|
-
order: number;
|
|
28
|
-
type?: undefined;
|
|
29
18
|
})[];
|
|
30
19
|
isHoveringImageEmpty: () => boolean;
|
|
31
20
|
get commands(): CommandItem[];
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { DocBlock } from '../../../../@ones-editor/core';
|
|
1
2
|
import { DocListBlock, ListBlockType } from '../types';
|
|
2
3
|
export declare function getListType(listData: DocListBlock): ListBlockType;
|
|
3
4
|
export declare function getListMarker(listData: DocListBlock): string;
|
|
5
|
+
export declare function pickTextBlockData(listBlockData: DocBlock): DocBlock;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
7
7
|
"devDependencies": {
|
|
8
|
+
"@types/lodash.clonedeep": "^4.5.0",
|
|
8
9
|
"@types/lodash.debounce": "^4.0.7",
|
|
9
|
-
"@types/lodash.
|
|
10
|
+
"@types/lodash.memoize": "^4.1.9"
|
|
10
11
|
},
|
|
11
12
|
"types": "src/index.d.ts"
|
|
12
13
|
}
|
|
@@ -6,6 +6,7 @@ export default class MathjaxEditor {
|
|
|
6
6
|
editMathjaxPopup: Popup | null;
|
|
7
7
|
onChange: OnEditChange | null;
|
|
8
8
|
tex: string;
|
|
9
|
+
oldTex: string;
|
|
9
10
|
private observer;
|
|
10
11
|
editMathjax(elem: HTMLElement, tex: string, onChange: OnEditChange, options?: ManualShowCommandBarOptions): void;
|
|
11
12
|
handleClose: (commandBar: AbstractCommandBar) => void;
|
|
@@ -1,32 +1,14 @@
|
|
|
1
1
|
import { BlockCommands, BlockElement, CommandItem, OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
|
-
import type { CommandItemType } from '../../../../../@ones-editor/core';
|
|
3
2
|
export default class ImageHoveringToolbarCommands implements BlockCommands {
|
|
4
3
|
protected editor: OnesEditor;
|
|
5
4
|
protected block: BlockElement;
|
|
6
5
|
group: string;
|
|
7
6
|
constructor(editor: OnesEditor, block: BlockElement);
|
|
8
|
-
_commands:
|
|
7
|
+
_commands: {
|
|
9
8
|
id: string;
|
|
10
9
|
name: string;
|
|
11
10
|
icon: string;
|
|
12
|
-
|
|
13
|
-
order: number;
|
|
14
|
-
type?: undefined;
|
|
15
|
-
} | {
|
|
16
|
-
id: string;
|
|
17
|
-
name: string;
|
|
18
|
-
type: CommandItemType;
|
|
19
|
-
icon?: undefined;
|
|
20
|
-
groupOrder?: undefined;
|
|
21
|
-
order?: undefined;
|
|
22
|
-
} | {
|
|
23
|
-
id: string;
|
|
24
|
-
name: string;
|
|
25
|
-
icon: string;
|
|
26
|
-
groupOrder?: undefined;
|
|
27
|
-
order?: undefined;
|
|
28
|
-
type?: undefined;
|
|
29
|
-
})[];
|
|
11
|
+
}[];
|
|
30
12
|
isHoveringImageEmpty: () => boolean;
|
|
31
13
|
get commands(): CommandItem[];
|
|
32
14
|
executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
|
|
@@ -10,7 +10,7 @@ export default class ShareDBServer extends EventCallbacks<ShareDBDocCallbacks> i
|
|
|
10
10
|
buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
|
|
11
11
|
getRemoteUsers(): RemoteUsers;
|
|
12
12
|
getVersionHelper(): OnesEditorDocVersionHelper;
|
|
13
|
-
getVersions(): Promise<DocVersion[]>;
|
|
13
|
+
getVersions(showPublished?: boolean): Promise<DocVersion[]>;
|
|
14
14
|
getVersion(ver: number): Promise<DocObject>;
|
|
15
15
|
getLatestVersion(): Promise<DocObject>;
|
|
16
16
|
getHistoryData(version: number, from?: number | undefined): Promise<{
|
|
@@ -11,7 +11,7 @@ export default class ShareDBSimpleClient {
|
|
|
11
11
|
getBaseURL(): string;
|
|
12
12
|
getBase64BaseURL(): string;
|
|
13
13
|
request<T = unknown>(url: string, opt?: any): Promise<AxiosResponse<any, T>>;
|
|
14
|
-
getVersions(): Promise<DocVersion[]>;
|
|
14
|
+
getVersions(showPublished: boolean): Promise<DocVersion[]>;
|
|
15
15
|
getVersion(ver: number): Promise<EditorDoc>;
|
|
16
16
|
getLatestVersion(): Promise<EditorDoc>;
|
|
17
17
|
getVersionOps(version: number, from?: number): Promise<{
|