@ones-editor/editor 2.0.4-beta.17 → 2.0.4-beta.19
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-button/drag-preview/element-to-data-url.d.ts +1 -1
- package/@ones-editor/block-menu/src/block-menu-button/index.d.ts +15 -4
- package/@ones-editor/{layout-block → column-block}/package.json +1 -1
- package/@ones-editor/column-block/src/child-containers.d.ts +2 -0
- package/@ones-editor/column-block/src/columns-options.d.ts +2 -0
- package/@ones-editor/column-block/src/columns-properties.d.ts +15 -0
- package/@ones-editor/column-block/src/index.d.ts +4 -0
- package/@ones-editor/column-block/src/types.d.ts +11 -0
- package/@ones-editor/core/src/core/blocks/common/block-wrapper.d.ts +1 -2
- package/@ones-editor/core/src/core/blocks/common/insert-empty-block.d.ts +2 -3
- package/@ones-editor/core/src/core/blocks/embed-blocks/embed-block/common.d.ts +0 -1
- package/@ones-editor/core/src/core/containers/children.d.ts +2 -5
- package/@ones-editor/core/src/core/doc/container.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/insert-doc/insert-doc.d.ts +1 -1
- package/@ones-editor/core/src/core/editor-doc/handle-block-data-changed.d.ts +1 -2
- package/@ones-editor/core/src/core/types.d.ts +4 -54
- package/@ones-editor/core/src/helper/hovering-block.d.ts +1 -3
- package/@ones-editor/drop-target/src/drop-indicator.d.ts +2 -3
- package/@ones-editor/drop-target/src/drop-target.d.ts +1 -2
- package/@ones-editor/drop-target/src/find-drop-target.d.ts +1 -1
- package/@ones-editor/drop-target/src/index.d.ts +1 -2
- package/@ones-editor/find-dialog/src/shortcuts.d.ts +2 -0
- package/@ones-editor/heading-collapse/src/heading-collapse-button/heading-utils.d.ts +1 -2
- package/@ones-editor/heading-collapse/src/index.d.ts +0 -1
- package/@ones-editor/image-embed/src/drag-drop/handle-drop-over.d.ts +4 -1
- package/@ones-editor/image-embed/src/drag-drop/handle-drop.d.ts +0 -1
- package/@ones-editor/image-embed/src/image-object.d.ts +0 -3
- package/@ones-editor/image-embed/src/index.d.ts +1 -5
- package/@ones-editor/image-embed/src/types.d.ts +0 -1
- package/@ones-editor/table-block/src/index.d.ts +0 -1
- package/@ones-editor/table-block/src/table-block/table-creator/index.d.ts +1 -1
- package/@ones-editor/to-docx/src/doc2other/core.d.ts +0 -2
- package/@ones-editor/toc/src/build-toc.d.ts +0 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +1 -1
- package/@ones-editor/ui/src/quick-menu/index.d.ts +1 -6
- package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +2 -4
- package/@ones-editor/ui/src/quick-menu/types.d.ts +0 -1
- package/@ones-editor/ui-base/src/icons/index.d.ts +1 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +204 -215
- package/dist/types.d.ts +0 -2
- package/package.json +1 -1
- package/@ones-editor/block-menu/src/block-menu-button/menu-button/index.d.ts +0 -23
- package/@ones-editor/image-embed/src/hovering-toolbar/index.d.ts +0 -22
- package/@ones-editor/layout-block/src/block-drop.d.ts +0 -3
- package/@ones-editor/layout-block/src/caption.d.ts +0 -8
- package/@ones-editor/layout-block/src/child-containers.d.ts +0 -3
- package/@ones-editor/layout-block/src/column-resizer/index.d.ts +0 -2
- package/@ones-editor/layout-block/src/constants.d.ts +0 -32
- package/@ones-editor/layout-block/src/index.d.ts +0 -6
- package/@ones-editor/layout-block/src/layout-creator/index.d.ts +0 -27
- package/@ones-editor/layout-block/src/layout-operations.d.ts +0 -11
- package/@ones-editor/layout-block/src/locale/en-us.d.ts +0 -10
- package/@ones-editor/layout-block/src/locale/index.d.ts +0 -1
- package/@ones-editor/layout-block/src/locale/ja-jp.d.ts +0 -10
- package/@ones-editor/layout-block/src/locale/zh-cn.d.ts +0 -10
- package/@ones-editor/layout-block/src/options.d.ts +0 -2
- package/@ones-editor/layout-block/src/percent-bar.d.ts +0 -3
- package/@ones-editor/layout-block/src/selection.d.ts +0 -5
- package/@ones-editor/layout-block/src/toolbar.d.ts +0 -33
- package/@ones-editor/layout-block/src/types.d.ts +0 -17
- package/@ones-editor/layout-block/src/utils.d.ts +0 -6
- package/@ones-editor/media-embed/src/core/hovering-toolbar/index.d.ts +0 -22
- package/@ones-editor/to-docx/src/doc2other/layout.d.ts +0 -10
|
@@ -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,
|
|
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,2 +1,2 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
|
-
export declare function elementToDataUrl(editor: OnesEditor, element: HTMLElement
|
|
2
|
+
export declare function elementToDataUrl(editor: OnesEditor, element: HTMLElement): Promise<string>;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import EmptyBlockMenu from '../empty-block-menu';
|
|
3
|
+
import BlockMenu from '../block-menu';
|
|
4
|
+
export default class OnesEditorBlockMenuButton {
|
|
4
5
|
private editor;
|
|
5
|
-
|
|
6
|
+
buttonElement: HTMLButtonElement;
|
|
7
|
+
emptyBlockMenu: EmptyBlockMenu;
|
|
8
|
+
blockMenu: BlockMenu;
|
|
9
|
+
private dragHandler;
|
|
6
10
|
constructor(editor: OnesEditor);
|
|
7
11
|
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;
|
|
8
19
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BlockCommands, BlockElement, CommandItem, OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
+
export declare class ColumnsBlockCommands implements BlockCommands {
|
|
3
|
+
protected editor: OnesEditor;
|
|
4
|
+
protected block: BlockElement;
|
|
5
|
+
group: string;
|
|
6
|
+
constructor(editor: OnesEditor, block: BlockElement);
|
|
7
|
+
_commands: CommandItem[];
|
|
8
|
+
get commands(): CommandItem[];
|
|
9
|
+
executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
|
|
10
|
+
}
|
|
11
|
+
export declare function getColumnsBlockProperties(editor: OnesEditor, block: BlockElement): {
|
|
12
|
+
blockCommands: {
|
|
13
|
+
'hovering-toolbar': ColumnsBlockCommands;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DocBlock } from '../../../@ones-editor/core';
|
|
2
|
+
export type ColumnData = {
|
|
3
|
+
type: string;
|
|
4
|
+
columns: 1 | 2 | 3 | 4;
|
|
5
|
+
};
|
|
6
|
+
export declare const COLUMNS: ColumnData[];
|
|
7
|
+
export interface DocColumnsBlock extends DocBlock {
|
|
8
|
+
columnType: string;
|
|
9
|
+
children: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function getColumnData(type: string): ColumnData;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { OnesEditor, BlockElement, BlockPosition, ConvertBlockResult, SelectionRange, BlockStyles
|
|
1
|
+
import { OnesEditor, BlockElement, BlockPosition, ConvertBlockResult, SelectionRange, BlockStyles } from '../../types';
|
|
2
2
|
import { DocBlock, DocBlockAttributes } from '../../doc';
|
|
3
3
|
export declare function getBlockTextLength(editor: OnesEditor, block: BlockElement): number;
|
|
4
4
|
export declare function clearAllSelection(editor: OnesEditor): void;
|
|
5
5
|
export declare function updateBlockSelection(editor: OnesEditor, block: BlockElement, from: BlockPosition, to: BlockPosition): void;
|
|
6
6
|
export declare function getRootBlock(block: BlockElement): BlockElement;
|
|
7
|
-
export declare function getClosestContainerByCondition(_block: BlockElement, condition: (container: ContainerElement) => boolean): BlockElement | undefined;
|
|
8
7
|
export declare function getBlockMinWidth(editor: OnesEditor, block: BlockElement): number | undefined;
|
|
9
8
|
export declare function handleBlockElementUpdated(editor: OnesEditor, block: BlockElement, data: DocBlock): void;
|
|
10
9
|
export declare function convertBlockFrom(editor: OnesEditor, block: BlockElement, type: string, options: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getContainerBlockOverrideOptions(editor: OnesEditor, containerID: string, blockType?: string): ContainerBlockOverrideInsertEmptyBlockInsideOptions | undefined;
|
|
1
|
+
import { OnesEditor } from '../../types';
|
|
3
2
|
export declare function insertEmptyEmbedBlock(editor: OnesEditor, embedType: string, containerId: string, blockIndex: number, data?: Record<string, unknown>): Promise<import("../../types").BlockElement | null>;
|
|
4
|
-
export declare function insertEmptyBlock(editor: OnesEditor, type: string, containerId: string, blockIndex: number, data?: Record<string, unknown
|
|
3
|
+
export declare function insertEmptyBlock(editor: OnesEditor, type: string, containerId: string, blockIndex: number, data?: Record<string, unknown>): Promise<import("../../types").BlockElement | null> | null;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { BlockElement, ContainerElement
|
|
2
|
-
export declare function getChildBlocks(container: ContainerElement
|
|
3
|
-
condition: (block: BlockElement) => boolean;
|
|
4
|
-
editor: OnesEditor;
|
|
5
|
-
}): BlockElement[];
|
|
1
|
+
import { BlockElement, ContainerElement } from '../types';
|
|
2
|
+
export declare function getChildBlocks(container: ContainerElement): BlockElement[];
|
|
6
3
|
export declare function getFirstChildBlock(container: ContainerElement): BlockElement;
|
|
7
4
|
export declare function getLastChildBlock(container: ContainerElement): BlockElement;
|
|
8
5
|
export declare function getChildBlockCount(container: ContainerElement): number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DocBlock,
|
|
2
|
-
export declare function createContainer(doc: OnesEditorDoc,
|
|
1
|
+
import { DocBlock, OnesEditorDoc } from './doc';
|
|
2
|
+
export declare function createContainer(doc: OnesEditorDoc, blocks: DocBlock[]): string;
|
|
3
3
|
export declare function createEmptyContainer(doc: OnesEditorDoc, text?: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { DocObject } from '../../../doc';
|
|
2
2
|
import { BlockElement, CloneBlockResultInfo, ContainerElement, OnesEditor } from '../../../types';
|
|
3
3
|
export declare function editorInsertDoc(editor: OnesEditor, block: BlockElement, offset: number, insertedDoc: DocObject, cloneDocResult?: CloneBlockResultInfo): void;
|
|
4
|
-
export declare function editorInsertDocAt(editor: OnesEditor, container: ContainerElement, blockIndex: number,
|
|
4
|
+
export declare function editorInsertDocAt(editor: OnesEditor, container: ContainerElement, blockIndex: number, insertedDoc: DocObject, cloneDocResult?: CloneBlockResultInfo): BlockElement[];
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import type { DocBlockDelta } from '../doc';
|
|
2
1
|
import { OnesEditor } from '../types';
|
|
3
|
-
export declare function onBlockDataChanged(editor: OnesEditor, containerId: string, blockIndex: number
|
|
2
|
+
export declare function onBlockDataChanged(editor: OnesEditor, containerId: string, blockIndex: number): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
-
import { DocBlock, DocBlockAttributes,
|
|
2
|
+
import { DocBlock, DocBlockAttributes, DocBlocks, DocBlockText, DocBlockTextAttributes, DocBox, DocEmbedBlock, DocEmbedData, DocInsertion, DocObject, InsertBlockOptions, OnesEditorDoc, OnesEditorDocRange } from './doc';
|
|
3
3
|
export type ContainerElement = HTMLDivElement & {
|
|
4
4
|
__neverUse: 'ContainerElement';
|
|
5
5
|
};
|
|
@@ -118,7 +118,6 @@ export interface Closeable {
|
|
|
118
118
|
click: (item: CommandItem, target: HTMLElement) => void;
|
|
119
119
|
}
|
|
120
120
|
export type CommandItemChildrenPlacement = 'auto' | 'top' | 'left' | 'right' | 'bottom' | 'auto-start' | 'auto-end' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'right-start' | 'right-end' | 'left-start' | 'left-end';
|
|
121
|
-
export type CommandItemMenuType = 'inline' | 'sibling';
|
|
122
121
|
export interface CommandItem {
|
|
123
122
|
id: string;
|
|
124
123
|
name: string;
|
|
@@ -148,10 +147,6 @@ export interface CommandItem {
|
|
|
148
147
|
hideGroupItem?: boolean;
|
|
149
148
|
setCloseable?: (closeable: Closeable) => void;
|
|
150
149
|
beforePopup?: (parent: unknown) => void;
|
|
151
|
-
/**
|
|
152
|
-
* defaults to true
|
|
153
|
-
*/
|
|
154
|
-
shouldShown?: (currentBlock: BlockElement | undefined, menuType: CommandItemMenuType) => boolean;
|
|
155
150
|
}
|
|
156
151
|
export interface BlockCommandItem extends CommandItem {
|
|
157
152
|
blockId: string;
|
|
@@ -177,47 +172,10 @@ export interface BlockProperties {
|
|
|
177
172
|
blockCommands?: Record<string, BlockCommands>;
|
|
178
173
|
abstract?: string;
|
|
179
174
|
}
|
|
180
|
-
export interface DropHandler {
|
|
181
|
-
handleDrop: (editor: OnesEditor, dragData: BlockElement | File[], targetContainer: ContainerElement, blockIndex: number) => boolean | undefined;
|
|
182
|
-
}
|
|
183
|
-
export interface CombineToCreateOptions {
|
|
184
|
-
/**
|
|
185
|
-
* @returns sideway: 两侧合并(左右 indicator)
|
|
186
|
-
*
|
|
187
|
-
* body: 中间合并(target block 激活)(暂未实现)
|
|
188
|
-
*/
|
|
189
|
-
combinable: (editor: OnesEditor, source: BlockElement, target: BlockElement) => undefined | 'sideway' | 'body';
|
|
190
|
-
onCombine: (editor: OnesEditor, source: BlockElement, target: BlockElement, position: CombineDropInsertPos['pos'], dragObject: DragObject | null, handlers: DropHandler[]) => BlockElement | undefined;
|
|
191
|
-
}
|
|
192
|
-
export type ContainerBlockOverrideInsertEmptyBlockInsideOptionsDict = Record<string, ContainerBlockOverrideInsertEmptyBlockInsideOptions>;
|
|
193
|
-
export type ContainerBlockOverrideInsertEmptyBlockInsideOptions = {
|
|
194
|
-
item?: CommandItem;
|
|
195
|
-
data?: Record<string, unknown>;
|
|
196
|
-
};
|
|
197
175
|
export interface BlockOptions {
|
|
198
176
|
name: string;
|
|
199
177
|
insertBlockCommandItems?: CommandItem[];
|
|
200
|
-
overrideInertEmptyBlockInsideOptions?: ContainerBlockOverrideInsertEmptyBlockInsideOptionsDict;
|
|
201
178
|
handleInsertEmptyBlock?: (editor: OnesEditor, options: InsertEmptyBlockOptions) => Promise<BlockElement | null>;
|
|
202
|
-
isMenuButtonBaseContainer?: (container: ContainerElement) => boolean;
|
|
203
|
-
combineToCreate?: CombineToCreateOptions;
|
|
204
|
-
/**
|
|
205
|
-
* defaults to true.
|
|
206
|
-
*
|
|
207
|
-
* 'without-margin': include margin for dragging preview computing.
|
|
208
|
-
*/
|
|
209
|
-
draggingPreview?: boolean | 'margin-included';
|
|
210
|
-
innerToc?: boolean;
|
|
211
|
-
blockMenu?: {
|
|
212
|
-
showComment?: boolean;
|
|
213
|
-
showLocker?: boolean;
|
|
214
|
-
};
|
|
215
|
-
findPreviewElement?: (editor: OnesEditor, complexBlock: BlockElement) => HTMLElement;
|
|
216
|
-
headingCollapsable?: boolean;
|
|
217
|
-
/**
|
|
218
|
-
* 拖拽时,是否显示缩略图容器自带的阴影,默认为 false
|
|
219
|
-
*/
|
|
220
|
-
previewNoShadow?: boolean;
|
|
221
179
|
}
|
|
222
180
|
export interface StandardDragObject {
|
|
223
181
|
type: 'block';
|
|
@@ -235,17 +193,10 @@ export interface CustomDragObject {
|
|
|
235
193
|
}
|
|
236
194
|
export type DragObject = StandardDragObject | CustomDragObject;
|
|
237
195
|
export interface CustomDropInsertPos {
|
|
238
|
-
type: 'custom';
|
|
239
196
|
rect: DOMRect;
|
|
240
197
|
data: unknown;
|
|
241
|
-
targetBlock?: BlockElement;
|
|
242
198
|
}
|
|
243
|
-
export type
|
|
244
|
-
type: 'combine';
|
|
245
|
-
pos: 'left' | 'right';
|
|
246
|
-
onCombine: CombineToCreateOptions['onCombine'];
|
|
247
|
-
};
|
|
248
|
-
export type DropInsertPos = 'before' | 'after' | CombineDropInsertPos | CustomDropInsertPos;
|
|
199
|
+
export type DropInsertPos = 'before' | 'after' | CustomDropInsertPos;
|
|
249
200
|
export interface DropOptions {
|
|
250
201
|
isSourceBlock: boolean;
|
|
251
202
|
targetBlock: BlockElement;
|
|
@@ -266,9 +217,9 @@ export interface Block {
|
|
|
266
217
|
handleBlockElementUpdated?: (editor: OnesEditor, block: BlockElement, blockData: DocBlock) => void;
|
|
267
218
|
handleContainerResized?: (editor: OnesEditor, block: BlockElement) => void;
|
|
268
219
|
handleDeleteBlock?: (editor: OnesEditor, block: BlockElement, local: boolean, options: DeleteBlockEventOptions) => void;
|
|
269
|
-
handleUpdateBlock?: (editor: OnesEditor, block: BlockElement, blockData: DocBlock
|
|
220
|
+
handleUpdateBlock?: (editor: OnesEditor, block: BlockElement, blockData: DocBlock) => boolean;
|
|
270
221
|
handleDropOver?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | DataTransferItemList | null, x: number, y: number) => DropInsertPos | false | undefined;
|
|
271
|
-
handleDrop?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertPos, options: DropOptions) => boolean |
|
|
222
|
+
handleDrop?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertPos, options: DropOptions) => boolean | undefined;
|
|
272
223
|
getClientRects?: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => DOMRect[];
|
|
273
224
|
getMinWidth?: (editor: OnesEditor, block: BlockElement) => number | undefined;
|
|
274
225
|
convertFrom?: (editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
@@ -307,7 +258,6 @@ export interface ComplexKindBlock extends Block {
|
|
|
307
258
|
getTextToolbarReferenceClient?: (editor: OnesEditor, complexBlock: BlockElement) => DOMRect | undefined;
|
|
308
259
|
isChildContainerVisible?: (editor: OnesEditor, complexBlock: BlockElement, childContainer: ContainerElement) => boolean;
|
|
309
260
|
showChildContainer?: (editor: OnesEditor, complexBlock: BlockElement, childContainer: ContainerElement) => void;
|
|
310
|
-
beforeInsertDoc?: (editor: OnesEditor, container: ContainerElement, insertDoc: DocObject) => DocObject | undefined;
|
|
311
261
|
}
|
|
312
262
|
export interface SelectedBlock {
|
|
313
263
|
block: BlockElement;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
-
import
|
|
2
|
+
import { TextBlockContentChild } from '../core/blocks/text-blocks/base/child';
|
|
3
3
|
import { BlockElement, OnesEditor, OnesEditorCustom } from '../core/types';
|
|
4
4
|
export interface OnesEditorHoveringBlockEvents {
|
|
5
5
|
change: (block: BlockElement | null, old: BlockElement | null, event: MouseEvent) => void;
|
|
6
|
-
targetChange: (block: BlockElement | null, old: BlockElement | null, target: EventTarget | null, oldTarget: EventTarget | null) => void;
|
|
7
6
|
childChange: (block: BlockElement | null, child: TextBlockContentChild | null, old: TextBlockContentChild | null, event: MouseEvent) => void;
|
|
8
7
|
}
|
|
9
8
|
export interface OnesEditorHoveringBlockFilter extends OnesEditorCustom {
|
|
@@ -15,7 +14,6 @@ export interface OnesEditorHoveringBlockFinder extends OnesEditorCustom {
|
|
|
15
14
|
export default class OnesEditorHoveringBlock extends TypedEmitter<OnesEditorHoveringBlockEvents> {
|
|
16
15
|
private editor;
|
|
17
16
|
private hoveringBlock;
|
|
18
|
-
private hoveringElem;
|
|
19
17
|
private hoveringTextChild;
|
|
20
18
|
private filters;
|
|
21
19
|
private finders;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockElement, DropInsertPos, OnesEditor } from '../../../@ones-editor/core';
|
|
2
2
|
export declare const INDICATOR_SIZE = 2;
|
|
3
3
|
interface DropTarget {
|
|
4
4
|
block: BlockElement;
|
|
@@ -9,10 +9,9 @@ export default class DropIndicator {
|
|
|
9
9
|
private indicator;
|
|
10
10
|
target: DropTarget | null;
|
|
11
11
|
constructor(editor: OnesEditor);
|
|
12
|
-
createIndicator(): void;
|
|
13
12
|
show(block: BlockElement, insertPos: DropInsertPos): void;
|
|
14
13
|
hide(): void;
|
|
15
14
|
private getIndicatorRect;
|
|
16
|
-
getViewRect(block: BlockElement
|
|
15
|
+
getViewRect(block: BlockElement): DOMRect;
|
|
17
16
|
}
|
|
18
17
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockElement,
|
|
1
|
+
import { BlockElement, ContainerElement, OnesEditor } from '../../../@ones-editor/core';
|
|
2
2
|
import DropIndicator from './drop-indicator';
|
|
3
3
|
export interface DropHandler {
|
|
4
4
|
handleDrop: (editor: OnesEditor, dragData: BlockElement | File[], targetContainer: ContainerElement, blockIndex: number) => boolean | undefined;
|
|
@@ -12,7 +12,6 @@ export default class OnesEditorDropTarget {
|
|
|
12
12
|
dropEffect: 'move' | 'none';
|
|
13
13
|
} | undefined;
|
|
14
14
|
handlers: DropHandler[];
|
|
15
|
-
combineToCreate: CombineToCreateOptions[];
|
|
16
15
|
constructor(editor: OnesEditor);
|
|
17
16
|
destroy(): void;
|
|
18
17
|
addHandler(handler: DropHandler): 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;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { INDICATOR_SIZE } from './drop-indicator';
|
|
2
1
|
import OnesEditorDropTarget from './drop-target';
|
|
3
2
|
import type { DropHandler } from './drop-target';
|
|
4
3
|
import { patchInsertFile } from './handlers/patch-insert-file';
|
|
5
4
|
export * from './drag-object';
|
|
6
|
-
export { OnesEditorDropTarget, DropHandler, patchInsertFile
|
|
5
|
+
export { OnesEditorDropTarget, DropHandler, patchInsertFile };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../@ones-editor/core';
|
|
2
2
|
import './locale';
|
|
3
3
|
export declare function handleFindReplace(editor: OnesEditor): boolean;
|
|
4
|
+
declare function handleReplaceAndFind(editor: OnesEditor): boolean;
|
|
4
5
|
declare const FindReplaceShortcuts: {
|
|
5
6
|
'CtrlOrCmd+F': typeof handleFindReplace;
|
|
7
|
+
'CtrlOrCmd+Shift+H': typeof handleReplaceAndFind;
|
|
6
8
|
};
|
|
7
9
|
export { FindReplaceShortcuts, };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { BlockElement
|
|
1
|
+
import { BlockElement } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare function isTitleBlock(block: BlockElement): boolean;
|
|
3
|
-
export declare function canShowCollapseButtons(editor: OnesEditor, hoverBlock: BlockElement | null): boolean;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { BlockElement, DragObject, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import { ImageDragInsertPos } from './types';
|
|
3
|
-
export declare function getDragInsertPos(editor: OnesEditor, block: BlockElement, images: HTMLElement[], x: number, y?: number):
|
|
3
|
+
export declare function getDragInsertPos(editor: OnesEditor, block: BlockElement, images: HTMLElement[], x: number, y?: number): {
|
|
4
|
+
rect: DOMRect;
|
|
5
|
+
data: number;
|
|
6
|
+
};
|
|
4
7
|
export declare function handleDropOver(editor: OnesEditor, block: BlockElement, dragObject: DragObject | DataTransferItemList | null, x: number, y: number): ImageDragInsertPos | undefined;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { BlockElement, DragObject, DropInsertPos, DropOptions, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
export declare function deleteImageFromBlock(editor: OnesEditor, block: BlockElement, index: number): void;
|
|
3
2
|
export declare function handleDrop(editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertPos, options: DropOptions): boolean | undefined;
|
|
@@ -10,9 +10,6 @@ export declare class ImageObject implements ImageObjectBase {
|
|
|
10
10
|
private resizing;
|
|
11
11
|
private parentContainerResizerObserver;
|
|
12
12
|
private autoFix;
|
|
13
|
-
focusTimes: number;
|
|
14
|
-
mouseStartX: number;
|
|
15
|
-
mouseStartY: number;
|
|
16
13
|
constructor(editor: OnesEditor, blockData: DocEmbedBlock);
|
|
17
14
|
destroy(): void;
|
|
18
15
|
setAutoFix(autoFix: boolean): void;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { Embed } from '../../../@ones-editor/core';
|
|
2
|
-
import { toImageEmbedData } from './image-data';
|
|
3
2
|
import { ImageObject } from './image-object';
|
|
4
3
|
import './image-embed-style.scss';
|
|
5
|
-
import { deleteImageFromBlock } from './drag-drop/handle-drop';
|
|
6
4
|
import './locale';
|
|
7
5
|
import { getImageContainersByBlock } from './image-dom/helper';
|
|
8
6
|
import EmptyImageConverterInputHandler from './empty-image-converter';
|
|
9
7
|
import { ImagePasteHandler } from './paste-handler';
|
|
10
|
-
import type { ImageDragObject } from './drag-drop/types';
|
|
11
|
-
import { updateImageBlockSize } from './image-size';
|
|
12
8
|
export * from './shortcuts';
|
|
13
9
|
export * from './types';
|
|
14
|
-
export { ImageObject, ImagePasteHandler, getImageContainersByBlock
|
|
10
|
+
export { ImageObject, ImagePasteHandler, getImageContainersByBlock };
|
|
15
11
|
declare const ImageEmbed: Embed;
|
|
16
12
|
export { ImageEmbed, EmptyImageConverterInputHandler };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DocBlock, DocObject } from '../../../../@ones-editor/core';
|
|
2
2
|
import { CalcCell } from './table';
|
|
3
|
-
import { CalcCol } from './layout';
|
|
4
3
|
import { BlockObject, CodeObject, ExportState, GetDocByBlockFunc, GetTextsByBoxFunc, MD5Func } from './types';
|
|
5
4
|
/**
|
|
6
5
|
* 生成docx/html blocks的接口
|
|
@@ -21,7 +20,6 @@ export interface BlocksGenerator {
|
|
|
21
20
|
addTableMatrix(colsWidth: number[], matrix: CalcCell[][], data: DocObject): Promise<void>;
|
|
22
21
|
addVirtualBlock(blockId: string, data: DocObject, maxWidth: number): Promise<void>;
|
|
23
22
|
addEmptyParagraph(): void;
|
|
24
|
-
addLayoutMatrix(colsWidth: number[], matrix: CalcCol[], data: DocObject): Promise<void>;
|
|
25
23
|
}
|
|
26
24
|
export declare function convertBlocksOfDoc(parent: string, // 父节点,暂时只有list block需要这个
|
|
27
25
|
blocks: DocBlock[], data: DocObject, // 协作笔记里的block数组
|