@uppy/onedrive
Advanced tools
Comparing version 1.2.2 to 2.0.0-alpha.0
139
lib/index.js
@@ -0,77 +1,77 @@ | ||
"use strict"; | ||
var _class, _temp; | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
const { | ||
UIPlugin | ||
} = require('@uppy/core'); | ||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } | ||
const { | ||
Provider | ||
} = require('@uppy/companion-client'); | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
const { | ||
ProviderViews | ||
} = require('@uppy/provider-views'); | ||
var _require = require('@uppy/core'), | ||
Plugin = _require.Plugin; | ||
const { | ||
h | ||
} = require('preact'); | ||
var _require2 = require('@uppy/companion-client'), | ||
Provider = _require2.Provider; | ||
module.exports = (_temp = _class = class OneDrive extends UIPlugin { | ||
constructor(uppy, opts) { | ||
super(uppy, opts); | ||
this.id = this.opts.id || 'OneDrive'; | ||
Provider.initPlugin(this, opts); | ||
this.title = this.opts.title || 'OneDrive'; | ||
var _require3 = require('@uppy/provider-views'), | ||
ProviderViews = _require3.ProviderViews; | ||
this.icon = () => h("svg", { | ||
"aria-hidden": "true", | ||
focusable: "false", | ||
width: "32", | ||
height: "32", | ||
viewBox: "0 0 32 32" | ||
}, h("g", { | ||
fill: "none", | ||
fillRule: "evenodd" | ||
}, h("rect", { | ||
className: "uppy-ProviderIconBg", | ||
width: "32", | ||
height: "32", | ||
rx: "16", | ||
fill: "#0262C0" | ||
}), h("g", { | ||
fill: "#FFF", | ||
fillRule: "nonzero" | ||
}, h("path", { | ||
d: "M24.157 22s1.492-.205 1.79-1.655a2.624 2.624 0 0 0 .03-.878c-.22-1.64-1.988-2.01-1.988-2.01s.307-1.765-1.312-2.69c-1.62-.925-3.1 0-3.1 0S18.711 13 16.366 13c-3.016 0-3.519 3.448-3.519 3.448S10 16.618 10 19.14c0 2.523 2.597 2.86 2.597 2.86h11.56z" | ||
}), h("path", { | ||
d: "M9.421 19.246c0-2.197 1.606-3.159 2.871-3.472.44-1.477 1.654-3.439 4.135-3.439H16.445c1.721 0 2.79.823 3.368 1.476a3.99 3.99 0 0 1 1.147-.171h.01l.03.002C21.017 13.5 20.691 10 16.757 10c-2.69 0-3.639 2.345-3.639 2.345s-1.95-1.482-3.955.567c-1.028 1.052-.79 2.669-.79 2.669S6 15.824 6 18.412C6 20.757 8.452 21 8.452 21h1.372a3.77 3.77 0 0 1-.403-1.754z" | ||
})))); | ||
var _require4 = require('preact'), | ||
h = _require4.h; | ||
module.exports = (_temp = _class = /*#__PURE__*/function (_Plugin) { | ||
_inheritsLoose(OneDrive, _Plugin); | ||
function OneDrive(uppy, opts) { | ||
var _this; | ||
_this = _Plugin.call(this, uppy, opts) || this; | ||
_this.id = _this.opts.id || 'OneDrive'; | ||
Provider.initPlugin(_assertThisInitialized(_this), opts); | ||
_this.title = _this.opts.title || 'OneDrive'; | ||
_this.icon = function () { | ||
return h("svg", { | ||
"aria-hidden": "true", | ||
focusable: "false", | ||
width: "32", | ||
height: "32", | ||
viewBox: "0 0 32 32" | ||
}, h("g", { | ||
fill: "none", | ||
fillRule: "evenodd" | ||
}, h("rect", { | ||
className: "uppy-ProviderIconBg", | ||
width: "32", | ||
height: "32", | ||
rx: "16", | ||
fill: "#0262C0" | ||
}), h("g", { | ||
fill: "#FFF", | ||
fillRule: "nonzero" | ||
}, h("path", { | ||
d: "M24.157 22s1.492-.205 1.79-1.655a2.624 2.624 0 0 0 .03-.878c-.22-1.64-1.988-2.01-1.988-2.01s.307-1.765-1.312-2.69c-1.62-.925-3.1 0-3.1 0S18.711 13 16.366 13c-3.016 0-3.519 3.448-3.519 3.448S10 16.618 10 19.14c0 2.523 2.597 2.86 2.597 2.86h11.56z" | ||
}), h("path", { | ||
d: "M9.421 19.246c0-2.197 1.606-3.159 2.871-3.472.44-1.477 1.654-3.439 4.135-3.439H16.445c1.721 0 2.79.823 3.368 1.476a3.99 3.99 0 0 1 1.147-.171h.01l.03.002C21.017 13.5 20.691 10 16.757 10c-2.69 0-3.639 2.345-3.639 2.345s-1.95-1.482-3.955.567c-1.028 1.052-.79 2.669-.79 2.669S6 15.824 6 18.412C6 20.757 8.452 21 8.452 21h1.372a3.77 3.77 0 0 1-.403-1.754z" | ||
})))); | ||
}; | ||
_this.provider = new Provider(uppy, { | ||
companionUrl: _this.opts.companionUrl, | ||
companionHeaders: _this.opts.companionHeaders || _this.opts.serverHeaders, | ||
companionCookiesRule: _this.opts.companionCookiesRule, | ||
this.provider = new Provider(uppy, { | ||
companionUrl: this.opts.companionUrl, | ||
companionHeaders: this.opts.companionHeaders, | ||
companionCookiesRule: this.opts.companionCookiesRule, | ||
provider: 'onedrive', | ||
pluginId: _this.id | ||
pluginId: this.id | ||
}); | ||
_this.onFirstRender = _this.onFirstRender.bind(_assertThisInitialized(_this)); | ||
_this.render = _this.render.bind(_assertThisInitialized(_this)); | ||
return _this; | ||
this.defaultLocale = { | ||
strings: { | ||
pluginNameOneDrive: 'OneDrive' | ||
} | ||
}; | ||
this.i18nInit(); | ||
this.title = this.i18n('pluginNameOneDrive'); | ||
this.onFirstRender = this.onFirstRender.bind(this); | ||
this.render = this.render.bind(this); | ||
} | ||
var _proto = OneDrive.prototype; | ||
_proto.install = function install() { | ||
install() { | ||
this.view = new ProviderViews(this, { | ||
provider: this.provider | ||
}); | ||
var target = this.opts.target; | ||
const { | ||
target | ||
} = this.opts; | ||
@@ -81,18 +81,17 @@ if (target) { | ||
} | ||
}; | ||
} | ||
_proto.uninstall = function uninstall() { | ||
uninstall() { | ||
this.view.tearDown(); | ||
this.unmount(); | ||
}; | ||
} | ||
_proto.onFirstRender = function onFirstRender() { | ||
onFirstRender() { | ||
return Promise.all([this.provider.fetchPreAuthToken(), this.view.getFolder()]); | ||
}; | ||
} | ||
_proto.render = function render(state) { | ||
render(state) { | ||
return this.view.render(state); | ||
}; | ||
} | ||
return OneDrive; | ||
}(Plugin), _class.VERSION = "1.2.2", _temp); | ||
}, _class.VERSION = "2.0.0-alpha.0", _temp); |
{ | ||
"name": "@uppy/onedrive", | ||
"description": "Import files from OneDrive, into Uppy.", | ||
"version": "1.2.2", | ||
"version": "2.0.0-alpha.0", | ||
"license": "MIT", | ||
@@ -23,6 +23,6 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@uppy/companion-client": "^1.10.2", | ||
"@uppy/provider-views": "^1.12.3", | ||
"@uppy/utils": "^3.6.2", | ||
"preact": "8.2.9" | ||
"@uppy/companion-client": "^2.0.0-alpha.0", | ||
"@uppy/provider-views": "^2.0.0-alpha.0", | ||
"@uppy/utils": "^4.0.0-alpha.0", | ||
"preact": "^10.5.13" | ||
}, | ||
@@ -32,3 +32,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "4b782ffbbb443672843d7b4096956bed3b11d612" | ||
"gitHead": "113b627dd0ef5aa5d198dc309dda05da2117dfe5" | ||
} |
@@ -17,4 +17,4 @@ # @uppy/facebook | ||
```js | ||
const Uppy = require('@uppy/core') | ||
const Facebook = require('@uppy/facebook') | ||
import Uppy from '@uppy/core' | ||
import Facebook from '@uppy/facebook' | ||
@@ -21,0 +21,0 @@ const uppy = new Uppy() |
@@ -1,2 +0,2 @@ | ||
const { Plugin } = require('@uppy/core') | ||
const { UIPlugin } = require('@uppy/core') | ||
const { Provider } = require('@uppy/companion-client') | ||
@@ -6,3 +6,3 @@ const { ProviderViews } = require('@uppy/provider-views') | ||
module.exports = class OneDrive extends Plugin { | ||
module.exports = class OneDrive extends UIPlugin { | ||
static VERSION = require('../package.json').version | ||
@@ -29,3 +29,3 @@ | ||
companionUrl: this.opts.companionUrl, | ||
companionHeaders: this.opts.companionHeaders || this.opts.serverHeaders, | ||
companionHeaders: this.opts.companionHeaders, | ||
companionCookiesRule: this.opts.companionCookiesRule, | ||
@@ -36,2 +36,10 @@ provider: 'onedrive', | ||
this.defaultLocale = { | ||
strings: { | ||
pluginNameOneDrive: 'OneDrive', | ||
}, | ||
} | ||
this.i18nInit() | ||
this.title = this.i18n('pluginNameOneDrive') | ||
this.onFirstRender = this.onFirstRender.bind(this) | ||
@@ -46,3 +54,3 @@ this.render = this.render.bind(this) | ||
const target = this.opts.target | ||
const { target } = this.opts | ||
if (target) { | ||
@@ -49,0 +57,0 @@ this.mount(target, this) |
@@ -1,17 +0,13 @@ | ||
import Uppy = require('@uppy/core') | ||
import CompanionClient = require('@uppy/companion-client') | ||
import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core' | ||
import type { PublicProviderOptions, TokenStorage } from '@uppy/companion-client' | ||
declare module OneDrive { | ||
interface OneDriveOptions | ||
extends Uppy.PluginOptions, | ||
CompanionClient.PublicProviderOptions { | ||
export interface OneDriveOptions extends PluginOptions, PublicProviderOptions { | ||
replaceTargetContent?: boolean | ||
target?: Uppy.PluginTarget | ||
target?: PluginTarget | ||
title?: string | ||
storage?: CompanionClient.TokenStorage | ||
} | ||
storage?: TokenStorage | ||
} | ||
declare class OneDrive extends Uppy.Plugin<OneDrive.OneDriveOptions> {} | ||
declare class OneDrive extends UIPlugin<OneDriveOptions> {} | ||
export = OneDrive | ||
export default OneDrive |
@@ -1,2 +0,13 @@ | ||
import OneDrive = require('../') | ||
// TODO implement | ||
import Uppy from '@uppy/core' | ||
import OneDrive from '..' | ||
{ | ||
const uppy = new Uppy() | ||
uppy.use(OneDrive, { | ||
companionUrl: '', | ||
companionCookiesRule: 'same-origin', | ||
replaceTargetContent: false, | ||
target: 'body', | ||
title: 'title', | ||
}) | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
9
172
14844
1
+ Added@uppy/companion-client@2.2.2(transitive)
+ Added@uppy/core@2.3.4(transitive)
+ Added@uppy/provider-views@2.1.3(transitive)
+ Added@uppy/store-default@2.1.1(transitive)
+ Added@uppy/utils@4.1.3(transitive)
+ Addednanoid@3.3.8(transitive)
+ Addedpreact@10.25.2(transitive)
- Removed@uppy/companion-client@1.10.2(transitive)
- Removed@uppy/provider-views@1.12.3(transitive)
- Removedqs-stringify@1.2.1(transitive)
- Removedquerystringify@2.2.0(transitive)
- Removedrequires-port@1.0.0(transitive)
- Removedurl-parse@1.5.10(transitive)
Updated@uppy/utils@^4.0.0-alpha.0
Updatedpreact@^10.5.13