feat(wysiwyg): implement backspace
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user