* 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
* webcam: request a video mime type listed in `allowedFileTypes`
* webcam: stop recording when we are about to reach the max file size
* webcam: request an image mime type listed in `allowedFileTypes`
* docs: add Webcam#preferredImageMimeType
* locale: add `recordingStoppedMaxSize` string
* changelog: check webcam restrictions
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
* 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
* [feature] - Add new ‘showRecordingLength’ prop for the Webcam plugin. When this is true, it counts the duration of a recording and displays it to the user. Add a test for generating the correct duration of the recording.
* Update packages/@uppy/webcam/src/style.scss
Co-Authored-By: Artur Paikin <artur@arturpaikin.com>
* Added i18n for the recording length counter and update Readme. Fix Webcam styles where some styles were not in alphabetical order.
* Update packages/@uppy/webcam/src/style.scss
Co-Authored-By: Artur Paikin <artur@arturpaikin.com>
Added i18n for the recording length counter and update Readme. Fix Webcam styles where some styles were not in alphabetical order.
* 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
🎉
* 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
* Allow definition of MediaRecorder mimeType
This PR introduces a new option for the `@uppy/webcam` plugin called `preferredMimeType` which defaults as `null`.
If a value is passed, the browser's `MediaRecorder` implementation checks if the `preferredMimeType` is supported, and if it thinks it is, will attempt to record using the `preferredMimeType` rather than the browser default.
If the `preferredMimeType` is unsupported, the browser will fall back to using its default recording mime type.
This allows, for example, a user to pass `preferredMimeType: "video/webm"` during the `@uppy/webcam` plugin construction which will instruct the browser to record to a `.webm` container.
Specific codecs may also be passed here. For example, `video/webm;codecs=vp8` may still parse as valid by the browser.
## Limitations
This does not currently change the mime type for captured images on line 282 (`image/jpeg`) and will only pass the `preferredMimeType` to the browser `MediaRecorder` API.
### Reference
https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorderhttps://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/isTypeSupportedhttps://cs.chromium.org/chromium/src/third_party/blink/web_tests/fast/mediarecorder/MediaRecorder-isTypeSupported.html?q=MediaRecorder-isTypeSupported&drhttps://www.webmproject.org/about/faq/
* Constantize preferredMimeType
* Lint fix
* Change option name to preferredVideoMimeType
* One more preferredVideoMimeType
* Update comment
* docs: add preferredVideoMimeType
* 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 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
* @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
* first swing at building locale pack
* expose default locale on the plugin instance
* write a pretty en_US locale to a file, using stringify-object and template.js
* generated locale pack
* start adding a script that checks for unused locale strings
Co-Authored-By: Kevin van Zonneveld <kevin@transloadit.com>
* Update bin/build-locale-pack.js
* Console output improvements
* Also sort plugin locale keys
* Support dependencies when digging up sources
because e.g. 'emptyFolderAdded' is used in provider-views but set in Dashboard's defaultLocale
* More complex matching
So can can support cases like: `uppy.i18n(error.isAuthError ? 'companionAuthError' : 'companionError')`
* Remaining const defaultLocale -> this.defaultLocale
* Update packages/@uppy/locales/en_US.js
* Mock browser environment so all plugins can be instantiated
* Clean up output a bit
* Update bin/build-locale-pack.js
* Add all remaining plugin's locales to en_US bundle
* Update packages/@uppy/dashboard/src/index.js
* Update en_US.js
Co-Authored-By: Kevin van Zonneveld <kevin@transloadit.com>
* remove unused strings
Co-Authored-By: Kevin van Zonneveld <kevin@transloadit.com>
* Also write csv because that makes it real easy to import to friendlier places for translators /cc @arturi
* don’t set locale: this.defaultLocale — it overrides the lang pack
Co-Authored-By: Kevin van Zonneveld <kevin@transloadit.com>
* Add 'russian plural' for english, for consistency
Allows us to signal that this is possible in new target languages, and also run better linting
* Cleanup
* No longer write csv
* WIP for NL
* Create package.json
Co-Authored-By: Kevin van Zonneveld <kevin@transloadit.com>
* move locales to /src
Co-Authored-By: Kevin van Zonneveld <kevin@transloadit.com>
* ignore locales themselves
Co-Authored-By: Kevin van Zonneveld <kevin@transloadit.com>
* build minified locale packs
Co-Authored-By: Kevin van Zonneveld <kevin@transloadit.com>
* expose Uppy.locale = {} placeholder object
Co-Authored-By: Kevin van Zonneveld <kevin@transloadit.com>
* Update ru_RU.js
Co-Authored-By: Kevin van Zonneveld <kevin@transloadit.com>
* add locale bundles to example
Co-Authored-By: Kevin van Zonneveld <kevin@transloadit.com>
* Upload locales to cdn
* Allow to run tests with upload-to-cdn by setting a versionSuffix
* Move locale build to function, to make room for test()
* Bring ru_RU in sync with English
now that we've added 3 plural types across the board
* Document using locales as a consuming dev, and plugin dev
* Add linting for missing/excess locale strings
* Add the locales we had to remove to the legacy folder
and explain why they cannot make it back
* Move legacy outside of src so they are definitely not transpiled, etc
* Update packages/@uppy/locales/src/nl_NL.js
* Update website/src/docs/uppy.md
in case we need to manually close Dashboard panels, we now have a `this.parent` propety on Plugins, which means we can do `this.uppy.getPlugin(this.parent)` instead of `this.uppy.getPlugin('Dashboard')` — no need to know plugin id, see https://github.com/transloadit/uppy/issues/1057