feat(BlockEditor): add rich paste support with html-to-blocks parsing

- add clipboard.js with htmlToBlocks, blocksToHtml, and blocksToPlainText helpers
- handle single-paragraph html paste as inline splice preserving block type
- handle multi-block html paste by splitting current block and merging head/tail paragraphs
- add onPasteInline and onPasteBlocks props to Block component
- implement handlePasteInline and handlePasteBlocks in BlockEditor
- fallback to plain text insertion when html is absent or yields no blocks
- update README to document clipboard behaviour and new paste handlers
This commit is contained in:
2026-04-25 20:19:32 -04:00
parent 547b975c01
commit 085a779c74
6 changed files with 540 additions and 11 deletions
@@ -37,3 +37,4 @@ export {
normalize as normalizeInline,
} from './inline/types.js';
export { inlineToDom, domToInline } from './inline/serialize.js';
export { blocksToHtml, blocksToPlainText, htmlToBlocks } from './inline/clipboard.js';