Commit graph

19 commits

Author SHA1 Message Date
Merlijn Vos
57b5909611
Remove JSX global type everywhere (#5117)
* Remove JSX global type everywhere

* Add JSX to restricted globals

* Fix last instances of JSX global
2024-04-25 16:20:28 +02:00
Antoine du Hamel
e46db4042a
fixup! fix type imports (#5038) 2024-03-27 14:38:19 +01:00
Murderlon
f72ec1b7ef
@uppy/dropbox: refactor to TypeScript (#4979) 2024-03-10 11:22:51 +01:00
Murderlon
c8f1af8d12
@uppy/box: refactor to TypeScript (#4979) 2024-03-10 11:22:34 +01:00
Merlijn Vos
9b771f4d7c
Replace Provider.initPlugin with composition (#4977)
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2024-02-29 14:18:26 +01:00
Mikael Finstad
95e4cf30fb
fetchPreAuthToken in box too (#4969)
like all other providers
2024-02-28 10:35:40 +01:00
Mikael Finstad
ec4bc58508
Provider user sessions (#4619)
New concept "simple auth" - authentication that happens immediately (in one http request) without redirecting to any third party.

uppyAuthToken initially used to simply contain an encrypted & json encoded OAuth2 access_token for a specific provider. Then we added refresh tokens as well inside uppyAuthToken #4448. Now we also allow storing other state or parameters needed for that specific provider, like username, password, host name, webdav URL etc... This is needed for providers like webdav, ftp etc, where the user needs to give some more input data while authenticating

Companion:
- `providerTokens` has been renamed to `providerUserSession` because it now includes not only tokens, but a user's session with a provider.

Companion `Provider` class:
- New `hasSimpleAuth` static boolean property - whether this provider uses simple auth
- uppyAuthToken expiry default 24hr again for providers that don't support refresh tokens
- make uppyAuthToken expiry configurable per provider - new `authStateExpiry` static property (defaults to 24hr)
- new static property `grantDynamicToUserSession`, allows providers to specify which state from Grant `dynamic` to include into the provider's `providerUserSession`.
2023-12-05 22:55:41 +01:00
Merlijn Vos
9efd865a1f
Load Google Drive / OneDrive lists 5-10x faster & always load all files (#4513)
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2023-07-10 10:15:35 +02:00
Alexander Zaytsev
2e596ca9a1
@uppy/dashboard: update provider icon style (#4345) 2023-03-07 16:24:48 +08:00
Antoine du Hamel
e3de44b4eb
@uppy/box: refactor to ESM (#3643) 2022-04-19 19:15:18 +02:00
Merlijn Vos
00094af525
Refactor locale scripts & generate types and docs (#3276)
Closes #3232 

### Summary

- Create `locale.js` for every plugin instead of `this.defaultLocale` in the class
- Complete refactor of locale scripts
  - No dynamic plugin class imports with hacks to mimic the environment in order to get the `defaultLocale`.
  - Separate tests and build in separate files
  - Add two modes for test file, `unused` (fails hard) and `warnings`
- Generate docs
  - Use remark to cleanly mutate the file
  - Rename some doc files to match the plugin name (such as `statusbar` --> `status-bar`)
  - Comments in `locale.js` are kept and are present in the docs as well.
- Generate types
2021-11-10 11:43:04 +01:00
Artur Paikin
4ca78ab543
Set plugin titles from locale (#3023)
* What is happening "*"

* Instead of re-creating i18nInit, we could just make it part of the BasePlugin

* set plugin title and allow changing it from locale

* remove i18nInit method, since we now include it in BasePlugin

* All provider titles should come from locale

* Update en_US.js

* make translator private

//cc @aduh95

* init locale after calling setOptions

* Update en_US.js

* Update packages/@uppy/core/src/BasePlugin.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/core/src/index.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Bind `i18n` functions

* Remove duplicate i18nInit — it’s in BasePlugin already

* fix formatting

* fix name

* Update en_US.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-07-30 13:02:32 +01:00
Merlijn Vos
f01538ba41
Resolve all type TODO's (#2963) 2021-07-20 14:40:31 +02:00
Artur Paikin
ce959456ed
companion: Remove deprecated serverHeaders in favour of companionHeaders (#2995)
* remove deprecated serverHeaders in favour of companionHeaders

* remove TL_UPPY_SERVER and exports.UPPY_SERVER

@kvz @goto-bus-stop ok to do this already, right?
2021-07-08 18:10:14 +01:00
Merlijn Vos
ecec3d3213
Split Plugin into BasePlugin and extended UIPlugin (#2944) 2021-06-18 13:23:16 +02:00
Jace Zhu
ab5cb3e1e9
Update index.js (#2864)
* Update index.js

This PR added companion cookies rule to every provider except Box.
https://github.com/transloadit/uppy/pull/2618

(Not sure if there's a reason Box was left out)

* Update docs for the change
2021-04-28 00:02:48 +01:00
Kevin van Zonneveld
764c2ccada
Update Linter (#2796)
* relocate .vscode

* Switch to transloadit linter

* Update .eslintrc.json

* autofix code

* unlink and install eslint-config-transloadit@1.1.1

* Change 0 to "off"

* Don't change 'use strict'

* Do not vertically align

* disable key-spacing

* add import/no-extraneous-dependencies per package

* add more react/a11y warnings

* Revert "autofix code"

This reverts commit 14c8a8cde8.

* add import/no-extraneous-dependencies per example and main package

* autofix code (2)

* Allow devDependencies in ./bin

* Change import/no-extraneous-dependencies to warn again

* upgrade linter

* Set import/no-extraneous-dependencies to warn
2021-03-15 16:25:17 +00:00
Artur Paikin
8a60cf160b
Add opts.disabled for the Dashboard (#2768)
* Introduce opts.disabled for the Dashboard

* Reduce opacity, disable user-select, set cursor

* Add classes to providers' background circles

So they can be grayscaled via css

* add disableAllFocusableElements and run it in afterUpdate hook, if needed

* increase opacity for readability

* Store previous tabindex value and use it when restoring (setting disable: false)

//cc @goto-bus-stop

* Add disabled docs

* add disabled option to website example

Co-authored-by: Alexander Zaytsev <nqst@users.noreply.github.com>
2021-02-26 03:21:53 +00:00
Carter Konz
970ac8df5b
companion,box: Box provider implementation (#2549)
* boilerplate for Box provider

TODO:
  - adapter
  - index
  - website/src/docs
  - tests

* Box provider implementation

- adapter
- index
- npm bufoonery
- lil' fixes

and MORE!

TODO:
- thumbnails 🤬
- tests
- docs

* Box provider: add brand icon, fix file icons

- token issues with thumbnail/logout

* Box provider: fix thumbnails, upload

- fix tokens for box
- implement `size()`
- make debug logging easier to find (bold blue)

learned:
- box needs cookie auth
- thumbnail requests come back as 202s

TODO:
- fix logout with form POST (zoom example)

* Box provider: fix logout

- add client info as formData to revoke post

TODO:
- tests cleanup
- package-lock fix
- docs

* Box provider: docs

TODO:
- tests

* Box provider: cleanup

TODO:
- tests

* fix error msg path for Box

- remove comment

* keeping up

- update ProviderViews import
- fix version string on Box package.json

* companion,box: exclude box from global module/examples while in beta

Co-authored-by: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>
2020-11-13 15:37:00 +01:00