mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-27 20:27:13 +00:00
Merge branch 'master' into ig-uploads
This commit is contained in:
commit
459abae480
280 changed files with 20221 additions and 5689 deletions
248
.github/CONTRIBUTING.md
vendored
Normal file
248
.github/CONTRIBUTING.md
vendored
Normal file
|
|
@ -0,0 +1,248 @@
|
|||
## Uppy development
|
||||
|
||||
Fork the repository into your own account first. See the [GitHub Help](https://help.github.com/articles/fork-a-repo/) article for instructions.
|
||||
|
||||
After you have successfully forked the repo, clone and install the project:
|
||||
|
||||
```bash
|
||||
git clone git@github.com:YOUR_USERNAME/uppy.git
|
||||
cd uppy
|
||||
npm install
|
||||
npm run bootstrap
|
||||
```
|
||||
|
||||
We use lerna to manage the many plugin packages Uppy has. You should always do `npm run bootstrap` after an `npm install` to make sure lerna has installed the dependencies of each package and that the `package-lock.json` in the repository root is up to date.
|
||||
|
||||
Our website’s examples section is also our playground, please read the [Local Previews](#Local-Previews) section to get up and running.
|
||||
|
||||
## Tests
|
||||
|
||||
Unit tests are using Jest and can be run with:
|
||||
|
||||
```bash
|
||||
npm run test:unit
|
||||
```
|
||||
|
||||
For acceptance (or end-to-end) tests, we use [Webdriverio](http://webdriver.io). For it to run locally, you need to install a Selenium standalone server. Just follow [the guide](http://webdriver.io/guide.html) to do so. You can also install a Selenium standalone server from NPM:
|
||||
|
||||
```bash
|
||||
npm install selenium-standalone -g
|
||||
selenium-standalone install
|
||||
```
|
||||
|
||||
And then launch it:
|
||||
|
||||
```bash
|
||||
selenium-standalone start
|
||||
```
|
||||
|
||||
After you have installed and launched the selenium standalone server, run:
|
||||
|
||||
```bash
|
||||
npm run test:acceptance:local
|
||||
```
|
||||
|
||||
By default, `test:acceptance:local` uses Firefox. You can use a different browser, like Chrome, by passing the `-b` flag:
|
||||
|
||||
```bash
|
||||
npm run test:acceptance:local -- -b chrome
|
||||
```
|
||||
|
||||
> Note: The `--` is important, it tells npm that the remaining arguments should be interpreted by the script itself, not by npm.
|
||||
|
||||
You can run in multiple browsers by passing multiple `-b` flags:
|
||||
|
||||
```bash
|
||||
npm run test:acceptance:local -- -b chrome -b firefox
|
||||
```
|
||||
|
||||
When trying to get a specific integration test to pass, it's not that helpful to continuously run _all_ tests. You can use the `--suite` flag to run tests from a single `./test/endtoend` folder. For example, `--suite thumbnails` will only run the tests from `./test/endtoend/thumbnails`. Of course, it can also be combined with one or more `-b` flags.
|
||||
|
||||
```bash
|
||||
npm run test:acceptance:local -- -b chrome --suite thumbnails
|
||||
```
|
||||
|
||||
These tests are also run automatically on Travis builds with [SauceLabs](https://saucelabs.com/) cloud service using different OSes.
|
||||
|
||||
## Releases
|
||||
|
||||
Before doing a release, check that the examples on the website work:
|
||||
|
||||
```bash
|
||||
npm start
|
||||
open http://localhost:4000/examples/dashboard
|
||||
```
|
||||
|
||||
Also check the other examples:
|
||||
|
||||
```bash
|
||||
cd examples/EXAMPLENAME
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
Releases are managed by [Lerna](https://github.com/lerna/lerna/tree/2.x). We do some cleanup and compile work around releases too. Use the npm release script:
|
||||
|
||||
```bash
|
||||
npm run release
|
||||
```
|
||||
|
||||
If you have two factor authentication enabled on your npm account, you will need to temporarily disable it when doing an uppy release. Lerna doesn't support 2FA, and while there are workarounds, they don't reliably work for us. (In particular, using the `npm_config_otp` environment variable will fail because the token expires by the time the release script starts publishing anything.)
|
||||
|
||||
```bash
|
||||
npm profile disable-2fa
|
||||
npm run release
|
||||
npm profile enable-2fa auth-only
|
||||
```
|
||||
|
||||
Other things to keep in mind during release:
|
||||
|
||||
* When doing a minor release below 1.0, or a major release >= 1.0, of the `@uppy/core` package, the peerDependency of the plugin packages needs to be updated first. Eg when updating from 0.25.5 to 0.26.0, the peerDependency of each should be `"@uppy/core": "^0.26.0"` before doing `npm run release`.
|
||||
* When publishing a new package, publish it manually first with `npm publish --access public`, since by default `@`-prefixed packages are private on NPM, and Lerna will fail.
|
||||
|
||||
After a release, the demos on transloadit.com should also be updated. After updating, check that some things work locally:
|
||||
|
||||
- the demos in the demo section work (try one that uses an import robot, and one that you need to upload to)
|
||||
- the demos on the homepage work and can import from GDrive, Insta, Dropbox
|
||||
|
||||
If you don't have access to the transloadit.com source code ping @arturi or @goto-bus-stop and we'll pick it up. :sparkles:
|
||||
|
||||
## Website development
|
||||
|
||||
We keep the [uppy.io](http://uppy.io) website in `./website`, so it’s easy to keep docs and code in sync as we are still iterating at high velocity.
|
||||
|
||||
The site is built with [Hexo](http://hexo.io/), and Travis automatically deploys this onto GitHub Pages (it overwrites the `gh-pages` branch with Hexo's build at every change to `master`). The content is written in Markdown and located in `./website/src`. Feel free to fork & hack!
|
||||
|
||||
Even though bundled in this repo, the website is regarded as a separate project. As such, it has its own `package.json` and we aim to keep the surface where the two projects interface as small as possible. `./website/update.js` is called during website builds to inject the Uppy knowledge into the site.
|
||||
|
||||
### Local previews
|
||||
|
||||
It is recommended to exclude `./website/public/` from your editor if you want efficient searches.
|
||||
|
||||
To install the required node modules, type:
|
||||
|
||||
```bash
|
||||
npm install && cd website && npm install && cd ..
|
||||
```
|
||||
|
||||
For local previews on http://localhost:4000, type:
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
This will watch the website, as well as Uppy, as the examples, and rebuild everything and refresh your browser as files change.
|
||||
|
||||
Then, to work on, for instance, the XHRUpload example, you would edit the following files:
|
||||
|
||||
```bash
|
||||
${EDITOR} src/core/Core.js \
|
||||
src/plugins/XHRUpload.js \
|
||||
src/plugins/Plugin.js \
|
||||
website/src/examples/xhrupload/app.es6
|
||||
```
|
||||
|
||||
And open <http://localhost:4000/examples/xhrupload/> in your web browser.
|
||||
|
||||
## CSS guidelines
|
||||
|
||||
The CSS standards followed in this project closely resemble those from [Medium's CSS Guidelines](https://gist.github.com/fat/a47b882eb5f84293c4ed). If something is not mentioned here, follow their guidelines.
|
||||
|
||||
### Naming conventions
|
||||
|
||||
This project uses naming conventions adopted from the SUIT CSS framework.
|
||||
[Read about them here](https://github.com/suitcss/suit/blob/master/doc/naming-conventions.md).
|
||||
|
||||
To quickly summarize:
|
||||
|
||||
#### Utilities
|
||||
|
||||
Syntax: u-[sm-|md-|lg-]<utilityName>
|
||||
|
||||
```css
|
||||
.u-utilityName
|
||||
.u-floatLeft
|
||||
.u-lg-col6
|
||||
```
|
||||
|
||||
#### Components
|
||||
|
||||
Syntax: [<namespace>-]<ComponentName>[-descendentName][--modifierName]
|
||||
|
||||
```css
|
||||
.twt-Button /* Namespaced component */
|
||||
.MyComponent /* Components pascal cased */
|
||||
.Button--default /* Modified button style */
|
||||
.Button--large
|
||||
|
||||
.Tweet
|
||||
.Tweet-header /* Descendents */
|
||||
.Tweet-bodyText
|
||||
|
||||
.Accordion.is-collapsed /* State of component */
|
||||
.Accordion.is-expanded
|
||||
```
|
||||
|
||||
### SASS
|
||||
|
||||
This project uses SASS, with some limitations on nesting. One-level-deep nesting is allowed, but nesting may not extend a selector by using the `&` operator. For example:
|
||||
|
||||
```sass
|
||||
/* BAD */
|
||||
.Button {
|
||||
&--disabled {
|
||||
...
|
||||
}
|
||||
}
|
||||
|
||||
/* GOOD */
|
||||
.Button {
|
||||
...
|
||||
}
|
||||
|
||||
.Button--disabled {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
### Mobile-first responsive approach
|
||||
|
||||
Style to the mobile breakpoint with your selectors, then use `min-width` media queries to add any styles to the tablet or desktop breakpoints.
|
||||
|
||||
### Selector, rule ordering
|
||||
|
||||
- All selectors are sorted alphabetically and by type.
|
||||
- HTML elements go above classes and IDs in a file.
|
||||
- Rules are sorted alphabetically.
|
||||
|
||||
```sass
|
||||
/* BAD */
|
||||
.wrapper {
|
||||
width: 940px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.article {
|
||||
width: 100%;
|
||||
padding: 32px;
|
||||
}
|
||||
|
||||
/* GOOD */
|
||||
h1 {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.article {
|
||||
padding: 32px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
margin: auto;
|
||||
width: 940px;
|
||||
}
|
||||
```
|
||||
5
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
5
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Let us know about an unexpected error, a crash, or an incorrect behavior.
|
||||
labels: Bug, Triage
|
||||
---
|
||||
5
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
5
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
name: Feature request
|
||||
about: Suggest a new feature or other enhancement.
|
||||
labels: Feature, Triage
|
||||
---
|
||||
14
.github/ISSUE_TEMPLATE/integration_help.md
vendored
Normal file
14
.github/ISSUE_TEMPLATE/integration_help.md
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
name: Integration help
|
||||
title: Please use the community forum (or paid support) instead
|
||||
about: Do you need assistance with building the Uppy client in your bundler, or running Companion on your own preferred server platform?
|
||||
labels: Not Accepted
|
||||
---
|
||||
|
||||
Transloadit is providing Uppy free of charge. If you want you can self-host all components and never pay us a dime. There's docs and tests and your Bugs and Feature Requests are always welcome on GitHub.
|
||||
|
||||
There is also a different category of support that we'd like to call Integration Help: making things work for you, that are already reported working for the larger community.
|
||||
|
||||
As much as we'd like to provide detailed integration help to each non-paying user, Uppy has reached a point where this is no longer sustainable for our small crew. We end up investing our time in a million different projects, but without money flowing back, we can't ramp up our team along with the demand, spreading our team ever thinner, eventually grinding development to a halt.
|
||||
|
||||
This is not where we want to be, so in order to offer enthusiasts, businesses, and enterprises assistance in a sustainable way, we're providing community based integration help for free at <https://community.transloadit.com/c/uppy>, and offer business paid support via <https://uppy.io/support>.
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -3,6 +3,7 @@ Thumbs.db
|
|||
npm-debug.log
|
||||
env.sh
|
||||
node_modules
|
||||
.cache
|
||||
|
||||
dist/
|
||||
lib/
|
||||
|
|
@ -20,9 +21,10 @@ website/themes/uppy/_config.yml
|
|||
npm-debug.log*
|
||||
nohup.out
|
||||
|
||||
examples/bundled-example/bundle.js
|
||||
examples/dev/bundle.js
|
||||
uppy-*.tgz
|
||||
.eslintcache
|
||||
.cache
|
||||
|
||||
output/*
|
||||
!output/.keep
|
||||
|
|
|
|||
124
CHANGELOG.md
124
CHANGELOG.md
|
|
@ -1,4 +1,4 @@
|
|||
Our combined changelog and roadmap. It contains todos as well as dones.
|
||||
-Our combined changelog and roadmap. It contains todos as well as dones.
|
||||
|
||||
Items can be optionally be tagged tagged by GitHub owner issue if discussion
|
||||
happened / is needed.
|
||||
|
|
@ -56,6 +56,7 @@ PRs are welcome! Please do open an issue to discuss first if it's a big feature,
|
|||
- [ ] transloadit: option for StatusBar’s upload button to act as a "Start assembly" button? Useful if an assembly uses only import robots, such as /s3/import to start a batch transcoding job.
|
||||
- [ ] provider: Add Facebook, OneDrive, Box
|
||||
- [ ] provider: change ProviderViews signature to receive Provider instance in second param. ref https://github.com/transloadit/uppy/pull/743#discussion_r180106070
|
||||
- [ ] provider: add sorting, filtering, previews #254
|
||||
- [ ] core: css-in-js, while keeping non-random classnames (ideally prefixed) and useful preprocessor features. also see simple https://github.com/codemirror/CodeMirror/blob/master/lib/codemirror.css (@arturi, @goto-bus-stop)
|
||||
- [ ] webcam: Stop recording when file size is exceeded, should be possible given how the MediaRecorder API works
|
||||
- [ ] dashboard: add option to disable uploading from local disk #657
|
||||
|
|
@ -73,67 +74,134 @@ PRs are welcome! Please do open an issue to discuss first if it's a big feature,
|
|||
- [ ] webcam: Specify the resolution of the webcam images. We should add a way to specify any custom constraints to the Webcam plugin #876
|
||||
- [ ] transloadit: consider adding option to append result link from transloadit to the link thing in the Dashboard file block #1177
|
||||
- [ ] Consider uploading image thumbnails too #1212
|
||||
- [ ] Add `directories-dropped` event #849
|
||||
- [ ] dashboard: if you specified a delete endpoint, the “remove/cancel upload” button remains after the upload and it not only removes, but also sends a request to that endpoint #1216
|
||||
- [ ] dashboard: Show upload speed too if `showProgressDetails: true`. Maybe have separate options for which things are displayed, or at least have css-classes that can be hidden with `display: none` #766
|
||||
- [ ] react: Component wrappers to manage the Uppy instance, many people initialize it in render() which does not work correctly so this could make it easier for them https://github.com/transloadit/uppy/pull/1247#issuecomment-458063951
|
||||
- [ ] core: Fire event when a restriction fails #1251
|
||||
- [ ] core: customizing metadata fields, boolean metadata; see #809, #454 and related (@arturi)
|
||||
- [ ] goldenretriever: confirmation before restore, add “ghost” files #443 #257 (@arturi)
|
||||
- [ ] test: add typescript with JSDoc (@arturi)
|
||||
- [ ] locale: investigate preact-i18n@1.2.1, or our own script to report on missing i18n strings
|
||||
- [ ] build: utilize https://github.com/jonathantneal/postcss-preset-env, maybe https://github.com/jonathantneal/postcss-normalize (@arturi)
|
||||
- [ ] dashboard: allow minimizing the Dashboard during upload (Uppy then becomes just a tiny progress indicator) (@arturi)
|
||||
- [ ] fix incorrectly rotated image thumbnails #472
|
||||
- [ ] dragdrop: allow customizing arrow icon https://github.com/transloadit/uppy/pull/374#issuecomment-334116208 (@arturi)
|
||||
- [ ] show thumbnails when connecting with Google Drive #1162 (@ifedapoolarewaju)
|
||||
|
||||
## 1.0 Goals
|
||||
|
||||
What we need to do to release Uppy 1.0
|
||||
|
||||
- [ ] website: big release blog post
|
||||
- [ ] website: add 2 real world demos (avatar, form elements: github-comment-style-textarea)
|
||||
- [ ] chore: hunt down all `@TODO`s and either fix, or remove, or move to github issues/changelog backlog
|
||||
- [ ] chore: remove dead code/commented blocks
|
||||
- [ ] chore: remove the not-working npm scripts
|
||||
- [ ] chore: rewrite all code based on prettier+standardjs.com
|
||||
- [ ] core: uppy should not crash or be slow for many files. Specifically: be able to drop 5 files (or 7mb) without the upload button to take 2 seconds to appear
|
||||
- [ ] locale: update the locales of languages that we know ourselves. leave rest to community
|
||||
- [ ] locale: cdn (just in folder like Robodog, will attach to global) / for module to all languages in one big `@uppy/locales`
|
||||
- [ ] feature: basic React Native support (@arturi, @ifedapoolarewaju)
|
||||
- [ ] QA: add one integration test (or add to existing test) that uses more exotic (tus) options such as `useFastRemoteRetry` or `removeFingerprintOnSuccess` https://github.com/transloadit/uppy/issues/1327 (@arturi, @ifedapoolarewaju)
|
||||
- [ ] QA: manually test in multiple browsers and mobile devices again (SauceLabs can do Android/iOS too) (@nqst)
|
||||
- [x] QA: add one integration test that uses a Provider — added Url, Google Drive/Instagram/Dropbox tests are written, but tricky to automate (@ife)
|
||||
- [ ] QA: add one integration test that uses more exotic (tus) options such as `useFastRemoteRetry` (@arturi)
|
||||
- [ ] feature: preset for Transloadit that mimics jQuery SDK, check https://github.com/transloadit/jquery-sdk docs (@goto-bus-stop)
|
||||
- [ ] website: replace transloadit example with robodog example <-- add transloadit test key with restricted usage (no need to sign up yourself to try it)
|
||||
- [ ] website: big release blog post or series
|
||||
- [ ] website: design polish
|
||||
- [ ] companion: rename `serverUrl` and `serverPattern` to `companionUrl` and `companionAllowedHosts` (@ifedapoolarewaju)
|
||||
- [ ] transloadit: add error reporting, see https://github.com/transloadit/jquery-sdk/blob/891e99b08dd8142d8d8adc0553e6511967635ad7/js/lib/Modal.js#L122-L136 (@goto-bus-stop, @arturi)
|
||||
- [ ] transloadit: should adhere cancel event and abort assembly (@arturi, @goto-bus-stop)
|
||||
- [ ] dashboard: optional alert `onbeforeunload` while upload is in progress, safeguarding from accidentaly navigating away from a page with an ongoing upload
|
||||
|
||||
- [x] core: uppy should not crash or be slow for many files. Specifically: be able to drop 5 files (or 7mb) without the upload button to take 2 seconds to appear
|
||||
- [x] uppy-server: bump minor and deprecate that on npm in favour of @uppy/companion (@arturi)
|
||||
- [x] dashboard: implement Alex and Artur’s Dashboard redesign (@arturi)
|
||||
- [ ] feature: basic React Native support (@arturi owner+ios, @ife android)
|
||||
- [x] refactoring: Make `uppy-server` module live in main Uppy repo in `./server` as a second stage todo (after Lerna is done and we're happy) (@ife)
|
||||
- [x] QA: add one integration test that uses a Webpack and React/Redux environment (e.g. via `create-react-app`) (@goto-bus-stop)
|
||||
- [x] refactoring: split uppy into small packages, Lerna.js repo? and figure out how to share styles (during work, maybe add PR warning in `.github/*`? use `git mv` for everything) (@goto-bus-stop, @arturi)
|
||||
- [x] QA: make it so that all integration tests use `npm pack` and `npm install` first (@ife)
|
||||
- [x] docs: on using plugins, all options, list of plugins, i18n
|
||||
- [x] feature: beta file recovering after closed tab / browser crash
|
||||
- [x] feature: easy integration with React (UppyReact components)
|
||||
- [x] feature: finish the direct-to-s3 upload plugin and test it with the flow to then upload to :transloadit: afterwards. This is because this might influence the inner flow of the plugin architecture quite a bit
|
||||
- [x] feature: preset for Transloadit that mimics jQuery SDK, check https://github.com/transloadit/jquery-sdk docs (@goto-bus-stop)
|
||||
- [x] feature: Redux and ReduxDevTools support (currently mirrors Uppy state to Redux)
|
||||
- [x] feature: restrictions: by size, number of files, file type
|
||||
- [x] QA: add one integration test that uses a Provider — added Url, Google Drive/Instagram/Dropbox tests are written, but tricky to automate (@ife)
|
||||
- [x] QA: add one integration test that uses a Webpack and React/Redux environment (e.g. via `create-react-app`) (@goto-bus-stop)
|
||||
- [x] QA: make it so that all integration tests use `npm pack` and `npm install` first (@ife)
|
||||
- [x] QA: test uppy server. benchmarks / stress test. multiple connections, different setups, large files (10 GB)
|
||||
- [x] QA: tests for core and utils
|
||||
- [x] refactoring: Make `uppy-server` module live in main Uppy repo in `./server` as a second stage todo (after Lerna is done and we're happy) (@ife)
|
||||
- [x] refactoring: possibly switch from Yo-Yo to Preact, because it’s more stable, solves a few issues we are struggling with (onload being weird/hard/modern-browsers-only with bel; no way to pass refs to elements; extra network requests with base64 urls) and mature, “new standard”, larger community
|
||||
- [x] refactoring: split uppy into small packages, Lerna.js repo? and figure out how to share styles (during work, maybe add PR warning in `.github/*`? use `git mv` for everything) (@goto-bus-stop, @arturi)
|
||||
- [x] refactoring: webcam plugin
|
||||
- [x] uppy-server: add uppy-server to main API service to scale it horizontally. for the standalone server, we could write the script to support multiple clusters. Not sure how required or neccessary this may be for Transloadit's API service.
|
||||
- [x] uppy-server: better error handling, general cleanup (remove unused code. etc)
|
||||
- [x] uppy-server: security audit
|
||||
- [x] uppy-server: storing tokens in user’s browser only (d040281cc9a63060e2f2685c16de0091aee5c7b4)
|
||||
|
||||
## 0.31.0
|
||||
## 0.30.3
|
||||
|
||||
- [ ] core: customizing metadata fields, boolean metadata; see #809, #454 and related (@arturi)
|
||||
- [ ] goldenretriever: confirmation before restore, add “ghost” files #443 #257 (@arturi)
|
||||
- [ ] build: utilize https://github.com/jonathantneal/postcss-preset-env, maybe https://github.com/jonathantneal/postcss-normalize (@arturi)
|
||||
- [ ] fix incorrectly rotated image thumbnails #472
|
||||
Released: 2019-03-08
|
||||
|
||||
# next
|
||||
| Package | Version | Package | Version |
|
||||
|-|-|-|-|
|
||||
| @uppy/aws-s3-multipart | 0.30.3 | @uppy/provider-views | 0.30.3 |
|
||||
| @uppy/aws-s3 | 0.30.3 | @uppy/react | 0.30.3 |
|
||||
| @uppy/companion-client | 0.28.3 | @uppy/redux-dev-tools | 0.30.3 |
|
||||
| @uppy/companion | 0.17.3 | @uppy/robodog | 0.30.3 |
|
||||
| @uppy/core | 0.30.3 | @uppy/status-bar | 0.30.3 |
|
||||
| @uppy/dashboard | 0.30.3 | @uppy/store-default | 0.28.3 |
|
||||
| @uppy/drag-drop | 0.30.3 | @uppy/store-redux | 0.28.3 |
|
||||
| @uppy/dropbox | 0.30.3 | @uppy/thumbnail-generator | 0.30.3 |
|
||||
| @uppy/file-input | 0.30.3 | @uppy/transloadit | 0.30.3 |
|
||||
| @uppy/form | 0.30.3 | @uppy/tus | 0.30.3 |
|
||||
| @uppy/golden-retriever | 0.30.3 | @uppy/url | 0.30.3 |
|
||||
| @uppy/google-drive | 0.30.3 | @uppy/utils | 0.30.3 |
|
||||
| @uppy/informer | 0.30.3 | @uppy/webcam | 0.30.3 |
|
||||
| @uppy/instagram | 0.30.3 | @uppy/xhr-upload | 0.30.3 |
|
||||
| @uppy/progress-bar | 0.30.3 | uppy | 0.30.3 |
|
||||
|
||||
- @uppy/dashboard: Dashboard a11y improvements: trap focus in the active panel only (#1272 / @arturi)
|
||||
- @uppy/companion: Make providers support react native (#1286 / @ifedapoolarewaju)
|
||||
- @uppy/xhr-upload: Reject cancelled uploads (#1316 / @arturi)
|
||||
- @uppy/aws-s3: Avoid throwing error when file has been removed (#1318 / @craigjennings11)
|
||||
- @uppy/companion: Remove resources requirements for companion (#1311 / @kiloreux)
|
||||
- @uppy/webcam: Don’t show Smile! if countdown is false (#1324 / @arturi)
|
||||
- docs: update webpack homepage URLs, update Robodog readme (#1323 / @goto-bus-stop)
|
||||
|
||||
## 0.30.1 - 0.30.2
|
||||
|
||||
| Package | Version | Package | Version |
|
||||
|-|-|-|-|
|
||||
| @uppy/aws-s3-multipart | 0.30.2 | @uppy/provider-views | 0.30.2 |
|
||||
| @uppy/aws-s3 | 0.30.2 | @uppy/react | 0.30.2 |
|
||||
| @uppy/companion-client | 0.28.2 | @uppy/redux-dev-tools | 0.30.2 |
|
||||
| @uppy/companion | 0.17.2 | @uppy/robodog | 0.30.2 |
|
||||
| @uppy/core | 0.30.2 | @uppy/status-bar | 0.30.2 |
|
||||
| @uppy/dashboard | 0.30.2 | @uppy/store-default | 0.28.2 |
|
||||
| @uppy/drag-drop | 0.30.2 | @uppy/store-redux | 0.28.2 |
|
||||
| @uppy/dropbox | 0.30.2 | @uppy/thumbnail-generator | 0.30.2 |
|
||||
| @uppy/file-input | 0.30.2 | @uppy/transloadit | 0.30.2 |
|
||||
| @uppy/form | 0.30.2 | @uppy/tus | 0.30.2 |
|
||||
| @uppy/golden-retriever | 0.30.2 | @uppy/url | 0.30.2 |
|
||||
| @uppy/google-drive | 0.30.2 | @uppy/utils | 0.30.2 |
|
||||
| @uppy/informer | 0.30.2 | @uppy/webcam | 0.30.2 |
|
||||
| @uppy/instagram | 0.30.2 | @uppy/xhr-upload | 0.30.2 |
|
||||
| @uppy/progress-bar | 0.30.2 | uppy | 0.30.2 |
|
||||
|
||||
- @uppy/robodog: Add Robodog to CDN (#1304 / @kvz, @arturi)
|
||||
|
||||
## 0.30.0
|
||||
|
||||
- [ ] dashboard: allow minimizing the Dashboard during upload (Uppy then becomes just a tiny progress indicator) (@arturi)
|
||||
- [ ] test: add typescript with JSDoc (@arturi)
|
||||
- [ ] dragdrop: allow customizing arrow icon https://github.com/transloadit/uppy/pull/374#issuecomment-334116208 (@arturi)
|
||||
- [ ] dashboard: cancel button for transloadit assemblies (@arturi, @goto-bus-stop)
|
||||
- [ ] dashboard: optional alert `onbeforeunload` while upload is in progress, safeguarding from accidentaly navigating away from a page with an ongoing upload
|
||||
- [ ] transloadit: add error reporting, see https://github.com/transloadit/jquery-sdk/blob/891e99b08dd8142d8d8adc0553e6511967635ad7/js/lib/Modal.js#L122-L136 (@goto-bus-stop, @arturi)
|
||||
- [ ] server: bump minor and deprecate that on npm in favour of @uppy/companion (@ifedapoolarewaju)
|
||||
- [ ] companion: rename `serverUrl` and `serverPattern` to `companionUrl` and `companionAllowedHosts` (@ifedapoolarewaju)
|
||||
- [ ] show thumbnails when connecting with Google Drive #1162
|
||||
- @uppy/robodog: 📣⚠️Add Robodog — Transloadit browser SDK (#1135 / @goto-bus-stop)
|
||||
- @uppy/core: Set response in Core rather than in upload plugins (#1138 / @arturi)
|
||||
- @uppy/core: Don’t emit a complete event if an upload has been canceled (#1271 / @arturi)
|
||||
- @uppy/companion: Support redis option (auth_pass, etc...) (#1215 / @tranvansang)
|
||||
- @uppy/companion: sanitize text before adding to html (f77a102 / @ifedapoolarewaju)
|
||||
- @uppy/dashboard: Update pause-resume-cancel icons (#1241 / @arturi, @nqst)
|
||||
- @uppy/dashboard: Fix issues with multiple modals (#1258 / @goto-bus-stop, @arturi)
|
||||
- @uppy/dashboard: Dashboard ui fixes: fix icon animation jiggling, inherit font, allow overriding outline, fix breadcrumbs, bug with x button being stuck, fix an issue with long note margin on mobile (#1279 / @arturi)
|
||||
- @uppy/provider-views: update instagram nextPagePath after every fetch (25e31e5 / @ifedapoolarewaju)
|
||||
- @uppy/react: Allow changing instance in `uppy` prop (#1247 / @goto-bus-stop)
|
||||
- @uppy/react: Typescript: Make DashboardModal.target prop optional (#1254 / @mattes3)
|
||||
- @uppy/aws-s3: Use user provided filename / type for uploaded object, fixes #1238 (#1257 / @goto-bus-stop)
|
||||
- @uppy/tus: Update to tus-js-client@1.6.0 with React Native support (#1250 / @arturi)
|
||||
- build: Improve dev npm script: Use Parcel for bundled example, re-build lib automatically, don’t open browser and no ghosts mode, start companion when developing (but there’s optional npm run dev:no-companion) (#1280 / @arturi)
|
||||
|
||||
## 0.29.1
|
||||
|
||||
|
|
@ -228,7 +296,7 @@ What we need to do to release Uppy 1.0
|
|||
- @uppy/core: bring back i18n locale packs (#1114 / @goto-bus-stop, @arturi)
|
||||
- @uppy/companion: option validation (can use https://npm.im/ajv + JSON schema)
|
||||
- @uppy/companion: Remove duplicate typescript dependency (#1119 / @goto-bus-stop)
|
||||
- @uppy/companion: ⚠️ **breaking** Migrate provider adapter to Companion: saves 5KB on the frontend, all heavy lifting moved to the server side (#1093 / @ifedapoolarewaju)
|
||||
- @uppy/companion: ⚠️ **breaking** Migrate provider adapter to Companion: saves 5KB on the frontend, all heavy lifting moved to the server side (#1093 / @ifedapoolarewaju)
|
||||
- @uppy/core: single-use Uppy instance: adds an `allowMultipleUploads` option to @uppy/core. If set to false, uppy.upload() can only be called once. Afterward, no new files can be added and no new uploads can be started. This is intended to serve the `<form>`-like use case. (#1064 / @goto-bus-stop)
|
||||
- @uppy/dashboard: Auto close after finish using `closeAfterFinish: true` (#1106 / @goto-bus-stop)
|
||||
- @uppy/dashboard: call `hideAllPanels` after a file is added in Dashboard, instead of `toggleAddFilesPanel(false)` that didn’t hide some panels
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
Please refer to our:
|
||||
|
||||
- Contributor's guide in [`website/src/docs/contributing.md`](https://github.com/transloadit/uppy/blob/master/website/src/docs/contributing.md)
|
||||
64
README.md
64
README.md
|
|
@ -63,9 +63,9 @@ const uppy = Uppy({ autoProceed: false })
|
|||
$ npm install @uppy/core @uppy/dashboard @uppy/tus
|
||||
```
|
||||
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
|
||||
Add CSS [uppy.min.css](https://transloadit.edgly.net/releases/uppy/v0.29.1/dist/uppy.min.css), either to `<head>` of your HTML page or include in JS, if your bundler of choice supports it — transforms and plugins are available for Browserify and Webpack.
|
||||
Add CSS [uppy.min.css](https://transloadit.edgly.net/releases/uppy/v0.30.3/uppy.min.css), either to `<head>` of your HTML page or include in JS, if your bundler of choice supports it — transforms and plugins are available for Browserify and Webpack.
|
||||
|
||||
Alternatively, you can also use a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object.
|
||||
|
||||
|
|
@ -73,10 +73,10 @@ Alternatively, you can also use a pre-built bundle from Transloadit's CDN: Edgly
|
|||
|
||||
```html
|
||||
<!-- 1. Add CSS to `<head>` -->
|
||||
<link href="https://transloadit.edgly.net/releases/uppy/v0.29.1/dist/uppy.min.css" rel="stylesheet">
|
||||
<link href="https://transloadit.edgly.net/releases/uppy/v0.30.3/uppy.min.css" rel="stylesheet">
|
||||
|
||||
<!-- 2. Add JS before the closing `</body>` -->
|
||||
<script src="https://transloadit.edgly.net/releases/uppy/v0.29.1/dist/uppy.min.js"></script>
|
||||
<script src="https://transloadit.edgly.net/releases/uppy/v0.30.3/uppy.min.js"></script>
|
||||
|
||||
<!-- 3. Initialize -->
|
||||
<div class="UppyDragDrop"></div>
|
||||
|
|
@ -163,7 +163,7 @@ If you're using Uppy via a script tag, you can load the polyfills from [JSDelivr
|
|||
```html
|
||||
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4.2.5/dist/es6-promise.auto.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/whatwg-fetch@3.0.0/dist/fetch.umd.min.js"></script>
|
||||
<script src="https://transloadit.edgly.net/releases/uppy/v0.29.1/dist/uppy.min.js"></script>
|
||||
<script src="https://transloadit.edgly.net/releases/uppy/v0.30.3/uppy.min.js"></script>
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
|
@ -228,57 +228,61 @@ Use Uppy in your project? [Let us know](https://github.com/transloadit/uppy/issu
|
|||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[kiloreux](https://github.com/kiloreux) |[sadovnychyi](https://github.com/sadovnychyi) |[richardwillars](https://github.com/richardwillars) |[zcallan](https://github.com/zcallan) |[wilkoklak](https://github.com/wilkoklak) |[oliverpool](https://github.com/oliverpool) |
|
||||
|
||||
[<img alt="nqst" src="https://avatars0.githubusercontent.com/u/375537?v=4&s=117" width="117">](https://github.com/nqst) |[<img alt="janko-m" src="https://avatars2.githubusercontent.com/u/795488?v=4&s=117" width="117">](https://github.com/janko-m) |[<img alt="mattes3" src="https://avatars2.githubusercontent.com/u/2496674?v=4&s=117" width="117">](https://github.com/mattes3) |[<img alt="DJWassink" src="https://avatars3.githubusercontent.com/u/1822404?v=4&s=117" width="117">](https://github.com/DJWassink) |[<img alt="taoqf" src="https://avatars3.githubusercontent.com/u/15901911?v=4&s=117" width="117">](https://github.com/taoqf) |[<img alt="gavboulton" src="https://avatars0.githubusercontent.com/u/3900826?v=4&s=117" width="117">](https://github.com/gavboulton) |
|
||||
[<img alt="nqst" src="https://avatars0.githubusercontent.com/u/375537?v=4&s=117" width="117">](https://github.com/nqst) |[<img alt="janko" src="https://avatars2.githubusercontent.com/u/795488?v=4&s=117" width="117">](https://github.com/janko) |[<img alt="mattes3" src="https://avatars2.githubusercontent.com/u/2496674?v=4&s=117" width="117">](https://github.com/mattes3) |[<img alt="DJWassink" src="https://avatars3.githubusercontent.com/u/1822404?v=4&s=117" width="117">](https://github.com/DJWassink) |[<img alt="taoqf" src="https://avatars3.githubusercontent.com/u/15901911?v=4&s=117" width="117">](https://github.com/taoqf) |[<img alt="gavboulton" src="https://avatars0.githubusercontent.com/u/3900826?v=4&s=117" width="117">](https://github.com/gavboulton) |
|
||||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[nqst](https://github.com/nqst) |[janko-m](https://github.com/janko-m) |[mattes3](https://github.com/mattes3) |[DJWassink](https://github.com/DJWassink) |[taoqf](https://github.com/taoqf) |[gavboulton](https://github.com/gavboulton) |
|
||||
[nqst](https://github.com/nqst) |[janko](https://github.com/janko) |[mattes3](https://github.com/mattes3) |[DJWassink](https://github.com/DJWassink) |[taoqf](https://github.com/taoqf) |[gavboulton](https://github.com/gavboulton) |
|
||||
|
||||
[<img alt="bertho-zero" src="https://avatars0.githubusercontent.com/u/8525267?v=4&s=117" width="117">](https://github.com/bertho-zero) |[<img alt="frederikhors" src="https://avatars3.githubusercontent.com/u/41120635?v=4&s=117" width="117">](https://github.com/frederikhors) |[<img alt="pauln" src="https://avatars3.githubusercontent.com/u/574359?v=4&s=117" width="117">](https://github.com/pauln) |[<img alt="toadkicker" src="https://avatars1.githubusercontent.com/u/523330?v=4&s=117" width="117">](https://github.com/toadkicker) |[<img alt="mrbatista" src="https://avatars0.githubusercontent.com/u/6544817?v=4&s=117" width="117">](https://github.com/mrbatista) |[<img alt="phitranphitranphitran" src="https://avatars2.githubusercontent.com/u/14257077?v=4&s=117" width="117">](https://github.com/phitranphitranphitran) |
|
||||
[<img alt="bertho-zero" src="https://avatars0.githubusercontent.com/u/8525267?v=4&s=117" width="117">](https://github.com/bertho-zero) |[<img alt="tranvansang" src="https://avatars1.githubusercontent.com/u/13043196?v=4&s=117" width="117">](https://github.com/tranvansang) |[<img alt="pauln" src="https://avatars3.githubusercontent.com/u/574359?v=4&s=117" width="117">](https://github.com/pauln) |[<img alt="toadkicker" src="https://avatars1.githubusercontent.com/u/523330?v=4&s=117" width="117">](https://github.com/toadkicker) |[<img alt="mrbatista" src="https://avatars0.githubusercontent.com/u/6544817?v=4&s=117" width="117">](https://github.com/mrbatista) |[<img alt="sunil-shrestha" src="https://avatars3.githubusercontent.com/u/2129058?v=4&s=117" width="117">](https://github.com/sunil-shrestha) |
|
||||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[bertho-zero](https://github.com/bertho-zero) |[frederikhors](https://github.com/frederikhors) |[pauln](https://github.com/pauln) |[toadkicker](https://github.com/toadkicker) |[mrbatista](https://github.com/mrbatista) |[phitranphitranphitran](https://github.com/phitranphitranphitran) |
|
||||
[bertho-zero](https://github.com/bertho-zero) |[tranvansang](https://github.com/tranvansang) |[pauln](https://github.com/pauln) |[toadkicker](https://github.com/toadkicker) |[mrbatista](https://github.com/mrbatista) |[sunil-shrestha](https://github.com/sunil-shrestha) |
|
||||
|
||||
[<img alt="sunil-shrestha" src="https://avatars3.githubusercontent.com/u/2129058?v=4&s=117" width="117">](https://github.com/sunil-shrestha) |[<img alt="tranvansang" src="https://avatars1.githubusercontent.com/u/13043196?v=4&s=117" width="117">](https://github.com/tranvansang) |[<img alt="ap--" src="https://avatars1.githubusercontent.com/u/1463443?v=4&s=117" width="117">](https://github.com/ap--) |[<img alt="tim-kos" src="https://avatars1.githubusercontent.com/u/15005?v=4&s=117" width="117">](https://github.com/tim-kos) |[<img alt="ogtfaber" src="https://avatars2.githubusercontent.com/u/320955?v=4&s=117" width="117">](https://github.com/ogtfaber) |[<img alt="btrice" src="https://avatars2.githubusercontent.com/u/4358225?v=4&s=117" width="117">](https://github.com/btrice) |
|
||||
[<img alt="ap--" src="https://avatars1.githubusercontent.com/u/1463443?v=4&s=117" width="117">](https://github.com/ap--) |[<img alt="tim-kos" src="https://avatars1.githubusercontent.com/u/15005?v=4&s=117" width="117">](https://github.com/tim-kos) |[<img alt="ogtfaber" src="https://avatars2.githubusercontent.com/u/320955?v=4&s=117" width="117">](https://github.com/ogtfaber) |[<img alt="btrice" src="https://avatars2.githubusercontent.com/u/4358225?v=4&s=117" width="117">](https://github.com/btrice) |[<img alt="craigjennings11" src="https://avatars2.githubusercontent.com/u/1683368?v=4&s=117" width="117">](https://github.com/craigjennings11) |[<img alt="jedwood" src="https://avatars0.githubusercontent.com/u/369060?v=4&s=117" width="117">](https://github.com/jedwood) |
|
||||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[sunil-shrestha](https://github.com/sunil-shrestha) |[tranvansang](https://github.com/tranvansang) |[ap--](https://github.com/ap--) |[tim-kos](https://github.com/tim-kos) |[ogtfaber](https://github.com/ogtfaber) |[btrice](https://github.com/btrice) |
|
||||
[ap--](https://github.com/ap--) |[tim-kos](https://github.com/tim-kos) |[ogtfaber](https://github.com/ogtfaber) |[btrice](https://github.com/btrice) |[craigjennings11](https://github.com/craigjennings11) |[jedwood](https://github.com/jedwood) |
|
||||
|
||||
[<img alt="pekala" src="https://avatars1.githubusercontent.com/u/4643658?v=4&s=117" width="117">](https://github.com/pekala) |[<img alt="manuelkiessling" src="https://avatars2.githubusercontent.com/u/206592?v=4&s=117" width="117">](https://github.com/manuelkiessling) |[<img alt="Martin005" src="https://avatars0.githubusercontent.com/u/10096404?v=4&s=117" width="117">](https://github.com/Martin005) |[<img alt="martiuslim" src="https://avatars2.githubusercontent.com/u/17944339?v=4&s=117" width="117">](https://github.com/martiuslim) |[<img alt="msand" src="https://avatars2.githubusercontent.com/u/1131362?v=4&s=117" width="117">](https://github.com/msand) |[<img alt="Burkes" src="https://avatars2.githubusercontent.com/u/9220052?v=4&s=117" width="117">](https://github.com/Burkes) |
|
||||
[<img alt="pekala" src="https://avatars1.githubusercontent.com/u/4643658?v=4&s=117" width="117">](https://github.com/pekala) |[<img alt="manuelkiessling" src="https://avatars2.githubusercontent.com/u/206592?v=4&s=117" width="117">](https://github.com/manuelkiessling) |[<img alt="Martin005" src="https://avatars0.githubusercontent.com/u/10096404?v=4&s=117" width="117">](https://github.com/Martin005) |[<img alt="martiuslim" src="https://avatars2.githubusercontent.com/u/17944339?v=4&s=117" width="117">](https://github.com/martiuslim) |[<img alt="Burkes" src="https://avatars2.githubusercontent.com/u/9220052?v=4&s=117" width="117">](https://github.com/Burkes) |[<img alt="richartkeil" src="https://avatars0.githubusercontent.com/u/8680858?v=4&s=117" width="117">](https://github.com/richartkeil) |
|
||||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[pekala](https://github.com/pekala) |[manuelkiessling](https://github.com/manuelkiessling) |[Martin005](https://github.com/Martin005) |[martiuslim](https://github.com/martiuslim) |[msand](https://github.com/msand) |[Burkes](https://github.com/Burkes) |
|
||||
[pekala](https://github.com/pekala) |[manuelkiessling](https://github.com/manuelkiessling) |[Martin005](https://github.com/Martin005) |[martiuslim](https://github.com/martiuslim) |[Burkes](https://github.com/Burkes) |[richartkeil](https://github.com/richartkeil) |
|
||||
|
||||
[<img alt="richmeij" src="https://avatars0.githubusercontent.com/u/9741858?v=4&s=117" width="117">](https://github.com/richmeij) |[<img alt="rosenfeld" src="https://avatars1.githubusercontent.com/u/32246?v=4&s=117" width="117">](https://github.com/rosenfeld) |[<img alt="ThomasG77" src="https://avatars2.githubusercontent.com/u/642120?v=4&s=117" width="117">](https://github.com/ThomasG77) |[<img alt="zhuangya" src="https://avatars2.githubusercontent.com/u/499038?v=4&s=117" width="117">](https://github.com/zhuangya) |[<img alt="fortrieb" src="https://avatars0.githubusercontent.com/u/4126707?v=4&s=117" width="117">](https://github.com/fortrieb) |[<img alt="muhammadInam" src="https://avatars1.githubusercontent.com/u/7801708?v=4&s=117" width="117">](https://github.com/muhammadInam) |
|
||||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[richmeij](https://github.com/richmeij) |[rosenfeld](https://github.com/rosenfeld) |[ThomasG77](https://github.com/ThomasG77) |[zhuangya](https://github.com/zhuangya) |[fortrieb](https://github.com/fortrieb) |[muhammadInam](https://github.com/muhammadInam) |
|
||||
|
||||
[<img alt="richartkeil" src="https://avatars0.githubusercontent.com/u/8680858?v=4&s=117" width="117">](https://github.com/richartkeil) |[<img alt="ajschmidt8" src="https://avatars0.githubusercontent.com/u/7400326?v=4&s=117" width="117">](https://github.com/ajschmidt8) |[<img alt="tuoxiansp" src="https://avatars1.githubusercontent.com/u/3960056?v=4&s=117" width="117">](https://github.com/tuoxiansp) |[<img alt="amitport" src="https://avatars1.githubusercontent.com/u/1131991?v=4&s=117" width="117">](https://github.com/amitport) |[<img alt="functino" src="https://avatars0.githubusercontent.com/u/415498?v=4&s=117" width="117">](https://github.com/functino) |[<img alt="radarhere" src="https://avatars2.githubusercontent.com/u/3112309?v=4&s=117" width="117">](https://github.com/radarhere) |
|
||||
[<img alt="msand" src="https://avatars2.githubusercontent.com/u/1131362?v=4&s=117" width="117">](https://github.com/msand) |[<img alt="ajschmidt8" src="https://avatars0.githubusercontent.com/u/7400326?v=4&s=117" width="117">](https://github.com/ajschmidt8) |[<img alt="asmt3" src="https://avatars1.githubusercontent.com/u/1777709?v=4&s=117" width="117">](https://github.com/asmt3) |[<img alt="amitport" src="https://avatars1.githubusercontent.com/u/1131991?v=4&s=117" width="117">](https://github.com/amitport) |[<img alt="tuoxiansp" src="https://avatars1.githubusercontent.com/u/3960056?v=4&s=117" width="117">](https://github.com/tuoxiansp) |[<img alt="radarhere" src="https://avatars2.githubusercontent.com/u/3112309?v=4&s=117" width="117">](https://github.com/radarhere) |
|
||||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[richartkeil](https://github.com/richartkeil) |[ajschmidt8](https://github.com/ajschmidt8) |[tuoxiansp](https://github.com/tuoxiansp) |[amitport](https://github.com/amitport) |[functino](https://github.com/functino) |[radarhere](https://github.com/radarhere) |
|
||||
[msand](https://github.com/msand) |[ajschmidt8](https://github.com/ajschmidt8) |[asmt3](https://github.com/asmt3) |[amitport](https://github.com/amitport) |[tuoxiansp](https://github.com/tuoxiansp) |[radarhere](https://github.com/radarhere) |
|
||||
|
||||
[<img alt="azeemba" src="https://avatars0.githubusercontent.com/u/2160795?v=4&s=117" width="117">](https://github.com/azeemba) |[<img alt="bducharme" src="https://avatars2.githubusercontent.com/u/4173569?v=4&s=117" width="117">](https://github.com/bducharme) |[<img alt="chao" src="https://avatars2.githubusercontent.com/u/55872?v=4&s=117" width="117">](https://github.com/chao) |[<img alt="csprance" src="https://avatars0.githubusercontent.com/u/7902617?v=4&s=117" width="117">](https://github.com/csprance) |[<img alt="cbush06" src="https://avatars0.githubusercontent.com/u/15720146?v=4&s=117" width="117">](https://github.com/cbush06) |[<img alt="danmichaelo" src="https://avatars1.githubusercontent.com/u/434495?v=4&s=117" width="117">](https://github.com/danmichaelo) |
|
||||
[<img alt="bochkarev-artem" src="https://avatars2.githubusercontent.com/u/11025874?v=4&s=117" width="117">](https://github.com/bochkarev-artem) |[<img alt="azeemba" src="https://avatars0.githubusercontent.com/u/2160795?v=4&s=117" width="117">](https://github.com/azeemba) |[<img alt="bducharme" src="https://avatars2.githubusercontent.com/u/4173569?v=4&s=117" width="117">](https://github.com/bducharme) |[<img alt="chao" src="https://avatars2.githubusercontent.com/u/55872?v=4&s=117" width="117">](https://github.com/chao) |[<img alt="csprance" src="https://avatars0.githubusercontent.com/u/7902617?v=4&s=117" width="117">](https://github.com/csprance) |[<img alt="cbush06" src="https://avatars0.githubusercontent.com/u/15720146?v=4&s=117" width="117">](https://github.com/cbush06) |
|
||||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[azeemba](https://github.com/azeemba) |[bducharme](https://github.com/bducharme) |[chao](https://github.com/chao) |[csprance](https://github.com/csprance) |[cbush06](https://github.com/cbush06) |[danmichaelo](https://github.com/danmichaelo) |
|
||||
[bochkarev-artem](https://github.com/bochkarev-artem) |[azeemba](https://github.com/azeemba) |[bducharme](https://github.com/bducharme) |[chao](https://github.com/chao) |[csprance](https://github.com/csprance) |[cbush06](https://github.com/cbush06) |
|
||||
|
||||
[<img alt="mrboomer" src="https://avatars0.githubusercontent.com/u/5942912?v=4&s=117" width="117">](https://github.com/mrboomer) |[<img alt="davilima6" src="https://avatars0.githubusercontent.com/u/422130?v=4&s=117" width="117">](https://github.com/davilima6) |[<img alt="yoldar" src="https://avatars3.githubusercontent.com/u/1597578?v=4&s=117" width="117">](https://github.com/yoldar) |[<img alt="lowsprofile" src="https://avatars1.githubusercontent.com/u/11029687?v=4&s=117" width="117">](https://github.com/lowsprofile) |[<img alt="FWirtz" src="https://avatars1.githubusercontent.com/u/6052785?v=4&s=117" width="117">](https://github.com/FWirtz) |[<img alt="geoffappleford" src="https://avatars2.githubusercontent.com/u/731678?v=4&s=117" width="117">](https://github.com/geoffappleford) |
|
||||
[<img alt="danmichaelo" src="https://avatars1.githubusercontent.com/u/434495?v=4&s=117" width="117">](https://github.com/danmichaelo) |[<img alt="mrboomer" src="https://avatars0.githubusercontent.com/u/5942912?v=4&s=117" width="117">](https://github.com/mrboomer) |[<img alt="davilima6" src="https://avatars0.githubusercontent.com/u/422130?v=4&s=117" width="117">](https://github.com/davilima6) |[<img alt="yoldar" src="https://avatars3.githubusercontent.com/u/1597578?v=4&s=117" width="117">](https://github.com/yoldar) |[<img alt="lowsprofile" src="https://avatars1.githubusercontent.com/u/11029687?v=4&s=117" width="117">](https://github.com/lowsprofile) |[<img alt="FWirtz" src="https://avatars1.githubusercontent.com/u/6052785?v=4&s=117" width="117">](https://github.com/FWirtz) |
|
||||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[mrboomer](https://github.com/mrboomer) |[davilima6](https://github.com/davilima6) |[yoldar](https://github.com/yoldar) |[lowsprofile](https://github.com/lowsprofile) |[FWirtz](https://github.com/FWirtz) |[geoffappleford](https://github.com/geoffappleford) |
|
||||
[danmichaelo](https://github.com/danmichaelo) |[mrboomer](https://github.com/mrboomer) |[davilima6](https://github.com/davilima6) |[yoldar](https://github.com/yoldar) |[lowsprofile](https://github.com/lowsprofile) |[FWirtz](https://github.com/FWirtz) |
|
||||
|
||||
[<img alt="gjungb" src="https://avatars0.githubusercontent.com/u/3391068?v=4&s=117" width="117">](https://github.com/gjungb) |[<img alt="JacobMGEvans" src="https://avatars1.githubusercontent.com/u/27247160?v=4&s=117" width="117">](https://github.com/JacobMGEvans) |[<img alt="jcjmcclean" src="https://avatars3.githubusercontent.com/u/1822574?v=4&s=117" width="117">](https://github.com/jcjmcclean) |[<img alt="vith" src="https://avatars1.githubusercontent.com/u/3265539?v=4&s=117" width="117">](https://github.com/vith) |[<img alt="jessica-coursera" src="https://avatars1.githubusercontent.com/u/35155465?v=4&s=117" width="117">](https://github.com/jessica-coursera) |[<img alt="jderrough" src="https://avatars3.githubusercontent.com/u/1108358?v=4&s=117" width="117">](https://github.com/jderrough) |
|
||||
[<img alt="geoffappleford" src="https://avatars2.githubusercontent.com/u/731678?v=4&s=117" width="117">](https://github.com/geoffappleford) |[<img alt="gjungb" src="https://avatars0.githubusercontent.com/u/3391068?v=4&s=117" width="117">](https://github.com/gjungb) |[<img alt="JacobMGEvans" src="https://avatars1.githubusercontent.com/u/27247160?v=4&s=117" width="117">](https://github.com/JacobMGEvans) |[<img alt="jcjmcclean" src="https://avatars3.githubusercontent.com/u/1822574?v=4&s=117" width="117">](https://github.com/jcjmcclean) |[<img alt="vith" src="https://avatars1.githubusercontent.com/u/3265539?v=4&s=117" width="117">](https://github.com/vith) |[<img alt="jessica-coursera" src="https://avatars1.githubusercontent.com/u/35155465?v=4&s=117" width="117">](https://github.com/jessica-coursera) |
|
||||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[gjungb](https://github.com/gjungb) |[JacobMGEvans](https://github.com/JacobMGEvans) |[jcjmcclean](https://github.com/jcjmcclean) |[vith](https://github.com/vith) |[jessica-coursera](https://github.com/jessica-coursera) |[jderrough](https://github.com/jderrough) |
|
||||
[geoffappleford](https://github.com/geoffappleford) |[gjungb](https://github.com/gjungb) |[JacobMGEvans](https://github.com/JacobMGEvans) |[jcjmcclean](https://github.com/jcjmcclean) |[vith](https://github.com/vith) |[jessica-coursera](https://github.com/jessica-coursera) |
|
||||
|
||||
[<img alt="firesharkstudios" src="https://avatars1.githubusercontent.com/u/17069637?v=4&s=117" width="117">](https://github.com/firesharkstudios) |[<img alt="kyleparisi" src="https://avatars0.githubusercontent.com/u/1286753?v=4&s=117" width="117">](https://github.com/kyleparisi) |[<img alt="dviry" src="https://avatars3.githubusercontent.com/u/1230260?v=4&s=117" width="117">](https://github.com/dviry) |[<img alt="leods92" src="https://avatars0.githubusercontent.com/u/879395?v=4&s=117" width="117">](https://github.com/leods92) |[<img alt="lucaperret" src="https://avatars1.githubusercontent.com/u/1887122?v=4&s=117" width="117">](https://github.com/lucaperret) |[<img alt="mperrando" src="https://avatars2.githubusercontent.com/u/525572?v=4&s=117" width="117">](https://github.com/mperrando) |
|
||||
[<img alt="Dargmuesli" src="https://avatars2.githubusercontent.com/u/4778485?v=4&s=117" width="117">](https://github.com/Dargmuesli) |[<img alt="jderrough" src="https://avatars3.githubusercontent.com/u/1108358?v=4&s=117" width="117">](https://github.com/jderrough) |[<img alt="firesharkstudios" src="https://avatars1.githubusercontent.com/u/17069637?v=4&s=117" width="117">](https://github.com/firesharkstudios) |[<img alt="kyleparisi" src="https://avatars0.githubusercontent.com/u/1286753?v=4&s=117" width="117">](https://github.com/kyleparisi) |[<img alt="dviry" src="https://avatars3.githubusercontent.com/u/1230260?v=4&s=117" width="117">](https://github.com/dviry) |[<img alt="leods92" src="https://avatars0.githubusercontent.com/u/879395?v=4&s=117" width="117">](https://github.com/leods92) |
|
||||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[firesharkstudios](https://github.com/firesharkstudios) |[kyleparisi](https://github.com/kyleparisi) |[dviry](https://github.com/dviry) |[leods92](https://github.com/leods92) |[lucaperret](https://github.com/lucaperret) |[mperrando](https://github.com/mperrando) |
|
||||
[Dargmuesli](https://github.com/Dargmuesli) |[jderrough](https://github.com/jderrough) |[firesharkstudios](https://github.com/firesharkstudios) |[kyleparisi](https://github.com/kyleparisi) |[dviry](https://github.com/dviry) |[leods92](https://github.com/leods92) |
|
||||
|
||||
[<img alt="mnafees" src="https://avatars1.githubusercontent.com/u/1763885?v=4&s=117" width="117">](https://github.com/mnafees) |[<img alt="phillipalexander" src="https://avatars0.githubusercontent.com/u/1577682?v=4&s=117" width="117">](https://github.com/phillipalexander) |[<img alt="luarmr" src="https://avatars3.githubusercontent.com/u/817416?v=4&s=117" width="117">](https://github.com/luarmr) |[<img alt="phobos101" src="https://avatars2.githubusercontent.com/u/7114944?v=4&s=117" width="117">](https://github.com/phobos101) |[<img alt="fortunto2" src="https://avatars1.githubusercontent.com/u/1236751?v=4&s=117" width="117">](https://github.com/fortunto2) |[<img alt="sergei-zelinsky" src="https://avatars2.githubusercontent.com/u/19428086?v=4&s=117" width="117">](https://github.com/sergei-zelinsky) |
|
||||
[<img alt="lucaperret" src="https://avatars1.githubusercontent.com/u/1887122?v=4&s=117" width="117">](https://github.com/lucaperret) |[<img alt="mperrando" src="https://avatars2.githubusercontent.com/u/525572?v=4&s=117" width="117">](https://github.com/mperrando) |[<img alt="mnafees" src="https://avatars1.githubusercontent.com/u/1763885?v=4&s=117" width="117">](https://github.com/mnafees) |[<img alt="phillipalexander" src="https://avatars0.githubusercontent.com/u/1577682?v=4&s=117" width="117">](https://github.com/phillipalexander) |[<img alt="luarmr" src="https://avatars3.githubusercontent.com/u/817416?v=4&s=117" width="117">](https://github.com/luarmr) |[<img alt="phobos101" src="https://avatars2.githubusercontent.com/u/7114944?v=4&s=117" width="117">](https://github.com/phobos101) |
|
||||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[mnafees](https://github.com/mnafees) |[phillipalexander](https://github.com/phillipalexander) |[luarmr](https://github.com/luarmr) |[phobos101](https://github.com/phobos101) |[fortunto2](https://github.com/fortunto2) |[sergei-zelinsky](https://github.com/sergei-zelinsky) |
|
||||
[lucaperret](https://github.com/lucaperret) |[mperrando](https://github.com/mperrando) |[mnafees](https://github.com/mnafees) |[phillipalexander](https://github.com/phillipalexander) |[luarmr](https://github.com/luarmr) |[phobos101](https://github.com/phobos101) |
|
||||
|
||||
[<img alt="tomsaleeba" src="https://avatars0.githubusercontent.com/u/1773838?v=4&s=117" width="117">](https://github.com/tomsaleeba) |[<img alt="vially" src="https://avatars1.githubusercontent.com/u/433598?v=4&s=117" width="117">](https://github.com/vially) |[<img alt="eltercero" src="https://avatars0.githubusercontent.com/u/545235?v=4&s=117" width="117">](https://github.com/eltercero) |[<img alt="xhocquet" src="https://avatars2.githubusercontent.com/u/8116516?v=4&s=117" width="117">](https://github.com/xhocquet) |[<img alt="avalla" src="https://avatars1.githubusercontent.com/u/986614?v=4&s=117" width="117">](https://github.com/avalla) |[<img alt="c0b41" src="https://avatars1.githubusercontent.com/u/2834954?v=4&s=117" width="117">](https://github.com/c0b41) |
|
||||
[<img alt="fortunto2" src="https://avatars1.githubusercontent.com/u/1236751?v=4&s=117" width="117">](https://github.com/fortunto2) |[<img alt="sergei-zelinsky" src="https://avatars2.githubusercontent.com/u/19428086?v=4&s=117" width="117">](https://github.com/sergei-zelinsky) |[<img alt="tomsaleeba" src="https://avatars0.githubusercontent.com/u/1773838?v=4&s=117" width="117">](https://github.com/tomsaleeba) |[<img alt="vially" src="https://avatars1.githubusercontent.com/u/433598?v=4&s=117" width="117">](https://github.com/vially) |[<img alt="eltercero" src="https://avatars0.githubusercontent.com/u/545235?v=4&s=117" width="117">](https://github.com/eltercero) |[<img alt="xhocquet" src="https://avatars2.githubusercontent.com/u/8116516?v=4&s=117" width="117">](https://github.com/xhocquet) |
|
||||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[tomsaleeba](https://github.com/tomsaleeba) |[vially](https://github.com/vially) |[eltercero](https://github.com/eltercero) |[xhocquet](https://github.com/xhocquet) |[avalla](https://github.com/avalla) |[c0b41](https://github.com/c0b41) |
|
||||
[fortunto2](https://github.com/fortunto2) |[sergei-zelinsky](https://github.com/sergei-zelinsky) |[tomsaleeba](https://github.com/tomsaleeba) |[vially](https://github.com/vially) |[eltercero](https://github.com/eltercero) |[xhocquet](https://github.com/xhocquet) |
|
||||
|
||||
[<img alt="craigcbrunner" src="https://avatars3.githubusercontent.com/u/2780521?v=4&s=117" width="117">](https://github.com/craigcbrunner) |[<img alt="franckl" src="https://avatars0.githubusercontent.com/u/3875803?v=4&s=117" width="117">](https://github.com/franckl) |[<img alt="luntta" src="https://avatars0.githubusercontent.com/u/14221637?v=4&s=117" width="117">](https://github.com/luntta) |[<img alt="rhymes" src="https://avatars3.githubusercontent.com/u/146201?v=4&s=117" width="117">](https://github.com/rhymes) |[<img alt="asmt3" src="https://avatars1.githubusercontent.com/u/1777709?v=4&s=117" width="117">](https://github.com/asmt3) |
|
||||
:---: |:---: |:---: |:---: |:---: |
|
||||
[craigcbrunner](https://github.com/craigcbrunner) |[franckl](https://github.com/franckl) |[luntta](https://github.com/luntta) |[rhymes](https://github.com/rhymes) |[asmt3](https://github.com/asmt3) |
|
||||
[<img alt="avalla" src="https://avatars1.githubusercontent.com/u/986614?v=4&s=117" width="117">](https://github.com/avalla) |[<img alt="c0b41" src="https://avatars1.githubusercontent.com/u/2834954?v=4&s=117" width="117">](https://github.com/c0b41) |[<img alt="craigcbrunner" src="https://avatars3.githubusercontent.com/u/2780521?v=4&s=117" width="117">](https://github.com/craigcbrunner) |[<img alt="franckl" src="https://avatars0.githubusercontent.com/u/3875803?v=4&s=117" width="117">](https://github.com/franckl) |[<img alt="ninesalt" src="https://avatars2.githubusercontent.com/u/7952255?v=4&s=117" width="117">](https://github.com/ninesalt) |[<img alt="luntta" src="https://avatars0.githubusercontent.com/u/14221637?v=4&s=117" width="117">](https://github.com/luntta) |
|
||||
:---: |:---: |:---: |:---: |:---: |:---: |
|
||||
[avalla](https://github.com/avalla) |[c0b41](https://github.com/c0b41) |[craigcbrunner](https://github.com/craigcbrunner) |[franckl](https://github.com/franckl) |[ninesalt](https://github.com/ninesalt) |[luntta](https://github.com/luntta) |
|
||||
|
||||
[<img alt="rhymes" src="https://avatars3.githubusercontent.com/u/146201?v=4&s=117" width="117">](https://github.com/rhymes) |[<img alt="functino" src="https://avatars0.githubusercontent.com/u/415498?v=4&s=117" width="117">](https://github.com/functino) |
|
||||
:---: |:---: |
|
||||
[rhymes](https://github.com/rhymes) |[functino](https://github.com/functino) |
|
||||
<!--/contributors-->
|
||||
|
||||
## License
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ const sass = require('node-sass')
|
|||
const postcss = require('postcss')
|
||||
const autoprefixer = require('autoprefixer')
|
||||
const cssnano = require('cssnano')
|
||||
const safeImportant = require('postcss-safe-important')
|
||||
// const safeImportant = require('postcss-safe-important')
|
||||
const chalk = require('chalk')
|
||||
const { promisify } = require('util')
|
||||
const fs = require('fs')
|
||||
|
|
@ -44,15 +44,23 @@ async function compileCSS () {
|
|||
}
|
||||
})
|
||||
|
||||
const postcssResult = await postcss([ autoprefixer, safeImportant ])
|
||||
const postcssResult = await postcss([ autoprefixer ])
|
||||
.process(scssResult.css, { from: file })
|
||||
postcssResult.warnings().forEach(function (warn) {
|
||||
console.warn(warn.toString())
|
||||
})
|
||||
|
||||
const outdir = path.join(path.dirname(file), '../dist')
|
||||
// Save the `uppy` package's CSS as `uppy.css`, the rest as `style.css`.
|
||||
const outfile = path.join(outdir, outdir.includes('packages/uppy/') ? 'uppy.css' : 'style.css')
|
||||
// Save the `uppy` package's CSS as `uppy.css`,
|
||||
// `@uppy/robodog` as `robodog.css`,
|
||||
// the rest as `style.css`.
|
||||
// const outfile = path.join(outdir, outdir.includes('packages/uppy/') ? 'uppy.css' : 'style.css')
|
||||
let outfile = path.join(outdir, 'style.css')
|
||||
if (outdir.includes('packages/uppy/')) {
|
||||
outfile = path.join(outdir, 'uppy.css')
|
||||
} else if (outdir.includes('packages/@uppy/robodog/')) {
|
||||
outfile = path.join(outdir, 'robodog.css')
|
||||
}
|
||||
await mkdirp(outdir)
|
||||
await writeFile(outfile, postcssResult.css)
|
||||
console.info(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
var path = require('path')
|
||||
var fs = require('fs')
|
||||
var chalk = require('chalk')
|
||||
var mkdirp = require('mkdirp')
|
||||
|
|
@ -7,18 +6,12 @@ var tinyify = require('tinyify')
|
|||
var browserify = require('browserify')
|
||||
var exorcist = require('exorcist')
|
||||
|
||||
var distPath = './packages/uppy/dist'
|
||||
var srcPath = './packages/uppy'
|
||||
|
||||
function handleErr (err) {
|
||||
console.error(chalk.red('✗ Error:'), chalk.red(err.message))
|
||||
}
|
||||
|
||||
function buildUppyBundle (minify) {
|
||||
var src = path.join(srcPath, 'bundle.js')
|
||||
var bundleFile = minify ? 'uppy.min.js' : 'uppy.js'
|
||||
|
||||
var b = browserify(src, { debug: true, standalone: 'Uppy' })
|
||||
function buildBundle (srcFile, bundleFile, { minify = false, standalone = '' } = {}) {
|
||||
var b = browserify(srcFile, { debug: true, standalone })
|
||||
if (minify) {
|
||||
b.plugin(tinyify)
|
||||
}
|
||||
|
|
@ -27,23 +20,44 @@ function buildUppyBundle (minify) {
|
|||
|
||||
return new Promise(function (resolve, reject) {
|
||||
b.bundle()
|
||||
.pipe(exorcist(path.join(distPath, bundleFile + '.map')))
|
||||
.pipe(fs.createWriteStream(path.join(distPath, bundleFile), 'utf8'))
|
||||
.pipe(exorcist(bundleFile + '.map'))
|
||||
.pipe(fs.createWriteStream(bundleFile), 'utf8')
|
||||
.on('error', handleErr)
|
||||
.on('finish', function () {
|
||||
if (minify) {
|
||||
console.info(chalk.green('✓ Built Minified Bundle:'), chalk.magenta(bundleFile))
|
||||
console.info(chalk.green(`✓ Built Minified Bundle [${standalone}]:`), chalk.magenta(bundleFile))
|
||||
} else {
|
||||
console.info(chalk.green('✓ Built Bundle:'), chalk.magenta(bundleFile))
|
||||
console.info(chalk.green(`✓ Built Bundle [${standalone}]:`), chalk.magenta(bundleFile))
|
||||
}
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
mkdirp.sync(distPath)
|
||||
mkdirp.sync('./packages/uppy/dist')
|
||||
mkdirp.sync('./packages/@uppy/robodog/dist')
|
||||
|
||||
Promise.all([buildUppyBundle(), buildUppyBundle(true)])
|
||||
.then(function () {
|
||||
console.info(chalk.yellow('✓ JS Bundle 🎉'))
|
||||
})
|
||||
Promise.all([
|
||||
buildBundle(
|
||||
'./packages/uppy/bundle.js',
|
||||
'./packages/uppy/dist/uppy.js',
|
||||
{ standalone: 'Uppy' }
|
||||
),
|
||||
buildBundle(
|
||||
'./packages/uppy/bundle.js',
|
||||
'./packages/uppy/dist/uppy.min.js',
|
||||
{ standalone: 'Uppy', minify: true }
|
||||
),
|
||||
buildBundle(
|
||||
'./packages/@uppy/robodog/bundle.js',
|
||||
'./packages/@uppy/robodog/dist/robodog.js',
|
||||
{ standalone: 'Robodog' }
|
||||
),
|
||||
buildBundle(
|
||||
'./packages/@uppy/robodog/bundle.js',
|
||||
'./packages/@uppy/robodog/dist/robodog.min.js',
|
||||
{ standalone: 'Robodog', minify: true }
|
||||
)
|
||||
]).then(function () {
|
||||
console.info(chalk.yellow('✓ JS bundles 🎉'))
|
||||
})
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ cp README.md packages/uppy/README.md
|
|||
npm run clean
|
||||
FRESH=1 npm run build
|
||||
|
||||
git commit -m "Release"
|
||||
git commit --allow-empty -m "Release"
|
||||
lerna version --amend --no-push --exact
|
||||
|
||||
lerna publish from-git
|
||||
|
|
|
|||
16
bin/remove-accidental-git-tags.sh
Normal file
16
bin/remove-accidental-git-tags.sh
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# removes tags that Lerna generated, but then failed to release,
|
||||
# and is now unfortunately stuck
|
||||
# usage: ./remove-tags.sh VERSION_NUMBER
|
||||
# where VERSION_NUMBER is something like 0.30.0
|
||||
|
||||
Packages=(aws-s3 file-input react transloadit aws-s3-multipart form redux-dev-tools tus companion golden-retriever robodog url companion-client google-drive server-utils utils core informer status-bar webcam dashboard instagram store-default xhr-upload drag-drop progress-bar store-redux dropbox provider-views thumbnail-generator)
|
||||
Version = $*
|
||||
|
||||
for i in "${Packages[@]}"
|
||||
do
|
||||
TAG="@uppy/$i@$1"
|
||||
echo "removing $TAG"
|
||||
git tag -d $TAG
|
||||
done
|
||||
|
|
@ -31,5 +31,7 @@ fi
|
|||
|
||||
version_files="./examples/ README.md bin/upload-to-cdn.sh website/src/examples/ website/src/docs/ website/themes/uppy/layout/"
|
||||
main_package_version=$(node -p "require('./packages/uppy/package.json').version")
|
||||
replace-x -r 'uppy/v\d+\.\d+\.\d+/dist' "uppy/v$main_package_version/dist" $version_files --exclude=node_modules
|
||||
# Legacy defeater for also renaming the old /dist/ locations, can be removed as soon as everything's on the new dist-less thing
|
||||
replace-x -r 'uppy/v\d+\.\d+\.\d+/dist/' "uppy/v$main_package_version/" $version_files --exclude=node_modules
|
||||
replace-x -r 'uppy/v\d+\.\d+\.\d+/' "uppy/v$main_package_version/" $version_files --exclude=node_modules
|
||||
git add $version_files # add changes to the Release commit
|
||||
|
|
|
|||
9
bin/to-gif-hq.sh
Executable file
9
bin/to-gif-hq.sh
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
# Convert a video file to a gif.
|
||||
# `to-gif /path/to/input.mp4 /path/to/output.gif`
|
||||
palette="/tmp/to-gif-palette.png"
|
||||
filters="fps=15"
|
||||
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
|
||||
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2
|
||||
|
||||
# gifsicle --resize-fit-width 1000 -i animation.gif > animation-1000px.gif
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
# - Checks if a tag is being built (on Travis - otherwise opts to continue execution regardless)
|
||||
# - Installs AWS CLI if needed
|
||||
# - Assumed a fully built uppy is in root dir (unless a specific tag was specified, then it's fetched from npm)
|
||||
# - Runs npm pack, and stores files to e.g. https://transloadit.edgly.net/releases/uppy/v0.29.1/dist/uppy.css
|
||||
# - Runs npm pack, and stores files to e.g. https://transloadit.edgly.net/releases/uppy/v0.30.3/uppy.css
|
||||
# - Uses local package by default, if [version] argument was specified, takes package from npm
|
||||
#
|
||||
# Run as:
|
||||
|
|
@ -50,6 +50,7 @@ pushd "${__root}" > /dev/null 2>&1
|
|||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ -z "${EDGLY_KEY:-}" ] && [ -f ./env.sh ]; then
|
||||
source ./env.sh
|
||||
fi
|
||||
|
|
@ -73,9 +74,39 @@ pushd "${__root}" > /dev/null 2>&1
|
|||
AWS_SECRET_ACCESS_KEY="${EDGLY_SECRET}" \
|
||||
aws s3 ls \
|
||||
--region="us-east-1" \
|
||||
"s3://crates.edgly.net/756b8efaed084669b02cb99d4540d81f/default/releases/uppy/v${version}/package.json" > /dev/null 2>&1 && fatal "Tag ${version} already exists"
|
||||
"s3://crates.edgly.net/756b8efaed084669b02cb99d4540d81f/default/releases/uppy/v${version}/uppy.min.css" > /dev/null 2>&1 && fatal "Tag ${version} already exists"
|
||||
echo "✅"
|
||||
|
||||
|
||||
echo "--> Obtain relevant npm files for robodog ${version} ... "
|
||||
pushd packages/@uppy/robodog
|
||||
if [ -z "${remoteVersion}" ]; then
|
||||
npm pack || fatal "Unable to fetch "
|
||||
else
|
||||
npm pack "@uppy/robodog@${remoteVersion}"
|
||||
fi
|
||||
popd > /dev/null 2>&1
|
||||
echo "✅"
|
||||
rm -rf /tmp/robodog-to-edgly
|
||||
mkdir -p /tmp/robodog-to-edgly
|
||||
cp -af "packages/@uppy/robodog/uppy-robodog-${version}.tgz" /tmp/robodog-to-edgly/
|
||||
tar zxvf "packages/@uppy/robodog/uppy-robodog-${version}.tgz" -C /tmp/robodog-to-edgly/
|
||||
|
||||
echo "--> Upload robodog to edgly.net CDN"
|
||||
pushd /tmp/robodog-to-edgly/package/dist
|
||||
# --delete \
|
||||
env \
|
||||
AWS_ACCESS_KEY_ID="${EDGLY_KEY}" \
|
||||
AWS_SECRET_ACCESS_KEY="${EDGLY_SECRET}" \
|
||||
aws s3 sync \
|
||||
--region="us-east-1" \
|
||||
--exclude 'node_modules/*' \
|
||||
./ "s3://crates.edgly.net/756b8efaed084669b02cb99d4540d81f/default/releases/uppy/v${version}"
|
||||
echo "Saved https://transloadit.edgly.net/releases/uppy/v${version}/"
|
||||
popd > /dev/null 2>&1
|
||||
rm -rf /tmp/robodog-to-edgly
|
||||
|
||||
|
||||
echo "--> Obtain relevant npm files for uppy ${version} ... "
|
||||
pushd packages/uppy
|
||||
if [ -z "${remoteVersion}" ]; then
|
||||
|
|
@ -90,8 +121,8 @@ pushd "${__root}" > /dev/null 2>&1
|
|||
cp -af "packages/uppy/uppy-${version}.tgz" /tmp/uppy-to-edgly/
|
||||
tar zxvf "packages/uppy/uppy-${version}.tgz" -C /tmp/uppy-to-edgly/
|
||||
|
||||
echo "--> Upload to edgly.net CDN"
|
||||
pushd /tmp/uppy-to-edgly/package
|
||||
echo "--> Upload uppy to edgly.net CDN"
|
||||
pushd /tmp/uppy-to-edgly/package/dist
|
||||
# --delete \
|
||||
env \
|
||||
AWS_ACCESS_KEY_ID="${EDGLY_KEY}" \
|
||||
|
|
@ -104,6 +135,7 @@ pushd "${__root}" > /dev/null 2>&1
|
|||
popd > /dev/null 2>&1
|
||||
rm -rf /tmp/uppy-to-edgly
|
||||
|
||||
|
||||
echo "${version}" | env \
|
||||
AWS_ACCESS_KEY_ID="${EDGLY_KEY}" \
|
||||
AWS_SECRET_ACCESS_KEY="${EDGLY_SECRET}" \
|
||||
|
|
|
|||
32
examples/bundled/index.html
Normal file
32
examples/bundled/index.html
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>uppy</title>
|
||||
</head>
|
||||
<body>
|
||||
<style>
|
||||
main {
|
||||
padding-top: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#upload-form {
|
||||
max-width: 600px;
|
||||
margin: auto;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
<main>
|
||||
<h1>Uppy</h1>
|
||||
|
||||
<form id="upload-form" action="/">
|
||||
<input type="file">
|
||||
<button type="submit">Upload</button>
|
||||
</form>
|
||||
</main>
|
||||
|
||||
<script src="index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
71
examples/bundled/index.js
Normal file
71
examples/bundled/index.js
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
const Uppy = require('@uppy/core')
|
||||
const Dashboard = require('@uppy/dashboard')
|
||||
const Instagram = require('@uppy/instagram')
|
||||
const GoogleDrive = require('@uppy/google-drive')
|
||||
const Url = require('@uppy/url')
|
||||
const Webcam = require('@uppy/webcam')
|
||||
const Tus = require('@uppy/tus')
|
||||
|
||||
require('@uppy/core/dist/style.css')
|
||||
require('@uppy/dashboard/dist/style.css')
|
||||
require('@uppy/url/dist/style.css')
|
||||
require('@uppy/webcam/dist/style.css')
|
||||
|
||||
const TUS_ENDPOINT = 'https://master.tus.io/files/'
|
||||
|
||||
const uppy = Uppy({
|
||||
debug: true,
|
||||
meta: {
|
||||
username: 'John',
|
||||
license: 'Creative Commons'
|
||||
}
|
||||
})
|
||||
.use(Dashboard, {
|
||||
trigger: '#pick-files',
|
||||
target: '#upload-form',
|
||||
inline: true,
|
||||
replaceTargetContent: true,
|
||||
metaFields: [
|
||||
{ id: 'license', name: 'License', placeholder: 'specify license' },
|
||||
{ id: 'caption', name: 'Caption', placeholder: 'add caption' }
|
||||
],
|
||||
showProgressDetails: true,
|
||||
proudlyDisplayPoweredByUppy: true,
|
||||
note: '2 files, images and video only'
|
||||
})
|
||||
.use(GoogleDrive, { target: Dashboard, serverUrl: 'http://localhost:3020' })
|
||||
.use(Instagram, { target: Dashboard, serverUrl: 'http://localhost:3020' })
|
||||
.use(Url, { target: Dashboard, serverUrl: 'http://localhost:3020' })
|
||||
.use(Webcam, { target: Dashboard })
|
||||
.use(Tus, { endpoint: TUS_ENDPOINT })
|
||||
|
||||
// You can optinally enable the Golden Retriever plugin — it will
|
||||
// restore files after a browser crash / accidental closed window
|
||||
// see more at https://uppy.io/docs/golden-retriever/
|
||||
//
|
||||
// .use(GoldenRetriever, {serviceWorker: true})
|
||||
|
||||
uppy.on('complete', (result) => {
|
||||
if (result.failed.length === 0) {
|
||||
console.log('Upload successful 😀')
|
||||
} else {
|
||||
console.warn('Upload failed 😞')
|
||||
}
|
||||
console.log('successful files:', result.successful)
|
||||
console.log('failed files:', result.failed)
|
||||
})
|
||||
|
||||
// uncomment if you enable Golden Retriever
|
||||
//
|
||||
/* eslint-disable compat/compat */
|
||||
// if ('serviceWorker' in navigator) {
|
||||
// navigator.serviceWorker
|
||||
// .register('/sw.js')
|
||||
// .then((registration) => {
|
||||
// console.log('ServiceWorker registration successful with scope: ', registration.scope)
|
||||
// })
|
||||
// .catch((error) => {
|
||||
// console.log('Registration failed with ' + error)
|
||||
// })
|
||||
// }
|
||||
/* eslint-enable */
|
||||
8218
examples/bundled/package-lock.json
generated
Normal file
8218
examples/bundled/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
19
examples/bundled/package.json
Normal file
19
examples/bundled/package.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"scripts": {
|
||||
"dev": "parcel index.html",
|
||||
"build": "parcel build index.html"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.26.3",
|
||||
"parcel-bundler": "^1.11.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uppy/core": "^0.30.3",
|
||||
"@uppy/dashboard": "^0.30.3",
|
||||
"@uppy/google-drive": "^0.30.3",
|
||||
"@uppy/instagram": "^0.30.3",
|
||||
"@uppy/tus": "^0.30.3",
|
||||
"@uppy/url": "^0.30.3",
|
||||
"@uppy/webcam": "^0.30.3"
|
||||
}
|
||||
}
|
||||
65
examples/bundled/sw.js
Normal file
65
examples/bundled/sw.js
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
// This service worker is needed for Golden Retriever plugin,
|
||||
// only include if you’ve enabled it
|
||||
// https://uppy.io/docs/golden-retriever/
|
||||
|
||||
/* globals clients */
|
||||
|
||||
const fileCache = Object.create(null)
|
||||
|
||||
function getCache (name) {
|
||||
if (!fileCache[name]) {
|
||||
fileCache[name] = Object.create(null)
|
||||
}
|
||||
return fileCache[name]
|
||||
}
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
console.log('Installing Uppy Service Worker...')
|
||||
|
||||
event.waitUntil(Promise.resolve()
|
||||
.then(() => self.skipWaiting()))
|
||||
})
|
||||
|
||||
self.addEventListener('activate', (event) => {
|
||||
event.waitUntil(self.clients.claim())
|
||||
})
|
||||
|
||||
function sendMessageToAllClients (msg) {
|
||||
clients.matchAll().then((clients) => {
|
||||
clients.forEach((client) => {
|
||||
client.postMessage(msg)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function addFile (store, file) {
|
||||
getCache(store)[file.id] = file.data
|
||||
console.log('Added file blob to service worker cache:', file.data)
|
||||
}
|
||||
|
||||
function removeFile (store, fileID) {
|
||||
delete getCache(store)[fileID]
|
||||
console.log('Removed file blob from service worker cache:', fileID)
|
||||
}
|
||||
|
||||
function getFiles (store) {
|
||||
sendMessageToAllClients({
|
||||
type: 'uppy/ALL_FILES',
|
||||
store: store,
|
||||
files: getCache(store)
|
||||
})
|
||||
}
|
||||
|
||||
self.addEventListener('message', (event) => {
|
||||
switch (event.data.type) {
|
||||
case 'uppy/ADD_FILE':
|
||||
addFile(event.data.store, event.data.file)
|
||||
break
|
||||
case 'uppy/REMOVE_FILE':
|
||||
removeFile(event.data.store, event.data.fileID)
|
||||
break
|
||||
case 'uppy/GET_FILES':
|
||||
getFiles(event.data.store)
|
||||
break
|
||||
}
|
||||
})
|
||||
|
|
@ -4,11 +4,11 @@
|
|||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://transloadit.edgly.net/releases/uppy/v0.29.1/dist/uppy.min.css" rel="stylesheet">
|
||||
<link href="https://transloadit.edgly.net/releases/uppy/v0.30.3/uppy.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<button id="uppyModalOpener">Open Modal</button>
|
||||
<script src="https://transloadit.edgly.net/releases/uppy/v0.29.1/dist/uppy.min.js"></script>
|
||||
<script src="https://transloadit.edgly.net/releases/uppy/v0.30.3/uppy.min.js"></script>
|
||||
<script>
|
||||
const uppy = Uppy.Core({debug: true, autoProceed: false})
|
||||
.use(Uppy.Dashboard, { trigger: '#uppyModalOpener' })
|
||||
|
|
|
|||
|
|
@ -14,11 +14,35 @@
|
|||
|
||||
#upload-form {
|
||||
max-width: 400px;
|
||||
margin: auto;
|
||||
text-align: left;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
a {
|
||||
color: purple;
|
||||
}
|
||||
|
||||
button,
|
||||
input {
|
||||
color: green;
|
||||
font-size: 30px;
|
||||
text-align: right;
|
||||
border: 2px solid purple;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 60px;
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 60px;
|
||||
}
|
||||
|
||||
.foo a {
|
||||
color: purple;
|
||||
}
|
||||
</style>
|
||||
<main>
|
||||
<main class="foo">
|
||||
<h1>Uppy is here</h1>
|
||||
|
||||
<form id="upload-form" action="/">
|
||||
|
|
@ -20,7 +20,7 @@ const uppy = Uppy({
|
|||
.use(Dashboard, {
|
||||
trigger: '#pick-files',
|
||||
// inline: true,
|
||||
// target: 'body',
|
||||
target: '.foo',
|
||||
metaFields: [
|
||||
{ id: 'license', name: 'License', placeholder: 'specify license' },
|
||||
{ id: 'caption', name: 'Caption', placeholder: 'add caption' }
|
||||
156
examples/transloadit-textarea/index.html
Normal file
156
examples/transloadit-textarea/index.html
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://transloadit.edgly.net/releases/uppy/v0.30.3/robodog.css">
|
||||
<style>
|
||||
body {
|
||||
font-family: Roboto, Open Sans;
|
||||
background: #f4f5f6;
|
||||
}
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-family: Oxygen, Raleway, Open Sans;
|
||||
}
|
||||
|
||||
header {
|
||||
width: 800px;
|
||||
margin: auto;
|
||||
}
|
||||
header h1 { text-align: center; }
|
||||
|
||||
main {
|
||||
background: white;
|
||||
margin: auto;
|
||||
width: 800px;
|
||||
border: 2px solid #e8eaee;
|
||||
padding: 36px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
main p:first-child { margin-top: 0 }
|
||||
|
||||
label {
|
||||
display: flex;
|
||||
padding-bottom: 16px;
|
||||
border-bottom: 1px solid #e8eaee;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.label-text {
|
||||
width: 25%;
|
||||
text-transform: uppercase;
|
||||
color: #888888;
|
||||
line-height: 34px;
|
||||
}
|
||||
label input, label textarea {
|
||||
flex-grow: 1;
|
||||
height: 34px;
|
||||
}
|
||||
label textarea {
|
||||
box-sizing: border-box;
|
||||
padding: 6px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #b7b7b4;
|
||||
font-family: Roboto, Open Sans;
|
||||
min-height: 160px;
|
||||
width: 100%;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.form-createSnippet {
|
||||
border: 1px solid #2e6da4;
|
||||
border-bottom-width: 3px;
|
||||
padding: 8px;
|
||||
border-radius: 5px;
|
||||
background-color: #337ab7;
|
||||
color: white;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mdtxt {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.mdtxt-controls {
|
||||
}
|
||||
.mdtxt-upload {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
border-radius: 0 0 5px 5px;
|
||||
border: 1px solid #b7b7b4;
|
||||
border-top-width: 0;
|
||||
padding: 4px 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.mdtxt textarea {
|
||||
margin-bottom: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.mdtxt-upload .error {
|
||||
border-color: red;
|
||||
color: red;
|
||||
}
|
||||
.mdtxt-upload .error .message {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.snippet {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
/* temp uppy fix, there was a typo in class name */
|
||||
/* remove after uppy@>0.30.3 */
|
||||
.uppy-DashboardAddFiles {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
flex: 1;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Markdown Bin</h1>
|
||||
</header>
|
||||
<main>
|
||||
<p>
|
||||
Markdown Bin is a demo app that works a bit like Github Gists or pastebin. You can add markdown snippets, and add file attachments to each snippet by clicking "Upload an attachment" or by dragging files onto the text area. Transloadit generates an inline preview image for images, videos, and audio files. <a target="_blank" href="https://github.com/transloadit/uppy/blob/master/examples/transloadit-textarea/template.json">» View the Assembly Template here.</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
⚠️ For this demo, snippets are stored locally in your browser. Attachments are stored in Transloadit's temporary storage and expire after about 24 hours. In a real app, you can easily export files to a permanent storage solution like Amazon S3 or Google Cloud. <a target="_blank" href="https://transloadit.com/docs/#17-saving-conversion-results">» Learn more</a>
|
||||
</p>
|
||||
|
||||
<form id="new">
|
||||
<h2>Create a new snippet</h2>
|
||||
<label>
|
||||
<span class="label-text">Snippet Title</span>
|
||||
<input type="text" name="title" placeholder="Snippet Title">
|
||||
</label>
|
||||
<label>
|
||||
<textarea name="snippet"></textarea>
|
||||
</label>
|
||||
<p>
|
||||
<button class="form-createSnippet" type="submit">
|
||||
Create
|
||||
</button>
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<h2>Previous snippets</h2>
|
||||
|
||||
<div id="snippets">
|
||||
</div>
|
||||
</main>
|
||||
<template id="snippet">
|
||||
<div class="snippet">
|
||||
<h3 class="snippet-title"></h3>
|
||||
<div class="snippet-content"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script src="bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
185
examples/transloadit-textarea/main.js
Normal file
185
examples/transloadit-textarea/main.js
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
/* eslint-env browser */
|
||||
const marked = require('marked')
|
||||
const dragdrop = require('drag-drop')
|
||||
const robodog = require('@uppy/robodog')
|
||||
|
||||
const TRANSLOADIT_EXAMPLE_KEY = '35c1aed03f5011e982b6afe82599b6a0'
|
||||
const TRANSLOADIT_EXAMPLE_TEMPLATE = '0b2ee2bc25dc43619700c2ce0a75164a'
|
||||
|
||||
/**
|
||||
* A textarea for markdown text, with support for file attachments.
|
||||
*
|
||||
* ## Usage
|
||||
*
|
||||
* ```js
|
||||
* const element = document.querySelector('textarea')
|
||||
* const mdtxt = new MarkdownTextarea(element)
|
||||
* mdtxt.install()
|
||||
* ```
|
||||
*/
|
||||
class MarkdownTextarea {
|
||||
constructor (element) {
|
||||
this.element = element
|
||||
this.controls = document.createElement('div')
|
||||
this.controls.classList.add('mdtxt-controls')
|
||||
this.uploadLine = document.createElement('div')
|
||||
this.uploadLine.classList.add('mdtxt-upload')
|
||||
|
||||
this.uploadLine.appendChild(
|
||||
document.createTextNode('Upload an attachment'))
|
||||
}
|
||||
|
||||
install () {
|
||||
const { element } = this
|
||||
const wrapper = document.createElement('div')
|
||||
wrapper.classList.add('mdtxt')
|
||||
element.parentNode.replaceChild(wrapper, element)
|
||||
wrapper.appendChild(this.controls)
|
||||
wrapper.appendChild(element)
|
||||
wrapper.appendChild(this.uploadLine)
|
||||
|
||||
this.setupUploadLine()
|
||||
}
|
||||
|
||||
setupTextareaDrop () {
|
||||
dragdrop(this.element, (files) => {
|
||||
this.uploadFiles(files)
|
||||
})
|
||||
}
|
||||
|
||||
setupUploadLine () {
|
||||
this.uploadLine.addEventListener('click', () => {
|
||||
this.pickFiles()
|
||||
})
|
||||
}
|
||||
|
||||
reportUploadError (err) {
|
||||
this.uploadLine.classList.add('error')
|
||||
const message = document.createElement('span')
|
||||
message.appendChild(document.createTextNode(err.message))
|
||||
this.uploadLine.insertChild(message, this.uploadLine.firstChild)
|
||||
}
|
||||
|
||||
unreportUploadError () {
|
||||
this.uploadLine.classList.remove('error')
|
||||
const message = this.uploadLine.querySelector('message')
|
||||
if (message) {
|
||||
this.uploadLine.removeChild(message)
|
||||
}
|
||||
}
|
||||
|
||||
insertAttachments (attachments) {
|
||||
attachments.forEach((attachment) => {
|
||||
const { file, thumb } = attachment
|
||||
const link = `\n[LABEL](${file.ssl_url})\n`
|
||||
const labelText = `View File ${file.basename}`
|
||||
if (thumb) {
|
||||
this.element.value += link.replace('LABEL', ``)
|
||||
} else {
|
||||
this.element.value += link.replace('LABEL', labelText)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
matchFilesAndThumbs (results) {
|
||||
const filesById = {}
|
||||
const thumbsById = {}
|
||||
|
||||
results.forEach((result) => {
|
||||
if (result.stepName === 'thumbnails') {
|
||||
thumbsById[result.original_id] = result
|
||||
} else {
|
||||
filesById[result.original_id] = result
|
||||
}
|
||||
})
|
||||
|
||||
return Object.keys(filesById).reduce((acc, key) => {
|
||||
const file = filesById[key]
|
||||
const thumb = thumbsById[key]
|
||||
acc.push({ file, thumb })
|
||||
return acc
|
||||
}, [])
|
||||
}
|
||||
|
||||
uploadFiles (files) {
|
||||
robodog.upload({
|
||||
waitForEncoding: true,
|
||||
params: {
|
||||
auth: { key: TRANSLOADIT_EXAMPLE_KEY },
|
||||
template_id: TRANSLOADIT_EXAMPLE_TEMPLATE
|
||||
}
|
||||
}).then((result) => {
|
||||
this.insertAttachments(
|
||||
this.matchFilesAndThumbs(result.results)
|
||||
)
|
||||
}).catch((err) => {
|
||||
console.error(err)
|
||||
this.reportUploadError(err)
|
||||
})
|
||||
}
|
||||
|
||||
pickFiles () {
|
||||
robodog.pick({
|
||||
waitForEncoding: true,
|
||||
params: {
|
||||
auth: { key: TRANSLOADIT_EXAMPLE_KEY },
|
||||
template_id: TRANSLOADIT_EXAMPLE_TEMPLATE
|
||||
}
|
||||
}).then((result) => {
|
||||
this.insertAttachments(
|
||||
this.matchFilesAndThumbs(result.results)
|
||||
)
|
||||
}).catch((err) => {
|
||||
console.error(err)
|
||||
this.reportUploadError(err)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const textarea = new MarkdownTextarea(
|
||||
document.querySelector('#new textarea'))
|
||||
textarea.install()
|
||||
|
||||
function renderSnippet (title, text) {
|
||||
const template = document.querySelector('#snippet')
|
||||
const newSnippet = document.importNode(template.content, true)
|
||||
const titleEl = newSnippet.querySelector('.snippet-title')
|
||||
const contentEl = newSnippet.querySelector('.snippet-content')
|
||||
|
||||
titleEl.appendChild(document.createTextNode(title))
|
||||
contentEl.innerHTML = marked(text)
|
||||
|
||||
const list = document.querySelector('#snippets')
|
||||
list.insertBefore(newSnippet, list.firstChild)
|
||||
}
|
||||
|
||||
function saveSnippet (title, text) {
|
||||
const id = parseInt(localStorage.numSnippets || 0, 10)
|
||||
localStorage[`snippet_${id}`] = JSON.stringify({ title, text })
|
||||
localStorage.numSnippets = id + 1
|
||||
}
|
||||
|
||||
function loadSnippets () {
|
||||
for (let id = 0; localStorage[`snippet_${id}`] != null; id += 1) {
|
||||
const { title, text } = JSON.parse(localStorage[`snippet_${id}`])
|
||||
renderSnippet(title, text)
|
||||
}
|
||||
}
|
||||
|
||||
document.querySelector('#new').addEventListener('submit', (event) => {
|
||||
event.preventDefault()
|
||||
|
||||
const title = event.target.querySelector('input[name="title"]').value ||
|
||||
'Unnamed Snippet'
|
||||
const text = textarea.element.value
|
||||
|
||||
saveSnippet(title, text)
|
||||
renderSnippet(title, text)
|
||||
|
||||
event.target.querySelector('input').value = ''
|
||||
event.target.querySelector('textarea').value = ''
|
||||
})
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
loadSnippets()
|
||||
})
|
||||
19
examples/transloadit-textarea/package.json
Normal file
19
examples/transloadit-textarea/package.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"aliasify": {
|
||||
"aliases": {
|
||||
"@uppy": "../../packages/@uppy"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"drag-drop": "^4.2.0",
|
||||
"marked": "^0.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"aliasify": "^2.1.0",
|
||||
"browserify": "^16.2.3",
|
||||
"ecstatic": "^3.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "browserify -g aliasify main.js > bundle.js && ecstatic"
|
||||
}
|
||||
}
|
||||
93
examples/transloadit-textarea/template.json
Normal file
93
examples/transloadit-textarea/template.json
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
"steps": {
|
||||
":original": {
|
||||
"robot": "/upload/handle"
|
||||
},
|
||||
|
||||
"images": {
|
||||
"use": [
|
||||
":original"
|
||||
],
|
||||
"robot": "/file/filter",
|
||||
"result": true,
|
||||
"accepts": [
|
||||
["${file.mime}", "regex", "image/"]
|
||||
]
|
||||
},
|
||||
"videos": {
|
||||
"use": [
|
||||
":original"
|
||||
],
|
||||
"robot": "/file/filter",
|
||||
"result": true,
|
||||
"accepts": [
|
||||
["${file.mime}", "regex", "video/"]
|
||||
]
|
||||
},
|
||||
"audios": {
|
||||
"use": [
|
||||
":original"
|
||||
],
|
||||
"robot": "/file/filter",
|
||||
"result": true,
|
||||
"accepts": [
|
||||
["${file.mime}", "regex", "audio/"]
|
||||
]
|
||||
},
|
||||
"others": {
|
||||
"use": [
|
||||
":original"
|
||||
],
|
||||
"robot": "/file/filter",
|
||||
"result": true,
|
||||
"rejects": [
|
||||
["${file.mime}", "regex", "image/"],
|
||||
["${file.mime}", "regex", "video/"],
|
||||
["${file.mime}", "regex", "audio/"]
|
||||
]
|
||||
},
|
||||
|
||||
"audio_thumbnails": {
|
||||
"use": [
|
||||
"audios"
|
||||
],
|
||||
"robot": "/audio/artwork",
|
||||
"ffmpeg_stack": "v3.3.3"
|
||||
},
|
||||
"resized_thumbnails": {
|
||||
"use": [
|
||||
"images",
|
||||
"audio_thumbnails"
|
||||
],
|
||||
"robot": "/image/resize",
|
||||
"imagemagick_stack": "v1.0.0",
|
||||
"width": 400,
|
||||
"height": 300,
|
||||
"resize_strategy": "fit",
|
||||
"zoom": false
|
||||
},
|
||||
"video_thumbnails": {
|
||||
"use": [
|
||||
"videos"
|
||||
],
|
||||
"robot": "/video/thumbs",
|
||||
"ffmpeg_stack": "v3.3.3",
|
||||
"count": 1,
|
||||
"offsets": [
|
||||
"50%"
|
||||
],
|
||||
"format": "jpeg",
|
||||
"width": 400,
|
||||
"height": 300,
|
||||
"resize_strategy": "fit"
|
||||
},
|
||||
"thumbnails": {
|
||||
"use": [
|
||||
"resized_thumbnails",
|
||||
"video_thumbnails"
|
||||
],
|
||||
"robot": "/image/optimize",
|
||||
"result": true
|
||||
}
|
||||
}
|
||||
}
|
||||
1
examples/transloadit/.gitignore
vendored
Normal file
1
examples/transloadit/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
uppy.min.css
|
||||
110
examples/transloadit/index.html
Normal file
110
examples/transloadit/index.html
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Uppy :tl: playground</title>
|
||||
</head>
|
||||
<body>
|
||||
<style>
|
||||
html {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
main {
|
||||
padding: 20px;
|
||||
font: 12pt sans-serif;
|
||||
background: white;
|
||||
width: 800px;
|
||||
margin: auto;
|
||||
}
|
||||
hr {
|
||||
border: 0;
|
||||
background-color: #111e33;
|
||||
height: 1px;
|
||||
}
|
||||
.hidden { display: none; }
|
||||
.error { color: red; }
|
||||
#logo { height: 1em; vertical-align: middle; }
|
||||
</style>
|
||||
<main>
|
||||
<h1>Uppy <img src="https://transloadit.edgly.net/assets/images/logo-small.svg" alt="Transloadit" id="logo"> playground</h1>
|
||||
|
||||
<hr>
|
||||
<h2>transloadit.form()</h2>
|
||||
|
||||
<form id="test-form" method="post" action="http://localhost:9967/test">
|
||||
<p><strong>leave a message</strong>
|
||||
<p>
|
||||
<label>name:
|
||||
<input type="text" name="name">
|
||||
</label>
|
||||
<p>
|
||||
<label>message: <br>
|
||||
<textarea name="message"></textarea>
|
||||
</label>
|
||||
|
||||
<p>
|
||||
<label>
|
||||
attachments:
|
||||
<input type="file" name="files" multiple>
|
||||
</label>
|
||||
<div class="progress"></div>
|
||||
|
||||
<p>
|
||||
<button type="submit">
|
||||
Upload
|
||||
</button>
|
||||
|
||||
<span class="error"></span>
|
||||
</form>
|
||||
|
||||
<hr>
|
||||
<h2>transloadit.form() with dashboard</h2>
|
||||
<form id="dashboard-form" method="post" action="http://localhost:9967/test">
|
||||
<p><strong>leave a message</strong>
|
||||
<p>
|
||||
<label>name:
|
||||
<input type="text" name="name">
|
||||
</label>
|
||||
<p>
|
||||
<label>message: <br>
|
||||
<textarea name="message"></textarea>
|
||||
</label>
|
||||
|
||||
<p>
|
||||
<label>
|
||||
attachments:
|
||||
<span class="dashboard"></span>
|
||||
</label>
|
||||
|
||||
<p>
|
||||
<button type="submit">
|
||||
Upload
|
||||
</button>
|
||||
|
||||
<span class="error"></span>
|
||||
</form>
|
||||
|
||||
|
||||
<hr>
|
||||
<h2>transloadit.pick()</h2>
|
||||
|
||||
<p>
|
||||
<button onclick="openModal()">Open</button>
|
||||
|
||||
<hr>
|
||||
<h2>transloadit.upload()</h2>
|
||||
<p>
|
||||
An <input type=file> backed by `transloadit.upload`:
|
||||
|
||||
<p>
|
||||
<input type="file" multiple onchange="doUpload(event)">
|
||||
|
||||
<p id="upload-result">
|
||||
<p id="upload-error" class="error">
|
||||
</main>
|
||||
|
||||
<link href="uppy.min.css" rel="stylesheet">
|
||||
<script src="bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
99
examples/transloadit/main.js
Normal file
99
examples/transloadit/main.js
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
const { inspect } = require('util')
|
||||
const transloadit = require('@uppy/robodog')
|
||||
|
||||
/**
|
||||
* transloadit.form
|
||||
*/
|
||||
|
||||
const formUppy = transloadit.form('#test-form', {
|
||||
debug: true,
|
||||
fields: ['message'],
|
||||
restrictions: {
|
||||
allowedFileTypes: ['.png']
|
||||
},
|
||||
waitForEncoding: true,
|
||||
params: {
|
||||
auth: { key: '05a61ed019fe11e783fdbd1f56c73eb0' },
|
||||
template_id: 'be001500a56011e889f9cddd88df842c'
|
||||
},
|
||||
modal: true,
|
||||
progressBar: '#test-form .progress'
|
||||
})
|
||||
|
||||
formUppy.on('error', (err) => {
|
||||
document.querySelector('#test-form .error')
|
||||
.textContent = err.message
|
||||
})
|
||||
|
||||
formUppy.on('upload-error', (file, err) => {
|
||||
document.querySelector('#test-form .error')
|
||||
.textContent = err.message
|
||||
})
|
||||
|
||||
window.formUppy = formUppy
|
||||
|
||||
const formUppyWithDashboard = transloadit.form('#dashboard-form', {
|
||||
debug: true,
|
||||
fields: ['message'],
|
||||
restrictions: {
|
||||
allowedFileTypes: ['.png']
|
||||
},
|
||||
waitForEncoding: true,
|
||||
params: {
|
||||
auth: { key: '05a61ed019fe11e783fdbd1f56c73eb0' },
|
||||
template_id: 'be001500a56011e889f9cddd88df842c'
|
||||
},
|
||||
dashboard: '#dashboard-form .dashboard'
|
||||
})
|
||||
|
||||
window.formUppyWithDashboard = formUppyWithDashboard
|
||||
|
||||
/**
|
||||
* transloadit.modal
|
||||
*/
|
||||
|
||||
function openModal () {
|
||||
transloadit.pick({
|
||||
restrictions: {
|
||||
allowedFileTypes: ['.png']
|
||||
},
|
||||
waitForEncoding: true,
|
||||
params: {
|
||||
auth: { key: '05a61ed019fe11e783fdbd1f56c73eb0' },
|
||||
template_id: 'be001500a56011e889f9cddd88df842c'
|
||||
},
|
||||
providers: [
|
||||
'webcam'
|
||||
]
|
||||
// if providers need custom config
|
||||
// webcam: {
|
||||
// option: 'whatever'
|
||||
// }
|
||||
}).then(console.log, console.error)
|
||||
}
|
||||
|
||||
window.openModal = openModal
|
||||
|
||||
/**
|
||||
* transloadit.upload
|
||||
*/
|
||||
|
||||
window.doUpload = (event) => {
|
||||
const resultEl = document.querySelector('#upload-result')
|
||||
const errorEl = document.querySelector('#upload-error')
|
||||
transloadit.upload(event.target.files, {
|
||||
waitForEncoding: true,
|
||||
params: {
|
||||
auth: { key: '05a61ed019fe11e783fdbd1f56c73eb0' },
|
||||
template_id: 'be001500a56011e889f9cddd88df842c'
|
||||
}
|
||||
}).then((result) => {
|
||||
resultEl.classList.remove('hidden')
|
||||
errorEl.classList.add('hidden')
|
||||
resultEl.textContent = inspect(result.results)
|
||||
}, (err) => {
|
||||
resultEl.classList.add('hidden')
|
||||
errorEl.classList.remove('hidden')
|
||||
errorEl.textContent = err.message
|
||||
})
|
||||
}
|
||||
4797
examples/transloadit/package-lock.json
generated
Normal file
4797
examples/transloadit/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
23
examples/transloadit/package.json
Normal file
23
examples/transloadit/package.json
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"private": true,
|
||||
"name": "uppy-robodog-example",
|
||||
"scripts": {
|
||||
"css": "cp ../../packages/uppy/dist/uppy.min.css .",
|
||||
"start": "npm run css && (node server & budo main.js:bundle.js -- -t babelify -g aliasify & wait)"
|
||||
},
|
||||
"aliasify": {
|
||||
"aliases": {
|
||||
"@uppy": "../../packages/@uppy"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"he": "^1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"aliasify": "^2.1.0",
|
||||
"babel-core": "^6.26.3",
|
||||
"babelify": "^8.0.0",
|
||||
"budo": "^11.3.2",
|
||||
"express": "^4.16.4"
|
||||
}
|
||||
}
|
||||
13
examples/transloadit/readme.md
Normal file
13
examples/transloadit/readme.md
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Multiple Instances
|
||||
|
||||
This example uses Uppy with the RestoreFiles plugin.
|
||||
It has two instances on the same page, side-by-side, but with different `id`s so their stored files don't interfere with each other.
|
||||
|
||||
## Run it
|
||||
|
||||
Move into this directory, then:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
122
examples/transloadit/server.js
Normal file
122
examples/transloadit/server.js
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
const http = require('http')
|
||||
const qs = require('querystring')
|
||||
const e = require('he').encode
|
||||
|
||||
/**
|
||||
* A very haxxor server that outputs some of the data it receives in a POST form parameter.
|
||||
*/
|
||||
|
||||
const server = http.createServer(onrequest)
|
||||
server.listen(9967)
|
||||
|
||||
function onrequest (req, res) {
|
||||
if (req.url !== '/test') {
|
||||
res.writeHead(404, {'content-type': 'text/html'})
|
||||
res.end('404')
|
||||
return
|
||||
}
|
||||
|
||||
let body = ''
|
||||
req.on('data', (chunk) => { body += chunk })
|
||||
req.on('end', () => {
|
||||
onbody(body)
|
||||
})
|
||||
|
||||
function onbody (body) {
|
||||
const fields = qs.parse(body)
|
||||
const assemblies = JSON.parse(fields.transloadit)
|
||||
|
||||
res.setHeader('content-type', 'text/html')
|
||||
res.write(Header())
|
||||
res.write(FormFields(fields))
|
||||
assemblies.forEach((assembly) => {
|
||||
res.write(AssemblyResult(assembly))
|
||||
})
|
||||
res.end(Footer())
|
||||
}
|
||||
}
|
||||
|
||||
function Header () {
|
||||
return `
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body { background: #f1f1f1; }
|
||||
main {
|
||||
padding: 20px;
|
||||
font: 12pt sans-serif;
|
||||
background: white;
|
||||
width: 800px;
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
`
|
||||
}
|
||||
|
||||
function Footer () {
|
||||
return `
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
`
|
||||
}
|
||||
|
||||
function FormFields (fields) {
|
||||
return `
|
||||
<h1>Form Fields</h1>
|
||||
<dl>
|
||||
${Object.entries(fields).map(Field).join('\n')}
|
||||
</dl>
|
||||
`
|
||||
|
||||
function Field ([name, value]) {
|
||||
if (name === 'transloadit') return ''
|
||||
return `
|
||||
<dt>${e(name)}</dt>
|
||||
<dd>${e(value)}</dd>
|
||||
`
|
||||
}
|
||||
}
|
||||
|
||||
function AssemblyResult (assembly) {
|
||||
return `
|
||||
<h1>${e(assembly.assembly_id)} (${e(assembly.ok)})</h1>
|
||||
${UploadsList(assembly.uploads)}
|
||||
${ResultsList(assembly.results)}
|
||||
`
|
||||
}
|
||||
|
||||
function UploadsList (uploads) {
|
||||
return `
|
||||
<ul>
|
||||
${uploads.map(Upload).join('\n')}
|
||||
</ul>
|
||||
`
|
||||
|
||||
function Upload (upload) {
|
||||
return `<li>${e(upload.name)}</li>`
|
||||
}
|
||||
}
|
||||
|
||||
function ResultsList (results) {
|
||||
return Object.keys(results)
|
||||
.map(ResultsSection)
|
||||
.join('\n')
|
||||
|
||||
function ResultsSection (stepName) {
|
||||
return `
|
||||
<h2>${e(stepName)}</h2>
|
||||
<ul>
|
||||
${results[stepName].map(Result).join('\n')}
|
||||
</ul>
|
||||
`
|
||||
}
|
||||
|
||||
function Result (result) {
|
||||
return `<li>${e(result.name)} <a href="${result.ssl_url}" target="_blank">View</a></li>`
|
||||
}
|
||||
}
|
||||
|
|
@ -4,11 +4,11 @@
|
|||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://transloadit.edgly.net/releases/uppy/v0.29.1/dist/uppy.min.css" rel="stylesheet">
|
||||
<link href="https://transloadit.edgly.net/releases/uppy/v0.30.3/uppy.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<button id="uppyModalOpener">Open Modal</button>
|
||||
<script src="https://transloadit.edgly.net/releases/uppy/v0.29.1/dist/uppy.min.js"></script>
|
||||
<script src="https://transloadit.edgly.net/releases/uppy/v0.30.3/uppy.min.js"></script>
|
||||
<script>
|
||||
const uppy = Uppy.Core({debug: true, autoProceed: false})
|
||||
.use(Uppy.Dashboard, { trigger: '#uppyModalOpener' })
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
# Unused
|
||||
|
||||
These locale files are not currently used by Uppy. We are keeping them around because they will, hopefully, be used in the future.
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
/* eslint camelcase: 0 */
|
||||
|
||||
const cs_CZ = {}
|
||||
|
||||
cs_CZ.strings = {
|
||||
chooseFile: 'Vyberte soubor',
|
||||
orDragDrop: 'nebo ho sem přetáhněte',
|
||||
youHaveChosen: 'Vybrali jste: %{fileName}',
|
||||
filesChosen: {
|
||||
0: '%{smart_count} soubor vybrán',
|
||||
1: '%{smart_count} soubory vybrány',
|
||||
2: '%{smart_count} souborů vybráno'
|
||||
},
|
||||
filesUploaded: {
|
||||
0: '%{smart_count} soubor nahrán',
|
||||
1: '%{smart_count} soubory nahrány',
|
||||
2: '%{smart_count} souborů nahráno'
|
||||
},
|
||||
files: {
|
||||
0: '%{smart_count} soubor',
|
||||
1: '%{smart_count} soubory',
|
||||
2: '%{smart_count} souborů'
|
||||
},
|
||||
uploadFiles: {
|
||||
0: 'Nahrát %{smart_count} soubor',
|
||||
1: 'Nahrát %{smart_count} soubory',
|
||||
2: 'Nahrát %{smart_count} souborů'
|
||||
},
|
||||
selectToUpload: 'Vybrat soubory k nahrání',
|
||||
closeModal: 'Zavřít okno',
|
||||
upload: 'Nahrát',
|
||||
importFrom: 'Importovat soubory z',
|
||||
dashboardWindowTitle: 'Uppy Dashboard okno (Pro zavření stiskněte Escape)',
|
||||
dashboardTitle: 'Uppy Dashboard',
|
||||
copyLinkToClipboardSuccess: 'Odkaz zkopírován do schránky.',
|
||||
copyLinkToClipboardFallback: 'Zkopírovat následující odkaz',
|
||||
done: 'Hotovo',
|
||||
localDisk: 'Disk',
|
||||
dropPasteImport: 'Přetáhněte soubory, vložte je, importujte je z některých výše uvedených služeb, nebo',
|
||||
dropPaste: 'Přetáhněte soubory, vložte je, nebo',
|
||||
browse: 'procházejte',
|
||||
fileProgress: 'Nahrávání: rychlost nahrávání a zbývající čas',
|
||||
numberOfSelectedFiles: 'Počet vybraných souborů',
|
||||
uploadAllNewFiles: 'Nahrát všechny nové soubory'
|
||||
}
|
||||
|
||||
cs_CZ.pluralize = function (n) {
|
||||
if (n === 1) {
|
||||
return 0
|
||||
}
|
||||
|
||||
if (n >= 2 && n <= 4) {
|
||||
return 1
|
||||
}
|
||||
|
||||
return 2
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
|
||||
window.Uppy.locales.cs_CZ = cs_CZ
|
||||
}
|
||||
|
||||
module.exports = cs_CZ
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/* eslint camelcase: 0 */
|
||||
|
||||
const de_DE = {}
|
||||
|
||||
de_DE.strings = {
|
||||
chooseFile: 'Wähle eine Datei',
|
||||
youHaveChosen: 'Du hast gewählt: %{fileName}',
|
||||
orDragDrop: 'oder schiebe Sie hier her',
|
||||
filesChosen: {
|
||||
0: '%{smart_count} Datei gewählt',
|
||||
1: '%{smart_count} Dateien gewählt'
|
||||
},
|
||||
filesUploaded: {
|
||||
0: '%{smart_count} Datei hochgeladen',
|
||||
1: '%{smart_count} Dateien hochgeladen'
|
||||
},
|
||||
files: {
|
||||
0: '%{smart_count} Datei',
|
||||
1: '%{smart_count} Dateien'
|
||||
},
|
||||
uploadFiles: {
|
||||
0: 'Upload %{smart_count} Datei',
|
||||
1: 'Upload %{smart_count} Dateien'
|
||||
},
|
||||
selectToUpload: 'Ausgewählten Dateien wurden hochgeladen',
|
||||
closeModal: 'Schließen Modal',
|
||||
upload: 'Hochladen',
|
||||
importFrom: 'Importiere Daten von',
|
||||
dashboardWindowTitle: 'Uppy Dashboard Fenster (Drücke Escape zum schließen)',
|
||||
dashboardTitle: 'Uppy Dashboard',
|
||||
copyLinkToClipboardSuccess: 'Link wurde in Zwischenablage kopiert.',
|
||||
copyLinkToClipboardFallback: 'Kopiere die untere URL',
|
||||
done: 'Fertig',
|
||||
localDisk: 'Lokale Festplatte',
|
||||
dropPasteImport: 'Ziehe Dateien hier her, einfügen, importieren aus einer der oberen Quellen oder',
|
||||
dropPaste: 'Zihe Dateien hier her, einfügen oder',
|
||||
browse: 'Durchsuchen',
|
||||
fileProgress: 'Datei Fortschritt: Upload Geschwindigkeit und ETA',
|
||||
numberOfSelectedFiles: 'Anzahl gewählter Dateien',
|
||||
uploadAllNewFiles: 'Alle neuen Dateien hochladen'
|
||||
}
|
||||
|
||||
de_DE.pluralize = function (n) {
|
||||
if (n === 1) {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
|
||||
window.Uppy.locales.de_DE = de_DE
|
||||
}
|
||||
|
||||
module.exports = de_DE
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/* eslint camelcase: 0 */
|
||||
|
||||
const en_US = {}
|
||||
|
||||
en_US.strings = {
|
||||
chooseFile: 'Choose a file',
|
||||
youHaveChosen: 'You have chosen: %{fileName}',
|
||||
orDragDrop: 'or drag it here',
|
||||
filesChosen: {
|
||||
0: '%{smart_count} file selected',
|
||||
1: '%{smart_count} files selected'
|
||||
},
|
||||
filesUploaded: {
|
||||
0: '%{smart_count} file uploaded',
|
||||
1: '%{smart_count} files uploaded'
|
||||
},
|
||||
files: {
|
||||
0: '%{smart_count} file',
|
||||
1: '%{smart_count} files'
|
||||
},
|
||||
uploadFiles: {
|
||||
0: 'Upload %{smart_count} file',
|
||||
1: 'Upload %{smart_count} files'
|
||||
},
|
||||
selectToUpload: 'Select files to upload',
|
||||
closeModal: 'Close Modal',
|
||||
upload: 'Upload',
|
||||
importFrom: 'Import files from',
|
||||
dashboardWindowTitle: 'Uppy Dashboard Window (Press escape to close)',
|
||||
dashboardTitle: 'Uppy Dashboard',
|
||||
copyLinkToClipboardSuccess: 'Link copied to clipboard.',
|
||||
copyLinkToClipboardFallback: 'Copy the URL below',
|
||||
done: 'Done',
|
||||
localDisk: 'Local Disk',
|
||||
dropPasteImport: 'Drop files here, paste, import from one of the locations above or',
|
||||
dropPaste: 'Drop files here, paste or',
|
||||
browse: 'browse',
|
||||
fileProgress: 'File progress: upload speed and ETA',
|
||||
numberOfSelectedFiles: 'Number of selected files',
|
||||
uploadAllNewFiles: 'Upload all new files'
|
||||
}
|
||||
|
||||
en_US.pluralize = function (n) {
|
||||
if (n === 1) {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
|
||||
window.Uppy.locales.en_US = en_US
|
||||
}
|
||||
|
||||
module.exports = en_US
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/* eslint camelcase: 0 */
|
||||
|
||||
const es_ES = {}
|
||||
|
||||
es_ES.strings = {
|
||||
chooseFile: 'Selecciona un fichero',
|
||||
youHaveChosen: 'Has seleccionado: %{fileName}',
|
||||
orDragDrop: 'o arrástralo aquí',
|
||||
filesChosen: {
|
||||
0: '%{smart_count} fichero seleccionado',
|
||||
1: '%{smart_count} ficheros seleccionados'
|
||||
},
|
||||
filesUploaded: {
|
||||
0: '%{smart_count} fichero subido',
|
||||
1: '%{smart_count} ficheros subidos'
|
||||
},
|
||||
files: {
|
||||
0: '%{smart_count} fichero',
|
||||
1: '%{smart_count} ficheros'
|
||||
},
|
||||
uploadFiles: {
|
||||
0: 'Subir %{smart_count} fichero',
|
||||
1: 'Subir %{smart_count} ficheros'
|
||||
},
|
||||
selectToUpload: 'Selecciona los ficheros a subir',
|
||||
closeModal: 'Cerrar modal',
|
||||
upload: 'Subir',
|
||||
importFrom: 'Importar ficheros desde',
|
||||
dashboardWindowTitle: 'Panel de Uppy (Pulsa escape para cerrar)',
|
||||
dashboardTitle: 'Panel de Uppy',
|
||||
copyLinkToClipboardSuccess: 'Enlace copiado al portapapeles.',
|
||||
copyLinkToClipboardFallback: 'Copiar la siguiente URL',
|
||||
done: 'Hecho',
|
||||
localDisk: 'Disco local',
|
||||
dropPasteImport: 'Arrasta ficheros aquí, pega, importa de alguno de los servicios de arriba o',
|
||||
dropPaste: 'Arrastra ficheros aquí, pega o',
|
||||
browse: 'navegar',
|
||||
fileProgress: 'Progreso: velocidad de subida y tiempo estimado',
|
||||
numberOfSelectedFiles: 'Número de ficheros seleccionados',
|
||||
uploadAllNewFiles: 'Subir todos los nuevos ficheros'
|
||||
}
|
||||
|
||||
es_ES.pluralize = function (n) {
|
||||
if (n === 1) {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
|
||||
window.Uppy.locales.es_ES = es_ES
|
||||
}
|
||||
|
||||
module.exports = es_ES
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/* eslint camelcase: 0 */
|
||||
|
||||
const fi_FI = {}
|
||||
|
||||
fi_FI.strings = {
|
||||
chooseFile: 'Valitse tiedosto',
|
||||
youHaveChosen: 'Valitsit: %{fileName}',
|
||||
orDragDrop: 'tai raahaa se tähän',
|
||||
filesChosen: {
|
||||
0: '%{smart_count} tiedosto valittu',
|
||||
1: '%{smart_count} tiedostoa valittu'
|
||||
},
|
||||
filesUploaded: {
|
||||
0: '%{smart_count} tiedosto siirretty',
|
||||
1: '%{smart_count} tiedostoa siirretty'
|
||||
},
|
||||
files: {
|
||||
0: '%{smart_count} tiedosto',
|
||||
1: '%{smart_count} tiedostoa'
|
||||
},
|
||||
uploadFiles: {
|
||||
0: 'Siirrä %{smart_count} tiedosto',
|
||||
1: 'Siirrä %{smart_count} tiedostoa'
|
||||
},
|
||||
selectToUpload: 'Valitse siirrettävät tiedostot',
|
||||
closeModal: 'Sulje ikkuna',
|
||||
upload: 'Siirrä',
|
||||
importFrom: 'Tuo tiedostoja',
|
||||
dashboardWindowTitle: 'Uppy-ohjausnäkymä (Sulje Esc-näppäimellä)',
|
||||
dashboardTitle: 'Uppy-ohjausnäkymä',
|
||||
copyLinkToClipboardSuccess: 'Linkki kopioitu leikepöydälle.',
|
||||
copyLinkToClipboardFallback: 'Kopioi allaoleva linkki',
|
||||
done: 'Valmis',
|
||||
localDisk: 'Paikallinen levy',
|
||||
dropPasteImport: 'Pudota tiedosto(t) tähän, liitä, tuo tiedostoja ylläolevista sijainneista tai',
|
||||
dropPaste: 'Pudota tiedosto(t) tähän, liitä tai',
|
||||
browse: 'selaa',
|
||||
fileProgress: 'Siirron edistyminen: lähetysnopeus ja arvioitu valmistumisaika',
|
||||
numberOfSelectedFiles: 'Valittujen tiedostojen lukumäärä',
|
||||
uploadAllNewFiles: 'Siirrä kaikki uudet tiedostot'
|
||||
}
|
||||
|
||||
fi_FI.pluralize = function (n) {
|
||||
if (n === 1) {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
|
||||
window.Uppy.locales.fi_FI = fi_FI
|
||||
}
|
||||
|
||||
module.exports = fi_FI
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/* eslint camelcase: 0 */
|
||||
|
||||
const id_ID = {}
|
||||
|
||||
id_ID.strings = {
|
||||
chooseFile: 'Pilih berkas',
|
||||
youHaveChosen: 'Berkas yang dipilih: %{fileName}',
|
||||
orDragDrop: 'atau tarik dan taruh berkas ke sini',
|
||||
filesChosen: {
|
||||
0: '%{smart_count} berkas dipilih',
|
||||
1: '%{smart_count} berkas dipilih'
|
||||
},
|
||||
filesUploaded: {
|
||||
0: '%{smart_count} berkas terunggah',
|
||||
1: '%{smart_count} berkas terunggah'
|
||||
},
|
||||
files: {
|
||||
0: '%{smart_count} berkas',
|
||||
1: '%{smart_count} berkas'
|
||||
},
|
||||
uploadFiles: {
|
||||
0: 'Unggah %{smart_count} berkas',
|
||||
1: 'Unggah %{smart_count} berkas'
|
||||
},
|
||||
selectToUpload: 'Pilih berkas untuk mengunggah',
|
||||
closeModal: 'Tutup Modal',
|
||||
upload: 'Unggah',
|
||||
importFrom: 'Import berkas dari',
|
||||
dashboardWindowTitle: 'Uppy Beranda Window (Tekan escape untuk menutup)',
|
||||
dashboardTitle: 'Beranda Uppy',
|
||||
copyLinkToClipboardSuccess: 'Link tersalin.',
|
||||
copyLinkToClipboardFallback: 'Salin URL di bawah ini',
|
||||
done: 'Selesai',
|
||||
localDisk: 'Penyimpanan Lokal',
|
||||
dropPasteImport: 'Taruh berkas di sini, tempel, import dari salah satu lokasi di atas atau',
|
||||
dropPaste: 'Taruh berkas di sini, tempel atau',
|
||||
browse: 'cari',
|
||||
fileProgress: 'Proses berkas: kecepatan unggah dan ETA',
|
||||
numberOfSelectedFiles: 'Total berkas yang di pilih',
|
||||
uploadAllNewFiles: 'Unggah semua berkas baru'
|
||||
}
|
||||
|
||||
id_ID.pluralize = function (n) {
|
||||
if (n === 1) {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
|
||||
window.Uppy.locales.id_ID = id_ID
|
||||
}
|
||||
|
||||
module.exports = id_ID
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/* eslint camelcase: 0 */
|
||||
|
||||
const it_IT = {}
|
||||
|
||||
it_IT.strings = {
|
||||
chooseFile: 'Seleziona un file',
|
||||
youHaveChosen: 'Hai scelto: %{fileName}',
|
||||
orDragDrop: 'oppure trascinalo qui',
|
||||
filesChosen: {
|
||||
0: '%{smart_count} file selezionato',
|
||||
1: '%{smart_count} file selezionati'
|
||||
},
|
||||
filesUploaded: {
|
||||
0: '%{smart_count} file caricato',
|
||||
1: '%{smart_count} file caricati'
|
||||
},
|
||||
files: {
|
||||
0: '%{smart_count} file',
|
||||
1: '%{smart_count} file'
|
||||
},
|
||||
uploadFiles: {
|
||||
0: 'Carica %{smart_count} file',
|
||||
1: 'Carica %{smart_count} file'
|
||||
},
|
||||
selectToUpload: 'Seleziona i file da caricare',
|
||||
closeModal: 'Chiudi la finestra',
|
||||
upload: 'Carica',
|
||||
importFrom: 'Importa i file da',
|
||||
dashboardWindowTitle: 'Uppy Dashboard Window (Premi escape per chiuderla)',
|
||||
dashboardTitle: 'Uppy Dashboard',
|
||||
copyLinkToClipboardSuccess: 'Collegamento copiato negli appunti.',
|
||||
copyLinkToClipboardFallback: 'Copia il seguente indirizzo',
|
||||
done: 'Fatto',
|
||||
localDisk: 'Disco locale',
|
||||
dropPasteImport: 'Trascina i file qui, incolla, importa da uno dei servizi sopra oppure',
|
||||
dropPaste: 'Trascina i file qui, incolla oppure',
|
||||
browse: 'sfoglia',
|
||||
fileProgress: 'Avanzamento del file: velocità di caricamento e tempo rimanente',
|
||||
numberOfSelectedFiles: 'Numero di file selezionati',
|
||||
uploadAllNewFiles: 'Carica tutti i nuovi file'
|
||||
}
|
||||
|
||||
it_IT.pluralize = function (n) {
|
||||
if (n === 1) {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
|
||||
window.Uppy.locales.it_IT = it_IT
|
||||
}
|
||||
|
||||
module.exports = it_IT
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/* eslint camelcase: 0 */
|
||||
|
||||
const nb_NO = {}
|
||||
|
||||
nb_NO.strings = {
|
||||
chooseFile: 'Velg en fil',
|
||||
youHaveChosen: 'Du har valgt: %{fileName}',
|
||||
orDragDrop: 'eller slipp den her',
|
||||
filesChosen: {
|
||||
0: '%{smart_count} fil valgt',
|
||||
1: '%{smart_count} filer valgt'
|
||||
},
|
||||
filesUploaded: {
|
||||
0: '%{smart_count} fil lastet opp',
|
||||
1: '%{smart_count} filer lastet opp'
|
||||
},
|
||||
files: {
|
||||
0: '%{smart_count} fil',
|
||||
1: '%{smart_count} filer'
|
||||
},
|
||||
uploadFiles: {
|
||||
0: 'Lastet opp %{smart_count} fil',
|
||||
1: 'Lastet opp %{smart_count} filer'
|
||||
},
|
||||
selectToUpload: 'Velg filer å laste opp',
|
||||
closeModal: 'Lukk dialogboksen',
|
||||
upload: 'Last opp',
|
||||
importFrom: 'Importer filer fra',
|
||||
dashboardWindowTitle: 'Uppy Dashboard-vindu (Trykk escape for å lukke)',
|
||||
dashboardTitle: 'Uppy Dashboard',
|
||||
copyLinkToClipboardSuccess: 'Lenken ble kopiert til utklippstavla.',
|
||||
copyLinkToClipboardFallback: 'Kopier URL-en under',
|
||||
done: 'Ferdig',
|
||||
localDisk: 'Lokal disk',
|
||||
dropPasteImport: 'Du kan slippe eller lime inn filer her, importere fra en en av plasseringene ovenfor eller',
|
||||
dropPaste: 'Du kan slippe eller lime inn filer her eller',
|
||||
browse: 'velge dem',
|
||||
fileProgress: 'Filstatus: Opplastingshastighet og ETA',
|
||||
numberOfSelectedFiles: 'Antall valgte filer',
|
||||
uploadAllNewFiles: 'Last opp alle nye filer'
|
||||
}
|
||||
|
||||
nb_NO.pluralize = function (n) {
|
||||
if (n === 1) {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
|
||||
window.Uppy.locales.nb_NO = nb_NO
|
||||
}
|
||||
|
||||
module.exports = nb_NO
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
/* eslint camelcase: 0 */
|
||||
|
||||
const pl_PL = {}
|
||||
|
||||
pl_PL.strings = {
|
||||
chooseFile: 'Wybierz plik',
|
||||
youHaveChosen: 'Wybrałeś: %{fileName}',
|
||||
orDragDrop: 'lub przeciągnij tutaj',
|
||||
filesChosen: {
|
||||
0: '%{smart_count} wybrany plik',
|
||||
1: '%{smart_count} wybrane pliki',
|
||||
2: '%{smart_count} wybranych plików'
|
||||
},
|
||||
filesUploaded: {
|
||||
0: '%{smart_count} wysłany plik',
|
||||
1: '%{smart_count} wysłane pliki',
|
||||
2: '%{smart_count} wysłanych plików'
|
||||
},
|
||||
files: {
|
||||
0: '%{smart_count} plik',
|
||||
1: '%{smart_count} pliki',
|
||||
2: '%{smart_count} plików'
|
||||
},
|
||||
uploadFiles: {
|
||||
0: 'Wyślij %{smart_count} plik',
|
||||
1: 'Wyślij %{smart_count} pliki',
|
||||
2: 'Wyślij %{smart_count} plików'
|
||||
},
|
||||
selectToUpload: 'Wybierz pliki do wysłania',
|
||||
closeModal: 'Zamknij okno',
|
||||
upload: 'Wyślij',
|
||||
importFrom: 'Zaimportuj pliki z',
|
||||
dashboardWindowTitle: 'Okno Uppy Dashboard (Wciśnij esc, aby zamknąć)',
|
||||
dashboardTitle: 'Uppy Dashboard',
|
||||
copyLinkToClipboardSuccess: 'Link skopiowany do schowka.',
|
||||
copyLinkToClipboardFallback: 'Skopiuj poniższy link',
|
||||
done: 'Gotowe',
|
||||
localDisk: 'Dysk lokalny',
|
||||
dropPasteImport: 'Upuść, wklej lub zaimportuj pliki tutaj albo',
|
||||
dropPaste: 'Upuść lub wklej pliki tutaj albo',
|
||||
browse: 'przeglądaj',
|
||||
fileProgress: 'Postęp pliku: prędkość wysyłania i przewidywany pozostały czas',
|
||||
numberOfSelectedFiles: 'Ilość wybranych plików',
|
||||
uploadAllNewFiles: 'Wyślij wszystkie nowe pliki'
|
||||
}
|
||||
|
||||
pl_PL.pluralize = function (n) {
|
||||
if (n === 1) {
|
||||
return 0
|
||||
}
|
||||
if (n >= 2 && n <= 4) {
|
||||
return 1
|
||||
}
|
||||
return 2
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
|
||||
window.Uppy.locales.pl_PL = pl_PL
|
||||
}
|
||||
|
||||
module.exports = pl_PL
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
/* eslint camelcase: 0 */
|
||||
|
||||
const pt_BR = {}
|
||||
|
||||
pt_BR.strings = {
|
||||
chooseFile: 'Escolha um arquivo',
|
||||
youHaveChosen: 'Você escolheu: %{fileName}',
|
||||
orDragDrop: 'ou arraste-o aqui',
|
||||
filesChosen: {
|
||||
0: '%{smart_count} arquivo selecionado',
|
||||
1: '%{smart_count} arquivos selecionados'
|
||||
},
|
||||
filesUploaded: {
|
||||
0: '%{smart_count} arquivo enviado',
|
||||
1: '%{smart_count} arquivos enviados'
|
||||
},
|
||||
files: {
|
||||
0: '%{smart_count} arquivo',
|
||||
1: '%{smart_count} arquivos'
|
||||
},
|
||||
uploadFiles: {
|
||||
0: 'Enviar %{smart_count} arquivo',
|
||||
1: 'Enviar %{smart_count} arquivos'
|
||||
},
|
||||
selectToUpload: 'Selecione arquivos para enviar',
|
||||
closeModal: 'Fechar Modal',
|
||||
upload: 'Enviar',
|
||||
importFrom: 'Importar arquivos de',
|
||||
dashboardWindowTitle: 'Painel do Uppy (Aperte Esc para fechar)',
|
||||
dashboardTitle: 'Painel do Uppy',
|
||||
copyLinkToClipboardSuccess: 'Link copiado para área de transferência.',
|
||||
copyLinkToClipboardFallback: 'Copie a URL abaixo',
|
||||
done: 'Finalizado',
|
||||
localDisk: 'Disco Local',
|
||||
dropPasteImport: 'Arraste arquivos até aqui, cole-os ou importe de:',
|
||||
fileProgress: 'Progresso de Arquivo: velocidade de envio e estimativas',
|
||||
numberOfSelectedFiles: 'Números de arquivos selecionados',
|
||||
uploadAllNewFiles: 'Enviar todos os arquivos novos'
|
||||
}
|
||||
|
||||
pt_BR.pluralize = function (n) {
|
||||
if (n === 1) {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
|
||||
window.Uppy.locales.pt_BR = pt_BR
|
||||
}
|
||||
|
||||
module.exports = pt_BR
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
/* eslint camelcase: 0 */
|
||||
|
||||
const ru_RU = {}
|
||||
|
||||
ru_RU.strings = {
|
||||
chooseFile: 'Выберите файл',
|
||||
orDragDrop: 'или перенесите его сюда',
|
||||
youHaveChosen: 'Вы выбрали: %{file_name}',
|
||||
filesChosen: {
|
||||
0: 'Выбран %{smart_count} файл',
|
||||
1: 'Выбрано %{smart_count} файла',
|
||||
2: 'Выбрано %{smart_count} файлов'
|
||||
},
|
||||
upload: 'Загрузить',
|
||||
localDisk: 'Диск',
|
||||
dropPasteImport: 'Перенесите файлы сюда, вставьте из буфера обмена или импортируйте из сервисов выше'
|
||||
}
|
||||
|
||||
ru_RU.pluralize = function (n) {
|
||||
if (n % 10 === 1 && n % 100 !== 11) {
|
||||
return 0
|
||||
}
|
||||
|
||||
if (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20)) {
|
||||
return 1
|
||||
}
|
||||
|
||||
return 2
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
|
||||
window.Uppy.locales.ru_RU = ru_RU
|
||||
}
|
||||
|
||||
module.exports = ru_RU
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/* eslint camelcase: 0 */
|
||||
|
||||
const tr_TR = {}
|
||||
|
||||
tr_TR.strings = {
|
||||
chooseFile: 'Dosya Seçin',
|
||||
youHaveChosen: 'Seçmiş olduğun dosya: %{fileName}',
|
||||
orDragDrop: 'yada bırakın',
|
||||
filesChosen: {
|
||||
0: '%{smart_count} adet dosya seçili',
|
||||
1: '%{smart_count} adet dosyalar seçili'
|
||||
},
|
||||
filesUploaded: {
|
||||
0: '%{smart_count} adet dosya yüklendi',
|
||||
1: '%{smart_count} adet dosyalar yüklendi'
|
||||
},
|
||||
files: {
|
||||
0: '%{smart_count} dosya',
|
||||
1: '%{smart_count} dosyalar'
|
||||
},
|
||||
uploadFiles: {
|
||||
0: 'Yüklenen %{smart_count} dosya',
|
||||
1: 'Yüklenen %{smart_count} dosyalar'
|
||||
},
|
||||
selectToUpload: 'Yüklemek için dosyaları seçin',
|
||||
closeModal: 'Pencereyi Kapat',
|
||||
upload: 'Yükle',
|
||||
importFrom: 'Dosyaları içeri aktar',
|
||||
dashboardWindowTitle: 'Uppy Panel Pencerisi (kapatmak için esc kullanın)',
|
||||
dashboardTitle: 'Uppy Panel',
|
||||
copyLinkToClipboardSuccess: 'Bağlantı kopyalandı.',
|
||||
copyLinkToClipboardFallback: 'Bağlantıyı kopyala.',
|
||||
done: 'Bitti',
|
||||
localDisk: 'Lokal Dosyalar',
|
||||
dropPasteImport: 'Dosyaları buraya bırakın, yukarıdaki konumlardan birinden yapıştırın, içeri aktarın veya',
|
||||
dropPaste: 'Dosyaları buraya bırak, yapıştır veya',
|
||||
browse: 'Gözat',
|
||||
fileProgress: 'Dosya ilerlemesi: yükleme hızı ve süresi',
|
||||
numberOfSelectedFiles: 'Seçilen dosya sayısı',
|
||||
uploadAllNewFiles: 'Tüm yeni dosyaları yükle'
|
||||
}
|
||||
|
||||
tr_TR.pluralize = function (n) {
|
||||
if (n === 1) {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
|
||||
window.Uppy.locales.tr_TR = tr_TR
|
||||
}
|
||||
|
||||
module.exports = tr_TR
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
/* eslint camelcase: 0 */
|
||||
|
||||
const zh_CN = {}
|
||||
|
||||
zh_CN.strings = {
|
||||
chooseFile: '选择文件',
|
||||
youHaveChosen: '你已经选择了: %{fileName}',
|
||||
orDragDrop: '或者拖到这里来',
|
||||
filesChosen: {
|
||||
0: '已选 %{smart_count} 个文件'
|
||||
},
|
||||
filesUploaded: {
|
||||
0: '已上传 %{smart_count} 个文件'
|
||||
},
|
||||
files: {
|
||||
0: '%{smart_count} 个文件'
|
||||
},
|
||||
uploadFiles: {
|
||||
0: '上传 %{smart_count} 个文件'
|
||||
},
|
||||
selectToUpload: '选择文件以上传',
|
||||
closeModal: '关闭对话框',
|
||||
upload: '上传'
|
||||
}
|
||||
|
||||
zh_CN.pluralize = function (n) {
|
||||
return 0
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
|
||||
window.Uppy.locales.zh_CN = zh_CN
|
||||
}
|
||||
|
||||
module.exports = zh_CN
|
||||
6679
package-lock.json
generated
6679
package-lock.json
generated
File diff suppressed because it is too large
Load diff
24
package.json
24
package.json
|
|
@ -49,13 +49,13 @@
|
|||
"isomorphic-fetch": "2.2.1",
|
||||
"jest": "^23.6.0",
|
||||
"json3": "^3.3.2",
|
||||
"lerna": "^3.4.3",
|
||||
"lerna": "^3.13.0",
|
||||
"lint-staged": "^6.1.1",
|
||||
"minify-stream": "^1.2.0",
|
||||
"mkdirp": "0.5.1",
|
||||
"multi-glob": "^1.0.2",
|
||||
"nock": "^9.6.1",
|
||||
"node-sass": "^4.10.0",
|
||||
"node-sass": "^4.11.0",
|
||||
"npm-auth-to-token": "^1.0.0",
|
||||
"npm-run-all": "^4.1.3",
|
||||
"onchange": "^4.1.0",
|
||||
|
|
@ -71,7 +71,8 @@
|
|||
"tinyify": "^2.4.3",
|
||||
"tsify": "^4.0.1",
|
||||
"typescript": "^2.9.2",
|
||||
"verdaccio": "^3.8.5",
|
||||
"touch": "^3.1.0",
|
||||
"verdaccio": "^3.11.4",
|
||||
"watchify": "^3.11.0",
|
||||
"wdio-mocha-framework": "^0.6.4",
|
||||
"wdio-sauce-service": "^0.4.12",
|
||||
|
|
@ -87,7 +88,7 @@
|
|||
"build:js": "npm-run-all build:lib build:bundle",
|
||||
"build:lib": "node ./bin/build-lib.js",
|
||||
"build": "npm-run-all --parallel build:js build:css build:companion --serial build:gzip size",
|
||||
"clean": "rm -rf packages/*/lib packages/@uppy/*/lib && rm -rf packages/uppy/dist",
|
||||
"clean": "rm -rf packages/*/lib packages/@uppy/*/lib packages/*/dist packages/@uppy/*/dist",
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"lint": "eslint . --cache",
|
||||
"lint-staged": "lint-staged",
|
||||
|
|
@ -109,16 +110,15 @@
|
|||
"travis:deletecache": "travis cache --delete",
|
||||
"watch:css": "onchange 'packages/**/*.scss' --initial --verbose -- npm run build:css",
|
||||
"watch:js": "onchange 'packages/{@uppy/,}*/src/**/*.js' --initial --verbose -- npm run build:bundle",
|
||||
"watch:js:lib": "onchange 'packages/{@uppy/,}*/src/**/*.js' --initial --verbose -- npm run build:lib",
|
||||
"watch": "npm-run-all --parallel watch:js watch:css",
|
||||
"watch:fast": "npm-run-all --parallel watch:css web:preview",
|
||||
"watch:example:browsersync": "browser-sync start --server examples/bundled-example --port 3452 --serveStatic packages/uppy/dist --files \"examples/bundled-example/bundle.js, packages/uppy/dist/uppy.min.css\"",
|
||||
"watch:example:js": "cd examples/bundled-example && npm run watch",
|
||||
"watch:example": "npm-run-all --parallel watch:example:js watch:css watch:example:browsersync",
|
||||
"dev": "npm-run-all --parallel watch:example:js watch:css watch:example:browsersync",
|
||||
"web:build": "cd website && node update.js && ./node_modules/.bin/hexo generate --silent && node build-examples.js",
|
||||
"dev:browsersync": "browser-sync start --no-open --no-ghost-mode false --server examples/dev --port 3452 --serveStatic packages/uppy/dist --files \"examples/dev/bundle.js, packages/uppy/dist/uppy.min.css, packages/uppy/lib/**/*\"",
|
||||
"dev:js": "cd examples/dev && npm run watch",
|
||||
"dev": "npm-run-all --parallel start:companion dev:js watch:css watch:js:lib dev:browsersync",
|
||||
"dev:no-companion": "npm-run-all --parallel dev:js watch:css watch:js:lib dev:browsersync",
|
||||
"web:build": "cd website && node update.js && touch db.json && ./node_modules/.bin/hexo generate && node build-examples.js",
|
||||
"web:clean": "cd website && ./node_modules/.bin/hexo clean",
|
||||
"web:deploy": "npm-run-all web:install web:disc web:build && ./bin/web-deploy",
|
||||
"web:generated-docs": "cd website && node node_modules/documentation/bin/documentation.js readme ../src/index.js --readme-file=src/docs/api.md --section 'Uppy Core & Plugins' -q --github -c doc-order.json",
|
||||
"web:deploy": "npm-run-all web:disc web:build && ./bin/web-deploy",
|
||||
"web:disc": "node ./bin/disc.js",
|
||||
"web:install": "cd website && npm install",
|
||||
"web:bundle:update:watch": "onchange 'packages/uppy/dist/**/*.css' 'packages/uppy/dist/**/*.js' --initial --verbose -- node website/update.js",
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ uppy.use(AwsS3Multipart, {
|
|||
$ npm install @uppy/aws-s3-multipart --save
|
||||
```
|
||||
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
|
||||
Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@uppy/aws-s3-multipart",
|
||||
"description": "Upload to Amazon S3 with Uppy and S3's Multipart upload strategy",
|
||||
"version": "0.29.1",
|
||||
"version": "0.30.3",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"types": "types/index.d.ts",
|
||||
|
|
@ -23,14 +23,14 @@
|
|||
"url": "git+https://github.com/transloadit/uppy.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uppy/companion-client": "0.27.3",
|
||||
"@uppy/utils": "0.29.1",
|
||||
"@uppy/companion-client": "0.28.3",
|
||||
"@uppy/utils": "0.30.3",
|
||||
"resolve-url": "^0.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@uppy/core": "0.29.1"
|
||||
"@uppy/core": "0.30.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "^0.29.0"
|
||||
"@uppy/core": "^0.30.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
const { Plugin } = require('@uppy/core')
|
||||
const { Socket, RequestClient } = require('@uppy/companion-client')
|
||||
const { Socket, Provider, RequestClient } = require('@uppy/companion-client')
|
||||
const emitSocketProgress = require('@uppy/utils/lib/emitSocketProgress')
|
||||
const getSocketHost = require('@uppy/utils/lib/getSocketHost')
|
||||
const limitPromises = require('@uppy/utils/lib/limitPromises')
|
||||
|
|
@ -249,28 +249,19 @@ module.exports = class AwsS3Multipart extends Plugin {
|
|||
|
||||
this.uppy.emit('upload-started', file)
|
||||
|
||||
fetch(file.remote.url, {
|
||||
method: 'post',
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(Object.assign({}, file.remote.body, {
|
||||
const Client = file.remote.providerOptions.provider ? Provider : RequestClient
|
||||
const client = new Client(this.uppy, file.remote.providerOptions)
|
||||
client.post(
|
||||
file.remote.url,
|
||||
Object.assign({}, file.remote.body, {
|
||||
protocol: 's3-multipart',
|
||||
size: file.data.size,
|
||||
metadata: file.meta
|
||||
}))
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.status < 200 || res.status > 300) {
|
||||
return reject(res.statusText)
|
||||
}
|
||||
|
||||
return res.json().then((data) => {
|
||||
this.uppy.setFileState(file.id, { serverToken: data.token })
|
||||
return this.uppy.getFile(file.id)
|
||||
})
|
||||
).then((res) => {
|
||||
this.uppy.setFileState(file.id, { serverToken: res.token })
|
||||
file = this.uppy.getFile(file.id)
|
||||
return file
|
||||
})
|
||||
.then((file) => {
|
||||
return this.connectToServerSocket(file)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ uppy.use(AwsS3, {
|
|||
$ npm install @uppy/aws-s3 --save
|
||||
```
|
||||
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
|
||||
Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@uppy/aws-s3",
|
||||
"description": "Upload to Amazon S3 with Uppy",
|
||||
"version": "0.29.1",
|
||||
"version": "0.30.3",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"types": "types/index.d.ts",
|
||||
|
|
@ -22,15 +22,15 @@
|
|||
"url": "git+https://github.com/transloadit/uppy.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uppy/companion-client": "0.27.3",
|
||||
"@uppy/utils": "0.29.1",
|
||||
"@uppy/xhr-upload": "0.29.1",
|
||||
"@uppy/companion-client": "0.28.3",
|
||||
"@uppy/utils": "0.30.3",
|
||||
"@uppy/xhr-upload": "0.30.3",
|
||||
"resolve-url": "^0.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@uppy/core": "0.29.1"
|
||||
"@uppy/core": "0.30.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "^0.29.0"
|
||||
"@uppy/core": "^0.30.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ module.exports = class AwsS3 extends Plugin {
|
|||
const updatedFiles = {}
|
||||
fileIDs.forEach((id, index) => {
|
||||
const file = this.uppy.getFile(id)
|
||||
if (file.error) {
|
||||
if (!file || file.error) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@uppy/companion-client",
|
||||
"description": "Client library for communication with Companion. Intended for use in Uppy plugins.",
|
||||
"version": "0.27.3",
|
||||
"version": "0.28.3",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"types": "types/index.d.ts",
|
||||
|
|
|
|||
|
|
@ -13,17 +13,22 @@ module.exports = class Provider extends RequestClient {
|
|||
this.id = this.provider
|
||||
this.authProvider = opts.authProvider || this.provider
|
||||
this.name = this.opts.name || _getName(this.id)
|
||||
this.tokenKey = `companion-${this.id}-auth-token`
|
||||
this.pluginId = this.opts.pluginId
|
||||
this.tokenKey = `companion-${this.pluginId}-auth-token`
|
||||
}
|
||||
|
||||
get defaultHeaders () {
|
||||
return Object.assign({}, super.defaultHeaders, {'uppy-auth-token': localStorage.getItem(this.tokenKey)})
|
||||
return Object.assign({}, super.defaultHeaders, {'uppy-auth-token': this.getAuthToken()})
|
||||
}
|
||||
|
||||
// @todo(i.olarewaju) consider whether or not this method should be exposed
|
||||
setAuthToken (token) {
|
||||
// @todo(i.olarewaju) add fallback for OOM storage
|
||||
localStorage.setItem(this.tokenKey, token)
|
||||
this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey, token)
|
||||
}
|
||||
|
||||
getAuthToken () {
|
||||
return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)
|
||||
}
|
||||
|
||||
checkAuth () {
|
||||
|
|
@ -48,7 +53,7 @@ module.exports = class Provider extends RequestClient {
|
|||
logout (redirect = location.href) {
|
||||
return this.get(`${this.id}/logout?redirect=${redirect}`)
|
||||
.then((res) => {
|
||||
localStorage.removeItem(this.tokenKey)
|
||||
this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)
|
||||
return res
|
||||
})
|
||||
}
|
||||
|
|
@ -59,6 +64,7 @@ module.exports = class Provider extends RequestClient {
|
|||
if (defaultOpts) {
|
||||
plugin.opts = Object.assign({}, defaultOpts, opts)
|
||||
}
|
||||
|
||||
if (opts.serverPattern) {
|
||||
const pattern = opts.serverPattern
|
||||
// validate serverPattern param
|
||||
|
|
@ -74,5 +80,7 @@ module.exports = class Provider extends RequestClient {
|
|||
plugin.opts.serverPattern = opts.serverUrl
|
||||
}
|
||||
}
|
||||
|
||||
plugin.storage = plugin.opts.storage || localStorage
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ Please ensure that the required env variables are set before runnning/using comp
|
|||
$ companion
|
||||
```
|
||||
|
||||
If you cloned the repo from gtihub and want to run it as a standalone server, you may also run the following command from within its
|
||||
If you cloned the repo from GitHub and want to run it as a standalone server, you may also run the following command from within its
|
||||
directory
|
||||
|
||||
```bash
|
||||
|
|
@ -95,5 +95,36 @@ When you are all set install the dependencies and deploy your function:
|
|||
npm install && sls deploy
|
||||
```
|
||||
|
||||
### Deploy to heroku
|
||||
|
||||
Companion can also be deployed to [Heroku](https://www.heroku.com)
|
||||
```
|
||||
mkdir uppy-companion && cd uppy-companion
|
||||
|
||||
git init
|
||||
|
||||
echo 'export COMPANION_PORT=$PORT' > .profile
|
||||
echo 'node_modules' > .gitignore
|
||||
echo '{
|
||||
"name": "uppy-companion",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"start": "companion"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uppy/companion": "^0.17.0"
|
||||
}
|
||||
}' > package.json
|
||||
|
||||
npm i
|
||||
|
||||
git add . && git commit -am 'first commit'
|
||||
|
||||
heroku create
|
||||
|
||||
git push heroku master
|
||||
```
|
||||
Make sure you set the required [environment variables](https://uppy.io/docs/companion/#Configure-Standalone).
|
||||
|
||||
|
||||
See [full documentation](https://uppy.io/docs/companion/)
|
||||
|
|
|
|||
|
|
@ -48,12 +48,7 @@ spec:
|
|||
containers:
|
||||
- image: docker.io/transloadit/companion:latest
|
||||
imagePullPolicy: Always
|
||||
name: companion
|
||||
resources:
|
||||
limits:
|
||||
memory: 2Gi
|
||||
requests:
|
||||
memory: 2Gi
|
||||
name: companion
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: uppy-companion-env
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ __companion="$(dirname "$(dirname "${__kube}")")"
|
|||
# Install kubectl
|
||||
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.11.2/bin/linux/amd64/kubectl
|
||||
chmod +x ./kubectl
|
||||
mkdir ${HOME}/.local/bin/
|
||||
mkdir -p ${HOME}/.local/bin/
|
||||
export PATH="${HOME}/.local/bin/:$PATH"
|
||||
mv ./kubectl ${HOME}/.local/bin/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@uppy/companion",
|
||||
"version": "0.16.1",
|
||||
"version": "0.17.3",
|
||||
"description": "OAuth helper and remote fetcher for Uppy's (https://uppy.io) extensible file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Dropbox and Google Drive, S3 and more :dog:",
|
||||
"main": "lib/uppy.js",
|
||||
"types": "types/index.d.ts",
|
||||
|
|
|
|||
|
|
@ -67,6 +67,13 @@ class Uploader {
|
|||
* @returns {boolean}
|
||||
*/
|
||||
validateOptions (options) {
|
||||
// s3 uploads don't require upload destination
|
||||
// validation, because the destination is determined
|
||||
// by the server's s3 config
|
||||
if (options.protocol === 's3-multipart') {
|
||||
return true
|
||||
}
|
||||
|
||||
if (!options.endpoint && !options.uploadUrl) {
|
||||
this._errRespMessage = 'No destination specified'
|
||||
return false
|
||||
|
|
@ -89,6 +96,10 @@ class Uploader {
|
|||
})
|
||||
}
|
||||
|
||||
hasError () {
|
||||
return this._errRespMessage != null
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a substring of the token
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
/**
|
||||
* oAuth callback. Encrypts the access token and sends the new token with the response,
|
||||
* and redirects to redirect url.
|
||||
*/
|
||||
const tokenService = require('../helpers/jwt')
|
||||
const parseUrl = require('url').parse
|
||||
const { hasMatch } = require('../helpers/utils')
|
||||
const oAuthState = require('../helpers/oauth-state')
|
||||
const logger = require('../logger')
|
||||
|
||||
/**
|
||||
|
|
@ -25,29 +21,5 @@ module.exports = function callback (req, res, next) {
|
|||
req.uppy.providerTokens[providerName] = req.query.access_token
|
||||
logger.debug(`Generating auth token for provider ${providerName}.`)
|
||||
const uppyAuthToken = tokenService.generateToken(req.uppy.providerTokens, req.uppy.options.secret)
|
||||
// add the token to cookies for thumbnail/image requests
|
||||
tokenService.addToCookies(res, uppyAuthToken, req.uppy.options)
|
||||
|
||||
const state = (req.session.grant || {}).state
|
||||
if (state) {
|
||||
const origin = oAuthState.getFromState(state, 'origin', req.uppy.options.secret)
|
||||
const allowedClients = req.uppy.options.clients
|
||||
// if no preset clients then allow any client
|
||||
if (!allowedClients || hasMatch(origin, allowedClients) || hasMatch(parseUrl(origin).host, allowedClients)) {
|
||||
return res.send(`
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<script>
|
||||
window.opener.postMessage({token: "${uppyAuthToken}"}, "${origin}")
|
||||
window.close()
|
||||
</script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>`
|
||||
)
|
||||
}
|
||||
}
|
||||
next()
|
||||
return res.redirect(req.uppy.buildURL(`/${providerName}/send-token?uppyAuthToken=${uppyAuthToken}`, true))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,12 @@ function get (req, res) {
|
|||
headers: body.headers
|
||||
})
|
||||
|
||||
if (uploader.hasError()) {
|
||||
const response = uploader.getResponse()
|
||||
res.status(response.status).json(response.body)
|
||||
return
|
||||
}
|
||||
|
||||
// wait till the client has connected to the socket, before starting
|
||||
// the download, so that the client can receive all download/upload progress.
|
||||
logger.debug('Waiting for socket connection before beginning remote download.')
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
module.exports = {
|
||||
authorized: require('./authorized'),
|
||||
callback: require('./callback'),
|
||||
sendToken: require('./send-token'),
|
||||
get: require('./get'),
|
||||
thumbnail: require('./thumbnail'),
|
||||
list: require('./list'),
|
||||
|
|
|
|||
|
|
@ -9,13 +9,9 @@ function logout (req, res) {
|
|||
const session = req.session
|
||||
const providerName = req.params.providerName
|
||||
|
||||
if (req.uppy.providerTokens[providerName]) {
|
||||
if (req.uppy.providerTokens && req.uppy.providerTokens[providerName]) {
|
||||
delete req.uppy.providerTokens[providerName]
|
||||
tokenService.addToCookies(
|
||||
res,
|
||||
tokenService.generateToken(req.uppy.providerTokens, req.uppy.options.secret),
|
||||
req.uppy.options
|
||||
)
|
||||
tokenService.removeFromCookies(res, req.uppy.options, req.uppy.provider.authProviderName)
|
||||
}
|
||||
|
||||
if (session.grant) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
*
|
||||
* sends auth token to uppy client
|
||||
*/
|
||||
const tokenService = require('../helpers/jwt')
|
||||
const parseUrl = require('url').parse
|
||||
const { hasMatch, sanitizeHtml } = require('../helpers/utils')
|
||||
const oAuthState = require('../helpers/oauth-state')
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {object} req
|
||||
* @param {object} res
|
||||
* @param {function} next
|
||||
*/
|
||||
module.exports = function sendToken (req, res, next) {
|
||||
const uppyAuthToken = req.uppy.authToken
|
||||
// add the token to cookies for thumbnail/image requests
|
||||
tokenService.addToCookies(res, uppyAuthToken, req.uppy.options, req.uppy.provider.authProvider)
|
||||
|
||||
const state = (req.session.grant || {}).state
|
||||
if (state) {
|
||||
const origin = oAuthState.getFromState(state, 'origin', req.uppy.options.secret)
|
||||
const allowedClients = req.uppy.options.clients
|
||||
// if no preset clients then allow any client
|
||||
if (!allowedClients || hasMatch(origin, allowedClients) || hasMatch(parseUrl(origin).host, allowedClients)) {
|
||||
return res.send(htmlContent(uppyAuthToken, origin))
|
||||
}
|
||||
}
|
||||
next()
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} token uppy auth token
|
||||
* @param {string} origin url string
|
||||
*/
|
||||
const htmlContent = (token, origin) => {
|
||||
return `
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<script>
|
||||
window.opener.postMessage({token: "${token}"}, "${sanitizeHtml(origin)}")
|
||||
window.close()
|
||||
</script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>`
|
||||
}
|
||||
|
|
@ -61,6 +61,12 @@ const get = (req, res) => {
|
|||
headers: req.body.headers
|
||||
})
|
||||
|
||||
if (uploader.hasError()) {
|
||||
const response = uploader.getResponse()
|
||||
res.status(response.status).json(response.body)
|
||||
return
|
||||
}
|
||||
|
||||
logger.debug('Waiting for socket connection before beginning remote download.')
|
||||
uploader.onSocketReady(() => {
|
||||
logger.debug('Socket connection received. Starting remote download.')
|
||||
|
|
|
|||
|
|
@ -29,8 +29,9 @@ module.exports.verifyToken = (token, secret) => {
|
|||
* @param {object} res
|
||||
* @param {string} token
|
||||
* @param {object=} uppyOptions
|
||||
* @param {string} providerName
|
||||
*/
|
||||
module.exports.addToCookies = (res, token, uppyOptions) => {
|
||||
module.exports.addToCookies = (res, token, uppyOptions, providerName) => {
|
||||
const cookieOptions = {
|
||||
maxAge: 1000 * 60 * 60 * 24 * 30, // would expire after 30 days
|
||||
httpOnly: true
|
||||
|
|
@ -40,5 +41,24 @@ module.exports.addToCookies = (res, token, uppyOptions) => {
|
|||
cookieOptions.domain = uppyOptions.cookieDomain
|
||||
}
|
||||
// send signed token to client.
|
||||
res.cookie('uppyAuthToken', token, cookieOptions)
|
||||
res.cookie(`uppyAuthToken--${providerName}`, token, cookieOptions)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {object} res
|
||||
* @param {object=} uppyOptions
|
||||
* @param {string} providerName
|
||||
*/
|
||||
module.exports.removeFromCookies = (res, uppyOptions, providerName) => {
|
||||
const cookieOptions = {
|
||||
maxAge: 1000 * 60 * 60 * 24 * 30, // would expire after 30 days
|
||||
httpOnly: true
|
||||
}
|
||||
|
||||
if (uppyOptions.cookieDomain) {
|
||||
cookieOptions.domain = uppyOptions.cookieDomain
|
||||
}
|
||||
|
||||
res.clearCookie(`uppyAuthToken--${providerName}`, cookieOptions)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,15 @@ exports.jsonStringify = (data) => {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Does a simple html sanitization on the passed value
|
||||
*
|
||||
* @param {string} text
|
||||
*/
|
||||
exports.sanitizeHtml = (text) => {
|
||||
return text ? text.replace(/<\/?[^>]+(>|$)/g, '') : text
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the size and content type of a url's content
|
||||
*
|
||||
|
|
|
|||
|
|
@ -38,6 +38,6 @@ exports.gentleVerifyToken = (req, res, next) => {
|
|||
}
|
||||
|
||||
exports.cookieAuthToken = (req, res, next) => {
|
||||
req.uppy.authToken = req.cookies.uppyAuthToken
|
||||
req.uppy.authToken = req.cookies[`uppyAuthToken--${req.uppy.provider.authProvider}`]
|
||||
return next()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ exports.buildHelpfulStartupMessage = (uppyOptions) => {
|
|||
providerName = 'drive'
|
||||
}
|
||||
|
||||
callbackURLs.push(buildURL(`/${providerName}/callback`, true))
|
||||
callbackURLs.push(buildURL(`/connect/${providerName}/callback`, true))
|
||||
})
|
||||
|
||||
return stripIndent`
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ module.exports.app = (options = {}) => {
|
|||
app.get('/:providerName/redirect', middlewares.hasSessionAndProvider, controllers.redirect)
|
||||
app.get('/:providerName/logout', middlewares.hasSessionAndProvider, middlewares.gentleVerifyToken, controllers.logout)
|
||||
app.get('/:providerName/authorized', middlewares.hasSessionAndProvider, middlewares.gentleVerifyToken, controllers.authorized)
|
||||
app.get('/:providerName/send-token', middlewares.hasSessionAndProvider, middlewares.verifyToken, controllers.sendToken)
|
||||
app.get('/:providerName/list/:id?', middlewares.hasSessionAndProvider, middlewares.verifyToken, controllers.list)
|
||||
app.post('/:providerName/get/:id', middlewares.hasSessionAndProvider, middlewares.verifyToken, controllers.get)
|
||||
app.get('/:providerName/thumbnail/:id', middlewares.hasSessionAndProvider, middlewares.cookieAuthToken, middlewares.verifyToken, controllers.thumbnail)
|
||||
|
|
@ -217,7 +218,7 @@ const getOptionsMiddleware = (options) => {
|
|||
req.uppy = {
|
||||
options,
|
||||
s3Client,
|
||||
authToken: req.header('uppy-auth-token'),
|
||||
authToken: req.header('uppy-auth-token') || req.query.uppyAuthToken,
|
||||
buildURL: getURLBuilder(options)
|
||||
}
|
||||
next()
|
||||
|
|
|
|||
|
|
@ -66,26 +66,35 @@ describe('download provdier file', () => {
|
|||
})
|
||||
|
||||
describe('test authentication', () => {
|
||||
test('authentication callback redirects to specified url', () => {
|
||||
test('authentication callback redirects to send-token url', () => {
|
||||
return request(authServer)
|
||||
.get('/drive/callback')
|
||||
.set('uppy-auth-token', token)
|
||||
.expect(302)
|
||||
.expect((res) => {
|
||||
expect(res.header['location']).toContain('http://localhost:3020/drive/send-token?uppyAuthToken=')
|
||||
})
|
||||
})
|
||||
|
||||
test('the token gets sent via cookie and html', () => {
|
||||
return request(authServer)
|
||||
.get(`/drive/send-token?uppyAuthToken=${token}`)
|
||||
.expect(200)
|
||||
.expect((res) => {
|
||||
const authToken = res.header['set-cookie'][0].split(';')[0].split('uppyAuthToken=')[1]
|
||||
const authToken = res.header['set-cookie'][0].split(';')[0].split('uppyAuthToken--google=')[1]
|
||||
expect(authToken).toEqual(token)
|
||||
// see mock ../../src/server/helpers/oauth-state above for http://localhost:3020
|
||||
const body = `
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<script>
|
||||
window.opener.postMessage({token: "${authToken}"}, "http://localhost:3020")
|
||||
window.close()
|
||||
</script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>`
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<script>
|
||||
window.opener.postMessage({token: "${token}"}, "http://localhost:3020")
|
||||
window.close()
|
||||
</script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>`
|
||||
expect(res.text).toBe(body)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ const session = require('express-session')
|
|||
var authServer = express()
|
||||
|
||||
authServer.use(session({ secret: 'grant', resave: true, saveUninitialized: true }))
|
||||
authServer.all('/drive/callback', (req, res, next) => {
|
||||
authServer.all('/drive/send-token', (req, res, next) => {
|
||||
req.session.grant = {
|
||||
state: 'non-empty-value' }
|
||||
next()
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ uppy.use(SomePlugin)
|
|||
$ npm install @uppy/core --save
|
||||
```
|
||||
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
|
||||
Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@uppy/core",
|
||||
"description": "Core module for the extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:",
|
||||
"version": "0.29.1",
|
||||
"version": "0.30.3",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"style": "dist/style.min.css",
|
||||
|
|
@ -20,8 +20,8 @@
|
|||
"url": "git+https://github.com/transloadit/uppy.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uppy/store-default": "0.27.1",
|
||||
"@uppy/utils": "0.29.1",
|
||||
"@uppy/store-default": "0.28.3",
|
||||
"@uppy/utils": "0.30.3",
|
||||
"cuid": "^2.1.1",
|
||||
"lodash.throttle": "^4.1.1",
|
||||
"mime-match": "^1.0.2",
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: left;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.uppy-Root *, .uppy-Root *:before, .uppy-Root *:after {
|
||||
|
|
@ -19,8 +21,15 @@
|
|||
// }
|
||||
|
||||
.uppy-Root *:focus {
|
||||
outline: $size-focus-outline solid $color-cornflower-blue;
|
||||
outline-offset: $size-focus-offset;
|
||||
outline: $size-focus-outline solid $color-cornflower-blue; /* no !important */
|
||||
outline-offset: $size-focus-offset; /* no !important */
|
||||
|
||||
// outline: none;
|
||||
// box-shadow: inset 0 0 0 2px rgba($color-cornflower-blue, 0.5);
|
||||
}
|
||||
|
||||
.uppy-Root [hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4
|
||||
|
|
@ -41,72 +50,46 @@
|
|||
// Utilities
|
||||
|
||||
.uppy-u-reset {
|
||||
// @include reset-button;
|
||||
animation: none 0s ease 0s 1 normal none running;
|
||||
-webkit-appearance: none;
|
||||
line-height: 1;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
color: inherit;
|
||||
backface-visibility: visible;
|
||||
background: transparent none repeat 0 0 / auto auto padding-box border-box scroll;
|
||||
background: none;
|
||||
border: medium none currentColor;
|
||||
border-collapse: separate;
|
||||
border-image: none;
|
||||
border-radius: 0;
|
||||
border-spacing: 0;
|
||||
bottom: auto;
|
||||
box-shadow: none;
|
||||
// box-sizing: content-box;
|
||||
caption-side: top;
|
||||
clear: none;
|
||||
clip: auto;
|
||||
color: #000;
|
||||
columns: auto;
|
||||
column-count: auto;
|
||||
column-fill: balance;
|
||||
column-gap: normal;
|
||||
column-rule: medium none currentColor;
|
||||
column-span: 1;
|
||||
column-width: auto;
|
||||
content: normal;
|
||||
counter-increment: none;
|
||||
counter-reset: none;
|
||||
cursor: auto;
|
||||
// direction: ltr;
|
||||
display: inline;
|
||||
empty-cells: show;
|
||||
float: none;
|
||||
font-family: serif;
|
||||
font-size: medium;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
font-weight: normal;
|
||||
font-stretch: normal;
|
||||
line-height: normal;
|
||||
height: auto;
|
||||
hyphens: none;
|
||||
left: auto;
|
||||
letter-spacing: normal;
|
||||
list-style: disc outside none;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
max-height: none;
|
||||
max-width: none;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
opacity: 1;
|
||||
orphans: 2;
|
||||
outline: medium none invert;
|
||||
overflow: visible;
|
||||
overflow-x: visible;
|
||||
overflow-y: visible;
|
||||
padding: 0;
|
||||
page-break-after: auto;
|
||||
page-break-before: auto;
|
||||
page-break-inside: auto;
|
||||
perspective: none;
|
||||
perspective-origin: 50% 50%;
|
||||
position: static;
|
||||
right: auto;
|
||||
tab-size: 8;
|
||||
table-layout: auto;
|
||||
text-align: left;
|
||||
text-align-last: auto;
|
||||
text-decoration: none;
|
||||
text-indent: 0;
|
||||
text-shadow: none;
|
||||
|
|
@ -120,11 +103,7 @@
|
|||
vertical-align: baseline;
|
||||
visibility: visible;
|
||||
white-space: normal;
|
||||
widows: 2;
|
||||
width: auto;
|
||||
word-spacing: normal;
|
||||
z-index: auto;
|
||||
// all: initial;
|
||||
}
|
||||
|
||||
// Inputs
|
||||
|
|
@ -135,6 +114,7 @@
|
|||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
padding: 6px 8px;
|
||||
background-color: $color-white;
|
||||
}
|
||||
|
||||
.uppy-size--md .uppy-c-textInput {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class Uppy {
|
|||
1: 'You have to select at least %{smart_count} files'
|
||||
},
|
||||
exceedsSize: 'This file exceeds maximum allowed size of',
|
||||
youCanOnlyUploadFileTypes: 'You can only upload:',
|
||||
youCanOnlyUploadFileTypes: 'You can only upload: %{types}',
|
||||
companionError: 'Connection with Companion failed',
|
||||
failedToUpload: 'Failed to upload %{file}',
|
||||
noInternetConnection: 'No Internet connection',
|
||||
|
|
@ -46,7 +46,9 @@ class Uppy {
|
|||
1: 'Select %{smart_count} files'
|
||||
},
|
||||
cancel: 'Cancel',
|
||||
logOut: 'Log out'
|
||||
logOut: 'Log out',
|
||||
filter: 'Filter',
|
||||
resetFilter: 'Reset filter'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -341,7 +343,7 @@ class Uppy {
|
|||
}
|
||||
|
||||
if (allowedFileTypes) {
|
||||
const isCorrectFileType = allowedFileTypes.filter((type) => {
|
||||
const isCorrectFileType = allowedFileTypes.some((type) => {
|
||||
// if (!file.type) return false
|
||||
|
||||
// is this is a mime-type
|
||||
|
|
@ -352,15 +354,14 @@ class Uppy {
|
|||
|
||||
// otherwise this is likely an extension
|
||||
if (type[0] === '.') {
|
||||
if (file.extension === type.substr(1)) {
|
||||
return file.extension
|
||||
}
|
||||
return file.extension.toLowerCase() === type.substr(1).toLowerCase()
|
||||
}
|
||||
}).length > 0
|
||||
return false
|
||||
})
|
||||
|
||||
if (!isCorrectFileType) {
|
||||
const allowedFileTypesString = allowedFileTypes.join(', ')
|
||||
throw new Error(`${this.i18n('youCanOnlyUploadFileTypes')} ${allowedFileTypesString}`)
|
||||
throw new Error(this.i18n('youCanOnlyUploadFileTypes', { types: allowedFileTypesString }))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -648,6 +649,7 @@ class Uppy {
|
|||
})
|
||||
|
||||
if (inProgress.length === 0) {
|
||||
this.emit('progress', 0)
|
||||
this.setState({ totalProgress: 0 })
|
||||
return
|
||||
}
|
||||
|
|
@ -684,6 +686,7 @@ class Uppy {
|
|||
: Math.round(uploadedSize / totalSize * 100)
|
||||
|
||||
this.setState({ totalProgress })
|
||||
this.emit('progress', totalProgress)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1197,6 +1200,10 @@ class Uppy {
|
|||
// always refers to the latest state. In the handler right above it refers
|
||||
// to an outdated object without the `.result` property.
|
||||
const { currentUploads } = this.getState()
|
||||
if (!currentUploads[uploadID]) {
|
||||
this.log(`Not setting result for an upload that has been canceled: ${uploadID}`)
|
||||
return
|
||||
}
|
||||
const currentUpload = currentUploads[uploadID]
|
||||
const result = currentUpload.result
|
||||
this.emit('complete', result)
|
||||
|
|
|
|||
|
|
@ -1179,6 +1179,13 @@ describe('src/Core', () => {
|
|||
expect(err).toMatchObject(new Error('You can only upload: .gif, .jpg, .jpeg'))
|
||||
expect(core.getState().info.message).toEqual('You can only upload: .gif, .jpg, .jpeg')
|
||||
}
|
||||
|
||||
expect(() => core.addFile({
|
||||
source: 'jest',
|
||||
name: 'foo2.JPG',
|
||||
type: '',
|
||||
data: new File([sampleImage], { type: 'image/jpeg' })
|
||||
}).not.toThrow())
|
||||
})
|
||||
|
||||
it('should enforce the maxFileSize rule', () => {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ uppy.use(Dashboard, {
|
|||
$ npm install @uppy/dashboard --save
|
||||
```
|
||||
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
|
||||
Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@uppy/dashboard",
|
||||
"description": "Universal UI plugin for Uppy.",
|
||||
"version": "0.29.1",
|
||||
"version": "0.30.3",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"style": "dist/style.min.css",
|
||||
|
|
@ -22,11 +22,11 @@
|
|||
"url": "git+https://github.com/transloadit/uppy.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uppy/informer": "0.29.1",
|
||||
"@uppy/provider-views": "0.29.1",
|
||||
"@uppy/status-bar": "0.29.1",
|
||||
"@uppy/thumbnail-generator": "0.29.1",
|
||||
"@uppy/utils": "0.29.1",
|
||||
"@uppy/informer": "0.30.3",
|
||||
"@uppy/provider-views": "0.30.3",
|
||||
"@uppy/status-bar": "0.30.3",
|
||||
"@uppy/thumbnail-generator": "0.30.3",
|
||||
"@uppy/utils": "0.30.3",
|
||||
"classnames": "^2.2.6",
|
||||
"cuid": "^2.1.1",
|
||||
"drag-drop": "2.13.3",
|
||||
|
|
@ -37,10 +37,10 @@
|
|||
"resize-observer-polyfill": "^1.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@uppy/core": "0.29.1",
|
||||
"@uppy/google-drive": "0.29.1"
|
||||
"@uppy/core": "0.30.3",
|
||||
"@uppy/google-drive": "0.30.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "^0.29.0"
|
||||
"@uppy/core": "^0.30.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ const poweredByUppy = (props) => {
|
|||
<path d="M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z" fill-rule="evenodd" />
|
||||
</svg><span class="uppy-Dashboard-poweredByUppy">Uppy</span></a>
|
||||
}
|
||||
|
||||
class AddFiles extends Component {
|
||||
constructor (props) {
|
||||
super(props)
|
||||
|
|
@ -19,12 +18,11 @@ class AddFiles extends Component {
|
|||
}
|
||||
|
||||
render () {
|
||||
// const isHidden = Object.keys(this.props.files).length === 0
|
||||
const hasAcquirers = this.props.acquirers.length !== 0
|
||||
|
||||
if (!hasAcquirers) {
|
||||
return (
|
||||
<div class="uppy-DashboarAddFiles">
|
||||
<div class="uppy-DashboardAddFiles">
|
||||
<div class="uppy-DashboardTabs">
|
||||
<ActionBrowseTagline
|
||||
acquirers={this.props.acquirers}
|
||||
|
|
@ -35,7 +33,7 @@ class AddFiles extends Component {
|
|||
maxNumberOfFiles={this.props.maxNumberOfFiles}
|
||||
/>
|
||||
</div>
|
||||
<div class="uppy-DashboarAddFiles-info">
|
||||
<div class="uppy-DashboardAddFiles-info">
|
||||
{ this.props.note && <div class="uppy-Dashboard-note">{this.props.note}</div> }
|
||||
{ this.props.proudlyDisplayPoweredByUppy && poweredByUppy(this.props) }
|
||||
</div>
|
||||
|
|
@ -47,7 +45,7 @@ class AddFiles extends Component {
|
|||
// because Uppy will be handling the upload and so we can select same file
|
||||
// after removing — otherwise browser thinks it’s already selected
|
||||
return (
|
||||
<div class="uppy-DashboarAddFiles">
|
||||
<div class="uppy-DashboardAddFiles">
|
||||
<div class="uppy-DashboardTabs">
|
||||
<ActionBrowseTagline
|
||||
acquirers={this.props.acquirers}
|
||||
|
|
@ -86,7 +84,7 @@ class AddFiles extends Component {
|
|||
role="tab"
|
||||
tabindex={0}
|
||||
aria-controls={`uppy-DashboardContent-panel--${target.id}`}
|
||||
aria-selected={this.props.activePanel.id === target.id}
|
||||
aria-selected={this.props.activePickerPanel.id === target.id}
|
||||
onclick={() => this.props.showPanel(target.id)}>
|
||||
{target.icon()}
|
||||
<div class="uppy-DashboardTab-name">{target.name}</div>
|
||||
|
|
@ -95,7 +93,7 @@ class AddFiles extends Component {
|
|||
})}
|
||||
</div>
|
||||
</div>
|
||||
<div class="uppy-DashboarAddFiles-info">
|
||||
<div class="uppy-DashboardAddFiles-info">
|
||||
{ this.props.note && <div class="uppy-Dashboard-note">{this.props.note}</div> }
|
||||
{ this.props.proudlyDisplayPoweredByUppy && poweredByUppy(this.props) }
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ const AddFiles = require('./AddFiles')
|
|||
const AddFilesPanel = (props) => {
|
||||
return (
|
||||
<div class="uppy-Dashboard-AddFilesPanel"
|
||||
data-uppy-panelType="AddFiles"
|
||||
aria-hidden={props.showAddFilesPanel}>
|
||||
<div class="uppy-DashboardContent-bar">
|
||||
<div class="uppy-DashboardContent-title" role="heading" aria-level="h1">
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
const FileList = require('./FileList')
|
||||
const AddFiles = require('./AddFiles')
|
||||
const AddFilesPanel = require('./AddFilesPanel')
|
||||
const PanelContent = require('./PanelContent')
|
||||
const PanelTopBar = require('./PanelTopBar')
|
||||
const PickerPanelContent = require('./PickerPanelContent')
|
||||
const PanelTopBar = require('./PickerPanelTopBar')
|
||||
const FileCard = require('./FileCard')
|
||||
const classNames = require('classnames')
|
||||
const isTouchDevice = require('@uppy/utils/lib/isTouchDevice')
|
||||
|
|
@ -12,11 +12,18 @@ const PreactCSSTransitionGroup = require('preact-css-transition-group')
|
|||
// http://dev.edenspiekermann.com/2016/02/11/introducing-accessible-modal-dialog
|
||||
// https://github.com/ghosh/micromodal
|
||||
|
||||
module.exports = function Dashboard (props) {
|
||||
// if (!props.inline && props.modal.isHidden) {
|
||||
// return <span />
|
||||
// }
|
||||
function TransitionWrapper (props) {
|
||||
return (
|
||||
<PreactCSSTransitionGroup
|
||||
transitionName="uppy-transition-slideDownUp"
|
||||
transitionEnterTimeout={250}
|
||||
transitionLeaveTimeout={250}>
|
||||
{props.children}
|
||||
</PreactCSSTransitionGroup>
|
||||
)
|
||||
}
|
||||
|
||||
module.exports = function Dashboard (props) {
|
||||
const noFiles = props.totalFileCount === 0
|
||||
|
||||
const dashboardClassName = classNames(
|
||||
|
|
@ -33,7 +40,7 @@ module.exports = function Dashboard (props) {
|
|||
|
||||
return (
|
||||
<div class={dashboardClassName}
|
||||
aria-hidden={props.inline ? 'false' : props.modal.isHidden}
|
||||
aria-hidden={props.inline ? 'false' : props.isHidden}
|
||||
aria-label={!props.inline ? props.i18n('dashboardWindowTitle') : props.i18n('dashboardTitle')}
|
||||
onpaste={props.handlePaste}>
|
||||
|
||||
|
|
@ -46,13 +53,17 @@ module.exports = function Dashboard (props) {
|
|||
width: props.inline && props.width ? props.width : '',
|
||||
height: props.inline && props.height ? props.height : ''
|
||||
}}>
|
||||
<button class="uppy-Dashboard-close"
|
||||
type="button"
|
||||
aria-label={props.i18n('closeModal')}
|
||||
title={props.i18n('closeModal')}
|
||||
onclick={props.closeModal}>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
||||
{!props.inline
|
||||
? <button class="uppy-u-reset uppy-Dashboard-close"
|
||||
type="button"
|
||||
aria-label={props.i18n('closeModal')}
|
||||
title={props.i18n('closeModal')}
|
||||
onclick={props.closeModal}>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
: null
|
||||
}
|
||||
|
||||
<div class="uppy-Dashboard-innerWrap">
|
||||
{ (!noFiles && props.showSelectedFiles) && <PanelTopBar {...props} /> }
|
||||
|
|
@ -63,26 +74,17 @@ module.exports = function Dashboard (props) {
|
|||
<AddFiles {...props} />
|
||||
)}
|
||||
|
||||
<PreactCSSTransitionGroup
|
||||
transitionName="uppy-transition-slideDownUp"
|
||||
transitionEnterTimeout={250}
|
||||
transitionLeaveTimeout={250}>
|
||||
<TransitionWrapper>
|
||||
{ props.showAddFilesPanel ? <AddFilesPanel key="AddFilesPanel" {...props} /> : null }
|
||||
</PreactCSSTransitionGroup>
|
||||
</TransitionWrapper>
|
||||
|
||||
<PreactCSSTransitionGroup
|
||||
transitionName="uppy-transition-slideDownUp"
|
||||
transitionEnterTimeout={250}
|
||||
transitionLeaveTimeout={250}>
|
||||
<TransitionWrapper>
|
||||
{ props.fileCardFor ? <FileCard key="FileCard" {...props} /> : null }
|
||||
</PreactCSSTransitionGroup>
|
||||
</TransitionWrapper>
|
||||
|
||||
<PreactCSSTransitionGroup
|
||||
transitionName="uppy-transition-slideDownUp"
|
||||
transitionEnterTimeout={250}
|
||||
transitionLeaveTimeout={250}>
|
||||
{ props.activePanel ? <PanelContent key="PanelContent" {...props} /> : null }
|
||||
</PreactCSSTransitionGroup>
|
||||
<TransitionWrapper>
|
||||
{ props.activePickerPanel ? <PickerPanelContent key="PickerPanelContent" {...props} /> : null }
|
||||
</TransitionWrapper>
|
||||
|
||||
<div class="uppy-Dashboard-progressindicators">
|
||||
{props.progressindicators.map((target) => {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class FileCard extends Component {
|
|||
return metaFields.map((field, i) => {
|
||||
return <fieldset class="uppy-DashboardFileCard-fieldset">
|
||||
<label class="uppy-DashboardFileCard-label">{field.name}</label>
|
||||
<input class="uppy-c-textInput uppy-DashboardFileCard-input"
|
||||
<input class="uppy-u-reset uppy-c-textInput uppy-DashboardFileCard-input"
|
||||
type="text"
|
||||
data-name={field.id}
|
||||
value={file.meta[field.id]}
|
||||
|
|
@ -71,6 +71,7 @@ class FileCard extends Component {
|
|||
|
||||
return (
|
||||
<div class="uppy-DashboardFileCard"
|
||||
data-uppy-panelType="FileCard"
|
||||
onDragOver={ignoreEvent}
|
||||
onDragLeave={ignoreEvent}
|
||||
onDrop={ignoreEvent}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ const prettyBytes = require('prettier-bytes')
|
|||
const FileItemProgress = require('./FileItemProgress')
|
||||
const getFileTypeIcon = require('../utils/getFileTypeIcon')
|
||||
const FilePreview = require('./FilePreview')
|
||||
const { iconCopy, iconRetry } = require('./icons')
|
||||
const { iconRetry } = require('./icons')
|
||||
const classNames = require('classnames')
|
||||
const { h } = require('preact')
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ module.exports = function fileItem (props) {
|
|||
</div>
|
||||
}
|
||||
{(!uploadInProgressOrComplete && props.metaFields && props.metaFields.length)
|
||||
? <button class="uppy-DashboardItem-edit"
|
||||
? <button class="uppy-u-reset uppy-DashboardItem-edit"
|
||||
type="button"
|
||||
aria-label={props.i18n('editFile')}
|
||||
title={props.i18n('editFile')}
|
||||
|
|
@ -157,7 +157,7 @@ module.exports = function fileItem (props) {
|
|||
: null
|
||||
}
|
||||
{props.showLinkToFileUploadResult && file.uploadURL
|
||||
? <button class="uppy-DashboardItem-copyLink"
|
||||
? <button class="uppy-u-reset uppy-DashboardItem-copyLink"
|
||||
type="button"
|
||||
aria-label={props.i18n('copyLink')}
|
||||
title={props.i18n('copyLink')}
|
||||
|
|
@ -168,7 +168,7 @@ module.exports = function fileItem (props) {
|
|||
props.info(props.i18n('copyLinkToClipboardSuccess'), 'info', 3000)
|
||||
})
|
||||
.catch(props.log)
|
||||
}}>{iconCopy()}</button>
|
||||
}}>{props.i18n('link')}</button>
|
||||
: ''
|
||||
}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -17,5 +17,3 @@ module.exports = function FilePreview (props) {
|
|||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// <span class="uppy-DashboardItem-previewType">{file.extension && file.extension.length < 5 ? file.extension : null}</span>
|
||||
|
|
|
|||
|
|
@ -5,21 +5,22 @@ function PanelContent (props) {
|
|||
return (
|
||||
<div class="uppy-DashboardContent-panel"
|
||||
role="tabpanel"
|
||||
id={props.activePanel && `uppy-DashboardContent-panel--${props.activePanel.id}`}
|
||||
data-uppy-panelType="PickerPanel"
|
||||
id={props.activePickerPanel && `uppy-DashboardContent-panel--${props.activePickerPanel.id}`}
|
||||
onDragOver={ignoreEvent}
|
||||
onDragLeave={ignoreEvent}
|
||||
onDrop={ignoreEvent}
|
||||
onPaste={ignoreEvent}>
|
||||
<div class="uppy-DashboardContent-bar">
|
||||
<div class="uppy-DashboardContent-title" role="heading" aria-level="h1">
|
||||
{props.i18n('importFrom', { name: props.activePanel.name })}
|
||||
{props.i18n('importFrom', { name: props.activePickerPanel.name })}
|
||||
</div>
|
||||
<button class="uppy-DashboardContent-back"
|
||||
type="button"
|
||||
onclick={props.hideAllPanels}>{props.i18n('done')}</button>
|
||||
</div>
|
||||
<div class="uppy-DashboardContent-panelBody">
|
||||
{props.getPlugin(props.activePanel.id).render(props.state)}
|
||||
{props.getPlugin(props.activePickerPanel.id).render(props.state)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
@ -2,7 +2,7 @@ const { h } = require('preact')
|
|||
|
||||
// https://css-tricks.com/creating-svg-icon-system-react/
|
||||
|
||||
function defaultTabIcon () {
|
||||
function defaultPickerIcon () {
|
||||
return <svg aria-hidden="true" width="30" height="30" viewBox="0 0 30 30">
|
||||
<path d="M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z" />
|
||||
</svg>
|
||||
|
|
@ -83,7 +83,7 @@ function iconText () {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
defaultTabIcon,
|
||||
defaultPickerIcon,
|
||||
iconCopy,
|
||||
iconResume,
|
||||
iconPause,
|
||||
|
|
|
|||
|
|
@ -8,9 +8,8 @@ const ThumbnailGenerator = require('@uppy/thumbnail-generator')
|
|||
const findAllDOMElements = require('@uppy/utils/lib/findAllDOMElements')
|
||||
const toArray = require('@uppy/utils/lib/toArray')
|
||||
const cuid = require('cuid')
|
||||
// const prettyBytes = require('prettier-bytes')
|
||||
const ResizeObserver = require('resize-observer-polyfill').default || require('resize-observer-polyfill')
|
||||
const { defaultTabIcon } = require('./components/icons')
|
||||
const { defaultPickerIcon } = require('./components/icons')
|
||||
|
||||
// Some code for managing focus was adopted from https://github.com/ghosh/micromodal
|
||||
// MIT licence, https://github.com/ghosh/micromodal/blob/master/LICENSE.md
|
||||
|
|
@ -32,6 +31,15 @@ const FOCUSABLE_ELEMENTS = [
|
|||
const TAB_KEY = 9
|
||||
const ESC_KEY = 27
|
||||
|
||||
function createPromise () {
|
||||
const o = {}
|
||||
o.promise = new Promise((resolve, reject) => {
|
||||
o.resolve = resolve
|
||||
o.reject = reject
|
||||
})
|
||||
return o
|
||||
}
|
||||
|
||||
/**
|
||||
* Dashboard UI with previews, metadata editing, tabs for various services and more
|
||||
*/
|
||||
|
|
@ -56,6 +64,7 @@ module.exports = class Dashboard extends Plugin {
|
|||
copyLinkToClipboardSuccess: 'Link copied to clipboard',
|
||||
copyLinkToClipboardFallback: 'Copy the URL below',
|
||||
copyLink: 'Copy link',
|
||||
link: 'Link',
|
||||
fileSource: 'File source: %{name}',
|
||||
done: 'Done',
|
||||
back: 'Back',
|
||||
|
|
@ -118,7 +127,7 @@ module.exports = class Dashboard extends Plugin {
|
|||
width: 750,
|
||||
height: 550,
|
||||
thumbnailWidth: 280,
|
||||
defaultTabIcon: defaultTabIcon,
|
||||
defaultPickerIcon,
|
||||
showLinkToFileUploadResult: true,
|
||||
showProgressDetails: false,
|
||||
hideUploadButton: false,
|
||||
|
|
@ -136,7 +145,6 @@ module.exports = class Dashboard extends Plugin {
|
|||
proudlyDisplayPoweredByUppy: true,
|
||||
onRequestCloseModal: () => this.closeModal(),
|
||||
showSelectedFiles: true,
|
||||
// locale: defaultLocale,
|
||||
browserBackButtonClose: false
|
||||
}
|
||||
|
||||
|
|
@ -218,20 +226,22 @@ module.exports = class Dashboard extends Plugin {
|
|||
|
||||
hideAllPanels () {
|
||||
this.setPluginState({
|
||||
activePanel: false,
|
||||
showAddFilesPanel: false
|
||||
activePickerPanel: false,
|
||||
showAddFilesPanel: false,
|
||||
activeOverlayType: null
|
||||
})
|
||||
}
|
||||
|
||||
showPanel (id) {
|
||||
const { targets } = this.getPluginState()
|
||||
|
||||
const activePanel = targets.filter((target) => {
|
||||
const activePickerPanel = targets.filter((target) => {
|
||||
return target.type === 'acquirer' && target.id === id
|
||||
})[0]
|
||||
|
||||
this.setPluginState({
|
||||
activePanel: activePanel
|
||||
activePickerPanel: activePickerPanel,
|
||||
activeOverlayType: 'PickerPanel'
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -244,6 +254,14 @@ module.exports = class Dashboard extends Plugin {
|
|||
}
|
||||
|
||||
getFocusableNodes () {
|
||||
// if an overlay is open, we should trap focus inside the overlay
|
||||
const activeOverlayType = this.getPluginState().activeOverlayType
|
||||
if (activeOverlayType) {
|
||||
const activeOverlay = this.el.querySelector(`[data-uppy-panelType="${activeOverlayType}"]`)
|
||||
const nodes = activeOverlay.querySelectorAll(FOCUSABLE_ELEMENTS)
|
||||
return Object.keys(nodes).map((key) => nodes[key])
|
||||
}
|
||||
|
||||
const nodes = this.el.querySelectorAll(FOCUSABLE_ELEMENTS)
|
||||
return Object.keys(nodes).map((key) => nodes[key])
|
||||
}
|
||||
|
|
@ -302,6 +320,7 @@ module.exports = class Dashboard extends Plugin {
|
|||
}
|
||||
|
||||
openModal () {
|
||||
const { promise, resolve } = createPromise()
|
||||
// save scroll position
|
||||
this.savedScrollPosition = window.scrollY
|
||||
// save active element, so we can restore focus when modal is closed
|
||||
|
|
@ -317,12 +336,14 @@ module.exports = class Dashboard extends Plugin {
|
|||
isHidden: false
|
||||
})
|
||||
this.el.removeEventListener('animationend', handler, false)
|
||||
resolve()
|
||||
}
|
||||
this.el.addEventListener('animationend', handler, false)
|
||||
} else {
|
||||
this.setPluginState({
|
||||
isHidden: false
|
||||
})
|
||||
resolve()
|
||||
}
|
||||
|
||||
if (this.opts.browserBackButtonClose) {
|
||||
|
|
@ -334,6 +355,8 @@ module.exports = class Dashboard extends Plugin {
|
|||
|
||||
// this.rerender(this.uppy.getState())
|
||||
this.setFocusToBrowse()
|
||||
|
||||
return promise
|
||||
}
|
||||
|
||||
closeModal (opts = {}) {
|
||||
|
|
@ -347,6 +370,8 @@ module.exports = class Dashboard extends Plugin {
|
|||
return
|
||||
}
|
||||
|
||||
const { promise, resolve } = createPromise()
|
||||
|
||||
if (this.opts.disablePageScrollWhenModalOpen) {
|
||||
document.body.classList.remove('uppy-Dashboard-isFixed')
|
||||
}
|
||||
|
|
@ -361,12 +386,14 @@ module.exports = class Dashboard extends Plugin {
|
|||
isClosing: false
|
||||
})
|
||||
this.el.removeEventListener('animationend', handler, false)
|
||||
resolve()
|
||||
}
|
||||
this.el.addEventListener('animationend', handler, false)
|
||||
} else {
|
||||
this.setPluginState({
|
||||
isHidden: true
|
||||
})
|
||||
resolve()
|
||||
}
|
||||
|
||||
// handle ESC and TAB keys in modal dialog
|
||||
|
|
@ -383,6 +410,8 @@ module.exports = class Dashboard extends Plugin {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return promise
|
||||
}
|
||||
|
||||
isModalOpen () {
|
||||
|
|
@ -509,13 +538,15 @@ module.exports = class Dashboard extends Plugin {
|
|||
|
||||
toggleFileCard (fileId) {
|
||||
this.setPluginState({
|
||||
fileCardFor: fileId || false
|
||||
fileCardFor: fileId || null,
|
||||
activeOverlayType: fileId ? 'FileCard' : null
|
||||
})
|
||||
}
|
||||
|
||||
toggleAddFilesPanel (show) {
|
||||
this.setPluginState({
|
||||
showAddFilesPanel: show
|
||||
showAddFilesPanel: show,
|
||||
activeOverlayType: show ? 'AddFiles' : null
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -586,29 +617,11 @@ module.exports = class Dashboard extends Plugin {
|
|||
|
||||
const isAllPaused = inProgressFiles.length !== 0 &&
|
||||
pausedFiles.length === inProgressFiles.length
|
||||
// const isAllPaused = inProgressNotPausedFiles.length === 0 &&
|
||||
// !isAllComplete &&
|
||||
// !isAllErrored &&
|
||||
// uploadStartedFiles.length > 0
|
||||
|
||||
// let inProgressNotPausedFilesArray = []
|
||||
// inProgressNotPausedFiles.forEach((file) => {
|
||||
// inProgressNotPausedFilesArray.push(files[file])
|
||||
// })
|
||||
|
||||
// let totalSize = 0
|
||||
// let totalUploadedSize = 0
|
||||
// inProgressNotPausedFilesArray.forEach((file) => {
|
||||
// totalSize = totalSize + (file.progress.bytesTotal || 0)
|
||||
// totalUploadedSize = totalUploadedSize + (file.progress.bytesUploaded || 0)
|
||||
// })
|
||||
// totalSize = prettyBytes(totalSize)
|
||||
// totalUploadedSize = prettyBytes(totalUploadedSize)
|
||||
|
||||
const attachRenderFunctionToTarget = (target) => {
|
||||
const plugin = this.uppy.getPlugin(target.id)
|
||||
return Object.assign({}, target, {
|
||||
icon: plugin.icon || this.opts.defaultTabIcon,
|
||||
icon: plugin.icon || this.opts.defaultPickerIcon,
|
||||
render: plugin.render
|
||||
})
|
||||
}
|
||||
|
|
@ -648,7 +661,7 @@ module.exports = class Dashboard extends Plugin {
|
|||
|
||||
return DashboardUI({
|
||||
state,
|
||||
modal: pluginState,
|
||||
isHidden: pluginState.isHidden,
|
||||
files,
|
||||
newFiles,
|
||||
uploadStartedFiles,
|
||||
|
|
@ -665,7 +678,7 @@ module.exports = class Dashboard extends Plugin {
|
|||
totalProgress: state.totalProgress,
|
||||
allowNewUpload,
|
||||
acquirers,
|
||||
activePanel: pluginState.activePanel,
|
||||
activePickerPanel: pluginState.activePickerPanel,
|
||||
animateOpenClose: this.opts.animateOpenClose,
|
||||
isClosing: pluginState.isClosing,
|
||||
getPlugin: this.uppy.getPlugin,
|
||||
|
|
@ -707,6 +720,7 @@ module.exports = class Dashboard extends Plugin {
|
|||
isWide: pluginState.containerWidth > 400,
|
||||
containerWidth: pluginState.containerWidth,
|
||||
isTargetDOMEl: this.isTargetDOMEl,
|
||||
parentElement: this.el,
|
||||
allowedFileTypes: this.uppy.opts.restrictions.allowedFileTypes,
|
||||
maxNumberOfFiles: this.uppy.opts.restrictions.maxNumberOfFiles,
|
||||
showSelectedFiles: this.opts.showSelectedFiles
|
||||
|
|
@ -725,9 +739,10 @@ module.exports = class Dashboard extends Plugin {
|
|||
// Set default state for Dashboard
|
||||
this.setPluginState({
|
||||
isHidden: true,
|
||||
showFileCard: false,
|
||||
fileCardFor: null,
|
||||
activeOverlayType: null,
|
||||
showAddFilesPanel: false,
|
||||
activePanel: false,
|
||||
activePickerPanel: false,
|
||||
metaFields: this.opts.metaFields,
|
||||
targets: []
|
||||
})
|
||||
|
|
|
|||
|
|
@ -115,20 +115,25 @@
|
|||
background-color: $color-almost-white;
|
||||
max-width: 100%; /* no !important */
|
||||
max-height: 100%; /* no !important */
|
||||
min-width: 290px;
|
||||
min-height: 400px;
|
||||
// min-width: 290px;
|
||||
// min-height: 450px is required for everything to fit on mobile
|
||||
min-height: 450px;
|
||||
outline: none;
|
||||
border: 1px solid rgba($color-gray, 0.2);
|
||||
border-radius: 5px;
|
||||
|
||||
.uppy-Dashboard--modal & {
|
||||
z-index: $zIndex-3;
|
||||
.uppy-size--md & {
|
||||
min-height: auto;
|
||||
}
|
||||
|
||||
@media #{$screen-medium} {
|
||||
width: 750px; /* no !important */
|
||||
height: 550px; /* no !important */
|
||||
}
|
||||
|
||||
.uppy-Dashboard--modal & {
|
||||
z-index: $zIndex-3;
|
||||
}
|
||||
}
|
||||
|
||||
.uppy-Dashboard-innerWrap {
|
||||
|
|
@ -157,28 +162,23 @@
|
|||
}
|
||||
|
||||
.uppy-Dashboard-close {
|
||||
@include reset-button;
|
||||
display: none;
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: -33px;
|
||||
right: -2px;
|
||||
cursor: pointer;
|
||||
color: rgba($color-white, 0.9);
|
||||
font-size: 27px;
|
||||
z-index: $zIndex-5;
|
||||
|
||||
@media #{$screen-medium} {
|
||||
font-size: 35px;
|
||||
top: -10px;
|
||||
right: -35px;
|
||||
}
|
||||
|
||||
.uppy-Dashboard--modal & {
|
||||
z-index: $zIndex-5;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.uppy-DashboarAddFiles {
|
||||
.uppy-DashboardAddFiles {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
|
@ -215,8 +215,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
.uppy-DashboarAddFiles-info {
|
||||
padding-top: 30px;
|
||||
.uppy-DashboardAddFiles-info {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
|
||||
.uppy-size--md & {
|
||||
|
|
@ -224,6 +224,7 @@
|
|||
bottom: 30px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding-top: 30px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -316,15 +317,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
.uppy-DashboardTab-btn svg,
|
||||
.uppy-DashboardTab-btn svg * {
|
||||
.uppy-DashboardTab-btn svg {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
display: inline-block;
|
||||
vertical-align: text-top;
|
||||
overflow: hidden;
|
||||
transition: transform 0.2s;
|
||||
will-change: transform;
|
||||
transition: transform ease-in-out 0.2s;
|
||||
}
|
||||
|
||||
.uppy-DashboardTab-btn:hover svg {
|
||||
|
|
@ -573,20 +572,21 @@
|
|||
|
||||
.uppy-Dashboard-note {
|
||||
font-size: 13px;
|
||||
line-height: 1.2;
|
||||
line-height: 1.25;
|
||||
text-align: center;
|
||||
color: rgba($color-asphalt-gray, 0.8);
|
||||
// position: absolute;
|
||||
// bottom: 45px;
|
||||
// left: 0;
|
||||
width: 100%;
|
||||
max-width: 350px;
|
||||
margin: auto;
|
||||
padding: 0 15px;
|
||||
|
||||
.uppy-size--md & {
|
||||
font-size: 16px;
|
||||
line-height: 1.35;
|
||||
max-width: 600px;
|
||||
}
|
||||
}
|
||||
|
||||
.uppy-Dashboard-poweredBy {
|
||||
a.uppy-Dashboard-poweredBy {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
|
|
@ -595,10 +595,6 @@
|
|||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.uppy-Dashboard-poweredByUppy {
|
||||
color: $color-gray;
|
||||
}
|
||||
|
||||
.uppy-Dashboard-poweredByIcon {
|
||||
stroke: $color-gray;
|
||||
fill: none;
|
||||
|
|
@ -607,6 +603,7 @@
|
|||
position: relative;
|
||||
top: 1px;
|
||||
opacity: 0.9;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
.uppy-DashboardItem {
|
||||
|
|
@ -807,15 +804,13 @@
|
|||
|
||||
.uppy-DashboardItem-edit,
|
||||
.uppy-DashboardItem-copyLink {
|
||||
@include reset-button;
|
||||
display: inline-block;
|
||||
vertical-align: bottom;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.uppy-DashboardItem-copyLink {
|
||||
width: 12px;
|
||||
height: 11px;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: 1;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.uppy-DashboardItem-edit:not(:first-child),
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ uppy.use(DragDrop, {
|
|||
$ npm install @uppy/drag-drop --save
|
||||
```
|
||||
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
|
||||
Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@uppy/drag-drop",
|
||||
"description": "Droppable zone UI for Uppy. Drag and drop files into it to upload.",
|
||||
"version": "0.29.1",
|
||||
"version": "0.30.3",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"style": "dist/style.min.css",
|
||||
|
|
@ -25,14 +25,14 @@
|
|||
"url": "git+https://github.com/transloadit/uppy.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uppy/utils": "0.29.1",
|
||||
"@uppy/utils": "0.30.3",
|
||||
"drag-drop": "2.13.3",
|
||||
"preact": "^8.2.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@uppy/core": "0.29.1"
|
||||
"@uppy/core": "0.30.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "^0.29.0"
|
||||
"@uppy/core": "^0.30.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ uppy.use(Dropbox, {
|
|||
$ npm install @uppy/dropbox --save
|
||||
```
|
||||
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
We recommend installing from npm and then using a module bundler such as [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
|
||||
|
||||
Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue