From fd9c1933adbca4dfe1f59508c666c19bb3c1248b Mon Sep 17 00:00:00 2001 From: ifedapoolarewaju Date: Tue, 4 Feb 2020 12:16:30 +0100 Subject: [PATCH 01/13] website: optionally enable facebook with transloadit --- website/src/examples/transloadit/app.es6 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/website/src/examples/transloadit/app.es6 b/website/src/examples/transloadit/app.es6 index 5d7c2686e..0f5d5e9b6 100644 --- a/website/src/examples/transloadit/app.es6 +++ b/website/src/examples/transloadit/app.es6 @@ -5,7 +5,9 @@ const Dashboard = require('@uppy/dashboard') const Webcam = require('@uppy/webcam') const Transloadit = require('@uppy/transloadit') const Instagram = require('@uppy/instagram') +const Facebook = require('@uppy/facebook') const { createHmac } = require('crypto') +const COMPANION = require('../env') function sha1 (key, text) { return createHmac('sha1', key) @@ -97,7 +99,13 @@ function initUppy (opts = {}) { companionUrl: 'https://api2.transloadit.com/companion', companionAllowedHosts: Transloadit.COMPANION_PATTERN }) - .use(Webcam, { target: Dashboard, modes: ['picture'] }) + if (document.location.hash === '#enable-facebook') { + uppy.use(Facebook, { + target: Dashboard, + companionUrl: COMPANION + }) + } + uppy.use(Webcam, { target: Dashboard, modes: ['picture'] }) uppy .on('transloadit:result', (stepName, result) => { From b7bdce7363c68193aa6017247681f7c9345300bc Mon Sep 17 00:00:00 2001 From: Kevin van Zonneveld Date: Wed, 5 Feb 2020 13:49:48 +0100 Subject: [PATCH 02/13] Upload downloadable zip archive of releases to CDN (#2052) * Fix jsdoc warnings * Upload downloadable zip archive of releases to CDN * var -> const * Only upload .zip for the main uppy package * Implement @goto-bus-stop's feedback --- bin/upload-to-cdn.js | 19 +++++++++++++++---- package.json | 1 + 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bin/upload-to-cdn.js b/bin/upload-to-cdn.js index d2acf8988..6d312921e 100644 --- a/bin/upload-to-cdn.js +++ b/bin/upload-to-cdn.js @@ -30,6 +30,7 @@ const mime = require('mime-types') const { promisify } = require('util') const readFile = promisify(require('fs').readFile) const finished = promisify(require('stream').finished) +const AdmZip = require('adm-zip') function delay (ms) { return new Promise(resolve => setTimeout(resolve, ms)) @@ -41,10 +42,10 @@ const AWS_DIRECTORY = '756b8efaed084669b02cb99d4540d81f/default' /** * Get remote dist/ files by fetching the tarball for the given version - * from npm and filtering it down to package/dist/ files. +from npm and filtering it down to package/dist/ files. * - * @param {string} Package name, eg. @uppy/robodog - * @param {string} Package version, eg. "1.2.0" + * @param {string} packageName eg. @uppy/robodog + * @param {string} version eg. 1.8.0 * @returns a Map, filename → content */ async function getRemoteDistFiles (packageName, version) { @@ -74,7 +75,7 @@ async function getRemoteDistFiles (packageName, version) { * Get local dist/ files by asking npm-packlist what files would be added * to an npm package during publish, and filtering those down to just dist/ files. * - * @param {string} Base file path of the package, eg. ./packages/@uppy/locales + * @param {string} packagePath Base file path of the package, eg. ./packages/@uppy/locales * @returns a Map, filename → content */ async function getLocalDistFiles (packagePath) { @@ -160,6 +161,16 @@ async function main (packageName, version) { ? await getRemoteDistFiles(packageName, version) : await getLocalDistFiles(packagePath) + if (packageName === 'uppy') { + // Create downloadable zip archive + const zip = new AdmZip() + for (const [filename, buffer] of files.entries()) { + zip.addFile(filename, buffer) + } + + files.set(`uppy-v${version}.zip`, zip.toBuffer()) + } + for (const [filename, buffer] of files.entries()) { const key = path.posix.join(AWS_DIRECTORY, outputPath, filename) console.log(`pushing s3://${AWS_BUCKET}/${key}`) diff --git a/package.json b/package.json index 40beb0838..9abe57d2e 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,7 @@ "@wdio/local-runner": "^5.16.15", "@wdio/mocha-framework": "^5.16.15", "@wdio/sauce-service": "^5.16.10", + "adm-zip": "0.4.13", "aliasify": "^2.1.0", "autoprefixer": "^9.7.3", "babel-eslint": "^10.0.3", From 44cc071471c472b129e0a91b5c86f470a737daa0 Mon Sep 17 00:00:00 2001 From: Artur Paikin Date: Wed, 5 Feb 2020 15:54:56 +0300 Subject: [PATCH 03/13] informer, status-bar: Display a browser alert when an error question mark button is clicked (#2031) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Display a browser alrert when an error question mark button is clicked Informer can dissappear, while the alert dialog will stay on screen indefinitely. Plus it’s easier to copy/paste from the alert, than the bubble (virtually impossible). * Keep displaying Informer when the message ? bubble is hovered * Tweak line-height --- packages/@uppy/informer/src/index.js | 21 +++++++++++++++++---- packages/@uppy/status-bar/src/StatusBar.js | 6 ++++++ packages/@uppy/status-bar/src/style.scss | 1 + 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/packages/@uppy/informer/src/index.js b/packages/@uppy/informer/src/index.js index 646ca8088..a993b2436 100644 --- a/packages/@uppy/informer/src/index.js +++ b/packages/@uppy/informer/src/index.js @@ -19,16 +19,26 @@ module.exports = class Informer extends Plugin { // set default options const defaultOptions = {} - // merge default options with the ones set by user this.opts = Object.assign({}, defaultOptions, opts) - - this.render = this.render.bind(this) } - render (state) { + render = (state) => { const { isHidden, message, details } = state.info + function displayErrorAlert () { + const errorMessage = `${message} \n\n ${details}` + alert(errorMessage) + } + + const handleMouseOver = () => { + clearTimeout(this.uppy.infoTimeoutID) + } + + const handleMouseLeave = () => { + this.uppy.infoTimeoutID = setTimeout(this.uppy.hideInfo, 2000) + } + return ( - - + + +// const robodog = require('@uppy/robodog') const TRANSLOADIT_EXAMPLE_KEY = '35c1aed03f5011e982b6afe82599b6a0' diff --git a/website/src/examples/markdown-snippets/app.html b/website/src/examples/markdown-snippets/app.html index d90cf7b1d..d0265734e 100644 --- a/website/src/examples/markdown-snippets/app.html +++ b/website/src/examples/markdown-snippets/app.html @@ -1,6 +1,6 @@ + -->

Create a new snippet

diff --git a/website/themes/uppy/layout/index.ejs b/website/themes/uppy/layout/index.ejs index 791f625ba..afb4233f1 100644 --- a/website/themes/uppy/layout/index.ejs +++ b/website/themes/uppy/layout/index.ejs @@ -144,8 +144,8 @@

© <%- date(Date.now(), 'YYYY') %> Transloadit

- - + +