Skip to content

Commit e1441d5

Browse files
committed
Remove isCuttable api
1 parent 4607836 commit e1441d5

File tree

4 files changed

+3
-26
lines changed

4 files changed

+3
-26
lines changed

core/block_svg.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,11 +1726,6 @@ export class BlockSvg
17261726
return this.isOwnDeletable() && this.isOwnMovable();
17271727
}
17281728

1729-
/** Returns whether this block is cuttable or not. */
1730-
isCuttable(): boolean {
1731-
return this.isDeletable() && this.isMovable();
1732-
}
1733-
17341729
/** Returns whether this block is movable or not. */
17351730
override isMovable(): boolean {
17361731
return this.dragStrategy.isMovable();

core/comments/rendered_workspace_comment.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,6 @@ export class RenderedWorkspaceComment
249249
return this.isOwnMovable() && this.isOwnDeletable();
250250
}
251251

252-
/** Returns whether this comment is cuttable or not */
253-
isCuttable(): boolean {
254-
return this.isMovable() && this.isDeletable();
255-
}
256-
257252
/** Returns whether this comment is movable or not. */
258253
isMovable(): boolean {
259254
return this.dragStrategy.isMovable();

core/interfaces/i_copyable.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ export interface ICopyable<T extends ICopyData> extends ISelectable {
2222
* @returns True if it can currently be copied.
2323
*/
2424
isCopyable?(): boolean;
25-
26-
/**
27-
* Whether this instance is currently cuttable.
28-
*
29-
* @returns True if it can currently be cut.
30-
*/
31-
isCuttable?(): boolean;
3225
}
3326

3427
export namespace ICopyable {

core/shortcut_items.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,13 @@ function isCopyable(focused: IFocusableNode): boolean {
125125
/**
126126
* Determine if a focusable node can be cut.
127127
*
128-
* This will use the isCuttable method if the node implements it, otherwise
129-
* it will fall back to checking if the node can be moved and deleted in its
130-
* current workspace.
128+
* This will check if the node can be both copied and deleted in its current
129+
* workspace.
131130
*
132131
* @param focused The focused object.
133132
*/
134133
function isCuttable(focused: IFocusableNode): boolean {
135-
if (!isICopyable(focused) || !isIDeletable(focused) || !isDraggable(focused))
136-
return false;
137-
if (focused.isCuttable !== undefined) {
138-
return focused.isCuttable();
139-
}
140-
return focused.isMovable() && focused.isDeletable();
134+
return isCopyable(focused) && isIDeletable(focused) && focused.isDeletable();
141135
}
142136

143137
/**

0 commit comments

Comments
 (0)