@ones-editor/editor 2.0.7-beta.4 → 2.0.7-beta.6
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.
|
@@ -94,7 +94,7 @@ export interface Embed {
|
|
|
94
94
|
handleDeleteBlock?: (editor: OnesEditor, block: BlockElement, local: boolean, options: DeleteBlockEventOptions) => void;
|
|
95
95
|
handleUpdateBlock?: (editor: OnesEditor, block: BlockElement, blockData: DocEmbedBlock) => boolean;
|
|
96
96
|
handleDropOver?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | DataTransferItemList | null, x: number, y: number) => DropInsertPos | undefined;
|
|
97
|
-
handleDrop?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos:
|
|
97
|
+
handleDrop?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertResolvedPos, options: DropOptions) => boolean | undefined;
|
|
98
98
|
convertFrom?: (editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
99
99
|
offset: number;
|
|
100
100
|
data?: DocBlockAttributes;
|
|
@@ -249,7 +249,8 @@ export type CombineDropInsertPos = {
|
|
|
249
249
|
pos: 'left' | 'right';
|
|
250
250
|
onCombine: CombineToCreateOptions['onCombine'];
|
|
251
251
|
};
|
|
252
|
-
export type DropInsertPos = 'before' | 'after' | CombineDropInsertPos | CustomDropInsertPos;
|
|
252
|
+
export type DropInsertPos = 'before' | 'after' | CombineDropInsertPos | CustomDropInsertPos | 'before-container' | 'after-container';
|
|
253
|
+
export type DropInsertResolvedPos = Exclude<DropInsertPos, 'before-container' | 'after-container'>;
|
|
253
254
|
export interface DropOptions {
|
|
254
255
|
isSourceBlock: boolean;
|
|
255
256
|
targetBlock: BlockElement;
|
|
@@ -272,7 +273,7 @@ export interface Block {
|
|
|
272
273
|
handleDeleteBlock?: (editor: OnesEditor, block: BlockElement, local: boolean, options: DeleteBlockEventOptions) => void;
|
|
273
274
|
handleUpdateBlock?: (editor: OnesEditor, block: BlockElement, blockData: DocBlock, delta?: DocBlockDelta) => boolean;
|
|
274
275
|
handleDropOver?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | DataTransferItemList | null, x: number, y: number) => DropInsertPos | false | undefined;
|
|
275
|
-
handleDrop?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos:
|
|
276
|
+
handleDrop?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertResolvedPos, options: DropOptions) => boolean | ContainerElement | undefined;
|
|
276
277
|
getClientRects?: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => DOMRect[];
|
|
277
278
|
getMinWidth?: (editor: OnesEditor, block: BlockElement) => number | undefined;
|
|
278
279
|
convertFrom?: (editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BlockContentElement, BlockElement,
|
|
1
|
+
import { BlockContentElement, BlockElement, DropInsertResolvedPos, OnesEditor } from '../../../@ones-editor/core';
|
|
2
2
|
export declare const INDICATOR_SIZE = 2;
|
|
3
3
|
interface DropTarget {
|
|
4
4
|
block: BlockElement;
|
|
5
|
-
insertPos:
|
|
5
|
+
insertPos: DropInsertResolvedPos;
|
|
6
6
|
}
|
|
7
7
|
export default class DropIndicator {
|
|
8
8
|
private editor;
|
|
@@ -10,7 +10,7 @@ export default class DropIndicator {
|
|
|
10
10
|
target: DropTarget | null;
|
|
11
11
|
constructor(editor: OnesEditor);
|
|
12
12
|
createIndicator(): void;
|
|
13
|
-
show(block: BlockElement, insertPos:
|
|
13
|
+
show(block: BlockElement, insertPos: DropInsertResolvedPos): void;
|
|
14
14
|
hide(): void;
|
|
15
15
|
private getIndicatorRect;
|
|
16
16
|
getViewRect(block: BlockElement | BlockContentElement): DOMRect;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BlockElement, DragObject,
|
|
1
|
+
import { BlockElement, DragObject, DropInsertResolvedPos, DropOptions, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare function deleteImageFromBlock(editor: OnesEditor, block: BlockElement, index: number): void;
|
|
3
|
-
export declare function handleDrop(editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos:
|
|
3
|
+
export declare function handleDrop(editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertResolvedPos, options: DropOptions): boolean | undefined;
|