* Changed aria-level attribute to correct syntax.
Changed the aria-level attribute to the correct syntax. Changes were also made to meet ADA compliance.
* update a few more aria-level attributes
Co-authored-by: Renée Kooi <renee@kooi.me>
* core: add an addFiles() method that only updates state once
Previously, adding 1300-ish files took around 260ms, and looked like
this in Firefox's performance tab:

All of the downward peaks are `setState()` calls and GC.
Now it takes around 60ms, and looks like this:

Here, most of the time is spent generating file IDs and guessing file
types. Those would be areas to look at next.
* dashboard: prevent frequent state update if nothing changed
After the last commit, `addFiles()` still spends a lot of time in
`emit()` and `hideAllPanels()`. The reason is that `addFiles()` still
emits all the hundreds of file-added events, and the Dashboard responds
to each with `hideAllPanels()`, which does a state update. But this all
happens synchronously, and the state almost certainly did not change
since the last `file-added` event that fired a millisecond ago.
This adds a check to avoid the state update if it is not necessary.

Adding 1300 files takes about 40ms now.
With this change, the `addFiles()` call is no longer the slowest
part—now preact rendering all the items is!
* utils: optimize generateFileID and getFileNameAndExtension
Replaces some clever things with more mundane and faster things!
Now, generateFileID is a bunch of string concatenations.
Now, getFileNameAndExtension uses `lastIndexOf()` instead of a regex.

Adding 1300 files takes about 25ms.
* dashboard: use preact-virtual-list
* thumbnail-generator: add `lazy` option
* dashboard: request thumbnails once file item renders the first time
* dashboard: fork preact-virtual-list
* core: add removeFiles() to remove files in bulk
* Implement removeFile() in terms of removeFiles()
* thumbnail-generator: only queue files that can be previewed
* rename size constants to accommodate WIDTH/HEIGHT
* Use new uppy.addFiles in DragDrop and FileInput
* utils: fix getFileNameAndExtension() type
* Rip out the lazy thumbnail generation
* Rip out virtualization.
* Remove virtualization leftovers
* tell future people that this is intentionally verbose
* Update package-lock.json
* henlo i am spell
* Make `addFiles()` respect maxNumberOfFiles
* core: show an informer error if some files fail in bulk add
* locales: fix quotes to make build:locale-pack happy
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
Updating `dropEffect` on `ondrop` doesn't matter, since the effect will
already have been executed at that point. It should be updated in
ondragenter/ondragover instead.
fixes#1978
* Add a method to update options in Core
* Add a method to update options in Plugin (for any plugins)
* Allow re-initializing i18n locales after they’ve been updated with .setOptions
* use rest spread instead of Object.assign
* override setOptions in plugins to include i18nInit
* merge restrictions object in setOptions
* check that newOpts exists
* add spread ...
* don’t double merge
* add i18nInit to all plugins that use translation strings
* add setOptions tests to Core and Dashboard
* add setOptions docs for Core and Plugins
* fix tests for thumbnail-generator by adding plugins: {} to mock core
cause ThumbnailGenerator now calls this.setPluginState, which expects `core.state.plugins`
* also update meta with setOptions if it’s passed, change the way this.opts is set in core
@goto-bus-stop does this look ok? merging restrictions opts in core
* if locale was passed to setOptions(), call plugin.setOptions() on all plugins, so that i18n updates
* add Dashboard test that checks if locale is updated from Core via setOptions()
* Reafactor website Dashboard example to use setOptions and allow selecting a locale
🎉
The `...props` object that we were spreading into `<FileProgress />`
contained another, different `error` prop, which was empty for
individual file upload failures. By putting the `...props` spread in
front, the file-specific error takes precedence over the global error.
Fixes#1881
* add waitForThumbnailsBeforeUpload option, false by default: enter preprocess stage until all thumbnails are generated and all exif data is added
* check if the queue is empty already, then resolve immediately
* add EXIF data to file meta, use uppy.once instead of on
* add generatingThumbnails locale
* delete the thumbnail from exif metadata, because it contains a blob
* @utils/getDroppedFiles.js - mild refactoring
* @utils/getDroppedFiles.js - added .info and .log on drop error
* @utils/getDroppedFiles.js - one more refactor
* @utils/getDroppedFiles.js - log error objects instead of strings
* Update eslint
* Do eslint --fix
* Do not access Object.prototype method 'hasOwnProperty' from target object
* utils: add hasProperty
* eslint --fix
* Disable quote-props for locale files
* add back quotes in locale files
* revert locale files to state on master
* Update react-scripts
* add dashboard:file-edit-start and dashboard:file-edit-complete events
* Small docs change
1. Changed unusual quotes `“` to the ones we use in other places `"`
2. `then user` => `the user`
* prettify quotes
* everywhere - decorative changes
* /examples - fix duplicate logs in examples
* @uppy/dashboard - only fire the safety resize if we're not in a closed modal
* website/examples - made sure console.debug works in IE10
* lerna link convert
* ci: use npm ci
* update lockfile
* companion: set `bin` to source file
Since typescript doesn't actually transform anything, we can just use
this.
In a next major version we could set `noEmit: true` in the tsconfig and
stop publishing `lib`.
* companion: do chmod +x on start-server.js
* build: remove obsolete lerna config
* build: explicitly install latest versions when building e2e tests for ci
* Remove versions from private packages
* fix regex
* try fix
* ci: force npm to install to endtoend folder
* ci: fold up e2e build output
* Update netlify deploy preview command
* Remove mentions of npm run bootstrap
* Edit .github/CONTRIBUTING.md instead
* companion: add proxy executable
* companion: fix publish
* Downgrade jest to appease create-react-app
* Replace prettier-bytes with its copy, only use 1024 instead of 1000 to justify KB vs kB
* Add tests
* added License
* pretty-bytes to @uppy/utils/lib/prettyBytes everywhere
* Set file.type before calling onBeforeFileAdded, throw in upload so .catch works, emit restriction-failed for minNumberOfFiles, too
We must throw in upload onError, otherwise .catch won’t catch
* It seems startUpload is not used in Dashboard, used in StatusBar instead
probably a leftover from before StautsBar became a standalone plugin
* only log non-restriction errors
* throw early if restrictions.allowedFileTypes is not an array
* flip condition: do emit the event if err.isRestriction
* @uppy/locales - updated Nl translation as per Kevin
* @uppy/provider-views - moved all translations to Core, removed dependency on Dashboard
* @uppy/locales - added missing translations for 'Add more'
* @uppy/dashboard - factored out and visually nested FileCard scss
(Without changing any actual styles)
* @uppy/dashboard - positioned image previews well in FileCard.js for IE11
And updated CSS to depend on predictable flexbox logic.
* @uppy/dashboard - FileCard.js, ensured Firefox respects flexbox, and fixed border-radius in Safari
* @uppy/dashboard - FileCard.js, fixed imports, moved local classes to local css file
* @uppy/dashboard - FileCard.js, changed classNames as per the new convention
* @uppy/dashboard - FileCard.js, removed unneeded binds
* eslint - added the eslint warning for no unused vars
* eslint - commented out unused-variables rule
It's handy to have nearby, but we don't want to discriminate against all unused variables, sometimes they are expressive.
* dashboard: reduce rerendering of FileItems
* dashboard: move pure HOC to util file
* dashboard: memoize arrays passed to child elements too
* dashboard: fix memoize-one import when bundler used `module` key
* Log error in uppy.addFile try/catch
* Add `.isRestriction` to a custom RestrictionError, check for that before logging
* keep throwing for robodog.upload
//cc @goto-bus-stop
* /examples/dev - added drag-drop plugin dev environment
* @uppy/drag-drop - moved isDragDropSupported() to @uppy/utils
* @uppy/drag-drop - got rid of drag-drop npm library
* examples/dev - made compiled files placed in /output instead of /lib
* ~/examples/dev - made watchify only watch files once
* @uppy/drag-drop - add onPaste
* /examples/dev - readded html css override-attempts
* @uppy/drag-drop - made whole area clickable, and made it accessible
* @uppy/drag-drop - removed excessive outline in firefox
* change dragText classname to browse, minor spacing and order changes
* /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
* Refactor to fix loosing metadata state on re-renders
* uppy-DashboardContent-bar shouldn’t shrink
* Populate formState in constructor, empty meta value if undefined, pass field.id from oninput
* Use local styles instead of unpkg CDN
* update locales and stargazers
* @uppy/provider-views - added accessibility
* @uppy/provider-views - simplified checkbox css
* @uppy/dashboard - on tab set focus to the current verlay
* @uppy/dashboard - factored out code related to focus into a separate file
* @uppy/dashboard, and connected plugins - made focus travel well, and be managed in a single place in Dashboard
* @uppy/dashboard - made modal opener button focus keep focus on modal close
* @uppy/dashboard - focus management for uploaded-files
* @uppy/dashboard - made informer read messages without interruption
* @uppy/provider-views - removed the bug of focus jumping on safari
* @uppy/dashboard - made focus travel well in instagram in firefox
* @uppy - moved lodash.debounce dependency from / to @uppy/dashboard
* everywhere - made <ul>s not focusable for firefox
* @uppy/provider-views - unnested scss, copypasted alex's :focus changes
* Added JSDoc eslint package and rules, and fixed some JSDoc comments
* .eslintrc - made jsdoc errors warnings instead
* package-lock.json for new package.json
* eslint fix
* @uppy/dashboard - avoid forcing focus when we are inline
* @uppy/dashboard - in firefox, made sure superfocus is not switching back to uppy
* @uppy/dashboard - no focus jump for .info() inline, fix for firefox
Made focus not interrupt .info() when we are in the inline mode;
Made firefox start superfocusing when we either tab into, or click on some element in Uppy
* @uppy/dashboard - only listen to click/focus on uppy
* @uppy/dashboard - started trapping focus in inline mode too
* @uppy/dashboard - restricted trapFocus() event listener to this.el
* @uppy/core - started throttling progress emits.
1. To fix heat up in firefox
2. To fix focus in firefox
* @uppy/core - fixed tests by adding .flush()-s for progress emits
* @uppy/dashboard - stopped trapping focus in inline mode, made background inert
* @uppy/dashboard - added MutationObserver polyfill
* tests - made locale-packs.js pass
* REVERTED last 3 commits that introduced inert
Inert requires too many polyfills, atm tests fail in IE 10.0, wicg-inert library reportedly has performance issues. We decided to at least wait until _some_ browser introduce inert html property natively.
* @uppy/dashboard - IE11 fix for focusing
* @uppy/dashboard - fix for a bug in Safari for long uploads with checkbox clicking
* RERUN TESTS - tiny commit to rerun tests
* @uppy/dashboard - removed useless touchstart event listener
* Cancel superFocus in recordIfFocusedOnUppyRecently, when focus moves away from Uppy
* @uppy/provider-views - made Filter not swallow letters
* @uppy/dashboard - stopped superfocus from refocusing if we're already in the overlay
* /examples/dev - added drag-drop plugin dev environment
* @uppy/drag-drop - moved isDragDropSupported() to @uppy/utils
* @uppy/drag-drop - got rid of drag-drop npm library
* examples/dev - made compiled files placed in /output instead of /lib
* ~/examples/dev - made watchify only watch files once
* @uppy/drag-drop - add onPaste
* /examples/dev - readded html css override-attempts
* @uppy/drag-drop - made whole area clickable, and made it accessible
* @uppy/drag-drop - removed excessive outline in firefox
* REVERTED last 2 commits