feat(wysiwyg): implement backspace

This commit is contained in:
Juergen Kunz
2025-06-24 15:52:28 +00:00
parent 83f153f654
commit ca525ce7e3
7 changed files with 563 additions and 108 deletions

View File

@ -59,6 +59,9 @@ export class WysiwygBlockOperations {
* Removes a block by its ID
*/
removeBlock(blockId: string): void {
// Save checkpoint before deletion
this.component.saveToHistory(false);
this.component.blocks = this.component.blocks.filter((b: IBlock) => b.id !== blockId);
// Remove the block element programmatically if we have the editor
@ -120,6 +123,9 @@ export class WysiwygBlockOperations {
transformBlock(blockId: string, newType: IBlock['type'], metadata?: any): void {
const block = this.findBlock(blockId);
if (block) {
// Save checkpoint before transformation
this.component.saveToHistory(false);
block.type = newType;
block.content = '';
if (metadata) {