View as Markdown

API reference: @salmonui/rich-text

moveBlockfunction

import { moveBlock } from '@salmonui/rich-text';
function moveBlock(blocks: readonly Block[], id: string, position: BlockPosition): Block[];

Moves a block (with its children) before or after another block, or into another block's children. Moving a block into itself or its own subtree, or relative to a missing block, returns the input unchanged.