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

react-dnd-html5-backend

Package Overview
Dependencies
Maintainers
3
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dnd-html5-backend - npm Package Compare versions

Comparing version 2.1.2 to 2.2.0

.travis.yml

3

dist/ReactDnDHTML5Backend.min.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ReactDnDHTML5Backend=e():t.ReactDnDHTML5Backend=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function o(t){return t&&t.__esModule?t:{"default":t}}function i(t){return new u["default"](t)}e.__esModule=!0,e["default"]=i;var a=r(28),u=o(a),s=r(32),c=o(s),f=r(7),p=n(f);e.NativeTypes=p,e.getEmptyImage=c["default"]},function(t,e){function r(t){var e=typeof t;return"number"==e||"boolean"==e||"string"==e&&"__proto__"!==t||null==t}t.exports=r},function(t,e,r){var n=r(8),o=r(9),i=n(o,"Map");t.exports=i},function(t,e,r){function n(t,e){for(var r=t.length;r--;)if(o(t[r][0],e))return r;return-1}var o=r(5);t.exports=n},function(t,e,r){var n=r(8),o=n(Object,"create");t.exports=o},function(t,e){function r(t,e){return t===e||t!==t&&e!==e}t.exports=r},function(t,e,r){function n(t,e){if("function"!=typeof t)throw new TypeError(a);return e=u(void 0===e?t.length-1:i(e),0),function(){for(var r=arguments,n=-1,i=u(r.length-e,0),a=Array(i);++n<i;)a[n]=r[e+n];switch(e){case 0:return t.call(this,a);case 1:return t.call(this,r[0],a);case 2:return t.call(this,r[0],r[1],a)}var s=Array(e+1);for(n=-1;++n<e;)s[n]=r[n];return s[e]=a,o(t,this,s)}}var o=r(18),i=r(81),a="Expected a function",u=Math.max;t.exports=n},function(t,e){"use strict";e.__esModule=!0;var r="__NATIVE_FILE__";e.FILE=r;var n="__NATIVE_URL__";e.URL=n;var o="__NATIVE_TEXT__";e.TEXT=o},function(t,e,r){function n(t,e){var r=null==t?void 0:t[e];return o(r)?r:void 0}var o=r(76);t.exports=n},function(t,e,r){(function(t,n){var o=r(54),i={"function":!0,object:!0},a=i[typeof e]&&e&&!e.nodeType?e:null,u=i[typeof t]&&t&&!t.nodeType?t:null,s=o(a&&u&&"object"==typeof n&&n),c=o(i[typeof self]&&self),f=o(i[typeof window]&&window),p=o(i[typeof this]&&this),d=s||f!==(p&&p.window)&&f||c||p||Function("return this")();t.exports=d}).call(e,r(85)(t),function(){return this}())},function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){function n(t){return i(t)&&o(t)}var o=r(25),i=r(14);t.exports=n},function(t,e,r){function n(t){var e=o(t)?s.call(t):"";return e==i||e==a}var o=r(13),i="[object Function]",a="[object GeneratorFunction]",u=Object.prototype,s=u.toString;t.exports=n},function(t,e){function r(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=r},function(t,e){function r(t){return!!t&&"object"==typeof t}t.exports=r},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=r(79),i=n(o),a=i["default"](function(){return/firefox/i.test(navigator.userAgent)});e.isFirefox=a;var u=i["default"](function(){return Boolean(window.safari)});e.isSafari=u},function(t,e,r){function n(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}var o=r(68),i=r(69),a=r(70),u=r(71),s=r(72);n.prototype.clear=o,n.prototype["delete"]=i,n.prototype.get=a,n.prototype.has=u,n.prototype.set=s,t.exports=n},function(t,e,r){function n(t){var e=-1,r=t?t.length:0;for(this.__data__=new o;++e<r;)this.push(t[e])}var o=r(16),i=r(53);n.prototype.push=i,t.exports=n},function(t,e){function r(t,e,r){var n=r.length;switch(n){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}t.exports=r},function(t,e,r){function n(t,e){return!!t.length&&o(t,e,0)>-1}var o=r(47);t.exports=n},function(t,e){function r(t,e,r){for(var n=-1,o=t.length;++n<o;)if(r(e,t[n]))return!0;return!1}t.exports=r},function(t,e,r){function n(t,e){var r=t.__data__;if(o(e)){var n=r.__data__,a="string"==typeof e?n.string:n.hash;return a[e]===i}return r.has(e)}var o=r(1),i="__lodash_hash_undefined__";t.exports=n},function(t,e,r){function n(t,e){return o?void 0!==t[e]:a.call(t,e)}var o=r(4),i=Object.prototype,a=i.hasOwnProperty;t.exports=n},function(t,e){function r(t,e){return t="number"==typeof t||o.test(t)?+t:-1,e=null==e?n:e,t>-1&&t%1==0&&e>t}var n=9007199254740991,o=/^(?:0|[1-9]\d*)$/;t.exports=r},function(t,e,r){function n(t){return o(t)&&u.call(t,"callee")&&(!c.call(t,"callee")||s.call(t)==i)}var o=r(11),i="[object Arguments]",a=Object.prototype,u=a.hasOwnProperty,s=a.toString,c=a.propertyIsEnumerable;t.exports=n},function(t,e,r){function n(t){return null!=t&&!("function"==typeof t&&i(t))&&a(o(t))}var o=r(58),i=r(12),a=r(26);t.exports=n},function(t,e){function r(t){return"number"==typeof t&&t>-1&&t%1==0&&n>=t}var n=9007199254740991;t.exports=r},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var i=r(83),a=n(i),u=r(84),s=n(u),c=function(){function t(){o(this,t),this.entered=[]}return t.prototype.enter=function(t){var e=this.entered.length;return this.entered=a["default"](this.entered.filter(function(e){return document.documentElement.contains(e)&&(!e.contains||e.contains(t))}),[t]),0===e&&this.entered.length>0},t.prototype.leave=function(t){var e=this.entered.length;return this.entered=s["default"](this.entered.filter(function(t){return document.documentElement.contains(t)}),t),e>0&&0===this.entered.length},t.prototype.reset=function(){this.entered=[]},t}();e["default"]=c,t.exports=e["default"]},function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function o(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var a=r(75),u=o(a),s=r(33),c=o(s),f=r(27),p=o(f),d=r(15),h=r(31),l=r(30),v=r(7),g=n(v),y=function(){function t(e){i(this,t),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.sourcePreviewNodes={},this.sourcePreviewNodeOptions={},this.sourceNodes={},this.sourceNodeOptions={},this.enterLeaveCounter=new p["default"],this.getSourceClientOffset=this.getSourceClientOffset.bind(this),this.handleTopDragStart=this.handleTopDragStart.bind(this),this.handleTopDragStartCapture=this.handleTopDragStartCapture.bind(this),this.handleTopDragEndCapture=this.handleTopDragEndCapture.bind(this),this.handleTopDragEnter=this.handleTopDragEnter.bind(this),this.handleTopDragEnterCapture=this.handleTopDragEnterCapture.bind(this),this.handleTopDragLeaveCapture=this.handleTopDragLeaveCapture.bind(this),this.handleTopDragOver=this.handleTopDragOver.bind(this),this.handleTopDragOverCapture=this.handleTopDragOverCapture.bind(this),this.handleTopDrop=this.handleTopDrop.bind(this),this.handleTopDropCapture=this.handleTopDropCapture.bind(this),this.handleSelectStart=this.handleSelectStart.bind(this),this.endDragIfSourceWasRemovedFromDOM=this.endDragIfSourceWasRemovedFromDOM.bind(this),this.endDragNativeItem=this.endDragNativeItem.bind(this)}return t.prototype.setup=function(){if("undefined"!=typeof window){if(this.constructor.isSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");this.constructor.isSetUp=!0,this.addEventListeners(window)}},t.prototype.teardown=function(){"undefined"!=typeof window&&(this.constructor.isSetUp=!1,this.removeEventListeners(window),this.clearCurrentDragSourceNode())},t.prototype.addEventListeners=function(t){t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0)},t.prototype.removeEventListeners=function(t){t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0)},t.prototype.connectDragPreview=function(t,e,r){var n=this;return this.sourcePreviewNodeOptions[t]=r,this.sourcePreviewNodes[t]=e,function(){delete n.sourcePreviewNodes[t],delete n.sourcePreviewNodeOptions[t]}},t.prototype.connectDragSource=function(t,e,r){var n=this;this.sourceNodes[t]=e,this.sourceNodeOptions[t]=r;var o=function(e){return n.handleDragStart(e,t)},i=function(e){return n.handleSelectStart(e,t)};return e.setAttribute("draggable",!0),e.addEventListener("dragstart",o),e.addEventListener("selectstart",i),function(){delete n.sourceNodes[t],delete n.sourceNodeOptions[t],e.removeEventListener("dragstart",o),e.removeEventListener("selectstart",i),e.setAttribute("draggable",!1)}},t.prototype.connectDropTarget=function(t,e){var r=this,n=function(e){return r.handleDragEnter(e,t)},o=function(e){return r.handleDragOver(e,t)},i=function(e){return r.handleDrop(e,t)};return e.addEventListener("dragenter",n),e.addEventListener("dragover",o),e.addEventListener("drop",i),function(){e.removeEventListener("dragenter",n),e.removeEventListener("dragover",o),e.removeEventListener("drop",i)}},t.prototype.getCurrentSourceNodeOptions=function(){var t=this.monitor.getSourceId(),e=this.sourceNodeOptions[t];return u["default"](e||{},{dropEffect:"move"})},t.prototype.getCurrentDropEffect=function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect},t.prototype.getCurrentSourcePreviewNodeOptions=function(){var t=this.monitor.getSourceId(),e=this.sourcePreviewNodeOptions[t];return u["default"](e||{},{anchorX:.5,anchorY:.5,captureDraggingState:!1})},t.prototype.getSourceClientOffset=function(t){return h.getNodeClientOffset(this.sourceNodes[t])},t.prototype.isDraggingNativeItem=function(){var t=this.monitor.getItemType();return Object.keys(g).some(function(e){return g[e]===t})},t.prototype.beginDragNativeItem=function(t){this.clearCurrentDragSourceNode();var e=l.createNativeDragSource(t);this.currentNativeSource=new e,this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle]),d.isFirefox()&&window.addEventListener("mousemove",this.endDragNativeItem,!0)},t.prototype.endDragNativeItem=function(){this.isDraggingNativeItem()&&(d.isFirefox()&&window.removeEventListener("mousemove",this.endDragNativeItem,!0),this.actions.endDrag(),this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},t.prototype.endDragIfSourceWasRemovedFromDOM=function(){var t=this.currentDragSourceNode;document.body.contains(t)||this.clearCurrentDragSourceNode()&&this.actions.endDrag()},t.prototype.setCurrentDragSourceNode=function(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t,this.currentDragSourceNodeOffset=h.getNodeClientOffset(t),this.currentDragSourceNodeOffsetChanged=!1,window.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},t.prototype.clearCurrentDragSourceNode=function(){return this.currentDragSourceNode?(this.currentDragSourceNode=null,this.currentDragSourceNodeOffset=null,this.currentDragSourceNodeOffsetChanged=!1,window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0),!0):!1},t.prototype.checkIfCurrentDragSourceRectChanged=function(){var t=this.currentDragSourceNode;return t?this.currentDragSourceNodeOffsetChanged?!0:(this.currentDragSourceNodeOffsetChanged=!c["default"](h.getNodeClientOffset(t),this.currentDragSourceNodeOffset),this.currentDragSourceNodeOffsetChanged):!1},t.prototype.handleTopDragStartCapture=function(){this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},t.prototype.handleDragStart=function(t,e){this.dragStartSourceIds.unshift(e)},t.prototype.handleTopDragStart=function(t){var e=this,r=this.dragStartSourceIds;this.dragStartSourceIds=null;var n=h.getEventClientOffset(t);this.actions.beginDrag(r,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:n});var o=t.dataTransfer,i=l.matchNativeItemType(o);if(this.monitor.isDragging()){if("function"==typeof o.setDragImage){var a=this.monitor.getSourceId(),u=this.sourceNodes[a],s=this.sourcePreviewNodes[a]||u,c=this.getCurrentSourcePreviewNodeOptions(),f=c.anchorX,p=c.anchorY,d={anchorX:f,anchorY:p},v=h.getDragPreviewOffset(u,s,n,d);o.setDragImage(s,v.x,v.y)}try{o.setData("application/json",{})}catch(g){}this.setCurrentDragSourceNode(t.target);var y=this.getCurrentSourcePreviewNodeOptions(),D=y.captureDraggingState;D?this.actions.publishDragSource():setTimeout(function(){return e.actions.publishDragSource()})}else if(i)this.beginDragNativeItem(i);else{if(!(o.types||t.target.hasAttribute&&t.target.hasAttribute("draggable")))return;t.preventDefault()}},t.prototype.handleTopDragEndCapture=function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()},t.prototype.handleTopDragEnterCapture=function(t){this.dragEnterTargetIds=[];var e=this.enterLeaveCounter.enter(t.target);if(e&&!this.monitor.isDragging()){var r=t.dataTransfer,n=l.matchNativeItemType(r);n&&this.beginDragNativeItem(n)}},t.prototype.handleDragEnter=function(t,e){this.dragEnterTargetIds.unshift(e)},t.prototype.handleTopDragEnter=function(t){var e=this,r=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){d.isFirefox()||this.actions.hover(r,{clientOffset:h.getEventClientOffset(t)});var n=r.some(function(t){return e.monitor.canDropOnTarget(t)});n&&(t.preventDefault(),t.dataTransfer.dropEffect=this.getCurrentDropEffect())}},t.prototype.handleTopDragOverCapture=function(){this.dragOverTargetIds=[]},t.prototype.handleDragOver=function(t,e){this.dragOverTargetIds.unshift(e)},t.prototype.handleTopDragOver=function(t){var e=this,r=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return t.preventDefault(),void(t.dataTransfer.dropEffect="none");this.actions.hover(r,{clientOffset:h.getEventClientOffset(t)});var n=r.some(function(t){return e.monitor.canDropOnTarget(t)});n?(t.preventDefault(),t.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(t.preventDefault(),t.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(t.preventDefault(),t.dataTransfer.dropEffect="move")},t.prototype.handleTopDragLeaveCapture=function(t){this.isDraggingNativeItem()&&t.preventDefault();var e=this.enterLeaveCounter.leave(t.target);e&&this.isDraggingNativeItem()&&this.endDragNativeItem()},t.prototype.handleTopDropCapture=function(t){this.dropTargetIds=[],t.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(t.dataTransfer),this.enterLeaveCounter.reset()},t.prototype.handleDrop=function(t,e){this.dropTargetIds.unshift(e)},t.prototype.handleTopDrop=function(t){var e=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(e,{clientOffset:h.getEventClientOffset(t)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()},t.prototype.handleSelectStart=function(t){var e=t.target;"function"==typeof e.dragDrop&&("INPUT"===e.tagName||"SELECT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable||(t.preventDefault(),e.dragDrop()))},t}();e["default"]=y,t.exports=e["default"]},function(t,e){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var n=function(){function t(e,n){r(this,t);for(var o=e.length,i=[],a=0;o>a;a++)i.push(a);i.sort(function(t,r){return e[t]<e[r]?-1:1});for(var u=[],s=[],c=[],f=void 0,p=void 0,a=0;o-1>a;a++)f=e[a+1]-e[a],p=n[a+1]-n[a],s.push(f),u.push(p),c.push(p/f);for(var d=[c[0]],a=0;a<s.length-1;a++){var h=c[a],l=c[a+1];if(0>=h*l)d.push(0);else{f=s[a];var v=s[a+1],g=f+v;d.push(3*g/((g+v)/h+(g+f)/l))}}d.push(c[c.length-1]);for(var y=[],D=[],m=void 0,a=0;a<d.length-1;a++){m=c[a];var x=d[a],_=1/s[a],g=x+d[a+1]-m-m;y.push((m-x-g)*_),D.push(g*_*_)}this.xs=e,this.ys=n,this.c1s=d,this.c2s=y,this.c3s=D}return t.prototype.interpolate=function(t){var e=this.xs,r=this.ys,n=this.c1s,o=this.c2s,i=this.c3s,a=e.length-1;if(t===e[a])return r[a];for(var u=0,s=i.length-1,c=void 0;s>=u;){c=Math.floor(.5*(u+s));var f=e[c];if(t>f)u=c+1;else{if(!(f>t))return r[c];s=c-1}}a=Math.max(0,s);var p=t-e[a],d=p*p;return r[a]+n[a]*p+o[a]*d+i[a]*p*d},t}();e["default"]=n,t.exports=e["default"]},function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e,r){var n=e.reduce(function(e,r){return e||t.getData(r)},null);return null!=n?n:r}function u(t){var e=d[t],r=e.exposeProperty,n=e.matchesTypes,a=e.getData;return function(){function t(){o(this,t),this.item=Object.defineProperties({},i({},r,{get:function(){return console.warn("Browser doesn't allow reading \""+r+'" until the drop event.'),null},configurable:!0,enumerable:!0}))}return t.prototype.mutateItemByReadingDataTransfer=function(t){delete this.item[r],this.item[r]=a(t,n)},t.prototype.canDrag=function(){return!0},t.prototype.beginDrag=function(){return this.item},t.prototype.isDragging=function(t,e){return e===t.getSourceId()},t.prototype.endDrag=function(){},t}()}function s(t){var e=Array.prototype.slice.call(t.types||[]);return Object.keys(d).filter(function(t){var r=d[t].matchesTypes;return r.some(function(t){return e.indexOf(t)>-1})})[0]||null}e.__esModule=!0;var c;e.createNativeDragSource=u,e.matchNativeItemType=s;var f=r(7),p=n(f),d=(c={},i(c,p.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(t){return Array.prototype.slice.call(t.files)}}),i(c,p.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(t,e){return a(t,e,"").split("\n")}}),i(c,p.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(t,e){return a(t,e,"")}}),c)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){var e=t.nodeType===f?t:t.parentElement;if(!e)return null;var r=e.getBoundingClientRect(),n=r.top,o=r.left;return{x:o,y:n}}function i(t){return{x:t.clientX,y:t.clientY}}function a(t,e,r,n){var i="IMG"===e.nodeName&&(u.isFirefox()||!document.documentElement.contains(e)),a=i?t:e,s=o(a),f={x:r.x-s.x,y:r.y-s.y},p=t.offsetWidth,d=t.offsetHeight,h=n.anchorX,l=n.anchorY,v=i?e.width:p,g=i?e.height:d;u.isSafari()&&i?(g/=window.devicePixelRatio,v/=window.devicePixelRatio):u.isFirefox()&&!i&&(g*=window.devicePixelRatio,v*=window.devicePixelRatio);var y=new c["default"]([0,.5,1],[f.x,f.x/p*v,f.x+v-p]),D=new c["default"]([0,.5,1],[f.y,f.y/d*g,f.y+g-d]),m=y.interpolate(h),x=D.interpolate(l);return u.isSafari()&&i&&(x+=(window.devicePixelRatio-1)*g),{x:m,y:x}}e.__esModule=!0,e.getNodeClientOffset=o,e.getEventClientOffset=i,e.getDragPreviewOffset=a;var u=r(15),s=r(29),c=n(s),f=1},function(t,e){"use strict";function r(){return n||(n=new Image,n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),n}e.__esModule=!0,e["default"]=r;var n=void 0;t.exports=e["default"]},function(t,e){"use strict";function r(t,e){if(t===e)return!0;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<r.length;i++){if(!o.call(e,r[i])||t[r[i]]!==e[r[i]])return!1;var a=t[r[i]],u=e[r[i]];if(a!==u)return!1}return!0}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,r){function n(){}var o=r(4),i=Object.prototype;n.prototype=o?o(null):i,t.exports=n},function(t,e,r){var n=r(9),o=n.Reflect;t.exports=o},function(t,e,r){var n=r(8),o=r(9),i=n(o,"Set");t.exports=i},function(t,e){function r(t,e){for(var r=-1,n=t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}t.exports=r},function(t,e){function r(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}t.exports=r},function(t,e,r){function n(t,e,r,n){return void 0===t||o(t,i[r])&&!a.call(n,r)?e:t}var o=r(5),i=Object.prototype,a=i.hasOwnProperty;t.exports=n},function(t,e,r){function n(t,e,r){var n=t[e];(!o(n,r)||o(n,i[e])&&!a.call(t,e)||void 0===r&&!(e in t))&&(t[e]=r)}var o=r(5),i=Object.prototype,a=i.hasOwnProperty;t.exports=n},function(t,e,r){function n(t,e){var r=o(t,e);if(0>r)return!1;var n=t.length-1;return r==n?t.pop():a.call(t,r,1),!0}var o=r(3),i=Array.prototype,a=i.splice;t.exports=n},function(t,e,r){function n(t,e){var r=o(t,e);return 0>r?void 0:t[r][1]}var o=r(3);t.exports=n},function(t,e,r){function n(t,e){return o(t,e)>-1}var o=r(3);t.exports=n},function(t,e,r){function n(t,e,r){var n=o(t,e);0>n?t.push([e,r]):t[n][1]=r}var o=r(3);t.exports=n},function(t,e,r){function n(t,e,r,n){var p=-1,d=i,h=!0,l=t.length,v=[],g=e.length;if(!l)return v;r&&(e=u(e,s(r))),n?(d=a,h=!1):e.length>=f&&(d=c,h=!1,e=new o(e));t:for(;++p<l;){var y=t[p],D=r?r(y):y;if(h&&D===D){for(var m=g;m--;)if(e[m]===D)continue t;v.push(y)}else d(e,D,n)||v.push(y)}return v}var o=r(17),i=r(19),a=r(20),u=r(37),s=r(51),c=r(21),f=200;t.exports=n},function(t,e,r){function n(t,e,r,s){s||(s=[]);for(var c=-1,f=t.length;++c<f;){var p=t[c];u(p)&&(r||a(p)||i(p))?e?n(p,e,r,s):o(s,p):r||(s[s.length]=p)}return s}var o=r(38),i=r(24),a=r(10),u=r(11);t.exports=n},function(t,e,r){function n(t,e,r){if(e!==e)return o(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var o=r(63);t.exports=n},function(t,e,r){function n(t){t=null==t?t:Object(t);var e=[];for(var r in t)e.push(r);return e}var o=r(35),i=r(67),a=Object.prototype,u=o?o.enumerate:void 0,s=a.propertyIsEnumerable;u&&!s.call({valueOf:1},"valueOf")&&(n=function(t){return i(u(t))}),t.exports=n},function(t,e){function r(t){return function(e){return null==e?void 0:e[t]}}t.exports=r},function(t,e){function r(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}t.exports=r},function(t,e){function r(t){return function(e){return t(e)}}t.exports=r},function(t,e,r){function n(t,e,r){var n=-1,p=i,d=t.length,h=!0,l=[],v=l;if(r)h=!1,p=a;else if(d>=f){var g=e?null:s(t);if(g)return c(g);h=!1,p=u,v=new o}else v=e?[]:l;t:for(;++n<d;){var y=t[n],D=e?e(y):y;if(h&&D===D){for(var m=v.length;m--;)if(v[m]===D)continue t;e&&v.push(D),l.push(y)}else p(v,D,r)||(v!==l&&v.push(D),l.push(y))}return l}var o=r(17),i=r(19),a=r(20),u=r(21),s=r(57),c=r(73),f=200;t.exports=n},function(t,e,r){function n(t){var e=this.__data__;if(o(t)){var r=e.__data__,n="string"==typeof t?r.string:r.hash;n[t]=i}else e.set(t,i)}var o=r(1),i="__lodash_hash_undefined__";t.exports=n},function(t,e){function r(t){return t&&t.Object===Object?t:null}t.exports=r},function(t,e,r){function n(t,e,r,n){r||(r={});for(var i=-1,a=e.length;++i<a;){var u=e[i],s=n?n(r[u],t[u],u,r,t):t[u];o(r,u,s)}return r}var o=r(40);t.exports=n},function(t,e,r){function n(t){return i(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,u=i>2?r[2]:void 0;for(a="function"==typeof a?(i--,a):void 0,u&&o(r[0],r[1],u)&&(a=3>i?void 0:a,i=1),e=Object(e);++n<i;){var s=r[n];s&&t(e,s,n,a)}return e})}var o=r(65),i=r(6);t.exports=n},function(t,e,r){var n=r(36),o=r(80),i=n&&2===new n([1,2]).size?function(t){return new n(t)}:o;t.exports=i},function(t,e,r){var n=r(49),o=n("length");t.exports=o},function(t,e,r){function n(t,e){return o(t,e)&&delete t[e]}var o=r(22);t.exports=n},function(t,e,r){function n(t,e){if(o){var r=t[e];return r===i?void 0:r}return u.call(t,e)?t[e]:void 0}var o=r(4),i="__lodash_hash_undefined__",a=Object.prototype,u=a.hasOwnProperty;t.exports=n},function(t,e,r){function n(t,e,r){t[e]=o&&void 0===r?i:r}var o=r(4),i="__lodash_hash_undefined__";t.exports=n},function(t,e,r){function n(t){var e=t?t.length:void 0;return u(e)&&(a(t)||s(t)||i(t))?o(e,String):null}var o=r(50),i=r(24),a=r(10),u=r(26),s=r(77);t.exports=n},function(t,e){function r(t,e,r){for(var n=t.length,o=e+(r?0:-1);r?o--:++o<n;){var i=t[o];if(i!==i)return o}return-1}t.exports=r},function(t,e){function r(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}t.exports=r},function(t,e,r){function n(t,e,r){if(!u(r))return!1;var n=typeof e;return("number"==n?i(r)&&a(e,r.length):"string"==n&&e in r)?o(r[e],t):!1}var o=r(5),i=r(25),a=r(23),u=r(13);t.exports=n},function(t,e){function r(t){var e=t&&t.constructor,r="function"==typeof e&&e.prototype||n;return t===r}var n=Object.prototype;t.exports=r},function(t,e){function r(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}t.exports=r},function(t,e,r){function n(){this.__data__={hash:new o,map:i?new i:[],string:new o}}var o=r(34),i=r(2);t.exports=n},function(t,e,r){function n(t){var e=this.__data__;return u(t)?a("string"==typeof t?e.string:e.hash,t):o?e.map["delete"](t):i(e.map,t)}var o=r(2),i=r(41),a=r(59),u=r(1);t.exports=n},function(t,e,r){function n(t){var e=this.__data__;return u(t)?a("string"==typeof t?e.string:e.hash,t):o?e.map.get(t):i(e.map,t)}var o=r(2),i=r(42),a=r(60),u=r(1);t.exports=n},function(t,e,r){function n(t){var e=this.__data__;return u(t)?a("string"==typeof t?e.string:e.hash,t):o?e.map.has(t):i(e.map,t)}var o=r(2),i=r(43),a=r(22),u=r(1);t.exports=n},function(t,e,r){function n(t,e){var r=this.__data__;return u(t)?a("string"==typeof t?r.string:r.hash,t,e):o?r.map.set(t,e):i(r.map,t,e),this}var o=r(2),i=r(44),a=r(61),u=r(1);t.exports=n},function(t,e){function r(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}t.exports=r},function(t,e,r){var n=r(55),o=r(56),i=r(78),a=o(function(t,e,r,o){n(e,i(e),t,o)});t.exports=a},function(t,e,r){var n=r(18),o=r(39),i=r(74),a=r(6),u=a(function(t){return t.push(void 0,o),n(i,void 0,t)});t.exports=u},function(t,e,r){function n(t){return null==t?!1:o(t)?d.test(f.call(t)):a(t)&&(i(t)?d:s).test(t)}var o=r(12),i=r(64),a=r(14),u=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Object.prototype,f=Function.prototype.toString,p=c.hasOwnProperty,d=RegExp("^"+f.call(p).replace(u,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=n},function(t,e,r){function n(t){return"string"==typeof t||!o(t)&&i(t)&&s.call(t)==a}var o=r(10),i=r(14),a="[object String]",u=Object.prototype,s=u.toString;t.exports=n},function(t,e,r){function n(t){for(var e=-1,r=u(t),n=o(t),s=n.length,f=i(t),p=!!f,d=f||[],h=d.length;++e<s;){var l=n[e];p&&("length"==l||a(l,h))||"constructor"==l&&(r||!c.call(t,l))||d.push(l)}return d}var o=r(48),i=r(62),a=r(23),u=r(66),s=Object.prototype,c=s.hasOwnProperty;t.exports=n},function(t,e,r){function n(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(i);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a),a};return r.cache=new n.Cache,r}var o=r(16),i="Expected a function";n.Cache=o,t.exports=n},function(t,e){function r(){}t.exports=r},function(t,e,r){function n(t){if(!t)return 0===t?t:0;if(t=o(t),t===i||t===-i){var e=0>t?-1:1;return e*a}var r=t%1;return t===t?r?t-r:t:0}var o=r(82),i=1/0,a=1.7976931348623157e308;t.exports=n},function(t,e,r){function n(t){if(i(t)){var e=o(t.valueOf)?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(u,"");var r=c.test(t);return r||f.test(t)?p(t.slice(2),r?2:8):s.test(t)?a:+t}var o=r(12),i=r(13),a=NaN,u=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,f=/^0o[0-7]+$/i,p=parseInt;t.exports=n},function(t,e,r){var n=r(46),o=r(52),i=r(6),a=i(function(t){return o(n(t,!1,!0))});t.exports=a},function(t,e,r){var n=r(45),o=r(11),i=r(6),a=i(function(t,e){return o(t)?n(t,e):[]});t.exports=a},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ReactDnDHTML5Backend=t():e.ReactDnDHTML5Backend=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return new u.default(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.getEmptyImage=t.NativeTypes=void 0,t.default=i;var a=r(35),u=o(a),s=r(39),c=o(s),f=r(10),l=n(f);t.NativeTypes=l,t.getEmptyImage=c.default},function(e,t,r){var n=r(24),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},function(e,t,r){function n(e,t){for(var r=e.length;r--;)if(o(e[r][0],t))return r;return-1}var o=r(7);e.exports=n},function(e,t,r){function n(e,t){return a(i(e,t,o),e+"")}var o=r(27),i=r(91),a=r(94);e.exports=n},function(e,t,r){function n(e,t){var r=e.__data__;return o(t)?r["string"==typeof t?"string":"hash"]:r.map}var o=r(75);e.exports=n},function(e,t,r){function n(e,t){var r=i(e,t);return o(r)?r:void 0}var o=r(55),i=r(67);e.exports=n},function(e,t,r){var n=r(5),o=n(Object,"create");e.exports=o},function(e,t){function r(e,t){return e===t||e!==e&&t!==t}e.exports=r},function(e,t){function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=r},function(e,t){function r(e){return null!=e&&"object"==typeof e}e.exports=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FILE="__NATIVE_FILE__",t.URL="__NATIVE_URL__",t.TEXT="__NATIVE_TEXT__"},function(e,t,r){var n=r(1),o=n.Symbol;e.exports=o},function(e,t,r){function n(e){return null==e?void 0===e?s:u:c&&c in Object(e)?i(e):a(e)}var o=r(11),i=r(66),a=r(90),u="[object Null]",s="[object Undefined]",c=o?o.toStringTag:void 0;e.exports=n},function(e,t,r){function n(e){return null!=e&&i(e.length)&&!o(e)}var o=r(31),i=r(32);e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.isSafari=t.isFirefox=void 0;var o=r(104),i=n(o);t.isFirefox=(0,i.default)(function(){return/firefox/i.test(navigator.userAgent)}),t.isSafari=(0,i.default)(function(){return Boolean(window.safari)})},function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var o=r(83),i=r(84),a=r(85),u=r(86),s=r(87);n.prototype.clear=o,n.prototype.delete=i,n.prototype.get=a,n.prototype.has=u,n.prototype.set=s,e.exports=n},function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new o;++t<r;)this.add(e[t])}var o=r(15),i=r(92),a=r(93);n.prototype.add=n.prototype.push=i,n.prototype.has=a,e.exports=n},function(e,t){function r(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}e.exports=r},function(e,t,r){function n(e,t){var r=null==e?0:e.length;return!!r&&o(e,t,0)>-1}var o=r(52);e.exports=n},function(e,t){function r(e,t,r){for(var n=-1,o=null==e?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1}e.exports=r},function(e,t,r){function n(e,t,r){"__proto__"==t&&o?o(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var o=r(23);e.exports=n},function(e,t){function r(e){return function(t){return e(t)}}e.exports=r},function(e,t){function r(e,t){return e.has(t)}e.exports=r},function(e,t,r){var n=r(5),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(t,function(){return this}())},function(e,t){function r(e,t){return t=null==t?n:t,!!t&&("number"==typeof e||o.test(e))&&e>-1&&e%1==0&&e<t}var n=9007199254740991,o=/^(?:0|[1-9]\d*)$/;e.exports=r},function(e,t){function r(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}e.exports=r},function(e,t){function r(e){return e}e.exports=r},function(e,t,r){var n=r(53),o=r(9),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(e){return o(e)&&a.call(e,"callee")&&!u.call(e,"callee")};e.exports=s},function(e,t){var r=Array.isArray;e.exports=r},function(e,t,r){function n(e){return i(e)&&o(e)}var o=r(13),i=r(9);e.exports=n},function(e,t,r){function n(e){if(!i(e))return!1;var t=o(e);return t==u||t==s||t==a||t==c}var o=r(12),i=r(8),a="[object AsyncFunction]",u="[object Function]",s="[object GeneratorFunction]",c="[object Proxy]";e.exports=n},function(e,t){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}var n=9007199254740991;e.exports=r},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(107),u=n(a),s=r(108),c=n(s),f=function(){function e(){o(this,e),this.entered=[]}return i(e,[{key:"enter",value:function(e){var t=this.entered.length,r=function(t){return document.documentElement.contains(t)&&(!t.contains||t.contains(e))};return this.entered=(0,u.default)(this.entered.filter(r),[e]),0===t&&this.entered.length>0}},{key:"leave",value:function(e){var t=this.entered.length;return this.entered=(0,c.default)(this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}]),e}();t.default=f},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(100),s=o(u),c=r(40),f=o(c),l=r(34),d=o(l),h=r(14),p=r(38),v=r(37),g=r(10),y=n(g),D=function(){function e(t){i(this,e),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.context=t.getContext(),this.sourcePreviewNodes={},this.sourcePreviewNodeOptions={},this.sourceNodes={},this.sourceNodeOptions={},this.enterLeaveCounter=new d.default,this.getSourceClientOffset=this.getSourceClientOffset.bind(this),this.handleTopDragStart=this.handleTopDragStart.bind(this),this.handleTopDragStartCapture=this.handleTopDragStartCapture.bind(this),this.handleTopDragEndCapture=this.handleTopDragEndCapture.bind(this),this.handleTopDragEnter=this.handleTopDragEnter.bind(this),this.handleTopDragEnterCapture=this.handleTopDragEnterCapture.bind(this),this.handleTopDragLeaveCapture=this.handleTopDragLeaveCapture.bind(this),this.handleTopDragOver=this.handleTopDragOver.bind(this),this.handleTopDragOverCapture=this.handleTopDragOverCapture.bind(this),this.handleTopDrop=this.handleTopDrop.bind(this),this.handleTopDropCapture=this.handleTopDropCapture.bind(this),this.handleSelectStart=this.handleSelectStart.bind(this),this.endDragIfSourceWasRemovedFromDOM=this.endDragIfSourceWasRemovedFromDOM.bind(this),this.endDragNativeItem=this.endDragNativeItem.bind(this)}return a(e,[{key:"setup",value:function(){if("undefined"!=typeof this.window){if(this.window.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");this.window.__isReactDndBackendSetUp=!0,this.addEventListeners(this.window)}}},{key:"teardown",value:function(){"undefined"!=typeof this.window&&(this.window.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.window),this.clearCurrentDragSourceNode())}},{key:"addEventListeners",value:function(e){e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0)}},{key:"removeEventListeners",value:function(e){e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0)}},{key:"connectDragPreview",value:function(e,t,r){var n=this;return this.sourcePreviewNodeOptions[e]=r,this.sourcePreviewNodes[e]=t,function(){delete n.sourcePreviewNodes[e],delete n.sourcePreviewNodeOptions[e]}}},{key:"connectDragSource",value:function(e,t,r){var n=this;this.sourceNodes[e]=t,this.sourceNodeOptions[e]=r;var o=function(t){return n.handleDragStart(t,e)},i=function(t){return n.handleSelectStart(t,e)};return t.setAttribute("draggable",!0),t.addEventListener("dragstart",o),t.addEventListener("selectstart",i),function(){delete n.sourceNodes[e],delete n.sourceNodeOptions[e],t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",i),t.setAttribute("draggable",!1)}}},{key:"connectDropTarget",value:function(e,t){var r=this,n=function(t){return r.handleDragEnter(t,e)},o=function(t){return r.handleDragOver(t,e)},i=function(t){return r.handleDrop(t,e)};return t.addEventListener("dragenter",n),t.addEventListener("dragover",o),t.addEventListener("drop",i),function(){t.removeEventListener("dragenter",n),t.removeEventListener("dragover",o),t.removeEventListener("drop",i)}}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions[e];return(0,s.default)(t||{},{dropEffect:"move"})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions[e];return(0,s.default)(t||{},{anchorX:.5,anchorY:.5,captureDraggingState:!1})}},{key:"getSourceClientOffset",value:function(e){return(0,p.getNodeClientOffset)(this.sourceNodes[e])}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(y).some(function(t){return y[t]===e})}},{key:"beginDragNativeItem",value:function(e){this.clearCurrentDragSourceNode();var t=(0,v.createNativeDragSource)(e);this.currentNativeSource=new t,this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle]),(0,h.isFirefox)()&&this.window.addEventListener("mousemove",this.endDragNativeItem,!0)}},{key:"endDragNativeItem",value:function(){this.isDraggingNativeItem()&&((0,h.isFirefox)()&&this.window.removeEventListener("mousemove",this.endDragNativeItem,!0),this.actions.endDrag(),this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)}},{key:"endDragIfSourceWasRemovedFromDOM",value:function(){var e=this.currentDragSourceNode;document.body.contains(e)||this.clearCurrentDragSourceNode()&&this.actions.endDrag()}},{key:"setCurrentDragSourceNode",value:function(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.currentDragSourceNodeOffset=(0,p.getNodeClientOffset)(e),this.currentDragSourceNodeOffsetChanged=!1,this.window.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}},{key:"clearCurrentDragSourceNode",value:function(){return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.currentDragSourceNodeOffset=null,this.currentDragSourceNodeOffsetChanged=!1,this.window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0),!0)}},{key:"checkIfCurrentDragSourceRectChanged",value:function(){var e=this.currentDragSourceNode;return!!e&&(!!this.currentDragSourceNodeOffsetChanged||(this.currentDragSourceNodeOffsetChanged=!(0,f.default)((0,p.getNodeClientOffset)(e),this.currentDragSourceNodeOffset),this.currentDragSourceNodeOffsetChanged))}},{key:"handleTopDragStartCapture",value:function(){this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]}},{key:"handleDragStart",value:function(e,t){this.dragStartSourceIds.unshift(t)}},{key:"handleTopDragStart",value:function(e){var t=this,r=this.dragStartSourceIds;this.dragStartSourceIds=null;var n=(0,p.getEventClientOffset)(e);this.actions.beginDrag(r,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:n});var o=e.dataTransfer,i=(0,v.matchNativeItemType)(o);if(this.monitor.isDragging()){if("function"==typeof o.setDragImage){var a=this.monitor.getSourceId(),u=this.sourceNodes[a],s=this.sourcePreviewNodes[a]||u,c=this.getCurrentSourcePreviewNodeOptions(),f=c.anchorX,l=c.anchorY,d={anchorX:f,anchorY:l},h=(0,p.getDragPreviewOffset)(u,s,n,d);o.setDragImage(s,h.x,h.y)}try{o.setData("application/json",{})}catch(e){}this.setCurrentDragSourceNode(e.target);var g=this.getCurrentSourcePreviewNodeOptions(),y=g.captureDraggingState;y?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(i)this.beginDragNativeItem(i);else{if(!(o.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}}},{key:"handleTopDragEndCapture",value:function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()}},{key:"handleTopDragEnterCapture",value:function(e){this.dragEnterTargetIds=[];var t=this.enterLeaveCounter.enter(e.target);if(t&&!this.monitor.isDragging()){var r=e.dataTransfer,n=(0,v.matchNativeItemType)(r);n&&this.beginDragNativeItem(n)}}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleTopDragEnter",value:function(e){var t=this,r=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){(0,h.isFirefox)()||this.actions.hover(r,{clientOffset:(0,p.getEventClientOffset)(e)});var n=r.some(function(e){return t.monitor.canDropOnTarget(e)});n&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect())}}},{key:"handleTopDragOverCapture",value:function(){this.dragOverTargetIds=[]}},{key:"handleDragOver",value:function(e,t){this.dragOverTargetIds.unshift(t)}},{key:"handleTopDragOver",value:function(e){var t=this,r=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(r,{clientOffset:(0,p.getEventClientOffset)(e)});var n=r.some(function(e){return t.monitor.canDropOnTarget(e)});n?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")}},{key:"handleTopDragLeaveCapture",value:function(e){this.isDraggingNativeItem()&&e.preventDefault();var t=this.enterLeaveCounter.leave(e.target);t&&this.isDraggingNativeItem()&&this.endDragNativeItem()}},{key:"handleTopDropCapture",value:function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}},{key:"handleTopDrop",value:function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:(0,p.getEventClientOffset)(e)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()}},{key:"handleSelectStart",value:function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))}},{key:"window",get:function(){return this.context&&this.context.window||window}}]),e}();t.default=D},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(t,n){r(this,e);for(var o=t.length,i=[],a=0;a<o;a++)i.push(a);i.sort(function(e,r){return t[e]<t[r]?-1:1});for(var u=[],s=[],c=[],f=void 0,l=void 0,d=0;d<o-1;d++)f=t[d+1]-t[d],l=n[d+1]-n[d],s.push(f),u.push(l),c.push(l/f);for(var h=[c[0]],p=0;p<s.length-1;p++){var v=c[p],g=c[p+1];if(v*g<=0)h.push(0);else{f=s[p];var y=s[p+1],D=f+y;h.push(3*D/((D+y)/v+(D+f)/g))}}h.push(c[c.length-1]);for(var b=[],x=[],m=void 0,_=0;_<h.length-1;_++){m=c[_];var O=h[_],T=1/s[_],w=O+h[_+1]-m-m;b.push((m-O-w)*T),x.push(w*T*T)}this.xs=t,this.ys=n,this.c1s=h,this.c2s=b,this.c3s=x}return n(e,[{key:"interpolate",value:function(e){var t=this.xs,r=this.ys,n=this.c1s,o=this.c2s,i=this.c3s,a=t.length-1;if(e===t[a])return r[a];for(var u=0,s=i.length-1,c=void 0;u<=s;){c=Math.floor(.5*(u+s));var f=t[c];if(f<e)u=c+1;else{if(!(f>e))return r[c];s=c-1}}a=Math.max(0,s);var l=e-t[a],d=l*l;return r[a]+n[a]*l+o[a]*d+i[a]*l*d}}]),e}();t.default=o},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e,t){for(var r in t){var n=t[r];n.configurable=n.enumerable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,r,n)}return e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t,r){var n=t.reduce(function(t,r){return t||e.getData(r)},null);return null!=n?n:r}function s(e){var t=p[e],r=t.exposeProperty,n=t.matchesTypes,a=t.getData;return function(){function e(){var t,n;i(this,e),this.item=(t={},n={},n[r]=n[r]||{},n[r].get=function(){return console.warn("Browser doesn't allow reading \""+r+'" until the drop event.'),null},o(t,n),t)}return l(e,[{key:"mutateItemByReadingDataTransfer",value:function(e){delete this.item[r],this.item[r]=a(e,n)}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}]),e}()}function c(e){var t=Array.prototype.slice.call(e.types||[]);return Object.keys(p).filter(function(e){var r=p[e].matchesTypes;return r.some(function(e){return t.indexOf(e)>-1})})[0]||null}Object.defineProperty(t,"__esModule",{value:!0});var f,l=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.createNativeDragSource=s,t.matchNativeItemType=c;var d=r(10),h=n(d),p=(f={},a(f,h.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(e){return Array.prototype.slice.call(e.files)}}),a(f,h.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(e,t){return u(e,t,"").split("\n")}}),a(f,h.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(e,t){return u(e,t,"")}}),f)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.nodeType===f?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,o=r.left;return{x:o,y:n}}function i(e){return{x:e.clientX,y:e.clientY}}function a(e,t,r,n){var i="IMG"===t.nodeName&&((0,u.isFirefox)()||!document.documentElement.contains(t)),a=i?e:t,s=o(a),f={x:r.x-s.x,y:r.y-s.y},l=e.offsetWidth,d=e.offsetHeight,h=n.anchorX,p=n.anchorY,v=i?t.width:l,g=i?t.height:d;(0,u.isSafari)()&&i?(g/=window.devicePixelRatio,v/=window.devicePixelRatio):(0,u.isFirefox)()&&!i&&(g*=window.devicePixelRatio,v*=window.devicePixelRatio);var y=new c.default([0,.5,1],[f.x,f.x/l*v,f.x+v-l]),D=new c.default([0,.5,1],[f.y,f.y/d*g,f.y+g-d]),b=y.interpolate(h),x=D.interpolate(p);return(0,u.isSafari)()&&i&&(x+=(window.devicePixelRatio-1)*g),{x:b,y:x}}Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeClientOffset=o,t.getEventClientOffset=i,t.getDragPreviewOffset=a;var u=r(14),s=r(36),c=n(s),f=1},function(e,t){"use strict";function r(){return n||(n=new Image,n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var n=void 0},function(e,t){"use strict";function r(e,t){if(e===t)return!0;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<r.length;i+=1){if(!o.call(t,r[i])||e[r[i]]!==t[r[i]])return!1;var a=e[r[i]],u=t[r[i]];if(a!==u)return!1}return!0}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var o=r(68),i=r(69),a=r(70),u=r(71),s=r(72);n.prototype.clear=o,n.prototype.delete=i,n.prototype.get=a,n.prototype.has=u,n.prototype.set=s,e.exports=n},function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var o=r(78),i=r(79),a=r(80),u=r(81),s=r(82);n.prototype.clear=o,n.prototype.delete=i,n.prototype.get=a,n.prototype.has=u,n.prototype.set=s,e.exports=n},function(e,t,r){var n=r(5),o=r(1),i=n(o,"Map");e.exports=i},function(e,t,r){var n=r(5),o=r(1),i=n(o,"Set");e.exports=i},function(e,t,r){function n(e,t){var r=a(e),n=!r&&i(e),f=!r&&!n&&u(e),d=!r&&!n&&!f&&c(e),h=r||n||f||d,p=h?o(e.length,String):[],v=p.length;for(var g in e)!t&&!l.call(e,g)||h&&("length"==g||f&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,v))||p.push(g);return p}var o=r(59),i=r(28),a=r(29),u=r(101),s=r(25),c=r(102),f=Object.prototype,l=f.hasOwnProperty;e.exports=n},function(e,t){function r(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}e.exports=r},function(e,t){function r(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}e.exports=r},function(e,t,r){function n(e,t,r){var n=e[t];u.call(e,t)&&i(n,r)&&(void 0!==r||t in e)||o(e,t,r)}var o=r(20),i=r(7),a=Object.prototype,u=a.hasOwnProperty;e.exports=n},function(e,t,r){function n(e,t,r,n){var l=-1,d=i,h=!0,p=e.length,v=[],g=t.length;if(!p)return v;r&&(t=u(t,s(r))),n?(d=a,h=!1):t.length>=f&&(d=c,h=!1,t=new o(t));e:for(;++l<p;){var y=e[l],D=null==r?y:r(y);if(y=n||0!==y?y:0,h&&D===D){for(var b=g;b--;)if(t[b]===D)continue e;v.push(y)}else d(t,D,n)||v.push(y)}return v}var o=r(16),i=r(18),a=r(19),u=r(46),s=r(21),c=r(22),f=200;e.exports=n},function(e,t){function r(e,t,r,n){for(var o=e.length,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1}e.exports=r},function(e,t,r){function n(e,t,r,a,u){var s=-1,c=e.length;for(r||(r=i),u||(u=[]);++s<c;){var f=e[s];t>0&&r(f)?t>1?n(f,t-1,r,a,u):o(u,f):a||(u[u.length]=f)}return u}var o=r(47),i=r(73);e.exports=n},function(e,t,r){function n(e,t,r){return t===t?a(e,t,r):o(e,i,r)}var o=r(50),i=r(54),a=r(96);e.exports=n},function(e,t,r){function n(e){return i(e)&&o(e)==a}var o=r(12),i=r(9),a="[object Arguments]";e.exports=n},function(e,t){function r(e){return e!==e}e.exports=r},function(e,t,r){function n(e){if(!a(e)||i(e))return!1;var t=o(e)?p:c;return t.test(u(e))}var o=r(31),i=r(76),a=r(8),u=r(97),s=/[\\^$.*+?()[\]{}|]/g,c=/^\[object .+?Constructor\]$/,f=Function.prototype,l=Object.prototype,d=f.toString,h=l.hasOwnProperty,p=RegExp("^"+d.call(h).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=n},function(e,t,r){function n(e){return a(e)&&i(e.length)&&!!I[o(e)]}var o=r(12),i=r(32),a=r(9),u="[object Arguments]",s="[object Array]",c="[object Boolean]",f="[object Date]",l="[object Error]",d="[object Function]",h="[object Map]",p="[object Number]",v="[object Object]",g="[object RegExp]",y="[object Set]",D="[object String]",b="[object WeakMap]",x="[object ArrayBuffer]",m="[object DataView]",_="[object Float32Array]",O="[object Float64Array]",T="[object Int8Array]",w="[object Int16Array]",E="[object Int32Array]",S="[object Uint8Array]",N="[object Uint8ClampedArray]",j="[object Uint16Array]",C="[object Uint32Array]",I={};I[_]=I[O]=I[T]=I[w]=I[E]=I[S]=I[N]=I[j]=I[C]=!0,I[u]=I[s]=I[x]=I[c]=I[m]=I[f]=I[l]=I[d]=I[h]=I[p]=I[v]=I[g]=I[y]=I[D]=I[b]=!1,e.exports=n},function(e,t,r){function n(e){if(!o(e))return a(e);var t=i(e),r=[];for(var n in e)("constructor"!=n||!t&&s.call(e,n))&&r.push(n);return r}var o=r(8),i=r(77),a=r(88),u=Object.prototype,s=u.hasOwnProperty;e.exports=n},function(e,t,r){var n=r(99),o=r(23),i=r(27),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i;e.exports=a},function(e,t){function r(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}e.exports=r},function(e,t,r){function n(e,t,r){var n=-1,l=i,d=e.length,h=!0,p=[],v=p;if(r)h=!1,l=a;else if(d>=f){var g=t?null:s(e);if(g)return c(g);h=!1,l=u,v=new o}else v=t?[]:p;e:for(;++n<d;){var y=e[n],D=t?t(y):y;if(y=r||0!==y?y:0,h&&D===D){for(var b=v.length;b--;)if(v[b]===D)continue e;t&&v.push(D),p.push(y)}else l(v,D,r)||(v!==p&&v.push(D),p.push(y))}return p}var o=r(16),i=r(18),a=r(19),u=r(22),s=r(64),c=r(26),f=200;e.exports=n},function(e,t,r){function n(e,t,r,n){var a=!r;r||(r={});for(var u=-1,s=t.length;++u<s;){var c=t[u],f=n?n(r[c],e[c],c,r,e):void 0;void 0===f&&(f=e[c]),a?i(r,c,f):o(r,c,f)}return r}var o=r(48),i=r(20);e.exports=n},function(e,t,r){var n=r(1),o=n["__core-js_shared__"];e.exports=o},function(e,t,r){function n(e){return o(function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,u=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,u&&i(r[0],r[1],u)&&(a=o<3?void 0:a,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,a)}return t})}var o=r(3),i=r(74);e.exports=n},function(e,t,r){var n=r(44),o=r(105),i=r(26),a=1/0,u=n&&1/i(new n([,-0]))[1]==a?function(e){return new n(e)}:o;e.exports=u},function(e,t,r){function n(e,t,r,n){return void 0===e||o(e,i[r])&&!a.call(n,r)?t:e}var o=r(7),i=Object.prototype,a=i.hasOwnProperty;e.exports=n},function(e,t,r){function n(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=u.call(e);return n&&(t?e[s]=r:delete e[s]),o}var o=r(11),i=Object.prototype,a=i.hasOwnProperty,u=i.toString,s=o?o.toStringTag:void 0;e.exports=n},function(e,t){function r(e,t){return null==e?void 0:e[t]}e.exports=r},function(e,t,r){function n(){this.__data__=o?o(null):{},this.size=0}var o=r(6);e.exports=n},function(e,t){function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}e.exports=r},function(e,t,r){function n(e){var t=this.__data__;if(o){var r=t[e];return r===i?void 0:r}return u.call(t,e)?t[e]:void 0}var o=r(6),i="__lodash_hash_undefined__",a=Object.prototype,u=a.hasOwnProperty;e.exports=n},function(e,t,r){function n(e){var t=this.__data__;return o?void 0!==t[e]:a.call(t,e)}var o=r(6),i=Object.prototype,a=i.hasOwnProperty;e.exports=n},function(e,t,r){function n(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=o&&void 0===t?i:t,this}var o=r(6),i="__lodash_hash_undefined__";e.exports=n},function(e,t,r){function n(e){return a(e)||i(e)||!!(u&&e&&e[u])}var o=r(11),i=r(28),a=r(29),u=o?o.isConcatSpreadable:void 0;e.exports=n},function(e,t,r){function n(e,t,r){if(!u(r))return!1;var n=typeof t;return!!("number"==n?i(r)&&a(t,r.length):"string"==n&&t in r)&&o(r[t],e)}var o=r(7),i=r(13),a=r(25),u=r(8);e.exports=n},function(e,t){function r(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}e.exports=r},function(e,t,r){function n(e){return!!i&&i in e}var o=r(62),i=function(){var e=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=n},function(e,t){function r(e){var t=e&&e.constructor,r="function"==typeof t&&t.prototype||n;return e===r}var n=Object.prototype;e.exports=r},function(e,t){function r(){this.__data__=[],this.size=0}e.exports=r},function(e,t,r){function n(e){var t=this.__data__,r=o(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():a.call(t,r,1),--this.size,!0}var o=r(2),i=Array.prototype,a=i.splice;e.exports=n},function(e,t,r){function n(e){var t=this.__data__,r=o(t,e);return r<0?void 0:t[r][1]}var o=r(2);e.exports=n},function(e,t,r){function n(e){return o(this.__data__,e)>-1}var o=r(2);e.exports=n},function(e,t,r){function n(e,t){var r=this.__data__,n=o(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var o=r(2);e.exports=n},function(e,t,r){function n(){this.size=0,this.__data__={hash:new o,map:new(a||i),string:new o}}var o=r(41),i=r(42),a=r(43);e.exports=n},function(e,t,r){function n(e){var t=o(this,e).delete(e);return this.size-=t?1:0,t}var o=r(4);e.exports=n},function(e,t,r){function n(e){return o(this,e).get(e)}var o=r(4);e.exports=n},function(e,t,r){function n(e){return o(this,e).has(e)}var o=r(4);e.exports=n},function(e,t,r){function n(e,t){var r=o(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var o=r(4);e.exports=n},function(e,t){function r(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}e.exports=r},function(e,t,r){(function(e){var n=r(24),o="object"==typeof t&&t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o,u=a&&n.process,s=function(){try{return u&&u.binding&&u.binding("util")}catch(e){}}();e.exports=s}).call(t,r(33)(e))},function(e,t){function r(e){return o.call(e)}var n=Object.prototype,o=n.toString;e.exports=r},function(e,t,r){function n(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var n=arguments,a=-1,u=i(n.length-t,0),s=Array(u);++a<u;)s[a]=n[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=n[a];return c[t]=r(s),o(e,this,c)}}var o=r(17),i=Math.max;e.exports=n},function(e,t){function r(e){return this.__data__.set(e,n),this}var n="__lodash_hash_undefined__";e.exports=r},function(e,t){function r(e){return this.__data__.has(e)}e.exports=r},function(e,t,r){var n=r(58),o=r(95),i=o(n);e.exports=i},function(e,t){function r(e){var t=0,r=0;return function(){var a=i(),u=o-(a-r);if(r=a,u>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var n=800,o=16,i=Date.now;e.exports=r},function(e,t){function r(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1}e.exports=r},function(e,t){function r(e){if(null!=e){
try{return o.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var n=Function.prototype,o=n.toString;e.exports=r},function(e,t,r){var n=r(61),o=r(63),i=r(103),a=o(function(e,t,r,o){n(t,i(t),e,o)});e.exports=a},function(e,t){function r(e){return function(){return e}}e.exports=r},function(e,t,r){var n=r(17),o=r(98),i=r(3),a=r(65),u=i(function(e){return e.push(void 0,a),n(o,void 0,e)});e.exports=u},function(e,t,r){(function(e){var n=r(1),o=r(106),i="object"==typeof t&&t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,u=a&&a.exports===i,s=u?n.Buffer:void 0,c=s?s.isBuffer:void 0,f=c||o;e.exports=f}).call(t,r(33)(e))},function(e,t,r){var n=r(56),o=r(21),i=r(89),a=i&&i.isTypedArray,u=a?o(a):n;e.exports=u},function(e,t,r){function n(e){return a(e)?o(e,!0):i(e)}var o=r(45),i=r(57),a=r(13);e.exports=n},function(e,t,r){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(i);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(n.Cache||o),r}var o=r(15),i="Expected a function";n.Cache=o,e.exports=n},function(e,t){function r(){}e.exports=r},function(e,t){function r(){return!1}e.exports=r},function(e,t,r){var n=r(51),o=r(3),i=r(60),a=r(30),u=o(function(e){return i(n(e,1,a,!0))});e.exports=u},function(e,t,r){var n=r(49),o=r(3),i=r(30),a=o(function(e,t){return i(e)?n(e,t):[]});e.exports=a}])});
'use strict';
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isSafari = exports.isFirefox = undefined;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _memoize = require('lodash/memoize');
var _lodashMemoize = require('lodash/memoize');
var _memoize2 = _interopRequireDefault(_memoize);
var _lodashMemoize2 = _interopRequireDefault(_lodashMemoize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var isFirefox = _lodashMemoize2['default'](function () {
var isFirefox = exports.isFirefox = (0, _memoize2.default)(function () {
return (/firefox/i.test(navigator.userAgent)
);
});
exports.isFirefox = isFirefox;
var isSafari = _lodashMemoize2['default'](function () {
var isSafari = exports.isSafari = (0, _memoize2.default)(function () {
return Boolean(window.safari);
});
exports.isSafari = isSafari;
});
'use strict';
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _union = require('lodash/union');
var _lodashUnion = require('lodash/union');
var _union2 = _interopRequireDefault(_union);
var _lodashUnion2 = _interopRequireDefault(_lodashUnion);
var _without = require('lodash/without');
var _lodashWithout = require('lodash/without');
var _without2 = _interopRequireDefault(_without);
var _lodashWithout2 = _interopRequireDefault(_lodashWithout);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var EnterLeaveCounter = (function () {
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var EnterLeaveCounter = function () {
function EnterLeaveCounter() {

@@ -24,30 +28,36 @@ _classCallCheck(this, EnterLeaveCounter);

EnterLeaveCounter.prototype.enter = function enter(enteringNode) {
var previousLength = this.entered.length;
_createClass(EnterLeaveCounter, [{
key: 'enter',
value: function enter(enteringNode) {
var previousLength = this.entered.length;
this.entered = _lodashUnion2['default'](this.entered.filter(function (node) {
return document.documentElement.contains(node) && (!node.contains || node.contains(enteringNode));
}), [enteringNode]);
var isNodeEntered = function isNodeEntered(node) {
return document.documentElement.contains(node) && (!node.contains || node.contains(enteringNode));
};
return previousLength === 0 && this.entered.length > 0;
};
this.entered = (0, _union2.default)(this.entered.filter(isNodeEntered), [enteringNode]);
EnterLeaveCounter.prototype.leave = function leave(leavingNode) {
var previousLength = this.entered.length;
return previousLength === 0 && this.entered.length > 0;
}
}, {
key: 'leave',
value: function leave(leavingNode) {
var previousLength = this.entered.length;
this.entered = _lodashWithout2['default'](this.entered.filter(function (node) {
return document.documentElement.contains(node);
}), leavingNode);
this.entered = (0, _without2.default)(this.entered.filter(function (node) {
return document.documentElement.contains(node);
}), leavingNode);
return previousLength > 0 && this.entered.length === 0;
};
return previousLength > 0 && this.entered.length === 0;
}
}, {
key: 'reset',
value: function reset() {
this.entered = [];
}
}]);
EnterLeaveCounter.prototype.reset = function reset() {
this.entered = [];
};
return EnterLeaveCounter;
})();
}();
exports['default'] = EnterLeaveCounter;
module.exports = exports['default'];
exports.default = EnterLeaveCounter;
'use strict';
exports.__esModule = true;
exports['default'] = getEmptyImage;
var emptyImage = undefined;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getEmptyImage;
var emptyImage = void 0;
function getEmptyImage() {

@@ -14,4 +15,2 @@ if (!emptyImage) {

return emptyImage;
}
module.exports = exports['default'];
}
'use strict';
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _defaults = require('lodash/defaults');
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _defaults2 = _interopRequireDefault(_defaults);
var _lodashDefaults = require('lodash/defaults');
var _lodashDefaults2 = _interopRequireDefault(_lodashDefaults);
var _shallowEqual = require('./shallowEqual');

@@ -33,3 +31,9 @@

var HTML5Backend = (function () {
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var HTML5Backend = function () {
function HTML5Backend(manager) {

@@ -41,2 +45,3 @@ _classCallCheck(this, HTML5Backend);

this.registry = manager.getRegistry();
this.context = manager.getContext();

@@ -47,3 +52,3 @@ this.sourcePreviewNodes = {};

this.sourceNodeOptions = {};
this.enterLeaveCounter = new _EnterLeaveCounter2['default']();
this.enterLeaveCounter = new _EnterLeaveCounter2.default();

@@ -66,515 +71,556 @@ this.getSourceClientOffset = this.getSourceClientOffset.bind(this);

HTML5Backend.prototype.setup = function setup() {
if (typeof window === 'undefined') {
return;
}
_createClass(HTML5Backend, [{
key: 'setup',
value: function setup() {
if (typeof this.window === 'undefined') {
return;
}
if (this.constructor.isSetUp) {
throw new Error('Cannot have two HTML5 backends at the same time.');
if (this.window.__isReactDndBackendSetUp) {
// eslint-disable-line no-underscore-dangle
throw new Error('Cannot have two HTML5 backends at the same time.');
}
this.window.__isReactDndBackendSetUp = true; // eslint-disable-line no-underscore-dangle
this.addEventListeners(this.window);
}
this.constructor.isSetUp = true;
this.addEventListeners(window);
};
}, {
key: 'teardown',
value: function teardown() {
if (typeof this.window === 'undefined') {
return;
}
HTML5Backend.prototype.teardown = function teardown() {
if (typeof window === 'undefined') {
return;
this.window.__isReactDndBackendSetUp = false; // eslint-disable-line no-underscore-dangle
this.removeEventListeners(this.window);
this.clearCurrentDragSourceNode();
}
}, {
key: 'addEventListeners',
value: function addEventListeners(target) {
target.addEventListener('dragstart', this.handleTopDragStart);
target.addEventListener('dragstart', this.handleTopDragStartCapture, true);
target.addEventListener('dragend', this.handleTopDragEndCapture, true);
target.addEventListener('dragenter', this.handleTopDragEnter);
target.addEventListener('dragenter', this.handleTopDragEnterCapture, true);
target.addEventListener('dragleave', this.handleTopDragLeaveCapture, true);
target.addEventListener('dragover', this.handleTopDragOver);
target.addEventListener('dragover', this.handleTopDragOverCapture, true);
target.addEventListener('drop', this.handleTopDrop);
target.addEventListener('drop', this.handleTopDropCapture, true);
}
}, {
key: 'removeEventListeners',
value: function removeEventListeners(target) {
target.removeEventListener('dragstart', this.handleTopDragStart);
target.removeEventListener('dragstart', this.handleTopDragStartCapture, true);
target.removeEventListener('dragend', this.handleTopDragEndCapture, true);
target.removeEventListener('dragenter', this.handleTopDragEnter);
target.removeEventListener('dragenter', this.handleTopDragEnterCapture, true);
target.removeEventListener('dragleave', this.handleTopDragLeaveCapture, true);
target.removeEventListener('dragover', this.handleTopDragOver);
target.removeEventListener('dragover', this.handleTopDragOverCapture, true);
target.removeEventListener('drop', this.handleTopDrop);
target.removeEventListener('drop', this.handleTopDropCapture, true);
}
}, {
key: 'connectDragPreview',
value: function connectDragPreview(sourceId, node, options) {
var _this = this;
this.constructor.isSetUp = false;
this.removeEventListeners(window);
this.clearCurrentDragSourceNode();
};
this.sourcePreviewNodeOptions[sourceId] = options;
this.sourcePreviewNodes[sourceId] = node;
HTML5Backend.prototype.addEventListeners = function addEventListeners(target) {
target.addEventListener('dragstart', this.handleTopDragStart);
target.addEventListener('dragstart', this.handleTopDragStartCapture, true);
target.addEventListener('dragend', this.handleTopDragEndCapture, true);
target.addEventListener('dragenter', this.handleTopDragEnter);
target.addEventListener('dragenter', this.handleTopDragEnterCapture, true);
target.addEventListener('dragleave', this.handleTopDragLeaveCapture, true);
target.addEventListener('dragover', this.handleTopDragOver);
target.addEventListener('dragover', this.handleTopDragOverCapture, true);
target.addEventListener('drop', this.handleTopDrop);
target.addEventListener('drop', this.handleTopDropCapture, true);
};
return function () {
delete _this.sourcePreviewNodes[sourceId];
delete _this.sourcePreviewNodeOptions[sourceId];
};
}
}, {
key: 'connectDragSource',
value: function connectDragSource(sourceId, node, options) {
var _this2 = this;
HTML5Backend.prototype.removeEventListeners = function removeEventListeners(target) {
target.removeEventListener('dragstart', this.handleTopDragStart);
target.removeEventListener('dragstart', this.handleTopDragStartCapture, true);
target.removeEventListener('dragend', this.handleTopDragEndCapture, true);
target.removeEventListener('dragenter', this.handleTopDragEnter);
target.removeEventListener('dragenter', this.handleTopDragEnterCapture, true);
target.removeEventListener('dragleave', this.handleTopDragLeaveCapture, true);
target.removeEventListener('dragover', this.handleTopDragOver);
target.removeEventListener('dragover', this.handleTopDragOverCapture, true);
target.removeEventListener('drop', this.handleTopDrop);
target.removeEventListener('drop', this.handleTopDropCapture, true);
};
this.sourceNodes[sourceId] = node;
this.sourceNodeOptions[sourceId] = options;
HTML5Backend.prototype.connectDragPreview = function connectDragPreview(sourceId, node, options) {
var _this = this;
var handleDragStart = function handleDragStart(e) {
return _this2.handleDragStart(e, sourceId);
};
var handleSelectStart = function handleSelectStart(e) {
return _this2.handleSelectStart(e, sourceId);
};
this.sourcePreviewNodeOptions[sourceId] = options;
this.sourcePreviewNodes[sourceId] = node;
node.setAttribute('draggable', true);
node.addEventListener('dragstart', handleDragStart);
node.addEventListener('selectstart', handleSelectStart);
return function () {
delete _this.sourcePreviewNodes[sourceId];
delete _this.sourcePreviewNodeOptions[sourceId];
};
};
return function () {
delete _this2.sourceNodes[sourceId];
delete _this2.sourceNodeOptions[sourceId];
HTML5Backend.prototype.connectDragSource = function connectDragSource(sourceId, node, options) {
var _this2 = this;
node.removeEventListener('dragstart', handleDragStart);
node.removeEventListener('selectstart', handleSelectStart);
node.setAttribute('draggable', false);
};
}
}, {
key: 'connectDropTarget',
value: function connectDropTarget(targetId, node) {
var _this3 = this;
this.sourceNodes[sourceId] = node;
this.sourceNodeOptions[sourceId] = options;
var handleDragEnter = function handleDragEnter(e) {
return _this3.handleDragEnter(e, targetId);
};
var handleDragOver = function handleDragOver(e) {
return _this3.handleDragOver(e, targetId);
};
var handleDrop = function handleDrop(e) {
return _this3.handleDrop(e, targetId);
};
var handleDragStart = function handleDragStart(e) {
return _this2.handleDragStart(e, sourceId);
};
var handleSelectStart = function handleSelectStart(e) {
return _this2.handleSelectStart(e, sourceId);
};
node.addEventListener('dragenter', handleDragEnter);
node.addEventListener('dragover', handleDragOver);
node.addEventListener('drop', handleDrop);
node.setAttribute('draggable', true);
node.addEventListener('dragstart', handleDragStart);
node.addEventListener('selectstart', handleSelectStart);
return function () {
delete _this2.sourceNodes[sourceId];
delete _this2.sourceNodeOptions[sourceId];
node.removeEventListener('dragstart', handleDragStart);
node.removeEventListener('selectstart', handleSelectStart);
node.setAttribute('draggable', false);
};
};
HTML5Backend.prototype.connectDropTarget = function connectDropTarget(targetId, node) {
var _this3 = this;
var handleDragEnter = function handleDragEnter(e) {
return _this3.handleDragEnter(e, targetId);
};
var handleDragOver = function handleDragOver(e) {
return _this3.handleDragOver(e, targetId);
};
var handleDrop = function handleDrop(e) {
return _this3.handleDrop(e, targetId);
};
node.addEventListener('dragenter', handleDragEnter);
node.addEventListener('dragover', handleDragOver);
node.addEventListener('drop', handleDrop);
return function () {
node.removeEventListener('dragenter', handleDragEnter);
node.removeEventListener('dragover', handleDragOver);
node.removeEventListener('drop', handleDrop);
};
};
HTML5Backend.prototype.getCurrentSourceNodeOptions = function getCurrentSourceNodeOptions() {
var sourceId = this.monitor.getSourceId();
var sourceNodeOptions = this.sourceNodeOptions[sourceId];
return _lodashDefaults2['default'](sourceNodeOptions || {}, {
dropEffect: 'move'
});
};
HTML5Backend.prototype.getCurrentDropEffect = function getCurrentDropEffect() {
if (this.isDraggingNativeItem()) {
// It makes more sense to default to 'copy' for native resources
return 'copy';
return function () {
node.removeEventListener('dragenter', handleDragEnter);
node.removeEventListener('dragover', handleDragOver);
node.removeEventListener('drop', handleDrop);
};
}
}, {
key: 'getCurrentSourceNodeOptions',
value: function getCurrentSourceNodeOptions() {
var sourceId = this.monitor.getSourceId();
var sourceNodeOptions = this.sourceNodeOptions[sourceId];
return this.getCurrentSourceNodeOptions().dropEffect;
};
HTML5Backend.prototype.getCurrentSourcePreviewNodeOptions = function getCurrentSourcePreviewNodeOptions() {
var sourceId = this.monitor.getSourceId();
var sourcePreviewNodeOptions = this.sourcePreviewNodeOptions[sourceId];
return _lodashDefaults2['default'](sourcePreviewNodeOptions || {}, {
anchorX: 0.5,
anchorY: 0.5,
captureDraggingState: false
});
};
HTML5Backend.prototype.getSourceClientOffset = function getSourceClientOffset(sourceId) {
return _OffsetUtils.getNodeClientOffset(this.sourceNodes[sourceId]);
};
HTML5Backend.prototype.isDraggingNativeItem = function isDraggingNativeItem() {
var itemType = this.monitor.getItemType();
return Object.keys(NativeTypes).some(function (key) {
return NativeTypes[key] === itemType;
});
};
HTML5Backend.prototype.beginDragNativeItem = function beginDragNativeItem(type) {
this.clearCurrentDragSourceNode();
var SourceType = _NativeDragSources.createNativeDragSource(type);
this.currentNativeSource = new SourceType();
this.currentNativeHandle = this.registry.addSource(type, this.currentNativeSource);
this.actions.beginDrag([this.currentNativeHandle]);
// On Firefox, if mousemove fires, the drag is over but browser failed to tell us.
// This is not true for other browsers.
if (_BrowserDetector.isFirefox()) {
window.addEventListener('mousemove', this.endDragNativeItem, true);
return (0, _defaults2.default)(sourceNodeOptions || {}, {
dropEffect: 'move'
});
}
};
}, {
key: 'getCurrentDropEffect',
value: function getCurrentDropEffect() {
if (this.isDraggingNativeItem()) {
// It makes more sense to default to 'copy' for native resources
return 'copy';
}
HTML5Backend.prototype.endDragNativeItem = function endDragNativeItem() {
if (!this.isDraggingNativeItem()) {
return;
return this.getCurrentSourceNodeOptions().dropEffect;
}
}, {
key: 'getCurrentSourcePreviewNodeOptions',
value: function getCurrentSourcePreviewNodeOptions() {
var sourceId = this.monitor.getSourceId();
var sourcePreviewNodeOptions = this.sourcePreviewNodeOptions[sourceId];
if (_BrowserDetector.isFirefox()) {
window.removeEventListener('mousemove', this.endDragNativeItem, true);
return (0, _defaults2.default)(sourcePreviewNodeOptions || {}, {
anchorX: 0.5,
anchorY: 0.5,
captureDraggingState: false
});
}
}, {
key: 'getSourceClientOffset',
value: function getSourceClientOffset(sourceId) {
return (0, _OffsetUtils.getNodeClientOffset)(this.sourceNodes[sourceId]);
}
}, {
key: 'isDraggingNativeItem',
value: function isDraggingNativeItem() {
var itemType = this.monitor.getItemType();
return Object.keys(NativeTypes).some(function (key) {
return NativeTypes[key] === itemType;
});
}
}, {
key: 'beginDragNativeItem',
value: function beginDragNativeItem(type) {
this.clearCurrentDragSourceNode();
this.actions.endDrag();
this.registry.removeSource(this.currentNativeHandle);
this.currentNativeHandle = null;
this.currentNativeSource = null;
};
var SourceType = (0, _NativeDragSources.createNativeDragSource)(type);
this.currentNativeSource = new SourceType();
this.currentNativeHandle = this.registry.addSource(type, this.currentNativeSource);
this.actions.beginDrag([this.currentNativeHandle]);
HTML5Backend.prototype.endDragIfSourceWasRemovedFromDOM = function endDragIfSourceWasRemovedFromDOM() {
var node = this.currentDragSourceNode;
if (document.body.contains(node)) {
return;
// On Firefox, if mousemove fires, the drag is over but browser failed to tell us.
// This is not true for other browsers.
if ((0, _BrowserDetector.isFirefox)()) {
this.window.addEventListener('mousemove', this.endDragNativeItem, true);
}
}
}, {
key: 'endDragNativeItem',
value: function endDragNativeItem() {
if (!this.isDraggingNativeItem()) {
return;
}
if (this.clearCurrentDragSourceNode()) {
if ((0, _BrowserDetector.isFirefox)()) {
this.window.removeEventListener('mousemove', this.endDragNativeItem, true);
}
this.actions.endDrag();
this.registry.removeSource(this.currentNativeHandle);
this.currentNativeHandle = null;
this.currentNativeSource = null;
}
};
}, {
key: 'endDragIfSourceWasRemovedFromDOM',
value: function endDragIfSourceWasRemovedFromDOM() {
var node = this.currentDragSourceNode;
if (document.body.contains(node)) {
return;
}
HTML5Backend.prototype.setCurrentDragSourceNode = function setCurrentDragSourceNode(node) {
this.clearCurrentDragSourceNode();
this.currentDragSourceNode = node;
this.currentDragSourceNodeOffset = _OffsetUtils.getNodeClientOffset(node);
this.currentDragSourceNodeOffsetChanged = false;
if (this.clearCurrentDragSourceNode()) {
this.actions.endDrag();
}
}
}, {
key: 'setCurrentDragSourceNode',
value: function setCurrentDragSourceNode(node) {
this.clearCurrentDragSourceNode();
this.currentDragSourceNode = node;
this.currentDragSourceNodeOffset = (0, _OffsetUtils.getNodeClientOffset)(node);
this.currentDragSourceNodeOffsetChanged = false;
// Receiving a mouse event in the middle of a dragging operation
// means it has ended and the drag source node disappeared from DOM,
// so the browser didn't dispatch the dragend event.
window.addEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true);
};
HTML5Backend.prototype.clearCurrentDragSourceNode = function clearCurrentDragSourceNode() {
if (this.currentDragSourceNode) {
this.currentDragSourceNode = null;
this.currentDragSourceNodeOffset = null;
this.currentDragSourceNodeOffsetChanged = false;
window.removeEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true);
return true;
// Receiving a mouse event in the middle of a dragging operation
// means it has ended and the drag source node disappeared from DOM,
// so the browser didn't dispatch the dragend event.
this.window.addEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true);
}
}, {
key: 'clearCurrentDragSourceNode',
value: function clearCurrentDragSourceNode() {
if (this.currentDragSourceNode) {
this.currentDragSourceNode = null;
this.currentDragSourceNodeOffset = null;
this.currentDragSourceNodeOffsetChanged = false;
this.window.removeEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true);
return true;
}
return false;
};
HTML5Backend.prototype.checkIfCurrentDragSourceRectChanged = function checkIfCurrentDragSourceRectChanged() {
var node = this.currentDragSourceNode;
if (!node) {
return false;
}
}, {
key: 'checkIfCurrentDragSourceRectChanged',
value: function checkIfCurrentDragSourceRectChanged() {
var node = this.currentDragSourceNode;
if (!node) {
return false;
}
if (this.currentDragSourceNodeOffsetChanged) {
return true;
}
if (this.currentDragSourceNodeOffsetChanged) {
return true;
}
this.currentDragSourceNodeOffsetChanged = !_shallowEqual2['default'](_OffsetUtils.getNodeClientOffset(node), this.currentDragSourceNodeOffset);
this.currentDragSourceNodeOffsetChanged = !(0, _shallowEqual2.default)((0, _OffsetUtils.getNodeClientOffset)(node), this.currentDragSourceNodeOffset);
return this.currentDragSourceNodeOffsetChanged;
};
return this.currentDragSourceNodeOffsetChanged;
}
}, {
key: 'handleTopDragStartCapture',
value: function handleTopDragStartCapture() {
this.clearCurrentDragSourceNode();
this.dragStartSourceIds = [];
}
}, {
key: 'handleDragStart',
value: function handleDragStart(e, sourceId) {
this.dragStartSourceIds.unshift(sourceId);
}
}, {
key: 'handleTopDragStart',
value: function handleTopDragStart(e) {
var _this4 = this;
HTML5Backend.prototype.handleTopDragStartCapture = function handleTopDragStartCapture() {
this.clearCurrentDragSourceNode();
this.dragStartSourceIds = [];
};
var dragStartSourceIds = this.dragStartSourceIds;
HTML5Backend.prototype.handleDragStart = function handleDragStart(e, sourceId) {
this.dragStartSourceIds.unshift(sourceId);
};
this.dragStartSourceIds = null;
HTML5Backend.prototype.handleTopDragStart = function handleTopDragStart(e) {
var _this4 = this;
var clientOffset = (0, _OffsetUtils.getEventClientOffset)(e);
var dragStartSourceIds = this.dragStartSourceIds;
// Don't publish the source just yet (see why below)
this.actions.beginDrag(dragStartSourceIds, {
publishSource: false,
getSourceClientOffset: this.getSourceClientOffset,
clientOffset: clientOffset
});
this.dragStartSourceIds = null;
var dataTransfer = e.dataTransfer;
var clientOffset = _OffsetUtils.getEventClientOffset(e);
var nativeType = (0, _NativeDragSources.matchNativeItemType)(dataTransfer);
// Don't publish the source just yet (see why below)
this.actions.beginDrag(dragStartSourceIds, {
publishSource: false,
getSourceClientOffset: this.getSourceClientOffset,
clientOffset: clientOffset
});
if (this.monitor.isDragging()) {
if (typeof dataTransfer.setDragImage === 'function') {
// Use custom drag image if user specifies it.
// If child drag source refuses drag but parent agrees,
// use parent's node as drag image. Neither works in IE though.
var sourceId = this.monitor.getSourceId();
var sourceNode = this.sourceNodes[sourceId];
var dragPreview = this.sourcePreviewNodes[sourceId] || sourceNode;
var dataTransfer = e.dataTransfer;
var _getCurrentSourcePrev = this.getCurrentSourcePreviewNodeOptions(),
anchorX = _getCurrentSourcePrev.anchorX,
anchorY = _getCurrentSourcePrev.anchorY;
var nativeType = _NativeDragSources.matchNativeItemType(dataTransfer);
var anchorPoint = { anchorX: anchorX, anchorY: anchorY };
var dragPreviewOffset = (0, _OffsetUtils.getDragPreviewOffset)(sourceNode, dragPreview, clientOffset, anchorPoint);
dataTransfer.setDragImage(dragPreview, dragPreviewOffset.x, dragPreviewOffset.y);
}
if (this.monitor.isDragging()) {
if (typeof dataTransfer.setDragImage === 'function') {
// Use custom drag image if user specifies it.
// If child drag source refuses drag but parent agrees,
// use parent's node as drag image. Neither works in IE though.
var sourceId = this.monitor.getSourceId();
var sourceNode = this.sourceNodes[sourceId];
var dragPreview = this.sourcePreviewNodes[sourceId] || sourceNode;
try {
// Firefox won't drag without setting data
dataTransfer.setData('application/json', {});
} catch (err) {}
// IE doesn't support MIME types in setData
var _getCurrentSourcePreviewNodeOptions = this.getCurrentSourcePreviewNodeOptions();
var anchorX = _getCurrentSourcePreviewNodeOptions.anchorX;
var anchorY = _getCurrentSourcePreviewNodeOptions.anchorY;
// Store drag source node so we can check whether
// it is removed from DOM and trigger endDrag manually.
this.setCurrentDragSourceNode(e.target);
var anchorPoint = { anchorX: anchorX, anchorY: anchorY };
var dragPreviewOffset = _OffsetUtils.getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint);
dataTransfer.setDragImage(dragPreview, dragPreviewOffset.x, dragPreviewOffset.y);
}
// Now we are ready to publish the drag source.. or are we not?
try {
// Firefox won't drag without setting data
dataTransfer.setData('application/json', {});
} catch (err) {}
// IE doesn't support MIME types in setData
var _getCurrentSourcePrev2 = this.getCurrentSourcePreviewNodeOptions(),
captureDraggingState = _getCurrentSourcePrev2.captureDraggingState;
// Store drag source node so we can check whether
// it is removed from DOM and trigger endDrag manually.
this.setCurrentDragSourceNode(e.target);
// Now we are ready to publish the drag source.. or are we not?
var _getCurrentSourcePreviewNodeOptions2 = this.getCurrentSourcePreviewNodeOptions();
var captureDraggingState = _getCurrentSourcePreviewNodeOptions2.captureDraggingState;
if (!captureDraggingState) {
// Usually we want to publish it in the next tick so that browser
// is able to screenshot the current (not yet dragging) state.
//
// It also neatly avoids a situation where render() returns null
// in the same tick for the source element, and browser freaks out.
setTimeout(function () {
return _this4.actions.publishDragSource();
});
if (!captureDraggingState) {
// Usually we want to publish it in the next tick so that browser
// is able to screenshot the current (not yet dragging) state.
//
// It also neatly avoids a situation where render() returns null
// in the same tick for the source element, and browser freaks out.
setTimeout(function () {
return _this4.actions.publishDragSource();
});
} else {
// In some cases the user may want to override this behavior, e.g.
// to work around IE not supporting custom drag previews.
//
// When using a custom drag layer, the only way to prevent
// the default drag preview from drawing in IE is to screenshot
// the dragging state in which the node itself has zero opacity
// and height. In this case, though, returning null from render()
// will abruptly end the dragging, which is not obvious.
//
// This is the reason such behavior is strictly opt-in.
this.actions.publishDragSource();
}
} else if (nativeType) {
// A native item (such as URL) dragged from inside the document
this.beginDragNativeItem(nativeType);
} else if (!dataTransfer.types && (!e.target.hasAttribute || !e.target.hasAttribute('draggable'))) {
// Looks like a Safari bug: dataTransfer.types is null, but there was no draggable.
// Just let it drag. It's a native type (URL or text) and will be picked up in
// dragenter handler.
return; // eslint-disable-line no-useless-return
} else {
// In some cases the user may want to override this behavior, e.g.
// to work around IE not supporting custom drag previews.
//
// When using a custom drag layer, the only way to prevent
// the default drag preview from drawing in IE is to screenshot
// the dragging state in which the node itself has zero opacity
// and height. In this case, though, returning null from render()
// will abruptly end the dragging, which is not obvious.
//
// This is the reason such behavior is strictly opt-in.
this.actions.publishDragSource();
// If by this time no drag source reacted, tell browser not to drag.
e.preventDefault();
}
} else if (nativeType) {
// A native item (such as URL) dragged from inside the document
this.beginDragNativeItem(nativeType);
} else if (!dataTransfer.types && (!e.target.hasAttribute || !e.target.hasAttribute('draggable'))) {
// Looks like a Safari bug: dataTransfer.types is null, but there was no draggable.
// Just let it drag. It's a native type (URL or text) and will be picked up in dragenter handler.
return;
} else {
// If by this time no drag source reacted, tell browser not to drag.
e.preventDefault();
}
};
HTML5Backend.prototype.handleTopDragEndCapture = function handleTopDragEndCapture() {
if (this.clearCurrentDragSourceNode()) {
// Firefox can dispatch this event in an infinite loop
// if dragend handler does something like showing an alert.
// Only proceed if we have not handled it already.
this.actions.endDrag();
}, {
key: 'handleTopDragEndCapture',
value: function handleTopDragEndCapture() {
if (this.clearCurrentDragSourceNode()) {
// Firefox can dispatch this event in an infinite loop
// if dragend handler does something like showing an alert.
// Only proceed if we have not handled it already.
this.actions.endDrag();
}
}
};
}, {
key: 'handleTopDragEnterCapture',
value: function handleTopDragEnterCapture(e) {
this.dragEnterTargetIds = [];
HTML5Backend.prototype.handleTopDragEnterCapture = function handleTopDragEnterCapture(e) {
this.dragEnterTargetIds = [];
var isFirstEnter = this.enterLeaveCounter.enter(e.target);
if (!isFirstEnter || this.monitor.isDragging()) {
return;
}
var isFirstEnter = this.enterLeaveCounter.enter(e.target);
if (!isFirstEnter || this.monitor.isDragging()) {
return;
}
var dataTransfer = e.dataTransfer;
var dataTransfer = e.dataTransfer;
var nativeType = (0, _NativeDragSources.matchNativeItemType)(dataTransfer);
var nativeType = _NativeDragSources.matchNativeItemType(dataTransfer);
if (nativeType) {
// A native item (such as file or URL) dragged from outside the document
this.beginDragNativeItem(nativeType);
if (nativeType) {
// A native item (such as file or URL) dragged from outside the document
this.beginDragNativeItem(nativeType);
}
}
};
}, {
key: 'handleDragEnter',
value: function handleDragEnter(e, targetId) {
this.dragEnterTargetIds.unshift(targetId);
}
}, {
key: 'handleTopDragEnter',
value: function handleTopDragEnter(e) {
var _this5 = this;
HTML5Backend.prototype.handleDragEnter = function handleDragEnter(e, targetId) {
this.dragEnterTargetIds.unshift(targetId);
};
var dragEnterTargetIds = this.dragEnterTargetIds;
HTML5Backend.prototype.handleTopDragEnter = function handleTopDragEnter(e) {
var _this5 = this;
this.dragEnterTargetIds = [];
var dragEnterTargetIds = this.dragEnterTargetIds;
if (!this.monitor.isDragging()) {
// This is probably a native item type we don't understand.
return;
}
this.dragEnterTargetIds = [];
if (!(0, _BrowserDetector.isFirefox)()) {
// Don't emit hover in `dragenter` on Firefox due to an edge case.
// If the target changes position as the result of `dragenter`, Firefox
// will still happily dispatch `dragover` despite target being no longer
// there. The easy solution is to only fire `hover` in `dragover` on FF.
this.actions.hover(dragEnterTargetIds, {
clientOffset: (0, _OffsetUtils.getEventClientOffset)(e)
});
}
if (!this.monitor.isDragging()) {
// This is probably a native item type we don't understand.
return;
}
if (!_BrowserDetector.isFirefox()) {
// Don't emit hover in `dragenter` on Firefox due to an edge case.
// If the target changes position as the result of `dragenter`, Firefox
// will still happily dispatch `dragover` despite target being no longer
// there. The easy solution is to only fire `hover` in `dragover` on FF.
this.actions.hover(dragEnterTargetIds, {
clientOffset: _OffsetUtils.getEventClientOffset(e)
var canDrop = dragEnterTargetIds.some(function (targetId) {
return _this5.monitor.canDropOnTarget(targetId);
});
}
var canDrop = dragEnterTargetIds.some(function (targetId) {
return _this5.monitor.canDropOnTarget(targetId);
});
if (canDrop) {
// IE requires this to fire dragover events
e.preventDefault();
e.dataTransfer.dropEffect = this.getCurrentDropEffect();
if (canDrop) {
// IE requires this to fire dragover events
e.preventDefault();
e.dataTransfer.dropEffect = this.getCurrentDropEffect();
}
}
};
}, {
key: 'handleTopDragOverCapture',
value: function handleTopDragOverCapture() {
this.dragOverTargetIds = [];
}
}, {
key: 'handleDragOver',
value: function handleDragOver(e, targetId) {
this.dragOverTargetIds.unshift(targetId);
}
}, {
key: 'handleTopDragOver',
value: function handleTopDragOver(e) {
var _this6 = this;
HTML5Backend.prototype.handleTopDragOverCapture = function handleTopDragOverCapture() {
this.dragOverTargetIds = [];
};
var dragOverTargetIds = this.dragOverTargetIds;
HTML5Backend.prototype.handleDragOver = function handleDragOver(e, targetId) {
this.dragOverTargetIds.unshift(targetId);
};
this.dragOverTargetIds = [];
HTML5Backend.prototype.handleTopDragOver = function handleTopDragOver(e) {
var _this6 = this;
if (!this.monitor.isDragging()) {
// This is probably a native item type we don't understand.
// Prevent default "drop and blow away the whole document" action.
e.preventDefault();
e.dataTransfer.dropEffect = 'none';
return;
}
var dragOverTargetIds = this.dragOverTargetIds;
this.actions.hover(dragOverTargetIds, {
clientOffset: (0, _OffsetUtils.getEventClientOffset)(e)
});
this.dragOverTargetIds = [];
var canDrop = dragOverTargetIds.some(function (targetId) {
return _this6.monitor.canDropOnTarget(targetId);
});
if (!this.monitor.isDragging()) {
// This is probably a native item type we don't understand.
// Prevent default "drop and blow away the whole document" action.
e.preventDefault();
e.dataTransfer.dropEffect = 'none';
return;
if (canDrop) {
// Show user-specified drop effect.
e.preventDefault();
e.dataTransfer.dropEffect = this.getCurrentDropEffect();
} else if (this.isDraggingNativeItem()) {
// Don't show a nice cursor but still prevent default
// "drop and blow away the whole document" action.
e.preventDefault();
e.dataTransfer.dropEffect = 'none';
} else if (this.checkIfCurrentDragSourceRectChanged()) {
// Prevent animating to incorrect position.
// Drop effect must be other than 'none' to prevent animation.
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
}
}
}, {
key: 'handleTopDragLeaveCapture',
value: function handleTopDragLeaveCapture(e) {
if (this.isDraggingNativeItem()) {
e.preventDefault();
}
this.actions.hover(dragOverTargetIds, {
clientOffset: _OffsetUtils.getEventClientOffset(e)
});
var isLastLeave = this.enterLeaveCounter.leave(e.target);
if (!isLastLeave) {
return;
}
var canDrop = dragOverTargetIds.some(function (targetId) {
return _this6.monitor.canDropOnTarget(targetId);
});
if (canDrop) {
// Show user-specified drop effect.
e.preventDefault();
e.dataTransfer.dropEffect = this.getCurrentDropEffect();
} else if (this.isDraggingNativeItem()) {
// Don't show a nice cursor but still prevent default
// "drop and blow away the whole document" action.
e.preventDefault();
e.dataTransfer.dropEffect = 'none';
} else if (this.checkIfCurrentDragSourceRectChanged()) {
// Prevent animating to incorrect position.
// Drop effect must be other than 'none' to prevent animation.
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
if (this.isDraggingNativeItem()) {
this.endDragNativeItem();
}
}
};
HTML5Backend.prototype.handleTopDragLeaveCapture = function handleTopDragLeaveCapture(e) {
if (this.isDraggingNativeItem()) {
}, {
key: 'handleTopDropCapture',
value: function handleTopDropCapture(e) {
this.dropTargetIds = [];
e.preventDefault();
}
var isLastLeave = this.enterLeaveCounter.leave(e.target);
if (!isLastLeave) {
return;
}
if (this.isDraggingNativeItem()) {
this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer);
}
if (this.isDraggingNativeItem()) {
this.endDragNativeItem();
this.enterLeaveCounter.reset();
}
};
HTML5Backend.prototype.handleTopDropCapture = function handleTopDropCapture(e) {
this.dropTargetIds = [];
e.preventDefault();
if (this.isDraggingNativeItem()) {
this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer);
}, {
key: 'handleDrop',
value: function handleDrop(e, targetId) {
this.dropTargetIds.unshift(targetId);
}
}, {
key: 'handleTopDrop',
value: function handleTopDrop(e) {
var dropTargetIds = this.dropTargetIds;
this.enterLeaveCounter.reset();
};
this.dropTargetIds = [];
HTML5Backend.prototype.handleDrop = function handleDrop(e, targetId) {
this.dropTargetIds.unshift(targetId);
};
this.actions.hover(dropTargetIds, {
clientOffset: (0, _OffsetUtils.getEventClientOffset)(e)
});
this.actions.drop();
HTML5Backend.prototype.handleTopDrop = function handleTopDrop(e) {
var dropTargetIds = this.dropTargetIds;
if (this.isDraggingNativeItem()) {
this.endDragNativeItem();
} else {
this.endDragIfSourceWasRemovedFromDOM();
}
}
}, {
key: 'handleSelectStart',
value: function handleSelectStart(e) {
var target = e.target;
this.dropTargetIds = [];
// Only IE requires us to explicitly say
// we want drag drop operation to start
this.actions.hover(dropTargetIds, {
clientOffset: _OffsetUtils.getEventClientOffset(e)
});
this.actions.drop();
if (typeof target.dragDrop !== 'function') {
return;
}
if (this.isDraggingNativeItem()) {
this.endDragNativeItem();
} else {
this.endDragIfSourceWasRemovedFromDOM();
}
};
// Inputs and textareas should be selectable
if (target.tagName === 'INPUT' || target.tagName === 'SELECT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {
return;
}
HTML5Backend.prototype.handleSelectStart = function handleSelectStart(e) {
var target = e.target;
// Only IE requires us to explicitly say
// we want drag drop operation to start
if (typeof target.dragDrop !== 'function') {
return;
// For other targets, ask IE
// to enable drag and drop
e.preventDefault();
target.dragDrop();
}
// Inputs and textareas should be selectable
if (target.tagName === 'INPUT' || target.tagName === 'SELECT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {
return;
}, {
key: 'window',
get: function get() {
return this.context && this.context.window || window;
}
}]);
// For other targets, ask IE
// to enable drag and drop
e.preventDefault();
target.dragDrop();
};
return HTML5Backend;
})();
}();
exports['default'] = HTML5Backend;
module.exports = exports['default'];
exports.default = HTML5Backend;
'use strict';
exports.__esModule = true;
exports['default'] = createHTML5Backend;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getEmptyImage = exports.NativeTypes = undefined;
exports.default = createHTML5Backend;
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _HTML5Backend = require('./HTML5Backend');

@@ -22,7 +21,10 @@

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.NativeTypes = NativeTypes;
exports.getEmptyImage = _getEmptyImage2['default'];
exports.getEmptyImage = _getEmptyImage2.default;
function createHTML5Backend(manager) {
return new _HTML5Backend2['default'](manager);
return new _HTML5Backend2.default(manager);
}
"use strict";
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var MonotonicInterpolant = (function () {
/* eslint
no-plusplus: off,
no-mixed-operators: off
*/
var MonotonicInterpolant = function () {
function MonotonicInterpolant(xs, ys) {

@@ -26,7 +34,7 @@ _classCallCheck(this, MonotonicInterpolant);

var ms = [];
var dx = undefined;
var dy = undefined;
for (var i = 0; i < length - 1; i++) {
dx = xs[i + 1] - xs[i];
dy = ys[i + 1] - ys[i];
var dx = void 0;
var dy = void 0;
for (var _i = 0; _i < length - 1; _i++) {
dx = xs[_i + 1] - xs[_i];
dy = ys[_i + 1] - ys[_i];
dxs.push(dx);

@@ -39,10 +47,10 @@ dys.push(dy);

var c1s = [ms[0]];
for (var i = 0; i < dxs.length - 1; i++) {
var _m = ms[i];
var mNext = ms[i + 1];
for (var _i2 = 0; _i2 < dxs.length - 1; _i2++) {
var _m = ms[_i2];
var mNext = ms[_i2 + 1];
if (_m * mNext <= 0) {
c1s.push(0);
} else {
dx = dxs[i];
var dxNext = dxs[i + 1];
dx = dxs[_i2];
var dxNext = dxs[_i2 + 1];
var common = dx + dxNext;

@@ -57,10 +65,10 @@ c1s.push(3 * common / ((common + dxNext) / _m + (common + dx) / mNext));

var c3s = [];
var m = undefined;
for (var i = 0; i < c1s.length - 1; i++) {
m = ms[i];
var c1 = c1s[i];
var invDx = 1 / dxs[i];
var common = c1 + c1s[i + 1] - m - m;
c2s.push((m - c1 - common) * invDx);
c3s.push(common * invDx * invDx);
var m = void 0;
for (var _i3 = 0; _i3 < c1s.length - 1; _i3++) {
m = ms[_i3];
var c1 = c1s[_i3];
var invDx = 1 / dxs[_i3];
var _common = c1 + c1s[_i3 + 1] - m - m;
c2s.push((m - c1 - _common) * invDx);
c3s.push(_common * invDx * invDx);
}

@@ -75,42 +83,45 @@

MonotonicInterpolant.prototype.interpolate = function interpolate(x) {
var xs = this.xs;
var ys = this.ys;
var c1s = this.c1s;
var c2s = this.c2s;
var c3s = this.c3s;
_createClass(MonotonicInterpolant, [{
key: "interpolate",
value: function interpolate(x) {
var xs = this.xs,
ys = this.ys,
c1s = this.c1s,
c2s = this.c2s,
c3s = this.c3s;
// The rightmost point in the dataset should give an exact result
var i = xs.length - 1;
if (x === xs[i]) {
return ys[i];
}
// The rightmost point in the dataset should give an exact result
// Search for the interval x is in, returning the corresponding y if x is one of the original xs
var low = 0;
var high = c3s.length - 1;
var mid = undefined;
while (low <= high) {
mid = Math.floor(0.5 * (low + high));
var xHere = xs[mid];
if (xHere < x) {
low = mid + 1;
} else if (xHere > x) {
high = mid - 1;
} else {
return ys[mid];
var i = xs.length - 1;
if (x === xs[i]) {
return ys[i];
}
// Search for the interval x is in, returning the corresponding y if x is one of the original xs
var low = 0;
var high = c3s.length - 1;
var mid = void 0;
while (low <= high) {
mid = Math.floor(0.5 * (low + high));
var xHere = xs[mid];
if (xHere < x) {
low = mid + 1;
} else if (xHere > x) {
high = mid - 1;
} else {
return ys[mid];
}
}
i = Math.max(0, high);
// Interpolate
var diff = x - xs[i];
var diffSq = diff * diff;
return ys[i] + c1s[i] * diff + c2s[i] * diffSq + c3s[i] * diff * diffSq;
}
i = Math.max(0, high);
}]);
// Interpolate
var diff = x - xs[i];
var diffSq = diff * diff;
return ys[i] + c1s[i] * diff + c2s[i] * diffSq + c3s[i] * diff * diffSq;
};
return MonotonicInterpolant;
})();
}();
exports["default"] = MonotonicInterpolant;
module.exports = exports["default"];
exports.default = MonotonicInterpolant;
'use strict';
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _nativeTypesConfig;

@@ -10,12 +14,14 @@

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
var _NativeTypes = require('./NativeTypes');
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var NativeTypes = _interopRequireWildcard(_NativeTypes);
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var _NativeTypes = require('./NativeTypes');
function _defineEnumerableProperties(obj, descs) { for (var key in descs) { var desc = descs[key]; desc.configurable = desc.enumerable = true; if ("value" in desc) desc.writable = true; Object.defineProperty(obj, key, desc); } return obj; }
var NativeTypes = _interopRequireWildcard(_NativeTypes);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function getDataFromDataTransfer(dataTransfer, typesToTry, defaultValue) {

@@ -51,43 +57,49 @@ var result = typesToTry.reduce(function (resultSoFar, typeToTry) {

function createNativeDragSource(type) {
var _nativeTypesConfig$type = nativeTypesConfig[type];
var exposeProperty = _nativeTypesConfig$type.exposeProperty;
var matchesTypes = _nativeTypesConfig$type.matchesTypes;
var getData = _nativeTypesConfig$type.getData;
var _nativeTypesConfig$ty = nativeTypesConfig[type],
exposeProperty = _nativeTypesConfig$ty.exposeProperty,
matchesTypes = _nativeTypesConfig$ty.matchesTypes,
getData = _nativeTypesConfig$ty.getData;
return (function () {
return function () {
function NativeDragSource() {
var _item, _mutatorMap;
_classCallCheck(this, NativeDragSource);
this.item = Object.defineProperties({}, _defineProperty({}, exposeProperty, {
get: function get() {
console.warn( // eslint-disable-line no-console
'Browser doesn\'t allow reading "' + exposeProperty + '" until the drop event.');
return null;
},
configurable: true,
enumerable: true
}));
this.item = (_item = {}, _mutatorMap = {}, _mutatorMap[exposeProperty] = _mutatorMap[exposeProperty] || {}, _mutatorMap[exposeProperty].get = function () {
console.warn( // eslint-disable-line no-console
'Browser doesn\'t allow reading "' + exposeProperty + '" until the drop event.');
return null;
}, _defineEnumerableProperties(_item, _mutatorMap), _item);
}
NativeDragSource.prototype.mutateItemByReadingDataTransfer = function mutateItemByReadingDataTransfer(dataTransfer) {
delete this.item[exposeProperty];
this.item[exposeProperty] = getData(dataTransfer, matchesTypes);
};
_createClass(NativeDragSource, [{
key: 'mutateItemByReadingDataTransfer',
value: function mutateItemByReadingDataTransfer(dataTransfer) {
delete this.item[exposeProperty];
this.item[exposeProperty] = getData(dataTransfer, matchesTypes);
}
}, {
key: 'canDrag',
value: function canDrag() {
return true;
}
}, {
key: 'beginDrag',
value: function beginDrag() {
return this.item;
}
}, {
key: 'isDragging',
value: function isDragging(monitor, handle) {
return handle === monitor.getSourceId();
}
}, {
key: 'endDrag',
value: function endDrag() {}
}]);
NativeDragSource.prototype.canDrag = function canDrag() {
return true;
};
NativeDragSource.prototype.beginDrag = function beginDrag() {
return this.item;
};
NativeDragSource.prototype.isDragging = function isDragging(monitor, handle) {
return handle === monitor.getSourceId();
};
NativeDragSource.prototype.endDrag = function endDrag() {};
return NativeDragSource;
})();
}();
}

@@ -94,0 +106,0 @@

'use strict';
exports.__esModule = true;
var FILE = '__NATIVE_FILE__';
exports.FILE = FILE;
var URL = '__NATIVE_URL__';
exports.URL = URL;
var TEXT = '__NATIVE_TEXT__';
exports.TEXT = TEXT;
Object.defineProperty(exports, "__esModule", {
value: true
});
var FILE = exports.FILE = '__NATIVE_FILE__';
var URL = exports.URL = '__NATIVE_URL__';
var TEXT = exports.TEXT = '__NATIVE_TEXT__';
'use strict';
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getNodeClientOffset = getNodeClientOffset;

@@ -8,4 +10,2 @@ exports.getEventClientOffset = getEventClientOffset;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _BrowserDetector = require('./BrowserDetector');

@@ -17,2 +17,7 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/* eslint
no-mixed-operators: off
*/
var ELEMENT_NODE = 1;

@@ -27,7 +32,6 @@

var _el$getBoundingClientRect = el.getBoundingClientRect();
var _el$getBoundingClient = el.getBoundingClientRect(),
top = _el$getBoundingClient.top,
left = _el$getBoundingClient.left;
var top = _el$getBoundingClientRect.top;
var left = _el$getBoundingClientRect.left;
return { x: left, y: top };

@@ -46,3 +50,3 @@ }

// Firefox only cares if it's an image, but WebKit also wants it to be detached.
var isImage = dragPreview.nodeName === 'IMG' && (_BrowserDetector.isFirefox() || !document.documentElement.contains(dragPreview));
var isImage = dragPreview.nodeName === 'IMG' && ((0, _BrowserDetector.isFirefox)() || !document.documentElement.contains(dragPreview));
var dragPreviewNode = isImage ? sourceNode : dragPreview;

@@ -56,7 +60,8 @@

var sourceWidth = sourceNode.offsetWidth;
var sourceHeight = sourceNode.offsetHeight;
var anchorX = anchorPoint.anchorX;
var anchorY = anchorPoint.anchorY;
var sourceWidth = sourceNode.offsetWidth,
sourceHeight = sourceNode.offsetHeight;
var anchorX = anchorPoint.anchorX,
anchorY = anchorPoint.anchorY;
var dragPreviewWidth = isImage ? dragPreview.width : sourceWidth;

@@ -66,6 +71,6 @@ var dragPreviewHeight = isImage ? dragPreview.height : sourceHeight;

// Work around @2x coordinate discrepancies in browsers
if (_BrowserDetector.isSafari() && isImage) {
if ((0, _BrowserDetector.isSafari)() && isImage) {
dragPreviewHeight /= window.devicePixelRatio;
dragPreviewWidth /= window.devicePixelRatio;
} else if (_BrowserDetector.isFirefox() && !isImage) {
} else if ((0, _BrowserDetector.isFirefox)() && !isImage) {
dragPreviewHeight *= window.devicePixelRatio;

@@ -77,3 +82,3 @@ dragPreviewWidth *= window.devicePixelRatio;

// If you know a simpler way to do this, let me know
var interpolantX = new _MonotonicInterpolant2['default']([0, 0.5, 1], [
var interpolantX = new _MonotonicInterpolant2.default([0, 0.5, 1], [
// Dock to the left

@@ -85,3 +90,3 @@ offsetFromDragPreview.x,

offsetFromDragPreview.x + dragPreviewWidth - sourceWidth]);
var interpolantY = new _MonotonicInterpolant2['default']([0, 0.5, 1], [
var interpolantY = new _MonotonicInterpolant2.default([0, 0.5, 1], [
// Dock to the top

@@ -97,3 +102,3 @@ offsetFromDragPreview.y,

// Work around Safari 8 positioning bug
if (_BrowserDetector.isSafari() && isImage) {
if ((0, _BrowserDetector.isSafari)() && isImage) {
// We'll have to wait for @3x to see if this is entirely correct

@@ -100,0 +105,0 @@ y += (window.devicePixelRatio - 1) * dragPreviewHeight;

"use strict";
exports.__esModule = true;
exports["default"] = shallowEqual;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = shallowEqual;
function shallowEqual(objA, objB) {

@@ -20,3 +21,3 @@ if (objA === objB) {

var hasOwn = Object.prototype.hasOwnProperty;
for (var i = 0; i < keysA.length; i++) {
for (var i = 0; i < keysA.length; i += 1) {
if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {

@@ -35,4 +36,2 @@ return false;

return true;
}
module.exports = exports["default"];
}
{
"name": "react-dnd-html5-backend",
"version": "2.1.2",
"version": "2.2.0",
"description": "HTML5 backend for React DnD",

@@ -10,11 +10,13 @@ "main": "lib/index.js",

"build:umd": "webpack",
"build": "npm run build:lib && npm run build:umd",
"build": "npm-run-all --parallel build:*",
"lint": "eslint .",
"test": "mocha --compilers js:babel/register --recursive",
"test:watch": "npm run test -- --watch",
"prepublish": "npm run lint && npm run clean && npm run test && npm run build"
"unit_test": "mocha --require babel-register --recursive",
"unit_test:watch": "npm run unit_test -- --watch",
"test": "npm-run-all clean --parallel lint build unit_test",
"develop": "npm run unit_test:watch",
"prepublish": "npm test"
},
"repository": {
"type": "git",
"url": "https://github.com/gaearon/react-dnd-html5-backend.git"
"url": "https://github.com/react-dnd/react-dnd-html5-backend.git"
},

@@ -24,13 +26,21 @@ "author": "Dan Abramov <dan.abramov@me.com> (http://github.com/gaearon)",

"bugs": {
"url": "https://github.com/gaearon/react-dnd-html5-backend/issues"
"url": "https://github.com/react-dnd/react-dnd-html5-backend/issues"
},
"homepage": "https://github.com/gaearon/react-dnd-html5-backend",
"homepage": "https://github.com/react-dnd/react-dnd-html5-backend",
"devDependencies": {
"babel": "^5.8.23",
"babel-eslint": "^4.1.3",
"babel-loader": "^5.3.2",
"eslint": "^1.6.0",
"eslint-config-airbnb": "^0.1.0",
"babel-cli": "^6.22.2",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.10",
"babel-preset-latest": "^6.22.0",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"eslint": "^3.14.0",
"eslint-config-airbnb": "^14.0.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^3.0.2",
"eslint-plugin-react": "^6.9.0",
"expect.js": "^0.3.1",
"mocha": "^2.0.1",
"mocha": "^3.2.0",
"npm-run-all": "^4.0.1",
"react-dnd": "^2.2.0",
"rimraf": "^2.4.3",

@@ -43,4 +53,4 @@ "webpack": "^1.12.2"

"peerDependencies": {
"react-dnd": "^2.0.0"
"react-dnd": "^2.2.0"
}
}

@@ -1,6 +0,12 @@

# React DnD HTML5 Backend [![npm package](https://img.shields.io/npm/v/react-dnd-html5-backend.svg?style=flat-square)](https://www.npmjs.org/package/react-dnd-html5-backend)
[![npm package](https://img.shields.io/npm/v/react-dnd-html5-backend.svg?style=flat-square)](https://www.npmjs.org/package/react-dnd-html5-backend)
[![Build Status](https://travis-ci.org/react-dnd/react-dnd-html5-backend.svg?branch=master)](https://travis-ci.org/react-dnd/react-dnd-html5-backend)
[![dependencies Status](https://david-dm.org/react-dnd/react-dnd-html5-backend/status.svg)](https://david-dm.org/react-dnd/react-dnd-html5-backend)
[![devDependencies Status](https://david-dm.org/react-dnd/react-dnd-html5-backend/dev-status.svg)](https://david-dm.org/react-dnd/react-dnd-html5-backend?type=dev)
[![peerDependencies Status](https://david-dm.org/react-dnd/react-dnd-html5-backend/peer-status.svg)](https://david-dm.org/react-dnd/react-dnd-html5-backend?type=peer)
The officially supported HTML5 backend for [React DnD](http://gaearon.github.io/react-dnd/).
See [the docs](http://gaearon.github.io/react-dnd/docs-html5-backend.html) for usage information.
# React DnD HTML5 Backend
The officially supported HTML5 backend for [React DnD](http://react-dnd.github.io/react-dnd/).
See [the docs](http://react-dnd.github.io/react-dnd/docs-html5-backend.html) for usage information.
## Installation

@@ -19,3 +25,3 @@

If you’d rather not use npm, you can use [npmcdn](http://npmcdn.com/) to access the UMD build directly: [ReactDnDHTML5Backend.min.js](https://npmcdn.com/react-dnd-html5-backend@latest/dist/ReactDnDHTML5Backend.min.js).
If you’d rather not use npm, you can use [unpkg](http://unpkg.com/) to access the UMD build directly: [ReactDnDHTML5Backend.min.js](https://unpkg.com/react-dnd-html5-backend@latest/dist/ReactDnDHTML5Backend.min.js).
You may point your Bower config to it.

@@ -22,0 +28,0 @@

import memoize from 'lodash/memoize';
export const isFirefox = memoize(() =>
/firefox/i.test(navigator.userAgent)
);
export const isSafari = memoize(() =>
Boolean(window.safari)
);
export const isFirefox = memoize(() => /firefox/i.test(navigator.userAgent));
export const isSafari = memoize(() => Boolean(window.safari));

@@ -12,8 +12,10 @@ import union from 'lodash/union';

const isNodeEntered = node => (
document.documentElement.contains(node) &&
(!node.contains || node.contains(enteringNode))
);
this.entered = union(
this.entered.filter(node =>
document.documentElement.contains(node) &&
(!node.contains || node.contains(enteringNode))
),
[enteringNode]
this.entered.filter(isNodeEntered),
[enteringNode],
);

@@ -29,5 +31,5 @@

this.entered.filter(node =>
document.documentElement.contains(node)
document.documentElement.contains(node),
),
leavingNode
leavingNode,
);

@@ -34,0 +36,0 @@

@@ -14,2 +14,3 @@ import defaults from 'lodash/defaults';

this.registry = manager.getRegistry();
this.context = manager.getContext();

@@ -38,21 +39,25 @@ this.sourcePreviewNodes = {};

get window() {
return (this.context && this.context.window) || window;
}
setup() {
if (typeof window === 'undefined') {
if (typeof this.window === 'undefined') {
return;
}
if (this.constructor.isSetUp) {
if (this.window.__isReactDndBackendSetUp) { // eslint-disable-line no-underscore-dangle
throw new Error('Cannot have two HTML5 backends at the same time.');
}
this.constructor.isSetUp = true;
this.addEventListeners(window);
this.window.__isReactDndBackendSetUp = true; // eslint-disable-line no-underscore-dangle
this.addEventListeners(this.window);
}
teardown() {
if (typeof window === 'undefined') {
if (typeof this.window === 'undefined') {
return;
}
this.constructor.isSetUp = false;
this.removeEventListeners(window);
this.window.__isReactDndBackendSetUp = false; // eslint-disable-line no-underscore-dangle
this.removeEventListeners(this.window);
this.clearCurrentDragSourceNode();

@@ -101,4 +106,4 @@ }

const handleDragStart = (e) => this.handleDragStart(e, sourceId);
const handleSelectStart = (e) => this.handleSelectStart(e, sourceId);
const handleDragStart = e => this.handleDragStart(e, sourceId);
const handleSelectStart = e => this.handleSelectStart(e, sourceId);

@@ -120,5 +125,5 @@ node.setAttribute('draggable', true);

connectDropTarget(targetId, node) {
const handleDragEnter = (e) => this.handleDragEnter(e, targetId);
const handleDragOver = (e) => this.handleDragOver(e, targetId);
const handleDrop = (e) => this.handleDrop(e, targetId);
const handleDragEnter = e => this.handleDragEnter(e, targetId);
const handleDragOver = e => this.handleDragOver(e, targetId);
const handleDrop = e => this.handleDrop(e, targetId);

@@ -141,3 +146,3 @@ node.addEventListener('dragenter', handleDragEnter);

return defaults(sourceNodeOptions || {}, {
dropEffect: 'move'
dropEffect: 'move',
});

@@ -162,3 +167,3 @@ }

anchorY: 0.5,
captureDraggingState: false
captureDraggingState: false,
});

@@ -174,3 +179,3 @@ }

return Object.keys(NativeTypes).some(
key => NativeTypes[key] === itemType
key => NativeTypes[key] === itemType,
);

@@ -190,3 +195,3 @@ }

if (isFirefox()) {
window.addEventListener('mousemove', this.endDragNativeItem, true);
this.window.addEventListener('mousemove', this.endDragNativeItem, true);
}

@@ -201,3 +206,3 @@ }

if (isFirefox()) {
window.removeEventListener('mousemove', this.endDragNativeItem, true);
this.window.removeEventListener('mousemove', this.endDragNativeItem, true);
}

@@ -231,3 +236,3 @@

// so the browser didn't dispatch the dragend event.
window.addEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true);
this.window.addEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true);
}

@@ -240,3 +245,3 @@

this.currentDragSourceNodeOffsetChanged = false;
window.removeEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true);
this.window.removeEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true);
return true;

@@ -260,3 +265,3 @@ }

getNodeClientOffset(node),
this.currentDragSourceNodeOffset
this.currentDragSourceNodeOffset,
);

@@ -286,3 +291,3 @@

getSourceClientOffset: this.getSourceClientOffset,
clientOffset
clientOffset,
});

@@ -307,3 +312,3 @@

clientOffset,
anchorPoint
anchorPoint,
);

@@ -356,4 +361,5 @@ dataTransfer.setDragImage(dragPreview, dragPreviewOffset.x, dragPreviewOffset.y);

// Looks like a Safari bug: dataTransfer.types is null, but there was no draggable.
// Just let it drag. It's a native type (URL or text) and will be picked up in dragenter handler.
return;
// Just let it drag. It's a native type (URL or text) and will be picked up in
// dragenter handler.
return; // eslint-disable-line no-useless-return
} else {

@@ -410,3 +416,3 @@ // If by this time no drag source reacted, tell browser not to drag.

this.actions.hover(dragEnterTargetIds, {
clientOffset: getEventClientOffset(e)
clientOffset: getEventClientOffset(e),
});

@@ -416,3 +422,3 @@ }

const canDrop = dragEnterTargetIds.some(
targetId => this.monitor.canDropOnTarget(targetId)
targetId => this.monitor.canDropOnTarget(targetId),
);

@@ -448,7 +454,7 @@

this.actions.hover(dragOverTargetIds, {
clientOffset: getEventClientOffset(e)
clientOffset: getEventClientOffset(e),
});
const canDrop = dragOverTargetIds.some(
targetId => this.monitor.canDropOnTarget(targetId)
targetId => this.monitor.canDropOnTarget(targetId),
);

@@ -508,3 +514,3 @@

this.actions.hover(dropTargetIds, {
clientOffset: getEventClientOffset(e)
clientOffset: getEventClientOffset(e),
});

@@ -511,0 +517,0 @@ this.actions.drop();

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

/* eslint
no-plusplus: off,
no-mixed-operators: off
*/
export default class MonotonicInterpolant {

@@ -2,0 +6,0 @@ constructor(xs, ys) {

@@ -6,3 +6,3 @@ import * as NativeTypes from './NativeTypes';

resultSoFar || dataTransfer.getData(typeToTry),
null
null,
);

@@ -19,4 +19,3 @@

matchesTypes: ['Files'],
getData: (dataTransfer) =>
Array.prototype.slice.call(dataTransfer.files)
getData: dataTransfer => Array.prototype.slice.call(dataTransfer.files),
},

@@ -27,3 +26,3 @@ [NativeTypes.URL]: {

getData: (dataTransfer, matchesTypes) =>
getDataFromDataTransfer(dataTransfer, matchesTypes, '').split('\n')
getDataFromDataTransfer(dataTransfer, matchesTypes, '').split('\n'),
},

@@ -34,4 +33,4 @@ [NativeTypes.TEXT]: {

getData: (dataTransfer, matchesTypes) =>
getDataFromDataTransfer(dataTransfer, matchesTypes, '')
}
getDataFromDataTransfer(dataTransfer, matchesTypes, ''),
},
};

@@ -43,3 +42,3 @@

matchesTypes,
getData
getData,
} = nativeTypesConfig[type];

@@ -52,6 +51,6 @@

console.warn( // eslint-disable-line no-console
`Browser doesn't allow reading "${exposeProperty}" until the drop event.`
`Browser doesn't allow reading "${exposeProperty}" until the drop event.`,
);
return null;
}
},
};

@@ -84,3 +83,3 @@ }

return Object.keys(nativeTypesConfig).filter(nativeItemType => {
return Object.keys(nativeTypesConfig).filter((nativeItemType) => {
const { matchesTypes } = nativeTypesConfig[nativeItemType];

@@ -87,0 +86,0 @@ return matchesTypes.some(t => dataTransferTypes.indexOf(t) > -1);

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

/* eslint
no-mixed-operators: off
*/
import { isSafari, isFirefox } from './BrowserDetector';

@@ -22,3 +25,3 @@ import MonotonicInterpolant from './MonotonicInterpolant';

x: e.clientX,
y: e.clientY
y: e.clientY,
};

@@ -39,3 +42,3 @@ }

x: clientOffset.x - dragPreviewNodeOffsetFromClient.x,
y: clientOffset.y - dragPreviewNodeOffsetFromClient.y
y: clientOffset.y - dragPreviewNodeOffsetFromClient.y,
};

@@ -66,3 +69,3 @@

// Dock to the right
offsetFromDragPreview.x + dragPreviewWidth - sourceWidth
offsetFromDragPreview.x + dragPreviewWidth - sourceWidth,
]);

@@ -75,3 +78,3 @@ const interpolantY = new MonotonicInterpolant([0, 0.5, 1], [

// Dock to the bottom
offsetFromDragPreview.y + dragPreviewHeight - sourceHeight
offsetFromDragPreview.y + dragPreviewHeight - sourceHeight,
]);

@@ -78,0 +81,0 @@ const x = interpolantX.interpolate(anchorX);

@@ -15,3 +15,3 @@ export default function shallowEqual(objA, objB) {

const hasOwn = Object.prototype.hasOwnProperty;
for (let i = 0; i < keysA.length; i++) {
for (let i = 0; i < keysA.length; i += 1) {
if (!hasOwn.call(objB, keysA[i]) ||

@@ -18,0 +18,0 @@ objA[keysA[i]] !== objB[keysA[i]]) {

Sorry, the diff of this file is not supported yet

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