@sequent-org/moodboard 1.4.13 → 1.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -102,6 +102,21 @@ export class KeyboardClipboardImagePaste {
|
|
|
102
102
|
}
|
|
103
103
|
if (handled) return;
|
|
104
104
|
|
|
105
|
+
// Windows/desktop clipboard providers may expose pasted files as items
|
|
106
|
+
// with generic type like "Files" and empty clipboardData.files.
|
|
107
|
+
for (const item of items) {
|
|
108
|
+
if (!item || typeof item.getAsFile !== 'function') continue;
|
|
109
|
+
const fileFromItem = item.getAsFile();
|
|
110
|
+
if (!fileFromItem) continue;
|
|
111
|
+
e.preventDefault();
|
|
112
|
+
if (fileFromItem.type && fileFromItem.type.startsWith('image/')) {
|
|
113
|
+
await this.handleImageFileUpload(fileFromItem, fileFromItem.name || 'clipboard-image.png');
|
|
114
|
+
} else {
|
|
115
|
+
await this.handleFileUpload(fileFromItem, fileFromItem.name || 'clipboard-file');
|
|
116
|
+
}
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
105
120
|
const files = cd.files ? Array.from(cd.files) : [];
|
|
106
121
|
const imgFile = files.find(f => f.type && f.type.startsWith('image/'));
|
|
107
122
|
if (imgFile) {
|