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

drag-drop

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drag-drop - npm Package Compare versions

Comparing version 4.2.0 to 5.0.0

2

dragdrop.min.js

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

(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.DragDrop=a()}})(function(){return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c<g.length;c++)a(g[c]);return a}return b}()({1:[function(a,b){b.exports=function(a,b){function c(a,e){return a.reduce(function(a,d){return Array.isArray(d)&&e<b?a.concat(c(d,e+1)):a.concat(d)},[])}return b="number"==typeof b?b:1/0,b?c(a,1):Array.isArray(a)?a.map(function(a){return a}):a}},{}],2:[function(a,b){function c(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}function e(a){if(k===setTimeout)return setTimeout(a,0);if((k===c||!k)&&setTimeout)return k=setTimeout,setTimeout(a,0);try{return k(a,0)}catch(b){try{return k.call(null,a,0)}catch(b){return k.call(this,a,0)}}}function f(a){if(l===clearTimeout)return clearTimeout(a);if((l===d||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(a);try{return l(a)}catch(b){try{return l.call(null,a)}catch(b){return l.call(this,a)}}}function g(){p&&n&&(p=!1,n.length?o=n.concat(o):q=-1,o.length&&h())}function h(){if(!p){var a=e(g);p=!0;for(var b=o.length;b;){for(n=o,o=[];++q<b;)n&&n[q].run();q=-1,b=o.length}n=null,p=!1,f(a)}}function j(a,b){this.fun=a,this.array=b}function i(){}var k,l,m=b.exports={};(function(){try{k="function"==typeof setTimeout?setTimeout:c}catch(a){k=c}try{l="function"==typeof clearTimeout?clearTimeout:d}catch(a){l=d}})();var n,o=[],p=!1,q=-1;m.nextTick=function(a){var b=Array(arguments.length-1);if(1<arguments.length)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];o.push(new j(a,b)),1!==o.length||p||e(h)},j.prototype.run=function(){this.fun.apply(null,this.array)},m.title="browser",m.browser=!0,m.env={},m.argv=[],m.version="",m.versions={},m.on=i,m.addListener=i,m.once=i,m.off=i,m.removeListener=i,m.removeAllListeners=i,m.emit=i,m.prependListener=i,m.prependOnceListener=i,m.listeners=function(){return[]},m.binding=function(){throw new Error("process.binding is not supported")},m.cwd=function(){return"/"},m.chdir=function(){throw new Error("process.chdir is not supported")},m.umask=function(){return 0}},{}],3:[function(a,b){(function(a){b.exports=function(b,c){function d(b){function d(){c&&c(b,f),c=null}i?a.nextTick(d):d()}function e(a,b,c){f[a]=c,(0==--g||b)&&d(b)}var f,g,h,i=!0;Array.isArray(b)?(f=[],g=b.length):(h=Object.keys(b),f={},g=h.length),g?h?h.forEach(function(a){b[a](function(b,c){e(a,b,c)})}):b.forEach(function(a,b){a(function(a,c){e(b,a,c)})}):d(null),i=!1}}).call(this,a("_process"))},{_process:2}],"/":[function(a,b){function c(a,b){function d(){h.readEntries(function(a){0<a.length?(g=g.concat(Array.from(a)),d()):e()})}function e(){f(g.map(function(a){return function(b){c(a,b)}}),function(c,d){c?b(c):(d.push({fullPath:a.fullPath,name:a.name,isFile:!1,isDirectory:!0}),b(null,d))})}var g=[];if(a.isFile)a.file(function(c){c.fullPath=a.fullPath,c.isFile=!0,c.isDirectory=!1,b(null,c)},function(a){b(a)});else if(a.isDirectory){var h=a.createReader();d()}}b.exports=function(a,b){function e(a){return b.onDragEnter&&b.onDragEnter(a),a.stopPropagation(),a.preventDefault(),!1}function g(c){if(c.stopPropagation(),c.preventDefault(),b.onDragOver&&b.onDragOver(c),c.dataTransfer.items){var d=Array.from(c.dataTransfer.items),e=d.filter(function(a){return"file"===a.kind}),f=d.filter(function(a){return"string"===a.kind});if(0===e.length&&!b.onDropText)return;if(0===f.length&&!b.onDrop)return;if(0===e.length&&0===f.length)return}return a.classList.add("drag"),clearTimeout(l),c.dataTransfer.dropEffect="copy",!1}function h(a){return a.stopPropagation(),a.preventDefault(),b.onDragLeave&&b.onDragLeave(a),clearTimeout(l),l=setTimeout(j,50),!1}function i(a){a.stopPropagation(),a.preventDefault(),b.onDragLeave&&b.onDragLeave(a),clearTimeout(l),j();var e={x:a.clientX,y:a.clientY},g=a.dataTransfer.getData("text");if(g&&b.onDropText&&b.onDropText(g,e),b.onDrop&&a.dataTransfer.items){var h=a.dataTransfer.files,i=Array.from(a.dataTransfer.items).filter(function(a){return"file"===a.kind});if(0===i.length)return;f(i.map(function(a){return function(b){c(a.webkitGetAsEntry(),b)}}),function(a,c){if(a)throw a;var f=d(c),g=f.filter(function(a){return a.isFile}),i=f.filter(function(a){return a.isDirectory});b.onDrop(g,e,h,i)})}return!1}function j(){a.classList.remove("drag")}if("string"==typeof a){var k=a;if(a=window.document.querySelector(a),!a)throw new Error("\""+k+"\" does not match any HTML elements")}if(!a)throw new Error("\""+a+"\" is not a valid HTML element");"function"==typeof b&&(b={onDrop:b});var l;return a.addEventListener("dragenter",e,!1),a.addEventListener("dragover",g,!1),a.addEventListener("dragleave",h,!1),a.addEventListener("drop",i,!1),function(){j(),a.removeEventListener("dragenter",e,!1),a.removeEventListener("dragover",g,!1),a.removeEventListener("dragleave",h,!1),a.removeEventListener("drop",i,!1)}};var d=a("flatten"),f=a("run-parallel")},{flatten:1,"run-parallel":3}]},{},[])("/")});
(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.DragDrop=a()}})(function(){return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c<g.length;c++)a(g[c]);return a}return b}()({1:[function(a,b){function c(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}function e(a){if(l===setTimeout)return setTimeout(a,0);if((l===c||!l)&&setTimeout)return l=setTimeout,setTimeout(a,0);try{return l(a,0)}catch(b){try{return l.call(null,a,0)}catch(b){return l.call(this,a,0)}}}function f(a){if(m===clearTimeout)return clearTimeout(a);if((m===d||!m)&&clearTimeout)return m=clearTimeout,clearTimeout(a);try{return m(a)}catch(b){try{return m.call(null,a)}catch(b){return m.call(this,a)}}}function g(){q&&o&&(q=!1,o.length?p=o.concat(p):r=-1,p.length&&h())}function h(){if(!q){var a=e(g);q=!0;for(var b=p.length;b;){for(o=p,p=[];++r<b;)o&&o[r].run();r=-1,b=p.length}o=null,q=!1,f(a)}}function j(a,b){this.fun=a,this.array=b}function k(){}var l,m,n=b.exports={};(function(){try{l="function"==typeof setTimeout?setTimeout:c}catch(a){l=c}try{m="function"==typeof clearTimeout?clearTimeout:d}catch(a){m=d}})();var o,p=[],q=!1,r=-1;n.nextTick=function(a){var b=Array(arguments.length-1);if(1<arguments.length)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];p.push(new j(a,b)),1!==p.length||q||e(h)},j.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=k,n.addListener=k,n.once=k,n.off=k,n.removeListener=k,n.removeAllListeners=k,n.emit=k,n.prependListener=k,n.prependOnceListener=k,n.listeners=function(){return[]},n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},{}],2:[function(a,b){(function(a){b.exports=function(b,c){function d(b){function d(){c&&c(b,f),c=null}i?a.nextTick(d):d()}function e(a,b,c){f[a]=c,(0==--g||b)&&d(b)}var f,g,h,i=!0;Array.isArray(b)?(f=[],g=b.length):(h=Object.keys(b),f={},g=h.length),g?h?h.forEach(function(a){b[a](function(b,c){e(a,b,c)})}):b.forEach(function(a,b){a(function(a,c){e(b,a,c)})}):d(null),i=!1}}).call(this,a("_process"))},{_process:1}],"/":[function(a,b){function c(a,b){function e(){h.readEntries(function(a){0<a.length?(g=g.concat(Array.from(a)),e()):f()})}function f(){d(g.map(function(a){return function(b){c(a,b)}}),function(c,d){c?b(c):(d.push({fullPath:a.fullPath,name:a.name,isFile:!1,isDirectory:!0}),b(null,d))})}var g=[];if(a.isFile)a.file(function(c){c.fullPath=a.fullPath,c.isFile=!0,c.isDirectory=!1,b(null,c)},function(a){b(a)});else if(a.isDirectory){var h=a.createReader();e()}}b.exports=function(a,b){function e(a){return b.onDragEnter&&b.onDragEnter(a),a.stopPropagation(),a.preventDefault(),!1}function f(c){if(c.stopPropagation(),c.preventDefault(),b.onDragOver&&b.onDragOver(c),c.dataTransfer.items){var d=Array.from(c.dataTransfer.items),e=d.filter(function(a){return"file"===a.kind}),f=d.filter(function(a){return"string"===a.kind});if(0===e.length&&!b.onDropText)return;if(0===f.length&&!b.onDrop)return;if(0===e.length&&0===f.length)return}return a.classList.add("drag"),clearTimeout(k),c.dataTransfer.dropEffect="copy",!1}function g(a){return a.stopPropagation(),a.preventDefault(),b.onDragLeave&&b.onDragLeave(a),clearTimeout(k),k=setTimeout(i,50),!1}function h(a){a.stopPropagation(),a.preventDefault(),b.onDragLeave&&b.onDragLeave(a),clearTimeout(k),i();var e={x:a.clientX,y:a.clientY},f=a.dataTransfer.getData("text");if(f&&b.onDropText&&b.onDropText(f,e),b.onDrop&&a.dataTransfer.items){var g=a.dataTransfer.files,h=Array.from(a.dataTransfer.items).filter(function(a){return"file"===a.kind});if(0===h.length)return;d(h.map(function(a){return function(b){c(a.webkitGetAsEntry(),b)}}),function(a,c){if(a)throw a;var d=c.flat(),f=d.filter(function(a){return a.isFile}),h=d.filter(function(a){return a.isDirectory});b.onDrop(f,e,g,h)})}return!1}function i(){a.classList.remove("drag")}if("string"==typeof a){var j=a;if(a=window.document.querySelector(a),!a)throw new Error("\""+j+"\" does not match any HTML elements")}if(!a)throw new Error("\""+a+"\" is not a valid HTML element");"function"==typeof b&&(b={onDrop:b});var k;return a.addEventListener("dragenter",e,!1),a.addEventListener("dragover",f,!1),a.addEventListener("dragleave",g,!1),a.addEventListener("drop",h,!1),function(){i(),a.removeEventListener("dragenter",e,!1),a.removeEventListener("dragover",f,!1),a.removeEventListener("dragleave",g,!1),a.removeEventListener("drop",h,!1)}};var d=a("run-parallel")},{"run-parallel":2}]},{},[])("/")});
module.exports = dragDrop
var flatten = require('flatten')
var parallel = require('run-parallel')

@@ -137,3 +136,3 @@

var entries = flatten(results)
var entries = results.flat()

@@ -140,0 +139,0 @@ var files = entries.filter(function (item) {

{
"name": "drag-drop",
"description": "HTML5 drag & drop for humans",
"version": "4.2.0",
"version": "5.0.0",
"author": "Feross Aboukhadijeh <feross@feross.org> (http://feross.org/)",

@@ -11,9 +11,8 @@ "bugs": {

"blob-to-buffer": "^1.0.2",
"flatten": "^1.0.2",
"run-parallel": "^1.0.0"
},
"devDependencies": {
"babel-minify": "^0.4.3",
"babel-minify": "^0.5.0",
"browserify": "^16.1.0",
"ecstatic": "^3.2.0",
"ecstatic": "^4.0.0",
"html-inline": "^1.2.0",

@@ -20,0 +19,0 @@ "standard": "*",

@@ -15,3 +15,3 @@ # drag-drop [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

In case you didn't know, the
[HTML5 drag and drop API](https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications)
[HTML5 drag and drop API](https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API)
is a

@@ -78,3 +78,3 @@ [total disaster](http://www.quirksmode.org/blog/archives/2009/09/the_html5_drag.html)!

console.log(file.type)
console.log(file.lastModifiedData)
console.log(file.lastModifiedDate)
console.log(file.fullPath) // not real full path due to browser security restrictions

@@ -81,0 +81,0 @@ console.log(file.path) // in Electron, this contains the actual full path

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