@uppy/core
Advanced tools
Comparing version 0.26.0 to 0.27.0
@@ -68,3 +68,3 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
id: 'uppy', | ||
autoProceed: true, | ||
autoProceed: false, | ||
debug: false, | ||
@@ -841,3 +841,3 @@ restrictions: { | ||
// show informer if offline | ||
if (typeof window !== 'undefined') { | ||
if (typeof window !== 'undefined' && window.addEventListener) { | ||
window.addEventListener('online', function () { | ||
@@ -844,0 +844,0 @@ return _this5.updateOnlineStatus(); |
@@ -62,11 +62,13 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
return plugins[this.id]; | ||
return plugins[this.id] || {}; | ||
}; | ||
Plugin.prototype.setPluginState = function setPluginState(update) { | ||
var plugins = _extends({}, this.uppy.getState().plugins); | ||
plugins[this.id] = _extends({}, plugins[this.id], update); | ||
var _extends2; | ||
var _uppy$getState2 = this.uppy.getState(), | ||
plugins = _uppy$getState2.plugins; | ||
this.uppy.setState({ | ||
plugins: plugins | ||
plugins: _extends({}, plugins, (_extends2 = {}, _extends2[this.id] = _extends({}, plugins[this.id], update), _extends2)) | ||
}); | ||
@@ -73,0 +75,0 @@ }; |
{ | ||
"name": "@uppy/core", | ||
"description": "Core module for the extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:", | ||
"version": "0.26.0", | ||
"version": "0.27.0", | ||
"license": "MIT", | ||
@@ -24,4 +24,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@uppy/store-default": "0.26.0", | ||
"@uppy/utils": "0.26.0", | ||
"@uppy/store-default": "0.27.0", | ||
"@uppy/utils": "0.27.0", | ||
"cuid": "^2.1.1", | ||
@@ -28,0 +28,0 @@ "lodash.throttle": "^4.1.1", |
@@ -23,3 +23,3 @@ # @uppy/core | ||
const uppy = Uppy({ autoProceed: false }) | ||
const uppy = Uppy() | ||
uppy.use(SomePlugin) | ||
@@ -26,0 +26,0 @@ ``` |
@@ -56,3 +56,3 @@ const Translator = require('@uppy/utils/lib/Translator') | ||
id: 'uppy', | ||
autoProceed: true, | ||
autoProceed: false, | ||
debug: false, | ||
@@ -789,3 +789,3 @@ restrictions: { | ||
// show informer if offline | ||
if (typeof window !== 'undefined') { | ||
if (typeof window !== 'undefined' && window.addEventListener) { | ||
window.addEventListener('online', () => this.updateOnlineStatus()) | ||
@@ -792,0 +792,0 @@ window.addEventListener('offline', () => this.updateOnlineStatus()) |
@@ -691,3 +691,2 @@ const fs = require('fs') | ||
const core = new Core({ | ||
autoProceed: false, | ||
onBeforeUpload: (files) => { | ||
@@ -998,3 +997,2 @@ for (var fileId in files) { | ||
const core = new Core({ | ||
autoProceed: false, | ||
restrictions: { | ||
@@ -1030,3 +1028,2 @@ maxNumberOfFiles: 1 | ||
const core = new Core({ | ||
autoProceed: false, | ||
restrictions: { | ||
@@ -1053,3 +1050,2 @@ allowedFileTypes: ['image/gif', 'image/png'] | ||
const core = new Core({ | ||
autoProceed: false, | ||
restrictions: { | ||
@@ -1076,3 +1072,2 @@ allowedFileTypes: ['.gif', '.jpg', '.jpeg'] | ||
const core = new Core({ | ||
autoProceed: false, | ||
restrictions: { | ||
@@ -1079,0 +1074,0 @@ maxFileSize: 1234 |
@@ -48,11 +48,16 @@ const preact = require('preact') | ||
const { plugins } = this.uppy.getState() | ||
return plugins[this.id] | ||
return plugins[this.id] || {} | ||
} | ||
setPluginState (update) { | ||
const plugins = Object.assign({}, this.uppy.getState().plugins) | ||
plugins[this.id] = Object.assign({}, plugins[this.id], update) | ||
const { plugins } = this.uppy.getState() | ||
this.uppy.setState({ | ||
plugins: plugins | ||
plugins: { | ||
...plugins, | ||
[this.id]: { | ||
...plugins[this.id], | ||
...update | ||
} | ||
} | ||
}) | ||
@@ -59,0 +64,0 @@ } |
@@ -64,6 +64,6 @@ export interface UppyFile { | ||
restrictions: { | ||
maxFileSize: false, | ||
maxNumberOfFiles: false, | ||
minNumberOfFiles: false, | ||
allowedFileTypes: false | ||
maxFileSize: number | null, | ||
maxNumberOfFiles: number | null, | ||
minNumberOfFiles: number | null, | ||
allowedFileTypes: string[] | null | ||
}; | ||
@@ -70,0 +70,0 @@ target: string | Plugin; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20
152171
3866
1
+ Added@uppy/store-default@0.27.0(transitive)
+ Added@uppy/utils@0.27.0(transitive)
- Removed@uppy/store-default@0.26.0(transitive)
- Removed@uppy/utils@0.26.0(transitive)
Updated@uppy/store-default@0.27.0
Updated@uppy/utils@0.27.0