react-dropzone / file-selector

Convert a DragEvent or file input to a list of File objects
MIT License
95 stars 33 forks source link

feat: use getAsFileSystemHandle when available #91

Closed rolandjitsu closed 1 month ago

rolandjitsu commented 1 month ago

What kind of change does this PR introduce?

Did you add tests for your changes?

If relevant, did you update the documentation?

Summary

Complete the impl. of https://github.com/react-dropzone/file-selector/pull/79 with tests and typescript types.

Does this PR introduce a breaking change?

No.

Other information

rolandjitsu commented 1 month ago

@tomayac please check this PR out. I've added some tests and additional typescript type support for the new handle property.

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build ae387457db4eb1e92b2d2a815de8bc263fd43dd2-PR-91

Details


Totals Coverage Status
Change from base Build 6adbc2fe4dad708280f8bc60590335a892510731: 0.0%
Covered Lines: 89
Relevant Lines: 89

💛 - Coveralls
rolandjitsu commented 1 month ago

LGTM

I'm not sure if it matters, but you may want to replace FileSystemHandle with the more explicit FileSystemFileHandle, since this is only dealing with files, not directories (for which FileSystemDirectoryHandle exists, both inherit from FileSystemHandle).

Made the handle of type FileSystemFileHandle on FileWithPath and kept the internal use as FileSystemHandle.

rolandjitsu commented 1 month ago

@tomayac can we go ahead with this PR or would you like to update yours to match this one?

tomayac commented 1 month ago

@tomayac can we go ahead with this PR or would you like to update yours to match this one?

No worries with taking yous. Just close mine in favor of this. Glad the feature is landing.

github-actions[bot] commented 1 month ago

:tada: This PR is included in version 1.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: