react-dnd
Advanced tools
Comparing version 0.9.0 to 0.9.1
{ | ||
"name": "react-dnd", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"homepage": "https://github.com/gaearon/react-dnd", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -8,2 +8,3 @@ "use strict"; | ||
isFileDragDropEvent = require("../utils/isFileDragDropEvent"), | ||
isUrlDragDropEvent = require("../utils/isUrlDragDropEvent"), | ||
configureDataTransfer = require("../utils/configureDataTransfer"), | ||
@@ -45,4 +46,8 @@ shallowEqual = require("react/lib/shallowEqual"), | ||
function preventDefaultFileDropAction(e) { | ||
if (isFileDragDropEvent(e)) { | ||
function isNativeDragDropEvent(e) { | ||
return isFileDragDropEvent(e) || isUrlDragDropEvent(e); | ||
} | ||
function preventDefaultNativeDropAction(e) { | ||
if (isNativeDragDropEvent(e)) { | ||
e.preventDefault(); | ||
@@ -57,4 +62,8 @@ } | ||
var isFirstEnter = _monitor.enter(e.target); | ||
if (isFirstEnter && isFileDragDropEvent(e)) { | ||
DragDropActionCreators.startDragging(NativeDragItemTypes.FILE, null); | ||
if (isFirstEnter) { | ||
if (isFileDragDropEvent(e)) { | ||
DragDropActionCreators.startDragging(NativeDragItemTypes.FILE, null); | ||
} else if (isUrlDragDropEvent(e)) { | ||
DragDropActionCreators.startDragging(NativeDragItemTypes.URL, null); | ||
} | ||
} | ||
@@ -64,3 +73,3 @@ } | ||
function handleTopDragOver(e) { | ||
preventDefaultFileDropAction(e); | ||
preventDefaultNativeDropAction(e); | ||
@@ -83,6 +92,6 @@ var offsetFromClient = HTML5.getOffsetFromClient(_currentComponent, e); | ||
function handleTopDragLeave(e) { | ||
preventDefaultFileDropAction(e); | ||
preventDefaultNativeDropAction(e); | ||
var isLastLeave = _monitor.leave(e.target); | ||
if (isLastLeave && isFileDragDropEvent(e)) { | ||
if (isLastLeave && isNativeDragDropEvent(e)) { | ||
DragDropActionCreators.endDragging(); | ||
@@ -93,7 +102,7 @@ } | ||
function handleTopDrop(e) { | ||
preventDefaultFileDropAction(e); | ||
preventDefaultNativeDropAction(e); | ||
_monitor.reset(); | ||
if (isFileDragDropEvent(e)) { | ||
if (isNativeDragDropEvent(e)) { | ||
DragDropActionCreators.endDragging(); | ||
@@ -100,0 +109,0 @@ } |
@@ -6,5 +6,6 @@ "use strict"; | ||
var NativeDragItemTypes = { | ||
FILE: "__NATIVE_FILE__" | ||
FILE: "__NATIVE_FILE__", | ||
URL: "__NATIVE_URL__" | ||
}; | ||
module.exports = NativeDragItemTypes; |
@@ -11,2 +11,4 @@ "use strict"; | ||
isFileDragDropEvent = require("./isFileDragDropEvent"), | ||
isUrlDragDropEvent = require("../utils/isUrlDragDropEvent"), | ||
extractNativeItem = require("../utils/extractNativeItem"), | ||
invariant = require("react/lib/invariant"), | ||
@@ -20,3 +22,4 @@ assign = require("react/lib/Object.assign"), | ||
function checkValidType(component, type) { | ||
invariant(type && typeof type === "string", "Expected item type to be a non-empty string. See %s", component.constructor.displayName); | ||
/*jshint -W122 */ | ||
invariant(type && (typeof type === "string" || typeof type === "symbol"), "Expected item type to be a non-empty string or a symbol. See %s", component.constructor.displayName); | ||
} | ||
@@ -275,4 +278,4 @@ | ||
if (isFileDragDropEvent(e)) { | ||
// Use Copy drop effect for dragging files. | ||
if (isFileDragDropEvent(e) || isUrlDragDropEvent(e)) { | ||
// Use Copy drop effect for dragging files or urls. | ||
// Because browser gives no drag preview, "+" icon is useful. | ||
@@ -339,8 +342,7 @@ effectsAllowed = [DropEffects.COPY]; | ||
if (isFileDragDropEvent(e)) { | ||
// We don't know file list until the `drop` event, | ||
// so we couldn't put `item` into the store. | ||
item = { | ||
files: Array.prototype.slice.call(e.dataTransfer.files) | ||
}; | ||
// We don't know the exact list until the `drop` event, | ||
// so we couldn't put `item` into the store. | ||
if (!item) { | ||
item = extractNativeItem(e); | ||
} | ||
@@ -347,0 +349,0 @@ |
@@ -14,2 +14,10 @@ "use strict"; | ||
}; | ||
}, | ||
getInitialOffsetFromClient: function getInitialOffsetFromClient() { | ||
return DragOffsetStore.getInitialOffsetFromClient(); | ||
}, | ||
getCurrentOffsetFromClient: function getCurrentOffsetFromClient() { | ||
return DragOffsetStore.getCurrentOffsetFromClient(); | ||
} | ||
@@ -16,0 +24,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.ReactDND=e():t.ReactDND=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(30),i=r.HTML5,o=n(37);t.exports={DragDropMixin:o(i),ImagePreloaderMixin:n(32),DragLayerMixin:n(31),HorizontalDragAnchors:n(19),VerticalDragAnchors:n(21),NativeDragItemTypes:n(20),DropEffects:n(8)}},function(t){function e(t){return"number"==typeof t&&t>-1&&t%1==0&&n>=t}var n=Math.pow(2,53)-1;t.exports=e},function(t){function e(t){var e=typeof t;return"function"==e||t&&"object"==e||!1}t.exports=e},function(t,e,n){function r(t){return null==t?!1:f.call(t)==s?g.test(u.call(t)):o(t)&&a.test(t)||!1}var i=n(70),o=n(4),s="[object Function]",a=/^\[object .+?Constructor\]$/,c=Object.prototype,u=Function.prototype.toString,f=c.toString,g=RegExp("^"+i(f).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},function(t){function e(t){return t&&"object"==typeof t||!1}t.exports=e},function(t,e,n){var r=n(1),i=n(3),o=n(4),s="[object Array]",a=Object.prototype,c=a.toString,u=i(u=Array.isArray)&&u,f=u||function(t){return o(t)&&r(t.length)&&c.call(t)==s||!1};t.exports=f},function(t,e,n){"use strict";var r=n(17),i=function(t){var e,n={};r(t instanceof Object&&!Array.isArray(t));for(e in t)t.hasOwnProperty(e)&&(n[e]=e);return n};t.exports=i},function(t,e,n){"use strict";var r=n(6),i=r({DRAG_START:null,DRAG_END:null,DRAG:null,DROP:null});t.exports=i},function(t){"use strict";var e={COPY:"copy",MOVE:"move",LINK:"link"};t.exports=e},function(t,e,n){"use strict";var r=n(45).Dispatcher,i=n(16),o=i(new r,{handleAction:function(t){this.dispatch({action:t})}});t.exports=o},function(t,e,n){"use strict";var r=n(9),i=n(7),o=n(23),s=null,a=null,c=null,u=o({getInitialOffsetFromContainer:function(){return s},getInitialOffsetFromClient:function(){return a},getCurrentOffsetFromClient:function(){return c}});u.dispatchToken=r.register(function(t){var e=t.action;switch(e.type){case i.DRAG_START:s=e.offsetFromContainer,a=e.offsetFromClient,c=e.offsetFromClient,u.emitChange();break;case i.DRAG:c=e.offsetFromClient,u.emitChange();break;case i.DRAG_END:c=null,c=null,u.emitChange()}}),t.exports=u},function(t,e,n){"use strict";var r=n(9),i=n(7),o=n(10),s=n(23),a=null,c=null,u=null,f=null,g=s({isDragging:function(){return!!a},getEffectsAllowed:function(){return u},getDropEffect:function(){return f},getDraggedItem:function(){return a},getDraggedItemType:function(){return c}});g.dispatchToken=r.register(function(t){r.waitFor([o.dispatchToken]);var e=t.action;switch(e.type){case i.DRAG_START:f=null,a=e.item,c=e.itemType,u=e.effectsAllowed,g.emitChange();break;case i.DROP:f=e.dropEffect,g.emitChange();break;case i.DRAG_END:a=null,c=null,u=null,f=null,g.emitChange()}}),t.exports=g},function(t){"use strict";function e(){return!!window.safari}t.exports=e},function(t){function e(t,e){return t=+t,e=null==e?n:e,t>-1&&t%1==0&&e>t}var n=Math.pow(2,53)-1;t.exports=e},function(t,e,n){function r(t){var e=o(t)?t.length:void 0;return i(e)&&c.call(t)==s||!1}var i=n(1),o=n(4),s="[object Arguments]",a=Object.prototype,c=a.toString;t.exports=r},function(t){function e(){}t.exports=e},function(t){function e(t){if(null==t)throw new TypeError("Object.assign target cannot be null or undefined");for(var e=Object(t),n=Object.prototype.hasOwnProperty,r=1;r<arguments.length;r++){var i=arguments[r];if(null!=i){var o=Object(i);for(var s in o)n.call(o,s)&&(e[s]=o[s])}}return e}t.exports=e},function(t){"use strict";var e=function(t,e,n,r,i,o,s,a){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,s,a],f=0;c=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return u[f++]}))}throw c.framesToPop=1,c}};t.exports=e},function(t,e,n){"use strict";var r=n(9),i=n(7),o={startDragging:function(t,e,n,o,s){r.handleAction({type:i.DRAG_START,itemType:t,item:e,effectsAllowed:n,offsetFromClient:o,offsetFromContainer:s})},drag:function(t){r.handleAction({type:i.DRAG,offsetFromClient:t})},recordDrop:function(t){r.handleAction({type:i.DROP,dropEffect:t})},endDragging:function(){r.handleAction({type:i.DRAG_END})}};t.exports=o},function(t,e,n){"use strict";var r=n(6),i=r({LEFT:null,CENTER:null,RIGHT:null});t.exports=i},function(t,e,n){"use strict";var r=(n(6),{FILE:"__NATIVE_FILE__"});t.exports=r},function(t,e,n){"use strict";var r=n(6),i=r({TOP:null,CENTER:null,BOTTOM:null});t.exports=i},function(t,e,n){"use strict";var r=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=n(48),s=n(49),a=function(){function t(){i(this,t),this._entered=[]}return r(t,null,{enter:{value:function(t){return this._entered=o(this._entered.filter(function(e){return document.body.contains(e)&&(!e.contains||e.contains(t))}),[t]),1===this._entered.length},writable:!0,configurable:!0},leave:{value:function(t){return this._entered=s(this._entered.filter(function(t){return document.body.contains(t)}),t),0===this._entered.length},writable:!0,configurable:!0},reset:{value:function(){this._entered=[]},writable:!0,configurable:!0}}),t}();t.exports=a},function(t,e,n){"use strict";function r(t){var e=o({emitChange:function(){this.emit(s)},addChangeListener:function(t){this.on(s,t)},removeChangeListener:function(t){this.removeListener(s,t)}},t,i.prototype);return e.setMaxListeners(0),e}var i=n(74).EventEmitter,o=n(16),s="change";t.exports=r},function(t){"use strict";function e(t){if(!t.dataTransfer)return!1;var e=Array.prototype.slice.call(t.dataTransfer.types);return-1!==e.indexOf("Files")}t.exports=e},function(t,e,n){function r(t,e,n){if(e!==e)return i(t,n);for(var r=(n||0)-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}var i=n(63);t.exports=r},function(t,e,n){function r(t,e){var n=t.data,r="string"==typeof e||i(e)?n.set.has(e):n.hash[e];return r?0:-1}var i=n(2);t.exports=r},function(t,e,n){(function(e){var r=n(50),i=n(71),o=n(3),s=o(s=e.Set)&&s,a=o(a=Object.create)&&a,c=a&&s?function(t){return new r(t)}:i(null);t.exports=c}).call(e,function(){return this}())},function(t,e,n){(function(e){var r=n(3),i=/\bthis\b/,o=Object.prototype,s=(s=e.window)&&s.document,a=o.propertyIsEnumerable,c={};!function(){c.funcDecomp=!r(e.WinRTError)&&i.test(function(){return this}),c.funcNames="string"==typeof Function.name;try{c.dom=11===s.createDocumentFragment().nodeType}catch(t){c.dom=!1}try{c.nonEnumArgs=!a.call(arguments,1)}catch(t){c.nonEnumArgs=!0}}(0,0),t.exports=c}).call(e,function(){return this}())},function(t,e,n){"use strict";function r(t){var e=t.getBoundingClientRect();return{top:e.top,left:e.left,width:e.width,height:e.height}}function i(){if(!p){var t=r(g);p=!w(h,t)}return p}function o(){if(l&&!document.body.contains(g)){var t=m.getDraggedItemType();l.handleDragEnd(t,null)}}function s(t){x(t)&&t.preventDefault()}function a(t){t.preventDefault();var e=T.enter(t.target);e&&x(t)&&v.startDragging(D.FILE,null)}function c(t){s(t);var e=b.getOffsetFromClient(l,t);v.drag(e),d&&(t.dataTransfer.dropEffect=d,d=null),g&&E()&&i()&&t.preventDefault()}function u(t){s(t);var e=T.leave(t.target);e&&x(t)&&v.endDragging()}function f(t){s(t),T.reset(),x(t)&&v.endDragging(),o()}var g,l,h,p,d,v=n(18),m=n(11),D=n(20),y=n(22),x=n(24),_=n(36),w=n(73),E=n(43),T=new y,b={setup:function(){"undefined"!=typeof window&&(window.addEventListener("dragenter",a),window.addEventListener("dragover",c),window.addEventListener("dragleave",u),window.addEventListener("drop",f))},teardown:function(){"undefined"!=typeof window&&(window.removeEventListener("dragenter",a),window.removeEventListener("dragover",c),window.removeEventListener("dragleave",u),window.removeEventListener("drop",f))},beginDrag:function(t,e,n,i,s,a,c){var u=e.nativeEvent,f=u.dataTransfer,d=u.target;_(f,n,i,s,a,c),l=t,g=d,h=r(d),p=!1,window.addEventListener("mousemove",o,!0)},endDrag:function(){g=null,l=null,h=null,p=!1,window.removeEventListener("mousemove",o,!0)},dragOver:function(t,e,n){d||(d=n)},getDragSourceProps:function(t,e){return{draggable:!0,onDragStart:t.handleDragStart.bind(t,e),onDragEnd:t.handleDragEnd.bind(t,e)}},getDropTargetProps:function(t,e){return{onDragEnter:t.handleDragEnter.bind(t,e),onDragOver:t.handleDragOver.bind(t,e),onDragLeave:t.handleDragLeave.bind(t,e),onDrop:t.handleDrop.bind(t,e)}},getOffsetFromClient:function(t,e){return{x:e.clientX,y:e.clientY}}};t.exports=b},function(t,e,n){"use strict";t.exports={HTML5:n(29)}},function(t,e,n){"use strict";var r=n(11),i=n(10),o={getInitialState:function(){return this.getStateForDragLayerMixin()},getDragLayerState:function(){var t=this.state,e=t.isDragging,n=t.draggedItemType,r=t.draggedItem,i=t.initialOffset,o=t.currentOffset;return{isDragging:e,draggedItemType:n,draggedItem:r,initialOffset:i,currentOffset:o}},getStateForDragLayerMixin:function(){var t=i.getInitialOffsetFromClient(),e=i.getCurrentOffsetFromClient(),n=i.getInitialOffsetFromContainer(),o=!1,s=null,a=null,c=null,u=null;return t&&e&&(o=!0,s=r.getDraggedItemType(),a=r.getDraggedItem(),c={x:t.x-n.x,y:t.y-n.y},u={x:e.x-n.x,y:e.y-n.y}),{isDragging:o,draggedItemType:s,draggedItem:a,initialOffset:c,currentOffset:u}},handleStoreChangeInDragLayerMixin:function(){this.isMounted()&&this.setState(this.getStateForDragLayerMixin())},componentDidMount:function(){i.addChangeListener(this.handleStoreChangeInDragLayerMixin),r.addChangeListener(this.handleStoreChangeInDragLayerMixin)},componentWillUnmount:function(){i.removeChangeListener(this.handleStoreChangeInDragLayerMixin),r.removeChangeListener(this.handleStoreChangeInDragLayerMixin)}};t.exports=o},function(t,e,n){"use strict";var r=n(41),i="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",o={componentDidMount:function(){this._cachedImages={},this._readyImages={},this.preloadImages()},componentDidUpdate:function(){this.preloadImages()},componentWillUnmount:function(){for(var t in this._cachedImages)this._cachedImages[t].src=i;this._cachedImages={}},hasPreloadedImage:function(t){return!!this._readyImages[t]},getPreloadedImage:function(t){return this.hasPreloadedImage(t)?this._cachedImages[t]:void 0},preloadImages:function(){var t=this.getImageUrlsToPreload();t.forEach(this.preloadImage)},preloadImage:function(t){var e=this;if(t&&!this._cachedImages[t]){var n=new Image;n.onload=function(){e.isMounted()&&(e._readyImages[t]=!0)},n.onerror=function(){e.isMounted()&&delete e._cachedImages[t]},n.src=t,this._cachedImages[t]=n}},getDragImageScale:r};t.exports=o},function(t,e,n){"use strict";var r=n(17),i=n(15),o={canDrag:function(){return!0},beginDrag:function(){r(!1,"Drag source must contain a method called beginDrag. See https://github.com/gaearon/react-dnd#drag-source-api")},endDrag:i};t.exports=o},function(t,e,n){"use strict";var r=n(15),i={canDrop:function(){return!0},getDropEffect:function(t,e){return e[0]},enter:r,over:r,leave:r,acceptDrop:r};t.exports=i},function(t,e,n){"use strict";var r=n(10),i={getCurrentOffsetDelta:function(){var t=r.getInitialOffsetFromClient(),e=r.getCurrentOffsetFromClient();return{x:e.x-t.x,y:e.y-t.y}}};t.exports=i},function(t,e,n){"use strict";function r(t,e,n,r,a,c){try{t.setData("application/json",{})}catch(u){}if(i(n)&&t.setDragImage){var f=o(e,n,r,a);t.setDragImage(n,f.x,f.y)}t.effectAllowed=s(c)}var i=n(44),o=n(40),s=n(39);t.exports=r},function(t,e,n){"use strict";function r(t,e){d(e&&"string"==typeof e,"Expected item type to be a non-empty string. See %s",t.constructor.displayName)}function i(t,e){var n=t.constructor.displayName;d(t._dragSources[e],'There is no drag source for "%s" registered in %s. Have you forgotten to register it? See configureDragDrop in %s',e,n,n)}function o(t,e){var n=t.constructor.displayName;d(t._dropTargets[e],'There is no drop target for "%s" registered in %s. Have you forgotten to register it? See configureDragDrop in %s',e,n,n)}function s(t){function e(e){0===s&&t.setup(e),s++}function n(e){s--,0===s&&t.teardown(e)}var s=0;return{getInitialState:function(){var t={ownDraggedItemType:null,currentDropEffect:null};return v(t,this.getStateForDragDropMixin())},getActiveDropTargetType:function(){var t=this.state,e=t.draggedItemType,n=t.draggedItem,r=t.ownDraggedItemType,i=this._dropTargets[e];if(!i)return null;if(e===r)return null;var o=i.canDrop;return o(this,n)?e:null},isAnyDropTargetActive:function(t){return t.indexOf(this.getActiveDropTargetType())>-1},getStateForDragDropMixin:function(){return{draggedItem:c.getDraggedItem(),draggedItemType:c.getDraggedItemType()}},getDragState:function(t){return r(this,t),i(this,t),{isDragging:this.state.ownDraggedItemType===t}},getDropState:function(t){r(this,t),o(this,t);var e=this.getActiveDropTargetType()===t,n=!!this.state.currentDropEffect;return{isDragging:e,isHovering:e&&n}},componentWillMount:function(){this._monitor=new f,this._dragSources={},this._dropTargets={},d(this.constructor.configureDragDrop,"%s must implement static configureDragDrop(register, context) to use DragDropMixin",this.constructor.displayName),this.constructor.configureDragDrop(this.registerDragDropItemTypeHandlers,u)},componentDidMount:function(){e(this),c.addChangeListener(this.handleStoreChangeInDragDropMixin)},componentWillUnmount:function(){n(this),c.removeChangeListener(this.handleStoreChangeInDragDropMixin)},registerDragDropItemTypeHandlers:function(t,e){r(this,t);var n=e.dragSource,i=e.dropTarget;n&&(d(!this._dragSources[t],"Drag source for %s specified twice. See configureDragDrop in %s",t,this.constructor.displayName),this._dragSources[t]=m(n,l)),i&&(d(!this._dropTargets[t],"Drop target for %s specified twice. See configureDragDrop in %s",t,this.constructor.displayName),this._dropTargets[t]=m(i,h))},handleStoreChangeInDragDropMixin:function(){this.isMounted()&&this.setState(this.getStateForDragDropMixin())},dragSourceFor:function(e){return r(this,e),i(this,e),t.getDragSourceProps(this,e)},handleDragStart:function(e,n){var r=this,i=this._dragSources[e],o=i.canDrag,s=i.beginDrag;if(!o(this))return void n.preventDefault();var u,f=s(this),l=f.item,h=f.dragPreview,p=f.dragAnchors,v=f.effectsAllowed,m=this.getDOMNode(),x=m.getBoundingClientRect(),_=t.getOffsetFromClient(this,n);u={x:_.x-x.left,y:_.y-x.top},v||(v=[g.MOVE]),d(D(v)&&v.length>0,"Expected effectsAllowed to be non-empty array"),d(y(l),'Expected return value of beginDrag to contain "item" object'),t.beginDrag(this,n,m,h,p,u,v),a.startDragging(e,l,v,_,u),setTimeout(function(){r.isMounted()&&c.getDraggedItem()===l&&r.setState({ownDraggedItemType:e})})},handleDragEnd:function(e){t.endDrag(this);var n=this._dragSources[e].endDrag,r=c.getDropEffect();a.endDragging(),this.isMounted()&&this.setState({ownDraggedItemType:null}),n(this,r)},dropTargetFor:function(){for(var e=this,n=arguments.length,i=Array(n),s=0;n>s;s++)i[s]=arguments[s];return i.forEach(function(t){r(e,t),o(e,t)}),t.getDropTargetProps(this,i)},handleDragEnter:function(t,e){if(this.isAnyDropTargetActive(t)&&this._monitor.enter(e.target)){e.preventDefault();var n=this._dropTargets[this.state.draggedItemType],r=n.enter,i=n.getDropEffect,o=c.getEffectsAllowed();p(e)&&(o=[g.COPY]);var s=i(this,o);s&&d(o.indexOf(s)>-1,"Effect %s supplied by drop target is not one of the effects allowed by drag source: %s",s,o.join(", ")),this.setState({currentDropEffect:s}),r(this,this.state.draggedItem)}},handleDragOver:function(e,n){if(this.isAnyDropTargetActive(e)){n.preventDefault();{var r=this._dropTargets[this.state.draggedItemType],i=r.over;r.getDropEffect}i(this,this.state.draggedItem),t.dragOver(this,n,this.state.currentDropEffect||"move")}},handleDragLeave:function(t,e){if(this.isAnyDropTargetActive(t)&&this._monitor.leave(e.target)){this.setState({currentDropEffect:null});var n=this._dropTargets[this.state.draggedItemType].leave;n(this,this.state.draggedItem)}},handleDrop:function(t,e){if(this.isAnyDropTargetActive(t)){e.preventDefault();var n=this.state.draggedItem,r=this._dropTargets[this.state.draggedItemType].acceptDrop,i=this.state.currentDropEffect,o=!!c.getDropEffect();p(e)&&(n={files:Array.prototype.slice.call(e.dataTransfer.files)}),this._monitor.reset(),o||a.recordDrop(i),this.setState({currentDropEffect:null}),r(this,n,o,c.getDropEffect())}}}}{var a=n(18),c=n(11),u=n(35),f=n(22),g=n(8),l=n(33),h=n(34),p=n(24),d=n(17),v=n(16),m=n(67),D=n(5),y=n(2);n(15)}t.exports=s},function(t){"use strict";function e(t,e){return-1!==t.indexOf(e,t.length-e.length)}t.exports=e},function(t,e,n){"use strict";function r(t){var e=t.indexOf(i.COPY)>-1,n=t.indexOf(i.MOVE)>-1,r=t.indexOf(i.LINK)>-1;return e&&n&&r?"all":e&&n?"copyMove":r&&n?"linkMove":e&&r?"copyLink":e?"copy":n?"move":r?"link":"none"}var i=n(8);t.exports=r},function(t,e,n){"use strict";function r(t,e,n,r){n=n||{};var a=t.offsetWidth,c=t.offsetHeight,u=e instanceof Image,f=u?e.width:a,g=u?e.height:c,l=n.horizontal||i.CENTER,h=n.vertical||o.CENTER,p=r.x,d=r.y;switch(s()&&(g/=window.devicePixelRatio,f/=window.devicePixelRatio),l){case i.LEFT:break;case i.CENTER:p*=f/a;break;case i.RIGHT:p=f-f*(1-p/a)}switch(h){case o.TOP:break;case o.CENTER:d*=g/c;break;case o.BOTTOM:d=g-g*(1-d/c)}return s()&&(d+=(window.devicePixelRatio-1)*g),{x:p,y:d}}var i=n(19),o=n(21),s=n(12);t.exports=r},function(t,e,n){"use strict";function r(){return i()||o()?window.devicePixelRatio:1}var i=n(42),o=n(12);t.exports=r},function(t){"use strict";function e(){return/firefox/i.test(navigator.userAgent)}t.exports=e},function(t){"use strict";function e(){return"WebkitAppearance"in document.documentElement.style}t.exports=e},function(t,e,n){"use strict";function r(t){return t?i()&&t instanceof Image&&o(t.src,".gif")?!1:!0:!1}var i=n(12),o=n(38);t.exports=r},function(t,e,n){t.exports.Dispatcher=n(46)},function(t,e,n){"use strict";function r(){this.$Dispatcher_callbacks={},this.$Dispatcher_isPending={},this.$Dispatcher_isHandled={},this.$Dispatcher_isDispatching=!1,this.$Dispatcher_pendingPayload=null}var i=n(47),o=1,s="ID_";r.prototype.register=function(t){var e=s+o++;return this.$Dispatcher_callbacks[e]=t,e},r.prototype.unregister=function(t){i(this.$Dispatcher_callbacks[t],"Dispatcher.unregister(...): `%s` does not map to a registered callback.",t),delete this.$Dispatcher_callbacks[t]},r.prototype.waitFor=function(t){i(this.$Dispatcher_isDispatching,"Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];this.$Dispatcher_isPending[n]?i(this.$Dispatcher_isHandled[n],"Dispatcher.waitFor(...): Circular dependency detected while waiting for `%s`.",n):(i(this.$Dispatcher_callbacks[n],"Dispatcher.waitFor(...): `%s` does not map to a registered callback.",n),this.$Dispatcher_invokeCallback(n))}},r.prototype.dispatch=function(t){i(!this.$Dispatcher_isDispatching,"Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch."),this.$Dispatcher_startDispatching(t);try{for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]||this.$Dispatcher_invokeCallback(e)}finally{this.$Dispatcher_stopDispatching()}},r.prototype.isDispatching=function(){return this.$Dispatcher_isDispatching},r.prototype.$Dispatcher_invokeCallback=function(t){this.$Dispatcher_isPending[t]=!0,this.$Dispatcher_callbacks[t](this.$Dispatcher_pendingPayload),this.$Dispatcher_isHandled[t]=!0},r.prototype.$Dispatcher_startDispatching=function(t){for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]=!1,this.$Dispatcher_isHandled[e]=!1;this.$Dispatcher_pendingPayload=t,this.$Dispatcher_isDispatching=!0},r.prototype.$Dispatcher_stopDispatching=function(){this.$Dispatcher_pendingPayload=null,this.$Dispatcher_isDispatching=!1},t.exports=r},function(t){"use strict";var e=function(t,e,n,r,i,o,s,a){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,s,a],f=0;c=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return u[f++]}))}throw c.framesToPop=1,c}};t.exports=e},function(t,e,n){function r(){return o(i(arguments,!1,!0))}var i=n(56),o=n(59);t.exports=r},function(t,e,n){function r(t){return i(t,o(arguments,1))}var i=n(55),o=n(57);t.exports=r},function(t,e,n){(function(e){function r(t){var e=t?t.length:0;for(this.data={hash:a(null),set:new s};e--;)this.push(t[e])}var i=n(61),o=n(3),s=o(s=e.Set)&&s,a=o(a=Object.create)&&a;r.prototype.push=i,t.exports=r}).call(e,function(){return this}())},function(t){function e(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}t.exports=e},function(t){function e(t,e){return"undefined"==typeof t?e:t}t.exports=e},function(t,e,n){function r(t,e,n){var r=o(e);if(!n)return i(e,t,r);for(var s=-1,a=r.length;++s<a;){var c=r[s],u=t[c],f=n(u,e[c],c,t,e);(f===f?f===u:u!==u)&&("undefined"!=typeof u||c in t)||(t[c]=f)}return t}var i=n(54),o=n(68);t.exports=r},function(t){function e(t,e,n){n||(n=e,e={});for(var r=-1,i=n.length;++r<i;){var o=n[r];e[o]=t[o]}return e}t.exports=e},function(t,e,n){function r(t,e){var n=t?t.length:0,r=[];if(!n)return r;var a=-1,c=i,u=!0,f=u&&e.length>=200?s(e):null,g=e.length;f&&(c=o,u=!1,e=f);t:for(;++a<n;){var l=t[a];if(u&&l===l){for(var h=g;h--;)if(e[h]===l)continue t;r.push(l)}else c(e,l)<0&&r.push(l)}return r}var i=n(25),o=n(26),s=n(27);t.exports=r},function(t,e,n){function r(t,e,n,c){for(var u=(c||0)-1,f=t.length,g=-1,l=[];++u<f;){var h=t[u];if(a(h)&&s(h.length)&&(o(h)||i(h))){e&&(h=r(h,e,n));var p=-1,d=h.length;for(l.length+=d;++p<d;)l[++g]=h[p]}else n||(l[++g]=h)}return l}var i=n(14),o=n(5),s=n(1),a=n(4);t.exports=r},function(t){function e(t,e,n){var r=-1,i=t.length;e=null==e?0:+e||0,0>e&&(e=-e>i?0:i+e),n="undefined"==typeof n||n>i?i:+n||0,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}t.exports=e},function(t){function e(t){return"string"==typeof t?t:null==t?"":t+""}t.exports=e},function(t,e,n){function r(t,e){var n=-1,r=i,a=t.length,c=!0,u=c&&a>=200,f=u?s():null,g=[];f?(r=o,c=!1):(u=!1,f=e?[]:g);t:for(;++n<a;){var l=t[n],h=e?e(l,n,t):l;if(c&&l===l){for(var p=f.length;p--;)if(f[p]===h)continue t;e&&f.push(h),g.push(l)}else r(f,h)<0&&((e||u)&&f.push(h),g.push(l))}return g}var i=n(25),o=n(26),s=n(27);t.exports=r},function(t,e,n){function r(t,e,n){if("function"!=typeof t)return i;if("undefined"==typeof e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)};case 5:return function(n,r,i,o,s){return t.call(e,n,r,i,o,s)}}return function(){return t.apply(e,arguments)}}var i=n(72);t.exports=r},function(t,e,n){function r(t){var e=this.data;"string"==typeof t||i(t)?e.set.add(t):e.hash[t]=!0}var i=n(2);t.exports=r},function(t,e,n){function r(t){return function(){var e=arguments.length,n=arguments[0];if(2>e||null==n)return n;if(e>3&&o(arguments[1],arguments[2],arguments[3])&&(e=2),e>3&&"function"==typeof arguments[e-2])var r=i(arguments[--e-1],arguments[e--],5);else e>2&&"function"==typeof arguments[e-1]&&(r=arguments[--e]);for(var s=0;++s<e;){var a=arguments[s];a&&t(n,a,r)}return n}}var i=n(60),o=n(64);t.exports=r},function(t){function e(t,e,n){for(var r=t.length,i=n?e||r:(e||0)-1;n?i--:++i<r;){var o=t[i];if(o!==o)return i}return-1}t.exports=e},function(t,e,n){function r(t,e,n){if(!s(n))return!1;var r=typeof e;if("number"==r)var a=n.length,c=o(a)&&i(e,a);else c="string"==r&&e in n;if(c){var u=n[e];return t===t?t===u:u!==u}return!1}var i=n(13),o=n(1),s=n(2);t.exports=r},function(t,e,n){function r(t){for(var e=c(t),n=e.length,r=n&&t.length,f=r&&a(r)&&(o(t)||u.nonEnumArgs&&i(t)),l=-1,h=[];++l<n;){var p=e[l];(f&&s(p,r)||g.call(t,p))&&h.push(p)}return h}var i=n(14),o=n(5),s=n(13),a=n(1),c=n(69),u=n(28),f=Object.prototype,g=f.hasOwnProperty;t.exports=r},function(t,e,n){var r=n(53),i=n(62),o=i(r);t.exports=o},function(t,e,n){function r(t){if(null==t)return t;var e=i(arguments);return e.push(s),o.apply(void 0,e)}var i=n(51),o=n(66),s=n(52);t.exports=r},function(t,e,n){var r=n(1),i=n(3),o=n(2),s=n(65),a=i(a=Object.keys)&&a,c=a?function(t){if(t)var e=t.constructor,n=t.length;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&n&&r(n)?s(t):o(t)?a(t):[]}:s;t.exports=c},function(t,e,n){function r(t){if(null==t)return[];c(t)||(t=Object(t));var e=t.length;e=e&&a(e)&&(o(t)||u.nonEnumArgs&&i(t))&&e||0;for(var n=t.constructor,r=-1,f="function"==typeof n&&n.prototype===t,l=Array(e),h=e>0;++r<e;)l[r]=r+"";for(var p in t)h&&s(p,e)||"constructor"==p&&(f||!g.call(t,p))||l.push(p);return l}var i=n(14),o=n(5),s=n(13),a=n(1),c=n(2),u=n(28),f=Object.prototype,g=f.hasOwnProperty;t.exports=r},function(t,e,n){function r(t){return t=i(t),t&&s.test(t)?t.replace(o,"\\$&"):t}var i=n(58),o=/[.*+?^${}()|[\]\/\\]/g,s=RegExp(o.source);t.exports=r},function(t){function e(t){return function(){return t}}t.exports=e},function(t){function e(t){return t}t.exports=e},function(t){"use strict";function e(t,e){if(t===e)return!0;var n;for(n in t)if(t.hasOwnProperty(n)&&(!e.hasOwnProperty(n)||t[n]!==e[n]))return!1;for(n in e)if(e.hasOwnProperty(n)&&!t.hasOwnProperty(n))return!1;return!0}t.exports=e},function(t){function e(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function r(t){return"number"==typeof t}function i(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=e,e.EventEmitter=e,e.prototype._events=void 0,e.prototype._maxListeners=void 0,e.defaultMaxListeners=10,e.prototype.setMaxListeners=function(t){if(!r(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},e.prototype.emit=function(t){var e,r,s,a,c,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[t],o(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(s=arguments.length,a=new Array(s-1),c=1;s>c;c++)a[c-1]=arguments[c];r.apply(this,a)}else if(i(r)){for(s=arguments.length,a=new Array(s-1),c=1;s>c;c++)a[c-1]=arguments[c];for(u=r.slice(),s=u.length,c=0;s>c;c++)u[c].apply(this,a)}return!0},e.prototype.addListener=function(t,r){var s;if(!n(r))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(r.listener)?r.listener:r),this._events[t]?i(this._events[t])?this._events[t].push(r):this._events[t]=[this._events[t],r]:this._events[t]=r,i(this._events[t])&&!this._events[t].warned){var s;s=o(this._maxListeners)?e.defaultMaxListeners:this._maxListeners,s&&s>0&&this._events[t].length>s&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())}return this},e.prototype.on=e.prototype.addListener,e.prototype.once=function(t,e){function r(){this.removeListener(t,r),i||(i=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var i=!1;return r.listener=e,this.on(t,r),this},e.prototype.removeListener=function(t,e){var r,o,s,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],s=r.length,o=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(r)){for(a=s;a-->0;)if(r[a]===e||r[a].listener&&r[a].listener===e){o=a;break}if(0>o)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},e.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],n(r))this.removeListener(t,r);else for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},e.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},e.listenerCount=function(t,e){var r;return r=t._events&&t._events[e]?n(t._events[e])?1:t._events[e].length:0}}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.ReactDND=e():t.ReactDND=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(31),i=r.HTML5,o=n(38);t.exports={DragDropMixin:o(i),ImagePreloaderMixin:n(33),DragLayerMixin:n(32),HorizontalDragAnchors:n(21),VerticalDragAnchors:n(23),NativeDragItemTypes:n(22),DropEffects:n(8)}},function(t){function e(t){return"number"==typeof t&&t>-1&&t%1==0&&n>=t}var n=Math.pow(2,53)-1;t.exports=e},function(t){function e(t){var e=typeof t;return"function"==e||t&&"object"==e||!1}t.exports=e},function(t,e,n){function r(t){return null==t?!1:f.call(t)==s?g.test(u.call(t)):o(t)&&a.test(t)||!1}var i=n(72),o=n(4),s="[object Function]",a=/^\[object .+?Constructor\]$/,c=Object.prototype,u=Function.prototype.toString,f=c.toString,g=RegExp("^"+i(f).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},function(t){function e(t){return t&&"object"==typeof t||!1}t.exports=e},function(t,e,n){var r=n(1),i=n(3),o=n(4),s="[object Array]",a=Object.prototype,c=a.toString,u=i(u=Array.isArray)&&u,f=u||function(t){return o(t)&&r(t.length)&&c.call(t)==s||!1};t.exports=f},function(t,e,n){"use strict";var r=n(19),i=function(t){var e,n={};r(t instanceof Object&&!Array.isArray(t));for(e in t)t.hasOwnProperty(e)&&(n[e]=e);return n};t.exports=i},function(t,e,n){"use strict";var r=n(6),i=r({DRAG_START:null,DRAG_END:null,DRAG:null,DROP:null});t.exports=i},function(t){"use strict";var e={COPY:"copy",MOVE:"move",LINK:"link"};t.exports=e},function(t,e,n){"use strict";var r=n(47).Dispatcher,i=n(18),o=i(new r,{handleAction:function(t){this.dispatch({action:t})}});t.exports=o},function(t,e,n){"use strict";var r=n(9),i=n(7),o=n(25),s=null,a=null,c=null,u=o({getInitialOffsetFromContainer:function(){return s},getInitialOffsetFromClient:function(){return a},getCurrentOffsetFromClient:function(){return c}});u.dispatchToken=r.register(function(t){var e=t.action;switch(e.type){case i.DRAG_START:s=e.offsetFromContainer,a=e.offsetFromClient,c=e.offsetFromClient,u.emitChange();break;case i.DRAG:c=e.offsetFromClient,u.emitChange();break;case i.DRAG_END:c=null,c=null,u.emitChange()}}),t.exports=u},function(t,e,n){"use strict";var r=n(9),i=n(7),o=n(10),s=n(25),a=null,c=null,u=null,f=null,g=s({isDragging:function(){return!!a},getEffectsAllowed:function(){return u},getDropEffect:function(){return f},getDraggedItem:function(){return a},getDraggedItemType:function(){return c}});g.dispatchToken=r.register(function(t){r.waitFor([o.dispatchToken]);var e=t.action;switch(e.type){case i.DRAG_START:f=null,a=e.item,c=e.itemType,u=e.effectsAllowed,g.emitChange();break;case i.DROP:f=e.dropEffect,g.emitChange();break;case i.DRAG_END:a=null,c=null,u=null,f=null,g.emitChange()}}),t.exports=g},function(t){"use strict";function e(t){if(!t.dataTransfer)return!1;var e=Array.prototype.slice.call(t.dataTransfer.types);return-1!==e.indexOf("Files")}t.exports=e},function(t){"use strict";function e(){return!!window.safari}t.exports=e},function(t){"use strict";function e(t){var e=Array.prototype.slice.call(t.dataTransfer.types);return-1!==e.indexOf("Url")||-1!==e.indexOf("text/uri-list")}t.exports=e},function(t){function e(t,e){return t=+t,e=null==e?n:e,t>-1&&t%1==0&&e>t}var n=Math.pow(2,53)-1;t.exports=e},function(t,e,n){function r(t){var e=o(t)?t.length:void 0;return i(e)&&c.call(t)==s||!1}var i=n(1),o=n(4),s="[object Arguments]",a=Object.prototype,c=a.toString;t.exports=r},function(t){function e(){}t.exports=e},function(t){function e(t){if(null==t)throw new TypeError("Object.assign target cannot be null or undefined");for(var e=Object(t),n=Object.prototype.hasOwnProperty,r=1;r<arguments.length;r++){var i=arguments[r];if(null!=i){var o=Object(i);for(var s in o)n.call(o,s)&&(e[s]=o[s])}}return e}t.exports=e},function(t){"use strict";var e=function(t,e,n,r,i,o,s,a){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,s,a],f=0;c=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return u[f++]}))}throw c.framesToPop=1,c}};t.exports=e},function(t,e,n){"use strict";var r=n(9),i=n(7),o={startDragging:function(t,e,n,o,s){r.handleAction({type:i.DRAG_START,itemType:t,item:e,effectsAllowed:n,offsetFromClient:o,offsetFromContainer:s})},drag:function(t){r.handleAction({type:i.DRAG,offsetFromClient:t})},recordDrop:function(t){r.handleAction({type:i.DROP,dropEffect:t})},endDragging:function(){r.handleAction({type:i.DRAG_END})}};t.exports=o},function(t,e,n){"use strict";var r=n(6),i=r({LEFT:null,CENTER:null,RIGHT:null});t.exports=i},function(t,e,n){"use strict";var r=(n(6),{FILE:"__NATIVE_FILE__",URL:"__NATIVE_URL__"});t.exports=r},function(t,e,n){"use strict";var r=n(6),i=r({TOP:null,CENTER:null,BOTTOM:null});t.exports=i},function(t,e,n){"use strict";var r=function(t,e,n){e&&Object.defineProperties(t,e),n&&Object.defineProperties(t.prototype,n)},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=n(50),s=n(51),a=function(){function t(){i(this,t),this._entered=[]}return r(t,null,{enter:{value:function(t){return this._entered=o(this._entered.filter(function(e){return document.body.contains(e)&&(!e.contains||e.contains(t))}),[t]),1===this._entered.length},writable:!0,configurable:!0},leave:{value:function(t){return this._entered=s(this._entered.filter(function(t){return document.body.contains(t)}),t),0===this._entered.length},writable:!0,configurable:!0},reset:{value:function(){this._entered=[]},writable:!0,configurable:!0}}),t}();t.exports=a},function(t,e,n){"use strict";function r(t){var e=o({emitChange:function(){this.emit(s)},addChangeListener:function(t){this.on(s,t)},removeChangeListener:function(t){this.removeListener(s,t)}},t,i.prototype);return e.setMaxListeners(0),e}var i=n(76).EventEmitter,o=n(18),s="change";t.exports=r},function(t,e,n){function r(t,e,n){if(e!==e)return i(t,n);for(var r=(n||0)-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}var i=n(65);t.exports=r},function(t,e,n){function r(t,e){var n=t.data,r="string"==typeof e||i(e)?n.set.has(e):n.hash[e];return r?0:-1}var i=n(2);t.exports=r},function(t,e,n){(function(e){var r=n(52),i=n(73),o=n(3),s=o(s=e.Set)&&s,a=o(a=Object.create)&&a,c=a&&s?function(t){return new r(t)}:i(null);t.exports=c}).call(e,function(){return this}())},function(t,e,n){(function(e){var r=n(3),i=/\bthis\b/,o=Object.prototype,s=(s=e.window)&&s.document,a=o.propertyIsEnumerable,c={};!function(){c.funcDecomp=!r(e.WinRTError)&&i.test(function(){return this}),c.funcNames="string"==typeof Function.name;try{c.dom=11===s.createDocumentFragment().nodeType}catch(t){c.dom=!1}try{c.nonEnumArgs=!a.call(arguments,1)}catch(t){c.nonEnumArgs=!0}}(0,0),t.exports=c}).call(e,function(){return this}())},function(t,e,n){"use strict";function r(t){var e=t.getBoundingClientRect();return{top:e.top,left:e.left,width:e.width,height:e.height}}function i(){if(!d){var t=r(l);d=!E(h,t)}return d}function o(){if(p&&!document.body.contains(l)){var t=D.getDraggedItemType();p.handleDragEnd(t,null)}}function s(t){return _(t)||w(t)}function a(t){s(t)&&t.preventDefault()}function c(t){t.preventDefault();var e=A.enter(t.target);e&&(_(t)?m.startDragging(y.FILE,null):w(t)&&m.startDragging(y.URL,null))}function u(t){a(t);var e=I.getOffsetFromClient(p,t);m.drag(e),v&&(t.dataTransfer.dropEffect=v,v=null),l&&b()&&i()&&t.preventDefault()}function f(t){a(t);var e=A.leave(t.target);e&&s(t)&&m.endDragging()}function g(t){a(t),A.reset(),s(t)&&m.endDragging(),o()}var l,p,h,d,v,m=n(20),D=n(11),y=n(22),x=n(24),_=n(12),w=n(14),T=n(37),E=n(75),b=n(45),A=new x,I={setup:function(){"undefined"!=typeof window&&(window.addEventListener("dragenter",c),window.addEventListener("dragover",u),window.addEventListener("dragleave",f),window.addEventListener("drop",g))},teardown:function(){"undefined"!=typeof window&&(window.removeEventListener("dragenter",c),window.removeEventListener("dragover",u),window.removeEventListener("dragleave",f),window.removeEventListener("drop",g))},beginDrag:function(t,e,n,i,s,a,c){var u=e.nativeEvent,f=u.dataTransfer,g=u.target;T(f,n,i,s,a,c),p=t,l=g,h=r(g),d=!1,window.addEventListener("mousemove",o,!0)},endDrag:function(){l=null,p=null,h=null,d=!1,window.removeEventListener("mousemove",o,!0)},dragOver:function(t,e,n){v||(v=n)},getDragSourceProps:function(t,e){return{draggable:!0,onDragStart:t.handleDragStart.bind(t,e),onDragEnd:t.handleDragEnd.bind(t,e)}},getDropTargetProps:function(t,e){return{onDragEnter:t.handleDragEnter.bind(t,e),onDragOver:t.handleDragOver.bind(t,e),onDragLeave:t.handleDragLeave.bind(t,e),onDrop:t.handleDrop.bind(t,e)}},getOffsetFromClient:function(t,e){return{x:e.clientX,y:e.clientY}}};t.exports=I},function(t,e,n){"use strict";t.exports={HTML5:n(30)}},function(t,e,n){"use strict";var r=n(11),i=n(10),o={getInitialState:function(){return this.getStateForDragLayerMixin()},getDragLayerState:function(){var t=this.state,e=t.isDragging,n=t.draggedItemType,r=t.draggedItem,i=t.initialOffset,o=t.currentOffset;return{isDragging:e,draggedItemType:n,draggedItem:r,initialOffset:i,currentOffset:o}},getStateForDragLayerMixin:function(){var t=i.getInitialOffsetFromClient(),e=i.getCurrentOffsetFromClient(),n=i.getInitialOffsetFromContainer(),o=!1,s=null,a=null,c=null,u=null;return t&&e&&(o=!0,s=r.getDraggedItemType(),a=r.getDraggedItem(),c={x:t.x-n.x,y:t.y-n.y},u={x:e.x-n.x,y:e.y-n.y}),{isDragging:o,draggedItemType:s,draggedItem:a,initialOffset:c,currentOffset:u}},handleStoreChangeInDragLayerMixin:function(){this.isMounted()&&this.setState(this.getStateForDragLayerMixin())},componentDidMount:function(){i.addChangeListener(this.handleStoreChangeInDragLayerMixin),r.addChangeListener(this.handleStoreChangeInDragLayerMixin)},componentWillUnmount:function(){i.removeChangeListener(this.handleStoreChangeInDragLayerMixin),r.removeChangeListener(this.handleStoreChangeInDragLayerMixin)}};t.exports=o},function(t,e,n){"use strict";var r=n(43),i="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",o={componentDidMount:function(){this._cachedImages={},this._readyImages={},this.preloadImages()},componentDidUpdate:function(){this.preloadImages()},componentWillUnmount:function(){for(var t in this._cachedImages)this._cachedImages[t].src=i;this._cachedImages={}},hasPreloadedImage:function(t){return!!this._readyImages[t]},getPreloadedImage:function(t){return this.hasPreloadedImage(t)?this._cachedImages[t]:void 0},preloadImages:function(){var t=this.getImageUrlsToPreload();t.forEach(this.preloadImage)},preloadImage:function(t){var e=this;if(t&&!this._cachedImages[t]){var n=new Image;n.onload=function(){e.isMounted()&&(e._readyImages[t]=!0)},n.onerror=function(){e.isMounted()&&delete e._cachedImages[t]},n.src=t,this._cachedImages[t]=n}},getDragImageScale:r};t.exports=o},function(t,e,n){"use strict";var r=n(19),i=n(17),o={canDrag:function(){return!0},beginDrag:function(){r(!1,"Drag source must contain a method called beginDrag. See https://github.com/gaearon/react-dnd#drag-source-api")},endDrag:i};t.exports=o},function(t,e,n){"use strict";var r=n(17),i={canDrop:function(){return!0},getDropEffect:function(t,e){return e[0]},enter:r,over:r,leave:r,acceptDrop:r};t.exports=i},function(t,e,n){"use strict";var r=n(10),i={getCurrentOffsetDelta:function(){var t=r.getInitialOffsetFromClient(),e=r.getCurrentOffsetFromClient();return{x:e.x-t.x,y:e.y-t.y}},getInitialOffsetFromClient:function(){return r.getInitialOffsetFromClient()},getCurrentOffsetFromClient:function(){return r.getCurrentOffsetFromClient()}};t.exports=i},function(t,e,n){"use strict";function r(t,e,n,r,a,c){try{t.setData("application/json",{})}catch(u){}if(i(n)&&t.setDragImage){var f=o(e,n,r,a);t.setDragImage(n,f.x,f.y)}t.effectAllowed=s(c)}var i=n(46),o=n(42),s=n(41);t.exports=r},function(t,e,n){"use strict";function r(t,e){m(e&&("string"==typeof e||"symbol"==typeof e),"Expected item type to be a non-empty string or a symbol. See %s",t.constructor.displayName)}function i(t,e){var n=t.constructor.displayName;m(t._dragSources[e],'There is no drag source for "%s" registered in %s. Have you forgotten to register it? See configureDragDrop in %s',e,n,n)}function o(t,e){var n=t.constructor.displayName;m(t._dropTargets[e],'There is no drop target for "%s" registered in %s. Have you forgotten to register it? See configureDragDrop in %s',e,n,n)}function s(t){function e(e){0===s&&t.setup(e),s++}function n(e){s--,0===s&&t.teardown(e)}var s=0;return{getInitialState:function(){var t={ownDraggedItemType:null,currentDropEffect:null};return D(t,this.getStateForDragDropMixin())},getActiveDropTargetType:function(){var t=this.state,e=t.draggedItemType,n=t.draggedItem,r=t.ownDraggedItemType,i=this._dropTargets[e];if(!i)return null;if(e===r)return null;var o=i.canDrop;return o(this,n)?e:null},isAnyDropTargetActive:function(t){return t.indexOf(this.getActiveDropTargetType())>-1},getStateForDragDropMixin:function(){return{draggedItem:c.getDraggedItem(),draggedItemType:c.getDraggedItemType()}},getDragState:function(t){return r(this,t),i(this,t),{isDragging:this.state.ownDraggedItemType===t}},getDropState:function(t){r(this,t),o(this,t);var e=this.getActiveDropTargetType()===t,n=!!this.state.currentDropEffect;return{isDragging:e,isHovering:e&&n}},componentWillMount:function(){this._monitor=new f,this._dragSources={},this._dropTargets={},m(this.constructor.configureDragDrop,"%s must implement static configureDragDrop(register, context) to use DragDropMixin",this.constructor.displayName),this.constructor.configureDragDrop(this.registerDragDropItemTypeHandlers,u)},componentDidMount:function(){e(this),c.addChangeListener(this.handleStoreChangeInDragDropMixin)},componentWillUnmount:function(){n(this),c.removeChangeListener(this.handleStoreChangeInDragDropMixin)},registerDragDropItemTypeHandlers:function(t,e){r(this,t);var n=e.dragSource,i=e.dropTarget;n&&(m(!this._dragSources[t],"Drag source for %s specified twice. See configureDragDrop in %s",t,this.constructor.displayName),this._dragSources[t]=y(n,l)),i&&(m(!this._dropTargets[t],"Drop target for %s specified twice. See configureDragDrop in %s",t,this.constructor.displayName),this._dropTargets[t]=y(i,p))},handleStoreChangeInDragDropMixin:function(){this.isMounted()&&this.setState(this.getStateForDragDropMixin())},dragSourceFor:function(e){return r(this,e),i(this,e),t.getDragSourceProps(this,e)},handleDragStart:function(e,n){var r=this,i=this._dragSources[e],o=i.canDrag,s=i.beginDrag;if(!o(this))return void n.preventDefault();var u,f=s(this),l=f.item,p=f.dragPreview,h=f.dragAnchors,d=f.effectsAllowed,v=this.getDOMNode(),D=v.getBoundingClientRect(),y=t.getOffsetFromClient(this,n);u={x:y.x-D.left,y:y.y-D.top},d||(d=[g.MOVE]),m(x(d)&&d.length>0,"Expected effectsAllowed to be non-empty array"),m(_(l),'Expected return value of beginDrag to contain "item" object'),t.beginDrag(this,n,v,p,h,u,d),a.startDragging(e,l,d,y,u),setTimeout(function(){r.isMounted()&&c.getDraggedItem()===l&&r.setState({ownDraggedItemType:e})})},handleDragEnd:function(e){t.endDrag(this);var n=this._dragSources[e].endDrag,r=c.getDropEffect();a.endDragging(),this.isMounted()&&this.setState({ownDraggedItemType:null}),n(this,r)},dropTargetFor:function(){for(var e=this,n=arguments.length,i=Array(n),s=0;n>s;s++)i[s]=arguments[s];return i.forEach(function(t){r(e,t),o(e,t)}),t.getDropTargetProps(this,i)},handleDragEnter:function(t,e){if(this.isAnyDropTargetActive(t)&&this._monitor.enter(e.target)){e.preventDefault();var n=this._dropTargets[this.state.draggedItemType],r=n.enter,i=n.getDropEffect,o=c.getEffectsAllowed();(h(e)||d(e))&&(o=[g.COPY]);var s=i(this,o);s&&m(o.indexOf(s)>-1,"Effect %s supplied by drop target is not one of the effects allowed by drag source: %s",s,o.join(", ")),this.setState({currentDropEffect:s}),r(this,this.state.draggedItem)}},handleDragOver:function(e,n){if(this.isAnyDropTargetActive(e)){n.preventDefault();{var r=this._dropTargets[this.state.draggedItemType],i=r.over;r.getDropEffect}i(this,this.state.draggedItem),t.dragOver(this,n,this.state.currentDropEffect||"move")}},handleDragLeave:function(t,e){if(this.isAnyDropTargetActive(t)&&this._monitor.leave(e.target)){this.setState({currentDropEffect:null});var n=this._dropTargets[this.state.draggedItemType].leave;n(this,this.state.draggedItem)}},handleDrop:function(t,e){if(this.isAnyDropTargetActive(t)){e.preventDefault();var n=this.state.draggedItem,r=this._dropTargets[this.state.draggedItemType].acceptDrop,i=this.state.currentDropEffect,o=!!c.getDropEffect();n||(n=v(e)),this._monitor.reset(),o||a.recordDrop(i),this.setState({currentDropEffect:null}),r(this,n,o,c.getDropEffect())}}}}{var a=n(20),c=n(11),u=n(36),f=n(24),g=n(8),l=n(34),p=n(35),h=n(12),d=n(14),v=n(40),m=n(19),D=n(18),y=n(69),x=n(5),_=n(2);n(17)}t.exports=s},function(t){"use strict";function e(t,e){return-1!==t.indexOf(e,t.length-e.length)}t.exports=e},function(t,e,n){"use strict";function r(t){return i(t)?{files:Array.prototype.slice.call(t.dataTransfer.files)}:o(t)?{urls:(t.dataTransfer.getData("Url")||t.dataTransfer.getData("text/uri-list")||"").split("\n")}:void 0}var i=n(12),o=n(14);t.exports=r},function(t,e,n){"use strict";function r(t){var e=t.indexOf(i.COPY)>-1,n=t.indexOf(i.MOVE)>-1,r=t.indexOf(i.LINK)>-1;return e&&n&&r?"all":e&&n?"copyMove":r&&n?"linkMove":e&&r?"copyLink":e?"copy":n?"move":r?"link":"none"}var i=n(8);t.exports=r},function(t,e,n){"use strict";function r(t,e,n,r){n=n||{};var a=t.offsetWidth,c=t.offsetHeight,u=e instanceof Image,f=u?e.width:a,g=u?e.height:c,l=n.horizontal||i.CENTER,p=n.vertical||o.CENTER,h=r.x,d=r.y;switch(s()&&(g/=window.devicePixelRatio,f/=window.devicePixelRatio),l){case i.LEFT:break;case i.CENTER:h*=f/a;break;case i.RIGHT:h=f-f*(1-h/a)}switch(p){case o.TOP:break;case o.CENTER:d*=g/c;break;case o.BOTTOM:d=g-g*(1-d/c)}return s()&&(d+=(window.devicePixelRatio-1)*g),{x:h,y:d}}var i=n(21),o=n(23),s=n(13);t.exports=r},function(t,e,n){"use strict";function r(){return i()||o()?window.devicePixelRatio:1}var i=n(44),o=n(13);t.exports=r},function(t){"use strict";function e(){return/firefox/i.test(navigator.userAgent)}t.exports=e},function(t){"use strict";function e(){return"WebkitAppearance"in document.documentElement.style}t.exports=e},function(t,e,n){"use strict";function r(t){return t?i()&&t instanceof Image&&o(t.src,".gif")?!1:!0:!1}var i=n(13),o=n(39);t.exports=r},function(t,e,n){t.exports.Dispatcher=n(48)},function(t,e,n){"use strict";function r(){this.$Dispatcher_callbacks={},this.$Dispatcher_isPending={},this.$Dispatcher_isHandled={},this.$Dispatcher_isDispatching=!1,this.$Dispatcher_pendingPayload=null}var i=n(49),o=1,s="ID_";r.prototype.register=function(t){var e=s+o++;return this.$Dispatcher_callbacks[e]=t,e},r.prototype.unregister=function(t){i(this.$Dispatcher_callbacks[t],"Dispatcher.unregister(...): `%s` does not map to a registered callback.",t),delete this.$Dispatcher_callbacks[t]},r.prototype.waitFor=function(t){i(this.$Dispatcher_isDispatching,"Dispatcher.waitFor(...): Must be invoked while dispatching.");for(var e=0;e<t.length;e++){var n=t[e];this.$Dispatcher_isPending[n]?i(this.$Dispatcher_isHandled[n],"Dispatcher.waitFor(...): Circular dependency detected while waiting for `%s`.",n):(i(this.$Dispatcher_callbacks[n],"Dispatcher.waitFor(...): `%s` does not map to a registered callback.",n),this.$Dispatcher_invokeCallback(n))}},r.prototype.dispatch=function(t){i(!this.$Dispatcher_isDispatching,"Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch."),this.$Dispatcher_startDispatching(t);try{for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]||this.$Dispatcher_invokeCallback(e)}finally{this.$Dispatcher_stopDispatching()}},r.prototype.isDispatching=function(){return this.$Dispatcher_isDispatching},r.prototype.$Dispatcher_invokeCallback=function(t){this.$Dispatcher_isPending[t]=!0,this.$Dispatcher_callbacks[t](this.$Dispatcher_pendingPayload),this.$Dispatcher_isHandled[t]=!0},r.prototype.$Dispatcher_startDispatching=function(t){for(var e in this.$Dispatcher_callbacks)this.$Dispatcher_isPending[e]=!1,this.$Dispatcher_isHandled[e]=!1;this.$Dispatcher_pendingPayload=t,this.$Dispatcher_isDispatching=!0},r.prototype.$Dispatcher_stopDispatching=function(){this.$Dispatcher_pendingPayload=null,this.$Dispatcher_isDispatching=!1},t.exports=r},function(t){"use strict";var e=function(t,e,n,r,i,o,s,a){if(!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,s,a],f=0;c=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return u[f++]}))}throw c.framesToPop=1,c}};t.exports=e},function(t,e,n){function r(){return o(i(arguments,!1,!0))}var i=n(58),o=n(61);t.exports=r},function(t,e,n){function r(t){return i(t,o(arguments,1))}var i=n(57),o=n(59);t.exports=r},function(t,e,n){(function(e){function r(t){var e=t?t.length:0;for(this.data={hash:a(null),set:new s};e--;)this.push(t[e])}var i=n(63),o=n(3),s=o(s=e.Set)&&s,a=o(a=Object.create)&&a;r.prototype.push=i,t.exports=r}).call(e,function(){return this}())},function(t){function e(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}t.exports=e},function(t){function e(t,e){return"undefined"==typeof t?e:t}t.exports=e},function(t,e,n){function r(t,e,n){var r=o(e);if(!n)return i(e,t,r);for(var s=-1,a=r.length;++s<a;){var c=r[s],u=t[c],f=n(u,e[c],c,t,e);(f===f?f===u:u!==u)&&("undefined"!=typeof u||c in t)||(t[c]=f)}return t}var i=n(56),o=n(70);t.exports=r},function(t){function e(t,e,n){n||(n=e,e={});for(var r=-1,i=n.length;++r<i;){var o=n[r];e[o]=t[o]}return e}t.exports=e},function(t,e,n){function r(t,e){var n=t?t.length:0,r=[];if(!n)return r;var a=-1,c=i,u=!0,f=u&&e.length>=200?s(e):null,g=e.length;f&&(c=o,u=!1,e=f);t:for(;++a<n;){var l=t[a];if(u&&l===l){for(var p=g;p--;)if(e[p]===l)continue t;r.push(l)}else c(e,l)<0&&r.push(l)}return r}var i=n(26),o=n(27),s=n(28);t.exports=r},function(t,e,n){function r(t,e,n,c){for(var u=(c||0)-1,f=t.length,g=-1,l=[];++u<f;){var p=t[u];if(a(p)&&s(p.length)&&(o(p)||i(p))){e&&(p=r(p,e,n));var h=-1,d=p.length;for(l.length+=d;++h<d;)l[++g]=p[h]}else n||(l[++g]=p)}return l}var i=n(16),o=n(5),s=n(1),a=n(4);t.exports=r},function(t){function e(t,e,n){var r=-1,i=t.length;e=null==e?0:+e||0,0>e&&(e=-e>i?0:i+e),n="undefined"==typeof n||n>i?i:+n||0,0>n&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}t.exports=e},function(t){function e(t){return"string"==typeof t?t:null==t?"":t+""}t.exports=e},function(t,e,n){function r(t,e){var n=-1,r=i,a=t.length,c=!0,u=c&&a>=200,f=u?s():null,g=[];f?(r=o,c=!1):(u=!1,f=e?[]:g);t:for(;++n<a;){var l=t[n],p=e?e(l,n,t):l;if(c&&l===l){for(var h=f.length;h--;)if(f[h]===p)continue t;e&&f.push(p),g.push(l)}else r(f,p)<0&&((e||u)&&f.push(p),g.push(l))}return g}var i=n(26),o=n(27),s=n(28);t.exports=r},function(t,e,n){function r(t,e,n){if("function"!=typeof t)return i;if("undefined"==typeof e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)};case 5:return function(n,r,i,o,s){return t.call(e,n,r,i,o,s)}}return function(){return t.apply(e,arguments)}}var i=n(74);t.exports=r},function(t,e,n){function r(t){var e=this.data;"string"==typeof t||i(t)?e.set.add(t):e.hash[t]=!0}var i=n(2);t.exports=r},function(t,e,n){function r(t){return function(){var e=arguments.length,n=arguments[0];if(2>e||null==n)return n;if(e>3&&o(arguments[1],arguments[2],arguments[3])&&(e=2),e>3&&"function"==typeof arguments[e-2])var r=i(arguments[--e-1],arguments[e--],5);else e>2&&"function"==typeof arguments[e-1]&&(r=arguments[--e]);for(var s=0;++s<e;){var a=arguments[s];a&&t(n,a,r)}return n}}var i=n(62),o=n(66);t.exports=r},function(t){function e(t,e,n){for(var r=t.length,i=n?e||r:(e||0)-1;n?i--:++i<r;){var o=t[i];if(o!==o)return i}return-1}t.exports=e},function(t,e,n){function r(t,e,n){if(!s(n))return!1;var r=typeof e;if("number"==r)var a=n.length,c=o(a)&&i(e,a);else c="string"==r&&e in n;if(c){var u=n[e];return t===t?t===u:u!==u}return!1}var i=n(15),o=n(1),s=n(2);t.exports=r},function(t,e,n){function r(t){for(var e=c(t),n=e.length,r=n&&t.length,f=r&&a(r)&&(o(t)||u.nonEnumArgs&&i(t)),l=-1,p=[];++l<n;){var h=e[l];(f&&s(h,r)||g.call(t,h))&&p.push(h)}return p}var i=n(16),o=n(5),s=n(15),a=n(1),c=n(71),u=n(29),f=Object.prototype,g=f.hasOwnProperty;t.exports=r},function(t,e,n){var r=n(55),i=n(64),o=i(r);t.exports=o},function(t,e,n){function r(t){if(null==t)return t;var e=i(arguments);return e.push(s),o.apply(void 0,e)}var i=n(53),o=n(68),s=n(54);t.exports=r},function(t,e,n){var r=n(1),i=n(3),o=n(2),s=n(67),a=i(a=Object.keys)&&a,c=a?function(t){if(t)var e=t.constructor,n=t.length;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&n&&r(n)?s(t):o(t)?a(t):[]}:s;t.exports=c},function(t,e,n){function r(t){if(null==t)return[];c(t)||(t=Object(t));var e=t.length;e=e&&a(e)&&(o(t)||u.nonEnumArgs&&i(t))&&e||0;for(var n=t.constructor,r=-1,f="function"==typeof n&&n.prototype===t,l=Array(e),p=e>0;++r<e;)l[r]=r+"";for(var h in t)p&&s(h,e)||"constructor"==h&&(f||!g.call(t,h))||l.push(h);return l}var i=n(16),o=n(5),s=n(15),a=n(1),c=n(2),u=n(29),f=Object.prototype,g=f.hasOwnProperty;t.exports=r},function(t,e,n){function r(t){return t=i(t),t&&s.test(t)?t.replace(o,"\\$&"):t}var i=n(60),o=/[.*+?^${}()|[\]\/\\]/g,s=RegExp(o.source);t.exports=r},function(t){function e(t){return function(){return t}}t.exports=e},function(t){function e(t){return t}t.exports=e},function(t){"use strict";function e(t,e){if(t===e)return!0;var n;for(n in t)if(t.hasOwnProperty(n)&&(!e.hasOwnProperty(n)||t[n]!==e[n]))return!1;for(n in e)if(e.hasOwnProperty(n)&&!t.hasOwnProperty(n))return!1;return!0}t.exports=e},function(t){function e(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function r(t){return"number"==typeof t}function i(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=e,e.EventEmitter=e,e.prototype._events=void 0,e.prototype._maxListeners=void 0,e.defaultMaxListeners=10,e.prototype.setMaxListeners=function(t){if(!r(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},e.prototype.emit=function(t){var e,r,s,a,c,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[t],o(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(s=arguments.length,a=new Array(s-1),c=1;s>c;c++)a[c-1]=arguments[c];r.apply(this,a)}else if(i(r)){for(s=arguments.length,a=new Array(s-1),c=1;s>c;c++)a[c-1]=arguments[c];for(u=r.slice(),s=u.length,c=0;s>c;c++)u[c].apply(this,a)}return!0},e.prototype.addListener=function(t,r){var s;if(!n(r))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(r.listener)?r.listener:r),this._events[t]?i(this._events[t])?this._events[t].push(r):this._events[t]=[this._events[t],r]:this._events[t]=r,i(this._events[t])&&!this._events[t].warned){var s;s=o(this._maxListeners)?e.defaultMaxListeners:this._maxListeners,s&&s>0&&this._events[t].length>s&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())}return this},e.prototype.on=e.prototype.addListener,e.prototype.once=function(t,e){function r(){this.removeListener(t,r),i||(i=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var i=!1;return r.listener=e,this.on(t,r),this},e.prototype.removeListener=function(t,e){var r,o,s,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],s=r.length,o=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(r)){for(a=s;a-->0;)if(r[a]===e||r[a].listener&&r[a].listener===e){o=a;break}if(0>o)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},e.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],n(r))this.removeListener(t,r);else for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},e.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},e.listenerCount=function(t,e){var r;return r=t._events&&t._events[e]?n(t._events[e])?1:t._events[e].length:0}}])}); |
@@ -110,5 +110,13 @@ # API | ||
##### `getInitialOffsetFromClient()` | ||
Returns `{ x, y }` coordinates of mouse position when dragging started in client coordinates (as opposed to coordinates within the page). | ||
##### `getCurrentOffsetFromClient()` | ||
Returns `{ x, y }` coordinates of the last recorded mouse position in client coordinates (as opposed to coordinates within the page). | ||
##### `getCurrentOffsetDelta()` | ||
Returns `{ x, y }` coordinate delta between current mouse position and its position when dragging started. | ||
Returns relative `{ x, y }` coordinate delta between last recorded mouse position and its position when dragging started. | ||
@@ -119,2 +127,4 @@ ## `DragLayerMixin` | ||
If you have performance problems due to drag layer redrawing on every position change, you should use [`PureRenderMixin`](http://facebook.github.io/react/docs/pure-render-mixin.html) (or manually implement [`shouldComponentUpdate`](http://facebook.github.io/react/docs/advanced-performance.html)) in child components to avoid reconciling them. | ||
##### `getDragLayerState()` | ||
@@ -174,3 +184,3 @@ | ||
Provides a single constant, `NativeDragItemTypes.FILE`, that you can use as an item type for file drop targets. | ||
Provides two constants, `NativeDragItemTypes.FILE` and `NativeDragItemTypes.URL`, that you can use as an item type for native file and URL drop targets. | ||
@@ -177,0 +187,0 @@ ## `DropEffects` |
@@ -9,3 +9,3 @@ # Upgrade Guide | ||
Declaring `configureDragDrop` as an instance method is now deprecated. You need to put it into `statics` and change all methods to accept `component` as the first parameter instead of using `this`. | ||
Declaring `configureDragDrop` as an instance method is now not supported. You need to put it into `statics` and change all methods to accept `component` as the first parameter instead of using `this`. | ||
@@ -89,2 +89,2 @@ If your code looked like this: | ||
acceptDrop(component: ReactComponent, item: Object, isHandled: bool, effect: DropEffect?) | ||
``` | ||
``` |
@@ -17,3 +17,3 @@ ### Simple Drag Source | ||
These types are just string constants that are used to match compatible drag sources and drop targets. Even if you only plan to have one draggable type of items, it's still neccessary to declare a string constant for it. This makes it trivial to later add additional draggable/droppable types without rewriting half of your drag and drop code. Also, always relying on types allows us to elegantly support file drag and drop via a “builtin” `NativeDragItemTypes.FILE` type. | ||
These types are just string constants that are used to match compatible drag sources and drop targets. Even if you only plan to have one draggable type of items, it's still neccessary to declare a string constant for it. This makes it trivial to later add additional draggable/droppable types without rewriting half of your drag and drop code. Also, always relying on types allows us to elegantly support file and URL drag and drop via a “builtin” `NativeDragItemTypes.FILE` and `NativeDragItemTypes.URL` types. | ||
@@ -20,0 +20,0 @@ Let's make a very simple draggable component that, when dragged, represents `IMAGE`: |
'use strict'; | ||
var React = require('react'), | ||
{ PureRenderMixin } = require('react/addons'), | ||
{ PropTypes } = React; | ||
@@ -15,2 +16,4 @@ | ||
var Box = React.createClass({ | ||
mixins: [PureRenderMixin], | ||
propTypes: { | ||
@@ -17,0 +20,0 @@ title: PropTypes.string.isRequired |
@@ -5,2 +5,3 @@ 'use strict'; | ||
Box = require('./Box'), | ||
{ PureRenderMixin } = require('react/addons'), | ||
{ PropTypes } = React; | ||
@@ -18,2 +19,4 @@ | ||
var BoxDragPreview = React.createClass({ | ||
mixins: [PureRenderMixin], | ||
propTypes: { | ||
@@ -20,0 +23,0 @@ title: PropTypes.string.isRequired |
@@ -9,2 +9,3 @@ 'use strict'; | ||
{ PropTypes } = React, | ||
{ PureRenderMixin } = require('react/addons'), | ||
{ DragDropMixin, DragLayerMixin } = require('react-dnd'); | ||
@@ -22,3 +23,3 @@ | ||
var Container = React.createClass({ | ||
mixins: [DragDropMixin], | ||
mixins: [DragDropMixin, PureRenderMixin], | ||
@@ -25,0 +26,0 @@ propTypes: { |
@@ -8,2 +8,3 @@ 'use strict'; | ||
{ PropTypes } = React, | ||
{ PureRenderMixin } = require('react/addons'), | ||
{ DragDropMixin, DropEffects } = require('react-dnd'); | ||
@@ -25,3 +26,3 @@ | ||
var DraggableBox = React.createClass({ | ||
mixins: [DragDropMixin], | ||
mixins: [DragDropMixin, PureRenderMixin], | ||
@@ -28,0 +29,0 @@ propTypes: { |
@@ -8,2 +8,3 @@ 'use strict'; | ||
{ DragLayerMixin } = require('react-dnd'), | ||
{ PureRenderMixin } = require('react/addons'), | ||
{ PropTypes } = React; | ||
@@ -45,3 +46,3 @@ | ||
var DragLayer = React.createClass({ | ||
mixins: [DragLayerMixin], | ||
mixins: [DragLayerMixin, PureRenderMixin], | ||
@@ -48,0 +49,0 @@ propTypes: { |
@@ -27,3 +27,3 @@ 'use strict'; | ||
{this.renderDustbin([ItemTypes.PAPER])} | ||
{this.renderDustbin([ItemTypes.PAPER, NativeDragItemTypes.FILE])} | ||
{this.renderDustbin([NativeDragItemTypes.FILE, NativeDragItemTypes.URL])} | ||
</div> | ||
@@ -30,0 +30,0 @@ |
@@ -13,3 +13,3 @@ 'use strict'; | ||
<p> | ||
Several different dustbins can handle several types of items. Note that the last dustbin is special: it can also handle files from your hard drive. | ||
Several different dustbins can handle several types of items. Note that the last dustbin is special: it can handle files from your hard drive and URLs. | ||
</p> | ||
@@ -16,0 +16,0 @@ </div> |
@@ -8,2 +8,3 @@ 'use strict'; | ||
isFileDragDropEvent = require('../utils/isFileDragDropEvent'), | ||
isUrlDragDropEvent = require('../utils/isUrlDragDropEvent'), | ||
configureDataTransfer = require('../utils/configureDataTransfer'), | ||
@@ -45,4 +46,8 @@ shallowEqual = require('react/lib/shallowEqual'), | ||
function preventDefaultFileDropAction(e) { | ||
if (isFileDragDropEvent(e)) { | ||
function isNativeDragDropEvent(e) { | ||
return isFileDragDropEvent(e) || isUrlDragDropEvent(e); | ||
} | ||
function preventDefaultNativeDropAction(e) { | ||
if (isNativeDragDropEvent(e)) { | ||
e.preventDefault(); | ||
@@ -57,4 +62,8 @@ } | ||
var isFirstEnter = _monitor.enter(e.target); | ||
if (isFirstEnter && isFileDragDropEvent(e)) { | ||
DragDropActionCreators.startDragging(NativeDragItemTypes.FILE, null); | ||
if (isFirstEnter) { | ||
if (isFileDragDropEvent(e)) { | ||
DragDropActionCreators.startDragging(NativeDragItemTypes.FILE, null); | ||
} else if (isUrlDragDropEvent(e)) { | ||
DragDropActionCreators.startDragging(NativeDragItemTypes.URL, null); | ||
} | ||
} | ||
@@ -64,3 +73,3 @@ } | ||
function handleTopDragOver(e) { | ||
preventDefaultFileDropAction(e); | ||
preventDefaultNativeDropAction(e); | ||
@@ -83,6 +92,6 @@ var offsetFromClient = HTML5.getOffsetFromClient(_currentComponent, e); | ||
function handleTopDragLeave(e) { | ||
preventDefaultFileDropAction(e); | ||
preventDefaultNativeDropAction(e); | ||
var isLastLeave = _monitor.leave(e.target); | ||
if (isLastLeave && isFileDragDropEvent(e)) { | ||
if (isLastLeave && isNativeDragDropEvent(e)) { | ||
DragDropActionCreators.endDragging(); | ||
@@ -93,7 +102,7 @@ } | ||
function handleTopDrop(e) { | ||
preventDefaultFileDropAction(e); | ||
preventDefaultNativeDropAction(e); | ||
_monitor.reset(); | ||
if (isFileDragDropEvent(e)) { | ||
if (isNativeDragDropEvent(e)) { | ||
DragDropActionCreators.endDragging(); | ||
@@ -100,0 +109,0 @@ } |
@@ -6,5 +6,6 @@ 'use strict'; | ||
var NativeDragItemTypes = { | ||
FILE: '__NATIVE_FILE__' | ||
FILE: '__NATIVE_FILE__', | ||
URL: '__NATIVE_URL__' | ||
}; | ||
module.exports = NativeDragItemTypes; |
@@ -11,2 +11,4 @@ 'use strict'; | ||
isFileDragDropEvent = require('./isFileDragDropEvent'), | ||
isUrlDragDropEvent = require('../utils/isUrlDragDropEvent'), | ||
extractNativeItem = require('../utils/extractNativeItem'), | ||
invariant = require('react/lib/invariant'), | ||
@@ -20,5 +22,6 @@ assign = require('react/lib/Object.assign'), | ||
function checkValidType(component, type) { | ||
/*jshint -W122 */ | ||
invariant( | ||
type && typeof type === 'string', | ||
'Expected item type to be a non-empty string. See %s', | ||
type && (typeof type === 'string' || typeof type === 'symbol'), | ||
'Expected item type to be a non-empty string or a symbol. See %s', | ||
component.constructor.displayName | ||
@@ -288,4 +291,4 @@ ); | ||
if (isFileDragDropEvent(e)) { | ||
// Use Copy drop effect for dragging files. | ||
if (isFileDragDropEvent(e) || isUrlDragDropEvent(e)) { | ||
// Use Copy drop effect for dragging files or urls. | ||
// Because browser gives no drag preview, "+" icon is useful. | ||
@@ -355,8 +358,7 @@ effectsAllowed = [DropEffects.COPY]; | ||
if (isFileDragDropEvent(e)) { | ||
// We don't know file list until the `drop` event, | ||
// so we couldn't put `item` into the store. | ||
item = { | ||
files: Array.prototype.slice.call(e.dataTransfer.files) | ||
}; | ||
// We don't know the exact list until the `drop` event, | ||
// so we couldn't put `item` into the store. | ||
if (!item) { | ||
item = extractNativeItem(e); | ||
} | ||
@@ -363,0 +365,0 @@ |
@@ -14,2 +14,10 @@ 'use strict'; | ||
}; | ||
}, | ||
getInitialOffsetFromClient() { | ||
return DragOffsetStore.getInitialOffsetFromClient(); | ||
}, | ||
getCurrentOffsetFromClient() { | ||
return DragOffsetStore.getCurrentOffsetFromClient(); | ||
} | ||
@@ -16,0 +24,0 @@ }; |
{ | ||
"name": "react-dnd", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"description": "Drag and drop for React with full DOM control", | ||
@@ -5,0 +5,0 @@ "main": "dist-modules/index.js", |
React DnD | ||
========= | ||
[![Join the chat at https://gitter.im/gaearon/react-dnd](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/gaearon/react-dnd?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
eve | ||
[![Join the chat at https://gitter.im/gaearon/react-dnd](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/gaearon/react-dnd?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
Drag and drop for React with full DOM control. | ||
@@ -7,0 +7,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2356976
117
4376