react-dnd
Advanced tools
Comparing version 0.9.2 to 0.9.3
{ | ||
"name": "react-dnd", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"homepage": "https://github.com/gaearon/react-dnd", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -13,2 +13,4 @@ "use strict"; | ||
var ELEMENT_NODE = 1; | ||
// Store global state for browser-specific fixes and workarounds | ||
@@ -23,2 +25,10 @@ var _monitor = new EnterLeaveMonitor(), | ||
function getElementRect(el) { | ||
if (el.nodeType !== ELEMENT_NODE) { | ||
el = el.parentElement; | ||
} | ||
if (!el) { | ||
return null; | ||
} | ||
var rect = el.getBoundingClientRect(); | ||
@@ -66,3 +76,3 @@ // Copy so object doesn't get reused | ||
// If by this time no drag source reacted, tell browser not to drag. | ||
if (!DragOperationStore.isDragging()) { | ||
if (!isNativeDragDropEvent(e) && !DragOperationStore.isDragging()) { | ||
e.preventDefault(); | ||
@@ -69,0 +79,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(31),i=r.HTML5,o=n(38);t.exports={DragDropMixin:o(i),ImagePreloaderMixin:n(33),DragLayerMixin:n(32),HorizontalDragAnchors:n(20),VerticalDragAnchors:n(22),NativeDragItemTypes:n(21),DropEffects:n(7)}},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(18),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(16),o=i(new r,{handleAction:function(t){this.dispatch({action:t})}});t.exports=o},function(t,e,n){"use strict";var r=n(8),i=n(6),o=n(24),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(8),i=n(6),o=n(9),s=n(24),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){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(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(8),i=n(6),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(18),i=r({LEFT:null,CENTER:null,RIGHT:null});t.exports=i},function(t){"use strict";var e={FILE:"__NATIVE_FILE__",URL:"__NATIVE_URL__"};t.exports=e},function(t,e,n){"use strict";var r=n(18),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(16),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){function e(){}t.exports=e},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(t){return{x:t.clientX,y:t.clientY}}function o(){if(!m){var t=r(h);m=!A(v,t)}return m}function s(){if(d&&!document.body.contains(h)){var t=x.getDraggedItemType();d.handleDragEnd(t,null)}}function a(t){return E(t)||T(t)}function c(t){a(t)&&t.preventDefault()}function u(t){x.isDragging()||t.preventDefault()}function f(t){t.preventDefault();var e=O.enter(t.target);e&&(E(t)?y.startDragging(_.FILE,null):T(t)&&y.startDragging(_.URL,null))}function g(t){c(t);var e=i(t);y.drag(e),D&&(t.dataTransfer.dropEffect=D,D=null),h&&I()&&o()&&t.preventDefault()}function l(t){c(t);var e=O.leave(t.target);e&&a(t)&&y.endDragging()}function p(t){c(t),O.reset(),a(t)&&y.endDragging(),s()}var h,d,v,m,D,y=n(19),x=n(10),_=n(21),w=n(23),E=n(11),T=n(13),b=n(37),A=n(75),I=n(45),O=new w,L={setup:function(){"undefined"!=typeof window&&(window.addEventListener("dragstart",u),window.addEventListener("dragenter",f),window.addEventListener("dragover",g),window.addEventListener("dragleave",l),window.addEventListener("drop",p))},teardown:function(){"undefined"!=typeof window&&(window.removeEventListener("dragstart",u),window.removeEventListener("dragenter",f),window.removeEventListener("dragover",g),window.removeEventListener("dragleave",l),window.removeEventListener("drop",p))},beginDrag:function(t,e,n,i,o,a,c){var u=e.nativeEvent,f=u.dataTransfer,g=u.target;b(f,n,i,o,a,c),d=t,h=g,v=r(g),m=!1,window.addEventListener("mousemove",s,!0)},endDrag:function(){h=null,d=null,v=null,m=!1,window.removeEventListener("mousemove",s,!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 i(e)}};t.exports=L},function(t,e,n){"use strict";t.exports={HTML5:n(30)}},function(t,e,n){"use strict";var r=n(10),i=n(9),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(17),i=n(29),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(29),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(9),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(!c.isDragging()&&o(this)){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},p||(p=v),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].over;r(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(19),c=n(10),u=n(36),f=n(23),g=n(7),l=n(34),p=n(35),h=n(11),d=n(13),v=n(40),m=n(17),D=n(16),y=n(69),x=n(5),_=n(2);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(11),o=n(13);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(7);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(20),o=n(22),s=n(12);t.exports=r},function(t,e,n){"use strict";function r(){return i()||o()?window.devicePixelRatio:1}var i=n(44),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(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(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 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(15),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(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(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(14),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(15),o=n(5),s=n(14),a=n(1),c=n(71),u=n(28),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(15),o=n(5),s=n(14),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(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}}])}); | ||
!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(20),VerticalDragAnchors:n(22),NativeDragItemTypes:n(21),DropEffects:n(7)}},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(c.call(t)):o(t)&&a.test(t)||!1}var i=n(72),o=n(4),s="[object Function]",a=/^\[object .+?Constructor\]$/,u=Object.prototype,c=Function.prototype.toString,f=u.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,u=a.toString,c=i(c=Array.isArray)&&c,f=c||function(t){return o(t)&&r(t.length)&&u.call(t)==s||!1};t.exports=f},function(t,e,n){"use strict";var r=n(18),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(16),o=i(new r,{handleAction:function(t){this.dispatch({action:t})}});t.exports=o},function(t,e,n){"use strict";var r=n(8),i=n(6),o=n(24),s=null,a=null,u=null,c=o({getInitialOffsetFromContainer:function(){return s},getInitialOffsetFromClient:function(){return a},getCurrentOffsetFromClient:function(){return u}});c.dispatchToken=r.register(function(t){var e=t.action;switch(e.type){case i.DRAG_START:s=e.offsetFromContainer,a=e.offsetFromClient,u=e.offsetFromClient,c.emitChange();break;case i.DRAG:u=e.offsetFromClient,c.emitChange();break;case i.DRAG_END:u=null,u=null,c.emitChange()}}),t.exports=c},function(t,e,n){"use strict";var r=n(8),i=n(6),o=n(9),s=n(24),a=null,u=null,c=null,f=null,g=s({isDragging:function(){return!!a},getEffectsAllowed:function(){return c},getDropEffect:function(){return f},getDraggedItem:function(){return a},getDraggedItemType:function(){return u}});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,u=e.itemType,c=e.effectsAllowed,g.emitChange();break;case i.DROP:f=e.dropEffect,g.emitChange();break;case i.DRAG_END:a=null,u=null,c=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)&&u.call(t)==s||!1}var i=n(1),o=n(4),s="[object Arguments]",a=Object.prototype,u=a.toString;t.exports=r},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 u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,s,a],f=0;u=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return c[f++]}))}throw u.framesToPop=1,u}};t.exports=e},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(8),i=n(6),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(18),i=r({LEFT:null,CENTER:null,RIGHT:null});t.exports=i},function(t){"use strict";var e={FILE:"__NATIVE_FILE__",URL:"__NATIVE_URL__"};t.exports=e},function(t,e,n){"use strict";var r=n(18),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(16),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,u=a&&s?function(t){return new r(t)}:i(null);t.exports=u}).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,u={};!function(){u.funcDecomp=!r(e.WinRTError)&&i.test(function(){return this}),u.funcNames="string"==typeof Function.name;try{u.dom=11===s.createDocumentFragment().nodeType}catch(t){u.dom=!1}try{u.nonEnumArgs=!a.call(arguments,1)}catch(t){u.nonEnumArgs=!0}}(0,0),t.exports=u}).call(e,function(){return this}())},function(t){function e(){}t.exports=e},function(t,e,n){"use strict";function r(t){if(t.nodeType!==O&&(t=t.parentElement),!t)return null;var e=t.getBoundingClientRect();return{top:e.top,left:e.left,width:e.width,height:e.height}}function i(t){return{x:t.clientX,y:t.clientY}}function o(){if(!m){var t=r(h);m=!A(v,t)}return m}function s(){if(d&&!document.body.contains(h)){var t=x.getDraggedItemType();d.handleDragEnd(t,null)}}function a(t){return E(t)||T(t)}function u(t){a(t)&&t.preventDefault()}function c(t){a(t)||x.isDragging()||t.preventDefault()}function f(t){t.preventDefault();var e=L.enter(t.target);e&&(E(t)?y.startDragging(_.FILE,null):T(t)&&y.startDragging(_.URL,null))}function g(t){u(t);var e=i(t);y.drag(e),D&&(t.dataTransfer.dropEffect=D,D=null),h&&I()&&o()&&t.preventDefault()}function l(t){u(t);var e=L.leave(t.target);e&&a(t)&&y.endDragging()}function p(t){u(t),L.reset(),a(t)&&y.endDragging(),s()}var h,d,v,m,D,y=n(19),x=n(10),_=n(21),w=n(23),E=n(11),T=n(13),b=n(37),A=n(75),I=n(45),O=1,L=new w,C={setup:function(){"undefined"!=typeof window&&(window.addEventListener("dragstart",c),window.addEventListener("dragenter",f),window.addEventListener("dragover",g),window.addEventListener("dragleave",l),window.addEventListener("drop",p))},teardown:function(){"undefined"!=typeof window&&(window.removeEventListener("dragstart",c),window.removeEventListener("dragenter",f),window.removeEventListener("dragover",g),window.removeEventListener("dragleave",l),window.removeEventListener("drop",p))},beginDrag:function(t,e,n,i,o,a,u){var c=e.nativeEvent,f=c.dataTransfer,g=c.target;b(f,n,i,o,a,u),d=t,h=g,v=r(g),m=!1,window.addEventListener("mousemove",s,!0)},endDrag:function(){h=null,d=null,v=null,m=!1,window.removeEventListener("mousemove",s,!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 i(e)}};t.exports=C},function(t,e,n){"use strict";t.exports={HTML5:n(30)}},function(t,e,n){"use strict";var r=n(10),i=n(9),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,u=null,c=null;return t&&e&&(o=!0,s=r.getDraggedItemType(),a=r.getDraggedItem(),u={x:t.x-n.x,y:t.y-n.y},c={x:e.x-n.x,y:e.y-n.y}),{isDragging:o,draggedItemType:s,draggedItem:a,initialOffset:u,currentOffset:c}},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(17),i=n(29),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(29),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(9),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,u){try{t.setData("application/json",{})}catch(c){}if(i(n)&&t.setDragImage){var f=o(e,n,r,a);t.setDragImage(n,f.x,f.y)}t.effectAllowed=s(u)}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:u.getDraggedItem(),draggedItemType:u.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,c)},componentDidMount:function(){e(this),u.addChangeListener(this.handleStoreChangeInDragDropMixin)},componentWillUnmount:function(){n(this),u.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(!u.isDragging()&&o(this)){var c,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);c={x:y.x-D.left,y:y.y-D.top},p||(p=v),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,c,d),a.startDragging(e,l,d,y,c),setTimeout(function(){r.isMounted()&&u.getDraggedItem()===l&&r.setState({ownDraggedItemType:e})})}},handleDragEnd:function(e){t.endDrag(this);var n=this._dragSources[e].endDrag,r=u.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=u.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].over;r(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=!!u.getDropEffect();n||(n=v(e)),this._monitor.reset(),o||a.recordDrop(i),this.setState({currentDropEffect:null}),r(this,n,o,u.getDropEffect())}}}}var a=n(19),u=n(10),c=n(36),f=n(23),g=n(7),l=n(34),p=n(35),h=n(11),d=n(13),v=n(40),m=n(17),D=n(16),y=n(69),x=n(5),_=n(2);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(11),o=n(13);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(7);t.exports=r},function(t,e,n){"use strict";function r(t,e,n,r){n=n||{};var a=t.offsetWidth,u=t.offsetHeight,c=e instanceof Image,f=c?e.width:a,g=c?e.height:u,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/u;break;case o.BOTTOM:d=g-g*(1-d/u)}return s()&&(d+=(window.devicePixelRatio-1)*g),{x:h,y:d}}var i=n(20),o=n(22),s=n(12);t.exports=r},function(t,e,n){"use strict";function r(){return i()||o()?window.devicePixelRatio:1}var i=n(44),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(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 u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,s,a],f=0;u=new Error("Invariant Violation: "+e.replace(/%s/g,function(){return c[f++]}))}throw u.framesToPop=1,u}};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 u=r[s],c=t[u],f=n(c,e[u],u,t,e);(f===f?f===c:c!==c)&&("undefined"!=typeof c||u in t)||(t[u]=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,u=i,c=!0,f=c&&e.length>=200?s(e):null,g=e.length;f&&(u=o,c=!1,e=f);t:for(;++a<n;){var l=t[a];if(c&&l===l){for(var p=g;p--;)if(e[p]===l)continue t;r.push(l)}else u(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,u){for(var c=(u||0)-1,f=t.length,g=-1,l=[];++c<f;){var p=t[c];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(15),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,u=!0,c=u&&a>=200,f=c?s():null,g=[];f?(r=o,u=!1):(c=!1,f=e?[]:g);t:for(;++n<a;){var l=t[n],p=e?e(l,n,t):l;if(u&&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||c)&&f.push(p),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(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,u=o(a)&&i(e,a);else u="string"==r&&e in n;if(u){var c=n[e];return t===t?t===c:c!==c}return!1}var i=n(14),o=n(1),s=n(2);t.exports=r},function(t,e,n){function r(t){for(var e=u(t),n=e.length,r=n&&t.length,f=r&&a(r)&&(o(t)||c.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(15),o=n(5),s=n(14),a=n(1),u=n(71),c=n(28),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,u=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=u},function(t,e,n){function r(t){if(null==t)return[];u(t)||(t=Object(t));var e=t.length;e=e&&a(e)&&(o(t)||c.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(15),o=n(5),s=n(14),a=n(1),u=n(2),c=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(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,u,c;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),u=1;s>u;u++)a[u-1]=arguments[u];r.apply(this,a)}else if(i(r)){for(s=arguments.length,a=new Array(s-1),u=1;s>u;u++)a[u-1]=arguments[u];for(c=r.slice(),s=c.length,u=0;s>u;u++)c[u].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}}])}); |
'use strict'; | ||
var React = require('react'), | ||
{ PureRenderMixin } = require('react/addons'), | ||
{ PropTypes } = React; | ||
import React, { PropTypes } from 'react'; | ||
import PureRenderMixin from 'react/lib/ReactComponentWithPureRenderMixin'; | ||
var styles = { | ||
box: { | ||
border: '1px dashed gray', | ||
padding: '0.5rem', | ||
display: 'inline-block' | ||
} | ||
const styles = { | ||
border: '1px dashed gray', | ||
padding: '0.5rem', | ||
display: 'inline-block' | ||
}; | ||
var Box = React.createClass({ | ||
const Box = React.createClass({ | ||
mixins: [PureRenderMixin], | ||
@@ -23,5 +20,7 @@ | ||
render() { | ||
const { title } = this.props; | ||
return ( | ||
<div style={styles.box}> | ||
{this.props.title} | ||
<div style={styles}> | ||
{title} | ||
</div> | ||
@@ -32,2 +31,2 @@ ); | ||
module.exports = Box; | ||
export default Box; |
'use strict'; | ||
var React = require('react'), | ||
Box = require('./Box'), | ||
{ PureRenderMixin } = require('react/addons'), | ||
{ PropTypes } = React; | ||
import React, { PropTypes } from 'react'; | ||
import PureRenderMixin from 'react/lib/ReactComponentWithPureRenderMixin'; | ||
import Box from './Box'; | ||
var styles = { | ||
boxDragPreview: (props, state) => ({ | ||
backgroundColor: state.tickTock ? 'white' : 'yellow', | ||
display: 'inline-block', | ||
transform: 'rotate(-7deg)', | ||
WebkitTransform: 'rotate(-7deg)' | ||
}) | ||
const styles = { | ||
display: 'inline-block', | ||
transform: 'rotate(-7deg)', | ||
WebkitTransform: 'rotate(-7deg)' | ||
}; | ||
var BoxDragPreview = React.createClass({ | ||
const BoxDragPreview = React.createClass({ | ||
mixins: [PureRenderMixin], | ||
@@ -43,6 +39,11 @@ | ||
render() { | ||
var { title } = this.props; | ||
const { title } = this.props; | ||
const { tickTock } = this.state; | ||
const backgroundColor = tickTock ? 'white' : 'yellow'; | ||
return ( | ||
<div style={styles.boxDragPreview(this.props, this.state)}> | ||
<div style={{ | ||
...styles, | ||
backgroundColor | ||
}}> | ||
<Box title={title} /> | ||
@@ -54,2 +55,2 @@ </div> | ||
module.exports = BoxDragPreview; | ||
export default BoxDragPreview; |
'use strict'; | ||
var React = require('react'), | ||
update = require('react/lib/update'), | ||
ItemTypes = require('./ItemTypes'), | ||
DraggableBox = require('./DraggableBox'), | ||
snapToGrid = require('./snapToGrid'), | ||
{ PropTypes } = React, | ||
{ PureRenderMixin } = require('react/addons'), | ||
{ DragDropMixin, DragLayerMixin } = require('react-dnd'); | ||
import React, { PropTypes } from 'react'; | ||
import PureRenderMixin from 'react/lib/ReactComponentWithPureRenderMixin'; | ||
import update from 'react/lib/update'; | ||
import ItemTypes from './ItemTypes'; | ||
import DraggableBox from './DraggableBox'; | ||
import snapToGrid from './snapToGrid'; | ||
import { DragDropMixin } from 'react-dnd'; | ||
var styles = { | ||
container: { | ||
width: 300, | ||
height: 300, | ||
border: '1px solid black', | ||
position: 'relative' | ||
} | ||
const styles = { | ||
width: 300, | ||
height: 300, | ||
border: '1px solid black', | ||
position: 'relative' | ||
}; | ||
var Container = React.createClass({ | ||
function makeDropTarget(context) { | ||
return { | ||
acceptDrop(component, item) { | ||
const delta = context.getCurrentOffsetDelta(); | ||
let left = Math.round(item.left + delta.x); | ||
let top = Math.round(item.top + delta.y); | ||
if (component.props.snapToGrid) { | ||
[left, top] = snapToGrid(left, top); | ||
} | ||
component.moveBox(item.id, left, top); | ||
} | ||
}; | ||
} | ||
const Container = React.createClass({ | ||
mixins: [DragDropMixin, PureRenderMixin], | ||
@@ -32,3 +45,3 @@ | ||
'a': { top: 20, left: 80, title: 'Drag me around' }, | ||
'b': { top: 180, left: 20, title: 'Drag me too' }, | ||
'b': { top: 180, left: 20, title: 'Drag me too' } | ||
} | ||
@@ -41,15 +54,3 @@ }; | ||
register(ItemTypes.BOX, { | ||
dropTarget: { | ||
acceptDrop(component, item) { | ||
var delta = context.getCurrentOffsetDelta(), | ||
left = Math.round(item.left + delta.x), | ||
top = Math.round(item.top + delta.y); | ||
if (component.props.snapToGrid) { | ||
[left, top] = snapToGrid(left, top); | ||
} | ||
component.moveBox(item.id, left, top); | ||
} | ||
} | ||
dropTarget: makeDropTarget(context) | ||
}); | ||
@@ -81,6 +82,6 @@ } | ||
render() { | ||
var { boxes } = this.state; | ||
const { boxes } = this.state; | ||
return ( | ||
<div style={styles.container} | ||
<div style={styles} | ||
{...this.dropTargetFor(ItemTypes.BOX)}> | ||
@@ -96,2 +97,2 @@ {Object | ||
module.exports = Container; | ||
export default Container; |
'use strict'; | ||
var React = require('react'), | ||
ItemTypes = require('./ItemTypes'), | ||
getEmptyImage = require('./getEmptyImage'), | ||
Box = require('./Box'), | ||
{ PropTypes } = React, | ||
{ PureRenderMixin } = require('react/addons'), | ||
{ DragDropMixin, DropEffects } = require('react-dnd'); | ||
import React, { PropTypes } from 'react'; | ||
import PureRenderMixin from 'react/lib/ReactComponentWithPureRenderMixin'; | ||
import ItemTypes from './ItemTypes'; | ||
import getEmptyImage from './getEmptyImage'; | ||
import Box from './Box'; | ||
import { DragDropMixin, DropEffects } from 'react-dnd'; | ||
var styles = { | ||
draggableBox: (props) => { | ||
var { left, top } = props, | ||
transform = `translate3d(${left}px, ${top}px, 0)`; | ||
const dragSource = { | ||
beginDrag(component) { | ||
return { | ||
position: 'absolute', | ||
transform: transform, | ||
WebkitTransform: transform | ||
effectAllowed: DropEffects.MOVE, | ||
dragPreview: getEmptyImage(), | ||
item: component.props | ||
}; | ||
@@ -24,3 +20,14 @@ } | ||
var DraggableBox = React.createClass({ | ||
function getStyles(props) { | ||
const { left, top } = props; | ||
const transform = `translate3d(${left}px, ${top}px, 0)`; | ||
return { | ||
position: 'absolute', | ||
transform: transform, | ||
WebkitTransform: transform | ||
}; | ||
} | ||
const DraggableBox = React.createClass({ | ||
mixins: [DragDropMixin, PureRenderMixin], | ||
@@ -32,3 +39,3 @@ | ||
left: PropTypes.number.isRequired, | ||
top: PropTypes.number.isRequired, | ||
top: PropTypes.number.isRequired | ||
}, | ||
@@ -38,13 +45,3 @@ | ||
configureDragDrop(register) { | ||
register(ItemTypes.BOX, { | ||
dragSource: { | ||
beginDrag(component) { | ||
return { | ||
effectAllowed: DropEffects.MOVE, | ||
dragPreview: getEmptyImage(), | ||
item: component.props | ||
}; | ||
} | ||
} | ||
}); | ||
register(ItemTypes.BOX, { dragSource }); | ||
} | ||
@@ -54,4 +51,4 @@ }, | ||
render() { | ||
var { title } = this.props; | ||
var { isDragging } = this.getDragState(ItemTypes.BOX); | ||
const { title } = this.props; | ||
const { isDragging } = this.getDragState(ItemTypes.BOX); | ||
@@ -64,3 +61,3 @@ if (isDragging) { | ||
<div {...this.dragSourceFor(ItemTypes.BOX)} | ||
style={styles.draggableBox(this.props)}> | ||
style={getStyles(this.props)}> | ||
<Box title={title} /> | ||
@@ -72,2 +69,2 @@ </div> | ||
module.exports = DraggableBox; | ||
export default DraggableBox; |
'use strict'; | ||
var React = require('react'), | ||
ItemTypes = require('./ItemTypes'), | ||
BoxDragPreview = require('./BoxDragPreview'), | ||
snapToGrid = require('./snapToGrid'), | ||
{ DragLayerMixin } = require('react-dnd'), | ||
{ PureRenderMixin } = require('react/addons'), | ||
{ PropTypes } = React; | ||
import React, { PropTypes } from 'react'; | ||
import PureRenderMixin from 'react/lib/ReactComponentWithPureRenderMixin'; | ||
import ItemTypes from './ItemTypes'; | ||
import BoxDragPreview from './BoxDragPreview'; | ||
import snapToGrid from './snapToGrid'; | ||
import { DragLayerMixin } from 'react-dnd'; | ||
var styles = { | ||
dragLayer: { | ||
position: 'fixed', | ||
pointerEvents: 'none', | ||
zIndex: 100, | ||
left: 0, | ||
top: 0, | ||
width:'100%', | ||
height: '100%' | ||
}, | ||
const layerStyles = { | ||
position: 'fixed', | ||
pointerEvents: 'none', | ||
zIndex: 100, | ||
left: 0, | ||
top: 0, | ||
width: '100%', | ||
height: '100%' | ||
}; | ||
draggedItem: (props, state) => { | ||
var { x, y } = state.currentOffset; | ||
function getItemStyles(props, state) { | ||
let { x, y } = state.currentOffset; | ||
if (props.snapToGrid) { | ||
x -= state.initialOffset.x; | ||
y -= state.initialOffset.y; | ||
if (props.snapToGrid) { | ||
x -= state.initialOffset.x; | ||
y -= state.initialOffset.y; | ||
[x, y] = snapToGrid(x, y); | ||
[x, y] = snapToGrid(x, y); | ||
x += state.initialOffset.x; | ||
y += state.initialOffset.y; | ||
} | ||
x += state.initialOffset.x; | ||
y += state.initialOffset.y; | ||
} | ||
var transform = `translate(${x}px, ${y}px)`; | ||
const transform = `translate(${x}px, ${y}px)`; | ||
return { | ||
transform: transform, | ||
WebkitTransform: transform | ||
}; | ||
} | ||
return { | ||
transform: transform, | ||
WebkitTransform: transform | ||
}; | ||
} | ||
}; | ||
var DragLayer = React.createClass({ | ||
const DragLayer = React.createClass({ | ||
mixins: [DragLayerMixin, PureRenderMixin], | ||
@@ -61,3 +57,3 @@ | ||
render() { | ||
var { | ||
const { | ||
draggedItem, | ||
@@ -73,4 +69,4 @@ draggedItemType, | ||
return ( | ||
<div style={styles.dragLayer}> | ||
<div style={styles.draggedItem(this.props, this.state)}> | ||
<div style={layerStyles}> | ||
<div style={getItemStyles(this.props, this.state)}> | ||
{this.renderItem(draggedItemType, draggedItem)} | ||
@@ -83,2 +79,2 @@ </div> | ||
module.exports = DragLayer; | ||
export default DragLayer; |
'use strict'; | ||
var TRANSPARENT_PIXEL_SRC = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==', | ||
emptyImg = document.createElement('img'); | ||
const TRANSPARENT_PIXEL_SRC = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='; | ||
const emptyImg = document.createElement('img'); | ||
emptyImg.src = TRANSPARENT_PIXEL_SRC; | ||
function getEmptyImage() { | ||
export default function getEmptyImage() { | ||
return emptyImg; | ||
} | ||
module.exports = getEmptyImage; | ||
} |
'use strict'; | ||
var React = require('react'), | ||
Container = require('./Container'), | ||
DragLayer = require('./DragLayer'), | ||
LinkedStateMixin = require('react/lib/LinkedStateMixin'); | ||
import React from 'react'; | ||
import LinkedStateMixin from 'react/lib/LinkedStateMixin'; | ||
import Container from './Container'; | ||
import DragLayer from './DragLayer'; | ||
var DragAroundCustom = React.createClass({ | ||
const DragAroundCustom = React.createClass({ | ||
mixins: [LinkedStateMixin], | ||
@@ -19,6 +19,8 @@ | ||
render() { | ||
const { snapToGridAfterDrop, snapToGridWhileDragging } = this.state; | ||
return ( | ||
<div> | ||
<Container snapToGrid={this.state.snapToGridAfterDrop} /> | ||
<DragLayer snapToGrid={this.state.snapToGridWhileDragging} /> | ||
<Container snapToGrid={snapToGridAfterDrop} /> | ||
<DragLayer snapToGrid={snapToGridWhileDragging} /> | ||
<p> | ||
@@ -57,2 +59,2 @@ <input type='checkbox' | ||
module.exports = DragAroundCustom; | ||
export default DragAroundCustom; |
'use strict'; | ||
module.exports = { | ||
export default { | ||
BOX: 'box' | ||
}; |
'use strict'; | ||
function snapToGrid(x, y) { | ||
export default function snapToGrid(x, y) { | ||
x = Math.round(x / 32) * 32; | ||
@@ -8,4 +8,2 @@ y = Math.round(y / 32) * 32; | ||
return [x, y]; | ||
} | ||
module.exports = snapToGrid; | ||
} |
'use strict'; | ||
var React = require('react'), | ||
ItemTypes = require('./ItemTypes'), | ||
{ PropTypes } = React, | ||
{ DragDropMixin, DropEffects } = require('react-dnd'); | ||
import React, { PropTypes } from 'react'; | ||
import ItemTypes from './ItemTypes'; | ||
import { DragDropMixin, DropEffects } from 'react-dnd'; | ||
var Box = React.createClass({ | ||
const dragSource = { | ||
beginDrag(component) { | ||
return { | ||
effectAllowed: DropEffects.MOVE, | ||
item: component.props | ||
}; | ||
} | ||
}; | ||
const style = { | ||
position: 'absolute', | ||
border: '1px dashed gray', | ||
padding: '0.5rem' | ||
}; | ||
const Box = React.createClass({ | ||
mixins: [DragDropMixin], | ||
@@ -20,12 +34,3 @@ | ||
configureDragDrop(register) { | ||
register(ItemTypes.BOX, { | ||
dragSource: { | ||
beginDrag(component) { | ||
return { | ||
effectAllowed: DropEffects.MOVE, | ||
item: component.props | ||
}; | ||
} | ||
} | ||
}); | ||
register(ItemTypes.BOX, { dragSource }); | ||
} | ||
@@ -35,4 +40,4 @@ }, | ||
render() { | ||
var { isDragging } = this.getDragState(ItemTypes.BOX), | ||
{ hideSourceOnDrag } = this.props; | ||
const { hideSourceOnDrag, left, top, children } = this.props; | ||
const { isDragging } = this.getDragState(ItemTypes.BOX); | ||
@@ -46,9 +51,7 @@ if (isDragging && hideSourceOnDrag) { | ||
style={{ | ||
position: 'absolute', | ||
left: this.props.left, | ||
top: this.props.top, | ||
border: '1px dashed gray', | ||
padding: '0.5rem' | ||
...style, | ||
left, | ||
top | ||
}}> | ||
{this.props.children} | ||
{children} | ||
</div> | ||
@@ -59,2 +62,2 @@ ); | ||
module.exports = Box; | ||
export default Box; |
'use strict'; | ||
var React = require('react'), | ||
update = require('react/lib/update'), | ||
ItemTypes = require('./ItemTypes'), | ||
Box = require('./Box'), | ||
{ PropTypes } = React, | ||
{ DragDropMixin } = require('react-dnd'); | ||
import React, { PropTypes } from 'react'; | ||
import update from 'react/lib/update'; | ||
import ItemTypes from './ItemTypes'; | ||
import Box from './Box'; | ||
import { DragDropMixin } from'react-dnd'; | ||
var Container = React.createClass({ | ||
function makeDropTarget(context) { | ||
return { | ||
acceptDrop(component, item) { | ||
const delta = context.getCurrentOffsetDelta(); | ||
const left = Math.round(item.left + delta.x); | ||
const top = Math.round(item.top + delta.y); | ||
component.moveBox(item.id, left, top); | ||
} | ||
}; | ||
} | ||
const styles = { | ||
width: 300, | ||
height: 300, | ||
border: '1px solid black', | ||
position: 'relative' | ||
}; | ||
const Container = React.createClass({ | ||
mixins: [DragDropMixin], | ||
@@ -21,3 +39,3 @@ | ||
'a': { top: 20, left: 80, title: 'Drag me around' }, | ||
'b': { top: 180, left: 20, title: 'Drag me too' }, | ||
'b': { top: 180, left: 20, title: 'Drag me too' } | ||
} | ||
@@ -30,11 +48,3 @@ }; | ||
register(ItemTypes.BOX, { | ||
dropTarget: { | ||
acceptDrop(component, item) { | ||
var delta = context.getCurrentOffsetDelta(), | ||
left = Math.round(item.left + delta.x), | ||
top = Math.round(item.top + delta.y); | ||
component.moveBox(item.id, left, top); | ||
} | ||
} | ||
dropTarget: makeDropTarget(context) | ||
}); | ||
@@ -45,28 +55,24 @@ } | ||
moveBox(id, left, top) { | ||
var stateUpdate = { | ||
boxes: {} | ||
}; | ||
stateUpdate.boxes[id] = { | ||
$merge: { | ||
left: left, | ||
top: top | ||
this.setState(update(this.state, { | ||
boxes: { | ||
[id]: { | ||
$merge: { | ||
left: left, | ||
top: top | ||
} | ||
} | ||
} | ||
}; | ||
this.setState(update(this.state, stateUpdate)); | ||
})); | ||
}, | ||
render() { | ||
const { hideSourceOnDrag } = this.props; | ||
const { boxes} = this.state; | ||
return ( | ||
<div {...this.dropTargetFor(ItemTypes.BOX)} | ||
style={{ | ||
width: 300, | ||
height: 300, | ||
border: '1px solid black', | ||
position: 'relative' | ||
}}> | ||
style={styles}> | ||
{Object.keys(this.state.boxes).map(key => { | ||
var box = this.state.boxes[key]; | ||
{Object.keys(boxes).map(key => { | ||
const { left, top, title } = boxes[key]; | ||
@@ -76,6 +82,6 @@ return ( | ||
id={key} | ||
left={box.left} | ||
top={box.top} | ||
hideSourceOnDrag={this.props.hideSourceOnDrag}> | ||
{box.title} | ||
left={left} | ||
top={top} | ||
hideSourceOnDrag={hideSourceOnDrag}> | ||
{title} | ||
</Box> | ||
@@ -90,2 +96,2 @@ ); | ||
module.exports = Container; | ||
export default Container; |
'use strict'; | ||
var React = require('react'), | ||
Container = require('./Container'), | ||
LinkedStateMixin = require('react/lib/LinkedStateMixin'), | ||
{ Link } = require('react-router'); | ||
import React from 'react'; | ||
import LinkedStateMixin from 'react/lib/LinkedStateMixin'; | ||
import Container from './Container'; | ||
import { Link } from 'react-router'; | ||
var DragAroundNaive = React.createClass({ | ||
const DragAroundNaive = React.createClass({ | ||
mixins: [LinkedStateMixin], | ||
@@ -18,5 +18,7 @@ | ||
render() { | ||
const { hideSourceOnDrag } = this.state; | ||
return ( | ||
<div> | ||
<Container hideSourceOnDrag={this.state.hideSourceOnDrag} /> | ||
<Container hideSourceOnDrag={hideSourceOnDrag} /> | ||
<p> | ||
@@ -52,2 +54,2 @@ <input type='checkbox' | ||
module.exports = DragAroundNaive; | ||
export default DragAroundNaive; |
'use strict'; | ||
module.exports = { | ||
export default { | ||
BOX: 'box' | ||
}; |
'use strict'; | ||
var React = require('react'), | ||
makeDustbin = require('./makeDustbin'), | ||
makeItem = require('./makeItem'), | ||
ItemTypes = require('./ItemTypes'), | ||
{ NativeDragItemTypes } = require('react-dnd'); | ||
import React from 'react'; | ||
import makeDustbin from './makeDustbin'; | ||
import makeItem from './makeItem'; | ||
import ItemTypes from './ItemTypes'; | ||
import { NativeDragItemTypes } from 'react-dnd'; | ||
var Container = React.createClass({ | ||
const Container = React.createClass({ | ||
renderDustbin(accepts) { | ||
var Dustbin = makeDustbin(accepts); | ||
const Dustbin = makeDustbin(accepts); | ||
return <Dustbin />; | ||
@@ -16,3 +16,3 @@ }, | ||
renderItem(name, dropType) { | ||
var Item = makeItem(dropType); | ||
const Item = makeItem(dropType); | ||
return <Item name={name} />; | ||
@@ -43,2 +43,2 @@ }, | ||
module.exports = Container; | ||
export default Container; |
'use strict'; | ||
var React = require('react'), | ||
Container = require('./Container'); | ||
import React from 'react'; | ||
import Container from './Container'; | ||
var DustbinSorted = React.createClass({ | ||
const DustbinSorted = React.createClass({ | ||
render() { | ||
@@ -20,2 +20,2 @@ return ( | ||
module.exports = DustbinSorted; | ||
export default DustbinSorted; |
'use strict'; | ||
module.exports = { | ||
export default { | ||
FOOD: 'food', | ||
@@ -5,0 +5,0 @@ GLASS: 'glass', |
'use strict'; | ||
var React = require('react'), | ||
ItemTypes = require('./ItemTypes'), | ||
{ DragDropMixin } = require('react-dnd'), | ||
{ PropTypes } = React; | ||
import React from 'react'; | ||
import { DragDropMixin } from 'react-dnd'; | ||
function makeDustbin(accepts) { | ||
var Dustbin = React.createClass({ | ||
const dropTarget = { | ||
acceptDrop(component, item) { | ||
component.setState({ | ||
lastDroppedItem: item | ||
}); | ||
} | ||
}; | ||
const style = { | ||
height: '12rem', | ||
width: '12rem', | ||
color: 'white', | ||
padding: '2rem', | ||
margin: '0.5rem', | ||
textAlign: 'center', | ||
float: 'left' | ||
}; | ||
export default function makeDustbin(accepts) { | ||
const Dustbin = React.createClass({ | ||
mixins: [DragDropMixin], | ||
@@ -20,14 +36,4 @@ | ||
configureDragDrop(register) { | ||
var dropTarget = { | ||
acceptDrop(component, item) { | ||
component.setState({ | ||
lastDroppedItem: item | ||
}); | ||
} | ||
}; | ||
accepts.forEach(itemType => { | ||
register(itemType, { | ||
dropTarget: dropTarget | ||
}); | ||
register(itemType, { dropTarget }); | ||
}); | ||
@@ -38,5 +44,6 @@ } | ||
render() { | ||
var dropStates = accepts.map(this.getDropState), | ||
backgroundColor = '#222'; | ||
const { lastDroppedItem } = this.state; | ||
const dropStates = accepts.map(this.getDropState); | ||
let backgroundColor = '#222'; | ||
if (dropStates.some(s => s.isHovering)) { | ||
@@ -51,10 +58,4 @@ backgroundColor = 'darkgreen'; | ||
style={{ | ||
height: '12rem', | ||
width: '12rem', | ||
color: 'white', | ||
backgroundColor: backgroundColor, | ||
padding: '2rem', | ||
margin: '0.5rem', | ||
textAlign: 'center', | ||
float: 'left' | ||
...style, | ||
backgroundColor | ||
}}> | ||
@@ -67,4 +68,4 @@ | ||
{this.state.lastDroppedItem && | ||
<p>Last dropped: {JSON.stringify(this.state.lastDroppedItem)}</p> | ||
{lastDroppedItem && | ||
<p>Last dropped: {JSON.stringify(lastDroppedItem)}</p> | ||
} | ||
@@ -77,4 +78,2 @@ </div> | ||
return Dustbin; | ||
} | ||
module.exports = makeDustbin; | ||
} |
'use strict'; | ||
var React = require('react'), | ||
ItemTypes = require('./ItemTypes'), | ||
{ PropTypes } = React, | ||
{ DragDropMixin } = require('react-dnd'); | ||
import React, { PropTypes } from 'react'; | ||
import { DragDropMixin } from 'react-dnd'; | ||
function makeItem(dropType) { | ||
var Item = React.createClass({ | ||
const dragSource = { | ||
beginDrag(component) { | ||
return { | ||
item: { | ||
name: component.props.name | ||
} | ||
}; | ||
}, | ||
endDrag(component, effect) { | ||
if (effect) { | ||
component.setState({ | ||
hasDropped: true | ||
}); | ||
} | ||
} | ||
}; | ||
const style = { | ||
border: '1px dashed gray', | ||
backgroundColor: 'white', | ||
padding: '0.5rem', | ||
margin: '0.5rem', | ||
maxWidth: 80, | ||
float: 'left' | ||
}; | ||
export default function makeItem(dropType) { | ||
const Item = React.createClass({ | ||
mixins: [DragDropMixin], | ||
@@ -24,21 +49,3 @@ | ||
configureDragDrop(register) { | ||
register(dropType, { | ||
dragSource: { | ||
beginDrag(component) { | ||
return { | ||
item: { | ||
name: component.props.name, | ||
} | ||
}; | ||
}, | ||
endDrag(component, effect) { | ||
if (effect) { | ||
component.setState({ | ||
hasDropped: true | ||
}); | ||
} | ||
} | ||
} | ||
}); | ||
register(dropType, { dragSource }); | ||
} | ||
@@ -48,4 +55,6 @@ }, | ||
render() { | ||
var { hasDropped } = this.state, | ||
{ isDragging } = this.getDragState(dropType); | ||
const { name } = this.props; | ||
const { hasDropped } = this.state; | ||
const { isDragging } = this.getDragState(dropType); | ||
const opacity = isDragging ? 0.4 : 1; | ||
@@ -55,14 +64,9 @@ return ( | ||
style={{ | ||
border: '1px dashed gray', | ||
backgroundColor: 'white', | ||
padding: '0.5rem', | ||
margin: '0.5rem', | ||
opacity: isDragging ? 0.4 : 1, | ||
maxWidth: 80, | ||
float: 'left' | ||
...style, | ||
opacity | ||
}}> | ||
{hasDropped ? | ||
<s>{this.props.name}</s> : | ||
this.props.name | ||
<s>{name}</s> : | ||
name | ||
} | ||
@@ -75,4 +79,2 @@ </div> | ||
return Item; | ||
} | ||
module.exports = makeItem; | ||
} |
'use strict'; | ||
var React = require('react'), | ||
Dustbin = require('./Dustbin'), | ||
Item = require('./Item'); | ||
import React from 'react'; | ||
import Dustbin from './Dustbin'; | ||
import Item from './Item'; | ||
var Container = React.createClass({ | ||
const Container = React.createClass({ | ||
render() { | ||
@@ -22,2 +22,2 @@ return ( | ||
module.exports = Container; | ||
export default Container; |
'use strict'; | ||
var React = require('react'), | ||
ItemTypes = require('./ItemTypes'), | ||
{ DragDropMixin } = require('react-dnd'); | ||
import React from 'react'; | ||
import ItemTypes from './ItemTypes'; | ||
import { DragDropMixin } from 'react-dnd'; | ||
var Dustbin = React.createClass({ | ||
const itemDropTarget = { | ||
acceptDrop(component, item) { | ||
window.alert('You dropped ' + item.name + '!'); | ||
} | ||
}; | ||
const style = { | ||
height: '12rem', | ||
width: '12rem', | ||
color: 'white', | ||
padding: '2rem', | ||
textAlign: 'center' | ||
}; | ||
const Dustbin = React.createClass({ | ||
mixins: [DragDropMixin], | ||
@@ -13,7 +27,3 @@ | ||
register(ItemTypes.ITEM, { | ||
dropTarget: { | ||
acceptDrop(component, item) { | ||
window.alert('You dropped ' + item.name + '!'); | ||
} | ||
} | ||
dropTarget: itemDropTarget | ||
}); | ||
@@ -24,5 +34,5 @@ } | ||
render() { | ||
var dropState = this.getDropState(ItemTypes.ITEM), | ||
backgroundColor = '#222'; | ||
const dropState = this.getDropState(ItemTypes.ITEM); | ||
let backgroundColor = '#222'; | ||
if (dropState.isHovering) { | ||
@@ -37,8 +47,4 @@ backgroundColor = 'darkgreen'; | ||
style={{ | ||
height: '12rem', | ||
width: '12rem', | ||
color: 'white', | ||
backgroundColor: backgroundColor, | ||
padding: '2rem', | ||
textAlign: 'center' | ||
...style, | ||
backgroundColor | ||
}}> | ||
@@ -55,2 +61,2 @@ | ||
module.exports = Dustbin; | ||
export default Dustbin; |
'use strict'; | ||
var React = require('react'), | ||
Container = require('./Container'); | ||
import React from 'react'; | ||
import Container from './Container'; | ||
var DustbinSimple = React.createClass({ | ||
const DustbinSimple = React.createClass({ | ||
render() { | ||
@@ -21,2 +21,2 @@ return ( | ||
module.exports = DustbinSimple; | ||
export default DustbinSimple; |
'use strict'; | ||
var React = require('react'), | ||
ItemTypes = require('./ItemTypes'), | ||
{ PropTypes } = React, | ||
{ DragDropMixin } = require('react-dnd'); | ||
import React, { PropTypes } from 'react'; | ||
import ItemTypes from './ItemTypes'; | ||
import { DragDropMixin } from 'react-dnd'; | ||
var Item = React.createClass({ | ||
const itemDragSource = { | ||
beginDrag(component) { | ||
return { | ||
item: { | ||
name: component.props.name | ||
} | ||
}; | ||
} | ||
}; | ||
const style = { | ||
border: '1px dashed gray', | ||
backgroundColor: 'white', | ||
padding: '0.5rem', | ||
margin: '0.5rem', | ||
maxWidth: 80 | ||
}; | ||
const Item = React.createClass({ | ||
mixins: [DragDropMixin], | ||
@@ -18,11 +35,3 @@ | ||
register(ItemTypes.ITEM, { | ||
dragSource: { | ||
beginDrag(component) { | ||
return { | ||
item: { | ||
name: component.props.name | ||
} | ||
}; | ||
} | ||
} | ||
dragSource: itemDragSource | ||
}); | ||
@@ -33,3 +42,5 @@ } | ||
render() { | ||
var { isDragging } = this.getDragState(ItemTypes.ITEM); | ||
const { name } = this.props; | ||
const { isDragging } = this.getDragState(ItemTypes.ITEM); | ||
const opacity = isDragging ? 0.4 : 1; | ||
@@ -39,10 +50,6 @@ return ( | ||
style={{ | ||
border: '1px dashed gray', | ||
backgroundColor: 'white', | ||
padding: '0.5rem', | ||
margin: '0.5rem', | ||
opacity: isDragging ? 0.4 : 1, | ||
maxWidth: 80 | ||
...style, | ||
opacity | ||
}}> | ||
{this.props.name} | ||
{name} | ||
</div> | ||
@@ -53,2 +60,2 @@ ); | ||
module.exports = Item; | ||
export default Item; |
'use strict'; | ||
module.exports = { | ||
export default { | ||
ITEM: 'item' | ||
}; |
'use strict'; | ||
module.exports = { | ||
export default { | ||
YELLOW: 'yellow', | ||
BLUE: 'blue' | ||
}; |
'use strict'; | ||
var React = require('react'), | ||
makeSource = require('./makeSource'), | ||
Colors = require('./Colors'), | ||
Target = require('./Target'); | ||
import React from 'react'; | ||
import makeSource from './makeSource'; | ||
import Colors from './Colors'; | ||
import Target from './Target'; | ||
var Container = React.createClass({ | ||
const Container = React.createClass({ | ||
render() { | ||
var Yellow = makeSource(Colors.YELLOW), | ||
BlueSource = makeSource(Colors.BLUE); | ||
const YellowSource = makeSource(Colors.YELLOW); | ||
const BlueSource = makeSource(Colors.BLUE); | ||
@@ -17,8 +17,8 @@ return ( | ||
<BlueSource> | ||
<Yellow> | ||
<Yellow /> | ||
<YellowSource> | ||
<YellowSource /> | ||
<BlueSource /> | ||
</Yellow> | ||
</YellowSource> | ||
<BlueSource> | ||
<Yellow /> | ||
<YellowSource /> | ||
</BlueSource> | ||
@@ -36,2 +36,2 @@ </BlueSource> | ||
module.exports = Container; | ||
export default Container; |
'use strict'; | ||
var React = require('react'), | ||
Container = require('./Container'); | ||
import React from 'react'; | ||
import Container from './Container'; | ||
var NestingSources = React.createClass({ | ||
const NestingSources = React.createClass({ | ||
render() { | ||
@@ -20,2 +20,2 @@ return ( | ||
module.exports = NestingSources; | ||
export default NestingSources; |
'use strict'; | ||
var React = require('react'), | ||
Colors = require('./Colors'), | ||
LinkedStateMixin = require('react/lib/LinkedStateMixin'), | ||
{ DragDropMixin } = require('react-dnd'); | ||
import React from 'react'; | ||
import LinkedStateMixin from 'react/lib/LinkedStateMixin'; | ||
import Colors from './Colors'; | ||
import { DragDropMixin } from 'react-dnd'; | ||
function makeSource(sourceColor) { | ||
var dragSource = { | ||
canDrag(component) { | ||
return !component.state.forbidDrag; | ||
}, | ||
const dragSource = { | ||
canDrag(component) { | ||
return !component.state.forbidDrag; | ||
}, | ||
beginDrag() { | ||
return { | ||
item: { } | ||
}; | ||
} | ||
}; | ||
beginDrag() { | ||
return { | ||
item: { } | ||
}; | ||
} | ||
}; | ||
const style = { | ||
border: '1px dashed gray', | ||
padding: '0.5rem', | ||
margin: '0.5rem' | ||
}; | ||
export default function makeSource(sourceColor) { | ||
var Source = React.createClass({ | ||
@@ -26,5 +32,3 @@ mixins: [DragDropMixin, LinkedStateMixin], | ||
configureDragDrop(register) { | ||
register(sourceColor, { | ||
dragSource: dragSource | ||
}); | ||
register(sourceColor, { dragSource }); | ||
} | ||
@@ -40,5 +44,7 @@ }, | ||
render() { | ||
var { isDragging } = this.getDragState(sourceColor), | ||
backgroundColor; | ||
const { children } = this.props; | ||
const { isDragging } = this.getDragState(sourceColor); | ||
const opacity = isDragging ? 0.4 : 1; | ||
let backgroundColor; | ||
switch (sourceColor) { | ||
@@ -56,7 +62,5 @@ case Colors.YELLOW: | ||
style={{ | ||
border: '1px dashed gray', | ||
backgroundColor: backgroundColor, | ||
padding: '0.5rem', | ||
margin: '0.5rem', | ||
opacity: isDragging ? 0.4 : 1 | ||
...style, | ||
backgroundColor, | ||
opacity | ||
}}> | ||
@@ -69,3 +73,3 @@ | ||
{this.props.children} | ||
{children} | ||
</div> | ||
@@ -77,4 +81,2 @@ ); | ||
return Source; | ||
} | ||
module.exports = makeSource; | ||
} |
'use strict'; | ||
var React = require('react'), | ||
Colors = require('./Colors'), | ||
{ DragDropMixin } = require('react-dnd'); | ||
import React from 'react'; | ||
import Colors from './Colors'; | ||
import { DragDropMixin } from 'react-dnd'; | ||
@@ -17,3 +17,11 @@ function makeDropTarget(color) { | ||
var Target = React.createClass({ | ||
const style = { | ||
border: '1px dashed gray', | ||
height: '12rem', | ||
width: '12rem', | ||
padding: '2rem', | ||
textAlign: 'center' | ||
}; | ||
const Target = React.createClass({ | ||
mixins: [DragDropMixin], | ||
@@ -40,10 +48,10 @@ | ||
render() { | ||
var { lastDroppedColor } = this.state, | ||
blueDropState = this.getDropState(Colors.BLUE), | ||
yellowDropState = this.getDropState(Colors.YELLOW), | ||
isDragging = blueDropState.isDragging || yellowDropState.isDragging, | ||
isHovering = blueDropState.isHovering || yellowDropState.isHovering, | ||
backgroundColor = '#fff', | ||
opacity = isHovering ? 1 : 0.7; | ||
const { lastDroppedColor } = this.state; | ||
const blueDropState = this.getDropState(Colors.BLUE); | ||
const yellowDropState = this.getDropState(Colors.YELLOW); | ||
const isDragging = blueDropState.isDragging || yellowDropState.isDragging; | ||
const isHovering = blueDropState.isHovering || yellowDropState.isHovering; | ||
const opacity = isHovering ? 1 : 0.7; | ||
let backgroundColor = '#fff'; | ||
if (blueDropState.isDragging) { | ||
@@ -58,9 +66,5 @@ backgroundColor = 'lightblue'; | ||
style={{ | ||
backgroundColor: backgroundColor, | ||
opacity: opacity, | ||
border: '1px dashed gray', | ||
height: '12rem', | ||
width: '12rem', | ||
padding: '2rem', | ||
textAlign: 'center' | ||
...style, | ||
backgroundColor, | ||
opacity | ||
}}> | ||
@@ -78,2 +82,2 @@ | ||
module.exports = Target; | ||
export default Target; |
'use strict'; | ||
var React = require('react'), | ||
ItemTypes = require('./ItemTypes'), | ||
{ PropTypes } = React, | ||
{ DragDropMixin } = require('react-dnd'); | ||
import React, { PropTypes } from 'react'; | ||
import ItemTypes from './ItemTypes'; | ||
import { DragDropMixin } from 'react-dnd'; | ||
var Card = React.createClass({ | ||
const dragSource = { | ||
beginDrag(component) { | ||
return { | ||
item: { | ||
id: component.props.id | ||
} | ||
}; | ||
} | ||
}; | ||
const dropTarget = { | ||
over(component, item) { | ||
component.props.moveCard(item.id, component.props.id); | ||
} | ||
}; | ||
const style = { | ||
border: '1px dashed gray', | ||
backgroundColor: 'white', | ||
padding: '0.5rem', | ||
margin: '0.5rem' | ||
}; | ||
const Card = React.createClass({ | ||
mixins: [DragDropMixin], | ||
@@ -20,17 +42,4 @@ | ||
register(ItemTypes.CARD, { | ||
dragSource: { | ||
beginDrag(component) { | ||
return { | ||
item: { | ||
id: component.props.id | ||
} | ||
}; | ||
} | ||
}, | ||
dropTarget: { | ||
over(component, item) { | ||
component.props.moveCard(item.id, component.props.id); | ||
} | ||
} | ||
dragSource, | ||
dropTarget | ||
}); | ||
@@ -41,3 +50,5 @@ } | ||
render() { | ||
var { isDragging } = this.getDragState(ItemTypes.CARD); | ||
const { text } = this.props; | ||
const { isDragging } = this.getDragState(ItemTypes.CARD); | ||
const opacity = isDragging ? 0 : 1; | ||
@@ -48,9 +59,6 @@ return ( | ||
style={{ | ||
border: '1px dashed gray', | ||
backgroundColor: 'white', | ||
padding: '0.5rem', | ||
margin: '0.5rem', | ||
opacity: isDragging ? 0 : 1 | ||
...style, | ||
opacity | ||
}}> | ||
{this.props.text} | ||
{text} | ||
</div> | ||
@@ -61,2 +69,2 @@ ); | ||
module.exports = Card; | ||
export default Card; |
'use strict'; | ||
var React = require('react'), | ||
Card = require('./Card'), | ||
update = require('react/lib/update'); | ||
import React from 'react'; | ||
import update from 'react/lib/update'; | ||
import Card from './Card'; | ||
var Container = React.createClass({ | ||
const Container = React.createClass({ | ||
getInitialState() { | ||
@@ -36,8 +36,10 @@ return { | ||
moveCard(id, afterId) { | ||
var card = this.state.cards.filter(c => c.id === id)[0], | ||
afterCard = this.state.cards.filter(c => c.id === afterId)[0], | ||
cardIndex = this.state.cards.indexOf(card), | ||
afterIndex = this.state.cards.indexOf(afterCard); | ||
const { cards } = this.state; | ||
var stateUpdate = { | ||
const card = cards.filter(c => c.id === id)[0]; | ||
const afterCard = cards.filter(c => c.id === afterId)[0]; | ||
const cardIndex = cards.indexOf(card); | ||
const afterIndex = cards.indexOf(afterCard); | ||
this.setState(update(this.state, { | ||
cards: { | ||
@@ -49,11 +51,11 @@ $splice: [ | ||
} | ||
}; | ||
this.setState(update(this.state, stateUpdate)); | ||
})); | ||
}, | ||
render() { | ||
const { cards } = this.state; | ||
return ( | ||
<div> | ||
{this.state.cards.map(card => { | ||
{cards.map(card => { | ||
return ( | ||
@@ -71,2 +73,2 @@ <Card key={card.id} | ||
module.exports = Container; | ||
export default Container; |
'use strict'; | ||
var React = require('react'), | ||
Container = require('./Container'); | ||
import React from 'react'; | ||
import Container from './Container'; | ||
var DustbinSimple = React.createClass({ | ||
const DustbinSimple = React.createClass({ | ||
render() { | ||
@@ -19,2 +19,2 @@ return ( | ||
module.exports = DustbinSimple; | ||
export default DustbinSimple; |
'use strict'; | ||
module.exports = { | ||
export default { | ||
CARD: 'card' | ||
}; |
@@ -17,3 +17,3 @@ var webpack = require('webpack'); | ||
loaders: [ | ||
{ test: /\.js$/, loaders: ['react-hot-loader', '6to5'], exclude: /node_modules/ } | ||
{ test: /\.js$/, loaders: ['react-hot-loader', '6to5?experimental'], exclude: /node_modules/ } | ||
] | ||
@@ -20,0 +20,0 @@ }, |
@@ -19,3 +19,3 @@ var webpack = require('webpack'); | ||
loaders: [ | ||
{ test: /\.js$/, loaders: ['6to5'], exclude: /node_modules/ }, | ||
{ test: /\.js$/, loaders: ['6to5?experimental'], exclude: /node_modules/ } | ||
] | ||
@@ -22,0 +22,0 @@ }, |
@@ -13,2 +13,4 @@ 'use strict'; | ||
const ELEMENT_NODE = 1; | ||
// Store global state for browser-specific fixes and workarounds | ||
@@ -23,2 +25,10 @@ var _monitor = new EnterLeaveMonitor(), | ||
function getElementRect(el) { | ||
if (el.nodeType !== ELEMENT_NODE) { | ||
el = el.parentElement; | ||
} | ||
if (!el) { | ||
return null; | ||
} | ||
var rect = el.getBoundingClientRect(); | ||
@@ -66,3 +76,3 @@ // Copy so object doesn't get reused | ||
// If by this time no drag source reacted, tell browser not to drag. | ||
if (!DragOperationStore.isDragging()) { | ||
if (!isNativeDragDropEvent(e) && !DragOperationStore.isDragging()) { | ||
e.preventDefault(); | ||
@@ -69,0 +79,0 @@ } |
{ | ||
"name": "react-dnd", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"description": "Drag and drop for React with full DOM control", | ||
@@ -5,0 +5,0 @@ "main": "dist-modules/index.js", |
@@ -73,3 +73,3 @@ React DnD | ||
Examples use [ES6 syntax](https://babeljs.io/docs/learn-es6/). | ||
Examples use **[ES6 syntax](https://babeljs.io/docs/learn-es6/)** via **[Babel](https://babeljs.io/)** transpiler. You can still use React DnD in an ES5 codebase, but if you copy code from examples, make sure you translate it to ES5 where needed. | ||
@@ -76,0 +76,0 @@ ## Installation |
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
4586
2324593