@uppy/instagram
Advanced tools
Comparing version 1.5.2 to 2.0.0-alpha.0
130
lib/index.js
@@ -0,70 +1,67 @@ | ||
"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 Instagram extends UIPlugin { | ||
constructor(uppy, opts) { | ||
super(uppy, opts); | ||
this.id = this.opts.id || 'Instagram'; | ||
Provider.initPlugin(this, opts); | ||
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", | ||
fill: "#E1306C", | ||
width: "32", | ||
height: "32", | ||
rx: "16" | ||
}), h("path", { | ||
d: "M16 8.622c2.403 0 2.688.009 3.637.052.877.04 1.354.187 1.67.31.392.144.745.374 1.036.673.299.29.529.644.673 1.035.123.317.27.794.31 1.671.043.95.052 1.234.052 3.637s-.009 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.671a2.98 2.98 0 0 1-1.708 1.708c-.317.123-.794.27-1.671.31-.95.043-1.234.053-3.637.053s-2.688-.01-3.637-.053c-.877-.04-1.354-.187-1.671-.31a2.788 2.788 0 0 1-1.035-.673 2.788 2.788 0 0 1-.673-1.035c-.123-.317-.27-.794-.31-1.671-.043-.949-.052-1.234-.052-3.637s.009-2.688.052-3.637c.04-.877.187-1.354.31-1.67.144-.392.374-.745.673-1.036.29-.299.644-.529 1.035-.673.317-.123.794-.27 1.671-.31.95-.043 1.234-.052 3.637-.052zM16 7c-2.444 0-2.75.01-3.71.054-.959.044-1.613.196-2.185.419-.6.225-1.145.58-1.594 1.038-.458.45-.813.993-1.039 1.594-.222.572-.374 1.226-.418 2.184C7.01 13.25 7 13.556 7 16s.01 2.75.054 3.71c.044.959.196 1.613.419 2.185.226.6.58 1.145 1.038 1.594.45.458.993.813 1.594 1.038.572.223 1.227.375 2.184.419.96.044 1.267.054 3.711.054s2.75-.01 3.71-.054c.959-.044 1.613-.196 2.185-.419a4.602 4.602 0 0 0 2.632-2.632c.223-.572.375-1.226.419-2.184.044-.96.054-1.267.054-3.711s-.01-2.75-.054-3.71c-.044-.959-.196-1.613-.419-2.185A4.412 4.412 0 0 0 23.49 8.51a4.412 4.412 0 0 0-1.594-1.039c-.572-.222-1.226-.374-2.184-.418C18.75 7.01 18.444 7 16 7zm0 4.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9zm0 7.421a2.921 2.921 0 1 1 0-5.842 2.921 2.921 0 0 1 0 5.842zm4.875-6.671a1.125 1.125 0 1 1 0-2.25 1.125 1.125 0 0 1 0 2.25z", | ||
fill: "#FFF" | ||
}))); | ||
var _require4 = require('preact'), | ||
h = _require4.h; | ||
module.exports = (_temp = _class = /*#__PURE__*/function (_Plugin) { | ||
_inheritsLoose(Instagram, _Plugin); | ||
function Instagram(uppy, opts) { | ||
var _this; | ||
_this = _Plugin.call(this, uppy, opts) || this; | ||
_this.id = _this.opts.id || 'Instagram'; | ||
Provider.initPlugin(_assertThisInitialized(_this), opts); | ||
_this.title = _this.opts.title || 'Instagram'; | ||
_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", | ||
fill: "#E1306C", | ||
width: "32", | ||
height: "32", | ||
rx: "16" | ||
}), h("path", { | ||
d: "M16 8.622c2.403 0 2.688.009 3.637.052.877.04 1.354.187 1.67.31.392.144.745.374 1.036.673.299.29.529.644.673 1.035.123.317.27.794.31 1.671.043.95.052 1.234.052 3.637s-.009 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.671a2.98 2.98 0 0 1-1.708 1.708c-.317.123-.794.27-1.671.31-.95.043-1.234.053-3.637.053s-2.688-.01-3.637-.053c-.877-.04-1.354-.187-1.671-.31a2.788 2.788 0 0 1-1.035-.673 2.788 2.788 0 0 1-.673-1.035c-.123-.317-.27-.794-.31-1.671-.043-.949-.052-1.234-.052-3.637s.009-2.688.052-3.637c.04-.877.187-1.354.31-1.67.144-.392.374-.745.673-1.036.29-.299.644-.529 1.035-.673.317-.123.794-.27 1.671-.31.95-.043 1.234-.052 3.637-.052zM16 7c-2.444 0-2.75.01-3.71.054-.959.044-1.613.196-2.185.419-.6.225-1.145.58-1.594 1.038-.458.45-.813.993-1.039 1.594-.222.572-.374 1.226-.418 2.184C7.01 13.25 7 13.556 7 16s.01 2.75.054 3.71c.044.959.196 1.613.419 2.185.226.6.58 1.145 1.038 1.594.45.458.993.813 1.594 1.038.572.223 1.227.375 2.184.419.96.044 1.267.054 3.711.054s2.75-.01 3.71-.054c.959-.044 1.613-.196 2.185-.419a4.602 4.602 0 0 0 2.632-2.632c.223-.572.375-1.226.419-2.184.044-.96.054-1.267.054-3.711s-.01-2.75-.054-3.71c-.044-.959-.196-1.613-.419-2.185A4.412 4.412 0 0 0 23.49 8.51a4.412 4.412 0 0 0-1.594-1.039c-.572-.222-1.226-.374-2.184-.418C18.75 7.01 18.444 7 16 7zm0 4.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9zm0 7.421a2.921 2.921 0 1 1 0-5.842 2.921 2.921 0 0 1 0 5.842zm4.875-6.671a1.125 1.125 0 1 1 0-2.25 1.125 1.125 0 0 1 0 2.25z", | ||
fill: "#FFF" | ||
}))); | ||
this.defaultLocale = { | ||
strings: { | ||
pluginNameInstagram: 'Instagram' | ||
} | ||
}; | ||
_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.i18nInit(); | ||
this.title = this.i18n('pluginNameInstagram'); | ||
this.provider = new Provider(uppy, { | ||
companionUrl: this.opts.companionUrl, | ||
companionHeaders: this.opts.companionHeaders, | ||
companionKeysParams: this.opts.companionKeysParams, | ||
companionCookiesRule: this.opts.companionCookiesRule, | ||
provider: 'instagram', | ||
pluginId: _this.id | ||
pluginId: this.id | ||
}); | ||
_this.onFirstRender = _this.onFirstRender.bind(_assertThisInitialized(_this)); | ||
_this.render = _this.render.bind(_assertThisInitialized(_this)); | ||
return _this; | ||
this.onFirstRender = this.onFirstRender.bind(this); | ||
this.render = this.render.bind(this); | ||
} | ||
var _proto = Instagram.prototype; | ||
_proto.install = function install() { | ||
install() { | ||
this.view = new ProviderViews(this, { | ||
@@ -77,3 +74,5 @@ provider: this.provider, | ||
}); | ||
var target = this.opts.target; | ||
const { | ||
target | ||
} = this.opts; | ||
@@ -83,18 +82,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('recent')]); | ||
}; | ||
} | ||
_proto.render = function render(state) { | ||
render(state) { | ||
return this.view.render(state); | ||
}; | ||
} | ||
return Instagram; | ||
}(Plugin), _class.VERSION = "1.5.2", _temp); | ||
}, _class.VERSION = "2.0.0-alpha.0", _temp); |
{ | ||
"name": "@uppy/instagram", | ||
"description": "Import photos and videos from Instagram, into Uppy.", | ||
"version": "1.5.2", | ||
"version": "2.0.0-alpha.0", | ||
"license": "MIT", | ||
@@ -26,6 +26,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,4 +17,4 @@ # @uppy/instagram | ||
```js | ||
const Uppy = require('@uppy/core') | ||
const Instagram = require('@uppy/instagram') | ||
import Uppy from '@uppy/core' | ||
import Instagram from '@uppy/instagram' | ||
@@ -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 Instagram extends Plugin { | ||
module.exports = class Instagram extends UIPlugin { | ||
static VERSION = require('../package.json').version | ||
@@ -14,3 +14,2 @@ | ||
Provider.initPlugin(this, opts) | ||
this.title = this.opts.title || 'Instagram' | ||
this.icon = () => ( | ||
@@ -25,5 +24,13 @@ <svg aria-hidden="true" focusable="false" width="32" height="32" viewBox="0 0 32 32"> | ||
this.defaultLocale = { | ||
strings: { | ||
pluginNameInstagram: 'Instagram', | ||
}, | ||
} | ||
this.i18nInit() | ||
this.title = this.i18n('pluginNameInstagram') | ||
this.provider = new Provider(uppy, { | ||
companionUrl: this.opts.companionUrl, | ||
companionHeaders: this.opts.companionHeaders || this.opts.serverHeaders, | ||
companionHeaders: this.opts.companionHeaders, | ||
companionKeysParams: this.opts.companionKeysParams, | ||
@@ -48,3 +55,3 @@ companionCookiesRule: this.opts.companionCookiesRule, | ||
const target = this.opts.target | ||
const { target } = this.opts | ||
if (target) { | ||
@@ -51,0 +58,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 Instagram { | ||
interface InstagramOptions | ||
extends Uppy.PluginOptions, | ||
CompanionClient.PublicProviderOptions { | ||
export interface InstagramOptions extends PluginOptions, PublicProviderOptions { | ||
replaceTargetContent?: boolean | ||
target?: Uppy.PluginTarget | ||
target?: PluginTarget | ||
title?: string | ||
storage?: CompanionClient.TokenStorage | ||
} | ||
storage?: TokenStorage | ||
} | ||
declare class Instagram extends Uppy.Plugin<Instagram.InstagramOptions> {} | ||
declare class Instagram extends UIPlugin<InstagramOptions> {} | ||
export = Instagram | ||
export default Instagram |
@@ -1,2 +0,13 @@ | ||
import Instagram = require('../') | ||
// TODO implement | ||
import Uppy from '@uppy/core' | ||
import Instagram from '..' | ||
{ | ||
const uppy = new Uppy() | ||
uppy.use(Instagram, { | ||
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
181
17762
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