@ones-editor/editor 0.0.3-beta.49 → 0.0.3-beta.50
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-button/drag-drop/find-preview-element.d.ts +1 -1
- package/@ones-editor/code-block/src/code-block/caption/caption-input-handler.d.ts +2 -2
- package/@ones-editor/code-block/src/code-block/code-caret.d.ts +7 -0
- package/@ones-editor/code-block/src/code-block/code-copy.d.ts +4 -0
- package/@ones-editor/code-block/src/code-block/create-empty-code.d.ts +2 -2
- package/@ones-editor/code-block/src/code-block/index.d.ts +3 -1
- package/@ones-editor/code-block/src/code-block/settings/index.d.ts +3 -0
- package/@ones-editor/comments/src/comments-helper/utils.d.ts +0 -1
- package/@ones-editor/comments/src/comments-list/arrange-items.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/block-anchor/create-block-anchor.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/index.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-markdown.d.ts +3 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-html.d.ts +3 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-text.d.ts +3 -0
- package/@ones-editor/core/src/core/composition/clipboard/copy.d.ts +2 -2
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +3 -0
- package/@ones-editor/core/src/core/converter/block-to-html.d.ts +2 -2
- package/@ones-editor/core/src/core/converter/block-to-markdown.d.ts +2 -2
- package/@ones-editor/core/src/core/converter/block-to-text.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/focus-to-end.d.ts +0 -1
- package/@ones-editor/core/src/core/index.d.ts +1 -0
- package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +3 -0
- package/@ones-editor/core/src/core/selection/actions/index.d.ts +2 -2
- package/@ones-editor/core/src/core/selection/actions/select-all.d.ts +3 -1
- package/@ones-editor/core/src/core/selection/actions/select-block.d.ts +2 -0
- package/@ones-editor/core/src/core/selection/actions/word-offset.d.ts +1 -1
- package/@ones-editor/core/src/core/selection/editor-selection.d.ts +1 -0
- package/@ones-editor/core/src/core/types.d.ts +9 -4
- package/@ones-editor/core/src/utils/dom-scroll.d.ts +3 -1
- package/@ones-editor/graph-embed/src/helper/graph-base.d.ts +1 -0
- package/@ones-editor/image-embed/package.json +2 -1
- package/@ones-editor/image-embed/src/drag-drop/drag-handler.d.ts +4 -0
- package/@ones-editor/list-block/src/converter/convert-list-to.d.ts +2 -0
- package/@ones-editor/list-block/src/converter/convert-to-list.d.ts +14 -0
- package/@ones-editor/list-block/src/converter/index.d.ts +2 -14
- package/@ones-editor/list-block/src/level/change-multi-levels.d.ts +2 -0
- package/@ones-editor/list-block/src/level/decrease-level.d.ts +1 -0
- package/@ones-editor/list-block/src/types.d.ts +2 -1
- package/@ones-editor/markdown-to-doc/src/markdown-to-doc.d.ts +1 -0
- package/@ones-editor/markdown-to-doc/src/tokens/block-tokens/latex.d.ts +4 -0
- package/@ones-editor/media-embed/src/core/media-embed.d.ts +3 -1
- package/@ones-editor/mention/src/mention.d.ts +1 -0
- package/@ones-editor/paste-handler/src/paste-handler.d.ts +1 -1
- package/@ones-editor/paste-special/src/paste-special-handler.d.ts +2 -2
- package/@ones-editor/scroll-container/src/dom-utils.d.ts +9 -0
- package/@ones-editor/scroll-container/src/index.d.ts +2 -0
- package/@ones-editor/scroll-container/src/observer/container-resize-observer.d.ts +2 -1
- package/@ones-editor/scroll-container/src/observer/locating-resize-observer.d.ts +2 -1
- package/@ones-editor/scroll-container/src/scroll-listener.d.ts +2 -0
- package/@ones-editor/scroll-container/src/types.d.ts +1 -0
- package/@ones-editor/table-block/src/locale/en-us.d.ts +5 -0
- package/@ones-editor/table-block/src/locale/zh-cn.d.ts +5 -0
- package/@ones-editor/table-block/src/table-block/table-scroll-events.d.ts +1 -0
- package/@ones-editor/table-block/src/types.d.ts +2 -0
- package/@ones-editor/text-commands/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/text-commands/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/locale/en-us.d.ts +2 -0
- package/@ones-editor/ui/src/locale/zh-cn.d.ts +2 -0
- package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +1 -0
- package/@ones-editor/ui/src/toolbar/box-only.d.ts +2 -0
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +2 -1
- package/@ones-editor/ui-base/src/auto-suggest/index.d.ts +2 -1
- package/@ones-editor/ui-base/src/input/create-input.d.ts +1 -0
- package/@ones-editor/ui-base/src/item-shortcuts/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/list/drop-down-filterable-list.d.ts +2 -2
- package/@ones-editor/ui-base/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/webpage-embed/src/ui/dialog.d.ts +2 -2
- package/@ones-editor/webpage-embed/src/webpage-embed/webpage-items.d.ts +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +160 -135
- package/package.json +3 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BlockElement } from '../../../../../@ones-editor/core';
|
|
2
2
|
export declare function findPreviewElement(block: BlockElement): HTMLElement;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { OnesEditor, OnesEditorCustom, OnesEditorInputHandler } from '../../../../../@ones-editor/core';
|
|
1
|
+
import { OnesEditor, OnesEditorCustom, OnesEditorDocs, OnesEditorInputHandler } from '../../../../../@ones-editor/core';
|
|
2
2
|
export default class CodeBlockCaptionInputHandler implements OnesEditorInputHandler, OnesEditorCustom {
|
|
3
3
|
constructor(editor: OnesEditor);
|
|
4
4
|
destroy(): void;
|
|
5
5
|
handleBeforeKeyDown(editor: OnesEditor, event: KeyboardEvent): boolean;
|
|
6
|
-
handleBeforePaste(editor: OnesEditor, event: ClipboardEvent): Promise<boolean>;
|
|
6
|
+
handleBeforePaste(editor: OnesEditor, event: ClipboardEvent | null, docs: OnesEditorDocs): Promise<boolean>;
|
|
7
7
|
static init(editor: OnesEditor): void;
|
|
8
8
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DocObject, OnesEditor, OnesEditorInputHandler } from '../../../../@ones-editor/core';
|
|
2
|
+
export default class CopyCodeInputHandler implements OnesEditorInputHandler {
|
|
3
|
+
handleBeforeCopy(editor: OnesEditor, event: ClipboardEvent, doc: DocObject): boolean | DocObject | undefined;
|
|
4
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import { DocCodeBlockData } from './code-block-data';
|
|
3
|
-
export declare function createEmptyCode(editor: OnesEditor): {
|
|
3
|
+
export declare function createEmptyCode(editor: OnesEditor): Promise<{
|
|
4
4
|
blockData: DocCodeBlockData;
|
|
5
5
|
focusBlockId: string;
|
|
6
|
-
}
|
|
6
|
+
}>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import CodeBlock, { CodeLineBlock } from './code-block';
|
|
2
|
+
import OnesEditorCodeCaret from './code-caret';
|
|
3
|
+
import CopyCodeInputHandler from './code-copy';
|
|
2
4
|
import CodeShortcuts from './code-shortcuts';
|
|
3
5
|
import CodeTextDecorator from './code-text-decorate';
|
|
4
|
-
export { CodeBlock, CodeLineBlock, CodeTextDecorator, CodeShortcuts };
|
|
6
|
+
export { CodeBlock, CodeLineBlock, CodeTextDecorator, CodeShortcuts, CopyCodeInputHandler, OnesEditorCodeCaret };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OnesEditorComment, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare function isChildComment(comment: OnesEditorComment): boolean;
|
|
3
|
-
export declare function getCommentsRoot(): HTMLDivElement;
|
|
4
3
|
export declare function getCommentItemCountInGroupItem(groupItemRoot: HTMLElement, commentItemCls?: string): number;
|
|
5
4
|
export declare function getClosestCommentItemId(element: HTMLElement): string | null;
|
|
6
5
|
export declare function addGroupActionToElement(element: HTMLElement, action: string): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import type { CommentGroupItem } from './group-item';
|
|
3
|
-
export declare function arrangeItems(editor: OnesEditor, items: CommentGroupItem[], activeItem: CommentGroupItem | null): void;
|
|
3
|
+
export declare function arrangeItems(editor: OnesEditor, items: CommentGroupItem[], activeItem: CommentGroupItem | null, fixTop?: number): void;
|
|
@@ -31,6 +31,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
|
|
|
31
31
|
handleEditorResize: () => void;
|
|
32
32
|
handleDocChanged: () => void;
|
|
33
33
|
handleItemResize: () => void;
|
|
34
|
+
handleScroll: (event: WheelEvent) => void;
|
|
34
35
|
updateGroupItemSwitch: () => void;
|
|
35
36
|
private updateComments;
|
|
36
37
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../types';
|
|
2
2
|
import './anchor.scss';
|
|
3
3
|
export declare function createBlockAnchor(editor: OnesEditor, block: BlockElement, id: string, refClientRect?: DOMRect): HTMLElement;
|
|
4
|
+
export declare function createBlockCaretAnchor(editor: OnesEditor, block: BlockElement, offset: number, id: string): HTMLElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DocObject } from '../../doc';
|
|
2
2
|
import { BlockElement, OnesEditor } from '../../types';
|
|
3
|
-
export declare function docToPlainText(editor: OnesEditor, doc: DocObject): string;
|
|
4
3
|
export declare function addMetaToDoc(editor: OnesEditor, doc: DocObject): void;
|
|
5
|
-
export
|
|
4
|
+
export type BeforeCopyCallback = (editor: OnesEditor, event: ClipboardEvent, doc: DocObject) => DocObject | boolean | undefined;
|
|
5
|
+
export declare function editorCopy(editor: OnesEditor, event: ClipboardEvent, beforeCopy?: BeforeCopyCallback): void;
|
|
6
6
|
export declare function editorCopyWithoutEvent(editor: OnesEditor): void;
|
|
7
7
|
export declare function editorCopyBlock(editor: OnesEditor, block: BlockElement): Promise<boolean>;
|
|
@@ -10,6 +10,8 @@ export interface EditorInputCallbacks {
|
|
|
10
10
|
onFocus: () => void;
|
|
11
11
|
onBlur: () => void;
|
|
12
12
|
onPaste: (event: ClipboardEvent) => void;
|
|
13
|
+
onPasteText: (text: string) => void;
|
|
14
|
+
onCopy: (event: ClipboardEvent) => void;
|
|
13
15
|
addHandler: (handler: OnesEditorInputHandler) => void;
|
|
14
16
|
removeHandler: (handler: OnesEditorInputHandler) => void;
|
|
15
17
|
defaultInsertText: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => void;
|
|
@@ -36,6 +38,7 @@ export declare class EditorInput implements OnesEditorInput {
|
|
|
36
38
|
handleCopy: (event: ClipboardEvent) => void;
|
|
37
39
|
handleCut: (event: ClipboardEvent) => void;
|
|
38
40
|
handlePaste: (event: ClipboardEvent) => void;
|
|
41
|
+
handlePasteText: (text: string) => void;
|
|
39
42
|
handleChanged(action: OnesEditorUndoAction): void;
|
|
40
43
|
handleRemoteChanged(type: RemoteChangeType): void;
|
|
41
44
|
addHandler(handler: OnesEditorInputHandler): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DocBlock, DocObject } from '../doc';
|
|
2
|
-
import { OnesEditor } from '../types';
|
|
3
|
-
export declare function blockToHtml(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
|
|
2
|
+
import { BlockPath, OnesEditor } from '../types';
|
|
3
|
+
export declare function blockToHtml(editor: OnesEditor, blockData: DocBlock, doc: DocObject, path: BlockPath): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DocBlock, DocObject } from '../doc';
|
|
2
|
-
import { OnesEditor } from '../types';
|
|
3
|
-
export declare function blockToMarkdown(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
|
|
2
|
+
import { BlockPath, OnesEditor } from '../types';
|
|
3
|
+
export declare function blockToMarkdown(editor: OnesEditor, blockData: DocBlock, doc: DocObject, path: BlockPath): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DocBlock, DocObject } from '../doc';
|
|
2
|
-
import { OnesEditor } from '../types';
|
|
3
|
-
export declare function blockToText(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
|
|
2
|
+
import { BlockPath, OnesEditor } from '../types';
|
|
3
|
+
export declare function blockToText(editor: OnesEditor, blockData: DocBlock, doc: DocObject, path: BlockPath): string;
|
|
@@ -11,7 +11,9 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
|
|
|
11
11
|
onRemoteChanged(type: RemoteChangeType): void;
|
|
12
12
|
onCompositionStart(event: Event): void;
|
|
13
13
|
onUpdateCompositionText(event: Event, text: string, end: boolean): void;
|
|
14
|
+
onCopy(event: ClipboardEvent): void;
|
|
14
15
|
onPaste(event: ClipboardEvent): void;
|
|
16
|
+
onPasteText: (text: string) => Promise<void>;
|
|
15
17
|
onFocus(): void;
|
|
16
18
|
onBlur(): void;
|
|
17
19
|
addHandler(handler: OnesEditorInputHandler): void;
|
|
@@ -23,5 +25,6 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
|
|
|
23
25
|
defaultInsertText(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string): void;
|
|
24
26
|
defaultHandleKeydown(editor: OnesEditor, event: KeyboardEvent): boolean;
|
|
25
27
|
pasteDoc(doc: DocObject): Promise<void>;
|
|
28
|
+
private pasteDocs;
|
|
26
29
|
destroy(): void;
|
|
27
30
|
}
|
|
@@ -22,5 +22,5 @@ import { editorMovePageUp } from './move-page-up';
|
|
|
22
22
|
import { editorMovePageDown } from './move-page-down';
|
|
23
23
|
import { editorSelectPageUp } from './select-page-up';
|
|
24
24
|
import { editorSelectPageDown } from './select-page-down';
|
|
25
|
-
import { editorSelectAll } from './select-all';
|
|
26
|
-
export { editorMoveLeft, editorMoveRight, editorMoveUp, editorMoveDown, editorSelectDown, editorSelectUp, editorSelectLeft, editorSelectRight, editorMoveWordLeft, editorMoveWordEnd, editorSelectWordLeft, editorSelectWordEnd, editorMoveHome, editorMoveEnd, editorSelectHome, editorSelectEnd, editorMovePageUp, editorMovePageDown, editorSelectPageUp, editorSelectPageDown, editorSelectLineHome, editorSelectLineEnd, editorMoveLineHome, editorMoveLineEnd, editorSelectAll, };
|
|
25
|
+
import { editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks } from './select-all';
|
|
26
|
+
export { editorMoveLeft, editorMoveRight, editorMoveUp, editorMoveDown, editorSelectDown, editorSelectUp, editorSelectLeft, editorSelectRight, editorMoveWordLeft, editorMoveWordEnd, editorSelectWordLeft, editorSelectWordEnd, editorMoveHome, editorMoveEnd, editorSelectHome, editorSelectEnd, editorMovePageUp, editorMovePageDown, editorSelectPageUp, editorSelectPageDown, editorSelectLineHome, editorSelectLineEnd, editorMoveLineHome, editorMoveLineEnd, editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks, };
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { OnesEditor } from '../../types';
|
|
1
|
+
import { ContainerElement, OnesEditor, SimpleSelectionRange } from '../../types';
|
|
2
|
+
export declare function isContainerSelectedAllChildBlocks(container: ContainerElement, range: SimpleSelectionRange): boolean;
|
|
2
3
|
export declare function editorSelectAll(editor: OnesEditor): boolean;
|
|
4
|
+
export declare function editorSelectContainer(editor: OnesEditor, container: ContainerElement): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OnesEditor, SimpleBlockPosition } from '../../types';
|
|
2
2
|
export declare function editorGetWordLeftPos(editor: OnesEditor, type: 'move' | 'select'): SimpleBlockPosition | null;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function editorGetWordRightPos(editor: OnesEditor, type: 'move' | 'select'): SimpleBlockPosition | null;
|
|
@@ -29,6 +29,7 @@ export declare class EditorSelection implements OnesEditorSelection {
|
|
|
29
29
|
private verifyPos;
|
|
30
30
|
private updateFocusedBlock;
|
|
31
31
|
verify(): void;
|
|
32
|
+
to(type: 'text' | 'markdown' | 'html'): string;
|
|
32
33
|
private removeAllBlockFocusedClass;
|
|
33
34
|
private setBlockFocused;
|
|
34
35
|
}
|
|
@@ -61,6 +61,7 @@ export interface Box {
|
|
|
61
61
|
boxType: string;
|
|
62
62
|
updateBoxContent: (editor: OnesEditor, boxElement: BoxElement, boxContent: BoxContentElement, boxData: DocBox) => void;
|
|
63
63
|
convertFrom?: (editor: OnesEditor, text: string) => DocBox | null;
|
|
64
|
+
convertTo?: (editor: OnesEditor, boxData: DocBox, doc: DocObject, type: 'text' | 'html' | 'markdown') => string;
|
|
64
65
|
handleClickBox?: (editor: OnesEditor, box: BoxElement, event: MouseEvent) => void;
|
|
65
66
|
toStandardText?: (editor: OnesEditor, box: DocBox) => Promise<DocBlockText | undefined>;
|
|
66
67
|
getBoxProperties?: (editor: OnesEditor, boxElement: BoxElement) => BoxProperties;
|
|
@@ -130,8 +131,9 @@ export interface CommandItem {
|
|
|
130
131
|
manualShowChildren?: boolean;
|
|
131
132
|
childrenPlacement?: CommandItemChildrenPlacement;
|
|
132
133
|
childrenOffset?: [number, number];
|
|
133
|
-
|
|
134
|
+
subText?: string;
|
|
134
135
|
defaultCheckedChildren?: string[];
|
|
136
|
+
disableTooltip?: boolean;
|
|
135
137
|
setCloseable?: (closeable: Closeable) => void;
|
|
136
138
|
beforePopup?: (parent: unknown) => void;
|
|
137
139
|
}
|
|
@@ -214,7 +216,7 @@ export interface Block {
|
|
|
214
216
|
data?: DocBlockAttributes;
|
|
215
217
|
}) => ConvertBlockResult | null;
|
|
216
218
|
selectionToDoc?: (editor: OnesEditor, selectedBlock: SelectedBlock) => DocObject;
|
|
217
|
-
convertTo?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject, type: 'text' | 'html' | 'markdown') => string;
|
|
219
|
+
convertTo?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject, type: 'text' | 'html' | 'markdown', path: BlockPath) => string;
|
|
218
220
|
toStandardDoc?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject) => Promise<DocObject | undefined>;
|
|
219
221
|
getBlockStyles?: (editor: OnesEditor, block: BlockElement) => BlockStyles;
|
|
220
222
|
blockToDoc?: (srcDoc: DocObject, srcBlockData: DocBlock, childBlockConverter: (srcDoc: DocObject, srcBlockData: DocBlock) => DocObject) => DocObject;
|
|
@@ -542,6 +544,7 @@ export interface OnesEditorSelection {
|
|
|
542
544
|
getAnchorPos: () => BlockPosition;
|
|
543
545
|
getFocusedPos: () => BlockPosition;
|
|
544
546
|
scrollIntoView: () => void;
|
|
547
|
+
to: (type: 'text' | 'markdown' | 'html') => string;
|
|
545
548
|
}
|
|
546
549
|
export type RemoteChangeType = 'UpdateBlockText' | 'UpdateBlockData' | 'InsertBlock' | 'DeleteBlock' | 'InsertChildContainer' | 'DeleteChildContainer';
|
|
547
550
|
export interface OnesEditorInput {
|
|
@@ -555,6 +558,7 @@ export interface OnesEditorInput {
|
|
|
555
558
|
handleKeyDown: (event: KeyboardEvent) => void;
|
|
556
559
|
handleChanged: (action: OnesEditorUndoAction) => void;
|
|
557
560
|
handleRemoteChanged: (type: RemoteChangeType) => void;
|
|
561
|
+
handlePasteText: (text: string) => void;
|
|
558
562
|
addHandler: (handler: OnesEditorInputHandler) => void;
|
|
559
563
|
removeHandler: (handler: OnesEditorInputHandler) => void;
|
|
560
564
|
defaultInsertText: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => void;
|
|
@@ -578,8 +582,9 @@ export interface OnesEditorInputHandler {
|
|
|
578
582
|
handleAfterInsertText?: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => boolean;
|
|
579
583
|
handleBeforeKeyDown?: (editor: OnesEditor, event: KeyboardEvent) => boolean;
|
|
580
584
|
handleAfterKeyDown?: (editor: OnesEditor, event: KeyboardEvent) => boolean;
|
|
581
|
-
|
|
582
|
-
|
|
585
|
+
handleBeforeCopy?: (editor: OnesEditor, event: ClipboardEvent, doc: DocObject) => DocObject | boolean | undefined;
|
|
586
|
+
handleBeforePaste?: (editor: OnesEditor, event: ClipboardEvent | null, doc: OnesEditorDocs) => Promise<boolean>;
|
|
587
|
+
handleAfterPaste?: (editor: OnesEditor, event: ClipboardEvent | null, doc: OnesEditorDocs) => Promise<boolean>;
|
|
583
588
|
handleBeforePasteDoc?: (editor: OnesEditor, doc: DocObject) => Promise<boolean>;
|
|
584
589
|
handleAfterPasteDoc?: (editor: OnesEditor, doc: DocObject) => Promise<boolean>;
|
|
585
590
|
handleChanged?: (editor: OnesEditor, action: OnesEditorUndoAction) => void;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export declare function getScrollContainer(element: HTMLElement
|
|
1
|
+
export declare function getScrollContainer(element: HTMLElement, options?: {
|
|
2
|
+
horizontal?: boolean;
|
|
3
|
+
}): HTMLElement;
|
|
2
4
|
export declare function disablePageScroll(id: string): void;
|
|
3
5
|
export declare function enablePageScroll(id: string): void;
|
|
@@ -6,6 +6,7 @@ export default abstract class GraphBase {
|
|
|
6
6
|
private codeEmbedDataKey;
|
|
7
7
|
protected editor: OnesEditor;
|
|
8
8
|
logger: Logger;
|
|
9
|
+
editing: boolean;
|
|
9
10
|
constructor(editor: OnesEditor, graphType: GraphType, codeEmbedDataKey: string);
|
|
10
11
|
protected abstract code2ObjectUrl(code: string): Promise<string>;
|
|
11
12
|
protected abstract code2ResourceId(code: string): Promise<string>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
export default class OnesEditorImageDragHandler {
|
|
3
3
|
private editor;
|
|
4
|
+
img: HTMLImageElement;
|
|
5
|
+
private dragContainer;
|
|
6
|
+
private startPosition;
|
|
4
7
|
constructor(editor: OnesEditor);
|
|
5
8
|
destroy(): void;
|
|
6
9
|
handleDragStart: (event: DragEvent) => Promise<void>;
|
|
10
|
+
handleDrag: (e: DragEvent) => void;
|
|
7
11
|
handleDragEnd: () => void;
|
|
8
12
|
}
|
|
9
13
|
declare global {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { DocListBlock, ListBlockType } from '../types';
|
|
3
|
+
type ConvertToListData = {
|
|
4
|
+
listType?: ListBlockType;
|
|
5
|
+
};
|
|
6
|
+
export declare function findNearestList(srcBlock: BlockElement, type: ListBlockType): BlockElement | null;
|
|
7
|
+
export declare function convertToList(editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
8
|
+
offset: number;
|
|
9
|
+
data?: ConvertToListData;
|
|
10
|
+
}): {
|
|
11
|
+
blockData: DocListBlock;
|
|
12
|
+
onConverted: (editor: OnesEditor, block: BlockElement) => void;
|
|
13
|
+
} | null;
|
|
14
|
+
export {};
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type ConvertToListData = {
|
|
4
|
-
listType?: ListBlockType;
|
|
5
|
-
};
|
|
6
|
-
export declare function findNearestList(srcBlock: BlockElement, type: ListBlockType): BlockElement | null;
|
|
7
|
-
export declare function convertToList(editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
8
|
-
offset: number;
|
|
9
|
-
data?: ConvertToListData;
|
|
10
|
-
}): {
|
|
11
|
-
blockData: DocListBlock;
|
|
12
|
-
onConverted: (editor: OnesEditor, block: BlockElement) => void;
|
|
13
|
-
} | null;
|
|
14
|
-
export {};
|
|
1
|
+
export * from './convert-to-list';
|
|
2
|
+
export * from './convert-list-to';
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare function canDecreaseListBlockLevel(editor: OnesEditor, block: BlockElement): boolean;
|
|
2
3
|
export declare function decreaseListBlockLevel(editor: OnesEditor, block: BlockElement): boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BlockElement, CommandItem, DocBlock, OnesEditor } from '../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, CommandItem, DocBlock, DocBlockText, OnesEditor } from '../../../@ones-editor/core';
|
|
2
2
|
export interface DocListBlock extends DocBlock {
|
|
3
|
+
text: DocBlockText;
|
|
3
4
|
level: number;
|
|
4
5
|
start: number;
|
|
5
6
|
ordered: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InsertEmptyBlockOptions, DocEmbedBlock, DocEmbedData } from '../../../../@ones-editor/core';
|
|
1
|
+
import { InsertEmptyBlockOptions, DocEmbedBlock, DocEmbedData, DocObject } from '../../../../@ones-editor/core';
|
|
2
2
|
import type { Embed, OnesEditor, BlockContentElement, BlockElement } from '../../../../@ones-editor/core';
|
|
3
3
|
import { MediaType } from '../constant';
|
|
4
4
|
import { Media } from './media';
|
|
@@ -20,10 +20,12 @@ export declare abstract class MediaEmbed implements Embed {
|
|
|
20
20
|
icon: string;
|
|
21
21
|
order: number;
|
|
22
22
|
group: string;
|
|
23
|
+
subText: string;
|
|
23
24
|
}[];
|
|
24
25
|
handleInsertEmptyEmbed: (editor: OnesEditor, options: InsertEmptyBlockOptions) => Promise<BlockElement | null>;
|
|
25
26
|
};
|
|
26
27
|
createEmbedContent(editor: OnesEditor, content: BlockContentElement, blockData: DocEmbedBlock<DocEmbedData>): void;
|
|
27
28
|
handleUpdateBlock(editor: OnesEditor, block: BlockElement, blockData: DocEmbedBlock<DocEmbedData>): boolean;
|
|
28
29
|
handleDeleteBlock(editor: OnesEditor, block: BlockElement): void;
|
|
30
|
+
convertTo(editor: OnesEditor, blockData: DocEmbedBlock, doc: DocObject, type: 'html' | 'text' | 'markdown'): string;
|
|
29
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnesEditor, OnesEditorDocs, OnesEditorInputHandler } from '../../../@ones-editor/core';
|
|
2
2
|
export default class OnesEditorPasteHandler implements OnesEditorInputHandler {
|
|
3
3
|
constructor(editor: OnesEditor);
|
|
4
|
-
handleBeforePaste(editor: OnesEditor, event: ClipboardEvent, docs: OnesEditorDocs): Promise<boolean>;
|
|
4
|
+
handleBeforePaste(editor: OnesEditor, event: ClipboardEvent | null, docs: OnesEditorDocs): Promise<boolean>;
|
|
5
5
|
handleInsertImages(editor: OnesEditor, images: File[]): Promise<void>;
|
|
6
6
|
}
|
|
@@ -8,7 +8,7 @@ export default class PasteSpecialHandler implements OnesEditorInputHandler {
|
|
|
8
8
|
constructor(editor: OnesEditor);
|
|
9
9
|
destroy(): void;
|
|
10
10
|
handleChanged(editor: OnesEditor, action: OnesEditorUndoAction): void;
|
|
11
|
-
handleBeforePaste(editor: OnesEditor, event: ClipboardEvent): Promise<boolean>;
|
|
12
|
-
handleAfterPaste(editor: OnesEditor, event: ClipboardEvent, docs: OnesEditorDocs): Promise<boolean>;
|
|
11
|
+
handleBeforePaste(editor: OnesEditor, event: ClipboardEvent | null): Promise<boolean>;
|
|
12
|
+
handleAfterPaste(editor: OnesEditor, event: ClipboardEvent | null, docs: OnesEditorDocs): Promise<boolean>;
|
|
13
13
|
handlePasteSpecial: (doc: DocObject) => void;
|
|
14
14
|
}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { ScrollAreaElement, ScrollContainerElement, ScrollCore } from './common-types';
|
|
2
|
+
export declare function getElementScale(element: Element): number;
|
|
3
|
+
export declare function getSizeAsScale(element: HTMLElement, num: number): number;
|
|
2
4
|
export declare function getScrollWrapPaddingSize(scrollWrap: ScrollAreaElement): {
|
|
3
5
|
paddingBottom: number;
|
|
4
6
|
paddingTop: number;
|
|
5
7
|
paddingLeft: number;
|
|
6
8
|
paddingRight: number;
|
|
7
9
|
};
|
|
10
|
+
export declare function getElementScrollSize(scrollContainer: Element): {
|
|
11
|
+
scrollLeft: number;
|
|
12
|
+
scrollWidth: number;
|
|
13
|
+
clientWidth: number;
|
|
14
|
+
clientHeight: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function getElementOffset(element: HTMLElement, key: 'offsetLeft' | 'offsetTop' | 'offsetWidth' | 'offsetHeight'): number;
|
|
8
17
|
export declare function getOriginBoundaryData(scrollCore: ScrollCore, scrollContainer: ScrollContainerElement): {
|
|
9
18
|
originWidth: number;
|
|
10
19
|
maxLeft: number;
|
|
@@ -3,6 +3,7 @@ import { ScrollContainerOptions } from './types';
|
|
|
3
3
|
export * from './types';
|
|
4
4
|
export interface ChildEvents {
|
|
5
5
|
scroll: (scrollContainer: ScrollContainer) => void;
|
|
6
|
+
resize: (scrollContainer: ScrollContainer) => void;
|
|
6
7
|
}
|
|
7
8
|
export declare class ScrollContainer extends TypedEmitter<ChildEvents> {
|
|
8
9
|
private scrollListener?;
|
|
@@ -13,6 +14,7 @@ export declare class ScrollContainer extends TypedEmitter<ChildEvents> {
|
|
|
13
14
|
get scrollOptions(): ScrollContainerOptions;
|
|
14
15
|
init: (options: ScrollContainerOptions) => void;
|
|
15
16
|
private handleContainerScroll;
|
|
17
|
+
private handleResize;
|
|
16
18
|
private handleBaseListenerDestroy;
|
|
17
19
|
destroy(): void;
|
|
18
20
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ScrollContainerElement, ScrollCore } from '../common-types';
|
|
2
2
|
export declare class ContainerResizeObserver {
|
|
3
3
|
private scrollCore;
|
|
4
|
+
private callback;
|
|
4
5
|
private resizeObserver;
|
|
5
|
-
constructor(scrollCore: ScrollCore);
|
|
6
|
+
constructor(scrollCore: ScrollCore, callback: (scrollContainer: ScrollContainerElement) => void);
|
|
6
7
|
private get containers();
|
|
7
8
|
private handleResizeEntry;
|
|
8
9
|
private handleContentResize;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ScrollContainerElement, ScrollCore } from '../common-types';
|
|
2
2
|
export declare class LocatingContainerResizeObserver {
|
|
3
3
|
private scrollCore;
|
|
4
|
+
private callback;
|
|
4
5
|
private resizeObserver;
|
|
5
6
|
private scrollContainersMap;
|
|
6
|
-
constructor(scrollCore: ScrollCore);
|
|
7
|
+
constructor(scrollCore: ScrollCore, callback: (scrollContainer: ScrollContainerElement) => void);
|
|
7
8
|
private handleResizeEntry;
|
|
8
9
|
private handleResize;
|
|
9
10
|
bind(scrollContainer: ScrollContainerElement): void;
|
|
@@ -4,6 +4,7 @@ import { ScrollContainerOptions } from './types';
|
|
|
4
4
|
import './ui/bar.scss';
|
|
5
5
|
interface ChildEvents {
|
|
6
6
|
scroll: (scrollCore: ScrollListener, scrollContainerElement: ScrollContainerElement) => void;
|
|
7
|
+
resize: (scrollCore: ScrollListener, scrollContainerElement: ScrollContainerElement) => void;
|
|
7
8
|
}
|
|
8
9
|
export declare class ScrollListener extends TypedEmitter<ChildEvents> implements ScrollCore {
|
|
9
10
|
private parentContainer;
|
|
@@ -18,6 +19,7 @@ export declare class ScrollListener extends TypedEmitter<ChildEvents> implements
|
|
|
18
19
|
constructor(parentContainer: ParentContainerElement);
|
|
19
20
|
private load;
|
|
20
21
|
private handleScrollContainerScroll;
|
|
22
|
+
private handleResize;
|
|
21
23
|
getParentScrollContainer(): Element;
|
|
22
24
|
private handleIntersection;
|
|
23
25
|
private handleWindowEffect;
|
|
@@ -6,6 +6,11 @@ declare const _default: {
|
|
|
6
6
|
mergeCell: string;
|
|
7
7
|
splitCell: string;
|
|
8
8
|
tableConfigKey: string;
|
|
9
|
+
deleteTable: string;
|
|
10
|
+
insertCol: string;
|
|
11
|
+
insertRow: string;
|
|
12
|
+
deleteCol: string;
|
|
13
|
+
deleteRow: string;
|
|
9
14
|
tableConfig: {
|
|
10
15
|
rowTitle: string;
|
|
11
16
|
colTitle: string;
|
|
@@ -6,6 +6,11 @@ declare const _default: {
|
|
|
6
6
|
mergeCell: string;
|
|
7
7
|
splitCell: string;
|
|
8
8
|
tableConfigKey: string;
|
|
9
|
+
deleteTable: string;
|
|
10
|
+
insertCol: string;
|
|
11
|
+
insertRow: string;
|
|
12
|
+
deleteCol: string;
|
|
13
|
+
deleteRow: string;
|
|
9
14
|
tableConfig: {
|
|
10
15
|
rowTitle: string;
|
|
11
16
|
colTitle: string;
|
|
@@ -14,6 +14,7 @@ export declare class TableScrollEvents {
|
|
|
14
14
|
setAutoScroll(dir: NonNullable<ScrollDirType>): void;
|
|
15
15
|
handleSelectionChanged: (editor: OnesEditor) => void;
|
|
16
16
|
handleScroll: (scrollContainer: ScrollContainer) => void;
|
|
17
|
+
handleReset: (scrollContainer: ScrollContainer) => void;
|
|
17
18
|
destroy(): void;
|
|
18
19
|
}
|
|
19
20
|
export declare function handleTableScrollEvents(editor: OnesEditor): TableScrollEvents;
|