Socket
Socket
Sign inDemoInstall

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.3.0 to 2.3.1

2

dragdrop.bundle.js

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

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.DragDrop=t()}}(function(){return function t(n,e,r){function o(a,u){if(!e[a]){if(!n[a]){var f="function"==typeof require&&require;if(!u&&f)return f(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[a]={exports:{}};n[a][0].call(l.exports,function(t){var e=n[a][1][t];return o(e?e:t)},l,l.exports,t,n,e,r)}return e[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,n,e){n.exports=function(t,n){function e(t,r){return t.reduce(function(t,o){return Array.isArray(o)&&n>r?t.concat(e(o,r+1)):t.concat(o)},[])}return n="number"==typeof n?n:1/0,e(t,1)}},{}],2:[function(t,n,e){function r(t,n,e){var r=!0,u=!0;if("function"!=typeof t)throw new TypeError(a);return e===!1?r=!1:o(e)&&(r="leading"in e?!!e.leading:r,u="trailing"in e?!!e.trailing:u),i(t,n,{leading:r,maxWait:+n,trailing:u})}function o(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var i=t("lodash.debounce"),a="Expected a function";n.exports=r},{"lodash.debounce":3}],3:[function(t,n,e){function r(t,n,e){function r(){h&&clearTimeout(h),d&&clearTimeout(d),w=0,d=h=m=void 0}function i(n,e){e&&clearTimeout(e),d=h=m=void 0,n&&(w=c(),v=t.apply(y,p),h||d||(p=y=void 0))}function f(){var t=n-(c()-g);0>=t||t>n?i(m,d):h=setTimeout(f,t)}function l(){i(b,h)}function s(){if(p=arguments,g=c(),y=this,m=b&&(h||!x),E===!1)var e=x&&!h;else{d||x||(w=g);var r=E-(g-w),o=0>=r||r>E;o?(d&&(d=clearTimeout(d)),w=g,v=t.apply(y,p)):d||(d=setTimeout(l,r))}return o&&h?h=clearTimeout(h):h||n===E||(h=setTimeout(f,n)),e&&(o=!0,v=t.apply(y,p)),!o||h||d||(p=y=void 0),v}var p,d,v,g,y,h,m,w=0,E=!1,b=!0;if("function"!=typeof t)throw new TypeError(a);if(n=0>n?0:+n||0,e===!0){var x=!0;b=!1}else o(e)&&(x=!!e.leading,E="maxWait"in e&&u(+e.maxWait||0,n),b="trailing"in e?!!e.trailing:b);return s.cancel=r,s}function o(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var i=t("lodash._getnative"),a="Expected a function",u=Math.max,f=i(Date,"now"),c=f||function(){return(new Date).getTime()};n.exports=r},{"lodash._getnative":4}],4:[function(t,n,e){function r(t){return!!t&&"object"==typeof t}function o(t,n){var e=null==t?void 0:t[n];return u(e)?e:void 0}function i(t){return a(t)&&d.call(t)==f}function a(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function u(t){return null==t?!1:i(t)?v.test(s.call(t)):r(t)&&c.test(t)}var f="[object Function]",c=/^\[object .+?Constructor\]$/,l=Object.prototype,s=Function.prototype.toString,p=l.hasOwnProperty,d=l.toString,v=RegExp("^"+s.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");n.exports=o},{}],5:[function(t,n,e){var r=t("dezalgo");n.exports=function(t,n){function e(t,e,r){o[t]=r,(0===--i||e)&&(n&&n(e,o),n=null)}n&&(n=r(n));var o,i,a;Array.isArray(t)?(o=[],i=t.length):(a=Object.keys(t),o={},i=a.length),i?a?a.forEach(function(n){t[n](e.bind(void 0,n))}):t.forEach(function(t,n){t(e.bind(void 0,n))}):(n&&n(null,o),n=null)}},{dezalgo:6}],6:[function(t,n,e){function r(t){var n=!0;return i(function(){n=!1}),function(){var e=arguments,r=this;n?i(function(){t.apply(r,e)}):t.apply(r,e)}}var o=t("wrappy");n.exports=o(r);var i=t("asap")},{asap:7,wrappy:9}],7:[function(t,n,e){"use strict";function r(){if(f.length)throw f.shift()}function o(t){var n;n=u.length?u.pop():new i,n.task=t,a(n)}function i(){this.task=null}var a=t("./raw"),u=[],f=[],c=a.makeRequestCallFromTimer(r);n.exports=o,i.prototype.call=function(){try{this.task.call()}catch(t){o.onerror?o.onerror(t):(f.push(t),c())}finally{this.task=null,u[u.length]=this}}},{"./raw":8}],8:[function(t,n,e){(function(t){"use strict";function e(t){u.length||(a(),f=!0),u[u.length]=t}function r(){for(;c<u.length;){var t=c;if(c+=1,u[t].call(),c>l){for(var n=0,e=u.length-c;e>n;n++)u[n]=u[n+c];u.length-=c,c=0}}u.length=0,c=0,f=!1}function o(t){var n=1,e=new s(t),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){n=-n,r.data=n}}function i(t){return function(){function n(){clearTimeout(e),clearInterval(r),t()}var e=setTimeout(n,0),r=setInterval(n,50)}}n.exports=e;var a,u=[],f=!1,c=0,l=1024,s=t.MutationObserver||t.WebKitMutationObserver;a="function"==typeof s?o(r):i(r),e.requestFlush=a,e.makeRequestCallFromTimer=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(t,n,e){function r(t,n){function e(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];var r=t.apply(this,n),o=n[n.length-1];return"function"==typeof r&&r!==o&&Object.keys(o).forEach(function(t){r[t]=o[t]}),r}if(t&&n)return r(t)(n);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(n){e[n]=t[n]}),e}n.exports=r},{}],"/":[function(t,n,e){function r(t,n){"string"==typeof t&&(t=document.querySelector(t));var e=i(t),r=a(t,n);return t.addEventListener("dragenter",o,!1),t.addEventListener("dragover",e,!1),t.addEventListener("drop",r,!1),function(){t instanceof Element&&t.classList.remove("drag"),t.removeEventListener("dragenter",o,!1),t.removeEventListener("dragover",e,!1),t.removeEventListener("drop",r,!1)}}function o(t){return t.stopPropagation(),t.preventDefault(),!1}function i(t){var n=s(function(){t instanceof Element&&t.classList.add("drag"),t.timeout&&clearTimeout(t.timeout),t.timeout=setTimeout(function(){t instanceof Element&&t.classList.remove("drag")},150)},100,{trailing:!1});return function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy",n()}}function a(t,n){return function(e){e.stopPropagation(),e.preventDefault(),t instanceof Element&&t.classList.remove("drag");var r={x:e.clientX,y:e.clientY};if(e.dataTransfer.items)l(f(e.dataTransfer.items).map(function(t){return function(n){u(t.webkitGetAsEntry(),n)}}),function(t,e){t||n(c(e),r)});else{var o=f(e.dataTransfer.files);o.forEach(function(t){t.fullPath="/"+t.name}),n(o,r)}return!1}}function u(t,n){function e(){i.readEntries(function(t){t.length>0?(o=o.concat(f(t)),e()):r()})}function r(){l(o.map(function(t){return function(n){u(t,n)}}),n)}var o=[];if(t.isFile)t.file(function(e){e.fullPath=t.fullPath,n(null,e)});else if(t.isDirectory){var i=t.createReader();e()}}function f(t){return Array.prototype.slice.call(t||[],0)}n.exports=r;var c=t("flatten"),l=t("run-parallel"),s=t("lodash.throttle")},{flatten:1,"lodash.throttle":2,"run-parallel":5}]},{},[])("/")});
!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.DragDrop=n()}}(function(){return function n(t,e,r){function o(u,a){if(!e[u]){if(!t[u]){var c="function"==typeof require&&require;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var l=e[u]={exports:{}};t[u][0].call(l.exports,function(n){var e=t[u][1][n];return o(e?e:n)},l,l.exports,n,t,e,r)}return e[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(n,t,e){function r(){l=!1,a.length?f=a.concat(f):s=-1,f.length&&o()}function o(){if(!l){var n=setTimeout(r);l=!0;for(var t=f.length;t;){for(a=f,f=[];++s<t;)a[s].run();s=-1,t=f.length}a=null,l=!1,clearTimeout(n)}}function i(n,t){this.fun=n,this.array=t}function u(){}var a,c=t.exports={},f=[],l=!1,s=-1;c.nextTick=function(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];f.push(new i(n,t)),1!==f.length||l||setTimeout(o,0)},i.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=u,c.addListener=u,c.once=u,c.off=u,c.removeListener=u,c.removeAllListeners=u,c.emit=u,c.binding=function(n){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(n){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},{}],2:[function(n,t,e){t.exports=function(n,t){function e(n,r){return n.reduce(function(n,o){return Array.isArray(o)&&t>r?n.concat(e(o,r+1)):n.concat(o)},[])}return t="number"==typeof t?t:1/0,e(n,1)}},{}],3:[function(n,t,e){function r(n,t,e){var r=!0,a=!0;if("function"!=typeof n)throw new TypeError(u);return e===!1?r=!1:o(e)&&(r="leading"in e?!!e.leading:r,a="trailing"in e?!!e.trailing:a),i(n,t,{leading:r,maxWait:+t,trailing:a})}function o(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}var i=n("lodash.debounce"),u="Expected a function";t.exports=r},{"lodash.debounce":4}],4:[function(n,t,e){function r(n,t,e){function r(){h&&clearTimeout(h),p&&clearTimeout(p),w=0,p=h=y=void 0}function i(t,e){e&&clearTimeout(e),p=h=y=void 0,t&&(w=f(),v=n.apply(m,d),h||p||(d=m=void 0))}function c(){var n=t-(f()-g);0>=n||n>t?i(y,p):h=setTimeout(c,n)}function l(){i(x,h)}function s(){if(d=arguments,g=f(),m=this,y=x&&(h||!T),E===!1)var e=T&&!h;else{p||T||(w=g);var r=E-(g-w),o=0>=r||r>E;o?(p&&(p=clearTimeout(p)),w=g,v=n.apply(m,d)):p||(p=setTimeout(l,r))}return o&&h?h=clearTimeout(h):h||t===E||(h=setTimeout(c,t)),e&&(o=!0,v=n.apply(m,d)),!o||h||p||(d=m=void 0),v}var d,p,v,g,m,h,y,w=0,E=!1,x=!0;if("function"!=typeof n)throw new TypeError(u);if(t=0>t?0:+t||0,e===!0){var T=!0;x=!1}else o(e)&&(T=!!e.leading,E="maxWait"in e&&a(+e.maxWait||0,t),x="trailing"in e?!!e.trailing:x);return s.cancel=r,s}function o(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}var i=n("lodash._getnative"),u="Expected a function",a=Math.max,c=i(Date,"now"),f=c||function(){return(new Date).getTime()};t.exports=r},{"lodash._getnative":5}],5:[function(n,t,e){function r(n){return!!n&&"object"==typeof n}function o(n,t){var e=null==n?void 0:n[t];return a(e)?e:void 0}function i(n){return u(n)&&p.call(n)==c}function u(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function a(n){return null==n?!1:i(n)?v.test(s.call(n)):r(n)&&f.test(n)}var c="[object Function]",f=/^\[object .+?Constructor\]$/,l=Object.prototype,s=Function.prototype.toString,d=l.hasOwnProperty,p=l.toString,v=RegExp("^"+s.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=o},{}],6:[function(n,t,e){(function(n){t.exports=function(t,e){function r(t){function r(){e&&e(t,i),e=null}c?n.nextTick(r):r()}function o(n,t,e){i[n]=e,(0===--u||t)&&r(t)}var i,u,a,c=!0;Array.isArray(t)?(i=[],u=t.length):(a=Object.keys(t),i={},u=a.length),u?a?a.forEach(function(n){t[n](o.bind(void 0,n))}):t.forEach(function(n,t){n(o.bind(void 0,t))}):r(null),c=!1}}).call(this,n("_process"))},{_process:1}],"/":[function(n,t,e){function r(n,t){"string"==typeof n&&(n=window.document.querySelector(n));var e=i(n),r=u(n,t);return n.addEventListener("dragenter",o,!1),n.addEventListener("dragover",e,!1),n.addEventListener("drop",r,!1),function(){n instanceof window.Element&&n.classList.remove("drag"),n.removeEventListener("dragenter",o,!1),n.removeEventListener("dragover",e,!1),n.removeEventListener("drop",r,!1)}}function o(n){return n.stopPropagation(),n.preventDefault(),!1}function i(n){var t=s(function(){n instanceof window.Element&&n.classList.add("drag"),n.timeout&&clearTimeout(n.timeout),n.timeout=setTimeout(function(){n instanceof window.Element&&n.classList.remove("drag")},150)},100,{trailing:!1});return function(n){n.stopPropagation(),n.preventDefault(),n.dataTransfer.dropEffect="copy",t()}}function u(n,t){return function(e){e.stopPropagation(),e.preventDefault(),n instanceof window.Element&&n.classList.remove("drag");var r={x:e.clientX,y:e.clientY};if(e.dataTransfer.items)l(c(e.dataTransfer.items).map(function(n){return function(t){a(n.webkitGetAsEntry(),t)}}),function(n,e){n||t(f(e),r)});else{var o=c(e.dataTransfer.files);o.forEach(function(n){n.fullPath="/"+n.name}),t(o,r)}return!1}}function a(n,t){function e(){i.readEntries(function(n){n.length>0?(o=o.concat(c(n)),e()):r()})}function r(){l(o.map(function(n){return function(t){a(n,t)}}),t)}var o=[];if(n.isFile)n.file(function(e){e.fullPath=n.fullPath,t(null,e)});else if(n.isDirectory){var i=n.createReader();e()}}function c(n){return Array.prototype.slice.call(n||[],0)}t.exports=r;var f=n("flatten"),l=n("run-parallel"),s=n("lodash.throttle")},{flatten:2,"lodash.throttle":3,"run-parallel":6}]},{},[])("/")});

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

/* global Element */
module.exports = dragDrop

@@ -10,3 +8,3 @@

function dragDrop (elem, ondrop) {
if (typeof elem === 'string') elem = document.querySelector(elem)
if (typeof elem === 'string') elem = window.document.querySelector(elem)

@@ -22,3 +20,3 @@ var onDragOver = makeOnDragOver(elem)

return function remove () {
if (elem instanceof Element) elem.classList.remove('drag')
if (elem instanceof window.Element) elem.classList.remove('drag')
elem.removeEventListener('dragenter', stopEvent, false)

@@ -38,7 +36,7 @@ elem.removeEventListener('dragover', onDragOver, false)

var fn = throttle(function () {
if (elem instanceof Element) elem.classList.add('drag')
if (elem instanceof window.Element) elem.classList.add('drag')
if (elem.timeout) clearTimeout(elem.timeout)
elem.timeout = setTimeout(function () {
if (elem instanceof Element) elem.classList.remove('drag')
if (elem instanceof window.Element) elem.classList.remove('drag')
}, 150)

@@ -59,3 +57,3 @@ }, 100, {trailing: false})

e.preventDefault()
if (elem instanceof Element) elem.classList.remove('drag')
if (elem instanceof window.Element) elem.classList.remove('drag')
var pos = { x: e.clientX, y: e.clientY }

@@ -62,0 +60,0 @@ if (e.dataTransfer.items) {

{
"name": "drag-drop",
"description": "HTML5 drag & drop for humans",
"version": "2.3.0",
"version": "2.3.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