Prevent shape.remove

You could do it via rules, for example described in this thread. The ContextPadProvider is using such logic.

This CodeSandbox might be a good starting point.