From e0b8939b93cd15e5285fd941a7d2143debc9dfa6 Mon Sep 17 00:00:00 2001 From: Artur Paikin Date: Tue, 2 Nov 2021 11:38:57 +0000 Subject: [PATCH 01/19] =?UTF-8?q?if=20an=20item=20is=20checked,=20it=20can?= =?UTF-8?q?=E2=80=99t=20be=20disabled=20(#3288)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@uppy/provider-views/src/Browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@uppy/provider-views/src/Browser.js b/packages/@uppy/provider-views/src/Browser.js index ce305a4024..c6a752b7db 100644 --- a/packages/@uppy/provider-views/src/Browser.js +++ b/packages/@uppy/provider-views/src/Browser.js @@ -115,7 +115,7 @@ function Browser (props) { viewType, i18n, type: 'file', - isDisabled: !validated.result && isChecked(file), + isDisabled: !validated.result && !isChecked(file), restrictionReason: validated.reason, }) })} From 66290b49309d385b775c809f68190081d0b78839 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 2 Nov 2021 14:12:42 +0100 Subject: [PATCH 02/19] @uppy/companion: use Node.js 16.x for Dockerfile (#3289) Fixes: https://github.com/transloadit/uppy/issues/3287 --- packages/@uppy/companion/Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/@uppy/companion/Dockerfile b/packages/@uppy/companion/Dockerfile index 07e7b15027..29ec5b5be6 100644 --- a/packages/@uppy/companion/Dockerfile +++ b/packages/@uppy/companion/Dockerfile @@ -1,4 +1,4 @@ -FROM node:14.18.0-alpine as build +FROM node:16.13.0-alpine as build COPY package.json /app/package.json @@ -6,12 +6,10 @@ WORKDIR /app # Install node_modules # * to optionally copy lock files that _might_ _not_ exist -ADD package.json package-*.json yarn.* /tmp/ +ADD package.json package-*.json yarn.* .yarn /tmp/ RUN cd /tmp && apk --update add --virtual native-dep \ make gcc g++ python libgcc libstdc++ git && \ - npm install -g corepack && \ corepack yarn install && \ - corepack yarn ls && \ apk del native-dep RUN mkdir -p /app && cd /app && ln -nfs /tmp/node_modules RUN apk add bash @@ -19,7 +17,7 @@ COPY . /app ENV PATH "${PATH}:/app/node_modules/.bin" RUN corepack yarn run build -FROM node:14.15.3-alpine +FROM node:16.13.0-alpine RUN mkdir -p /app WORKDIR /app From f7d15c77d36a814e27f300f2594037e8d3072aa0 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 3 Nov 2021 08:30:18 +0100 Subject: [PATCH 03/19] @uppy/companion: fix Dockerfiles (#3291) * @uppy/companion: fix Dockerfiles * Fix Docker building and deployments. Co-authored-by: Abdelhadi Khiati --- packages/@uppy/companion/Dockerfile | 2 +- packages/@uppy/companion/Dockerfile.test | 8 ++------ packages/@uppy/companion/docker-compose-dev.yml | 2 +- packages/@uppy/companion/docker-compose-test.yml | 2 +- packages/@uppy/companion/docker-compose.yml | 2 +- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/@uppy/companion/Dockerfile b/packages/@uppy/companion/Dockerfile index 29ec5b5be6..ffc3d1cfeb 100644 --- a/packages/@uppy/companion/Dockerfile +++ b/packages/@uppy/companion/Dockerfile @@ -8,7 +8,7 @@ WORKDIR /app # * to optionally copy lock files that _might_ _not_ exist ADD package.json package-*.json yarn.* .yarn /tmp/ RUN cd /tmp && apk --update add --virtual native-dep \ - make gcc g++ python libgcc libstdc++ git && \ + make gcc g++ python3 libgcc libstdc++ git && \ corepack yarn install && \ apk del native-dep RUN mkdir -p /app && cd /app && ln -nfs /tmp/node_modules diff --git a/packages/@uppy/companion/Dockerfile.test b/packages/@uppy/companion/Dockerfile.test index ba49fa9113..c8e7963748 100644 --- a/packages/@uppy/companion/Dockerfile.test +++ b/packages/@uppy/companion/Dockerfile.test @@ -1,15 +1,11 @@ -FROM alpine:3.6 - -RUN apk add --update nodejs \ - nodejs-npm +FROM node:16.13.0-alpine COPY package.json /app/package.json WORKDIR /app RUN apk --update add --virtual native-dep \ - make gcc g++ python libgcc libstdc++ git && \ - npm install -g corepack && \ + make gcc g++ python3 libgcc libstdc++ git && \ corepack yarn install && \ apk del native-dep RUN apk add bash diff --git a/packages/@uppy/companion/docker-compose-dev.yml b/packages/@uppy/companion/docker-compose-dev.yml index eeb5e45838..2e6f20226e 100644 --- a/packages/@uppy/companion/docker-compose-dev.yml +++ b/packages/@uppy/companion/docker-compose-dev.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: uppy: diff --git a/packages/@uppy/companion/docker-compose-test.yml b/packages/@uppy/companion/docker-compose-test.yml index e22561d389..d27b3d8385 100644 --- a/packages/@uppy/companion/docker-compose-test.yml +++ b/packages/@uppy/companion/docker-compose-test.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: uppy: diff --git a/packages/@uppy/companion/docker-compose.yml b/packages/@uppy/companion/docker-compose.yml index fad4e5b6f5..3dbf23a12a 100644 --- a/packages/@uppy/companion/docker-compose.yml +++ b/packages/@uppy/companion/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: uppy: From 8ebae547a1398521b724c04b3c9d32c2c8ff954f Mon Sep 17 00:00:00 2001 From: Abdelhadi Khiati Date: Wed, 3 Nov 2021 08:34:57 +0100 Subject: [PATCH 04/19] Remove yarn file --- packages/@uppy/companion/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@uppy/companion/Dockerfile b/packages/@uppy/companion/Dockerfile index ffc3d1cfeb..69cf3ce93f 100644 --- a/packages/@uppy/companion/Dockerfile +++ b/packages/@uppy/companion/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /app # Install node_modules # * to optionally copy lock files that _might_ _not_ exist -ADD package.json package-*.json yarn.* .yarn /tmp/ +ADD package.json package-*.json yarn.* /tmp/ RUN cd /tmp && apk --update add --virtual native-dep \ make gcc g++ python3 libgcc libstdc++ git && \ corepack yarn install && \ From 6a96c6fd06be1100c70056a4741725089aa18677 Mon Sep 17 00:00:00 2001 From: bencergazda Date: Wed, 3 Nov 2021 12:30:10 +0100 Subject: [PATCH 05/19] fix: @uppy/utils - `getFileType()` always returns a string (#3294) --- packages/@uppy/utils/types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@uppy/utils/types/index.d.ts b/packages/@uppy/utils/types/index.d.ts index 1439dc40a6..0867d7a6b0 100644 --- a/packages/@uppy/utils/types/index.d.ts +++ b/packages/@uppy/utils/types/index.d.ts @@ -162,7 +162,7 @@ declare module '@uppy/utils/lib/getFileNameAndExtension' { declare module '@uppy/utils/lib/getFileType' { import UppyUtils = require('@uppy/utils') - function getFileType (file: UppyUtils.UppyFile): string | null + function getFileType (file: UppyUtils.UppyFile): string export = getFileType } From 3c44b5b52089ef9bc9eb71df79cbfc3eedc96ed7 Mon Sep 17 00:00:00 2001 From: Artur Paikin Date: Thu, 4 Nov 2021 15:09:21 +0000 Subject: [PATCH 06/19] @uppy/provider-views@2.0.5 --- packages/@uppy/provider-views/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@uppy/provider-views/package.json b/packages/@uppy/provider-views/package.json index a206c20c03..bc3165f3cd 100644 --- a/packages/@uppy/provider-views/package.json +++ b/packages/@uppy/provider-views/package.json @@ -1,7 +1,7 @@ { "name": "@uppy/provider-views", "description": "View library for Uppy remote provider plugins.", - "version": "2.0.4", + "version": "2.0.5", "license": "MIT", "main": "lib/index.js", "style": "dist/style.min.css", From cad658a20d06c5a895b97aa9730274fcfd5ab4c7 Mon Sep 17 00:00:00 2001 From: Artur Paikin Date: Thu, 4 Nov 2021 15:45:05 +0000 Subject: [PATCH 07/19] Release uppy@2.2.2 --- packages/uppy/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/uppy/package.json b/packages/uppy/package.json index 4158c6b612..b90f68c454 100644 --- a/packages/uppy/package.json +++ b/packages/uppy/package.json @@ -1,7 +1,7 @@ { "name": "uppy", "description": "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": "2.2.1", + "version": "2.2.2", "license": "MIT", "main": "index.js", "module": "index.mjs", From e7ab2d4793e5c015b7522c8c51a6cdf7714f0edd Mon Sep 17 00:00:00 2001 From: Merlijn Vos Date: Fri, 5 Nov 2021 13:13:31 +0100 Subject: [PATCH 08/19] Update BACKLOG.md --- BACKLOG.md | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/BACKLOG.md b/BACKLOG.md index a46925d1b7..66c8b3aad0 100644 --- a/BACKLOG.md +++ b/BACKLOG.md @@ -5,32 +5,12 @@ These are ideas that are planned for specific versions or act as a backlog without a clear date. PRs are welcome! Please do open an issue to discuss first if it's a big feature, priorities may have changed after something was added here. -## `2.0.0` - -- [x] Drop IE10 (officially), drop IE11 polyfills? (@aduh95) -- [x] *: upgrade to Preact X (@murderlon) -- [x] chore: hunt down most `@TODO`s and either fix, or remove, or move to github issues/changelog backlog (@murderlon) -- [x] core: consider removing Preact from `Plugin` (maybe have a `(ui)Plugin extends BasePlugin`?) as pointed out on Reddit https://www.reddit.com/r/javascript/comments/bhkx5k/uppy_10_your_best_friend_in_file_uploading/ (@murderlon) -- [x] core: force the `new` keyword when instantiating Uppy — now we support both `new Uppy()` and `Uppy()` which is harder to maintain and might lead to confusion (@arturi) -- [ ] core: maybe we remove `file.name` and only keep `file.meta.name`; we can change the file.name here actually because it's just a plain object. we can't change the file.data.name where data is a File instance from an input or something. For XHRUpload, where we put the File instance in a FormData object and it uses the unchangeable .name property (@arturi) -- [x] core: pass full file object to `onBeforeFileAdded`. Maybe also check restrictions before calling the callbacks: https://github.com/transloadit/uppy/pull/1594 (@arturi) -- [x] core/dashboard: replace `poweredBy` and `exceedsSize` locale keys by word order aware versions, see PR #2077 (@goto-bus-stop) -- [x] dashboard: set default `trigger: null`, see https://github.com/transloadit/uppy/pull/2144#issuecomment-600581690 (@arturi) -- [x] form: make the `multipleResults` option `true` by default (@arturi) -- [x] locales: Remove the old es_GL name alias for gl_ES. Keep gl_ES only (@arturi) -- [x] providers: remove `serverHeaders` https://github.com/transloadit/uppy/pull/1861 (@mifi) -- [x] transloadit: remove `UPPY_SERVER` constant (@mifi) -- [x] tus: set the `limit` option to a sensible default, like 5 (10?) (@arturi) -- [x] xhr: set the `limit` option to a sensible default, like 5 (10?) (@arturi) -- [x] xhr: change default name depending on whether `bundle` is set `files[]` (`true`) vs `file` (default) (#782) (@aduh95) -- [x] providers: allow changing provider name title through locale https://github.com/transloadit/uppy/issues/2279 (@goto-bus-stop) -- [x] tus: remove `autoRetry` option (throw error at runtime if it is explicitly given) (@aduh95) -- [x] dashboard: showing links to files should be turned off by default (it's great for devs, they can opt-in, but for end-user UI it's weird and can even lead to problems) (@arturi) - ## `3.0.0` - [ ] Switch to ES Modules (ESM) - [ ] @uppy/image-editor: Remove silly hack to work around non-ESM. +- [ ] Consider updating the name of @uppy/aws-s3 and @uppy/aws-s3-multipart to reflect it also supports Google Cloud Storage, Wasabi, and other cloud providers. +- [ ] Consider fixing all locale files to follow the bcp-47 standard (nl_NL --> nl-NL) ## `4.0.0` From 6e4884f5590a6c6849ddc23f70bdf222072b0183 Mon Sep 17 00:00:00 2001 From: Artur Paikin Date: Fri, 5 Nov 2021 15:00:43 +0000 Subject: [PATCH 09/19] Required meta fields UI (#3285) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add checkRequiredMetaFieldsOnFile for checking single file's meta fields after editing * add MetaErrorMessage component, mobile and desktop styles * use AggregateRestrictionError again * metaFieldIdToName — use names of meta fields instead of id * Update MetaErrorMessage.js * desktop style tweaks * update jest snapshot --- packages/@uppy/core/src/Uppy.js | 43 +++++++++++----- .../core/src/__snapshots__/Uppy.test.js.snap | 2 + .../src/components/FileItem/FileInfo/index.js | 33 ++++++++----- .../components/FileItem/FileInfo/index.scss | 49 ++++++++++++++++++- .../FileItem/FilePreviewAndLink/index.js | 9 +++- .../components/FileItem/MetaErrorMessage.js | 35 +++++++++++++ .../src/components/FileItem/index.js | 5 ++ packages/@uppy/dashboard/src/index.js | 4 ++ packages/@uppy/locales/src/en_US.js | 4 ++ 9 files changed, 156 insertions(+), 28 deletions(-) create mode 100644 packages/@uppy/dashboard/src/components/FileItem/MetaErrorMessage.js diff --git a/packages/@uppy/core/src/Uppy.js b/packages/@uppy/core/src/Uppy.js index 2a687a61d3..91d273428f 100644 --- a/packages/@uppy/core/src/Uppy.js +++ b/packages/@uppy/core/src/Uppy.js @@ -26,12 +26,13 @@ class RestrictionError extends Error { if (typeof AggregateError === 'undefined') { // eslint-disable-next-line no-global-assign globalThis.AggregateError = class AggregateError extends Error { - constructor (message, errors) { + constructor (errors, message) { super(message) this.errors = errors } } } + class AggregateRestrictionError extends AggregateError { constructor (...args) { super(...args) @@ -557,27 +558,39 @@ class Uppy { } /** - * Check if requiredMetaField restriction is met before uploading. + * Check if requiredMetaField restriction is met for a specific file. * */ - #checkRequiredMetaFields (files) { + #checkRequiredMetaFieldsOnFile (file) { const { requiredMetaFields } = this.opts.restrictions const { hasOwnProperty } = Object.prototype const errors = [] - for (const fileID of Object.keys(files)) { - const file = this.getFile(fileID) - for (let i = 0; i < requiredMetaFields.length; i++) { - if (!hasOwnProperty.call(file.meta, requiredMetaFields[i]) || file.meta[requiredMetaFields[i]] === '') { - const err = new RestrictionError(`${this.i18n('missingRequiredMetaFieldOnFile', { fileName: file.name })}`) - errors.push(err) - this.#showOrLogErrorAndThrow(err, { file, showInformer: false, throwErr: false }) - } + const missingFields = [] + for (let i = 0; i < requiredMetaFields.length; i++) { + if (!hasOwnProperty.call(file.meta, requiredMetaFields[i]) || file.meta[requiredMetaFields[i]] === '') { + const err = new RestrictionError(`${this.i18n('missingRequiredMetaFieldOnFile', { fileName: file.name })}`) + errors.push(err) + missingFields.push(requiredMetaFields[i]) + this.#showOrLogErrorAndThrow(err, { file, showInformer: false, throwErr: false }) } } + this.setFileState(file.id, { missingRequiredMetaFields: missingFields }) + return errors + } + + /** + * Check if requiredMetaField restriction is met before uploading. + * + */ + #checkRequiredMetaFields (files) { + const errors = Object.keys(files).flatMap((fileID) => { + const file = this.getFile(fileID) + return this.#checkRequiredMetaFieldsOnFile(file) + }) if (errors.length) { - throw new AggregateRestrictionError(`${this.i18n('missingRequiredMetaField')}`, errors) + throw new AggregateRestrictionError(errors, `${this.i18n('missingRequiredMetaField')}`) } } @@ -1277,6 +1290,12 @@ class Uppy { this.calculateTotalProgress() }) + this.on('dashboard:file-edit-complete', (file) => { + if (file) { + this.#checkRequiredMetaFieldsOnFile(file) + } + }) + // show informer if offline if (typeof window !== 'undefined' && window.addEventListener) { window.addEventListener('online', this.#updateOnlineStatus) diff --git a/packages/@uppy/core/src/__snapshots__/Uppy.test.js.snap b/packages/@uppy/core/src/__snapshots__/Uppy.test.js.snap index 1762b1101e..c0d9282118 100644 --- a/packages/@uppy/core/src/__snapshots__/Uppy.test.js.snap +++ b/packages/@uppy/core/src/__snapshots__/Uppy.test.js.snap @@ -24,6 +24,7 @@ Object { "name": "foo.jpg", "type": "image/jpeg", }, + "missingRequiredMetaFields": Array [], "name": "foo.jpg", "preview": undefined, "progress": Object { @@ -47,6 +48,7 @@ Object { "name": "bar.jpg", "type": "image/jpeg", }, + "missingRequiredMetaFields": Array [], "name": "bar.jpg", "preview": undefined, "progress": Object { diff --git a/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.js b/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.js index 843e1b3ca9..c9c974b286 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.js +++ b/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.js @@ -1,5 +1,6 @@ const { h, Fragment } = require('preact') const prettierBytes = require('@transloadit/prettier-bytes') +const MetaErrorMessage = require('../MetaErrorMessage') const truncateString = require('@uppy/utils/lib/truncateString') const renderFileName = (props) => { @@ -54,22 +55,22 @@ const renderAuthor = (props) => { } const renderFileSize = (props) => props.file.size && ( -
- {prettierBytes(props.file.size)} -
+
+ {prettierBytes(props.file.size)} +
) const ReSelectButton = (props) => props.file.isGhost && ( - - {' \u2022 '} - - + + {' \u2022 '} + + ) const ErrorButton = ({ file, onClick }) => { @@ -107,6 +108,12 @@ module.exports = function FileInfo (props) { onClick={() => alert(props.file.error)} // TODO: move to a custom alert implementation /> + ) } diff --git a/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.scss b/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.scss index b2a10f4a51..4f7dab37fa 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.scss +++ b/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.scss @@ -46,6 +46,7 @@ display: inline-block; text-transform: uppercase; vertical-align: bottom; + margin-bottom: 5px; } .uppy-Dashboard-Item-reSelect { @@ -54,5 +55,49 @@ font-size: inherit; font-family: inherit; } -// ...uppy-Dashboard-Item-status| -// ...uppy-Dashboard-Item-fileInfo| + +.uppy-Dashboard-Item-errorMessage { + font-size: 11px; + font-weight: 500; + line-height: 1.3; + color: darken($red, 15%); + background-color: lighten($red, 45%); + padding: 5px 6px; +} + +.uppy-Dashboard-Item-errorMessageBtn { + text-decoration: underline; + cursor: pointer; + font-weight: 500; +} + +// Error message desktop / large screen +.uppy-Dashboard-Item-preview .uppy-Dashboard-Item-errorMessage { + display: none; + + .uppy-size--md & { + display: block; + border-top: 1px solid lighten($red, 35%); + padding: 6px 8px; + line-height: 1.4; + position: absolute; + bottom: 0; + left: 0; + right: 0; + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; + } +} + +// Error message mobile / small screen +.uppy-Dashboard-Item-fileInfo .uppy-Dashboard-Item-errorMessage { + display: inline-block; + position: static; + border: 1px solid lighten($red, 35%); + border-radius: 3px; + + .uppy-size--md & { + display: none; + } +} + diff --git a/packages/@uppy/dashboard/src/components/FileItem/FilePreviewAndLink/index.js b/packages/@uppy/dashboard/src/components/FileItem/FilePreviewAndLink/index.js index 2b99484f35..b0b95a4ef3 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/FilePreviewAndLink/index.js +++ b/packages/@uppy/dashboard/src/components/FileItem/FilePreviewAndLink/index.js @@ -1,5 +1,6 @@ const { h } = require('preact') const FilePreview = require('../../FilePreview') +const MetaErrorMessage = require('../MetaErrorMessage') const getFileTypeIcon = require('../../../utils/getFileTypeIcon') module.exports = function FilePreviewAndLink (props) { @@ -19,11 +20,17 @@ module.exports = function FilePreviewAndLink (props) { target="_blank" aria-label={props.file.meta.name} > - + ) } + ) } diff --git a/packages/@uppy/dashboard/src/components/FileItem/MetaErrorMessage.js b/packages/@uppy/dashboard/src/components/FileItem/MetaErrorMessage.js new file mode 100644 index 0000000000..00d2bcc2e1 --- /dev/null +++ b/packages/@uppy/dashboard/src/components/FileItem/MetaErrorMessage.js @@ -0,0 +1,35 @@ +const { h } = require('preact') + +const metaFieldIdToName = (metaFieldId, metaFields) => { + const field = metaFields.filter(f => f.id === metaFieldId) + return field[0].name +} + +module.exports = function renderMissingMetaFieldsError (props) { + const { file, toggleFileCard, i18n, metaFields } = props + const { missingRequiredMetaFields } = file + if (!missingRequiredMetaFields?.length) { + return null + } + + const metaFieldsString = missingRequiredMetaFields.map(missingMetaField => ( + metaFieldIdToName(missingMetaField, metaFields) + )).join(', ') + + return ( +
+ {i18n('missingRequiredMetaFields', { + smart_count: missingRequiredMetaFields.length, + fields: metaFieldsString, + })} + {' '} + +
+ ) +} diff --git a/packages/@uppy/dashboard/src/components/FileItem/index.js b/packages/@uppy/dashboard/src/components/FileItem/index.js index 3eed378abe..3a9c57b54e 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/index.js +++ b/packages/@uppy/dashboard/src/components/FileItem/index.js @@ -76,6 +76,9 @@ module.exports = class FileItem extends Component { Date: Fri, 5 Nov 2021 16:09:36 +0100 Subject: [PATCH 10/19] Add showRecordingLength to webcam types (#3303) --- packages/@uppy/webcam/types/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@uppy/webcam/types/index.d.ts b/packages/@uppy/webcam/types/index.d.ts index 8c824139fb..35f370a0a0 100644 --- a/packages/@uppy/webcam/types/index.d.ts +++ b/packages/@uppy/webcam/types/index.d.ts @@ -18,6 +18,7 @@ export interface WebcamOptions extends PluginOptions { locale?: WebcamLocale title?: string videoConstraints?: MediaTrackConstraints + showRecordingLength?: boolean } declare class Webcam extends UIPlugin {} From a545c66d10df8eaf9e0fde9bc7a1fccc2070381f Mon Sep 17 00:00:00 2001 From: John Adair Date: Fri, 5 Nov 2021 08:28:21 -0700 Subject: [PATCH 11/19] Convert sets to arrays prior to using spread operator to enable transpilation to ES5 (#3297) --- packages/@uppy/core/src/Uppy.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@uppy/core/src/Uppy.js b/packages/@uppy/core/src/Uppy.js index 91d273428f..c149b83723 100644 --- a/packages/@uppy/core/src/Uppy.js +++ b/packages/@uppy/core/src/Uppy.js @@ -1611,9 +1611,9 @@ class Uppy { const restoreStep = currentUpload.step || 0 const steps = [ - ...this.#preProcessors, - ...this.#uploaders, - ...this.#postProcessors, + ...Array.from(this.#preProcessors), + ...Array.from(this.#uploaders), + ...Array.from(this.#postProcessors), ] try { for (let step = restoreStep; step < steps.length; step++) { From bc67c5e708b707313280034b447aaa2331b1d4ef Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 8 Nov 2021 11:23:10 +0100 Subject: [PATCH 12/19] @uppy/aws-s3: use `Promise.allSettled` insead of custom utils (#3079) --- packages/@uppy/aws-s3/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@uppy/aws-s3/src/index.js b/packages/@uppy/aws-s3/src/index.js index 701a327db1..e3aae9fa10 100644 --- a/packages/@uppy/aws-s3/src/index.js +++ b/packages/@uppy/aws-s3/src/index.js @@ -27,7 +27,6 @@ const BasePlugin = require('@uppy/core/lib/BasePlugin') const { RateLimitedQueue, internalRateLimitedQueue } = require('@uppy/utils/lib/RateLimitedQueue') -const settle = require('@uppy/utils/lib/settle') const { RequestClient } = require('@uppy/companion-client') const MiniXHRUpload = require('./MiniXHRUpload') const isXml = require('./isXml') @@ -175,7 +174,7 @@ module.exports = class AwsS3 extends BasePlugin { const numberOfFiles = fileIDs.length - return settle(fileIDs.map((id, index) => { + return Promise.allSettled(fileIDs.map((id, index) => { paramsPromises[id] = getUploadParameters(this.uppy.getFile(id)) return paramsPromises[id].then((params) => { delete paramsPromises[id] @@ -211,6 +210,7 @@ module.exports = class AwsS3 extends BasePlugin { const file = this.uppy.getFile(id) this.uppy.emit('upload-error', file, error) + return Promise.reject(error) }) })).finally(() => { // cleanup. From 7ad3e7111bda89cedcb6fc882cd1afc1410b6eec Mon Sep 17 00:00:00 2001 From: Murderlon Date: Mon, 8 Nov 2021 15:31:37 +0100 Subject: [PATCH 13/19] @uppy/unsplash@2.0.3 --- packages/@uppy/unsplash/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@uppy/unsplash/package.json b/packages/@uppy/unsplash/package.json index 8521f34e81..d394fdacd5 100644 --- a/packages/@uppy/unsplash/package.json +++ b/packages/@uppy/unsplash/package.json @@ -1,7 +1,7 @@ { "name": "@uppy/unsplash", "description": "Import files from Unsplash, the free stock photography resource, into Uppy", - "version": "2.0.2", + "version": "2.0.3", "license": "MIT", "main": "lib/index.js", "types": "types/index.d.ts", From 6cec046811026b32b25b972111f9262e46646737 Mon Sep 17 00:00:00 2001 From: Murderlon Date: Mon, 8 Nov 2021 15:40:46 +0100 Subject: [PATCH 14/19] Release @uppy/robodog@2.1.2 --- packages/@uppy/robodog/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@uppy/robodog/package.json b/packages/@uppy/robodog/package.json index bd07ea6bcb..c769ce5606 100644 --- a/packages/@uppy/robodog/package.json +++ b/packages/@uppy/robodog/package.json @@ -1,7 +1,7 @@ { "name": "@uppy/robodog", "description": "Transloadit SDK for browsers based on Uppy", - "version": "2.1.1", + "version": "2.1.2", "license": "MIT", "main": "lib/index.js", "jsnext:main": "src/index.js", From 9fbc0de51bd1120c08cdeed48888ae281049057f Mon Sep 17 00:00:00 2001 From: Murderlon Date: Mon, 8 Nov 2021 15:59:50 +0100 Subject: [PATCH 15/19] meta: update version references in docs --- BUNDLE-README.md | 2 +- README.md | 8 ++++---- bin/after-version-bump.js | 2 +- examples/cdn-example/index.html | 4 ++-- examples/transloadit-textarea/index.html | 2 +- examples/uppy-with-companion/client/index.html | 4 ++-- packages/@uppy/robodog/README.md | 4 ++-- website/src/docs/index.md | 10 +++++----- website/src/docs/locales.md | 2 +- website/src/docs/migration-guides.md | 6 +++--- website/src/docs/robodog-form.md | 8 ++++---- website/src/docs/robodog.md | 4 ++-- website/src/examples/i18n/app.html | 4 ++-- website/src/examples/markdown-snippets/app.es6 | 2 +- website/src/examples/markdown-snippets/app.html | 2 +- website/themes/uppy/layout/index.ejs | 4 ++-- 16 files changed, 34 insertions(+), 34 deletions(-) diff --git a/BUNDLE-README.md b/BUNDLE-README.md index 25c80939df..bdb644708e 100644 --- a/BUNDLE-README.md +++ b/BUNDLE-README.md @@ -1,7 +1,7 @@ # Uppy Hi, thanks for trying out the bundled version of the Uppy File Uploader. You can use -this from a CDN (``) or bundle it with your webapp. +this from a CDN (``) or bundle it with your webapp. Note that the recommended way to use Uppy is to install it with yarn/npm and use a bundler like Webpack so that you can create a smaller custom build with only the diff --git a/README.md b/README.md index 2d7cfd72a6..911e53d042 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ $ npm install @uppy/core @uppy/dashboard @uppy/tus 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://releases.transloadit.com/uppy/v2.2.1/uppy.min.css), either to your HTML page’s `` 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://releases.transloadit.com/uppy/v2.2.2/uppy.min.css), either to your HTML page’s `` 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. @@ -77,10 +77,10 @@ Alternatively, you can also use a pre-built bundle from Transloadit’s CDN: Edg ```html - + - +
@@ -190,7 +190,7 @@ If you’re using Uppy from CDN, those polyfills are already included in the leg bundle, so no need to include anything additionally: ```html - + ``` ## FAQ diff --git a/bin/after-version-bump.js b/bin/after-version-bump.js index 206d4eebfe..d9f77e49ee 100755 --- a/bin/after-version-bump.js +++ b/bin/after-version-bump.js @@ -79,7 +79,7 @@ async function main () { } const message = await lastCommitMessage() - if (message.trim() !== 'Release') { + if (!message.trim().includes('Release')) { console.error(`Last commit is not a release commit, but '${message}'`) process.exit(1) } diff --git a/examples/cdn-example/index.html b/examples/cdn-example/index.html index 6edbf67f49..a5b707f0ef 100644 --- a/examples/cdn-example/index.html +++ b/examples/cdn-example/index.html @@ -4,11 +4,11 @@ - + - + + + + ``` Then, a global `Robodog` variable will be available. For usage instructions, please see the [main Robodog documentation](https://uppy.io/docs/robodog). diff --git a/website/src/docs/index.md b/website/src/docs/index.md index 30ea9c7c2a..f07c54ca21 100644 --- a/website/src/docs/index.md +++ b/website/src/docs/index.md @@ -19,12 +19,12 @@ Here’s the simplest example html page with Uppy (it uses a CDN bundle, while w Uppy - +
- + + ``` 2\. Add CSS to ``: ```html - + ``` 3\. Initialize at the bottom of the closing `` tag: @@ -183,5 +183,5 @@ export * from '@uppy/core' If you’re using Uppy from CDN, those polyfills are already included in the bundle, no need to include anything additionally: ```html - + ``` diff --git a/website/src/docs/locales.md b/website/src/docs/locales.md index 8a445a9cc8..db417a4e57 100644 --- a/website/src/docs/locales.md +++ b/website/src/docs/locales.md @@ -34,7 +34,7 @@ const uppy = new Uppy({ Add a ` + + - - + + ``` Please note that while you may be able to get 2.0 to work in IE11 this way, we do not officially support it anymore. diff --git a/website/src/docs/robodog-form.md b/website/src/docs/robodog-form.md index 5c54a497a3..abda7a4343 100644 --- a/website/src/docs/robodog-form.md +++ b/website/src/docs/robodog-form.md @@ -137,7 +137,7 @@ $(selector).transloadit({ ```html - + + + + ``` diff --git a/website/src/examples/i18n/app.html b/website/src/examples/i18n/app.html index 2a571ba68f..f4d371f92e 100644 --- a/website/src/examples/i18n/app.html +++ b/website/src/examples/i18n/app.html @@ -1,7 +1,7 @@ - +
@@ -12,7 +12,7 @@
Uploaded files:
- + +// const robodog = require('@uppy/robodog') const TRANSLOADIT_EXAMPLE_KEY = '35c1aed03f5011e982b6afe82599b6a0' diff --git a/website/src/examples/markdown-snippets/app.html b/website/src/examples/markdown-snippets/app.html index c8d365dd65..9e4ef6b4bb 100644 --- a/website/src/examples/markdown-snippets/app.html +++ b/website/src/examples/markdown-snippets/app.html @@ -1,6 +1,6 @@ + -->

Create a new snippet

diff --git a/website/themes/uppy/layout/index.ejs b/website/themes/uppy/layout/index.ejs index 48f29f0451..117bd24d04 100644 --- a/website/themes/uppy/layout/index.ejs +++ b/website/themes/uppy/layout/index.ejs @@ -187,8 +187,8 @@

© <%- date(Date.now(), 'YYYY') %> Transloadit

- - + + `) or bundle it with your webapp. +this from a CDN (``) or bundle it with your webapp. Note that the recommended way to use Uppy is to install it with yarn/npm and use a bundler like Webpack so that you can create a smaller custom build with only the diff --git a/README.md b/README.md index 911e53d042..558a5f2d01 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ $ npm install @uppy/core @uppy/dashboard @uppy/tus 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://releases.transloadit.com/uppy/v2.2.2/uppy.min.css), either to your HTML page’s `` 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://releases.transloadit.com/uppy/v2.2.3/uppy.min.css), either to your HTML page’s `` 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. @@ -77,10 +77,10 @@ Alternatively, you can also use a pre-built bundle from Transloadit’s CDN: Edg ```html - + - +
@@ -190,7 +190,7 @@ If you’re using Uppy from CDN, those polyfills are already included in the leg bundle, so no need to include anything additionally: ```html - + ``` ## FAQ diff --git a/bin/after-version-bump.js b/bin/after-version-bump.js index d9f77e49ee..10d9f94c1d 100755 --- a/bin/after-version-bump.js +++ b/bin/after-version-bump.js @@ -13,7 +13,6 @@ // NOTE this _amends_ the previous commit, which should // already be a "Release" commit generated by bin/release. -const lastCommitMessage = require('last-commit-message') const { spawn } = require('child_process') const { readFile, writeFile } = require('fs/promises') const once = require('events.once') @@ -78,12 +77,6 @@ async function main () { process.exit(0) } - const message = await lastCommitMessage() - if (!message.trim().includes('Release')) { - console.error(`Last commit is not a release commit, but '${message}'`) - process.exit(1) - } - const files = await globby([ 'README.md', 'BUNDLE-README.md', diff --git a/examples/cdn-example/index.html b/examples/cdn-example/index.html index a5b707f0ef..a0ec37a0bf 100644 --- a/examples/cdn-example/index.html +++ b/examples/cdn-example/index.html @@ -4,11 +4,11 @@ - + - + + + + ``` Then, a global `Robodog` variable will be available. For usage instructions, please see the [main Robodog documentation](https://uppy.io/docs/robodog). diff --git a/packages/@uppy/robodog/package.json b/packages/@uppy/robodog/package.json index c769ce5606..196a785bb3 100644 --- a/packages/@uppy/robodog/package.json +++ b/packages/@uppy/robodog/package.json @@ -1,7 +1,7 @@ { "name": "@uppy/robodog", "description": "Transloadit SDK for browsers based on Uppy", - "version": "2.1.2", + "version": "2.1.3", "license": "MIT", "main": "lib/index.js", "jsnext:main": "src/index.js", diff --git a/packages/uppy/package.json b/packages/uppy/package.json index b90f68c454..f95f72856b 100644 --- a/packages/uppy/package.json +++ b/packages/uppy/package.json @@ -1,7 +1,7 @@ { "name": "uppy", "description": "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": "2.2.2", + "version": "2.2.3", "license": "MIT", "main": "index.js", "module": "index.mjs", diff --git a/website/src/docs/index.md b/website/src/docs/index.md index f07c54ca21..5c8bc07bc6 100644 --- a/website/src/docs/index.md +++ b/website/src/docs/index.md @@ -19,12 +19,12 @@ Here’s the simplest example html page with Uppy (it uses a CDN bundle, while w Uppy - +
- + + ``` 2\. Add CSS to ``: ```html - + ``` 3\. Initialize at the bottom of the closing `` tag: @@ -183,5 +183,5 @@ export * from '@uppy/core' If you’re using Uppy from CDN, those polyfills are already included in the bundle, no need to include anything additionally: ```html - + ``` diff --git a/website/src/docs/locales.md b/website/src/docs/locales.md index db417a4e57..4e7a6b3d38 100644 --- a/website/src/docs/locales.md +++ b/website/src/docs/locales.md @@ -34,7 +34,7 @@ const uppy = new Uppy({ Add a ` + + - - + + ``` Please note that while you may be able to get 2.0 to work in IE11 this way, we do not officially support it anymore. diff --git a/website/src/docs/robodog-form.md b/website/src/docs/robodog-form.md index abda7a4343..6d800313ca 100644 --- a/website/src/docs/robodog-form.md +++ b/website/src/docs/robodog-form.md @@ -137,7 +137,7 @@ $(selector).transloadit({ ```html - + + + + ``` diff --git a/website/src/examples/i18n/app.html b/website/src/examples/i18n/app.html index f4d371f92e..02776e206d 100644 --- a/website/src/examples/i18n/app.html +++ b/website/src/examples/i18n/app.html @@ -1,7 +1,7 @@ - +
@@ -12,7 +12,7 @@
Uploaded files:
- + +// const robodog = require('@uppy/robodog') const TRANSLOADIT_EXAMPLE_KEY = '35c1aed03f5011e982b6afe82599b6a0' diff --git a/website/src/examples/markdown-snippets/app.html b/website/src/examples/markdown-snippets/app.html index 9e4ef6b4bb..08fc8a8c6f 100644 --- a/website/src/examples/markdown-snippets/app.html +++ b/website/src/examples/markdown-snippets/app.html @@ -1,6 +1,6 @@ + -->

Create a new snippet

diff --git a/website/themes/uppy/layout/index.ejs b/website/themes/uppy/layout/index.ejs index 117bd24d04..9504bc08e9 100644 --- a/website/themes/uppy/layout/index.ejs +++ b/website/themes/uppy/layout/index.ejs @@ -187,8 +187,8 @@

© <%- date(Date.now(), 'YYYY') %> Transloadit

- - + +