Commit graph

64 commits

Author SHA1 Message Date
Murderlon
82a5999260
Merge branch 'main' into 4.x
* main: (22 commits)
  @uppy/xhr-upload: refactor to use `fetcher` (#5074)
  docs: use StackBlitz for all examples/issue template (#5125)
  Update yarn.lock
  Add svelte 5 as peer dep (#5122)
  Bump docker/setup-buildx-action from 2 to 3 (#5124)
  Bump actions/checkout from 3 to 4 (#5123)
  Remove JSX global type everywhere (#5117)
  Revert "@uppy/core: reference updated i18n in Restricter"
  @uppy/core: reference updated i18n in Restricter
  @uppy/utils: improve return type of `dataURItoFile` (#5112)
  @uppy/drop-target: change drop event type to DragEvent (#5107)
  @uppy/image-editor: fix label definitions (#5111)
  meta: bump Prettier version (#5114)
  @uppy/provider-views: bring back "loaded X files..." (#5097)
  @uppy/dashboard: fix type of trigger option (#5106)
  meta: fix linter
  @uppy/form: fix `submitOnSuccess` and `triggerUploadOnSubmit` combination (#5058)
  Bump docker/build-push-action from 3 to 5 (#5105)
  Bump akhileshns/heroku-deploy from 3.12.12 to 3.13.15 (#5102)
  Bump docker/login-action from 2 to 3 (#5101)
  ...
2024-04-29 15:56:33 +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
Merlijn Vos
915a563da9
@uppy/react: remove useUppy & reintroduce useUppyState (#5059) 2024-04-17 12:05:48 +02:00
Antoine du Hamel
4be043a306
@uppy/react: remove prop-types dependency (#5031) 2024-03-27 13:18:11 +01:00
Antoine du Hamel
619f8ae4e8
@uppy/react: remove Wrapper.ts (#5032) 2024-03-27 11:20:08 +01:00
Antoine du Hamel
462e8c61bd
@uppy/react: refactor to TS (#5012) 2024-03-27 11:03:34 +01:00
Chris Grigg
01f2428b41
@uppy/dashboard: add new autoOpen option (#5001)
* Add autoOpenView option that defaults to meta

* <Dashboard/> - deprecate `autoOpenFileEditor`, use `autoOpen` instead

* tests - account for the case where `opts` are undefined

* Update packages/@uppy/dashboard/src/Dashboard.jsx

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

* types - properly deprecate option `autoOpenFileEditor`

* everywhere - rename "fileEditor" => "imageEditor"

* <DashboardModal/> - refactor `props` passing

* types - copypaste types

* Dashboard.tsx - autoOpen: `false` => `null`

* change the default value too

---------

Co-authored-by: Evgenia Karunus <lakesare@gmail.com>
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2024-03-25 21:31:09 +04:00
Antoine du Hamel
89a2fc5d24
remove unnecessary 'use strict' directives (#4943) 2024-02-21 10:49:45 +01:00
Artur Paikin
440b8a9f9a
Revert "@uppy/react: add useUppyState (#4711)" (#4789)
This reverts commit 12e08ada02.
2023-11-12 02:03:55 +01:00
Merlijn Vos
12e08ada02
@uppy/react: add useUppyState (#4711) 2023-10-24 08:58:58 +02:00
Antoine du Hamel
34c78e9093
meta: run Prettier on existing files (#4713) 2023-09-29 11:11:28 +02:00
Merlijn Vos
f71df146fa
@uppy/react: allow id from props (#4570)
Fixes: https://github.com/transloadit/uppy/issues/4482
2023-07-13 12:14:16 +02:00
Antoine du Hamel
0a7eceac21
meta: fix all ESLint warnings and turn them into errors (#4398) 2023-04-04 15:54:13 +02:00
Merlijn Vos
81d482fdc9
@uppy/react: deprecate useUppy (#4223)
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2022-12-23 14:45:20 +01:00
Matt Jesuele
8a3665d28b
@uppy/react: useUppy: fix unmount on NextJS dev mode (#4062) 2022-08-30 15:44:23 +02:00
Merlijn Vos
9a213b59da
Fix all breaking todo comments for 3.0 (#3907)
- `@uppy/aws/s3-multipart`: remove `client` getter and setter.
  - reason: internal usage only
  - migrate: use exposed options only
- `@uppy/core`: remove `AggregateError` polyfill
  - reason: [should be polyfilled by the user](https://github.com/transloadit/uppy/pull/3532#discussion_r818602636)
  - migrate: install `AggregateError` polyfill or use `core-js`
- `@uppy/core`: remove `reset()` method
  - reason: it's a duplicate of `cancelAll`, but with a less intention revealing name
  - migrate: use `cancelAll`
- `@uppy/core`: remove backwards compatible exports (static properties on `Uppy`)
  - reason: transition to ESM
  - migrate: import the `Uppy` class by default and/or use named exports for everything else.
- `@uppy/react`: don't expose `validProps`
  - reason: internal only
  - migrate: do not depend on this
- `@uppy/store-redux`: remove backwards compatible exports (static properties on `ReduxStore`)
  - reason: transition to ESM
  - migrate: use named imports
- `@uppy/thumbnail-generator`: remove `rotateImage`, `protect`, and `canvasToBlob` from prototype.
  - reason: internal only
  - migrate: don't depend on this
2022-08-03 20:07:24 +02:00
Antoine du Hamel
dc7ad4b916
@uppy/status-bar: rename internal modules (#3929)
* rename `StatusBar` -> `StatusBarUI`

* rename `_StatusBar.jsx` -> `StatusBar.jsx`
2022-08-02 14:53:49 +02:00
Murderlon
d31cae30aa
Fix exports in propTypes.js to fix website build 2022-07-27 18:32:28 +02:00
Antoine du Hamel
a6029d0304 Merge stable branch 2022-06-09 21:15:10 +02:00
Tomasz Pęksa
2c05d51794
Reset uppy instance when React component is unmounted (#3814) 2022-06-07 18:14:37 +02:00
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