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 2.13.0 to 2.13.1

2

dragdrop.min.js

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

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

@@ -8,5 +8,13 @@ module.exports = dragDrop

if (typeof elem === 'string') {
var selector = elem
elem = window.document.querySelector(elem)
if (!elem) {
throw new Error('"' + selector + '" does not match any HTML elements')
}
}
if (!elem) {
throw new Error('"' + elem + '" is not a valid HTML element')
}
if (typeof listeners === 'function') {

@@ -13,0 +21,0 @@ listeners = { onDrop: listeners }

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

@@ -6,0 +6,0 @@ "bugs": {

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