mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-23 14:57:25 +00:00
feat: Advanced file editor and file tree improvements (#444)
# Features - File drag and drop upload: Support uploading files and folders via drag and drop - Binary file handling: Detect binary files and display a friendly message instead of trying to edit them - Folder download: Download folders as ZIP files (using JSZip library) - Context menu integration: Full right-click context menu for file operations (rename, delete, copy path, download, new file/folder)
This commit is contained in:
22
src/components/code-editor/utils/binaryFile.ts
Normal file
22
src/components/code-editor/utils/binaryFile.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
// Binary file extensions (images are handled by ImageViewer, not here)
|
||||
const BINARY_EXTENSIONS = [
|
||||
// Archives
|
||||
'zip', 'tar', 'gz', 'rar', '7z', 'bz2', 'xz',
|
||||
// Executables
|
||||
'exe', 'dll', 'so', 'dylib', 'app', 'dmg', 'msi',
|
||||
// Media
|
||||
'mp3', 'mp4', 'wav', 'avi', 'mov', 'mkv', 'flv', 'wmv', 'm4a', 'ogg',
|
||||
// Documents
|
||||
'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'odt', 'ods', 'odp',
|
||||
// Fonts
|
||||
'ttf', 'otf', 'woff', 'woff2', 'eot',
|
||||
// Database
|
||||
'db', 'sqlite', 'sqlite3',
|
||||
// Other binary
|
||||
'bin', 'dat', 'iso', 'img', 'class', 'jar', 'war', 'pyc', 'pyo'
|
||||
];
|
||||
|
||||
export const isBinaryFile = (filename: string): boolean => {
|
||||
const ext = filename.split('.').pop()?.toLowerCase();
|
||||
return BINARY_EXTENSIONS.includes(ext ?? '');
|
||||
};
|
||||
Reference in New Issue
Block a user