Interface: IDeleteArea
Defined in: packages/blockly/core/interfaces/i_delete_area.ts:16
Interface for a component that can delete a block or bubble that is dropped on top of it.
Extends
Properties index
| Property | Description |
|---|---|
| id | The unique ID for this component that is used to register with the ComponentManager. |
Methods index
| Method | Description |
|---|---|
| wouldDelete | Returns whether the provided block or bubble would be deleted if dropped on this area. This method should check if the element is deletable and is always called before onDragEnter/onDragOver/onDragExit. |
| getClientRect | Returns the bounding rectangle of the drag target area in pixel units relative to viewport. |
| onDragEnter | Handles when a cursor with a block or bubble enters this drag target. |
| onDragOver | Handles when a cursor with a block or bubble is dragged over this drag target. |
| onDragExit | Handles when a cursor with a block or bubble exits this drag target. |
| onDrop | Handles when a block or bubble is dropped on this component. Should not handle delete here. |
| shouldPreventMove | Returns whether the provided block or bubble should not be moved after being dropped on this component. If true, the element will return to where it was when the drag started. |
Properties
id
id: string;
Defined in: packages/blockly/core/interfaces/i_component.ts:18
The unique ID for this component that is used to register with the ComponentManager.
Inherited from
Methods
wouldDelete()
wouldDelete(element): boolean;
Defined in: packages/blockly/core/interfaces/i_delete_area.ts:27
Returns whether the provided block or bubble would be deleted if dropped on this area. This method should check if the element is deletable and is always called before onDragEnter/onDragOver/onDragExit.
Parameters
| Parameter | Type | Description |
|---|---|---|
element | IDraggable | The block or bubble currently being dragged. |
Returns
boolean
Whether the element provided would be deleted if dropped on this area.
getClientRect()
getClientRect(): Rect | null;
Defined in: packages/blockly/core/interfaces/i_drag_target.ts:25
Returns the bounding rectangle of the drag target area in pixel units relative to viewport.
Returns
Rect | null
The component's bounding box. Null if drag target area should be ignored.
Inherited from
onDragEnter()
onDragEnter(dragElement): void;
Defined in: packages/blockly/core/interfaces/i_drag_target.ts:32
Handles when a cursor with a block or bubble enters this drag target.
Parameters
| Parameter | Type | Description |
|---|---|---|
dragElement | IDraggable | The block or bubble currently being dragged. |
Returns
void
Inherited from
onDragOver()
onDragOver(dragElement): void;
Defined in: packages/blockly/core/interfaces/i_drag_target.ts:40
Handles when a cursor with a block or bubble is dragged over this drag target.
Parameters
| Parameter | Type | Description |
|---|---|---|
dragElement | IDraggable | The block or bubble currently being dragged. |
Returns
void
Inherited from
onDragExit()
onDragExit(dragElement): void;
Defined in: packages/blockly/core/interfaces/i_drag_target.ts:47
Handles when a cursor with a block or bubble exits this drag target.
Parameters
| Parameter | Type | Description |
|---|---|---|
dragElement | IDraggable | The block or bubble currently being dragged. |
Returns
void
Inherited from
onDrop()
onDrop(dragElement): void;
Defined in: packages/blockly/core/interfaces/i_drag_target.ts:55
Handles when a block or bubble is dropped on this component. Should not handle delete here.
Parameters
| Parameter | Type | Description |
|---|---|---|
dragElement | IDraggable | The block or bubble currently being dragged. |
Returns
void
Inherited from
shouldPreventMove()
shouldPreventMove(dragElement): boolean;
Defined in: packages/blockly/core/interfaces/i_drag_target.ts:66
Returns whether the provided block or bubble should not be moved after being dropped on this component. If true, the element will return to where it was when the drag started.
Parameters
| Parameter | Type | Description |
|---|---|---|
dragElement | IDraggable | The block or bubble currently being dragged. |
Returns
boolean
Whether the block or bubble provided should be returned to drag start.