feat: improve ArtCraft integration and configurable file opening

This commit is contained in:
SantaSpeen committed 2026-11-02 00:37:44 +03:00
1 parent 3bc62d2b69
commit 80bc2c458d
60 files changed
+1738 -232

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@
const message = event.data, job = jobs.get(message.requestId); if (!job) return;
jobs.delete(message.requestId);
if (!Array.isArray(message.files)) { job.reject(new DOMException("Selection cancelled", "AbortError")); return; }
const files = message.files.filter(f => typeof f.name === "string" && f.bytes instanceof ArrayBuffer && f.bytes.byteLength <= 64 * 1024 * 1024)
const files = message.files.filter(f => typeof f.name === "string" && f.bytes instanceof ArrayBuffer && f.bytes.byteLength <= 256 * 1024 * 1024)
.map(f => new File([f.bytes], f.name, { type: typeof f.mime === "string" ? f.mime : "" }));
if (!files.length) job.reject(new DOMException("No file selected", "AbortError")); else job.resolve(files);
});