forked from DevinoSolutions/upup
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cu 86b2qw06r feat add upload event listeners (DevinoSolutions#247)
* feat(uploader): enhanced file preview with react-file-viewer - Added support for previewing multiple file types (PDF, DOCX, XLSX, etc.) - Implemented `react-file-viewer` for better file preview capabilities - Maintained fallback to FileIcon component when preview fails OTHER CHANGES - Resolved React version mismatch (16.14.0 -> 18.2.0) to fix hook errors in Storybook - Added VSCode workspace folder to `.gitignore` BREAKING CHANGE: New dependency `react-file-viewer` is required * feat(uploader): enhanced file preview hover interactions - Added hover effect with background color change and shadow elevation - Implemented cursor pointer for clickable file previews - Added active state for click feedback - Enhanced dark mode hover states - Maintained consistent hover behaviour across mini and full preview modes * fix(uploader): resolved DOCX preview conflicts and improve type safety - Added modal-based DOCX preview to prevent interference between multiple previews - Created FileWithId interface and shared type definitions - Fixed file ID generation and management - Added proper cleanup for object URLs - Ensured consistent key generation for previews BREAKING CHANGE: File state type is now FileWithId[] instead of File[] * feat(preview): implemented universal portal-based file preview - Replaced DOCX-specific preview with universal file preview component - Added modal preview support for all file types - Fixed file name truncation in preview cards * chore(app): cleaned up unused files * feat(events): implemented comprehensive upload event system - Added file handling events (onFileClick, onFilesChange, onFileRemove) - Added upload lifecycle events (onUpload, onCompletedUpload, onAllCompleted, onUploadFail) - Added progress tracking events (onFileProgress, onTotalProgress) - Added drag-and-drop events (onDragOver, onDragLeave, onDrop) - Added integration selection event (onClick) The event system provides granular control and visibility into: - File selection and removal - Upload progress per file and overall - Upload success/failure states - Drag-and-drop interactions - Integration method selection - Updates Demonstrates all events in Storybook with status updates and console logs * feat(app): implemented event handlers for mini uploader * refactor(app): name refinements to reduce ambiguity and ensure consistency per review, changed: - `onClick` to `onIntegrationClick` - `onUpload` to `onFileUploadStart` - `onCompletedUpload` to `onFileUploadComplete` - `onAllCompleted` to `onAllUploadsComplete` - `onUploadFail` to `onFileUploadFail` - `onTotalProgress` to `onTotalUploadProgress` - `onDragOver` to `onFileDragOver` - `onDragLeave` to `onFileDragLeave` - `onDrop` to `onFileDrop` fix failing build caused by `src/lib/uploadObject.ts` * feat: added onFileTypeMismatch and onCancelUpload events - Added onFileTypeMismatch event to handle file type validation failures - Added onCancelUpload event for upload cancellation handling - Updated useProgress hook to properly handle upload abortion - Exposed cancelUpload method through component ref * refactor(app): swapped `Date.now` and `Math.random` calls for more accurate values from `uuid` call * fix(app): prettier fixes
- Loading branch information
1 parent
e9a36c1
commit 54c53aa
Showing
15 changed files
with
481 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.