@yoopta/editor
Version:
<h2 align="center">Yoopta-Editor v1 🎉</h2> <p align="center">Yoopta-Editor - is an open source notion-like editor 💥</p> <div align="center"> <img width="574" alt="Screen Shot 2023-01-25 at 16 04 29" src="https://user-images.githubusercontent.com/2909311
49 lines • 1.35 kB
TypeScript
import type { YooEditor, YooptaPathIndex } from '../types';
export type MergeBlockOptions = {
/**
* Source block to merge (the one that will be merged into target)
* @default editor.path.current
*/
at?: YooptaPathIndex;
blockId?: string;
/**
* Target block to merge into (the one that will receive content)
* If not provided, uses previous block
* @default previous block
*/
targetAt?: YooptaPathIndex;
targetBlockId?: string;
/**
* Focus after merge
* @default true
*/
focus?: boolean;
/**
* Preserve content from source block
* @default true
*/
preserveContent?: boolean;
};
/**
* Merge a block into another block
*
* @param editor - YooEditor instance
* @param options - Merge options
*
* @example
* ```typescript
* // Merge current block into previous (default behavior)
* editor.mergeBlock();
*
* // Merge specific block into previous
* editor.mergeBlock({ at: 5 });
*
* // Merge block at index 5 into block at index 3
* editor.mergeBlock({ at: 5, targetAt: 3 });
*
* // Merge without focusing
* editor.mergeBlock({ focus: false });
* ```
*/
export declare function mergeBlock(editor: YooEditor, options?: MergeBlockOptions): void;
//# sourceMappingURL=mergeBlock.d.ts.map