fix!: various drag-adjacent interfaces (#7975)

* fix: ISelectable and IDeletable interfaces

* fix: switch everything over to use new draggable interface

* fix: exports
This commit is contained in:
Beka Westberg
2024-03-29 21:00:56 +00:00
committed by GitHub
parent 59f589c32a
commit abfbbbc299
14 changed files with 78 additions and 39 deletions

View File

@@ -15,7 +15,8 @@
import {BlockSvg} from './block_svg.js';
import {DragTarget} from './drag_target.js';
import type {IDeleteArea} from './interfaces/i_delete_area.js';
import type {IDraggable} from './interfaces/i_draggable.old.js';
import type {IDraggable} from './interfaces/i_draggable.js';
import {isDeletable} from './interfaces/i_deletable.js';
/**
* Abstract class for a component that can delete a block or bubble that is
@@ -60,7 +61,7 @@ export class DeleteArea extends DragTarget implements IDeleteArea {
const couldDeleteBlock = !block.getParent() && block.isDeletable();
this.updateWouldDelete_(couldDeleteBlock);
} else {
this.updateWouldDelete_(element.isDeletable());
this.updateWouldDelete_(isDeletable(element) && element.isDeletable());
}
return this.wouldDelete_;
}