This can be done by removing the DELETE_AREA capability from the toolbox:
// Create workspae in the usual way:
const workspace = Blockly.inject(/* omitted */);
// Get Toolbox instance, remove DELETE_AREA capability:
const toolbox = workspace.getToolbox();
workspace.getComponentManager().removeCapability(
Blockly.ComponentManager.Capability.DELETE_AREA
);
This will prevent blocks from being deleted by dragging them to the toolbox.
Christopher