@ones-editor/editor 1.1.18-beta.20 → 1.1.18-beta.22
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/index.d.ts +5 -15
- package/@ones-editor/block-menu/src/block-menu-button/menu-button/index.d.ts +32 -0
- package/@ones-editor/comments/src/comment-quick-reply/index.d.ts +0 -1
- 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 +1 -3
- package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +1 -1
- package/@ones-editor/context-menu/src/menu/index.d.ts +0 -1
- package/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +1 -2
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +0 -2
- package/@ones-editor/core/src/core/editor/editor-dom/editor-dom.d.ts +0 -1
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +0 -1
- package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +1 -3
- package/@ones-editor/core/src/core/types.d.ts +10 -2
- package/@ones-editor/core/src/core/undo-manager/actions/action.d.ts +2 -2
- package/@ones-editor/core/src/core/undo-manager/undo-manager.d.ts +1 -0
- package/@ones-editor/core/src/utils/dom.d.ts +0 -3
- package/@ones-editor/core/src/utils/file.d.ts +1 -2
- package/@ones-editor/drop-target/src/drop-indicator.d.ts +1 -0
- package/@ones-editor/drop-target/src/find-drop-target.d.ts +1 -1
- package/@ones-editor/layout-block/package.json +8 -0
- package/@ones-editor/layout-block/src/block-drop.d.ts +3 -0
- package/@ones-editor/layout-block/src/child-containers.d.ts +3 -0
- package/@ones-editor/layout-block/src/column-resizer/index.d.ts +2 -0
- package/@ones-editor/layout-block/src/columns-options.d.ts +2 -0
- package/@ones-editor/layout-block/src/constants.d.ts +27 -0
- package/@ones-editor/layout-block/src/index.d.ts +4 -0
- package/@ones-editor/layout-block/src/layout-creator/index.d.ts +27 -0
- package/@ones-editor/layout-block/src/layout-operations.d.ts +10 -0
- package/@ones-editor/layout-block/src/locale/en-us.d.ts +6 -0
- package/@ones-editor/layout-block/src/locale/index.d.ts +1 -0
- package/@ones-editor/layout-block/src/locale/ja-jp.d.ts +6 -0
- package/@ones-editor/layout-block/src/locale/zh-cn.d.ts +6 -0
- package/@ones-editor/layout-block/src/percent-bar.d.ts +3 -0
- package/@ones-editor/layout-block/src/selection.d.ts +5 -0
- package/@ones-editor/layout-block/src/toolbar.d.ts +33 -0
- package/@ones-editor/layout-block/src/types.d.ts +31 -0
- package/@ones-editor/list-block/src/index.d.ts +1 -2
- package/@ones-editor/paste-special/src/paste-special-button.d.ts +0 -1
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +0 -1
- package/@ones-editor/sharedb-doc/src/types.d.ts +0 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/link-popup/index.d.ts +1 -4
- package/@ones-editor/ui/src/quick-menu/index.d.ts +4 -0
- package/@ones-editor/ui-base/src/icons/index.d.ts +3 -1
- package/@ones-editor/ui-base/src/popup/popup.d.ts +1 -0
- package/dist/index.js +848 -77673
- package/dist/types.d.ts +0 -3
- package/package.json +1 -1
- package/@ones-editor/list-block/src/local-events/paste-handler.d.ts +0 -6
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export default class OnesEditorBlockMenuButton {
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import OnesEditorBlockMenuButton from './menu-button';
|
|
3
|
+
export default class OnesEditorBlockMenuButtons {
|
|
5
4
|
private editor;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
blockMenu: BlockMenu;
|
|
9
|
-
private dragHandler;
|
|
5
|
+
rootButton: OnesEditorBlockMenuButton;
|
|
6
|
+
private parentButton;
|
|
10
7
|
constructor(editor: OnesEditor);
|
|
11
8
|
destroy(): void;
|
|
12
|
-
handleHoverBlock: (hoverBlock: BlockElement | null, oldBlock: BlockElement | null, event: MouseEvent) => void;
|
|
13
|
-
handleButtonClick: () => void;
|
|
14
|
-
updatePlaceholder: (block: BlockElement) => void;
|
|
15
|
-
handleChanged: () => void;
|
|
16
|
-
createButton(): HTMLButtonElement;
|
|
17
|
-
setButtonType(type: 'move' | 'insert'): void;
|
|
18
|
-
updateButton(block: BlockElement): void;
|
|
19
9
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BlockElement, OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
|
+
import EmptyBlockMenu from '../../empty-block-menu';
|
|
3
|
+
import BlockMenu from '../../block-menu';
|
|
4
|
+
export declare enum MenuButtonType {
|
|
5
|
+
ROOT = "root",
|
|
6
|
+
PARENT = "parent"
|
|
7
|
+
}
|
|
8
|
+
export default class OnesEditorBlockMenuButton {
|
|
9
|
+
private editor;
|
|
10
|
+
private menuType;
|
|
11
|
+
buttonElement: HTMLButtonElement;
|
|
12
|
+
emptyBlockMenu: EmptyBlockMenu;
|
|
13
|
+
blockMenu: BlockMenu;
|
|
14
|
+
private dragHandler;
|
|
15
|
+
private menuButtonType;
|
|
16
|
+
private removeButtonDelay;
|
|
17
|
+
private shouldRemoveParentButton;
|
|
18
|
+
private removeTimer;
|
|
19
|
+
constructor(editor: OnesEditor, menuType: MenuButtonType);
|
|
20
|
+
destroy(): void;
|
|
21
|
+
handleHoverBlock: (hoverBlock: BlockElement | null, oldBlock: BlockElement | null, event: MouseEvent) => void;
|
|
22
|
+
showRootButton(hoverBlock: BlockElement): void;
|
|
23
|
+
showParentButton(hoverBlock: BlockElement): void;
|
|
24
|
+
removeParentButton: () => void;
|
|
25
|
+
addButtonToView(block: BlockElement): void;
|
|
26
|
+
handleButtonClick: () => void;
|
|
27
|
+
updatePlaceholder: (block: BlockElement) => void;
|
|
28
|
+
handleChanged: () => void;
|
|
29
|
+
createButton(): HTMLButtonElement;
|
|
30
|
+
setButtonType(type: 'move' | 'insert'): void;
|
|
31
|
+
updateButton(block: BlockElement): void;
|
|
32
|
+
}
|
|
@@ -13,7 +13,7 @@ export default class OnesEditorComments {
|
|
|
13
13
|
private showComment;
|
|
14
14
|
showCommentList: (groupId?: string) => void;
|
|
15
15
|
setFirstEditingCommentActive(): void;
|
|
16
|
-
isEditing(
|
|
16
|
+
isEditing(): 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(
|
|
21
|
+
isEditing(): boolean;
|
|
22
22
|
setFirstEditingCommentActive(): void;
|
|
23
23
|
handleSelectionOnComment: () => void;
|
|
24
24
|
updateCommentCount: () => void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import { OnesEditor, OnesEditorComment } from '../../../../@ones-editor/core';
|
|
3
2
|
import { CommentWithChildren, OnesEditorCommentsProvider } from '../types';
|
|
4
3
|
import { CommentGroupItem } from './group-item';
|
|
@@ -14,7 +13,6 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
|
|
|
14
13
|
groupItemHandlers: CommentGroupItemHandlers;
|
|
15
14
|
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
|
|
16
15
|
destroy(): void;
|
|
17
|
-
dispatchScroll: import("lodash").DebouncedFunc<() => void>;
|
|
18
16
|
updateItemsLayout(): void;
|
|
19
17
|
private bindEvents;
|
|
20
18
|
private unbindEvents;
|
|
@@ -24,7 +22,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
|
|
|
24
22
|
active: boolean;
|
|
25
23
|
}): CommentGroupItem | null;
|
|
26
24
|
private findFirstEditingComment;
|
|
27
|
-
isEditing(
|
|
25
|
+
isEditing(): boolean;
|
|
28
26
|
closeEditing: (groupId: string) => void;
|
|
29
27
|
setFirstEditingCommentActive: () => void;
|
|
30
28
|
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 '../..';
|
|
4
4
|
import { MiniGroupList } from './group-list';
|
|
5
5
|
interface MiniCommentsListEvents {
|
|
6
6
|
onMiniCommentClose: () => void;
|
|
@@ -12,7 +12,6 @@ declare class OnesEditorContextMenu implements OnesEditorCustom {
|
|
|
12
12
|
private isInEditor;
|
|
13
13
|
private handleContextMenuShown;
|
|
14
14
|
private handleContextMenuClick;
|
|
15
|
-
private handleContextMenuClose;
|
|
16
15
|
private handleImageEmbedAction;
|
|
17
16
|
}
|
|
18
17
|
export default OnesEditorContextMenu;
|
|
@@ -2,9 +2,8 @@ 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 complexBlockGeFirstSimpleChild(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 complexBlockGetDeepFirstChild(editor: OnesEditor, container: ContainerElement): BlockElement | null;
|
|
8
7
|
export declare function findPrevSimpleBlockBeforeChildContainer(editor: OnesEditor, childContainer: ContainerElement, options?: GetChildContainerOptions): BlockElement | null;
|
|
9
8
|
export declare function complexBlockGetTopChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
|
|
10
9
|
export declare function complexBlockGetBottomChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
|
|
@@ -27,11 +27,9 @@ export declare class EditorInput implements OnesEditorInput {
|
|
|
27
27
|
callbacks: EditorInputCallbacks;
|
|
28
28
|
inputElement: HTMLInputElement;
|
|
29
29
|
constructor(editor: OnesEditor, callbacks: EditorInputCallbacks);
|
|
30
|
-
private isInCommandbar;
|
|
31
30
|
destroy(): void;
|
|
32
31
|
getInput(): HTMLInputElement;
|
|
33
32
|
focus(): void;
|
|
34
|
-
isInDisableScrollMask(target: HTMLElement): boolean;
|
|
35
33
|
handleWindowBlur: () => void;
|
|
36
34
|
handleDocumentClick: (event: MouseEvent) => void;
|
|
37
35
|
handleDocumentSelectionChange: () => void;
|
|
@@ -6,6 +6,5 @@ export declare function editorGetVisibleRect(editor: OnesEditor): DOMRect;
|
|
|
6
6
|
export declare function isBlockPositionVisible(editor: OnesEditor, pos: SimpleBlockPosition): boolean;
|
|
7
7
|
export declare function scrollIntoView(editor: OnesEditor, target: HTMLElement, options?: {
|
|
8
8
|
animation?: boolean;
|
|
9
|
-
verticalOffset?: number;
|
|
10
9
|
}): void;
|
|
11
10
|
export declare function editorScrollIntoView(editor: OnesEditor): void;
|
|
@@ -34,7 +34,6 @@ 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;
|
|
38
37
|
uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
|
|
39
38
|
addResources(resourceIds: string[]): Promise<string[]>;
|
|
40
39
|
buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import { EditorInputCallbacks } from '../composition/editor-input';
|
|
3
2
|
import { OnesEditor, OnesEditorInputHandler, OnesEditorUndoAction, RemoteChangeType, PasteOptions } from '../types';
|
|
4
3
|
import { DocObject } from '../doc';
|
|
@@ -19,8 +18,7 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
|
|
|
19
18
|
onPaste(event: ClipboardEvent): void;
|
|
20
19
|
onPasteText: (text: string, options?: PasteOptions) => Promise<void>;
|
|
21
20
|
onFocus(): void;
|
|
22
|
-
onBlur
|
|
23
|
-
removeActiveForBlur: import("lodash").DebouncedFunc<() => void>;
|
|
21
|
+
onBlur(): void;
|
|
24
22
|
addHandler(handler: OnesEditorInputHandler): void;
|
|
25
23
|
removeHandler(handler: OnesEditorInputHandler): void;
|
|
26
24
|
handleBeforeInsertText(containerId: string, blockIndex: number, offset: number, text: string): boolean;
|
|
@@ -147,6 +147,7 @@ export interface CommandItem {
|
|
|
147
147
|
hideGroupItem?: boolean;
|
|
148
148
|
setCloseable?: (closeable: Closeable) => void;
|
|
149
149
|
beforePopup?: (parent: unknown) => void;
|
|
150
|
+
shouldShown?: (currentBlock: BlockElement) => boolean;
|
|
150
151
|
}
|
|
151
152
|
export interface BlockCommandItem extends CommandItem {
|
|
152
153
|
blockId: string;
|
|
@@ -176,6 +177,13 @@ export interface BlockOptions {
|
|
|
176
177
|
name: string;
|
|
177
178
|
insertBlockCommandItems?: CommandItem[];
|
|
178
179
|
handleInsertEmptyBlock?: (editor: OnesEditor, options: InsertEmptyBlockOptions) => Promise<BlockElement | null>;
|
|
180
|
+
/**
|
|
181
|
+
* 当前 hover 的元素是否可以展示左侧更多按钮
|
|
182
|
+
* @param editor 编辑器实例
|
|
183
|
+
* @param hoverBlock hover 元素
|
|
184
|
+
* @returns true -> 展示,false -> 不展示
|
|
185
|
+
*/
|
|
186
|
+
contentMenuBtnShouldShown?: (editor: OnesEditor, hoverBlock: BlockElement) => boolean;
|
|
179
187
|
}
|
|
180
188
|
export interface StandardDragObject {
|
|
181
189
|
type: 'block';
|
|
@@ -195,6 +203,7 @@ export type DragObject = StandardDragObject | CustomDragObject;
|
|
|
195
203
|
export interface CustomDropInsertPos {
|
|
196
204
|
rect: DOMRect;
|
|
197
205
|
data: unknown;
|
|
206
|
+
targetBlock?: BlockElement;
|
|
198
207
|
}
|
|
199
208
|
export type DropInsertPos = 'before' | 'after' | CustomDropInsertPos;
|
|
200
209
|
export interface DropOptions {
|
|
@@ -308,6 +317,7 @@ export interface OnesEditorUndoManager {
|
|
|
308
317
|
canUndo: () => boolean;
|
|
309
318
|
canRedo: () => boolean;
|
|
310
319
|
runInGroup: <T>(action: () => T) => T;
|
|
320
|
+
runInGroupAsync: <T>(action: () => Promise<T>) => Promise<T>;
|
|
311
321
|
lastAction: () => OnesEditorUndoAction | null;
|
|
312
322
|
undoTo: (action: OnesEditorUndoAction | null) => boolean;
|
|
313
323
|
}
|
|
@@ -399,7 +409,6 @@ export interface OnesEditorOptionalOptions {
|
|
|
399
409
|
colors?: string[];
|
|
400
410
|
scrollContainer?: HTMLElement;
|
|
401
411
|
enableComments?: boolean;
|
|
402
|
-
enableContextMenu?: boolean;
|
|
403
412
|
settingsProvider?: OnesEditorSettingsProvider;
|
|
404
413
|
}
|
|
405
414
|
export interface OnesEditorOptions {
|
|
@@ -408,7 +417,6 @@ export interface OnesEditorOptions {
|
|
|
408
417
|
[index: string]: unknown;
|
|
409
418
|
};
|
|
410
419
|
enableComments?: boolean;
|
|
411
|
-
enableContextMenu?: boolean;
|
|
412
420
|
scrollContainer?: HTMLElement;
|
|
413
421
|
}
|
|
414
422
|
export interface OnesEditorComponents {
|
|
@@ -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
|
+
findContainerById(editor: OnesEditor, id: string): boolean;
|
|
14
|
+
findBlockById(editor: OnesEditor, id: string): boolean;
|
|
15
15
|
checkBlockData(editor: OnesEditor, blockData: DocBlock): boolean;
|
|
16
16
|
}
|
|
@@ -16,6 +16,7 @@ declare class UndoManager implements OnesEditorUndoManager, EditorDocLocalAction
|
|
|
16
16
|
private endGroup;
|
|
17
17
|
hasGroup(): boolean;
|
|
18
18
|
runInGroup<T>(action: () => T): T;
|
|
19
|
+
runInGroupAsync<T>(action: () => Promise<T>): Promise<T>;
|
|
19
20
|
undo(): boolean;
|
|
20
21
|
redo(): boolean;
|
|
21
22
|
canUndo(): boolean;
|
|
@@ -34,7 +34,4 @@ 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
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;
|
|
40
37
|
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
interface SelectFileOptions {
|
|
2
2
|
multiple?: boolean;
|
|
3
|
-
container?: HTMLElement;
|
|
4
3
|
}
|
|
5
4
|
export declare function selectFile<T extends SelectFileOptions = SelectFileOptions>(accept: string, options?: T): Promise<T extends {
|
|
6
5
|
multiple: true;
|
|
7
|
-
} ?
|
|
6
|
+
} ? File[] : File>;
|
|
8
7
|
export declare function isDraggingFiles(v: unknown): v is File[];
|
|
9
8
|
export declare function getFileExt(file: string): string;
|
|
10
9
|
export declare function requestDownload(downloadUrl: string, fileName?: string): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
-
export declare function findTargetBlock(editor: OnesEditor, x
|
|
2
|
+
export declare function findTargetBlock(editor: OnesEditor, x?: number, y?: number): BlockElement | null;
|
|
3
3
|
export declare function canInsertAsSibling(editor: OnesEditor, block: BlockElement): boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 名称
|
|
3
|
+
*/
|
|
4
|
+
export declare const LAYOUT_NAME = "LayoutBlock";
|
|
5
|
+
/**
|
|
6
|
+
* 快捷键
|
|
7
|
+
*/
|
|
8
|
+
export declare const LAYOUT_SHORTCUT_ID = "insert-layout";
|
|
9
|
+
/**
|
|
10
|
+
* 快捷键提示
|
|
11
|
+
*/
|
|
12
|
+
export declare const LAYOUT_SHORTCUT_SUBTEXT = "/layout";
|
|
13
|
+
export declare const LAYOUT_BLOCK_TYPE = "layout";
|
|
14
|
+
/**
|
|
15
|
+
* 最大分栏数
|
|
16
|
+
*/
|
|
17
|
+
export declare const MAX_LAYOUT_COLUMNS = 6;
|
|
18
|
+
/**
|
|
19
|
+
* 分栏最小宽度,百分比
|
|
20
|
+
*/
|
|
21
|
+
export declare const MIN_LAYOUT_WIDTH_PERCENT = 0.08;
|
|
22
|
+
export declare const DROP_TYPE_WHITE_LIST: string[];
|
|
23
|
+
/**
|
|
24
|
+
* custom dom
|
|
25
|
+
*/
|
|
26
|
+
export declare const LAYOUT_SEPARATOR_CLASS_NAME = "layout-separator";
|
|
27
|
+
export declare const LAYOUT_SEPARATOR_INDEX_ATTRIBUTE_KEY = "layoutSeparatorIndex";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Closeable, CommandItem } from '../../../../@ones-editor/core';
|
|
2
|
+
import { CreateLayoutData } from '../types';
|
|
3
|
+
declare class LayoutCreatorItem implements CommandItem, CreateLayoutData {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
colCount?: number | undefined;
|
|
7
|
+
classPrefix: {
|
|
8
|
+
container: string;
|
|
9
|
+
title: string;
|
|
10
|
+
column: string;
|
|
11
|
+
};
|
|
12
|
+
element: HTMLElement;
|
|
13
|
+
closeable: Closeable | null;
|
|
14
|
+
columnsArray: number[];
|
|
15
|
+
constructor();
|
|
16
|
+
setCloseable: (closeable: Closeable) => void;
|
|
17
|
+
destroy: () => void;
|
|
18
|
+
createLayoutCreatorElement(): HTMLDivElement;
|
|
19
|
+
handleCreatorClick: (event: MouseEvent) => void;
|
|
20
|
+
handleCreatorLeave: () => void;
|
|
21
|
+
handleLayoutCreatorColumnEnter: (event: MouseEvent) => void;
|
|
22
|
+
highlightLayoutCreatorColumn: (colIndex: number) => void;
|
|
23
|
+
setColumnClassByIndex: (column: HTMLElement | null, index: number, targetIndex: number) => void;
|
|
24
|
+
showCreateLayoutCount: (colIndex: number) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare function getLayoutCreatorItem(): LayoutCreatorItem;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BlockElement, OnesEditor, InsertEmptyBlockOptions } from '../../../@ones-editor/core';
|
|
2
|
+
export declare function handleInsertEmptyBlock(editor: OnesEditor, options: InsertEmptyBlockOptions): Promise<BlockElement>;
|
|
3
|
+
export declare function selectContainer(editor: OnesEditor, layoutBlockElement: BlockElement, startContainerID: string, endContainerID?: string): void;
|
|
4
|
+
export declare function changeColumnOrder(editor: OnesEditor, layoutBlock: BlockElement, sourceContainerID: string, position: number): void;
|
|
5
|
+
export declare function combineLayoutBlock(editor: OnesEditor, from: BlockElement, to: BlockElement, position?: number): void;
|
|
6
|
+
export declare function addColumn(editor: OnesEditor, targetBlock: BlockElement, options?: {
|
|
7
|
+
sourceBlock?: BlockElement;
|
|
8
|
+
position?: number;
|
|
9
|
+
}): void;
|
|
10
|
+
export declare function deleteColumn(editor: OnesEditor, columnContainerID: string, layoutBlock: BlockElement): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LayoutKindBlock } from './types';
|
|
2
|
+
export declare const updateSelection: LayoutKindBlock['updateSelection'];
|
|
3
|
+
export declare const clearSelection: LayoutKindBlock['clearSelection'];
|
|
4
|
+
export declare const getSelectedContainers: LayoutKindBlock['getSelectedContainers'];
|
|
5
|
+
export declare const getTextToolbarReferenceClient: LayoutKindBlock['getTextToolbarReferenceClient'];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { OnesEditor, BlockElement, BlockCommands, CommandItem, AutoScroll, OnesEditorCustom, ContainerElement } from '../../../@ones-editor/core';
|
|
2
|
+
export declare function createSeparatorContainer(editor: OnesEditor, childContainerId: string, index: number): HTMLDivElement;
|
|
3
|
+
export declare function createActionBar(editor: OnesEditor, containerID: string, _blockElement: BlockElement): HTMLDivElement;
|
|
4
|
+
export declare function elementToDataUrl(editor: OnesEditor, element: HTMLElement): Promise<string>;
|
|
5
|
+
export declare class OnesEditorCustomLayoutDragHandler implements OnesEditorCustom {
|
|
6
|
+
private editor;
|
|
7
|
+
activeLayoutBlock?: BlockElement;
|
|
8
|
+
columnContainer?: ContainerElement;
|
|
9
|
+
draggingContainer?: HTMLElement;
|
|
10
|
+
autoScroll?: AutoScroll;
|
|
11
|
+
startPosition?: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
get separators(): HTMLElement[] | undefined;
|
|
16
|
+
get draggingContainerIndex(): number | undefined;
|
|
17
|
+
constructor(editor: OnesEditor);
|
|
18
|
+
destroy(): void;
|
|
19
|
+
handleMouseDown: (event: MouseEvent) => void;
|
|
20
|
+
handleDragStart: (event: MouseEvent) => Promise<void>;
|
|
21
|
+
handleDrag: (event: MouseEvent) => void;
|
|
22
|
+
handleDragEnd: (event?: MouseEvent) => void;
|
|
23
|
+
private getClosetSeparator;
|
|
24
|
+
}
|
|
25
|
+
export declare class ColumnsBlockCommands implements BlockCommands {
|
|
26
|
+
protected editor: OnesEditor;
|
|
27
|
+
protected block: BlockElement;
|
|
28
|
+
group: string;
|
|
29
|
+
constructor(editor: OnesEditor, block: BlockElement);
|
|
30
|
+
_commands: CommandItem[];
|
|
31
|
+
get commands(): CommandItem[];
|
|
32
|
+
executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ComplexKindBlock, DocBlock } from '../../../@ones-editor/core';
|
|
2
|
+
export interface LayoutDocBlock extends DocBlock {
|
|
3
|
+
children: string[];
|
|
4
|
+
colsWidth: number[];
|
|
5
|
+
}
|
|
6
|
+
export type LayoutKindBlock = ComplexKindBlock;
|
|
7
|
+
export type LayoutDropData = {
|
|
8
|
+
isValidColumnDragging: boolean;
|
|
9
|
+
position: number;
|
|
10
|
+
};
|
|
11
|
+
export interface CreateLayoutData {
|
|
12
|
+
colCount?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated
|
|
16
|
+
*/
|
|
17
|
+
export declare const COMMANDS: readonly [{
|
|
18
|
+
readonly id: "column-2";
|
|
19
|
+
readonly name: "2 columns";
|
|
20
|
+
}, {
|
|
21
|
+
readonly id: "column-3";
|
|
22
|
+
readonly name: "3 columns";
|
|
23
|
+
}, {
|
|
24
|
+
readonly id: "column-4";
|
|
25
|
+
readonly name: "4 columns";
|
|
26
|
+
}, {
|
|
27
|
+
readonly id: "add-column";
|
|
28
|
+
readonly name: "AddColumn";
|
|
29
|
+
}];
|
|
30
|
+
export type CommandID = (typeof COMMANDS)[number]['id'];
|
|
31
|
+
export declare function getColumnLengthByType(type: string): number;
|
|
@@ -6,9 +6,8 @@ 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';
|
|
10
9
|
export { type ListOptions, type DocListBlock } from './types';
|
|
11
10
|
declare const ListBlock: TextKindBlock;
|
|
12
11
|
export * from './utils';
|
|
13
12
|
export * from './keyboard/to-text-block';
|
|
14
|
-
export { ListBlock, OnesEditorListMindmap, Mindmap, resetListStart, toMindmap, isMindmapRootBlock, ListBlockShortcuts, isViewingAsMindmap, getLastMindmapNode,
|
|
13
|
+
export { ListBlock, OnesEditorListMindmap, Mindmap, resetListStart, toMindmap, isMindmapRootBlock, ListBlockShortcuts, isViewingAsMindmap, getLastMindmapNode, };
|
|
@@ -14,7 +14,6 @@ export default class PasteSpecialButton {
|
|
|
14
14
|
private cleaningDoc;
|
|
15
15
|
handlePasteSpecial: (bar: AbstractCommandBar, item: CommandItem) => void;
|
|
16
16
|
handleClose: () => void;
|
|
17
|
-
handleSelectionChange: () => void;
|
|
18
17
|
hide(): void;
|
|
19
18
|
clearCheckedState(): void;
|
|
20
19
|
destroy(): void;
|