Commit graph

44 commits

Author SHA1 Message Date
Antoine du Hamel
b4e5d86370
@uppy/react: refactor to ESM (#3780) 2022-05-30 18:33:00 +02:00
Artur Paikin
934ba79f00
core: wrap plugins in div.uppy-Root and set dir attrubute in UIPlugin (#3692)
* Add @uppy/remote-sources preset/plugin

* yarn.lock

* Update packages/@uppy/remote-sources/README.md

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

* Use div.uppy-Root for all plugins mounted in DOM; set dir in UIPlugin

* remote uppy-Root from all UI plugins, as it will be set in UIPlugin automatically

* Remove uppy-Root from file-input

* Revert "Update packages/@uppy/remote-sources/README.md"

This reverts commit 3fd00028f7.

* Revert "yarn.lock"

This reverts commit 04dd8c73de.

* Revert "Add @uppy/remote-sources preset/plugin"

This reverts commit ac1f5df6b3.

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

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

* Update packages/@uppy/drag-drop/src/DragDrop.jsx

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

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

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

* Revert "Update packages/@uppy/core/src/UIPlugin.js"

This reverts commit f91af00d6b.

* @uppy/react: add .uppy-Contrainer class name to wrapper div

* @uppy/svelte: add .uppy-Contrainer class name to wrapper div

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
Co-authored-by: Renée Kooi <renee@kooi.me>
2022-05-13 11:04:29 +01:00
Mikael Finstad
8ed210545c
proposal: Cancel assemblies optional (#3575)
* change cancel logic

to make canceling assemblies optional
possibly fixes #3547

* add forgotten file

* rewrite to reason='user'

* try to fix crash

* change reason to unmount

* Apply suggestions from code review

* add close+unmount in more code examples

also fix rule of hooks issue

* improve reason docs

* add tests

* add options also to reset

* update doc

* also prevent canceling uploads on unmount

* Update website/src/docs/transloadit.md

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

* remove conflicting file

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2022-05-06 01:53:46 +07:00
Merlijn Vos
d42badf995
Support React 18 in @uppy/react (#3680)
* Support React 18
* Remove unit tests
* Create e2e tests

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-05-04 17:38:08 +02:00
Kevin van Zonneveld
bfe659820e
Upgrade linting to 2.0.0-0 (#3280)
* Upgrade linting to 2.0.0-0

* Adjust so we can pass without error

* Fix linting

* Update header-blacklist.js

* Update index.js

* Update Uppy.js

* Update Components.js

* Update StatusBar.js

* Update Assembly.js

* Upgrade to linting 2.0.0 (final release)
2021-11-09 11:19:05 +00:00
Antoine du Hamel
7fd7b604d7
@uppy/react: update HTMLAttributes filter (#3215) 2021-09-28 16:58:50 +02:00
Antoine du Hamel
6b68876c68
@uppy/react: propagate prop mutation (#3208)
* @uppy/react: propagate prop mutation

Fixes: https://github.com/transloadit/uppy/issues/3203

* fixup! @uppy/react: propagate prop mutation

* fixup! @uppy/react: propagate prop mutation

* Apply changes to other Components

* Update TODOs
2021-09-28 16:57:58 +02:00
Merlijn Vos
2ce0c8b4dc
Fix React DashboardModal's target type (#3110) 2021-08-30 15:01:15 +02:00
Antoine du Hamel
6b7ad5e7c7
Stricter linter (#3095)
* enforce some eslint rules

* enforce accessibility linter rules

* harden lint rules with only 1 or 2 warnings

* fix remaining rules with less than 3 warnings

* fix e2e tests

* fix remaining rules with less than 4 warnings

* fix remaining rules with less than 6 warnings

* fix `shuffleTaglines`

* fix companion build
2021-08-17 20:32:57 +02:00
Artur Paikin
472766e48b
UIPlugin fix: prevent Preact replacing contents of body element by using createDocumentFragment (#3072)
* Pass createDocumentFragment instead of the targetElement to Preact, so it doesn’t destroy the contents of targetElement

* remove replaceTargetContent

* also remove replaceTargetContent from docs and website
2021-08-06 10:02:11 +01:00
Merlijn Vos
f01538ba41
Resolve all type TODO's (#2963) 2021-07-20 14:40:31 +02:00
Antoine du Hamel
d40b5241db
core: remove more IE hacks (#3015)
We can now use `Object.fromEntries`, `Object.values`, and `Symbol`.
Also changes polyfill suggestion for legacy browsers to use `core-js`
which includes almost all we need and more.
2021-07-16 09:27:51 +02:00
Antoine du Hamel
5630f7dc07
tools: enable linter for TypeScript (#2997)
* tools: enable linter for TypeScript files and code snippets

* types: remove remaning namespaces

* tools: remove unused Babel decorator plugin
2021-07-13 14:28:14 +02:00
Antoine du Hamel
dcaef3173f core: fix types 2021-07-09 12:22:11 +02:00
Artur Paikin
a8003c873e
core: force new keyword (#2949)
* Force Uppy initialization with new keyword, remove run()

* update some types

* update docs and examples

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

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

* Update packages/@uppy/core/types/index.d.ts

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

* add new in tests

* Move all types to ESM syntax and fix all issues

* Add back e2e build script and revert uppy docs commit

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Murderlon <merlijn@soverin.net>
2021-07-08 19:02:13 +01:00
Merlijn Vos
acb6566ec0
Always enable strict types and remove .run method (#2957)
* Always use strict types and remove `.run` method

* Remove accidental package-lock.json files

* Actually remove `.run` method
2021-06-30 12:05:10 +01:00
Merlijn Vos
ecec3d3213
Split Plugin into BasePlugin and extended UIPlugin (#2944) 2021-06-18 13:23:16 +02:00
Andrew
9a9860ac8f
Allowed HTML Attributes to be passed via props (#2891)
* Allowed HTML Attributes to be passed via props

This fix still needs some work, as certain attributes could be passed to Uppy or as an HTML attribute, such as target

When this is fixed, this will resolve #2403

* Removed shared attributes

I removed the ability to use certain attributes ('width', 'height', and 'target') and pass them down as Props to the div due to that fact that Uppy relies on them

* Add typescript types for the HTML attributes

* Moved common.js to getHTMLProps.js

* Fixed import

* Converted `possibleStandardNames` to an Array

* Fix import

* Fix tests
2021-06-14 13:11:37 +01:00
JT
f149eb1a38
Add function as allowed prop type (#2873) 2021-05-04 17:52:05 +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
Andrew
80b5ace47d
Added FileInput component to React (#2706)
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2020-12-18 21:21:12 +00:00
Renée Kooi
b03c5af053
react: add useUppy() hook (#2666)
* react: add useUppy() hook

* add test

* docs: replace useRef/useEffect recommendation with useUppy()

* fix typo
2020-12-18 21:11:11 +00:00
Renée Kooi
8c826313b6
A few docs things (#2371) 2020-07-29 12:17:27 +02:00
Renée Kooi
ab3d7cb067
react: fix typescript proptypes for DashboardModal, fixes #2124 (#2136) 2020-03-16 15:22:03 +01:00
Renée Kooi
be66c47deb
Actually check types (#1918)
* types: stronger typings

* Remove remaining `declare module` things for uppy.use

* Format types standard-style-like

* Add `target` properties to plugin typings

* Add type for `replaceTargetContent` option

* xhr-upload: allow lowercase method

* opt in to stricter typechecks

* use the strictly typed version in all typings tests

* endtoend: use strict types in typescript test

* Add some comments to the typings file so IDEs will warn about untyped use()

* informer: remove obsolete option from typings

* react: generate prop types based on actual options types

* react: update types

* react: fix import in typings test

* companion-client: add `pluginId` property to ProviderOptions type

Co-Authored-By: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>

* core: remove some `any` types

* *: add locale string types

* *: generate locale typings

* core: fix LocaleStrings<> type

* dashboard: add locale string type tests

* tus: inherit options typings from tus-js-client

* transloadit: add missing options types

* ci: do the required build steps before testing typings

* Support TokenStorage in types, add `title?: string` options

* form: update typings

* types: put TokenStorage type in dependents

* Document Uppy.StrictTypes

* if we pin at least we should use the latest

* Allow document.querySelector

I think it's a eslint-plugin-compat bug that it's marking querySelector
as not available in Android Chrome 78.

Co-authored-by: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>
2020-02-12 16:22:09 +01:00
Pankaj Kumar
627b2e4df9 componentWillReceiveProps logic moved to componentDidUpdate (#1999) 2020-01-06 14:48:50 +01:00
Renée Kooi
e6c52f7681
Use opts.id as the plugin ID for all plugins, fixes #1674 2019-06-19 09:58:14 +02:00
Sagar Jain
1b3d5df5c5 updated PR as per comments from review 2019-05-27 19:46:30 +05:30
Sagar Jain
275bb69f61 dashboard react component prop typings updated 2019-05-25 12:43:09 +05:30
Renée Kooi
4cd5a3be0f
react: add thumbnailWidth prop type for Dashboard components, fixes #1524 2019-05-08 11:02:03 +02:00
kokokenada
702b29ecbc add showSelectedFiles which was missing from type definition 2019-03-09 19:28:32 -05:00
Artyom Bochkarev
6f0e5d7f77
Add trigger field 2019-03-06 12:24:21 +01:00
Renée Kooi
097c6efccc
Merge pull request #1247 from transloadit/feature/react-uppy-change
react: Allow changing instance in `uppy` prop
2019-01-28 10:57:52 +01:00
Matthias Bohlen
d3d86555f0 Make "target" prop optional in Typescript. 2019-01-27 11:17:09 +01:00
Renée Kooi
53a362ecd8
Add back componentWillUnmount 2019-01-21 15:12:30 +01:00
Renée Kooi
50a24ffba4
react: Allow changing instance in uppy prop 2019-01-21 15:05:25 +01:00
Renée Kooi
8a8e00da2f
Formatting for @uppy/react types 2018-12-20 14:52:58 +01:00
Renée Kooi
1a0878a851
Merge pull request #1131 from mattes3/master
Make Uppy's React components usable from Typescript
2018-12-10 15:50:12 +01:00
Renée Kooi
c1594eb0f9
react: Allow Dashboard height to accept a string with unit 2018-11-12 10:54:03 +01:00
Matthias Bohlen
421441824a Add Typescript types for Uppy's React components. 2018-11-04 18:15:29 +01:00
craigcbrunner@gmail.com
fbf2b33c24 Allowing width on dashboard to accept a string for 100% 2018-11-02 20:44:05 -07:00
Renée Kooi
72689d01ac
Export Plugin class from @uppy/core. 2018-06-28 12:20:21 +02:00
Artur Paikin
356585f4af update to status-bar and xhr-upload in: tests, website, dependencies, examples 2018-06-21 16:20:55 -04:00
Renée Kooi
c9b266ade1
Move React components to @uppy/react package. 2018-06-18 10:14:08 +02:00