Commit graph

62 commits

Author SHA1 Message Date
prakash
d6a0132145
refactor(core): merge @uppy/provider-views into core via ./provider-views export 2026-06-22 01:40:32 +05:30
prakash
b3aa4cdd6c
refactor(core): merge @uppy/companion-client into core via ./companion-client export 2026-06-22 01:40:26 +05:30
prakash
156b87ec17
refactor(core): merge @uppy/utils into core via ./utils export 2026-06-22 01:40:25 +05:30
Prakash
79e6460a6c
Make Generics Optional in uppy.getPlugin (#6057)
fixes #6024.

### Problem
- `getPlugin()` defaults to `UnknownPlugin`, so methods like `openModal`
are not visible , since core is not aware of that plugin type

### Proposed change
- Introduce a types-only registry in core:
- `export interface PluginTypeRegistry<M extends Meta, B extends Body>
{}`
- Overload `getPlugin` to return a precise type when the id is a known
key of the registry.
- add `Dashboard` to  PluginTypeRegistry through module augmentation:
  - `'Dashboard': Dashboard<M, B>`.
- When a project imports from `@uppy/dashboard`, its module augmentation
extends PluginTypeRegistry, adding the correct type into it
- I've added Tests , kept them in a separate file so it's easier to
review , once this approach gets approved I'll add them to
`Uppy.test.ts`

Once this PR gets a positive review I'll add this for other plugins ,
currently only added for `@uppy/dashboard`

**Build with Local tarball can be checked here** 


https://stackblitz.com/~/github.com/qxprakash/uppy-type-test?file=type_test.ts
2025-11-17 18:18:54 +05:30
Prakash
5ba2c1c8d3
Server side search @uppy/Companion (#6003)
## High Level View

<img width="3367" height="1576" alt="Global Search (1)"
src="https://github.com/user-attachments/assets/134e8658-5cbd-4816-87a1-3bd42603089d"
/>


- Search View replicated , through minimal components `<GlobalSearchView
/>` and `<SearchResultItem />`
- Both components take only the minimal state needed to render the
search view no dependency on PartialTree. search response from companion
server is directly passed to GlobalSearchView for file state.
- `#buildPath` creates missing parent nodes in partialTree (if any) and
opens the folder in the normal way using a minimal wrapper over
openFolder function.
- Both interactions : "checking a file/folder" and "opening a folder"
use the same function `#buildPath` to build the path, then use the
already existing `openFolder` and `toggleCheckBox`.
- Max search results: 1000. Pagination removed for simplicity (can be
added later).
- From a UI/UX standpoint, all functionality works as expected.
- The only limitation is occasional inconsistent partial checked states
when the tree isn’t fully built — unavoidable since percolateUp and
percolateDown require the complete partialTree to sync state correctly.
This issue isn’t critical; even in other cases, we already mark folders
"checked" whereas they may be empty if not yet fetched.
- I figured out it's better to just derive the checkedState from
PartialTree , and then pass it to `GlobalSearchView` rather than keep it
separate and then worrying about checked state syncs across two views
for UI to look right.
- IMO this is the most simplest approach I could come up with. without
sacrificing any user functionality and it carefully reuses all the util
code.

---------

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2025-10-08 21:18:17 +02:00
Prakash
d301c01d6a
@uppy/utils: update export maps (#5900)
- cleanup `@uppy/utils ` removed unused / redundant modules .
- migrated modules and tests from `.js` to `.ts`
- removed all the nested export paths
- updated `@uppy/utils` import paths for all packages
- `@uppy/angular` is still failing while running`yarn build` , I'm
looking into it.

---------

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2025-08-19 12:25:27 +02:00
Merlijn Vos
78299475ae
Migrate from Eslint/Prettier/Stylelint to Biome (#5794) 2025-07-01 14:55:41 +02:00
Merlijn Vos
d408570373
From Babel to TS (#5792) 2025-06-30 16:12:26 +02:00
Merlijn Vos
d58cc20372
ts: make locale strings optional (#5728) 2025-04-21 12:34:29 +02:00
Merlijn Vos
229902eb17
@uppy/core: fix locale type for plugins (#5700)
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2025-03-31 12:04:29 +02:00
Merlijn Vos
6e65cd8c51
Import types consistently from @uppy/core (#5589)
* Import types consistently from @uppy/core

* Add new eslint rule

* Clean up exports
2025-01-09 11:03:43 +01:00
Merlijn Vos
3e2aa9f3c8
Use .js(x) for all imports instead .ts(x) (#5573) 2025-01-06 13:29:55 +01:00
Mikael Finstad
afd4befee2
Google Picker (#5443)
* initial poc

* improvements

- split into two plugins
- implement photos picker
- auto login
- save access token in local storage
- document
- handle photos/files picked and send to companion
- add new hook useStore for making it easier to use localStorage data in react
- add new hook useUppyState for making it easier to use uppy state from react
- add new hook useUppyPluginState for making it easier to plugin state from react
- fix css error

* implement picker in companion

* type todo

* fix ts error

which occurs in dev when js has been built before build:ts gets called

* reuse docs

* imrpve type safety

* simplify async wrapper

* improve doc

* fix lint

* fix build error

* check if token is valid

* fix broken logging code

* pull logic out from react component

* remove docs

* improve auth ui

* fix bug

* remove unused useUppyState

* try to fix build error
2024-12-02 18:34:50 +08:00
Antoine du Hamel
64bffd5363
export plugin options (#5433) 2024-08-28 15:49:03 +02:00
Antoine du Hamel
489ca6de55
meta: enforce use of extension in import type declarations (#5316) 2024-07-09 14:35:58 +02:00
Merlijn Vos
88d508f7bf
TS strict mode (#5258)
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2024-06-20 16:54:10 +02:00
Antoine du Hamel
a42b150639
Merge stable branch 2024-06-18 17:22:02 +02:00
Mikael Finstad
e6674a1eee
@uppy/google-photos: add plugin (#5061) 2024-06-18 11:13:23 +02:00
Evgenia Karunus
b7b65b9aeb
PartialTree - get rid of .onFirstRender() (#5187)
everywhere - get rid of `.onFirstRender()`
2024-05-30 06:06:21 +04:00
Merlijn Vos
1634263c6b
Use title consistently from locales (#5134) 2024-05-08 12:54:25 +02:00
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
00405fb24c
fix type imports (#5038)
We sometimes where importing source files, which may not be available in
production. Instead we should target extension-less paths in `lib/`
folders so the generated `.d.ts` files are used.
2024-03-27 14:32:45 +01:00
Murderlon
f72ec1b7ef
@uppy/dropbox: refactor to TypeScript (#4979) 2024-03-10 11:22:51 +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
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
3fd5aa73f5
@uppy/dropbox: refactor to ESM (#3651) 2022-04-21 16:13:01 +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
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
Ifedapo .A. Olarewaju
c7b097cd90
companion: add support to allow custom oauth credentials at request time (#2622)
* companion: add support to allow custom oauth credentials at request time

other affected ackages: dropbox, google-drive, zoom, instagram, facebook, onedrive, provider-views

* companion: avoid re-using "state" value from previous oauth dance

* companion: fix tests

* companion: add test for preauth endpoint

* companion: document functions

* companion: add tests for oauth credentials fetcher module

* companion: rename "params" to "parameters" to avoid ambiguity with transloadit's API

* companion: fix typos

Co-authored-by: Renée Kooi <renee@kooi.me>

* companion-client: use qs-stringify for url queries

* companion-client: rename "credentialsRequestParams" -> "companionKeysParams"

Co-authored-by: Renée Kooi <renee@kooi.me>
2021-01-15 10:50:12 +01:00
Ifedapo .A. Olarewaju
3b5d19f363
companion-client: support options cookies send rule (#2618)
* companion-client: support options cookies send rule

fixes #2241

* companion-client: prefix cookiesSendRule option with "companion"

* companion-client: set "companionCookiesRule" as optional field
2021-01-12 14:54:36 +01:00
Ifedapo .A. Olarewaju
d586a4cf53
companion,unsplash: Unsplash provider (#2431)
* unsplash[wip]: implement unsplash provider + plugin

* unsplash,provider-views,companion-client: fully working unsplash plugin

* unsplash: clean up plugin implementation

* provider-views: refactor CloseWrapper

* companion-client: encode search text before adding it to URL

Co-authored-by: Renée Kooi <renee@kooi.me>

* companion: use object spread over Object.assign

Co-authored-by: Renée Kooi <renee@kooi.me>

* zoom: fix provider-view import

* circle icon

* update locale strings and package-lock

* move truncateString to @uppy/utils and use it for Unsplash name-description conversion, adding .jpg

* use alt_description if description in null

* companion: handle name truncation internally

* companion: handling carriage for truncation + fix urlmeta import

Co-authored-by: Renée Kooi <renee@kooi.me>
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2020-10-28 19:50:51 +01:00
Ifedapo .A. Olarewaju
69f653eb47
provider-views: handle all plugin state in provider-views (#2318)
other plugins concerned onedrive,dropbox,instagram,google-drive
2020-06-15 14:39:54 +01:00
Artur Paikin
68f36b1ac2
Refactor FileProgress component (#2303)
* refactor FileProgress component; pass hideCancelButton, hidePauseResumeButton and hideRetryButton

* move icons to where they are rendered, rename UppyIcon to uppy-u-icon

* cleanup: rename DashboardItem, remove xmlns

* update docs to specify the option also hides action button on each individual file
2020-06-06 04:10:01 +02:00
Artur Paikin
5079d98584
dashboard: 2020 redesign 🍿 (#2015)
* ProviderViews: Improve Instagram’s “video thumbnail”

* Update all provider icons to nicer round ones

* Change “drop files” copy depending on number of acquirers and Dashboard width

* Translator: support multiple components in options

When the source contains multiple placeholders for interpolation, we should ignore chunks that are not strings, because those can be JSX objects and will be otherwise incorrectly turned into strings.

Without this condition we’d get this: [object Object] hello [object Object] my <button>

* Remove unused locale strings

* Rever renderSingleInlineProvider, use Browse button instead of link, tweak styles

* Try “Browse My Device” button

* Introduce “Dark Mode“: new Dashboard option 'theme': 'light', 'dark' or 'auto'

* Refactor to also add uninstall/removeListener for the darkModeMediaQuery; remove all bindings in favor of class properties

* More dark mode styles: Providers, FileCard, tweaking focus, inputs, etc

* My Device: mobile and desktop icons

* add isMobileDevice capability, very simple detection

* More dark mode styles

* refactor

* switch back to single simple my device icon

* chrome 78 for android doesn’t support document.querySelector 👌

* nobr --> span white-space: nowrap

* Major style tweaks for mobile provider list, show dashed borders only when DnD is supported

* Add color after “import from”

just for Russian for now, because I’m thinking if this should be a part of the language string or html? @goto-bus-stop @kvz, what do you think?

* improve isMobileDevice, add tests

* don’t set the isMobileDevice capability in core for now

* add checks for typeof window !== 'undefined', otherwise fails in Node/RN

* update locales

* refactor renderDropFilesSubtitle
2020-03-24 18:05:11 +01:00
ifedapoolarewaju
83ec63efb2
providers: remove redundant use of options 2020-01-31 14:54:13 +01:00
Renée Kooi
d6d4b05425
companion-client: rename serverHeaders to companionHeaders (#1861) 2019-10-09 14:34:52 +02:00
Evgenia Karunus
7ce63fcb7e Accessibility follow-up PR: make all svgs not focusable in IE11 (#1662)
* /examples/dev - added polyfills for easy development in IE11

* @uppy/dashboard - made all svgs not focusable in IE11

* /examples/dev - started sharing serviceWorker registration code

* /examples/dev - added polyfills for IE11 to dev bundle
2019-06-17 17:08:05 +03:00
Renée Kooi
980210f76c
Add VERSION properties to all plugins.
And remove the proposal-object-rest-spread plugin because it is built
into preset-env now.
2019-05-27 16:53:47 +02:00
Ifedapo Olarewaju
f4e558bf94 rename serverUrl to companionUrl
and serverPattern to companionAllowedHosts
2019-04-14 13:53:50 +01:00
Alexander Zaytsev
5668b6c7d7 Update Dropbox icon 2019-04-08 10:51:47 +03:00
Ifedapo Olarewaju
700b557c3b provier-views,companion-client: handle 401 response for companion 2019-03-28 01:42:46 +01:00
Ifedapo Olarewaju
8cf0455c31 companion-client: store auth token via plugins 2019-02-20 08:28:28 +01:00
Ifedapo Olarewaju
eabf6f6576 companion-client: use platform agnositc storage to store auth token 2019-02-10 13:05:42 +01:00