import { toastError } from "../error/toast-error"; import { $authTokenPermissions } from "../nano-states"; const isValidClipboardEvent = (event: ClipboardEvent) => { const selection = document.getSelection(); if (selection?.type === "Range") { return false; } // Note on event.target: // // The spec (https://w3c.github.io/clipboard-apis/#to-fire-a-clipboard-event) // says that if the context is not editable, the target should be the focused node. // // But in practice it seems that the target is based // on where the cursor is, rather than which element has focus. // For example, if a