Commit graph

48 commits

Author SHA1 Message Date
Artur Paikin
68f36b1ac2
Refactor FileProgress component (#2303)
* 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
2020-06-06 04:10:01 +02:00
Artur Paikin
dd5f0b23b4
webcam: Show “enable camera” screen if no camera device was detected (#2282)
* show “enable camera” screen if no camera device was detected

* update locale strings
2020-05-25 12:16:54 +02:00
Alexander Zaytsev
57da3a5a80
Dark mode design improvements (#2232)
* Modify highlight/link color

* Paler dashed outline

* Simpler input focus

* Tweak statuses' gray

* Tweak & fix :focus colors

* Swap TabBtn hover/focus colors

* Tweak dark focus outline

* Darker actionBtn

* Webcam button support

* Add isDraggingOver support

* Add ScreenCapture support

* ProviderBrowserItem-inner support

* Better fakeCheckbox support
2020-05-05 18:02:24 +02:00
Artur Paikin
53138f48f8 move from white to off-white 2020-04-24 09:17:37 +02:00
Artur Paikin
a6c8ef15e1
ScreenCapture plugin for screenshots / screen recordings (#2132)
* Finnish locale semantics improved

* Finnish semantics improved

* Screen capture initial commit

* Fix. Removed audio constraint from video.

* ui improvements

* so Lerna doesn’t try to publish as private

* refactor, tweak icons

* remove commented code from webcam styles

* Check for MediaRecorder (hides button in Safari) and refactor everything

* update readme

* beta for now

Co-authored-by: Miika Jukakoski <miika.jukakoski@ourmind.io>
2020-04-21 20:47:20 +02:00
Renée Kooi
876f8a2fc0
webcam: Try to respect restrictions (#2090)
* 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>
2020-03-24 18:53:36 +01:00
Artur Paikin
5079d98584
dashboard: 2020 redesign 🍿 (#2015)
* 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
2020-03-24 18:05:11 +01:00
Naveed Ahmad
dd3f72aef3
Fix#2071 Check the availability isTypeSupported api before call… (#2072)
* Check the availability isTypeSupported api before calling.

This will fix #2071

* Run `eslint --fix`

Co-authored-by: Renée Kooi <renee@kooi.me>
2020-02-17 12:26:03 +01:00
Dominic Eden
e7fbaa940d [feature] - Add new ‘showRecordingLength’ option for the Webcam plugin (#1947)
* [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.
2019-11-27 20:10:38 +03:00
Artur Paikin
4e54483e61 core: setOptions for Core and plugins (#1728)
* 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

🎉
2019-11-04 10:33:30 +01:00
Renée Kooi
733de659da
Upgrade standard to v14 (#1860)
* Update eslint dependencies.

* standard --fix

* build: disable handler name lint rule

* status-bar: manually fix lint errors

* webcam: manually fix lint errors

* url: manually fix lint errors

* react-native: manually fix lint errors

* dashboard: manually fix lint errors

* informer: manually fix linting errors

* progress-bar: manually fix lint errors

* provider-views: manually fix lint errors

* redux-dev-tools: manually fix lint errors

* build: disable buggy no-unused-vars rule

* examples: manually fix lint errors

* ` quotes for code things, ' for text things
2019-10-09 14:53:02 +02:00
Renée Kooi
c62ec3665d Update eslint to v6 (#1777)
* 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
2019-08-13 21:45:30 +03:00
Dave Kiss
d5b45a82ff Allow definition of MediaRecorder mimeType (#1708)
* 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/MediaRecorder
https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/isTypeSupported
https://cs.chromium.org/chromium/src/third_party/blink/web_tests/fast/mediarecorder/MediaRecorder-isTypeSupported.html?q=MediaRecorder-isTypeSupported&dr
https://www.webmproject.org/about/faq/

* Constantize preferredMimeType

* Lint fix

* Change option name to preferredVideoMimeType

* One more preferredVideoMimeType

* Update comment

* docs: add preferredVideoMimeType
2019-07-08 12:14:53 +02:00
Artur Paikin
5e35987079
Log error in uppy.addFile try/catch (#1680)
* 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
2019-06-28 20:25:17 +03:00
Evgenia Karunus
7ce63fcb7e Accessibility follow-up PR: make all svgs not focusable in IE11 (#1662)
* /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
2019-06-17 17:08:05 +03:00
Artur Paikin
e2e7e1d540 remove old debug console.log 2019-06-14 19:11:50 +03:00
Artur Paikin
7de8464a54
Change webcam file name so that it fits on one line in Dashboard (#1660) 2019-06-12 23:30:33 +03:00
Evgenia Karunus
6bcf2040e9 Feature/accessibility (#1507)
* @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
2019-06-11 19:10:32 +03:00
Renée Kooi
980210f76c
Add VERSION properties to all plugins.
And remove the proposal-object-rest-spread plugin because it is built
into preset-env now.
2019-05-27 16:53:47 +02:00
Renée Kooi
3b1d5b933f
Update eslint-plugin-compat and eslint-plugin-jest 2019-05-20 11:29:10 +02:00
Renée Kooi
f97b3931bb
Upgrade eslint. 2019-05-20 11:28:44 +02:00
Renée Kooi
4840ed4c39
webcam: fix supportsMediaRecorder test
arrow functions do not have a prototype.
2019-05-20 11:27:04 +02:00
Artur Paikin
28fce1a137 Default locale for all plugins (#1443)
* 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
2019-04-17 13:34:23 +02:00
Alexander Zaytsev
8be12fdd42 Organize color variables (now they're without color- prefix 2019-04-10 11:12:21 +03:00
Alexander Zaytsev
25e8369c6a Get rid of $color-gray 2019-04-10 10:52:27 +03:00
Alexander Zaytsev
eb854fb9fb Replace $color-black with $gray-800 in some places 2019-04-10 10:29:39 +03:00
Alexander Zaytsev
f1916f6712 Simplify color name: cornflower-blue -> blue 2019-04-09 15:42:04 +03:00
Alexander Zaytsev
851e2c7bdd Subtle hover 2019-04-09 13:25:32 +03:00
Alexander Zaytsev
624bf7d314 Fix spacing 2019-04-09 13:24:42 +03:00
Alexander Zaytsev
879664fd39 Remove optional xmlns attribute from the SVGs 2019-04-09 12:12:31 +03:00
Artur Paikin
7a640071cb don’t show Smile! if countdown is false 2019-03-04 22:06:16 +03:00
Artur Paikin
cd8fae0ac9 Don’t bundle Core styles with everything, because of CSS conflicts
To use Dashboard, you now have to include the following css:
```js
import '@uppy/core/dist/style.css'
import '@uppy/dashboard/dist/style.css'
```
2018-11-22 13:59:02 +03:00
Artur Paikin
68730f8a1b Fix a bug where Webcam video was overflowing its container 2018-11-16 01:52:11 +03:00
Artur Paikin
5ec15c11ca update this.translator = new Translator in all plugins that use i18n
I wonder if this could somehow be done in Plugin class once
2018-10-20 12:50:34 -04:00
Artur Paikin
7c19386114 Save actual plugin instance instead of plugin.id in this.parent 2018-09-19 19:21:42 -04:00
Artur Paikin
f8020d877b add commented parent.hideAllPanels call
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
2018-09-19 19:13:52 -04:00
Kent Johnson
0c245855ba Fix for Cordova mangling new File instances 2018-09-02 19:46:22 -05:00
Artur Paikin
f18c1de768 tweak Webcam permission screen copy 2018-07-27 22:43:10 -04:00
Artur Paikin
8082bf4fa1 use .uppy-size--md everywhere 2018-07-27 22:40:07 -04:00
Artur Paikin
2b79112700 add uppy-DashboardContent-panelBody wrapper 2018-07-26 14:45:31 -04:00
Artur Paikin
a9cb820d9a styles 2018-07-26 02:08:01 -04:00
Artur Paikin
66a7457c52 Allow setting custom names for plugins
Closes #920
2018-07-26 02:04:40 -04:00
Artur Paikin
ac77507fa8 PanelTopBar, refactor to remove excess containers 2018-07-22 23:58:07 -04:00
Artur Paikin
77f363ced7 styles, svg 2018-07-02 10:17:50 -04:00
Artur Paikin
6cc9f80b53 Colored icons 2018-07-02 10:15:17 -04:00
Renée Kooi
72689d01ac
Export Plugin class from @uppy/core. 2018-06-28 12:20:21 +02:00
Renée Kooi
382f4fba95
Move stylesheets into packages. 2018-06-18 12:35:47 +02:00
Renée Kooi
f1751140a3
Move Webcam to @uppy/webcam. 2018-06-14 16:31:19 +02:00