From e1441d5308b668f3c6e73b43a51e1a4176ce63f4 Mon Sep 17 00:00:00 2001 From: Erik Pasternak Date: Tue, 10 Jun 2025 11:09:12 -0700 Subject: [PATCH] Remove isCuttable api --- core/block_svg.ts | 5 ----- core/comments/rendered_workspace_comment.ts | 5 ----- core/interfaces/i_copyable.ts | 7 ------- core/shortcut_items.ts | 12 +++--------- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/core/block_svg.ts b/core/block_svg.ts index 501be1b59..a30cc34ed 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -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(); diff --git a/core/comments/rendered_workspace_comment.ts b/core/comments/rendered_workspace_comment.ts index 569905518..42fb1fda4 100644 --- a/core/comments/rendered_workspace_comment.ts +++ b/core/comments/rendered_workspace_comment.ts @@ -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(); diff --git a/core/interfaces/i_copyable.ts b/core/interfaces/i_copyable.ts index 4f5e4ab9a..246dd4dd5 100644 --- a/core/interfaces/i_copyable.ts +++ b/core/interfaces/i_copyable.ts @@ -22,13 +22,6 @@ export interface ICopyable 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 { diff --git a/core/shortcut_items.ts b/core/shortcut_items.ts index 8d67321d7..302308fd6 100644 --- a/core/shortcut_items.ts +++ b/core/shortcut_items.ts @@ -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(); } /**