From 52eb08d032b59fa45ad3deda73f2340ba511c8d8 Mon Sep 17 00:00:00 2001 From: matthewlipski Date: Thu, 7 Nov 2024 14:06:56 +0100 Subject: [PATCH 1/2] Made reading files lower priority than reading text when inserting from clipboard --- .../core/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts b/packages/core/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts index b5b3fbe54..eabefb3c4 100644 --- a/packages/core/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts +++ b/packages/core/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts @@ -1,7 +1,7 @@ export const acceptedMIMETypes = [ "vscode-editor-data", "blocknote/html", - "Files", "text/html", "text/plain", + "Files", ] as const; From 8ca873331bc455ed3ce6efccbfcba394f5a6f1b4 Mon Sep 17 00:00:00 2001 From: matthewlipski Date: Wed, 13 Nov 2024 18:01:04 +0100 Subject: [PATCH 2/2] Added warning when `uploadFile` is not defined when inserting file --- .../src/api/clipboard/fromClipboard/handleFileInsertion.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/src/api/clipboard/fromClipboard/handleFileInsertion.ts b/packages/core/src/api/clipboard/fromClipboard/handleFileInsertion.ts index 2369dd248..6aa9d8cc8 100644 --- a/packages/core/src/api/clipboard/fromClipboard/handleFileInsertion.ts +++ b/packages/core/src/api/clipboard/fromClipboard/handleFileInsertion.ts @@ -50,6 +50,10 @@ export async function handleFileInsertion< S extends StyleSchema >(event: DragEvent | ClipboardEvent, editor: BlockNoteEditor) { if (!editor.uploadFile) { + // eslint-disable-next-line no-console + console.warn( + "Attempted ot insert file, but uploadFile is not set in the BlockNote editor options" + ); return; }