Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/modules/IDE/components/Editor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ class Editor extends React.Component {
mode = 'x-shader/x-fragment';
} else if (fileName.match(/.+\.(vert|stl)$/i)) {
mode = 'x-shader/x-vertex';
} else if (fileName.match(/.+\.mtl$/i)) {
mode = 'x-shader/x-vertex'; // or any other mode that you want to use for .mtl files
} else {
mode = 'text/plain';
}
Expand Down
23,680 changes: 14,197 additions & 9,483 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"babel-plugin-transform-react-remove-prop-types": "^0.2.12",
"css-loader": "^5.2.7",
"css-minimizer-webpack-plugin": "^3.4.1",
"eslint": "^7.31.0",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-import": "^2.23.4",
Expand Down
9 changes: 5 additions & 4 deletions server/utils/fileUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export const fileExtensionsArray = [
'frag',
'bin',
'xml',
'stl'
'stl',
'mtl'
];

export const mimeTypes = `image/*,audio/*,text/javascript,text/html,text/css,
Expand All @@ -66,10 +67,10 @@ export const MEDIA_FILE_QUOTED_REGEX = new RegExp(

export const STRING_REGEX = /(['"])((\\\1|.)*?)\1/gm;
// these are files that have to be linked to with a blob url
export const PLAINTEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag|tsv|xml|stl)$/i;
export const PLAINTEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag|tsv|xml|stl|mtl)$/i;
// these are files that users would want to edit as text (maybe svg should be here?)
export const TEXT_FILE_REGEX = /.+\.(json|txt|csv|tsv|vert|frag|js|css|html|htm|jsx|xml|stl)$/i;
export const TEXT_FILE_REGEX = /.+\.(json|txt|csv|tsv|vert|frag|js|css|html|htm|jsx|xml|stl|mtl)$/i;
export const NOT_EXTERNAL_LINK_REGEX = /^(?!(http:\/\/|https:\/\/))/;
export const EXTERNAL_LINK_REGEX = /^(http:\/\/|https:\/\/)/;

export const CREATE_FILE_REGEX = /.+\.(json|txt|csv|tsv|js|css|frag|vert|xml|html|htm|stl)$/i;
export const CREATE_FILE_REGEX = /.+\.(json|txt|csv|tsv|js|css|frag|vert|xml|html|htm|stl|mtl)$/i;
2 changes: 1 addition & 1 deletion translations/locales/be/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
"Title": "ফাইল তৈরি করুন",
"CloseButtonARIA": "নতুন ফাইল মোডাল বন্ধ করুন",
"EnterName": "নাম লিখুন",
"InvalidType": "অবৈধ ফাইল ধরন। বৈধ এক্সটেনশনগুলি হলো .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .frag এবং .vert."
"InvalidType": "অবৈধ ফাইল ধরন। বৈধ এক্সটেনশনগুলি হলো .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .mtl, .frag এবং .vert."
},
"NewFileForm": {
"AddFileSubmit": "ফাইল যোগ করুন",
Expand Down
2 changes: 1 addition & 1 deletion translations/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
"Title": "Create File",
"CloseButtonARIA": "Close New File Modal",
"EnterName": "Please enter a name",
"InvalidType": "Invalid file type. Valid extensions are .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .frag, and .vert."
"InvalidType": "Invalid file type. Valid extensions are .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .mtl, .frag, and .vert."
},
"NewFileForm": {
"AddFileSubmit": "Add File",
Expand Down
2 changes: 1 addition & 1 deletion translations/locales/es-419/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
"Title": "Crear Archivo",
"CloseButtonARIA": "Cerrar diálogo de crear archivo",
"EnterName": "Por favor introduce un nombre",
"InvalidType": "Tipo de archivo inválido. Las extensiones válidas son .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .frag y .vert."
"InvalidType": "Tipo de archivo inválido. Las extensiones válidas son .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .mtl, .frag y .vert."
},
"NewFileForm": {
"AddFileSubmit": "Agregar Archivo",
Expand Down
2 changes: 1 addition & 1 deletion translations/locales/hi/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
"Title": "फ़ाइल बनाएँ",
"CloseButtonARIA": "नई फ़ाइल मोडल बंद करें",
"EnterName": "कृपया एक नाम दर्ज करें",
"InvalidType": "अमान्य फ़ाइल प्रकार। मान्य एक्सटेंशन हैं .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .frag, और .vert."
"InvalidType": "अमान्य फ़ाइल प्रकार। मान्य एक्सटेंशन हैं .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .mtl, .frag, और .vert."
},
"NewFileForm": {
"AddFileSubmit": "फाइल जोडें",
Expand Down
2 changes: 1 addition & 1 deletion translations/locales/ja/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
"Title": "ファイル作成",
"CloseButtonARIA": "新規ファイルモーダルを閉じる",
"EnterName": "ファイル名を入力してください",
"InvalidType": "ファイルタイプが無効です。有効な拡張子は、.js、.css、.json、.xml、.stl、.txt、.csv、.tsv、.frag、.vertです。"
"InvalidType": "ファイルタイプが無効です。有効な拡張子は、.js、.css、.json、.xml、.stl、.txt、.csv、.tsv、.mtl、.frag、.vertです。"
},
"NewFileForm": {
"AddFileSubmit": "ファイルを追加",
Expand Down