From ca7fd77a94c880085bfdae41bd9efca4b2db1c03 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Mon, 18 Oct 2021 15:28:27 +1000 Subject: [PATCH] DEV: Bump uppy module versions for retryable prepareUploadParts (#14629) This commit bumps the following uppy modules: * @uppy/aws-s3 * @uppy/aws-s3-multipart * @uppy/core * @uppy/drop-target * @uppy/xhr-upload This is done so we can use the new functionality for retrying failed prepareUploadParts calls, introduced in https://github.com/transloadit/uppy/commit/e435f4a91747db8116e1c9b5dd37de25bf847f43. I also needed to make some changes to composer-upload-uppy to support this retrying, while at the same time being able to throw a bootbox with the error message if the number of retries are exceeded. --- .../app/mixins/composer-upload-uppy.js | 62 +++- app/assets/javascripts/discourse/package.json | 10 +- app/assets/javascripts/yarn.lock | 95 +++-- package.json | 10 +- vendor/assets/javascripts/uppy.js | 343 +++++++++--------- yarn.lock | 95 +++-- 6 files changed, 314 insertions(+), 301 deletions(-) diff --git a/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js b/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js index 78b06180607..3089a399b33 100644 --- a/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js +++ b/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js @@ -1,4 +1,5 @@ import Mixin from "@ember/object/mixin"; +import { Promise } from "rsvp"; import ExtendableUploader from "discourse/mixins/extendable-uploader"; import { ajax } from "discourse/lib/ajax"; import { deepMerge } from "discourse-common/lib/object"; @@ -374,6 +375,7 @@ export default Mixin.create(ExtendableUploader, { _useS3MultipartUploads() { const self = this; + const retryDelays = [0, 1000, 3000, 5000]; this._uppyInstance.use(AwsS3Multipart, { // controls how many simultaneous _chunks_ are uploaded, not files, @@ -384,6 +386,7 @@ export default Mixin.create(ExtendableUploader, { // chunk size via getChunkSize(file), so we may want to increase // the chunk size for larger files limit: 10, + retryDelays, createMultipartUpload(file) { self._uppyInstance.emit("create-multipart", file.id); @@ -419,22 +422,53 @@ export default Mixin.create(ExtendableUploader, { }, prepareUploadParts(file, partData) { - return ( - ajax("/uploads/batch-presign-multipart-parts.json", { - type: "POST", - data: { - part_numbers: partData.partNumbers, - unique_identifier: file.meta.unique_identifier, - }, + if (file.preparePartsRetryAttempts === undefined) { + file.preparePartsRetryAttempts = 0; + } + return ajax("/uploads/batch-presign-multipart-parts.json", { + type: "POST", + data: { + part_numbers: partData.partNumbers, + unique_identifier: file.meta.unique_identifier, + }, + }) + .then((data) => { + if (file.preparePartsRetryAttempts) { + delete file.preparePartsRetryAttempts; + self._consoleDebug( + `[uppy] Retrying batch fetch for ${file.id} was successful, continuing.` + ); + } + return { presignedUrls: data.presigned_urls }; }) - .then((data) => { - return { presignedUrls: data.presigned_urls }; - }) - // uppy is inconsistent, an error here does not fire the upload-error event - .catch((err) => { + .catch((err) => { + const status = err.jqXHR.status; + + // it is kind of ugly to have to track the retry attempts for + // the file based on the retry delays, but uppy's `retryable` + // function expects the rejected Promise data to be structured + // _just so_, and provides no interface for us to tell how many + // times the upload has been retried (which it tracks internally) + // + // if we exceed the attempts then there is no way that uppy will + // retry the upload once again, so in that case the alert can + // be safely shown to the user that their upload has failed. + if (file.preparePartsRetryAttempts < retryDelays.length) { + file.preparePartsRetryAttempts += 1; + const attemptsLeft = + retryDelays.length - file.preparePartsRetryAttempts + 1; + self._consoleDebug( + `[uppy] Fetching a batch of upload part URLs for ${file.id} failed with status ${status}, retrying ${attemptsLeft} more times...` + ); + return Promise.reject({ source: { status } }); + } else { + self._consoleDebug( + `[uppy] Fetching a batch of upload part URLs for ${file.id} failed too many times, throwing error.` + ); + // uppy is inconsistent, an error here does not fire the upload-error event self._handleUploadError(file, err); - }) - ); + } + }); }, completeMultipartUpload(file, data) { diff --git a/app/assets/javascripts/discourse/package.json b/app/assets/javascripts/discourse/package.json index b1c930fce94..0f3ee57c4ad 100644 --- a/app/assets/javascripts/discourse/package.json +++ b/app/assets/javascripts/discourse/package.json @@ -21,11 +21,11 @@ "@ember/test-helpers": "^2.2.0", "@glimmer/component": "^1.0.0", "@popperjs/core": "2.9.3", - "@uppy/aws-s3": "^2.0.2", - "@uppy/aws-s3-multipart": "^2.0.2", - "@uppy/core": "^2.0.1", - "@uppy/drop-target": "^1.0.1", - "@uppy/xhr-upload": "^2.0.1", + "@uppy/aws-s3": "^2.0.4", + "@uppy/aws-s3-multipart": "^2.1.0", + "@uppy/core": "^2.1.0", + "@uppy/drop-target": "^1.1.0", + "@uppy/xhr-upload": "^2.0.4", "admin": "^1.0.0", "bent": "^7.3.12", "broccoli-asset-rev": "^3.0.0", diff --git a/app/assets/javascripts/yarn.lock b/app/assets/javascripts/yarn.lock index 72ebb0d7adb..00dcf529209 100644 --- a/app/assets/javascripts/yarn.lock +++ b/app/assets/javascripts/yarn.lock @@ -1387,81 +1387,72 @@ resolved "https://registry.yarnpkg.com/@types/symlink-or-copy/-/symlink-or-copy-1.2.0.tgz#4151a81b4052c80bc2becbae09f3a9ec010a9c7a" integrity sha512-Lja2xYuuf2B3knEsga8ShbOdsfNOtzT73GyJmZyY7eGl2+ajOqrs8yM5ze0fsSoYwvA6bw7/Qr7OZ7PEEmYwWg== -"@uppy/aws-s3-multipart@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@uppy/aws-s3-multipart/-/aws-s3-multipart-2.0.2.tgz#b12f0938fad61532f20a9aa1aa017a484d310c83" - integrity sha512-+PaYGP8/XbMnWAEEAcdh9AF1TzXXazHdHDJf+QEN2eH7UBEDpieY2P7c4t/yhZXY25ifOQjKryGt8inoAaHJDA== +"@uppy/aws-s3-multipart@^2.1.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@uppy/aws-s3-multipart/-/aws-s3-multipart-2.1.1.tgz#7749491067ab72249dab201cc12409e57f2dbb1a" + integrity sha512-p+oFSCWEUc7ptv73sdZuWoq10hh0vzmP4cxwBEX/+nrplLFSuRUJ+z2XnNEigo8jXHWbA86k6tEX/3XIUsslgg== dependencies: - "@uppy/companion-client" "^2.0.0" - "@uppy/utils" "^4.0.0" + "@uppy/companion-client" "^2.0.3" + "@uppy/utils" "^4.0.3" -"@uppy/aws-s3@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@uppy/aws-s3/-/aws-s3-2.0.2.tgz#6bd4e17bf3984bf7f8633264c3669a454d9853d5" - integrity sha512-Nxp0nFGTVYgNIVN4bHdWHx+1nEkdCdFeYGw3KltIGPhzN4RRMAvrsCB3Mk4AAWL4KSVKs4BgkNfYNVt3nRJVqg== +"@uppy/aws-s3@^2.0.4": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@uppy/aws-s3/-/aws-s3-2.0.5.tgz#dae2edb819b8e79119304a1659b931a862bf1e45" + integrity sha512-VWqVtmKtV/wSLCZdFbWlUt+CS7W/KZv20Pmm3JgcDLrQk3PdciYg3L9x65FTP8kSDsiXCwMg7uO5HfbspZWx9Q== dependencies: - "@uppy/companion-client" "^2.0.0" - "@uppy/utils" "^4.0.0" - "@uppy/xhr-upload" "^2.0.2" + "@uppy/companion-client" "^2.0.3" + "@uppy/utils" "^4.0.3" + "@uppy/xhr-upload" "^2.0.5" nanoid "^3.1.25" -"@uppy/companion-client@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@uppy/companion-client/-/companion-client-2.0.0.tgz#60980d949d1ed15fe88bc8358171a938289b917c" - integrity sha512-TH/uw6aVeDKHcoepM9QAbSMMoi4MqUEG+loOEDwkB0CPkJGRYLqwvpnaO9pnELE7k1ZHfGGvRw0lxbkq5olGAg== +"@uppy/companion-client@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@uppy/companion-client/-/companion-client-2.0.3.tgz#d3cd30ebbc9f87d27374d13258b5d304366f10d5" + integrity sha512-I1baKKBpb3d//q3agRtNV3UD/sA7EecFOfoVSpMlPkFu6oQqxjSC5OFXTf3fa8X+wo4Lcutv1++3igPJ1zrgbA== dependencies: - "@uppy/utils" "^4.0.0" + "@uppy/utils" "^4.0.3" namespace-emitter "^2.0.1" -"@uppy/core@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@uppy/core/-/core-2.0.1.tgz#e9686ce3e5560593d249c455a9b3c542509e2289" - integrity sha512-MdSvc3ngVebfSBHYLKzFFSUxAatSqH/vYP6v4R3uU/zFaZ0cW9A/Xm52S6rGLKf1d5ZNOvZjesdkre6d61m2Eg== +"@uppy/core@^2.1.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@uppy/core/-/core-2.1.1.tgz#503b3172ffe32e6cc7385f5b0c99f008ade815f1" + integrity sha512-dFlcy6+05zwsJk1KNeUKVWUyAfhOVwNpnPLaR1NX9Qsjv7KlYfUNRVW3uCCmIpd/EZsX44+haiqGrhLcYDAcxA== dependencies: "@transloadit/prettier-bytes" "0.0.7" - "@uppy/store-default" "^2.0.0" - "@uppy/utils" "^4.0.0" + "@uppy/store-default" "^2.0.2" + "@uppy/utils" "^4.0.3" lodash.throttle "^4.1.1" mime-match "^1.0.2" namespace-emitter "^2.0.1" nanoid "^3.1.25" preact "^10.5.13" -"@uppy/drop-target@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@uppy/drop-target/-/drop-target-1.0.1.tgz#9126fc52c1f36b30a3dff91219c7a0a45865bd2d" - integrity sha512-BAX/T9p6qySmty8i3MglPi3Ica722RctY2BE9PwhwvQ5konyH4WlhH/jDAaGzzVZE9plc2sfoLntzH1yZoajEA== +"@uppy/drop-target@^1.1.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@uppy/drop-target/-/drop-target-1.1.1.tgz#9bfbcb7b284ef605d01fc24823f857cbad51377a" + integrity sha512-2MxNGEkI2vt1D6MEa0PNqR+VTMbuUzmiytHyy57phZNCNes8K4BdnneBwla2nG3LI0D1TURK7MKxaSjv93d3Vg== dependencies: - "@uppy/utils" "^4.0.0" + "@uppy/utils" "^4.0.3" -"@uppy/store-default@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@uppy/store-default/-/store-default-2.0.0.tgz#c446a89d07a6df7f980a15eeb880d169baa14d7f" - integrity sha512-5HXTR2Qn20rpPUCUFBuNBfYDIa20oyUV14+FAnklgv2P32/zIyk79eFYloDRg8H7mOosVpovlysfDkI4iJh8Ag== +"@uppy/store-default@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@uppy/store-default/-/store-default-2.0.2.tgz#c0464e92452fdc7d4cd1548d2c7453017cad7a98" + integrity sha512-D9oz08EYBoc4fDotvaevd2Q7uVldS61HYFOXK20b5M/xXF/uxepapaqQnMu1DfCVsA77rhp7DMemxnWc9y8xTQ== -"@uppy/utils@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@uppy/utils/-/utils-4.0.0.tgz#337ffe668843a393171c8e9ff885d70af3a57417" - integrity sha512-sQOIM0cZOuV63l8JxgpRxAJiD/sJChKdEb1c5clRoxs4oafgtD9pl/BcBrOarMwk3r7kVZHt2apOL3V4BvD2Zw== +"@uppy/utils@^4.0.3": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@uppy/utils/-/utils-4.0.3.tgz#181fdd161e1450d31af0cf7bc97946a99196a8fe" + integrity sha512-LApneC8lNvTonzSJFupxzuEvKhwp/Klc1otq8t+zXpdgjLVVSuW/rJBFfdIDrmDoqSzVLQKYjMy07CmhDAWfKg== dependencies: lodash.throttle "^4.1.1" -"@uppy/xhr-upload@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@uppy/xhr-upload/-/xhr-upload-2.0.1.tgz#751f00c30bd00004aa38d0e0eda653dee0e42206" - integrity sha512-7LMZL1+MdpUT1v3+JTs23Zhw+vZ1XL0a3r6cH0+1/JeN4Kx0AnSUouXF2tamdA5OOZpSqseY4lfFO3pJqCXOOA== +"@uppy/xhr-upload@^2.0.4", "@uppy/xhr-upload@^2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@uppy/xhr-upload/-/xhr-upload-2.0.5.tgz#5792a7ff0bfb1503c8a9cccefb48ddb40deb11de" + integrity sha512-DkD6cRKrcI4oDmCimHAULb6rruyUt6SbH4/omhpvWILbG/mWV5vA39YLvYxCZ1FZbijJ4QkVTKEeOTLcmoljPg== dependencies: - "@uppy/companion-client" "^2.0.0" - "@uppy/utils" "^4.0.0" - nanoid "^3.1.25" - -"@uppy/xhr-upload@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@uppy/xhr-upload/-/xhr-upload-2.0.2.tgz#dc61332fc6bf53fcc79892ec41330ac475bdfba6" - integrity sha512-yb/yCUquX0m96jABMEpUQGnxBqjtB5b3u9l8pY+wi3N7SEuDk1u2PPakkbzI6xcguW1e9Peb+Q2LYK6wWaPIxQ== - dependencies: - "@uppy/companion-client" "^2.0.0" - "@uppy/utils" "^4.0.0" + "@uppy/companion-client" "^2.0.3" + "@uppy/utils" "^4.0.3" nanoid "^3.1.25" "@webassemblyjs/ast@1.9.0": diff --git a/package.json b/package.json index 158e1168f87..b2b05c8dc1b 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,11 @@ "@highlightjs/cdn-assets": "^10.6.0", "@json-editor/json-editor": "^2.5.2", "@popperjs/core": "v2.9.3", - "@uppy/aws-s3": "^2.0.2", - "@uppy/aws-s3-multipart": "^2.0.2", - "@uppy/core": "^2.0.1", - "@uppy/drop-target": "^1.0.1", - "@uppy/xhr-upload": "^2.0.1", + "@uppy/aws-s3": "^2.0.4", + "@uppy/aws-s3-multipart": "^2.1.0", + "@uppy/core": "^2.1.0", + "@uppy/drop-target": "^1.1.0", + "@uppy/xhr-upload": "^2.0.4", "ace-builds": "1.4.12", "blueimp-file-upload": "10.13.0", "bootbox": "3.2.0", diff --git a/vendor/assets/javascripts/uppy.js b/vendor/assets/javascripts/uppy.js index 932d36b1079..7545f505ad1 100644 --- a/vendor/assets/javascripts/uppy.js +++ b/vendor/assets/javascripts/uppy.js @@ -217,11 +217,8 @@ class MultipartUploader { this.isPaused = true; } - abort(opts = {}) { - const really = opts.really || false; - if (!really) return this.pause(); - - _classPrivateFieldLooseBase(this, _abortUpload)[_abortUpload](); + abort(opts = undefined) { + if (opts != null && opts.really) _classPrivateFieldLooseBase(this, _abortUpload)[_abortUpload]();else this.pause(); } } @@ -411,14 +408,15 @@ function _retryable2({ async function _prepareUploadParts2(candidates) { this.lockedCandidatesForBatch.push(...candidates); - const result = await this.options.prepareUploadParts({ - key: this.key, - uploadId: this.uploadId, - partNumbers: candidates.map(index => index + 1) + const result = await _classPrivateFieldLooseBase(this, _retryable)[_retryable]({ + attempt: () => this.options.prepareUploadParts({ + key: this.key, + uploadId: this.uploadId, + partNumbers: candidates.map(index => index + 1) + }) }); - const valid = typeof (result == null ? void 0 : result.presignedUrls) === 'object'; - if (!valid) { + if (typeof (result == null ? void 0 : result.presignedUrls) !== 'object') { throw new TypeError('AwsS3/Multipart: Got incorrect result from `prepareUploadParts()`, expected an object `{ presignedUrls }`.'); } @@ -499,6 +497,7 @@ function _uploadPartBytes2(index, url, headers) { xhr.responseType = 'text'; function cleanup() { + // eslint-disable-next-line no-use-before-define signal.removeEventListener('abort', onabort); } @@ -526,7 +525,10 @@ function _uploadPartBytes2(index, url, headers) { error.source = ev.target; defer.reject(error); return; - } + } // This avoids the net::ERR_OUT_OF_MEMORY in Chromium Browsers. + + + this.chunks[index] = null; _classPrivateFieldLooseBase(this, _onPartProgress)[_onPartProgress](index, body.size, body.size); // NOTE This must be allowed by CORS. @@ -589,14 +591,12 @@ function _onError2(err) { } module.exports = MultipartUploader; -},{"@uppy/utils/lib/AbortController":22,"@uppy/utils/lib/delay":28}],3:[function(require,module,exports){ +},{"@uppy/utils/lib/AbortController":23,"@uppy/utils/lib/delay":29}],3:[function(require,module,exports){ "use strict"; var _class, _temp; -const { - BasePlugin -} = require('@uppy/core'); +const BasePlugin = require('@uppy/core/lib/BasePlugin'); const { Socket, @@ -1103,8 +1103,8 @@ module.exports = (_temp = _class = class AwsS3Multipart extends BasePlugin { this.uppy.removeUploader(this.upload); } -}, _class.VERSION = "2.0.2", _temp); -},{"./MultipartUploader":2,"@uppy/companion-client":12,"@uppy/core":17,"@uppy/utils/lib/EventTracker":23,"@uppy/utils/lib/RateLimitedQueue":26,"@uppy/utils/lib/emitSocketProgress":29,"@uppy/utils/lib/getSocketHost":40}],4:[function(require,module,exports){ +}, _class.VERSION = "2.1.1", _temp); +},{"./MultipartUploader":2,"@uppy/companion-client":12,"@uppy/core/lib/BasePlugin":14,"@uppy/utils/lib/EventTracker":24,"@uppy/utils/lib/RateLimitedQueue":27,"@uppy/utils/lib/emitSocketProgress":30,"@uppy/utils/lib/getSocketHost":41}],4:[function(require,module,exports){ "use strict"; var _getOptions, _addEventHandlerForFile, _addEventHandlerIfFileStillExists, _uploadLocalFile, _uploadRemoteFile; @@ -1347,9 +1347,10 @@ function _uploadLocalFile2(file, current, total) { return reject(error); }); xhr.open(opts.method.toUpperCase(), opts.endpoint, true); // IE10 does not allow setting `withCredentials` and `responseType` - // before `open()` is called. + // before `open()` is called. It’s important to set withCredentials + // to a boolean, otherwise React Native crashes - xhr.withCredentials = opts.withCredentials; + xhr.withCredentials = Boolean(opts.withCredentials); if (opts.responseType !== '') { xhr.responseType = opts.responseType; @@ -1480,7 +1481,7 @@ function _uploadRemoteFile2(file) { return Promise.reject(err); })); } -},{"@uppy/companion-client":12,"@uppy/utils/lib/EventTracker":23,"@uppy/utils/lib/NetworkError":24,"@uppy/utils/lib/ProgressTimeout":25,"@uppy/utils/lib/RateLimitedQueue":26,"@uppy/utils/lib/emitSocketProgress":29,"@uppy/utils/lib/getSocketHost":40,"@uppy/utils/lib/isNetworkError":44,"nanoid":52}],5:[function(require,module,exports){ +},{"@uppy/companion-client":12,"@uppy/utils/lib/EventTracker":24,"@uppy/utils/lib/NetworkError":25,"@uppy/utils/lib/ProgressTimeout":26,"@uppy/utils/lib/RateLimitedQueue":27,"@uppy/utils/lib/emitSocketProgress":30,"@uppy/utils/lib/getSocketHost":41,"@uppy/utils/lib/isNetworkError":45,"nanoid":53}],5:[function(require,module,exports){ "use strict"; var _class, _client, _requests, _uploader, _handleUpload, _temp; @@ -1517,9 +1518,7 @@ function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + n * This isn't as nicely modular as we'd like and requires us to maintain two copies of * the XHRUpload code, but at least it's not horrifically broken :) */ -const { - BasePlugin -} = require('@uppy/core'); +const BasePlugin = require('@uppy/core/lib/BasePlugin'); const { RateLimitedQueue, @@ -1796,8 +1795,8 @@ module.exports = (_temp = (_client = /*#__PURE__*/_classPrivateFieldLooseKey("cl this.uppy.removeUploader(_classPrivateFieldLooseBase(this, _handleUpload)[_handleUpload]); } -}), _class.VERSION = "2.0.2", _temp); -},{"./MiniXHRUpload":4,"./isXml":6,"@uppy/companion-client":12,"@uppy/core":17,"@uppy/utils/lib/RateLimitedQueue":26,"@uppy/utils/lib/settle":46}],6:[function(require,module,exports){ +}), _class.VERSION = "2.0.5", _temp); +},{"./MiniXHRUpload":4,"./isXml":6,"@uppy/companion-client":12,"@uppy/core/lib/BasePlugin":14,"@uppy/utils/lib/RateLimitedQueue":27,"@uppy/utils/lib/settle":47}],6:[function(require,module,exports){ "use strict"; /** @@ -2141,7 +2140,7 @@ module.exports = (_temp = (_getPostResponseFunc = /*#__PURE__*/_classPrivateFiel })).then(_classPrivateFieldLooseBase(this, _getPostResponseFunc)[_getPostResponseFunc](skipPostResponse)).then(handleJSONResponse).catch(_classPrivateFieldLooseBase(this, _errorHandler)[_errorHandler](method, path)); } -}), _class.VERSION = "2.0.0", _class.defaultHeaders = { +}), _class.VERSION = "2.0.3", _class.defaultHeaders = { Accept: 'application/json', 'Content-Type': 'application/json', 'Uppy-Versions': `@uppy/companion-client=${_class.VERSION}` @@ -2168,7 +2167,7 @@ function _errorHandler2(method, path) { return Promise.reject(err); }; } -},{"./AuthError":7,"@uppy/utils/lib/fetchWithNetworkError":30}],10:[function(require,module,exports){ +},{"./AuthError":7,"@uppy/utils/lib/fetchWithNetworkError":31}],10:[function(require,module,exports){ 'use strict'; const RequestClient = require('./RequestClient'); @@ -2316,7 +2315,7 @@ module.exports = (_queued = /*#__PURE__*/_classPrivateFieldLooseKey("queued"), _ } }); -},{"namespace-emitter":51}],12:[function(require,module,exports){ +},{"namespace-emitter":52}],12:[function(require,module,exports){ 'use strict'; /** * Manages communications with Companion @@ -2451,7 +2450,7 @@ module.exports = class BasePlugin { afterUpdate() {} }; -},{"@uppy/utils/lib/Translator":27}],15:[function(require,module,exports){ +},{"@uppy/utils/lib/Translator":28}],15:[function(require,module,exports){ "use strict"; function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; } @@ -2618,22 +2617,9 @@ class UIPlugin extends BasePlugin { } module.exports = UIPlugin; -},{"./BasePlugin":14,"@uppy/utils/lib/findDOMElement":31,"preact":54}],16:[function(require,module,exports){ -"use strict"; - -module.exports = function getFileName(fileType, fileDescriptor) { - if (fileDescriptor.name) { - return fileDescriptor.name; - } - - if (fileType.split('/')[0] === 'image') { - return `${fileType.split('/')[0]}.${fileType.split('/')[1]}`; - } - - return 'noname'; -}; -},{}],17:[function(require,module,exports){ -"use strict"; +},{"./BasePlugin":14,"@uppy/utils/lib/findDOMElement":32,"preact":55}],16:[function(require,module,exports){ +/* global AggregateError */ +'use strict'; let _Symbol$for, _Symbol$for2; @@ -2643,7 +2629,6 @@ var id = 0; function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + name; } -/* global AggregateError */ const Translator = require('@uppy/utils/lib/Translator'); const ee = require('namespace-emitter'); @@ -2673,11 +2658,7 @@ const getFileName = require('./getFileName'); const { justErrorsLogger, debugLogger -} = require('./loggers'); - -const UIPlugin = require('./UIPlugin'); - -const BasePlugin = require('./BasePlugin'); // Exported from here. +} = require('./loggers'); // Exported from here. class RestrictionError extends Error { @@ -2851,6 +2832,7 @@ class Uppy { noMoreFilesAllowed: 'Cannot add more files', noDuplicates: 'Cannot add the duplicate file \'%{fileName}\', it already exists', companionError: 'Connection with Companion failed', + authAborted: 'Authentication aborted', companionUnauthorizeHint: 'To unauthorize to your %{provider} account, please go to %{url}', failedToUpload: 'Failed to upload %{file}', noInternetConnection: 'No Internet connection', @@ -2870,6 +2852,7 @@ class Uppy { loading: 'Loading...', authenticateWithTitle: 'Please authenticate with %{pluginName} to select files', authenticateWith: 'Connect to %{pluginName}', + signInWithGoogle: 'Sign in with Google', searchImages: 'Search for images', enterTextToSearch: 'Enter text to search for images', backToSearch: 'Back to Search', @@ -4016,8 +3999,7 @@ class Uppy { }); } -} // Expose class constructor. - +} function _checkRestrictions2(file, files = this.getFiles()) { const { @@ -4116,10 +4098,9 @@ function _checkRequiredMetaFields2(files) { hasOwnProperty } = Object.prototype; const errors = []; - const fileIDs = Object.keys(files); - for (let i = 0; i < fileIDs.length; i++) { - const file = this.getFile(fileIDs[i]); + 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]] === '') { @@ -4494,27 +4475,21 @@ function _removeUpload2(uploadID) { }); } -function _runUpload2(uploadID) { - const uploadData = this.getState().currentUploads[uploadID]; - const restoreStep = uploadData.step; +async function _runUpload2(uploadID) { + let { + currentUploads + } = this.getState(); + let currentUpload = currentUploads[uploadID]; + const restoreStep = currentUpload.step || 0; const steps = [..._classPrivateFieldLooseBase(this, _preProcessors)[_preProcessors], ..._classPrivateFieldLooseBase(this, _uploaders)[_uploaders], ..._classPrivateFieldLooseBase(this, _postProcessors)[_postProcessors]]; - let lastStep = Promise.resolve(); - steps.forEach((fn, step) => { - // Skip this step if we are restoring and have already completed this step before. - if (step < restoreStep) { - return; - } - - lastStep = lastStep.then(() => { - const { - currentUploads - } = this.getState(); - const currentUpload = currentUploads[uploadID]; + try { + for (let step = restoreStep; step < steps.length; step++) { if (!currentUpload) { - return; + break; } + const fn = steps[step]; const updatedUpload = { ...currentUpload, step }; @@ -4525,26 +4500,22 @@ function _runUpload2(uploadID) { }); // TODO give this the `updatedUpload` object as its only parameter maybe? // Otherwise when more metadata may be added to the upload this would keep getting more parameters - return fn(updatedUpload.fileIDs, uploadID); // eslint-disable-line consistent-return - }).then(() => null); - }); // Not returning the `catch`ed promise, because we still want to return a rejected - // promise from this method if the upload failed. + await fn(updatedUpload.fileIDs, uploadID); // Update currentUpload value in case it was modified asynchronously. - lastStep.catch(err => { + currentUploads = this.getState().currentUploads; + currentUpload = currentUploads[uploadID]; + } + } catch (err) { this.emit('error', err); _classPrivateFieldLooseBase(this, _removeUpload)[_removeUpload](uploadID); - }); - return lastStep.then(() => { - // Set result data. - const { - currentUploads - } = this.getState(); - const currentUpload = currentUploads[uploadID]; - if (!currentUpload) { - return; - } // Mark postprocessing step as complete if necessary; this addresses a case where we might get + throw err; + } // Set result data. + + + if (currentUpload) { + // Mark postprocessing step as complete if necessary; this addresses a case where we might get // stuck in the postprocessing UI while the upload is fully complete. // If the postprocessing steps do not do any work, they may not emit postprocessing events at // all, and never mark the postprocessing as complete. This is fine on its own but we @@ -4554,8 +4525,6 @@ function _runUpload2(uploadID) { // // So, just in case an upload with postprocessing plugins *has* completed *without* emitting // postprocessing completion, we do it instead. - - currentUpload.fileIDs.forEach(fileID => { const file = this.getFile(fileID); @@ -4566,50 +4535,71 @@ function _runUpload2(uploadID) { const files = currentUpload.fileIDs.map(fileID => this.getFile(fileID)); const successful = files.filter(file => !file.error); const failed = files.filter(file => file.error); - this.addResultData(uploadID, { + await this.addResultData(uploadID, { successful, failed, uploadID - }); - }).then(() => { - // Emit completion events. - // This is in a separate function so that the `currentUploads` variable - // 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(); + }); // Update currentUpload value in case it was modified asynchronously. - if (!currentUploads[uploadID]) { - return; - } + currentUploads = this.getState().currentUploads; + currentUpload = currentUploads[uploadID]; + } // Emit completion events. + // This is in a separate function so that the `currentUploads` variable + // always refers to the latest state. In the handler right above it refers + // to an outdated object without the `.result` property. - const currentUpload = currentUploads[uploadID]; - const { - result - } = currentUpload; + + let result; + + if (currentUpload) { + result = currentUpload.result; this.emit('complete', result); - _classPrivateFieldLooseBase(this, _removeUpload)[_removeUpload](uploadID); // eslint-disable-next-line consistent-return + _classPrivateFieldLooseBase(this, _removeUpload)[_removeUpload](uploadID); + } + if (result == null) { + this.log(`Not setting result for an upload that has been removed: ${uploadID}`); + } - return result; - }).then(result => { - if (result == null) { - this.log(`Not setting result for an upload that has been removed: ${uploadID}`); - } - - return result; - }); + return result; } -Uppy.VERSION = "2.0.1"; +Uppy.VERSION = "2.1.1"; +module.exports = Uppy; +},{"./getFileName":17,"./loggers":19,"./supportsUploadProgress":20,"@transloadit/prettier-bytes":1,"@uppy/store-default":22,"@uppy/utils/lib/Translator":28,"@uppy/utils/lib/generateFileID":33,"@uppy/utils/lib/getFileNameAndExtension":39,"@uppy/utils/lib/getFileType":40,"lodash.throttle":50,"mime-match":51,"namespace-emitter":52,"nanoid":53}],17:[function(require,module,exports){ +"use strict"; + +module.exports = function getFileName(fileType, fileDescriptor) { + if (fileDescriptor.name) { + return fileDescriptor.name; + } + + if (fileType.split('/')[0] === 'image') { + return `${fileType.split('/')[0]}.${fileType.split('/')[1]}`; + } + + return 'noname'; +}; +},{}],18:[function(require,module,exports){ +'use strict'; + +const Uppy = require('./Uppy'); + +const UIPlugin = require('./UIPlugin'); + +const BasePlugin = require('./BasePlugin'); + +const { + debugLogger +} = require('./loggers'); + module.exports = Uppy; module.exports.Uppy = Uppy; module.exports.UIPlugin = UIPlugin; module.exports.BasePlugin = BasePlugin; module.exports.debugLogger = debugLogger; -},{"./BasePlugin":14,"./UIPlugin":15,"./getFileName":16,"./loggers":18,"./supportsUploadProgress":19,"@transloadit/prettier-bytes":1,"@uppy/store-default":21,"@uppy/utils/lib/Translator":27,"@uppy/utils/lib/generateFileID":32,"@uppy/utils/lib/getFileNameAndExtension":38,"@uppy/utils/lib/getFileType":39,"lodash.throttle":49,"mime-match":50,"namespace-emitter":51,"nanoid":52}],18:[function(require,module,exports){ +},{"./BasePlugin":14,"./UIPlugin":15,"./Uppy":16,"./loggers":19}],19:[function(require,module,exports){ "use strict"; /* eslint-disable no-console */ @@ -4633,7 +4623,7 @@ module.exports = { justErrorsLogger, debugLogger }; -},{"@uppy/utils/lib/getTimeStamp":41}],19:[function(require,module,exports){ +},{"@uppy/utils/lib/getTimeStamp":42}],20:[function(require,module,exports){ "use strict"; // Edge 15.x does not fire 'progress' events on uploads. @@ -4669,14 +4659,12 @@ module.exports = function supportsUploadProgress(userAgent) { return false; }; -},{}],20:[function(require,module,exports){ +},{}],21:[function(require,module,exports){ "use strict"; var _class, _temp; -const { - BasePlugin -} = require('@uppy/core'); +const BasePlugin = require('@uppy/core/lib/BasePlugin'); const getDroppedFiles = require('@uppy/utils/lib/getDroppedFiles'); @@ -4711,7 +4699,9 @@ module.exports = (_temp = _class = class DropTarget extends BasePlugin { } }; - this.handleDrop = event => { + this.handleDrop = async event => { + var _this$opts$onDrop, _this$opts; + event.preventDefault(); event.stopPropagation(); clearTimeout(this.removeDragOverClassTimeout); // 2. Remove dragover class @@ -4727,12 +4717,16 @@ module.exports = (_temp = _class = class DropTarget extends BasePlugin { this.uppy.log(error, 'error'); }; - getDroppedFiles(event.dataTransfer, { + const files = await getDroppedFiles(event.dataTransfer, { logDropError - }).then(files => this.addFiles(files)); + }); + this.addFiles(files); + (_this$opts$onDrop = (_this$opts = this.opts).onDrop) == null ? void 0 : _this$opts$onDrop.call(_this$opts, event); }; this.handleDragOver = event => { + var _this$opts$onDragOver, _this$opts2; + event.preventDefault(); event.stopPropagation(); // 1. Add a small (+) icon on drop // (and prevent browsers from interpreting this as files being _moved_ into the browser, @@ -4744,9 +4738,12 @@ module.exports = (_temp = _class = class DropTarget extends BasePlugin { this.setPluginState({ isDraggingOver: true }); + (_this$opts$onDragOver = (_this$opts2 = this.opts).onDragOver) == null ? void 0 : _this$opts$onDragOver.call(_this$opts2, event); }; this.handleDragLeave = event => { + var _this$opts$onDragLeav, _this$opts3; + event.preventDefault(); event.stopPropagation(); const { @@ -4761,6 +4758,7 @@ module.exports = (_temp = _class = class DropTarget extends BasePlugin { isDraggingOver: false }); }, 50); + (_this$opts$onDragLeav = (_this$opts3 = this.opts).onDragLeave) == null ? void 0 : _this$opts$onDragLeav.call(_this$opts3, event); }; this.addListeners = () => { @@ -4820,8 +4818,8 @@ module.exports = (_temp = _class = class DropTarget extends BasePlugin { this.removeListeners(); } -}, _class.VERSION = "1.0.1", _temp); -},{"@uppy/core":17,"@uppy/utils/lib/getDroppedFiles":33,"@uppy/utils/lib/toArray":47}],21:[function(require,module,exports){ +}, _class.VERSION = "1.1.1", _temp); +},{"@uppy/core/lib/BasePlugin":14,"@uppy/utils/lib/getDroppedFiles":34,"@uppy/utils/lib/toArray":48}],22:[function(require,module,exports){ "use strict"; function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; } @@ -4875,22 +4873,22 @@ function _publish2(...args) { }); } -DefaultStore.VERSION = "2.0.0"; +DefaultStore.VERSION = "2.0.2"; module.exports = function defaultStore() { return new DefaultStore(); }; -},{}],22:[function(require,module,exports){ +},{}],23:[function(require,module,exports){ "use strict"; /** * Little AbortController proxy module so we can swap out the implementation easily later. */ -exports.AbortController = AbortController; -exports.AbortSignal = AbortSignal; +exports.AbortController = globalThis.AbortController; +exports.AbortSignal = globalThis.AbortSignal; exports.createAbortError = (message = 'Aborted') => new DOMException(message, 'AbortError'); -},{}],23:[function(require,module,exports){ +},{}],24:[function(require,module,exports){ "use strict"; var _emitter, _events; @@ -4931,7 +4929,7 @@ module.exports = (_emitter = /*#__PURE__*/_classPrivateFieldLooseKey("emitter"), } }); -},{}],24:[function(require,module,exports){ +},{}],25:[function(require,module,exports){ "use strict"; class NetworkError extends Error { @@ -4945,7 +4943,7 @@ class NetworkError extends Error { } module.exports = NetworkError; -},{}],25:[function(require,module,exports){ +},{}],26:[function(require,module,exports){ "use strict"; function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; } @@ -5013,7 +5011,7 @@ class ProgressTimeout { } module.exports = ProgressTimeout; -},{}],26:[function(require,module,exports){ +},{}],27:[function(require,module,exports){ "use strict"; function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; } @@ -5221,7 +5219,7 @@ module.exports = { RateLimitedQueue, internalRateLimitedQueue: Symbol('__queue') }; -},{}],27:[function(require,module,exports){ +},{}],28:[function(require,module,exports){ "use strict"; var _apply; @@ -5392,7 +5390,7 @@ function _apply2(locale) { }; this.locale.pluralize = locale.pluralize || prevLocale.pluralize; } -},{"./hasProperty":42}],28:[function(require,module,exports){ +},{"./hasProperty":43}],29:[function(require,module,exports){ "use strict"; const { @@ -5439,7 +5437,7 @@ module.exports = function delay(ms, opts) { return undefined; }); }; -},{"./AbortController":22}],29:[function(require,module,exports){ +},{"./AbortController":23}],30:[function(require,module,exports){ "use strict"; const throttle = require('lodash.throttle'); @@ -5465,7 +5463,7 @@ module.exports = throttle(emitSocketProgress, 300, { leading: true, trailing: true }); -},{"lodash.throttle":49}],30:[function(require,module,exports){ +},{"lodash.throttle":50}],31:[function(require,module,exports){ "use strict"; const NetworkError = require('./NetworkError'); @@ -5483,7 +5481,7 @@ module.exports = function fetchWithNetworkError(...options) { } }); }; -},{"./NetworkError":24}],31:[function(require,module,exports){ +},{"./NetworkError":25}],32:[function(require,module,exports){ "use strict"; const isDOMElement = require('./isDOMElement'); @@ -5506,7 +5504,7 @@ module.exports = function findDOMElement(element, context = document) { return null; }; -},{"./isDOMElement":43}],32:[function(require,module,exports){ +},{"./isDOMElement":44}],33:[function(require,module,exports){ "use strict"; function encodeCharacter(character) { @@ -5556,7 +5554,7 @@ module.exports = function generateFileID(file) { return id; }; -},{}],33:[function(require,module,exports){ +},{}],34:[function(require,module,exports){ "use strict"; const webkitGetAsEntryApi = require('./utils/webkitGetAsEntryApi/index'); @@ -5590,7 +5588,7 @@ module.exports = function getDroppedFiles(dataTransfer, { return fallbackApi(dataTransfer); }; -},{"./utils/fallbackApi":34,"./utils/webkitGetAsEntryApi/index":37}],34:[function(require,module,exports){ +},{"./utils/fallbackApi":35,"./utils/webkitGetAsEntryApi/index":38}],35:[function(require,module,exports){ "use strict"; const toArray = require('../../toArray'); // .files fallback, should be implemented in any browser @@ -5600,7 +5598,7 @@ module.exports = function fallbackApi(dataTransfer) { const files = toArray(dataTransfer.files); return Promise.resolve(files); }; -},{"../../toArray":47}],35:[function(require,module,exports){ +},{"../../toArray":48}],36:[function(require,module,exports){ "use strict"; /** @@ -5633,7 +5631,7 @@ module.exports = function getFilesAndDirectoriesFromDirectory(directoryReader, o onSuccess(oldEntries); }); }; -},{}],36:[function(require,module,exports){ +},{}],37:[function(require,module,exports){ "use strict"; /** @@ -5654,7 +5652,7 @@ module.exports = function getRelativePath(fileEntry) { return fileEntry.fullPath; }; -},{}],37:[function(require,module,exports){ +},{}],38:[function(require,module,exports){ "use strict"; const toArray = require('../../../toArray'); @@ -5705,7 +5703,7 @@ module.exports = function webkitGetAsEntryApi(dataTransfer, logDropError) { }); return Promise.all(rootPromises).then(() => files); }; -},{"../../../toArray":47,"./getFilesAndDirectoriesFromDirectory":35,"./getRelativePath":36}],38:[function(require,module,exports){ +},{"../../../toArray":48,"./getFilesAndDirectoriesFromDirectory":36,"./getRelativePath":37}],39:[function(require,module,exports){ "use strict"; /** @@ -5729,7 +5727,7 @@ module.exports = function getFileNameAndExtension(fullFileName) { extension: fullFileName.slice(lastDot + 1) }; }; -},{}],39:[function(require,module,exports){ +},{}],40:[function(require,module,exports){ "use strict"; const getFileNameAndExtension = require('./getFileNameAndExtension'); @@ -5750,7 +5748,7 @@ module.exports = function getFileType(file) { return 'application/octet-stream'; }; -},{"./getFileNameAndExtension":38,"./mimeTypes":45}],40:[function(require,module,exports){ +},{"./getFileNameAndExtension":39,"./mimeTypes":46}],41:[function(require,module,exports){ "use strict"; module.exports = function getSocketHost(url) { @@ -5760,7 +5758,7 @@ module.exports = function getSocketHost(url) { const socketProtocol = /^http:\/\//i.test(url) ? 'ws' : 'wss'; return `${socketProtocol}://${host}`; }; -},{}],41:[function(require,module,exports){ +},{}],42:[function(require,module,exports){ "use strict"; /** @@ -5784,13 +5782,13 @@ module.exports = function getTimeStamp() { const seconds = pad(date.getSeconds()); return `${hours}:${minutes}:${seconds}`; }; -},{}],42:[function(require,module,exports){ +},{}],43:[function(require,module,exports){ "use strict"; module.exports = function has(object, key) { return Object.prototype.hasOwnProperty.call(object, key); }; -},{}],43:[function(require,module,exports){ +},{}],44:[function(require,module,exports){ "use strict"; /** @@ -5801,7 +5799,7 @@ module.exports = function has(object, key) { module.exports = function isDOMElement(obj) { return (obj == null ? void 0 : obj.nodeType) === Node.ELEMENT_NODE; }; -},{}],44:[function(require,module,exports){ +},{}],45:[function(require,module,exports){ "use strict"; function isNetworkError(xhr) { @@ -5813,7 +5811,7 @@ function isNetworkError(xhr) { } module.exports = isNetworkError; -},{}],45:[function(require,module,exports){ +},{}],46:[function(require,module,exports){ "use strict"; // ___Why not add the mime-types package? @@ -5871,7 +5869,7 @@ module.exports = { gz: 'application/gzip', dmg: 'application/x-apple-diskimage' }; -},{}],46:[function(require,module,exports){ +},{}],47:[function(require,module,exports){ "use strict"; module.exports = function settle(promises) { @@ -5894,21 +5892,19 @@ module.exports = function settle(promises) { }; }); }; -},{}],47:[function(require,module,exports){ +},{}],48:[function(require,module,exports){ "use strict"; /** * Converts list into array */ module.exports = Array.from; -},{}],48:[function(require,module,exports){ +},{}],49:[function(require,module,exports){ "use strict"; var _class, _temp; -const { - BasePlugin -} = require('@uppy/core'); +const BasePlugin = require('@uppy/core/lib/BasePlugin'); const { nanoid @@ -6017,7 +6013,7 @@ module.exports = (_temp = _class = class XHRUpload extends BasePlugin { try { parsedResponse = JSON.parse(responseText); } catch (err) { - this.uppy.log(err); + uppy.log(err); } return parsedResponse; @@ -6051,6 +6047,7 @@ module.exports = (_temp = _class = class XHRUpload extends BasePlugin { this.opts = { ...defaultOptions, ...opts }; + this.i18nInit(); this.handleUpload = this.handleUpload.bind(this); // Simultaneous upload limiting is shared across all uploads with this plugin. if (internalRateLimitedQueue in this.opts) { @@ -6560,8 +6557,8 @@ module.exports = (_temp = _class = class XHRUpload extends BasePlugin { this.uppy.removeUploader(this.handleUpload); } -}, _class.VERSION = "2.0.1", _temp); -},{"@uppy/companion-client":12,"@uppy/core":17,"@uppy/utils/lib/EventTracker":23,"@uppy/utils/lib/NetworkError":24,"@uppy/utils/lib/ProgressTimeout":25,"@uppy/utils/lib/RateLimitedQueue":26,"@uppy/utils/lib/emitSocketProgress":29,"@uppy/utils/lib/getSocketHost":40,"@uppy/utils/lib/isNetworkError":44,"@uppy/utils/lib/settle":46,"nanoid":52}],49:[function(require,module,exports){ +}, _class.VERSION = "2.0.5", _temp); +},{"@uppy/companion-client":12,"@uppy/core/lib/BasePlugin":14,"@uppy/utils/lib/EventTracker":24,"@uppy/utils/lib/NetworkError":25,"@uppy/utils/lib/ProgressTimeout":26,"@uppy/utils/lib/RateLimitedQueue":27,"@uppy/utils/lib/emitSocketProgress":30,"@uppy/utils/lib/getSocketHost":41,"@uppy/utils/lib/isNetworkError":45,"@uppy/utils/lib/settle":47,"nanoid":53}],50:[function(require,module,exports){ (function (global){(function (){ /** * lodash (Custom Build) @@ -7004,7 +7001,7 @@ function toNumber(value) { module.exports = throttle; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],50:[function(require,module,exports){ +},{}],51:[function(require,module,exports){ var wildcard = require('wildcard'); var reMimePartSplit = /[\/\+\.]/; @@ -7030,7 +7027,7 @@ module.exports = function(target, pattern) { return pattern ? test(pattern.split(';')[0]) : test; }; -},{"wildcard":56}],51:[function(require,module,exports){ +},{"wildcard":57}],52:[function(require,module,exports){ /** * Create an event emitter with namespaces * @name createNamespaceEmitter @@ -7168,7 +7165,7 @@ module.exports = function createNamespaceEmitter () { return emitter } -},{}],52:[function(require,module,exports){ +},{}],53:[function(require,module,exports){ (function (process){(function (){ // This file replaces `index.js` in bundlers like webpack or Rollup, // according to `browser` config in `package.json`. @@ -7276,7 +7273,7 @@ let nanoid = (size = 21) => { module.exports = { nanoid, customAlphabet, customRandom, urlAlphabet, random } }).call(this)}).call(this,require('_process')) -},{"./url-alphabet/index.cjs":53,"_process":55}],53:[function(require,module,exports){ +},{"./url-alphabet/index.cjs":54,"_process":56}],54:[function(require,module,exports){ // This alphabet uses `A-Za-z0-9_-` symbols. The genetic algorithm helped // optimize the gzip compression for this alphabet. let urlAlphabet = @@ -7284,11 +7281,11 @@ let urlAlphabet = module.exports = { urlAlphabet } -},{}],54:[function(require,module,exports){ +},{}],55:[function(require,module,exports){ var n,l,u,t,i,o,r,f,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(n,l){for(var u in l)n[u]=l[u];return n}function p(n){var l=n.parentNode;l&&l.removeChild(n)}function v(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return h(l,f,i,o,null)}function h(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null!=l.vnode&&l.vnode(f),f}function y(n){return n.children}function d(n,l){this.props=n,this.context=l}function _(n,l){if(null==l)return n.__?_(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l0?h(k.type,k.props,k.key,null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=A[p])||d&&k.key==d.key&&k.type===d.type)A[p]=void 0;else for(v=0;v2&&(f.children=arguments.length>3?n.call(arguments,2):t),h(l.type,f,i||l.key,o||l.ref,null)},exports.createContext=function(n,l){var u={__c:l="__cC"+f++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(x)},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u},exports.toChildArray=function n(l,u){return u=u||[],null==l||"boolean"==typeof l||(Array.isArray(l)?l.some(function(l){n(l,u)}):u.push(l)),u},exports.options=l; -},{}],55:[function(require,module,exports){ +},{}],56:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -7474,7 +7471,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],56:[function(require,module,exports){ +},{}],57:[function(require,module,exports){ /* jshint node: true */ 'use strict'; @@ -7569,7 +7566,7 @@ module.exports = function(text, test, separator) { return matcher; }; -},{}],57:[function(require,module,exports){ +},{}],58:[function(require,module,exports){ // We need a custom build of Uppy because we do not use webpack for // our JS modules/build. The only way to get what you want from Uppy // is to use the webpack modules or to include the entire Uppy project @@ -7582,4 +7579,4 @@ Uppy.AwsS3 = require('@uppy/aws-s3') Uppy.AwsS3Multipart = require('@uppy/aws-s3-multipart') Uppy.DropTarget = require('@uppy/drop-target') -},{"@uppy/aws-s3":5,"@uppy/aws-s3-multipart":3,"@uppy/core":17,"@uppy/drop-target":20,"@uppy/xhr-upload":48}]},{},[57]); +},{"@uppy/aws-s3":5,"@uppy/aws-s3-multipart":3,"@uppy/core":18,"@uppy/drop-target":21,"@uppy/xhr-upload":49}]},{},[58]); diff --git a/yarn.lock b/yarn.lock index 50946f26bf7..0f6840614b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -259,81 +259,72 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.11.2.tgz#2de1ed6670439387da1c9f549a2ade2b0a799256" integrity sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA== -"@uppy/aws-s3-multipart@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@uppy/aws-s3-multipart/-/aws-s3-multipart-2.0.2.tgz#b12f0938fad61532f20a9aa1aa017a484d310c83" - integrity sha512-+PaYGP8/XbMnWAEEAcdh9AF1TzXXazHdHDJf+QEN2eH7UBEDpieY2P7c4t/yhZXY25ifOQjKryGt8inoAaHJDA== +"@uppy/aws-s3-multipart@^2.1.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@uppy/aws-s3-multipart/-/aws-s3-multipart-2.1.1.tgz#7749491067ab72249dab201cc12409e57f2dbb1a" + integrity sha512-p+oFSCWEUc7ptv73sdZuWoq10hh0vzmP4cxwBEX/+nrplLFSuRUJ+z2XnNEigo8jXHWbA86k6tEX/3XIUsslgg== dependencies: - "@uppy/companion-client" "^2.0.0" - "@uppy/utils" "^4.0.0" + "@uppy/companion-client" "^2.0.3" + "@uppy/utils" "^4.0.3" -"@uppy/aws-s3@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@uppy/aws-s3/-/aws-s3-2.0.2.tgz#6bd4e17bf3984bf7f8633264c3669a454d9853d5" - integrity sha512-Nxp0nFGTVYgNIVN4bHdWHx+1nEkdCdFeYGw3KltIGPhzN4RRMAvrsCB3Mk4AAWL4KSVKs4BgkNfYNVt3nRJVqg== +"@uppy/aws-s3@^2.0.4": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@uppy/aws-s3/-/aws-s3-2.0.5.tgz#dae2edb819b8e79119304a1659b931a862bf1e45" + integrity sha512-VWqVtmKtV/wSLCZdFbWlUt+CS7W/KZv20Pmm3JgcDLrQk3PdciYg3L9x65FTP8kSDsiXCwMg7uO5HfbspZWx9Q== dependencies: - "@uppy/companion-client" "^2.0.0" - "@uppy/utils" "^4.0.0" - "@uppy/xhr-upload" "^2.0.2" + "@uppy/companion-client" "^2.0.3" + "@uppy/utils" "^4.0.3" + "@uppy/xhr-upload" "^2.0.5" nanoid "^3.1.25" -"@uppy/companion-client@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@uppy/companion-client/-/companion-client-2.0.0.tgz#60980d949d1ed15fe88bc8358171a938289b917c" - integrity sha512-TH/uw6aVeDKHcoepM9QAbSMMoi4MqUEG+loOEDwkB0CPkJGRYLqwvpnaO9pnELE7k1ZHfGGvRw0lxbkq5olGAg== +"@uppy/companion-client@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@uppy/companion-client/-/companion-client-2.0.3.tgz#d3cd30ebbc9f87d27374d13258b5d304366f10d5" + integrity sha512-I1baKKBpb3d//q3agRtNV3UD/sA7EecFOfoVSpMlPkFu6oQqxjSC5OFXTf3fa8X+wo4Lcutv1++3igPJ1zrgbA== dependencies: - "@uppy/utils" "^4.0.0" + "@uppy/utils" "^4.0.3" namespace-emitter "^2.0.1" -"@uppy/core@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@uppy/core/-/core-2.0.1.tgz#e9686ce3e5560593d249c455a9b3c542509e2289" - integrity sha512-MdSvc3ngVebfSBHYLKzFFSUxAatSqH/vYP6v4R3uU/zFaZ0cW9A/Xm52S6rGLKf1d5ZNOvZjesdkre6d61m2Eg== +"@uppy/core@^2.1.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@uppy/core/-/core-2.1.1.tgz#503b3172ffe32e6cc7385f5b0c99f008ade815f1" + integrity sha512-dFlcy6+05zwsJk1KNeUKVWUyAfhOVwNpnPLaR1NX9Qsjv7KlYfUNRVW3uCCmIpd/EZsX44+haiqGrhLcYDAcxA== dependencies: "@transloadit/prettier-bytes" "0.0.7" - "@uppy/store-default" "^2.0.0" - "@uppy/utils" "^4.0.0" + "@uppy/store-default" "^2.0.2" + "@uppy/utils" "^4.0.3" lodash.throttle "^4.1.1" mime-match "^1.0.2" namespace-emitter "^2.0.1" nanoid "^3.1.25" preact "^10.5.13" -"@uppy/drop-target@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@uppy/drop-target/-/drop-target-1.0.1.tgz#9126fc52c1f36b30a3dff91219c7a0a45865bd2d" - integrity sha512-BAX/T9p6qySmty8i3MglPi3Ica722RctY2BE9PwhwvQ5konyH4WlhH/jDAaGzzVZE9plc2sfoLntzH1yZoajEA== +"@uppy/drop-target@^1.1.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@uppy/drop-target/-/drop-target-1.1.1.tgz#9bfbcb7b284ef605d01fc24823f857cbad51377a" + integrity sha512-2MxNGEkI2vt1D6MEa0PNqR+VTMbuUzmiytHyy57phZNCNes8K4BdnneBwla2nG3LI0D1TURK7MKxaSjv93d3Vg== dependencies: - "@uppy/utils" "^4.0.0" + "@uppy/utils" "^4.0.3" -"@uppy/store-default@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@uppy/store-default/-/store-default-2.0.0.tgz#c446a89d07a6df7f980a15eeb880d169baa14d7f" - integrity sha512-5HXTR2Qn20rpPUCUFBuNBfYDIa20oyUV14+FAnklgv2P32/zIyk79eFYloDRg8H7mOosVpovlysfDkI4iJh8Ag== +"@uppy/store-default@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@uppy/store-default/-/store-default-2.0.2.tgz#c0464e92452fdc7d4cd1548d2c7453017cad7a98" + integrity sha512-D9oz08EYBoc4fDotvaevd2Q7uVldS61HYFOXK20b5M/xXF/uxepapaqQnMu1DfCVsA77rhp7DMemxnWc9y8xTQ== -"@uppy/utils@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@uppy/utils/-/utils-4.0.0.tgz#337ffe668843a393171c8e9ff885d70af3a57417" - integrity sha512-sQOIM0cZOuV63l8JxgpRxAJiD/sJChKdEb1c5clRoxs4oafgtD9pl/BcBrOarMwk3r7kVZHt2apOL3V4BvD2Zw== +"@uppy/utils@^4.0.3": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@uppy/utils/-/utils-4.0.3.tgz#181fdd161e1450d31af0cf7bc97946a99196a8fe" + integrity sha512-LApneC8lNvTonzSJFupxzuEvKhwp/Klc1otq8t+zXpdgjLVVSuW/rJBFfdIDrmDoqSzVLQKYjMy07CmhDAWfKg== dependencies: lodash.throttle "^4.1.1" -"@uppy/xhr-upload@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@uppy/xhr-upload/-/xhr-upload-2.0.1.tgz#751f00c30bd00004aa38d0e0eda653dee0e42206" - integrity sha512-7LMZL1+MdpUT1v3+JTs23Zhw+vZ1XL0a3r6cH0+1/JeN4Kx0AnSUouXF2tamdA5OOZpSqseY4lfFO3pJqCXOOA== +"@uppy/xhr-upload@^2.0.4", "@uppy/xhr-upload@^2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@uppy/xhr-upload/-/xhr-upload-2.0.5.tgz#5792a7ff0bfb1503c8a9cccefb48ddb40deb11de" + integrity sha512-DkD6cRKrcI4oDmCimHAULb6rruyUt6SbH4/omhpvWILbG/mWV5vA39YLvYxCZ1FZbijJ4QkVTKEeOTLcmoljPg== dependencies: - "@uppy/companion-client" "^2.0.0" - "@uppy/utils" "^4.0.0" - nanoid "^3.1.25" - -"@uppy/xhr-upload@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@uppy/xhr-upload/-/xhr-upload-2.0.2.tgz#dc61332fc6bf53fcc79892ec41330ac475bdfba6" - integrity sha512-yb/yCUquX0m96jABMEpUQGnxBqjtB5b3u9l8pY+wi3N7SEuDk1u2PPakkbzI6xcguW1e9Peb+Q2LYK6wWaPIxQ== - dependencies: - "@uppy/companion-client" "^2.0.0" - "@uppy/utils" "^4.0.0" + "@uppy/companion-client" "^2.0.3" + "@uppy/utils" "^4.0.3" nanoid "^3.1.25" JSONStream@^1.0.3: