react-movable-block-editor
Version:
React component for creating layouts and content via drag-and-drop blocks.
28 lines (27 loc) • 1.38 kB
TypeScript
import { ById, BlockNode } from '../../data';
import { BlockEditorValue } from './BlockEditorProps';
export declare function deepCopy(byId: ById, node: BlockNode): BlockNode;
export declare function paste(value: BlockEditorValue): BlockEditorValue;
export declare function pasteChild(byId: ById, copiedNode: BlockNode): {
byId: ById;
newId: string;
};
export declare function newBlockId(byId: ById, prefix?: string): string;
export declare function create(value: BlockEditorValue, props: Partial<BlockNode>): BlockEditorValue;
export declare function update(value: BlockEditorValue, nodeId: string, propsToUpdate: Partial<BlockNode>): BlockEditorValue;
export declare function destroy(value: BlockEditorValue, nodeId: string): BlockEditorValue;
export declare function move(value: BlockEditorValue, nodeId: string, targetParentId: string, opts?: {
beforeItemId?: string;
afterItemId?: string;
isPlaceHolder?: boolean;
absolutePos?: {
left: number;
top: number;
};
}): BlockEditorValue;
export declare function moveInDirection(value: BlockEditorValue, nodeId: string, moveOpts?: {
direction?: 'left' | 'right' | 'down' | 'up';
distance?: number;
stepPx?: number;
}): BlockEditorValue;
export declare function focusNode(value: BlockEditorValue, node: BlockNode, focus?: boolean): BlockEditorValue;