* meta: upgrade ESLint to v8.0.0
Forcing `@typescript-eslint/experimental-utils` resolution to `5.0.0` to work around the Angular linter bug. This can be removed when we move to Angular 13.
* Remove unnecessary entries from `.eslintignore`
- `private/remark-lint-uppy/index.js`: ESLiint v8 supports TLA
- `website/private_modules/hexo-renderer-uppyexamples/node_modules/**`:
all `node_modules` folder are ignored anyway.
- Fix upload by calling `Provider.initPlugin` in the `@uppy/unsplash` class
- Tweak styling for author and file size in dashboard.
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* Only handle drag events with files
* Added modification to drag-drop package as well
* Use some() instead of find() for broader browser support
* `dataTransfer.types` is not a real array in IE10
* introduce canHandleRootDrop, so we can check if dragged items are supported by some plugin
* drag-drop should check for allowNewUpload
* refactor and simplify
* expose events for Dashboard too
* move event handler call to the bottom
Co-authored-by: Renée Kooi <renee@kooi.me>
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
The current discard button does not have a unique classname like the submit button. This will help in customizing the styles just for the discard button.
* Close window on auth callback error
Because simply receiving a "Bad request" is very bad UX
For example if the user cancels the auth flow, or doesn't give companion access
it's better to go back
* Update packages/@uppy/companion/src/server/controllers/callback.js
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* Update packages/@uppy/companion/src/server/controllers/callback.js
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* Update packages/@uppy/companion/src/server/controllers/callback.js
* Update callback.js
* pull out reusable code to getDynamicStateFromRequest
* Signal auth error to client
* fix test mocking
* npm run build:locale-pack
* Update packages/@uppy/companion/src/server/controllers/callback.js
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* fix lint
* add i18n string that got lost during merge
* add french translation
* add dutch translation
* add norwegian translation
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* rewrite to async/await
* Only fetch size (HEAD) if needed #3034
* Update packages/@uppy/companion/src/server/controllers/url.js
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* Change HEAD to GET in getURLMeta
and abort request immediately upon response headers received
https://github.com/transloadit/uppy/issues/3034#issuecomment-908059234
* fix lint
* fix lint
* cut off length of file names
or else we get
"MetadataTooLarge: Your metadata headers exceed the maximum allowed metadata size" in tus / S3
* try to fix flaky test
* remove iife and cleanup code a bit
* fix lint by reordering code
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Makes it easier to debug when we can see it in the log files
e.g.
```
companion: 2021-09-20T20:03:53.226Z [error] provider.onedrive.list.error ProviderApiError: Access Denied
companion: 2021-09-20T19:57:49.897Z [error] provider.onedrive.list.error ProviderApiError: Item does not exist
```
We don't know what is the error code here...
* refactor cors middleware to avoid duplicates
* Make more ACAH headers default
Add the following headers to access-control-allow-headers by default:
Authorization, Origin, Content-Type, Accept
They are needed for basic operation. See https://github.com/transloadit/uppy/issues/3021
therefore also remove custom middlewares in examples and standalone
* Update outdated readme for S3
AWS now requires JSON instead of XML format
* Update packages/@uppy/companion/src/server/middlewares.js
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* Update packages/@uppy/companion/src/server/middlewares.js
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* fix review comments
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* Make uploadUrls recommended
- warn on startup if uploadUrls is not specified as not specifying it is a security risk
- improve docs to make it more clear why uploadUrls should be specified (say that uploadUrls is required even though it is not, due to backward compatibility)
- no longer require_tld (it gives a false security) - fixes#2831
* Apply suggestions from code review
* Apply suggestions from code review
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* remove `example: []`
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* @uppy/core: move `Uppy` class to its own module
Fixes: https://github.com/transloadit/uppy/issues/3220
* Rename snapshot file
* Update docs
* Update website/src/_posts/2021-08-2.0.md
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
* Update migration guide
* Do not bundle preact with non-UI plugin packages
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
* @uppy/image-editor: add workaround for when `Cropper` is loaded as ESM
Fixes: https://github.com/transloadit/uppy/issues/3199
* Update packages/@uppy/image-editor/src/Editor.js
Co-authored-by: Kevin van Zonneveld <kevin@vanzonneveld.net>
* Add backlog entry
Co-authored-by: Kevin van Zonneveld <kevin@vanzonneveld.net>
* fix: AbortController is not defined
* use globalThis
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>