Remove isCuttable api

This commit is contained in:
Erik Pasternak
2025-06-10 11:09:12 -07:00
parent 46078369c2
commit e1441d5308
4 changed files with 3 additions and 26 deletions

View File

@@ -1726,11 +1726,6 @@ export class BlockSvg
return this.isOwnDeletable() && this.isOwnMovable();
}
/** Returns whether this block is cuttable or not. */
isCuttable(): boolean {
return this.isDeletable() && this.isMovable();
}
/** Returns whether this block is movable or not. */
override isMovable(): boolean {
return this.dragStrategy.isMovable();

View File

@@ -249,11 +249,6 @@ export class RenderedWorkspaceComment
return this.isOwnMovable() && this.isOwnDeletable();
}
/** Returns whether this comment is cuttable or not */
isCuttable(): boolean {
return this.isMovable() && this.isDeletable();
}
/** Returns whether this comment is movable or not. */
isMovable(): boolean {
return this.dragStrategy.isMovable();

View File

@@ -22,13 +22,6 @@ export interface ICopyable<T extends ICopyData> extends ISelectable {
* @returns True if it can currently be copied.
*/
isCopyable?(): boolean;
/**
* Whether this instance is currently cuttable.
*
* @returns True if it can currently be cut.
*/
isCuttable?(): boolean;
}
export namespace ICopyable {

View File

@@ -125,19 +125,13 @@ function isCopyable(focused: IFocusableNode): boolean {
/**
* Determine if a focusable node can be cut.
*
* This will use the isCuttable method if the node implements it, otherwise
* it will fall back to checking if the node can be moved and deleted in its
* current workspace.
* This will check if the node can be both copied and deleted in its current
* workspace.
*
* @param focused The focused object.
*/
function isCuttable(focused: IFocusableNode): boolean {
if (!isICopyable(focused) || !isIDeletable(focused) || !isDraggable(focused))
return false;
if (focused.isCuttable !== undefined) {
return focused.isCuttable();
}
return focused.isMovable() && focused.isDeletable();
return isCopyable(focused) && isIDeletable(focused) && focused.isDeletable();
}
/**