Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@uppy/facebook

Package Overview
Dependencies
Maintainers
8
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uppy/facebook - npm Package Compare versions

Comparing version 2.0.5 to 2.0.6

lib/Facebook.js

7

CHANGELOG.md
# @uppy/facebook
## 2.0.6
Released: 2022-04-27
Included in: Uppy v2.9.4
- @uppy/facebook: refactor to ESM (Antoine du Hamel / #3653)
## 2.0.5

@@ -4,0 +11,0 @@

99

lib/index.js
"use strict";
var _class, _temp;
const {
UIPlugin
} = require('@uppy/core');
const {
Provider
} = require('@uppy/companion-client');
const {
ProviderViews
} = require('@uppy/provider-views');
const {
h
} = require('preact');
const locale = require('./locale.js');
module.exports = (_temp = _class = class Facebook extends UIPlugin {
constructor(uppy, opts) {
super(uppy, opts);
this.id = this.opts.id || 'Facebook';
Provider.initPlugin(this, opts);
this.title = this.opts.title || 'Facebook';
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: "#3C5A99"
}), h("path", {
d: "M17.842 26v-8.667h2.653l.398-3.377h-3.051v-2.157c0-.978.248-1.644 1.527-1.644H21V7.132A19.914 19.914 0 0 0 18.623 7c-2.352 0-3.963 1.574-3.963 4.465v2.49H12v3.378h2.66V26h3.182z",
fill: "#FFF",
fillRule: "nonzero"
})));
this.provider = new Provider(uppy, {
companionUrl: this.opts.companionUrl,
companionHeaders: this.opts.companionHeaders,
companionKeysParams: this.opts.companionKeysParams,
companionCookiesRule: this.opts.companionCookiesRule,
provider: 'facebook',
pluginId: this.id
});
this.defaultLocale = locale;
this.i18nInit();
this.title = this.i18n('pluginNameFacebook');
this.onFirstRender = this.onFirstRender.bind(this);
this.render = this.render.bind(this);
}
install() {
this.view = new ProviderViews(this, {
provider: this.provider
});
const {
target
} = this.opts;
if (target) {
this.mount(target, this);
}
}
uninstall() {
this.view.tearDown();
this.unmount();
}
onFirstRender() {
return Promise.all([this.provider.fetchPreAuthToken(), this.view.getFolder()]);
}
render(state) {
const viewOptions = {};
if (this.getPluginState().files.length && !this.getPluginState().folders.length) {
viewOptions.viewType = 'grid';
viewOptions.showFilter = false;
viewOptions.showTitles = false;
}
return this.view.render(state, viewOptions);
}
}, _class.VERSION = "2.0.5", _temp);
module.exports = require("./Facebook.js");
{
"name": "@uppy/facebook",
"description": "Import files from Facebook, into Uppy.",
"version": "2.0.5",
"version": "2.0.6",
"license": "MIT",
"main": "lib/index.js",
"type": "module",
"types": "types/index.d.ts",

@@ -23,10 +24,10 @@ "keywords": [

"dependencies": {
"@uppy/companion-client": "^2.0.4",
"@uppy/provider-views": "^2.0.6",
"@uppy/utils": "^4.0.4",
"@uppy/companion-client": "^2.0.6",
"@uppy/provider-views": "^2.0.8",
"@uppy/utils": "^4.0.7",
"preact": "^10.5.13"
},
"peerDependencies": {
"@uppy/core": "^2.1.3"
"@uppy/core": "^2.1.9"
}
}

@@ -1,75 +0,1 @@

const { UIPlugin } = require('@uppy/core')
const { Provider } = require('@uppy/companion-client')
const { ProviderViews } = require('@uppy/provider-views')
const { h } = require('preact')
const locale = require('./locale.js')
module.exports = class Facebook extends UIPlugin {
static VERSION = require('../package.json').version
constructor (uppy, opts) {
super(uppy, opts)
this.id = this.opts.id || 'Facebook'
Provider.initPlugin(this, opts)
this.title = this.opts.title || 'Facebook'
this.icon = () => (
<svg aria-hidden="true" focusable="false" width="32" height="32" viewBox="0 0 32 32">
<g fill="none" fillRule="evenodd">
<rect className="uppy-ProviderIconBg" width="32" height="32" rx="16" fill="#3C5A99" />
<path d="M17.842 26v-8.667h2.653l.398-3.377h-3.051v-2.157c0-.978.248-1.644 1.527-1.644H21V7.132A19.914 19.914 0 0 0 18.623 7c-2.352 0-3.963 1.574-3.963 4.465v2.49H12v3.378h2.66V26h3.182z" fill="#FFF" fillRule="nonzero" />
</g>
</svg>
)
this.provider = new Provider(uppy, {
companionUrl: this.opts.companionUrl,
companionHeaders: this.opts.companionHeaders,
companionKeysParams: this.opts.companionKeysParams,
companionCookiesRule: this.opts.companionCookiesRule,
provider: 'facebook',
pluginId: this.id,
})
this.defaultLocale = locale
this.i18nInit()
this.title = this.i18n('pluginNameFacebook')
this.onFirstRender = this.onFirstRender.bind(this)
this.render = this.render.bind(this)
}
install () {
this.view = new ProviderViews(this, {
provider: this.provider,
})
const { target } = this.opts
if (target) {
this.mount(target, this)
}
}
uninstall () {
this.view.tearDown()
this.unmount()
}
onFirstRender () {
return Promise.all([
this.provider.fetchPreAuthToken(),
this.view.getFolder(),
])
}
render (state) {
const viewOptions = {}
if (this.getPluginState().files.length && !this.getPluginState().folders.length) {
viewOptions.viewType = 'grid'
viewOptions.showFilter = false
viewOptions.showTitles = false
}
return this.view.render(state, viewOptions)
}
}
export { default } from './Facebook.jsx'

@@ -1,2 +0,2 @@

module.exports = {
export default {
strings: {

@@ -3,0 +3,0 @@ pluginNameFacebook: 'Facebook',

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc