chore: Update file-drop-element to the latest version 🚀 (#1017)

* fix(package): update file-drop-element to version 0.2.0

* chore(package): update lockfile yarn.lock

* fix: update for file drop 0.2.0
This commit is contained in:
greenkeeper[bot] 2019-02-19 22:24:03 -08:00 committed by Nolan Lawson
parent 44e3ea575e
commit 8049977563
5 changed files with 14 additions and 17 deletions

View File

@ -62,7 +62,7 @@
"events-light": "^1.0.5",
"express": "^4.16.4",
"file-api": "^0.10.4",
"file-drop-element": "0.0.9",
"file-drop-element": "0.2.0",
"form-data": "^2.3.3",
"glob": "^7.1.3",
"helmet": "^3.15.1",

View File

@ -73,10 +73,12 @@
mediaAccept
}),
methods: {
onFileDrop (e) {
let { file } = e
async onFileDrop (e) {
let { files } = e
let { realm } = this.get()
/* no await */ doMediaUpload(realm, file)
for (let file of files) { // upload one at a time to avoid hitting limits
await doMediaUpload(realm, file)
}
}
}
}

View File

@ -53,12 +53,6 @@
import { mediaAccept } from '../../_static/media'
export default {
oncreate () {
window.__composeToolbar = this // for testing
},
ondestroy () {
window.__composeToolbar = null
},
components: {
IconButton,
ComposeAutosuggest

View File

@ -131,9 +131,10 @@ export const uploadKittenImage = i => (exec(() => {
let image = images[`kitten${i}`]
let blob = blobUtils.base64StringToBlob(image.data, 'image/png')
blob.name = image.name
window.__composeToolbar.onFileChange({
target: { files: [blob] }
})
let fileDrop = document.querySelector('file-drop')
let event = new Event('filedrop', { bubbles: false })
event.files = [blob]
fileDrop.dispatchEvent(event)
}, {
dependencies: {
images,

View File

@ -3120,10 +3120,10 @@ file-api@^0.10.4:
mime ">= 1.2.11"
remedial ">= 1.0.7"
file-drop-element@0.0.9:
version "0.0.9"
resolved "https://registry.yarnpkg.com/file-drop-element/-/file-drop-element-0.0.9.tgz#d05fb6d3ab5d8e58e1978256057d14a3bdfa0746"
integrity sha512-LfcczsUadIDGh9uyVLF3fjHr1bT/E7NzyD/9m+/ANJTiys8k0IhLkb7ZWdFWNZPlvF8sdTuvnqZWYDPlmqj+rw==
file-drop-element@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/file-drop-element/-/file-drop-element-0.2.0.tgz#c9214515b9d6b11f32c7fcee299f3a671939409e"
integrity sha512-BGDdaJ4U2Cz0qhv6YGLnuhVtKcN8fp7F/4dS7lGSL1Fbe8m4cbGk+8awwHW0xcFqutMojxGchMVuWYQpEpP/Qg==
file-entry-cache@^2.0.0:
version "2.0.0"