Clipboard
Cut, copy, and paste as pipeline intents.
Clipboard handling lives in the substrate and the clipboard module of @spine-editor/dom. Cut, copy, and paste all translate into intents dispatched through the engine.
Copy
writeSelectionToClipboard(...) reads the current selection, serializes the selected fragment to the clipboard, and returns control to the substrate. Copying does not mutate the document.
Cut
Cut is copy followed by a delete intent. The substrate groups them so a single keystroke produces one undo entry.
Paste
The substrate intercepts paste events, reads the available clipboard formats,
and dispatches a PasteIntent whose payload is either text ({ kind: "text" })
or a semantic fragment ({ kind: "fragment" }). The paste planner takes it from
there — see paste.
Internal vs external clipboard
When copying from SpineEditor, a structured fragment representation is written alongside HTML/plain text. On paste, the runtime prefers the structured payload when it is present and falls back to parsed external formats otherwise. Exact MIME types and parsing support live in packages/dom/src/clipboard/.