@uppy/zoom
Advanced tools
Comparing version 0.1.18 to 0.2.0-alpha.0
143
lib/index.js
@@ -0,79 +1,79 @@ | ||
"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 Zoom extends UIPlugin { | ||
constructor(uppy, opts) { | ||
super(uppy, opts); | ||
this.id = this.opts.id || 'Zoom'; | ||
Provider.initPlugin(this, opts); | ||
this.title = this.opts.title || 'Zoom'; | ||
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("rect", { | ||
className: "uppy-ProviderIconBg", | ||
width: "32", | ||
height: "32", | ||
rx: "16", | ||
fill: "#0E71EB" | ||
}), h("g", { | ||
fill: "none", | ||
fillRule: "evenodd" | ||
}, h("path", { | ||
fill: "#fff", | ||
d: "M29,31H14c-1.657,0-3-1.343-3-3V17h15c1.657,0,3,1.343,3,3V31z", | ||
style: "transform: translate(-5px, -5px) scale(0.9);" | ||
}), h("polygon", { | ||
fill: "#fff", | ||
points: "37,31 31,27 31,21 37,17", | ||
style: "transform: translate(-5px, -5px) scale(0.9);" | ||
}))); | ||
var _require4 = require('preact'), | ||
h = _require4.h; | ||
module.exports = (_temp = _class = /*#__PURE__*/function (_Plugin) { | ||
_inheritsLoose(Zoom, _Plugin); | ||
function Zoom(uppy, opts) { | ||
var _this; | ||
_this = _Plugin.call(this, uppy, opts) || this; | ||
_this.id = _this.opts.id || 'Zoom'; | ||
Provider.initPlugin(_assertThisInitialized(_this), opts); | ||
_this.title = _this.opts.title || 'Zoom'; | ||
_this.icon = function () { | ||
return h("svg", { | ||
"aria-hidden": "true", | ||
focusable: "false", | ||
width: "32", | ||
height: "32", | ||
viewBox: "0 0 32 32" | ||
}, h("rect", { | ||
className: "uppy-ProviderIconBg", | ||
width: "32", | ||
height: "32", | ||
rx: "16", | ||
fill: "#0E71EB" | ||
}), h("g", { | ||
fill: "none", | ||
fillRule: "evenodd" | ||
}, h("path", { | ||
fill: "#fff", | ||
d: "M29,31H14c-1.657,0-3-1.343-3-3V17h15c1.657,0,3,1.343,3,3V31z", | ||
style: "transform: translate(-5px, -5px) scale(0.9);" | ||
}), h("polygon", { | ||
fill: "#fff", | ||
points: "37,31 31,27 31,21 37,17", | ||
style: "transform: translate(-5px, -5px) scale(0.9);" | ||
}))); | ||
}; | ||
_this.provider = new Provider(uppy, { | ||
companionUrl: _this.opts.companionUrl, | ||
companionHeaders: _this.opts.companionHeaders || _this.opts.serverHeaders, | ||
companionKeysParams: _this.opts.companionKeysParams, | ||
companionCookiesRule: _this.opts.companionCookiesRule, | ||
this.provider = new Provider(uppy, { | ||
companionUrl: this.opts.companionUrl, | ||
companionHeaders: this.opts.companionHeaders, | ||
companionKeysParams: this.opts.companionKeysParams, | ||
companionCookiesRule: this.opts.companionCookiesRule, | ||
provider: 'zoom', | ||
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: { | ||
pluginNameZoom: 'Zoom' | ||
} | ||
}; | ||
this.i18nInit(); | ||
this.title = this.i18n('pluginNameZoom'); | ||
this.onFirstRender = this.onFirstRender.bind(this); | ||
this.render = this.render.bind(this); | ||
} | ||
var _proto = Zoom.prototype; | ||
_proto.install = function install() { | ||
install() { | ||
this.view = new ProviderViews(this, { | ||
provider: this.provider | ||
}); | ||
var target = this.opts.target; | ||
const { | ||
target | ||
} = this.opts; | ||
@@ -83,18 +83,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 Zoom; | ||
}(Plugin), _class.VERSION = "0.1.18", _temp); | ||
}, _class.VERSION = "0.2.0-alpha.0", _temp); |
{ | ||
"name": "@uppy/zoom", | ||
"description": "Import files from zoom, into Uppy.", | ||
"version": "0.1.18", | ||
"version": "0.2.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" | ||
}, | ||
@@ -35,3 +35,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "4b782ffbbb443672843d7b4096956bed3b11d612" | ||
"gitHead": "113b627dd0ef5aa5d198dc309dda05da2117dfe5" | ||
} |
@@ -17,6 +17,6 @@ # @uppy/zoom | ||
```js | ||
const Uppy = require('@uppy/core') | ||
const Zoom = require('@uppy/zoom') | ||
import Uppy from '@uppy/core' | ||
import Zoom from '@uppy/zoom' | ||
const uppy = Uppy() | ||
const uppy = new Uppy() | ||
uppy.use(Zoom, { | ||
@@ -23,0 +23,0 @@ // Options |
@@ -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 Zoom extends Plugin { | ||
module.exports = class Zoom extends UIPlugin { | ||
static VERSION = require('../package.json').version | ||
@@ -27,3 +27,3 @@ | ||
companionUrl: this.opts.companionUrl, | ||
companionHeaders: this.opts.companionHeaders || this.opts.serverHeaders, | ||
companionHeaders: this.opts.companionHeaders, | ||
companionKeysParams: this.opts.companionKeysParams, | ||
@@ -35,2 +35,10 @@ companionCookiesRule: this.opts.companionCookiesRule, | ||
this.defaultLocale = { | ||
strings: { | ||
pluginNameZoom: 'Zoom', | ||
}, | ||
} | ||
this.i18nInit() | ||
this.title = this.i18n('pluginNameZoom') | ||
this.onFirstRender = this.onFirstRender.bind(this) | ||
@@ -45,3 +53,3 @@ this.render = this.render.bind(this) | ||
const target = this.opts.target | ||
const { target } = this.opts | ||
if (target) { | ||
@@ -48,0 +56,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 { TokenStorage, PublicProviderOptions } from '@uppy/companion-client' | ||
declare module Zoom { | ||
interface ZoomOptions | ||
extends Uppy.PluginOptions, | ||
CompanionClient.PublicProviderOptions { | ||
interface ZoomOptions extends PluginOptions, PublicProviderOptions { | ||
replaceTargetContent?: boolean | ||
target?: Uppy.PluginTarget | ||
target?: PluginTarget | ||
title?: string | ||
storage?: CompanionClient.TokenStorage | ||
} | ||
storage?: TokenStorage | ||
} | ||
declare class Zoom extends Uppy.Plugin<Zoom.ZoomOptions> {} | ||
declare class Zoom extends UIPlugin<ZoomOptions> {} | ||
export = Zoom | ||
export default Zoom |
@@ -1,2 +0,13 @@ | ||
import Zoom = require('../') | ||
// TODO implement | ||
import Uppy from '@uppy/core' | ||
import Zoom from '..' | ||
{ | ||
const uppy = new Uppy() | ||
uppy.use(Zoom, { | ||
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
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
171
13753
+ 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.7(transitive)
+ Addedpreact@10.24.1(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