Commit graph

349 commits

Author SHA1 Message Date
Antoine du Hamel
b4e5d86370
@uppy/react: refactor to ESM (#3780) 2022-05-30 18:33:00 +02:00
Eduard Müller / taktik
2f0b39b8dc
@uppy/dashboard: use webkitRelativePath when querying a file's relative path (#3766)
- fixes missing "relativePath" meta property when adding files via the "Browse Folder" link in the dashboard with Chrome or Edge
2022-05-25 12:16:49 +02:00
Antoine du Hamel
5a8a8d35be
meta: prepare test files for lint rule hardening (#3761) 2022-05-23 12:02:19 +02:00
Antoine du Hamel
327509a7dc
@uppy/dashboard: refactor to ESM (#3701) 2022-05-18 10:17:27 +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
Merlijn Vos
6da874ed3a
meta: Make E2E Great Again (#3444)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-02-08 17:37:27 +01:00
Merlijn Vos
7fdad73d6e
Add dashboard and UIPlugin types (#3426) 2022-02-01 12:57:24 +03:00
Artur Paikin
80e5cedf11
Unsplash: UI improvements (#3438)
* add extra dot before file size

* show search term at the top when displaying results

* add inline search to result screen

* update locale

* update locale

* remove comments

* improve semantics, remove duplicate event handlers
2022-01-26 22:34:47 +00:00
Artur Paikin
cfaf2acf4e
check if info array is empty (#3442) 2022-01-20 15:14:11 +00:00
Antoine du Hamel
479f3a68a5
deps: use nanoid/non-secure to workaround react-native limitation (#3350)
Fixes: https://github.com/transloadit/uppy/issues/3340
2021-12-09 15:33:25 +01:00
Merlijn Vos
6b9d6dd423
Save meta fields when opening the image editor (#3339) 2021-12-07 11:20:23 +01:00
Antoine du Hamel
cd8af60bfb
examples: update angular-example to Angular v13 (#3325)
* examples: update angular-example to Angular v13

* meta: upgrade TS version accross the board

* meta: upgrade ESLint packages

* Fix angular-examples tests

* bump lock file

* fix type conflict

* Upgrade `ng-packagr`
2021-11-22 19:12:56 +01:00
Merlijn Vos
6add4ef031
Status bar error state improvements (#3299)
- Show error state of status bar if there is only _one_ failed file instead of _all_ failed files. Used to be stuck in the uploading state when a file failed.
- Add "x of x files uploaded" below "Upload failed" for extra context.
- Improve the error details button styling in the statusbar
- Improve the error details button styling in the file info card. Now placed next to the file name.
- Set status bar state to complete if the user manually removes the failed files.
2021-11-15 10:15:52 +00: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
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
Artur Paikin
6e4884f559
Required meta fields UI (#3285)
* add checkRequiredMetaFieldsOnFile for checking single file's meta fields after editing

* add MetaErrorMessage component, mobile and desktop styles

* use AggregateRestrictionError again

* metaFieldIdToName — use names of meta fields instead of id

* Update MetaErrorMessage.js

* desktop style tweaks

* update jest snapshot
2021-11-05 15:00:43 +00:00
Merlijn Vos
f6f07b164a
Fix @uppy/unsplash upload (#3272)
- 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>
2021-10-21 12:10:37 +02:00
Lars Fernhomberg
8985283572
Disable drop state for non-files (#2449)
* 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>
2021-10-20 17:01:30 +01:00
Merlijn Vos
3002201f38
Fix i18n error in CopyLinkButton (#3235) 2021-10-01 17:39:25 +02:00
Merlijn Vos
b7559acd7c
Make @uppy/unsplash production ready (#3196)
Co-authored-by: Alexander Zaytsev <nqst@users.noreply.github.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-10-01 16:31:58 +02:00
Murderlon
b34394ba56
Revert "Fix i18n error in CopyLinkButton"
This reverts commit cc81561ec6.
2021-10-01 15:28:31 +02:00
Murderlon
cc81561ec6
Fix i18n error in CopyLinkButton 2021-10-01 15:27:45 +02:00
Merlijn Vos
a298e59f17
Show all details on mobile when showProgressDetails is true (#3174) 2021-09-20 15:47:28 +02:00
Antoine du Hamel
c33c4e43b2
@uppy/dashboard: fix linter (#3206) 2021-09-20 15:44:34 +02:00
Merlijn Vos
bbb035a9df
Fix autoOpenFileEditor for @uppy/dashboard (#3186) 2021-09-10 12:38:55 +02:00
Artur Paikin
dbe3ed25b3
build: add stylelint (#3124)
* add stylelint with stylelint-config-standard

* autofix style issues

* fix more linting issues

* add stylelint-scss

* fix two more

* add stylelint-config-rational-order and autofix order

https://github.com/constverum/stylelint-config-rational-order
2021-08-24 01:37:57 +01:00
Artur Paikin
17b361a286
Core: rename allowMultipleUploads to allowMultipleUploadBatches (#3115)
* allowNewUpload  --> allowMultipleUploadBatches

* noNewAlreadyUploading --> noMoreFilesAllowed

* Disallow drag-drop when allowNewUpload: false in Core

* Fix tests

* add deprecation notice to types

* Update Dashboard.js
2021-08-23 13:19:40 +01:00
Antoine du Hamel
ec87b232e9
meta: enforce no-unused-vars linter rule (#3118)
* meta: enforce `no-unused-vars` linter rule

* meta: fix `@typescript-eslint/no-unused-vars` linter warnings

* meta: enforce `no-unused-expressions` lint rule

* @uppy/companion: fix `tsc` build
2021-08-23 13:10:17 +01:00
Antoine du Hamel
1f0e7a59c0
@uppy/dashboard: fix metafield form validation (#3113)
* @uppy/dashboard: fix metafield form validation

Browsers without support for the HTML `form` attribute would misbehave,
making it impossible to validate the form at all, and potentially validate an
unrelated upper form if users are embeding Uppy inside a a `<form>`.

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

* Add comments

* Fix docs and types
2021-08-19 15:19:48 +01: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
Merlijn Vos
a3aac6ba4c
Create onUnmount in UIPlugin for plugins that require clean up (#3093)
- Create and call `onUnmount` in `UIPlugin` for plugins that require clean up
- Update webcam `stop` to clean up when already recording
- Update "Writing plugins" docs
- Move `onMount` and `onUnmount` from `BasePlugin` into `UIPlugin`
- Update types
2021-08-17 14:52:06 +02:00
Merlijn Vos
667a2366fa
Fix editFile locale usage (#3108) 2021-08-17 12:32:21 +01:00
Merlijn Vos
8fb6078256
Improve a11y of remove button in dashboard (#3088)
* Improve a11y of remove button in dashboard

* Update `en_US.js`

* Update fr_FR.js

* Update `nl_NL.js`

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-08-10 19:04:42 +01:00
Antoine du Hamel
8f7e63b882
Revert "dashboard: mostly restore backwards compatibility for the browse strings (#2397)" (#3082)
This reverts commit 72965029f2.

Refs: https://github.com/transloadit/uppy/pull/2397
2021-08-09 19:33:24 +02:00
Antoine du Hamel
d94c7d1232
build: harden locale pack check for unused or duplicate key (#3081) 2021-08-09 19:32:44 +02:00
Artur Paikin
2b52d9f9ab fileSource string is unused 2021-08-02 21:48:36 +01:00
Artur Paikin
2f791c1747 @uppy/dashboard,@uppy/status-bar: call core methods directly (#3062)
Instead of passing props with x = uppy.x, pass uppy and call methods on
it directly (no need to use `.bind`).
2021-08-02 16:11:28 +02:00
Antoine du Hamel
9b0d25068d
build: fix building on Node.js v14.x LTS (#3061) 2021-08-02 12:36:25 +01:00
Artur Paikin
bb1c615dc4 Merge conflict, Editor.js 2021-07-30 14:31:21 +01:00
Artur Paikin
172cc77f63 Merge master 2021-07-30 14:27:21 +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
Antoine du Hamel
defc7b40f8
deps: replace cuid with nanoid (#3053)
Refs: https://github.com/transloadit/uppy/pull/3040#issuecomment-886468554
2021-07-29 17:29:52 +02:00
Renée Kooi
dd55949b79
Remove backwards compatibility hacks in locales (#2969)
* Remove poweredBy2 hack

* Remove exceedsSize2 hack

* tick off poweredBy/exceedsSize task

* do not lint generated files

* fix tests
2021-07-29 15:09:25 +02:00
Antoine du Hamel
56b84dfec7
Dashboard: add required option to metaFields (#2896)
* Dashboard: add `required` option to `metaFields`

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

* use `<form>` element to allow users to use all built-in form features
from the web browser.

* remove `saveOnEnter` hack

The fields are now inside a form, saving on Enter is the default
behavior – and it doesn't short-circuit form validation checks.

* restrictions.requiredMetaFields

* fix documentation of restrictions.requiredMetaFields

* check for required meta fields on upload

* Use detached `<form>` element to avoid nesting `<form>` elements

* fixup! Use detached `<form>` element to avoid nesting `<form>` elements

* Use `cuid` to generate `<form>` `id`
2021-07-29 13:15:36 +01:00
Antoine du Hamel
836a731d73
@uppy/core: avoid binding methods to instance in constructor (#3043)
Core classes methods are not suited to be used as eventHandlers, I don't
think it makes sense to have them bound.
2021-07-28 23:38:58 +01:00
Artur Paikin
f20330aee9
Dashboard: rename Done to Cancel, add Save to Image Editor (#3033)
* Rename Done button to Cancel everywhere

* Add Save button to the top bar of the FileEditor

* Remove Save button from Image Editor toolbar

* fix locale
2021-07-21 14:07:42 +01:00
Merlijn Vos
f01538ba41
Resolve all type TODO's (#2963) 2021-07-20 14:40:31 +02:00
Artur Paikin
005a7e48ec
showLinkToFileUploadResult: false by default (#2994) 2021-07-08 18:10:36 +01:00
Murderlon
fe96096c3d
Merge branch 'master' into 2.0
* master: (23 commits)
  A bit of polish (#2986)
  Companion: Fix typescript error
  Companion: Fix invalid referrer crashing the process
  Publish 1.30 blog post
  Release
  Build: Companion needs to be built before locale-pack
  Release
  Fix build: locale-pack first, integrations second
  changelog for 1.30
  Release
  Update package.json
  Only log info if debug is true (#2855)
  build(deps): bump prismjs from 1.23.0 to 1.24.0 (#2971)
  Angular Integration (#2871)
  ci: don't run markdown tests in type tests
  Add types for `uppy.once` method (#2965)
  build: lint fixes in build scripts
  Fix typo in docs/progressbar.md (#2962)
  Document `uppy.once` in `docs/uppy.md` (#2960)
  Add `props` example to docs/vue.md (#2959)
  ...
2021-07-07 15:32:38 +02:00
Andrew
8f4cc89a9e
Angular Integration (#2871)
* feature(integration): initial Angular framework implementation

* Package cleanup

* Actually add the components this time

* fix rendering bug

* Add documentation

* dependency fixes

* add broken example

* Make locales ignore angular

* dependency updates

* Update package-lock.json

* Fix broken example

* Make example consistent with docs

* angular: Update styling advice

* angular: Build system stuff

* angular: Escape dependency hell

* angular: Add dashboard-modal component

* angular: Update package.json/prepare for release

* angular: Fix styling bugs

* add Angular dependencies

* Update README.md

* lint fixes — those deps are in root

* Update README.md

Co-authored-by: Adam Medford <adammedford@gmail.com>
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2021-06-30 11:36:57 +01:00