File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ export const EDITABLE_FILE_EXTENSION_MAP: Record<string, string | null> = {
1818export const FILE_EXTENSION_MIMETYPE_MAP : Record <
1919 | keyof typeof EDITABLE_FILE_EXTENSION_MAP
2020 | ( typeof AUDIO_FILE_EXTENSIONS ) [ number ]
21- | ( typeof IMAGE_FILE_EXTENSIONS ) [ number ] ,
21+ | ( typeof IMAGE_FILE_EXTENSIONS ) [ number ]
22+ | ( typeof FONT_FILE_EXTENSIONS ) [ number ] ,
2223 string
2324> = {
2425 html : "text/html" ,
@@ -45,6 +46,11 @@ export const FILE_EXTENSION_MIMETYPE_MAP: Record<
4546 opus : "audio/opus" ,
4647 mid : "audio/midi" ,
4748 midi : "audio/midi" ,
49+ woff : "font/woff" ,
50+ woff2 : "font/woff2" ,
51+ ttf : "font/ttf" ,
52+ otf : "font/otf" ,
53+ eot : "application/vnd.ms-fontobject" ,
4854} ;
4955
5056export const EDITABLE_FILE_EXTENSIONS = Object . keys (
@@ -69,10 +75,19 @@ export const IMAGE_FILE_EXTENSIONS = [
6975 "ico" ,
7076] ;
7177
78+ export const FONT_FILE_EXTENSIONS = [
79+ "woff" ,
80+ "woff2" ,
81+ "ttf" ,
82+ "otf" ,
83+ "eot" ,
84+ ] ;
85+
7286export const ALLOWED_FILE_EXTENSIONS = [
7387 ...EDITABLE_FILE_EXTENSIONS ,
7488 ...AUDIO_FILE_EXTENSIONS ,
7589 ...IMAGE_FILE_EXTENSIONS ,
90+ ...FONT_FILE_EXTENSIONS ,
7691] ;
7792
7893export const DEFAULT_INDEX_HTML = `<!DOCTYPE html>
You can’t perform that action at this time.
0 commit comments