Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
55e6811
Started with issue #92 - Add TypeScript Support
Maxi10022 Nov 11, 2025
28e29a7
Updated ClipboardContext.tsx
Maxi10022 Nov 11, 2025
a0253a4
Removed PropTypes package
Maxi10022 Nov 11, 2025
ccc7e21
Updated createFolderTree.ts
Maxi10022 Nov 11, 2025
877629e
Updated remaining utility functions
Maxi10022 Nov 11, 2025
1594381
Updated TranslationProvider.tsx context
Maxi10022 Nov 12, 2025
604d434
Updated FileNavigationContxt.tsx
Maxi10022 Nov 12, 2025
a47b0e8
Updated context implementations
Maxi10022 Nov 12, 2025
634c6d7
Updated FileManagerFunctions.ts
Maxi10022 Nov 12, 2025
a4ae610
Updated hooks
Maxi10022 Nov 12, 2025
b121254
Exported TriggerAction to its own file
Maxi10022 Nov 12, 2025
c997573
Updated tsconfig.json
Maxi10022 Nov 12, 2025
d1ba96e
Addendum to useTriggerAction.ts
Maxi10022 Nov 12, 2025
a93f907
Updated components
Maxi10022 Nov 12, 2025
829c59c
Updated api client implementation
Maxi10022 Nov 12, 2025
4b85072
Updated ContextMenu.tsx component
Maxi10022 Nov 12, 2025
67fa53d
Updated Checkbox.tsx component
Maxi10022 Nov 12, 2025
792bf28
Updated ClipboardContext.tsx
Maxi10022 Nov 12, 2025
3edcba8
Updated File.ts type
Maxi10022 Nov 12, 2025
a4eff6a
Added vite-env.d.ts
Maxi10022 Nov 12, 2025
8b71fab
Fixed getAllFilesAPI.ts
Maxi10022 Nov 12, 2025
7d5d755
Minor type changes to utility methods
Maxi10022 Nov 12, 2025
660372f
Updated types
Maxi10022 Nov 12, 2025
871673b
Converted all content int Actions folder to proper TS
Maxi10022 Nov 12, 2025
ccbf304
Converted FileManager components to TS
Maxi10022 Nov 12, 2025
84bb277
Updated FilesContext.ts and FileNavigationContext.tsx
Maxi10022 Nov 12, 2025
784f6f3
Fixed imports
Maxi10022 Nov 12, 2025
e89c904
Converted App.tsx to TS
Maxi10022 Nov 12, 2025
0c56dea
Added .env.example files back
Maxi10022 Nov 12, 2025
61184c5
Fixed minor type warnings
Maxi10022 Nov 12, 2025
f74f380
Renamed `File` to `FileItem` and `FileExtended` to `ExtendedFileItem`
Maxi10022 Nov 14, 2025
ed68b2a
Updated project configuration
Maxi10022 Nov 14, 2025
8654159
Renamed `FileItem` component to `FileListItem`
Maxi10022 Nov 14, 2025
e6ff44f
Removed unused usings
Maxi10022 Nov 14, 2025
26df373
Fixed type import
Maxi10022 Nov 14, 2025
b19f157
Updated index exports
Maxi10022 Nov 14, 2025
3f338ff
Updated package.json and vite.config.ts
Maxi10022 Nov 14, 2025
8b84b5a
Added TypeScript and JavaScript samples
Maxi10022 Nov 14, 2025
809e27a
README now mentions TypeScript support
Maxi10022 Nov 14, 2025
2087445
Updated README.md
Maxi10022 Nov 14, 2025
f0b88c1
Updated App.tsx
Maxi10022 Nov 27, 2025
dda76f6
Updated App.tsx
Maxi10022 Nov 27, 2025
f71ba58
Updated FileManagerFunctions.ts
Maxi10022 Nov 27, 2025
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
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>

<p>
An open-source React.js package for easy integration of a file manager into applications. It provides a user-friendly interface for managing files and folders, including viewing, uploading, and deleting, with full UI and backend integration.
An open-source React.js package with TypeScript suppor for easy integration of a file manager into applications. It provides a user-friendly interface for managing files and folders, including viewing, uploading, and deleting, with full UI and backend integration.
</p>

## ✨ Features
Expand Down Expand Up @@ -43,7 +43,47 @@ npm i @cubone/react-file-manager

## 💻 Usage

Here’s a basic example of how to use the File Manager Component in your React application:
**TypeScript:** Here’s a basic example of how to use the File Manager Component in your React application:

```tsx
import { useState } from "react";
import { FileItem, FileManager } from "@cubone/react-file-manager";
import "@cubone/react-file-manager/dist/style.css";

function App() {
const [files, setFiles] = useState<FileItem[]>([
{
name: "Documents",
isDirectory: true, // Folder
path: "/Documents", // Located in Root directory
updatedAt: "2024-09-09T10:30:00Z", // Last updated time
},
{
name: "Pictures",
isDirectory: true,
path: "/Pictures", // Located in Root directory as well
updatedAt: "2024-09-09T11:00:00Z",
},
{
name: "Pic.png",
isDirectory: false, // File
path: "/Pictures/Pic.png", // Located inside the "Pictures" folder
updatedAt: "2024-09-08T16:45:00Z",
size: 2048, // File size in bytes (example: 2 KB)
},
]);

return (
<>
<FileManager files={files} />
</>
);
}

export default App;
```

**JavaScript:** Here’s a basic example of how to use the File Manager Component in your React application:

```jsx
import { useState } from "react";
Expand Down Expand Up @@ -83,6 +123,8 @@ function App() {
export default App;
```

More detailed samples can be found in the [samples folder](tree/main/frontend).

## 📂 File Structure

The `files` prop accepts an array of objects, where each object represents a file or folder. You can
Expand Down
10 changes: 8 additions & 2 deletions frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ module.exports = {
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json'
},
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
plugins: ['react-refresh', "@typescript-eslint"],
rules: {
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
Expand Down
Loading