@ones-editor/editor 1.1.8 → 1.1.9-beta.3
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-menu/src/block-menu/items/insert-block-items/index.d.ts +1 -1
- package/@ones-editor/block-menu/src/block-menu/standard-block-actions/hook.d.ts +2 -0
- package/@ones-editor/code-block/src/code-block/header/index.d.ts +1 -0
- package/@ones-editor/code-block/src/code-block/languages.d.ts +1 -1
- package/@ones-editor/code-block/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/code-block/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/code-block/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/comments/src/comment-quick-reply/index.d.ts +1 -0
- package/@ones-editor/comments/src/comments/comments.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/comments-list.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +3 -1
- package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +1 -1
- package/@ones-editor/comments/src/comments-render/index.d.ts +1 -0
- package/@ones-editor/context-menu/src/menu/index.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/common/execute-block-command.d.ts +2 -2
- package/@ones-editor/core/src/core/blocks/common/heading-block-dom.d.ts +7 -0
- package/@ones-editor/core/src/core/blocks/common/index.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/complex-blocks/child-blocks.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +3 -2
- package/@ones-editor/core/src/core/command-providers/commands/range-commands.d.ts +1 -1
- package/@ones-editor/core/src/core/command-providers/editor-command-providers.d.ts +1 -1
- package/@ones-editor/core/src/core/composition/clipboard/copy.d.ts +2 -1
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +2 -0
- package/@ones-editor/core/src/core/composition/index.d.ts +1 -1
- package/@ones-editor/core/src/core/containers/container.d.ts +1 -1
- package/@ones-editor/core/src/core/containers/root-container.d.ts +1 -0
- package/@ones-editor/core/src/core/doc/rich-text/text-style.d.ts +1 -0
- 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/editor-dom/editor-dom.d.ts +5 -3
- package/@ones-editor/core/src/core/editor/index.d.ts +1 -0
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +1 -0
- package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +3 -1
- package/@ones-editor/core/src/core/selection/ensure-block-visible.d.ts +2 -0
- package/@ones-editor/core/src/core/types.d.ts +15 -5
- package/@ones-editor/core/src/core/undo-manager/actions/action.d.ts +2 -2
- package/@ones-editor/core/src/utils/animate-scroll.d.ts +4 -0
- package/@ones-editor/core/src/utils/dom.d.ts +4 -0
- package/@ones-editor/core/src/utils/file.d.ts +2 -1
- package/@ones-editor/excalidraw/src/types.d.ts +2 -1
- package/@ones-editor/find-dialog/src/find-dialog.d.ts +1 -0
- package/@ones-editor/heading-collapse/src/doc-event/collapse-handler.d.ts +4 -0
- package/@ones-editor/heading-collapse/src/heading-collapse-button/collapse-heading-block.d.ts +2 -2
- package/@ones-editor/heading-collapse/src/heading-collapse-button/heading-utils.d.ts +0 -4
- package/@ones-editor/heading-collapse/src/heading-collapse-button/index.d.ts +1 -0
- package/@ones-editor/heading-collapse/src/heading-collapse-button/paste-handler.d.ts +8 -0
- package/@ones-editor/input-handlers/src/enforce-with-document-title/types.d.ts +2 -0
- package/@ones-editor/list-block/src/index.d.ts +2 -1
- package/@ones-editor/list-block/src/local-events/paste-handler.d.ts +6 -0
- package/@ones-editor/list-block/src/mindmap/to-mindmap/to-mindmap.d.ts +2 -2
- package/@ones-editor/list-block/src/mindmap/to-mindmap/types.d.ts +2 -2
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +2 -1
- package/@ones-editor/sharedb-doc/src/types.d.ts +1 -0
- package/@ones-editor/status/package.json +7 -0
- package/@ones-editor/status/src/dom/input.d.ts +1 -0
- package/@ones-editor/status/src/dom/overflow-tooltip-tag.d.ts +10 -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/index.d.ts +1 -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/table-block/package.json +1 -0
- package/@ones-editor/table-block/src/index.d.ts +2 -2
- package/@ones-editor/table-block/src/table-block/index.d.ts +1 -0
- package/@ones-editor/table-block/src/table-block/table-dom.d.ts +1 -0
- package/@ones-editor/table-block/src/table-block/table-grid.d.ts +3 -0
- package/@ones-editor/table-block/src/types.d.ts +1 -0
- package/@ones-editor/templates/src/index.d.ts +2 -2
- package/@ones-editor/templates/src/templates/select-template.d.ts +4 -0
- package/@ones-editor/templates/src/templates/types.d.ts +1 -0
- package/@ones-editor/to-docx/src/doc2other/core.d.ts +1 -0
- package/@ones-editor/to-docx/src/doc2other/image.d.ts +1 -1
- package/@ones-editor/to-docx/src/doc2other/types.d.ts +1 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +2 -2
- package/@ones-editor/ui/src/link-popup/index.d.ts +4 -1
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +2 -2
- package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +2 -2
- package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +2 -1
- package/@ones-editor/ui/src/quick-menu/types.d.ts +8 -3
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +2 -0
- package/@ones-editor/ui-base/src/command-bar/manual-menu.d.ts +1 -1
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +1 -0
- package/@ones-editor/ui-base/src/icons/index.d.ts +2 -1
- package/@ones-editor/ui-base/src/input/create-input.d.ts +3 -2
- package/@ones-editor/ui-base/src/popup/popup.d.ts +1 -0
- package/@ones-editor/versions/src/types.d.ts +4 -1
- package/@ones-editor/versions/src/version-dialog/size-limit-textarea.d.ts +2 -1
- package/@ones-editor/versions/src/version-dialog/version-list.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +210 -199
- package/dist/types.d.ts +8 -0
- package/package.json +5 -3
- package/@ones-editor/to-docx/src/doc2other/html-css.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../../../@ones-editor/core';
|
|
2
2
|
import type { GetAllQuickMenuItemsOptions } from '../../../../../../@ones-editor/ui';
|
|
3
3
|
import type { BlockMenuItem } from '../types';
|
|
4
|
-
export declare function getAllInsertBlockItems(editor: OnesEditor, source: 'insert-block' | 'insert-block-before', options
|
|
4
|
+
export declare function getAllInsertBlockItems(editor: OnesEditor, source: 'insert-block' | 'insert-block-before', options: GetAllQuickMenuItemsOptions): BlockMenuItem[];
|
|
5
5
|
export declare function executeInsertBlockCommand(editor: OnesEditor, block: BlockElement, item: BlockMenuItem, insertAbove?: boolean): Promise<BlockElement | null> | undefined;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BlockCommands, BlockElement, CommandItem, OnesEditor, OnesEditorBlockHook } from '../../../../../@ones-editor/core';
|
|
2
2
|
export default class StandardBlockActionHook implements OnesEditorBlockHook {
|
|
3
3
|
commands(editor: OnesEditor, blockElement: BlockElement): BlockCommands;
|
|
4
|
+
deleteBlock(editor: OnesEditor, block: BlockElement): void;
|
|
5
|
+
copyBlock(editor: OnesEditor, block: BlockElement): void;
|
|
4
6
|
executeCommand: (editor: OnesEditor, bloockElement: BlockElement, item: CommandItem) => void;
|
|
5
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
2
|
import { DocCodeBlockData } from '../code-block-data';
|
|
3
3
|
export declare function createCodeBlockHeader(editor: OnesEditor, block: BlockElement, codeData: DocCodeBlockData): void;
|
|
4
|
+
export declare function getCodeBlockHeader(block: BlockElement): HTMLElement;
|
|
@@ -67,7 +67,7 @@ import 'prismjs/components/prism-vhdl';
|
|
|
67
67
|
import 'prismjs/components/prism-visual-basic';
|
|
68
68
|
import 'prismjs/components/prism-wasm';
|
|
69
69
|
import 'prismjs/components/prism-yaml';
|
|
70
|
-
declare const SUPPORTED_LANGUAGES: {
|
|
70
|
+
declare const SUPPORTED_LANGUAGES: () => {
|
|
71
71
|
abap: {
|
|
72
72
|
name: string;
|
|
73
73
|
aliases: string[];
|
|
@@ -13,7 +13,7 @@ export default class OnesEditorComments {
|
|
|
13
13
|
private showComment;
|
|
14
14
|
showCommentList: (groupId?: string) => void;
|
|
15
15
|
setFirstEditingCommentActive(): void;
|
|
16
|
-
isEditing(): boolean;
|
|
16
|
+
isEditing(includeEmpty?: boolean): boolean;
|
|
17
17
|
mount(containers: CommentRoot): void;
|
|
18
18
|
private handleCommentListClose;
|
|
19
19
|
private handleOnSelectComment;
|
|
@@ -18,7 +18,7 @@ export default class CommentsList extends TypedEmitter<CommentsListEvents> imple
|
|
|
18
18
|
onDeleteComment(commentId: string, local: boolean): void;
|
|
19
19
|
onUpdateComment(commentId: string, local: boolean): void;
|
|
20
20
|
createList(): CommentGroupList;
|
|
21
|
-
isEditing(): boolean;
|
|
21
|
+
isEditing(includeEmpty?: boolean): boolean;
|
|
22
22
|
setFirstEditingCommentActive(): void;
|
|
23
23
|
handleSelectionOnComment: () => void;
|
|
24
24
|
updateCommentCount: () => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
1
2
|
import { OnesEditor, OnesEditorComment } from '../../../../@ones-editor/core';
|
|
2
3
|
import { CommentWithChildren, OnesEditorCommentsProvider } from '../types';
|
|
3
4
|
import { CommentGroupItem } from './group-item';
|
|
@@ -13,6 +14,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
|
|
|
13
14
|
groupItemHandlers: CommentGroupItemHandlers;
|
|
14
15
|
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
|
|
15
16
|
destroy(): void;
|
|
17
|
+
dispatchScroll: import("lodash").DebouncedFunc<() => void>;
|
|
16
18
|
updateItemsLayout(): void;
|
|
17
19
|
private bindEvents;
|
|
18
20
|
private unbindEvents;
|
|
@@ -22,7 +24,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
|
|
|
22
24
|
active: boolean;
|
|
23
25
|
}): CommentGroupItem | null;
|
|
24
26
|
private findFirstEditingComment;
|
|
25
|
-
isEditing(): boolean;
|
|
27
|
+
isEditing(includeEmpty?: boolean): boolean;
|
|
26
28
|
closeEditing: (groupId: string) => void;
|
|
27
29
|
setFirstEditingCommentActive: () => void;
|
|
28
30
|
setActiveItem(index: number, direction?: 'prev' | 'next'): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
2
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
|
-
import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '
|
|
3
|
+
import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../../types';
|
|
4
4
|
import { MiniGroupList } from './group-list';
|
|
5
5
|
interface MiniCommentsListEvents {
|
|
6
6
|
onMiniCommentClose: () => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BlockElement, BlockPath, DocBlock, DocBlockTextAttributes, OnesEditor, OnesEditorBlockRenderer, OnesEditorBlockRenderResult } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare class OnesEditorCommentsRender implements OnesEditorBlockRenderer {
|
|
3
3
|
renderText(editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
|
|
4
|
+
renderBox(editor: OnesEditor, path: BlockPath, attributes: DocBlockTextAttributes): OnesEditorBlockRenderResult;
|
|
4
5
|
renderBlock(editor: OnesEditor, path: BlockPath, blockData: DocBlock): OnesEditorBlockRenderResult;
|
|
5
6
|
updateBlock(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocBlock): void;
|
|
6
7
|
}
|
|
@@ -12,6 +12,7 @@ declare class OnesEditorContextMenu implements OnesEditorCustom {
|
|
|
12
12
|
private isInEditor;
|
|
13
13
|
private handleContextMenuShown;
|
|
14
14
|
private handleContextMenuClick;
|
|
15
|
+
private handleContextMenuClose;
|
|
15
16
|
private handleImageEmbedAction;
|
|
16
17
|
}
|
|
17
18
|
export default OnesEditorContextMenu;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BlockElement, CommandItem, OnesEditor } from '../../types';
|
|
1
|
+
import { BlockCommandItemWithSource, BlockElement, CommandItem, OnesEditor } from '../../types';
|
|
2
2
|
export declare function executeEmbedBlockCommand(editor: OnesEditor, block: BlockElement, commandGroup: string, item: CommandItem): unknown;
|
|
3
|
-
export declare function executeBlockCommand(editor: OnesEditor, block: BlockElement, commandGroup: string, item:
|
|
3
|
+
export declare function executeBlockCommand(editor: OnesEditor, block: BlockElement, commandGroup: string, item: BlockCommandItemWithSource): unknown;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BlockElement } from '../../types';
|
|
2
|
+
export declare function isHeadingBlock(block: BlockElement): boolean;
|
|
3
|
+
export declare function getBlockHeading(block: BlockElement): number;
|
|
4
|
+
export declare function isExpandedHeadingBlock(block: BlockElement): boolean;
|
|
5
|
+
export declare function isCollapsedHeadingBlock(block: BlockElement): boolean;
|
|
6
|
+
export declare function getHeadingBlockChildren(block: BlockElement, oldHeading?: number): BlockElement[];
|
|
7
|
+
export declare function getNextHiddenBlocks(block: BlockElement): BlockElement[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor, SelectedBlock } from '../../types';
|
|
2
2
|
export type GetAllChildBlocksOptions = {
|
|
3
3
|
simpleBlockOnly?: boolean;
|
|
4
|
+
visibleOnly?: boolean;
|
|
4
5
|
};
|
|
5
6
|
export declare function getAllChildBlocks(editor: OnesEditor, options?: GetAllChildBlocksOptions): BlockElement[];
|
|
6
7
|
export declare function getAllSelectedBlocks(editor: OnesEditor, options?: GetAllChildBlocksOptions): SelectedBlock[];
|
|
@@ -2,9 +2,10 @@ import { OnesEditor, BlockElement, BlockPosition, ContainerElement, ComplexBlock
|
|
|
2
2
|
export declare function complexBlockGetAllChildContainers(editor: OnesEditor, block: BlockElement, options?: GetChildContainerOptions): ContainerElement[];
|
|
3
3
|
export declare function complexBlockGetSelectedContainers(editor: OnesEditor, block: BlockElement, start: BlockPosition, end: BlockPosition): ContainerElement[];
|
|
4
4
|
export declare function isFirstChildBlockInComplexBlock(editor: OnesEditor, childBlock: BlockElement): boolean;
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function complexBlockGetFirstSimpleChild(editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions): BlockElement | null;
|
|
6
6
|
export declare function complexBlockGetLastSimpleChild(editor: OnesEditor, complexBlock: BlockElement, options?: GetChildContainerOptions): BlockElement | null;
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function complexBlockGetDeepFirstChild(editor: OnesEditor, container: ContainerElement): BlockElement | null;
|
|
8
|
+
export declare function findPrevSimpleBlockBeforeChildContainer(editor: OnesEditor, childContainer: ContainerElement, options?: GetChildContainerOptions): BlockElement | null;
|
|
8
9
|
export declare function complexBlockGetTopChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
|
|
9
10
|
export declare function complexBlockGetBottomChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
|
|
10
11
|
export declare function complexBlockFindNearestChildBlock(editor: OnesEditor, complexBlock: BlockElement, x: number, y: number): BlockElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlockCommandItemWithSource, CommandParams, CommandResult, SelectionRange } from '../../types';
|
|
2
|
-
export declare function getRangeCommands(range: SelectionRange): BlockCommandItemWithSource[];
|
|
2
|
+
export declare function getRangeCommands(range: SelectionRange, source: string): BlockCommandItemWithSource[];
|
|
3
3
|
export declare function executeRangeCommand(range: SelectionRange, command: BlockCommandItemWithSource, params: CommandParams): {
|
|
4
4
|
[index: string]: CommandResult;
|
|
5
5
|
};
|
|
@@ -7,7 +7,7 @@ export default class EditorCommandProviders implements OnesEditorCommandProvider
|
|
|
7
7
|
registerCommandProvider(provider: OnesEditorCommandProvider): void;
|
|
8
8
|
getCommandProviders(): OnesEditorCommandProvider[];
|
|
9
9
|
getCommandProvider(id: string): OnesEditorCommandProvider;
|
|
10
|
-
getCommands(range: SelectionRange): BlockCommandItemWithSource[];
|
|
10
|
+
getCommands(range: SelectionRange, source: string): BlockCommandItemWithSource[];
|
|
11
11
|
executeCommand(range: SelectionRange, command: BlockCommandItemWithSource, params: CommandParams): {
|
|
12
12
|
[index: string]: import("../types").CommandResult;
|
|
13
13
|
};
|
|
@@ -4,5 +4,6 @@ export declare function injectDocToHtmlFragment(htmlFragment: string, doc: DocOb
|
|
|
4
4
|
export declare function addMetaToDoc(editor: OnesEditor, doc: DocObject): void;
|
|
5
5
|
export type BeforeCopyCallback = (editor: OnesEditor, event: ClipboardEvent, doc: DocObject) => DocObject | boolean | undefined;
|
|
6
6
|
export declare function editorCopy(editor: OnesEditor, event: ClipboardEvent, beforeCopy?: BeforeCopyCallback): void;
|
|
7
|
+
export declare function editorCopyDoc(editor: OnesEditor, doc: DocObject): void;
|
|
7
8
|
export declare function editorCopyWithoutEvent(editor: OnesEditor, beforeCopy?: BeforeCopyCallback): void;
|
|
8
|
-
export declare function editorCopyBlock(editor: OnesEditor, block: BlockElement): Promise<
|
|
9
|
+
export declare function editorCopyBlock(editor: OnesEditor, block: BlockElement): Promise<void>;
|
|
@@ -27,9 +27,11 @@ export declare class EditorInput implements OnesEditorInput {
|
|
|
27
27
|
callbacks: EditorInputCallbacks;
|
|
28
28
|
inputElement: HTMLInputElement;
|
|
29
29
|
constructor(editor: OnesEditor, callbacks: EditorInputCallbacks);
|
|
30
|
+
private isInCommandbar;
|
|
30
31
|
destroy(): void;
|
|
31
32
|
getInput(): HTMLInputElement;
|
|
32
33
|
focus(): void;
|
|
34
|
+
isInDisableScrollMask(target: HTMLElement): boolean;
|
|
33
35
|
handleWindowBlur: () => void;
|
|
34
36
|
handleDocumentClick: (event: MouseEvent) => void;
|
|
35
37
|
handleDocumentSelectionChange: () => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { editorCopyBlock, addMetaToDoc, injectDocToHtmlFragment } from './clipboard/copy';
|
|
1
|
+
export { editorCopyBlock, editorCopyDoc, addMetaToDoc, injectDocToHtmlFragment } from './clipboard/copy';
|
|
2
2
|
export { copyResourcesFromDoc } from './clipboard/resources/copy-resources';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DocBlock, OnesEditorDoc } from '../doc/doc';
|
|
2
2
|
import { ContainerElement } from '../types';
|
|
3
|
-
export declare function isContainer(elem: Element):
|
|
3
|
+
export declare function isContainer(elem: Element): elem is ContainerElement;
|
|
4
4
|
export declare function isRootContainer(container: ContainerElement): boolean;
|
|
5
5
|
export declare function isChildContainer(container: ContainerElement): boolean;
|
|
6
6
|
export declare function getContainerId(container: ContainerElement): string;
|
|
@@ -5,6 +5,7 @@ export declare const TEXT_STYLE_BACKGROUND_COLOR_PREFIX = "style-bg-color-";
|
|
|
5
5
|
export declare function addAttribute(text: DocBlockText, key: string, value: DocTextAttributeType): DocBlockText;
|
|
6
6
|
export declare function removeAttribute(text: DocBlockText, key: string, value: unknown, options?: {
|
|
7
7
|
ignoreValue: boolean;
|
|
8
|
+
handleBox?: boolean;
|
|
8
9
|
}): DocBlockText;
|
|
9
10
|
export declare function rangeAddAttribute(offset: number, length: number, text: DocBlockText, key: string, value: DocTextAttributeType): DocBlockText;
|
|
10
11
|
export declare function rangeRemoveAttribute(offset: number, length: number, text: DocBlockText, key: string, value: unknown, options?: {
|
|
@@ -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;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { OnesEditor, SimpleBlockPosition
|
|
1
|
+
import { OnesEditor, SimpleBlockPosition } from '../../types';
|
|
2
2
|
export declare function editorGetClientHeight(editor: OnesEditor): number;
|
|
3
3
|
export declare function editorGetClientTop(editor: OnesEditor): number;
|
|
4
4
|
export declare function editorGetClientBottom(editor: OnesEditor): number;
|
|
5
5
|
export declare function editorGetVisibleRect(editor: OnesEditor): DOMRect;
|
|
6
6
|
export declare function isBlockPositionVisible(editor: OnesEditor, pos: SimpleBlockPosition): boolean;
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function scrollIntoView(editor: OnesEditor, target: HTMLElement, options?: {
|
|
8
|
+
animation?: boolean;
|
|
9
|
+
verticalOffset?: number;
|
|
10
|
+
}): void;
|
|
8
11
|
export declare function editorScrollIntoView(editor: OnesEditor): void;
|
|
9
|
-
export declare function scrollIntoView(dom: Element, options?: any): void;
|
|
@@ -34,6 +34,7 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
|
|
|
34
34
|
onCustomMessage(msg: unknown): void;
|
|
35
35
|
onStatusChanged(status: OnesEditorDocStatus): void;
|
|
36
36
|
onError(error: Error): void;
|
|
37
|
+
onAuthRecover(): void;
|
|
37
38
|
uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
|
|
38
39
|
addResources(resourceIds: string[]): Promise<string[]>;
|
|
39
40
|
buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
1
2
|
import { EditorInputCallbacks } from '../composition/editor-input';
|
|
2
3
|
import { OnesEditor, OnesEditorInputHandler, OnesEditorUndoAction, RemoteChangeType, PasteOptions } from '../types';
|
|
3
4
|
import { DocObject } from '../doc';
|
|
@@ -18,7 +19,8 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
|
|
|
18
19
|
onPaste(event: ClipboardEvent): void;
|
|
19
20
|
onPasteText: (text: string, options?: PasteOptions) => Promise<void>;
|
|
20
21
|
onFocus(): void;
|
|
21
|
-
onBlur()
|
|
22
|
+
onBlur: import("lodash").DebouncedFunc<() => void>;
|
|
23
|
+
removeActiveForBlur: import("lodash").DebouncedFunc<() => void>;
|
|
22
24
|
addHandler(handler: OnesEditorInputHandler): void;
|
|
23
25
|
removeHandler(handler: OnesEditorInputHandler): void;
|
|
24
26
|
handleBeforeInsertText(containerId: string, blockIndex: number, offset: number, text: string): boolean;
|
|
@@ -78,7 +78,7 @@ export interface InsertEmptyBlockOptions {
|
|
|
78
78
|
containerId: string;
|
|
79
79
|
blockIndex: number;
|
|
80
80
|
data?: Record<string, unknown>;
|
|
81
|
-
from?: 'block-menu' | 'quick-menu';
|
|
81
|
+
from?: 'block-menu' | 'quick-menu' | 'add-block-menu';
|
|
82
82
|
}
|
|
83
83
|
export interface EmbedOptions {
|
|
84
84
|
name: string;
|
|
@@ -144,6 +144,7 @@ export interface CommandItem {
|
|
|
144
144
|
ellipsisTooltip?: string;
|
|
145
145
|
disableTooltip?: boolean;
|
|
146
146
|
disableReason?: string;
|
|
147
|
+
hideGroupItem?: boolean;
|
|
147
148
|
setCloseable?: (closeable: Closeable) => void;
|
|
148
149
|
beforePopup?: (parent: unknown) => void;
|
|
149
150
|
}
|
|
@@ -255,6 +256,8 @@ export interface ComplexKindBlock extends Block {
|
|
|
255
256
|
focus: ComplexBlockPosition;
|
|
256
257
|
};
|
|
257
258
|
getTextToolbarReferenceClient?: (editor: OnesEditor, complexBlock: BlockElement) => DOMRect | undefined;
|
|
259
|
+
isChildContainerVisible?: (editor: OnesEditor, complexBlock: BlockElement, childContainer: ContainerElement) => boolean;
|
|
260
|
+
showChildContainer?: (editor: OnesEditor, complexBlock: BlockElement, childContainer: ContainerElement) => void;
|
|
258
261
|
}
|
|
259
262
|
export interface SelectedBlock {
|
|
260
263
|
block: BlockElement;
|
|
@@ -380,6 +383,9 @@ export interface OnesEditorEvents {
|
|
|
380
383
|
'blur': (editor: OnesEditor) => void;
|
|
381
384
|
'focus': (editor: OnesEditor) => void;
|
|
382
385
|
'containerRemount': (editor: OnesEditor, containerId: string) => void;
|
|
386
|
+
'beforeExecCommand': (editor: OnesEditor, command: CommandItem, option: {
|
|
387
|
+
source: string;
|
|
388
|
+
}) => void;
|
|
383
389
|
}
|
|
384
390
|
export interface OnesEditorSettingsProvider {
|
|
385
391
|
getItem: (key: string) => string | null;
|
|
@@ -393,6 +399,7 @@ export interface OnesEditorOptionalOptions {
|
|
|
393
399
|
colors?: string[];
|
|
394
400
|
scrollContainer?: HTMLElement;
|
|
395
401
|
enableComments?: boolean;
|
|
402
|
+
enableContextMenu?: boolean;
|
|
396
403
|
settingsProvider?: OnesEditorSettingsProvider;
|
|
397
404
|
}
|
|
398
405
|
export interface OnesEditorOptions {
|
|
@@ -401,6 +408,7 @@ export interface OnesEditorOptions {
|
|
|
401
408
|
[index: string]: unknown;
|
|
402
409
|
};
|
|
403
410
|
enableComments?: boolean;
|
|
411
|
+
enableContextMenu?: boolean;
|
|
404
412
|
scrollContainer?: HTMLElement;
|
|
405
413
|
}
|
|
406
414
|
export interface OnesEditorComponents {
|
|
@@ -442,6 +450,7 @@ export type OnesEditorCustomCreator = (editor: OnesEditor) => OnesEditorCustom;
|
|
|
442
450
|
export interface CloneBlockResultInfo {
|
|
443
451
|
containerIdMap: Map<string, string>;
|
|
444
452
|
blockIdMap: Map<string, string>;
|
|
453
|
+
boxIdMap: Map<string, string>;
|
|
445
454
|
}
|
|
446
455
|
export interface OnesEditorDomEvents extends OnesEditorCustom {
|
|
447
456
|
addEventListener: <T = Event>(element: Element | Document | Window, eventName: string, eventHandler: (editor: OnesEditor, event: T) => void) => void;
|
|
@@ -476,6 +485,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
476
485
|
readonly options: OnesEditorOptions;
|
|
477
486
|
readonly domEvents: OnesEditorDomEvents;
|
|
478
487
|
readonly settingsProvider: OnesEditorSettingsProvider;
|
|
488
|
+
version: string;
|
|
479
489
|
readonly: boolean;
|
|
480
490
|
addCustom: <T extends OnesEditorCustom>(name: string, creator: OnesEditorCustomCreator) => T;
|
|
481
491
|
getCustom: <T extends OnesEditorCustom>(name: string) => T;
|
|
@@ -515,7 +525,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
515
525
|
getSelectedText: () => string;
|
|
516
526
|
clearSelectedContents: () => void;
|
|
517
527
|
insertBlock: (containerId: string, blockIndex: number, blockData: DocBlock, newRange?: OnesEditorDocRange, options?: InsertBlockOptions) => BlockElement;
|
|
518
|
-
insertEmbed: (containerId: string, blockIndex: number, embedType: string, embedData: DocEmbedData, newRange?: OnesEditorDocRange) => BlockElement;
|
|
528
|
+
insertEmbed: (containerId: string, blockIndex: number, embedType: string, embedData: DocEmbedData, newRange?: OnesEditorDocRange, attributes?: DocBlockAttributes) => BlockElement;
|
|
519
529
|
deleteBlock: (block: BlockElement, newRange?: OnesEditorDocRange) => void;
|
|
520
530
|
getTextPosition: () => BlockTextPosition;
|
|
521
531
|
getBlockString: (block: BlockElement, options?: {
|
|
@@ -535,14 +545,14 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
535
545
|
insertTextBlock: (text?: string | DocBlockText, containerId?: string, blockIndex?: number, options?: {
|
|
536
546
|
newRange?: OnesEditorDocRange;
|
|
537
547
|
insertBlockOptions?: InsertBlockOptions;
|
|
538
|
-
}) => BlockElement;
|
|
548
|
+
}, attributes?: DocBlockAttributes) => BlockElement;
|
|
539
549
|
insertDoc: (block: BlockElement, offset: number, doc: DocObject, cloneDocResult?: CloneBlockResultInfo) => void;
|
|
540
550
|
insertDocAt: (container: ContainerElement, blockIndex: number, doc: DocObject, cloneDocResult?: CloneBlockResultInfo) => BlockElement[];
|
|
541
551
|
pasteDoc: (doc: DocObject) => Promise<void>;
|
|
542
552
|
deleteChildContainers: (containerIds: string[]) => void;
|
|
543
553
|
updateBlockData: (block: BlockElement, data: DocBlockAttributes, newRange?: SelectionRange) => DocBlock;
|
|
544
554
|
updateEmbedData: (block: BlockElement, data: DocEmbedData, newRange?: SelectionRange) => DocBlock;
|
|
545
|
-
updateBoxData: (boxData: DocBox) => void;
|
|
555
|
+
updateBoxData: (boxData: DocBox, options?: InsertTextOptions) => void;
|
|
546
556
|
updateCompositionText: (text: string, end: boolean) => void;
|
|
547
557
|
getColor: (index: number, type?: string) => string;
|
|
548
558
|
}
|
|
@@ -667,7 +677,7 @@ export interface OnesEditorCommandProviders {
|
|
|
667
677
|
registerCommandProvider: (provider: OnesEditorCommandProvider) => void;
|
|
668
678
|
getCommandProviders: () => OnesEditorCommandProvider[];
|
|
669
679
|
getCommandProvider: (id: string) => OnesEditorCommandProvider;
|
|
670
|
-
getCommands: (range: SelectionRange) => BlockCommandItemWithSource[];
|
|
680
|
+
getCommands: (range: SelectionRange, source: string) => BlockCommandItemWithSource[];
|
|
671
681
|
executeCommand: (range: SelectionRange, item: BlockCommandItemWithSource, params: CommandParams) => {
|
|
672
682
|
[index: string]: CommandResult;
|
|
673
683
|
};
|
|
@@ -10,7 +10,7 @@ export default class Action implements OnesEditorUndoAction {
|
|
|
10
10
|
combinable(other: OnesEditorUndoAction): boolean;
|
|
11
11
|
combine(other: OnesEditorUndoAction): void;
|
|
12
12
|
setAfterRange(range: OnesEditorDocRange): void;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
hasDocContainerId(editor: OnesEditor, id: string): boolean;
|
|
14
|
+
findDocBlockById(editor: OnesEditor, id: string): DocBlock | undefined;
|
|
15
15
|
checkBlockData(editor: OnesEditor, blockData: DocBlock): boolean;
|
|
16
16
|
}
|
|
@@ -8,6 +8,8 @@ export interface IUserOptions {
|
|
|
8
8
|
minDuration?: number;
|
|
9
9
|
speed?: number;
|
|
10
10
|
verticalOffset?: number;
|
|
11
|
+
disableHorizontal?: boolean;
|
|
12
|
+
disableVertical?: boolean;
|
|
11
13
|
}
|
|
12
14
|
export interface IOptions {
|
|
13
15
|
cancelOnUserAction: boolean;
|
|
@@ -18,6 +20,8 @@ export interface IOptions {
|
|
|
18
20
|
minDuration: number;
|
|
19
21
|
speed: number;
|
|
20
22
|
verticalOffset: number;
|
|
23
|
+
disableHorizontal?: boolean;
|
|
24
|
+
disableVertical?: boolean;
|
|
21
25
|
}
|
|
22
26
|
declare function animateScrollTo(y: number, userOptions?: IUserOptions): Promise<boolean>;
|
|
23
27
|
declare function animateScrollTo(coords: TCoords, userOptions?: IUserOptions): Promise<boolean>;
|
|
@@ -33,4 +33,8 @@ export declare function findTarget(event: Event, cssSelector: string): Element |
|
|
|
33
33
|
export declare function findEventTargetBlock(event: Event): Element | null;
|
|
34
34
|
export declare function isElementVisible(element: Element | null): boolean;
|
|
35
35
|
export declare function getElementScale(element: Element): number;
|
|
36
|
+
export declare function bindKeyDownEvent(input: HTMLInputElement | HTMLTextAreaElement, callback: (event: KeyboardEvent, composing: boolean) => void): () => void;
|
|
37
|
+
export declare function getElementFromPoint(x: number, y: number, options?: {
|
|
38
|
+
noFilter: boolean;
|
|
39
|
+
}): Element;
|
|
36
40
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
interface SelectFileOptions {
|
|
2
2
|
multiple?: boolean;
|
|
3
|
+
container?: HTMLElement;
|
|
3
4
|
}
|
|
4
5
|
export declare function selectFile<T extends SelectFileOptions = SelectFileOptions>(accept: string, options?: T): Promise<T extends {
|
|
5
6
|
multiple: true;
|
|
6
|
-
} ? File[] : File>;
|
|
7
|
+
} ? (File[] | null) : (File | null)>;
|
|
7
8
|
export declare function isDraggingFiles(v: unknown): v is File[];
|
|
8
9
|
export declare function getFileExt(file: string): string;
|
|
9
10
|
export declare function requestDownload(downloadUrl: string, fileName?: string): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ExcalidrawElement } from '@excalidraw/excalidraw/types/element/types';
|
|
1
2
|
import { BinaryFiles } from '@excalidraw/excalidraw/types/types';
|
|
2
3
|
export type ExcalidrawEmbedData = {
|
|
3
4
|
src: string;
|
|
@@ -5,5 +6,5 @@ export type ExcalidrawEmbedData = {
|
|
|
5
6
|
};
|
|
6
7
|
export type ExcalidrawSvgMetadata = {
|
|
7
8
|
files: BinaryFiles;
|
|
8
|
-
elements: readonly
|
|
9
|
+
elements: readonly ExcalidrawElement[];
|
|
9
10
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare function isHeadingCollapsed(editor: OnesEditor, blockId: string): boolean;
|
|
3
|
+
export declare function setCollapsedHeading(editor: OnesEditor, blockId: string, collapsed: boolean, heading?: number): void;
|
|
4
|
+
export declare function getCollapsedHeading(editor: OnesEditor, blockId: string): number | undefined;
|
package/@ones-editor/heading-collapse/src/heading-collapse-button/collapse-heading-block.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
export declare function getHeadingBlockChildren(block: BlockElement): BlockElement[];
|
|
3
2
|
export declare function collapseHeadingBlock(editor: OnesEditor, block: BlockElement): void;
|
|
4
|
-
export declare function
|
|
3
|
+
export declare function showBlocks(editor: OnesEditor, blocks: BlockElement[]): void;
|
|
4
|
+
export declare function expandHeadingBlock(editor: OnesEditor, block: BlockElement, heading?: number): void;
|
|
5
5
|
export declare function toggleHeadingBlock(editor: OnesEditor, block: BlockElement): void;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
import { BlockElement } from '../../../../@ones-editor/core';
|
|
2
|
-
export declare function getBlockHeading(block: BlockElement): number;
|
|
3
|
-
export declare function isHeadingBlock(block: BlockElement): boolean;
|
|
4
|
-
export declare function isExpandedHeadingBlock(block: BlockElement): boolean;
|
|
5
|
-
export declare function isCollapsedHeadingBlock(block: BlockElement): boolean;
|
|
6
2
|
export declare function isTitleBlock(block: BlockElement): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DocObject, OnesEditor, OnesEditorCustom, OnesEditorInputHandler } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class HeadingPasteHandler implements OnesEditorInputHandler, OnesEditorCustom {
|
|
3
|
+
private startIndex;
|
|
4
|
+
private containerId;
|
|
5
|
+
handleBeforePaste(editor: OnesEditor): Promise<boolean>;
|
|
6
|
+
handleAfterPasteDoc(editor: OnesEditor, doc: DocObject): Promise<boolean>;
|
|
7
|
+
destroy(): void;
|
|
8
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
1
2
|
export interface EnforceWithDocumentTitleHandlerOptions {
|
|
2
3
|
hideTitle?: boolean;
|
|
3
4
|
headingLevel?: number;
|
|
@@ -5,4 +6,5 @@ export interface EnforceWithDocumentTitleHandlerOptions {
|
|
|
5
6
|
contentPlaceholder?: string | Element;
|
|
6
7
|
readonlyTitlePlaceholder?: string;
|
|
7
8
|
addPlaceholderToAllCurrentEmptyBlock?: boolean;
|
|
9
|
+
applyContentPlaceholder?: (editor: OnesEditor) => boolean;
|
|
8
10
|
}
|
|
@@ -6,8 +6,9 @@ import ListBlockShortcuts from './keyboard/shortcut';
|
|
|
6
6
|
import { resetListStart } from './start/reset-list-start';
|
|
7
7
|
import './lang';
|
|
8
8
|
import './style.scss';
|
|
9
|
+
import { ListPasteHandler } from './local-events/paste-handler';
|
|
9
10
|
export { type ListOptions, type DocListBlock } from './types';
|
|
10
11
|
declare const ListBlock: TextKindBlock;
|
|
11
12
|
export * from './utils';
|
|
12
13
|
export * from './keyboard/to-text-block';
|
|
13
|
-
export { ListBlock, OnesEditorListMindmap, Mindmap, resetListStart, toMindmap, isMindmapRootBlock, ListBlockShortcuts, isViewingAsMindmap, getLastMindmapNode, };
|
|
14
|
+
export { ListBlock, OnesEditorListMindmap, Mindmap, resetListStart, toMindmap, isMindmapRootBlock, ListBlockShortcuts, isViewingAsMindmap, getLastMindmapNode, ListPasteHandler, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DocObject, OnesEditor, OnesEditorInputHandler } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class ListPasteHandler implements OnesEditorInputHandler {
|
|
3
|
+
private fixStartByList;
|
|
4
|
+
handleBeforePasteDoc(editor: OnesEditor, doc: DocObject): Promise<boolean>;
|
|
5
|
+
handleAfterPaste(editor: OnesEditor): Promise<boolean>;
|
|
6
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as markmap from 'markmap-view';
|
|
2
2
|
import { BlockElement, OnesEditor } from '../../../../../@ones-editor/core';
|
|
3
3
|
import { ToMindmapOptions } from './types';
|
|
4
|
-
export declare function toMindmap(editor: OnesEditor, block: BlockElement, mindmapOptions:
|
|
4
|
+
export declare function toMindmap(editor: OnesEditor, block: BlockElement, mindmapOptions: Partial<markmap.Markmap['options']>, options: ToMindmapOptions): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Markmap } from 'markmap-view';
|
|
3
3
|
export interface ToMindmapOptions {
|
|
4
4
|
mindmapTools: MindmapTools;
|
|
5
5
|
reset?: boolean;
|
|
@@ -7,7 +7,7 @@ export interface ToMindmapOptions {
|
|
|
7
7
|
selectBlock?: boolean;
|
|
8
8
|
}
|
|
9
9
|
export interface MindmapTools {
|
|
10
|
-
toMindmap: (editor: OnesEditor, block: BlockElement, mindmapOptions:
|
|
10
|
+
toMindmap: (editor: OnesEditor, block: BlockElement, mindmapOptions: Partial<Markmap['options']>, options: ToMindmapOptions) => void;
|
|
11
11
|
closeMindmap: (editor: OnesEditor, block: BlockElement) => void;
|
|
12
12
|
fitMindmap: (editor: OnesEditor, block: BlockElement) => void;
|
|
13
13
|
}
|