@atlaskit/drag-and-drop
Advanced tools
Comparing version 4.4.2 to 4.5.0
@@ -1,6 +0,16 @@ | ||
<a name="4.4.2"></a> | ||
## 4.4.2 (2017-07-27) | ||
<a name="4.5.0"></a> | ||
# 4.5.0 (2017-07-28) | ||
<a name="4.5.0"></a> | ||
# 4.5.0 (2017-07-28) | ||
### Features | ||
* **component:** adding support for scroll containers ([5afae78](https://bitbucket.org/atlassian/atlaskit/commits/5afae78)) | ||
<a name="4.4.2"></a> | ||
@@ -7,0 +17,0 @@ ## 4.4.2 (2017-07-27) |
@@ -1,2 +0,2 @@ | ||
module.exports=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Droppable=t.Draggable=t.DragDropContext=void 0;var i=n(2),o=r(i),a=n(25),u=r(a),d=n(50),s=r(d);t.DragDropContext=o.default,t.Draggable=u.default,t.Droppable=s.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(3),o=r(i);t.default=o.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(5),u=r(a),d=n(6),s=r(d),l=n(7),f=r(l),c=n(8),p=r(c),g=n(9),v=n(10),h=r(v),m=n(24),b=r(m),y=function(e){function t(){return(0,u.default)(this,t),(0,s.default)(this,e.apply(this,arguments))}return(0,f.default)(t,e),t.prototype.componentWillMount=function(){this.store=(0,h.default)(this.props)},t.prototype.getChildContext=function(){return(0,o.default)({},b.default,this.store)},t.prototype.render=function(){return this.props.children},t}(g.Component);y.propTypes={onDragStart:p.default.func,onDragEnd:p.default.func.isRequired,children:p.default.any},y.childContextTypes=(0,o.default)({},b.default,p.default.shape({dispatch:p.default.func.isRequired,subscribe:p.default.func.isRequired,getState:p.default.func.isRequired}).isRequired),t.default=y},function(e,t){e.exports=require("babel-runtime/helpers/defineProperty")},function(e,t){e.exports=require("babel-runtime/helpers/classCallCheck")},function(e,t){e.exports=require("babel-runtime/helpers/possibleConstructorReturn")},function(e,t){e.exports=require("babel-runtime/helpers/inherits")},function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(11),o=n(12),a=r(o),u=n(13),d=r(u),s=n(23),l=r(s),f=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||i.compose;t.default=function(e){return(0,i.createStore)(d.default,f((0,i.applyMiddleware)(a.default,(0,l.default)(e))))}},function(e,t){e.exports=require("redux")},function(e,t){e.exports=require("redux-thunk")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(14),u=r(a),d=n(15),s=r(d),l=n(16),f=r(l),c=n(22),p=r(c),g=(0,s.default)(function(e){var t={phase:e||"IDLE",drag:null,drop:null,dimension:{request:null,draggable:{},droppable:{}}};return t});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g("IDLE"),t=arguments[1];if("BEGIN_LIFT"===t.type)return"IDLE"!==e.phase?(console.error("trying to start a lift while another is occurring"),e):g("COLLECTING_DIMENSIONS");if("REQUEST_DIMENSIONS"===t.type){if("COLLECTING_DIMENSIONS"!==e.phase)return console.error("trying to collect dimensions at the wrong time"),e;var n=t.payload;return{phase:"COLLECTING_DIMENSIONS",drag:null,drop:null,dimension:{request:n,draggable:{},droppable:{}}}}if("PUBLISH_DRAGGABLE_DIMENSION"===t.type){var r=t.payload;return"COLLECTING_DIMENSIONS"!==e.phase?(console.warn("dimension rejected as no longer requesting dimensions",r),e):e.dimension.draggable[r.id]?(console.error("dimension already exists for "+r.id),e):(0,u.default)({},e,{dimension:{request:e.dimension.request,droppable:e.dimension.droppable,draggable:(0,u.default)({},e.dimension.draggable,(0,o.default)({},r.id,r))}})}if("PUBLISH_DROPPABLE_DIMENSION"===t.type){var i=t.payload;return"COLLECTING_DIMENSIONS"!==e.phase?(console.warn("dimension rejected as no longer requesting dimensions",i),e):e.dimension.droppable[i.id]?(console.error("dimension already exists for "+i.id),e):(0,u.default)({},e,{dimension:{request:e.dimension.request,draggable:e.dimension.draggable,droppable:(0,u.default)({},e.dimension.droppable,(0,o.default)({},i.id,i))}})}if("COMPLETE_LIFT"===t.type){if("COLLECTING_DIMENSIONS"!==e.phase)return console.error("trying complete lift without collecting dimensions"),e;var a=t.payload,d=a.id,s=a.type,l=a.center,c=a.selection,v=(0,f.default)(l,d,e.dimension.draggable,e.dimension.droppable),h=v.destination;if(!h)return console.error("lifting a draggable that is not inside a droppable"),g();var m={source:h,center:l,selection:c,dimension:e.dimension.draggable[d]},b={id:d,type:s,offset:{x:0,y:0},center:l,shouldAnimate:!1};return(0,u.default)({},e,{phase:"DRAGGING",drag:{initial:m,current:b,impact:v}})}if("MOVE"===t.type){if("DRAGGING"!==e.phase)return console.error("cannot move while not dragging",t),g();if(null==e.drag)return console.error("cannot move if there is no drag information"),g();var y=t.payload,D=y.offset,M=y.center,_=e.drag.current,w=e.drag.initial,R={id:_.id,type:_.type,center:M,offset:D,shouldAnimate:!1},O=(0,f.default)(R.center,R.id,e.dimension.draggable,e.dimension.droppable),I={initial:w,impact:O,current:R};return(0,u.default)({},e,{drag:I})}if("MOVE_FORWARD"===t.type||"MOVE_BACKWARD"===t.type){if("DRAGGING"!==e.phase)return console.error("cannot move while not dragging",t),g();if(!e.drag)return console.error("cannot move if there is no drag information"),g();var E=e.drag;if(!E.impact.destination)return console.warn("cannot move forward when there is not previous location"),e;var P="MOVE_FORWARD"===t.type,q=(0,p.default)(P,E.current.id,E.impact.destination,e.dimension.draggable,e.dimension.droppable);if(!q)return e;var x={x:E.current.offset.x+q.x,y:E.current.offset.y+q.y},S={x:E.current.center.x+q.x,y:E.current.center.y+q.y},A={id:E.current.id,type:E.current.type,offset:x,center:S,shouldAnimate:!0},C=(0,f.default)(A.center,A.id,e.dimension.draggable,e.dimension.droppable);return(0,u.default)({},e,{drag:{initial:E.initial,current:A,impact:C}})}if("DROP_ANIMATE"===t.type){var N=t.payload,L=N.newHomeOffset,k=N.result;if("DRAGGING"!==e.phase)return console.error("cannot animate drop while not dragging",t),e;if(!e.drag)return console.error("cannot animate drop - invalid drag state"),g();var T={newHomeOffset:L,result:k,last:e.drag};return{phase:"DROP_ANIMATING",drag:null,drop:{pending:T,result:null},dimension:{request:null,draggable:{},droppable:{}}}}if("DROP_COMPLETE"===t.type){var W=t.payload;return{phase:"DROP_COMPLETE",drag:null,drop:{pending:null,result:W},dimension:{request:null,draggable:{},droppable:{}}}}return"CANCEL"===t.type?g():e}},function(e,t){e.exports=require("babel-runtime/helpers/extends")},function(e,t){e.exports=require("memoize-one")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(17),o=r(i),a=n(20),u=r(a),d=n(21),s=r(d);t.default=function(e,t,n,r){var i=(0,o.default)(e,r);if(!i)return s.default;var a=n[t],d=r[i],l=e.y-a.center.y>0,f=(0,u.default)(d,n),c=f.filter(function(t){return t!==a&&(l?!(t.center.y<a.center.y)&&e.y>t.withMargin.top:!(a.center.y<t.center.y)&&e.y<t.withMargin.bottom)}).map(function(e){return e.id}),p=f.indexOf(a),g=function(){return c.length?l?p+c.length:p-c.length:p}(),v=g!==p?a.withMargin.height:0,h={amount:v,draggables:c,isMovingForward:l},m={movement:h,destination:{droppableId:i,index:g}};return m}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=r(i),a=n(19),u=r(a);t.default=function(e,t){var n=(0,o.default)(t).find(function(n){return(0,u.default)(e,t[n])});return n||null}},function(e,t){e.exports=require("babel-runtime/core-js/object/keys")},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=t.withMargin,r=n.top,i=n.right,o=n.bottom,a=n.left;return e.x>=a&&e.x<=i&&e.y>=r&&e.y<=o}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=r(i),a=n(15),u=r(a),d=n(19),s=r(d);t.default=(0,u.default)(function(e,t){return(0,o.default)(t).map(function(e){return t[e]}).filter(function(t){return(0,s.default)(t.center,e)}).sort(function(e,t){return e.center.y-t.center.y})})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={draggables:[],amount:0,isMovingForward:!1},r={movement:n,destination:null};t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(15),o=r(i),a=n(20),u=r(a),d=(0,o.default)(function(e,t){return e.indexOf(t)});t.default=function(e,t,n,r,i){var o=i[n.droppableId],a=r[t],s=n.index,l=(0,u.default)(o,r),f=d(l,a);if(f===-1)return console.error("could not find draggable inside current droppable"),null;if(e&&s===l.length-1)return null;if(!e&&0===s)return null;var c=l[s],p=e?s+1:s-1,g=l[p],v=e&&p<=f||!e&&p>=f,h=v?c.withMargin.height:g.withMargin.height,m={x:0,y:e?h:-h};return m}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(15),o=r(i),a=function(e){return(0,o.default)(function(t,n){var r=e.onDragStart,i=e.onDragEnd,o=t.phase,a=n.phase;if("DRAGGING"===o&&"DRAGGING"!==a){if(!r)return;return t.drag?void r(t.drag.current.id,t.drag.initial.source):void console.error("cannot fire onDragStart hook without drag state",{current:t,previous:n})}if("DROP_COMPLETE"===o&&"DROP_COMPLETE"!==a){if(!t.drop||!t.drop.result)return void console.error("cannot fire onDragEnd hook without drag state",{current:t,previous:n});var u=t.drop.result,d=u.source,s=u.destination,l=u.draggableId;if(!s)return void i(t.drop.result);var f=d.droppableId!==s.droppableId||d.index!==s.index;if(f)return void i(t.drop.result);var c={draggableId:l,source:d,destination:null};i(c)}if("IDLE"===o&&"DRAGGING"===a){if(!n.drag)return void console.error("cannot fire onDragEnd for cancel because cannot find previous drag");var p={draggableId:n.drag.current.id,source:n.drag.initial.source,destination:null};i(p)}if("IDLE"===o&&"DROP_ANIMATING"===a){if(!n.drop||!n.drop.pending)return void console.error("cannot fire onDragEnd for cancel because cannot find previous pending drop");var g={draggableId:n.drop.pending.result.draggableId,source:n.drop.pending.result.source,destination:null};i(g)}})};t.default=function(e){var t=a(e);return function(e){return function(n){return function(r){var i=e.getState(),o=n(r),a=e.getState();return t(a,i),o}}}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="private-drag-drop-store-key-do-not-use"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(26),o=r(i);t.default=o.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var i=n(15),o=r(i),a=n(27),u=n(28),d=n(29),s=n(30),l=r(s),f=n(24),c=r(f),p=n(37),g={x:0,y:0},v={isDropAnimating:!1,isDragging:!1,canAnimate:!0,offset:g,initial:null},h=t.makeSelector=function(){var e=function(e,t){return t.draggableId},t=(0,o.default)(function(e,t){return{x:e,y:t}}),n=(0,o.default)(function(e){return{isDropAnimating:!1,isDragging:!1,canAnimate:!0,offset:e,initial:null}}),r=(0,o.default)(function(e,r){var i=r.draggables.indexOf(e)!==-1;if(!i)return v;var o=r.isMovingForward?-r.amount:r.amount;return n(t(0,o))});return(0,u.createSelector)([d.phaseSelector,d.dragSelector,d.pendingDropSelector,e],function(e,t,n,i){if("DRAGGING"===e){if(!t)return console.error("invalid dragging state"),v;var o=t.current,a=t.initial,u=t.impact;if(o.id!==i)return r(i,u.movement);var d=o.offset,s=o.shouldAnimate;return{isDragging:!0,isDropAnimating:!1,canAnimate:s,offset:d,initial:a}}return"DROP_ANIMATING"===e?n?n.last.current.id!==i?r(i,n.last.impact.movement):{isDragging:!0,isDropAnimating:!0,canAnimate:!0,offset:n.newHomeOffset,initial:n.last.initial}:(console.error("cannot animate drop without a pending drop"),v):"DROP_COMPLETE"===e?{offset:g,isDropAnimating:!1,isDragging:!1,canAnimate:!1,initial:null}:v})},m=function(){var e=h();return function(t,n){return e(t,n)}},b={lift:p.lift,move:p.move,moveBackward:p.moveBackward,moveForward:p.moveForward,drop:p.drop,dropAnimationFinished:p.dropAnimationFinished,cancel:p.cancel};t.default=(0,a.connect)(m(),b,null,{storeKey:c.default})(l.default)},function(e,t){e.exports=require("react-redux")},function(e,t){e.exports=require("reselect")},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.phaseSelector=function(e){return e.phase},t.pendingDropSelector=function(e){return e.drop&&e.drop.pending?e.drop.pending:null},t.dragSelector=function(e){return e.drag}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.zIndexOptions=void 0;var i=n(5),o=r(i),a=n(6),u=r(a),d=n(7),s=r(d),l=n(8),f=r(l),c=n(9),p=r(c),g=n(15),v=r(g),h=n(31),m=r(h),b=n(32),y=n(40),D=r(y),M=n(44),_=r(M),w=n(43),R=n(48),O=r(R),I=n(49),E=r(I),P=t.zIndexOptions={dragging:5e3,dropAnimating:4500},q=function(e){function t(n,r){(0,o.default)(this,t);var i=(0,u.default)(this,e.call(this,n,r));return i.state={ref:null},i.onMoveEnd=function(){i.props.isDropAnimating&&i.props.dropAnimationFinished(i.props.draggableId)},i.onLift=function(e){i.throwIfCannotDrag();var t=i.props,n=t.lift,r=t.draggableId,o=t.type,a=(0,O.default)(i.state.ref);n(r,o,a,e)},i.onKeyLift=function(){i.throwIfCannotDrag();var e=i.props,t=e.lift,n=e.draggableId,r=e.type,o=(0,O.default)(i.state.ref);t(n,r,o,o)},i.onMove=function(e){i.throwIfCannotDrag();var t=i.props,n=t.draggableId,r=t.initial,o=t.move;if(r){var a={x:e.x-r.selection.x,y:e.y-r.selection.y},u={x:r.center.x+a.x,y:r.center.y+a.y};o(n,a,u)}},i.onMoveForward=function(){i.throwIfCannotDrag(),i.props.moveForward(i.props.draggableId)},i.onMoveBackward=function(){i.throwIfCannotDrag(),i.props.moveBackward(i.props.draggableId)},i.onDrop=function(){i.throwIfCannotDrag(),i.props.drop(i.props.draggableId)},i.onCancel=function(){i.props.cancel(i.props.draggableId)},i.setRef=function(e){null!==e&&e!==i.state.ref&&i.setState({ref:e})},i.getDraggingStyle=(0,v.default)(function(e,t,n,r){var i={position:"absolute",boxSizing:"border-box",zIndex:n?P.dropAnimating:P.dragging,width:e,height:t,transform:r.transform};return i}),i.getNotDraggingStyle=(0,v.default)(function(e,t){var n={transition:e?w.css.outOfTheWay:null,transform:t.transform};return n}),i.getProvided=(0,v.default)(function(e,t,n,r,o,a){var u=function(){if(!e)return i.getNotDraggingStyle(n,a);(0,m.default)(r,"initial dimension required for dragging");var o=r.dimension.withoutMargin,u=o.width,d=o.height;return i.getDraggingStyle(u,d,t,a)}(),d={innerRef:i.setRef,placeholder:e||t?i.getPlaceholder():null,dragHandleProps:o,draggableStyle:u};return d}),i.getSnapshot=(0,v.default)(function(e){return{isDragging:e}}),i.getSpeed=(0,v.default)(function(e,t,n){return n?t?"STANDARD":e?"FAST":"INSTANT":"INSTANT"}),i.callbacks={onLift:i.onLift,onMove:i.onMove,onDrop:i.onDrop,onCancel:i.onCancel,onKeyLift:i.onKeyLift,onMoveBackward:i.onMoveBackward,onMoveForward:i.onMoveForward},i}return(0,s.default)(t,e),t.prototype.throwIfCannotDrag=function(){(0,m.default)(this.state.ref,"Draggable: cannot drag as no DOM node has been provided"),(0,m.default)(!this.props.isDragDisabled,"Draggable: cannot drag as dragging is not enabled")},t.prototype.getPlaceholder=function(){(0,m.default)(this.props.initial,"cannot get a drag placeholder when not dragging");var e=this.props.initial.dimension;return p.default.createElement(E.default,{height:e.withMargin.height,width:e.withMargin.width})},t.prototype.render=function(){var e=this,t=this.props,n=t.draggableId,r=t.type,i=t.offset,o=t.isDragging,a=t.isDropAnimating,u=t.canAnimate,d=t.isDragDisabled,s=t.initial,l=t.children,f=this.getSpeed(o,a,u);return p.default.createElement(b.DraggableDimensionPublisher,{itemId:n,type:r,targetRef:this.state.ref},p.default.createElement(D.default,{speed:f,destination:i,onMoveEnd:this.onMoveEnd},function(t){return p.default.createElement(_.default,{isEnabled:!d,callbacks:e.callbacks,draggableRef:e.state.ref},function(n){return l(e.getProvided(o,a,u,s,n,t),e.getSnapshot(o))})}))},t}(c.Component);q.propTypes={isDragging:f.default.bool.isRequired,isDropAnimating:f.default.bool.isRequired,canAnimate:f.default.bool.isRequired,offset:f.default.shape({x:f.default.number.isRequired,y:f.default.number.isRequired}).isRequired,initial:f.default.shape({source:f.default.shape({droppableId:f.default.string.isRequired,index:f.default.number.isRequired}).isRequired,center:f.default.shape({x:f.default.number.isRequired,y:f.default.number.isRequired}).isRequired,selection:f.default.shape({x:f.default.number.isRequired,y:f.default.number.isRequired}).isRequired,dimension:f.default.shape({id:f.default.string.isRequired,withMargin:f.default.shape({top:f.default.number.isRequired,right:f.default.number.isRequired,bottom:f.default.number.isRequired,left:f.default.number.isRequired,width:f.default.number.isRequired,height:f.default.number.isRequired}).isRequired,withoutMargin:f.default.shape({top:f.default.number.isRequired,right:f.default.number.isRequired,bottom:f.default.number.isRequired,left:f.default.number.isRequired,width:f.default.number.isRequired,height:f.default.number.isRequired}).isRequired,center:f.default.shape({x:f.default.number.isRequired,y:f.default.number.isRequired}).isRequired}).isRequired}),lift:f.default.func.isRequired,move:f.default.func.isRequired,moveForward:f.default.func.isRequired,moveBackward:f.default.func.isRequired,drop:f.default.func.isRequired,cancel:f.default.func.isRequired,dropAnimationFinished:f.default.func.isRequired,draggableId:f.default.string.isRequired,children:f.default.func.isRequired,type:f.default.string,isDragDisabled:f.default.bool},q.defaultProps={isDragDisabled:!1,type:"DEFAULT"},t.default=q},function(e,t){e.exports=require("invariant")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.DroppableDimensionPublisher=t.DraggableDimensionPublisher=void 0;var i=n(33),o=r(i),a=n(37);t.DraggableDimensionPublisher=(0,o.default)(a.publishDraggableDimension),t.DroppableDimensionPublisher=(0,o.default)(a.publishDroppableDimension)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var i=n(27),o=n(28),a=n(15),u=r(a),d=n(24),s=r(d),l=n(34),f=r(l),c=function(e){return e.dimension.request},p=function(e,t){return t.type},g=t.makeSelector=function(){var e=(0,u.default)(function(e){return{shouldPublish:e}});return(0,o.createSelector)([p,c],function(t,n){return e(!!n&&t===n)})},v=function(){var e=g();return function(t,n){return e(t,n)}};t.default=function(e){var t={publish:e};return(0,i.connect)(v,t,null,{storeKey:s.default})(f.default)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=r(i),a=n(6),u=r(a),d=n(7),s=r(d),l=n(8),f=r(l),c=n(9),p=n(31),g=r(p),v=n(35),h=r(v),m=n(36),b=r(m),y=function(e){function t(){var n,r,i;(0,o.default)(this,t);for(var a=arguments.length,d=Array(a),s=0;s<a;s++)d[s]=arguments[s];return n=r=(0,u.default)(this,e.call.apply(e,[this].concat(d))),r.getDimension=function(){var e=r.props,t=e.itemId,n=e.targetRef;(0,g.default)(n,"DimensionPublisher cannot calculate a dimension when not attached to the DOM");var i=window.getComputedStyle(n),o={top:parseInt(i.marginTop,10),right:parseInt(i.marginRight,10),bottom:parseInt(i.marginBottom,10),left:parseInt(i.marginLeft,10)};return(0,b.default)(t,n.getBoundingClientRect(),o,(0,h.default)())},i=n,(0,u.default)(r,i)}return(0,s.default)(t,e),t.prototype.componentWillReceiveProps=function(e){!this.props.shouldPublish&&e.shouldPublish&&this.props.publish(this.getDimension())},t.prototype.render=function(){return this.props.children},t}(c.Component);y.propTypes={shouldPublish:f.default.bool.isRequired,publish:f.default.func.isRequired,itemId:f.default.string.isRequired,type:f.default.string.isRequired,targetRef:f.default.any,children:f.default.any},t.default=y},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{x:window.pageXOffset,y:window.pageYOffset}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r){var i=t.top,o=t.right,a=t.bottom,u=t.left,d=t.width,s=t.height,l={top:i+r.y,right:o+r.x,left:u+r.x,bottom:a+r.y},f={top:l.top,right:l.right,left:l.left,bottom:l.bottom,width:d,height:s},c={top:l.top+n.top,right:l.right+n.right,left:l.left+n.left,bottom:l.bottom+n.bottom,width:d+n.left+n.right,height:s+n.bottom+n.top},p={id:e,withoutMargin:f,withMargin:c,center:{x:(l.left+l.right)/2,y:(l.top+l.bottom)/2}};return p}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.lift=t.dropAnimationFinished=t.drop=t.completeDrop=t.cancel=t.moveForward=t.moveBackward=t.move=t.publishDroppableDimension=t.publishDraggableDimension=t.requestDimensions=void 0;var i=n(38),o=r(i),a=n(39),u=r(a),d=t.requestDimensions=function(e){return{type:"REQUEST_DIMENSIONS",payload:e}},s=function(){return{type:"BEGIN_LIFT"}},l=function(e,t,n,r){return{type:"COMPLETE_LIFT",payload:{id:e,type:t,center:n,selection:r}}},f=(t.publishDraggableDimension=function(e){return{type:"PUBLISH_DRAGGABLE_DIMENSION",payload:e}},t.publishDroppableDimension=function(e){return{type:"PUBLISH_DROPPABLE_DIMENSION",payload:e}},t.move=function(e,t,n){return{type:"MOVE",payload:{id:e,offset:t,center:n}}},t.moveBackward=function(e){return{type:"MOVE_BACKWARD",payload:e}},t.moveForward=function(e){return{type:"MOVE_FORWARD",payload:e}},t.cancel=function(e){return{type:"CANCEL",payload:e}}),c=function(e,t){return{type:"DROP_ANIMATE",payload:{newHomeOffset:e,result:t}}},p=t.completeDrop=function(e){return{type:"DROP_COMPLETE",payload:e}};t.drop=function(e){return function(t,n){var r=n();if("COLLECTING_DIMENSIONS"===r.phase)return console.error("canceling drag while collecting"),void t(f(e));if("DRAGGING"!==r.phase)return console.error("cannot drop if not dragging",r),void t(f(e));if(!r.drag)return console.error("invalid drag state",r),void t(f(e));var i=r.drag,a=i.impact,d=i.initial,s=i.current,l={draggableId:s.id,source:d.source,destination:a.destination},g=(0,o.default)(a.movement,s.offset,r.dimension.draggable),v=!(0,u.default)(s.offset,g);return v?void t(c(g,l)):void t(p(l))}},t.dropAnimationFinished=function(e){return function(t,n){var r=n();return"DROP_ANIMATING"!==r.phase?(console.error("cannot end drop that is no longer animating",r),void t(f(e))):r.drop&&r.drop.pending?void t(p(r.drop.pending.result)):(console.error("cannot end drop that has no pending state",r),void t(f(e)))}},t.lift=function(e,t,n,r){return function(i,o){!function(){var e=o();if("DROP_ANIMATING"===e.phase){if(!e.drop||!e.drop.pending)return console.error("cannot flush drop animation if there is no pending"),void i(f("super cool id"));i(p(e.drop.pending.result))}}(),setTimeout(function(){var a=o();"IDLE"===a.phase&&"DRAG_COMPLETE"===a.phase||i(f("some-fake-id")),i(s()),i(d(t)),setTimeout(function(){var a=o();"COLLECTING_DIMENSIONS"===a.phase&&i(l(e,t,n,r))})})}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={x:0,y:0};t.default=function(e,t,r){if(!e.draggables.length)return n;var i=e.draggables.reduce(function(e,t){var n=r[t];return e+n.withMargin.height},0),o=e.isMovingForward?i:-i,a={x:0,y:o},u={x:0,y:t.y-a.y},d={x:0,y:t.y-u.y};return d}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return e.x===t.x&&e.y===t.y}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(41),o=r(i);t.default=o.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=r(i),a=n(6),u=r(a),d=n(7),s=r(d),l=n(8),f=r(l),c=n(9),p=r(c),g=n(42),v=n(43),h={x:0,y:0},m={transform:null},b=function(e){return e.x===h.x&&e.y===h.y},y=function(e,t,n){if(e)return m;var r={x:t,y:n};if(b(r))return m;var i={transform:"translate("+r.x+"px, "+r.y+"px)"};return i},D=function(e){function t(){var n,r,i;(0,o.default)(this,t);for(var a=arguments.length,d=Array(a),s=0;s<a;s++)d[s]=arguments[s];return n=r=(0,u.default)(this,e.call.apply(e,[this].concat(d))),r.onRest=function(){var e=r.props.onMoveEnd;e&&setTimeout(function(){return e()})},r.getFinal=function(){var e=r.props.destination,t=r.props.speed;if("INSTANT"===t)return e;var n="FAST"===t?v.physics.fast:v.physics.standard;return{x:(0,g.spring)(e.x,n),y:(0,g.spring)(e.y,n)}},i=n,(0,u.default)(r,i)}return(0,s.default)(t,e),t.prototype.render=function(){var e=this,t=this.getFinal(),n=b(t);return p.default.createElement(g.Motion,{defaultStyle:h,style:t,onRest:this.onRest},function(t){return e.props.children(y(n,t.x,t.y))})},t}(c.Component);D.propTypes={children:f.default.func.isRequired,speed:f.default.oneOf(["INSTANT","STANDARD","FAST"]).isRequired,destination:f.default.shape({x:f.default.number.isRequired,y:f.default.number.isRequired}),onMoveEnd:f.default.func},D.defaultProps={destination:h},t.default=D},function(e,t){e.exports=require("react-motion")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.css=t.physics=void 0;var i=n(14),o=r(i);t.physics=function(){var e={stiffness:800,damping:60,precision:.9},t=(0,o.default)({},e),n=(0,o.default)({},e,{stiffness:2*e.stiffness});return{standard:t,fast:n}}(),t.css={outOfTheWay:"transform 0.2s cubic-bezier(0.2, 0, 0, 1)"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(45),o=r(i);t.default=o.default},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.sloppyClickThreshold=void 0;var o=n(5),a=i(o),u=n(6),d=i(u),s=n(7),l=i(s),f=n(8),c=i(f),p=n(9),g=n(31),v=i(g),h=n(15),m=i(h),b=n(46),y=i(b),D=n(47),M=r(D),_=n(35),w=i(_),R=function(){},O=function(){return!1},I=0,E=t.sloppyClickThreshold=5,P=function(e){function t(){var n,r,i;(0,a.default)(this,t);for(var o=arguments.length,u=Array(o),s=0;s<o;s++)u[s]=arguments[s];return n=r=(0,d.default)(this,e.call.apply(e,[this].concat(u))),r.state={draggingWith:null,pending:null},r.ifDragging=function(e){r.state.draggingWith&&e()},r.scheduleMove=(0,y.default)(function(e){r.ifDragging(function(){return r.props.callbacks.onMove(e)})}),r.scheduleMoveForward=(0,y.default)(function(){r.ifDragging(r.props.callbacks.onMoveForward)}),r.scheduleMoveBackward=(0,y.default)(function(){r.ifDragging(r.props.callbacks.onMoveBackward)}),r.onWindowResize=function(){return r.state.pending?void r.stopPendingMouseDrag():void r.stopDragging(function(){return r.props.callbacks.onCancel()})},r.onWindowMouseMove=function(e){var t=r.state,n=t.draggingWith,i=t.pending;if("KEYBOARD"!==n){var o=e.button,a=e.clientX,u=e.clientY;if(o===I){var d=(0,w.default)(),s={x:a+d.x,y:u+d.y};if(!i)return void r.scheduleMove(s);var l=Math.abs(i.x-s.x)>=E||Math.abs(i.y-s.y)>=E;l&&r.startDragging("MOUSE",function(){return r.props.callbacks.onLift(s)})}}},r.onWindowMouseUp=function(){return r.state.pending?void r.stopPendingMouseDrag():r.state.draggingWith?void("MOUSE"===r.state.draggingWith&&r.stopDragging(function(){return r.props.callbacks.onDrop()})):void console.error("should not be listening to mouse up events when nothing is dragging")},r.onWindowMouseDown=function(){"MOUSE"===r.state.draggingWith&&console.error("Should not be able to trigger a mousedown while a MOUSE drag\n is occurring. Expecting a mouseup first."),r.stopDragging(function(){return r.props.callbacks.onCancel()})},r.onMouseDown=function(e){if("KEYBOARD"===r.state.draggingWith)return void r.stopDragging(function(){return r.props.callbacks.onCancel()});var t=e.button,n=e.clientX,i=e.clientY;if(t===I){e.stopPropagation(),e.preventDefault();var o=(0,w.default)(),a={x:n+o.x,y:i+o.y};r.startPendingMouseDrag(a)}},r.onWindowKeydown=function(e){var t=Boolean(r.state.pending);return t?void(e.keyCode===M.escape&&(e.preventDefault(),r.stopPendingMouseDrag())):(r.state.draggingWith||(console.error("should not be listening to window mouse up if nothing is dragging"),r.stopDragging(function(){return r.props.callbacks.onCancel()})),e.keyCode===M.enter&&e.preventDefault(),e.keyCode===M.tab&&e.preventDefault(),e.keyCode===M.escape&&(e.preventDefault(),r.stopDragging(function(){return r.props.callbacks.onCancel()})),"MOUSE"===r.state.draggingWith?void(e.keyCode===M.space&&e.preventDefault()):(e.keyCode===M.space&&(e.preventDefault(),r.stopDragging(function(){return r.props.callbacks.onDrop()})),e.keyCode===M.arrowDown&&(e.preventDefault(),r.scheduleMoveForward()),void(e.keyCode===M.arrowUp&&(e.preventDefault(),r.scheduleMoveBackward()))))},r.onKeyDown=function(e){!r.props.isEnabled||r.state.pending||r.state.draggingWith||e.keyCode===M.space&&(e.preventDefault(),e.stopPropagation(),r.startDragging("KEYBOARD",function(){return r.props.callbacks.onKeyLift()}))},r.onClick=function(e){r.preventClick&&(r.preventClick=!1,e.preventDefault())},r.startPendingMouseDrag=function(e){if(r.state.draggingWith)return void console.error("cannot start a pending mouse drag when already dragging");if(r.state.pending)return void console.error("cannot start a pending mouse drag when there is already a pending position");r.bindWindowEvents();var t={draggingWith:null,pending:e};r.setState(t)},r.startDragging=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:R;if(r.state.draggingWith)return void console.error("cannot start dragging when already dragging");if("MOUSE"===e&&!r.state.pending)return void console.error("cannot start mouse drag when there is not a pending position");"KEYBOARD"===e&&r.bindWindowEvents();var n={draggingWith:e,pending:null};r.setState(n,t)},r.stopPendingMouseDrag=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R;(0,v.default)(r.state.pending,"cannot stop pending drag when there is none"),r.preventClick=!1,r.unbindWindowEvents(),r.setState({draggingWith:null,pending:null},e)},r.stopDragging=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R;if(!r.state.draggingWith)return void console.error("cannot stop dragging when not dragging");r.unbindWindowEvents(),"MOUSE"===r.state.draggingWith&&(r.preventClick=!0);var t={draggingWith:null,pending:null};r.setState(t,e)},r.unbindWindowEvents=function(){window.removeEventListener("mousemove",r.onWindowMouseMove),window.removeEventListener("mouseup",r.onWindowMouseUp),window.removeEventListener("mousedown",r.onWindowMouseDown),window.removeEventListener("keydown",r.onWindowKeydown),window.removeEventListener("resize",r.onWindowResize)},r.bindWindowEvents=function(){window.addEventListener("mousemove",r.onWindowMouseMove),window.addEventListener("mouseup",r.onWindowMouseUp),window.addEventListener("mousedown",r.onWindowMouseDown),window.addEventListener("keydown",r.onWindowKeydown),window.addEventListener("resize",r.onWindowResize)},r.getProvided=(0,m.default)(function(e,t){if(!e)return null;var n={onMouseDown:r.onMouseDown,onKeyDown:r.onKeyDown, | ||
onClick:r.onClick,tabIndex:0,"aria-grabbed":t,draggable:!1,onDragStart:O,onDrop:O};return n}),i=n,(0,d.default)(r,i)}return(0,l.default)(t,e),t.prototype.componentWillUnmount=function(){this.state.draggingWith&&(this.preventClick=!1,this.unbindWindowEvents(),this.props.callbacks.onCancel())},t.prototype.componentWillReceiveProps=function(e){var t=this;if(!e.isEnabled)return this.state.pending?void this.stopPendingMouseDrag():void(this.state.draggingWith&&this.stopDragging(function(){return t.props.callbacks.onCancel()}))},t.prototype.render=function(){var e=this.props,t=e.children,n=e.isEnabled,r=this.state.draggingWith,i=Boolean(r);return t(this.getProvided(n,i))},t}(p.Component);P.propTypes={isEnabled:c.default.bool.isRequired,callbacks:c.default.shape({onLift:c.default.func.isRequired,onKeyLift:c.default.func.isRequired,onMove:c.default.func.isRequired,onMoveForward:c.default.func.isRequired,onMoveBackward:c.default.func.isRequired,onDrop:c.default.func.isRequired,onCancel:c.default.func.isRequired}).isRequired,children:c.default.func.isRequired},t.default=P},function(e,t){e.exports=require("raf-schd")},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tab=9,t.enter=13,t.escape=27,t.space=32,t.arrowUp=38,t.arrowDown=40},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(35),o=r(i);t.default=function(e){var t=e.getBoundingClientRect(),n=t.top,r=t.right,i=t.bottom,a=t.left,u=(0,o.default)(),d=(a+u.x+(r+u.x))/2,s=(n+u.y+(i+u.y))/2;return{x:d,y:s}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=r(i),a=n(6),u=r(a),d=n(7),s=r(d),l=n(8),f=r(l),c=n(9),p=r(c),g=function(e){function t(){return(0,o.default)(this,t),(0,u.default)(this,e.apply(this,arguments))}return(0,s.default)(t,e),t.prototype.render=function(){var e={width:this.props.width,height:this.props.height};return p.default.createElement("div",{style:e})},t}(c.PureComponent);g.propTypes={height:f.default.number.isRequired,width:f.default.number.isRequired},t.default=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(51),o=r(i);t.default=o.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var i=n(27),o=n(28),a=n(15),u=r(a),d=n(24),s=r(d),l=n(29),f=n(52),c=r(f),p=t.makeSelector=function(){var e=function(e,t){return t.droppableId},t=function(e,t){return t.isDropDisabled||!1},n=(0,u.default)(function(e,t){return!!t&&t.droppableId===e}),r=(0,u.default)(function(e){return{isDraggingOver:e}});return(0,o.createSelector)([l.phaseSelector,l.dragSelector,l.pendingDropSelector,e,t],function(e,t,i,o,a){if(a)return r(!1);if("DRAGGING"===e){if(!t)return console.error("cannot determine dragging over as there is not drag"),r(!1);var u=n(o,t.impact.destination);return r(u)}if("DROP_ANIMATING"===e){if(!i)return console.error("cannot determine dragging over as there is no pending result"),r(!1);var d=n(o,i.last.impact.destination);return r(d)}return r(!1)})},g=function(){var e=p();return function(t,n){return e(t,n)}};t.default=(0,i.connect)(g(),null,null,{storeKey:s.default})(c.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=r(i),a=n(6),u=r(a),d=n(7),s=r(d),l=n(8),f=r(l),c=n(9),p=r(c),g=n(32),v=function(e){function t(){var n,r,i;(0,o.default)(this,t);for(var a=arguments.length,d=Array(a),s=0;s<a;s++)d[s]=arguments[s];return n=r=(0,u.default)(this,e.call.apply(e,[this].concat(d))),r.state={ref:null},r.setRef=function(e){null!==e&&e!==r.state.ref&&r.setState({ref:e})},i=n,(0,u.default)(r,i)}return(0,s.default)(t,e),t.prototype.render=function(){var e={innerRef:this.setRef},t={isDraggingOver:this.props.isDraggingOver};return p.default.createElement(g.DroppableDimensionPublisher,{itemId:this.props.droppableId,type:this.props.type,targetRef:this.state.ref},this.props.children(e,t))},t}(c.Component);v.propTypes={droppableId:f.default.string.isRequired,isDropDisabled:f.default.bool,type:f.default.string,children:f.default.func.isRequired,isDraggingOver:f.default.bool.isRequired},v.defaultProps={type:"DEFAULT",isDropDisabled:!1},t.default=v}]); | ||
module.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Droppable=t.Draggable=t.DragDropContext=void 0;var o=n(2),i=r(o),a=n(26),u=r(a),d=n(50),l=r(d);t.DragDropContext=i.default,t.Draggable=u.default,t.Droppable=l.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(3),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),i=r(o),a=n(5),u=r(a),d=n(6),l=r(d),s=n(7),c=r(s),f=n(8),p=r(f),g=n(9),h=n(10),v=r(h),b=n(25),m=function(e){function t(){return(0,u.default)(this,t),(0,l.default)(this,e.apply(this,arguments))}return(0,c.default)(t,e),t.prototype.componentWillMount=function(){this.store=(0,v.default)(this.props)},t.prototype.getChildContext=function(){return(0,i.default)({},b.storeKey,this.store)},t.prototype.render=function(){return this.props.children},t}(g.Component);m.propTypes={onDragStart:p.default.func,onDragEnd:p.default.func.isRequired,children:p.default.any},m.childContextTypes=(0,i.default)({},b.storeKey,p.default.shape({dispatch:p.default.func.isRequired,subscribe:p.default.func.isRequired,getState:p.default.func.isRequired}).isRequired),t.default=m},function(e,t){e.exports=require("babel-runtime/helpers/defineProperty")},function(e,t){e.exports=require("babel-runtime/helpers/classCallCheck")},function(e,t){e.exports=require("babel-runtime/helpers/possibleConstructorReturn")},function(e,t){e.exports=require("babel-runtime/helpers/inherits")},function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(11),i=n(12),a=r(i),u=n(13),d=r(u),l=n(24),s=r(l),c=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||o.compose;t.default=function(e){return(0,o.createStore)(d.default,c((0,o.applyMiddleware)(a.default,(0,s.default)(e))))}},function(e,t){e.exports=require("redux")},function(e,t){e.exports=require("redux-thunk")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),i=r(o),a=n(14),u=r(a),d=n(15),l=r(d),s=n(16),c=n(17),f=r(c),p=n(23),g=r(p),h=n(18),v=r(h),b={request:null,draggable:{},droppable:{}},m={x:0,y:0},y=(0,l.default)(function(e){var t={phase:e||"IDLE",drag:null,drop:null,dimension:b};return t}),w=function(e){var t=e.state,n=e.clientSelection,r=e.pageSelection,o=e.shouldAnimate,i=void 0!==o&&o,a=e.windowScroll;if("DRAGGING"!==t.phase)return console.error("cannot move while not dragging"),y();if(null==t.drag)return console.error("cannot move if there is no drag information"),y();var d=t.drag.current,l=t.drag.initial,c=t.dimension.droppable[l.source.droppableId],p=function(){var e=(0,s.subtract)(n,l.client.selection),t=(0,s.add)(e,l.client.center),r={selection:n,offset:e,center:t};return r}(),g=function(){var e=(0,s.subtract)(r,l.page.selection),t=(0,s.add)(e,l.page.center),n={selection:r,offset:e,center:t};return n}(),h=(0,s.subtract)(c.scroll.initial,c.scroll.current),v={center:(0,s.add)(g.center,(0,s.negate)(h))},b=a||d.windowScroll,m={id:d.id,type:d.type,client:p,page:g,withinDroppable:v,shouldAnimate:i,windowScroll:b},w=(0,f.default)({page:g.selection,withinDroppable:v,draggableId:m.id,draggables:t.dimension.draggable,droppables:t.dimension.droppable}),D={initial:l,impact:w,current:m};return(0,u.default)({},t,{drag:D})};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y("IDLE"),t=arguments[1];if("BEGIN_LIFT"===t.type)return"IDLE"!==e.phase?(console.error("trying to start a lift while another is occurring"),e):y("COLLECTING_DIMENSIONS");if("REQUEST_DIMENSIONS"===t.type){if("COLLECTING_DIMENSIONS"!==e.phase)return console.error("trying to collect dimensions at the wrong time"),e;var n=t.payload;return{phase:"COLLECTING_DIMENSIONS",drag:null,drop:null,dimension:{request:n,draggable:{},droppable:{}}}}if("PUBLISH_DRAGGABLE_DIMENSION"===t.type){var r=t.payload;return"COLLECTING_DIMENSIONS"!==e.phase?(console.warn("dimension rejected as no longer requesting dimensions",r),e):e.dimension.draggable[r.id]?(console.error("dimension already exists for "+r.id),e):(0,u.default)({},e,{dimension:{request:e.dimension.request,droppable:e.dimension.droppable,draggable:(0,u.default)({},e.dimension.draggable,(0,i.default)({},r.id,r))}})}if("PUBLISH_DROPPABLE_DIMENSION"===t.type){var o=t.payload;return"COLLECTING_DIMENSIONS"!==e.phase?(console.warn("dimension rejected as no longer requesting dimensions",o),e):e.dimension.droppable[o.id]?(console.error("dimension already exists for "+o.id),e):(0,u.default)({},e,{dimension:{request:e.dimension.request,draggable:e.dimension.draggable,droppable:(0,u.default)({},e.dimension.droppable,(0,i.default)({},o.id,o))}})}if("COMPLETE_LIFT"===t.type){if("COLLECTING_DIMENSIONS"!==e.phase)return console.error("trying complete lift without collecting dimensions"),e;var a=t.payload,d=a.id,l=a.type,c=a.client,p=a.page,h=a.windowScroll,D={center:p.center},M=(0,f.default)({page:p.selection,withinDroppable:D,draggableId:d,draggables:e.dimension.draggable,droppables:e.dimension.droppable}),_=M.destination;if(!_)return console.error("lifting a draggable that is not inside a droppable"),y();var R={source:_,client:c,page:p,windowScroll:h,withinDroppable:D},S={id:d,type:l,client:{selection:c.selection,center:c.center,offset:m},page:{selection:p.selection,center:p.center,offset:m},withinDroppable:D,windowScroll:h,shouldAnimate:!1};return(0,u.default)({},e,{phase:"DRAGGING",drag:{initial:R,current:S,impact:M}})}if("UPDATE_DROPPABLE_DIMENSION_SCROLL"===t.type){if("DRAGGING"!==e.phase)return console.error("cannot update a droppable dimensions scroll when not dragging"),y();if(null==e.drag)return console.error("invalid store state"),y();var I=t.payload,O=I.id,E=I.offset,q=e.dimension.droppable[O];if(!q)return console.error("cannot update a droppable that is not inside of the state",O),y();var P=(0,u.default)({},q,{scroll:{initial:q.scroll.initial,current:E}}),A=(0,u.default)({},e,{dimension:{request:e.dimension.request,draggable:e.dimension.draggable,droppable:(0,u.default)({},e.dimension.droppable,(0,i.default)({},O,P))}}),x=e.drag.current,C=x.client,L=x.page;return w({state:A,clientSelection:C.selection,pageSelection:L.selection})}if("MOVE"===t.type){var N=t.payload,W=N.client,T=N.page,k=N.windowScroll;return w({state:e,clientSelection:W,pageSelection:T,windowScroll:k})}if("MOVE_BY_WINDOW_SCROLL"===t.type){var G=t.payload.windowScroll;if(!e.drag)return console.error("cannot move with window scrolling if no current drag"),y();var B=e.drag.current.client.selection,j=(0,s.subtract)(e.drag.current.windowScroll,e.drag.initial.windowScroll),F=(0,s.subtract)(G,e.drag.initial.windowScroll),K=(0,s.subtract)(F,j),U=(0,s.add)(e.drag.current.page.selection,K);return w({state:e,clientSelection:B,pageSelection:U,windowScroll:G})}if("MOVE_FORWARD"===t.type||"MOVE_BACKWARD"===t.type){if("DRAGGING"!==e.phase)return console.error("cannot move while not dragging",t),y();if(!e.drag)return console.error("cannot move if there is no drag information"),y();var z=e.drag;if(!z.impact.destination)return console.warn("cannot move forward when there is not previous location"),e;var Y="MOVE_FORWARD"===t.type,V=(0,g.default)({isMovingForward:Y,draggableId:z.current.id,location:z.impact.destination,draggables:e.dimension.draggable,droppables:e.dimension.droppable});if(!V)return e;var H=(0,s.add)(z.current.page.selection,V),X=(0,s.add)(z.current.client.selection,V),Q=(0,v.default)(H,e.dimension.droppable);return Q?w({state:e,clientSelection:X,pageSelection:H,shouldAnimate:!0}):(console.info("currently not supporting moving a draggable outside the visibility bounds of a droppable"),e)}if("DROP_ANIMATE"===t.type){var J=t.payload,Z=J.newHomeOffset,$=J.result;if("DRAGGING"!==e.phase)return console.error("cannot animate drop while not dragging",t),e;if(!e.drag)return console.error("cannot animate drop - invalid drag state"),y();var ee={newHomeOffset:Z,result:$,last:e.drag};return{phase:"DROP_ANIMATING",drag:null,drop:{pending:ee,result:null},dimension:e.dimension}}if("DROP_COMPLETE"===t.type){var te=t.payload;return{phase:"DROP_COMPLETE",drag:null,drop:{pending:null,result:te},dimension:b}}return"CANCEL"===t.type?y():e}},function(e,t){e.exports=require("babel-runtime/helpers/extends")},function(e,t){e.exports=require("memoize-one")},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},t.subtract=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},t.isEqual=function(e,t){return e.x===t.x&&e.y===t.y},t.negate=function(e){return{x:-e.x,y:-e.y}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(18),i=r(o),a=n(21),u=r(a),d=n(22),l=r(d);t.default=function(e){var t=e.page,n=e.withinDroppable,r=e.draggableId,o=e.draggables,a=e.droppables,d=(0,i.default)(t,a);if(!d)return l.default;var s=n.center,c=o[r],f=a[d],p=(0,u.default)(f,o),g=c.page.withoutMargin.center,h=s.y-g.y>0,v=p.filter(function(e){if(e===c)return!1;var t=e.page.withoutMargin;return h?!(t.center.y<g.y)&&s.y>t.top:!(g.y<t.center.y)&&s.y<t.bottom}).map(function(e){return e.id}),b=p.indexOf(c),m=function(){return v.length?h?b+v.length:b-v.length:b}(),y=m!==b?c.page.withMargin.height:0,w={amount:y,draggables:v,isMovingForward:h},D={movement:w,destination:{droppableId:d,index:m}};return D}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(19),i=r(o),a=n(20),u=r(a);t.default=function(e,t){var n=(0,i.default)(t).find(function(n){return(0,u.default)(e,t[n])});return n||null}},function(e,t){e.exports=require("babel-runtime/core-js/object/keys")},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=t.page.withMargin,r=n.top,o=n.right,i=n.bottom,a=n.left;return e.x>=a&&e.x<=o&&e.y>=r&&e.y<=i}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(19),i=r(o),a=n(15),u=r(a);t.default=(0,u.default)(function(e,t){return(0,i.default)(t).map(function(e){return t[e]}).filter(function(t){return t.droppableId===e.id}).sort(function(e,t){return e.page.withoutMargin.center.y-t.page.withoutMargin.center.y})})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={draggables:[],amount:0,isMovingForward:!1},r={movement:n,destination:null};t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(15),i=r(o),a=n(21),u=r(a),d=(0,i.default)(function(e,t){return e.indexOf(t)});t.default=function(e){var t=e.isMovingForward,n=e.draggableId,r=e.location,o=e.draggables,i=e.droppables,a=i[r.droppableId],l=o[n],s=r.index,c=(0,u.default)(a,o),f=d(c,l);if(f===-1)return console.error("could not find draggable inside current droppable"),null;if(t&&s===c.length-1)return null;if(!t&&0===s)return null;var p=c[s],g=t?s+1:s-1,h=c[g],v=t&&g<=f||!t&&g>=f,b=v?p.page.withMargin.height:h.page.withMargin.height,m={x:0,y:t?b:-b};return m}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(15),i=r(o),a=function(e){return(0,i.default)(function(t,n){var r=e.onDragStart,o=e.onDragEnd,i=t.phase,a=n.phase;if("DRAGGING"===i&&"DRAGGING"!==a){if(!r)return;return t.drag?void r(t.drag.current.id,t.drag.initial.source):void console.error("cannot fire onDragStart hook without drag state",{current:t,previous:n})}if("DROP_COMPLETE"===i&&"DROP_COMPLETE"!==a){if(!t.drop||!t.drop.result)return void console.error("cannot fire onDragEnd hook without drag state",{current:t,previous:n});var u=t.drop.result,d=u.source,l=u.destination,s=u.draggableId;if(!l)return void o(t.drop.result);var c=d.droppableId!==l.droppableId||d.index!==l.index;if(c)return void o(t.drop.result);var f={draggableId:s,source:d,destination:null};o(f)}if("IDLE"===i&&"DRAGGING"===a){if(!n.drag)return void console.error("cannot fire onDragEnd for cancel because cannot find previous drag");var p={draggableId:n.drag.current.id,source:n.drag.initial.source,destination:null};o(p)}if("IDLE"===i&&"DROP_ANIMATING"===a){if(!n.drop||!n.drop.pending)return void console.error("cannot fire onDragEnd for cancel because cannot find previous pending drop");var g={draggableId:n.drop.pending.result.draggableId,source:n.drop.pending.result.source,destination:null};o(g)}})};t.default=function(e){var t=a(e);return function(e){return function(n){return function(r){var o=e.getState(),i=n(r),a=e.getState();return t(a,o),i}}}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return"private-drag-drop-key-do-not-use-store-"+e};t.storeKey=n("store"),t.droppableIdKey=n("droppable-id")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(27),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var o=n(15),i=r(o),a=n(28),u=n(29),d=n(30),l=n(31),s=r(l),c=n(25),f=n(35),p={x:0,y:0},g={isDropAnimating:!1,isDragging:!1,isAnotherDragging:!1,canAnimate:!0,offset:p,dimension:null},h=t.makeSelector=function(){var e=function(e,t){return t.draggableId},t=(0,i.default)(function(e,t){return{x:e,y:t}}),n=(0,i.default)(function(e,t){return{isDropAnimating:!1,isDragging:!1,canAnimate:!0,isAnotherDragging:t,offset:e,dimension:null}}),r=(0,i.default)(function(e,r,o){var i=r.draggables.indexOf(e)!==-1;if(!i)return n(p,o);var a=r.isMovingForward?-r.amount:r.amount;return n(t(0,a),o)}),o=function(e,t){if(!e.dimension)return null;var n=e.dimension.draggable[t.draggableId];return n?n:null};return(0,u.createSelector)([e,d.phaseSelector,d.dragSelector,d.pendingDropSelector,o],function(e,t,n,o,i){if("DRAGGING"===t){if(!n)return console.error("invalid dragging state"),g;var a=n.current,u=n.impact;if(a.id!==e)return r(e,u.movement,!0);var d=a.client.offset,l=a.shouldAnimate;return{isDragging:!0,isAnotherDragging:!1,isDropAnimating:!1,canAnimate:l,offset:d,dimension:i}}return"DROP_ANIMATING"===t?o?o.last.current.id!==e?r(e,o.last.impact.movement,!1):{isDragging:!1,isDropAnimating:!0,isAnotherDragging:!1,canAnimate:!0,offset:o.newHomeOffset,dimension:i}:(console.error("cannot animate drop without a pending drop"),g):"DROP_COMPLETE"===t?{isDropAnimating:!1,isAnotherDragging:!1,isDragging:!1,canAnimate:!1,offset:p,dimension:null}:g})},v=function(){var e=h();return function(t,n){return e(t,n)}},b={lift:f.lift,move:f.move,moveBackward:f.moveBackward,moveForward:f.moveForward,moveByWindowScroll:f.moveByWindowScroll,drop:f.drop,dropAnimationFinished:f.dropAnimationFinished,cancel:f.cancel};t.default=(0,a.connect)(v(),b,null,{storeKey:c.storeKey})(s.default)},function(e,t){e.exports=require("react-redux")},function(e,t){e.exports=require("reselect")},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.phaseSelector=function(e){return e.phase},t.pendingDropSelector=function(e){return e.drop&&e.drop.pending?e.drop.pending:null},t.dragSelector=function(e){return e.drag}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.zIndexOptions=void 0;var o=n(4),i=r(o),a=n(5),u=r(a),d=n(6),l=r(d),s=n(7),c=r(s),f=n(8),p=r(f),g=n(9),h=r(g),v=n(15),b=r(v),m=n(32),y=r(m),w=n(33),D=r(w),M=n(40),_=r(M),R=n(44),S=r(R),I=n(43),O=n(38),E=r(O),q=n(48),P=r(q),A=n(49),x=r(A),C=n(25),L=n(16),N=t.zIndexOptions={dragging:5e3,dropAnimating:4500},W=function(e){function t(n,r){(0,u.default)(this,t);var o=(0,l.default)(this,e.call(this,n,r));return o.state={ref:null},o.onMoveEnd=function(){o.props.isDropAnimating&&o.props.dropAnimationFinished(o.props.draggableId)},o.onLift=function(e){o.throwIfCannotDrag();var t=o.props,n=t.lift,r=t.draggableId,i=t.type,a=o.state.ref,u=(0,E.default)(),d={selection:e,center:(0,P.default)(a)},l={selection:(0,L.add)(d.selection,u),center:(0,L.add)(d.center,u)};n(r,i,d,l,u)},o.onKeyLift=function(){o.throwIfCannotDrag();var e=o.props,t=e.lift,n=e.draggableId,r=e.type,i=o.state.ref,a=(0,P.default)(i),u={selection:a,center:a},d=(0,E.default)(),l={selection:(0,L.add)(a,d),center:(0,L.add)(a,d)};t(n,r,u,l,d)},o.onMove=function(e){o.throwIfCannotDrag();var t=o.props,n=t.draggableId,r=t.dimension,i=t.move;if(r){var a=(0,E.default)(),u=(0,L.add)(e,a);i(n,e,u,a)}},o.onMoveForward=function(){o.throwIfCannotDrag(),o.props.moveForward(o.props.draggableId)},o.onMoveBackward=function(){o.throwIfCannotDrag(),o.props.moveBackward(o.props.draggableId)},o.onWindowScroll=function(){o.throwIfCannotDrag();var e=(0,E.default)();o.props.moveByWindowScroll(o.props.draggableId,e)},o.onDrop=function(){o.throwIfCannotDrag(),o.props.drop(o.props.draggableId)},o.onCancel=function(){o.props.cancel(o.props.draggableId)},o.setRef=function(e){null!==e&&e!==o.state.ref&&o.setState({ref:e})},o.getDraggingStyle=(0,b.default)(function(e,t,n,r,o,i){var a={position:"fixed",boxSizing:"border-box",pointerEvents:"none",zIndex:o?N.dropAnimating:N.dragging,width:e,height:t,top:n,left:r,transform:i.transform?""+i.transform:null};return a}),o.getNotDraggingStyle=(0,b.default)(function(e,t,n){var r={transition:e?I.css.outOfTheWay:null,transform:t.transform,pointerEvents:n?"none":"auto"};return r}),o.getProvided=(0,b.default)(function(e,t,n,r,i,a,u){var d=e||t,l=function(){if(!d)return o.getNotDraggingStyle(r,u,n);(0,y.default)(i,"draggable dimension required for dragging");var e=i.client.withoutMargin,a=e.width,l=e.height,s=e.top,c=e.left;return o.getDraggingStyle(a,l,s,c,t,u)}(),s={innerRef:o.setRef,placeholder:d?o.getPlaceholder():null,dragHandleProps:a,draggableStyle:l};return s}),o.getSnapshot=(0,b.default)(function(e,t){return{isDragging:e||t}}),o.getSpeed=(0,b.default)(function(e,t,n){return n?t?"STANDARD":e?"FAST":"INSTANT":"INSTANT"}),o.callbacks={onLift:o.onLift,onMove:o.onMove,onDrop:o.onDrop,onCancel:o.onCancel,onKeyLift:o.onKeyLift,onMoveBackward:o.onMoveBackward,onMoveForward:o.onMoveForward,onWindowScroll:o.onWindowScroll},o}return(0,c.default)(t,e),t.prototype.throwIfCannotDrag=function(){(0,y.default)(this.state.ref,"Draggable: cannot drag as no DOM node has been provided"),(0,y.default)(!this.props.isDragDisabled,"Draggable: cannot drag as dragging is not enabled")},t.prototype.getPlaceholder=function(){var e=this.props.dimension;return(0,y.default)(e,"cannot get a drag placeholder when not dragging"),h.default.createElement(x.default,{height:e.page.withMargin.height,width:e.page.withMargin.width})},t.prototype.render=function(){var e=this,t=this.props,n=t.draggableId,r=t.type,o=t.offset,i=t.isDragging,a=t.isDropAnimating,u=t.isAnotherDragging,d=t.canAnimate,l=t.isDragDisabled,s=t.dimension,c=t.children,f=this.getSpeed(i,a,d);return h.default.createElement(D.default,{draggableId:n,droppableId:this.context[C.droppableIdKey],type:r,targetRef:this.state.ref},h.default.createElement(_.default,{speed:f,destination:o,onMoveEnd:this.onMoveEnd},function(t){return h.default.createElement(S.default,{isEnabled:!l,callbacks:e.callbacks,draggableRef:e.state.ref},function(n){return c(e.getProvided(i,a,u,d,s,n,t),e.getSnapshot(i,a))})}))},t}(g.Component);W.propTypes={isDragging:p.default.bool.isRequired,isDropAnimating:p.default.bool.isRequired,isAnotherDragging:p.default.bool.isRequired,canAnimate:p.default.bool.isRequired,offset:p.default.shape({x:p.default.number.isRequired,y:p.default.number.isRequired}).isRequired,dimension:p.default.shape({id:p.default.string.isRequired,droppableId:p.default.string.isRequired,page:p.default.shape({withMargin:p.default.shape({top:p.default.number.isRequired,left:p.default.number.isRequired,bottom:p.default.number.isRequired,right:p.default.number.isRequired,width:p.default.number.isRequired,height:p.default.number.isRequired,center:p.default.shape({x:p.default.number.isRequired,y:p.default.number.isRequired}).isRequired}).isRequired,withoutMargin:p.default.shape({top:p.default.number.isRequired,left:p.default.number.isRequired,bottom:p.default.number.isRequired,right:p.default.number.isRequired,width:p.default.number.isRequired,height:p.default.number.isRequired,center:p.default.shape({x:p.default.number.isRequired,y:p.default.number.isRequired}).isRequired}).isRequired}).isRequired,client:p.default.shape({withMargin:p.default.shape({top:p.default.number.isRequired,left:p.default.number.isRequired,bottom:p.default.number.isRequired,right:p.default.number.isRequired,width:p.default.number.isRequired,height:p.default.number.isRequired,center:p.default.shape({x:p.default.number.isRequired,y:p.default.number.isRequired}).isRequired}).isRequired,withoutMargin:p.default.shape({top:p.default.number.isRequired,left:p.default.number.isRequired,bottom:p.default.number.isRequired,right:p.default.number.isRequired,width:p.default.number.isRequired,height:p.default.number.isRequired,center:p.default.shape({x:p.default.number.isRequired,y:p.default.number.isRequired}).isRequired}).isRequired}).isRequired}),lift:p.default.func.isRequired,move:p.default.func.isRequired,moveByWindowScroll:p.default.func.isRequired,moveForward:p.default.func.isRequired,moveBackward:p.default.func.isRequired,drop:p.default.func.isRequired,cancel:p.default.func.isRequired,dropAnimationFinished:p.default.func.isRequired,draggableId:p.default.string.isRequired,children:p.default.func.isRequired,type:p.default.string,isDragDisabled:p.default.bool},W.defaultProps={isDragDisabled:!1,type:"DEFAULT"},W.contextTypes=(0,i.default)({},C.droppableIdKey,g.PropTypes.string.isRequired),t.default=W},function(e,t){e.exports=require("invariant")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(34),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var o=n(28),i=n(29),a=n(15),u=r(a),d=n(25),l=n(35),s=n(37),c=r(s),f=function(e){return e.dimension.request},p=function(e,t){return t.type},g=t.makeSelector=function(){var e=(0,u.default)(function(e){return{shouldPublish:e}});return(0,i.createSelector)([p,f],function(t,n){return e(t===n)})},h=function(){var e=g();return function(t,n){return e(t,n)}},v={publish:l.publishDraggableDimension};t.default=(0,o.connect)(h,v,null,{storeKey:d.storeKey})(c.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.lift=t.dropAnimationFinished=t.drop=t.completeDrop=t.cancel=t.moveForward=t.moveBackward=t.moveByWindowScroll=t.move=t.updateDroppableDimensionScroll=t.publishDroppableDimension=t.publishDraggableDimension=t.requestDimensions=void 0;var o=n(36),i=r(o),a=n(16),u=t.requestDimensions=function(e){return{type:"REQUEST_DIMENSIONS",payload:e}},d=function(){return{type:"BEGIN_LIFT"}},l=function(e,t,n,r,o){return{type:"COMPLETE_LIFT",payload:{id:e,type:t,client:n,page:r,windowScroll:o}}},s=(t.publishDraggableDimension=function(e){return{type:"PUBLISH_DRAGGABLE_DIMENSION",payload:e}},t.publishDroppableDimension=function(e){return{type:"PUBLISH_DROPPABLE_DIMENSION",payload:e}},t.updateDroppableDimensionScroll=function(e,t){return{type:"UPDATE_DROPPABLE_DIMENSION_SCROLL",payload:{id:e,offset:t}}},t.move=function(e,t,n,r){return{type:"MOVE",payload:{id:e,client:t,page:n,windowScroll:r}}},t.moveByWindowScroll=function(e,t){return{type:"MOVE_BY_WINDOW_SCROLL",payload:{id:e,windowScroll:t}}},t.moveBackward=function(e){return{type:"MOVE_BACKWARD",payload:e}},t.moveForward=function(e){return{type:"MOVE_FORWARD",payload:e}},t.cancel=function(e){return{type:"CANCEL",payload:e}}),c=function(e,t){return{type:"DROP_ANIMATE",payload:{newHomeOffset:e,result:t}}},f=t.completeDrop=function(e){return{type:"DROP_COMPLETE",payload:e}};t.drop=function(e){return function(t,n){var r=n();if("COLLECTING_DIMENSIONS"===r.phase)return console.error("canceling drag while collecting"),void t(s(e));if("DRAGGING"!==r.phase)return console.error("cannot drop if not dragging",r),void t(s(e));if(!r.drag)return console.error("invalid drag state",r),void t(s(e));var o=r.drag,u=o.impact,d=o.initial,l=o.current,p=r.dimension.droppable[d.source.droppableId],g={draggableId:l.id,source:d.source,destination:u.destination},h=(0,a.subtract)(p.scroll.initial,p.scroll.current),v=(0,i.default)({movement:u.movement,clientOffset:l.client.offset,pageOffset:l.page.offset,scrollDiff:h,draggables:r.dimension.draggable}),b=!(0,a.isEqual)(l.client.offset,v);return b?void t(c(v,g)):void t(f(g))}},t.dropAnimationFinished=function(e){return function(t,n){var r=n();return"DROP_ANIMATING"!==r.phase?(console.error("cannot end drop that is no longer animating",r),void t(s(e))):r.drop&&r.drop.pending?void t(f(r.drop.pending.result)):(console.error("cannot end drop that has no pending state",r),void t(s(e)))}},t.lift=function(e,t,n,r,o){return function(i,a){!function(){var e=a();if("DROP_ANIMATING"===e.phase){if(!e.drop||!e.drop.pending)return console.error("cannot flush drop animation if there is no pending"),void i(s("super cool id"));i(f(e.drop.pending.result))}}(),setTimeout(function(){var c=a();"IDLE"===c.phase&&"DRAG_COMPLETE"===c.phase||i(s("some-fake-id")),i(d()),i(u(t)),setTimeout(function(){var u=a();"COLLECTING_DIMENSIONS"===u.phase&&i(l(e,t,n,r,o))})})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16);t.default=function(e){var t=e.movement,n=e.clientOffset,o=e.pageOffset,i=e.scrollDiff,a=e.draggables;if(!t.draggables.length)return i;var u=t.draggables.reduce(function(e,t){var n=a[t];return e+n.page.withMargin.height},0),d=t.isMovingForward?u:-u,l={x:0,y:d},s=(0,r.subtract)(l,o),c=(0,r.add)(s,n),f=(0,r.add)(c,i);return f}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),i=r(o),a=n(6),u=r(a),d=n(7),l=r(d),s=n(8),c=r(s),f=n(9),p=n(32),g=r(p),h=n(38),v=r(h),b=n(39),m=function(e){function t(){var n,r,o;(0,i.default)(this,t);for(var a=arguments.length,d=Array(a),l=0;l<a;l++)d[l]=arguments[l];return n=r=(0,u.default)(this,e.call.apply(e,[this].concat(d))),r.getDimension=function(){var e=r.props,t=e.draggableId,n=e.droppableId,o=e.targetRef;(0,g.default)(o,"DraggableDimensionPublisher cannot calculate a dimension when not attached to the DOM");var i=window.getComputedStyle(o),a={top:parseInt(i.marginTop,10),right:parseInt(i.marginRight,10),bottom:parseInt(i.marginBottom,10),left:parseInt(i.marginLeft,10)},u=(0,b.getDraggableDimension)({id:t,droppableId:n,clientRect:o.getBoundingClientRect(),margin:a,windowScroll:(0,v.default)()});return u},o=n,(0,u.default)(r,o)}return(0,l.default)(t,e),t.prototype.componentWillReceiveProps=function(e){var t=!this.props.shouldPublish&&e.shouldPublish;t&&this.props.publish(this.getDimension())},t.prototype.render=function(){return this.props.children},t}(f.Component);m.propTypes={shouldPublish:c.default.bool.isRequired,publish:c.default.func.isRequired,draggableId:c.default.string.isRequired,droppableId:c.default.string.isRequired,type:c.default.string.isRequired,targetRef:c.default.any,children:c.default.any},t.default=m},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{x:window.pageXOffset,y:window.pageYOffset}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={x:0,y:0},r=t.noMargin={top:0,right:0,bottom:0,left:0},o=function(e,t){var n=e.top,r=e.right,o=e.bottom,i=e.left,a=e.width,u=e.height;return{top:n+t.y,left:i+t.x,bottom:o+t.y,right:r+t.x,height:u,width:a}},i=function(e,t){var n=e.top,r=e.right,o=e.bottom,i=e.left,a=e.height,u=e.width;return{top:n+t.top,left:i+t.left,bottom:o+t.bottom,right:r+t.right,height:a+t.top+t.bottom,width:u+t.left+t.right}},a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x,width:e.width,height:e.height,center:{x:(e.right+t.x+(e.left+t.x))/2,y:(e.bottom+t.y+(e.top+t.y))/2}}};t.getDraggableDimension=function(e){var t=e.id,u=e.droppableId,d=e.clientRect,l=e.margin,s=void 0===l?r:l,c=e.windowScroll,f=void 0===c?n:c,p=o(d,f),g=i(p,s),h={id:t,droppableId:u,client:{withoutMargin:a(d),withMargin:a(i(d,s))},page:{withoutMargin:a(p),withMargin:a(g)}};return h},t.getDroppableDimension=function(e){var t=e.id,u=e.clientRect,d=e.margin,l=void 0===d?r:d,s=e.windowScroll,c=void 0===s?n:s,f=e.scroll,p=void 0===f?n:f,g=o(u,c),h=i(g,l),v={id:t,scroll:{initial:p,current:p},page:{withoutMargin:a(g),withMargin:a(h)}};return v}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(41),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),i=r(o),a=n(6),u=r(a),d=n(7),l=r(d),s=n(8),c=r(s),f=n(9),p=r(f),g=n(42),h=n(43),v={x:0,y:0},b={transform:null},m=function(e){return e.x===v.x&&e.y===v.y},y=function(e,t,n){if(e)return b;var r={x:t,y:n};if(m(r))return b;var o={transform:"translate("+r.x+"px, "+r.y+"px)"};return o},w=function(e){function t(){var n,r,o;(0,i.default)(this,t);for(var a=arguments.length,d=Array(a),l=0;l<a;l++)d[l]=arguments[l];return n=r=(0,u.default)(this,e.call.apply(e,[this].concat(d))),r.onRest=function(){var e=r.props.onMoveEnd;e&&setTimeout(function(){return e()})},r.getFinal=function(){var e=r.props.destination,t=r.props.speed;if("INSTANT"===t)return e;var n="FAST"===t?h.physics.fast:h.physics.standard;return{x:(0,g.spring)(e.x,n),y:(0,g.spring)(e.y,n)}},o=n,(0,u.default)(r,o)}return(0,l.default)(t,e),t.prototype.render=function(){var e=this,t=this.getFinal(),n=m(t);return p.default.createElement(g.Motion,{defaultStyle:v,style:t,onRest:this.onRest},function(t){return e.props.children(y(n,t.x,t.y))})},t}(f.Component);w.propTypes={children:c.default.func.isRequired,speed:c.default.oneOf(["INSTANT","STANDARD","FAST"]).isRequired,destination:c.default.shape({x:c.default.number.isRequired,y:c.default.number.isRequired}),onMoveEnd:c.default.func},w.defaultProps={destination:v},t.default=w},function(e,t){e.exports=require("react-motion")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.css=t.physics=void 0;var o=n(14),i=r(o);t.physics=function(){var e={stiffness:1e3,damping:60,precision:.99},t=(0,i.default)({},e),n=(0,i.default)({},e,{stiffness:2*e.stiffness});return{standard:t,fast:n}}(),t.css={outOfTheWay:"transform 0.2s cubic-bezier(0.2, 0, 0, 1)"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(45),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{ | ||
value:!0}),t.sloppyClickThreshold=void 0;var i=n(5),a=o(i),u=n(6),d=o(u),l=n(7),s=o(l),c=n(8),f=o(c),p=n(9),g=n(32),h=o(g),v=n(15),b=o(v),m=n(46),y=o(m),w=n(47),D=r(w),M=function(){},_=function(){return!1},R=0,S=t.sloppyClickThreshold=5,I=function(e){function t(){var n,r,o;(0,a.default)(this,t);for(var i=arguments.length,u=Array(i),l=0;l<i;l++)u[l]=arguments[l];return n=r=(0,d.default)(this,e.call.apply(e,[this].concat(u))),r.state={draggingWith:null,pending:null},r.ifDragging=function(e){r.state.draggingWith&&e()},r.memoizedMove=(0,b.default)(function(e,t){var n={x:e,y:t};r.props.callbacks.onMove(n)}),r.scheduleMove=(0,y.default)(function(e){r.ifDragging(function(){return r.memoizedMove(e.x,e.y)})}),r.scheduleMoveForward=(0,y.default)(function(){r.ifDragging(r.props.callbacks.onMoveForward)}),r.scheduleMoveBackward=(0,y.default)(function(){r.ifDragging(r.props.callbacks.onMoveBackward)}),r.scheduleWindowScrollMove=(0,y.default)(function(){r.ifDragging(r.props.callbacks.onWindowScroll)}),r.onWindowResize=function(){return r.state.pending?void r.stopPendingMouseDrag():void(r.state.draggingWith&&r.stopDragging(function(){return r.props.callbacks.onCancel()}))},r.onWindowScroll=function(){var e=r.state.draggingWith;if(e)return"MOUSE"===e?void r.scheduleWindowScrollMove():void("KEYBOARD"===e&&r.stopDragging(function(){return r.props.callbacks.onCancel()}))},r.onWindowMouseMove=function(e){var t=r.state,n=t.draggingWith,o=t.pending;if("KEYBOARD"!==n){var i=e.button,a=e.clientX,u=e.clientY;if(i===R){var d={x:a,y:u};if(!o)return void r.scheduleMove(d);var l=Math.abs(o.x-d.x)>=S||Math.abs(o.y-d.y)>=S;l&&r.startDragging("MOUSE",function(){return r.props.callbacks.onLift(d)})}}},r.onWindowMouseUp=function(){return r.state.pending?void r.stopPendingMouseDrag():r.state.draggingWith?void("MOUSE"===r.state.draggingWith&&r.stopDragging(function(){return r.props.callbacks.onDrop()})):void console.error("should not be listening to mouse up events when nothing is dragging")},r.onWindowMouseDown=function(){r.stopDragging(function(){return r.props.callbacks.onCancel()})},r.onMouseDown=function(e){if("KEYBOARD"===r.state.draggingWith)return void r.stopDragging(function(){return r.props.callbacks.onCancel()});var t=e.button,n=e.clientX,o=e.clientY;if(t===R){e.stopPropagation(),e.preventDefault();var i={x:n,y:o};r.startPendingMouseDrag(i)}},r.onWindowKeydown=function(e){var t=Boolean(r.state.pending);return t?void(e.keyCode===D.escape&&(e.preventDefault(),r.stopPendingMouseDrag())):(r.state.draggingWith||(console.error("should not be listening to window mouse up if nothing is dragging"),r.stopDragging(function(){return r.props.callbacks.onCancel()})),e.keyCode===D.enter&&e.preventDefault(),e.keyCode===D.tab&&e.preventDefault(),e.keyCode===D.escape&&(e.preventDefault(),r.stopDragging(function(){return r.props.callbacks.onCancel()})),"MOUSE"===r.state.draggingWith?void(e.keyCode===D.space&&e.preventDefault()):(e.keyCode===D.space&&(e.preventDefault(),r.stopDragging(function(){return r.props.callbacks.onDrop()})),e.keyCode===D.arrowDown&&(e.preventDefault(),r.scheduleMoveForward()),void(e.keyCode===D.arrowUp&&(e.preventDefault(),r.scheduleMoveBackward()))))},r.onKeyDown=function(e){!r.props.isEnabled||r.state.pending||r.state.draggingWith||e.keyCode===D.space&&(e.preventDefault(),e.stopPropagation(),r.startDragging("KEYBOARD",function(){return r.props.callbacks.onKeyLift()}))},r.onClick=function(e){r.preventClick&&(r.preventClick=!1,e.preventDefault())},r.startPendingMouseDrag=function(e){if(r.state.draggingWith)return void console.error("cannot start a pending mouse drag when already dragging");if(r.state.pending)return void console.error("cannot start a pending mouse drag when there is already a pending position");r.bindWindowEvents();var t={draggingWith:null,pending:e};r.setState(t)},r.startDragging=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M;if(r.state.draggingWith)return void console.error("cannot start dragging when already dragging");if("MOUSE"===e&&!r.state.pending)return void console.error("cannot start mouse drag when there is not a pending position");"KEYBOARD"===e&&r.bindWindowEvents();var n={draggingWith:e,pending:null};r.setState(n,t)},r.stopPendingMouseDrag=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M;(0,h.default)(r.state.pending,"cannot stop pending drag when there is none"),r.preventClick=!1,r.unbindWindowEvents(),r.setState({draggingWith:null,pending:null},e)},r.stopDragging=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M;if(!r.state.draggingWith)return void console.error("cannot stop dragging when not dragging");r.unbindWindowEvents(),"MOUSE"===r.state.draggingWith&&(r.preventClick=!0);var t={draggingWith:null,pending:null};r.setState(t,e)},r.unbindWindowEvents=function(){window.removeEventListener("mousemove",r.onWindowMouseMove),window.removeEventListener("mouseup",r.onWindowMouseUp),window.removeEventListener("mousedown",r.onWindowMouseDown),window.removeEventListener("keydown",r.onWindowKeydown),window.removeEventListener("resize",r.onWindowResize),window.removeEventListener("scroll",r.onWindowScroll)},r.bindWindowEvents=function(){window.addEventListener("mousemove",r.onWindowMouseMove),window.addEventListener("mouseup",r.onWindowMouseUp),window.addEventListener("mousedown",r.onWindowMouseDown),window.addEventListener("keydown",r.onWindowKeydown),window.addEventListener("resize",r.onWindowResize),window.addEventListener("scroll",r.onWindowScroll,{passive:!0})},r.getProvided=(0,b.default)(function(e,t){if(!e)return null;var n={onMouseDown:r.onMouseDown,onKeyDown:r.onKeyDown,onClick:r.onClick,tabIndex:0,"aria-grabbed":t,draggable:!1,onDragStart:_,onDrop:_};return n}),o=n,(0,d.default)(r,o)}return(0,s.default)(t,e),t.prototype.componentWillUnmount=function(){this.state.draggingWith&&(this.preventClick=!1,this.unbindWindowEvents(),this.props.callbacks.onCancel())},t.prototype.componentWillReceiveProps=function(e){var t=this;if(!e.isEnabled)return this.state.pending?void this.stopPendingMouseDrag():void(this.state.draggingWith&&this.stopDragging(function(){return t.props.callbacks.onCancel()}))},t.prototype.render=function(){var e=this.props,t=e.children,n=e.isEnabled,r=this.state.draggingWith,o=Boolean(r);return t(this.getProvided(n,o))},t}(p.Component);I.propTypes={isEnabled:f.default.bool.isRequired,callbacks:f.default.shape({onLift:f.default.func.isRequired,onKeyLift:f.default.func.isRequired,onMove:f.default.func.isRequired,onWindowScroll:f.default.func.isRequired,onMoveForward:f.default.func.isRequired,onMoveBackward:f.default.func.isRequired,onDrop:f.default.func.isRequired,onCancel:f.default.func.isRequired}).isRequired,children:f.default.func.isRequired},t.default=I},function(e,t){e.exports=require("raf-schd")},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tab=9,t.enter=13,t.escape=27,t.space=32,t.arrowUp=38,t.arrowDown=40},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.getBoundingClientRect(),n=t.top,r=t.right,o=t.bottom,i=t.left,a=(i+r)/2,u=(n+o)/2;return{x:a,y:u}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),i=r(o),a=n(6),u=r(a),d=n(7),l=r(d),s=n(8),c=r(s),f=n(9),p=r(f),g=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,e.apply(this,arguments))}return(0,l.default)(t,e),t.prototype.render=function(){var e={width:this.props.width,height:this.props.height};return p.default.createElement("div",{style:e})},t}(f.PureComponent);g.propTypes={height:c.default.number.isRequired,width:c.default.number.isRequired},t.default=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(51),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var o=n(28),i=n(29),a=n(15),u=r(a),d=n(25),l=n(30),s=n(52),c=r(s),f=t.makeSelector=function(){var e=function(e,t){return t.droppableId},t=function(e,t){return t.isDropDisabled||!1},n=(0,u.default)(function(e,t){return!!t&&t.droppableId===e}),r=(0,u.default)(function(e){return{isDraggingOver:e}});return(0,i.createSelector)([l.phaseSelector,l.dragSelector,l.pendingDropSelector,e,t],function(e,t,o,i,a){if(a)return r(!1);if("DRAGGING"===e){if(!t)return console.error("cannot determine dragging over as there is not drag"),r(!1);var u=n(i,t.impact.destination);return r(u)}if("DROP_ANIMATING"===e){if(!o)return console.error("cannot determine dragging over as there is no pending result"),r(!1);var d=n(i,o.last.impact.destination);return r(d)}return r(!1)})},p=function(){var e=f();return function(t,n){return e(t,n)}};t.default=(0,o.connect)(p(),null,null,{storeKey:d.storeKey})(c.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),i=r(o),a=n(5),u=r(a),d=n(6),l=r(d),s=n(7),c=r(s),f=n(8),p=r(f),g=n(9),h=r(g),v=n(53),b=r(v),m=n(25),y=function(e){function t(){var n,r,o;(0,u.default)(this,t);for(var i=arguments.length,a=Array(i),d=0;d<i;d++)a[d]=arguments[d];return n=r=(0,l.default)(this,e.call.apply(e,[this].concat(a))),r.state={ref:null},r.setRef=function(e){null!==e&&e!==r.state.ref&&r.setState({ref:e})},o=n,(0,l.default)(r,o)}return(0,c.default)(t,e),t.prototype.getChildContext=function(){var e=(0,i.default)({},m.droppableIdKey,this.props.droppableId);return e},t.prototype.render=function(){var e={innerRef:this.setRef},t={isDraggingOver:this.props.isDraggingOver};return h.default.createElement(b.default,{droppableId:this.props.droppableId,type:this.props.type,targetRef:this.state.ref},this.props.children(e,t))},t}(g.Component);y.propTypes={droppableId:p.default.string.isRequired,isDropDisabled:p.default.bool,type:p.default.string,children:p.default.func.isRequired,isDraggingOver:p.default.bool.isRequired},y.defaultProps={type:"DEFAULT",isDropDisabled:!1},y.childContextTypes=(0,i.default)({},m.droppableIdKey,g.PropTypes.string.isRequired),t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(54),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var o=n(28),i=n(29),a=n(15),u=r(a),d=n(25),l=n(55),s=r(l),c=n(35),f=function(e){return e.dimension.request},p=function(e,t){return t.type},g=t.makeSelector=function(){var e=(0,u.default)(function(e){return{shouldPublish:e}});return(0,i.createSelector)([p,f],function(t,n){return e(t===n)})},h=function(){var e=g();return function(t,n){return e(t,n)}},v={publish:c.publishDroppableDimension,updateScroll:c.updateDroppableDimensionScroll};t.default=(0,o.connect)(h,v,null,{storeKey:d.storeKey})(s.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),i=r(o),a=n(6),u=r(a),d=n(7),l=r(d),s=n(8),c=r(s),f=n(9),p=n(32),g=r(p),h=n(46),v=r(h),b=n(15),m=r(b),y=n(38),w=r(y),D=n(39),M=n(56),_=r(M),R={x:0,y:0},S=function(e){function t(){var n,r,o;(0,i.default)(this,t);for(var a=arguments.length,d=Array(a),l=0;l<a;l++)d[l]=arguments[l];return n=r=(0,u.default)(this,e.call.apply(e,[this].concat(d))),r.isWatchingScroll=!1,r.closestScrollable=null,r.getScrollOffset=function(){if(!r.closestScrollable)return R;var e={x:r.closestScrollable.scrollLeft,y:r.closestScrollable.scrollTop};return e},r.getDimension=function(){var e=r.props,t=e.droppableId,n=e.targetRef;(0,g.default)(n,"DimensionPublisher cannot calculate a dimension when not attached to the DOM");var o=window.getComputedStyle(n),i={top:parseInt(o.marginTop,10),right:parseInt(o.marginRight,10),bottom:parseInt(o.marginBottom,10),left:parseInt(o.marginLeft,10)},a=(0,D.getDroppableDimension)({id:t,clientRect:n.getBoundingClientRect(),margin:i,windowScroll:(0,w.default)(),scroll:r.getScrollOffset()});return a},r.memoizedUpdateScroll=(0,m.default)(function(e,t){var n={x:e,y:t};r.props.updateScroll(r.props.droppableId,n)}),r.scheduleScrollUpdate=(0,v.default)(function(e){r.isWatchingScroll&&r.memoizedUpdateScroll(e.x,e.y)}),r.onClosestScroll=function(){r.scheduleScrollUpdate(r.getScrollOffset())},r.watchScroll=function(){(0,g.default)(r.props.targetRef,"cannot watch scroll if not in the dom"),null!=r.closestScrollable&&(r.isWatchingScroll||(r.isWatchingScroll=!0,r.closestScrollable.addEventListener("scroll",r.onClosestScroll,{passive:!0})))},r.unwatchScroll=function(){r.isWatchingScroll&&(r.isWatchingScroll=!1,r.closestScrollable.removeEventListener("scroll",r.onClosestScroll))},o=n,(0,u.default)(r,o)}return(0,l.default)(t,e),t.prototype.componentWillUnmount=function(){this.isWatchingScroll&&this.unwatchScroll()},t.prototype.componentWillReceiveProps=function(e){e.targetRef!==this.props.targetRef&&this.isWatchingScroll&&(console.warn("changing targetRef while watching scroll!"),this.unwatchScroll());var t=!this.props.shouldPublish&&e.shouldPublish;return e.shouldPublish?void(t&&(this.closestScrollable=(0,_.default)(this.props.targetRef),this.props.publish(this.getDimension()),this.watchScroll())):void this.unwatchScroll()},t.prototype.render=function(){return this.props.children},t}(f.Component);S.propTypes={shouldPublish:c.default.bool.isRequired,publish:c.default.func.isRequired,updateScroll:c.default.func.isRequired,droppableId:c.default.string.isRequired,type:c.default.string.isRequired,targetRef:c.default.any,children:c.default.any},t.default=S},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.some(function(e){return"auto"===e||"scroll"===e})},r=function(e){var t=window.getComputedStyle(e);return n(t.overflow,t.overflowY)},o=function e(t){return null==t?null:r(t)?t:e(t.parentElement)};t.default=o}]); |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babel-runtime/helpers/defineProperty"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("redux"),require("redux-thunk"),require("babel-runtime/helpers/extends"),require("memoize-one"),require("babel-runtime/core-js/object/keys"),require("react-redux"),require("reselect"),require("invariant"),require("react-motion"),require("raf-schd")):"function"==typeof define&&define.amd?define(["babel-runtime/helpers/defineProperty","babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","prop-types","react","redux","redux-thunk","babel-runtime/helpers/extends","memoize-one","babel-runtime/core-js/object/keys","react-redux","reselect","invariant","react-motion","raf-schd"],t):"object"==typeof exports?exports["@atlaskit/dragAndDrop"]=t(require("babel-runtime/helpers/defineProperty"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("redux"),require("redux-thunk"),require("babel-runtime/helpers/extends"),require("memoize-one"),require("babel-runtime/core-js/object/keys"),require("react-redux"),require("reselect"),require("invariant"),require("react-motion"),require("raf-schd")):e["@atlaskit/dragAndDrop"]=t(e["babel-runtime/helpers/defineProperty"],e["babel-runtime/helpers/classCallCheck"],e["babel-runtime/helpers/possibleConstructorReturn"],e["babel-runtime/helpers/inherits"],e["prop-types"],e.react,e.redux,e["redux-thunk"],e["babel-runtime/helpers/extends"],e["memoize-one"],e["babel-runtime/core-js/object/keys"],e["react-redux"],e.reselect,e.invariant,e["react-motion"],e["raf-schd"])}(this,function(e,t,n,r,i,o,a,u,d,s,l,f,c,p,g,h){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Droppable=t.Draggable=t.DragDropContext=void 0;var i=n(2),o=r(i),a=n(25),u=r(a),d=n(50),s=r(d);t.DragDropContext=o.default,t.Draggable=u.default,t.Droppable=s.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(3),o=r(i);t.default=o.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(5),u=r(a),d=n(6),s=r(d),l=n(7),f=r(l),c=n(8),p=r(c),g=n(9),h=n(10),v=r(h),b=n(24),m=r(b),y=function(e){function t(){return(0,u.default)(this,t),(0,s.default)(this,e.apply(this,arguments))}return(0,f.default)(t,e),t.prototype.componentWillMount=function(){this.store=(0,v.default)(this.props)},t.prototype.getChildContext=function(){return(0,o.default)({},m.default,this.store)},t.prototype.render=function(){return this.props.children},t}(g.Component);y.propTypes={onDragStart:p.default.func,onDragEnd:p.default.func.isRequired,children:p.default.any},y.childContextTypes=(0,o.default)({},m.default,p.default.shape({dispatch:p.default.func.isRequired,subscribe:p.default.func.isRequired,getState:p.default.func.isRequired}).isRequired),t.default=y},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t){e.exports=i},function(e,t){e.exports=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(11),o=n(12),a=r(o),u=n(13),d=r(u),s=n(23),l=r(s),f=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||i.compose;t.default=function(e){return(0,i.createStore)(d.default,f((0,i.applyMiddleware)(a.default,(0,l.default)(e))))}},function(e,t){e.exports=a},function(e,t){e.exports=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(14),u=r(a),d=n(15),s=r(d),l=n(16),f=r(l),c=n(22),p=r(c),g=(0,s.default)(function(e){var t={phase:e||"IDLE",drag:null,drop:null,dimension:{request:null,draggable:{},droppable:{}}};return t});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g("IDLE"),t=arguments[1];if("BEGIN_LIFT"===t.type)return"IDLE"!==e.phase?(console.error("trying to start a lift while another is occurring"),e):g("COLLECTING_DIMENSIONS");if("REQUEST_DIMENSIONS"===t.type){if("COLLECTING_DIMENSIONS"!==e.phase)return console.error("trying to collect dimensions at the wrong time"),e;var n=t.payload;return{phase:"COLLECTING_DIMENSIONS",drag:null,drop:null,dimension:{request:n,draggable:{},droppable:{}}}}if("PUBLISH_DRAGGABLE_DIMENSION"===t.type){var r=t.payload;return"COLLECTING_DIMENSIONS"!==e.phase?(console.warn("dimension rejected as no longer requesting dimensions",r),e):e.dimension.draggable[r.id]?(console.error("dimension already exists for "+r.id),e):(0,u.default)({},e,{dimension:{request:e.dimension.request,droppable:e.dimension.droppable,draggable:(0,u.default)({},e.dimension.draggable,(0,o.default)({},r.id,r))}})}if("PUBLISH_DROPPABLE_DIMENSION"===t.type){var i=t.payload;return"COLLECTING_DIMENSIONS"!==e.phase?(console.warn("dimension rejected as no longer requesting dimensions",i),e):e.dimension.droppable[i.id]?(console.error("dimension already exists for "+i.id),e):(0,u.default)({},e,{dimension:{request:e.dimension.request,draggable:e.dimension.draggable,droppable:(0,u.default)({},e.dimension.droppable,(0,o.default)({},i.id,i))}})}if("COMPLETE_LIFT"===t.type){if("COLLECTING_DIMENSIONS"!==e.phase)return console.error("trying complete lift without collecting dimensions"),e;var a=t.payload,d=a.id,s=a.type,l=a.center,c=a.selection,h=(0,f.default)(l,d,e.dimension.draggable,e.dimension.droppable),v=h.destination;if(!v)return console.error("lifting a draggable that is not inside a droppable"),g();var b={source:v,center:l,selection:c,dimension:e.dimension.draggable[d]},m={id:d,type:s,offset:{x:0,y:0},center:l,shouldAnimate:!1};return(0,u.default)({},e,{phase:"DRAGGING",drag:{initial:b,current:m,impact:h}})}if("MOVE"===t.type){if("DRAGGING"!==e.phase)return console.error("cannot move while not dragging",t),g();if(null==e.drag)return console.error("cannot move if there is no drag information"),g();var y=t.payload,D=y.offset,M=y.center,_=e.drag.current,w=e.drag.initial,R={id:_.id,type:_.type,center:M,offset:D,shouldAnimate:!1},O=(0,f.default)(R.center,R.id,e.dimension.draggable,e.dimension.droppable),I={initial:w,impact:O,current:R};return(0,u.default)({},e,{drag:I})}if("MOVE_FORWARD"===t.type||"MOVE_BACKWARD"===t.type){if("DRAGGING"!==e.phase)return console.error("cannot move while not dragging",t),g();if(!e.drag)return console.error("cannot move if there is no drag information"),g();var E=e.drag;if(!E.impact.destination)return console.warn("cannot move forward when there is not previous location"),e;var q="MOVE_FORWARD"===t.type,x=(0,p.default)(q,E.current.id,E.impact.destination,e.dimension.draggable,e.dimension.droppable);if(!x)return e;var P={x:E.current.offset.x+x.x,y:E.current.offset.y+x.y},C={x:E.current.center.x+x.x,y:E.current.center.y+x.y},S={id:E.current.id,type:E.current.type,offset:P,center:C,shouldAnimate:!0},A=(0,f.default)(S.center,S.id,e.dimension.draggable,e.dimension.droppable);return(0,u.default)({},e,{drag:{initial:E.initial,current:S,impact:A}})}if("DROP_ANIMATE"===t.type){var N=t.payload,k=N.newHomeOffset,L=N.result;if("DRAGGING"!==e.phase)return console.error("cannot animate drop while not dragging",t),e;if(!e.drag)return console.error("cannot animate drop - invalid drag state"),g();var T={newHomeOffset:k,result:L,last:e.drag};return{phase:"DROP_ANIMATING",drag:null,drop:{pending:T,result:null},dimension:{request:null,draggable:{},droppable:{}}}}if("DROP_COMPLETE"===t.type){var W=t.payload;return{phase:"DROP_COMPLETE",drag:null,drop:{pending:null,result:W},dimension:{request:null,draggable:{},droppable:{}}}}return"CANCEL"===t.type?g():e}},function(e,t){e.exports=d},function(e,t){e.exports=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(17),o=r(i),a=n(20),u=r(a),d=n(21),s=r(d);t.default=function(e,t,n,r){var i=(0,o.default)(e,r);if(!i)return s.default;var a=n[t],d=r[i],l=e.y-a.center.y>0,f=(0,u.default)(d,n),c=f.filter(function(t){return t!==a&&(l?!(t.center.y<a.center.y)&&e.y>t.withMargin.top:!(a.center.y<t.center.y)&&e.y<t.withMargin.bottom)}).map(function(e){return e.id}),p=f.indexOf(a),g=function(){return c.length?l?p+c.length:p-c.length:p}(),h=g!==p?a.withMargin.height:0,v={amount:h,draggables:c,isMovingForward:l},b={movement:v,destination:{droppableId:i,index:g}};return b}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=r(i),a=n(19),u=r(a);t.default=function(e,t){var n=(0,o.default)(t).find(function(n){return(0,u.default)(e,t[n])});return n||null}},function(e,t){e.exports=l},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=t.withMargin,r=n.top,i=n.right,o=n.bottom,a=n.left;return e.x>=a&&e.x<=i&&e.y>=r&&e.y<=o}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=r(i),a=n(15),u=r(a),d=n(19),s=r(d);t.default=(0,u.default)(function(e,t){return(0,o.default)(t).map(function(e){return t[e]}).filter(function(t){return(0,s.default)(t.center,e)}).sort(function(e,t){return e.center.y-t.center.y})})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={draggables:[],amount:0,isMovingForward:!1},r={movement:n,destination:null};t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(15),o=r(i),a=n(20),u=r(a),d=(0,o.default)(function(e,t){return e.indexOf(t)});t.default=function(e,t,n,r,i){var o=i[n.droppableId],a=r[t],s=n.index,l=(0,u.default)(o,r),f=d(l,a);if(f===-1)return console.error("could not find draggable inside current droppable"),null;if(e&&s===l.length-1)return null;if(!e&&0===s)return null;var c=l[s],p=e?s+1:s-1,g=l[p],h=e&&p<=f||!e&&p>=f,v=h?c.withMargin.height:g.withMargin.height,b={x:0,y:e?v:-v};return b}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(15),o=r(i),a=function(e){return(0,o.default)(function(t,n){var r=e.onDragStart,i=e.onDragEnd,o=t.phase,a=n.phase;if("DRAGGING"===o&&"DRAGGING"!==a){if(!r)return;return t.drag?void r(t.drag.current.id,t.drag.initial.source):void console.error("cannot fire onDragStart hook without drag state",{current:t,previous:n})}if("DROP_COMPLETE"===o&&"DROP_COMPLETE"!==a){if(!t.drop||!t.drop.result)return void console.error("cannot fire onDragEnd hook without drag state",{current:t,previous:n});var u=t.drop.result,d=u.source,s=u.destination,l=u.draggableId;if(!s)return void i(t.drop.result);var f=d.droppableId!==s.droppableId||d.index!==s.index;if(f)return void i(t.drop.result);var c={draggableId:l,source:d,destination:null};i(c)}if("IDLE"===o&&"DRAGGING"===a){if(!n.drag)return void console.error("cannot fire onDragEnd for cancel because cannot find previous drag");var p={draggableId:n.drag.current.id,source:n.drag.initial.source,destination:null};i(p)}if("IDLE"===o&&"DROP_ANIMATING"===a){if(!n.drop||!n.drop.pending)return void console.error("cannot fire onDragEnd for cancel because cannot find previous pending drop");var g={draggableId:n.drop.pending.result.draggableId,source:n.drop.pending.result.source,destination:null};i(g)}})};t.default=function(e){var t=a(e);return function(e){return function(n){return function(r){var i=e.getState(),o=n(r),a=e.getState();return t(a,i),o}}}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="private-drag-drop-store-key-do-not-use"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(26),o=r(i);t.default=o.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var i=n(15),o=r(i),a=n(27),u=n(28),d=n(29),s=n(30),l=r(s),f=n(24),c=r(f),p=n(37),g={x:0,y:0},h={isDropAnimating:!1,isDragging:!1,canAnimate:!0,offset:g,initial:null},v=t.makeSelector=function(){var e=function(e,t){return t.draggableId},t=(0,o.default)(function(e,t){return{x:e,y:t}}),n=(0,o.default)(function(e){return{isDropAnimating:!1,isDragging:!1,canAnimate:!0,offset:e,initial:null}}),r=(0,o.default)(function(e,r){var i=r.draggables.indexOf(e)!==-1;if(!i)return h;var o=r.isMovingForward?-r.amount:r.amount;return n(t(0,o))});return(0,u.createSelector)([d.phaseSelector,d.dragSelector,d.pendingDropSelector,e],function(e,t,n,i){if("DRAGGING"===e){if(!t)return console.error("invalid dragging state"),h;var o=t.current,a=t.initial,u=t.impact;if(o.id!==i)return r(i,u.movement);var d=o.offset,s=o.shouldAnimate;return{isDragging:!0,isDropAnimating:!1,canAnimate:s,offset:d,initial:a}}return"DROP_ANIMATING"===e?n?n.last.current.id!==i?r(i,n.last.impact.movement):{isDragging:!0,isDropAnimating:!0,canAnimate:!0,offset:n.newHomeOffset,initial:n.last.initial}:(console.error("cannot animate drop without a pending drop"),h):"DROP_COMPLETE"===e?{offset:g,isDropAnimating:!1,isDragging:!1,canAnimate:!1,initial:null}:h})},b=function(){var e=v();return function(t,n){return e(t,n)}},m={lift:p.lift,move:p.move,moveBackward:p.moveBackward,moveForward:p.moveForward,drop:p.drop,dropAnimationFinished:p.dropAnimationFinished,cancel:p.cancel};t.default=(0,a.connect)(b(),m,null,{storeKey:c.default})(l.default)},function(e,t){e.exports=f},function(e,t){e.exports=c},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.phaseSelector=function(e){return e.phase},t.pendingDropSelector=function(e){return e.drop&&e.drop.pending?e.drop.pending:null},t.dragSelector=function(e){return e.drag}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.zIndexOptions=void 0;var i=n(5),o=r(i),a=n(6),u=r(a),d=n(7),s=r(d),l=n(8),f=r(l),c=n(9),p=r(c),g=n(15),h=r(g),v=n(31),b=r(v),m=n(32),y=n(40),D=r(y),M=n(44),_=r(M),w=n(43),R=n(48),O=r(R),I=n(49),E=r(I),q=t.zIndexOptions={dragging:5e3,dropAnimating:4500},x=function(e){function t(n,r){(0,o.default)(this,t);var i=(0,u.default)(this,e.call(this,n,r));return i.state={ref:null},i.onMoveEnd=function(){i.props.isDropAnimating&&i.props.dropAnimationFinished(i.props.draggableId)},i.onLift=function(e){i.throwIfCannotDrag();var t=i.props,n=t.lift,r=t.draggableId,o=t.type,a=(0,O.default)(i.state.ref);n(r,o,a,e)},i.onKeyLift=function(){i.throwIfCannotDrag();var e=i.props,t=e.lift,n=e.draggableId,r=e.type,o=(0,O.default)(i.state.ref);t(n,r,o,o)},i.onMove=function(e){i.throwIfCannotDrag();var t=i.props,n=t.draggableId,r=t.initial,o=t.move;if(r){var a={x:e.x-r.selection.x,y:e.y-r.selection.y},u={x:r.center.x+a.x,y:r.center.y+a.y};o(n,a,u)}},i.onMoveForward=function(){i.throwIfCannotDrag(),i.props.moveForward(i.props.draggableId)},i.onMoveBackward=function(){i.throwIfCannotDrag(),i.props.moveBackward(i.props.draggableId)},i.onDrop=function(){i.throwIfCannotDrag(),i.props.drop(i.props.draggableId)},i.onCancel=function(){i.props.cancel(i.props.draggableId)},i.setRef=function(e){null!==e&&e!==i.state.ref&&i.setState({ref:e})},i.getDraggingStyle=(0,h.default)(function(e,t,n,r){var i={position:"absolute",boxSizing:"border-box",zIndex:n?q.dropAnimating:q.dragging,width:e,height:t,transform:r.transform};return i}),i.getNotDraggingStyle=(0,h.default)(function(e,t){var n={transition:e?w.css.outOfTheWay:null,transform:t.transform};return n}),i.getProvided=(0,h.default)(function(e,t,n,r,o,a){var u=function(){if(!e)return i.getNotDraggingStyle(n,a);(0,b.default)(r,"initial dimension required for dragging");var o=r.dimension.withoutMargin,u=o.width,d=o.height;return i.getDraggingStyle(u,d,t,a)}(),d={innerRef:i.setRef,placeholder:e||t?i.getPlaceholder():null,dragHandleProps:o,draggableStyle:u};return d}),i.getSnapshot=(0,h.default)(function(e){return{isDragging:e}}),i.getSpeed=(0,h.default)(function(e,t,n){return n?t?"STANDARD":e?"FAST":"INSTANT":"INSTANT"}),i.callbacks={onLift:i.onLift,onMove:i.onMove,onDrop:i.onDrop,onCancel:i.onCancel,onKeyLift:i.onKeyLift,onMoveBackward:i.onMoveBackward,onMoveForward:i.onMoveForward},i}return(0,s.default)(t,e),t.prototype.throwIfCannotDrag=function(){(0,b.default)(this.state.ref,"Draggable: cannot drag as no DOM node has been provided"),(0,b.default)(!this.props.isDragDisabled,"Draggable: cannot drag as dragging is not enabled")},t.prototype.getPlaceholder=function(){(0,b.default)(this.props.initial,"cannot get a drag placeholder when not dragging");var e=this.props.initial.dimension;return p.default.createElement(E.default,{height:e.withMargin.height,width:e.withMargin.width})},t.prototype.render=function(){var e=this,t=this.props,n=t.draggableId,r=t.type,i=t.offset,o=t.isDragging,a=t.isDropAnimating,u=t.canAnimate,d=t.isDragDisabled,s=t.initial,l=t.children,f=this.getSpeed(o,a,u);return p.default.createElement(m.DraggableDimensionPublisher,{itemId:n,type:r,targetRef:this.state.ref},p.default.createElement(D.default,{speed:f,destination:i,onMoveEnd:this.onMoveEnd},function(t){return p.default.createElement(_.default,{isEnabled:!d,callbacks:e.callbacks,draggableRef:e.state.ref},function(n){return l(e.getProvided(o,a,u,s,n,t),e.getSnapshot(o))})}))},t}(c.Component);x.propTypes={isDragging:f.default.bool.isRequired,isDropAnimating:f.default.bool.isRequired,canAnimate:f.default.bool.isRequired,offset:f.default.shape({x:f.default.number.isRequired,y:f.default.number.isRequired}).isRequired,initial:f.default.shape({source:f.default.shape({droppableId:f.default.string.isRequired,index:f.default.number.isRequired}).isRequired,center:f.default.shape({x:f.default.number.isRequired,y:f.default.number.isRequired}).isRequired,selection:f.default.shape({x:f.default.number.isRequired,y:f.default.number.isRequired}).isRequired,dimension:f.default.shape({id:f.default.string.isRequired,withMargin:f.default.shape({top:f.default.number.isRequired,right:f.default.number.isRequired,bottom:f.default.number.isRequired,left:f.default.number.isRequired,width:f.default.number.isRequired,height:f.default.number.isRequired}).isRequired,withoutMargin:f.default.shape({top:f.default.number.isRequired,right:f.default.number.isRequired,bottom:f.default.number.isRequired,left:f.default.number.isRequired,width:f.default.number.isRequired,height:f.default.number.isRequired}).isRequired,center:f.default.shape({x:f.default.number.isRequired,y:f.default.number.isRequired}).isRequired}).isRequired}),lift:f.default.func.isRequired,move:f.default.func.isRequired,moveForward:f.default.func.isRequired,moveBackward:f.default.func.isRequired,drop:f.default.func.isRequired,cancel:f.default.func.isRequired,dropAnimationFinished:f.default.func.isRequired,draggableId:f.default.string.isRequired,children:f.default.func.isRequired,type:f.default.string,isDragDisabled:f.default.bool},x.defaultProps={isDragDisabled:!1,type:"DEFAULT"},t.default=x},function(e,t){e.exports=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.DroppableDimensionPublisher=t.DraggableDimensionPublisher=void 0;var i=n(33),o=r(i),a=n(37);t.DraggableDimensionPublisher=(0,o.default)(a.publishDraggableDimension),t.DroppableDimensionPublisher=(0,o.default)(a.publishDroppableDimension)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var i=n(27),o=n(28),a=n(15),u=r(a),d=n(24),s=r(d),l=n(34),f=r(l),c=function(e){return e.dimension.request},p=function(e,t){return t.type},g=t.makeSelector=function(){var e=(0,u.default)(function(e){return{shouldPublish:e}});return(0,o.createSelector)([p,c],function(t,n){return e(!!n&&t===n)})},h=function(){var e=g();return function(t,n){return e(t,n)}};t.default=function(e){var t={publish:e};return(0,i.connect)(h,t,null,{storeKey:s.default})(f.default)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=r(i),a=n(6),u=r(a),d=n(7),s=r(d),l=n(8),f=r(l),c=n(9),p=n(31),g=r(p),h=n(35),v=r(h),b=n(36),m=r(b),y=function(e){function t(){var n,r,i;(0,o.default)(this,t);for(var a=arguments.length,d=Array(a),s=0;s<a;s++)d[s]=arguments[s];return n=r=(0,u.default)(this,e.call.apply(e,[this].concat(d))),r.getDimension=function(){var e=r.props,t=e.itemId,n=e.targetRef;(0,g.default)(n,"DimensionPublisher cannot calculate a dimension when not attached to the DOM");var i=window.getComputedStyle(n),o={top:parseInt(i.marginTop,10),right:parseInt(i.marginRight,10),bottom:parseInt(i.marginBottom,10),left:parseInt(i.marginLeft,10)};return(0,m.default)(t,n.getBoundingClientRect(),o,(0,v.default)())},i=n,(0,u.default)(r,i)}return(0,s.default)(t,e),t.prototype.componentWillReceiveProps=function(e){!this.props.shouldPublish&&e.shouldPublish&&this.props.publish(this.getDimension())},t.prototype.render=function(){return this.props.children},t}(c.Component);y.propTypes={shouldPublish:f.default.bool.isRequired,publish:f.default.func.isRequired,itemId:f.default.string.isRequired,type:f.default.string.isRequired,targetRef:f.default.any,children:f.default.any},t.default=y},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{x:window.pageXOffset,y:window.pageYOffset}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r){var i=t.top,o=t.right,a=t.bottom,u=t.left,d=t.width,s=t.height,l={top:i+r.y,right:o+r.x,left:u+r.x,bottom:a+r.y},f={top:l.top,right:l.right,left:l.left,bottom:l.bottom,width:d,height:s},c={top:l.top+n.top,right:l.right+n.right,left:l.left+n.left,bottom:l.bottom+n.bottom,width:d+n.left+n.right,height:s+n.bottom+n.top},p={id:e,withoutMargin:f,withMargin:c,center:{x:(l.left+l.right)/2,y:(l.top+l.bottom)/2}};return p}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.lift=t.dropAnimationFinished=t.drop=t.completeDrop=t.cancel=t.moveForward=t.moveBackward=t.move=t.publishDroppableDimension=t.publishDraggableDimension=t.requestDimensions=void 0;var i=n(38),o=r(i),a=n(39),u=r(a),d=t.requestDimensions=function(e){return{type:"REQUEST_DIMENSIONS",payload:e}},s=function(){return{type:"BEGIN_LIFT"}},l=function(e,t,n,r){return{type:"COMPLETE_LIFT",payload:{id:e,type:t,center:n,selection:r}}},f=(t.publishDraggableDimension=function(e){return{type:"PUBLISH_DRAGGABLE_DIMENSION",payload:e}},t.publishDroppableDimension=function(e){return{type:"PUBLISH_DROPPABLE_DIMENSION",payload:e}},t.move=function(e,t,n){return{type:"MOVE",payload:{id:e,offset:t,center:n}}},t.moveBackward=function(e){return{type:"MOVE_BACKWARD",payload:e}},t.moveForward=function(e){return{type:"MOVE_FORWARD",payload:e}},t.cancel=function(e){return{type:"CANCEL",payload:e}}),c=function(e,t){return{type:"DROP_ANIMATE",payload:{newHomeOffset:e,result:t}}},p=t.completeDrop=function(e){return{type:"DROP_COMPLETE",payload:e}};t.drop=function(e){return function(t,n){var r=n();if("COLLECTING_DIMENSIONS"===r.phase)return console.error("canceling drag while collecting"),void t(f(e));if("DRAGGING"!==r.phase)return console.error("cannot drop if not dragging",r),void t(f(e));if(!r.drag)return console.error("invalid drag state",r),void t(f(e));var i=r.drag,a=i.impact,d=i.initial,s=i.current,l={draggableId:s.id,source:d.source,destination:a.destination},g=(0,o.default)(a.movement,s.offset,r.dimension.draggable),h=!(0,u.default)(s.offset,g);return h?void t(c(g,l)):void t(p(l))}},t.dropAnimationFinished=function(e){return function(t,n){var r=n();return"DROP_ANIMATING"!==r.phase?(console.error("cannot end drop that is no longer animating",r),void t(f(e))):r.drop&&r.drop.pending?void t(p(r.drop.pending.result)):(console.error("cannot end drop that has no pending state",r),void t(f(e)))}},t.lift=function(e,t,n,r){return function(i,o){!function(){var e=o();if("DROP_ANIMATING"===e.phase){if(!e.drop||!e.drop.pending)return console.error("cannot flush drop animation if there is no pending"),void i(f("super cool id"));i(p(e.drop.pending.result))}}(),setTimeout(function(){var a=o();"IDLE"===a.phase&&"DRAG_COMPLETE"===a.phase||i(f("some-fake-id")),i(s()),i(d(t)),setTimeout(function(){var a=o();"COLLECTING_DIMENSIONS"===a.phase&&i(l(e,t,n,r))})})}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={x:0,y:0};t.default=function(e,t,r){if(!e.draggables.length)return n;var i=e.draggables.reduce(function(e,t){var n=r[t];return e+n.withMargin.height},0),o=e.isMovingForward?i:-i,a={x:0,y:o},u={x:0,y:t.y-a.y},d={x:0,y:t.y-u.y};return d}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return e.x===t.x&&e.y===t.y}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(41),o=r(i);t.default=o.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=r(i),a=n(6),u=r(a),d=n(7),s=r(d),l=n(8),f=r(l),c=n(9),p=r(c),g=n(42),h=n(43),v={x:0,y:0},b={transform:null},m=function(e){return e.x===v.x&&e.y===v.y},y=function(e,t,n){if(e)return b;var r={x:t,y:n};if(m(r))return b;var i={transform:"translate("+r.x+"px, "+r.y+"px)"};return i},D=function(e){function t(){var n,r,i;(0,o.default)(this,t);for(var a=arguments.length,d=Array(a),s=0;s<a;s++)d[s]=arguments[s];return n=r=(0,u.default)(this,e.call.apply(e,[this].concat(d))),r.onRest=function(){var e=r.props.onMoveEnd;e&&setTimeout(function(){return e()})},r.getFinal=function(){var e=r.props.destination,t=r.props.speed;if("INSTANT"===t)return e;var n="FAST"===t?h.physics.fast:h.physics.standard;return{x:(0,g.spring)(e.x,n),y:(0,g.spring)(e.y,n)}},i=n,(0,u.default)(r,i)}return(0,s.default)(t,e),t.prototype.render=function(){var e=this,t=this.getFinal(),n=m(t);return p.default.createElement(g.Motion,{defaultStyle:v,style:t,onRest:this.onRest},function(t){return e.props.children(y(n,t.x,t.y))})},t}(c.Component);D.propTypes={children:f.default.func.isRequired,speed:f.default.oneOf(["INSTANT","STANDARD","FAST"]).isRequired,destination:f.default.shape({x:f.default.number.isRequired,y:f.default.number.isRequired}),onMoveEnd:f.default.func},D.defaultProps={destination:v},t.default=D},function(e,t){e.exports=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.css=t.physics=void 0;var i=n(14),o=r(i);t.physics=function(){var e={stiffness:800,damping:60,precision:.9},t=(0,o.default)({},e),n=(0,o.default)({},e,{stiffness:2*e.stiffness});return{standard:t,fast:n}}(),t.css={outOfTheWay:"transform 0.2s cubic-bezier(0.2, 0, 0, 1)"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(45),o=r(i);t.default=o.default},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.sloppyClickThreshold=void 0;var o=n(5),a=i(o),u=n(6),d=i(u),s=n(7),l=i(s),f=n(8),c=i(f),p=n(9),g=n(31),h=i(g),v=n(15),b=i(v),m=n(46),y=i(m),D=n(47),M=r(D),_=n(35),w=i(_),R=function(){},O=function(){return!1},I=0,E=t.sloppyClickThreshold=5,q=function(e){function t(){var n,r,i;(0,a.default)(this,t);for(var o=arguments.length,u=Array(o),s=0;s<o;s++)u[s]=arguments[s];return n=r=(0,d.default)(this,e.call.apply(e,[this].concat(u))),r.state={draggingWith:null,pending:null},r.ifDragging=function(e){r.state.draggingWith&&e()},r.scheduleMove=(0,y.default)(function(e){r.ifDragging(function(){return r.props.callbacks.onMove(e)})}),r.scheduleMoveForward=(0,y.default)(function(){r.ifDragging(r.props.callbacks.onMoveForward)}),r.scheduleMoveBackward=(0,y.default)(function(){r.ifDragging(r.props.callbacks.onMoveBackward)}),r.onWindowResize=function(){return r.state.pending?void r.stopPendingMouseDrag():void r.stopDragging(function(){return r.props.callbacks.onCancel()})},r.onWindowMouseMove=function(e){var t=r.state,n=t.draggingWith,i=t.pending;if("KEYBOARD"!==n){var o=e.button,a=e.clientX,u=e.clientY;if(o===I){var d=(0,w.default)(),s={x:a+d.x,y:u+d.y};if(!i)return void r.scheduleMove(s);var l=Math.abs(i.x-s.x)>=E||Math.abs(i.y-s.y)>=E;l&&r.startDragging("MOUSE",function(){return r.props.callbacks.onLift(s)})}}},r.onWindowMouseUp=function(){return r.state.pending?void r.stopPendingMouseDrag():r.state.draggingWith?void("MOUSE"===r.state.draggingWith&&r.stopDragging(function(){return r.props.callbacks.onDrop()})):void console.error("should not be listening to mouse up events when nothing is dragging")},r.onWindowMouseDown=function(){"MOUSE"===r.state.draggingWith&&console.error("Should not be able to trigger a mousedown while a MOUSE drag\n is occurring. Expecting a mouseup first."),r.stopDragging(function(){return r.props.callbacks.onCancel()})},r.onMouseDown=function(e){if("KEYBOARD"===r.state.draggingWith)return void r.stopDragging(function(){return r.props.callbacks.onCancel()});var t=e.button,n=e.clientX,i=e.clientY;if(t===I){e.stopPropagation(),e.preventDefault();var o=(0,w.default)(),a={x:n+o.x,y:i+o.y};r.startPendingMouseDrag(a)}},r.onWindowKeydown=function(e){var t=Boolean(r.state.pending);return t?void(e.keyCode===M.escape&&(e.preventDefault(),r.stopPendingMouseDrag())):(r.state.draggingWith||(console.error("should not be listening to window mouse up if nothing is dragging"),r.stopDragging(function(){return r.props.callbacks.onCancel()})),e.keyCode===M.enter&&e.preventDefault(),e.keyCode===M.tab&&e.preventDefault(),e.keyCode===M.escape&&(e.preventDefault(),r.stopDragging(function(){return r.props.callbacks.onCancel()})),"MOUSE"===r.state.draggingWith?void(e.keyCode===M.space&&e.preventDefault()):(e.keyCode===M.space&&(e.preventDefault(),r.stopDragging(function(){return r.props.callbacks.onDrop()})),e.keyCode===M.arrowDown&&(e.preventDefault(),r.scheduleMoveForward()),void(e.keyCode===M.arrowUp&&(e.preventDefault(),r.scheduleMoveBackward()))))},r.onKeyDown=function(e){!r.props.isEnabled||r.state.pending||r.state.draggingWith||e.keyCode===M.space&&(e.preventDefault(),e.stopPropagation(),r.startDragging("KEYBOARD",function(){return r.props.callbacks.onKeyLift()}))},r.onClick=function(e){r.preventClick&&(r.preventClick=!1,e.preventDefault())},r.startPendingMouseDrag=function(e){if(r.state.draggingWith)return void console.error("cannot start a pending mouse drag when already dragging");if(r.state.pending)return void console.error("cannot start a pending mouse drag when there is already a pending position");r.bindWindowEvents();var t={draggingWith:null,pending:e};r.setState(t)},r.startDragging=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:R;if(r.state.draggingWith)return void console.error("cannot start dragging when already dragging"); | ||
if("MOUSE"===e&&!r.state.pending)return void console.error("cannot start mouse drag when there is not a pending position");"KEYBOARD"===e&&r.bindWindowEvents();var n={draggingWith:e,pending:null};r.setState(n,t)},r.stopPendingMouseDrag=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R;(0,h.default)(r.state.pending,"cannot stop pending drag when there is none"),r.preventClick=!1,r.unbindWindowEvents(),r.setState({draggingWith:null,pending:null},e)},r.stopDragging=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R;if(!r.state.draggingWith)return void console.error("cannot stop dragging when not dragging");r.unbindWindowEvents(),"MOUSE"===r.state.draggingWith&&(r.preventClick=!0);var t={draggingWith:null,pending:null};r.setState(t,e)},r.unbindWindowEvents=function(){window.removeEventListener("mousemove",r.onWindowMouseMove),window.removeEventListener("mouseup",r.onWindowMouseUp),window.removeEventListener("mousedown",r.onWindowMouseDown),window.removeEventListener("keydown",r.onWindowKeydown),window.removeEventListener("resize",r.onWindowResize)},r.bindWindowEvents=function(){window.addEventListener("mousemove",r.onWindowMouseMove),window.addEventListener("mouseup",r.onWindowMouseUp),window.addEventListener("mousedown",r.onWindowMouseDown),window.addEventListener("keydown",r.onWindowKeydown),window.addEventListener("resize",r.onWindowResize)},r.getProvided=(0,b.default)(function(e,t){if(!e)return null;var n={onMouseDown:r.onMouseDown,onKeyDown:r.onKeyDown,onClick:r.onClick,tabIndex:0,"aria-grabbed":t,draggable:!1,onDragStart:O,onDrop:O};return n}),i=n,(0,d.default)(r,i)}return(0,l.default)(t,e),t.prototype.componentWillUnmount=function(){this.state.draggingWith&&(this.preventClick=!1,this.unbindWindowEvents(),this.props.callbacks.onCancel())},t.prototype.componentWillReceiveProps=function(e){var t=this;if(!e.isEnabled)return this.state.pending?void this.stopPendingMouseDrag():void(this.state.draggingWith&&this.stopDragging(function(){return t.props.callbacks.onCancel()}))},t.prototype.render=function(){var e=this.props,t=e.children,n=e.isEnabled,r=this.state.draggingWith,i=Boolean(r);return t(this.getProvided(n,i))},t}(p.Component);q.propTypes={isEnabled:c.default.bool.isRequired,callbacks:c.default.shape({onLift:c.default.func.isRequired,onKeyLift:c.default.func.isRequired,onMove:c.default.func.isRequired,onMoveForward:c.default.func.isRequired,onMoveBackward:c.default.func.isRequired,onDrop:c.default.func.isRequired,onCancel:c.default.func.isRequired}).isRequired,children:c.default.func.isRequired},t.default=q},function(e,t){e.exports=h},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tab=9,t.enter=13,t.escape=27,t.space=32,t.arrowUp=38,t.arrowDown=40},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(35),o=r(i);t.default=function(e){var t=e.getBoundingClientRect(),n=t.top,r=t.right,i=t.bottom,a=t.left,u=(0,o.default)(),d=(a+u.x+(r+u.x))/2,s=(n+u.y+(i+u.y))/2;return{x:d,y:s}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=r(i),a=n(6),u=r(a),d=n(7),s=r(d),l=n(8),f=r(l),c=n(9),p=r(c),g=function(e){function t(){return(0,o.default)(this,t),(0,u.default)(this,e.apply(this,arguments))}return(0,s.default)(t,e),t.prototype.render=function(){var e={width:this.props.width,height:this.props.height};return p.default.createElement("div",{style:e})},t}(c.PureComponent);g.propTypes={height:f.default.number.isRequired,width:f.default.number.isRequired},t.default=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(51),o=r(i);t.default=o.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var i=n(27),o=n(28),a=n(15),u=r(a),d=n(24),s=r(d),l=n(29),f=n(52),c=r(f),p=t.makeSelector=function(){var e=function(e,t){return t.droppableId},t=function(e,t){return t.isDropDisabled||!1},n=(0,u.default)(function(e,t){return!!t&&t.droppableId===e}),r=(0,u.default)(function(e){return{isDraggingOver:e}});return(0,o.createSelector)([l.phaseSelector,l.dragSelector,l.pendingDropSelector,e,t],function(e,t,i,o,a){if(a)return r(!1);if("DRAGGING"===e){if(!t)return console.error("cannot determine dragging over as there is not drag"),r(!1);var u=n(o,t.impact.destination);return r(u)}if("DROP_ANIMATING"===e){if(!i)return console.error("cannot determine dragging over as there is no pending result"),r(!1);var d=n(o,i.last.impact.destination);return r(d)}return r(!1)})},g=function(){var e=p();return function(t,n){return e(t,n)}};t.default=(0,i.connect)(g(),null,null,{storeKey:s.default})(c.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=r(i),a=n(6),u=r(a),d=n(7),s=r(d),l=n(8),f=r(l),c=n(9),p=r(c),g=n(32),h=function(e){function t(){var n,r,i;(0,o.default)(this,t);for(var a=arguments.length,d=Array(a),s=0;s<a;s++)d[s]=arguments[s];return n=r=(0,u.default)(this,e.call.apply(e,[this].concat(d))),r.state={ref:null},r.setRef=function(e){null!==e&&e!==r.state.ref&&r.setState({ref:e})},i=n,(0,u.default)(r,i)}return(0,s.default)(t,e),t.prototype.render=function(){var e={innerRef:this.setRef},t={isDraggingOver:this.props.isDraggingOver};return p.default.createElement(g.DroppableDimensionPublisher,{itemId:this.props.droppableId,type:this.props.type,targetRef:this.state.ref},this.props.children(e,t))},t}(c.Component);h.propTypes={droppableId:f.default.string.isRequired,isDropDisabled:f.default.bool,type:f.default.string,children:f.default.func.isRequired,isDraggingOver:f.default.bool.isRequired},h.defaultProps={type:"DEFAULT",isDropDisabled:!1},t.default=h}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babel-runtime/helpers/defineProperty"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("redux"),require("redux-thunk"),require("babel-runtime/helpers/extends"),require("memoize-one"),require("babel-runtime/core-js/object/keys"),require("react-redux"),require("reselect"),require("invariant"),require("react-motion"),require("raf-schd")):"function"==typeof define&&define.amd?define(["babel-runtime/helpers/defineProperty","babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","prop-types","react","redux","redux-thunk","babel-runtime/helpers/extends","memoize-one","babel-runtime/core-js/object/keys","react-redux","reselect","invariant","react-motion","raf-schd"],t):"object"==typeof exports?exports["@atlaskit/dragAndDrop"]=t(require("babel-runtime/helpers/defineProperty"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("redux"),require("redux-thunk"),require("babel-runtime/helpers/extends"),require("memoize-one"),require("babel-runtime/core-js/object/keys"),require("react-redux"),require("reselect"),require("invariant"),require("react-motion"),require("raf-schd")):e["@atlaskit/dragAndDrop"]=t(e["babel-runtime/helpers/defineProperty"],e["babel-runtime/helpers/classCallCheck"],e["babel-runtime/helpers/possibleConstructorReturn"],e["babel-runtime/helpers/inherits"],e["prop-types"],e.react,e.redux,e["redux-thunk"],e["babel-runtime/helpers/extends"],e["memoize-one"],e["babel-runtime/core-js/object/keys"],e["react-redux"],e.reselect,e.invariant,e["react-motion"],e["raf-schd"])}(this,function(e,t,n,r,o,i,a,u,d,l,s,c,f,p,g,h){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Droppable=t.Draggable=t.DragDropContext=void 0;var o=n(2),i=r(o),a=n(26),u=r(a),d=n(50),l=r(d);t.DragDropContext=i.default,t.Draggable=u.default,t.Droppable=l.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(3),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),i=r(o),a=n(5),u=r(a),d=n(6),l=r(d),s=n(7),c=r(s),f=n(8),p=r(f),g=n(9),h=n(10),v=r(h),b=n(25),m=function(e){function t(){return(0,u.default)(this,t),(0,l.default)(this,e.apply(this,arguments))}return(0,c.default)(t,e),t.prototype.componentWillMount=function(){this.store=(0,v.default)(this.props)},t.prototype.getChildContext=function(){return(0,i.default)({},b.storeKey,this.store)},t.prototype.render=function(){return this.props.children},t}(g.Component);m.propTypes={onDragStart:p.default.func,onDragEnd:p.default.func.isRequired,children:p.default.any},m.childContextTypes=(0,i.default)({},b.storeKey,p.default.shape({dispatch:p.default.func.isRequired,subscribe:p.default.func.isRequired,getState:p.default.func.isRequired}).isRequired),t.default=m},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t){e.exports=o},function(e,t){e.exports=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(11),i=n(12),a=r(i),u=n(13),d=r(u),l=n(24),s=r(l),c=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||o.compose;t.default=function(e){return(0,o.createStore)(d.default,c((0,o.applyMiddleware)(a.default,(0,s.default)(e))))}},function(e,t){e.exports=a},function(e,t){e.exports=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),i=r(o),a=n(14),u=r(a),d=n(15),l=r(d),s=n(16),c=n(17),f=r(c),p=n(23),g=r(p),h=n(18),v=r(h),b={request:null,draggable:{},droppable:{}},m={x:0,y:0},y=(0,l.default)(function(e){var t={phase:e||"IDLE",drag:null,drop:null,dimension:b};return t}),w=function(e){var t=e.state,n=e.clientSelection,r=e.pageSelection,o=e.shouldAnimate,i=void 0!==o&&o,a=e.windowScroll;if("DRAGGING"!==t.phase)return console.error("cannot move while not dragging"),y();if(null==t.drag)return console.error("cannot move if there is no drag information"),y();var d=t.drag.current,l=t.drag.initial,c=t.dimension.droppable[l.source.droppableId],p=function(){var e=(0,s.subtract)(n,l.client.selection),t=(0,s.add)(e,l.client.center),r={selection:n,offset:e,center:t};return r}(),g=function(){var e=(0,s.subtract)(r,l.page.selection),t=(0,s.add)(e,l.page.center),n={selection:r,offset:e,center:t};return n}(),h=(0,s.subtract)(c.scroll.initial,c.scroll.current),v={center:(0,s.add)(g.center,(0,s.negate)(h))},b=a||d.windowScroll,m={id:d.id,type:d.type,client:p,page:g,withinDroppable:v,shouldAnimate:i,windowScroll:b},w=(0,f.default)({page:g.selection,withinDroppable:v,draggableId:m.id,draggables:t.dimension.draggable,droppables:t.dimension.droppable}),D={initial:l,impact:w,current:m};return(0,u.default)({},t,{drag:D})};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y("IDLE"),t=arguments[1];if("BEGIN_LIFT"===t.type)return"IDLE"!==e.phase?(console.error("trying to start a lift while another is occurring"),e):y("COLLECTING_DIMENSIONS");if("REQUEST_DIMENSIONS"===t.type){if("COLLECTING_DIMENSIONS"!==e.phase)return console.error("trying to collect dimensions at the wrong time"),e;var n=t.payload;return{phase:"COLLECTING_DIMENSIONS",drag:null,drop:null,dimension:{request:n,draggable:{},droppable:{}}}}if("PUBLISH_DRAGGABLE_DIMENSION"===t.type){var r=t.payload;return"COLLECTING_DIMENSIONS"!==e.phase?(console.warn("dimension rejected as no longer requesting dimensions",r),e):e.dimension.draggable[r.id]?(console.error("dimension already exists for "+r.id),e):(0,u.default)({},e,{dimension:{request:e.dimension.request,droppable:e.dimension.droppable,draggable:(0,u.default)({},e.dimension.draggable,(0,i.default)({},r.id,r))}})}if("PUBLISH_DROPPABLE_DIMENSION"===t.type){var o=t.payload;return"COLLECTING_DIMENSIONS"!==e.phase?(console.warn("dimension rejected as no longer requesting dimensions",o),e):e.dimension.droppable[o.id]?(console.error("dimension already exists for "+o.id),e):(0,u.default)({},e,{dimension:{request:e.dimension.request,draggable:e.dimension.draggable,droppable:(0,u.default)({},e.dimension.droppable,(0,i.default)({},o.id,o))}})}if("COMPLETE_LIFT"===t.type){if("COLLECTING_DIMENSIONS"!==e.phase)return console.error("trying complete lift without collecting dimensions"),e;var a=t.payload,d=a.id,l=a.type,c=a.client,p=a.page,h=a.windowScroll,D={center:p.center},M=(0,f.default)({page:p.selection,withinDroppable:D,draggableId:d,draggables:e.dimension.draggable,droppables:e.dimension.droppable}),_=M.destination;if(!_)return console.error("lifting a draggable that is not inside a droppable"),y();var R={source:_,client:c,page:p,windowScroll:h,withinDroppable:D},S={id:d,type:l,client:{selection:c.selection,center:c.center,offset:m},page:{selection:p.selection,center:p.center,offset:m},withinDroppable:D,windowScroll:h,shouldAnimate:!1};return(0,u.default)({},e,{phase:"DRAGGING",drag:{initial:R,current:S,impact:M}})}if("UPDATE_DROPPABLE_DIMENSION_SCROLL"===t.type){if("DRAGGING"!==e.phase)return console.error("cannot update a droppable dimensions scroll when not dragging"),y();if(null==e.drag)return console.error("invalid store state"),y();var I=t.payload,O=I.id,q=I.offset,E=e.dimension.droppable[O];if(!E)return console.error("cannot update a droppable that is not inside of the state",O),y();var x=(0,u.default)({},E,{scroll:{initial:E.scroll.initial,current:q}}),P=(0,u.default)({},e,{dimension:{request:e.dimension.request,draggable:e.dimension.draggable,droppable:(0,u.default)({},e.dimension.droppable,(0,i.default)({},O,x))}}),C=e.drag.current,A=C.client,L=C.page;return w({state:P,clientSelection:A.selection,pageSelection:L.selection})}if("MOVE"===t.type){var N=t.payload,W=N.client,k=N.page,T=N.windowScroll;return w({state:e,clientSelection:W,pageSelection:k,windowScroll:T})}if("MOVE_BY_WINDOW_SCROLL"===t.type){var j=t.payload.windowScroll;if(!e.drag)return console.error("cannot move with window scrolling if no current drag"),y();var G=e.drag.current.client.selection,B=(0,s.subtract)(e.drag.current.windowScroll,e.drag.initial.windowScroll),F=(0,s.subtract)(j,e.drag.initial.windowScroll),K=(0,s.subtract)(F,B),U=(0,s.add)(e.drag.current.page.selection,K);return w({state:e,clientSelection:G,pageSelection:U,windowScroll:j})}if("MOVE_FORWARD"===t.type||"MOVE_BACKWARD"===t.type){if("DRAGGING"!==e.phase)return console.error("cannot move while not dragging",t),y();if(!e.drag)return console.error("cannot move if there is no drag information"),y();var z=e.drag;if(!z.impact.destination)return console.warn("cannot move forward when there is not previous location"),e;var Y="MOVE_FORWARD"===t.type,V=(0,g.default)({isMovingForward:Y,draggableId:z.current.id,location:z.impact.destination,draggables:e.dimension.draggable,droppables:e.dimension.droppable});if(!V)return e;var H=(0,s.add)(z.current.page.selection,V),X=(0,s.add)(z.current.client.selection,V),Q=(0,v.default)(H,e.dimension.droppable);return Q?w({state:e,clientSelection:X,pageSelection:H,shouldAnimate:!0}):(console.info("currently not supporting moving a draggable outside the visibility bounds of a droppable"),e)}if("DROP_ANIMATE"===t.type){var J=t.payload,Z=J.newHomeOffset,$=J.result;if("DRAGGING"!==e.phase)return console.error("cannot animate drop while not dragging",t),e;if(!e.drag)return console.error("cannot animate drop - invalid drag state"),y();var ee={newHomeOffset:Z,result:$,last:e.drag};return{phase:"DROP_ANIMATING",drag:null,drop:{pending:ee,result:null},dimension:e.dimension}}if("DROP_COMPLETE"===t.type){var te=t.payload;return{phase:"DROP_COMPLETE",drag:null,drop:{pending:null,result:te},dimension:b}}return"CANCEL"===t.type?y():e}},function(e,t){e.exports=d},function(e,t){e.exports=l},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},t.subtract=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},t.isEqual=function(e,t){return e.x===t.x&&e.y===t.y},t.negate=function(e){return{x:-e.x,y:-e.y}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(18),i=r(o),a=n(21),u=r(a),d=n(22),l=r(d);t.default=function(e){var t=e.page,n=e.withinDroppable,r=e.draggableId,o=e.draggables,a=e.droppables,d=(0,i.default)(t,a);if(!d)return l.default;var s=n.center,c=o[r],f=a[d],p=(0,u.default)(f,o),g=c.page.withoutMargin.center,h=s.y-g.y>0,v=p.filter(function(e){if(e===c)return!1;var t=e.page.withoutMargin;return h?!(t.center.y<g.y)&&s.y>t.top:!(g.y<t.center.y)&&s.y<t.bottom}).map(function(e){return e.id}),b=p.indexOf(c),m=function(){return v.length?h?b+v.length:b-v.length:b}(),y=m!==b?c.page.withMargin.height:0,w={amount:y,draggables:v,isMovingForward:h},D={movement:w,destination:{droppableId:d,index:m}};return D}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(19),i=r(o),a=n(20),u=r(a);t.default=function(e,t){var n=(0,i.default)(t).find(function(n){return(0,u.default)(e,t[n])});return n||null}},function(e,t){e.exports=s},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=t.page.withMargin,r=n.top,o=n.right,i=n.bottom,a=n.left;return e.x>=a&&e.x<=o&&e.y>=r&&e.y<=i}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(19),i=r(o),a=n(15),u=r(a);t.default=(0,u.default)(function(e,t){return(0,i.default)(t).map(function(e){return t[e]}).filter(function(t){return t.droppableId===e.id}).sort(function(e,t){return e.page.withoutMargin.center.y-t.page.withoutMargin.center.y})})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={draggables:[],amount:0,isMovingForward:!1},r={movement:n,destination:null};t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(15),i=r(o),a=n(21),u=r(a),d=(0,i.default)(function(e,t){return e.indexOf(t)});t.default=function(e){var t=e.isMovingForward,n=e.draggableId,r=e.location,o=e.draggables,i=e.droppables,a=i[r.droppableId],l=o[n],s=r.index,c=(0,u.default)(a,o),f=d(c,l);if(f===-1)return console.error("could not find draggable inside current droppable"),null;if(t&&s===c.length-1)return null;if(!t&&0===s)return null;var p=c[s],g=t?s+1:s-1,h=c[g],v=t&&g<=f||!t&&g>=f,b=v?p.page.withMargin.height:h.page.withMargin.height,m={x:0,y:t?b:-b};return m}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(15),i=r(o),a=function(e){return(0,i.default)(function(t,n){var r=e.onDragStart,o=e.onDragEnd,i=t.phase,a=n.phase;if("DRAGGING"===i&&"DRAGGING"!==a){if(!r)return;return t.drag?void r(t.drag.current.id,t.drag.initial.source):void console.error("cannot fire onDragStart hook without drag state",{current:t,previous:n})}if("DROP_COMPLETE"===i&&"DROP_COMPLETE"!==a){if(!t.drop||!t.drop.result)return void console.error("cannot fire onDragEnd hook without drag state",{current:t,previous:n});var u=t.drop.result,d=u.source,l=u.destination,s=u.draggableId;if(!l)return void o(t.drop.result);var c=d.droppableId!==l.droppableId||d.index!==l.index;if(c)return void o(t.drop.result);var f={draggableId:s,source:d,destination:null};o(f)}if("IDLE"===i&&"DRAGGING"===a){if(!n.drag)return void console.error("cannot fire onDragEnd for cancel because cannot find previous drag");var p={draggableId:n.drag.current.id,source:n.drag.initial.source,destination:null};o(p)}if("IDLE"===i&&"DROP_ANIMATING"===a){if(!n.drop||!n.drop.pending)return void console.error("cannot fire onDragEnd for cancel because cannot find previous pending drop");var g={draggableId:n.drop.pending.result.draggableId,source:n.drop.pending.result.source,destination:null};o(g)}})};t.default=function(e){var t=a(e);return function(e){return function(n){return function(r){var o=e.getState(),i=n(r),a=e.getState();return t(a,o),i}}}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return"private-drag-drop-key-do-not-use-store-"+e};t.storeKey=n("store"),t.droppableIdKey=n("droppable-id")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(27),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var o=n(15),i=r(o),a=n(28),u=n(29),d=n(30),l=n(31),s=r(l),c=n(25),f=n(35),p={x:0,y:0},g={isDropAnimating:!1,isDragging:!1,isAnotherDragging:!1,canAnimate:!0,offset:p,dimension:null},h=t.makeSelector=function(){var e=function(e,t){return t.draggableId},t=(0,i.default)(function(e,t){return{x:e,y:t}}),n=(0,i.default)(function(e,t){return{isDropAnimating:!1,isDragging:!1,canAnimate:!0,isAnotherDragging:t,offset:e,dimension:null}}),r=(0,i.default)(function(e,r,o){var i=r.draggables.indexOf(e)!==-1;if(!i)return n(p,o);var a=r.isMovingForward?-r.amount:r.amount;return n(t(0,a),o)}),o=function(e,t){if(!e.dimension)return null;var n=e.dimension.draggable[t.draggableId];return n?n:null};return(0,u.createSelector)([e,d.phaseSelector,d.dragSelector,d.pendingDropSelector,o],function(e,t,n,o,i){if("DRAGGING"===t){if(!n)return console.error("invalid dragging state"),g;var a=n.current,u=n.impact;if(a.id!==e)return r(e,u.movement,!0);var d=a.client.offset,l=a.shouldAnimate;return{isDragging:!0,isAnotherDragging:!1,isDropAnimating:!1,canAnimate:l,offset:d,dimension:i}}return"DROP_ANIMATING"===t?o?o.last.current.id!==e?r(e,o.last.impact.movement,!1):{isDragging:!1,isDropAnimating:!0,isAnotherDragging:!1,canAnimate:!0,offset:o.newHomeOffset,dimension:i}:(console.error("cannot animate drop without a pending drop"),g):"DROP_COMPLETE"===t?{isDropAnimating:!1,isAnotherDragging:!1,isDragging:!1,canAnimate:!1,offset:p,dimension:null}:g})},v=function(){var e=h();return function(t,n){return e(t,n)}},b={lift:f.lift,move:f.move,moveBackward:f.moveBackward,moveForward:f.moveForward,moveByWindowScroll:f.moveByWindowScroll,drop:f.drop,dropAnimationFinished:f.dropAnimationFinished,cancel:f.cancel};t.default=(0,a.connect)(v(),b,null,{storeKey:c.storeKey})(s.default)},function(e,t){e.exports=c},function(e,t){e.exports=f},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.phaseSelector=function(e){return e.phase},t.pendingDropSelector=function(e){return e.drop&&e.drop.pending?e.drop.pending:null},t.dragSelector=function(e){return e.drag}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.zIndexOptions=void 0;var o=n(4),i=r(o),a=n(5),u=r(a),d=n(6),l=r(d),s=n(7),c=r(s),f=n(8),p=r(f),g=n(9),h=r(g),v=n(15),b=r(v),m=n(32),y=r(m),w=n(33),D=r(w),M=n(40),_=r(M),R=n(44),S=r(R),I=n(43),O=n(38),q=r(O),E=n(48),x=r(E),P=n(49),C=r(P),A=n(25),L=n(16),N=t.zIndexOptions={dragging:5e3,dropAnimating:4500},W=function(e){function t(n,r){(0,u.default)(this,t);var o=(0,l.default)(this,e.call(this,n,r));return o.state={ref:null},o.onMoveEnd=function(){o.props.isDropAnimating&&o.props.dropAnimationFinished(o.props.draggableId)},o.onLift=function(e){o.throwIfCannotDrag();var t=o.props,n=t.lift,r=t.draggableId,i=t.type,a=o.state.ref,u=(0,q.default)(),d={selection:e,center:(0,x.default)(a)},l={selection:(0,L.add)(d.selection,u),center:(0,L.add)(d.center,u)};n(r,i,d,l,u)},o.onKeyLift=function(){o.throwIfCannotDrag();var e=o.props,t=e.lift,n=e.draggableId,r=e.type,i=o.state.ref,a=(0,x.default)(i),u={selection:a,center:a},d=(0,q.default)(),l={selection:(0,L.add)(a,d),center:(0,L.add)(a,d)};t(n,r,u,l,d)},o.onMove=function(e){o.throwIfCannotDrag();var t=o.props,n=t.draggableId,r=t.dimension,i=t.move;if(r){var a=(0,q.default)(),u=(0,L.add)(e,a);i(n,e,u,a)}},o.onMoveForward=function(){o.throwIfCannotDrag(),o.props.moveForward(o.props.draggableId)},o.onMoveBackward=function(){o.throwIfCannotDrag(),o.props.moveBackward(o.props.draggableId)},o.onWindowScroll=function(){o.throwIfCannotDrag();var e=(0,q.default)();o.props.moveByWindowScroll(o.props.draggableId,e)},o.onDrop=function(){o.throwIfCannotDrag(),o.props.drop(o.props.draggableId)},o.onCancel=function(){o.props.cancel(o.props.draggableId)},o.setRef=function(e){null!==e&&e!==o.state.ref&&o.setState({ref:e})},o.getDraggingStyle=(0,b.default)(function(e,t,n,r,o,i){var a={position:"fixed",boxSizing:"border-box",pointerEvents:"none",zIndex:o?N.dropAnimating:N.dragging,width:e,height:t,top:n,left:r,transform:i.transform?""+i.transform:null};return a}),o.getNotDraggingStyle=(0,b.default)(function(e,t,n){var r={transition:e?I.css.outOfTheWay:null,transform:t.transform,pointerEvents:n?"none":"auto"};return r}),o.getProvided=(0,b.default)(function(e,t,n,r,i,a,u){var d=e||t,l=function(){if(!d)return o.getNotDraggingStyle(r,u,n);(0,y.default)(i,"draggable dimension required for dragging");var e=i.client.withoutMargin,a=e.width,l=e.height,s=e.top,c=e.left;return o.getDraggingStyle(a,l,s,c,t,u)}(),s={innerRef:o.setRef,placeholder:d?o.getPlaceholder():null,dragHandleProps:a,draggableStyle:l};return s}),o.getSnapshot=(0,b.default)(function(e,t){return{isDragging:e||t}}),o.getSpeed=(0,b.default)(function(e,t,n){return n?t?"STANDARD":e?"FAST":"INSTANT":"INSTANT"}),o.callbacks={onLift:o.onLift,onMove:o.onMove,onDrop:o.onDrop,onCancel:o.onCancel,onKeyLift:o.onKeyLift,onMoveBackward:o.onMoveBackward,onMoveForward:o.onMoveForward,onWindowScroll:o.onWindowScroll},o}return(0,c.default)(t,e),t.prototype.throwIfCannotDrag=function(){(0,y.default)(this.state.ref,"Draggable: cannot drag as no DOM node has been provided"),(0,y.default)(!this.props.isDragDisabled,"Draggable: cannot drag as dragging is not enabled")},t.prototype.getPlaceholder=function(){var e=this.props.dimension;return(0,y.default)(e,"cannot get a drag placeholder when not dragging"),h.default.createElement(C.default,{height:e.page.withMargin.height,width:e.page.withMargin.width})},t.prototype.render=function(){var e=this,t=this.props,n=t.draggableId,r=t.type,o=t.offset,i=t.isDragging,a=t.isDropAnimating,u=t.isAnotherDragging,d=t.canAnimate,l=t.isDragDisabled,s=t.dimension,c=t.children,f=this.getSpeed(i,a,d);return h.default.createElement(D.default,{draggableId:n,droppableId:this.context[A.droppableIdKey],type:r,targetRef:this.state.ref},h.default.createElement(_.default,{speed:f,destination:o,onMoveEnd:this.onMoveEnd},function(t){return h.default.createElement(S.default,{isEnabled:!l,callbacks:e.callbacks,draggableRef:e.state.ref},function(n){return c(e.getProvided(i,a,u,d,s,n,t),e.getSnapshot(i,a))})}))},t}(g.Component);W.propTypes={isDragging:p.default.bool.isRequired,isDropAnimating:p.default.bool.isRequired,isAnotherDragging:p.default.bool.isRequired,canAnimate:p.default.bool.isRequired,offset:p.default.shape({x:p.default.number.isRequired,y:p.default.number.isRequired}).isRequired,dimension:p.default.shape({id:p.default.string.isRequired,droppableId:p.default.string.isRequired,page:p.default.shape({withMargin:p.default.shape({top:p.default.number.isRequired,left:p.default.number.isRequired,bottom:p.default.number.isRequired,right:p.default.number.isRequired,width:p.default.number.isRequired,height:p.default.number.isRequired,center:p.default.shape({x:p.default.number.isRequired,y:p.default.number.isRequired}).isRequired}).isRequired,withoutMargin:p.default.shape({top:p.default.number.isRequired,left:p.default.number.isRequired,bottom:p.default.number.isRequired,right:p.default.number.isRequired,width:p.default.number.isRequired,height:p.default.number.isRequired,center:p.default.shape({x:p.default.number.isRequired,y:p.default.number.isRequired}).isRequired}).isRequired}).isRequired,client:p.default.shape({withMargin:p.default.shape({top:p.default.number.isRequired,left:p.default.number.isRequired,bottom:p.default.number.isRequired,right:p.default.number.isRequired,width:p.default.number.isRequired,height:p.default.number.isRequired,center:p.default.shape({x:p.default.number.isRequired,y:p.default.number.isRequired}).isRequired}).isRequired,withoutMargin:p.default.shape({top:p.default.number.isRequired,left:p.default.number.isRequired,bottom:p.default.number.isRequired,right:p.default.number.isRequired,width:p.default.number.isRequired,height:p.default.number.isRequired,center:p.default.shape({x:p.default.number.isRequired,y:p.default.number.isRequired}).isRequired}).isRequired}).isRequired}),lift:p.default.func.isRequired,move:p.default.func.isRequired,moveByWindowScroll:p.default.func.isRequired,moveForward:p.default.func.isRequired,moveBackward:p.default.func.isRequired,drop:p.default.func.isRequired,cancel:p.default.func.isRequired,dropAnimationFinished:p.default.func.isRequired,draggableId:p.default.string.isRequired,children:p.default.func.isRequired,type:p.default.string,isDragDisabled:p.default.bool},W.defaultProps={isDragDisabled:!1,type:"DEFAULT"},W.contextTypes=(0,i.default)({},A.droppableIdKey,g.PropTypes.string.isRequired),t.default=W},function(e,t){e.exports=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(34),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var o=n(28),i=n(29),a=n(15),u=r(a),d=n(25),l=n(35),s=n(37),c=r(s),f=function(e){return e.dimension.request},p=function(e,t){return t.type},g=t.makeSelector=function(){var e=(0,u.default)(function(e){return{shouldPublish:e}});return(0,i.createSelector)([p,f],function(t,n){return e(t===n)})},h=function(){var e=g();return function(t,n){return e(t,n)}},v={publish:l.publishDraggableDimension};t.default=(0,o.connect)(h,v,null,{storeKey:d.storeKey})(c.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.lift=t.dropAnimationFinished=t.drop=t.completeDrop=t.cancel=t.moveForward=t.moveBackward=t.moveByWindowScroll=t.move=t.updateDroppableDimensionScroll=t.publishDroppableDimension=t.publishDraggableDimension=t.requestDimensions=void 0;var o=n(36),i=r(o),a=n(16),u=t.requestDimensions=function(e){return{type:"REQUEST_DIMENSIONS",payload:e}},d=function(){return{type:"BEGIN_LIFT"}},l=function(e,t,n,r,o){return{type:"COMPLETE_LIFT",payload:{id:e,type:t,client:n,page:r,windowScroll:o}}},s=(t.publishDraggableDimension=function(e){return{type:"PUBLISH_DRAGGABLE_DIMENSION",payload:e}},t.publishDroppableDimension=function(e){return{type:"PUBLISH_DROPPABLE_DIMENSION",payload:e}},t.updateDroppableDimensionScroll=function(e,t){return{type:"UPDATE_DROPPABLE_DIMENSION_SCROLL",payload:{id:e,offset:t}}},t.move=function(e,t,n,r){return{type:"MOVE",payload:{id:e,client:t,page:n,windowScroll:r}}},t.moveByWindowScroll=function(e,t){return{type:"MOVE_BY_WINDOW_SCROLL",payload:{id:e,windowScroll:t}}},t.moveBackward=function(e){return{type:"MOVE_BACKWARD",payload:e}},t.moveForward=function(e){return{type:"MOVE_FORWARD",payload:e}},t.cancel=function(e){return{type:"CANCEL",payload:e}}),c=function(e,t){return{type:"DROP_ANIMATE",payload:{newHomeOffset:e,result:t}}},f=t.completeDrop=function(e){return{type:"DROP_COMPLETE",payload:e}};t.drop=function(e){return function(t,n){var r=n();if("COLLECTING_DIMENSIONS"===r.phase)return console.error("canceling drag while collecting"),void t(s(e));if("DRAGGING"!==r.phase)return console.error("cannot drop if not dragging",r),void t(s(e));if(!r.drag)return console.error("invalid drag state",r),void t(s(e));var o=r.drag,u=o.impact,d=o.initial,l=o.current,p=r.dimension.droppable[d.source.droppableId],g={draggableId:l.id,source:d.source,destination:u.destination},h=(0,a.subtract)(p.scroll.initial,p.scroll.current),v=(0,i.default)({movement:u.movement,clientOffset:l.client.offset,pageOffset:l.page.offset,scrollDiff:h,draggables:r.dimension.draggable}),b=!(0,a.isEqual)(l.client.offset,v);return b?void t(c(v,g)):void t(f(g))}},t.dropAnimationFinished=function(e){return function(t,n){var r=n();return"DROP_ANIMATING"!==r.phase?(console.error("cannot end drop that is no longer animating",r),void t(s(e))):r.drop&&r.drop.pending?void t(f(r.drop.pending.result)):(console.error("cannot end drop that has no pending state",r),void t(s(e)))}},t.lift=function(e,t,n,r,o){return function(i,a){!function(){var e=a();if("DROP_ANIMATING"===e.phase){if(!e.drop||!e.drop.pending)return console.error("cannot flush drop animation if there is no pending"),void i(s("super cool id"));i(f(e.drop.pending.result))}}(),setTimeout(function(){var c=a();"IDLE"===c.phase&&"DRAG_COMPLETE"===c.phase||i(s("some-fake-id")),i(d()),i(u(t)),setTimeout(function(){var u=a();"COLLECTING_DIMENSIONS"===u.phase&&i(l(e,t,n,r,o))})})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16);t.default=function(e){var t=e.movement,n=e.clientOffset,o=e.pageOffset,i=e.scrollDiff,a=e.draggables;if(!t.draggables.length)return i;var u=t.draggables.reduce(function(e,t){var n=a[t];return e+n.page.withMargin.height},0),d=t.isMovingForward?u:-u,l={x:0,y:d},s=(0,r.subtract)(l,o),c=(0,r.add)(s,n),f=(0,r.add)(c,i);return f}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),i=r(o),a=n(6),u=r(a),d=n(7),l=r(d),s=n(8),c=r(s),f=n(9),p=n(32),g=r(p),h=n(38),v=r(h),b=n(39),m=function(e){function t(){var n,r,o;(0,i.default)(this,t);for(var a=arguments.length,d=Array(a),l=0;l<a;l++)d[l]=arguments[l];return n=r=(0,u.default)(this,e.call.apply(e,[this].concat(d))),r.getDimension=function(){var e=r.props,t=e.draggableId,n=e.droppableId,o=e.targetRef;(0,g.default)(o,"DraggableDimensionPublisher cannot calculate a dimension when not attached to the DOM");var i=window.getComputedStyle(o),a={top:parseInt(i.marginTop,10),right:parseInt(i.marginRight,10),bottom:parseInt(i.marginBottom,10),left:parseInt(i.marginLeft,10)},u=(0,b.getDraggableDimension)({id:t,droppableId:n,clientRect:o.getBoundingClientRect(),margin:a,windowScroll:(0,v.default)()});return u},o=n,(0,u.default)(r,o)}return(0,l.default)(t,e),t.prototype.componentWillReceiveProps=function(e){var t=!this.props.shouldPublish&&e.shouldPublish;t&&this.props.publish(this.getDimension())},t.prototype.render=function(){return this.props.children},t}(f.Component);m.propTypes={shouldPublish:c.default.bool.isRequired,publish:c.default.func.isRequired,draggableId:c.default.string.isRequired,droppableId:c.default.string.isRequired,type:c.default.string.isRequired,targetRef:c.default.any,children:c.default.any},t.default=m},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{x:window.pageXOffset,y:window.pageYOffset}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={x:0,y:0},r=t.noMargin={top:0,right:0,bottom:0,left:0},o=function(e,t){var n=e.top,r=e.right,o=e.bottom,i=e.left,a=e.width,u=e.height;return{top:n+t.y,left:i+t.x,bottom:o+t.y,right:r+t.x,height:u,width:a}},i=function(e,t){var n=e.top,r=e.right,o=e.bottom,i=e.left,a=e.height,u=e.width;return{top:n+t.top,left:i+t.left,bottom:o+t.bottom,right:r+t.right,height:a+t.top+t.bottom,width:u+t.left+t.right}},a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x,width:e.width,height:e.height,center:{x:(e.right+t.x+(e.left+t.x))/2,y:(e.bottom+t.y+(e.top+t.y))/2}}};t.getDraggableDimension=function(e){var t=e.id,u=e.droppableId,d=e.clientRect,l=e.margin,s=void 0===l?r:l,c=e.windowScroll,f=void 0===c?n:c,p=o(d,f),g=i(p,s),h={id:t,droppableId:u,client:{withoutMargin:a(d),withMargin:a(i(d,s))},page:{withoutMargin:a(p),withMargin:a(g)}};return h},t.getDroppableDimension=function(e){var t=e.id,u=e.clientRect,d=e.margin,l=void 0===d?r:d,s=e.windowScroll,c=void 0===s?n:s,f=e.scroll,p=void 0===f?n:f,g=o(u,c),h=i(g,l),v={id:t,scroll:{initial:p,current:p},page:{withoutMargin:a(g),withMargin:a(h)}};return v}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(41),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),i=r(o),a=n(6),u=r(a),d=n(7),l=r(d),s=n(8),c=r(s),f=n(9),p=r(f),g=n(42),h=n(43),v={x:0,y:0},b={transform:null},m=function(e){return e.x===v.x&&e.y===v.y},y=function(e,t,n){if(e)return b;var r={x:t,y:n};if(m(r))return b;var o={transform:"translate("+r.x+"px, "+r.y+"px)"};return o},w=function(e){function t(){var n,r,o;(0,i.default)(this,t);for(var a=arguments.length,d=Array(a),l=0;l<a;l++)d[l]=arguments[l];return n=r=(0,u.default)(this,e.call.apply(e,[this].concat(d))),r.onRest=function(){var e=r.props.onMoveEnd;e&&setTimeout(function(){return e()})},r.getFinal=function(){var e=r.props.destination,t=r.props.speed; | ||
if("INSTANT"===t)return e;var n="FAST"===t?h.physics.fast:h.physics.standard;return{x:(0,g.spring)(e.x,n),y:(0,g.spring)(e.y,n)}},o=n,(0,u.default)(r,o)}return(0,l.default)(t,e),t.prototype.render=function(){var e=this,t=this.getFinal(),n=m(t);return p.default.createElement(g.Motion,{defaultStyle:v,style:t,onRest:this.onRest},function(t){return e.props.children(y(n,t.x,t.y))})},t}(f.Component);w.propTypes={children:c.default.func.isRequired,speed:c.default.oneOf(["INSTANT","STANDARD","FAST"]).isRequired,destination:c.default.shape({x:c.default.number.isRequired,y:c.default.number.isRequired}),onMoveEnd:c.default.func},w.defaultProps={destination:v},t.default=w},function(e,t){e.exports=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.css=t.physics=void 0;var o=n(14),i=r(o);t.physics=function(){var e={stiffness:1e3,damping:60,precision:.99},t=(0,i.default)({},e),n=(0,i.default)({},e,{stiffness:2*e.stiffness});return{standard:t,fast:n}}(),t.css={outOfTheWay:"transform 0.2s cubic-bezier(0.2, 0, 0, 1)"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(45),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.sloppyClickThreshold=void 0;var i=n(5),a=o(i),u=n(6),d=o(u),l=n(7),s=o(l),c=n(8),f=o(c),p=n(9),g=n(32),h=o(g),v=n(15),b=o(v),m=n(46),y=o(m),w=n(47),D=r(w),M=function(){},_=function(){return!1},R=0,S=t.sloppyClickThreshold=5,I=function(e){function t(){var n,r,o;(0,a.default)(this,t);for(var i=arguments.length,u=Array(i),l=0;l<i;l++)u[l]=arguments[l];return n=r=(0,d.default)(this,e.call.apply(e,[this].concat(u))),r.state={draggingWith:null,pending:null},r.ifDragging=function(e){r.state.draggingWith&&e()},r.memoizedMove=(0,b.default)(function(e,t){var n={x:e,y:t};r.props.callbacks.onMove(n)}),r.scheduleMove=(0,y.default)(function(e){r.ifDragging(function(){return r.memoizedMove(e.x,e.y)})}),r.scheduleMoveForward=(0,y.default)(function(){r.ifDragging(r.props.callbacks.onMoveForward)}),r.scheduleMoveBackward=(0,y.default)(function(){r.ifDragging(r.props.callbacks.onMoveBackward)}),r.scheduleWindowScrollMove=(0,y.default)(function(){r.ifDragging(r.props.callbacks.onWindowScroll)}),r.onWindowResize=function(){return r.state.pending?void r.stopPendingMouseDrag():void(r.state.draggingWith&&r.stopDragging(function(){return r.props.callbacks.onCancel()}))},r.onWindowScroll=function(){var e=r.state.draggingWith;if(e)return"MOUSE"===e?void r.scheduleWindowScrollMove():void("KEYBOARD"===e&&r.stopDragging(function(){return r.props.callbacks.onCancel()}))},r.onWindowMouseMove=function(e){var t=r.state,n=t.draggingWith,o=t.pending;if("KEYBOARD"!==n){var i=e.button,a=e.clientX,u=e.clientY;if(i===R){var d={x:a,y:u};if(!o)return void r.scheduleMove(d);var l=Math.abs(o.x-d.x)>=S||Math.abs(o.y-d.y)>=S;l&&r.startDragging("MOUSE",function(){return r.props.callbacks.onLift(d)})}}},r.onWindowMouseUp=function(){return r.state.pending?void r.stopPendingMouseDrag():r.state.draggingWith?void("MOUSE"===r.state.draggingWith&&r.stopDragging(function(){return r.props.callbacks.onDrop()})):void console.error("should not be listening to mouse up events when nothing is dragging")},r.onWindowMouseDown=function(){r.stopDragging(function(){return r.props.callbacks.onCancel()})},r.onMouseDown=function(e){if("KEYBOARD"===r.state.draggingWith)return void r.stopDragging(function(){return r.props.callbacks.onCancel()});var t=e.button,n=e.clientX,o=e.clientY;if(t===R){e.stopPropagation(),e.preventDefault();var i={x:n,y:o};r.startPendingMouseDrag(i)}},r.onWindowKeydown=function(e){var t=Boolean(r.state.pending);return t?void(e.keyCode===D.escape&&(e.preventDefault(),r.stopPendingMouseDrag())):(r.state.draggingWith||(console.error("should not be listening to window mouse up if nothing is dragging"),r.stopDragging(function(){return r.props.callbacks.onCancel()})),e.keyCode===D.enter&&e.preventDefault(),e.keyCode===D.tab&&e.preventDefault(),e.keyCode===D.escape&&(e.preventDefault(),r.stopDragging(function(){return r.props.callbacks.onCancel()})),"MOUSE"===r.state.draggingWith?void(e.keyCode===D.space&&e.preventDefault()):(e.keyCode===D.space&&(e.preventDefault(),r.stopDragging(function(){return r.props.callbacks.onDrop()})),e.keyCode===D.arrowDown&&(e.preventDefault(),r.scheduleMoveForward()),void(e.keyCode===D.arrowUp&&(e.preventDefault(),r.scheduleMoveBackward()))))},r.onKeyDown=function(e){!r.props.isEnabled||r.state.pending||r.state.draggingWith||e.keyCode===D.space&&(e.preventDefault(),e.stopPropagation(),r.startDragging("KEYBOARD",function(){return r.props.callbacks.onKeyLift()}))},r.onClick=function(e){r.preventClick&&(r.preventClick=!1,e.preventDefault())},r.startPendingMouseDrag=function(e){if(r.state.draggingWith)return void console.error("cannot start a pending mouse drag when already dragging");if(r.state.pending)return void console.error("cannot start a pending mouse drag when there is already a pending position");r.bindWindowEvents();var t={draggingWith:null,pending:e};r.setState(t)},r.startDragging=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M;if(r.state.draggingWith)return void console.error("cannot start dragging when already dragging");if("MOUSE"===e&&!r.state.pending)return void console.error("cannot start mouse drag when there is not a pending position");"KEYBOARD"===e&&r.bindWindowEvents();var n={draggingWith:e,pending:null};r.setState(n,t)},r.stopPendingMouseDrag=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M;(0,h.default)(r.state.pending,"cannot stop pending drag when there is none"),r.preventClick=!1,r.unbindWindowEvents(),r.setState({draggingWith:null,pending:null},e)},r.stopDragging=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M;if(!r.state.draggingWith)return void console.error("cannot stop dragging when not dragging");r.unbindWindowEvents(),"MOUSE"===r.state.draggingWith&&(r.preventClick=!0);var t={draggingWith:null,pending:null};r.setState(t,e)},r.unbindWindowEvents=function(){window.removeEventListener("mousemove",r.onWindowMouseMove),window.removeEventListener("mouseup",r.onWindowMouseUp),window.removeEventListener("mousedown",r.onWindowMouseDown),window.removeEventListener("keydown",r.onWindowKeydown),window.removeEventListener("resize",r.onWindowResize),window.removeEventListener("scroll",r.onWindowScroll)},r.bindWindowEvents=function(){window.addEventListener("mousemove",r.onWindowMouseMove),window.addEventListener("mouseup",r.onWindowMouseUp),window.addEventListener("mousedown",r.onWindowMouseDown),window.addEventListener("keydown",r.onWindowKeydown),window.addEventListener("resize",r.onWindowResize),window.addEventListener("scroll",r.onWindowScroll,{passive:!0})},r.getProvided=(0,b.default)(function(e,t){if(!e)return null;var n={onMouseDown:r.onMouseDown,onKeyDown:r.onKeyDown,onClick:r.onClick,tabIndex:0,"aria-grabbed":t,draggable:!1,onDragStart:_,onDrop:_};return n}),o=n,(0,d.default)(r,o)}return(0,s.default)(t,e),t.prototype.componentWillUnmount=function(){this.state.draggingWith&&(this.preventClick=!1,this.unbindWindowEvents(),this.props.callbacks.onCancel())},t.prototype.componentWillReceiveProps=function(e){var t=this;if(!e.isEnabled)return this.state.pending?void this.stopPendingMouseDrag():void(this.state.draggingWith&&this.stopDragging(function(){return t.props.callbacks.onCancel()}))},t.prototype.render=function(){var e=this.props,t=e.children,n=e.isEnabled,r=this.state.draggingWith,o=Boolean(r);return t(this.getProvided(n,o))},t}(p.Component);I.propTypes={isEnabled:f.default.bool.isRequired,callbacks:f.default.shape({onLift:f.default.func.isRequired,onKeyLift:f.default.func.isRequired,onMove:f.default.func.isRequired,onWindowScroll:f.default.func.isRequired,onMoveForward:f.default.func.isRequired,onMoveBackward:f.default.func.isRequired,onDrop:f.default.func.isRequired,onCancel:f.default.func.isRequired}).isRequired,children:f.default.func.isRequired},t.default=I},function(e,t){e.exports=h},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tab=9,t.enter=13,t.escape=27,t.space=32,t.arrowUp=38,t.arrowDown=40},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.getBoundingClientRect(),n=t.top,r=t.right,o=t.bottom,i=t.left,a=(i+r)/2,u=(n+o)/2;return{x:a,y:u}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),i=r(o),a=n(6),u=r(a),d=n(7),l=r(d),s=n(8),c=r(s),f=n(9),p=r(f),g=function(e){function t(){return(0,i.default)(this,t),(0,u.default)(this,e.apply(this,arguments))}return(0,l.default)(t,e),t.prototype.render=function(){var e={width:this.props.width,height:this.props.height};return p.default.createElement("div",{style:e})},t}(f.PureComponent);g.propTypes={height:c.default.number.isRequired,width:c.default.number.isRequired},t.default=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(51),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var o=n(28),i=n(29),a=n(15),u=r(a),d=n(25),l=n(30),s=n(52),c=r(s),f=t.makeSelector=function(){var e=function(e,t){return t.droppableId},t=function(e,t){return t.isDropDisabled||!1},n=(0,u.default)(function(e,t){return!!t&&t.droppableId===e}),r=(0,u.default)(function(e){return{isDraggingOver:e}});return(0,i.createSelector)([l.phaseSelector,l.dragSelector,l.pendingDropSelector,e,t],function(e,t,o,i,a){if(a)return r(!1);if("DRAGGING"===e){if(!t)return console.error("cannot determine dragging over as there is not drag"),r(!1);var u=n(i,t.impact.destination);return r(u)}if("DROP_ANIMATING"===e){if(!o)return console.error("cannot determine dragging over as there is no pending result"),r(!1);var d=n(i,o.last.impact.destination);return r(d)}return r(!1)})},p=function(){var e=f();return function(t,n){return e(t,n)}};t.default=(0,o.connect)(p(),null,null,{storeKey:d.storeKey})(c.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),i=r(o),a=n(5),u=r(a),d=n(6),l=r(d),s=n(7),c=r(s),f=n(8),p=r(f),g=n(9),h=r(g),v=n(53),b=r(v),m=n(25),y=function(e){function t(){var n,r,o;(0,u.default)(this,t);for(var i=arguments.length,a=Array(i),d=0;d<i;d++)a[d]=arguments[d];return n=r=(0,l.default)(this,e.call.apply(e,[this].concat(a))),r.state={ref:null},r.setRef=function(e){null!==e&&e!==r.state.ref&&r.setState({ref:e})},o=n,(0,l.default)(r,o)}return(0,c.default)(t,e),t.prototype.getChildContext=function(){var e=(0,i.default)({},m.droppableIdKey,this.props.droppableId);return e},t.prototype.render=function(){var e={innerRef:this.setRef},t={isDraggingOver:this.props.isDraggingOver};return h.default.createElement(b.default,{droppableId:this.props.droppableId,type:this.props.type,targetRef:this.state.ref},this.props.children(e,t))},t}(g.Component);y.propTypes={droppableId:p.default.string.isRequired,isDropDisabled:p.default.bool,type:p.default.string,children:p.default.func.isRequired,isDraggingOver:p.default.bool.isRequired},y.defaultProps={type:"DEFAULT",isDropDisabled:!1},y.childContextTypes=(0,i.default)({},m.droppableIdKey,g.PropTypes.string.isRequired),t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(54),i=r(o);t.default=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.makeSelector=void 0;var o=n(28),i=n(29),a=n(15),u=r(a),d=n(25),l=n(55),s=r(l),c=n(35),f=function(e){return e.dimension.request},p=function(e,t){return t.type},g=t.makeSelector=function(){var e=(0,u.default)(function(e){return{shouldPublish:e}});return(0,i.createSelector)([p,f],function(t,n){return e(t===n)})},h=function(){var e=g();return function(t,n){return e(t,n)}},v={publish:c.publishDroppableDimension,updateScroll:c.updateDroppableDimensionScroll};t.default=(0,o.connect)(h,v,null,{storeKey:d.storeKey})(s.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),i=r(o),a=n(6),u=r(a),d=n(7),l=r(d),s=n(8),c=r(s),f=n(9),p=n(32),g=r(p),h=n(46),v=r(h),b=n(15),m=r(b),y=n(38),w=r(y),D=n(39),M=n(56),_=r(M),R={x:0,y:0},S=function(e){function t(){var n,r,o;(0,i.default)(this,t);for(var a=arguments.length,d=Array(a),l=0;l<a;l++)d[l]=arguments[l];return n=r=(0,u.default)(this,e.call.apply(e,[this].concat(d))),r.isWatchingScroll=!1,r.closestScrollable=null,r.getScrollOffset=function(){if(!r.closestScrollable)return R;var e={x:r.closestScrollable.scrollLeft,y:r.closestScrollable.scrollTop};return e},r.getDimension=function(){var e=r.props,t=e.droppableId,n=e.targetRef;(0,g.default)(n,"DimensionPublisher cannot calculate a dimension when not attached to the DOM");var o=window.getComputedStyle(n),i={top:parseInt(o.marginTop,10),right:parseInt(o.marginRight,10),bottom:parseInt(o.marginBottom,10),left:parseInt(o.marginLeft,10)},a=(0,D.getDroppableDimension)({id:t,clientRect:n.getBoundingClientRect(),margin:i,windowScroll:(0,w.default)(),scroll:r.getScrollOffset()});return a},r.memoizedUpdateScroll=(0,m.default)(function(e,t){var n={x:e,y:t};r.props.updateScroll(r.props.droppableId,n)}),r.scheduleScrollUpdate=(0,v.default)(function(e){r.isWatchingScroll&&r.memoizedUpdateScroll(e.x,e.y)}),r.onClosestScroll=function(){r.scheduleScrollUpdate(r.getScrollOffset())},r.watchScroll=function(){(0,g.default)(r.props.targetRef,"cannot watch scroll if not in the dom"),null!=r.closestScrollable&&(r.isWatchingScroll||(r.isWatchingScroll=!0,r.closestScrollable.addEventListener("scroll",r.onClosestScroll,{passive:!0})))},r.unwatchScroll=function(){r.isWatchingScroll&&(r.isWatchingScroll=!1,r.closestScrollable.removeEventListener("scroll",r.onClosestScroll))},o=n,(0,u.default)(r,o)}return(0,l.default)(t,e),t.prototype.componentWillUnmount=function(){this.isWatchingScroll&&this.unwatchScroll()},t.prototype.componentWillReceiveProps=function(e){e.targetRef!==this.props.targetRef&&this.isWatchingScroll&&(console.warn("changing targetRef while watching scroll!"),this.unwatchScroll());var t=!this.props.shouldPublish&&e.shouldPublish;return e.shouldPublish?void(t&&(this.closestScrollable=(0,_.default)(this.props.targetRef),this.props.publish(this.getDimension()),this.watchScroll())):void this.unwatchScroll()},t.prototype.render=function(){return this.props.children},t}(f.Component);S.propTypes={shouldPublish:c.default.bool.isRequired,publish:c.default.func.isRequired,updateScroll:c.default.func.isRequired,droppableId:c.default.string.isRequired,type:c.default.string.isRequired,targetRef:c.default.any,children:c.default.any},t.default=S},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.some(function(e){return"auto"===e||"scroll"===e})},r=function(e){var t=window.getComputedStyle(e);return n(t.overflow,t.overflowY)},o=function e(t){return null==t?null:r(t)?t:e(t.parentElement)};t.default=o}])}); |
import getNewHomeOffset from './get-new-home-offset'; | ||
import getNewHomeClientOffset from './get-new-home-client-offset'; | ||
import isPositionEqual from './is-position-equal'; | ||
import { subtract, isEqual } from './position'; | ||
@@ -19,3 +19,3 @@ export var requestDimensions = function requestDimensions(type) { | ||
var completeLift = function completeLift(id, type, center, selection) { | ||
var completeLift = function completeLift(id, type, client, page, windowScroll) { | ||
return { | ||
@@ -26,4 +26,5 @@ type: 'COMPLETE_LIFT', | ||
type: type, | ||
center: center, | ||
selection: selection | ||
client: client, | ||
page: page, | ||
windowScroll: windowScroll | ||
} | ||
@@ -47,9 +48,20 @@ }; | ||
export var move = function move(id, offset, center) { | ||
export var updateDroppableDimensionScroll = function updateDroppableDimensionScroll(id, offset) { | ||
return { | ||
type: 'UPDATE_DROPPABLE_DIMENSION_SCROLL', | ||
payload: { | ||
id: id, | ||
offset: offset | ||
} | ||
}; | ||
}; | ||
export var move = function move(id, client, page, windowScroll) { | ||
return { | ||
type: 'MOVE', | ||
payload: { | ||
id: id, | ||
offset: offset, | ||
center: center | ||
client: client, | ||
page: page, | ||
windowScroll: windowScroll | ||
} | ||
@@ -59,2 +71,12 @@ }; | ||
export var moveByWindowScroll = function moveByWindowScroll(id, windowScroll) { | ||
return { | ||
type: 'MOVE_BY_WINDOW_SCROLL', | ||
payload: { | ||
id: id, | ||
windowScroll: windowScroll | ||
} | ||
}; | ||
}; | ||
export var moveBackward = function moveBackward(id) { | ||
@@ -129,2 +151,3 @@ return { | ||
var droppable = state.dimension.droppable[initial.source.droppableId]; | ||
@@ -137,8 +160,16 @@ var result = { | ||
var newHomeOffset = getNewHomeOffset(impact.movement, current.offset, state.dimension.draggable); | ||
var scrollDiff = subtract(droppable.scroll.initial, droppable.scroll.current); | ||
var newHomeOffset = getNewHomeClientOffset({ | ||
movement: impact.movement, | ||
clientOffset: current.client.offset, | ||
pageOffset: current.page.offset, | ||
scrollDiff: scrollDiff, | ||
draggables: state.dimension.draggable | ||
}); | ||
// Do not animate if you do not need to. | ||
// This will be the case if either you are dragging with a | ||
// keyboard or if you manage to nail it just with a mouse. | ||
var isAnimationRequired = !isPositionEqual(current.offset, newHomeOffset); | ||
var isAnimationRequired = !isEqual(current.client.offset, newHomeOffset); | ||
@@ -174,3 +205,3 @@ if (isAnimationRequired) { | ||
// using redux-thunk | ||
export var lift = function lift(id, type, center, selection) { | ||
export var lift = function lift(id, type, client, page, windowScroll) { | ||
return function (dispatch, getState) { | ||
@@ -214,3 +245,3 @@ (function () { | ||
} | ||
dispatch(completeLift(id, type, center, selection)); | ||
dispatch(completeLift(id, type, client, page, windowScroll)); | ||
}); | ||
@@ -217,0 +248,0 @@ }); |
import memoizeOne from 'memoize-one'; | ||
import getDraggablesInsideDroppable from './get-draggables-inside-droppable'; | ||
var getIndex = memoizeOne(function (draggables, target) { | ||
@@ -9,10 +9,16 @@ return draggables.indexOf(target); | ||
export default (function (isMovingForward, draggableId, location, draggableDimensions, droppableDimensions) { | ||
var droppableDimension = droppableDimensions[location.droppableId]; | ||
var draggableDimension = draggableDimensions[draggableId]; | ||
export default (function (_ref) { | ||
var isMovingForward = _ref.isMovingForward, | ||
draggableId = _ref.draggableId, | ||
location = _ref.location, | ||
draggables = _ref.draggables, | ||
droppables = _ref.droppables; | ||
var droppable = droppables[location.droppableId]; | ||
var draggable = draggables[draggableId]; | ||
var currentIndex = location.index; | ||
var insideDroppable = getDraggablesInsideDroppable(droppableDimension, draggableDimensions); | ||
var insideDroppable = getDraggablesInsideDroppable(droppable, draggables); | ||
var startIndex = getIndex(insideDroppable, draggableDimension); | ||
var startIndex = getIndex(insideDroppable, draggable); | ||
@@ -40,3 +46,3 @@ if (startIndex === -1) { | ||
var amount = isMovingTowardStart ? atCurrentIndex.withMargin.height : atNextIndex.withMargin.height; | ||
var amount = isMovingTowardStart ? atCurrentIndex.page.withMargin.height : atNextIndex.page.withMargin.height; | ||
@@ -43,0 +49,0 @@ var diff = { |
@@ -7,8 +7,14 @@ | ||
// It is the responsiblity of this function to return | ||
// the impact of a drag | ||
// It is the responsibility of this function | ||
// to return the impact of a drag | ||
export default (function (newCenter, draggableId, draggableDimensions, droppableDimensions) { | ||
var droppableId = getDroppableOver(newCenter, droppableDimensions); | ||
export default (function (_ref) { | ||
var page = _ref.page, | ||
withinDroppable = _ref.withinDroppable, | ||
draggableId = _ref.draggableId, | ||
draggables = _ref.draggables, | ||
droppables = _ref.droppables; | ||
var droppableId = getDroppableOver(page, droppables); | ||
// not dragging over anything | ||
@@ -19,12 +25,12 @@ if (!droppableId) { | ||
var draggingDimension = draggableDimensions[draggableId]; | ||
var droppableDimension = droppableDimensions[droppableId]; | ||
var newCenter = withinDroppable.center; | ||
var draggingDimension = draggables[draggableId]; | ||
var droppableDimension = droppables[droppableId]; | ||
var isMovingForward = newCenter.y - draggingDimension.center.y > 0; | ||
var insideDroppable = getDraggablesInsideDroppable(droppableDimension, draggables); | ||
// TODO: if not in the same home dimensions then can only move forward | ||
// not considering margin so that items move based on visible edges | ||
var draggableCenter = draggingDimension.page.withoutMargin.center; | ||
var isMovingForward = newCenter.y - draggableCenter.y > 0; | ||
// get all draggables inside the draggable | ||
var insideDroppable = getDraggablesInsideDroppable(droppableDimension, draggableDimensions); | ||
var moved = insideDroppable.filter(function (dimension) { | ||
@@ -36,10 +42,12 @@ // do not want to move the item that is dragging | ||
var fragment = dimension.page.withoutMargin; | ||
if (isMovingForward) { | ||
// 1. item needs to start ahead of the moving item | ||
// 2. the dragging item has moved over it | ||
if (dimension.center.y < draggingDimension.center.y) { | ||
if (fragment.center.y < draggableCenter.y) { | ||
return false; | ||
} | ||
return newCenter.y > dimension.withMargin.top; | ||
return newCenter.y > fragment.top; | ||
} | ||
@@ -49,7 +57,7 @@ // moving backwards | ||
// 2. the dragging item has moved over it | ||
if (draggingDimension.center.y < dimension.center.y) { | ||
if (draggableCenter.y < fragment.center.y) { | ||
return false; | ||
} | ||
return newCenter.y < dimension.withMargin.bottom; | ||
return newCenter.y < fragment.bottom; | ||
}).map(function (dimension) { | ||
@@ -72,3 +80,6 @@ return dimension.id; | ||
var amount = index !== startIndex ? draggingDimension.withMargin.height : 0; | ||
var amount = index !== startIndex ? | ||
// need to ensure that the whole item is moved | ||
draggingDimension.page.withMargin.height : 0; | ||
var movement = { | ||
@@ -75,0 +86,0 @@ amount: amount, |
import _Object$keys from 'babel-runtime/core-js/object/keys'; | ||
import memoizeOne from 'memoize-one'; | ||
import isInsideDimension from './is-inside-dimension'; | ||
@@ -10,3 +9,3 @@ export default memoizeOne(function (droppableDimension, draggableDimensions) { | ||
}).filter(function (dimension) { | ||
return isInsideDimension(dimension.center, droppableDimension); | ||
return dimension.droppableId === droppableDimension.id; | ||
}) | ||
@@ -16,4 +15,4 @@ // Dimensions are not guarenteed to be ordered in the same order as keys | ||
.sort(function (a, b) { | ||
return a.center.y - b.center.y; | ||
return a.page.withoutMargin.center.y - b.page.withoutMargin.center.y; | ||
}); | ||
}); |
import _Object$keys from 'babel-runtime/core-js/object/keys'; | ||
import isInsideDimension from './is-inside-dimension'; | ||
import isInsideDroppable from './is-inside-droppable'; | ||
export default (function (target, droppableDimensions) { | ||
var maybeId = _Object$keys(droppableDimensions).find(function (key) { | ||
return isInsideDimension(target, droppableDimensions[key]); | ||
export default (function (target, droppables) { | ||
var maybeId = _Object$keys(droppables).find(function (key) { | ||
return isInsideDroppable(target, droppables[key]); | ||
}); | ||
@@ -10,0 +10,0 @@ |
@@ -5,5 +5,15 @@ import _defineProperty from 'babel-runtime/helpers/defineProperty'; | ||
import { add, subtract, negate } from './position'; | ||
import getDragImpact from './get-drag-impact'; | ||
import getDiffToJumpToNextIndex from './get-diff-to-jump-to-next-index'; | ||
import getDroppableOver from './get-droppable-over'; | ||
var noDimensions = { | ||
request: null, | ||
draggable: {}, | ||
droppable: {} | ||
}; | ||
var origin = { x: 0, y: 0 }; | ||
var clean = memoizeOne(function (phase) { | ||
@@ -15,7 +25,3 @@ var state = { | ||
drop: null, | ||
dimension: { | ||
request: null, | ||
draggable: {}, | ||
droppable: {} | ||
} | ||
dimension: noDimensions | ||
}; | ||
@@ -26,2 +32,85 @@ | ||
var move = function move(_ref) { | ||
var state = _ref.state, | ||
clientSelection = _ref.clientSelection, | ||
pageSelection = _ref.pageSelection, | ||
_ref$shouldAnimate = _ref.shouldAnimate, | ||
shouldAnimate = _ref$shouldAnimate === undefined ? false : _ref$shouldAnimate, | ||
windowScroll = _ref.windowScroll; | ||
if (state.phase !== 'DRAGGING') { | ||
console.error('cannot move while not dragging'); | ||
return clean(); | ||
} | ||
if (state.drag == null) { | ||
console.error('cannot move if there is no drag information'); | ||
return clean(); | ||
} | ||
var previous = state.drag.current; | ||
var initial = state.drag.initial; | ||
var droppable = state.dimension.droppable[initial.source.droppableId]; | ||
var client = function () { | ||
var offset = subtract(clientSelection, initial.client.selection); | ||
var center = add(offset, initial.client.center); | ||
var result = { | ||
selection: clientSelection, | ||
offset: offset, | ||
center: center | ||
}; | ||
return result; | ||
}(); | ||
var page = function () { | ||
var offset = subtract(pageSelection, initial.page.selection); | ||
var center = add(offset, initial.page.center); | ||
var result = { | ||
selection: pageSelection, | ||
offset: offset, | ||
center: center | ||
}; | ||
return result; | ||
}(); | ||
var scrollDiff = subtract(droppable.scroll.initial, droppable.scroll.current); | ||
var withinDroppable = { | ||
center: add(page.center, negate(scrollDiff)) | ||
}; | ||
var currentWindowScroll = windowScroll || previous.windowScroll; | ||
var current = { | ||
id: previous.id, | ||
type: previous.type, | ||
client: client, | ||
page: page, | ||
withinDroppable: withinDroppable, | ||
shouldAnimate: shouldAnimate, | ||
windowScroll: currentWindowScroll | ||
}; | ||
var impact = getDragImpact({ | ||
page: page.selection, | ||
withinDroppable: withinDroppable, | ||
draggableId: current.id, | ||
draggables: state.dimension.draggable, | ||
droppables: state.dimension.droppable | ||
}); | ||
var drag = { | ||
initial: initial, | ||
impact: impact, | ||
current: current | ||
}; | ||
return _extends({}, state, { | ||
drag: drag | ||
}); | ||
}; | ||
export default (function () { | ||
@@ -112,8 +201,20 @@ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : clean('IDLE'); | ||
type = _action$payload.type, | ||
center = _action$payload.center, | ||
selection = _action$payload.selection; | ||
client = _action$payload.client, | ||
page = _action$payload.page, | ||
_windowScroll = _action$payload.windowScroll; | ||
// no scroll diff yet so withinDroppable is just the center position | ||
var impact = getDragImpact(center, id, state.dimension.draggable, state.dimension.droppable); | ||
var withinDroppable = { | ||
center: page.center | ||
}; | ||
var impact = getDragImpact({ | ||
page: page.selection, | ||
withinDroppable: withinDroppable, | ||
draggableId: id, | ||
draggables: state.dimension.draggable, | ||
droppables: state.dimension.droppable | ||
}); | ||
var source = impact.destination; | ||
@@ -128,5 +229,6 @@ | ||
source: source, | ||
center: center, | ||
selection: selection, | ||
dimension: state.dimension.draggable[id] | ||
client: client, | ||
page: page, | ||
windowScroll: _windowScroll, | ||
withinDroppable: withinDroppable | ||
}; | ||
@@ -137,4 +239,14 @@ | ||
type: type, | ||
offset: { x: 0, y: 0 }, | ||
center: center, | ||
client: { | ||
selection: client.selection, | ||
center: client.center, | ||
offset: origin | ||
}, | ||
page: { | ||
selection: page.selection, | ||
center: page.center, | ||
offset: origin | ||
}, | ||
withinDroppable: withinDroppable, | ||
windowScroll: _windowScroll, | ||
shouldAnimate: false | ||
@@ -153,5 +265,5 @@ }; | ||
if (action.type === 'MOVE') { | ||
if (action.type === 'UPDATE_DROPPABLE_DIMENSION_SCROLL') { | ||
if (state.phase !== 'DRAGGING') { | ||
console.error('cannot move while not dragging', action); | ||
console.error('cannot update a droppable dimensions scroll when not dragging'); | ||
return clean(); | ||
@@ -161,3 +273,3 @@ } | ||
if (state.drag == null) { | ||
console.error('cannot move if there is no drag information'); | ||
console.error('invalid store state'); | ||
return clean(); | ||
@@ -167,28 +279,85 @@ } | ||
var _action$payload2 = action.payload, | ||
offset = _action$payload2.offset, | ||
_center = _action$payload2.center; | ||
_id = _action$payload2.id, | ||
offset = _action$payload2.offset; | ||
var previous = state.drag.current; | ||
var _initial = state.drag.initial; | ||
var _current = { | ||
id: previous.id, | ||
type: previous.type, | ||
center: _center, | ||
offset: offset, | ||
// not animating small movements | ||
shouldAnimate: false | ||
}; | ||
var target = state.dimension.droppable[_id]; | ||
var _impact = getDragImpact(_current.center, _current.id, state.dimension.draggable, state.dimension.droppable); | ||
if (!target) { | ||
console.error('cannot update a droppable that is not inside of the state', _id); | ||
return clean(); | ||
} | ||
var drag = { | ||
initial: _initial, impact: _impact, current: _current | ||
}; | ||
// TODO: do not break an existing dimension. | ||
// Rather, have a different structure to store the scroll | ||
// $ExpectError - flow does not like spread | ||
var _dimension2 = _extends({}, target, { | ||
scroll: { | ||
initial: target.scroll.initial, | ||
current: offset | ||
} | ||
}); | ||
return _extends({}, state, { | ||
drag: drag | ||
var withUpdatedDimension = _extends({}, state, { | ||
dimension: { | ||
request: state.dimension.request, | ||
draggable: state.dimension.draggable, | ||
droppable: _extends({}, state.dimension.droppable, _defineProperty({}, _id, _dimension2)) | ||
} | ||
}); | ||
var _state$drag$current = state.drag.current, | ||
_client = _state$drag$current.client, | ||
_page = _state$drag$current.page; | ||
return move({ | ||
state: withUpdatedDimension, | ||
clientSelection: _client.selection, | ||
pageSelection: _page.selection | ||
}); | ||
} | ||
if (action.type === 'MOVE') { | ||
var _action$payload3 = action.payload, | ||
_client2 = _action$payload3.client, | ||
_page2 = _action$payload3.page, | ||
_windowScroll2 = _action$payload3.windowScroll; | ||
return move({ | ||
state: state, | ||
clientSelection: _client2, | ||
pageSelection: _page2, | ||
windowScroll: _windowScroll2 | ||
}); | ||
} | ||
if (action.type === 'MOVE_BY_WINDOW_SCROLL') { | ||
var _windowScroll3 = action.payload.windowScroll; | ||
if (!state.drag) { | ||
console.error('cannot move with window scrolling if no current drag'); | ||
return clean(); | ||
} | ||
var _client3 = state.drag.current.client.selection; | ||
// diff between the previous scroll position and the initial | ||
var previousDiff = subtract(state.drag.current.windowScroll, state.drag.initial.windowScroll); | ||
// diff between the current scroll position and the initial | ||
var currentDiff = subtract(_windowScroll3, state.drag.initial.windowScroll); | ||
// diff required to move from previous diff to new diff | ||
var diff = subtract(currentDiff, previousDiff); | ||
// move the page coordinate by that amount | ||
var _page3 = add(state.drag.current.page.selection, diff); | ||
return move({ | ||
state: state, | ||
clientSelection: _client3, | ||
pageSelection: _page3, | ||
windowScroll: _windowScroll3 | ||
}); | ||
} | ||
if (action.type === 'MOVE_FORWARD' || action.type === 'MOVE_BACKWARD') { | ||
@@ -214,36 +383,32 @@ if (state.phase !== 'DRAGGING') { | ||
var diff = getDiffToJumpToNextIndex(isMovingForward, existing.current.id, existing.impact.destination, state.dimension.draggable, state.dimension.droppable); | ||
var _diff = getDiffToJumpToNextIndex({ | ||
isMovingForward: isMovingForward, | ||
draggableId: existing.current.id, | ||
location: existing.impact.destination, | ||
draggables: state.dimension.draggable, | ||
droppables: state.dimension.droppable | ||
}); | ||
// cannot move anyway (at the beginning or end of a list) | ||
if (!diff) { | ||
if (!_diff) { | ||
return state; | ||
} | ||
var _offset = { | ||
x: existing.current.offset.x + diff.x, | ||
y: existing.current.offset.y + diff.y | ||
}; | ||
var _page4 = add(existing.current.page.selection, _diff); | ||
var _client4 = add(existing.current.client.selection, _diff); | ||
var _center2 = { | ||
x: existing.current.center.x + diff.x, | ||
y: existing.current.center.y + diff.y | ||
}; | ||
// current limitation: cannot go beyond visible border of list | ||
var droppableId = getDroppableOver(_page4, state.dimension.droppable); | ||
var _current2 = { | ||
id: existing.current.id, | ||
type: existing.current.type, | ||
offset: _offset, | ||
center: _center2, | ||
// animating movement | ||
if (!droppableId) { | ||
// eslint-disable-next-line no-console | ||
console.info('currently not supporting moving a draggable outside the visibility bounds of a droppable'); | ||
return state; | ||
} | ||
return move({ | ||
state: state, | ||
clientSelection: _client4, | ||
pageSelection: _page4, | ||
shouldAnimate: true | ||
}; | ||
var _impact2 = getDragImpact(_current2.center, _current2.id, state.dimension.draggable, state.dimension.droppable); | ||
return _extends({}, state, { | ||
drag: { | ||
initial: existing.initial, | ||
current: _current2, | ||
impact: _impact2 | ||
} | ||
}); | ||
@@ -253,5 +418,5 @@ } | ||
if (action.type === 'DROP_ANIMATE') { | ||
var _action$payload3 = action.payload, | ||
newHomeOffset = _action$payload3.newHomeOffset, | ||
result = _action$payload3.result; | ||
var _action$payload4 = action.payload, | ||
newHomeOffset = _action$payload4.newHomeOffset, | ||
result = _action$payload4.result; | ||
@@ -282,7 +447,3 @@ | ||
}, | ||
dimension: { | ||
request: null, | ||
draggable: {}, | ||
droppable: {} | ||
} | ||
dimension: state.dimension | ||
}; | ||
@@ -301,7 +462,3 @@ } | ||
}, | ||
dimension: { | ||
request: null, | ||
draggable: {}, | ||
droppable: {} | ||
} | ||
dimension: noDimensions | ||
}; | ||
@@ -308,0 +465,0 @@ } |
@@ -6,3 +6,3 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
var base = { | ||
stiffness: 800, // fast | ||
stiffness: 1000, // fast | ||
// stiffness: 200, // medium | ||
@@ -12,3 +12,3 @@ // stiffness: 100, // slow | ||
// precision: 0.5, | ||
precision: 0.9 | ||
precision: 0.99 | ||
}; | ||
@@ -15,0 +15,0 @@ |
@@ -11,3 +11,3 @@ import _defineProperty from 'babel-runtime/helpers/defineProperty'; | ||
import storeKey from '../../state/get-store-key'; | ||
import { storeKey } from '../context-keys'; | ||
@@ -30,3 +30,4 @@ var DragDropContext = function (_Component) { | ||
// [Need to declare childContextTypes without flow](https://github.com/brigand/babel-plugin-flow-react-proptypes/issues/22) | ||
// Need to declare childContextTypes without flow | ||
// https://github.com/brigand/babel-plugin-flow-react-proptypes/issues/22 | ||
@@ -33,0 +34,0 @@ |
@@ -12,3 +12,2 @@ import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
import * as keyCodes from '../key-codes'; | ||
import getScrollPosition from '../get-scroll-position'; | ||
@@ -47,5 +46,8 @@ | ||
} | ||
}, _this.scheduleMove = rafScheduler(function (point) { | ||
}, _this.memoizedMove = memoizeOne(function (x, y) { | ||
var point = { x: x, y: y }; | ||
_this.props.callbacks.onMove(point); | ||
}), _this.scheduleMove = rafScheduler(function (point) { | ||
_this.ifDragging(function () { | ||
return _this.props.callbacks.onMove(point); | ||
return _this.memoizedMove(point.x, point.y); | ||
}); | ||
@@ -56,2 +58,4 @@ }), _this.scheduleMoveForward = rafScheduler(function () { | ||
_this.ifDragging(_this.props.callbacks.onMoveBackward); | ||
}), _this.scheduleWindowScrollMove = rafScheduler(function () { | ||
_this.ifDragging(_this.props.callbacks.onWindowScroll); | ||
}), _this.onWindowResize = function () { | ||
@@ -63,5 +67,28 @@ if (_this.state.pending) { | ||
if (!_this.state.draggingWith) { | ||
return; | ||
} | ||
_this.stopDragging(function () { | ||
return _this.props.callbacks.onCancel(); | ||
}); | ||
}, _this.onWindowScroll = function () { | ||
var draggingWith = _this.state.draggingWith; | ||
if (!draggingWith) { | ||
return; | ||
} | ||
if (draggingWith === 'MOUSE') { | ||
_this.scheduleWindowScrollMove(); | ||
return; | ||
} | ||
if (draggingWith === 'KEYBOARD') { | ||
// currently not supporting window scrolling with a keyboard | ||
_this.stopDragging(function () { | ||
return _this.props.callbacks.onCancel(); | ||
}); | ||
} | ||
}, _this.onWindowMouseMove = function (event) { | ||
@@ -86,7 +113,5 @@ var _this$state = _this.state, | ||
// Ideally would just use event.pageX - but playing it safe | ||
var scroll = getScrollPosition(); | ||
var point = { | ||
x: clientX + scroll.x, | ||
y: clientY + scroll.y | ||
x: clientX, | ||
y: clientY | ||
}; | ||
@@ -131,6 +156,4 @@ | ||
}, _this.onWindowMouseDown = function () { | ||
if (_this.state.draggingWith === 'MOUSE') { | ||
console.error('Should not be able to trigger a mousedown while a MOUSE drag\n is occurring. Expecting a mouseup first.'); | ||
} | ||
// this can happen during a drag when the user clicks a button | ||
// other than the primary mouse button | ||
_this.stopDragging(function () { | ||
@@ -160,7 +183,5 @@ return _this.props.callbacks.onCancel(); | ||
// Ideally would just use event.pageX - but playing it safe | ||
var scroll = getScrollPosition(); | ||
var point = { | ||
x: clientX + scroll.x, | ||
y: clientY + scroll.y | ||
x: clientX, | ||
y: clientY | ||
}; | ||
@@ -329,2 +350,5 @@ | ||
}, _this.unbindWindowEvents = function () { | ||
// using a map to ensure that everything that is added | ||
// is always removed. It is easy to add a listener and | ||
// to forget about removing it. | ||
window.removeEventListener('mousemove', _this.onWindowMouseMove); | ||
@@ -335,2 +359,3 @@ window.removeEventListener('mouseup', _this.onWindowMouseUp); | ||
window.removeEventListener('resize', _this.onWindowResize); | ||
window.removeEventListener('scroll', _this.onWindowScroll); | ||
}, _this.bindWindowEvents = function () { | ||
@@ -342,2 +367,3 @@ window.addEventListener('mousemove', _this.onWindowMouseMove); | ||
window.addEventListener('resize', _this.onWindowResize); | ||
window.addEventListener('scroll', _this.onWindowScroll, { passive: true }); | ||
}, _this.getProvided = memoizeOne(function (isEnabled, isDragging) { | ||
@@ -362,6 +388,12 @@ if (!isEnabled) { | ||
} | ||
/* eslint-disable react/sort-comp */ | ||
// There is a case where if this is fired between | ||
// two different drags with the same x,y then the second | ||
// drag will not fire a move. This will only effect the | ||
// first frame. It was decided that this is better than | ||
// needing to clear the memoization cache between drags | ||
// given that it is a huge edge case. | ||
// scheduled functions | ||
@@ -384,2 +416,3 @@ | ||
// TODO: unbind handlers if drag is cancelled some somewhere else in application | ||
if (nextProps.isEnabled) { | ||
@@ -432,2 +465,3 @@ return; | ||
onMove: _PropTypes.func.isRequired, | ||
onWindowScroll: _PropTypes.func.isRequired, | ||
onMoveForward: _PropTypes.func.isRequired, | ||
@@ -434,0 +468,0 @@ onMoveBackward: _PropTypes.func.isRequired, |
@@ -6,13 +6,15 @@ import memoizeOne from 'memoize-one'; | ||
import Draggable from './draggable'; | ||
import storeKey from '../../state/get-store-key'; | ||
import { lift as liftAction, move as moveAction, moveForward as moveForwardAction, moveBackward as moveBackwardAction, drop as dropAction, cancel as cancelAction, dropAnimationFinished as dropAnimationFinishedAction } from '../../state/action-creators'; | ||
import { storeKey } from '../context-keys'; | ||
import { lift as liftAction, move as moveAction, moveForward as moveForwardAction, moveBackward as moveBackwardAction, drop as dropAction, cancel as cancelAction, dropAnimationFinished as dropAnimationFinishedAction, moveByWindowScroll as moveByWindowScrollAction } from '../../state/action-creators'; | ||
var origin = { x: 0, y: 0 }; | ||
var defaultMapProps = { | ||
isDropAnimating: false, | ||
isDragging: false, | ||
isAnotherDragging: false, | ||
canAnimate: true, | ||
offset: origin, | ||
initial: null | ||
dimension: null | ||
}; | ||
@@ -31,3 +33,3 @@ | ||
var getWithMovement = memoizeOne(function (offset) { | ||
var getWithMovement = memoizeOne(function (offset, isAnotherDragging) { | ||
return { | ||
@@ -37,12 +39,13 @@ isDropAnimating: false, | ||
canAnimate: true, | ||
isAnotherDragging: isAnotherDragging, | ||
offset: offset, | ||
initial: null | ||
dimension: null | ||
}; | ||
}); | ||
var getNotDraggingProps = memoizeOne(function (draggableId, movement) { | ||
var getNotDraggingProps = memoizeOne(function (draggableId, movement, isAnotherDragging) { | ||
var needsToMove = movement.draggables.indexOf(draggableId) !== -1; | ||
if (!needsToMove) { | ||
return defaultMapProps; | ||
return getWithMovement(origin, isAnotherDragging); | ||
} | ||
@@ -54,6 +57,20 @@ | ||
// currently not handling horizontal movement | ||
memoizedOffset(0, amount)); | ||
memoizedOffset(0, amount), isAnotherDragging); | ||
}); | ||
return createSelector([phaseSelector, dragSelector, pendingDropSelector, idSelector], function (phase, drag, pending, id) { | ||
var draggableSelector = function draggableSelector(state, ownProps) { | ||
if (!state.dimension) { | ||
return null; | ||
} | ||
var dimension = state.dimension.draggable[ownProps.draggableId]; | ||
// dimension might not be published yet | ||
if (!dimension) { | ||
return null; | ||
} | ||
return dimension; | ||
}; | ||
return createSelector([idSelector, phaseSelector, dragSelector, pendingDropSelector, draggableSelector], function (id, phase, drag, pending, dimension) { | ||
if (phase === 'DRAGGING') { | ||
@@ -66,3 +83,2 @@ if (!drag) { | ||
var current = drag.current, | ||
initial = drag.initial, | ||
impact = drag.impact; | ||
@@ -72,7 +88,9 @@ | ||
if (current.id !== id) { | ||
return getNotDraggingProps(id, impact.movement); | ||
return getNotDraggingProps(id, impact.movement, | ||
// blocking pointer events while something else is dragging | ||
true); | ||
} | ||
// this item is dragging | ||
var offset = current.offset; | ||
var offset = current.client.offset; | ||
var canAnimate = current.shouldAnimate; | ||
@@ -83,6 +101,7 @@ | ||
isDragging: true, | ||
isAnotherDragging: false, | ||
isDropAnimating: false, | ||
canAnimate: canAnimate, | ||
offset: offset, | ||
initial: initial | ||
dimension: dimension | ||
}; | ||
@@ -98,14 +117,16 @@ } | ||
if (pending.last.current.id !== id) { | ||
return getNotDraggingProps(id, pending.last.impact.movement); | ||
return getNotDraggingProps(id, pending.last.impact.movement, | ||
// We are indicating that nothing else is dragging while a drop is | ||
// occurring | ||
false); | ||
} | ||
return { | ||
// Tell the consumer that the drag is still | ||
// occurring with props to keep the isDragging appearance | ||
// while dropping. | ||
isDragging: true, | ||
isDragging: false, | ||
isDropAnimating: true, | ||
isAnotherDragging: false, | ||
canAnimate: true, | ||
offset: pending.newHomeOffset, | ||
initial: pending.last.initial | ||
// still need to provide the dimension for the placeholder | ||
dimension: dimension | ||
}; | ||
@@ -118,7 +139,8 @@ } | ||
return { | ||
offset: origin, | ||
isDropAnimating: false, | ||
isAnotherDragging: false, | ||
isDragging: false, | ||
canAnimate: false, | ||
initial: null | ||
offset: origin, | ||
dimension: null | ||
}; | ||
@@ -144,2 +166,3 @@ } | ||
moveForward: moveForwardAction, | ||
moveByWindowScroll: moveByWindowScrollAction, | ||
drop: dropAction, | ||
@@ -146,0 +169,0 @@ dropAnimationFinished: dropAnimationFinishedAction, |
/* eslint-disable import/no-extraneous-dependencies*/ | ||
// $ExpectError - not added to project deps | ||
import { lift, move, moveForward, moveBackward, drop, cancel, dropAnimationFinished } from '../../state/action-creators'; | ||
import { lift, move, moveByWindowScroll, moveForward, moveBackward, drop, cancel, dropAnimationFinished } from '../../state/action-creators'; | ||
/* eslint-enable */ | ||
@@ -6,0 +6,0 @@ |
@@ -0,1 +1,2 @@ | ||
import _defineProperty from 'babel-runtime/helpers/defineProperty'; | ||
import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
@@ -5,10 +6,11 @@ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn'; | ||
import _PropTypes from 'prop-types'; | ||
import React, { Component } from 'react'; | ||
import React, { Component, PropTypes } from 'react'; | ||
import memoizeOne from 'memoize-one'; | ||
import invariant from 'invariant'; | ||
import { DraggableDimensionPublisher } from '../dimension-publisher/'; | ||
import DraggableDimensionPublisher from '../draggable-dimension-publisher/'; | ||
import Moveable from '../moveable/'; | ||
import DragHandle from '../drag-handle'; | ||
import { css } from '../animation'; | ||
import getWindowScrollPosition from '../get-window-scroll-position'; | ||
// eslint-disable-next-line no-duplicate-imports | ||
@@ -18,2 +20,4 @@ | ||
import Placeholder from './placeholder'; | ||
import { droppableIdKey } from '../context-keys'; | ||
import { add } from '../../state/position'; | ||
@@ -31,3 +35,2 @@ | ||
/* eslint-disable react/sort-comp */ | ||
function Draggable(props, context) { | ||
@@ -50,3 +53,3 @@ _classCallCheck(this, Draggable); | ||
_this.onLift = function (selection) { | ||
_this.onLift = function (point) { | ||
_this.throwIfCannotDrag(); | ||
@@ -57,7 +60,18 @@ var _this$props = _this.props, | ||
type = _this$props.type; | ||
var ref = _this.state.ref; | ||
var center = getCenterPosition(_this.state.ref); | ||
var windowScroll = getWindowScrollPosition(); | ||
lift(draggableId, type, center, selection); | ||
var client = { | ||
selection: point, | ||
center: getCenterPosition(ref) | ||
}; | ||
var page = { | ||
selection: add(client.selection, windowScroll), | ||
center: add(client.center, windowScroll) | ||
}; | ||
lift(draggableId, type, client, page, windowScroll); | ||
}; | ||
@@ -71,11 +85,23 @@ | ||
type = _this$props2.type; | ||
var ref = _this.state.ref; | ||
// using center position as selection | ||
var center = getCenterPosition(_this.state.ref); | ||
var center = getCenterPosition(ref); | ||
// using center position as selection | ||
lift(draggableId, type, center, center); | ||
var client = { | ||
selection: center, | ||
center: center | ||
}; | ||
var windowScroll = getWindowScrollPosition(); | ||
var page = { | ||
selection: add(center, windowScroll), | ||
center: add(center, windowScroll) | ||
}; | ||
lift(draggableId, type, client, page, windowScroll); | ||
}; | ||
_this.onMove = function (point) { | ||
_this.onMove = function (client) { | ||
_this.throwIfCannotDrag(); | ||
@@ -85,3 +111,3 @@ | ||
draggableId = _this$props3.draggableId, | ||
initial = _this$props3.initial, | ||
dimension = _this$props3.dimension, | ||
move = _this$props3.move; | ||
@@ -91,16 +117,10 @@ | ||
if (!initial) { | ||
if (!dimension) { | ||
return; | ||
} | ||
var offset = { | ||
x: point.x - initial.selection.x, | ||
y: point.y - initial.selection.y | ||
}; | ||
var center = { | ||
x: initial.center.x + offset.x, | ||
y: initial.center.y + offset.y | ||
}; | ||
var windowScroll = getWindowScrollPosition(); | ||
var page = add(client, windowScroll); | ||
move(draggableId, offset, center); | ||
move(draggableId, client, page, windowScroll); | ||
}; | ||
@@ -118,2 +138,8 @@ | ||
_this.onWindowScroll = function () { | ||
_this.throwIfCannotDrag(); | ||
var windowScroll = getWindowScrollPosition(); | ||
_this.props.moveByWindowScroll(_this.props.draggableId, windowScroll); | ||
}; | ||
_this.onDrop = function () { | ||
@@ -146,32 +172,40 @@ _this.throwIfCannotDrag(); | ||
_this.getDraggingStyle = memoizeOne(function (width, height, isDropAnimating, movementStyle) { | ||
_this.getDraggingStyle = memoizeOne(function (width, height, top, left, isDropAnimating, movementStyle) { | ||
var style = { | ||
position: 'absolute', | ||
position: 'fixed', | ||
boxSizing: 'border-box', | ||
pointerEvents: 'none', | ||
zIndex: isDropAnimating ? zIndexOptions.dropAnimating : zIndexOptions.dragging, | ||
width: width, | ||
height: height, | ||
transform: movementStyle.transform | ||
top: top, | ||
left: left, | ||
transform: movementStyle.transform ? '' + movementStyle.transform : null | ||
}; | ||
return style; | ||
}); | ||
_this.getNotDraggingStyle = memoizeOne(function (canAnimate, movementStyle) { | ||
_this.getNotDraggingStyle = memoizeOne(function (canAnimate, movementStyle, isAnotherDragging) { | ||
var style = { | ||
transition: canAnimate ? css.outOfTheWay : null, | ||
transform: movementStyle.transform | ||
transform: movementStyle.transform, | ||
pointerEvents: isAnotherDragging ? 'none' : 'auto' | ||
}; | ||
return style; | ||
}); | ||
_this.getProvided = memoizeOne(function (isDragging, isDropAnimating, canAnimate, initial, dragHandleProps, movementStyle) { | ||
_this.getProvided = memoizeOne(function (isDragging, isDropAnimating, isAnotherDragging, canAnimate, dimension, dragHandleProps, movementStyle) { | ||
var useDraggingStyle = isDragging || isDropAnimating; | ||
var draggableStyle = function () { | ||
if (!isDragging) { | ||
return _this.getNotDraggingStyle(canAnimate, movementStyle); | ||
if (!useDraggingStyle) { | ||
return _this.getNotDraggingStyle(canAnimate, movementStyle, isAnotherDragging); | ||
} | ||
invariant(initial, 'initial dimension required for dragging'); | ||
invariant(dimension, 'draggable dimension required for dragging'); | ||
var _initial$dimension$wi = initial.dimension.withoutMargin, | ||
width = _initial$dimension$wi.width, | ||
height = _initial$dimension$wi.height; | ||
var _dimension$client$wit = dimension.client.withoutMargin, | ||
width = _dimension$client$wit.width, | ||
height = _dimension$client$wit.height, | ||
top = _dimension$client$wit.top, | ||
left = _dimension$client$wit.left; | ||
return _this.getDraggingStyle(width, height, isDropAnimating, movementStyle); | ||
return _this.getDraggingStyle(width, height, top, left, isDropAnimating, movementStyle); | ||
}(); | ||
@@ -181,3 +215,3 @@ | ||
innerRef: _this.setRef, | ||
placeholder: isDragging || isDropAnimating ? _this.getPlaceholder() : null, | ||
placeholder: useDraggingStyle ? _this.getPlaceholder() : null, | ||
dragHandleProps: dragHandleProps, | ||
@@ -188,5 +222,5 @@ draggableStyle: draggableStyle | ||
}); | ||
_this.getSnapshot = memoizeOne(function (isDragging) { | ||
_this.getSnapshot = memoizeOne(function (isDragging, isDropAnimating) { | ||
return { | ||
isDragging: isDragging | ||
isDragging: isDragging || isDropAnimating | ||
}; | ||
@@ -221,3 +255,4 @@ }); | ||
onMoveBackward: _this.onMoveBackward, | ||
onMoveForward: _this.onMoveForward | ||
onMoveForward: _this.onMoveForward, | ||
onWindowScroll: _this.onWindowScroll | ||
}; | ||
@@ -231,2 +266,8 @@ return _this; | ||
// Need to declare contextTypes without flow | ||
// https://github.com/brigand/babel-plugin-flow-react-proptypes/issues/22 | ||
/* eslint-disable react/sort-comp */ | ||
Draggable.prototype.throwIfCannotDrag = function throwIfCannotDrag() { | ||
@@ -242,8 +283,8 @@ invariant(this.state.ref, 'Draggable: cannot drag as no DOM node has been provided'); | ||
Draggable.prototype.getPlaceholder = function getPlaceholder() { | ||
invariant(this.props.initial, 'cannot get a drag placeholder when not dragging'); | ||
var dimension = this.props.initial.dimension; | ||
var dimension = this.props.dimension; | ||
invariant(dimension, 'cannot get a drag placeholder when not dragging'); | ||
return React.createElement(Placeholder, { | ||
height: dimension.withMargin.height, | ||
width: dimension.withMargin.width | ||
height: dimension.page.withMargin.height, | ||
width: dimension.page.withMargin.width | ||
}); | ||
@@ -261,5 +302,6 @@ }; | ||
isDropAnimating = _props.isDropAnimating, | ||
isAnotherDragging = _props.isAnotherDragging, | ||
canAnimate = _props.canAnimate, | ||
isDragDisabled = _props.isDragDisabled, | ||
initial = _props.initial, | ||
dimension = _props.dimension, | ||
children = _props.children; | ||
@@ -273,3 +315,4 @@ | ||
{ | ||
itemId: draggableId, | ||
draggableId: draggableId, | ||
droppableId: this.context[droppableIdKey], | ||
type: type, | ||
@@ -294,3 +337,3 @@ targetRef: this.state.ref | ||
function (dragHandleProps) { | ||
return children(_this2.getProvided(isDragging, isDropAnimating, canAnimate, initial, dragHandleProps, movementStyle), _this2.getSnapshot(isDragging)); | ||
return children(_this2.getProvided(isDragging, isDropAnimating, isAnotherDragging, canAnimate, dimension, dragHandleProps, movementStyle), _this2.getSnapshot(isDragging, isDropAnimating)); | ||
} | ||
@@ -309,2 +352,3 @@ ); | ||
isDropAnimating: _PropTypes.bool.isRequired, | ||
isAnotherDragging: _PropTypes.bool.isRequired, | ||
canAnimate: _PropTypes.bool.isRequired, | ||
@@ -315,36 +359,55 @@ offset: _PropTypes.shape({ | ||
}).isRequired, | ||
initial: _PropTypes.shape({ | ||
source: _PropTypes.shape({ | ||
droppableId: _PropTypes.string.isRequired, | ||
index: _PropTypes.number.isRequired | ||
}).isRequired, | ||
center: _PropTypes.shape({ | ||
x: _PropTypes.number.isRequired, | ||
y: _PropTypes.number.isRequired | ||
}).isRequired, | ||
selection: _PropTypes.shape({ | ||
x: _PropTypes.number.isRequired, | ||
y: _PropTypes.number.isRequired | ||
}).isRequired, | ||
dimension: _PropTypes.shape({ | ||
id: _PropTypes.string.isRequired, | ||
dimension: _PropTypes.shape({ | ||
id: _PropTypes.string.isRequired, | ||
droppableId: _PropTypes.string.isRequired, | ||
page: _PropTypes.shape({ | ||
withMargin: _PropTypes.shape({ | ||
top: _PropTypes.number.isRequired, | ||
left: _PropTypes.number.isRequired, | ||
bottom: _PropTypes.number.isRequired, | ||
right: _PropTypes.number.isRequired, | ||
width: _PropTypes.number.isRequired, | ||
height: _PropTypes.number.isRequired, | ||
center: _PropTypes.shape({ | ||
x: _PropTypes.number.isRequired, | ||
y: _PropTypes.number.isRequired | ||
}).isRequired | ||
}).isRequired, | ||
withoutMargin: _PropTypes.shape({ | ||
top: _PropTypes.number.isRequired, | ||
left: _PropTypes.number.isRequired, | ||
bottom: _PropTypes.number.isRequired, | ||
right: _PropTypes.number.isRequired, | ||
width: _PropTypes.number.isRequired, | ||
height: _PropTypes.number.isRequired, | ||
center: _PropTypes.shape({ | ||
x: _PropTypes.number.isRequired, | ||
y: _PropTypes.number.isRequired | ||
}).isRequired | ||
}).isRequired | ||
}).isRequired, | ||
client: _PropTypes.shape({ | ||
withMargin: _PropTypes.shape({ | ||
top: _PropTypes.number.isRequired, | ||
left: _PropTypes.number.isRequired, | ||
bottom: _PropTypes.number.isRequired, | ||
right: _PropTypes.number.isRequired, | ||
width: _PropTypes.number.isRequired, | ||
height: _PropTypes.number.isRequired | ||
height: _PropTypes.number.isRequired, | ||
center: _PropTypes.shape({ | ||
x: _PropTypes.number.isRequired, | ||
y: _PropTypes.number.isRequired | ||
}).isRequired | ||
}).isRequired, | ||
withoutMargin: _PropTypes.shape({ | ||
top: _PropTypes.number.isRequired, | ||
left: _PropTypes.number.isRequired, | ||
bottom: _PropTypes.number.isRequired, | ||
right: _PropTypes.number.isRequired, | ||
bottom: _PropTypes.number.isRequired, | ||
left: _PropTypes.number.isRequired, | ||
width: _PropTypes.number.isRequired, | ||
height: _PropTypes.number.isRequired | ||
}).isRequired, | ||
center: _PropTypes.shape({ | ||
x: _PropTypes.number.isRequired, | ||
y: _PropTypes.number.isRequired | ||
height: _PropTypes.number.isRequired, | ||
center: _PropTypes.shape({ | ||
x: _PropTypes.number.isRequired, | ||
y: _PropTypes.number.isRequired | ||
}).isRequired | ||
}).isRequired | ||
@@ -355,2 +418,3 @@ }).isRequired | ||
move: _PropTypes.func.isRequired, | ||
moveByWindowScroll: _PropTypes.func.isRequired, | ||
moveForward: _PropTypes.func.isRequired, | ||
@@ -370,2 +434,3 @@ moveBackward: _PropTypes.func.isRequired, | ||
}; | ||
Draggable.contextTypes = _defineProperty({}, droppableIdKey, PropTypes.string.isRequired); | ||
export default Draggable; |
import { connect } from 'react-redux'; | ||
import { createSelector } from 'reselect'; | ||
import memoizeOne from 'memoize-one'; | ||
import storeKey from '../../state/get-store-key'; | ||
import { storeKey } from '../context-keys'; | ||
import { dragSelector, pendingDropSelector, phaseSelector } from '../../state/selectors'; | ||
@@ -6,0 +6,0 @@ import Droppable from './droppable'; |
@@ -0,1 +1,2 @@ | ||
import _defineProperty from 'babel-runtime/helpers/defineProperty'; | ||
import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
@@ -5,5 +6,6 @@ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn'; | ||
import _PropTypes from 'prop-types'; | ||
import React, { Component } from 'react'; | ||
import React, { Component, PropTypes } from 'react'; | ||
import { DroppableDimensionPublisher } from '../dimension-publisher/'; | ||
import DroppableDimensionPublisher from '../droppable-dimension-publisher/'; | ||
import { droppableIdKey } from '../context-keys'; | ||
@@ -42,2 +44,11 @@ var Droppable = function (_Component) { | ||
// Need to declare childContextTypes without flow | ||
// https://github.com/brigand/babel-plugin-flow-react-proptypes/issues/22 | ||
Droppable.prototype.getChildContext = function getChildContext() { | ||
var value = _defineProperty({}, droppableIdKey, this.props.droppableId); | ||
return value; | ||
}; | ||
/* eslint-enable */ | ||
@@ -60,3 +71,3 @@ | ||
{ | ||
itemId: this.props.droppableId, | ||
droppableId: this.props.droppableId, | ||
type: this.props.type, | ||
@@ -83,2 +94,3 @@ targetRef: this.state.ref | ||
}; | ||
Droppable.childContextTypes = _defineProperty({}, droppableIdKey, PropTypes.string.isRequired); | ||
export default Droppable; |
@@ -1,2 +0,1 @@ | ||
import getScrollPosition from './get-scroll-position'; | ||
@@ -11,5 +10,4 @@ | ||
var scroll = getScrollPosition(); | ||
var centerX = (left + scroll.x + (right + scroll.x)) / 2; | ||
var centerY = (top + scroll.y + (bottom + scroll.y)) / 2; | ||
var centerX = (left + right) / 2; | ||
var centerY = (top + bottom) / 2; | ||
@@ -16,0 +14,0 @@ return { |
{ | ||
"name": "@atlaskit/drag-and-drop", | ||
"version": "4.4.2", | ||
"version": "4.5.0", | ||
"config": { | ||
@@ -34,4 +34,3 @@ "access": "public" | ||
"devDependencies": { | ||
"styled-components": "2.1.0", | ||
"eslint-plugin-chai-expect": "^1.1.1" | ||
"styled-components": "2.1.0" | ||
}, | ||
@@ -38,0 +37,0 @@ "peerDependencies": { |
@@ -10,3 +10,3 @@ [](http://atlaskit.atlassian.com) | ||
The goal of this library is to create a beautiful drag and drop experience for lists. It provides highly performant physics based mouse and keyboard dragging without creating any wrapping DOM nodes. | ||
The goal of this library is to create a beautiful drag and drop experience for lists. It provides highly performant, physics based, mouse and keyboard dragging - without creating any wrapping DOM nodes. | ||
@@ -148,5 +148,5 @@ ## `DragDropContext` | ||
**Dynamic hooks** | ||
Your *hook* functions will only be captured *once at start up*. Please do not change the function after that. If there is a valid use case for this then dynamic hooks could be supported. However, at this time it is not. | ||
## `Droppable` | ||
@@ -244,2 +244,19 @@ | ||
### Scroll containers | ||
This library supports dragging within scroll containers (DOM elements that have `overflow: auto;` or `overflow: scroll;`). The **only** supported use cases are: | ||
1. The `Droppable` can itself be a scroll container with **no scrollable parents** | ||
2. The `Droppable` has **one scrollable parent** | ||
**Auto scrolling is not provided** | ||
Currently auto scrolling of scroll containers is not part of this library. Auto scrolling is where the container automatically scrolls to make room for the dragging item as you drag near the edge of a scroll container. You are welcome to build your own auto scrolling list, or if you would you really like it as part of this library we could provide a auto scrolling `Droppable`. | ||
Users will be able to scroll a scroll container while dragging by using their trackpad or mouse wheel. | ||
**Keyboard dragging limitation** | ||
Getting keyboard dragging to work with scroll containers is quite difficult. Currently there is a limitation: you cannot drag with a keyboard beyond the visible edge of a scroll container. This limitation could be removed if we introduced auto scrolling. | ||
## `Draggable` | ||
@@ -330,8 +347,6 @@ | ||
**Be careful with position:absolute** | ||
**Ownership** | ||
*LTDR*: do not apply any `top`, `left`, `bottom`, `right` styles to the dragging element. | ||
It is a contract of this library that it own the positioning logic of the dragging element. This includes properties such as `top`, `right`, `bottom`, `left` and `transform`. The library may change how it positions things and what properties it uses without performing a major version bump. It is also recommended that you do not apply your own `transition` property to the dragging element. | ||
One of the styles of `provided.draggableStyle` is `position:absolute`. This intended position of the element is the original position. No `top`, `left`, `bottom`, `right` values are applied to enable this. Be careful that you are not applying one of these styles (`top`, `left`, `bottom`, `right`) to the element or its positioning will be broken. This is especially true if one of your parents has `position:relative` on it. | ||
```js | ||
@@ -381,18 +396,23 @@ <Draggable draggableId="draggable-1"> | ||
export type DraggingStyle = {| | ||
position: 'absolute', | ||
type DraggingStyle = {| | ||
position: 'fixed', | ||
boxSizing: 'border-box', | ||
// allow scrolling of the element behind the dragging element | ||
pointerEvents: 'none', | ||
zIndex: ZIndex, | ||
width: number, | ||
height: number, | ||
top: number, | ||
left: number, | ||
transform: ?string, | ||
|} | ||
export type NotDraggingStyle = {| | ||
type NotDraggingStyle = {| | ||
transition: ?string, | ||
transform: ?string, | ||
pointerEvents: 'none' | 'auto', | ||
|} | ||
``` | ||
- `provided.placeholder (?ReactElement)` The `Draggable` element has `position:absolute` applied to it while it is dragging. The role of the `placeholder` is to sit in the place that the `Draggable` was during a drag. It is needed to stop the `Droppable` list from collapsing when you drag. It is advised to render it as a sibling to the `Draggable` node. | ||
- `provided.placeholder (?ReactElement)` The `Draggable` element has `position:fixed` applied to it while it is dragging. The role of the `placeholder` is to sit in the place that the `Draggable` was during a drag. It is needed to stop the `Droppable` list from collapsing when you drag. It is advised to render it as a sibling to the `Draggable` node. | ||
@@ -575,6 +595,8 @@ ```js | ||
## Keyboard handling | ||
## Keyboard | ||
Currently the keyboard handling is hard coded. This could be changed in the future to become a prop of `Draggable`. Here is the existing keyboard mapping: | ||
**Shortcuts** | ||
Currently the keyboard handling is hard coded. This could be changed in the future to become customisable. Here is the existing keyboard mapping: | ||
- **tab `↹`** - standard browser tabbing will navigate through the `Droppable`'s. The library does not do anything fancy with `tab` while users are selecting. Once a drag has started, `tab` is blocked for the duration of the drag. | ||
@@ -586,5 +608,13 @@ - **spacebar ` `** - lift a focused `Draggable`. Also, drop a dragging `Draggable` where the drag was started with a `spacebar`. | ||
**Limitations of keyboard dragging** | ||
There is a currently limitation of keyboard dragging: **the drag will cancel if the user scrolls the window**. This could be worked around but for now it is the simpliest initial approach. | ||
### Currently supported feature set | ||
- dragging an item within a single vertical list | ||
- the vertical list can be a scroll container (without a scrollable parent) or be the child of a scroll container (that also does not have a scrollable parent) | ||
### Short term backlog | ||
- Correct scroll handling while dragging with keyboard or mouse | ||
- Moving items between vertical lists (until this lands conditional dropping will not be available) | ||
@@ -606,6 +636,10 @@ | ||
## Author | ||
## Author / maintainer | ||
Alex Reardon - areardon@atlassian.com | ||
### Contributing | ||
Please do not submit a pull request without first raising an issue to discuss your proposed change. | ||
_* Please note that this module could have dependencies that are governed by the Atlassian Design Guidelines license which will be automatically included on install. Each dependency has a license file that indicates whether the Atlassian Design Guidelines license applies._ | ||
@@ -612,0 +646,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
459521
1
57
7337
645