Ensure the canvas element is actually connected to the DOM before
handling paste events. This prevents LayerForge from capturing paste
events when navigating in subgraphs where the canvas is not visible.
Adds check for canvas.isConnected and document.body.contains() to
verify the canvas is part of the active DOM tree.