@uppy/dropbox
Advanced tools
Comparing version 3.2.0 to 3.3.0
# @uppy/dropbox | ||
## 3.3.0 | ||
Released: 2024-03-27 | ||
Included in: Uppy v3.24.0 | ||
- @uppy/dropbox: refactor to TypeScript (Murderlon / #4979) | ||
## 3.1.2 | ||
@@ -4,0 +11,0 @@ |
@@ -0,9 +1,11 @@ | ||
import { Provider, getAllowedHosts, tokenStorage } from '@uppy/companion-client'; | ||
import { UIPlugin } from '@uppy/core'; | ||
import { Provider } from '@uppy/companion-client'; | ||
import { ProviderViews } from '@uppy/provider-views'; | ||
import { h } from 'preact'; | ||
import locale from "./locale.js"; | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore We don't want TS to generate types for the package.json | ||
const packageJson = { | ||
"version": "3.2.0" | ||
"version": "3.3.0" | ||
}; | ||
import locale from './locale.js'; | ||
export default class Dropbox extends UIPlugin { | ||
@@ -13,4 +15,5 @@ constructor(uppy, opts) { | ||
this.id = this.opts.id || 'Dropbox'; | ||
Provider.initPlugin(this, opts); | ||
this.title = this.opts.title || 'Dropbox'; | ||
this.type = 'acquirer'; | ||
this.storage = this.opts.storage || tokenStorage; | ||
this.files = []; | ||
this.icon = () => h("svg", { | ||
@@ -28,2 +31,3 @@ className: "uppy-DashboardTab-iconDropbox", | ||
})); | ||
this.opts.companionAllowedHosts = getAllowedHosts(this.opts.companionAllowedHosts, this.opts.companionUrl); | ||
this.provider = new Provider(uppy, { | ||
@@ -40,3 +44,3 @@ companionUrl: this.opts.companionUrl, | ||
this.i18nInit(); | ||
this.title = this.i18n('pluginNameDropbox'); | ||
this.title = this.opts.title || this.i18n('pluginNameDropbox'); | ||
this.onFirstRender = this.onFirstRender.bind(this); | ||
@@ -61,4 +65,4 @@ this.render = this.render.bind(this); | ||
} | ||
onFirstRender() { | ||
return Promise.all([this.provider.fetchPreAuthToken(), this.view.getFolder()]); | ||
async onFirstRender() { | ||
await Promise.all([this.provider.fetchPreAuthToken(), this.view.getFolder()]); | ||
} | ||
@@ -65,0 +69,0 @@ render(state) { |
{ | ||
"name": "@uppy/dropbox", | ||
"description": "Import files from Dropbox, into Uppy.", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"license": "MIT", | ||
@@ -24,10 +24,10 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@uppy/companion-client": "^3.7.0", | ||
"@uppy/provider-views": "^3.8.0", | ||
"@uppy/utils": "^5.7.0", | ||
"@uppy/companion-client": "^3.8.0", | ||
"@uppy/provider-views": "^3.11.0", | ||
"@uppy/utils": "^5.7.5", | ||
"preact": "^10.5.13" | ||
}, | ||
"peerDependencies": { | ||
"@uppy/core": "^3.8.0" | ||
"@uppy/core": "^3.10.0" | ||
} | ||
} |
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
18706
199
1
Updated@uppy/provider-views@^3.11.0
Updated@uppy/utils@^5.7.5