@uppy/remote-sources
Advanced tools
Comparing version 1.0.3 to 1.0.4
function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; } | ||
var id = 0; | ||
function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + name; } | ||
import { BasePlugin } from '@uppy/core'; | ||
@@ -19,3 +16,3 @@ import Dashboard from '@uppy/dashboard'; | ||
const packageJson = { | ||
"version": "1.0.3" | ||
"version": "1.0.4" | ||
}; | ||
@@ -35,5 +32,3 @@ const availablePlugins = { | ||
}; | ||
var _installedPlugins = /*#__PURE__*/_classPrivateFieldLooseKey("installedPlugins"); | ||
export default class RemoteSources extends BasePlugin { | ||
@@ -52,6 +47,6 @@ constructor(uppy, opts) { | ||
}; | ||
this.opts = { ...defaultOptions, | ||
this.opts = { | ||
...defaultOptions, | ||
...opts | ||
}; | ||
if (this.opts.companionUrl == null) { | ||
@@ -61,3 +56,2 @@ throw new Error('Please specify companionUrl for RemoteSources to work, see https://uppy.io/docs/remote-sources#companionUrl'); | ||
} | ||
setOptions(newOpts) { | ||
@@ -68,10 +62,9 @@ this.uninstall(); | ||
} | ||
install() { | ||
this.opts.sources.forEach(pluginId => { | ||
const optsForRemoteSourcePlugin = { ...this.opts, | ||
const optsForRemoteSourcePlugin = { | ||
...this.opts, | ||
sources: undefined | ||
}; | ||
const plugin = availablePlugins[pluginId]; | ||
if (plugin == null) { | ||
@@ -85,10 +78,8 @@ const pluginNames = Object.keys(availablePlugins); | ||
} | ||
this.uppy.use(plugin, optsForRemoteSourcePlugin); // `plugin` is a class, but we want to track the instance object | ||
this.uppy.use(plugin, optsForRemoteSourcePlugin); | ||
// `plugin` is a class, but we want to track the instance object | ||
// so we have to do `getPlugin` here. | ||
_classPrivateFieldLooseBase(this, _installedPlugins)[_installedPlugins].add(this.uppy.getPlugin(pluginId)); | ||
}); | ||
} | ||
uninstall() { | ||
@@ -98,7 +89,5 @@ for (const plugin of _classPrivateFieldLooseBase(this, _installedPlugins)[_installedPlugins]) { | ||
} | ||
_classPrivateFieldLooseBase(this, _installedPlugins)[_installedPlugins].clear(); | ||
} | ||
} | ||
RemoteSources.VERSION = packageJson.version; |
{ | ||
"name": "@uppy/remote-sources", | ||
"description": "Uppy plugin that includes all remote sources that Uppy+Companion offer, like Instagram, Google Drive, Dropox, Box, Unsplash, Url etc", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"license": "MIT", | ||
@@ -30,15 +30,15 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@uppy/box": "^2.1.1", | ||
"@uppy/dashboard": "^3.4.0", | ||
"@uppy/dropbox": "^3.1.1", | ||
"@uppy/facebook": "^3.1.1", | ||
"@uppy/google-drive": "^3.1.1", | ||
"@uppy/instagram": "^3.1.1", | ||
"@uppy/onedrive": "^3.1.1", | ||
"@uppy/unsplash": "^3.2.1", | ||
"@uppy/url": "^3.3.1", | ||
"@uppy/zoom": "^2.1.1" | ||
"@uppy/box": "^2.1.3", | ||
"@uppy/dashboard": "^3.5.4", | ||
"@uppy/dropbox": "^3.1.3", | ||
"@uppy/facebook": "^3.1.2", | ||
"@uppy/google-drive": "^3.2.1", | ||
"@uppy/instagram": "^3.1.2", | ||
"@uppy/onedrive": "^3.1.3", | ||
"@uppy/unsplash": "^3.2.2", | ||
"@uppy/url": "^3.3.3", | ||
"@uppy/zoom": "^2.1.2" | ||
}, | ||
"peerDependencies": { | ||
"@uppy/core": "^3.2.0" | ||
"@uppy/core": "^3.5.1" | ||
}, | ||
@@ -49,5 +49,5 @@ "publishConfig": { | ||
"devDependencies": { | ||
"@jest/globals": "^29.0.0", | ||
"resize-observer-polyfill": "^1.5.1" | ||
"resize-observer-polyfill": "^1.5.1", | ||
"vitest": "^0.34.5" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import { afterAll, beforeAll, describe, expect, it } from '@jest/globals' | ||
import { afterAll, beforeAll, describe, expect, it } from 'vitest' | ||
import resizeObserverPolyfill from 'resize-observer-polyfill' | ||
@@ -3,0 +3,0 @@ import Core from '@uppy/core' |
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
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
17636
210
+ Addedpreact@10.25.2(transitive)
- Removedpreact@10.25.1(transitive)
Updated@uppy/box@^2.1.3
Updated@uppy/dashboard@^3.5.4
Updated@uppy/dropbox@^3.1.3
Updated@uppy/facebook@^3.1.2
Updated@uppy/google-drive@^3.2.1
Updated@uppy/instagram@^3.1.2
Updated@uppy/onedrive@^3.1.3
Updated@uppy/unsplash@^3.2.2
Updated@uppy/url@^3.3.3
Updated@uppy/zoom@^2.1.2