MCPcopy Index your code
hub / github.com/resend/react-email / handlePaste

Function handlePaste

packages/editor/src/plugins/image/file-handler.ts:13–23  ·  view source on GitHub ↗
(_view, event)

Source from the content-addressed store, hash-verified

11 key: new PluginKey('imageFileHandler'),
12 props: {
13 handlePaste(_view, event) {
14 const file = event.clipboardData?.files?.[0];
15 if (!file?.type.includes('image/')) {
16 return false;
17 }
18
19 event.preventDefault();
20 void executeUploadFlow({ editor, file, uploadImage });
21
22 return true;
23 },
24 handleDrop(_view, event, _slice, moved) {
25 if (moved || !event.dataTransfer?.files?.[0]) {
26 return false;

Callers

nothing calls this directly

Calls 1

executeUploadFlowFunction · 0.90

Tested by

no test coverage detected