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

@uppy/google-drive

Package Overview
Dependencies
Maintainers
8
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uppy/google-drive - npm Package Compare versions

Comparing version 2.0.5 to 2.1.0

lib/GoogleDrive.js

7

CHANGELOG.md
# @uppy/google-drive
## 2.1.0
Released: 2022-05-14
Included in: Uppy v2.10.0
- @uppy/google-drive: refactor to ESM (Antoine du Hamel / #3683)
## 2.0.5

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

10

lib/DriveProviderViews.js
"use strict";
const {
ProviderViews
} = require('@uppy/provider-views');
var _providerViews = require("@uppy/provider-views");
module.exports = class DriveProviderViews extends ProviderViews {
class DriveProviderViews extends _providerViews.ProviderViews {
toggleCheckbox(e, file) {

@@ -17,2 +15,4 @@ e.stopPropagation();

};
}
module.exports = DriveProviderViews;
"use strict";
var _class, _temp;
const {
UIPlugin
} = require('@uppy/core');
const {
Provider
} = require('@uppy/companion-client');
const {
h
} = require('preact');
const DriveProviderViews = require('./DriveProviderViews');
const locale = require('./locale');
module.exports = (_temp = _class = class GoogleDrive extends UIPlugin {
constructor(uppy, opts) {
super(uppy, opts);
this.id = this.opts.id || 'GoogleDrive';
this.title = this.opts.title || 'Google Drive';
Provider.initPlugin(this, opts);
this.title = this.opts.title || 'Google Drive';
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: "#4285F4",
width: "32",
height: "32",
rx: "16"
}), h("path", {
d: "M25.216 17.736L19.043 7h-6.086l6.175 10.736h6.084zm-11.275.896L10.9 24h11.723l3.04-5.368H13.942zm-1.789-10.29l-5.816 10.29L9.38 24l5.905-10.29-3.132-5.369z",
fill: "#FFF"
})));
this.provider = new Provider(uppy, {
companionUrl: this.opts.companionUrl,
companionHeaders: this.opts.companionHeaders,
companionKeysParams: this.opts.companionKeysParams,
companionCookiesRule: this.opts.companionCookiesRule,
provider: 'drive',
pluginId: this.id
});
this.defaultLocale = locale;
this.i18nInit();
this.title = this.i18n('pluginNameGoogleDrive');
this.onFirstRender = this.onFirstRender.bind(this);
this.render = this.render.bind(this);
}
install() {
this.view = new DriveProviderViews(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('root', '/')]);
}
render(state) {
return this.view.render(state);
}
}, _class.VERSION = "2.0.5", _temp);
module.exports = require("./GoogleDrive.js");
{
"name": "@uppy/google-drive",
"description": "The Google Drive plugin for Uppy lets users import files from their Google Drive account",
"version": "2.0.5",
"version": "2.1.0",
"license": "MIT",
"main": "lib/index.js",
"types": "types/index.d.ts",
"type": "module",
"keywords": [

@@ -24,10 +25,10 @@ "file uploader",

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

@@ -1,4 +0,4 @@

const { ProviderViews } = require('@uppy/provider-views')
import { ProviderViews } from '@uppy/provider-views'
module.exports = class DriveProviderViews extends ProviderViews {
export default class DriveProviderViews extends ProviderViews {
toggleCheckbox (e, file) {

@@ -5,0 +5,0 @@ e.stopPropagation()

@@ -1,85 +0,1 @@

const { UIPlugin } = require('@uppy/core')
const { Provider } = require('@uppy/companion-client')
const { h } = require('preact')
const DriveProviderViews = require('./DriveProviderViews')
const locale = require('./locale')
module.exports = class GoogleDrive extends UIPlugin {
static VERSION = require('../package.json').version
constructor (uppy, opts) {
super(uppy, opts)
this.id = this.opts.id || 'GoogleDrive'
this.title = this.opts.title || 'Google Drive'
Provider.initPlugin(this, opts)
this.title = this.opts.title || 'Google Drive'
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"
fill="#4285F4"
width="32"
height="32"
rx="16"
/>
<path
d="M25.216 17.736L19.043 7h-6.086l6.175 10.736h6.084zm-11.275.896L10.9 24h11.723l3.04-5.368H13.942zm-1.789-10.29l-5.816 10.29L9.38 24l5.905-10.29-3.132-5.369z"
fill="#FFF"
/>
</g>
</svg>
)
this.provider = new Provider(uppy, {
companionUrl: this.opts.companionUrl,
companionHeaders: this.opts.companionHeaders,
companionKeysParams: this.opts.companionKeysParams,
companionCookiesRule: this.opts.companionCookiesRule,
provider: 'drive',
pluginId: this.id,
})
this.defaultLocale = locale
this.i18nInit()
this.title = this.i18n('pluginNameGoogleDrive')
this.onFirstRender = this.onFirstRender.bind(this)
this.render = this.render.bind(this)
}
install () {
this.view = new DriveProviderViews(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('root', '/'),
])
}
render (state) {
return this.view.render(state)
}
}
export { default } from './GoogleDrive.jsx'

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

module.exports = {
export default {
strings: {

@@ -3,0 +3,0 @@ pluginNameGoogleDrive: 'Google Drive',

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

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