diff --git a/CHANGELOG.md b/CHANGELOG.md index 32a1641ef..2a4d6cf33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,8 @@ Sort of like jQuery UI: https://jqueryui.com/download/ - [ ] 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 +- [ ] dashboard: display data like image resolution on file cards #783 +- [ ] server: pass metadata to S3 `getKey` option, see https://github.com/transloadit/uppy/issues/689 ## 1.0 Goals @@ -73,14 +75,15 @@ What we need to do to release Uppy 1.0 - [ ] QA: test how everything works together: user experience from `npm install` to production build with Webpack, using in React/Redux environment (npm pack) - [ ] QA: test in multiple browsers and mobile devices again -- [ ] QA: test uppy server. benchmarks / stress test. multiple connections, different setups, large files (10 GB) +- [x] QA: test uppy server. benchmarks / stress test. multiple connections, different setups, large files (10 GB) - [ ] QA: tests for some plugins - [x] docs: on using plugins, all options, list of plugins, i18n - [ ] feature: preset for Transloadit that mimics jQuery SDK, check https://github.com/transloadit/jquery-sdk docs -- [ ] refactoring: possibly add CSS-in-JS +- [ ] refactoring: possibly add CSS-in-JS, style encapsulation - [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 - [ ] refactoring: split uppy into small packages, lerna repo? - [x] QA: tests for core and utils +- [ ] feature: basic Reacte Native support - [x] feature: Redux and ReduxDevTools support (currently mirrors Uppy state to Redux) - [x] feature: beta file recovering after closed tab / browser crash - [x] feature: easy integration with React (UppyReact components) @@ -92,13 +95,17 @@ What we need to do to release Uppy 1.0 - [x] uppy-server: security audit - [x] uppy-server: storing tokens in user’s browser only (d040281cc9a63060e2f2685c16de0091aee5c7b4) +# 0.26.0 + +- [ ] dashboard: allow minimizing the Dashboard during upload (Uppy then becomes just a tiny progress indicator) (@arturi) + # next ## 0.25.0 -- [ ] dashboard: allow minimizing the Dashboard during upload (Uppy then becomes just a tiny progress indicator) (@arturi) +To Be Released: 2018-05-31. + - [ ] dashboard: cancel button for transloadit assemblies (@arturi, @goto-bus-stop) -- [ ] dashboard: option for Boolean metadata #454 (@arturi) - [ ] core: figure out per-plugin locales and i18n strings packs #491 - [ ] goldenretriever: confirmation before restore #443 - [ ] goldenretriever: add “ghost” files (@arturi) @@ -112,20 +119,46 @@ What we need to do to release Uppy 1.0 - [ ] uppy-server: benchmarks / stress test, large file, uppy-server / tus / S3 (10 GB) - [ ] uppy-server: document docker image setup for uppy-server (@ifedapoolarewaju) - [ ] xhrupload: emit a final `upload-progress` event in the XHRUpload plugin just before firing `upload-complete` (tus-js-client already handles this internally) (@arturi) -- [ ] core: add more mime-to-extension mappings from https://github.com/micnic/mime.json/blob/master/index.json (which ones?) (@arturi, @goto-bus-stop) +- [ ] core: add more mime-to-extension mappings from https://github.com/micnic/mime.json/blob/master/index.json (which ones?) # (@arturi, @goto-bus-stop) - [ ] providers: select files only after “select” is pressed, don’t add them right away when they are checked (keep a list of fileIds in state?); better UI + solves issue with autoProceed uploading in background, which is weird; re-read https://github.com/transloadit/uppy/pull/419#issuecomment-345210519 (@arturi, @goto-bus-stop) - [ ] tus: add `filename` and `filetype`, so that tus servers knows what headers to set https://github.com/tus/tus-js-client/commit/ebc5189eac35956c9f975ead26de90c896dbe360 - [ ] core: look into utilizing https://github.com/que-etc/resize-observer-polyfill for responsive components. See also https://github.com/transloadit/uppy/issues/750 -- [x] statusbar: add some spacing between text elements (#760 / @goto-bus-stop) - [ ] core: use Browserslist config to share between PostCSS, Autoprefixer and Babel https://github.com/browserslist/browserslist, https://github.com/amilajack/eslint-plugin-compat (@arturi) - [ ] core: utilize https://github.com/jonathantneal/postcss-preset-env, maybe https://github.com/jonathantneal/postcss-normalize (@arturi) -- [ ] docs: improve on React docs https://uppy.io/docs/react/, add small example for each component maybe? Dashboard, DragDrop, ProgressBar? No need to make separate pages for all of them, just headings on the same page. Right now docs are confusing, because they focus on DashboardModal. Also problems with syntax highlight on https://uppy.io/docs/react/dashboard-modal/. +- [ ] docs: improve on React docs https://uppy.io/docs/react/, add small example for each component maybe? Dashboard, DragDrop, ProgressBar? No need to make separate pages for all of them, just headings on the same page. Right now docs are confusing, because they focus on DashboardModal. Also problems with syntax highlight on https://uppy.io/docs/react/dashboard-modal/ (@goto-bus-stop) - [ ] docs: add note in docs or solve the .run() issue, see #756 -- [x] core: add `uppy.getFiles()` method (@goto-bus-stop / #770) -- [x] dashboard: fix duplicate plugin IDs, see #702 (@goto-bus-stop) -- [x] react: update propTypes (#776 / @goto-bus-stop) -- [x] dashboard/statusbar: fix some unicode characters showing up as gibberish (#787 / @goto-bus-stop) -- [ ] core: customizing metadata fields, see #809 and related +- [ ] core: customizing metadata fields, boolean metadata; see #809, #454 and related (@arturi) +- [ ] providers: Add user/account names to Uppy provider views (@ifedapoolarewaju) + +## 0.24.4 + +Released: 2018-05-14. + +- core: Pass `allowedFileTypes` and `maxNumberOfFiles` to input[type=file] in UI components: Dashboard, DragDrop, FileInput (#814 / @arturi) +- transloadit: Update Transloadit plugin's Uppy Server handling (#804 / @goto-bus-stop) +- tus: respect `limit` option for upload parameter requests (#817 / @ap--) +- docs: doc: Explain name `metadata` vs. `$_FILES[]["name"]` (#1c1bf2e / @goto-bus-stop) +- dashboard: improve “powered by” icon (#0284c8e / @arturi) +- statusbar: add default string for cancel button (#822 / @mrbatista) + +## 0.24.3 + +Released: 2018-05-10. + +- core: add `uppy.getFiles()` method (@goto-bus-stop / #770) +- core: merge meta data when add file (#810 / @mrbatista) +- dashboard: fix duplicate plugin IDs, see #702 (@goto-bus-stop) +- dashboard/statusbar: fix some unicode characters showing up as gibberish (#787 / @goto-bus-stop) +- dashboard: Fix grid item height in remote providers with few files (#791 / @goto-bus-stop) +- dashboard: Add `rel="noopener noreferrer"` to links containing `target="_blank" (#767 / @kvz) +- instagram: add extensions to instagram files (@ifedapoolarewaju) +- transloadit: More robust failure handling for Transloadit, closes #708 (#805 / @goto-bus-stop) +- docs: Document "headers" upload parameter in AwsS3 plugin (#780 / @janko-m) +- docs: Update some `uppy.state` docs to align with the Stores feature (#792 / @goto-bus-stop) +- dragdrop: Add `inputName` option like FileInput has, set empty value="", closes #729 (#778 / @goto-bus-stop, @arturi) +- docs: Google Cloud Storage setup for the AwsS3 plugin (#777 / goto-bus-stop) +- react: Update React component PropTypes (#776 / @arturi) +- statusbar: add some spacing between text elements (#760 / @goto-bus-stop) ## 0.24.2 diff --git a/README.md b/README.md index 51332567c..7c4b1ad7b 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ $ npm install uppy --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/). -Add CSS [uppy.min.css](https://transloadit.edgly.net/releases/uppy/v0.24.2/dist/uppy.min.css), either to `` 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.24.4/dist/uppy.min.css), either to `` 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,12 +73,12 @@ Alternatively, you can also use a pre-built bundle from Transloadit's CDN: Edgly 1\. Add a script to the bottom of ``: ``` html - + ``` 2\. Add CSS to ``: ``` html - + ``` 3\. Initialize: diff --git a/bin/upload-to-cdn.sh b/bin/upload-to-cdn.sh index 56f5ecbd7..d9b71ac36 100755 --- a/bin/upload-to-cdn.sh +++ b/bin/upload-to-cdn.sh @@ -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.24.2/dist/uppy.css +# - Runs npm pack, and stores files to e.g. https://transloadit.edgly.net/releases/uppy/v0.24.4/dist/uppy.css # - Uses local package by default, if [version] argument was specified, takes package from npm # # Run as: diff --git a/examples/cdn-example/index.html b/examples/cdn-example/index.html index 1472499df..2e5fccade 100644 --- a/examples/cdn-example/index.html +++ b/examples/cdn-example/index.html @@ -4,11 +4,11 @@ - + - + + + ``` 2\. Add CSS to ``: ``` html - + ``` 3\. Initialize: diff --git a/website/src/docs/transloadit.md b/website/src/docs/transloadit.md index 631b2f29d..5d561cbee 100644 --- a/website/src/docs/transloadit.md +++ b/website/src/docs/transloadit.md @@ -24,6 +24,29 @@ uppy.use(Transloadit, { As of Uppy 0.24 the Transloadit plugin includes the [Tus](/docs/tus) plugin to handle the uploading, so you no longer have to add it manually. +## Properties + +### `Transloadit.UPPY_SERVER` + +The main endpoint for Transloadit's hosted uppy-servers. You can use this constant in remote provider options, like so: + +```js +const Dropbox = require('uppy/lib/plugins/Dropbox') +const Transloadit = require('uppy/lib/plugins/Transloadit') + +uppy.use(Dropbox, { + host: Transloadit.UPPY_SERVER +}) +``` + +The value of this constant is `https://api2.transloadit.com/uppy-server`. If you are using a custom [`service`](#service) option, you should also set a custom host option in your provider plugins, by taking a Transloadit API url and appending `/uppy-server`: + +```js +uppy.use(Dropbox, { + host: 'https://api2-us-east-1.transloadit.com/uppy-server' +}) +``` + ## Options ### `service` diff --git a/website/src/docs/tus.md b/website/src/docs/tus.md index 5aacc82c2..259fcab95 100644 --- a/website/src/docs/tus.md +++ b/website/src/docs/tus.md @@ -36,4 +36,8 @@ URL to upload to, where your tus.io server is running. Whether to auto-retry the upload when the user's internet connection is back online after an outage. +### `limit: 0` + +Limit the amount of uploads going on at the same time. Passing `0` means no limit. + [tus-js-client]: https://github.com/tus/tus-js-client diff --git a/website/src/docs/uppy.md b/website/src/docs/uppy.md index 17d050514..cd095005a 100644 --- a/website/src/docs/uppy.md +++ b/website/src/docs/uppy.md @@ -15,10 +15,10 @@ const uppy = Uppy({ autoProceed: true, debug: false, restrictions: { - maxFileSize: false, - maxNumberOfFiles: false, - minNumberOfFiles: false, - allowedFileTypes: false + maxFileSize: null, + maxNumberOfFiles: null, + minNumberOfFiles: null, + allowedFileTypes: null }, meta: {}, onBeforeFileAdded: (currentFile, files) => currentFile, @@ -52,10 +52,14 @@ Optionally provide rules and conditions for which files can be selected. **Parameters** -- `maxFileSize` *number* -- `maxNumberOfFiles` *number* -- `minNumberOfFiles` *number* -- `allowedFileTypes` *array* of wildcards or exact mime types, like `image/*` +- `maxFileSize` *null | number* +- `maxNumberOfFiles` *null | number* +- `minNumberOfFiles` *null | number* +- `allowedFileTypes` *null | array* of wildcards `image/*`, exact mime types `image/jpeg`, or file extensions `.jpg`: `['image/*', '.jpg', '.jpeg', '.png', '.gif']` + +`maxNumberOfFiles` affects the number of files user is able to select via the system file dialog in UI plugins like `DragDrop`, `FileInput` and `Dashboard`: when set to `1` they will only be able to select a single file, otherwise, when `null` or other number, they will be able to select multiple files. + +`allowedFileTypes` gets passed to the system file dialog via [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Limiting_accepted_file_types)’s accept attribute, so only files matching these types will be selectable. ### `meta: {}` @@ -69,7 +73,7 @@ meta: { This global metadata is added to each file in Uppy. It can be modified with two methods: -1. [`uppy.setMeta({ username: 'Peter' })`](/docs/uppy/#uppy-setmeta-data) — set or update meta for all files. +1. [`uppy.setMeta({ username: 'Peter' })`](/docs/uppy/#uppy-setMeta-data) — set or update meta for all files. 2. [`uppy.setFileMeta('myfileID', { resize: 1500 })`](/docs/uppy/#uppy-setFileMeta-fileID-data) — set or update meta for specific file. Metadata from each file is then attached to uploads in [Tus](/docs/tus/) and [XHRUpload](/docs/xhrupload/) plugins. diff --git a/website/src/docs/xhrupload.md b/website/src/docs/xhrupload.md index e839cba44..0181b84eb 100644 --- a/website/src/docs/xhrupload.md +++ b/website/src/docs/xhrupload.md @@ -183,9 +183,12 @@ The default form field for file uploads is `files[]`, which means you have to ac // upload.php $files = $_FILES['files']; $file_path = $files['tmp_name'][0]; // temporary upload path of the first file -move_uploaded_file($file_path, './img/img.png'); // save the file at `img/img.png` +$file_name = $_POST['name']; // desired name of the file +move_uploaded_file($file_path, './img/' . basename($file_name)); // save the file in `img/` ``` +Note how we're using `$_POST['name']` instead of `$my_file['name']`. `$my_file['name']` contains the original name of the file on the user's device. `$_POST['name']` contains the `name` metadata value for the uploaded file, which can be edited by the user using the [Dashboard](/docs/dashboard). + Set a custom `fieldName` to make working with the `$_FILES` array a bit less convoluted: ```js @@ -201,7 +204,7 @@ uppy.use(XHRUpload, { // upload.php $my_file = $_FILES['my_file']; $file_path = $my_file['tmp_name']; // temporary upload path of the file -$file_name = $my_file['name']; // original name of the file +$file_name = $_POST['name']; // desired name of the file move_uploaded_file($file_path, './img/' . basename($file_name)); // save the file at `img/FILE_NAME` ``` diff --git a/website/src/examples/i18n/app.html b/website/src/examples/i18n/app.html index f25002ab5..d51410bfe 100644 --- a/website/src/examples/i18n/app.html +++ b/website/src/examples/i18n/app.html @@ -1,11 +1,11 @@ +https://transloadit.edgly.net/releases/uppy/v0.24.4/dist/uppy.min.css -->
+https://transloadit.edgly.net/releases/uppy/v0.24.4/dist/uppy.min.js --> + +