fix: upload blobs (#3676)
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 132 KiB |
After Width: | Height: | Size: 280 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 330 KiB |
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 723 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 224 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 971 KiB |
@ -1,5 +1,24 @@
|
|||||||
import type { BlobStorage } from '@blocksuite/store';
|
import type { BlobStorage } from '@blocksuite/store';
|
||||||
|
|
||||||
|
const predefinedStaticFiles = [
|
||||||
|
'v2yF7lY2L5rtorTtTmYFsoMb9dBPKs5M1y9cUKxcI1M=',
|
||||||
|
'nSEEkYxrThpZfLoPNOzMp6HWekvutAIYmADElDe1J6I=',
|
||||||
|
'CBWoKrhSDndjBJzscQKENRqiXOOZnzIA5qyiCoy4-A0=',
|
||||||
|
'uvpOG9DrldeqIGNaqfwjFdMw_CcfXKfiEjYf7RXdeL0=',
|
||||||
|
'D7g-4LMqOsVWBNOD-_kGgCOvJEoc8rcpYbkfDlF2u5U=',
|
||||||
|
'4HXJrnBZGaGPFpowNawNog0aMg3dgoVaAnNqEMeUxq0=',
|
||||||
|
'rY96Bunn-69CnNe5X_e5CJLwgCJnN6rcbUisecs8kkQ=',
|
||||||
|
'fb0SNPtMpQlzBQ90_PB7vCu34WpiSUJbNKocFkL2vIo=',
|
||||||
|
'k07JiWnb-S7qgd9gDQNgqo-LYMe03RX8fR0TXQ-SpG4=',
|
||||||
|
'i39ZQ24NlUfWI0MhkbtvHTzGnWMVdr-aC2aOjvHPVg4=',
|
||||||
|
'0hjYqQd8SvwHT2gPds7qFw8W6qIEGVbZvG45uzoYjUU=',
|
||||||
|
'qezoK6du9n3PF4dl4aq5r7LeXz_sV3xOVpFzVVgjNsE=',
|
||||||
|
'sNVNYDBzUDN2J9OFVJdLJlryBLzRZBLl-4MTNoPF1tA=',
|
||||||
|
'Bd5F0WRI0fLh8RK1al9PawPVT3jv7VwBrqiiBEtdV-g=',
|
||||||
|
'029uztLz2CzJezK7UUhrbGiWUdZ0J7NVs_qR6RDsvb8=',
|
||||||
|
'5Cfem_137WmzR35ZeIC76oTkq5SQt-eHlZwJiLy0hgU=',
|
||||||
|
];
|
||||||
|
|
||||||
export const createStaticStorage = (): BlobStorage => {
|
export const createStaticStorage = (): BlobStorage => {
|
||||||
return {
|
return {
|
||||||
crud: {
|
crud: {
|
||||||
@ -7,6 +26,9 @@ export const createStaticStorage = (): BlobStorage => {
|
|||||||
if (key.startsWith('/static/')) {
|
if (key.startsWith('/static/')) {
|
||||||
const response = await fetch(key);
|
const response = await fetch(key);
|
||||||
return response.blob();
|
return response.blob();
|
||||||
|
} else if (predefinedStaticFiles.includes(key)) {
|
||||||
|
const response = await fetch(`/static/${key}.png`);
|
||||||
|
return response.blob();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|